mezon-js 2.15.25 → 2.15.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var K=Object.defineProperty,Y=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var j=(f,e,t)=>e in f?K(f,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[e]=t,v=(f,e)=>{for(var t in e||(e={}))Z.call(e,t)&&j(f,t,e[t]);if(G)for(var t of G(e))X.call(e,t)&&j(f,t,e[t]);return f},M=(f,e)=>Y(f,$(e));var d=(f,e,t)=>new Promise((n,i)=>{var c=o=>{try{s(t.next(o))}catch(a){i(a)}},l=o=>{try{s(t.throw(o))}catch(a){i(a)}},s=o=>o.done?n(o.value):Promise.resolve(o.value).then(c,l);s((t=t.apply(f,e)).next())});import"whatwg-fetch";import{encode as ee,decode as te}from"js-base64";import*as R from"mezon-js-protobuf";function g(f,e,t){let n=v({method:f},e);return n.headers=v({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(i=>{n.headers[i]||delete n.headers[i]}),t&&(n.body=t),n}function me(f){return ee(encodeURIComponent(f).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function ge(f){return decodeURIComponent(te(f).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(f){if(f==null)return{t:f};let e;if(f instanceof Uint8Array)e=new TextDecoder().decode(f);else if(typeof f=="string")e=f;else return typeof f=="object"?f:{t:f};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var L=f=>!f||f===null||f===void 0||f===""||f==="[]";function T(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageMentionList.decode(i)}catch(n){return P(f)}}function z(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageAttachmentList.decode(i)}catch(n){return P(f)}}function q(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(i)}catch(n){return P(f)}}function D(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageRefList.decode(i)}catch(n){return P(f)}}function B(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageReactionList.decode(i)}catch(n){return P(f)}}function N(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.DirectFcmProto.decode(i)}catch(n){return P(f)}}function _e(f){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(f)).finish()}function fe(f){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(f)).finish()}function ye(f){return R.MessageRefList.encode(R.MessageRefList.fromPartial(f)).finish()}function Ce(f){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(f)).finish()}function be(f){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(f)).finish()}var ne=(c=>(c[c.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",c[c.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",c[c.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",c[c.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",c[c.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",c))(ne||{}),se=(a=>(a[a.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",a[a.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",a[a.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",a[a.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",a[a.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",a[a.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",a[a.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",a[a.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",a[a.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",a))(se||{}),ie=(c=>(c[c.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",c[c.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",c[c.STREAM_MODE_DM=4]="STREAM_MODE_DM",c[c.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",c[c.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",c))(ie||{}),re=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(re||{}),oe=(a=>(a[a.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",a[a.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",a[a.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",a[a.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",a[a.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",a[a.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",a[a.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",a[a.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",a[a.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",a))(oe||{});function J(f){let e,t,n,i,c,l;try{e=P(f.channel_message.content)}catch(o){console.log("content is invalid",o)}try{t=B(f.channel_message.reactions)}catch(o){console.log("reactions is invalid",o)}try{n=T(f.channel_message.mentions)}catch(o){console.log("mentions is invalid",o)}try{i=z(f.channel_message.attachments)}catch(o){console.log("attachments is invalid",o)}try{c=D(f.channel_message.references)}catch(o){console.log("references is invalid",o)}try{l=f.channel_message.referenced_message}catch(o){console.log("referenced messages is invalid",o)}return{id:f.id||f.channel_message.message_id,avatar:f.channel_message.avatar,channel_id:f.channel_message.channel_id,mode:f.channel_message.mode,channel_label:f.channel_message.channel_label,clan_id:f.channel_message.clan_id,code:f.channel_message.code,message_id:f.channel_message.message_id,sender_id:f.channel_message.sender_id,update_time:f.channel_message.update_time,clan_logo:f.channel_message.clan_logo,category_name:f.channel_message.category_name,username:f.channel_message.username,clan_nick:f.channel_message.clan_nick,clan_avatar:f.channel_message.clan_avatar,display_name:f.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:i==null?void 0:i.attachments,referenced_message:l,references:c==null?void 0:c.refs,hide_editted:f.channel_message.hide_editted,is_public:f.channel_message.is_public,create_time_seconds:f.channel_message.create_time_seconds,update_time_seconds:f.channel_message.update_time_seconds,topic_id:f.channel_message.topic_id}}import*as H from"js-base64";var O=class f{constructor(e,t,n,i,c,l,s){this.created=n;this.api_url=i;this.ws_url=c;this.id_token=l;this.token=e,this.refresh_token=t,this.id_token=l,this.api_url=i,this.ws_url=c,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=s,this.update(e,t,s)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,n){let i=e.split(".");if(i.length!=3)throw"jwt is not valid.";let c=JSON.parse(H.atob(i[1])),l=Math.floor(parseInt(c.exp));if(t){let s=t.split(".");if(s.length!=3)throw"refresh jwt is not valid.";let o=JSON.parse(H.atob(s[1])),a=Math.floor(parseInt(o.exp));this.refresh_expires_at=a,this.refresh_token=t,this.is_remember=n}this.token=e,this.expires_at=l,this.username=c.usn,this.user_id=c.uid,this.vars=c.vrs}static restore(e,t,n,i,c){return new f(e,t,!1,n,i,"",c)}};import{encode as k}from"js-base64";import*as r from"mezon-js-protobuf";import{WebSocketAdapter as ae}from"mezon-js-protobuf";var I=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListChannelBadgeCount=17]="ListChannelBadgeCount",u[u.ListClanUsersStatus=18]="ListClanUsersStatus",u[u.ListChannelApps=19]="ListChannelApps",u[u.GetListFavoriteChannel=20]="GetListFavoriteChannel",u[u.ListCategoryDescs=21]="ListCategoryDescs",u[u.ListOnboarding=22]="ListOnboarding",u[u.GetListStickersByUserId=23]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=24]="GetSystemMessageByClanId",u[u.GetPinMessagesList=25]="GetPinMessagesList",u[u.GetChannelCanvasList=26]="GetChannelCanvasList",u[u.ListChannelTimeline=27]="ListChannelTimeline",u[u.ListChannelMessages=28]="ListChannelMessages",u[u.ListActivity=29]="ListActivity",u[u.ListChannelByUserId=30]="ListChannelByUserId",u[u.ListUserClansByUserId=31]="ListUserClansByUserId",u[u.GetUserProfileOnClan=32]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=33]="RegistFCMDeviceToken",u[u.IsBanned=34]="IsBanned",u[u.ListThreadDescs=35]="ListThreadDescs",u[u.ListArchivedChannelDescs=36]="ListArchivedChannelDescs",u[u.ListChannelDetail=37]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=38]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=39]="ListRoleUsers",u[u.ListChannelUsers=40]="ListChannelUsers",u[u.ListChannelAttachment=41]="ListChannelAttachment",u[u.ListChannelVoiceUsers=42]="ListChannelVoiceUsers",u[u.ListUserOnline=43]="ListUserOnline",u[u.ListNotifications=44]="ListNotifications",u[u.ListChannelUsersUC=45]="ListChannelUsersUC",u[u.ListWebhookByChannelId=46]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=47]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=48]="ListChannelSetting",u[u.ListApps=49]="ListApps",u[u.GetApp=50]="GetApp",u[u.ListForSaleItems=51]="ListForSaleItems",u[u.ListClanWebhook=52]="ListClanWebhook",u[u.GetUserStatus=53]="GetUserStatus",u[u.ListSdTopic=54]="ListSdTopic",u[u.AddFriends=55]="AddFriends",u[u.AddChannelUsers=56]="AddChannelUsers",u[u.RegistrationEmail=57]="RegistrationEmail",u[u.BlockFriends=58]="BlockFriends",u[u.UnblockFriends=59]="UnblockFriends",u[u.UploadAttachmentFile=60]="UploadAttachmentFile",u[u.UploadOauthFile=61]="UploadOauthFile",u[u.AddRolesChannelDesc=62]="AddRolesChannelDesc",u[u.CreateCategoryDesc=63]="CreateCategoryDesc",u[u.CreateChannelDesc=64]="CreateChannelDesc",u[u.CreateRole=65]="CreateRole",u[u.CreateEvent=66]="CreateEvent",u[u.DeleteRole=67]="DeleteRole",u[u.DeleteEvent=68]="DeleteEvent",u[u.DeleteRoleChannelDesc=69]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=70]="DeleteChannelDesc",u[u.CloseDMByChannelId=71]="CloseDMByChannelId",u[u.OpenDMByChannelId=72]="OpenDMByChannelId",u[u.DeleteAccount=73]="DeleteAccount",u[u.DeleteFriends=74]="DeleteFriends",u[u.DeleteCategoryDesc=75]="DeleteCategoryDesc",u[u.DeleteNotifications=76]="DeleteNotifications",u[u.DeleteClanDesc=77]="DeleteClanDesc",u[u.UpdateUser=78]="UpdateUser",u[u.UpdateUserProfileByClan=79]="UpdateUserProfileByClan",u[u.UpdateClanOrder=80]="UpdateClanOrder",u[u.RemoveChannelUsers=81]="RemoveChannelUsers",u[u.LeaveThread=82]="LeaveThread",u[u.ArchiveChannel=83]="ArchiveChannel",u[u.LinkSMS=84]="LinkSMS",u[u.ConfirmLinkMezonOTP=85]="ConfirmLinkMezonOTP",u[u.LinkEmail=86]="LinkEmail",u[u.CreateClanDesc=87]="CreateClanDesc",u[u.RemoveClanUsers=88]="RemoveClanUsers",u[u.BanClanUsers=89]="BanClanUsers",u[u.CreateLinkInviteUser=90]="CreateLinkInviteUser",u[u.InviteUser=91]="InviteUser",u[u.SetRoleChannelPermission=92]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=93]="SetNotificationChannelSetting",u[u.SetMuteChannel=94]="SetMuteChannel",u[u.SetMuteCategory=95]="SetMuteCategory",u[u.SetNotificationClanSetting=96]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=97]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=98]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=99]="DeleteNotificationChannel",u[u.CreatePinMessage=100]="CreatePinMessage",u[u.CreateMessage2Inbox=101]="CreateMessage2Inbox",u[u.UnlinkMezon=102]="UnlinkMezon",u[u.UnlinkEmail=103]="UnlinkEmail",u[u.UpdateAccount=104]="UpdateAccount",u[u.UpdateUsername=105]="UpdateUsername",u[u.UpdateCategory=106]="UpdateCategory",u[u.UpdateCategoryOrder=107]="UpdateCategoryOrder",u[u.UpdateRoleOrder=108]="UpdateRoleOrder",u[u.UpdateClanDesc=109]="UpdateClanDesc",u[u.UpdateChannelDesc=110]="UpdateChannelDesc",u[u.UpdateChannelPrivate=111]="UpdateChannelPrivate",u[u.UpdateRole=112]="UpdateRole",u[u.UpdateEvent=113]="UpdateEvent",u[u.SearchMessage=114]="SearchMessage",u[u.CreateClanEmoji=115]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=116]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=117]="UpdateClanEmojiById",u[u.GenerateWebhook=118]="GenerateWebhook",u[u.HandleWebhook=119]="HandleWebhook",u[u.UpdateWebhookById=120]="UpdateWebhookById",u[u.DeleteWebhookById=121]="DeleteWebhookById",u[u.AddClanSticker=122]="AddClanSticker",u[u.UpdateClanStickerById=123]="UpdateClanStickerById",u[u.DeleteClanStickerById=124]="DeleteClanStickerById",u[u.ChangeChannelCategory=125]="ChangeChannelCategory",u[u.CheckDuplicateName=126]="CheckDuplicateName",u[u.AddApp=127]="AddApp",u[u.DeleteApp=128]="DeleteApp",u[u.UpdateApp=129]="UpdateApp",u[u.AddAppToClan=130]="AddAppToClan",u[u.CreateSystemMessage=131]="CreateSystemMessage",u[u.UpdateSystemMessage=132]="UpdateSystemMessage",u[u.DeleteSystemMessage=133]="DeleteSystemMessage",u[u.StreamingServerCallback=134]="StreamingServerCallback",u[u.EditChannelCanvases=135]="EditChannelCanvases",u[u.GetChannelCanvasDetail=136]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=137]="DeleteChannelCanvas",u[u.AddChannelFavorite=138]="AddChannelFavorite",u[u.RemoveChannelFavorite=139]="RemoveChannelFavorite",u[u.CreateActiviy=140]="CreateActiviy",u[u.GetPubKeys=141]="GetPubKeys",u[u.PushPubKey=142]="PushPubKey",u[u.GetChanEncryptionMethod=143]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=144]="SetChanEncryptionMethod",u[u.GetKeyServer=145]="GetKeyServer",u[u.ListAuditLog=146]="ListAuditLog",u[u.GetOnboardingDetail=147]="GetOnboardingDetail",u[u.CreateOnboarding=148]="CreateOnboarding",u[u.UpdateOnboarding=149]="UpdateOnboarding",u[u.DeleteOnboarding=150]="DeleteOnboarding",u[u.ListOnboardingStep=151]="ListOnboardingStep",u[u.UpdateOnboardingStep=152]="UpdateOnboardingStep",u[u.GenerateClanWebhook=153]="GenerateClanWebhook",u[u.UpdateClanWebhookById=154]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=155]="DeleteClanWebhookById",u[u.HandleClanWebhook=156]="HandleClanWebhook",u[u.UpdateUserStatus=157]="UpdateUserStatus",u[u.UpdateUserCustomStatus=158]="UpdateUserCustomStatus",u[u.GetTopicDetail=159]="GetTopicDetail",u[u.CreateSdTopic=160]="CreateSdTopic",u[u.DeleteSdTopic=161]="DeleteSdTopic",u[u.CreateExternalMezonMeet=162]="CreateExternalMezonMeet",u[u.GenerateMeetToken=163]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=164]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=165]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=166]="CreateRoomChannelApps",u[u.GetMezonOauthClient=167]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=168]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=169]="UpdateMezonOauthClient",u[u.SearchThread=170]="SearchThread",u[u.GenerateHashChannelApps=171]="GenerateHashChannelApps",u[u.DeleteUserEvent=172]="DeleteUserEvent",u[u.AddUserEvent=173]="AddUserEvent",u[u.DeleteQuickMenuAccess=174]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=175]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=176]="UpdateQuickMenuAccess",u[u.TransferOwnership=177]="TransferOwnership",u[u.SendChannelMessage=178]="SendChannelMessage",u[u.UpdateChannelMessage=179]="UpdateChannelMessage",u[u.DeleteChannelMessage=180]="DeleteChannelMessage",u[u.ReportMessageAbuse=181]="ReportMessageAbuse",u[u.MessageButtonClick=182]="MessageButtonClick",u[u.ActiveArchivedThread=183]="ActiveArchivedThread",u[u.UpdateChannelTimeline=184]="UpdateChannelTimeline",u[u.AddAgentToChannel=185]="AddAgentToChannel",u[u.DisconnectAgent=186]="DisconnectAgent",u[u.CreateChannelTimeline=187]="CreateChannelTimeline",u[u.DetailChannelTimeline=188]="DetailChannelTimeline",u[u.CreatePoll=189]="CreatePoll",u[u.VotePoll=190]="VotePoll",u[u.ClosePoll=191]="ClosePoll",u[u.GetPoll=192]="GetPoll",u[u.ReactChannelMessage=193]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=194]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=195]="MultipartUploadAttachmentFileFinish",u))(I||{}),x=class x{constructor(e,t,n,i){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=i,n?this.adapter=n:this.adapter=new ae}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in I)return I[e]}connect(e,t=!1,n=!1,i,c,l){let[s,o]=e.ws_url.split(":");this.adapter.connect(s,o,t,e.token,l),this.adapter.onClose=c,this.adapter.onMessage=(a,h,m)=>d(this,null,function*(){if(n&&window&&window.console&&console.log("incomming message with cid %o and message %o",a,m),a!=0){let _=this.cIds[a];if(!_){console.error("No promise executor for message: %o",m);return}delete this.cIds[a],m.error?_.reject(m.error):_.resolve({code:h,message:m})}else yield i(0,0,m)})}send(e,t=x.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:i}=e,c=i;if(n!=null&&n.includes("/mezon.api.Mezon/")){let l=n.substring(17);c={api_request_event:{api_index:this.getApiFromPath(l),api_name:l,body:i.body}}}return new Promise((l,s)=>{var o,a;if(!this.adapter.isOpen())s("Socket connection has not been established yet.");else{c.channel_message_send?c.channel_message_send.content=JSON.stringify(c.channel_message_send.content):c.channel_message_update?c.channel_message_update.content=JSON.stringify(c.channel_message_update.content):c.ephemeral_message_send?c.ephemeral_message_send.message.content=JSON.stringify((o=c.ephemeral_message_send.message)==null?void 0:o.content):c.quick_menu_event&&(c.quick_menu_event.message.content=JSON.stringify((a=c.quick_menu_event.message)==null?void 0:a.content));let h=this.generatecid();this.cIds[h]={resolve:l,reject:s},t!==1/0&&t>0&&setTimeout(()=>{s("The socket timed out while waiting for a response.")},t),c.cid=h.toString(),this.adapter.send(c)}})}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let n="/mezon.api.Mezon/DeleteAccount",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>l),new Promise((l,s)=>setTimeout(s,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let n="/mezon.api.Mezon/GetAccount",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.Account.decode(l.message)})),new Promise((l,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateAccount",l=r.UpdateAccountRequest.encode(r.UpdateAccountRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/checklogin",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmlogin",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(t,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Bearer "+e),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>h),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/createqrlogin",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LoginIDResponse.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/smsotp",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/emailotp",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/email",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,i,c,l,s={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/mezon",a=new Map;a.set("create",i),a.set("username",c),a.set("is_remember",l);let h="";h=JSON.stringify(n||{});let m=this.buildFullUrl(this.basePath,o,a),_=g("POST",s,h);return e&&(_.headers.Authorization="Basic "+k(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(m,_).then(y=>d(this,null,function*(){let C=yield y.arrayBuffer();return r.Session.decode(new Uint8Array(C))})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/LinkEmail",l=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.LinkAccountConfirmRequest.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/LinkSMS",l=r.AccountMezon.encode(r.AccountMezon.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.LinkAccountConfirmRequest.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=r.LinkAccountConfirmRequest.encode(r.LinkAccountConfirmRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),s.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmotp",l=new Map,s="";s=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RegistrationEmail",l=r.RegistrationEmailRequest.encode(r.RegistrationEmailRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SessionRefresh",s=r.SessionRefreshRequest.encode(r.SessionRefreshRequest.fromPartial(n)).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Basic "+k(e+":"+t)),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.Session.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UnlinkEmail",l=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let n="/mezon.api.Mezon/ListActivity",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.ListUserActivity.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateActiviy",l=r.CreateActivityRequest.encode(r.CreateActivityRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.UserActivity.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddApp",l=r.AddAppRequest.encode(r.AddAppRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.App.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListApps",o=r.ListAppsRequest.encode(r.ListAppsRequest.fromPartial({filter:t,tombstones:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.AppList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n,i={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddAppToClan",s=r.AppClan.encode(r.AppClan.fromPartial({app_id:t,clan_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteApp",l=r.App.encode(r.App.fromPartial({id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetApp",l=r.App.encode(r.App.fromPartial({id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.App.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateApp",s=r.UpdateAppRequest.encode(r.UpdateAppRequest.fromPartial(M(v({},n),{id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.App.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,i,c,l={}){let s="/mezon.api.Mezon/ListAuditLog",a=r.ListAuditLogRequest.encode(r.ListAuditLogRequest.fromPartial({clan_id:i,user_id:n,action_log:t,date_log:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return r.ListAuditLog.decode(m)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateCategoryOrder",l=r.UpdateCategoryOrderRequest.encode(r.UpdateCategoryOrderRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,i,c,l,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListCategoryDescs",h=r.CategoryDesc.encode(r.CategoryDesc.fromPartial({clan_id:t,creator_id:n,category_name:i,category_id:c,category_order:l})).finish(),m=g("POST",s,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:m}).then(_=>d(this,null,function*(){return _.code!=0?{}:r.CategoryDescList.decode(_.message)})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,n={}){let i="/mezon.api.Mezon/ListChannelApps",l=r.ListChannelAppsRequest.encode(r.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ListChannelAppsResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,i,c,l={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetChannelCanvasList",a=r.ChannelCanvasListRequest.encode(r.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:n,limit:i,page:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ChannelCanvasListResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddChannelFavorite",l=r.AddFavoriteChannelRequest.encode(r.AddFavoriteChannelRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.AddFavoriteChannelResponse.decode(o)})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelFavorite",s=r.RemoveFavoriteChannelRequest.encode(r.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetListFavoriteChannel",l=r.ListFavoriteChannelRequest.encode(r.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ListFavoriteChannelResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,i,c,l,s,o={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelMessages",m=r.ListChannelMessagesRequest.encode(r.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:n,message_id:i,direction:c,limit:l,topic_id:s})).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return r.ChannelMessageList.decode(y)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddChannelUsers",s=r.AddChannelUsersRequest.encode(r.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,i,c,l,s,o,a,h={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let m="/mezon.api.Mezon/ListChannelAttachment",y=r.ListChannelAttachmentRequest.encode(r.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:n,file_type:i,limit:c,state:l,before:s,after:o,around:a})).finish(),C=g("POST",h,"");return C.body=y,e&&(C.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:m,fetchOptions:C}).then(b=>d(this,null,function*(){return b.code!=0?{}:r.ChannelAttachmentList.decode(b.message)})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChanEncryptionMethod",s=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial({channel_id:t,method:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ChanEncryptionMethod.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SetChanEncryptionMethod",s=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial(M(v({},n),{channel_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n,i={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/LeaveThread",s=r.LeaveThreadRequest.encode(r.LeaveThreadRequest.fromPartial({channel_id:n,clan_id:t})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ArchiveChannel",s=r.ArchiveChannelRequest.encode(r.ArchiveChannelRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListArchivedChannelDescs",l=r.ListArchivedChannelDescsRequest.encode(r.ListArchivedChannelDescsRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ListArchivedChannelDescsResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelUsers",s=r.RemoveChannelUsersRequest.encode(r.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,i,c,l,s,o={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelUsers",m=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:i,limit:c,state:l,cursor:s})).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelUserList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,i,c,l,s,o={}){let a="/mezon.api.Mezon/ListChannelDescs",m=r.ListChannelDescsRequest.encode(r.ListChannelDescsRequest.fromPartial({limit:t,state:n,page:i,clan_id:c,channel_type:l,is_mobile:s})).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelDescList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateChannelDesc",l=r.CreateChannelDescRequest.encode(r.CreateChannelDescRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ChannelDescription.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n,i={}){let c="/mezon.api.Mezon/ListChannelUsersUC",s=r.AllUsersAddChannelRequest.encode(r.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.AllUsersAddChannelResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n,i={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteChannelDesc",s=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateChannelDesc",s=r.UpdateChannelDescRequest.encode(r.UpdateChannelDescRequest.fromPartial(M(v({},n),{channel_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,i,c,l,s,o,a,h,m,_={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let y="/mezon.api.Mezon/ListChannelSetting",b=r.ChannelSettingListRequest.encode(r.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:n,category_id:i,active:l,private_channel:c,status:s,type:o,limit:a,page:h,channel_label:m})).finish(),A=g("POST",_,"");return A.body=b,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:A}).then(S=>d(this,null,function*(){return S.code!=0?{}:r.ChannelSettingListResponse.decode(S.message)})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n,i={}){let c="/mezon.api.Mezon/ListChannelVoiceUsers",s=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,limit:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.VoiceChannelUserList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListClanDescs",o=r.ListClanDescRequest.encode(r.ListClanDescRequest.fromPartial({limit:t,state:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ClanDescList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListChannelBadgeCount",o=r.ListChannelBadgeCountRequest.encode(r.ListChannelBadgeCountRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:i!=null?i:0})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ListChannelBadgeCountResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListUserOnline",o=r.ListUserOnlineRequest.encode(r.ListUserOnlineRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:i!=null?i:0})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ListUserOnlineResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateClanDesc",l=r.CreateClanDescRequest.encode(r.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ClanDesc.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,n={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteClanDesc",l=r.DeleteClanDescRequest.encode(r.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanDesc",s=r.UpdateClanDescRequest.encode(r.UpdateClanDescRequest.fromPartial(v({clan_id:t},n))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveClanUsers",s=r.RemoveClanUsersRequest.encode(r.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n,i={}){let c="/mezon.api.Mezon/ListBannedUsers",s=r.BannedUserListRequest.encode(r.BannedUserListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.BannedUserList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,i,c,l={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UnbanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:i,ban_time:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return{}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,i,c,l={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/BanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:i,ban_time:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return{}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanUsers",l=r.ListClanUsersRequest.encode(r.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ClanUserList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanUsersStatus",l=r.ListClanUsersStatusRequest.encode(r.ListClanUsersStatusRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ClanUserStatusList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateCategoryDesc",l=r.CreateCategoryDescRequest.encode(r.CreateCategoryDescRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.CategoryDesc.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CheckDuplicateName",l=r.CheckDuplicateNameRequest.encode(r.CheckDuplicateNameRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){if(o.status>=200&&o.status<300)return r.CheckDuplicateNameResponse.decode(o);throw o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,i,c={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteCategoryDesc",o=r.DeleteCategoryDescRequest.encode(r.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:n,category_label:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,i,c,l={}){let s="/mezon.api.Mezon/RegistFCMDeviceToken",a=r.RegistFcmDeviceTokenRequest.encode(r.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:n,platform:i,voip_token:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.RegistFcmDeviceTokenResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CloseDMByChannelId",l=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/OpenDMByChannelId",l=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateClanEmoji",l=r.ClanEmojiCreateRequest.encode(r.ClanEmojiCreateRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteByIdClanEmoji",o=r.ClanEmojiDeleteRequest.encode(r.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:n,emoji_label:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanEmojiById",s=r.ClanEmojiUpdateRequest.encode(r.ClanEmojiUpdateRequest.fromPartial({id:n.id,shortname:n.shortname,clan_id:n.clan_id})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let n="/mezon.api.Mezon/EmojiRecentList",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.EmojiRecentList.decode(l.message)})),new Promise((l,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let n="/mezon.api.Mezon/GetListEmojisByUserId",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.EmojiListedResponse.decode(l.message)})),new Promise((l,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SearchMessage",l=r.SearchMessageRequest.encode(r.SearchMessageRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.SearchMessageResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateEvent",l=r.Event.encode(r.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listEvents(e,t,n={}){let i="/mezon.api.Mezon/ListEvents",l=r.ListEventsRequest.encode(r.ListEventsRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.EventList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateEvent",l=r.CreateEventRequest.encode(r.CreateEventRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.EventManagement.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateEventUser",l=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,i,c,l,s={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteEvent",h=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial({event_id:t,clan_id:n,creator_id:i,event_label:c,channel_id:l})).finish(),m=g("POST",s,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:m}).then(_=>d(this,null,function*(){return{}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n,i={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateEvent",s=r.UpdateEventRequest.encode(r.UpdateEventRequest.fromPartial(n)).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteFriends",s=r.DeleteFriendsRequest.encode(r.DeleteFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListFriends",o=r.ListFriendsRequest.encode(r.ListFriendsRequest.fromPartial({limit:t,state:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.FriendList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n,i={}){let c="/mezon.api.Mezon/AddFriends",s=r.AddFriendsRequest.encode(r.AddFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.AddFriendsResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n,i={}){let c="/mezon.api.Mezon/BlockFriends",s=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n,i={}){let c="/mezon.api.Mezon/UnblockFriends",s=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,n={}){let i="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.NotificationChannelCategorySettingList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetUserProfileOnClan",l=r.ClanProfileRequest.encode(r.ClanProfileRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ClanProfile.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationCategory",l=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.NotificationUserChannel.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationChannel",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.NotificationUserChannel.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationClan",l=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.NotificationSetting.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationReactMessage",l=r.NotifiReactMessage.encode(r.NotifiReactMessage.fromPartial({channel_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.NotifiReactMessage.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GiveMeACoffee",l=r.GiveCoffeeEvent.encode(r.GiveCoffeeEvent.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let n="/mezon.api.Mezon/GetKeyServer",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.GetKeyServerResp.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateLinkInviteUser",l=r.LinkInviteUserRequest.encode(r.LinkInviteUserRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.LinkInviteUser.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,n={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/InviteUser",l=r.InviteUserRequest.encode(r.InviteUserRequest.fromPartial({invite_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.InviteUserRes.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,i={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let c="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),l=new Map,s="",o=this.buildFullUrl(this.basePath,c,l),a=g("GET",i,s);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.InviteUserRes.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let n="/mezon.api.Mezon/ListChannelByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.ChannelDescList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MarkAsRead",l=r.MarkAsReadRequest.encode(r.MarkAsReadRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let n="/mezon.api.Mezon/ListMezonOauthClient",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.MezonOauthClientList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetMuteCategory",l=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetMuteChannel",l=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteNotifications",s=r.DeleteNotificationsRequest.encode(r.DeleteNotificationsRequest.fromPartial({ids:t||[],category:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,i,c,l,s={}){let o="/mezon.api.Mezon/ListNotifications",h=r.ListNotificationsRequest.encode(r.ListNotificationsRequest.fromPartial({limit:t,clan_id:n,notification_id:i,category:c,direction:l})).finish(),m=g("POST",s,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:m}).then(_=>d(this,null,function*(){return r.NotificationList.decode(_)})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationChannelSetting",l=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationClanSetting",l=r.SetDefaultNotificationRequest.encode(r.SetDefaultNotificationRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationCategorySetting",l=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotificationChannel",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotiReactMessage",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationReactMessage",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetRoleChannelPermission",l=r.UpdateRoleChannelRequest.encode(r.UpdateRoleChannelRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let n="/mezon.api.Mezon/GetListPermission",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.PermissionList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,i,c={}){let l="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",o=r.PermissionRoleChannelListEventRequest.encode(r.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:n,user_id:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.PermissionRoleChannelListEventResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,i,c,l={}){let s="/mezon.api.Mezon/DeletePinMessage",a=r.DeletePinMessage.encode(r.DeletePinMessage.fromPartial({id:t,message_id:n,channel_id:i,clan_id:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>m),new Promise((m,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,i,c={}){let l="/mezon.api.Mezon/GetPinMessagesList",o=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial({message_id:t,channel_id:n,clan_id:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return r.PinMessagesList.decode(h)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateMessage2Inbox",l=r.Message2InboxRequest.encode(r.Message2InboxRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ChannelMessageHeader.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreatePinMessage",l=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ChannelMessageHeader.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,n={}){let i="/mezon.api.Mezon/GetPubKeys",l=r.GetPubKeysRequest.encode(r.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.GetPubKeysResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/PushPubKey",l=r.PushPubKeyRequest.encode(r.PushPubKeyRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddRolesChannelDesc",l=r.AddRoleChannelDescRequest.encode(r.AddRoleChannelDescRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n,i={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ChangeChannelCategory",s=r.ChangeChannelCategoryRequest.encode(r.ChangeChannelCategoryRequest.fromPartial(M(v({},n),{new_category_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteRoleChannelDesc",l=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,i,c,l={}){let s="/mezon.api.Mezon/ListRoles",a=r.RoleListEventRequest.encode(r.RoleListEventRequest.fromPartial({clan_id:t,limit:n,state:i,cursor:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.RoleListEventResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateRole",l=r.CreateRoleRequest.encode(r.CreateRoleRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.Role.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",s=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(M(v({},n),{role_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,i,c,l={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteRole",a=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial({role_id:t,channel_id:n,clan_id:i,role_label:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>m),new Promise((m,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateRole",s=r.UpdateRoleRequest.encode(r.UpdateRoleRequest.fromPartial(M(v({},n),{role_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,n={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListRolePermissions",l=r.ListPermissionsRequest.encode(r.ListPermissionsRequest.fromPartial({role_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.PermissionList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,i,c={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ListRoleUsers",o=r.ListRoleUsersRequest.encode(r.ListRoleUsersRequest.fromPartial({role_id:t,limit:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.RoleUserList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetRoleOfUserInTheClan",s=r.ListPermissionOfUsersRequest.encode(r.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.RoleList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,i,c={}){let l="/mezon.api.Mezon/SearchThread",o=r.SearchThreadRequest.encode(r.SearchThreadRequest.fromPartial({clan_id:t,channel_id:n,label:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ChannelDescList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SendToken",l=r.TokenSentEvent.encode(r.TokenSentEvent.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionLogout",l=r.SessionLogoutRequest.encode(r.SessionLogoutRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddClanSticker",l=r.ClanStickerAddRequest.encode(r.ClanStickerAddRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteClanStickerById",o=r.ClanStickerDeleteRequest.encode(r.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:n,sticker_label:i})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanStickerById",s=r.ClanStickerUpdateByIdRequest.encode(r.ClanStickerUpdateByIdRequest.fromPartial(M(v({},n),{id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let n="/mezon.api.Mezon/GetListStickersByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.StickerListedResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RegisterStreamingChannel",l=r.RegisterStreamingChannelRequest.encode(r.RegisterStreamingChannelRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.RegisterStreamingChannelResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,i,c,l,s,o={}){let a="/mezon.api.Mezon/ListStreamingChannelUsers",m=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:i,limit:c,state:l,cursor:s})).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.StreamingChannelUserList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let n="/mezon.api.Mezon/GetSystemMessagesList",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.SystemMessagesList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateSystemMessage",l=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,i={}){let c="/mezon.api.Mezon/ListSdTopic",s=r.ListSdTopicRequest.encode(r.ListSdTopicRequest.fromPartial({clan_id:t,limit:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.SdTopicList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateSdTopic",l=r.SdTopicRequest.encode(r.SdTopicRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.SdTopic.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteSystemMessage",l=r.DeleteSystemMessage.encode(r.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetSystemMessageByClanId",l=r.GetSystemMessage.encode(r.GetSystemMessage.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.SystemMessage.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateSystemMessage",s=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,i,c,l,s,o={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListThreadDescs",m=r.ListThreadRequest.encode(r.ListThreadRequest.fromPartial({channel_id:t,limit:n,state:i,clan_id:c,thread_id:l,page:s})).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelDescListNoPool.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateCategory",s=r.UpdateCategoryDescRequest.encode(r.UpdateCategoryDescRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateChannelPrivate",l=r.ChangeChannelPrivateRequest.encode(r.ChangeChannelPrivateRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateUserProfileByClan",s=r.UpdateClanProfileRequest.encode(r.UpdateClanProfileRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UploadOauthFile",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.UploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UploadAttachmentFile",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.UploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.MultipartUploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=r.MultipartUploadAttachmentFinishRequest.encode(r.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUser",l=r.UpdateUsersRequest.encode(r.UpdateUsersRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let n="/mezon.api.Mezon/ListUserClansByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.AllUserClans.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n,i={}){let c="/mezon.api.Mezon/ListUserPermissionInChannel",s=r.UserPermissionInChannelListRequest.encode(r.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.UserPermissionInChannelListResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let n="/mezon.api.Mezon/GetUserStatus",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.UserStatus.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUserStatus",l=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUserCustomStatus",l=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateWebhook",l=r.WebhookCreateRequest.encode(r.WebhookCreateRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.WebhookGenerateResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateWebhookById",s=r.WebhookUpdateRequestById.encode(r.WebhookUpdateRequestById.fromPartial(M(v({},n),{id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListWebhookByChannelId",s=r.WebhookListRequest.encode(r.WebhookListRequest.fromPartial({channel_id:t,clan_id:n||""})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.WebhookListResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteWebhookById",s=r.WebhookDeleteRequestById.encode(r.WebhookDeleteRequestById.fromPartial(M(v({},n),{id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let i=e+t+"?";for(let[c,l]of n)l instanceof Array?i+=l.reduce((s,o)=>s+encodeURIComponent(c)+"="+encodeURIComponent(o)+"&",""):l!=null&&(i+=encodeURIComponent(c)+"="+encodeURIComponent(l)+"&");return i}editChannelCanvases(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/EditChannelCanvases",l=r.EditChannelCanvasRequest.encode(r.EditChannelCanvasRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.EditChannelCanvasResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetChannelCanvasDetail",o=r.ChannelCanvasDetailRequest.encode(r.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:n||"",channel_id:i||""})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ChannelCanvasDetailResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,i,c={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteChannelCanvas",o=r.DeleteChannelCanvasRequest.encode(r.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:n||"",channel_id:i||""})).finish(),a=g("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,i,c,l={}){let s="/mezon.api.Mezon/ListOnboarding",a=r.ListOnboardingRequest.encode(r.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:n,limit:i,page:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ListOnboardingResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateOnboarding",l=r.CreateOnboardingRequest.encode(r.CreateOnboardingRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ListOnboardingResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteOnboarding",s=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetOnboardingDetail",s=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n||""})).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.OnboardingItem.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboarding",s=r.UpdateOnboardingRequest.encode(r.UpdateOnboardingRequest.fromPartial(M(v({},n),{id:t}))).finish(),o=g("POST",i,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateClanWebhook",l=r.GenerateClanWebhookRequest.encode(r.GenerateClanWebhookRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.GenerateClanWebhookResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanWebhook",l=r.ListClanWebhookRequest.encode(r.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.ListClanWebhookResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteClanWebhookById",l={id:t,clan_id:n},o=r.ClanWebhookRequest.encode(r.ClanWebhookRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanWebhookById",l=M(v({},n),{id:t}),o=r.UpdateClanWebhookRequest.encode(r.UpdateClanWebhookRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,n={}){let i="/mezon.api.Mezon/GetTopicDetail",c={topic_id:t},s=r.SdTopicDetailRequest.encode(r.SdTopicDetailRequest.fromPartial(c)).finish(),o=g("POST",n,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.SdTopic.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListOnboardingStep",s={clan_id:t,limit:n,page:i},a=r.ListOnboardingStepRequest.encode(r.ListOnboardingStepRequest.fromPartial(s)).finish(),h=g("POST",c,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ListOnboardingStepResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboardingStep",l=M(v({},n),{clan_id:t}),o=r.UpdateOnboardingStepRequest.encode(r.UpdateOnboardingStepRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateRoomChannelApps",l=r.CreateRoomChannelApps.encode(r.CreateRoomChannelApps.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.CreateRoomChannelApps.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateMeetToken",l=r.GenerateMeetTokenRequest.encode(r.GenerateMeetTokenRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.GenerateMeetTokenResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n,i={}){let c="/mezon.api.Mezon/GetMezonOauthClient",l={client_id:t,client_name:n},o=r.GetMezonOauthClientRequest.encode(r.GetMezonOauthClientRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.MezonOauthClient.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateMezonOauthClient",l=r.MezonOauthClient.encode(r.MezonOauthClient.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.MezonOauthClient.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,n={}){let i="/mezon.api.Mezon/GenerateHashChannelApps",c={app_id:t},s=r.GenerateHashChannelAppsRequest.encode(r.GenerateHashChannelAppsRequest.fromPartial(c)).finish(),o=g("POST",n,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.GenerateHashChannelAppsResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddUserEvent",l=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteUserEvent",l={clan_id:t,event_id:n},o=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateRoleOrder",l=r.UpdateRoleOrderRequest.encode(r.UpdateRoleOrderRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let n="/mezon.api.Mezon/CreateExternalMezonMeet",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.GenerateMezonMeetResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,i,c,l,s={}){if(n==null)throw new Error("'token' is a required parameter but is null or undefined.");let o="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(n))),a=new Map;a.set("username",i),a.set("metadata",c),a.set("is_guest",l);let h="",m=this.buildFullUrl(t,o,a),_=g("POST",s,h);return e&&(_.headers.Authorization="Bearer "+e),_.headers.Accept="application/x-protobuf",_.headers["Content-Type"]="application/json",Promise.race([fetch(m,_).then(y=>d(this,null,function*(){let C=yield y.arrayBuffer();return r.GenerateMeetTokenExternalResponse.decode(new Uint8Array(C))})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MuteParticipantMezonMeet",l=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelDetail",c={channel_id:t},s=r.ListChannelDetailRequest.encode(r.ListChannelDetailRequest.fromPartial(c)).finish(),o=g("POST",n,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ChannelDescription.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelTimeline",l=r.ListChannelTimelineRequest.encode(r.ListChannelTimelineRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.ListChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateChannelTimeline",l=r.CreateChannelTimelineRequest.encode(r.CreateChannelTimelineRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.CreateChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateChannelTimeline",l=r.UpdateChannelTimelineRequest.encode(r.UpdateChannelTimelineRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.UpdateChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DetailChannelTimeline",l=r.ChannelTimelineDetailRequest.encode(r.ChannelTimelineDetailRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.ChannelTimelineDetailResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateClanOrder",l=r.UpdateClanOrderRequest.encode(r.UpdateClanOrderRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,i,c={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/clan/discover",s=new Map,o="";o=JSON.stringify(i||{});let a=this.buildFullUrl(n,l,s),h=g("POST",c,o);return e&&(h.headers.Authorization="Basic "+k(e+":"+t)),h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(a,h).then(m=>d(this,null,function*(){let _=yield m.arrayBuffer();return r.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,i,c,l,s,o={}){let a="/mezon.api.Mezon/DeleteQuickMenuAccess",h={id:t,clan_id:n,bot_id:i,menu_name:c,background:l,action_msg:s},_=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(h)).finish(),y=g("POST",o,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListQuickMenuAccess",s={bot_id:t,channel_id:n,menu_type:i},a=r.ListQuickMenuAccessRequest.encode(r.ListQuickMenuAccessRequest.fromPartial(s)).finish(),h=g("POST",c,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.QuickMenuAccessList.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddQuickMenuAccess",l=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateQuickMenuAccess",l=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,n={}){let i="/mezon.api.Mezon/ListForSaleItems",c={page:t},s=r.ListForSaleItemsRequest.encode(r.ListForSaleItemsRequest.fromPartial(c)).finish(),o=g("POST",n,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ForSaleItemList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/IsFollower",l=r.IsFollowerRequest.encode(r.IsFollowerRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.IsFollowerResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/TransferOwnership",l=r.TransferOwnershipRequest.encode(r.TransferOwnershipRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUsername",l=r.UpdateUsernameRequest.encode(r.UpdateUsernameRequest.fromPartial(t)).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/IsBanned",c={channel_id:t},s=r.IsBannedRequest.encode(r.IsBannedRequest.fromPartial(c)).finish(),o=g("POST",n,"");return o.body=s,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.IsBannedResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n,i={}){let c="/mezon.api.Mezon/ReportMessageAbuse",l={message_id:t,abuse_type:n},o=r.ReportMessageAbuseReqest.encode(r.ReportMessageAbuseReqest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C){let b="/mezon.api.Mezon/SendChannelMessage",S=r.ChannelMessageSend.encode(r.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:s,attachments:o,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C})).finish(),w=g("POST",{},"");return w.body=S,e&&(w.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:b,fetchOptions:w}).then(E=>d(this,null,function*(){return r.ChannelMessageAck.decode(E)})),new Promise((E,W)=>setTimeout(()=>W(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,i,c,l,s,o,a,h,m,_){let y="/mezon.api.Mezon/UpdateChannelMessage",b=r.ChannelMessageUpdate.encode(r.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:n,message_id:l,mode:i,is_public:c,content:s,mentions:o,attachments:a,hide_editted:h,topic_id:m,is_update_msg_topic:_})).finish(),A=g("POST",{},"");return A.body=b,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:A}).then(S=>d(this,null,function*(){return S.code!=0?{}:r.ChannelMessageUpdate.decode(S.message)})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,i,c,l,s,o,a,h){let m="/mezon.api.Mezon/DeleteChannelMessage",y=r.ChannelMessageRemove.encode(r.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:n,message_id:l,mode:i,is_public:c,has_attachment:s,mentions:a,references:h,topic_id:o})).finish(),C=g("POST",{},"");return C.body=y,e&&(C.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:m,fetchOptions:C}).then(b=>d(this,null,function*(){return b.code!=0?{}:r.ChannelMessageRemove.decode(b.message)})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,i,c,l,s={}){let o="/mezon.api.Mezon/UpdateMezonVoiceState",a={clan_id:t,channel_id:n,display_name:i,room_name:c,state:l},m=r.HandleParticipantMeetStateEvent.encode(r.HandleParticipantMeetStateEvent.fromPartial(a)).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:_}).then(y=>y),new Promise((y,C)=>setTimeout(C,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,i,c,l,s,o={}){let a="/mezon.api.Mezon/MessageButtonClick",h={message_id:t,channel_id:n,button_id:i,sender_id:c,user_id:l,extra_data:s},_=r.MessageButtonClicked.encode(r.MessageButtonClicked.fromPartial(h)).finish(),y=g("POST",o,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,i,c,l,s,o={}){let a="/mezon.api.Mezon/DropdownBoxSelected",h={message_id:t,channel_id:n,selectbox_id:i,sender_id:c,user_id:l,values:s},_=r.DropdownBoxSelected.encode(r.DropdownBoxSelected.fromPartial(h)).finish(),y=g("POST",o,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n,i={}){let c="/mezon.api.Mezon/ActiveArchivedThread",l={clan_id:t,channel_id:n},o=r.ActiveArchivedThread.encode(r.ActiveArchivedThread.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n,i={}){let c="/mezon.api.Mezon/AddAgentToChannel",l={room_name:t,channel_id:n},o=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n,i={}){let c="/mezon.api.Mezon/DisconnectAgent",l={room_name:t,channel_id:n},o=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListMutedChannel",l=r.ListMutedChannelRequest.encode(r.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(o=>d(this,null,function*(){return r.MutedChannelList.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,i,c,l,s,o,a,h,m,_,y,C){let b="/mezon.api.Mezon/ReactChannelMessage",S=r.MessageReaction.encode(r.MessageReaction.fromPartial({clan_id:t,channel_id:n,mode:i,is_public:c,message_id:l,emoji_id:s,emoji:o,count:a,message_sender_id:h,action:m,emoji_recent_id:y,sender_name:C,topic_id:_})).finish(),w=g("POST",{},"");return w.body=S,e&&(w.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:b,fetchOptions:w}).then(E=>d(this,null,function*(){return r.ChannelMessageSend.decode(E)})),new Promise((E,W)=>setTimeout(()=>W(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,n={}){var o,a,h,m,_,y;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreatePoll",l=r.CreatePollRequest.encode(r.CreatePollRequest.fromPartial({channel_id:(o=t.channel_id)!=null?o:"0",clan_id:(a=t.clan_id)!=null?a:"0",question:(h=t.question)!=null?h:"",answers:(m=t.answers)!=null?m:[],expire_hours:(_=t.expire_hours)!=null?_:0,type:(y=t.type)!=null?y:0})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(C=>d(this,null,function*(){let b=r.CreatePollResponse.decode(C);return{poll_id:b.poll_id,message_id:b.message_id,question:b.question,answers:b.answers.map(A=>({index:A.index,label:A.label})),answer_counts:b.answer_counts,exp:b.exp,is_closed:b.is_closed,creator_id:b.creator_id,type:b.type,total_votes:b.total_votes}})),new Promise((C,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,n={}){var o,a,h,m;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/VotePoll",l=r.VotePollRequest.encode(r.VotePollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0",answer_indices:(m=t.answer_indices)!=null?m:[]})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(_=>d(this,null,function*(){var C;let y=_.length>0?r.VotePollResponse.decode(_):{my_answer_indices:[]};return{my_answer_indices:Array.from((C=y.my_answer_indices)!=null?C:[])}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,n={}){var o,a,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ClosePoll",l=r.ClosePollRequest.encode(r.ClosePollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(m=>{if(m.status==204||m.status>=200&&m.status<300)return{};throw m}),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,n={}){var o,a,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetPoll",l=r.GetPollRequest.encode(r.GetPollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),s=g("POST",n,"");return s.body=l,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(m=>d(this,null,function*(){let _=r.GetPollResponse.decode(m);return{poll_id:_.poll_id,message_id:_.message_id,question:_.question,answers:_.answers.map(y=>({index:y.index,label:y.label})),answer_counts:_.answer_counts,exp:_.exp,is_closed:_.is_closed,creator_id:_.creator_id,type:_.type,total_votes:_.total_votes,voter_details:_.voter_details.map(y=>({answer_index:y.answer_index,user_ids:y.user_ids}))}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return d(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return d(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return d(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>d(this,null,function*(){return{}})),new Promise((n,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,i){return d(this,null,function*(){let c="",l={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(s=>d(this,null,function*(){return{}})),new Promise((s,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,i){let c="",l={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(s=>d(this,null,function*(){return{}})),new Promise((s,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,i,c,l,s,o,a){return d(this,null,function*(){let h="",m={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:c,is_public:i,has_attachment:l,topic_id:s,mentions:o,references:a}};return Promise.race([this.send({urlPath:h,fetchOptions:m}).then(_=>d(this,null,function*(){return{}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,i,c,l,s,o,a,h,m){return d(this,null,function*(){let _="",y={channel_message_update:{clan_id:e,channel_id:t,message_id:c,content:l,mentions:s,attachments:o,mode:n,is_public:i,hide_editted:a,topic_id:h,is_update_msg_topic:m}};return Promise.race([this.send({urlPath:_,fetchOptions:y}).then(C=>d(this,null,function*(){return{}})),new Promise((C,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){let b="",A={quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:s,attachments:o,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C}}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(S=>d(this,null,function*(){return{}})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C,b){return d(this,null,function*(){let A="",S={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:s,attachments:o,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C,id:b}}};return Promise.race([this.send({urlPath:A,fetchOptions:S}).then(w=>d(this,null,function*(){return{}})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,i,c,l,s,o,a,h,m,_,y){return d(this,null,function*(){let C="",b={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:i,content:c,mentions:l,attachments:s,references:o,anonymous_message:a,mention_everyone:h,avatar:m,code:_,topic_id:y}};return Promise.race([this.send({urlPath:C,fetchOptions:b}).then(A=>d(this,null,function*(){return{}})),new Promise((A,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){let b="",A={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:i,is_public:c,message_id:l,emoji_id:s,emoji:o,count:a,message_sender_id:h,action:m,topic_id:_,emoji_recent_id:y,sender_name:C}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(S=>d(this,null,function*(){return{}})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,i,c,l){return d(this,null,function*(){let s="",o={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:i,sender_display_name:c,topic_id:l}};return Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,i,c,l){return d(this,null,function*(){let s="",o={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:i,timestamp_seconds:c,badge_count:l}};return Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,i,c,l,s,o,a,h,m,_,y){return d(this,null,function*(){let C="",b={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:i,message_id:c,timestamp_seconds:l,operation:s,message_sender_avatar:o,message_sender_id:a,message_sender_username:h,message_content:m,message_attachment:_,message_created_time:y}};return Promise.race([this.send({urlPath:C,fetchOptions:b}).then(A=>d(this,null,function*(){return{}})),new Promise((A,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,i){return d(this,null,function*(){let c="",l={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(s=>d(this,null,function*(){return{}})),new Promise((s,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return d(this,null,function*(){let n="",i={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,i,c){return d(this,null,function*(){let l="",s={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:i,caller_id:c}};return Promise.race([this.send({urlPath:l,fetchOptions:s}).then(o=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,i){return d(this,null,function*(){let c="",l={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(s=>d(this,null,function*(){return{}})),new Promise((s,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return d(this,null,function*(){let i="",c={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(l=>d(this,null,function*(){return{}})),new Promise((l,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}listDataSocket(e){return d(this,null,function*(){let t="",n={list_data_socket:e};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}};x.DefaultSendTimeoutMs=1e4;var F=x;var ce="127.0.0.1",le="7350",de="defaultkey",ue=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},V=!1,U=class U{constructor(e=de,t=ce,n=le,i=!1,c=null,l=ue,s=!0){this.serverkey=e;this.timeout=l;this.autoFallbackHttp=s;this.verbose=!1;this.host=t,this.port=n,this.useSSL=i;let a=`${i?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=U.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.transport=new F(e,l,c,a)}isOpen(){return this._connectionState===p.CONNECTED}setTransportAdapter(e){this.transport.setTransportAdapter(e)}connect(e,t=!1,n=!1,i=U.DefaultConnectTimeoutMs){if(this.verbose=n,this._connectionState===p.CONNECTED)return Promise.resolve(e);if(this._connectionState===p.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this.transport.connect(e,t,n,(l,s)=>d(this,null,function*(){if(!s.cid)if(s.notifications)s.notifications.notifications.forEach(o=>{o.content=o.content?N(o.content):void 0,this.onnotification(o)});else if(s.voice_started_event)this.onvoicestarted(s.voice_started_event);else if(s.voice_ended_event)this.onvoiceended(s.voice_ended_event);else if(s.voice_joined_event)this.onvoicejoined(s.voice_joined_event);else if(s.voice_leaved_event)this.onvoiceleaved(s.voice_leaved_event);else if(s.channel_created_event)this.onchannelcreated(s.channel_created_event);else if(s.category_event)this.oncategoryevent(s.category_event);else if(s.role_event)this.onroleevent(s.role_event);else if(s.event_emoji)this.oneventemoji(s.event_emoji);else if(s.noti_user_channel)this.oneventnotiuserchannel(s.noti_user_channel);else if(s.webhook_event)this.oneventwebhook(s.webhook_event);else if(s.channel_deleted_event)this.onchanneldeleted(s.channel_deleted_event);else if(s.clan_deleted_event)this.onclandeleted(s.clan_deleted_event);else if(s.sticker_create_event)this.onstickercreated(s.sticker_create_event);else if(s.sticker_update_event)this.onstickerupdated(s.sticker_update_event);else if(s.sticker_delete_event)this.onstickerdeleted(s.sticker_delete_event);else if(s.channel_updated_event)this.onchannelupdated(s.channel_updated_event);else if(s.delete_account_event)this.ondeleteaccount(s.delete_account_event);else if(s.clan_profile_updated_event)this.onclanprofileupdated(s.clan_profile_updated_event);else if(s.clan_updated_event)this.onclanupdated(s.clan_updated_event);else if(s.last_seen_message_event)this.onlastseenupdated(s.last_seen_message_event);else if(s.status_presence_event)this.onstatuspresence(s.status_presence_event);else if(s.channel_message){let o=J(s);this.onchannelmessage(o)}else s.message_typing_event?this.onmessagetyping(s.message_typing_event):s.message_reaction_event?this.onmessagereaction(s.message_reaction_event):s.channel_presence_event?this.onchannelpresence(s.channel_presence_event):s.last_pin_message_event?this.onpinmessage(s.last_pin_message_event):s.custom_status_event?this.oncustomstatus(s.custom_status_event):s.canvas_event?this.oncanvasevent(s.canvas_event):s.user_channel_added_event?this.onuserchanneladded(s.user_channel_added_event):s.add_clan_user_event?this.onuserclanadded(s.add_clan_user_event):s.user_profile_updated_event?this.onuserprofileupdate(s.user_profile_updated_event):s.user_channel_removed_event?this.onuserchannelremoved(s.user_channel_removed_event):s.block_friend?this.onblockfriend(s.block_friend):s.un_block_friend?this.onunblockfriend(s.un_block_friend):s.add_friend?this.onaddfriend(s.add_friend):s.remove_friend?this.onremovefriend(s.remove_friend):s.user_clan_removed_event?this.onuserclanremoved(s.user_clan_removed_event):s.clan_event_created?this.oneventcreated(s.clan_event_created):s.give_coffee_event?this.oncoffeegiven(s.give_coffee_event):s.role_assign_event?this.onroleassign(s.role_assign_event):s.streaming_started_event?this.onstreamingchannelstarted(s.streaming_started_event):s.streaming_ended_event?this.onstreamingchannelended(s.streaming_ended_event):s.streaming_joined_event?this.onstreamingchanneljoined(s.streaming_joined_event):s.streaming_leaved_event?this.onstreamingchannelleaved(s.streaming_leaved_event):s.permission_set_event?this.onpermissionset(s.permission_set_event):s.permission_changed_event?this.onpermissionchanged(s.permission_changed_event):s.unmute_event?this.onunmuteevent(s.unmute_event):s.token_sent_event?this.ontokensent(s.token_sent_event):s.message_button_clicked?this.onmessagebuttonclicked(s.message_button_clicked):s.dropdown_box_selected?this.onmessagedropdownboxselected(s.dropdown_box_selected):s.mark_as_read?this.onmarkasread(s.mark_as_read):s.voice_reaction_send?this.onvoicereactionmessage(s.voice_reaction_send):s.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(s.webrtc_signaling_fwd):s.list_activity?this.onactivityupdated(s.list_activity):s.sd_topic_event?this.onsdtopicevent(s.sd_topic_event):s.channel_app_event?this.onchannelappevent(s.channel_app_event):s.user_status_event?this.onuserstatusevent(s.user_status_event):s.join_channel_app_data?this.onjoinchannelappevent(s.join_channel_app_data):s.unpin_message_event?this.onunpinmessageevent(s.unpin_message_event):s.quick_menu_event?this.onquickmenuevent(s.quick_menu_event):s.meet_participant_event?this.onmeetparticipantevent(s.meet_participant_event):s.transfer_ownership_event?this.ontransferownership(s.transfer_ownership_event):s.ban_user_event?this.onbanneduser(s.ban_user_event):s.list_channel_users_banned_event?this.onlistchannelusersbanned(s.list_channel_users_banned_event):s.allow_anonymous_event?this.onallowanonymousevent(s.allow_anonymous_event):s.aiagent_enabled_event?this.onaiagentenabled(s.aiagent_enabled_event):s.refresh_session_event?this.onrefreshsession(s.refresh_session):s.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",s):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",s)}),l=>d(this,null,function*(){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(l)}));let c=new Promise((l,s)=>{this.transport.setOnOpen(o=>{this.verbose&&window&&window.console&&console.log(o);let a=V;V=!0,this.clearConnectTimeout(),this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,l(e),a&&this.onreconnect(o)}),this.transport.setOnError(o=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(o),this._connectPromise=void 0,this.transport.close(),s(o)}),this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.transport.close(),this._connectPromise=void 0,s("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},i)});return this._connectPromise=c,this._connectPromise}pingPong(){return d(this,null,function*(){if(!this.isOpen()){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop();return}try{let e="",t={ping:{}};yield this.transport.send({urlPath:e,fetchOptions:t},this._heartbeatTimeoutMs)}catch(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.transport.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(e)}onmessagetyping(e){this.verbose&&window&&window.console&&console.log(e)}onmessagereaction(e){this.verbose&&window&&window.console&&console.log(e)}onchannelmessage(e){this.verbose&&window&&window.console&&console.log(e)}onchannelpresence(e){this.verbose&&window&&window.console&&console.log(e)}onuserchanneladded(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanadded(e){this.verbose&&window&&window.console&&console.log(e)}onuserprofileupdate(e){this.verbose&&window&&window.console&&console.log(e)}onuserchannelremoved(e){this.verbose&&window&&window.console&&console.log(e)}onaddfriend(e){this.verbose&&window&&window.console&&console.log(e)}onremovefriend(e){this.verbose&&window&&window.console&&console.log(e)}onblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onunblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanremoved(e){this.verbose&&window&&window.console&&console.log(e)}onnotification(e){this.verbose&&window&&window.console&&console.log(e)}onstatuspresence(e){this.verbose&&window&&window.console&&console.log(e)}onpinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceended(e){this.verbose&&window&&window.console&&console.log(e)}onvoicestarted(e){this.verbose&&window&&window.console&&console.log(e)}onvoicejoined(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceleaved(e){this.verbose&&window&&window.console&&console.log(e)}onchannelcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncategoryevent(e){this.verbose&&window&&window.console&&console.log(e)}onroleevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventemoji(e){this.verbose&&window&&window.console&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&window&&window.console&&console.log(e)}oneventwebhook(e){this.verbose&&window&&window.console&&console.log(e)}onchanneldeleted(e){this.verbose&&window&&window.console&&console.log(e)}onclandeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickercreated(e){this.verbose&&window&&window.console&&console.log(e)}onstickerdeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickerupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelupdated(e){this.verbose&&window&&window.console&&console.log(e)}ondeleteaccount(e){this.verbose&&window&&window.console&&console.log(e)}onclanprofileupdated(e){this.verbose&&window&&window.console&&console.log(e)}onclanupdated(e){this.verbose&&window&&window.console&&console.log(e)}onlastseenupdated(e){this.verbose&&window&&window.console&&console.log(e)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&window&&window.console&&console.log(e)}oncanvasevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncoffeegiven(e){this.verbose&&window&&window.console&&console.log(e)}onroleassign(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelended(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionchanged(e){this.verbose&&window&&window.console&&console.log(e)}onunmuteevent(e){this.verbose&&window&&window.console&&console.log(e)}ontokensent(e){this.verbose&&window&&window.console&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&window&&window.console&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&window&&window.console&&console.log(e)}onmarkasread(e){this.verbose&&window&&window.console&&console.log(e)}onvoicereactionmessage(e){this.verbose&&window&&window.console&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&window&&window.console&&console.log(e)}onactivityupdated(e){this.verbose&&window&&window.console&&console.log(e)}onsdtopicevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onuserstatusevent(e){this.verbose&&window&&window.console&&console.log(e)}onjoinchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onunpinmessageevent(e){this.verbose&&window&&window.console&&console.log(e)}onquickmenuevent(e){this.verbose&&window&&window.console&&console.log(e)}ontransferownership(e){this.verbose&&window&&window.console&&console.log(e)}onbanneduser(e){this.verbose&&window&&window.console&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&window&&window.console&&console.log(e)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}onrefreshsession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,n,i,c={},l={}){let s={token:e,vars:c};return this.transport.authenticateMezon(this.serverkey,"",s,t,n,i,l).then(o=>new O(o.token||"",o.refresh_token||"",o.created||!1,o.api_url||"",o.ws_url||"",o.id_token||"",o.is_remember||!1))}authenticateSMSOTPRequest(e,t,n){let i={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",i,t).then(c=>Promise.resolve(c))}authenticateEmailOTPRequest(e,t,n){let i={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",i,t).then(c=>Promise.resolve(c))}confirmAuthenticateOTP(e){return d(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,n,i){let c={username:n,account:{email:e,password:t,vars:i}};return this.transport.authenticateEmail(this.serverkey,"",c,n).then(l=>new O(l.token||"",l.refresh_token||"",l.created||!1,l.api_url||"",l.ws_url||"",l.id_token||"",l.is_remember||!1))}setBasePath(e,t,n){this.host=e,this.port=t,this.useSSL=n;let c=`${n?"https://":"http://"}${e}:${t}`;return this.transport.setBasePath(c)}addChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(e.token,t,n).then(i=>i!==void 0)})}addFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(e.token,t,n)})}blockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(e.token,t,n).then(i=>Promise.resolve(i!=null))})}unblockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(e.token,t,n).then(i=>Promise.resolve(i!=null))})}uploadOauthFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(e.token,t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(e.token,t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(e.token,t)})}createCategoryDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(e.token,t).then(n=>Promise.resolve(n))})}createRole(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(e.token,t).then(n=>Promise.resolve(n))})}createEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(e.token,t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(e.token,t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(e.token,t).then(n=>n!==void 0)})}deleteApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(e.token,t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(e.token,t,n).then(i=>i!==void 0)})}deleteChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(e.token,t,n).then(i=>i!==void 0)})}deleteClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(e.token,t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(e.token,t,n,i).then(c=>c!==void 0)})}deleteNotifications(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(e.token,t,n).then(i=>Promise.resolve(i!=null))})}deleteRole(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(e.token,t,"0",n,i).then(c=>c!==void 0)})}deleteEvent(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(e.token,t,n,i,c,l).then(s=>s!==void 0)})}updateEventUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(e.token,t).then(n=>n!==void 0)})}emitEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(e.token,t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(e.token,t,n).then(i=>Promise.resolve(i!=null))})}listBannedUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(e.token,t,n).then(i=>Promise.resolve(i))})}unbanClanUsers(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(e.token,t,n,i).then(c=>Promise.resolve(c!=null))})}banClanUsers(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(e.token,t,n,i,c).then(l=>Promise.resolve(l!=null))})}removeChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(e.token,t,n).then(i=>Promise.resolve(i!=null))})}listChannelMessages(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(e.token,t,n,i,c,l,s).then(o=>{let a={messages:[],last_seen_message:o.last_seen_message,last_sent_message:o.last_sent_message};return o.messages==null||o.messages.forEach(h=>{let m,_,y,C,b;try{m=P(h.content)}catch(A){console.log("error parse content",A)}try{let A=B(h.reactions);_=(A==null?void 0:A.reactions)||A||P(h.reactions||"[]")}catch(A){_=P(h.reactions||"[]")}try{let A=T(h.mentions);y=(A==null?void 0:A.mentions)||A||P(h.mentions||"[]")}catch(A){y=P(h.mentions||"[]")}try{let A=z(h.attachments);C=(A==null?void 0:A.attachments)||A||P(h.attachments||"[]")}catch(A){C=P(h.attachments||"[]")}try{let A=D(h.references);b=(A==null?void 0:A.refs)||A||P(h.references||"[]")}catch(A){b=P(h.references||"[]")}a.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:m,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:C,mentions:y,reactions:_,references:b,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(a)})})}listChannelVoiceUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(e.token,t,n).then(i=>{let c={voice_channel_users:[]};return i.voice_channel_users==null||i.voice_channel_users.forEach(l=>{c.voice_channel_users.push({id:l.id,channel_id:l.channel_id,user_ids:l.user_ids,participant:l.participant})}),Promise.resolve(c)})})}listChannelUsers(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(e.token,t,n,i,l,c,s).then(o=>{let a={channel_users:[],cursor:o.cursor,channel_id:o.channel_id};return o.channel_users==null||o.channel_users.forEach(h=>{a.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(a)})})}listChannelAttachments(e,t,n,i,c,l,s,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(e.token,n,t,i,l,c,s,o).then(a=>{let h={attachments:[]};return a.attachments==null||a.attachments.forEach(m=>{h.attachments.push({filename:m.filename,filesize:m.filesize,filetype:m.filetype,id:m.id,uploader:m.uploader,url:m.url,message_id:m.message_id,create_time_seconds:m.create_time_seconds,width:m.width,height:m.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(e.token,t).then(n=>{let i={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(c=>{var l;i.clan_users.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,is_mobile:(l=c.user)==null?void 0:l.is_mobile,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,user_status:c.user.user_status,status:c.user.status,about_me:c.user.about_me,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,join_time_seconds:c.user.join_time_seconds},role_id:c.role_id,clan_nick:c.clan_nick,clan_avatar:c.clan_avatar})}),Promise.resolve(i)})})}listClanUsersStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(e.token,t).then(n=>{let i={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(c=>{i.clan_user_statuses.push({user_id:c.user_id,user_status:c.user_status})}),Promise.resolve(i)})})}listChannelDetail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(e.token,t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(e.token,t,n,i,c,l,s).then(o=>{let a={channeldesc:[],next_cursor:o.next_cursor,prev_cursor:o.prev_cursor,cacheable_cursor:o.cacheable_cursor};return o.channeldesc==null||(a.channeldesc=o.channeldesc),Promise.resolve(a)})})}listClanDescs(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(e.token,t,n,i).then(c=>{let l={clandesc:[]};return c.clandesc==null||(l.clandesc=c.clandesc),Promise.resolve(l)})})}listChannelBadgeCount(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(e.token,t,n,i).then(c=>{var l;return{channeldesc:(l=c.channeldesc)!=null?l:[],total_count:c.total_count}})})}listUserOnline(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(e.token,t,n,i).then(c=>{var l;return{users:(l=c.users)!=null?l:[],total_count:c.total_count}})})}listCategoryDescs(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(e.token,t,n,i).then(c=>{let l={categorydesc:[]};return c.categorydesc==null||(l.categorydesc=c.categorydesc),Promise.resolve(l)})})}listEvents(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(e.token,t).then(n=>Promise.resolve(n))})}getListPermission(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(e.token,t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(e.token,t,n,i).then(c=>Promise.resolve(c))})}registFCMDeviceToken(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(e.token,t,n,i,c).then(l=>Promise.resolve(l))})}getUserProfileOnClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(e.token,t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(e.token,t).then(n=>n!==void 0)})}openDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(e.token,t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(e.token,t)})}linkSMS(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(e.token,t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(e.token,t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(e.token,n,t,i).then(c=>{let l={friends:[],cursor:c.cursor};return c.friends==null||c.friends.forEach(s=>{var o;l.friends.push({user:{avatar_url:s.user.avatar_url,create_time_seconds:s.user.create_time_seconds,display_name:s.user.display_name,edge_count:s.user.edge_count?Number(s.user.edge_count):0,id:s.user.id,lang_tag:s.user.lang_tag,location:s.user.location,online:s.user.online,timezone:s.user.timezone,update_time:s.user.update_time,username:s.user.username,is_mobile:(o=s.user)==null?void 0:o.is_mobile,user_status:s.user.user_status,status:s.user.status,mezon_id:s.user.mezon_id,list_nick_names:s.user.list_nick_names,phone_number:s.user.phone_number,about_me:s.user.about_me},state:s.state,source_id:s.source_id})}),Promise.resolve(l)})})}listNotifications(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(e.token,n,t,i,c,l).then(s=>{let o={cacheable_cursor:s.cacheable_cursor,notifications:[]};return s.notifications==null||s.notifications.forEach(a=>{o.notifications.push({id:a.id,subject:a.subject,content:a.content?N(a.content):void 0,code:a.code?Number(a.code):0,sender_id:a.sender_id,create_time_seconds:a.create_time_seconds,persistent:a.persistent,category:a.category})}),Promise.resolve(o)})})}sessionLogout(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout(e.token,{refresh_token:n,token:t,device_id:i,platform:c}).then(l=>l!==void 0)})}unlinkEmail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(e.token,t).then(n=>n!==void 0)})}updateUsername(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(e.token,t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(e.token,t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(e.token,t,n).then(i=>i!==void 0)})}updateClanDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(e.token,t,n).then(i=>i!==void 0)})}updateCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(e.token,t,n).then(i=>i!==void 0)})}updateUserProfileByClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(e.token,t,n).then(i=>i!==void 0)})}updateRole(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(e.token,t,n).then(i=>i!==void 0)})}updateEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(e.token,t,n).then(i=>i!==void 0)})}updateApp(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(e.token,t,n).then(i=>Promise.resolve(i))})}createLinkInviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(e.token,t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return d(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(e.token,t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(e.token,t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(e.token,t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(e.token,t).then(n=>n!==void 0)})}setMuteCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(e.token,t).then(n=>n!==void 0)})}setMuteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(e.token,t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(e.token,t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(e.token,t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(e.token,t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(e.token,t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage(e.token,{channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(e.token,t).then(n=>n!==void 0)})}searchMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(e.token,t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(e.token,t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(e.token,t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(e.token,t,n,i).then(c=>{let l={pin_messages_list:[]};return c.pin_messages_list==null||c.pin_messages_list.forEach(s=>{l.pin_messages_list.push({id:s.id,avatar:s.avatar,channel_id:s.channel_id,content:s.content,create_time_seconds:s.create_time_seconds,message_id:s.message_id,sender_id:s.sender_id,username:s.username,attachment:s.attachment})}),Promise.resolve(l)})})}deletePinMessage(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(e.token,t,n,i,c).then(l=>l!==void 0)})}createClanEmoji(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(e.token,t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(e.token,t,n).then(i=>i!==void 0)})}deleteByIdClanEmoji(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(e.token,t,n,i).then(c=>c!==void 0)})}generateWebhookLink(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(e.token,t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(e.token,t,n).then(i=>Promise.resolve(i))})}updateWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(e.token,t,n).then(i=>i!==void 0)})}deleteWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(e.token,t,n).then(i=>i!==void 0)})}addClanSticker(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(e.token,t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(e.token,t,n,i).then(c=>c!==void 0)})}updateClanStickerById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(e.token,t,n).then(i=>i!==void 0)})}changeChannelCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(e.token,t,n).then(i=>i!==void 0)})}setRoleChannelPermission(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(e.token,t).then(n=>n!==void 0)})}addApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(e.token,t).then(n=>Promise.resolve(n))})}getApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(e.token,t).then(n=>Promise.resolve(n))})}listApps(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(e.token,t,n).then(i=>i!==void 0)})}getSystemMessagesList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(e.token,t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(e.token,t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(e.token,t,n).then(i=>Promise.resolve(i))})}deleteSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(e.token,t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(e.token,t).then(n=>Promise.resolve(n))})}givecoffee(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.giveMeACoffee(e.token,t).then(n=>n!==void 0)})}sendToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendToken(e.token,t).then(n=>n!==void 0)})}listStreamingChannelUsers(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(e.token,t,n,i,l,c,s).then(o=>{let a={streaming_channel_users:[]};return o.streaming_channel_users==null||o.streaming_channel_users.forEach(h=>{a.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant})}),Promise.resolve(a)})})}registerStreamingChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(e.token,t).then(n=>n!==void 0)})}listChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(e.token,t).then(n=>{let i={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(c=>{i.channel_apps.push({id:c.id,channel_id:c.channel_id,app_id:c.app_id,clan_id:c.clan_id,app_url:c.app_url,app_name:c.app_name,app_logo:c.app_logo})}),Promise.resolve(i)})})}getChannelCategoryNotiSettingsList(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(e.token,t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(e.token,t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(e.token,t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(e.token,t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(e.token,t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(e.token,t,n).then(i=>Promise.resolve(i))})}getListEmojisByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(e.token,t,n,i,c).then(l=>{let s={clan_id:t,roles:l.roles};return Promise.resolve(s)})})}listUserPermissionInChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(e.token,t,n).then(i=>{let c={clan_id:t,channel_id:n,permissions:i.permissions};return Promise.resolve(c)})})}getPermissionByRoleIdChannelId(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(e.token,t,n,i).then(c=>{let l={role_id:t,channel_id:n,permission_role_channel:c.permission_role_channel,user_id:i};return Promise.resolve(l)})})}markAsRead(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(e.token,t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(e.token,t,n,i,c,l,s).then(o=>{let a={channeldesc:[]};return o.channeldesc==null||(a.channeldesc=o.channeldesc),Promise.resolve(a)})})}listChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(e.token,t).then(n=>{var i;return(i=n.events)==null||i.forEach(c=>{c.attachments=[];let l;try{let s=q(c.preview_imgs);l=(s==null?void 0:s.attachments)||s||P(c.preview_imgs||"[]")}catch(s){l=P(c.preview_imgs||"[]")}Array.isArray(l)?c.preview_imgs=l:c.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let s=q(i.attachments),o=q(i.preview_imgs);c=(s==null?void 0:s.attachments)||s||P(i.attachments||"[]"),l=(o==null?void 0:o.attachments)||o||P(i.preview_imgs||"[]")}catch(s){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let s=q(i.attachments),o=q(i.preview_imgs);c=(s==null?void 0:s.attachments)||s||P(i.attachments||"[]"),l=(o==null?void 0:o.attachments)||o||P(i.preview_imgs||"[]")}catch(s){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let s=q(i.attachments),o=q(i.preview_imgs);c=(s==null?void 0:s.attachments)||s||P(i.attachments||"[]"),l=(o==null?void 0:o.attachments)||o||P(i.preview_imgs||"[]")}catch(s){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(e.token,t,n).then(i=>Promise.resolve(i))})}archiveChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(e.token,t,n).then(i=>Promise.resolve(i))})}listArchivedChannelDescs(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(e.token,t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,i,c,l,s,o,a,h,m){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(e.token,t,n,i,c,l,s,o,a,h,m).then(_=>Promise.resolve(_))})}getChannelCanvasList(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(e.token,t,n,i,c).then(l=>{let s={channel_canvases:[]};return l.channel_canvases==null||(s.clan_id=l.clan_id,s.channel_id=l.channel_id,s.channel_canvases=l.channel_canvases,s.count=l.count),Promise.resolve(s)})})}getChannelCanvasDetail(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(e.token,t,n,i).then(c=>Promise.resolve(c))})}editChannelCanvases(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(e.token,t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(e.token,t,n,i).then(c=>c!==void 0)})}addFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite(e.token,{channel_id:t,clan_id:n}).then(i=>i)})}removeFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(e.token,t,n).then(i=>i)})}getListFavoriteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(e.token,t).then(n=>n)})}listActivity(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(e.token,t).then(n=>n)})}createQRLogin(e){return d(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return d(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(e.token,t,n).then(i=>i)})}getChanEncryptionMethod(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(e.token,t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(e.token,t,{method:n}).then(i=>i)})}getPubKeys(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(e.token,t).then(n=>n)})}pushPubKey(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey(e.token,{PK:t}).then(n=>n)})}getKeyServer(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(e.token,t,n,i,c).then(l=>l)})}listOnboarding(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(e.token,t,n,i,c).then(l=>l)})}getOnboardingDetail(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(e.token,t,n).then(i=>Promise.resolve(i))})}createOnboarding(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(e.token,t).then(n=>n)})}updateOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(e.token,t,n).then(i=>i!==void 0)})}deleteOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(e.token,t,n).then(i=>i!==void 0)})}generateClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(e.token,t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(e.token,t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(e.token,t,n).then(i=>i!==void 0)})}updateClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(e.token,t,n).then(i=>i!==void 0)})}listOnboardingStep(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(e.token,t,n,i).then(c=>Promise.resolve(c))})}updateOnboardingStepByClanId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(e.token,t,n).then(i=>i!==void 0)})}updateUserStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(e.token,t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(e.token,t).then(n=>n!==void 0)})}getUserStatus(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(e.token,t,n).then(i=>Promise.resolve(i))})}createSdTopic(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(e.token,t).then(n=>n)})}getTopicDetail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(e.token,t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(e.token,t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(e.token,t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(e.token,t,n).then(i=>Promise.resolve(i))})}updateMezonOauthClient(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(e.token,t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(e.token,t,n,i).then(c=>Promise.resolve(c))})}generateHashChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(e.token,t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail(e.token,{email:t,password:n,old_password:i}).then(c=>Promise.resolve(c))})}addUserEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(e.token,t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(e.token,t,n).then(i=>i!==void 0)})}updateRoleOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(e.token,t).then(n=>Promise.resolve(n))})}deleteAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,i,c){return d(this,null,function*(){return this.transport.generateMeetTokenExternal("",e,t,n,i,c).then(l=>Promise.resolve(l))})}removeMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(e.token,t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(e.token,t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(e.token,t).then(n=>n!==void 0)})}listClanDiscover(e,t){return d(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e,t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(e.token,t,n,i).then(c=>Promise.resolve(c))})}deleteQuickMenuAccess(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(e.token,t,n).then(i=>i!==void 0)})}addQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(e.token,t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(e.token,t).then(n=>n!==void 0)})}listForSaleItems(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(e.token,t).then(n=>Promise.resolve(n))})}isFollower(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(e.token,t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(e.token,t).then(n=>n!==void 0)})}isBanned(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(e.token,t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(e.token,t,n).then(i=>i!==void 0)})}updateMezonVoiceState(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(e.token,t,n,i,c,l).then(s=>s!==void 0)})}sendChannelMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(e.token,t,n,i,c,l,s,o,a,h,m,_,y,C).then(b=>Promise.resolve(b))})}updateChannelMessage(e,t,n,i,c,l,s,o,a,h,m,_){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(e.token,t,n,i,c,l,s,o,a,h,m,_).then(y=>Promise.resolve(y))})}deleteChannelMessage(e,t,n,i,c,l,s,o,a,h){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(e.token,t,n,i,c,l,s,o,a,h).then(m=>Promise.resolve(m))})}messageButtonClick(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(e.token,t,n,i,c,l,s).then(o=>Promise.resolve(o))})}dropdownBoxSelected(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(e.token,t,n,i,c,l,s).then(o=>Promise.resolve(o))})}activeArchivedThread(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(e.token,t,n).then(i=>Promise.resolve(i))})}addAgentToChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(e.token,t,n).then(i=>Promise.resolve(i))})}disconnectAgent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(e.token,t,n).then(i=>Promise.resolve(i))})}listMutedChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(e.token,t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(e.token,t,n,i,c,l,s,o,a,h,m,_,y,C).then(b=>Promise.resolve(b))})}createPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(e.token,t)})}votePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(e.token,t)})}closePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(e.token,t)})}getPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(e.token,t)})}followUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,i,c)})}leaveChat(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,i,c)})}removeChatMessage(e,t,n,i,c,l,s,o,a,h){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,i,c,l,s,o,a,h)})}unfollowUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,i,c,l,s,o,a,h,m,_){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,i,c,l,s,o,a,h,m,_)})}updateStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,i,c,l,s,o,a,h,m,_,y,C,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,i,c,l,s,o,a,h,m,_,y,C,b)})}writeEphemeralMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C,b,A){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,i,c,l,s,o,a,h,m,_,y,C,b,A)})}writeChatMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,i,c,l,s,o,a,h,m,_,y,C)})}writeMessageReaction(e,t,n,i,c,l,s,o,a,h,m,_,y,C,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,i,c,l,s,o,a,h,m,_,y,C,b)})}writeMessageTyping(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,i,c,l,s)})}writeLastSeenMessage(e,t,n,i,c,l,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,i,c,l,s)})}writeLastPinMessage(e,t,n,i,c,l,s,o,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,i,c,l,s,o,a,h,m,_,y,C)})}writeCustomStatus(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,i,c)})}writeVoiceReaction(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}forwardWebrtcSignaling(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,i,c,l)})}makeCallPush(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,i,c)})}writeChannelAppEvent(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,i)})}listDataSocket(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listDataSocket(t)})}};U.DefaultHeartbeatTimeoutMs=1e4,U.DefaultConnectTimeoutMs=3e4;var Q=U;export{ne as ApiAppRole,ie as ChannelStreamMode,se as ChannelType,Q as Client,p as ConnectionState,J as CreateChannelMessageFromEvent,re as NotificationType,O as Session,oe as WebrtcSignalingType,ge as b64DecodeUnicode,me as b64EncodeUnicode,g as buildFetchOptions,z as decodeAttachments,q as decodeChannelTimelineAttachments,T as decodeMentions,N as decodeNotificationFcm,B as decodeReactions,D as decodeRefs,fe as encodeAttachments,_e as encodeMentions,be as encodeNotificationFcm,Ce as encodeReactions,ye as encodeRefs,P as safeJSONParse};
1
+ var K=Object.defineProperty,Y=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var j=(f,e,t)=>e in f?K(f,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[e]=t,v=(f,e)=>{for(var t in e||(e={}))Z.call(e,t)&&j(f,t,e[t]);if(G)for(var t of G(e))X.call(e,t)&&j(f,t,e[t]);return f},M=(f,e)=>Y(f,$(e));var d=(f,e,t)=>new Promise((n,i)=>{var c=s=>{try{o(t.next(s))}catch(a){i(a)}},l=s=>{try{o(t.throw(s))}catch(a){i(a)}},o=s=>s.done?n(s.value):Promise.resolve(s.value).then(c,l);o((t=t.apply(f,e)).next())});import"whatwg-fetch";import{encode as ee,decode as te}from"js-base64";import*as R from"mezon-js-protobuf";function g(f,e,t){let n=v({method:f},e);return n.headers=v({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(i=>{n.headers[i]||delete n.headers[i]}),t&&(n.body=t),n}function me(f){return ee(encodeURIComponent(f).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function ge(f){return decodeURIComponent(te(f).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(f){if(f==null)return{t:f};let e;if(f instanceof Uint8Array)e=new TextDecoder().decode(f);else if(typeof f=="string")e=f;else return typeof f=="object"?f:{t:f};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var L=f=>!f||f===null||f===void 0||f===""||f==="[]";function T(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageMentionList.decode(i)}catch(n){return P(f)}}function z(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageAttachmentList.decode(i)}catch(n){return P(f)}}function q(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(i)}catch(n){return P(f)}}function D(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageRefList.decode(i)}catch(n){return P(f)}}function B(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.MessageReactionList.decode(i)}catch(n){return P(f)}}function N(f){if(L(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,i=new Uint8Array(n);return R.DirectFcmProto.decode(i)}catch(n){return P(f)}}function _e(f){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(f)).finish()}function fe(f){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(f)).finish()}function ye(f){return R.MessageRefList.encode(R.MessageRefList.fromPartial(f)).finish()}function Ce(f){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(f)).finish()}function be(f){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(f)).finish()}var ne=(c=>(c[c.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",c[c.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",c[c.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",c[c.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",c[c.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",c))(ne||{}),se=(a=>(a[a.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",a[a.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",a[a.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",a[a.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",a[a.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",a[a.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",a[a.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",a[a.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",a[a.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",a))(se||{}),ie=(c=>(c[c.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",c[c.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",c[c.STREAM_MODE_DM=4]="STREAM_MODE_DM",c[c.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",c[c.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",c))(ie||{}),re=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(re||{}),oe=(a=>(a[a.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",a[a.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",a[a.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",a[a.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",a[a.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",a[a.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",a[a.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",a[a.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",a[a.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",a))(oe||{});function J(f){let e,t,n,i,c,l;try{e=P(f.channel_message.content)}catch(s){console.log("content is invalid",s)}try{t=B(f.channel_message.reactions)}catch(s){console.log("reactions is invalid",s)}try{n=T(f.channel_message.mentions)}catch(s){console.log("mentions is invalid",s)}try{i=z(f.channel_message.attachments)}catch(s){console.log("attachments is invalid",s)}try{c=D(f.channel_message.references)}catch(s){console.log("references is invalid",s)}try{l=f.channel_message.referenced_message}catch(s){console.log("referenced messages is invalid",s)}return{id:f.id||f.channel_message.message_id,avatar:f.channel_message.avatar,channel_id:f.channel_message.channel_id,mode:f.channel_message.mode,channel_label:f.channel_message.channel_label,clan_id:f.channel_message.clan_id,code:f.channel_message.code,message_id:f.channel_message.message_id,sender_id:f.channel_message.sender_id,update_time:f.channel_message.update_time,clan_logo:f.channel_message.clan_logo,category_name:f.channel_message.category_name,username:f.channel_message.username,clan_nick:f.channel_message.clan_nick,clan_avatar:f.channel_message.clan_avatar,display_name:f.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:i==null?void 0:i.attachments,referenced_message:l,references:c==null?void 0:c.refs,hide_editted:f.channel_message.hide_editted,is_public:f.channel_message.is_public,create_time_seconds:f.channel_message.create_time_seconds,update_time_seconds:f.channel_message.update_time_seconds,topic_id:f.channel_message.topic_id}}import*as H from"js-base64";var O=class f{constructor(e,t,n,i,c,l,o){this.created=n;this.api_url=i;this.ws_url=c;this.id_token=l;this.token=e,this.refresh_token=t,this.id_token=l,this.api_url=i,this.ws_url=c,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=o,this.update(e,t,o)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,n){let i=e.split(".");if(i.length!=3)throw"jwt is not valid.";let c=JSON.parse(H.atob(i[1])),l=Math.floor(parseInt(c.exp));if(t){let o=t.split(".");if(o.length!=3)throw"refresh jwt is not valid.";let s=JSON.parse(H.atob(o[1])),a=Math.floor(parseInt(s.exp));this.refresh_expires_at=a,this.refresh_token=t,this.is_remember=n}this.token=e,this.expires_at=l,this.username=c.usn,this.user_id=c.uid,this.vars=c.vrs}static restore(e,t,n,i,c){return new f(e,t,!1,n,i,"",c)}};import{encode as k}from"js-base64";import*as r from"mezon-js-protobuf";import{WebSocketAdapter as ae}from"mezon-js-protobuf";var I=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListChannelBadgeCount=17]="ListChannelBadgeCount",u[u.ListClanUsersStatus=18]="ListClanUsersStatus",u[u.ListChannelApps=19]="ListChannelApps",u[u.GetListFavoriteChannel=20]="GetListFavoriteChannel",u[u.ListCategoryDescs=21]="ListCategoryDescs",u[u.ListOnboarding=22]="ListOnboarding",u[u.GetListStickersByUserId=23]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=24]="GetSystemMessageByClanId",u[u.GetPinMessagesList=25]="GetPinMessagesList",u[u.GetChannelCanvasList=26]="GetChannelCanvasList",u[u.ListChannelTimeline=27]="ListChannelTimeline",u[u.ListChannelMessages=28]="ListChannelMessages",u[u.ListActivity=29]="ListActivity",u[u.ListChannelByUserId=30]="ListChannelByUserId",u[u.ListUserClansByUserId=31]="ListUserClansByUserId",u[u.GetUserProfileOnClan=32]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=33]="RegistFCMDeviceToken",u[u.IsBanned=34]="IsBanned",u[u.ListThreadDescs=35]="ListThreadDescs",u[u.ListArchivedChannelDescs=36]="ListArchivedChannelDescs",u[u.ListChannelDetail=37]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=38]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=39]="ListRoleUsers",u[u.ListChannelUsers=40]="ListChannelUsers",u[u.ListChannelAttachment=41]="ListChannelAttachment",u[u.ListChannelVoiceUsers=42]="ListChannelVoiceUsers",u[u.ListUserOnline=43]="ListUserOnline",u[u.ListNotifications=44]="ListNotifications",u[u.ListChannelUsersUC=45]="ListChannelUsersUC",u[u.ListWebhookByChannelId=46]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=47]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=48]="ListChannelSetting",u[u.ListApps=49]="ListApps",u[u.GetApp=50]="GetApp",u[u.ListForSaleItems=51]="ListForSaleItems",u[u.ListClanWebhook=52]="ListClanWebhook",u[u.GetUserStatus=53]="GetUserStatus",u[u.ListSdTopic=54]="ListSdTopic",u[u.AddFriends=55]="AddFriends",u[u.AddChannelUsers=56]="AddChannelUsers",u[u.RegistrationEmail=57]="RegistrationEmail",u[u.BlockFriends=58]="BlockFriends",u[u.UnblockFriends=59]="UnblockFriends",u[u.UploadAttachmentFile=60]="UploadAttachmentFile",u[u.UploadOauthFile=61]="UploadOauthFile",u[u.AddRolesChannelDesc=62]="AddRolesChannelDesc",u[u.CreateCategoryDesc=63]="CreateCategoryDesc",u[u.CreateChannelDesc=64]="CreateChannelDesc",u[u.CreateRole=65]="CreateRole",u[u.CreateEvent=66]="CreateEvent",u[u.DeleteRole=67]="DeleteRole",u[u.DeleteEvent=68]="DeleteEvent",u[u.DeleteRoleChannelDesc=69]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=70]="DeleteChannelDesc",u[u.CloseDMByChannelId=71]="CloseDMByChannelId",u[u.OpenDMByChannelId=72]="OpenDMByChannelId",u[u.DeleteAccount=73]="DeleteAccount",u[u.DeleteFriends=74]="DeleteFriends",u[u.DeleteCategoryDesc=75]="DeleteCategoryDesc",u[u.DeleteNotifications=76]="DeleteNotifications",u[u.DeleteClanDesc=77]="DeleteClanDesc",u[u.UpdateUser=78]="UpdateUser",u[u.UpdateUserProfileByClan=79]="UpdateUserProfileByClan",u[u.UpdateClanOrder=80]="UpdateClanOrder",u[u.RemoveChannelUsers=81]="RemoveChannelUsers",u[u.LeaveThread=82]="LeaveThread",u[u.ArchiveChannel=83]="ArchiveChannel",u[u.LinkSMS=84]="LinkSMS",u[u.ConfirmLinkMezonOTP=85]="ConfirmLinkMezonOTP",u[u.LinkEmail=86]="LinkEmail",u[u.CreateClanDesc=87]="CreateClanDesc",u[u.RemoveClanUsers=88]="RemoveClanUsers",u[u.BanClanUsers=89]="BanClanUsers",u[u.CreateLinkInviteUser=90]="CreateLinkInviteUser",u[u.InviteUser=91]="InviteUser",u[u.SetRoleChannelPermission=92]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=93]="SetNotificationChannelSetting",u[u.SetMuteChannel=94]="SetMuteChannel",u[u.SetMuteCategory=95]="SetMuteCategory",u[u.SetNotificationClanSetting=96]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=97]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=98]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=99]="DeleteNotificationChannel",u[u.CreatePinMessage=100]="CreatePinMessage",u[u.CreateMessage2Inbox=101]="CreateMessage2Inbox",u[u.UnlinkMezon=102]="UnlinkMezon",u[u.UnlinkEmail=103]="UnlinkEmail",u[u.UpdateAccount=104]="UpdateAccount",u[u.UpdateUsername=105]="UpdateUsername",u[u.UpdateCategory=106]="UpdateCategory",u[u.UpdateCategoryOrder=107]="UpdateCategoryOrder",u[u.UpdateRoleOrder=108]="UpdateRoleOrder",u[u.UpdateClanDesc=109]="UpdateClanDesc",u[u.UpdateChannelDesc=110]="UpdateChannelDesc",u[u.UpdateChannelPrivate=111]="UpdateChannelPrivate",u[u.UpdateRole=112]="UpdateRole",u[u.UpdateEvent=113]="UpdateEvent",u[u.SearchMessage=114]="SearchMessage",u[u.CreateClanEmoji=115]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=116]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=117]="UpdateClanEmojiById",u[u.GenerateWebhook=118]="GenerateWebhook",u[u.HandleWebhook=119]="HandleWebhook",u[u.UpdateWebhookById=120]="UpdateWebhookById",u[u.DeleteWebhookById=121]="DeleteWebhookById",u[u.AddClanSticker=122]="AddClanSticker",u[u.UpdateClanStickerById=123]="UpdateClanStickerById",u[u.DeleteClanStickerById=124]="DeleteClanStickerById",u[u.ChangeChannelCategory=125]="ChangeChannelCategory",u[u.CheckDuplicateName=126]="CheckDuplicateName",u[u.AddApp=127]="AddApp",u[u.DeleteApp=128]="DeleteApp",u[u.UpdateApp=129]="UpdateApp",u[u.AddAppToClan=130]="AddAppToClan",u[u.CreateSystemMessage=131]="CreateSystemMessage",u[u.UpdateSystemMessage=132]="UpdateSystemMessage",u[u.DeleteSystemMessage=133]="DeleteSystemMessage",u[u.StreamingServerCallback=134]="StreamingServerCallback",u[u.EditChannelCanvases=135]="EditChannelCanvases",u[u.GetChannelCanvasDetail=136]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=137]="DeleteChannelCanvas",u[u.AddChannelFavorite=138]="AddChannelFavorite",u[u.RemoveChannelFavorite=139]="RemoveChannelFavorite",u[u.CreateActiviy=140]="CreateActiviy",u[u.GetPubKeys=141]="GetPubKeys",u[u.PushPubKey=142]="PushPubKey",u[u.GetChanEncryptionMethod=143]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=144]="SetChanEncryptionMethod",u[u.GetKeyServer=145]="GetKeyServer",u[u.ListAuditLog=146]="ListAuditLog",u[u.GetOnboardingDetail=147]="GetOnboardingDetail",u[u.CreateOnboarding=148]="CreateOnboarding",u[u.UpdateOnboarding=149]="UpdateOnboarding",u[u.DeleteOnboarding=150]="DeleteOnboarding",u[u.ListOnboardingStep=151]="ListOnboardingStep",u[u.UpdateOnboardingStep=152]="UpdateOnboardingStep",u[u.GenerateClanWebhook=153]="GenerateClanWebhook",u[u.UpdateClanWebhookById=154]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=155]="DeleteClanWebhookById",u[u.HandleClanWebhook=156]="HandleClanWebhook",u[u.UpdateUserStatus=157]="UpdateUserStatus",u[u.UpdateUserCustomStatus=158]="UpdateUserCustomStatus",u[u.GetTopicDetail=159]="GetTopicDetail",u[u.CreateSdTopic=160]="CreateSdTopic",u[u.DeleteSdTopic=161]="DeleteSdTopic",u[u.CreateExternalMezonMeet=162]="CreateExternalMezonMeet",u[u.GenerateMeetToken=163]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=164]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=165]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=166]="CreateRoomChannelApps",u[u.GetMezonOauthClient=167]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=168]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=169]="UpdateMezonOauthClient",u[u.SearchThread=170]="SearchThread",u[u.GenerateHashChannelApps=171]="GenerateHashChannelApps",u[u.DeleteUserEvent=172]="DeleteUserEvent",u[u.AddUserEvent=173]="AddUserEvent",u[u.DeleteQuickMenuAccess=174]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=175]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=176]="UpdateQuickMenuAccess",u[u.TransferOwnership=177]="TransferOwnership",u[u.SendChannelMessage=178]="SendChannelMessage",u[u.UpdateChannelMessage=179]="UpdateChannelMessage",u[u.DeleteChannelMessage=180]="DeleteChannelMessage",u[u.ReportMessageAbuse=181]="ReportMessageAbuse",u[u.MessageButtonClick=182]="MessageButtonClick",u[u.ActiveArchivedThread=183]="ActiveArchivedThread",u[u.UpdateChannelTimeline=184]="UpdateChannelTimeline",u[u.AddAgentToChannel=185]="AddAgentToChannel",u[u.DisconnectAgent=186]="DisconnectAgent",u[u.CreateChannelTimeline=187]="CreateChannelTimeline",u[u.DetailChannelTimeline=188]="DetailChannelTimeline",u[u.CreatePoll=189]="CreatePoll",u[u.VotePoll=190]="VotePoll",u[u.ClosePoll=191]="ClosePoll",u[u.GetPoll=192]="GetPoll",u[u.ReactChannelMessage=193]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=194]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=195]="MultipartUploadAttachmentFileFinish",u))(I||{}),x=class x{constructor(e,t,n,i){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=i,n?this.adapter=n:this.adapter=new ae}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in I)return I[e]}connect(e,t,n=!1,i=!1,c,l,o){let[s,a]=t.split(":");this.adapter.connect(s,a,n,e,o),this.adapter.onClose=l,this.adapter.onMessage=(h,m,_)=>d(this,null,function*(){if(i&&window&&window.console&&console.log("incomming message with cid %o and message %o",h,_),h!=0){let y=this.cIds[h];if(!y){console.error("No promise executor for message: %o",_);return}delete this.cIds[h],_.error?y.reject(_.error):y.resolve({code:m,message:_})}else yield c(0,0,_)})}send(e,t=x.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:i}=e,c=i;if(n!=null&&n.includes("/mezon.api.Mezon/")){let l=n.substring(17);c={api_request_event:{api_index:this.getApiFromPath(l),api_name:l,body:i.body}}}return new Promise((l,o)=>{var s,a;if(!this.adapter.isOpen())o("Socket connection has not been established yet.");else{c.channel_message_send?c.channel_message_send.content=JSON.stringify(c.channel_message_send.content):c.channel_message_update?c.channel_message_update.content=JSON.stringify(c.channel_message_update.content):c.ephemeral_message_send?c.ephemeral_message_send.message.content=JSON.stringify((s=c.ephemeral_message_send.message)==null?void 0:s.content):c.quick_menu_event&&(c.quick_menu_event.message.content=JSON.stringify((a=c.quick_menu_event.message)==null?void 0:a.content));let h=this.generatecid();this.cIds[h]={resolve:l,reject:o},t!==1/0&&t>0&&setTimeout(()=>{o("The socket timed out while waiting for a response.")},t),c.cid=h.toString(),this.adapter.send(c)}})}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let n="/mezon.api.Mezon/DeleteAccount",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>l),new Promise((l,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let n="/mezon.api.Mezon/GetAccount",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.Account.decode(l.message)})),new Promise((l,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateAccount",l=r.UpdateAccountRequest.encode(r.UpdateAccountRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/checklogin",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmlogin",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(t,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Bearer "+e),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>h),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/createqrlogin",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LoginIDResponse.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/smsotp",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/emailotp",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/email",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,i,c,l,o={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let s="/v2/account/authenticate/mezon",a=new Map;a.set("create",i),a.set("username",c),a.set("is_remember",l);let h="";h=JSON.stringify(n||{});let m=this.buildFullUrl(this.basePath,s,a),_=g("POST",o,h);return e&&(_.headers.Authorization="Basic "+k(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(m,_).then(y=>d(this,null,function*(){let C=yield y.arrayBuffer();return r.Session.decode(new Uint8Array(C))})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/LinkEmail",l=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/LinkSMS",l=r.AccountMezon.encode(r.AccountMezon.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=r.LinkAccountConfirmRequest.encode(r.LinkAccountConfirmRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmotp",l=new Map,o="";o=JSON.stringify(n||{});let s=this.buildFullUrl(this.basePath,c,l),a=g("POST",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.Session.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RegistrationEmail",l=r.RegistrationEmailRequest.encode(r.RegistrationEmailRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,i={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SessionRefresh",o=r.SessionRefreshRequest.encode(r.SessionRefreshRequest.fromPartial(n)).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Basic "+k(e+":"+t)),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.Session.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UnlinkEmail",l=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let n="/mezon.api.Mezon/ListActivity",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.ListUserActivity.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateActiviy",l=r.CreateActivityRequest.encode(r.CreateActivityRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.UserActivity.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddApp",l=r.AddAppRequest.encode(r.AddAppRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.App.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListApps",s=r.ListAppsRequest.encode(r.ListAppsRequest.fromPartial({filter:t,tombstones:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.AppList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n,i={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddAppToClan",o=r.AppClan.encode(r.AppClan.fromPartial({app_id:t,clan_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteApp",l=r.App.encode(r.App.fromPartial({id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetApp",l=r.App.encode(r.App.fromPartial({id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.App.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateApp",o=r.UpdateAppRequest.encode(r.UpdateAppRequest.fromPartial(M(v({},n),{id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.App.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,i,c,l={}){let o="/mezon.api.Mezon/ListAuditLog",a=r.ListAuditLogRequest.encode(r.ListAuditLogRequest.fromPartial({clan_id:i,user_id:n,action_log:t,date_log:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return r.ListAuditLog.decode(m)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateCategoryOrder",l=r.UpdateCategoryOrderRequest.encode(r.UpdateCategoryOrderRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,i,c,l,o={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListCategoryDescs",h=r.CategoryDesc.encode(r.CategoryDesc.fromPartial({clan_id:t,creator_id:n,category_name:i,category_id:c,category_order:l})).finish(),m=g("POST",o,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:m}).then(_=>d(this,null,function*(){return _.code!=0?{}:r.CategoryDescList.decode(_.message)})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,n={}){let i="/mezon.api.Mezon/ListChannelApps",l=r.ListChannelAppsRequest.encode(r.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ListChannelAppsResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,i,c,l={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasList",a=r.ChannelCanvasListRequest.encode(r.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:n,limit:i,page:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ChannelCanvasListResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddChannelFavorite",l=r.AddFavoriteChannelRequest.encode(r.AddFavoriteChannelRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.AddFavoriteChannelResponse.decode(s)})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelFavorite",o=r.RemoveFavoriteChannelRequest.encode(r.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetListFavoriteChannel",l=r.ListFavoriteChannelRequest.encode(r.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ListFavoriteChannelResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,i,c,l,o,s={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelMessages",m=r.ListChannelMessagesRequest.encode(r.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:n,message_id:i,direction:c,limit:l,topic_id:o})).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return r.ChannelMessageList.decode(y)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddChannelUsers",o=r.AddChannelUsersRequest.encode(r.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,i,c,l,o,s,a,h={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let m="/mezon.api.Mezon/ListChannelAttachment",y=r.ListChannelAttachmentRequest.encode(r.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:n,file_type:i,limit:c,state:l,before:o,after:s,around:a})).finish(),C=g("POST",h,"");return C.body=y,e&&(C.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:m,fetchOptions:C}).then(b=>d(this,null,function*(){return b.code!=0?{}:r.ChannelAttachmentList.decode(b.message)})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChanEncryptionMethod",o=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial({channel_id:t,method:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ChanEncryptionMethod.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SetChanEncryptionMethod",o=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial(M(v({},n),{channel_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n,i={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/LeaveThread",o=r.LeaveThreadRequest.encode(r.LeaveThreadRequest.fromPartial({channel_id:n,clan_id:t})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ArchiveChannel",o=r.ArchiveChannelRequest.encode(r.ArchiveChannelRequest.fromPartial({clan_id:t,channel_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListArchivedChannelDescs",l=r.ListArchivedChannelDescsRequest.encode(r.ListArchivedChannelDescsRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ListArchivedChannelDescsResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelUsers",o=r.RemoveChannelUsersRequest.encode(r.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a})),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,i,c,l,o,s={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelUsers",m=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:i,limit:c,state:l,cursor:o})).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelUserList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,i,c,l,o,s={}){let a="/mezon.api.Mezon/ListChannelDescs",m=r.ListChannelDescsRequest.encode(r.ListChannelDescsRequest.fromPartial({limit:t,state:n,page:i,clan_id:c,channel_type:l,is_mobile:o})).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelDescList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateChannelDesc",l=r.CreateChannelDescRequest.encode(r.CreateChannelDescRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ChannelDescription.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n,i={}){let c="/mezon.api.Mezon/ListChannelUsersUC",o=r.AllUsersAddChannelRequest.encode(r.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.AllUsersAddChannelResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n,i={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteChannelDesc",o=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateChannelDesc",o=r.UpdateChannelDescRequest.encode(r.UpdateChannelDescRequest.fromPartial(M(v({},n),{channel_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,i,c,l,o,s,a,h,m,_={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let y="/mezon.api.Mezon/ListChannelSetting",b=r.ChannelSettingListRequest.encode(r.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:n,category_id:i,active:l,private_channel:c,status:o,type:s,limit:a,page:h,channel_label:m})).finish(),A=g("POST",_,"");return A.body=b,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:A}).then(S=>d(this,null,function*(){return S.code!=0?{}:r.ChannelSettingListResponse.decode(S.message)})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n,i={}){let c="/mezon.api.Mezon/ListChannelVoiceUsers",o=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,limit:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.VoiceChannelUserList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListClanDescs",s=r.ListClanDescRequest.encode(r.ListClanDescRequest.fromPartial({limit:t,state:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ClanDescList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListChannelBadgeCount",s=r.ListChannelBadgeCountRequest.encode(r.ListChannelBadgeCountRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:i!=null?i:0})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ListChannelBadgeCountResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListUserOnline",s=r.ListUserOnlineRequest.encode(r.ListUserOnlineRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:i!=null?i:0})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ListUserOnlineResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateClanDesc",l=r.CreateClanDescRequest.encode(r.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ClanDesc.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,n={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteClanDesc",l=r.DeleteClanDescRequest.encode(r.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanDesc",o=r.UpdateClanDescRequest.encode(r.UpdateClanDescRequest.fromPartial(v({clan_id:t},n))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveClanUsers",o=r.RemoveClanUsersRequest.encode(r.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n,i={}){let c="/mezon.api.Mezon/ListBannedUsers",o=r.BannedUserListRequest.encode(r.BannedUserListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.BannedUserList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,i,c,l={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/UnbanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:i,ban_time:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return{}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,i,c,l={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/BanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:i,ban_time:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return{}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanUsers",l=r.ListClanUsersRequest.encode(r.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ClanUserList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanUsersStatus",l=r.ListClanUsersStatusRequest.encode(r.ListClanUsersStatusRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ClanUserStatusList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateCategoryDesc",l=r.CreateCategoryDescRequest.encode(r.CreateCategoryDescRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.CategoryDesc.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CheckDuplicateName",l=r.CheckDuplicateNameRequest.encode(r.CheckDuplicateNameRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){if(s.status>=200&&s.status<300)return r.CheckDuplicateNameResponse.decode(s);throw s})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,i,c={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteCategoryDesc",s=r.DeleteCategoryDescRequest.encode(r.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:n,category_label:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,i,c,l={}){let o="/mezon.api.Mezon/RegistFCMDeviceToken",a=r.RegistFcmDeviceTokenRequest.encode(r.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:n,platform:i,voip_token:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.RegistFcmDeviceTokenResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CloseDMByChannelId",l=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/OpenDMByChannelId",l=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateClanEmoji",l=r.ClanEmojiCreateRequest.encode(r.ClanEmojiCreateRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteByIdClanEmoji",s=r.ClanEmojiDeleteRequest.encode(r.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:n,emoji_label:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanEmojiById",o=r.ClanEmojiUpdateRequest.encode(r.ClanEmojiUpdateRequest.fromPartial({id:n.id,shortname:n.shortname,clan_id:n.clan_id})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let n="/mezon.api.Mezon/EmojiRecentList",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.EmojiRecentList.decode(l.message)})),new Promise((l,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let n="/mezon.api.Mezon/GetListEmojisByUserId",c=g("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(l=>d(this,null,function*(){return l.code!=0?{}:r.EmojiListedResponse.decode(l.message)})),new Promise((l,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SearchMessage",l=r.SearchMessageRequest.encode(r.SearchMessageRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.SearchMessageResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateEvent",l=r.Event.encode(r.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listEvents(e,t,n={}){let i="/mezon.api.Mezon/ListEvents",l=r.ListEventsRequest.encode(r.ListEventsRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.EventList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateEvent",l=r.CreateEventRequest.encode(r.CreateEventRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.EventManagement.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateEventUser",l=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,i,c,l,o={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteEvent",h=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial({event_id:t,clan_id:n,creator_id:i,event_label:c,channel_id:l})).finish(),m=g("POST",o,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:m}).then(_=>d(this,null,function*(){return{}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n,i={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateEvent",o=r.UpdateEventRequest.encode(r.UpdateEventRequest.fromPartial(n)).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteFriends",o=r.DeleteFriendsRequest.encode(r.DeleteFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListFriends",s=r.ListFriendsRequest.encode(r.ListFriendsRequest.fromPartial({limit:t,state:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.FriendList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n,i={}){let c="/mezon.api.Mezon/AddFriends",o=r.AddFriendsRequest.encode(r.AddFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.AddFriendsResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n,i={}){let c="/mezon.api.Mezon/BlockFriends",o=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n,i={}){let c="/mezon.api.Mezon/UnblockFriends",o=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,n={}){let i="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.NotificationChannelCategorySettingList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetUserProfileOnClan",l=r.ClanProfileRequest.encode(r.ClanProfileRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ClanProfile.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationCategory",l=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.NotificationUserChannel.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationChannel",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.NotificationUserChannel.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationClan",l=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.NotificationSetting.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,n={}){let i="/mezon.api.Mezon/GetNotificationReactMessage",l=r.NotifiReactMessage.encode(r.NotifiReactMessage.fromPartial({channel_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.NotifiReactMessage.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GiveMeACoffee",l=r.GiveCoffeeEvent.encode(r.GiveCoffeeEvent.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let n="/mezon.api.Mezon/GetKeyServer",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.GetKeyServerResp.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateLinkInviteUser",l=r.LinkInviteUserRequest.encode(r.LinkInviteUserRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.LinkInviteUser.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,n={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/InviteUser",l=r.InviteUserRequest.encode(r.InviteUserRequest.fromPartial({invite_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.InviteUserRes.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,i={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let c="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),l=new Map,o="",s=this.buildFullUrl(this.basePath,c,l),a=g("GET",i,o);return e&&(a.headers.Authorization="Basic "+k(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(s,a).then(h=>d(this,null,function*(){let m=yield h.arrayBuffer();return r.InviteUserRes.decode(new Uint8Array(m))})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let n="/mezon.api.Mezon/ListChannelByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.ChannelDescList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MarkAsRead",l=r.MarkAsReadRequest.encode(r.MarkAsReadRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let n="/mezon.api.Mezon/ListMezonOauthClient",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.MezonOauthClientList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetMuteCategory",l=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetMuteChannel",l=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteNotifications",o=r.DeleteNotificationsRequest.encode(r.DeleteNotificationsRequest.fromPartial({ids:t||[],category:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,i,c,l,o={}){let s="/mezon.api.Mezon/ListNotifications",h=r.ListNotificationsRequest.encode(r.ListNotificationsRequest.fromPartial({limit:t,clan_id:n,notification_id:i,category:c,direction:l})).finish(),m=g("POST",o,"");return m.body=h,e&&(m.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:m}).then(_=>d(this,null,function*(){return r.NotificationList.decode(_)})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationChannelSetting",l=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationClanSetting",l=r.SetDefaultNotificationRequest.encode(r.SetDefaultNotificationRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationCategorySetting",l=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotificationChannel",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,n={}){let i="/mezon.api.Mezon/DeleteNotiReactMessage",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetNotificationReactMessage",l=r.NotificationChannel.encode(r.NotificationChannel.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SetRoleChannelPermission",l=r.UpdateRoleChannelRequest.encode(r.UpdateRoleChannelRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let n="/mezon.api.Mezon/GetListPermission",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.PermissionList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,i,c={}){let l="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",s=r.PermissionRoleChannelListEventRequest.encode(r.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:n,user_id:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.PermissionRoleChannelListEventResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,i,c,l={}){let o="/mezon.api.Mezon/DeletePinMessage",a=r.DeletePinMessage.encode(r.DeletePinMessage.fromPartial({id:t,message_id:n,channel_id:i,clan_id:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>m),new Promise((m,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,i,c={}){let l="/mezon.api.Mezon/GetPinMessagesList",s=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial({message_id:t,channel_id:n,clan_id:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return r.PinMessagesList.decode(h)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateMessage2Inbox",l=r.Message2InboxRequest.encode(r.Message2InboxRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ChannelMessageHeader.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreatePinMessage",l=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ChannelMessageHeader.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,n={}){let i="/mezon.api.Mezon/GetPubKeys",l=r.GetPubKeysRequest.encode(r.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.GetPubKeysResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/PushPubKey",l=r.PushPubKeyRequest.encode(r.PushPubKeyRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddRolesChannelDesc",l=r.AddRoleChannelDescRequest.encode(r.AddRoleChannelDescRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n,i={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ChangeChannelCategory",o=r.ChangeChannelCategoryRequest.encode(r.ChangeChannelCategoryRequest.fromPartial(M(v({},n),{new_category_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteRoleChannelDesc",l=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,i,c,l={}){let o="/mezon.api.Mezon/ListRoles",a=r.RoleListEventRequest.encode(r.RoleListEventRequest.fromPartial({clan_id:t,limit:n,state:i,cursor:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.RoleListEventResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateRole",l=r.CreateRoleRequest.encode(r.CreateRoleRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.Role.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",o=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(M(v({},n),{role_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,i,c,l={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteRole",a=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial({role_id:t,channel_id:n,clan_id:i,role_label:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>m),new Promise((m,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateRole",o=r.UpdateRoleRequest.encode(r.UpdateRoleRequest.fromPartial(M(v({},n),{role_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,n={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListRolePermissions",l=r.ListPermissionsRequest.encode(r.ListPermissionsRequest.fromPartial({role_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.PermissionList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,i,c={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ListRoleUsers",s=r.ListRoleUsersRequest.encode(r.ListRoleUsersRequest.fromPartial({role_id:t,limit:n,cursor:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.RoleUserList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetRoleOfUserInTheClan",o=r.ListPermissionOfUsersRequest.encode(r.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.RoleList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,i,c={}){let l="/mezon.api.Mezon/SearchThread",s=r.SearchThreadRequest.encode(r.SearchThreadRequest.fromPartial({clan_id:t,channel_id:n,label:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ChannelDescList.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SendToken",l=r.TokenSentEvent.encode(r.TokenSentEvent.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionLogout",l=r.SessionLogoutRequest.encode(r.SessionLogoutRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddClanSticker",l=r.ClanStickerAddRequest.encode(r.ClanStickerAddRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteClanStickerById",s=r.ClanStickerDeleteRequest.encode(r.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:n,sticker_label:i})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return{}})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanStickerById",o=r.ClanStickerUpdateByIdRequest.encode(r.ClanStickerUpdateByIdRequest.fromPartial(M(v({},n),{id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let n="/mezon.api.Mezon/GetListStickersByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.StickerListedResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RegisterStreamingChannel",l=r.RegisterStreamingChannelRequest.encode(r.RegisterStreamingChannelRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.RegisterStreamingChannelResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,i,c,l,o,s={}){let a="/mezon.api.Mezon/ListStreamingChannelUsers",m=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:i,limit:c,state:l,cursor:o})).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.StreamingChannelUserList.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let n="/mezon.api.Mezon/GetSystemMessagesList",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.SystemMessagesList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateSystemMessage",l=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,i={}){let c="/mezon.api.Mezon/ListSdTopic",o=r.ListSdTopicRequest.encode(r.ListSdTopicRequest.fromPartial({clan_id:t,limit:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.SdTopicList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateSdTopic",l=r.SdTopicRequest.encode(r.SdTopicRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.SdTopic.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteSystemMessage",l=r.DeleteSystemMessage.encode(r.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetSystemMessageByClanId",l=r.GetSystemMessage.encode(r.GetSystemMessage.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.SystemMessage.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateSystemMessage",o=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,i,c,l,o,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListThreadDescs",m=r.ListThreadRequest.encode(r.ListThreadRequest.fromPartial({channel_id:t,limit:n,state:i,clan_id:c,thread_id:l,page:o})).finish(),_=g("POST",s,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:_}).then(y=>d(this,null,function*(){return y.code!=0?{}:r.ChannelDescListNoPool.decode(y.message)})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateCategory",o=r.UpdateCategoryDescRequest.encode(r.UpdateCategoryDescRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateChannelPrivate",l=r.ChangeChannelPrivateRequest.encode(r.ChangeChannelPrivateRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateUserProfileByClan",o=r.UpdateClanProfileRequest.encode(r.UpdateClanProfileRequest.fromPartial(M(v({},n),{clan_id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UploadOauthFile",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.UploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UploadAttachmentFile",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.UploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.MultipartUploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=r.MultipartUploadAttachmentFinishRequest.encode(r.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUser",l=r.UpdateUsersRequest.encode(r.UpdateUsersRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let n="/mezon.api.Mezon/ListUserClansByUserId",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.AllUserClans.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n,i={}){let c="/mezon.api.Mezon/ListUserPermissionInChannel",o=r.UserPermissionInChannelListRequest.encode(r.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.UserPermissionInChannelListResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let n="/mezon.api.Mezon/GetUserStatus",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.UserStatus.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUserStatus",l=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUserCustomStatus",l=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateWebhook",l=r.WebhookCreateRequest.encode(r.WebhookCreateRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.WebhookGenerateResponse.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateWebhookById",o=r.WebhookUpdateRequestById.encode(r.WebhookUpdateRequestById.fromPartial(M(v({},n),{id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListWebhookByChannelId",o=r.WebhookListRequest.encode(r.WebhookListRequest.fromPartial({channel_id:t,clan_id:n||""})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.WebhookListResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteWebhookById",o=r.WebhookDeleteRequestById.encode(r.WebhookDeleteRequestById.fromPartial(M(v({},n),{id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let i=e+t+"?";for(let[c,l]of n)l instanceof Array?i+=l.reduce((o,s)=>o+encodeURIComponent(c)+"="+encodeURIComponent(s)+"&",""):l!=null&&(i+=encodeURIComponent(c)+"="+encodeURIComponent(l)+"&");return i}editChannelCanvases(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/EditChannelCanvases",l=r.EditChannelCanvasRequest.encode(r.EditChannelCanvasRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.EditChannelCanvasResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,i,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetChannelCanvasDetail",s=r.ChannelCanvasDetailRequest.encode(r.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:n||"",channel_id:i||""})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.ChannelCanvasDetailResponse.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,i,c={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteChannelCanvas",s=r.DeleteChannelCanvasRequest.encode(r.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:n||"",channel_id:i||""})).finish(),a=g("POST",c,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,i,c,l={}){let o="/mezon.api.Mezon/ListOnboarding",a=r.ListOnboardingRequest.encode(r.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:n,limit:i,page:c})).finish(),h=g("POST",l,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ListOnboardingResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateOnboarding",l=r.CreateOnboardingRequest.encode(r.CreateOnboardingRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ListOnboardingResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteOnboarding",o=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetOnboardingDetail",o=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n||""})).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.OnboardingItem.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboarding",o=r.UpdateOnboardingRequest.encode(r.UpdateOnboardingRequest.fromPartial(M(v({},n),{id:t}))).finish(),s=g("POST",i,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:s}).then(a=>a),new Promise((a,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateClanWebhook",l=r.GenerateClanWebhookRequest.encode(r.GenerateClanWebhookRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.GenerateClanWebhookResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListClanWebhook",l=r.ListClanWebhookRequest.encode(r.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.ListClanWebhookResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteClanWebhookById",l={id:t,clan_id:n},s=r.ClanWebhookRequest.encode(r.ClanWebhookRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanWebhookById",l=M(v({},n),{id:t}),s=r.UpdateClanWebhookRequest.encode(r.UpdateClanWebhookRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,n={}){let i="/mezon.api.Mezon/GetTopicDetail",c={topic_id:t},o=r.SdTopicDetailRequest.encode(r.SdTopicDetailRequest.fromPartial(c)).finish(),s=g("POST",n,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.SdTopic.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListOnboardingStep",o={clan_id:t,limit:n,page:i},a=r.ListOnboardingStepRequest.encode(r.ListOnboardingStepRequest.fromPartial(o)).finish(),h=g("POST",c,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.ListOnboardingStepResponse.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboardingStep",l=M(v({},n),{clan_id:t}),s=r.UpdateOnboardingStepRequest.encode(r.UpdateOnboardingStepRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateRoomChannelApps",l=r.CreateRoomChannelApps.encode(r.CreateRoomChannelApps.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.CreateRoomChannelApps.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GenerateMeetToken",l=r.GenerateMeetTokenRequest.encode(r.GenerateMeetTokenRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.GenerateMeetTokenResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n,i={}){let c="/mezon.api.Mezon/GetMezonOauthClient",l={client_id:t,client_name:n},s=r.GetMezonOauthClientRequest.encode(r.GetMezonOauthClientRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>d(this,null,function*(){return h.code!=0?{}:r.MezonOauthClient.decode(h.message)})),new Promise((h,m)=>setTimeout(()=>m(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateMezonOauthClient",l=r.MezonOauthClient.encode(r.MezonOauthClient.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.MezonOauthClient.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,n={}){let i="/mezon.api.Mezon/GenerateHashChannelApps",c={app_id:t},o=r.GenerateHashChannelAppsRequest.encode(r.GenerateHashChannelAppsRequest.fromPartial(c)).finish(),s=g("POST",n,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.GenerateHashChannelAppsResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddUserEvent",l=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n,i={}){let c="/mezon.api.Mezon/DeleteUserEvent",l={clan_id:t,event_id:n},s=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateRoleOrder",l=r.UpdateRoleOrderRequest.encode(r.UpdateRoleOrderRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let n="/mezon.api.Mezon/CreateExternalMezonMeet",i=g("POST",t,"");return e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:r.GenerateMezonMeetResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,i,c,l,o={}){if(n==null)throw new Error("'token' is a required parameter but is null or undefined.");let s="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(n))),a=new Map;a.set("username",i),a.set("metadata",c),a.set("is_guest",l);let h="",m=this.buildFullUrl(t,s,a),_=g("POST",o,h);return e&&(_.headers.Authorization="Bearer "+e),_.headers.Accept="application/x-protobuf",_.headers["Content-Type"]="application/json",Promise.race([fetch(m,_).then(y=>d(this,null,function*(){let C=yield y.arrayBuffer();return r.GenerateMeetTokenExternalResponse.decode(new Uint8Array(C))})),new Promise((y,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/MuteParticipantMezonMeet",l=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelDetail",c={channel_id:t},o=r.ListChannelDetailRequest.encode(r.ListChannelDetailRequest.fromPartial(c)).finish(),s=g("POST",n,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ChannelDescription.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelTimeline",l=r.ListChannelTimelineRequest.encode(r.ListChannelTimelineRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.ListChannelTimelineResponse.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreateChannelTimeline",l=r.CreateChannelTimelineRequest.encode(r.CreateChannelTimelineRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.CreateChannelTimelineResponse.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateChannelTimeline",l=r.UpdateChannelTimelineRequest.encode(r.UpdateChannelTimelineRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.UpdateChannelTimelineResponse.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DetailChannelTimeline",l=r.ChannelTimelineDetailRequest.encode(r.ChannelTimelineDetailRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.ChannelTimelineDetailResponse.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateClanOrder",l=r.UpdateClanOrderRequest.encode(r.UpdateClanOrderRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,i,c={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/clan/discover",o=new Map,s="";s=JSON.stringify(i||{});let a=this.buildFullUrl(n,l,o),h=g("POST",c,s);return e&&(h.headers.Authorization="Basic "+k(e+":"+t)),h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(a,h).then(m=>d(this,null,function*(){let _=yield m.arrayBuffer();return r.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,i,c,l,o,s={}){let a="/mezon.api.Mezon/DeleteQuickMenuAccess",h={id:t,clan_id:n,bot_id:i,menu_name:c,background:l,action_msg:o},_=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(h)).finish(),y=g("POST",s,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,i,c={}){let l="/mezon.api.Mezon/ListQuickMenuAccess",o={bot_id:t,channel_id:n,menu_type:i},a=r.ListQuickMenuAccessRequest.encode(r.ListQuickMenuAccessRequest.fromPartial(o)).finish(),h=g("POST",c,"");return h.body=a,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:l,fetchOptions:h}).then(m=>d(this,null,function*(){return m.code!=0?{}:r.QuickMenuAccessList.decode(m.message)})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/AddQuickMenuAccess",l=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateQuickMenuAccess",l=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,n={}){let i="/mezon.api.Mezon/ListForSaleItems",c={page:t},o=r.ListForSaleItemsRequest.encode(r.ListForSaleItemsRequest.fromPartial(c)).finish(),s=g("POST",n,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.ForSaleItemList.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/IsFollower",l=r.IsFollowerRequest.encode(r.IsFollowerRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.IsFollowerResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/TransferOwnership",l=r.TransferOwnershipRequest.encode(r.TransferOwnershipRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>s),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UpdateUsername",l=r.UpdateUsernameRequest.encode(r.UpdateUsernameRequest.fromPartial(t)).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return s.code!=0?{}:r.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/IsBanned",c={channel_id:t},o=r.IsBannedRequest.encode(r.IsBannedRequest.fromPartial(c)).finish(),s=g("POST",n,"");return s.body=o,e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:s}).then(a=>d(this,null,function*(){return a.code!=0?{}:r.IsBannedResponse.decode(a.message)})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n,i={}){let c="/mezon.api.Mezon/ReportMessageAbuse",l={message_id:t,abuse_type:n},s=r.ReportMessageAbuseReqest.encode(r.ReportMessageAbuseReqest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C){let b="/mezon.api.Mezon/SendChannelMessage",S=r.ChannelMessageSend.encode(r.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:o,attachments:s,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C})).finish(),w=g("POST",{},"");return w.body=S,e&&(w.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:b,fetchOptions:w}).then(E=>d(this,null,function*(){return r.ChannelMessageAck.decode(E)})),new Promise((E,W)=>setTimeout(()=>W(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,i,c,l,o,s,a,h,m,_){let y="/mezon.api.Mezon/UpdateChannelMessage",b=r.ChannelMessageUpdate.encode(r.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:n,message_id:l,mode:i,is_public:c,content:o,mentions:s,attachments:a,hide_editted:h,topic_id:m,is_update_msg_topic:_})).finish(),A=g("POST",{},"");return A.body=b,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:A}).then(S=>d(this,null,function*(){return S.code!=0?{}:r.ChannelMessageUpdate.decode(S.message)})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,i,c,l,o,s,a,h){let m="/mezon.api.Mezon/DeleteChannelMessage",y=r.ChannelMessageRemove.encode(r.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:n,message_id:l,mode:i,is_public:c,has_attachment:o,mentions:a,references:h,topic_id:s})).finish(),C=g("POST",{},"");return C.body=y,e&&(C.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:m,fetchOptions:C}).then(b=>d(this,null,function*(){return b.code!=0?{}:r.ChannelMessageRemove.decode(b.message)})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,i,c,l,o={}){let s="/mezon.api.Mezon/UpdateMezonVoiceState",a={clan_id:t,channel_id:n,display_name:i,room_name:c,state:l},m=r.HandleParticipantMeetStateEvent.encode(r.HandleParticipantMeetStateEvent.fromPartial(a)).finish(),_=g("POST",o,"");return _.body=m,e&&(_.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:_}).then(y=>y),new Promise((y,C)=>setTimeout(C,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,i,c,l,o,s={}){let a="/mezon.api.Mezon/MessageButtonClick",h={message_id:t,channel_id:n,button_id:i,sender_id:c,user_id:l,extra_data:o},_=r.MessageButtonClicked.encode(r.MessageButtonClicked.fromPartial(h)).finish(),y=g("POST",s,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,i,c,l,o,s={}){let a="/mezon.api.Mezon/DropdownBoxSelected",h={message_id:t,channel_id:n,selectbox_id:i,sender_id:c,user_id:l,values:o},_=r.DropdownBoxSelected.encode(r.DropdownBoxSelected.fromPartial(h)).finish(),y=g("POST",s,"");return y.body=_,e&&(y.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:y}).then(C=>C),new Promise((C,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n,i={}){let c="/mezon.api.Mezon/ActiveArchivedThread",l={clan_id:t,channel_id:n},s=r.ActiveArchivedThread.encode(r.ActiveArchivedThread.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n,i={}){let c="/mezon.api.Mezon/AddAgentToChannel",l={room_name:t,channel_id:n},s=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n,i={}){let c="/mezon.api.Mezon/DisconnectAgent",l={room_name:t,channel_id:n},s=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(l)).finish(),a=g("POST",i,"");return a.body=s,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(h=>h),new Promise((h,m)=>setTimeout(m,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListMutedChannel",l=r.ListMutedChannelRequest.encode(r.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(s=>d(this,null,function*(){return r.MutedChannelList.decode(s)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,i,c,l,o,s,a,h,m,_,y,C){let b="/mezon.api.Mezon/ReactChannelMessage",S=r.MessageReaction.encode(r.MessageReaction.fromPartial({clan_id:t,channel_id:n,mode:i,is_public:c,message_id:l,emoji_id:o,emoji:s,count:a,message_sender_id:h,action:m,emoji_recent_id:y,sender_name:C,topic_id:_})).finish(),w=g("POST",{},"");return w.body=S,e&&(w.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:b,fetchOptions:w}).then(E=>d(this,null,function*(){return r.ChannelMessageSend.decode(E)})),new Promise((E,W)=>setTimeout(()=>W(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,n={}){var s,a,h,m,_,y;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/CreatePoll",l=r.CreatePollRequest.encode(r.CreatePollRequest.fromPartial({channel_id:(s=t.channel_id)!=null?s:"0",clan_id:(a=t.clan_id)!=null?a:"0",question:(h=t.question)!=null?h:"",answers:(m=t.answers)!=null?m:[],expire_hours:(_=t.expire_hours)!=null?_:0,type:(y=t.type)!=null?y:0})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(C=>d(this,null,function*(){let b=r.CreatePollResponse.decode(C);return{poll_id:b.poll_id,message_id:b.message_id,question:b.question,answers:b.answers.map(A=>({index:A.index,label:A.label})),answer_counts:b.answer_counts,exp:b.exp,is_closed:b.is_closed,creator_id:b.creator_id,type:b.type,total_votes:b.total_votes}})),new Promise((C,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,n={}){var s,a,h,m;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/VotePoll",l=r.VotePollRequest.encode(r.VotePollRequest.fromPartial({poll_id:(s=t.poll_id)!=null?s:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0",answer_indices:(m=t.answer_indices)!=null?m:[]})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(_=>d(this,null,function*(){var C;let y=_.length>0?r.VotePollResponse.decode(_):{my_answer_indices:[]};return{my_answer_indices:Array.from((C=y.my_answer_indices)!=null?C:[])}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,n={}){var s,a,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ClosePoll",l=r.ClosePollRequest.encode(r.ClosePollRequest.fromPartial({poll_id:(s=t.poll_id)!=null?s:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(m=>{if(m.status==204||m.status>=200&&m.status<300)return{};throw m}),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,n={}){var s,a,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetPoll",l=r.GetPollRequest.encode(r.GetPollRequest.fromPartial({poll_id:(s=t.poll_id)!=null?s:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),o=g("POST",n,"");return o.body=l,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:o}).then(m=>d(this,null,function*(){let _=r.GetPollResponse.decode(m);return{poll_id:_.poll_id,message_id:_.message_id,question:_.question,answers:_.answers.map(y=>({index:y.index,label:y.label})),answer_counts:_.answer_counts,exp:_.exp,is_closed:_.is_closed,creator_id:_.creator_id,type:_.type,total_votes:_.total_votes,voter_details:_.voter_details.map(y=>({answer_index:y.answer_index,user_ids:y.user_ids}))}})),new Promise((m,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return d(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return d(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return d(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>d(this,null,function*(){return{}})),new Promise((n,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,i){return d(this,null,function*(){let c="",l={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(o=>d(this,null,function*(){return{}})),new Promise((o,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,i){let c="",l={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(o=>d(this,null,function*(){return{}})),new Promise((o,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,i,c,l,o,s,a){return d(this,null,function*(){let h="",m={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:c,is_public:i,has_attachment:l,topic_id:o,mentions:s,references:a}};return Promise.race([this.send({urlPath:h,fetchOptions:m}).then(_=>d(this,null,function*(){return{}})),new Promise((_,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,i,c,l,o,s,a,h,m){return d(this,null,function*(){let _="",y={channel_message_update:{clan_id:e,channel_id:t,message_id:c,content:l,mentions:o,attachments:s,mode:n,is_public:i,hide_editted:a,topic_id:h,is_update_msg_topic:m}};return Promise.race([this.send({urlPath:_,fetchOptions:y}).then(C=>d(this,null,function*(){return{}})),new Promise((C,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){let b="",A={quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:o,attachments:s,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C}}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(S=>d(this,null,function*(){return{}})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C,b){return d(this,null,function*(){let A="",S={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:i,is_public:c,content:l,mentions:o,attachments:s,references:a,anonymous_message:h,mention_everyone:m,avatar:_,code:y,topic_id:C,id:b}}};return Promise.race([this.send({urlPath:A,fetchOptions:S}).then(w=>d(this,null,function*(){return{}})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,i,c,l,o,s,a,h,m,_,y){return d(this,null,function*(){let C="",b={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:i,content:c,mentions:l,attachments:o,references:s,anonymous_message:a,mention_everyone:h,avatar:m,code:_,topic_id:y}};return Promise.race([this.send({urlPath:C,fetchOptions:b}).then(A=>d(this,null,function*(){return{}})),new Promise((A,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){let b="",A={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:i,is_public:c,message_id:l,emoji_id:o,emoji:s,count:a,message_sender_id:h,action:m,topic_id:_,emoji_recent_id:y,sender_name:C}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(S=>d(this,null,function*(){return{}})),new Promise((S,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,i,c,l){return d(this,null,function*(){let o="",s={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:i,sender_display_name:c,topic_id:l}};return Promise.race([this.send({urlPath:o,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,i,c,l){return d(this,null,function*(){let o="",s={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:i,timestamp_seconds:c,badge_count:l}};return Promise.race([this.send({urlPath:o,fetchOptions:s}).then(a=>d(this,null,function*(){return{}})),new Promise((a,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,i,c,l,o,s,a,h,m,_,y){return d(this,null,function*(){let C="",b={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:i,message_id:c,timestamp_seconds:l,operation:o,message_sender_avatar:s,message_sender_id:a,message_sender_username:h,message_content:m,message_attachment:_,message_created_time:y}};return Promise.race([this.send({urlPath:C,fetchOptions:b}).then(A=>d(this,null,function*(){return{}})),new Promise((A,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,i){return d(this,null,function*(){let c="",l={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(o=>d(this,null,function*(){return{}})),new Promise((o,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return d(this,null,function*(){let n="",i={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,i,c){return d(this,null,function*(){let l="",o={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:i,caller_id:c}};return Promise.race([this.send({urlPath:l,fetchOptions:o}).then(s=>d(this,null,function*(){return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,i){return d(this,null,function*(){let c="",l={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:i}};return Promise.race([this.send({urlPath:c,fetchOptions:l}).then(o=>d(this,null,function*(){return{}})),new Promise((o,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return d(this,null,function*(){let i="",c={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(l=>d(this,null,function*(){return{}})),new Promise((l,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}listDataSocket(e){return d(this,null,function*(){let t="",n={list_data_socket:e};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(i=>d(this,null,function*(){return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}};x.DefaultSendTimeoutMs=1e4;var F=x;var ce="127.0.0.1",le="7350",de="defaultkey",ue=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},V=!1,U=class U{constructor(e=de,t=ce,n=le,i=!1,c=null,l=ue,o=!0){this.serverkey=e;this.timeout=l;this.autoFallbackHttp=o;this.verbose=!1;this.host=t,this.port=n,this.useSSL=i;let a=`${i?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=U.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.transport=new F(e,l,c,a)}isOpen(){return this._connectionState===p.CONNECTED}setTransportAdapter(e){this.transport.setTransportAdapter(e)}connect(e,t,n=!1,i=!1,c=U.DefaultConnectTimeoutMs){if(this.verbose=i,this._connectionState===p.CONNECTED)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this.transport.connect(e,t,n,i,(o,s)=>d(this,null,function*(){if(!s.cid)if(s.notifications)s.notifications.notifications.forEach(a=>{a.content=a.content?N(a.content):void 0,this.onnotification(a)});else if(s.voice_started_event)this.onvoicestarted(s.voice_started_event);else if(s.voice_ended_event)this.onvoiceended(s.voice_ended_event);else if(s.voice_joined_event)this.onvoicejoined(s.voice_joined_event);else if(s.voice_leaved_event)this.onvoiceleaved(s.voice_leaved_event);else if(s.channel_created_event)this.onchannelcreated(s.channel_created_event);else if(s.category_event)this.oncategoryevent(s.category_event);else if(s.role_event)this.onroleevent(s.role_event);else if(s.event_emoji)this.oneventemoji(s.event_emoji);else if(s.noti_user_channel)this.oneventnotiuserchannel(s.noti_user_channel);else if(s.webhook_event)this.oneventwebhook(s.webhook_event);else if(s.channel_deleted_event)this.onchanneldeleted(s.channel_deleted_event);else if(s.clan_deleted_event)this.onclandeleted(s.clan_deleted_event);else if(s.sticker_create_event)this.onstickercreated(s.sticker_create_event);else if(s.sticker_update_event)this.onstickerupdated(s.sticker_update_event);else if(s.sticker_delete_event)this.onstickerdeleted(s.sticker_delete_event);else if(s.channel_updated_event)this.onchannelupdated(s.channel_updated_event);else if(s.delete_account_event)this.ondeleteaccount(s.delete_account_event);else if(s.clan_profile_updated_event)this.onclanprofileupdated(s.clan_profile_updated_event);else if(s.clan_updated_event)this.onclanupdated(s.clan_updated_event);else if(s.last_seen_message_event)this.onlastseenupdated(s.last_seen_message_event);else if(s.status_presence_event)this.onstatuspresence(s.status_presence_event);else if(s.channel_message){let a=J(s);this.onchannelmessage(a)}else s.message_typing_event?this.onmessagetyping(s.message_typing_event):s.message_reaction_event?this.onmessagereaction(s.message_reaction_event):s.channel_presence_event?this.onchannelpresence(s.channel_presence_event):s.last_pin_message_event?this.onpinmessage(s.last_pin_message_event):s.custom_status_event?this.oncustomstatus(s.custom_status_event):s.canvas_event?this.oncanvasevent(s.canvas_event):s.user_channel_added_event?this.onuserchanneladded(s.user_channel_added_event):s.add_clan_user_event?this.onuserclanadded(s.add_clan_user_event):s.user_profile_updated_event?this.onuserprofileupdate(s.user_profile_updated_event):s.user_channel_removed_event?this.onuserchannelremoved(s.user_channel_removed_event):s.block_friend?this.onblockfriend(s.block_friend):s.un_block_friend?this.onunblockfriend(s.un_block_friend):s.add_friend?this.onaddfriend(s.add_friend):s.remove_friend?this.onremovefriend(s.remove_friend):s.user_clan_removed_event?this.onuserclanremoved(s.user_clan_removed_event):s.clan_event_created?this.oneventcreated(s.clan_event_created):s.give_coffee_event?this.oncoffeegiven(s.give_coffee_event):s.role_assign_event?this.onroleassign(s.role_assign_event):s.streaming_started_event?this.onstreamingchannelstarted(s.streaming_started_event):s.streaming_ended_event?this.onstreamingchannelended(s.streaming_ended_event):s.streaming_joined_event?this.onstreamingchanneljoined(s.streaming_joined_event):s.streaming_leaved_event?this.onstreamingchannelleaved(s.streaming_leaved_event):s.permission_set_event?this.onpermissionset(s.permission_set_event):s.permission_changed_event?this.onpermissionchanged(s.permission_changed_event):s.unmute_event?this.onunmuteevent(s.unmute_event):s.token_sent_event?this.ontokensent(s.token_sent_event):s.message_button_clicked?this.onmessagebuttonclicked(s.message_button_clicked):s.dropdown_box_selected?this.onmessagedropdownboxselected(s.dropdown_box_selected):s.mark_as_read?this.onmarkasread(s.mark_as_read):s.voice_reaction_send?this.onvoicereactionmessage(s.voice_reaction_send):s.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(s.webrtc_signaling_fwd):s.list_activity?this.onactivityupdated(s.list_activity):s.sd_topic_event?this.onsdtopicevent(s.sd_topic_event):s.channel_app_event?this.onchannelappevent(s.channel_app_event):s.user_status_event?this.onuserstatusevent(s.user_status_event):s.join_channel_app_data?this.onjoinchannelappevent(s.join_channel_app_data):s.unpin_message_event?this.onunpinmessageevent(s.unpin_message_event):s.quick_menu_event?this.onquickmenuevent(s.quick_menu_event):s.meet_participant_event?this.onmeetparticipantevent(s.meet_participant_event):s.transfer_ownership_event?this.ontransferownership(s.transfer_ownership_event):s.ban_user_event?this.onbanneduser(s.ban_user_event):s.list_channel_users_banned_event?this.onlistchannelusersbanned(s.list_channel_users_banned_event):s.allow_anonymous_event?this.onallowanonymousevent(s.allow_anonymous_event):s.aiagent_enabled_event?this.onaiagentenabled(s.aiagent_enabled_event):s.refresh_session_event?this.onrefreshsession(s.refresh_session):s.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",s):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",s)}),o=>d(this,null,function*(){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(o)}));let l=new Promise((o,s)=>{this.transport.setOnOpen(a=>{this.verbose&&window&&window.console&&console.log(a);let h=V;V=!0,this.clearConnectTimeout(),this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,o(),h&&this.onreconnect(a)}),this.transport.setOnError(a=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(a),this._connectPromise=void 0,this.transport.close(),s(a)}),this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.transport.close(),this._connectPromise=void 0,s("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},c)});return this._connectPromise=l,this._connectPromise}pingPong(){return d(this,null,function*(){if(!this.isOpen()){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop();return}try{let e="",t={ping:{}};yield this.transport.send({urlPath:e,fetchOptions:t},this._heartbeatTimeoutMs)}catch(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.transport.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(e)}onmessagetyping(e){this.verbose&&window&&window.console&&console.log(e)}onmessagereaction(e){this.verbose&&window&&window.console&&console.log(e)}onchannelmessage(e){this.verbose&&window&&window.console&&console.log(e)}onchannelpresence(e){this.verbose&&window&&window.console&&console.log(e)}onuserchanneladded(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanadded(e){this.verbose&&window&&window.console&&console.log(e)}onuserprofileupdate(e){this.verbose&&window&&window.console&&console.log(e)}onuserchannelremoved(e){this.verbose&&window&&window.console&&console.log(e)}onaddfriend(e){this.verbose&&window&&window.console&&console.log(e)}onremovefriend(e){this.verbose&&window&&window.console&&console.log(e)}onblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onunblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanremoved(e){this.verbose&&window&&window.console&&console.log(e)}onnotification(e){this.verbose&&window&&window.console&&console.log(e)}onstatuspresence(e){this.verbose&&window&&window.console&&console.log(e)}onpinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceended(e){this.verbose&&window&&window.console&&console.log(e)}onvoicestarted(e){this.verbose&&window&&window.console&&console.log(e)}onvoicejoined(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceleaved(e){this.verbose&&window&&window.console&&console.log(e)}onchannelcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncategoryevent(e){this.verbose&&window&&window.console&&console.log(e)}onroleevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventemoji(e){this.verbose&&window&&window.console&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&window&&window.console&&console.log(e)}oneventwebhook(e){this.verbose&&window&&window.console&&console.log(e)}onchanneldeleted(e){this.verbose&&window&&window.console&&console.log(e)}onclandeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickercreated(e){this.verbose&&window&&window.console&&console.log(e)}onstickerdeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickerupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelupdated(e){this.verbose&&window&&window.console&&console.log(e)}ondeleteaccount(e){this.verbose&&window&&window.console&&console.log(e)}onclanprofileupdated(e){this.verbose&&window&&window.console&&console.log(e)}onclanupdated(e){this.verbose&&window&&window.console&&console.log(e)}onlastseenupdated(e){this.verbose&&window&&window.console&&console.log(e)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&window&&window.console&&console.log(e)}oncanvasevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncoffeegiven(e){this.verbose&&window&&window.console&&console.log(e)}onroleassign(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelended(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionchanged(e){this.verbose&&window&&window.console&&console.log(e)}onunmuteevent(e){this.verbose&&window&&window.console&&console.log(e)}ontokensent(e){this.verbose&&window&&window.console&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&window&&window.console&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&window&&window.console&&console.log(e)}onmarkasread(e){this.verbose&&window&&window.console&&console.log(e)}onvoicereactionmessage(e){this.verbose&&window&&window.console&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&window&&window.console&&console.log(e)}onactivityupdated(e){this.verbose&&window&&window.console&&console.log(e)}onsdtopicevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onuserstatusevent(e){this.verbose&&window&&window.console&&console.log(e)}onjoinchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onunpinmessageevent(e){this.verbose&&window&&window.console&&console.log(e)}onquickmenuevent(e){this.verbose&&window&&window.console&&console.log(e)}ontransferownership(e){this.verbose&&window&&window.console&&console.log(e)}onbanneduser(e){this.verbose&&window&&window.console&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&window&&window.console&&console.log(e)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}onrefreshsession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,n,i,c={},l={}){let o={token:e,vars:c};return this.transport.authenticateMezon(this.serverkey,"",o,t,n,i,l).then(s=>new O(s.token||"",s.refresh_token||"",s.created||!1,s.api_url||"",s.ws_url||"",s.id_token||"",s.is_remember||!1))}authenticateSMSOTPRequest(e,t,n){let i={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",i,t).then(c=>Promise.resolve(c))}authenticateEmailOTPRequest(e,t,n){let i={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",i,t).then(c=>Promise.resolve(c))}confirmAuthenticateOTP(e){return d(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,n,i){let c={username:n,account:{email:e,password:t,vars:i}};return this.transport.authenticateEmail(this.serverkey,"",c,n).then(l=>new O(l.token||"",l.refresh_token||"",l.created||!1,l.api_url||"",l.ws_url||"",l.id_token||"",l.is_remember||!1))}setBasePath(e,t,n){this.host=e,this.port=t,this.useSSL=n;let c=`${n?"https://":"http://"}${e}:${t}`;return this.transport.setBasePath(c)}addChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(e.token,t,n).then(i=>i!==void 0)})}addFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(e.token,t,n)})}blockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(e.token,t,n).then(i=>Promise.resolve(i!=null))})}unblockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(e.token,t,n).then(i=>Promise.resolve(i!=null))})}uploadOauthFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(e.token,t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(e.token,t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(e.token,t)})}createCategoryDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(e.token,t).then(n=>Promise.resolve(n))})}createRole(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(e.token,t).then(n=>Promise.resolve(n))})}createEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(e.token,t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(e.token,t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(e.token,t).then(n=>n!==void 0)})}deleteApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(e.token,t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(e.token,t,n).then(i=>i!==void 0)})}deleteChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(e.token,t,n).then(i=>i!==void 0)})}deleteClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(e.token,t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(e.token,t,n,i).then(c=>c!==void 0)})}deleteNotifications(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(e.token,t,n).then(i=>Promise.resolve(i!=null))})}deleteRole(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(e.token,t,"0",n,i).then(c=>c!==void 0)})}deleteEvent(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(e.token,t,n,i,c,l).then(o=>o!==void 0)})}updateEventUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(e.token,t).then(n=>n!==void 0)})}emitEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(e.token,t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(e.token,t,n).then(i=>Promise.resolve(i!=null))})}listBannedUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(e.token,t,n).then(i=>Promise.resolve(i))})}unbanClanUsers(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(e.token,t,n,i).then(c=>Promise.resolve(c!=null))})}banClanUsers(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(e.token,t,n,i,c).then(l=>Promise.resolve(l!=null))})}removeChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(e.token,t,n).then(i=>Promise.resolve(i!=null))})}listChannelMessages(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(e.token,t,n,i,c,l,o).then(s=>{let a={messages:[],last_seen_message:s.last_seen_message,last_sent_message:s.last_sent_message};return s.messages==null||s.messages.forEach(h=>{let m,_,y,C,b;try{m=P(h.content)}catch(A){console.log("error parse content",A)}try{let A=B(h.reactions);_=(A==null?void 0:A.reactions)||A||P(h.reactions||"[]")}catch(A){_=P(h.reactions||"[]")}try{let A=T(h.mentions);y=(A==null?void 0:A.mentions)||A||P(h.mentions||"[]")}catch(A){y=P(h.mentions||"[]")}try{let A=z(h.attachments);C=(A==null?void 0:A.attachments)||A||P(h.attachments||"[]")}catch(A){C=P(h.attachments||"[]")}try{let A=D(h.references);b=(A==null?void 0:A.refs)||A||P(h.references||"[]")}catch(A){b=P(h.references||"[]")}a.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:m,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:C,mentions:y,reactions:_,references:b,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(a)})})}listChannelVoiceUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(e.token,t,n).then(i=>{let c={voice_channel_users:[]};return i.voice_channel_users==null||i.voice_channel_users.forEach(l=>{c.voice_channel_users.push({id:l.id,channel_id:l.channel_id,user_ids:l.user_ids,participant:l.participant})}),Promise.resolve(c)})})}listChannelUsers(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(e.token,t,n,i,l,c,o).then(s=>{let a={channel_users:[],cursor:s.cursor,channel_id:s.channel_id};return s.channel_users==null||s.channel_users.forEach(h=>{a.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(a)})})}listChannelAttachments(e,t,n,i,c,l,o,s){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(e.token,n,t,i,l,c,o,s).then(a=>{let h={attachments:[]};return a.attachments==null||a.attachments.forEach(m=>{h.attachments.push({filename:m.filename,filesize:m.filesize,filetype:m.filetype,id:m.id,uploader:m.uploader,url:m.url,message_id:m.message_id,create_time_seconds:m.create_time_seconds,width:m.width,height:m.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(e.token,t).then(n=>{let i={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(c=>{var l;i.clan_users.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,is_mobile:(l=c.user)==null?void 0:l.is_mobile,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,user_status:c.user.user_status,status:c.user.status,about_me:c.user.about_me,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,join_time_seconds:c.user.join_time_seconds},role_id:c.role_id,clan_nick:c.clan_nick,clan_avatar:c.clan_avatar})}),Promise.resolve(i)})})}listClanUsersStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(e.token,t).then(n=>{let i={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(c=>{i.clan_user_statuses.push({user_id:c.user_id,user_status:c.user_status})}),Promise.resolve(i)})})}listChannelDetail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(e.token,t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(e.token,t,n,i,c,l,o).then(s=>{let a={channeldesc:[],next_cursor:s.next_cursor,prev_cursor:s.prev_cursor,cacheable_cursor:s.cacheable_cursor};return s.channeldesc==null||(a.channeldesc=s.channeldesc),Promise.resolve(a)})})}listClanDescs(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(e.token,t,n,i).then(c=>{let l={clandesc:[]};return c.clandesc==null||(l.clandesc=c.clandesc),Promise.resolve(l)})})}listChannelBadgeCount(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(e.token,t,n,i).then(c=>{var l;return{channeldesc:(l=c.channeldesc)!=null?l:[],total_count:c.total_count}})})}listUserOnline(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(e.token,t,n,i).then(c=>{var l;return{users:(l=c.users)!=null?l:[],total_count:c.total_count}})})}listCategoryDescs(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(e.token,t,n,i).then(c=>{let l={categorydesc:[]};return c.categorydesc==null||(l.categorydesc=c.categorydesc),Promise.resolve(l)})})}listEvents(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(e.token,t).then(n=>Promise.resolve(n))})}getListPermission(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(e.token,t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(e.token,t,n,i).then(c=>Promise.resolve(c))})}registFCMDeviceToken(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(e.token,t,n,i,c).then(l=>Promise.resolve(l))})}getUserProfileOnClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(e.token,t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(e.token,t).then(n=>n!==void 0)})}openDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(e.token,t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(e.token,t)})}linkSMS(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(e.token,t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(e.token,t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(e.token,n,t,i).then(c=>{let l={friends:[],cursor:c.cursor};return c.friends==null||c.friends.forEach(o=>{var s;l.friends.push({user:{avatar_url:o.user.avatar_url,create_time_seconds:o.user.create_time_seconds,display_name:o.user.display_name,edge_count:o.user.edge_count?Number(o.user.edge_count):0,id:o.user.id,lang_tag:o.user.lang_tag,location:o.user.location,online:o.user.online,timezone:o.user.timezone,update_time:o.user.update_time,username:o.user.username,is_mobile:(s=o.user)==null?void 0:s.is_mobile,user_status:o.user.user_status,status:o.user.status,mezon_id:o.user.mezon_id,list_nick_names:o.user.list_nick_names,phone_number:o.user.phone_number,about_me:o.user.about_me},state:o.state,source_id:o.source_id})}),Promise.resolve(l)})})}listNotifications(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(e.token,n,t,i,c,l).then(o=>{let s={cacheable_cursor:o.cacheable_cursor,notifications:[]};return o.notifications==null||o.notifications.forEach(a=>{s.notifications.push({id:a.id,subject:a.subject,content:a.content?N(a.content):void 0,code:a.code?Number(a.code):0,sender_id:a.sender_id,create_time_seconds:a.create_time_seconds,persistent:a.persistent,category:a.category})}),Promise.resolve(s)})})}sessionLogout(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout(e.token,{refresh_token:n,token:t,device_id:i,platform:c}).then(l=>l!==void 0)})}unlinkEmail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(e.token,t).then(n=>n!==void 0)})}updateUsername(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(e.token,t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(e.token,t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(e.token,t,n).then(i=>i!==void 0)})}updateClanDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(e.token,t,n).then(i=>i!==void 0)})}updateCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(e.token,t,n).then(i=>i!==void 0)})}updateUserProfileByClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(e.token,t,n).then(i=>i!==void 0)})}updateRole(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(e.token,t,n).then(i=>i!==void 0)})}updateEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(e.token,t,n).then(i=>i!==void 0)})}updateApp(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(e.token,t,n).then(i=>Promise.resolve(i))})}createLinkInviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(e.token,t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return d(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(e.token,t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(e.token,t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(e.token,t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(e.token,t).then(n=>n!==void 0)})}setMuteCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(e.token,t).then(n=>n!==void 0)})}setMuteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(e.token,t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(e.token,t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(e.token,t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(e.token,t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(e.token,t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage(e.token,{channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(e.token,t).then(n=>n!==void 0)})}searchMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(e.token,t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(e.token,t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(e.token,t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(e.token,t,n,i).then(c=>{let l={pin_messages_list:[]};return c.pin_messages_list==null||c.pin_messages_list.forEach(o=>{l.pin_messages_list.push({id:o.id,avatar:o.avatar,channel_id:o.channel_id,content:o.content,create_time_seconds:o.create_time_seconds,message_id:o.message_id,sender_id:o.sender_id,username:o.username,attachment:o.attachment})}),Promise.resolve(l)})})}deletePinMessage(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(e.token,t,n,i,c).then(l=>l!==void 0)})}createClanEmoji(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(e.token,t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(e.token,t,n).then(i=>i!==void 0)})}deleteByIdClanEmoji(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(e.token,t,n,i).then(c=>c!==void 0)})}generateWebhookLink(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(e.token,t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(e.token,t,n).then(i=>Promise.resolve(i))})}updateWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(e.token,t,n).then(i=>i!==void 0)})}deleteWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(e.token,t,n).then(i=>i!==void 0)})}addClanSticker(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(e.token,t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(e.token,t,n,i).then(c=>c!==void 0)})}updateClanStickerById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(e.token,t,n).then(i=>i!==void 0)})}changeChannelCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(e.token,t,n).then(i=>i!==void 0)})}setRoleChannelPermission(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(e.token,t).then(n=>n!==void 0)})}addApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(e.token,t).then(n=>Promise.resolve(n))})}getApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(e.token,t).then(n=>Promise.resolve(n))})}listApps(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(e.token,t,n).then(i=>i!==void 0)})}getSystemMessagesList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(e.token,t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(e.token,t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(e.token,t,n).then(i=>Promise.resolve(i))})}deleteSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(e.token,t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(e.token,t).then(n=>Promise.resolve(n))})}givecoffee(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.giveMeACoffee(e.token,t).then(n=>n!==void 0)})}sendToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendToken(e.token,t).then(n=>n!==void 0)})}listStreamingChannelUsers(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(e.token,t,n,i,l,c,o).then(s=>{let a={streaming_channel_users:[]};return s.streaming_channel_users==null||s.streaming_channel_users.forEach(h=>{a.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant})}),Promise.resolve(a)})})}registerStreamingChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(e.token,t).then(n=>n!==void 0)})}listChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(e.token,t).then(n=>{let i={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(c=>{i.channel_apps.push({id:c.id,channel_id:c.channel_id,app_id:c.app_id,clan_id:c.clan_id,app_url:c.app_url,app_name:c.app_name,app_logo:c.app_logo})}),Promise.resolve(i)})})}getChannelCategoryNotiSettingsList(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(e.token,t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(e.token,t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(e.token,t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(e.token,t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(e.token,t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(e.token,t,n).then(i=>Promise.resolve(i))})}getListEmojisByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(e.token,t,n,i,c).then(l=>{let o={clan_id:t,roles:l.roles};return Promise.resolve(o)})})}listUserPermissionInChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(e.token,t,n).then(i=>{let c={clan_id:t,channel_id:n,permissions:i.permissions};return Promise.resolve(c)})})}getPermissionByRoleIdChannelId(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(e.token,t,n,i).then(c=>{let l={role_id:t,channel_id:n,permission_role_channel:c.permission_role_channel,user_id:i};return Promise.resolve(l)})})}markAsRead(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(e.token,t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(e.token,t,n,i,c,l,o).then(s=>{let a={channeldesc:[]};return s.channeldesc==null||(a.channeldesc=s.channeldesc),Promise.resolve(a)})})}listChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(e.token,t).then(n=>{var i;return(i=n.events)==null||i.forEach(c=>{c.attachments=[];let l;try{let o=q(c.preview_imgs);l=(o==null?void 0:o.attachments)||o||P(c.preview_imgs||"[]")}catch(o){l=P(c.preview_imgs||"[]")}Array.isArray(l)?c.preview_imgs=l:c.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let o=q(i.attachments),s=q(i.preview_imgs);c=(o==null?void 0:o.attachments)||o||P(i.attachments||"[]"),l=(s==null?void 0:s.attachments)||s||P(i.preview_imgs||"[]")}catch(o){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let o=q(i.attachments),s=q(i.preview_imgs);c=(o==null?void 0:o.attachments)||o||P(i.attachments||"[]"),l=(s==null?void 0:s.attachments)||s||P(i.preview_imgs||"[]")}catch(o){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(e.token,t).then(n=>{let i=n.event;if(i){let c,l;try{let o=q(i.attachments),s=q(i.preview_imgs);c=(o==null?void 0:o.attachments)||o||P(i.attachments||"[]"),l=(s==null?void 0:s.attachments)||s||P(i.preview_imgs||"[]")}catch(o){c=P(i.attachments||"[]"),l=P(i.preview_imgs||"[]")}Array.isArray(c)?i.attachments=c:i.attachments=[],Array.isArray(l)?i.preview_imgs=l:i.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(e.token,t,n).then(i=>Promise.resolve(i))})}archiveChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(e.token,t,n).then(i=>Promise.resolve(i))})}listArchivedChannelDescs(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(e.token,t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,i,c,l,o,s,a,h,m){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(e.token,t,n,i,c,l,o,s,a,h,m).then(_=>Promise.resolve(_))})}getChannelCanvasList(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(e.token,t,n,i,c).then(l=>{let o={channel_canvases:[]};return l.channel_canvases==null||(o.clan_id=l.clan_id,o.channel_id=l.channel_id,o.channel_canvases=l.channel_canvases,o.count=l.count),Promise.resolve(o)})})}getChannelCanvasDetail(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(e.token,t,n,i).then(c=>Promise.resolve(c))})}editChannelCanvases(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(e.token,t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(e.token,t,n,i).then(c=>c!==void 0)})}addFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite(e.token,{channel_id:t,clan_id:n}).then(i=>i)})}removeFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(e.token,t,n).then(i=>i)})}getListFavoriteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(e.token,t).then(n=>n)})}listActivity(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(e.token,t).then(n=>n)})}createQRLogin(e){return d(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return d(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(e.token,t,n).then(i=>i)})}getChanEncryptionMethod(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(e.token,t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(e.token,t,{method:n}).then(i=>i)})}getPubKeys(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(e.token,t).then(n=>n)})}pushPubKey(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey(e.token,{PK:t}).then(n=>n)})}getKeyServer(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(e.token,t,n,i,c).then(l=>l)})}listOnboarding(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(e.token,t,n,i,c).then(l=>l)})}getOnboardingDetail(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(e.token,t,n).then(i=>Promise.resolve(i))})}createOnboarding(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(e.token,t).then(n=>n)})}updateOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(e.token,t,n).then(i=>i!==void 0)})}deleteOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(e.token,t,n).then(i=>i!==void 0)})}generateClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(e.token,t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(e.token,t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(e.token,t,n).then(i=>i!==void 0)})}updateClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(e.token,t,n).then(i=>i!==void 0)})}listOnboardingStep(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(e.token,t,n,i).then(c=>Promise.resolve(c))})}updateOnboardingStepByClanId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(e.token,t,n).then(i=>i!==void 0)})}updateUserStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(e.token,t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(e.token,t).then(n=>n!==void 0)})}getUserStatus(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(e.token,t,n).then(i=>Promise.resolve(i))})}createSdTopic(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(e.token,t).then(n=>n)})}getTopicDetail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(e.token,t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(e.token,t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(e.token,t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(e.token,t,n).then(i=>Promise.resolve(i))})}updateMezonOauthClient(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(e.token,t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(e.token,t,n,i).then(c=>Promise.resolve(c))})}generateHashChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(e.token,t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail(e.token,{email:t,password:n,old_password:i}).then(c=>Promise.resolve(c))})}addUserEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(e.token,t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(e.token,t,n).then(i=>i!==void 0)})}updateRoleOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(e.token,t).then(n=>Promise.resolve(n))})}deleteAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,i,c){return d(this,null,function*(){return this.transport.generateMeetTokenExternal("",e,t,n,i,c).then(l=>Promise.resolve(l))})}removeMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(e.token,t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(e.token,t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(e.token,t).then(n=>n!==void 0)})}listClanDiscover(e,t){return d(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e,t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(e.token,t,n,i).then(c=>Promise.resolve(c))})}deleteQuickMenuAccess(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(e.token,t,n).then(i=>i!==void 0)})}addQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(e.token,t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(e.token,t).then(n=>n!==void 0)})}listForSaleItems(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(e.token,t).then(n=>Promise.resolve(n))})}isFollower(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(e.token,t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(e.token,t).then(n=>n!==void 0)})}isBanned(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(e.token,t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(e.token,t,n).then(i=>i!==void 0)})}updateMezonVoiceState(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(e.token,t,n,i,c,l).then(o=>o!==void 0)})}sendChannelMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(e.token,t,n,i,c,l,o,s,a,h,m,_,y,C).then(b=>Promise.resolve(b))})}updateChannelMessage(e,t,n,i,c,l,o,s,a,h,m,_){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(e.token,t,n,i,c,l,o,s,a,h,m,_).then(y=>Promise.resolve(y))})}deleteChannelMessage(e,t,n,i,c,l,o,s,a,h){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(e.token,t,n,i,c,l,o,s,a,h).then(m=>Promise.resolve(m))})}messageButtonClick(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(e.token,t,n,i,c,l,o).then(s=>Promise.resolve(s))})}dropdownBoxSelected(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(e.token,t,n,i,c,l,o).then(s=>Promise.resolve(s))})}activeArchivedThread(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(e.token,t,n).then(i=>Promise.resolve(i))})}addAgentToChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(e.token,t,n).then(i=>Promise.resolve(i))})}disconnectAgent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(e.token,t,n).then(i=>Promise.resolve(i))})}listMutedChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(e.token,t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(e.token,t,n,i,c,l,o,s,a,h,m,_,y,C).then(b=>Promise.resolve(b))})}createPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(e.token,t)})}votePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(e.token,t)})}closePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(e.token,t)})}getPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(e.token,t)})}followUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,i,c)})}leaveChat(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,i,c)})}removeChatMessage(e,t,n,i,c,l,o,s,a,h){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,i,c,l,o,s,a,h)})}unfollowUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,i,c,l,o,s,a,h,m,_){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,i,c,l,o,s,a,h,m,_)})}updateStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,i,c,l,o,s,a,h,m,_,y,C,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,i,c,l,o,s,a,h,m,_,y,C,b)})}writeEphemeralMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C,b,A){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,i,c,l,o,s,a,h,m,_,y,C,b,A)})}writeChatMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,i,c,l,o,s,a,h,m,_,y,C)})}writeMessageReaction(e,t,n,i,c,l,o,s,a,h,m,_,y,C,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,i,c,l,o,s,a,h,m,_,y,C,b)})}writeMessageTyping(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,i,c,l,o)})}writeLastSeenMessage(e,t,n,i,c,l,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,i,c,l,o)})}writeLastPinMessage(e,t,n,i,c,l,o,s,a,h,m,_,y,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,i,c,l,o,s,a,h,m,_,y,C)})}writeCustomStatus(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,i,c)})}writeVoiceReaction(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}forwardWebrtcSignaling(e,t,n,i,c,l){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,i,c,l)})}makeCallPush(e,t,n,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,i,c)})}writeChannelAppEvent(e,t,n,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,i)})}listDataSocket(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listDataSocket(t)})}};U.DefaultHeartbeatTimeoutMs=1e4,U.DefaultConnectTimeoutMs=3e4;var Q=U;export{ne as ApiAppRole,ie as ChannelStreamMode,se as ChannelType,Q as Client,p as ConnectionState,J as CreateChannelMessageFromEvent,re as NotificationType,O as Session,oe as WebrtcSignalingType,ge as b64DecodeUnicode,me as b64EncodeUnicode,g as buildFetchOptions,z as decodeAttachments,q as decodeChannelTimelineAttachments,T as decodeMentions,N as decodeNotificationFcm,B as decodeReactions,D as decodeRefs,fe as encodeAttachments,_e as encodeMentions,be as encodeNotificationFcm,Ce as encodeReactions,ye as encodeRefs,P as safeJSONParse};