-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.js
More file actions
1 lines (1 loc) · 65.6 KB
/
Copy pathindex.js
File metadata and controls
1 lines (1 loc) · 65.6 KB
1
import{i as e,a as n,_ as r,b as i,C as o,c as a,u as c,d as u,E as d,A as l,e as h,f,g as v,h as _,j as g,k as b,U as m,P as w,l as k,m as I,n as T,o as A,S as N,L as M,p as Q,V as j,q as V,r as W,v as X,s as Y,t as Z,w as $,x as ee,y as te,z as ne,B as re,D as ie,F as se,G as oe,H as ce,I as ue,J as de,K as le,M as he,W as fe,N as pe,O as ve,Q as _e,R as ge,T as be,X as me,Y as ye,Z as we,$ as Ce,a0 as ke,a1 as Se,a2 as Ie,a3 as Ee,a4 as Te,a5 as De,a6 as Pe,a7 as Ae,a8 as Ue,a9 as Oe}from"./lib/__bundle-e9d3f9f9.js";export{aa as AppInfo,x as AuthTokenType,ac as CachedChannelInfo,ad as CachedDataClearOrder,C as ChannelType,ab as CollectionEventSource,s as ConnectionState,ae as DayOfWeek,a6 as DeviceOsPlatform,af as LastMessageThreadingPolicy,L as LocalCacheConfig,ag as NotificationInfo,a9 as PushTemplate,a4 as PushTokenRegistrationState,P as PushTokenType,a8 as PushTriggerOption,ah as ReportCategoryInfo,ai as Role,S as SendbirdChatOptions,t as SendbirdError,D as SendbirdErrorCode,an as SendbirdPlatform,am as SendbirdProduct,aj as UIKitConfigInfo,ak as UnreadCountThreadingPolicy,U as User,al as UserOnlineState}from"./lib/__bundle-e9d3f9f9.js";import{MessageModule as Ne,MessageSearchQuery as Me}from"./message.js";import{PollModule as Re}from"./poll.js";import{L as Le,N as qe,a as Fe,b as ze,c as Qe,g as je,M as xe,d as Ke,e as Ve,f as He,h as Be,i as We,j as Ge,k as Je,l as Xe,m as Ye,n as Ze,o as $e,D as et,p as tt,q as nt,r as rt,A as it,I as st,s as ot,U as at,C as ct,t as ut,B as dt,F as lt,S as ht,u as ft,v as pt,w as vt,x as _t}from"./lib/__bundle-b83d0535.js";export{t as ApplicationUserListQuery,y as BannedUserListQuery,z as BaseChannel,B as BlockedUserListQuery,C as ConnectionHandler,D as DndSchedule,F as FriendListQuery,p as LogLevel,q as MemoryStore,E as MutedUserListQuery,O as OperatorListQuery,P as Participant,G as Plugin,R as ReportCategory,H as RestrictedUser,J as RestrictionInfo,K as RestrictionType,S as SessionHandler,U as UserEventHandler}from"./lib/__bundle-b83d0535.js";import{g as gt,G as bt,A as mt,F as yt,U as wt,a as Ct,b as kt,S as St,c as It,d as Et,D as Tt,R as Dt}from"./lib/__bundle-3845896a.js";import{g as Pt,N as At}from"./lib/__bundle-0f1a869e.js";import"./lib/__bundle-6c219ecb.js";import"./lib/__bundle-acd77193.js";var Ut=function(e){this.key=e.key,this.url=e.url},Ot=function(e){this.id=e.id,this.name=e.name,this.url=e.url,this.emojis=e.emojis?e.emojis.map((function(e){return new Ut(e)})):[]},Nt=function(e){this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map((function(e){return new Ot(e)})):[]},Mt={profileImage:void 0,profileUrl:void 0,nickname:void 0},Rt=function(e){return{v2:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Fe,keyName:ze,index:[gt(bt.LATEST_LAST_MESSAGE),gt(bt.CHRONOLOGICAL),gt(bt.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:qe,keyName:Qe,index:[je(xe.CHANNEL_LATEST),je(xe.NEWEST_CHILD_MESSAGE)]},{collectionName:Ke,keyName:Ve,index:[je(xe.CHANNEL_LATEST),je(xe.NEWEST_CHILD_MESSAGE)]},{collectionName:He,keyName:Be}])];case 1:return[2,t.sent()]}}))}))},v3:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:We,keyName:Ge,index:[Pt("latest_last_message")]}])];case 1:return[2,t.sent()]}}))}))},v4:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Je,keyName:Xe,index:[Ye()]}])];case 1:return[2,t.sent()]}}))}))},v5:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Ze,keyName:$e,index:[["-userId","-updatedAt"]]}])];case 1:return[2,t.sent()]}}))}))}}},Lt=function(e){var t=new Le;return function(n,s){return r(void 0,void 0,void 0,(function(){var r,a,c,u;return i(this,(function(i){switch(i.label){case 0:switch(n){case 1:case 2:case 3:case 4:return[3,1];case 5:return[3,2];case 6:return[3,4];case 7:return[3,11]}return[3,15];case 1:return s(),[3,16];case 2:return[4,e.reset()];case 3:return i.sent(),s(),[3,16];case 4:return i.trys.push([4,9,,10]),r=Rt(e),a=r.v2,c=r.v3,u=r.v4,[4,a()];case 5:return i.sent(),[4,c()];case 6:return i.sent(),[4,u()];case 7:return i.sent(),[4,e.collection(qe).removeIf({where:{channelType:o.OPEN}})];case 8:return i.sent(),[3,10];case 9:return i.sent(),t.warn("Failed to migrate to v2, v3, v4"),[3,10];case 10:return s(),[3,16];case 11:return i.trys.push([11,13,,14]),[4,(0,Rt(e).v5)()];case 12:return i.sent(),[3,14];case 13:return i.sent(),t.warn("Failed to migrate to v5"),[3,14];case 14:return s(),[3,16];case 15:s(),i.label=16;case 16:return[2]}}))}))}},qt=function(){return"undefined"!=typeof document?document.visibilityState:"visible"},Ft=function(e){function t(t){var n=t.getVisibilityState,r=void 0===n?qt:n,i=t.initialState,s=void 0===i?"visible":i,o=t.isEnabled,a=void 0===o||o,c=t.pauseCheckDelay,d=t.supportMultipleTabs,l=void 0!==d&&d,h=t.localCacheEnabled,f=void 0!==h&&h,p=e.call(this)||this;return p._currentVisibility="visible",p._activeTimestamp=0,p._storageKey="",p._onMessage=function(e){if(p.isActive){var t=e.data;if(t.tabId!==p._tabId&&"SB_ACTIVE_APP"===t.type){if(t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}}},p._onStorage=function(e){if(p.isActive&&e.key===p._storageKey&&e.newValue)try{var t=JSON.parse(e.newValue);if(t.tabId===p._tabId||t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}catch(e){console.warn("failed to parse active tab info from storage",e)}},p._toggleFocusState=function(){p.isActive||"visible"===p._currentVisibility&&p._changeAppStateToActive()},p._toggleStateByVisibilityState=function(){var e=p._getVisibilityState();if("visible"===e){if("hidden"===p._currentVisibility){if(p.isActive)return;p._changeAppStateToActive(),p._dispatchAppStateEvent()}}else if("hidden"===e&&"visible"===p._currentVisibility){if(!p.isActive)return;p._changeAppStateToInactive()}p._currentVisibility=e},p._dispatchAppStateEvent=function(){p.isActive?p.dispatch("resume"):(p._clearPauseTimer(),p._pauseCheckDelay&&(p._pauseDelayTimer=setTimeout((function(){p._pauseDelayTimer=void 0,p.dispatch("pause")}),p._pauseCheckDelay)))},p._dispatchLocalCacheEvent=function(){p.isActive?p.dispatch("enable_local_cache"):p.dispatch("disable_local_cache")},p._changeAppStateToActive=function(){if(p._clearPauseTimer(),p._activeTimestamp=Date.now(),p._currentState="ACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),p._supportMultipleTabs){var e={tabId:p._tabId,timestamp:p._activeTimestamp};p._broadcastChannel?p._broadcastChannel.postMessage(u({type:"SB_ACTIVE_APP"},e)):localStorage.setItem(p._storageKey,JSON.stringify(e))}},p._changeAppStateToInactive=function(){var e=p._getVisibilityState();p._currentState="INACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),"hidden"===e&&p._dispatchAppStateEvent()},p._clearPauseTimer=function(){p._pauseDelayTimer&&(clearTimeout(p._pauseDelayTimer),p._pauseDelayTimer=void 0)},p._getVisibilityState=r,p._isEnabled=a,p._supportMultipleTabs=!!f&&l,p._pauseCheckDelay=c,p._currentVisibility=s,p}return a(t,e),Object.defineProperty(t.prototype,"isActive",{get:function(){return"ACTIVE"===this._currentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentVisibility",{get:function(){return this._currentVisibility},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailableBroadCast",{get:function(){return"undefined"!=typeof BroadcastChannel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailable",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&!!window.removeEventListener},enumerable:!1,configurable:!0}),t.prototype.start=function(e){var t=e.appId,n=e.userId,r=e.backgroundConnectionCloseTimeout;if(this._isEnabled&&this.isAvailable){if(void 0!==r&&-1!==r&&(this._pauseCheckDelay=0===r?10:1e3*r),this._supportMultipleTabs){var i="sendbird-".concat(t,"-").concat(n);if(this._tabId="".concat(i,"-").concat(c()),this._storageKey="".concat("sendbird-active-app:").concat(t,"-").concat(n),this.isAvailableBroadCast)try{this._broadcastChannel=new BroadcastChannel(i),this._broadcastChannel.onmessage=this._onMessage}catch(e){window.addEventListener("storage",this._onStorage,{capture:!0})}else window.addEventListener("storage",this._onStorage,{capture:!0});window.addEventListener("focus",this._toggleFocusState,{capture:!0}),window.addEventListener("pointerdown",this._toggleFocusState,{capture:!0})}window.addEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),"hidden"!==this.currentVisibility?this._changeAppStateToActive():this._currentState="INACTIVE"}},t.prototype.stop=function(){this._isEnabled&&this.isAvailable&&(this._clearPauseTimer(),this._supportMultipleTabs&&(this._broadcastChannel?(this._broadcastChannel.onmessage=null,this._broadcastChannel.close(),this._broadcastChannel=void 0):window.removeEventListener("storage",this._onStorage,{capture:!0}),window.removeEventListener("focus",this._toggleFocusState,{capture:!0}),window.removeEventListener("pointerdown",this._toggleFocusState,{capture:!0})),window.removeEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),this._tabId="",this._currentState="INACTIVE",this._activeTimestamp=0)},t}(d),zt=function(){function e(e){var t=e.logger,n=e.connectionDelegate,r=void 0===n?null:n,i=this;this._onlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.reconnect()},this._offlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.disconnect()},this.unsubscribes=[],this._onlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("online",e),function(){return window.removeEventListener("online",e,!1)}},this._offlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("offline",e),function(){return window.removeEventListener("offline",e,!1)}},this.logger=t,r&&(this.connectionDelegate=r)}return Object.defineProperty(e.prototype,"isAvailableOnWeb",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&"ononline"in window&&"onoffline"in window&&"undefined"!=typeof navigator&&void 0!==navigator.onLine},enumerable:!1,configurable:!0}),e.prototype.setOnlineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._onlineListener=e)},e.prototype.setOfflineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._offlineListener=e)},e.prototype.start=function(){this.unsubscribes=[this._onlineListener(this._onlineWorker),this._offlineListener(this._offlineWorker)]},e.prototype.stop=function(){var e=this;this.unsubscribes.forEach((function(t){try{null==t||t()}catch(t){e.logger.warn(t.message)}})),this.unsubscribes=[]},e.prototype.isOnline=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.isAvailableOnWeb?[2,navigator.onLine]:[2,new Promise((function(e){fetch("https://www.google.com",{method:l.GET,mode:"no-cors"}).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]}))}))},e}(),Qt=function(e){function t(t){var n,r=this;return(r=e.call(this)||this).method=l.GET,r.path=h,r.params=f(v({ts:"number"==typeof t.token?t.token:void 0,token:"string"==typeof t.token?t.token:void 0,limit:null!==(n=t.limit)&&void 0!==n?n:100})),r}return a(t,e),t}(_),jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.configs=n.configs,r.hasMore=n.has_more,r.nextToken=n.next,r.ts=n.ts,r}return a(t,e),t}(g),xt=function(e){function t(t){var n=t.userId,r=t.nickname,i=t.profileUrl,s=t.profileImage,o=t.preferredLanguages,a=e.call(this)||this;return a.method=l.PUT,a.path="".concat(b,"/").concat(encodeURIComponent(n)),a.params=f(v({nickname:r,profile_url:i,profile_file:s,preferred_languages:o})),a}return a(t,e),t}(_),Kt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new m(t,u({},n)),r}return a(t,e),t}(g),Vt=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=t.unique,c=e.call(this)||this;return c.method=l.POST,c.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/apns"),c.params=f({apns_device_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o,is_unique:a}),c}return a(t,e),t}(_),Ht=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),Bt=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=t.unique,c=e.call(this)||this;return c.method=l.POST,c.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/gcm"),c.params=f({gcm_reg_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o,is_unique:a}),c}return a(t,e),t}(_),Wt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),Gt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=l.DELETE,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/apns/").concat(encodeURIComponent(r)),i}return a(t,e),t}(_),Jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new m(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),Xt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=l.DELETE,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/gcm/").concat(encodeURIComponent(r)),i}return a(t,e),t}(_),Yt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new m(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),Zt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.DELETE,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/apns"),r}return a(t,e),t}(_),$t=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new m(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),en=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.DELETE,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/gcm"),r}return a(t,e),t}(_),tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new m(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(g),nn=function(e){function t(t){var n=t.userId,r=t.type,i=t.token,s=t.ts,o=e.call(this)||this;return o.method=l.GET,o.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/").concat(encodeURIComponent(r),"/device_tokens"),o.params={created_ts:s,token:i},o}return a(t,e),t}(_),rn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTokens={type:n.type?w[n.type.toLowerCase()]:w.UNKNOWN,deviceTokens:n.device_tokens,hasMore:n.has_more,token:n.token},r}return a(t,e),t}(g),sn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),r}return a(t,e),t}(_),on=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(g),cn=function(e){function t(t){var n=t.userId,r=t.willAutoAccept,i=e.call(this)||this;return i.method=l.PUT,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),i.params={auto_accept:r},i}return a(t,e),t}(_),un=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(g),dn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(_),ln=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(g),hn=function(e){function t(t){var n=t.userId,r=t.doNotDisturbOn,i=t.startHour,s=t.startMin,o=t.endHour,a=t.endMin,c=t.timezone,u=e.call(this)||this;return u.method=l.PUT,u.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),u.params={do_not_disturb:r,start_hour:i,start_min:s,end_hour:o,end_min:a,timezone:c},u}return a(t,e),t}(_),fn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(g),pn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(_),vn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(g),_n=function(e){function t(t){var n=t.userId,r=t.snoozeOn,i=t.startTs,s=t.endTs,o=e.call(this)||this;return o.method=l.PUT,o.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),o.params={snooze_enabled:r,snooze_start_ts:i,snooze_end_ts:s},o}return a(t,e),t}(_),gn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(g),bn=function(e){function t(t){var n=t.userId,r=t.blockedUserId,i=e.call(this)||this;return i.method=l.POST,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/block"),i.params={target_id:r},i}return a(t,e),t}(_);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new m(t,n),r}a(t,e)}(g);var mn=function(e){function t(t){var n=t.userId,r=t.unblockedUserId,i=e.call(this)||this;return i.method=l.DELETE,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/block/").concat(encodeURIComponent(r)),i}return a(t,e),t}(_);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(g);var yn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(_),wn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(g),Cn=function(e){function t(t){var n=t.userId,r=t.pushTriggerOption,i=e.call(this)||this;return i.method=l.PUT,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),i.params={push_trigger_option:r},i}return a(t,e),t}(_),kn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(g),Sn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/template"),r}return a(t,e),t}(_),In=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(g),En=function(e){function t(t){var n=t.userId,r=t.templateName,i=e.call(this)||this;return i.method=l.PUT,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/push/template"),i.params={name:r},i}return a(t,e),t}(_),Tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(g),Dn=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=l.GET,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/friends/changelogs"),i.params={token:r},i}return a(t,e),t}(_),Pn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.changelogs={addedUsers:n.added.map((function(e){return new m(t,e)})),updatedUsers:n.updated.map((function(e){return new m(t,e)})),deletedUserIds:n.deleted,hasMore:n.has_more,token:n.next},r}return a(t,e),t}(g),An=function(e){function t(t){var n=t.userId,r=t.discoveries,i=e.call(this)||this;return i.method=l.PUT,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discoveries:r.map((function(e){return{friend_discovery_key:e.friendDiscoveryKey,friend_name:e.friendName}}))},i}return a(t,e),t}(_),Un=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.friendDiscoveryRequestId=n.friend_discovery_request_id,r}return a(t,e),t}(g),On=function(e){function t(t){var n=t.userId,r=t.discoveryKeys,i=e.call(this)||this;return i.method=l.DELETE,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discovery_keys:r},i}return a(t,e),t}(_);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(g);var Nn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=l.POST,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(_),Mn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new m(t,e)})),r}return a(t,e),t}(g),Rn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=l.DELETE,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(_);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(g);var Ln=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),r.params={},r}return a(t,e),t}(_),qn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.allowFriendDiscovery=n.allow_friend_discovery,r}return a(t,e),t}(g),Fn=function(e){function t(t){var n=t.userId,r=t.allowFriendDiscovery,i=e.call(this)||this;return i.method=l.PUT,i.path="".concat(b,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),i.params={allow_friend_discovery:r},i}return a(t,e),t}(_);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(g);var zn,Qn=function(e){function t(t){var n=t.doNotDisturbOn,r=void 0===n||n,i=t.userId,s=t.weeklyDndSchedules,o=t.timezone,a=e.call(this)||this;return a.method=l.PUT,a.path="".concat(b,"/").concat(encodeURIComponent(i),"/push_preference"),a.params=f({do_not_disturb:r,dnd_schedules:s?et.payloadify(s):[],timezone:o}),a}return a(t,e),t}(_),jn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:et.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return a(t,e),t}(g),xn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(_),Kn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:et.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return a(t,e),t}(g),Vn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=l.DELETE,r.path="".concat(b,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(_),Hn=function(e){function t(){var t=e.call(this)||this;return t.method=l.GET,t.path=k,t}return a(t,e),t}(_),Bn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiContainer=new Nt(n),r}return a(t,e),t}(g),Wn=function(e){function t(t){var n=t.categoryId,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(k,"/").concat(n),r}return a(t,e),t}(_),Gn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiCategory=new Ot(n),r}return a(t,e),t}(g),Jn=function(e){function t(t){var n=t.key,r=e.call(this)||this;return r.method=l.GET,r.path="".concat(I,"/").concat(n),r}return a(t,e),t}(_),Xn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emoji=new Ut(n),r}return a(t,e),t}(g),Yn=function(e){function t(){var t=e.call(this)||this;return t.method=l.GET,t.path="".concat(T),t}return a(t,e),t}(_),Zn=function(e){function t(t,n){var r,i=this,s=null!=n?n:{};return(i=e.call(this,t,n)||this).uikitConfiguration={string:JSON.stringify(s),json:s},i.updatedAt=null!==(r=null==n?void 0:n.updated_at)&&void 0!==r?r:0,i}return a(t,e),t}(g);!function(e){e.DELIVERED="DELIVERED",e.CLICKED="CLICKED"}(zn||(zn={}));var $n,er=function(e){function t(t){var n=t.deviceToken,r=t.pushTrackingId,i=t.messageId,s=t.allowedPushNotification,o=t.channelKey,a=t.templateKey,c=t.eventType,u=t.notificationEventDeadline,d=e.call(this)||this;return d.method=l.POST,d.path=A,d.params=f({device_token:n,push_tracking_id:r,message_id:i,allowed_push_notification:s,channel_key:o,template_key:a,event_type:c,notification_event_deadline:u}),d}return a(t,e),t}(_),tr=function(){function t(e,t,n){var s=this;this._storeInitialized=!1,this._iid=e,this.options=t;var o=j.of(e),a=o.sdkState,c=o.cacheContext,u=o.dispatcher,d=o.sessionManager,l=o.requestQueue,h=o.logger,f=o.userEventHandlers,p=o.appStateToggleEnabled,v=o.supportMultipleTabs;this._onlineDetector=new zt({logger:h,connectionDelegate:{reconnect:function(){return r(s,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:if(t=j.of(e),n=t.sdkState,r=t.connectionManager,(s=t.sessionManager).session.hasSession)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.connect(s.session.authToken)];case 2:return i.sent(),[3,4];case 3:if(o=i.sent(),Se(o))throw o;return h.debug("connect failed by reconnect event = ",o),[3,4];case 4:return[3,9];case 5:if("foreground"!==n.appState)return[3,9];i.label=6;case 6:return i.trys.push([6,8,,9]),[4,r.resetAndReconnect()];case 7:return i.sent(),[3,9];case 8:if(a=i.sent(),Se(a))throw a;return h.debug("resetAndReconnect failed by reconnect event = ",a),[3,9];case 9:return u.dispatch(new At),[2]}}))}))},disconnect:function(){de((function(){return r(s,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=j.of(e),n=t.connectionManager,r=t.dispatcher,[4,n.disconnect()];case 1:return i.sent(),r.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:ie.NETWORK_ERROR,error_description:"cause=network_closed"}}))),[2]}}))}))}))}}});var _=new mt(e,{localCacheEnabled:c.localCacheEnabled,enableAutoResend:c.localCacheConfig.enableAutoResend,dispatcher:u,sdkState:a,logger:h});n.forEach((function(t){t.init(e,{sdkState:a,cacheContext:c,dispatcher:u,sessionManager:d,requestQueue:l,logger:h,onlineDetector:s._onlineDetector}),s[t.name]=t})),this._appStateChangeDetector=new Ft({isEnabled:p,supportMultipleTabs:v,localCacheEnabled:c.localCacheEnabled}),this._appStateChangeDetector.on("resume",(function(){h.debug("the page resumes from freeze"),s.setForegroundState()})).on("pause",(function(){h.debug("the page freezes"),s.setBackgroundState()})).on("enable_local_cache",(function(){h.debug("the local cache is enabled because the page is active"),c.localCacheEnabled=!0,s._setAppActiveState(!0),"foreground"===a.appState&&u.dispatch(new yt)})).on("disable_local_cache",(function(){h.debug("the local cache is disabled because the page is inactive"),c.localCacheEnabled=!1,s._setAppActiveState(!1)})),u.on((function(t){var n;if(t instanceof le){if(t.stateType===he.CONNECTED)_.processNonAutoResendRegisteredPendingMessages()}else if(t instanceof fe){if("USEV"===t.code){var o=t.as(wt).event;if(o.category===Ct.FRIEND_DISCOVERED){var u=kt.getDataAsFriendDiscoveredEvent(e,o).friendDiscoveries;pe((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return[2,f.forEach((function(e){e.onFriendsDiscovered&&e.onFriendsDiscovered(u)}))]}))}))}))}}}else if(t instanceof ve){var d=j.of(s._iid).subscribedUnreadMessageCount,l=!1,p=t.ts;"number"==typeof p&&p>d.ts&&(d.all!==t.all&&(l=!0),d.all=t.all>=0?t.all:0,t.customTypes&&Object.keys(t.customTypes).forEach((function(e){d.customTypes[e]!==t.customTypes[e]&&(l=!0),d.customTypes[e]=t.customTypes[e]})),l=l&&d.ts>0,d.ts=p),l&&pe((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return[2,f.forEach((function(e){e.onTotalUnreadMessageCountChanged&&e.onTotalUnreadMessageCountChanged({groupChannelCount:d.all,feedChannelCount:d.feed,customTypeUnreadCount:d.customTypes}),e.onTotalUnreadMessageCountUpdated&&e.onTotalUnreadMessageCountUpdated(d.all,d.customTypes)}))]}))}))}))}else if(t instanceof _e)c.preference.set(s._getUserProfileCacheKey(a.userId),ge.payloadify(t.userProfile)),(null===(n=t.userProfile.appInfo.notificationInfo)||void 0===n?void 0:n.isEnabled)&&c.preference.set(be(s.appId),{value:!0});else if(t instanceof me)t.configSyncNeeded&&de((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getAppConfigsInfo()];case 1:return e.sent(),[2]}}))}))}));else if(t instanceof St)c.preference.set(ye(s.appId),{configTs:t.configTs});else if(t instanceof we)t.error&&t.error.isSessionInvalidatedError&&(h.debug("session revoked."),s._internalDisconnect(t.error));else if(t instanceof Ce)switch(t.event){case"resume":s.setForegroundState();break;case"pause":s.setBackgroundState()}}))}return t.init=function(e){var n=e.appId,r=e.appVersion,i=e.modules,s=void 0===i?[]:i,o=e.options,a=void 0===o?new N:o,u=e.debugMode,d=void 0!==u&&u,l=e.customApiHost,h=e.customWebSocketHost,f=e.newInstance,p=void 0!==f&&f,v=e.logLevel,_=e.localCacheEnabled,g=void 0!==_&&_,b=e.localCacheConfig,m=void 0===b?new M:b,y=e.localCacheEncryption,w=e.supportMultipleTabs,C=void 0!==w&&w,k=e.useAsyncStorageStore,S=void 0===k?null:k,I=e.useMMKVStorageStore,E=void 0===I?null:I,T=e.appStateToggleEnabled,D=void 0===T||T;if(!$n||p){var P="su-".concat(c()),A=null!=y?y:{encrypt:function(e){return e},decrypt:function(e){return e}},U=new Le;U.level=null!=v?v:tt.WARN;var O=new nt({encryption:A});d||(Q()?E?O=new rt({MMKV:E,encryption:A}):S&&(O=new it({AsyncStorage:S,encryption:A}),U.warn("AsyncStorage store is deprecated due to the small size limit. Please use MMKVStorage store instead.")):O=new st({encryption:A})),new j(P,{appId:n,appVersion:r,options:a,apiHost:null!=l?l:"https://api-".concat(n,".sendbird.com"),websocketHost:null!=h?h:"wss://ws-".concat(n,".sendbird.com"),store:O,encryption:A,logger:U,localCacheEnabled:g,localCacheConfig:m,debugMode:d,appStateToggleEnabled:D,supportMultipleTabs:C});var R=[new Ne,new Re],L=new t(P,a,V(V([],W(s),!1),W(R),!1));return $n||($n=L),L}return $n},Object.defineProperty(t,"instance",{get:function(){return $n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"version",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appId",{get:function(){return j.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appInfo",{get:function(){var e=j.of(this._iid).appInfo;return null!=e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appVersion",{get:function(){var e;return null!==(e=j.of(this._iid).sdkState.appVersion)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugMode",{get:function(){return!!j.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logLevel",{get:function(){return j.of(this._iid).logger.level},set:function(e){j.of(this._iid).logger.level=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCacheEnabled",{get:function(){return j.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCacheConfig",{get:function(){var e=j.of(this._iid).cacheContext;return e.localCacheEnabled?e.localCacheConfig:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ekey",{get:function(){return j.of(this._iid).sessionManager.ekey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){var e;return null!==(e=j.of(this._iid).sessionManager.currentUser)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){var e=j.of(this._iid).connectionManager;return e.isConnected?Y.OPEN:e.isConnecting?Y.CONNECTING:Y.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastConnectedAt",{get:function(){var e=j.of(this._iid),t=e.connectedAt;return e.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fcmPushToken",{get:function(){var e;return null!==(e=this._fcmPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"apnsPushToken",{get:function(){var e;return null!==(e=this._apnsPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),t.prototype._getNestDBVersion=function(){return 8},t.prototype._getPreferenceVersion=function(){return 9},t.prototype._getPreferenceCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".pref")},t.prototype._getUserProfileCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".profile")},t.prototype._internalDisconnect=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return t=j.of(this._iid),n=t.connectionManager,r=t.sdkState,s=t.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),s.cancelAll(),[4,n.logout(e)];case 1:return i.sent(),[4,this.clearCachedData()];case 2:return i.sent(),r.appState="foreground",r.isAppActive=!1,[2]}}))}))},t.prototype._getAppConfigsInfo=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u,d=this;return i(this,(function(l){switch(l.label){case 0:return e=j.of(this._iid),t=e.requestQueue,n=e.dispatcher,s=e.cacheContext,o=e.sdkState,a={},[4,s.preference.get(ye(o.appId))];case 1:return(u=l.sent())&&(c=u.configTs),new It("appConfigsInfo",(function(e){return r(d,void 0,void 0,(function(){var r,s,o,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return r={hasNext:!0,nextToken:e},s=new Qt({token:e}),[4,t.send(s)];case 1:return o=i.sent(),c=o.as(jt),u=c.configs,d=c.hasMore,l=c.nextToken,h=c.ts,Object.keys(u).forEach((function(e){a[e]=u[e]})),r.hasNext=d,r.nextToken=l,d||n.dispatch(new Et({appConfigsInfo:a,configTs:h})),[2,r]}}))}))})).start(c),[2]}}))}))},t.prototype.getMemoryStoreForDebugging=function(){var e=j.of(this._iid),t=e.debugMode,n=e.cacheContext;if(t)return n.store instanceof nt?n.store:null;throw Z.debugModeRequired},t.prototype.addExtension=function(e,t){var n=j.of(this._iid).sdkState;["sb_uikit","sb_syncmanager","device-os-platform"].indexOf(e)>-1&&n.extensions&&(n.extensions[e]=t)},t.prototype.addSendbirdExtensions=function(e,t,n){var r,i,s=j.of(this._iid),o=s.logger,a=s.sdkState,c=new RegExp(ke);if(0===e.length)return o.debug("sb.addSendbirdExtensions() has failed because the given sendbirdExtensions is empty."),!1;if(e.find((function(e){return!c.test(e.version)})))return o.debug("sb.addSendbirdExtensions() has failed because the given version did not satisfy the SemVer specification."),!1;if(n)try{for(var u=$(Object.entries(n)),d=u.next();!d.done;d=u.next()){var l=W(d.value,2),h=l[0],f=l[1];if(/&|=/.test(h)||/&|=/.test(f))return o.debug("sb.addSendbirdExtensions() has failed because the given customData includes at least one invalid character: = or &."),!1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return a.sendbirdRuntimeEnvironment={sendbirdExtensions:e,deviceOS:t,customData:n},!0},t.prototype.setOnlineListener=function(e){this._onlineDetector.setOnlineListener(e)},t.prototype.setOfflineListener=function(e){this._onlineDetector.setOfflineListener(e)},t.prototype._safeInitializeStore=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:t=j.of(this._iid).cacheContext,n.label=1;case 1:return n.trys.push([1,3,,5]),[4,t.store.init(e)];case 2:return n.sent(),this._storeInitialized=!0,[3,5];case 3:return n.sent(),t.replaceStore(new nt),[4,this._safeInitializeStore(e)];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},t.prototype.initializeCache=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a,c,u,d;return i(this,(function(i){switch(i.label){case 0:if(t=j.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.dispatcher,o=t.logger,n.userId&&n.userId===e)return[3,13];a="sendbird@".concat(n.appId,"/").concat(e,".db"),i.label=1;case 1:return i.trys.push([1,9,11,13]),r.localCacheEnabled?r.nestdb&&r.nestdb.state!==ot.CLOSED&&r.nestdb.name===a?[3,3]:(c="sendbird@".concat(n.appId,"/").concat(e,".db"),(u=r.nestdb=new vt({name:c,version:this._getNestDBVersion(),store:r.store,config:new _t({dbname:c,cacheLimit:64,itemSizeLimit:61440})})).on("upgrade",Lt(u)),u.on("storeReplaced",(function(e){r.replaceStore(e),r.localCacheEnabled=!1,u.on("upgrade",Lt(u))})),[4,u.open()]):[3,6];case 2:return i.sent(),this._storeInitialized=!0,s.dispatch(new Tt(this._iid,{userId:e})),[3,5];case 3:return[4,this._safeInitializeStore(a)];case 4:i.sent(),i.label=5;case 5:return n.userId=e,[3,8];case 6:return[4,this._safeInitializeStore(a)];case 7:i.sent(),n.userId=e,i.label=8;case 8:return[3,13];case 9:return d=i.sent(),o.warn("Nest DB Open Failed. ",d),r.store instanceof nt||(r.replaceStore(new nt),r.localCacheEnabled=!1),[4,this._safeInitializeStore(a)];case 10:throw i.sent(),n.userId=e,Z.databaseError;case 11:return[4,this._setupPreference(e)];case 12:return i.sent(),[7];case 13:return[2]}}))}))},t.prototype.getCacheDataSize=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=j.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.estimateUsage()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,0]}}))}))},t.prototype.clearCachedData=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=j.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.clear()]:[3,2];case 1:t.sent(),e.nestdb.trim(),t.label=2;case 2:return this._storeInitialized?[4,e.preference.clear()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},t.prototype.clearCachedMessages=function(e){return r(this,void 0,void 0,(function(){var t,n,s,o=this;return i(this,(function(a){switch(a.label){case 0:return se(Ie("string",e)).throw(Z.invalidParameters),t=j.of(this._iid).cacheContext,n=ft.of(this._iid),s=pt.of(this._iid),n&&s?[4,Promise.all(e.map((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,n.removeMessagesOfChannel(e)];case 1:return t.sent(),[4,s.removeMessagesOfChannel(e)];case 2:return t.sent(),[2]}}))}))})))]:[3,2];case 1:a.sent(),a.label=2;case 2:return t.localCacheEnabled&&t.nestdb&&t.nestdb.trim(),[2]}}))}))},t.prototype._setupPreference=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=j.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.statManager,[4,r.preference.init(this._getPreferenceCacheKey(e),this._getPreferenceVersion())];case 1:return i.sent(),[4,r.preference.get(this._getUserProfileCacheKey(e))];case 2:return(o=i.sent())&&new ge(this._iid,o).apply(),[4,s.init("sendbird@".concat(n.appId,"/").concat(e,".statlog"))];case 3:return i.sent(),[2]}}))}))},t.prototype._willReuseOpenedCacheDatabase=function(e){var t=j.of(this._iid),n=t.sdkState,r=t.cacheContext,i="sendbird@".concat(n.appId,"/").concat(e,".db");return!(!r.localCacheConfig||!r.nestdb||r.nestdb.state===ot.CLOSED||r.nestdb.name!==i)},t.prototype._ready=function(e,t,s){return void 0===s&&(s={}),r(this,void 0,void 0,(function(){var r,o,a,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return se(n("string",e)&&n("string",t,!0)).throw(Z.invalidParameters),r=j.of(this._iid),o=r.sdkState,a=r.cacheContext,c=r.connectionManager,u=r.dispatcher,d=s.errorForOtherUser,o.userId&&o.userId!==e?d?[3,2]:[4,c.logout()]:[3,3];case 1:return i.sent(),[3,3];case 2:throw d;case 3:return i.trys.push([3,5,,6]),l=this._willReuseOpenedCacheDatabase(e),[4,this.initializeCache(e)];case 4:return i.sent(),a.localCacheEnabled&&l&&u.dispatch(new Dt),[3,6];case 5:return i.sent(),h=j.of(this._iid).logger,a.localCacheEnabled=!1,h.warn("Cache initialization failed - cache is not available."),[3,6];case 6:return[2]}}))}))},t.prototype.authenticateFeed=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.authenticate(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.authenticate=function(e,t,n){var s;return void 0===n&&(n=ee.SESSION_TOKEN),r(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return r=j.of(this._iid),o=r.sessionManager,a=r.connectionManager,[4,this._ready(e,t,{errorForOtherUser:a.isConnected?Z.alreadyConnectedAsAnotherUser:void 0})];case 1:return i.sent(),(null===(s=o.session.services)||void 0===s?void 0:s.includes(Ee.CHAT))?[3,3]:(o.handler||t&&n!==ee.ACCESS_TOKEN||this.setSessionHandler(new ht),[4,o.authenticate(e,t)]);case 2:i.sent(),i.label=3;case 3:return[2,this.currentUser]}}))}))},t.prototype.connect=function(e,t){var n;return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this._ready(e,t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,j.of(this._iid).connectionManager.connect(t)];case 3:return r.sent(),[3,5];case 4:return this._onlineDetector.start(),this._appStateChangeDetector.start({appId:this.appId,userId:e,backgroundConnectionCloseTimeout:null===(n=this.appInfo)||void 0===n?void 0:n.backgroundConnectionCloseTimeout}),[7];case 5:return[2,this.currentUser]}}))}))},t.prototype.reconnect=function(){var e=j.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.sessionManager,i=e.dispatcher,s=r.session.hasSession;return s&&(i.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_reconnect"}}))),this._appStateChangeDetector.start({appId:this.appId,userId:this.currentUser.userId,backgroundConnectionCloseTimeout:this.appInfo.backgroundConnectionCloseTimeout}),this._onlineDetector.start(),t.resetAndReconnect().then((function(){n.appState="foreground"})).catch((function(){}))),s},t.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._internalDisconnect()];case 1:return e.sent(),[2]}}))}))},t.prototype.disconnectWebSocket=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=j.of(this._iid),t=e.connectionManager,n=e.requestQueue,e.dispatcher.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_disconnect_websocket"}}))),this._appStateChangeDetector.stop(),this._onlineDetector.stop(),n.cancelAll(),[4,t.disconnectWebSocket(!0)];case 1:return r.sent(),[2]}}))}))},t.prototype.setBackgroundState=function(){var e=j.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger,i=e.dispatcher;"foreground"===n.appState&&(n.appState="background",n.isAppActive=!1,r.debug("going background state"),i.dispatch(new te(new ne({type:re.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:ie.WEBSOCKET_CONNECTION_CLOSED,error_description:"cause=background"}}))),t.background().catch((function(e){r.debug("setBackgroundState error = ",e)})))},t.prototype.setForegroundState=function(){var e=j.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.dispatcher,i=e.logger;"background"===n.appState&&(n.appState="foreground",n.isAppActive=!0,i.debug("going foreground state"),t.resetAndReconnect().catch((function(e){i.debug("setForgroundState error = ",e)})),r.dispatch(new At))},t.prototype._setAppActiveState=function(e){j.of(this._iid).sdkState.isAppActive=e},t.prototype.setSessionHandler=function(e){se(e instanceof ht).throw(Z.invalidParameters),j.of(this._iid).sessionManager.handler=e},t.prototype.addUserEventHandler=function(e,t){se(n("string",e)&&t instanceof at).throw(Z.invalidParameters),j.of(this._iid).userEventHandlers.set(e,t)},t.prototype.removeUserEventHandler=function(e){j.of(this._iid).userEventHandlers.delete(e)},t.prototype.removeAllUserEventHandler=function(){j.of(this._iid).userEventHandlers.clear()},t.prototype.addConnectionHandler=function(e,t){se(n("string",e)&&t instanceof ct).throw(Z.invalidParameters),j.of(this._iid).connectionHandlers.set(e,t)},t.prototype.removeConnectionHandler=function(e){j.of(this._iid).connectionHandlers.delete(e)},t.prototype.removeAllConnectionHandler=function(){j.of(this._iid).connectionHandlers.clear()},t.prototype.createApplicationUserListQuery=function(e){return void 0===e&&(e={}),new ut(this._iid,e)},t.prototype.createBlockedUserListQuery=function(e){return void 0===e&&(e={}),new dt(this._iid,e)},t.prototype.createFriendListQuery=function(e){return void 0===e&&(e={}),new lt(this._iid,e)},t.prototype.createMessageSearchQuery=function(e){return new Me(this._iid,e)},t.prototype.createPollListQuery=function(e){return new oe(this._iid,u({},e))},t.prototype.createPollVoterListQuery=function(e){return new ce(this._iid,u({},e))},t.prototype.buildUserFromSerializedData=function(e){var t=ue(e);return new m(this._iid,m.payloadify(t))},t.prototype.updateCurrentUserInfo=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var r,s,o,a,c,d,l;return i(this,(function(i){switch(i.label){case 0:return r=u(u({},Mt),t),se(function(t){return e(t.profileImage,!0)&&n("string",t.profileUrl,!0)&&n("string",t.nickname,!0)}(r)).throw(Z.invalidParameters),this.currentUser?(s=j.of(this._iid),o=s.sdkState,a=s.requestQueue,c=new xt(u({userId:o.userId},r)),[4,a.send(c)]):[3,2];case 1:return d=i.sent(),l=d.as(Kt).user,this.currentUser&&(r.nickname&&(this.currentUser.nickname=l.nickname),(r.profileUrl||r.profileImage)&&(this.currentUser.plainProfileUrl=l.profileUrl)),[2,l];case 2:throw Z.connectionRequired}}))}))},t.prototype.updateCurrentUserInfoWithPreferredLanguages=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return se(Ie("string",e)).throw(Z.invalidParameters),this.currentUser?(t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new xt({userId:n.userId,preferredLanguages:e}),[4,r.send(s)]):[3,2];case 1:return o=i.sent(),a=o.as(Kt).user,this.currentUser&&(this.currentUser.preferredLanguages=a.preferredLanguages),[2,a];case 2:throw Z.connectionRequired}}))}))},t.prototype.registerFCMPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f,p=this;return i(this,(function(v){switch(v.label){case 0:if(se(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)&&n("boolean",null==t?void 0:t.unique,!0)).throw(Z.invalidParameters),0===e.trim().length)return j.of(this._iid).logger.warn("registerFCMPushTokenForCurrentUser() failed because the token is empty."),[2,Te.ERROR];if((null==t?void 0:t.deviceOS)&&se(De(Pe,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw(Z.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||Pe.ANDROID,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},v.label=1;case 1:return v.trys.push([1,4,,5]),c=j.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,!(null==t?void 0:t.unique)&&u.hasDeviceToken(w.FCM,e)?[2,Te.SUCCESS]:(h=new Bt({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled,unique:null==t?void 0:t.unique}),[4,l.send(h)]);case 2:return f=v.sent(),[4,de((function(){return r(p,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=f.as(Wt).lastDeletedAt,(null==t?void 0:t.unique)&&"number"==typeof n&&(u.unsetDeviceTokens(),u.setDeviceTokenDeletedAt(n)),u.setDeviceToken(w.FCM,e,a),[4,u.saveDeviceToken()];case 1:return r.sent(),[2]}}))}))}))];case 3:return v.sent(),this._fcmPushToken="",[2,Te.SUCCESS];case 4:return v.sent(),[2,Te.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,Te.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(se(n("string",e)).throw(Z.invalidParameters),0===e.trim().length)return j.of(this._iid).logger.warn("unregisterFCMPushTokenForCurrentUser() failed because the token is empty."),[2,Te.ERROR];if(!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=j.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new Xt({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as(Yt).lastDeletedAt,[4,de((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(w.FCM,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._fcmPushToken="",[2,Te.SUCCESS];case 4:return h.sent(),[2,Te.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,Te.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=j.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new en({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as(tn).lastDeletedAt,[4,de((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(w.FCM),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.registerAPNSPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f,p=this;return i(this,(function(v){switch(v.label){case 0:if(se(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)&&n("boolean",null==t?void 0:t.unique,!0)).throw(Z.invalidParameters),0===e.trim().length)return j.of(this._iid).logger.warn("registerAPNSPushTokenForCurrentUser() failed because the token is empty."),[2,Te.ERROR];if((null==t?void 0:t.deviceOS)&&se(De(Pe,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw(Z.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||Pe.IOS,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},v.label=1;case 1:return v.trys.push([1,4,,5]),c=j.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,!(null==t?void 0:t.unique)&&u.hasDeviceToken(w.APNS,e)?[2,Te.SUCCESS]:(h=new Vt({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled,unique:null==t?void 0:t.unique}),[4,l.send(h)]);case 2:return f=v.sent(),[4,de((function(){return r(p,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=f.as(Ht).lastDeletedAt,(null==t?void 0:t.unique)&&"number"==typeof n&&(u.unsetDeviceTokens(),u.setDeviceTokenDeletedAt(n)),u.setDeviceToken(w.APNS,e,a),[4,u.saveDeviceToken()];case 1:return r.sent(),[2]}}))}))}))];case 3:return v.sent(),this._apnsPushToken="",[2,Te.SUCCESS];case 4:return v.sent(),[2,Te.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,Te.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(se(n("string",e)).throw(Z.invalidParameters),0===e.trim().length)return j.of(this._iid).logger.warn("unregisterAPNSPushTokenForCurrentUser() failed because the token is empty."),[2,Te.ERROR];if(!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=j.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new Gt({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as(Jt).lastDeletedAt,[4,de((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(w.APNS,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._apnsPushToken="",[2,Te.SUCCESS];case 4:return h.sent(),[2,Te.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,Te.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=j.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new Zt({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as($t).lastDeletedAt,[4,de((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(w.APNS),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.markPushNotificationAsDelivered=function(e,t){var n;return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v,_,g,b,m,y,w,C;return i(this,(function(i){switch(i.label){case 0:if(r=j.of(this._iid),s=r.logger,o=r.sessionManager,a=r.requestQueue,c=r.pushNotificationAckManager,s.debug("markPushNotificationAsDelivered:",e),u=zn.DELIVERED,d=c.parseData(e),l=d.pushTrackingId,h=d.sessionTopics,f=d.sessionKey,p=d.messageId,v=d.channelKey,_=d.templateKey,g=d.notificationEventDeadline,!f)throw s.info("Can't use markPushNotificationAsDelivered() feature."),Z.malformedDataError;if(!h.includes(Ae.PUSH_ACKNOWLEDGEMENT))throw s.info("Can't use markPushNotificationAsDelivered() feature."),Z.malformedDataError;if(c.isAcked(l,u))return s.info("already delivered push notification:",l),[2];b=Boolean(v),m=t&&b,y=null===(n=o.deviceTokens[0])||void 0===n?void 0:n.token,w=new er({deviceToken:null!=y?y:"",pushTrackingId:l,eventType:u,messageId:p,channelKey:v,templateKey:_,notificationEventDeadline:g,allowedPushNotification:m}),f&&(w.headers["Session-Key"]=f),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,a.send(w)];case 2:return i.sent(),c.markAsAcked(l,u),[3,4];case 3:throw C=i.sent(),s.debug("failed to mark push notification as delivered. push tracking id: ".concat(l,". error: ").concat(C)),C;case 4:return[2]}}))}))},t.prototype.markPushNotificationAsClicked=function(e){var t;return r(this,void 0,void 0,(function(){var n,r,s,o,a,c,u,d,l,h,f,p,v,_,g,b,m;return i(this,(function(i){switch(i.label){case 0:if(n=j.of(this._iid),r=n.logger,s=n.sessionManager,o=n.requestQueue,a=n.pushNotificationAckManager,r.debug("markPushNotificationAsClicked:",e),c=zn.CLICKED,u=a.parseData(e),d=u.pushTrackingId,l=u.sessionTopics,h=u.sessionKey,f=u.messageId,p=u.channelKey,v=u.templateKey,_=u.notificationEventDeadline,!h)throw r.info("Can't use markPushNotificationAsClicked() feature."),Z.malformedDataError;if(!l.includes(Ae.PUSH_ACKNOWLEDGEMENT))throw r.info("Can't use markPushNotificationAsClicked() feature."),Z.malformedDataError;if(a.isAcked(d,c))return r.info("already clicked push notification:",d),[2];g=null===(t=s.deviceTokens[0])||void 0===t?void 0:t.token,b=new er({deviceToken:null!=g?g:"",pushTrackingId:d,eventType:c,messageId:f,channelKey:p,templateKey:v,notificationEventDeadline:_}),h&&(b.headers["Session-Key"]=h),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.send(b)];case 2:return i.sent(),a.markAsAcked(d,c),[3,4];case 3:throw m=i.sent(),r.debug("failed to mark push notification as clicked. push tracking id: ".concat(d,". error: ").concat(m)),m;case 4:return[2]}}))}))},t.prototype.getChannelInvitationPreference=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new sn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,{autoAccept:s.as(on).autoAccept}]}}))}))},t.prototype.setChannelInvitationPreference=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return se(n("boolean",e)).throw(Z.invalidParameters),t=j.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new cn({userId:r.userId,willAutoAccept:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,{autoAccept:a.as(un).autoAccept}]}}))}))},t.prototype.getDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new dn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(ln).preference]}}))}))},t.prototype.setDoNotDisturb=function(e,t,s,o,a,c){return void 0===t&&(t=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===c&&(c=""),r(this,void 0,void 0,(function(){var r,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return se(n("boolean",e)&&n("number",t)&&n("number",s)&&n("number",o)&&n("number",a)&&n("string",c)).throw(Z.invalidParameters),r=j.of(this._iid),u=r.sdkState,d=r.requestQueue,l=new hn({userId:u.userId,doNotDisturbOn:e,startHour:t,startMin:s,endHour:o,endMin:a,timezone:c}),[4,d.send(l)];case 1:return h=i.sent(),[2,h.as(fn).preference]}}))}))},t.prototype.setWeeklyDoNotDisturb=function(e,t){return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,s,o,a,c;return i(this,(function(i){switch(i.label){case 0:return se(e instanceof et&&e.isValid()&&n("string",t)).throw(Z.invalidParameters),r=j.of(this._iid),s=r.sdkState,o=r.requestQueue,a=new Qn({userId:s.userId,weeklyDndSchedules:e,timezone:t}),[4,o.send(a)];case 1:return c=i.sent(),[2,c.as(jn).preference]}}))}))},t.prototype.getWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new xn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(Kn).preference]}}))}))},t.prototype.clearWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Vn({userId:t.userId}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},t.prototype.getSnoozePeriod=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new pn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(vn).snoozePeriod]}}))}))},t.prototype.setSnoozePeriod=function(e,t,s){return void 0===t&&(t=0),void 0===s&&(s=0),r(this,void 0,void 0,(function(){var r,o,a,c,u;return i(this,(function(i){switch(i.label){case 0:return se(n("boolean",e)&&n("number",t)&&n("number",s)).throw(Z.invalidParameters),r=j.of(this._iid),o=r.sdkState,a=r.requestQueue,c=new _n({userId:o.userId,snoozeOn:e,startTs:t,endTs:s}),[4,a.send(c)];case 1:return u=i.sent(),[2,u.as(gn).snoozePeriod]}}))}))},t.prototype.getMyPushTokensByToken=function(e,t){return r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v;return i(this,(function(i){switch(i.label){case 0:return se(n("string",e)&&De(w,t)).throw(Z.invalidParameters),r=j.of(this._iid),s=r.sdkState,o=r.requestQueue,a=r.sessionManager,c=new nn({userId:s.userId,type:t,token:e}),[4,o.send(c)];case 1:u=i.sent(),d=u.as(rn).pushTokens;try{for(l=$(d.deviceTokens),h=l.next();!h.done;h=l.next())f=h.value,a.setDeviceToken(d.type,f)}catch(e){p={error:e}}finally{try{h&&!h.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}}return[4,a.saveDeviceToken()];case 2:return i.sent(),[2,d]}}))}))},t.prototype.getPushTriggerOption=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new yn({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(wn).pushTriggerOption]}}))}))},t.prototype.setPushTriggerOption=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return se(De(Ue,e)).throw(Z.invalidParameters),t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Cn({userId:n.userId,pushTriggerOption:e}),[4,r.send(s)];case 1:return[2,i.sent().as(kn).pushTriggerOption]}}))}))},t.prototype.getPushTemplate=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Sn({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(In).name]}}))}))},t.prototype.setPushTemplate=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return se(De(Oe,e)).throw(Z.invalidParameters),t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new En({userId:n.userId,templateName:e}),[4,r.send(s)];case 1:return[2,i.sent().as(Tn).name]}}))}))},t.prototype.blockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return se(e instanceof m||n("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new bn({userId:r.userId,blockedUserId:e instanceof m?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.blockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.blockUser(e)]}))}))},t.prototype.unblockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return se(e instanceof m||n("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new mn({userId:r.userId,unblockedUserId:e instanceof m?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.unblockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.unblockUser(e)]}))}))},t.prototype.getFriendChangeLogsByToken=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return se(n("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new Dn({userId:r.userId,token:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,a.as(Pn).changelogs]}}))}))},t.prototype.getAllowFriendDiscovery=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Ln({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(qn).allowFriendDiscovery]}}))}))},t.prototype.setAllowFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return se(n("boolean",e)).throw(Z.invalidParameters),t=j.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new Fn({userId:r.userId,allowFriendDiscovery:e}),[4,s.send(o)];case 1:return i.sent(),[2,e]}}))}))},t.prototype.uploadFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new An({userId:n.userId,discoveries:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(Un).friendDiscoveryRequestId]}}))}))},t.prototype.deleteFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriendDiscoveries([e])]}))}))},t.prototype.deleteFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return se(Ie("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new On({userId:n.userId,discoveryKeys:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.addFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return se(Ie("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Nn({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(Mn).users]}}))}))},t.prototype.deleteFriend=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriends([e])]}))}))},t.prototype.deleteFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return se(Ie("string",e)).throw(Z.invalidParameters),t=j.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Rn({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.getAllEmoji=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=j.of(this._iid).requestQueue,t=new Hn,[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(Bn).emojiContainer]}}))}))},t.prototype.getEmojiCategory=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=j.of(this._iid).requestQueue,n=new Wn({categoryId:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Gn).emojiCategory]}}))}))},t.prototype.getEmoji=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=j.of(this._iid).requestQueue,n=new Jn({key:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Xn).emoji]}}))}))},t.prototype.getUIKitConfiguration=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=j.of(this._iid),se(e.hasExtension("sb_uikit")).throw(Z.notSupportedError),t=e.requestQueue,n=new Yn,[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Zn).uikitConfiguration]}}))}))},t.prototype.getReportCategoryInfoList=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,j.of(this._iid).reportCategoryManager.categories()];case 1:return[2,e.sent()]}}))}))},t}();export{Ut as Emoji,Ot as EmojiCategory,Nt as EmojiContainer,tr as default};