mezon-js 2.15.76 → 2.15.78

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
- "use strict";var mezonjs=(()=>{var ue=Object.create;var B=Object.defineProperty,he=Object.defineProperties,pe=Object.getOwnPropertyDescriptor,me=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,_e=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var te=(b,e,t)=>e in b?B(b,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[e]=t,v=(b,e)=>{for(var t in e||(e={}))ne.call(e,t)&&te(b,t,e[t]);if(ee)for(var t of ee(e))fe.call(e,t)&&te(b,t,e[t]);return b},M=(b,e)=>he(b,me(e));var O=(b=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(b,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):b)(function(b){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var be=(b,e)=>{for(var t in e)B(b,t,{get:e[t],enumerable:!0})},se=(b,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ge(e))!ne.call(b,r)&&r!==t&&B(b,r,{get:()=>e[r],enumerable:!(n=pe(e,r))||n.enumerable});return b};var ie=(b,e,t)=>(t=b!=null?ue(_e(b)):{},se(e||!b||!b.__esModule?B(t,"default",{value:b,enumerable:!0}):t,b)),ye=b=>se(B({},"__esModule",{value:!0}),b);var l=(b,e,t)=>new Promise((n,r)=>{var o=c=>{try{s(t.next(c))}catch(d){r(d)}},a=c=>{try{s(t.throw(c))}catch(d){r(d)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);s((t=t.apply(b,e)).next())});var Oe={};be(Oe,{ApiAppRole:()=>re,ChannelStreamMode:()=>ae,ChannelType:()=>oe,Client:()=>Z,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>Y,NotificationType:()=>ce,WebrtcSignalingType:()=>le,b64DecodeUnicode:()=>Ae,b64EncodeUnicode:()=>Ce,buildFetchOptions:()=>m,decodeAttachments:()=>W,decodeChannelTimelineAttachments:()=>T,decodeMentions:()=>x,decodeNotificationFcm:()=>G,decodeReactions:()=>H,decodeRefs:()=>N,encodeAttachments:()=>we,encodeMentions:()=>Pe,encodeNotificationFcm:()=>Se,encodeReactions:()=>ve,encodeRefs:()=>Re,safeJSONParse:()=>P});var Ur=O("whatwg-fetch");var I=O("js-base64"),R=ie(O("mezon-js-protobuf"));function m(b,e,t){let n=v({method:b},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(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function Ce(b){return(0,I.encode)(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Ae(b){return decodeURIComponent((0,I.decode)(b).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(b){if(b==null)return{t:b};let e;if(b instanceof Uint8Array)e=new TextDecoder().decode(b);else if(typeof b=="string")e=b;else return typeof b=="object"?b:{t:b};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 U=b=>!b||b===null||b===void 0||b===""||b==="[]";function x(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(b)}}function W(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(b)}}function T(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(b)}}function N(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(b)}}function H(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(b)}}function G(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(b)}}function Pe(b){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(b)).finish()}function we(b){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(b)).finish()}function Re(b){return R.MessageRefList.encode(R.MessageRefList.fromPartial(b)).finish()}function ve(b){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(b)).finish()}function Se(b){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(b)).finish()}var re=(o=>(o[o.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",o[o.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",o[o.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",o[o.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",o[o.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",o))(re||{}),oe=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(oe||{}),ae=(o=>(o[o.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",o[o.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",o[o.STREAM_MODE_DM=4]="STREAM_MODE_DM",o[o.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",o[o.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",o))(ae||{}),ce=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ce||{}),le=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(le||{});function Y(b){let e,t,n,r,o,a;try{e=P(b.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=H(b.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=x(b.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=W(b.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=N(b.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=b.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:b.id||b.channel_message.message_id,avatar:b.channel_message.avatar,channel_id:b.channel_message.channel_id,mode:b.channel_message.mode,channel_label:b.channel_message.channel_label,clan_id:b.channel_message.clan_id,code:b.channel_message.code,message_id:b.channel_message.message_id,sender_id:b.channel_message.sender_id,update_time:b.channel_message.update_time,clan_logo:b.channel_message.clan_logo,category_name:b.channel_message.category_name,username:b.channel_message.username,clan_nick:b.channel_message.clan_nick,clan_avatar:b.channel_message.clan_avatar,display_name:b.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:a,references:o==null?void 0:o.refs,hide_editted:b.channel_message.hide_editted,is_public:b.channel_message.is_public,create_time_seconds:b.channel_message.create_time_seconds,update_time_seconds:b.channel_message.update_time_seconds,topic_id:b.channel_message.topic_id}}var k=O("js-base64"),i=ie(O("mezon-js-protobuf")),de=O("mezon-js-protobuf");var Me="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let o=r-n;if(this.totalRequests++,t?this.failed++:o>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let a=(this.totalRequests-this.slowCount)/this.totalRequests;console.warn(`RATE ENDPOINT ${e}`,o,"TOTAL:",this.totalRequests,"SLOW:",this.slowCount,"RATE:",a),a<this.minAllowedFastRate&&(window.dispatchEvent(new CustomEvent(Me,{detail:{requestId:e,fastRate:a,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var $=(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.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u))($||{}),V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new de.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in $)return $[e]}connect(e,t,n,r,o,a){let[s,c]=t.split(":");this.adapter.connect(s,c,n,e,a),this.adapter.onOpen=o.onOpen,this.adapter.onError=o.onError,this.adapter.onClose=o.onClose,this.adapter.onMessage=(d,h,_)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,_),d!=0){let f=this.cIds[d];if(!f){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",_);return}delete this.cIds[d],_.error?(f.reject({code:h,error:_.error}),this.metricLatency.end(d,!0)):(f.resolve({code:h,message:_}),this.metricLatency.end(d))}else yield o.onMessage(0,0,_)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let a=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(a),api_name:a,body:r.body}}}return new Promise((a,s)=>l(this,null,function*(){var c,d;if(!this.adapter.isOpen())s("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((c=o.ephemeral_message_send.message)==null?void 0:c.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((d=o.quick_menu_event.message)==null?void 0:d.content));let h=this.generatecid();this.metricLatency.start(h),this.cIds[h]={resolve:a,reject:s},t!==1/0&&t>0&&setTimeout(()=>{this.metricLatency.end(h,!0),s("The socket timed out while waiting for a response.")},t),o.cid=h,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.Account.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",o=i.UpdateAccountRequest.encode(i.UpdateAccountRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/checklogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,o="";o=JSON.stringify(e||{});let a=this.buildFullUrl(this.basePath,n,r),s=m("POST",t,o);return s.headers.Accept="application/x-protobuf",s.headers["Content-Type"]="application/json",Promise.race([fetch(a,s).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/createqrlogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LoginIDResponse.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/smsotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/emailotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/email",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,o,a,s={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",a);let h="";h=JSON.stringify(n||{});let _=this.buildFullUrl(this.basePath,c,d),f=m("POST",s,h);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(_,f).then(y=>l(this,null,function*(){if(!y.ok)throw y;let g=yield y.arrayBuffer();return i.Session.decode(new Uint8Array(g))})),new Promise((y,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",o=i.AccountMezon.encode(i.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",o=i.LinkAccountConfirmRequest.encode(i.LinkAccountConfirmRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,a.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/confirmotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",o=i.RegistrationEmailRequest.encode(i.RegistrationEmailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/SessionRefresh",s=i.SessionRefreshRequest.encode(i.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=s,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ListUserActivity.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",o=i.CreateActivityRequest.encode(i.CreateActivityRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UserActivity.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",o=i.AddAppRequest.encode(i.AddAppRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let o="/mezon.api.Mezon/ListApps",s=i.ListAppsRequest.encode(i.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",a=i.AppClan.encode(i.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",a=i.UpdateAppRequest.encode(i.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListAuditLog",c=i.ListAuditLogRequest.encode(i.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){return i.ListAuditLog.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",o=i.UpdateCategoryOrderRequest.encode(i.UpdateCategoryOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListCategoryDescs",d=i.CategoryDesc.encode(i.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.CategoryDescList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",o=i.ListChannelAppsRequest.encode(i.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelAppsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,o={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasList",c=i.ChannelCanvasListRequest.encode(i.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",o=i.AddFavoriteChannelRequest.encode(i.AddFavoriteChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.AddFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",a=i.RemoveFavoriteChannelRequest.encode(i.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",o=i.ListFavoriteChannelRequest.encode(i.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=i.ListChannelMessagesRequest.encode(i.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){return i.ChannelMessageList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",a=i.AddChannelUsersRequest.encode(i.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,a,s,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",f=i.ListChannelAttachmentRequest.encode(i.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:o,before:a,after:s,around:c})).finish(),y=m("POST",d,"");return y.body=f,Promise.race([this.send({urlPath:h,fetchOptions:y}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",a=i.LeaveThreadRequest.encode(i.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",a=i.ArchiveChannelRequest.encode(i.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",o=i.ListArchivedChannelDescsRequest.encode(i.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListArchivedChannelDescsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",a=i.RemoveChannelUsersRequest.encode(i.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListChannelDescs",h=i.ListChannelDescsRequest.encode(i.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",o=i.CreateChannelDescRequest.encode(i.CreateChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelDescription.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",a=i.AllUsersAddChannelRequest.encode(i.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",a=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",a=i.UpdateChannelDescRequest.encode(i.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,a,s,c,d,h,_={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",g=i.ChannelSettingListRequest.encode(i.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:o,private_channel:r,status:a,type:s,limit:c,page:d,channel_label:h})).finish(),A=m("POST",_,"");return A.body=g,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return i.ChannelSettingListResponse.decode(C.message)})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",a=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let o="/mezon.api.Mezon/ListClanDescs",s=i.ListClanDescRequest.encode(i.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return i.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let o="/mezon.api.Mezon/ListChannelBadgeCount",s=i.ListChannelBadgeCountRequest.encode(i.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let o="/mezon.api.Mezon/ListUserOnline",s=i.ListUserOnlineRequest.encode(i.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",o=i.CreateClanDescRequest.encode(i.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",o=i.DeleteClanDescRequest.encode(i.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",a=i.UpdateClanDescRequest.encode(i.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",a=i.RemoveClanUsersRequest.encode(i.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",a=i.BannedUserListRequest.encode(i.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnbanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/BanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",o=i.ListClanUsersRequest.encode(i.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",o=i.ListClanUsersStatusRequest.encode(i.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserStatusList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",o=i.CreateCategoryDescRequest.encode(i.CreateCategoryDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CategoryDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",o=i.CheckDuplicateNameRequest.encode(i.CheckDuplicateNameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code==0)return i.CheckDuplicateNameResponse.decode(s.message);throw s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",s=i.DeleteCategoryDescRequest.encode(i.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,o={}){let a="/mezon.api.Mezon/RegistFCMDeviceToken",c=i.RegistFcmDeviceTokenRequest.encode(i.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",o=i.ClanEmojiCreateRequest.encode(i.ClanEmojiCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteByIdClanEmoji",s=i.ClanEmojiDeleteRequest.encode(i.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",a=i.ClanEmojiUpdateRequest.encode(i.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiRecentList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiListedResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",o=i.SearchMessageRequest.encode(i.SearchMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMessageResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",o=i.SearchCtrlKRequest.encode(i.SearchCtrlKRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchCtrlKResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.Event.encode(i.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",o=i.ListEventsRequest.encode(i.ListEventsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.CreateEventRequest.encode(i.CreateEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventManagement.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",o=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,a={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteEvent",d=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=i.UpdateEventRequest.encode(i.UpdateEventRequest.fromPartial(t)).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",a=i.DeleteFriendsRequest.encode(i.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let o="/mezon.api.Mezon/ListFriends",s=i.ListFriendsRequest.encode(i.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",a=i.AddFriendsRequest.encode(i.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationChannelCategorySettingList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",o=i.ClanProfileRequest.encode(i.ClanProfileRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanProfile.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationSetting.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",o=i.NotifiReactMessage.encode(i.NotifiReactMessage.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotifiReactMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GetKeyServerResp.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",o=i.LinkInviteUserRequest.encode(i.LinkInviteUserRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkInviteUser.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",o=i.InviteUserRequest.encode(i.InviteUserRequest.fromPartial({invite_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.InviteUserRes.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let o="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),a=new Map,s="",c=this.buildFullUrl(this.basePath,o,a),d=m("GET",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.InviteUserRes.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ChannelDescList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",o=i.MarkAsReadRequest.encode(i.MarkAsReadRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.MezonOauthClientList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",a=i.DeleteNotificationsRequest.encode(i.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/ListNotifications",d=i.ListNotificationsRequest.encode(i.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){return i.NotificationList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",o=i.SetDefaultNotificationRequest.encode(i.SetDefaultNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",o=i.UpdateRoleChannelRequest.encode(i.UpdateRoleChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.PermissionList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let o="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",s=i.PermissionRoleChannelListEventRequest.encode(i.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,o={}){let a="/mezon.api.Mezon/DeletePinMessage",c=i.DeletePinMessage.encode(i.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>h),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let o="/mezon.api.Mezon/GetPinMessagesList",s=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){return i.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",o=i.Message2InboxRequest.encode(i.Message2InboxRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",o=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",o=i.GetPubKeysRequest.encode(i.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetPubKeysResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",o=i.PushPubKeyRequest.encode(i.PushPubKeyRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",o=i.AddRoleChannelDescRequest.encode(i.AddRoleChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",a=i.ChangeChannelCategoryRequest.encode(i.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",o=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListRoles",c=i.RoleListEventRequest.encode(i.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RoleListEventResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",o=i.CreateRoleRequest.encode(i.CreateRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Role.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",a=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,o={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRole",c=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",a=i.UpdateRoleRequest.encode(i.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",o=i.ListPermissionsRequest.encode(i.ListPermissionsRequest.fromPartial({role_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.PermissionList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListRoleUsers",s=i.ListRoleUsersRequest.encode(i.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",a=i.ListPermissionOfUsersRequest.encode(i.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let o="/mezon.api.Mezon/SearchThread",s=i.SearchThreadRequest.encode(i.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",o=i.SessionLogoutRequest.encode(i.SessionLogoutRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",o=i.ClanStickerAddRequest.encode(i.ClanStickerAddRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteClanStickerById",s=i.ClanStickerDeleteRequest.encode(i.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",a=i.ClanStickerUpdateByIdRequest.encode(i.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.StickerListedResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",o=i.RegisterStreamingChannelRequest.encode(i.RegisterStreamingChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.RegisterStreamingChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.StreamingChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.SystemMessagesList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",o=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let o="/mezon.api.Mezon/ListSdTopic",s=i.ListSdTopicRequest.encode(i.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",o=i.SdTopicRequest.encode(i.SdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SdTopic.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",o=i.DeleteSystemMessage.encode(i.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",o=i.GetSystemMessage.encode(i.GetSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SystemMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",a=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,a,s={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=i.ListThreadRequest.encode(i.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescListNoPool.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",a=i.UpdateCategoryDescRequest.encode(i.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",o=i.ChangeChannelPrivateRequest.encode(i.ChangeChannelPrivateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",a=i.UpdateClanProfileRequest.encode(i.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",o=i.UploadBatchAttachmentRequest.encode(i.UploadBatchAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachmentBatch.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MultipartUploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=i.MultipartUploadAttachmentFinishRequest.encode(i.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",o=i.UpdateUsersRequest.encode(i.UpdateUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.AllUserClans.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",a=i.UserPermissionInChannelListRequest.encode(i.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.UserStatus.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",o=i.WebhookCreateRequest.encode(i.WebhookCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.WebhookGenerateResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",a=i.WebhookUpdateRequestById.encode(i.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",a=i.WebhookListRequest.encode(i.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",a=i.WebhookDeleteRequestById.encode(i.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,a]of n)a instanceof Array?r+=a.reduce((s,c)=>s+encodeURIComponent(o)+"="+encodeURIComponent(c)+"&",""):a!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(a)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",o=i.EditChannelCanvasRequest.encode(i.EditChannelCanvasRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EditChannelCanvasResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasDetail",s=i.ChannelCanvasDetailRequest.encode(i.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteChannelCanvas",s=i.DeleteChannelCanvasRequest.encode(i.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListOnboarding",c=i.ListOnboardingRequest.encode(i.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",o=i.CreateOnboardingRequest.encode(i.CreateOnboardingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListOnboardingResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",a=i.UpdateOnboardingRequest.encode(i.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",o=i.GenerateClanWebhookRequest.encode(i.GenerateClanWebhookRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",o=i.ListClanWebhookRequest.encode(i.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",o={id:e,clan_id:t},s=i.ClanWebhookRequest.encode(i.ClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",o=M(v({},t),{id:e}),s=i.UpdateClanWebhookRequest.encode(i.UpdateClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},a=i.SdTopicDetailRequest.encode(i.SdTopicDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",a={clan_id:e,limit:t,page:n},c=i.ListOnboardingStepRequest.encode(i.ListOnboardingStepRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",o=M(v({},t),{clan_id:e}),s=i.UpdateOnboardingStepRequest.encode(i.UpdateOnboardingStepRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",o=i.CreateRoomChannelApps.encode(i.CreateRoomChannelApps.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.CreateRoomChannelApps.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",o=i.GenerateMeetTokenRequest.encode(i.GenerateMeetTokenRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{token:new TextDecoder("utf-8").decode(new Uint8Array(s.message))}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",o={client_id:e,client_name:t},s=i.GetMezonOauthClientRequest.encode(i.GetMezonOauthClientRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",o=i.MezonOauthClient.encode(i.MezonOauthClient.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MezonOauthClient.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},a=i.GenerateHashChannelAppsRequest.encode(i.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",o=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",o={clan_id:e,event_id:t},s=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",o=i.UpdateRoleOrderRequest.encode(i.UpdateRoleOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,o={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let a="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),s=new Map;s.set("username",t),s.set("metadata",n),s.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,a,s),h=m("POST",o,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(_=>l(this,null,function*(){if(!_.ok)throw _;let f=yield _.arrayBuffer();return i.GenerateMeetTokenExternalResponse.decode(new Uint8Array(f))})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},a=i.ListChannelDetailRequest.encode(i.ListChannelDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",o=i.ListChannelTimelineRequest.encode(i.ListChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.ListChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",o=i.CreateChannelTimelineRequest.encode(i.CreateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.CreateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",o=i.UpdateChannelTimelineRequest.encode(i.UpdateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.UpdateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",o=i.ChannelTimelineDetailRequest.encode(i.ChannelTimelineDetailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.ChannelTimelineDetailResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",o=i.UpdateClanOrderRequest.encode(i.UpdateClanOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/clan/discover",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:a},_=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",a={bot_id:e,channel_id:t,menu_type:n},c=i.ListQuickMenuAccessRequest.encode(i.ListQuickMenuAccessRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.QuickMenuAccessList.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},a=i.ListForSaleItemsRequest.encode(i.ListForSaleItemsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",o=i.IsFollowerRequest.encode(i.IsFollowerRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.IsFollowerResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",o=i.TransferOwnershipRequest.encode(i.TransferOwnershipRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",o=i.UpdateUsernameRequest.encode(i.UpdateUsernameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},a=i.IsBannedRequest.encode(i.IsBannedRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",o={message_id:e,abuse_type:t},s=i.ReportMessageAbuseReqest.encode(i.ReportMessageAbuseReqest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){let g="/mezon.api.Mezon/SendChannelMessage",C=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:y})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){return i.ChannelMessageAck.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A={}){var X;let C="/mezon.api.Mezon/SendChannelMessage",w=new Map,S=typeof a=="string"?a:JSON.stringify(a!=null?a:{}),J=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:S,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g})).finish(),D=this.buildFullUrl((X=e.api_url)!=null?X:"",C,w),F=m("POST",A,"");return F.body=J,e.token&&(F.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,F).then(z=>l(this,null,function*(){if(!z.ok)throw z;if(z.status===204)return{};let Q=yield z.arrayBuffer();return i.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((z,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f){let y="/mezon.api.Mezon/UpdateChannelMessage",A=i.ChannelMessageUpdate.encode(i.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,content:a,mentions:s,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:_,is_update_msg_topic:f})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:y,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return i.ChannelMessageUpdate.decode(w.message)})),new Promise((w,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,a,s,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",f=i.ChannelMessageRemove.encode(i.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,has_attachment:a,mentions:c,references:d,topic_id:s})).finish(),y=m("POST",{},"");return y.body=f,Promise.race([this.send({urlPath:h,fetchOptions:y}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=i.HandleParticipantMeetStateEvent.encode(i.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),_=m("POST",a,"");return _.body=h,Promise.race([this.send({urlPath:s,fetchOptions:_}).then(f=>f),new Promise((f,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:a},_=i.MessageButtonClicked.encode(i.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:a},_=i.DropdownBoxSelected.encode(i.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",o={clan_id:e,channel_id:t},s=i.ActiveArchivedThread.encode(i.ActiveArchivedThread.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",o=i.ListMutedChannelRequest.encode(i.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.MutedChannelList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,a,s,c,d,h,_,f,y){let g="/mezon.api.Mezon/ReactChannelMessage",C=i.MessageReaction.encode(i.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,emoji_id:a,emoji:s,count:c,message_sender_id:d,action:h,emoji_recent_id:f,sender_name:y,topic_id:_})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){return i.ChannelMessageSend.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var s,c,d,h,_,f;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",o=i.CreatePollRequest.encode(i.CreatePollRequest.fromPartial({channel_id:(s=e.channel_id)!=null?s:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(_=e.expire_hours)!=null?_:0,type:(f=e.type)!=null?f:0})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(y=>l(this,null,function*(){if(y.code!=0)throw y;let g=i.CreatePollResponse.decode(y.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((y,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var s,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",o=i.VotePollRequest.encode(i.VotePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(_=>l(this,null,function*(){var y;let f=_.code==0?i.VotePollResponse.decode(_.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=f.my_answer_indices)!=null?y:[])}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",o=i.ClosePollRequest.encode(i.ClosePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",o=i.GetPollRequest.encode(i.GetPollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let _=i.GetPollResponse.decode(h.message);return{poll_id:_.poll_id,message_id:_.message_id,question:_.question,answers:_.answers.map(f=>({index:f.index,label:f.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(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let o="",a={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",a={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,a,s,c,d){return l(this,null,function*(){let h="",_={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:o,is_public:r,has_attachment:a,topic_id:s,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,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(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,o,a,s,c,d,h,_,f){return l(this,null,function*(){let y="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:a,mentions:s,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:_,is_update_msg_topic:f}};return Promise.race([this.send({urlPath:y,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(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(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C){return l(this,null,function*(){let w="",S={clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g};A!=null&&String(A).length>0&&(S.id=A);let E={menu_name:e,message:S};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:w,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,F)=>setTimeout(()=>F(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A){return l(this,null,function*(){let C="",w={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;return{}})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:y}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var w;if(C.code!=0)throw C;return(w=C==null?void 0:C.message)==null?void 0:w.channel_message_ack})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:o,message_id:a,emoji_id:s,emoji:c,count:d,message_sender_id:h,action:_,topic_id:f,emoji_recent_id:y,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,timestamp_seconds:a,operation:s,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:_,message_attachment:f,message_created_time:y}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let o="",a={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,o){return l(this,null,function*(){let a="",s={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:o}};return Promise.race([this.send({urlPath:a,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",a={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",o={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:o}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:i.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var ke="127.0.0.1",qe="7350",Ee="defaultkey",Te=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function L(b){return typeof Event=="function"?new Event(b):{type:b,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Ee,t=ke,n=qe,r=!1,o=Te,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,o,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,o=q.DefaultConnectTimeoutMs){var h,_;this.verbose=r;let a=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((_=this._lastConnectArgs)==null?void 0:_.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&a)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&a)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",L("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:o};let s,c,d=new Promise((f,y)=>{s=f,c=y});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",L("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("The socket timed out when trying to connect.")))},o);try{this.transport.connect(e,t,n,r,{onMessage:(f,y,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=Y(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",g):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",g)}),onClose:f=>{let y=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",f,!0,!0),y&&this.failConnect(new Error("Socket closed before connection was established."))},onOpen:f=>{this.verbose&&typeof console!="undefined"&&console.log(f);let y=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,s(),this._connectReject=void 0,y?this.onreconnect(f):this.onconnect(f)},onError:f=>{this.onerror(f),this._connectAttemptSeq+=1,this.failConnect(f instanceof Error?f:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",f,!0,!1)}})}catch(f){let y=L("error");this.onerror(y),this.markDisconnected("connect_sync_throw",y,!0,!1),this.failConnect(f instanceof Error?f:new Error(String(f)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",L("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",L("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=L("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let o=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,o||n&&this.ondisconnect(t),r&&!o&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let a=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,a)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&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)}onchannelarchive(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){this.verbose&&window&&window.console&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onscreenshare(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&window&&window.console&&console.log(e)}authenticateMezon(e,t,n,r,o={},a={}){let s={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",s,t,n,r,a).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(o=>o!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,a).then(s=>s!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(o=>Promise.resolve(o!=null))})}banClanUsers(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,o).then(a=>Promise.resolve(a!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,a,s).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let _,f,y,g,A;try{_=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=H(h.reactions);f=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){f=P(h.reactions||"[]")}try{let C=x(h.mentions);y=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){y=P(h.mentions||"[]")}try{let C=W(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=N(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.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:_,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:g,mentions:y,reactions:f,references:A,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(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let o={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(a=>{o.voice_channel_users.push({id:a.id,channel_id:a.channel_id,user_ids:a.user_ids,room_name:a.room_name,share_screen_ids:a.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,a,o,s).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.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(d)})})}listChannelAttachments(e,t,n,r,o,a,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,a,o,s,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(_=>{h.attachments.push({filename:_.filename,filesize:_.filesize,filetype:_.filetype,id:_.id,uploader:_.uploader,url:_.url,message_id:_.message_id,create_time_seconds:_.create_time_seconds,width:_.width,height:_.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(o=>{var a;r.clan_users.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,is_mobile:(a=o.user)==null?void 0:a.is_mobile,timezone:o.user.timezone,update_time:o.user.update_time,username:o.user.username,user_status:o.user.user_status,status:o.user.status,about_me:o.user.about_me,mezon_id:o.user.mezon_id,list_nick_names:o.user.list_nick_names,phone_number:o.user.phone_number,join_time_seconds:o.user.join_time_seconds},role_id:o.role_id,clan_nick:o.clan_nick,clan_avatar:o.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(o=>{r.clan_user_statuses.push({user_id:o.user_id,user_status:o.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(o=>{let a={clandesc:[]};return o.clandesc==null||(a.clandesc=o.clandesc),Promise.resolve(a)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(o=>{var a;return{channeldesc:(a=o.channeldesc)!=null?a:[],total_count:o.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(o=>{var a;return{users:(a=o.users)!=null?a:[],total_count:o.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(o=>{let a={categorydesc:[]};return o.categorydesc==null||(a.categorydesc=o.categorydesc),Promise.resolve(a)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(o=>Promise.resolve(o))})}registFCMDeviceToken(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,o).then(a=>Promise.resolve(a))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(o=>{let a={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(s=>{var c;a.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:(c=s.user)==null?void 0:c.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(a)})})}listNotifications(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,a).then(s=>{let c={cacheable_cursor:s.cacheable_cursor,notifications:[]};return s.notifications==null||s.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:o}).then(a=>a!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(t,n).then(r=>r!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(o=>{let a={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(s=>{a.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(a)})})}deletePinMessage(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,o).then(a=>a!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(o=>o!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(o=>o!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,a,o,s).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(o=>{r.channel_apps.push({id:o.id,channel_id:o.channel_id,app_id:o.app_id,clan_id:o.clan_id,app_url:o.app_url,app_name:o.app_name,app_logo:o.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(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 l(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 l(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 l(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,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,o).then(a=>{let s={clan_id:t,roles:a.roles};return Promise.resolve(s)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let o={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(o)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(o=>{let a={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(a)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(o=>{o.attachments=[];let a;try{let s=T(o.preview_imgs);a=(s==null?void 0:s.attachments)||s||P(o.preview_imgs||"[]")}catch(s){a=P(o.preview_imgs||"[]")}Array.isArray(a)?o.preview_imgs=a:o.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,o,a,s,c,d,h,_){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,o,a,s,c,d,h,_).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,o).then(a=>{let s={channel_canvases:[]};return a.channel_canvases==null||(s.clan_id=a.clan_id,s.channel_id=a.channel_id,s.channel_canvases=a.channel_canvases,s.count=a.count),Promise.resolve(s)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(o=>Promise.resolve(o))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(o=>o!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(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 l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(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,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,o).then(a=>a)})}listOnboarding(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,o).then(a=>a)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(o=>Promise.resolve(o))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(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,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(o=>Promise.resolve(o))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(o=>Promise.resolve(o))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(o=>Promise.resolve(o))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(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 l(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,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(o=>Promise.resolve(o))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e).then(t=>Promise.resolve(t))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(o=>Promise.resolve(o))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,a).then(s=>s!==void 0)})}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,a,s,c,d,h,_,f,y).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,o,a,s,c,d,h).then(_=>Promise.resolve(_))})}messageButtonClick(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,o)})}leaveChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,o)})}removeChatMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,o,a,s,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,a,s,c,d,h,_,f,y)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C,w){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,o,a,s,c,d,h,_,f,y,g,A,C,w)})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,o,a,s,c,d,h,_,f,y,g,A,C)})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,o,a,s,c,d,h,_,f,y,g)})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,o,a,s,c,d,h,_,f,y,g,A)})}writeMessageTyping(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,a,s)})}writeLastSeenMessage(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,a,s)})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,o,a,s,c,d,h,_,f,y,g)})}writeCustomStatus(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,o)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,o,a,s)})}forwardWebrtcSignaling(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,a)})}makeCallPush(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,o)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var Z=q;return ye(Oe);})();
1
+ "use strict";var mezonjs=(()=>{var he=Object.create;var B=Object.defineProperty,pe=Object.defineProperties,me=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertyNames,te=Object.getOwnPropertySymbols,fe=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var ne=(b,e,t)=>e in b?B(b,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[e]=t,v=(b,e)=>{for(var t in e||(e={}))se.call(e,t)&&ne(b,t,e[t]);if(te)for(var t of te(e))be.call(e,t)&&ne(b,t,e[t]);return b},M=(b,e)=>pe(b,ge(e));var O=(b=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(b,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):b)(function(b){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var ye=(b,e)=>{for(var t in e)B(b,t,{get:e[t],enumerable:!0})},ie=(b,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of _e(e))!se.call(b,r)&&r!==t&&B(b,r,{get:()=>e[r],enumerable:!(n=me(e,r))||n.enumerable});return b};var re=(b,e,t)=>(t=b!=null?he(fe(b)):{},ie(e||!b||!b.__esModule?B(t,"default",{value:b,enumerable:!0}):t,b)),Ce=b=>ie(B({},"__esModule",{value:!0}),b);var l=(b,e,t)=>new Promise((n,r)=>{var o=c=>{try{s(t.next(c))}catch(d){r(d)}},a=c=>{try{s(t.throw(c))}catch(d){r(d)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);s((t=t.apply(b,e)).next())});var Ue={};ye(Ue,{ApiAppRole:()=>oe,ChannelStreamMode:()=>ce,ChannelType:()=>ae,Client:()=>X,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>Y,E_CONNECT_ERROR:()=>$,NotificationType:()=>le,WebrtcSignalingType:()=>de,b64DecodeUnicode:()=>Pe,b64EncodeUnicode:()=>Ae,buildFetchOptions:()=>m,decodeAttachments:()=>W,decodeChannelTimelineAttachments:()=>T,decodeMentions:()=>x,decodeNotificationFcm:()=>G,decodeReactions:()=>H,decodeRefs:()=>N,encodeAttachments:()=>Re,encodeMentions:()=>we,encodeNotificationFcm:()=>Me,encodeReactions:()=>Se,encodeRefs:()=>ve,safeJSONParse:()=>P});var Lr=O("whatwg-fetch");var I=O("js-base64"),R=re(O("mezon-js-protobuf"));function m(b,e,t){let n=v({method:b},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(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function Ae(b){return(0,I.encode)(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Pe(b){return decodeURIComponent((0,I.decode)(b).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(b){if(b==null)return{t:b};let e;if(b instanceof Uint8Array)e=new TextDecoder().decode(b);else if(typeof b=="string")e=b;else return typeof b=="object"?b:{t:b};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 U=b=>!b||b===null||b===void 0||b===""||b==="[]";function x(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(b)}}function W(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(b)}}function T(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(b)}}function N(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(b)}}function H(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(b)}}function G(b){if(U(b))return;let e=b[0];if(e===91||e===123)return P(b);try{let n=b,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(b)}}function we(b){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(b)).finish()}function Re(b){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(b)).finish()}function ve(b){return R.MessageRefList.encode(R.MessageRefList.fromPartial(b)).finish()}function Se(b){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(b)).finish()}function Me(b){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(b)).finish()}var oe=(o=>(o[o.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",o[o.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",o[o.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",o[o.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",o[o.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",o))(oe||{}),ae=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(ae||{}),ce=(o=>(o[o.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",o[o.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",o[o.STREAM_MODE_DM=4]="STREAM_MODE_DM",o[o.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",o[o.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",o))(ce||{}),le=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(le||{}),de=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(de||{});function Y(b){let e,t,n,r,o,a;try{e=P(b.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=H(b.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=x(b.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=W(b.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=N(b.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=b.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:b.id||b.channel_message.message_id,avatar:b.channel_message.avatar,channel_id:b.channel_message.channel_id,mode:b.channel_message.mode,channel_label:b.channel_message.channel_label,clan_id:b.channel_message.clan_id,code:b.channel_message.code,message_id:b.channel_message.message_id,sender_id:b.channel_message.sender_id,update_time:b.channel_message.update_time,clan_logo:b.channel_message.clan_logo,category_name:b.channel_message.category_name,username:b.channel_message.username,clan_nick:b.channel_message.clan_nick,clan_avatar:b.channel_message.clan_avatar,display_name:b.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:a,references:o==null?void 0:o.refs,hide_editted:b.channel_message.hide_editted,is_public:b.channel_message.is_public,create_time_seconds:b.channel_message.create_time_seconds,update_time_seconds:b.channel_message.update_time_seconds,topic_id:b.channel_message.topic_id}}var $=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))($||{});var k=O("js-base64"),i=re(O("mezon-js-protobuf")),ue=O("mezon-js-protobuf");var ke="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let o=r-n;if(this.totalRequests++,t?this.failed++:o>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let a=(this.totalRequests-this.slowCount)/this.totalRequests;console.warn(`RATE ENDPOINT ${e}`,o,"TOTAL:",this.totalRequests,"SLOW:",this.slowCount,"RATE:",a),a<this.minAllowedFastRate&&(window.dispatchEvent(new CustomEvent(ke,{detail:{requestId:e,fastRate:a,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var Z=(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.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u))(Z||{}),V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new ue.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Z)return Z[e]}connect(e,t,n,r,o,a){let[s,c]=t.split(":");this.adapter.connect(s,c,n,e,a),this.adapter.onOpen=o.onOpen,this.adapter.onError=o.onError,this.adapter.onClose=o.onClose,this.adapter.onMessage=(d,h,_)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,_),d!=0){let f=this.cIds[d];if(!f){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",_);return}delete this.cIds[d],_.error?(f.reject({code:h,error:_.error}),this.metricLatency.end(d,!0)):(f.resolve({code:h,message:_}),this.metricLatency.end(d))}else yield o.onMessage(0,0,_)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let a=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(a),api_name:a,body:r.body}}}return new Promise((a,s)=>l(this,null,function*(){var c,d;if(!this.adapter.isOpen())s("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((c=o.ephemeral_message_send.message)==null?void 0:c.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((d=o.quick_menu_event.message)==null?void 0:d.content));let h=this.generatecid();this.metricLatency.start(h),this.cIds[h]={resolve:a,reject:s},t!==1/0&&t>0&&setTimeout(()=>{this.metricLatency.end(h,!0),s("The socket timed out while waiting for a response.")},t),o.cid=h,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.Account.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",o=i.UpdateAccountRequest.encode(i.UpdateAccountRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/checklogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,o="";o=JSON.stringify(e||{});let a=this.buildFullUrl(this.basePath,n,r),s=m("POST",t,o);return s.headers.Accept="application/x-protobuf",s.headers["Content-Type"]="application/json",Promise.race([fetch(a,s).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/createqrlogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LoginIDResponse.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/smsotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/emailotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/email",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,o,a,s={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",a);let h="";h=JSON.stringify(n||{});let _=this.buildFullUrl(this.basePath,c,d),f=m("POST",s,h);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(_,f).then(y=>l(this,null,function*(){if(!y.ok)throw y;let g=yield y.arrayBuffer();return i.Session.decode(new Uint8Array(g))})),new Promise((y,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",o=i.AccountMezon.encode(i.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",o=i.LinkAccountConfirmRequest.encode(i.LinkAccountConfirmRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,a.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/confirmotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",o=i.RegistrationEmailRequest.encode(i.RegistrationEmailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/SessionRefresh",s=i.SessionRefreshRequest.encode(i.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=s,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ListUserActivity.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",o=i.CreateActivityRequest.encode(i.CreateActivityRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UserActivity.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",o=i.AddAppRequest.encode(i.AddAppRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let o="/mezon.api.Mezon/ListApps",s=i.ListAppsRequest.encode(i.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",a=i.AppClan.encode(i.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",a=i.UpdateAppRequest.encode(i.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListAuditLog",c=i.ListAuditLogRequest.encode(i.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){return i.ListAuditLog.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",o=i.UpdateCategoryOrderRequest.encode(i.UpdateCategoryOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListCategoryDescs",d=i.CategoryDesc.encode(i.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.CategoryDescList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",o=i.ListChannelAppsRequest.encode(i.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelAppsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,o={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasList",c=i.ChannelCanvasListRequest.encode(i.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",o=i.AddFavoriteChannelRequest.encode(i.AddFavoriteChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.AddFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",a=i.RemoveFavoriteChannelRequest.encode(i.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",o=i.ListFavoriteChannelRequest.encode(i.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=i.ListChannelMessagesRequest.encode(i.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){return i.ChannelMessageList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",a=i.AddChannelUsersRequest.encode(i.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,a,s,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",f=i.ListChannelAttachmentRequest.encode(i.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:o,before:a,after:s,around:c})).finish(),y=m("POST",d,"");return y.body=f,Promise.race([this.send({urlPath:h,fetchOptions:y}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",a=i.LeaveThreadRequest.encode(i.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",a=i.ArchiveChannelRequest.encode(i.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",o=i.ListArchivedChannelDescsRequest.encode(i.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListArchivedChannelDescsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",a=i.RemoveChannelUsersRequest.encode(i.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListChannelDescs",h=i.ListChannelDescsRequest.encode(i.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",o=i.CreateChannelDescRequest.encode(i.CreateChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelDescription.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",a=i.AllUsersAddChannelRequest.encode(i.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",a=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",a=i.UpdateChannelDescRequest.encode(i.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,a,s,c,d,h,_={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",g=i.ChannelSettingListRequest.encode(i.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:o,private_channel:r,status:a,type:s,limit:c,page:d,channel_label:h})).finish(),A=m("POST",_,"");return A.body=g,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return i.ChannelSettingListResponse.decode(C.message)})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",a=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let o="/mezon.api.Mezon/ListClanDescs",s=i.ListClanDescRequest.encode(i.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return i.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let o="/mezon.api.Mezon/ListChannelBadgeCount",s=i.ListChannelBadgeCountRequest.encode(i.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let o="/mezon.api.Mezon/ListUserOnline",s=i.ListUserOnlineRequest.encode(i.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",o=i.CreateClanDescRequest.encode(i.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",o=i.DeleteClanDescRequest.encode(i.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",a=i.UpdateClanDescRequest.encode(i.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",a=i.RemoveClanUsersRequest.encode(i.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",a=i.BannedUserListRequest.encode(i.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnbanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/BanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",o=i.ListClanUsersRequest.encode(i.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",o=i.ListClanUsersStatusRequest.encode(i.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserStatusList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",o=i.CreateCategoryDescRequest.encode(i.CreateCategoryDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CategoryDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",o=i.CheckDuplicateNameRequest.encode(i.CheckDuplicateNameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code==0)return i.CheckDuplicateNameResponse.decode(s.message);throw s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",s=i.DeleteCategoryDescRequest.encode(i.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,o={}){let a="/mezon.api.Mezon/RegistFCMDeviceToken",c=i.RegistFcmDeviceTokenRequest.encode(i.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",o=i.ClanEmojiCreateRequest.encode(i.ClanEmojiCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteByIdClanEmoji",s=i.ClanEmojiDeleteRequest.encode(i.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",a=i.ClanEmojiUpdateRequest.encode(i.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiRecentList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiListedResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",o=i.SearchMessageRequest.encode(i.SearchMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMessageResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",o=i.SearchCtrlKRequest.encode(i.SearchCtrlKRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchCtrlKResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.Event.encode(i.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",o=i.ListEventsRequest.encode(i.ListEventsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.CreateEventRequest.encode(i.CreateEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventManagement.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",o=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,a={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteEvent",d=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=i.UpdateEventRequest.encode(i.UpdateEventRequest.fromPartial(t)).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",a=i.DeleteFriendsRequest.encode(i.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let o="/mezon.api.Mezon/ListFriends",s=i.ListFriendsRequest.encode(i.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",a=i.AddFriendsRequest.encode(i.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationChannelCategorySettingList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",o=i.ClanProfileRequest.encode(i.ClanProfileRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanProfile.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationSetting.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",o=i.NotifiReactMessage.encode(i.NotifiReactMessage.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotifiReactMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GetKeyServerResp.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",o=i.LinkInviteUserRequest.encode(i.LinkInviteUserRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkInviteUser.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",o=i.InviteUserRequest.encode(i.InviteUserRequest.fromPartial({invite_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.InviteUserRes.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let o="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),a=new Map,s="",c=this.buildFullUrl(this.basePath,o,a),d=m("GET",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.InviteUserRes.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ChannelDescList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",o=i.MarkAsReadRequest.encode(i.MarkAsReadRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.MezonOauthClientList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",a=i.DeleteNotificationsRequest.encode(i.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/ListNotifications",d=i.ListNotificationsRequest.encode(i.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){return i.NotificationList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",o=i.SetDefaultNotificationRequest.encode(i.SetDefaultNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",o=i.UpdateRoleChannelRequest.encode(i.UpdateRoleChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.PermissionList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let o="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",s=i.PermissionRoleChannelListEventRequest.encode(i.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,o={}){let a="/mezon.api.Mezon/DeletePinMessage",c=i.DeletePinMessage.encode(i.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>h),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let o="/mezon.api.Mezon/GetPinMessagesList",s=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){return i.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",o=i.Message2InboxRequest.encode(i.Message2InboxRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",o=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",o=i.GetPubKeysRequest.encode(i.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetPubKeysResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",o=i.PushPubKeyRequest.encode(i.PushPubKeyRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",o=i.AddRoleChannelDescRequest.encode(i.AddRoleChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",a=i.ChangeChannelCategoryRequest.encode(i.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",o=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListRoles",c=i.RoleListEventRequest.encode(i.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RoleListEventResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",o=i.CreateRoleRequest.encode(i.CreateRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Role.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",a=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,o={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRole",c=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",a=i.UpdateRoleRequest.encode(i.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",o=i.ListPermissionsRequest.encode(i.ListPermissionsRequest.fromPartial({role_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.PermissionList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListRoleUsers",s=i.ListRoleUsersRequest.encode(i.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",a=i.ListPermissionOfUsersRequest.encode(i.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let o="/mezon.api.Mezon/SearchThread",s=i.SearchThreadRequest.encode(i.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",o=i.SessionLogoutRequest.encode(i.SessionLogoutRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",o=i.ClanStickerAddRequest.encode(i.ClanStickerAddRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteClanStickerById",s=i.ClanStickerDeleteRequest.encode(i.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",a=i.ClanStickerUpdateByIdRequest.encode(i.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.StickerListedResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",o=i.RegisterStreamingChannelRequest.encode(i.RegisterStreamingChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.RegisterStreamingChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.StreamingChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.SystemMessagesList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",o=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let o="/mezon.api.Mezon/ListSdTopic",s=i.ListSdTopicRequest.encode(i.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",o=i.SdTopicRequest.encode(i.SdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SdTopic.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",o=i.DeleteSystemMessage.encode(i.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",o=i.GetSystemMessage.encode(i.GetSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SystemMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",a=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,a,s={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=i.ListThreadRequest.encode(i.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:a})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescListNoPool.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",a=i.UpdateCategoryDescRequest.encode(i.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",o=i.ChangeChannelPrivateRequest.encode(i.ChangeChannelPrivateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",a=i.UpdateClanProfileRequest.encode(i.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",o=i.UploadBatchAttachmentRequest.encode(i.UploadBatchAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachmentBatch.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MultipartUploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=i.MultipartUploadAttachmentFinishRequest.encode(i.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",o=i.UpdateUsersRequest.encode(i.UpdateUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.AllUserClans.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",a=i.UserPermissionInChannelListRequest.encode(i.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.UserStatus.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",o=i.WebhookCreateRequest.encode(i.WebhookCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.WebhookGenerateResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",a=i.WebhookUpdateRequestById.encode(i.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",a=i.WebhookListRequest.encode(i.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",a=i.WebhookDeleteRequestById.encode(i.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,a]of n)a instanceof Array?r+=a.reduce((s,c)=>s+encodeURIComponent(o)+"="+encodeURIComponent(c)+"&",""):a!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(a)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",o=i.EditChannelCanvasRequest.encode(i.EditChannelCanvasRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EditChannelCanvasResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasDetail",s=i.ChannelCanvasDetailRequest.encode(i.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteChannelCanvas",s=i.DeleteChannelCanvasRequest.encode(i.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListOnboarding",c=i.ListOnboardingRequest.encode(i.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",o=i.CreateOnboardingRequest.encode(i.CreateOnboardingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListOnboardingResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",a=i.UpdateOnboardingRequest.encode(i.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>c),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",o=i.GenerateClanWebhookRequest.encode(i.GenerateClanWebhookRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",o=i.ListClanWebhookRequest.encode(i.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",o={id:e,clan_id:t},s=i.ClanWebhookRequest.encode(i.ClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",o=M(v({},t),{id:e}),s=i.UpdateClanWebhookRequest.encode(i.UpdateClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},a=i.SdTopicDetailRequest.encode(i.SdTopicDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",a={clan_id:e,limit:t,page:n},c=i.ListOnboardingStepRequest.encode(i.ListOnboardingStepRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",o=M(v({},t),{clan_id:e}),s=i.UpdateOnboardingStepRequest.encode(i.UpdateOnboardingStepRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",o=i.CreateRoomChannelApps.encode(i.CreateRoomChannelApps.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.CreateRoomChannelApps.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",o=i.GenerateMeetTokenRequest.encode(i.GenerateMeetTokenRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateMeetTokenResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",o={client_id:e,client_name:t},s=i.GetMezonOauthClientRequest.encode(i.GetMezonOauthClientRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",o=i.MezonOauthClient.encode(i.MezonOauthClient.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MezonOauthClient.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},a=i.GenerateHashChannelAppsRequest.encode(i.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",o=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",o={clan_id:e,event_id:t},s=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",o=i.UpdateRoleOrderRequest.encode(i.UpdateRoleOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,o={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let a="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),s=new Map;s.set("username",t),s.set("metadata",n),s.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,a,s),h=m("POST",o,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(_=>l(this,null,function*(){if(!_.ok)throw _;let f=yield _.arrayBuffer();return i.GenerateMeetTokenExternalResponse.decode(new Uint8Array(f))})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},a=i.ListChannelDetailRequest.encode(i.ListChannelDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",o=i.ListChannelTimelineRequest.encode(i.ListChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.ListChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",o=i.CreateChannelTimelineRequest.encode(i.CreateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.CreateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",o=i.UpdateChannelTimelineRequest.encode(i.UpdateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.UpdateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",o=i.ChannelTimelineDetailRequest.encode(i.ChannelTimelineDetailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.ChannelTimelineDetailResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",o=i.UpdateClanOrderRequest.encode(i.UpdateClanOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/clan/discover",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return i.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:a},_=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",a={bot_id:e,channel_id:t,menu_type:n},c=i.ListQuickMenuAccessRequest.encode(i.ListQuickMenuAccessRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.QuickMenuAccessList.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},a=i.ListForSaleItemsRequest.encode(i.ListForSaleItemsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",o=i.IsFollowerRequest.encode(i.IsFollowerRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.IsFollowerResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",o=i.TransferOwnershipRequest.encode(i.TransferOwnershipRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>s),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",o=i.UpdateUsernameRequest.encode(i.UpdateUsernameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},a=i.IsBannedRequest.encode(i.IsBannedRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",o={message_id:e,abuse_type:t},s=i.ReportMessageAbuseReqest.encode(i.ReportMessageAbuseReqest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){let g="/mezon.api.Mezon/SendChannelMessage",C=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:y})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){return i.ChannelMessageAck.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A={}){var ee;let C="/mezon.api.Mezon/SendChannelMessage",w=new Map,S=typeof a=="string"?a:JSON.stringify(a!=null?a:{}),J=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:S,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g})).finish(),D=this.buildFullUrl((ee=e.api_url)!=null?ee:"",C,w),F=m("POST",A,"");return F.body=J,e.token&&(F.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,F).then(z=>l(this,null,function*(){if(!z.ok)throw z;if(z.status===204)return{};let Q=yield z.arrayBuffer();return i.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((z,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f){let y="/mezon.api.Mezon/UpdateChannelMessage",A=i.ChannelMessageUpdate.encode(i.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,content:a,mentions:s,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:_,is_update_msg_topic:f})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:y,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return i.ChannelMessageUpdate.decode(w.message)})),new Promise((w,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,a,s,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",f=i.ChannelMessageRemove.encode(i.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,has_attachment:a,mentions:c,references:d,topic_id:s})).finish(),y=m("POST",{},"");return y.body=f,Promise.race([this.send({urlPath:h,fetchOptions:y}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=i.HandleParticipantMeetStateEvent.encode(i.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),_=m("POST",a,"");return _.body=h,Promise.race([this.send({urlPath:s,fetchOptions:_}).then(f=>f),new Promise((f,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:a},_=i.MessageButtonClicked.encode(i.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:a},_=i.DropdownBoxSelected.encode(i.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",o={clan_id:e,channel_id:t},s=i.ActiveArchivedThread.encode(i.ActiveArchivedThread.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>d),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",o=i.ListMutedChannelRequest.encode(i.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){return i.MutedChannelList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,a,s,c,d,h,_,f,y){let g="/mezon.api.Mezon/ReactChannelMessage",C=i.MessageReaction.encode(i.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,emoji_id:a,emoji:s,count:c,message_sender_id:d,action:h,emoji_recent_id:f,sender_name:y,topic_id:_})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){return i.ChannelMessageSend.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var s,c,d,h,_,f;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",o=i.CreatePollRequest.encode(i.CreatePollRequest.fromPartial({channel_id:(s=e.channel_id)!=null?s:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(_=e.expire_hours)!=null?_:0,type:(f=e.type)!=null?f:0})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(y=>l(this,null,function*(){if(y.code!=0)throw y;let g=i.CreatePollResponse.decode(y.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((y,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var s,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",o=i.VotePollRequest.encode(i.VotePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(_=>l(this,null,function*(){var y;let f=_.code==0?i.VotePollResponse.decode(_.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=f.my_answer_indices)!=null?y:[])}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",o=i.ClosePollRequest.encode(i.ClosePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",o=i.GetPollRequest.encode(i.GetPollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let _=i.GetPollResponse.decode(h.message);return{poll_id:_.poll_id,message_id:_.message_id,question:_.question,answers:_.answers.map(f=>({index:f.index,label:f.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(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let o="",a={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",a={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,a,s,c,d){return l(this,null,function*(){let h="",_={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:o,is_public:r,has_attachment:a,topic_id:s,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,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(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,o,a,s,c,d,h,_,f){return l(this,null,function*(){let y="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:a,mentions:s,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:_,is_update_msg_topic:f}};return Promise.race([this.send({urlPath:y,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(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(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C){return l(this,null,function*(){let w="",S={clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g};A!=null&&String(A).length>0&&(S.id=A);let E={menu_name:e,message:S};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:w,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,F)=>setTimeout(()=>F(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A){return l(this,null,function*(){let C="",w={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:y,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;return{}})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:y}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var w;if(C.code!=0)throw C;return(w=C==null?void 0:C.message)==null?void 0:w.channel_message_ack})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:o,message_id:a,emoji_id:s,emoji:c,count:d,message_sender_id:h,action:_,topic_id:f,emoji_recent_id:y,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,timestamp_seconds:a,operation:s,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:_,message_attachment:f,message_created_time:y}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let o="",a={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,o){return l(this,null,function*(){let a="",s={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:o}};return Promise.race([this.send({urlPath:a,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",a={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",o={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:o}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:i.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var qe="127.0.0.1",Ee="7350",Te="defaultkey",Oe=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function L(b){return typeof Event=="function"?new Event(b):{type:b,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Te,t=qe,n=Ee,r=!1,o=Oe,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,o,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,o=q.DefaultConnectTimeoutMs){var h,_;this.verbose=r;let a=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((_=this._lastConnectArgs)==null?void 0:_.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&a)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&a)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",L("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:o};let s,c,d=new Promise((f,y)=>{s=f,c=y});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",L("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("TIME_OUT")))},o);try{this.transport.connect(e,t,n,r,{onMessage:(f,y,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=Y(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",g):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",g)}),onClose:f=>{let y=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",f,!0,!0),y&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:f=>{this.verbose&&typeof console!="undefined"&&console.log(f);let y=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,s(),this._connectReject=void 0,y?this.onreconnect(f):this.onconnect(f)},onError:f=>{this.onerror(f),this._connectAttemptSeq+=1,this.failConnect(f instanceof Error?f:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",f,!0,!1)}})}catch(f){let y=L("error");this.onerror(y),this.markDisconnected("connect_sync_throw",y,!0,!1),this.failConnect(f instanceof Error?f:new Error(String(f)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",L("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",L("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=L("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let o=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,o||n&&this.ondisconnect(t),r&&!o&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let a=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,a)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&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)}onchannelarchive(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){this.verbose&&window&&window.console&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onscreenshare(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&window&&window.console&&console.log(e)}authenticateMezon(e,t,n,r,o={},a={}){let s={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",s,t,n,r,a).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(o=>o!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,a).then(s=>s!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(o=>Promise.resolve(o!=null))})}banClanUsers(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,o).then(a=>Promise.resolve(a!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,a,s).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let _,f,y,g,A;try{_=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=H(h.reactions);f=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){f=P(h.reactions||"[]")}try{let C=x(h.mentions);y=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){y=P(h.mentions||"[]")}try{let C=W(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=N(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.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:_,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:g,mentions:y,reactions:f,references:A,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(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let o={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(a=>{o.voice_channel_users.push({id:a.id,channel_id:a.channel_id,user_ids:a.user_ids,room_name:a.room_name,share_screen_ids:a.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,a,o,s).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.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(d)})})}listChannelAttachments(e,t,n,r,o,a,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,a,o,s,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(_=>{h.attachments.push({filename:_.filename,filesize:_.filesize,filetype:_.filetype,id:_.id,uploader:_.uploader,url:_.url,message_id:_.message_id,create_time_seconds:_.create_time_seconds,width:_.width,height:_.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(o=>{var a;r.clan_users.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,is_mobile:(a=o.user)==null?void 0:a.is_mobile,timezone:o.user.timezone,update_time:o.user.update_time,username:o.user.username,user_status:o.user.user_status,status:o.user.status,about_me:o.user.about_me,mezon_id:o.user.mezon_id,list_nick_names:o.user.list_nick_names,phone_number:o.user.phone_number,join_time_seconds:o.user.join_time_seconds},role_id:o.role_id,clan_nick:o.clan_nick,clan_avatar:o.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(o=>{r.clan_user_statuses.push({user_id:o.user_id,user_status:o.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(o=>{let a={clandesc:[]};return o.clandesc==null||(a.clandesc=o.clandesc),Promise.resolve(a)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(o=>{var a;return{channeldesc:(a=o.channeldesc)!=null?a:[],total_count:o.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(o=>{var a;return{users:(a=o.users)!=null?a:[],total_count:o.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(o=>{let a={categorydesc:[]};return o.categorydesc==null||(a.categorydesc=o.categorydesc),Promise.resolve(a)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(o=>Promise.resolve(o))})}registFCMDeviceToken(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,o).then(a=>Promise.resolve(a))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(o=>{let a={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(s=>{var c;a.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:(c=s.user)==null?void 0:c.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(a)})})}listNotifications(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,a).then(s=>{let c={cacheable_cursor:s.cacheable_cursor,notifications:[]};return s.notifications==null||s.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:o}).then(a=>a!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(t,n).then(r=>r!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(o=>{let a={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(s=>{a.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(a)})})}deletePinMessage(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,o).then(a=>a!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(o=>o!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(o=>o!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,a,o,s).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(o=>{r.channel_apps.push({id:o.id,channel_id:o.channel_id,app_id:o.app_id,clan_id:o.clan_id,app_url:o.app_url,app_name:o.app_name,app_logo:o.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(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 l(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 l(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 l(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,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,o).then(a=>{let s={clan_id:t,roles:a.roles};return Promise.resolve(s)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let o={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(o)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(o=>{let a={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(a)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(o=>{o.attachments=[];let a;try{let s=T(o.preview_imgs);a=(s==null?void 0:s.attachments)||s||P(o.preview_imgs||"[]")}catch(s){a=P(o.preview_imgs||"[]")}Array.isArray(a)?o.preview_imgs=a:o.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,o,a,s,c,d,h,_){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,o,a,s,c,d,h,_).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,o).then(a=>{let s={channel_canvases:[]};return a.channel_canvases==null||(s.clan_id=a.clan_id,s.channel_id=a.channel_id,s.channel_canvases=a.channel_canvases,s.count=a.count),Promise.resolve(s)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(o=>Promise.resolve(o))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(o=>o!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(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 l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(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,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,o).then(a=>a)})}listOnboarding(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,o).then(a=>a)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(o=>Promise.resolve(o))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(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,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(o=>Promise.resolve(o))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(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 l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(o=>Promise.resolve(o))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(o=>Promise.resolve(o))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(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 l(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,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(o=>Promise.resolve(o))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e).then(t=>Promise.resolve(t))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(o=>Promise.resolve(o))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,a).then(s=>s!==void 0)})}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,a,s,c,d,h,_,f,y).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,o,a,s,c,d,h).then(_=>Promise.resolve(_))})}messageButtonClick(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,o,a,s,c,d,h,_,f,y,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,o)})}leaveChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,o)})}removeChatMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,o,a,s,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,a,s,c,d,h,_,f,y)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C,w){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,o,a,s,c,d,h,_,f,y,g,A,C,w)})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,o,a,s,c,d,h,_,f,y,g,A,C)})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,o,a,s,c,d,h,_,f,y,g)})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,_,f,y,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,o,a,s,c,d,h,_,f,y,g,A)})}writeMessageTyping(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,a,s)})}writeLastSeenMessage(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,a,s)})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,_,f,y,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,o,a,s,c,d,h,_,f,y,g)})}writeCustomStatus(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,o)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,o,a,s)})}forwardWebrtcSignaling(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,a)})}makeCallPush(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,o)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var X=q;return Ce(Ue);})();