UNPKG

@sendbird/chat

Version:
2 lines (1 loc) 23.8 kB
import{c as n,A as t,bt as r,e as s,f as i,g as a,a as o,a1 as u,j as c,bA as l,a4 as d,bs as m,u as p,_ as v,b as _,V as I,aa as U,aq as y,aW as k,t as b,b7 as A,F as w}from"./lib/__bundle-dec0ace5.js";export{bB as AIAgentInfo}from"./lib/__bundle-dec0ace5.js";import{C as F,b as T,c as P,d as S,e as M}from"./lib/__bundle-6505d693.js";export{C as Conversation,j as ConversationChannelInfo,g as ConversationHandoff,h as ConversationResolution,e as ConversationStatus,f as ConversationType,H as HelpdeskInfo}from"./lib/__bundle-6505d693.js";import"./lib/__bundle-94d0f78f.js";import"./lib/__bundle-59cfe6e6.js";import"./lib/__bundle-734795ff.js";import"./lib/__bundle-acd77193.js";var E,q,R=function(e){function i(n){var i=n.aiAgentId,a=n.userId,o=n.language,u=n.country,c=n.context,l=n.forceCreateChannel,h=n.knownActiveChannelUrl,d=e.call(this)||this;return d.method=t.POST,d.path="".concat(r,"/ai_agents/").concat(encodeURIComponent(i),"/messenger_settings"),d.requireAuth=!1,d.params=s({user_id:a,country:u,language:o,context:c,force_create:l,known_active_channel_url:h}),d}return n(i,e),i}(i),L=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.settings=t,r}return n(t,e),t}(a),D=function(e){function i(n){var i=this,a=n.token,o=n.limit,u=n.aiAgentId,c=n.status,l=n.reverse,h=n.order;return(i=e.call(this)||this).method=t.GET,i.path="".concat(r,"/my_conversations"),i.params=s({token:a,limit:o,reverse:l,order:h,status:c,bot_userid:u}),i}return n(i,e),i}(i),O=function(e){function t(n,t){var r=e.call(this,n,t)||this;r.conversations=[];var s=t.next_token,i=t.conversations;return r.token=s,i&&i.length>0&&(r.conversations=i.map((function(e){return new F(e)}))),r}return n(t,e),t}(a),Q={limit:10},x=function(e){function i(n){var i=this,a=n.limit,o=void 0===a?Q.limit:a,u=n.keys,c=n.token;return(i=e.call(this)||this).method=t.GET,i.path="".concat(r,"/sdk_message_templates"),i.params=s({limit:o,keys:u,token:c}),i}return n(i,e),i}(i),N=function(e){function t(n,t){var r=e.call(this,n,t)||this,s=t.templates,i=t.template_list_token;return r.token=i,r.templates=s.map((function(e){return{template:JSON.stringify(e)}})),r}return n(t,e),t}(a),G=function(e){function s(n){var s=this,i=n.key;return(s=e.call(this)||this).method=t.GET,s.path="".concat(r,"/sdk_message_templates/").concat(i),s}return n(s,e),s}(i),K=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.template=JSON.stringify(t),r}return n(t,e),t}(a);!function(e){e.INCLUDE="include",e.EXCLUDE="exclude"}(E||(E={})),function(e){e.INCLUDE="include",e.EXCLUDE="exclude"}(q||(q={}));var B,X={aiAgentChannelFilter:E.INCLUDE,aiAgentIds:[],deskChannelFilter:q.INCLUDE,pinnedChannelUrls:[]},z=function(e){function r(n){var r=e.call(this)||this,i=c(c({},X),n),a=i.aiAgentChannelFilter,o=i.aiAgentIds,u=i.deskChannelFilter,h=i.aiAgentConversationStatusFilter,d=i.pinnedChannelUrls,g=i.copilotConversationOnly,m=i.copilotSupportChannelUrl,p=i.userId,f=i.token,v=i.limit;return r.method=t.GET,r.path="".concat(l,"/").concat(encodeURIComponent(p),"/my_group_channels"),r.params=s({token:f,limit:v,ai_agent_channel_filter:a,desk_channel_filter:u,copilot_conversation_only:g,copilot_support_channel_url:m}),h&&h.length>0&&(r.params.ai_agent_conversation_status_filter=h),o&&o.length>0&&(r.params.ai_agent_ids=o),d&&d.length>0&&(r.params.pinned_channel_urls=d),r}return n(r,e),r}(i),J=function(e){function t(n,t){var r=e.call(this,n,t)||this;r.channels=[];var s=t.next,i=t.channels,a=t.ts;return r.token=s,i&&i.length>0&&(r.channels=i.map((function(e){return e.ts=a,new T(n,e)}))),r.ts=null!=a?a:0,r}return n(t,e),t}(a),V={aiAgentChannelFilter:E.INCLUDE,aiAgentIds:[],deskChannelFilter:q.INCLUDE,pinnedChannelUrls:[]},W=function(e){return d(E,e.aiAgentChannelFilter,!0)&&u("string",e.aiAgentIds,!0)&&d(q,e.deskChannelFilter,!0)&&u("string",e.pinnedChannelUrls,!0)},Y=function(e){function r(n){var r=n.userId,i=n.ts,a=n.token,o=n.params,u=e.call(this)||this,h=c(c({},V),o),d=h.aiAgentChannelFilter,g=h.aiAgentIds,m=h.deskChannelFilter,p=h.pinnedChannelUrls;return u.method=t.GET,u.path="".concat(l,"/").concat(encodeURIComponent(r),"/my_group_channels/changelogs"),u.params=s({token:a,change_ts:i,ai_agent_channel_filter:d,desk_channel_filter:m}),g&&g.length>0&&(u.params.ai_agent_ids=g),p&&p.length>0&&(u.params.pinned_channel_urls=p),u}return n(r,e),r}(i),Z=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.updatedChannels=t.updated.map((function(e){var r=Object.assign(e,{ts:t.ts});return new T(n,r)})),r.deletedChannelUrls=t.deleted,r.hasMore=t.has_more,r.token=t.next,r.ts=t.ts,r}return n(t,e),t}(a),$={aiAgentChannelFilter:E.INCLUDE,aiAgentIds:[],deskChannelFilter:q.INCLUDE,pinnedChannelUrls:[]},ee=function(e){function r(n){var r=n.userId,i=n.params,a=e.call(this)||this,o=c(c({},$),i),u=o.aiAgentChannelFilter,h=o.aiAgentConversationStatusFilter,d=o.aiAgentIds,g=o.deskChannelFilter,m=o.pinnedChannelUrls;return a.method=t.GET,a.path="".concat(l,"/").concat(encodeURIComponent(r),"/my_group_channels/unread_message_count"),a.params=s({ai_agent_channel_filter:u,desk_channel_filter:g}),h&&h.length>0&&(a.params.ai_agent_conversation_status_filter=h),d&&d.length>0&&(a.params.ai_agent_ids=d),m&&m.length>0&&(a.params.pinned_channel_urls=m),a}return n(r,e),r}(i),ne=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.total=t.total,r.aiAgentChannelCount=t.ai_agent_channel,r.deskChannelCount=t.desk_channel,r.pinnedChannel=t.pinned_channel.map((function(e){return{channelUrl:e.channel_url,count:e.count}})),r}return n(t,e),t}(a),te=function(e){function r(n){var r=n.channelUrl,i=n.messageId,a=n.key,o=n.data,u=e.call(this)||this;return u.method=t.POST,u.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/forms/").concat(encodeURIComponent(a),"/submit"),u.params=s(p({data:o})),u}return n(r,e),r}(i),re=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.result=null!=t?t:{},r}return n(t,e),t}(a),se=function(e){function r(n){var r=n.channelUrl,s=n.messageId,i=n.key,a=e.call(this)||this;return a.method=t.POST,a.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(s),"/forms/").concat(encodeURIComponent(i),"/cancel"),a.params={},a}return n(r,e),r}(i),ie=function(e){function r(n){var r=n.channelUrl,i=n.messageId,a=n.key,o=n.channel,u=n.data,c=e.call(this)||this;return c.method=t.POST,c.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/otps/").concat(encodeURIComponent(a),"/request"),c.params=s(p({channel:o,data:u})),c}return n(r,e),r}(i),ae=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.result=null!=t?t:{},r}return n(t,e),t}(a),oe=function(e){function r(n){var r=n.channelUrl,i=n.messageId,a=n.key,o=n.code,u=e.call(this)||this;return u.method=t.POST,u.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/otps/").concat(encodeURIComponent(a),"/verify"),u.params=s(p({code:o})),u}return n(r,e),r}(i),ue=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.result=null!=t?t:{},r}return n(t,e),t}(a),ce=function(e){function r(n){var r=n.channelUrl,s=n.messageId,i=n.key,a=e.call(this)||this;return a.method=t.POST,a.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(s),"/otps/").concat(encodeURIComponent(i),"/cancel"),a.params={},a}return n(r,e),r}(i),le=function(e){function r(n){var r=n.channelUrl,i=n.messageId,a=n.rating,o=n.comment,u=e.call(this)||this;return u.method=t.POST,u.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/feedback"),u.params=s(p({rating:a,comment:o})),u}return n(r,e),r}(i),he=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.id=t.id,r.rating=t.rating,r.comment=t.comment,r}return n(t,e),t}(a),de=function(e){function r(n){var r=n.channelUrl,i=n.messageId,a=n.rating,o=n.comment,u=e.call(this)||this;return u.method=t.PUT,u.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/feedback"),u.params=s(p({rating:a,comment:o})),u}return n(r,e),r}(i),ge=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.id=t.id,r.rating=t.rating,r.comment=t.comment,r}return n(t,e),t}(a),me=function(e){function r(n){var r=n.channelUrl,s=n.messageId,i=e.call(this)||this;return i.method=t.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(s),"/feedback"),i.params={},i}return n(r,e),r}(i),pe=function(e){function r(n){var r=n.channelUrl,s=n.messageId,i=n.status,a=n.detail,o=e.call(this)||this;return o.method=t.POST,o.path="".concat(m,"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(s),"/user_action_messages"),o.params={status:i,detail:null!=a?a:""},o}return n(r,e),r}(i),fe={},ve=function(){function e(e,n){var t=n.sdkState,r=n.requestQueue,s=n.logger,i=n.dispatcher;this._iid=e,this._sdkState=t,this._requestQueue=r,this._logger=s,this._dispatcher=i,fe[e]=this}return e.of=function(e){return fe[e]},e.prototype.requestMessengerSettings=function(e){return v(this,void 0,void 0,(function(){var n,t,r;return _(this,(function(s){switch(s.label){case 0:return n=I.of(this._iid).requestQueue,t=new R(e),[4,n.forceSend(t)];case 1:return r=s.sent(),[2,r.as(L).settings]}}))}))},e.prototype.getConversations=function(e,n,t){return v(this,void 0,void 0,(function(){var r,s,i,a,o,u;return _(this,(function(l){switch(l.label){case 0:return r=I.of(this._iid).requestQueue,s=new D(c(c({},n),{token:e,limit:t})),[4,r.send(s)];case 1:return i=l.sent(),a=i.as(O),o=a.conversations,u=a.token,[2,{conversations:o,token:u}]}}))}))},e.prototype.getMessageTemplates=function(e){return void 0===e&&(e={}),v(this,void 0,void 0,(function(){var n,t,r,s,i,a,o;return _(this,(function(u){switch(u.label){case 0:return n=e.keys,t=e.limit,r=new x({keys:n,limit:t}),[4,this._requestQueue.send(r)];case 1:return s=u.sent(),i=s.as(N),a=i.templates,o=i.token,[2,{templates:a,token:o}]}}))}))},e.prototype.getMessageTemplate=function(e){return v(this,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:return n=new G({key:e}),[4,this._requestQueue.send(n)];case 1:return t=r.sent(),[2,{template:t.as(K).template}]}}))}))},e.prototype.getMyGroupChannels=function(e,n,t,r){return void 0===r&&(r=U.REQUEST_CHANNEL),v(this,void 0,void 0,(function(){var s,i,a,o,u,l;return _(this,(function(h){switch(h.label){case 0:return s=new z(c(c({},n),{userId:this._sdkState.userId,token:e,limit:t})),[4,this._requestQueue.send(s)];case 1:return i=h.sent(),a=i.as(J),o=a.channels,u=a.token,l=a.ts,this._dispatcher.dispatch(new P({channels:o,context:{source:r}})),[2,{channels:o,token:u,ts:l}]}}))}))},e.prototype.getMyGroupChannelChangeLogs=function(e,n,t){return void 0===t&&(t=U.REQUEST_CHANNEL_CHANGELOGS),v(this,void 0,void 0,(function(){var r,s,i,a,o,u,c,l,h;return _(this,(function(d){switch(d.label){case 0:return r="string"==typeof e?e:null,s="number"==typeof e?e:null,i=new Y(p({userId:this._sdkState.userId,ts:s,token:r,params:n})),[4,this._requestQueue.send(i)];case 1:return a=d.sent(),o=a.as(Z),u=o.updatedChannels,c=o.deletedChannelUrls,l=o.hasMore,h=o.ts,u.length>0&&this._dispatcher.dispatch(new P({channels:u,context:{source:t},ts:h})),c.length>0&&this._dispatcher.dispatch(new S({channelUrls:c,context:{source:t}})),[2,{updatedChannels:u,deletedChannelUrls:c,hasMore:l,token:o.token}]}}))}))},e.prototype.getUnreadMessageCount=function(e){return v(this,void 0,void 0,(function(){var n,t,r,s,i,a,o;return _(this,(function(u){switch(u.label){case 0:return n=new ee({userId:this._sdkState.userId,params:e}),[4,this._requestQueue.send(n)];case 1:return t=u.sent(),r=t.as(ne),s=r.total,i=r.aiAgentChannelCount,a=r.deskChannelCount,o=r.pinnedChannel,[2,{total:s,aiAgentChannelCount:i,deskChannelCount:a,pinnedChannel:o}]}}))}))},e.prototype.submitForm=function(e){return v(this,void 0,void 0,(function(){var n,t,r;return _(this,(function(s){switch(s.label){case 0:return n=I.of(this._iid).requestQueue,t=new te({channelUrl:e.channelUrl,messageId:e.messageId,key:e.formKey,data:e.formData}),[4,n.send(t)];case 1:return r=s.sent(),[2,r.as(re).result]}}))}))},e.prototype.cancelForm=function(e){return v(this,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:return n=I.of(this._iid).requestQueue,t=new se({channelUrl:e.channelUrl,messageId:e.messageId,key:e.formKey}),[4,n.send(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.requestOTP=function(e){return v(this,void 0,void 0,(function(){var n,t,r;return _(this,(function(s){switch(s.label){case 0:return n=I.of(this._iid).requestQueue,t=new ie({channelUrl:e.channelUrl,messageId:e.messageId,key:e.otpKey,channel:e.otpChannel,data:e.otpData}),[4,n.send(t)];case 1:return r=s.sent(),[2,r.as(ae).result]}}))}))},e.prototype.verifyOTP=function(e){return v(this,void 0,void 0,(function(){var n,t,r;return _(this,(function(s){switch(s.label){case 0:return n=I.of(this._iid).requestQueue,t=new oe({channelUrl:e.channelUrl,messageId:e.messageId,key:e.otpKey,code:e.code}),[4,n.send(t)];case 1:return r=s.sent(),[2,r.as(ue).result]}}))}))},e.prototype.cancelOTP=function(e){return v(this,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:return n=I.of(this._iid).requestQueue,t=new ce({channelUrl:e.channelUrl,messageId:e.messageId,key:e.otpKey}),[4,n.send(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.createMessageFeedback=function(e){return v(this,void 0,void 0,(function(){var n,t,r,s;return _(this,(function(i){switch(i.label){case 0:return n=I.of(this._iid).requestQueue,t=new le({channelUrl:e.channelUrl,messageId:e.messageId,rating:e.rating,comment:e.comment}),[4,n.send(t)];case 1:return r=i.sent(),[2,{id:(s=r.as(he)).id,rating:s.rating,comment:s.comment}]}}))}))},e.prototype.updateMessageFeedback=function(e){return v(this,void 0,void 0,(function(){var n,t,r,s;return _(this,(function(i){switch(i.label){case 0:return n=I.of(this._iid).requestQueue,t=new de({channelUrl:e.channelUrl,messageId:e.messageId,rating:e.rating,comment:e.comment}),[4,n.send(t)];case 1:return r=i.sent(),[2,{id:(s=r.as(ge)).id,rating:s.rating,comment:s.comment}]}}))}))},e.prototype.deleteMessageFeedback=function(e){return v(this,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:return n=I.of(this._iid).requestQueue,t=new me({channelUrl:e.channelUrl,messageId:e.messageId}),[4,n.send(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.submitUserActionMessage=function(e){return v(this,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:return n=I.of(this._iid).requestQueue,t=new pe({channelUrl:e.channelUrl,messageId:e.messageId,status:e.status,detail:e.detail}),[4,n.send(t)];case 1:return r.sent(),[2]}}))}))},e}();!function(e){e.CREATED_AT="created_at",e.UPDATED_AT="updated_at"}(B||(B={}));var _e,Ce={status:void 0,aiAgentId:void 0,reverse:!1,order:B.UPDATED_AT},Ie=function(e){function t(n,t){var r,s,i,a,o=this;return(o=e.call(this,n,t)||this).status=null!==(r=t.status)&&void 0!==r?r:void 0,o.aiAgentId=null!==(s=t.aiAgentId)&&void 0!==s?s:void 0,o.reverse=null!==(i=t.reverse)&&void 0!==i?i:Ce.reverse,o.order=null!==(a=t.order)&&void 0!==a?a:Ce.order,o}return n(t,e),t.prototype._validate=function(){return e.prototype._validate.call(this)&&d(M,this.status,!0)&&o("string",this.aiAgentId,!0)&&o("boolean",this.reverse)&&d(B,this.order)},t.prototype.serialize=function(){return y(this)},t.prototype.next=function(){return v(this,void 0,void 0,(function(){var e,n,t,r;return _(this,(function(s){switch(s.label){case 0:return e=ve.of(this._iid),this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,[4,e.getConversations(this._token,p(c({},this)),this.limit)]):[3,2]:[3,5];case 1:return n=s.sent(),t=n.conversations,r=n.token,this._token=r,this._hasNext=!!r,this._isLoading=!1,[2,t];case 2:return[2,[]];case 3:throw b.queryInProgress;case 4:return[3,6];case 5:throw b.invalidParameters;case 6:return[2]}}))}))},t}(k),Ue=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r._ts=0,r.aiAgentChannelFilter=X.aiAgentChannelFilter,r.aiAgentIds=X.aiAgentIds,r.deskChannelFilter=X.deskChannelFilter,r.pinnedChannelUrls=X.pinnedChannelUrls,t.aiAgentChannelFilter&&(r.aiAgentChannelFilter=t.aiAgentChannelFilter),t.aiAgentConversationStatusFilter&&(r.aiAgentConversationStatusFilter=t.aiAgentConversationStatusFilter),t.aiAgentIds&&(r.aiAgentIds=t.aiAgentIds),t.deskChannelFilter&&(r.deskChannelFilter=t.deskChannelFilter),t.pinnedChannelUrls&&(r.pinnedChannelUrls=t.pinnedChannelUrls),r}return n(t,e),t.prototype._validate=function(){return e.prototype._validate.call(this)&&d(E,this.aiAgentChannelFilter)&&u(M,this.aiAgentConversationStatusFilter,!0)&&u("string",this.aiAgentIds)&&d(q,this.deskChannelFilter)&&u("string",this.pinnedChannelUrls)},t.prototype.serialize=function(){return y(this)},Object.defineProperty(t.prototype,"lastResponseAt",{get:function(){return this._ts},enumerable:!1,configurable:!0}),t.prototype.belongsTo=function(e){if(this.pinnedChannelUrls.includes(e.url))return!0;if(e.isAIAgent&&!e.conversation)return!1;if(this.aiAgentChannelFilter===E.EXCLUDE)if(e.isAIAgent)return!1;if(this.aiAgentConversationStatusFilter&&e.isAIAgent&&!this.aiAgentConversationStatusFilter.some((function(n){var t;return(null===(t=e.conversation)||void 0===t?void 0:t.status)===n})))return!1;if(this.deskChannelFilter===q.EXCLUDE)if(e.isDesk)return!1;return!0},t.prototype.next=function(){return v(this,void 0,void 0,(function(){var e,n,t,r,s,i;return _(this,(function(a){switch(a.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=ve.of(this._iid),n=p({aiAgentChannelFilter:this.aiAgentChannelFilter,aiAgentConversationStatusFilter:this.aiAgentConversationStatusFilter,aiAgentIds:this.aiAgentIds,deskChannelFilter:this.deskChannelFilter,pinnedChannelUrls:this.pinnedChannelUrls}),[4,e.getMyGroupChannels(this._token,n,this.limit)]):[3,2]:[3,5];case 1:return t=a.sent(),r=t.channels,s=t.token,i=t.ts,this._token=s,this._hasNext=!!s,this._isLoading=!1,this._ts=i,[2,r];case 2:return[2,[]];case 3:throw b.queryInProgress;case 4:return[3,6];case 5:throw b.invalidParameters;case 6:return[2]}}))}))},t}(k);!function(e){e.GOOD="good",e.BAD="bad"}(_e||(_e={}));var ye=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.name="aiAgent",n}return n(t,e),t.prototype.init=function(n,t){var r=t.sdkState,s=t.dispatcher,i=t.sessionManager,a=t.requestQueue,o=t.logger,u=t.onlineDetector,c=t.cacheContext;e.prototype.init.call(this,n,{sdkState:r,dispatcher:s,sessionManager:i,requestQueue:a,logger:o,onlineDetector:u,cacheContext:c}),this._manager=new ve(n,{sdkState:r,requestQueue:a,logger:o,dispatcher:s})},t.prototype.requestMessengerSettings=function(e){return v(this,void 0,void 0,(function(){var n,t,r,s,i,a,u;return _(this,(function(c){return n=e.aiAgentId,t=e.userId,r=e.language,s=e.country,i=e.context,a=e.forceCreateChannel,u=e.knownActiveChannelUrl,w(o("string",n)&&o("string",t,!0)&&o("string",r,!0)&&o("string",s,!0)&&o("object",i,!0)&&o("boolean",a,!0)&&o("string",u,!0)).throw(b.invalidParameters),[2,this._manager.requestMessengerSettings(e)]}))}))},t.prototype.createConversationListQuery=function(e){return void 0===e&&(e={}),new Ie(this._iid,e)},t.prototype.createMyGroupChannelListQuery=function(e){return void 0===e&&(e={}),new Ue(this._iid,e)},t.prototype.getMyGroupChannelChangeLogsByToken=function(e,n){return void 0===n&&(n={}),v(this,void 0,void 0,(function(){var t;return _(this,(function(r){switch(r.label){case 0:return t=c(c({},V),n),w(o("string",e)&&W(t)).throw(b.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(e,t)];case 1:return[2,r.sent()]}}))}))},t.prototype.getMyGroupChannelChangeLogsByTimestamp=function(e,n){return void 0===n&&(n={}),v(this,void 0,void 0,(function(){var t;return _(this,(function(r){switch(r.label){case 0:return t=c(c({},V),n),w(o("number",e)&&W(t)).throw(b.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(e,t)];case 1:return[2,r.sent()]}}))}))},t.prototype.getUnreadMessageCount=function(e){return void 0===e&&(e={}),v(this,void 0,void 0,(function(){var n;return _(this,(function(t){return n=c(c({},$),e),w(d(E,n.aiAgentChannelFilter,!0)&&u(M,n.aiAgentConversationStatusFilter,!0)&&u("string",n.aiAgentIds,!0)&&d(q,n.deskChannelFilter,!0)&&u("string",n.pinnedChannelUrls,!0)).throw(b.invalidParameters),[2,this._manager.getUnreadMessageCount(n)]}))}))},t.prototype.getMessageTemplates=function(e){return void 0===e&&(e={}),v(this,void 0,void 0,(function(){var n;return _(this,(function(t){return n=c(c({},Q),e),w(function(e){return o("number",e.limit,!0)&&u("string",e.keys,!0)}(n)).throw(b.invalidParameters),[2,this._manager.getMessageTemplates(e)]}))}))},t.prototype.getMessageTemplate=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e)).throw(b.invalidParameters),[2,this._manager.getMessageTemplate(e)]}))}))},t.prototype.submitForm=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.formKey)&&o("object",e.formData)).throw(b.invalidParameters),[2,this._manager.submitForm(e)]}))}))},t.prototype.cancelForm=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.formKey)).throw(b.invalidParameters),[2,this._manager.cancelForm(e)]}))}))},t.prototype.createMessageFeedback=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&d(_e,e.rating)&&o("string",e.comment,!0)).throw(b.invalidParameters),[2,this._manager.createMessageFeedback(e)]}))}))},t.prototype.updateMessageFeedback=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&d(_e,e.rating)&&o("string",e.comment,!0)).throw(b.invalidParameters),[2,this._manager.updateMessageFeedback(e)]}))}))},t.prototype.requestOTP=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.otpKey)&&o("string",e.otpChannel)&&o("object",e.otpData)).throw(b.invalidParameters),[2,this._manager.requestOTP(e)]}))}))},t.prototype.verifyOTP=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.otpKey)&&o("string",e.code)).throw(b.invalidParameters),[2,this._manager.verifyOTP(e)]}))}))},t.prototype.cancelOTP=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.otpKey)).throw(b.invalidParameters),[2,this._manager.cancelOTP(e)]}))}))},t.prototype.deleteMessageFeedback=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)).throw(b.invalidParameters),[2,this._manager.deleteMessageFeedback(e)]}))}))},t.prototype.submitUserActionMessage=function(e){return v(this,void 0,void 0,(function(){return _(this,(function(n){return w(o("string",e.channelUrl)&&o("number",e.messageId)&&o("string",e.status)&&o("string",e.detail,!0)).throw(b.invalidParameters),[2,this._manager.submitUserActionMessage(e)]}))}))},t}(A);export{E as AIAgentChannelFilter,Ue as AIAgentGroupChannelListQuery,_e as AIAgentMessageFeedbackRating,ye as AIAgentModule,B as ConversationListOrder,Ie as ConversationListQuery,q as DeskChannelFilter};