mezon-js 2.16.6 → 2.16.7

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 me=Object.create;var B=Object.defineProperty,ge=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertyNames,ie=Object.getOwnPropertySymbols,be=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var se=(y,e,t)=>e in y?B(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,v=(y,e)=>{for(var t in e||(e={}))re.call(e,t)&&se(y,t,e[t]);if(ie)for(var t of ie(e))Ce.call(e,t)&&se(y,t,e[t]);return y},M=(y,e)=>ge(y,fe(e));var O=(y=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(y,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):y)(function(y){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+y+'" is not supported')});var Ae=(y,e)=>{for(var t in e)B(y,t,{get:e[t],enumerable:!0})},oe=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!re.call(y,r)&&r!==t&&B(y,r,{get:()=>e[r],enumerable:!(n=_e(e,r))||n.enumerable});return y};var ae=(y,e,t)=>(t=y!=null?me(be(y)):{},oe(e||!y||!y.__esModule?B(t,"default",{value:y,enumerable:!0}):t,y)),Pe=y=>oe(B({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var o=a=>{try{i(t.next(a))}catch(d){r(d)}},c=a=>{try{i(t.throw(a))}catch(d){r(d)}},i=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,c);i((t=t.apply(y,e)).next())});var Fe={};Ae(Fe,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>te,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>X,E_CONNECT_ERROR:()=>Z,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>Re,b64EncodeUnicode:()=>we,buildFetchOptions:()=>m,decodeAttachments:()=>W,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>$,decodeMentions:()=>x,decodeNotificationFcm:()=>j,decodeReactions:()=>H,decodeRefs:()=>N,encodeAttachments:()=>Me,encodeMentions:()=>Se,encodeNotificationFcm:()=>Ee,encodeReactions:()=>qe,encodeRefs:()=>ke,normalizeClanHashtags:()=>G,safeJSONParse:()=>P});var zr=O("whatwg-fetch");var I=O("js-base64"),R=ae(O("mezon-js-protobuf"));function $(y){let e=y[0];if(y.length===0||e===10||e===18)try{return R.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=v({method:y},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 we(y){return(0,I.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Re(y){return decodeURIComponent((0,I.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ve=512;function G(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>ve)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};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=y=>!y||y===null||y===void 0||y===""||y==="[]";function x(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(y)}}function W(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function N(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(y)}}function H(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(y)}}function j(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(y)}}function Se(y){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(y)).finish()}function Me(y){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(y)).finish()}function ke(y){return R.MessageRefList.encode(R.MessageRefList.fromPartial(y)).finish()}function qe(y){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(y)).finish()}function Ee(y){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(y)).finish()}var ce=(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))(ce||{}),le=(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))(le||{}),de=(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))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(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))(he||{});function X(y){let e,t,n,r,o,c;try{e=P(y.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=H(y.channel_message.reactions)}catch(a){console.log("reactions is invalid",a)}try{n=x(y.channel_message.mentions)}catch(a){console.log("mentions is invalid",a)}try{r=W(y.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}try{o=N(y.channel_message.references)}catch(a){console.log("references is invalid",a)}try{c=y.channel_message.referenced_message}catch(a){console.log("referenced messages is invalid",a)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.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:c,references:o==null?void 0:o.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var Z=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(Z||{});var k=O("js-base64"),s=ae(O("mezon-js-protobuf")),pe=O("mezon-js-protobuf");var Te="CHECK_HEALTHY",K=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 c=(this.totalRequests-this.slowCount)/this.totalRequests;c<this.minAllowedFastRate&&(window.dispatchEvent(new CustomEvent(Te,{detail:{requestId:e,fastRate:c,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 ee=(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))(ee||{}),J=class J{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new pe.MezonNetworkAdapter,this.metricLatency=new K}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 ee)return ee[e]}connect(e,t,n,r,o,c){let[i,a]=t.split(":");this.adapter.connect(i,a,n,e,c),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=J.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let c=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(c),api_name:c,body:r.body}}}return new Promise((c,i)=>l(this,null,function*(){var a,d;if(!this.adapter.isOpen())i("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((a=o.ephemeral_message_send.message)==null?void 0:a.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:c,reject:i},t!==1/0&&t>0&&setTimeout(()=>{this.metricLatency.end(h,!0),i("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=>l(this,null,function*(){if(o.code!=0)throw o;return o})),new Promise((o,c)=>setTimeout(c,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 s.Account.decode(o.message)})),new Promise((o,c)=>setTimeout(()=>c(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=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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 c=this.buildFullUrl(this.basePath,n,r),i=m("POST",t,o);return i.headers.Accept="application/x-protobuf",i.headers["Content-Type"]="application/json",Promise.race([fetch(c,i).then(a=>a),new Promise((a,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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,o,c,i={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",c);let h="";h=JSON.stringify(n||{});let _=this.buildFullUrl(this.basePath,a,d),f=m("POST",i,h);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(_,f).then(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((b,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=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,c.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(n)).finish(),a=m("POST",r,"");return a.body=i,e&&(a.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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 s.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=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UserActivity.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let o="/mezon.api.Mezon/ListApps",i=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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",c=s.AppClan.encode(s.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.App.encode(s.App.fromPartial({id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.App.encode(s.App.fromPartial({id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.App.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListAuditLog",a=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,c={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListCategoryDescs",d=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),h=m("POST",c,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.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=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelAppsResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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 c="/mezon.api.Mezon/GetChannelCanvasList",a=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.AddFavoriteChannelResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(a,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",c=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListFavoriteChannelResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,c,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelMessages",h=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:c})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelMessageList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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",c=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,c,i,a,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",f=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:o,before:c,after:i,around:a})).finish(),b=m("POST",d,"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.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",c=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.ChanEncryptionMethod.decode(a.message)})),new Promise((a,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",c=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListArchivedChannelDescsResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,c,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:c})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,c,i={}){let a="/mezon.api.Mezon/ListChannelDescs",h=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:c})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelDescList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelDescription.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",c=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.AllUsersAddChannelResponse.decode(a.message)})),new Promise((a,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",c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,c,i,a,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=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:o,private_channel:r,status:c,type:i,limit:a,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 s.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",c=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.VoiceChannelUserList.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let o="/mezon.api.Mezon/ListClanDescs",i=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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 s.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",i=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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",i=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanDesc.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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",c=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",c=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.BannedUserList.decode(a.message)})),new Promise((a,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 c="/mezon.api.Mezon/UnbanClanUsers",a=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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 c="/mezon.api.Mezon/BanClanUsers",a=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserStatusList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CategoryDesc.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).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 c="/mezon.api.Mezon/RegistFCMDeviceToken",a=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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 s.EmojiRecentList.decode(o.message)})),new Promise((o,c)=>setTimeout(()=>c(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 s.EmojiListedResponse.decode(o.message)})),new Promise((o,c)=>setTimeout(()=>c(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=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMessageResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.SearchCtrlKRequest.encode(s.SearchCtrlKRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchCtrlKResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.Event.encode(s.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",o=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventManagement.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,c={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteEvent",d=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),h=m("POST",c,"");return h.body=d,Promise.race([this.send({urlPath:i,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",c=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",c=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let o="/mezon.api.Mezon/ListFriends",i=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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",c=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.AddFriendsResponse.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",c=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",c=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",o=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationChannelCategorySettingList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanProfile.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",o=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",o=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationSetting.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",o=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotifiReactMessage.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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 s.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=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkInviteUser.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.InviteUserRes.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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))),c=new Map,i="",a=this.buildFullUrl(this.basePath,o,c),d=m("GET",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.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 s.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=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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 s.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=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",c=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,c={}){let i="/mezon.api.Mezon/ListNotifications",d=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),h=m("POST",c,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.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=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",o=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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 s.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",i=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,o={}){let c="/mezon.api.Mezon/DeletePinMessage",a=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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."))])}getPinMessagesList(e,t,n,r={}){let o="/mezon.api.Mezon/GetPinMessagesList",i=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",o=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetPubKeysResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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",c=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListRoles",a=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Role.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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 c="/mezon.api.Mezon/DeleteRole",a=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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",c=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.PermissionList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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",c=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.RoleList.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let o="/mezon.api.Mezon/SearchThread",i=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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 s.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=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.RegisterStreamingChannelResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,c,i={}){let a="/mezon.api.Mezon/ListStreamingChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:c})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.StreamingChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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 s.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=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let o="/mezon.api.Mezon/ListSdTopic",i=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SdTopic.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SystemMessage.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,c,i={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListThreadDescs",h=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:c})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelDescListNoPool.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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",c=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.UploadBatchAttachmentRequest.encode(s.UploadBatchAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachmentBatch.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MultipartUploadAttachment.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(()=>a(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=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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 s.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",c=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.UserPermissionInChannelListResponse.decode(a.message)})),new Promise((a,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 s.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=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.WebhookGenerateResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.WebhookListResponse.decode(a.message)})),new Promise((a,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",c=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,c]of n)c instanceof Array?r+=c.reduce((i,a)=>i+encodeURIComponent(o)+"="+encodeURIComponent(a)+"&",""):c!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(c)+"&");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=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EditChannelCanvasResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",i=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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",i=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),a=m("POST",r,"");return a.body=i,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListOnboarding",a=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListOnboardingResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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",c=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.OnboardingItem.decode(a.message)})),new Promise((a,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",c=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=c,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateClanWebhookResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListClanWebhookResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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},i=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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}),i=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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},c=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=c,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.SdTopic.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",c={clan_id:e,limit:t,page:n},a=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(c)).finish(),d=m("POST",r,"");return d.body=a,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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}),i=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateRoomChannelApps.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return console.log(i.message),$(new Uint8Array(i.message))})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",o={client_id:e,client_name:t},i=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.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=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MezonOauthClient.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},c=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=c,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.GenerateHashChannelAppsResponse.decode(a.message)})),new Promise((a,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=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",o={clan_id:e,event_id:t},i=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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 s.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 c="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),i=new Map;i.set("username",t),i.set("metadata",n),i.set("is_guest",r);let a="",d=this.buildFullUrl(this.basePath,c,i),h=m("POST",o,a);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 s.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=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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},c=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=c,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.ChannelDescription.decode(a.message)})),new Promise((a,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=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelTimelineResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateChannelTimelineResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UpdateChannelTimelineResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelTimelineDetailResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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",c=new Map,i="";i=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),d=m("POST",r,i);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(a,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,c,i={}){let a="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:c},_=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",c={bot_id:e,channel_id:t,menu_type:n},a=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(c)).finish(),d=m("POST",r,"");return d.body=a,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.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=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},c=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=c,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.ForSaleItemList.decode(a.message)})),new Promise((a,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=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.IsFollowerResponse.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,a)=>setTimeout(a,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=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(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},c=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=c,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.IsBannedResponse.decode(a.message)})),new Promise((a,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},i=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,c,i,a,d,h,_,f,b){let g="/mezon.api.Mezon/SendChannelMessage",C=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:c,attachments:i,references:a,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;return s.ChannelMessageAck.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,o,c,i,a,d,h,_,f,b,g,A={}){var ne;let C="/mezon.api.Mezon/SendChannelMessage",w=new Map,S=typeof c=="string"?c:JSON.stringify(c!=null?c:{}),Q=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:S,mentions:i,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,topic_id:g})).finish(),D=this.buildFullUrl((ne=e.api_url)!=null?ne:"",C,w),F=m("POST",A,"");return F.body=Q,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 Y=yield z.arrayBuffer();return s.ChannelMessageAck.decode(new Uint8Array(Y))})),new Promise((z,Y)=>setTimeout(()=>Y(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,c,i,a,d,h,_,f){let b="/mezon.api.Mezon/UpdateChannelMessage",A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,content:c,mentions:i,attachments:a,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:b,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageUpdate.decode(w.message)})),new Promise((w,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,c,i,a,d){let h="/mezon.api.Mezon/DeleteChannelMessage",f=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,has_attachment:c,mentions:a,references:d,topic_id:i})).finish(),b=m("POST",{},"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,o,c={}){let i="/mezon.api.Mezon/UpdateMezonVoiceState",a={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(a)).finish(),_=m("POST",c,"");return _.body=h,Promise.race([this.send({urlPath:i,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return f})),new Promise((f,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,c,i={}){let a="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:c},_=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,c,i={}){let a="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:c},_=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,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},i=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(o)).finish(),a=m("POST",n,"");return a.body=i,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MutedChannelList.decode(i.message)})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,c,i,a,d,h,_,f,b){let g="/mezon.api.Mezon/ReactChannelMessage",C=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,emoji_id:c,emoji:i,count:a,message_sender_id:d,action:h,emoji_recent_id:f,sender_name:b,topic_id:_})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;return s.ChannelMessageSend.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var i,a,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=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(i=e.channel_id)!=null?i:"0",clan_id:(a=e.clan_id)!=null?a:"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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=s.CreatePollResponse.decode(b.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((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var i,a,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=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(_=>l(this,null,function*(){var b;let f=_.code==0?s.VotePollResponse.decode(_.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=f.my_answer_indices)!=null?b:[])}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var i,a,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",o=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var i,a,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",o=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let _=s.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="",c={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",c={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,c,i,a,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:c,topic_id:i,mentions:a,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,b)=>setTimeout(()=>b(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,c,i,a,d,h,_,f){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:c,mentions:i,attachments:a,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:b,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,c,i,a,d,h,_,f,b,g,A,C){return l(this,null,function*(){let w="",S={clan_id:t,channel_id:n,mode:r,is_public:o,content:c,mentions:i,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,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 Q={quick_menu_event:E};return Promise.race([this.send({urlPath:w,fetchOptions:Q}).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,c,i,a,d,h,_,f,b,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:c,mentions:i,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,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,c,i,a,d,h,_,f,b){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:c,attachments:i,references:a,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b}};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,c,i,a,d,h,_,f,b,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:c,emoji_id:i,emoji:a,count:d,message_sender_id:h,action:_,topic_id:f,emoji_recent_id:b,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,c){return l(this,null,function*(){let i="",a={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:c}};return Promise.race([this.send({urlPath:i,fetchOptions:a}).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,c){return l(this,null,function*(){let i="",a={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:c}};return Promise.race([this.send({urlPath:i,fetchOptions:a}).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,c,i,a,d,h,_,f,b){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:c,operation:i,message_sender_avatar:a,message_sender_id:d,message_sender_username:h,message_content:_,message_attachment:f,message_created_time:b}};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="",c={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,c){return l(this,null,function*(){let i="",a={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:c}};return Promise.race([this.send({urlPath:i,fetchOptions:a}).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 c="",i={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:o}};return Promise.race([this.send({urlPath:c,fetchOptions:i}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",c={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,a)=>setTimeout(()=>a(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(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,i)=>setTimeout(()=>i(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?{}:s.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};J.DefaultSendTimeoutMs=1e4;var V=J;var Oe="127.0.0.1",Ue="7350",Le="defaultkey",De=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function L(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Le,t=Oe,n=Ue,r=!1,o=De,c=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=c;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 a=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new V(e,o,a)}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 c=((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()&&c)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&c)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 i,a,d=new Promise((f,b)=>{i=f,a=b});this._connectPromise=d,this._connectReject=a,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,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?j(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=X(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 b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",f,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:f=>{this.verbose&&typeof console!="undefined"&&console.log(f);let b=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,i(),this._connectReject=void 0,b?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 b=L("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!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 c=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,c)}}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={},c={}){let i={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",i,t,n,r,c).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||""}))}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(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||""}))}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,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,c).then(i=>i!==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(c=>Promise.resolve(c!=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,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,c,i).then(a=>{let d={messages:[],last_seen_message:a.last_seen_message,last_sent_message:a.last_sent_message};return a.messages==null||a.messages.forEach(h=>{let _,f,b,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);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=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:b,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(c=>{o.voice_channel_users.push({id:c.id,channel_id:c.channel_id,user_ids:c.user_ids,room_name:c.room_name,share_screen_ids:c.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,c,o,i).then(a=>{let d={channel_users:[],cursor:a.cursor,channel_id:a.channel_id};return a.channel_users==null||a.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,c,i,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,c,o,i,a).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 c;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:(c=o.user)==null?void 0:c.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,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,c,i).then(a=>{let d={channeldesc:[],next_cursor:a.next_cursor,prev_cursor:a.prev_cursor,cacheable_cursor:a.cacheable_cursor};return a.channeldesc==null||(d.channeldesc=a.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 c={clandesc:[]};return o.clandesc==null||(c.clandesc=o.clandesc),Promise.resolve(c)})})}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 c;return{channeldesc:(c=o.channeldesc)!=null?c:[],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 c;return{users:(c=o.users)!=null?c:[],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 c={categorydesc:[]};return o.categorydesc==null||(c.categorydesc=o.categorydesc),Promise.resolve(c)})})}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(c=>Promise.resolve(c))})}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 c={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(i=>{var a;c.friends.push({user:{avatar_url:i.user.avatar_url,create_time_seconds:i.user.create_time_seconds,display_name:i.user.display_name,edge_count:i.user.edge_count?Number(i.user.edge_count):0,id:i.user.id,lang_tag:i.user.lang_tag,location:i.user.location,online:i.user.online,timezone:i.user.timezone,update_time:i.user.update_time,username:i.user.username,is_mobile:(a=i.user)==null?void 0:a.is_mobile,user_status:i.user.user_status,status:i.user.status,mezon_id:i.user.mezon_id,list_nick_names:i.user.list_nick_names,phone_number:i.user.phone_number,about_me:i.user.about_me},state:i.state,source_id:i.source_id})}),Promise.resolve(c)})})}listNotifications(e,t,n,r,o,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,c).then(i=>{let a={cacheable_cursor:i.cacheable_cursor,notifications:[]};return i.notifications==null||i.notifications.forEach(d=>{a.notifications.push({id:d.id,subject:d.subject,content:d.content?j(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(a)})})}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(c=>c!==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*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=v({},n);return r.hashtags!==void 0&&(r.hashtags=G(r.hashtags)),this.transport.updateClanDesc(t,r).then(o=>o!==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 c={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(i=>{c.pin_messages_list.push({id:i.id,avatar:i.avatar,channel_id:i.channel_id,content:i.content,create_time_seconds:i.create_time_seconds,message_id:i.message_id,sender_id:i.sender_id,username:i.username,attachment:i.attachment})}),Promise.resolve(c)})})}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(c=>c!==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,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,c,o,i).then(a=>{let d={streaming_channel_users:[]};return a.streaming_channel_users==null||a.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(c=>{let i={clan_id:t,roles:c.roles};return Promise.resolve(i)})})}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 c={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(c)})})}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,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,c,i).then(a=>{let d={channeldesc:[]};return a.channeldesc==null||(d.channeldesc=a.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 c;try{let i=T(o.preview_imgs);c=(i==null?void 0:i.attachments)||i||P(o.preview_imgs||"[]")}catch(i){c=P(o.preview_imgs||"[]")}Array.isArray(c)?o.preview_imgs=c: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,c;try{let i=T(r.attachments),a=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c;try{let i=T(r.attachments),a=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c;try{let i=T(r.attachments),a=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c,i,a,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,c,i,a,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(c=>{let i={channel_canvases:[]};return c.channel_canvases==null||(i.clan_id=c.clan_id,i.channel_id=c.channel_id,i.channel_canvases=c.channel_canvases,i.count=c.count),Promise.resolve(i)})})}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(c=>c)})}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(c=>c)})}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*(){let t=v({},e);return t.hashtags!==void 0&&(t.hashtags=G(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}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,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,c).then(i=>i!==void 0)})}sendChannelMessage(e,t,n,r,o,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,c,i,a,d,h,_,f,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,c,i,a,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,c,i,a,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,c,i,a,d,h,_,f,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,c,i,a,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,c,i,a,d,h).then(_=>Promise.resolve(_))})}messageButtonClick(e,t,n,r,o,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,o,c,i).then(a=>Promise.resolve(a))})}dropdownBoxSelected(e,t,n,r,o,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,o,c,i).then(a=>Promise.resolve(a))})}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,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,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,c,i,a,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,c,i,a,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,c,i,a,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,c,i,a,d,h,_,f,b)})}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,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,g,A,C,w)})}writeEphemeralMessage(e,t,n,r,o,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,g,A,C)})}writeChatMessage(e,t,n,r,o,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,g)})}writeMessageReaction(e,t,n,r,o,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,g,A)})}writeMessageTyping(e,t,n,r,o,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,c,i)})}writeLastSeenMessage(e,t,n,r,o,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,c,i)})}writeLastPinMessage(e,t,n,r,o,c,i,a,d,h,_,f,b,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,c,i,a,d,h,_,f,b,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,c,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,o,c,i)})}forwardWebrtcSignaling(e,t,n,r,o,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,c)})}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 te=q;return Pe(Fe);})();
1
+ "use strict";var mezonjs=(()=>{var me=Object.create;var B=Object.defineProperty,ge=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols,be=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ie=(y,e,t)=>e in y?B(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,v=(y,e)=>{for(var t in e||(e={}))re.call(e,t)&&ie(y,t,e[t]);if(se)for(var t of se(e))Ce.call(e,t)&&ie(y,t,e[t]);return y},M=(y,e)=>ge(y,fe(e));var O=(y=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(y,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):y)(function(y){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+y+'" is not supported')});var Ae=(y,e)=>{for(var t in e)B(y,t,{get:e[t],enumerable:!0})},oe=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!re.call(y,r)&&r!==t&&B(y,r,{get:()=>e[r],enumerable:!(n=_e(e,r))||n.enumerable});return y};var ae=(y,e,t)=>(t=y!=null?me(be(y)):{},oe(e||!y||!y.__esModule?B(t,"default",{value:y,enumerable:!0}):t,y)),Pe=y=>oe(B({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var o=a=>{try{s(t.next(a))}catch(d){r(d)}},c=a=>{try{s(t.throw(a))}catch(d){r(d)}},s=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,c);s((t=t.apply(y,e)).next())});var Fe={};Ae(Fe,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>te,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>X,E_CONNECT_ERROR:()=>Z,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>Re,b64EncodeUnicode:()=>we,buildFetchOptions:()=>m,decodeAttachments:()=>W,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>$,decodeMentions:()=>x,decodeNotificationFcm:()=>j,decodeReactions:()=>H,decodeRefs:()=>N,encodeAttachments:()=>Me,encodeMentions:()=>Se,encodeNotificationFcm:()=>Ee,encodeReactions:()=>qe,encodeRefs:()=>ke,normalizeClanHashtags:()=>G,safeJSONParse:()=>P});var xr=O("whatwg-fetch");var I=O("js-base64"),R=ae(O("mezon-js-protobuf"));function $(y){let e=y[0];if(y.length===0||e===10||e===18)try{return R.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=v({method:y},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 we(y){return(0,I.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Re(y){return decodeURIComponent((0,I.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ve=512;function G(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>ve)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};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=y=>!y||y===null||y===void 0||y===""||y==="[]";function x(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(y)}}function W(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function N(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(y)}}function H(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(y)}}function j(y){if(U(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(y)}}function Se(y){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(y)).finish()}function Me(y){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(y)).finish()}function ke(y){return R.MessageRefList.encode(R.MessageRefList.fromPartial(y)).finish()}function qe(y){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(y)).finish()}function Ee(y){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(y)).finish()}var ce=(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))(ce||{}),le=(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))(le||{}),de=(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))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(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))(he||{});function X(y){let e,t,n,r,o,c;try{e=P(y.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=H(y.channel_message.reactions)}catch(a){console.log("reactions is invalid",a)}try{n=x(y.channel_message.mentions)}catch(a){console.log("mentions is invalid",a)}try{r=W(y.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}try{o=N(y.channel_message.references)}catch(a){console.log("references is invalid",a)}try{c=y.channel_message.referenced_message}catch(a){console.log("referenced messages is invalid",a)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.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:c,references:o==null?void 0:o.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var Z=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(Z||{});var k=O("js-base64"),i=ae(O("mezon-js-protobuf")),pe=O("mezon-js-protobuf");var Te="CHECK_HEALTHY",K=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 c=(this.totalRequests-this.slowCount)/this.totalRequests;c<this.minAllowedFastRate&&(window.dispatchEvent(new CustomEvent(Te,{detail:{requestId:e,fastRate:c,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 ee=(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[u.SearchMentionUsers=211]="SearchMentionUsers",u))(ee||{}),J=class J{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new pe.MezonNetworkAdapter,this.metricLatency=new K}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 ee)return ee[e]}connect(e,t,n,r,o,c){let[s,a]=t.split(":");this.adapter.connect(s,a,n,e,c),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=J.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let c=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(c),api_name:c,body:r.body}}}return new Promise((c,s)=>l(this,null,function*(){var a,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((a=o.ephemeral_message_send.message)==null?void 0:a.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:c,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=>l(this,null,function*(){if(o.code!=0)throw o;return o})),new Promise((o,c)=>setTimeout(c,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,c)=>setTimeout(()=>c(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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 c=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(c,s).then(a=>a),new Promise((a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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,c,s={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",c);let h="";h=JSON.stringify(n||{});let _=this.buildFullUrl(this.basePath,a,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(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return i.Session.decode(new Uint8Array(g))})),new Promise((b,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,c.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,e&&(a.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UserActivity.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=i.AppClan.encode(i.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.UpdateAppRequest.encode(i.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.App.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListAuditLog",a=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=a,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,c={}){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",c,"");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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelAppsResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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 c="/mezon.api.Mezon/GetChannelCanvasList",a=i.ChannelCanvasListRequest.encode(i.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.AddFavoriteChannelResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(a,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",c=i.RemoveFavoriteChannelRequest.encode(i.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListFavoriteChannelResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,c,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/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:c})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelMessageList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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",c=i.AddChannelUsersRequest.encode(i.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,c,s,a,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:c,after:s,around:a})).finish(),b=m("POST",d,"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).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",c=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.ChanEncryptionMethod.decode(a.message)})),new Promise((a,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",c=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.LeaveThreadRequest.encode(i.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.ArchiveChannelRequest.encode(i.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListArchivedChannelDescsResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.RemoveChannelUsersRequest.encode(i.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,c,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/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:c})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,c,s={}){let a="/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:c})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelDescription.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",c=i.AllUsersAddChannelRequest.encode(i.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.AllUsersAddChannelResponse.decode(a.message)})),new Promise((a,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",c=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.UpdateChannelDescRequest.encode(i.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,c,s,a,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:c,type:s,limit:a,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",c=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.VoiceChannelUserList.decode(a.message)})),new Promise((a,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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanDesc.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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",c=i.UpdateClanDescRequest.encode(i.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.RemoveClanUsersRequest.encode(i.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",c=i.BannedUserListRequest.encode(i.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.BannedUserList.decode(a.message)})),new Promise((a,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 c="/mezon.api.Mezon/UnbanClanUsers",a=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=a,Promise.race([this.send({urlPath:c,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 c="/mezon.api.Mezon/BanClanUsers",a=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=a,Promise.race([this.send({urlPath:c,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserStatusList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CategoryDesc.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code==0)return i.CheckDuplicateNameResponse.decode(s.message);throw s})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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 c="/mezon.api.Mezon/RegistFCMDeviceToken",a=i.RegistFcmDeviceTokenRequest.encode(i.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=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=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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,c)=>setTimeout(()=>c(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,c)=>setTimeout(()=>c(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMessageResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchCtrlKResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}searchMentionUsers(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMentionUsers",o=i.SearchMentionUsersRequest.encode(i.SearchMentionUsersRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMentionUsersResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventManagement.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,c={}){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",c,"");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",c=i.UpdateEventRequest.encode(i.UpdateEventRequest.fromPartial(t)).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",c=i.DeleteFriendsRequest.encode(i.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=i.AddFriendsRequest.encode(i.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.AddFriendsResponse.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",c=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",c=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationChannelCategorySettingList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanProfile.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationSetting.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotifiReactMessage.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkInviteUser.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.InviteUserRes.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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))),c=new Map,s="",a=this.buildFullUrl(this.basePath,o,c),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(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",c=i.DeleteNotificationsRequest.encode(i.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,c={}){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",c,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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 c="/mezon.api.Mezon/DeletePinMessage",a=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=a,Promise.race([this.send({urlPath:c,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."))])}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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetPubKeysResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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",c=i.ChangeChannelCategoryRequest.encode(i.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListRoles",a=i.RoleListEventRequest.encode(i.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Role.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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 c="/mezon.api.Mezon/DeleteRole",a=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=a,Promise.race([this.send({urlPath:c,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",c=i.UpdateRoleRequest.encode(i.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.PermissionList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=i.ListPermissionOfUsersRequest.encode(i.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.RoleList.decode(a.message)})),new Promise((a,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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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",c=i.ClanStickerUpdateByIdRequest.encode(i.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.RegisterStreamingChannelResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,c,s={}){let a="/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:c})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.StreamingChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SdTopic.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SystemMessage.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,c,s={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/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:c})).finish(),_=m("POST",s,"");return _.body=h,Promise.race([this.send({urlPath:a,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.ChannelDescListNoPool.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(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",c=i.UpdateCategoryDescRequest.encode(i.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.UpdateClanProfileRequest.encode(i.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachmentBatch.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MultipartUploadAttachment.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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",c=i.UserPermissionInChannelListRequest.encode(i.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.UserPermissionInChannelListResponse.decode(a.message)})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.WebhookGenerateResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.WebhookUpdateRequestById.encode(i.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.WebhookListRequest.encode(i.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.WebhookListResponse.decode(a.message)})),new Promise((a,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",c=i.WebhookDeleteRequestById.encode(i.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,c]of n)c instanceof Array?r+=c.reduce((s,a)=>s+encodeURIComponent(o)+"="+encodeURIComponent(a)+"&",""):c!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(c)+"&");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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EditChannelCanvasResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).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(),a=m("POST",r,"");return a.body=s,Promise.race([this.send({urlPath:o,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let c="/mezon.api.Mezon/ListOnboarding",a=i.ListOnboardingRequest.encode(i.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=a,Promise.race([this.send({urlPath:c,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListOnboardingResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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",c=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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",c=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.OnboardingItem.decode(a.message)})),new Promise((a,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",c=i.UpdateOnboardingRequest.encode(i.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=c,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateClanWebhookResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListClanWebhookResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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},c=i.SdTopicDetailRequest.encode(i.SdTopicDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=c,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.SdTopic.decode(a.message)})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",c={clan_id:e,limit:t,page:n},a=i.ListOnboardingStepRequest.encode(i.ListOnboardingStepRequest.fromPartial(c)).finish(),d=m("POST",r,"");return d.body=a,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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CreateRoomChannelApps.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return console.log(s.message),$(new Uint8Array(s.message))})),new Promise((s,a)=>setTimeout(()=>a(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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MezonOauthClient.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},c=i.GenerateHashChannelAppsRequest.encode(i.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=c,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.GenerateHashChannelAppsResponse.decode(a.message)})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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 c="/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 a="",d=this.buildFullUrl(this.basePath,c,s),h=m("POST",o,a);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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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},c=i.ListChannelDetailRequest.encode(i.ListChannelDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=c,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.ChannelDescription.decode(a.message)})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelTimelineResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CreateChannelTimelineResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UpdateChannelTimelineResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelTimelineDetailResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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",c=new Map,s="";s=JSON.stringify(n||{});let a=this.buildFullUrl(this.basePath,o,c),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(a,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,c,s={}){let a="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:c},_=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",c={bot_id:e,channel_id:t,menu_type:n},a=i.ListQuickMenuAccessRequest.encode(i.ListQuickMenuAccessRequest.fromPartial(c)).finish(),d=m("POST",r,"");return d.body=a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},c=i.ListForSaleItemsRequest.encode(i.ListForSaleItemsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=c,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.ForSaleItemList.decode(a.message)})),new Promise((a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.IsFollowerResponse.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,a)=>setTimeout(a,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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(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},c=i.IsBannedRequest.encode(i.IsBannedRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=c,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return i.IsBannedResponse.decode(a.message)})),new Promise((a,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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,c,s,a,d,h,_,f,b){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:c,attachments:s,references:a,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;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,c,s,a,d,h,_,f,b,g,A={}){var ne;let C="/mezon.api.Mezon/SendChannelMessage",w=new Map,S=typeof c=="string"?c:JSON.stringify(c!=null?c:{}),Q=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:S,mentions:s,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,topic_id:g})).finish(),D=this.buildFullUrl((ne=e.api_url)!=null?ne:"",C,w),F=m("POST",A,"");return F.body=Q,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 Y=yield z.arrayBuffer();return i.ChannelMessageAck.decode(new Uint8Array(Y))})),new Promise((z,Y)=>setTimeout(()=>Y(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,c,s,a,d,h,_,f){let b="/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:c,mentions:s,attachments:a,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:b,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,c,s,a,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:c,mentions:a,references:d,topic_id:s})).finish(),b=m("POST",{},"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).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,c={}){let s="/mezon.api.Mezon/UpdateMezonVoiceState",a={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=i.HandleParticipantMeetStateEvent.encode(i.HandleParticipantMeetStateEvent.fromPartial(a)).finish(),_=m("POST",c,"");return _.body=h,Promise.race([this.send({urlPath:s,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return f})),new Promise((f,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,c,s={}){let a="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:c},_=i.MessageButtonClicked.encode(i.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,c,s={}){let a="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:c},_=i.DropdownBoxSelected.encode(i.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",s,"");return f.body=_,Promise.race([this.send({urlPath:a,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),a=m("POST",n,"");return a.body=s,Promise.race([this.send({urlPath:r,fetchOptions:a}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return 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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MutedChannelList.decode(s.message)})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,c,s,a,d,h,_,f,b){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:c,emoji:s,count:a,message_sender_id:d,action:h,emoji_recent_id:f,sender_name:b,topic_id:_})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(S=>l(this,null,function*(){if(S.code!=0)throw S;return i.ChannelMessageSend.decode(S.message)})),new Promise((S,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var s,a,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:(a=e.clan_id)!=null?a:"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(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=i.CreatePollResponse.decode(b.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((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var s,a,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:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(_=>l(this,null,function*(){var b;let f=_.code==0?i.VotePollResponse.decode(_.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=f.my_answer_indices)!=null?b:[])}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var s,a,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:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).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,a,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:(a=e.message_id)!=null?a:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=o,Promise.race([this.send({urlPath:n,fetchOptions:c}).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="",c={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",c={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,c,s,a,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:c,topic_id:s,mentions:a,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,b)=>setTimeout(()=>b(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,c,s,a,d,h,_,f){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:c,mentions:s,attachments:a,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:b,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,c,s,a,d,h,_,f,b,g,A,C){return l(this,null,function*(){let w="",S={clan_id:t,channel_id:n,mode:r,is_public:o,content:c,mentions:s,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,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 Q={quick_menu_event:E};return Promise.race([this.send({urlPath:w,fetchOptions:Q}).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,c,s,a,d,h,_,f,b,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:c,mentions:s,attachments:a,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,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,c,s,a,d,h,_,f,b){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:c,attachments:s,references:a,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b}};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,c,s,a,d,h,_,f,b,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:c,emoji_id:s,emoji:a,count:d,message_sender_id:h,action:_,topic_id:f,emoji_recent_id:b,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,c){return l(this,null,function*(){let s="",a={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:c}};return Promise.race([this.send({urlPath:s,fetchOptions:a}).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,c){return l(this,null,function*(){let s="",a={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:c}};return Promise.race([this.send({urlPath:s,fetchOptions:a}).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,c,s,a,d,h,_,f,b){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:c,operation:s,message_sender_avatar:a,message_sender_id:d,message_sender_username:h,message_content:_,message_attachment:f,message_created_time:b}};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="",c={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,c){return l(this,null,function*(){let s="",a={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:c}};return Promise.race([this.send({urlPath:s,fetchOptions:a}).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 c="",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:c,fetchOptions:s}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",c={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:c}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,a)=>setTimeout(()=>a(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(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,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))])})}};J.DefaultSendTimeoutMs=1e4;var V=J;var Oe="127.0.0.1",Ue="7350",Le="defaultkey",De=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function L(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Le,t=Oe,n=Ue,r=!1,o=De,c=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=c;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 a=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new V(e,o,a)}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 c=((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()&&c)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&c)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,a,d=new Promise((f,b)=>{s=f,a=b});this._connectPromise=d,this._connectReject=a,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,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?j(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=X(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 b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",f,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:f=>{this.verbose&&typeof console!="undefined"&&console.log(f);let b=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,b?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 b=L("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!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 c=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,c)}}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={},c={}){let s={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",s,t,n,r,c).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||""}))}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(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||""}))}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,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,c).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(c=>Promise.resolve(c!=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,c,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,c,s).then(a=>{let d={messages:[],last_seen_message:a.last_seen_message,last_sent_message:a.last_sent_message};return a.messages==null||a.messages.forEach(h=>{let _,f,b,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);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=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:b,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(c=>{o.voice_channel_users.push({id:c.id,channel_id:c.channel_id,user_ids:c.user_ids,room_name:c.room_name,share_screen_ids:c.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,c,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,c,o,s).then(a=>{let d={channel_users:[],cursor:a.cursor,channel_id:a.channel_id};return a.channel_users==null||a.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,c,s,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,c,o,s,a).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 c;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:(c=o.user)==null?void 0:c.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,c,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,c,s).then(a=>{let d={channeldesc:[],next_cursor:a.next_cursor,prev_cursor:a.prev_cursor,cacheable_cursor:a.cacheable_cursor};return a.channeldesc==null||(d.channeldesc=a.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 c={clandesc:[]};return o.clandesc==null||(c.clandesc=o.clandesc),Promise.resolve(c)})})}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 c;return{channeldesc:(c=o.channeldesc)!=null?c:[],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 c;return{users:(c=o.users)!=null?c:[],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 c={categorydesc:[]};return o.categorydesc==null||(c.categorydesc=o.categorydesc),Promise.resolve(c)})})}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(c=>Promise.resolve(c))})}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 c={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(s=>{var a;c.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:(a=s.user)==null?void 0:a.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(c)})})}listNotifications(e,t,n,r,o,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,c).then(s=>{let a={cacheable_cursor:s.cacheable_cursor,notifications:[]};return s.notifications==null||s.notifications.forEach(d=>{a.notifications.push({id:d.id,subject:d.subject,content:d.content?j(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(a)})})}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(c=>c!==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*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=v({},n);return r.hashtags!==void 0&&(r.hashtags=G(r.hashtags)),this.transport.updateClanDesc(t,r).then(o=>o!==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))})}searchMentionUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMentionUsers(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 c={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(s=>{c.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(c)})})}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(c=>c!==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,c,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,c,o,s).then(a=>{let d={streaming_channel_users:[]};return a.streaming_channel_users==null||a.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(c=>{let s={clan_id:t,roles:c.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 c={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(c)})})}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,c,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,c,s).then(a=>{let d={channeldesc:[]};return a.channeldesc==null||(d.channeldesc=a.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 c;try{let s=T(o.preview_imgs);c=(s==null?void 0:s.attachments)||s||P(o.preview_imgs||"[]")}catch(s){c=P(o.preview_imgs||"[]")}Array.isArray(c)?o.preview_imgs=c: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,c;try{let s=T(r.attachments),a=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c;try{let s=T(r.attachments),a=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c;try{let s=T(r.attachments),a=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),c=(a==null?void 0:a.attachments)||a||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),c=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(c)?r.preview_imgs=c: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,c,s,a,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,c,s,a,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(c=>{let s={channel_canvases:[]};return c.channel_canvases==null||(s.clan_id=c.clan_id,s.channel_id=c.channel_id,s.channel_canvases=c.channel_canvases,s.count=c.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(c=>c)})}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(c=>c)})}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*(){let t=v({},e);return t.hashtags!==void 0&&(t.hashtags=G(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}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,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,c).then(s=>s!==void 0)})}sendChannelMessage(e,t,n,r,o,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,c,s,a,d,h,_,f,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,c,s,a,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,c,s,a,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,c,s,a,d,h,_,f,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,c,s,a,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,c,s,a,d,h).then(_=>Promise.resolve(_))})}messageButtonClick(e,t,n,r,o,c,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,c,s).then(a=>Promise.resolve(a))})}dropdownBoxSelected(e,t,n,r,o,c,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,c,s).then(a=>Promise.resolve(a))})}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,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,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,c,s,a,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,c,s,a,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,c,s,a,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,c,s,a,d,h,_,f,b)})}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,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,g,A,C,w)})}writeEphemeralMessage(e,t,n,r,o,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,g,A,C)})}writeChatMessage(e,t,n,r,o,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,g)})}writeMessageReaction(e,t,n,r,o,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,g,A)})}writeMessageTyping(e,t,n,r,o,c,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,c,s)})}writeLastSeenMessage(e,t,n,r,o,c,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,c,s)})}writeLastPinMessage(e,t,n,r,o,c,s,a,d,h,_,f,b,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,c,s,a,d,h,_,f,b,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,c,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,c,s)})}forwardWebrtcSignaling(e,t,n,r,o,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,c)})}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 te=q;return Pe(Fe);})();