From 89a240a7397c8c934053c07b8fbaf13a7eb9051c Mon Sep 17 00:00:00 2001 From: Mathews Date: Wed, 10 Jul 2024 19:32:20 +0530 Subject: [PATCH] v4.0.10 --- CometChat.d.ts | 143 ++++++++++++++++++++++++++++++++++-- CometChat.js | 2 +- README.md | 192 +++++-------------------------------------------- package.json | 2 +- 4 files changed, 154 insertions(+), 185 deletions(-) diff --git a/CometChat.d.ts b/CometChat.d.ts index c132b5f..9296f54 100644 --- a/CometChat.d.ts +++ b/CometChat.d.ts @@ -4,21 +4,49 @@ export namespace CometChatNotifications{ * Function to get preferences set for the logged-in user. * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.10 due to newer method 'fetchPreferences'. It will be removed in subsequent versions. */ export function fetchPushPreferences(): Promise; + /** + * Function to get preferences set for the logged-in user. + * @returns {Promise} + * @memberof CometChatNotifications + */ + export function fetchPreferences(): Promise; /** * Function to update preferences for the logged-in user. * @param {PushPreferences} pushPreferences * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.10 due to newer method 'updatePreferences'. It will be removed in subsequent versions. */ export function updatePushPreferences(pushPreferences: PushPreferences): Promise; + /** + * Function to update preferences for the logged-in user. + * @param {NotificationPreferences} notificationPreferences + * @returns {Promise} + * @memberof CometChatNotifications + */ + export function updatePreferences(notificationPreferences: NotificationPreferences): Promise; /** * Function to reset preferences for the logged-in user. * @returns {Promise} * @memberof CometChatNotifications + * @deprecated + * + * This method is deprecated as of version 4.0.10 due to newer method 'resetPreferences'. It will be removed in subsequent versions. */ export function resetPushPreferences(): Promise; + /** + * Function to reset preferences for the logged-in user. + * @returns {Promise} + * @memberof CometChatNotifications + */ + export function resetPreferences(): Promise; /** * Function to register push token for the current authToken of the logged-in user. * @returns {Promise} @@ -54,6 +82,26 @@ export namespace CometChatNotifications{ * @memberof CometChatNotifications */ export function getMutedConversations(): Promise; + + + /** + * Function to update timezone for the logged-in user. + * @returns {Promise} + * @param {string} timezone + * @memberof CometChatNotifications + */ + export function updateTimezone(timezone: String): Promise; + /** + * Function to get timezone for the logged-in user. + * @returns {Promise<{timezone: string} | string>} A promise that resolves to an object containing the timezone or a string in case of an error. + * @memberof CometChatNotifications + */ + export function getTimezone(): Promise< + | { + timezone: string; + } + | string + >; export enum MessagesOptions { DONT_SUBSCRIBE, SUBSCRIBE_TO_ALL, @@ -132,6 +180,8 @@ export namespace CometChatNotifications{ KEY_MUTED_CONVERSATIONS: string; KEY_FROM: string; KEY_TO: string; + KEY_GET_TIMEZONE: string; + KEY_UPDATE_TIMEZONE: string; }; export const APIResponseConstants: { TOKEN_REGISTER_SUCCESS: string; @@ -142,6 +192,9 @@ export namespace CometChatNotifications{ MUTE_CONVERSATION_ERROR: string; UNMUTE_CONVERSATION_SUCCESS: string; UNMUTE_CONVERSATION_ERROR: string; + TIMEZONE_UPDATE_SUCCESS: string; + TIMEZONE_UPDATE_ERROR: string; + TIMEZONE_FETCH_ERROR: string; }; export const DEFAULT_PROVIDER_ID = "default"; @@ -401,6 +454,10 @@ export namespace CometChatNotifications{ static fromJSON(jsonData: Object): OneOnOnePreferences; } + /** + * @deprecated This class is deprecated as of version 4.0.10 due to newer class 'NotificationPreferences'. + * It will be removed in subsequent versions. + */ export class PushPreferences { /** * Get the OneOnOne preferences. @@ -448,6 +505,54 @@ export namespace CometChatNotifications{ */ static fromJSON(jsonData: Object): PushPreferences; } + + export class NotificationPreferences { + /** + * Get the OneOnOne preferences. + * @returns {OneOnOnePreferences} + */ + getOneOnOnePreferences(): OneOnOnePreferences; + /** + * @param {OneOnOnePreferences} oneOnOnePreferences + * Set the OneOnOne preferences. + */ + setOneOnOnePreferences(oneOnOnePreferences: OneOnOnePreferences): void; + /** + * Get the Muted preferences. + * @returns {MutePreferences} + */ + getMutePreferences(): MutePreferences; + /** + * @param {MutePreferences} mutePreferences + * Set the Mute preferences. + */ + setMutePreferences(mutePreferences: MutePreferences): void; + /** + * Get the Group preferences. + * @returns {GroupPreferences} + */ + getGroupPreferences(): GroupPreferences; + /** + * @param {GroupPreferences} groupPreferences + * Set the Group preferences. + */ + setGroupPreferences(groupPreferences: GroupPreferences): void; + /** + * Returns whether to use privacy template or not. + * @returns {boolean} + */ + getUsePrivacyTemplate(): boolean; + /** + * @param {boolean} usePrivacyTemplate + * Set whether to use privacy template or not. + */ + setUsePrivacyTemplate(usePrivacyTemplate: boolean): void; + /** + * @param {Object} jsonData + * Convert JSON object to NotificationPreferences. + */ + static fromJSON(jsonData: Object): NotificationPreferences; + } export class UnmutedConversation { /** @@ -1082,7 +1187,13 @@ export namespace CometChat { * @memberof CometChat */ export function getActiveCall(): Call; - + + /** + * Function to clear any active call. + * @returns {void} + * @memberof CometChat + */ + export function clearActiveCall(): void /** * Function to start a call. * @param {CallSettings} callSettings @@ -4286,8 +4397,8 @@ export class ConversationsRequestBuilder { /** @private */ WithTags: boolean; /** @private */ groupTags: Array; /** @private */ userTags: Array; - /** @private */ includeBlockedUsers: boolean; - /** @private */ withBlockedInfo: boolean; + /** @private */ IncludeBlockedUsers: boolean; + /** @private */ WithBlockedInfo: boolean; /** * * @param {number} limit @@ -4335,16 +4446,34 @@ export class ConversationsRequestBuilder { public setUserTags(userTags: Array): this; /** * A method to include blocked users in the list of conversations. - * @param {boolean} userTags + * @param {boolean} _includeBlockedUsers + * @returns + * @deprecated This method is deprecated as of version 4.0.10 due to newer method 'includeBlockedUsers'. + * It will be removed in subsequent versions. + */ + public setIncludeBlockedUsers(_includeBlockedUsers: boolean): this; + + /** + * A method to include blocked users in the list of conversations. + * @param {boolean} _includeBlockedUsers + * @returns + */ + public includeBlockedUsers(_includeBlockedUsers: boolean): this; + + /** + * A method to include blocked users information in the list of conversations. + * @param {boolean} _withBlockedInfo * @returns + * @deprecated This method is deprecated as of version 4.0.10 due to newer method 'withBlockedInfo'. + * It will be removed in subsequent versions. */ - public setIncludeBlockedUsers(_includeBlockedUsers: any): this; + public setWithBlockedInfo(_withBlockedInfo: boolean): this; /** * A method to include blocked users information in the list of conversations. - * @param {boolean} userTags + * @param {boolean} _withBlockedInfo * @returns */ - public setWithBlockedInfo(_withBlockedInfo: any): this; + public withBlockedInfo(_withBlockedInfo: boolean): this; /** * This method will return an object of the ConversationsRequest class. * @returns {ConversationsRequest} diff --git a/CometChat.js b/CometChat.js index 1d677e0..d7c562a 100644 --- a/CometChat.js +++ b/CometChat.js @@ -1 +1 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react-native","react"],e);else{var n="object"==typeof exports?e(require("@react-native-async-storage/async-storage"),require("react-native"),require("react")):e(t["@react-native-async-storage/async-storage"],t["react-native"],t.react);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n,o,s){return function(n){var o={};function s(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}return s.m=n,s.c=o,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(n,o,function(t){return e[t]}.bind(null,o));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=52)}([function(t,W,r){"use strict";(function(K){W.__esModule=!0,W.validateQuestion=W.updatePropertiesWithDynamicValue=W.getCallSettings=W.isCallingComponentInstalled=W.getKeyprefix=W.validateConversationType=W.validateUpdateUser=W.validateCreateUser=W.validateMessage=W.validateChatType=W.validateMsgId=W.validateArray=W.validateHideMessagesFromBlockedUsers=W.validateId=W.validateCreateGroup=W.validateJoinGroup=W.validateUpdateGroup=W.validateScope=W.isAudio=W.isVideo=W.isImage=W.getUpdatedSettings=W.getAppSettings=W.getCurrentTime=W.Logger=W.createUidFromJid=W.format=W.getOrdinalSuffix=W.isFalsy=W.isTruthy=W.isObject=W.getJidHost=W.getChatHost=void 0;var o=r(15),B=r(1),t=r(5),F=r(2),i=r(20),a=r(22),E=r(24),b=r(6),e=r(10),x=r(39),V=r(53),J=r(16),c=r(26);function k(t){return null!=t&&("string"==typeof t&&(t=t.trim()),"object"==typeof t&&0===Object.keys(t).length&&(t=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(t)}function u(t){for(var o=[],e=1;ei[0]&&e[1] All store cleared successfully","true"),t(!0)})}catch(t){_.Logger.error("CometChat: clearCache",t),e(t)}})},T.connect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(pt.connection||(T.onConnectionSuccess=n,T.disconnectedByUser=!1,T.WSLogin(T.user)),T.didAnalyticsPingStart()||T.isAnalyticsDisabled||(T.pingAnalytics(),T.startAnalyticsPingTimer())):o&&o(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnect=function(t){var e=t||{},n=e.onSuccess,o=e.onError;T.user?(T.disconnectedByUser=!0,T.disconnectInternally({onError:o}),pt.clearWSResponseTimer(),T.onDisconnectSuccess=n):o&&o(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.disconnectInternally=function(t){var e=(t||{}).onError;T.user?(pt.connection&&pt.WSLogout(),T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.clearWSReconnectionTimer()):e&&e(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},T.prototype.internalRestart=function(t){T.internalRestart||T.getInstance().internalLogout(!1).then(function(){T.internalRestart=!0,T.login(t).then(function(t){T.shouldConnectToWS=!0,T.internalRestart=!1},function(t){_.Logger.error("CometChat: internalRestart :: login",t),T.internalRestart=!1})},function(t){_.Logger.error("CometChat: internalRestart :: internalLogout",t)})},T.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(t,e){try{T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.WSReconnectionInProgress&&T.clearWSReconnectionTimer(),T.isLoggedOut=!0,T.WSReconnectionInProgress=!1,T.isAnalyticsDisabled=!1,T.clearCache().then(function(){T.apiKey=void 0,T.user=void 0,T.authToken=void 0,T.cometChat=void 0,T.mode=void 0,pt.WSLogout(),n&&T.pushToLoginListener("","Logout_Success"),t(!0)})}catch(t){_.Logger.error("CometChat: internalLogout",t),e(t)}})},T.markAsInteracted=function(t,o,e){return new Promise(function(n,e){try{_.isFalsy(t)?e(new d.CometChatException(m.ERRORS.PARAMETER_MISSING)):h.makeApiCall("markInteracted",{messageId:t},{interactions:[o]}).then(function(t){var e;e=t&&t.data&&t.data.message?t.data.message:"Marked interacted",n(e)},function(t){e(new d.CometChatException(t.error))})}catch(t){e(new d.CometChatException(t))}})},T.getConversationUpdateSettings=function(){return E(this,void 0,void 0,function(){var e;return c(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,_.getAppSettings()];case 1:return e=t.sent(),[2,ct.ConversationUpdateSettings.fromJSON(e)];case 2:return t.sent(),[2,new ct.ConversationUpdateSettings];case 3:return[2]}})})},T.initialzed=!1,T.CometChatException=d.CometChatException,T.TextMessage=R.TextMessage,T.MediaMessage=p.MediaMessage,T.CustomMessage=w.CustomMessage,T.Action=i.Action,T.Call=s.Call,T.TypingIndicator=Y.TypingIndicator,T.TransientMessage=Q.TransientMessage,T.InteractiveMessage=tt.InteractiveMessage,T.InteractionGoal=et.InteractionGoal,T.Interaction=nt.Interaction,T.InteractionReceipt=ot.InteractionReceipt,T.Group=a.Group,T.User=l.User,T.GroupMember=K.GroupMember,T.Conversation=x.Conversation,T.ReactionCount=it.ReactionCount,T.ReactionEvent=at.ReactionEvent,T.Reaction=Et.Reaction,T.USER_STATUS={ONLINE:f.PresenceConstatnts.STATUS.ONLINE,OFFLINE:f.PresenceConstatnts.STATUS.OFFLINE},T.MessagesRequest=U.MessagesRequest,T.MessagesRequestBuilder=U.MessagesRequestBuilder,T.ReactionsRequest=rt.ReactionsRequest,T.ReactionsRequestBuilder=rt.ReactionsRequestBuilder,T.UsersRequest=v.UsersRequest,T.UsersRequestBuilder=v.UsersRequestBuilder,T.ConversationsRequest=L.ConversationsRequest,T.ConversationsRequestBuilder=L.ConversationsRequestBuilder,T.BlockedUsersRequest=B.BlockedUsersRequest,T.BlockedUsersRequestBuilder=B.BlockedUsersRequestBuilder,T.GroupsRequest=y.GroupsRequest,T.GroupsRequestBuilder=y.GroupsRequestBuilder,T.GroupMembersRequest=P.GroupMembersRequest,T.GroupMembersRequestBuilder=P.GroupMembersRequestBuilder,T.BannedMembersRequest=M.BannedMembersRequest,T.BannedMembersRequestBuilder=M.BannedMembersRequestBuilder,T.CallSettings=k.CallSettings,T.CallSettingsBuilder=k.CallSettingsBuilder,T.MainVideoContainerSetting=k.MainVideoContainerSetting,T.AppSettings=F.AppSettings,T.AppSettingsBuilder=F.AppSettingsBuilder,T.CallingComponent=H.CallingComponent,T.MessageListener=o.MessageListener,T.UserListener=o.UserListener,T.GroupListener=o.GroupListener,T.OngoingCallListener=o.OngoingCallListener,T.CallListener=o.CallListener,T.ConnectionListener=o.ConnectionListener,T.LoginListener=o.LoginListener,T.CallController=N.CallController,T.CometChatHelper=b.CometChatHelper,T.Attachment=J.Attachment,T.ConversationUpdateSettings=ct.ConversationUpdateSettings,T.GoalType=f.GoalType,T.MESSAGE_TYPE=f.MessageConstatnts.TYPE,T.CATEGORY_MESSAGE=f.MessageConstatnts.CATEGORY.MESSAGE,T.CATEGORY_ACTION=f.MessageConstatnts.CATEGORY.ACTION,T.CATEGORY_CALL=f.MessageConstatnts.CATEGORY.CALL,T.CATEGORY_CUSTOM=f.MessageConstatnts.CATEGORY.CUSTOM,T.ACTION_TYPE=f.ActionConstatnts.ACTIONS,T.CALL_TYPE=f.CallConstants.CALL_TYPE,T.CATEGORY_INTERACTIVE=f.MessageConstatnts.CATEGORY.INTERACTIVE,T.REACTION_ACTION=f.REACTION_ACTION,T.RECEIVER_TYPE=f.MessageConstatnts.RECEIVER_TYPE,T.CALL_STATUS=f.CallConstants.CALL_STATUS,T.GROUP_MEMBER_SCOPE=f.GROUP_MEMBER_SCOPE,T.GROUP_TYPE=f.GROUP_TYPE,T.MESSAGE_REQUEST=f.MessageConstatnts.PAGINATION.CURSOR_FILEDS,T.CONNECTION_STATUS=f.CONNECTION_STATUS,T.CALL_MODE=f.CallConstants.CALL_MODE,T.AUDIO_MODE=f.CallConstants.AUDIO_MODE,T.SORT_BY=f.UserConstants.SORT_BY,T.SORT_ORDER=f.UserConstants.SORT_ORDER,T.WSReconnectionInProgress=!1,T.WSReconnectionTimerInterval=5e3,T.currentConnectionStatus=f.CONNECTION_STATUS.DISCONNECTED,T.isConnectingFromInit=!1,T.loginInProgress=!1,T.internalRestart=!1,T.settingsInterval=6e4,T.isAnalyticsPingStarted=!1,T.isLoggedOut=!0,T.isAnalyticsDisabled=!1,T.disconnectedByUser=!1,T.shouldConnectToWS=!0,T.isAppInactive=!1,T.onConnectionSuccess=null,T.onDisconnectSuccess=null,T.onConnectionError=null,T.callWaitTimer=null,T.callWaitTime=30,T}();e.CometChat=Ct},function(t,e,n){"use strict";e.__esModule=!0,e.BaseMessage=void 0;var o=n(1),s=n(21),r=n(0),i=function(){function t(t,e,n,o){this.reactions=[],this.mentionedUsers=[],this.mentionedMe=!1,this.receiverId=t,this.type=e,this.receiverType=n,this.category=o}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.getUnreadRepliesCount=function(){return this.unreadRepliesCount},t.prototype.setUnreadRepliesCount=function(t){this.unreadRepliesCount=t},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.setConversationId=function(t){this.conversationId=t},t.prototype.getParentMessageId=function(){return this.parentMessageId},t.prototype.setParentMessageId=function(t){this.parentMessageId=t},t.prototype.getMuid=function(){return this.muid},t.prototype.setMuid=function(t){this.muid=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(t){this.receiverId=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getSentAt=function(){return this.sentAt},t.prototype.setSentAt=function(t){this.sentAt=t},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(t){this.status=t},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.setDeliveredAt=function(t){this.deliveredAt=t},t.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},t.prototype.setDeliveredToMeAt=function(t){this.deliveredToMeAt=t},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setReadAt=function(t){this.readAt=t},t.prototype.getReadByMeAt=function(){return this.readByMeAt},t.prototype.setReadByMeAt=function(t){this.readByMeAt=t},t.prototype.getCategory=function(){return this.category},t.prototype.setCategory=function(t){this.category=t},t.prototype.getEditedAt=function(){return this.editedAt},t.prototype.setEditedAt=function(t){this.editedAt=t},t.prototype.getEditedBy=function(){return this.editedBy},t.prototype.setEditedBy=function(t){this.editedBy=t},t.prototype.getDeletedAt=function(){return this.deletedAt},t.prototype.setDeletedAt=function(t){this.deletedAt=t},t.prototype.getDeletedBy=function(){return this.deletedBy},t.prototype.setDeletedBy=function(t){this.deletedBy=t},t.prototype.getReplyCount=function(){return this.replyCount},t.prototype.setReplyCount=function(t){this.replyCount=t},t.prototype.getRawMessage=function(){return this.rawMessage},t.prototype.setRawMessage=function(t){this.rawMessage=t},t.prototype.setMentionedUsers=function(t){this.mentionedUsers=t},t.prototype.getMentionedUsers=function(){return this.mentionedUsers},t.prototype.setHasMentionedMe=function(t){this.mentionedMe=t},t.prototype.hasMentionedMe=function(){return this.mentionedMe},t.prototype.getData=function(){return this.data},t.prototype.setData=function(t){this.data=t},t.prototype.setReactions=function(t){try{this.setReactionsToData(t)}catch(t){return this.reactions}},t.prototype.getReactions=function(){try{return this.getReactionsFromData()}catch(t){return this.reactions}},t.prototype.setReactionsToData=function(t){var e=this.getData();if(e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]){var n=t.map(function(t){return new s.ReactionCount(t.reaction,t.count,!!t.reactedByMe&&t.reactedByMe)});e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=n,this.setData(e),this.reactions=n}else e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=t,this.setData(e),this.reactions=t},t.prototype.getReactionsFromData=function(){try{var t=this.getData(),n=[];if(t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS])t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS].forEach(function(t){var e=new s.ReactionCount(t.reaction,t.count,!!t.reactedByMe&&t.reactedByMe);n.push(e)});return n}catch(t){throw r.Logger.error("BaseMessageModel: getReactionsFromData",t),t}},t}();e.BaseMessage=i},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatEvent=void 0;var i=n(0),o=n(4),s=function(){function t(t,e,n,o,s,r){i.isFalsy(t)||(this.appId=t),i.isFalsy(e)||(this.receiver=e),i.isFalsy(n)||(this.receiverType=n),i.isFalsy(s)||(this.deviceId=s),i.isFalsy(o)||(this.sender=o),i.isFalsy(r)||(this.messageSender=r)}return t.prototype.getAppId=function(){return this.appId},t.prototype.setAppId=function(t){this.appId=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.setDeviceId=function(t){this.deviceId=t},t.prototype.getMessageSender=function(){return this.messageSender},t.prototype.setMessageSender=function(t){this.messageSender=t},t.prototype.getCometChatEventJSON=function(){var t={};return t[o.KEYS.APP_ID]=this.getAppId(),t[o.KEYS.RECEIVER]=this.getReceiver(),t[o.KEYS.RECEIVER_TYPE]=this.getReceiverType(),t[o.KEYS.DEVICE_ID]=this.getDeviceId(),t[o.KEYS.TYPE]=this.getType(),t[o.KEYS.SENDER]=this.getSender(),i.isFalsy(this.getMessageSender())||(t[o.KEYS.MESSAGE_SENDER]=this.getMessageSender()),t},t}();e.CometChatEvent=s},function(t,e,n){"use strict";e.__esModule=!0,e.Group=void 0;var o=n(1),s=function(){function t(t,e,n,o,s,r,i){this.hasJoined=!1,this.membersCount=0,this.isBanned=!1,this.guid=t,e&&(this.name=e),n&&(this.type=n),!o&&""!==o||"password"!=n||(this.password=o),(s||""===s)&&(this.icon=s),(r||""===r)&&(this.description=r),i&&(this.hasJoined=i)}return t.prototype.getGuid=function(){return this.guid},t.prototype.setGuid=function(t){this.guid=t},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){t&&(this.name=t)},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getPassword=function(){return this.password},t.prototype.setPassword=function(t){this.password=t},t.prototype.getIcon=function(){return this.icon},t.prototype.setIcon=function(t){this.icon=t},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(t){this.description=t},t.prototype.getOwner=function(){return this.owner},t.prototype.setOwner=function(t){this.owner=t},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.getCreatedAt=function(){return this.createdAt},t.prototype.setCreatedAt=function(t){this.createdAt=t},t.prototype.getUpdatedAt=function(){return this.updatedAt},t.prototype.setUpdatedAt=function(t){this.updatedAt=t},t.prototype.getHasJoined=function(){return this.hasJoined},t.prototype.setHasJoined=function(t){this.hasJoined=t},t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.setWsChannel=function(t){this.wsChannel=t},t.prototype.setScope=function(t){this.scope=t},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(t){this.joinedAt=t},t.prototype.getMembersCount=function(){return this.membersCount},t.prototype.setMembersCount=function(t){this.membersCount=t},t.prototype.setTags=function(t){this.tags=t},t.prototype.getTags=function(){return this.tags},t.prototype.isBannedFromGroup=function(){return this.isBanned},t.TYPE=o.GroupType,t.Type=t.TYPE,t}();e.Group=s},function(t,e,n){"use strict";e.__esModule=!0,e.FETCH_ERROR=e.TYPINGNOTIFICATION_CONSTANTS=e.LOGIN_ERROR=e.MESSAGE_ERRORS=e.MESSAGES_REQUEST_ERRORS=e.USERS_REQUEST_ERRORS=e.GROUP_CREATION_ERRORS=e.INIT_ERROR=e.ERRORS=e.SERVER_ERRORS=void 0,e.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},e.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},e.INIT_ERROR={NO_APP_ID:{code:e.ERRORS.PARAMETER_MISSING.code,name:e.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},e.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},e.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},e.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},e.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},e.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},e.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},e.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(t,e,n){"use strict";e.__esModule=!0,e.MessageController=void 0;var T=n(7),_=n(20),d=n(22),h=n(0),g=n(1),R=n(28),A=n(29),I=n(30),r=n(2),f=n(23),O=n(24),N=n(6),i=n(12),a=n(3),m=n(26),o=function(){function l(){}return l.trasformJSONMessge=function(n){var t,e,o,s,r;try{var i=null,a=void 0;switch(n[g.MessageConstatnts.KEYS.CATEGORY]){case g.MessageConstatnts.CATEGORY.ACTION:a=R.Action.actionFromJSON(n);break;case g.MessageConstatnts.CATEGORY.CALL:a=A.Call.callFromJSON(n);break;case g.MessageConstatnts.CATEGORY.MESSAGE:switch(n[g.MessageConstatnts.KEYS.TYPE]){case g.MessageConstatnts.TYPE.TEXT:a=new _.TextMessage(n[g.MessageConstatnts.KEYS.RECEIVER],n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.TEXT],n[g.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case g.MessageConstatnts.TYPE.CUSTOM:a=new O.CustomMessage(n[g.MessageConstatnts.KEYS.RECEIVER],n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.CUSTOM_DATA],n[g.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if(a=new d.MediaMessage(n[g.MessageConstatnts.KEYS.RECEIVER],n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.URL],n[g.MessageConstatnts.KEYS.TYPE],n[g.MessageConstatnts.KEYS.RECEIVER_TYPE]),n.hasOwnProperty(g.MessageConstatnts.KEYS.DATA)){var E=n[g.MessageConstatnts.KEYS.DATA];if(E.hasOwnProperty(g.MessageConstatnts.KEYS.ATTATCHMENTS)){var c,u=E[g.MessageConstatnts.KEYS.ATTATCHMENTS];new Array;u.map(function(t){c=new f.Attachment(t)}),a.setAttachment(c)}E.hasOwnProperty(g.MessageConstatnts.KEYS.TEXT)&&a.setCaption(E[g.MessageConstatnts.KEYS.TEXT])}a.hasOwnProperty("file")&&delete a.file}break;case g.MessageConstatnts.CATEGORY.CUSTOM:a=new O.CustomMessage(n[g.MessageConstatnts.KEYS.RECEIVER],n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.CUSTOM_DATA],n[g.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type);break;case g.MessageConstatnts.CATEGORY.INTERACTIVE:a=new m.InteractiveMessage(n[g.MessageConstatnts.KEYS.RECEIVER],n[g.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type,n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.INTERACTIVE_DATA],n[g.MessageConstatnts.KEYS.DATA][g.MessageConstatnts.KEYS.INTERACTION_GOAL])}if((n[g.MessageConstatnts.KEYS.CATEGORY]===g.MessageConstatnts.CATEGORY.MESSAGE||n[g.MessageConstatnts.KEYS.CATEGORY]===g.MessageConstatnts.CATEGORY.CUSTOM)&&n[g.MessageConstatnts.KEYS.TYPE]!==g.MessageConstatnts.TYPE.TEXT&&(null==n?void 0:n[g.MessageConstatnts.KEYS.DATA])&&(null===(t=null==n?void 0:n[g.MessageConstatnts.KEYS.DATA])||void 0===t?void 0:t[g.MessageConstatnts.KEYS.ATTATCHMENTS])&&0!==(null===(o=null===(e=null==n?void 0:n[g.MessageConstatnts.KEYS.DATA])||void 0===e?void 0:e[g.MessageConstatnts.KEYS.ATTATCHMENTS])||void 0===o?void 0:o.length)&&(null===(s=N.CometChat.user)||void 0===s?void 0:s.getFat())&&N.CometChat.SECURED_MEDIA_HOST){var p=N.CometChat.SECURED_MEDIA_HOST,S=null===(r=N.CometChat.user)||void 0===r?void 0:r.getFat(),C=h.updatePropertiesWithDynamicValue(n,p,"?"+g.ADDITIONAL_CONSTANTS.SECURE_URL_PROPERTY+"="+S);C&&(n=C)}n[g.MessageConstatnts.KEYS.MY_RECEIPTS]&&(n[g.MessageConstatnts.KEYS.MY_RECEIPTS]=n[g.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(n[g.MessageConstatnts.KEYS.MY_RECEIPTS]).map(function(t){var e=new I.MessageReceipt;t==g.DELIVERY_RECEIPTS.DELIVERED_AT&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.DELIVERY_RECEIPTS.DELIVERED_AT]),h.isFalsy(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.DELIVERY_RECEIPTS.RECIPIENT])?n[g.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.DELIVERY_RECEIPTS.DELIVERED_AT]:e.setSender(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.DELIVERY_RECEIPTS.RECIPIENT]),e.setReceiverType(n[g.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[g.MessageConstatnts.KEYS.RECEIVER])),n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.READ_RECEIPTS.READ_AT]),h.isFalsy(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.READ_RECEIPTS.RECIPIENT])?n[g.READ_RECEIPTS.READ_BY_ME_AT]=n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.READ_RECEIPTS.READ_AT]:e.setSender(n[g.MessageConstatnts.KEYS.MY_RECEIPTS][g.READ_RECEIPTS.RECIPIENT]),e.setReceiverType(n[g.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[g.MessageConstatnts.KEYS.RECEIVER]))}));try{if(Object.assign(a,n),(n=a).parentId&&(n.parentMessageId=n.parentId,delete n.parentId),n instanceof T.BaseMessage&&(h.isFalsy(i)||n.setRawMessage(i)),n instanceof _.TextMessage)l.extractDetailsFromMentions(n),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.getData()[g.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[g.MessageConstatnts.KEYS.METADATA]);else if(n instanceof d.MediaMessage)l.extractDetailsFromMentions(n),n.getData()[g.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[g.MessageConstatnts.KEYS.METADATA]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver());else if(n instanceof R.Action)n.setSender(n.getSender()),n.setReceiver(n.getActionFor()),n.setActionBy(n.getActionBy()),n.setActionOn(n.getActionOn()),n.setActionFor(n.getActionFor()),n.setMessage(n.getMessage());else if(n instanceof A.Call){try{n.setSender(n.getSender())}catch(t){h.Logger.error("MessageController: trasformJSONMessge: setSender",t)}try{n.setCallInitiator(n.getCallInitiator())}catch(t){h.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",t)}try{n.setReceiver(n.getCallReceiver()),n.setCallReceiver(n.getCallReceiver())}catch(t){h.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",t)}}else n instanceof O.CustomMessage?(n.getData()[g.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[g.MessageConstatnts.KEYS.METADATA]),n.setCustomData(n.getData()[g.MessageConstatnts.KEYS.CUSTOM_DATA]),n.setSubType(n.getData()[g.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver())):n instanceof m.InteractiveMessage&&(n.setMetadata(n.getData()[g.MessageConstatnts.KEYS.METADATA]),n.setInteractiveData(n.getData()[g.MessageConstatnts.KEYS.INTERACTIVE_DATA]),n.setInteractionGoal(n.getInteractionGoal()),n.setInteractions(n.getInteractions()),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.setIsSenderInteractionAllowed(n.getData()[g.MessageConstatnts.KEYS.ALLOW_SENDER_INTERACTION]));n.hasOwnProperty("rawMessage")||(i=JSON.parse(JSON.stringify(n))),n instanceof T.BaseMessage&&(h.isFalsy(i)||n.setRawMessage(i))}catch(t){h.Logger.error("MessageController: trasformJSONMessge: Main",t),n=null}return n}catch(t){h.Logger.error("MessageController: trasformJSONMessge",t)}},l.extractDetailsFromMentions=function(t){if(t.getData()[g.MessageConstatnts.KEYS.MENTIONS]){var e=[],n=!1,o=N.CometChat.user,s=t.getData()[g.MessageConstatnts.KEYS.MENTIONS];for(var r in s)r.toString()==(null==o?void 0:o.getUid())&&(n=!0),e.push(new a.User(s[r]));t.setMentionedUsers(e),t.setHasMentionedMe(n)}},l.getReceiptsFromJSON=function(s){return new Promise(function(t,e){try{var o=[];N.CometChat.getLoggedInUser().then(function(n){h.isFalsy(s.receipts)?t([]):(s.receipts.data.map(function(t){var e=new I.MessageReceipt;t[g.DELIVERY_RECEIPTS.DELIVERED_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(t[g.DELIVERY_RECEIPTS.DELIVERED_AT]),e.setTimestamp(t[g.DELIVERY_RECEIPTS.DELIVERED_AT]),h.isFalsy(t[g.DELIVERY_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(i.UsersController.trasformJSONUser(t[g.DELIVERY_RECEIPTS.RECIPIENT])),e.setReceiverType(s[g.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(s[g.MessageConstatnts.KEYS.RECEIVER])),t[g.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(t[g.READ_RECEIPTS.READ_AT]),e.setTimestamp(t[t[g.READ_RECEIPTS.READ_AT]]),h.isFalsy(t[g.READ_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(i.UsersController.trasformJSONUser(t[g.READ_RECEIPTS.RECIPIENT])),e.setReceiverType(s[g.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(s[g.MessageConstatnts.KEYS.RECEIVER])),o.push(e)}),t(o))})}catch(t){e(new r.CometChatException(t))}})},l}();e.MessageController=o},function(t,e,n){"use strict";e.__esModule=!0,e.UsersController=void 0;var o=n(3),s=n(0),r=function(){function t(){}return t.trasformJSONUser=function(t){var e;try{t.uid=t.uid.toString(),t.name=t.name.toString(),t.status&&"offline"!==t.status?t.status="online":t.status="offline",e=new o.User(t),Object.assign(e,t),t=e}catch(t){s.Logger.error("UsersController:transformJSONUser",t)}return t},t}();e.UsersController=r},function(t,e){t.exports=n},function(t,e,n){"use strict";var o,s,r,i,a,E,c,u;e.__esModule=!0,e.DEFAULT_PROVIDER_ID=e.ResponseConstants=e.APIConstants=e.PushPlatforms=e.MutedConversationType=e.DayOfWeek=e.DNDOptions=e.MemberActionsOptions=e.ReactionsOptions=e.RepliesOptions=e.MessagesOptions=void 0,(o=e.MessagesOptions||(e.MessagesOptions={}))[o.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",o[o.SUBSCRIBE_TO_ALL=2]="SUBSCRIBE_TO_ALL",o[o.SUBSCRIBE_TO_MENTIONS=3]="SUBSCRIBE_TO_MENTIONS",(s=e.RepliesOptions||(e.RepliesOptions={}))[s.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",s[s.SUBSCRIBE_TO_ALL=2]="SUBSCRIBE_TO_ALL",s[s.SUBSCRIBE_TO_MENTIONS=3]="SUBSCRIBE_TO_MENTIONS",(r=e.ReactionsOptions||(e.ReactionsOptions={}))[r.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",r[r.SUBSCRIBE_TO_REACTIONS_ON_OWN_MESSAGES=2]="SUBSCRIBE_TO_REACTIONS_ON_OWN_MESSAGES",r[r.SUBSCRIBE_TO_REACTIONS_ON_ALL_MESSAGES=3]="SUBSCRIBE_TO_REACTIONS_ON_ALL_MESSAGES",(i=e.MemberActionsOptions||(e.MemberActionsOptions={}))[i.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",i[i.SUBSCRIBE=2]="SUBSCRIBE",(a=e.DNDOptions||(e.DNDOptions={}))[a.DISABLED=1]="DISABLED",a[a.ENABLED=2]="ENABLED",(E=e.DayOfWeek||(e.DayOfWeek={})).MONDAY="monday",E.TUESDAY="tuesday",E.WEDNESDAY="wednesday",E.THURSDAY="thursday",E.FRIDAY="friday",E.SATURDAY="saturday",E.SUNDAY="sunday",(c=e.MutedConversationType||(e.MutedConversationType={})).ONE_ON_ONE="oneOnOne",c.GROUP="group",(u=e.PushPlatforms||(e.PushPlatforms={})).FCM_REACT_NATIVE_ANDROID="fcm_react_native_android",u.FCM_REACT_NATIVE_IOS="fcm_react_native_ios",u.APNS_REACT_NATIVE_DEVICE="apns_react_native_device",u.APNS_REACT_NATIVE_VOIP="apns_react_native_voip",e.APIConstants={KEY_GROUP_PREFERENCES:"groupPreferences",KEY_GROUP_MESSAGES:"groupMessages",KEY_GROUP_REACTIONS:"groupReactions",KEY_GROUP_REPLIES:"groupReplies",KEY_GROUP_MEMBER_ADDED:"groupMemberAdded",KEY_GROUP_MEMBER_LEFT:"groupMemberLeft",KEY_GROUP_MEMBER_JOINED:"groupMemberJoined",KEY_GROUP_MEMBER_KICKED:"groupMemberKicked",KEY_GROUP_MEMBER_BANNED:"groupMemberBanned",KEY_GROUP_MEMBER_UNBANNED:"groupMemberUnbanned",KEY_GROUP_MEMBER_SCOPE_CHANGED:"groupMemberScopeChanged",KEY_MUTE_PREFERENCES:"mutePreferences",KEY_MUTE_DND:"dnd",KEY_MUTE_SCHEDULE:"schedule",KEY_ONE_ON_ONE_PREFERENCES:"oneOnOnePreferences",KEY_ONE_ON_ONE_MESSAGES:"oneOnOneMessages",KEY_ONE_ON_ONE_REACTIONS:"oneOnOneReactions",KEY_ONE_ON_ONE_REPLIES:"oneOnOneReplies",KEY_USE_PRIVACY_TEMPLATE:"usePrivacyTemplate",KEY_PROVIDER_ID:"providerId",KEY_TIMEZONE:"timezone",KEY_PLATFORM:"platform",KEY_FCM_TOKEN:"fcmToken",KEY_DEVICE_TOKEN:"deviceToken",KEY_VOIP_TOKEN:"voipToken",KEY_CONVERSATIONS:"conversations",KEY_GET_PREFERENCES:"getPushPreferences",KEY_UPDATE_PREFERENCES:"updatePushPreferences",KEY_RESET_PREFERENCES:"resetPushPreferences",KEY_REGISTER_TOKEN:"registerToken",KEY_UNREGISTER_TOKEN:"unregisterToken",KEY_MUTE_CONVERSATIONS:"muteConversations",KEY_UNMUTE_CONVERSATIONS:"unmuteConversations",KEY_GET_MUTED_CONVERSATIONS:"getMutedConversations",KEY_MUTED_CONVERSATIONS:"mutedConversations",KEY_FROM:"from",KEY_TO:"to"},e.ResponseConstants={TOKEN_REGISTER_SUCCESS:"Push token registered successfully.",TOKEN_REGISTER_ERROR:"Failed to register push token.",TOKEN_UNREGISTER_SUCCESS:"Push token unregistered successfully.",TOKEN_UNREGISTER_ERROR:"Failed to unregister push token.",MUTE_CONVERSATION_SUCCESS:"Conversations muted successfully.",MUTE_CONVERSATION_ERROR:"Failed to mute conversations.",UNMUTE_CONVERSATION_SUCCESS:"Conversations unmuted successfully.",UNMUTE_CONVERSATION_ERROR:"Failed to unmute conversations."},e.DEFAULT_PROVIDER_ID="default"},function(t,e,n){"use strict";e.__esModule=!0,e.LocalStorage=void 0;var r=n(0),i=n(1),a=n(2),o=n(13),s=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.localStore=o.default}catch(t){r.Logger.error("store: constructor",{e:t})}}return t.getInstance=function(){return null==t.localStorage&&(t.localStorage=new t),t.localStorage},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return this.localStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return new Promise(function(n,e){try{o.localStore.getItem(s).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clearStore=function(){var s=this;return new Promise(function(n,e){try{var o=[r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_USER),r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_APP_SETTINGS)];s.localStore.getAllKeys().then(function(t){if(0"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},addReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"POST"},removeReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"DELETE"},getFilteredReactionsList:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"GET",data:{}},getReactionsList:{endpoint:"messages/{{messageId}}/reactions",method:"GET",data:{}},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},markAsReadForUser:{endpoint:"users/{{uid}}/conversation/read",method:"POST"},markAsReadForGroup:{endpoint:"groups/{{guid}}/conversation/read",method:"POST"},markAsDeliveredForUser:{endpoint:"users/{{uid}}/conversation/delivered",method:"POST"},markAsDeliveredForGroup:{endpoint:"groups/{{guid}}/conversation/delivered",method:"POST"},markUserMessagesAsUnread:{endpoint:"users/{{uid}}/conversation/read",method:"DELETE"},markGroupMessagesAsUnread:{endpoint:"groups/{{guid}}/conversation/read",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"},getUserConversationStarter:{endpoint:"ai/conversation-starter/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationStarter:{endpoint:"ai/conversation-starter/groups/{{guid}}",method:"GET",isAIApi:!0},getUserSmartReply:{endpoint:"ai/smart-replies/users/{{uid}}",method:"GET",isAIApi:!0},getGroupSmartReply:{endpoint:"ai/smart-replies/groups/{{guid}}",method:"GET",isAIApi:!0},markInteracted:{endpoint:"messages/{{messageId}}/interacted",method:"PATCH"},getUserConversationSummary:{endpoint:"ai/conversation-summary/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationSummary:{endpoint:"ai/conversation-summary/groups/{{guid}}",method:"GET",isAIApi:!0},getBotAssistanceInUserConversation:{endpoint:"ai/bots/{{botId}}/assistance/users/{{uid}}",method:"GET",isAIApi:!0},getBotAssistanceInGroupConversation:{endpoint:"ai/bots/{{botId}}/assistance/groups/{{guid}}",method:"GET",isAIApi:!0},getPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"GET"},updatePushPreferences:{endpoint:"notifications/push/v1/preferences",method:"PATCH"},resetPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"DELETE"},registerToken:{endpoint:"notifications/push/v1/tokens",method:"POST"},unregisterToken:{endpoint:"notifications/push/v1/tokens",method:"DELETE"},muteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"PUT"},unmuteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"DELETE"},getMutedConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"GET"}}}return a.prototype.getEndpointData=function(i){return new Promise(function(o,e){try{var s=p.CometChat.appSettings.getAdminHost(),r=p.CometChat.appSettings.getClientHost();u.LocalStorage.getInstance().get(c.LOCAL_STORE.KEY_APP_SETTINGS).then(function(t){if(E.isFalsy(t)){var e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi"))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+s+"/"+e.endpoint;e.endpoint=n,o(e)}else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+r+"/"+e.endpoint;e.endpoint=n,o(e)}}else{e={};if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi")){n="https://"+t[c.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}else{n="https://"+t[c.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+t[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+e.endpoint;e.endpoint=n,o(e)}}},function(t){var e;if((new a).uriEndpoints.hasOwnProperty(i))if((e=(new a).uriEndpoints[i]).hasOwnProperty(["isAdminApi"]))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+s+"/"+e.endpoint,o(e);else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+e.endpoint;e.endpoint=n,o(e)}else e.endpoint="https://"+r+"/"+e.endpoint,o(e)})}catch(t){e(new S.CometChatException(t))}})},a}();e.EndpointFactory=o},function(t,e,n){"use strict";e.__esModule=!0,e.getEndPoint=void 0;var o=n(37),i=n(2);e.getEndPoint=function(t,r){void 0===t&&(t=""),void 0===r&&(r={});var e=new o.EndpointFactory;return new Promise(function(o,s){try{e.getEndpointData(t).then(function(t){var e=t;if(e){for(var n in r)e.endpoint=e.endpoint.replace("{{"+n+"}}",r[n]);o(e)}else s({error:"Unknown endPoint name."})})}catch(t){s(new i.CometChatException(t))}})}},function(t,e,n){"use strict";e.__esModule=!0,e.MainVideoContainerSetting=e.CallSettingsBuilder=e.CallSettings=void 0;var o=n(1),s=n(0),r=function(){function t(t){this.sessionID=t.sessionID,this.defaultLayout=t.defaultLayout,this.isAudioOnly=t.isAudioOnly,this.region=t.region,this.domain=t.domain,this.user=t.user,this.listener=t.listener,this.mode=t.mode,this.ShowEndCallButton=t.ShowEndCallButton,this.ShowSwitchCameraButton=t.ShowSwitchCameraButton,this.ShowMuteAudioButton=t.ShowMuteAudioButton,this.ShowPauseVideoButton=t.ShowPauseVideoButton,this.ShowAudioModeButton=t.ShowAudioModeButton,this.StartAudioMuted=t.StartAudioMuted,this.StartVideoMuted=t.StartVideoMuted,this.analyticsSettings=t.analyticsSettings,this.appId=t.appId,this.defaultAudioMode=t.defaultAudioMode,this.ShowSwitchToVideoCallButton=t.ShowSwitchToVideoCallButton,this.AvatarMode=t.AvatarMode,this.ShowRecordingButton=t.ShowRecordingButton,this.StartRecordingOnCallStart=t.StartRecordingOnCallStart,this.MainVideoContainerSetting=t.MainVideoContainerSetting,this.EnableVideoTileClick=t.EnableVideoTileClick,this.enableDraggableVideoTile=t.enableDraggableVideoTile}return t.prototype.getSessionId=function(){return this.sessionID},t.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},t.prototype.getUser=function(){return this.user},t.prototype.getRegion=function(){return this.region},t.prototype.getAppId=function(){return this.appId},t.prototype.getDomain=function(){return this.domain},t.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},t.prototype.getCallEventListener=function(){return this.listener},t.prototype.getMode=function(){return this.mode},t.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},t.prototype.isSwitchCameraButtonEnabled=function(){return this.ShowSwitchCameraButton},t.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},t.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},t.prototype.isAudioModeButtonEnabled=function(){return this.ShowAudioModeButton},t.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},t.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},t.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},t.prototype.getDefaultAudioMode=function(){return this.defaultAudioMode},t.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},t.prototype.getAvatarMode=function(){return this.AvatarMode},t.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},t.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},t.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},t.prototype.isVideoTileClickEnabled=function(){return this.EnableVideoTileClick},t.prototype.isVideoTileDragEnabled=function(){return this.enableDraggableVideoTile},t.POSITION_TOP_LEFT="top-left",t.POSITION_TOP_RIGHT="top-right",t.POSITION_BOTTOM_LEFT="bottom-left",t.POSITION_BOTTOM_RIGHT="bottom-right",t.ASPECT_RATIO_DEFAULT="default",t.ASPECT_RATIO_CONTAIN="contain",t.ASPECT_RATIO_COVER="cover",t}();e.CallSettings=r;var i=function(){function t(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=o.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowSwitchCameraButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowAudioModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.analyticsSettings={},this.ShowSwitchToVideoCallButton=!0,this.AvatarMode="circle",this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.MainVideoContainerSetting=new a,this.EnableVideoTileClick=!0,this.enableDraggableVideoTile=!0}return t.prototype.setSessionID=function(t){return this.sessionID=t,this},t.prototype.enableDefaultLayout=function(t){return this.defaultLayout=t,this},t.prototype.setIsAudioOnlyCall=function(t){return this.isAudioOnly=t,this},t.prototype.setRegion=function(t){return this.region=t,this},t.prototype.setDomain=function(t){return this.domain=t,this},t.prototype.setUser=function(t){return this.user=t,this},t.prototype.setCallEventListener=function(t){return this.listener=t,this},t.prototype.setMode=function(t){return this.mode=t,this},t.prototype.showEndCallButton=function(t){return this.ShowEndCallButton=t,this},t.prototype.showSwitchCameraButton=function(t){return this.ShowSwitchCameraButton=t,this},t.prototype.showMuteAudioButton=function(t){return this.ShowMuteAudioButton=t,this},t.prototype.showPauseVideoButton=function(t){return this.ShowPauseVideoButton=t,this},t.prototype.showAudioModeButton=function(t){return this.ShowAudioModeButton=t,this},t.prototype.startWithAudioMuted=function(t){return this.StartAudioMuted=t,this},t.prototype.startWithVideoMuted=function(t){return this.StartVideoMuted=t,this},t.prototype.setAnalyticsSettings=function(t){return this.analyticsSettings=t,this},t.prototype.setAppId=function(t){return this.appId=t,this},t.prototype.setDefaultAudioMode=function(t){return this.defaultAudioMode=t,this},t.prototype.showSwitchToVideoCallButton=function(t){return this.ShowSwitchToVideoCallButton=t,this},t.prototype.setAvatarMode=function(t){return this.AvatarMode=t,this},t.prototype.showRecordingButton=function(t){return this.ShowRecordingButton=t,this},t.prototype.startRecordingOnCallStart=function(t){return this.StartRecordingOnCallStart=t,this},t.prototype.setMainVideoContainerSetting=function(t){return this.MainVideoContainerSetting=t,this},t.prototype.enableVideoTileClick=function(t){return this.EnableVideoTileClick=t,this},t.prototype.enableVideoTileDrag=function(t){return this.enableDraggableVideoTile=t,this},t.prototype.build=function(){return new r(this)},t}();e.CallSettingsBuilder=i;var a=function(){function t(){this.videoFit=r.ASPECT_RATIO_CONTAIN,this.zoomButton=o.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.fullScreenButton=o.CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS,this.userListButton=o.CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS,this.nameLabel=o.CallConstants.NAME_LABEL_DEFAULT_PARAMS}return t.prototype.setMainVideoAspectRatio=function(t){this.videoFit=t},t.prototype.setFullScreenButtonParams=function(t,e){s.isFalsy(t)||(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setNameLabelParams=function(t,e,n){s.isFalsy(t)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e),s.isFalsy(n)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=n)},t.prototype.setZoomButtonParams=function(t,e){s.isFalsy(t)||(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t.prototype.setUserListButtonParams=function(t,e){s.isFalsy(t)||(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=t),null!=e&&null!=e&&(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=e)},t}();e.MainVideoContainerSetting=a},function(t,e,n){"use strict";var o,s=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});e.__esModule=!0,e.CallingComponent=void 0;var i,a,E,c,u,p=n(54),S=n(17),C=n(6),l=n(3),T=n(1),_=n(16),d=n(55),h=n(0),g=n(5),r=function(e){function r(t){var r=e.call(this,t)||this;return r.state={shouldLoad:!1},a=t.callsettings,h.getCallSettings(a).then(function(t){var e=t.callSettingsNew,n=t.call,o=t.CallScreen,s=t.CometChatRTC;E=e,i=n,c=o,u=s,r.setState({shouldLoad:!0})}),r}return s(r,e),r.prototype.render=function(){return this.state.shouldLoad?p.createElement(S.View,{style:{flex:1,backgroundColor:"#000"}},p.createElement(c,{ref:function(t){return r.ref=t},style:{flex:1,backgroundColor:"#000"},callsettings:E,onCallEnded:function(){h.Logger.log("CallingComponent","oncallEnded")},onCallEndButtonPressed:function(){var t,e,n,o;i?(h.isFalsy(u)?(null===(t=null==r?void 0:r.ref)||void 0===t?void 0:t.endCall)&&(null===(e=null==r?void 0:r.ref)||void 0===e||e.endCall()):u.endCall(),setTimeout(function(){C.CometChat.endCall(a.getSessionId(),!0)},1e3)):(h.isFalsy(u)?(null===(n=null==r?void 0:r.ref)||void 0===n?void 0:n.endCall)&&(null===(o=null==r?void 0:r.ref)||void 0===o||o.endCall()):u.endCall(),_.CallController.getInstance().getCallListner()&&_.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null))},onUserJoined:function(t){if(t){var e=void 0;h.isFalsy(t.uid)||h.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&_.CallController.getInstance().getCallListner()&&(h.isFalsy(_.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||_.CallController.getInstance().getCallListner()._eventListener.onUserJoined(e)))}},onUserLeft:function(t){if(t){var e=void 0;h.isFalsy(t.uid)||h.isFalsy(t.name)||((e=new l.User(t)).setStatus("online"),C.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&_.CallController.getInstance().getCallListner()&&(h.isFalsy(_.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||_.CallController.getInstance().getCallListner()._eventListener.onUserLeft(e)))}},onUserListChanged:function(t){var n=[];t&&0=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function C(t,e){if(p.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return w(t).length;default:if(o)return G(t).length;e=(""+e).toLowerCase(),o=!0}}function l(t,e,n){var o=t[e];t[e]=t[n],t[n]=o}function T(t,e,n,o,s){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647=t.length){if(s)return-1;n=t.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof e&&(e=p.from(e,o)),p.isBuffer(e))return 0===e.length?-1:_(t,e,n,o,s);if("number"==typeof e)return e&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,o,s);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,o,s){var r,i=1,a=t.length,E=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a/=i=2,E/=2,n/=2}function c(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(s){var u=-1;for(r=n;r>>10&1023|55296),u=56320|1023&u),o.push(u),s+=p}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);var n="",o=0;for(;othis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return f(this,e,n);case"base64":return g(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},p.prototype.equals=function(t){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===p.compare(this,t)},p.prototype.inspect=function(){var t="",e=B.INSPECT_MAX_BYTES;return 0e&&(t+=" ... ")),""},p.prototype.compare=function(t,e,n,o,s){if(!p.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===s&&(s=this.length),e<0||n>t.length||o<0||s>this.length)throw new RangeError("out of range index");if(s<=o&&n<=e)return 0;if(s<=o)return-1;if(n<=e)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(o>>>=0),i=(n>>>=0)-(e>>>=0),a=Math.min(r,i),E=this.slice(o,s),c=t.slice(e,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var r,i,a,E,c,u,p,S,C,l=!1;;)switch(o){case"hex":return d(this,t,e,n);case"utf8":case"utf-8":return S=e,C=n,K(G(t,(p=this).length-S),p,S,C);case"ascii":return h(this,t,e,n);case"latin1":case"binary":return h(this,t,e,n);case"base64":return E=this,c=e,u=n,K(w(t),E,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i=e,a=n,K(function(t,e){for(var n,o,s,r=[],i=0;i>8,s=n%256,r.push(s),r.push(o);return r}(t,(r=this).length-i),r,i,a);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function I(t,e,n){var o="";n=Math.min(t.length,n);for(var s=e;st.length)throw new RangeError("Index out of range")}function P(t,e,n,o){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-n,2);s>>8*(o?s:1-s)}function M(t,e,n,o){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-n,4);s>>8*(o?s:3-s)&255}function v(t,e,n,o,s,r){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,o,s){return s||v(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function U(t,e,n,o,s){return s||v(t,0,n,8),r.write(t,e,n,o,52,8),n+8}p.prototype.slice=function(t,e){var n,o=this.length;if((t=~~t)<0?(t+=o)<0&&(t=0):o>>8):P(this,t,e,!0),e+2},p.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},p.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},p.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},p.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=0,i=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},p.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e|=0,!o){var s=Math.pow(2,8*n-1);y(this,t,e,n,s-1,-s)}var r=n-1,i=1,a=0;for(this[e+r]=255&t;0<=--r&&(i*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/i>>0)-a&255;return e+n},p.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},p.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},p.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},p.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},p.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),p.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},p.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},p.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},p.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},p.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},p.prototype.copy=function(t,e,n,o){if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(r=e;r>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function w(t){return o.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,n,o){for(var s=0;s=e.length||s>=t.length);++s)e[s+n]=t[s];return s}}).call(this,e(19))},function(t,e,n){"use strict";e.__esModule=!0,e.DaySchedule=void 0;var o=function(){function t(t,e,n){this.from=t,this.to=e,this.dnd=n}return t.prototype.getFrom=function(){return this.from},t.prototype.setFrom=function(t){this.from=t},t.prototype.getTo=function(){return this.to},t.prototype.setTo=function(t){this.to=t},t.prototype.getDND=function(){return this.dnd},t.prototype.setDND=function(t){this.dnd=t},t}();e.DaySchedule=o},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatNotifications=e.CometChat=e.init=void 0;var o=n(6),s=n(87);e.init=function(t){return o.CometChat.getInstance(t)},e.CometChat=o.CometChat,e.CometChatNotifications=s.CometChatNotifications},function(t,e,n){"use strict";e.__esModule=!0,e.RTCUser=void 0;var o=n(0),s=function(){function t(t){this.avatar="",o.isFalsy(t)||(this.uid=t.toString())}return t.prototype.setUID=function(t){this.uid=t?t.toString():""},t.prototype.getUID=function(){return this.uid.toString()},t.prototype.setName=function(t){this.name=t?t.toString():""},t.prototype.getName=function(){return this.name.toString()},t.prototype.setAvatar=function(t){this.avatar=t?t.toString():""},t.prototype.getAvatar=function(){return this.avatar.toString()},t.prototype.setJWT=function(t){this.jwt=t?t.toString():""},t.prototype.getJWT=function(){return this.jwt.toString()},t.prototype.setResource=function(t){this.resource=t?t.toString():""},t.prototype.getResource=function(){return this.resource.toString()},t}();e.RTCUser=s},function(t,e){t.exports=s},function(t,e,n){"use strict";e.__esModule=!0,e.AudioMode=void 0;var o=n(0),s=function(){function t(t,e){this.isSelected=!1,this.mode="",o.isFalsy(t)||(this.mode=t.toString()),this.isSelected=e||!1}return t.prototype.setMode=function(t){this.mode=t?t.toString():""},t.prototype.getMode=function(){return this.mode.toString()},t.prototype.setIsSelected=function(t){this.isSelected=t||!1},t.prototype.getIsSelected=function(){return this.isSelected},t}();e.AudioMode=s},function(t,e,n){"use strict";e.__esModule=!0,e.GroupsRequestBuilder=e.GroupsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(18),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(o.isFalsy(t.limit)||(this.limit=t.limit),o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.hasJoined)||(this.hasJoined=1),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.showTags)||(this.withTags=t.showTags))}return t.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();e.GroupsRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.joinedOnly=function(t){return this.hasJoined=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.GroupsRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.GroupMembersRequestBuilder=e.GroupMembersRequest=void 0;var s=n(5),o=n(0),r=n(15),i=n(2),a=n(42),E=n(1),c=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=r.LocalStorage.getInstance(),o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.GroupMembersRequest=c;var u=function(){function t(t){this.guid=t}return t.prototype.setGuid=function(t){return this.guid=t,this},t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new c(this)},t}();e.GroupMembersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.BannedMembersRequestBuilder=e.BannedMembersRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(42),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.USERS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.BannedMembersRequest=E;var c=function(){function t(t){this.guid=t}return t.prototype.setGuid=function(t){return this.guid=t,this},t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new E(this)},t}();e.BannedMembersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.UsersRequestBuilder=e.UsersRequest=void 0;var s=n(5),o=n(0),r=n(12),i=n(2),a=n(60),E=n(1),c=function(){function e(t){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=a.UserStore.getInstance(),o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),o.isFalsy(t.status)||(t.status==e.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=t.status),o.isFalsy(t.shouldHideBlockedUsers)||(this.hideBlockedUsers=t.shouldHideBlockedUsers),o.isFalsy(t.showFriendsOnly)||(this.friendsOnly=t.showFriendsOnly),o.isFalsy(t.showTags)||(this.withTags=t.showTags),o.isFalsy(t.role)||(this.role=t.role),o.isFalsy(t.roles)||(this.roles=t.roles),o.isFalsy(t.tags)||(this.tags=t.tags),o.isFalsy(t.UIDs)||(this.UIDs=t.UIDs),o.isFalsy(t.SortBy)||(this.sortBy=t.SortBy),o.isFalsy(t.SearchIn)||(this.searchIn=t.SearchIn),o.isFalsy(t.SortOrder)||(this.sortOrder=t.SortOrder))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},e.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},e}();e.UsersRequest=c;var u=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setStatus=function(t){return this.status=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.hideBlockedUsers=function(t){return this.shouldHideBlockedUsers=t,this},t.prototype.setRole=function(t){return this.role=t,this},t.prototype.setRoles=function(t){return this.roles=t,this},t.prototype.friendsOnly=function(t){return this.showFriendsOnly=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.setUIDs=function(t){return this.UIDs=t,this},t.prototype.sortBy=function(t){return this.SortBy=t,this},t.prototype.sortByOrder=function(t){return this.SortOrder=t,this},t.prototype.searchIn=function(t){return this.SearchIn=t,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},t}();e.UsersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.UserStore=void 0;var r=n(0),i=n(1),a=n(2),o=n(13),s=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.userStore=o.default}catch(t){r.Logger.error("UserStore: constructor",{e:t})}}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return this.userStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return new Promise(function(n,e){try{o.userStore.getItem(s).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clear=function(t){},t.prototype.selectStore=function(t){this.store=t},t.prototype.storeUsers=function(t){var e=this;return t.map(function(t){e.set(t.getUid(),t)}),!0},t.prototype.storeUser=function(t){return this.set(t.getUid(),t),!0},t}();e.UserStore=s},function(t,e,n){"use strict";e.__esModule=!0,e.ConversationsRequestBuilder=e.ConversationsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(32),a=n(1),E=function(){function t(t){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(t)||(this.limit=t.limit,o.isFalsy(t.conversationType)||(this.conversationType=t.conversationType)),o.isFalsy(t.getUserAndGroupTags)||(this.getUserAndGroupTags=t.getUserAndGroupTags),t.tags&&(this.tags=t.tags),o.isFalsy(t.WithTags)||(this.withTags=t.WithTags),t.groupTags&&(this.groupTags=t.groupTags),t.userTags&&(this.userTags=t.userTags),t.includeBlockedUsers&&(this.includeBlockedUsers=t.includeBlockedUsers),t.withBlockedInfo&&(this.withBlockedInfo=t.withBlockedInfo)}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.prototype.isIncludeBlockedUsers=function(){return this.includeBlockedUsers},t.prototype.isWithBlockedInfo=function(){return this.withBlockedInfo},t.prototype.getLimit=function(){return this.limit},t.prototype.getConversationType=function(){return this.conversationType},t.prototype.isWithUserAndGroupTags=function(){return this.getUserAndGroupTags},t.prototype.getTags=function(){return this.tags},t.prototype.isWithTags=function(){return this.withTags},t.prototype.getGroupTags=function(){return this.groupTags},t.prototype.getUserTags=function(){return this.userTags},t}();e.ConversationsRequest=E;var c=function(){function t(){this.WithTags=!1,this.includeBlockedUsers=!1,this.withBlockedInfo=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setConversationType=function(t){return this.conversationType=t,this},t.prototype.withUserAndGroupTags=function(t){return"boolean"==typeof t&&(this.getUserAndGroupTags=t),this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.setGroupTags=function(t){return this.groupTags=t,this},t.prototype.setUserTags=function(t){return this.userTags=t,this},t.prototype.setIncludeBlockedUsers=function(t){return this.includeBlockedUsers=t,this},t.prototype.setWithBlockedInfo=function(t){return this.withBlockedInfo=t,this},t.prototype.build=function(){return new E(this)},t}();e.ConversationsRequestBuilder=c},function(t,e,n){"use strict";var I=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function o(t){try{r(E.next(t))}catch(t){e(t)}}function s(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(o,s)}r((E=E.apply(t,i||[])).next())})},f=this&&this.__generator||function(n,o){var s,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]P.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void e(new O.CometChatException(JSON.parse(y.format(JSON.stringify(P.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",P.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(at&&M.MessageListnerMaping.getInstance().set(P.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(e.id))},function(t){M.MessageListnerMaping.getInstance().set(P.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(e.id))}),this.affix==P.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(e.id)&&(this.id=parseInt(e.id)),this.timestamp>e.sentAt&&(this.timestamp=e.sentAt),this.updatedAt>e.updatedAt&&(this.updatedAt=e.updatedAt)),this.id&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),n.push(m.MessageController.trasformJSONMessge(e)),[2]})})})):n=[],s(n),[2]})})},function(t){e(new O.CometChatException(t.error))})}catch(t){e(new O.CometChatException(t))}})},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[P.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(y.isFalsy(this.guid)||y.isFalsy(this.uid))&&y.isFalsy(this.guid)?(y.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var t={};t[P.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,t[P.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(y.isFalsy(this.guid)||y.isFalsy(this.uid))&&y.isFalsy(this.guid)&&y.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(e){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t.prototype.getFilteredNextDataByReceiverId=function(e){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).filter(function(t){return e[t].sender.uid==o.uid}).map(function(t){n=s(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>o.id}).map(function(t){n=s(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t}();e.MessagesRequest=o;var a=function(){function t(){this.maxLimit=P.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=P.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.mentionsWithTagInfoFlag=!1,this.mentionsWithBlockedInfoFlag=!1,this.interactionGoalCompletedOnly=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setGUID=function(t){return this.guid=t,this},t.prototype.setUID=function(t){return this.uid=t,this},t.prototype.setParentMessageId=function(t){return this.parentMessageId=t,this},t.prototype.setTimestamp=function(t){return void 0===t&&(t=y.getCurrentTime()),this.timestamp=t,this},t.prototype.setMessageId=function(t){return void 0===t&&(t=P.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=t,this},t.prototype.setUnread=function(t){return void 0===t&&(t=!1),this.unread=t,this},t.prototype.hideMessagesFromBlockedUsers=function(t){return void 0===t&&(t=!1),this.HideMessagesFromBlockedUsers=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKey=t,this},t.prototype.setUpdatedAfter=function(t){return this.updatedAt=t,this},t.prototype.updatesOnly=function(t){return t&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(t){return this.category=t,this},t.prototype.setCategories=function(t){return this.categories=t,this},t.prototype.setType=function(t){return this.type=t,this},t.prototype.setTypes=function(t){return this.types=t,this},t.prototype.hideReplies=function(t){return this.HideReplies=t,this},t.prototype.hideDeletedMessages=function(t){return this.HideDeletedMessages=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.mentionsWithTagInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithTagInfoFlag=t,this},t.prototype.mentionsWithBlockedInfo=function(t){return void 0===t&&(t=!1),this.mentionsWithBlockedInfoFlag=t,this},t.prototype.setInteractionGoalCompletedOnly=function(t){return void 0===t&&(t=!1),this.interactionGoalCompletedOnly=t,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new o(this)},t}();e.MessagesRequestBuilder=a},function(t,e,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,o=arguments.length;nt.getId()&&(i=parseInt(t.getId().toString())),oa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();e.BlockedUsersRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setDirection=function(t){return this.direction=t,this},t.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new E(this)},t}();e.BlockedUsersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.AppSettingsBuilder=e.AppSettings=void 0;var o=n(1),s=function(){function e(t){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=t.subscriptionType,this.roles=t.roles,this.region=t.region,this.autoJoinGroup=t.autoJoinGroup,this.establishSocketConnection=t.establishSocketConnection,this.adminHost=t.adminHost,this.clientHost=t.clientHost}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.prototype.getAdminHost=function(){return this.adminHost},e.prototype.getClientHost=function(){return this.clientHost},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();e.AppSettings=s;var r=function(){function t(){this.subscriptionType=s.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(t){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=t,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(t){return void 0===t&&(t=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=t.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(t){return void 0===t&&(t=!0),this.autoJoinGroup=t,this},t.prototype.autoEstablishSocketConnection=function(t){return void 0===t&&(t=!0),this.establishSocketConnection=t,this},t.prototype.overrideAdminHost=function(t){return this.adminHost=t,this},t.prototype.overrideClientHost=function(t){return this.clientHost=t,this},t.prototype.build=function(){return new s(this)},t}();e.AppSettingsBuilder=r},function(t,e,n){"use strict";var p=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;ei[0]&&e[1]>16&255,r[i++]=e>>8&255,r[i++]=255&e;var c,u;2===s&&(e=p[t.charCodeAt(E)]<<2|p[t.charCodeAt(E+1)]>>4,r[i++]=255&e);1===s&&(e=p[t.charCodeAt(E)]<<10|p[t.charCodeAt(E+1)]<<4|p[t.charCodeAt(E+2)]>>2,r[i++]=e>>8&255,r[i++]=255&e);return r},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,s=[],r=0,i=n-o;r>2]+a[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],s.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"="));return s.join("")};for(var a=[],p=[],S="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=o.length;s>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return r.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,o,s){var r,i,a=8*s-o-1,E=(1<>1,u=-7,p=n?s-1:0,S=n?-1:1,C=t[e+p];for(p+=S,r=C&(1<<-u)-1,C>>=-u,u+=a;0>=-u,u+=o;0>1,S=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:r-1,l=o?1:-1,T=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,i=u):(i=Math.floor(Math.log(e)/Math.LN2),e*(E=Math.pow(2,-i))<1&&(i--,E*=2),2<=(e+=1<=i+p?S/E:S*Math.pow(2,1-p))*E&&(i++,E/=2),u<=i+p?(a=0,i=u):1<=i+p?(a=(e*E-1)*Math.pow(2,s),i+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),i=0));8<=s;t[n+C]=255&a,C+=l,a/=256,s-=8);for(i=i<i[0]&&e[1]i[0]&&e[1]C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT)return void e(new p.CometChatException(JSON.parse(S.format(JSON.stringify(C.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",C.DEFAULT_VALUES.REACTIONS_MAX_LIMIT))));if(t>>((3&e)<<3)&255;return s}}},function(t,e){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=s;return[o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]]].join("")}},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatNotifications=void 0;var u=n(1),p=n(0),S=n(2),C=n(5),l=n(14),o=n(51),T=n(88),s=n(89),_=n(90),d=n(91),h=n(92),r=n(93),i=function(){function E(){}return E.fetchPushPreferences=function(){return new Promise(function(i,e){try{p.getAppSettings().then(function(t){C.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,{},null,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){if(t.data){var e=void 0,n=void 0,o=void 0,s=void 0;e=t.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?T.GroupPreferences.fromJSON(t.data):new T.GroupPreferences,n=t.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?d.OneOnOnePreferences.fromJSON(t.data):new d.OneOnOnePreferences,o=t.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?_.MutePreferences.fromJSON(t.data):new _.MutePreferences,s=!!t.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:e,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new h.PushPreferences)},function(t){return e(new S.CometChatException(t.error))})},function(t){return e(new S.CometChatException(t))})}catch(t){return e(new S.CometChatException(t))}})},E.updatePushPreferences=function(c){return new Promise(function(a,E){try{p.getAppSettings().then(function(t){var e,n=((e={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},e[l.APIConstants.KEY_MUTE_PREFERENCES]={},e[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},e),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],C.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,{},n,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){if(t.data){var e=void 0,n=void 0,o=void 0,s=void 0;e=t.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?T.GroupPreferences.fromJSON(t.data):new T.GroupPreferences,n=t.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?d.OneOnOnePreferences.fromJSON(t.data):new d.OneOnOnePreferences,o=t.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?_.MutePreferences.fromJSON(t.data):new _.MutePreferences,s=!!t.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:e,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new h.PushPreferences)},function(t){return E(new S.CometChatException(t.error))})},function(t){return E(new S.CometChatException(t))})}catch(t){return E(new S.CometChatException(t))}})},E.resetPushPreferences=function(){return new Promise(function(i,e){try{p.getAppSettings().then(function(t){C.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,{},null,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){if(t.data){var e=void 0,n=void 0,o=void 0,s=void 0;e=t.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?T.GroupPreferences.fromJSON(t.data):new T.GroupPreferences,n=t.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?d.OneOnOnePreferences.fromJSON(t.data):new d.OneOnOnePreferences,o=t.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?_.MutePreferences.fromJSON(t.data):new _.MutePreferences,s=!!t.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=h.PushPreferences.fromJSON({groupPreferences:e,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new h.PushPreferences)},function(t){return e(new S.CometChatException(t.error))})},function(t){return e(new S.CometChatException(t))})}catch(t){return e(new S.CometChatException(t))}})},E.getTokensForRequest=function(t,e,n,o){var s={};return s[l.APIConstants.KEY_PROVIDER_ID]=null!=o?o:l.DEFAULT_PROVIDER_ID,s[l.APIConstants.KEY_TIMEZONE]=t,n===l.PushPlatforms.FCM_REACT_NATIVE_ANDROID&&(s[l.APIConstants.KEY_FCM_TOKEN]=e),n===l.PushPlatforms.FCM_REACT_NATIVE_IOS&&(s[l.APIConstants.KEY_FCM_TOKEN]=e),n===l.PushPlatforms.APNS_REACT_NATIVE_DEVICE&&(s[l.APIConstants.KEY_DEVICE_TOKEN]=e),n===l.PushPlatforms.APNS_REACT_NATIVE_VOIP&&(s[l.APIConstants.KEY_VOIP_TOKEN]=e),s[l.APIConstants.KEY_PLATFORM]=n,s},E.registerPushToken=function(r,i,a){return new Promise(function(o,s){try{p.getAppSettings().then(function(t){var e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=E.getTokensForRequest(e,r,i,a);C.makeApiCall(l.APIConstants.KEY_REGISTER_TOKEN,{},n,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){return t.data&&t.data.success?o(l.ResponseConstants.TOKEN_REGISTER_SUCCESS):o(l.ResponseConstants.TOKEN_REGISTER_ERROR)},function(t){return s(new S.CometChatException(t.error))})},function(t){return s(new S.CometChatException(t))})}catch(t){return s(new S.CometChatException(t))}})},E.unregisterPushToken=function(){return new Promise(function(e,n){try{p.getAppSettings().then(function(t){C.makeApiCall(l.APIConstants.KEY_UNREGISTER_TOKEN,{},null,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){return t.data&&t.data.success?e(l.ResponseConstants.TOKEN_UNREGISTER_SUCCESS):e(l.ResponseConstants.TOKEN_UNREGISTER_ERROR)},function(t){return n(new S.CometChatException(t.error))})},function(t){return n(new S.CometChatException(t))})}catch(t){return n(new S.CometChatException(t))}})},E.muteConversations=function(r){return new Promise(function(o,s){try{p.getAppSettings().then(function(t){var e,n=((e={})[l.APIConstants.KEY_CONVERSATIONS]=r,e);C.makeApiCall(l.APIConstants.KEY_MUTE_CONVERSATIONS,{},n,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){return t.data&&t.data.success?o(l.ResponseConstants.MUTE_CONVERSATION_SUCCESS):o(l.ResponseConstants.MUTE_CONVERSATION_ERROR)},function(t){return s(new S.CometChatException(t.error))})},function(t){return s(new S.CometChatException(t))})}catch(t){return s(new S.CometChatException(t))}})},E.unmuteConversations=function(r){return new Promise(function(o,s){try{p.getAppSettings().then(function(t){var e,n=((e={})[l.APIConstants.KEY_CONVERSATIONS]=r,e);C.makeApiCall(l.APIConstants.KEY_UNMUTE_CONVERSATIONS,{},n,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){return t.data&&t.data.success?o(l.ResponseConstants.UNMUTE_CONVERSATION_SUCCESS):o(l.ResponseConstants.UNMUTE_CONVERSATION_ERROR)},function(t){return s(new S.CometChatException(t.error))})},function(t){return s(new S.CometChatException(t))})}catch(t){return s(new S.CometChatException(t))}})},E.getMutedConversations=function(){return new Promise(function(e,n){try{p.getAppSettings().then(function(t){C.makeApiCall(l.APIConstants.KEY_GET_MUTED_CONVERSATIONS,null,null,!1,{chatApiVersion:t[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(t){var n=[];return t.hasOwnProperty("data")&&t.data.hasOwnProperty(l.APIConstants.KEY_MUTED_CONVERSATIONS)&&t.data[l.APIConstants.KEY_MUTED_CONVERSATIONS].forEach(function(t){var e=new s.MutedConversation;e.setId(t.id),e.setType(t.type),e.setUntil(t.until),n.push(e)}),e(n)},function(t){return n(new S.CometChatException(t.error))})},function(t){return n(new S.CometChatException(t))})}catch(t){return n(new S.CometChatException(t))}})},E.MessagesOptions=l.MessagesOptions,E.RepliesOptions=l.RepliesOptions,E.ReactionsOptions=l.ReactionsOptions,E.MemberActionsOptions=l.MemberActionsOptions,E.DayOfWeek=l.DayOfWeek,E.DNDOptions=l.DNDOptions,E.MutedConversationType=l.MutedConversationType,E.PushPlatforms=l.PushPlatforms,E.DaySchedule=o.DaySchedule,E.PushPreferences=h.PushPreferences,E.GroupPreferences=T.GroupPreferences,E.OneOnOnePreferences=d.OneOnOnePreferences,E.MutePreferences=_.MutePreferences,E.MutedConversation=s.MutedConversation,E.UnmutedConversation=r.UnmutedConversation,E}();e.CometChatNotifications=i},function(t,e,n){"use strict";e.__esModule=!0,e.GroupPreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getMessagesPreference=function(){return this.groupMessages},n.prototype.getRepliesPreference=function(){return this.groupReplies},n.prototype.getReactionsPreference=function(){return this.groupReactions},n.prototype.getMemberLeftPreference=function(){return this.groupMemberLeft},n.prototype.getMemberAddedPreference=function(){return this.groupMemberAdded},n.prototype.getMemberJoinedPreference=function(){return this.groupMemberJoined},n.prototype.getMemberKickedPreference=function(){return this.groupMemberKicked},n.prototype.getMemberBannedPreference=function(){return this.groupMemberBanned},n.prototype.getMemberUnbannedPreference=function(){return this.groupMemberUnbanned},n.prototype.getMemberScopeChangedPreference=function(){return this.groupMemberScopeChanged},n.prototype.setMessagesPreference=function(t){this.groupMessages=t},n.prototype.setRepliesPreference=function(t){this.groupReplies=t},n.prototype.setReactionsPreference=function(t){this.groupReactions=t},n.prototype.setMemberLeftPreference=function(t){this.groupMemberLeft=t},n.prototype.setMemberAddedPreference=function(t){this.groupMemberAdded=t},n.prototype.setMemberJoinedPreference=function(t){this.groupMemberJoined=t},n.prototype.setMemberKickedPreference=function(t){this.groupMemberKicked=t},n.prototype.setMemberBannedPreference=function(t){this.groupMemberBanned=t},n.prototype.setMemberUnbannedPreference=function(t){this.groupMemberUnbanned=t},n.prototype.setMemberScopeChangedPreference=function(t){this.groupMemberScopeChanged=t},n.fromJSON=function(t){var e=new n;return e.setMessagesPreference(o.MessagesOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MESSAGES]]),e.setRepliesPreference(o.RepliesOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REPLIES]]),e.setReactionsPreference(o.ReactionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REACTIONS]]),e.setMemberAddedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_ADDED]]),e.setMemberJoinedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_JOINED]]),e.setMemberBannedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_BANNED]]),e.setMemberKickedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_KICKED]]),e.setMemberLeftPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_LEFT]]),e.setMemberScopeChangedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]]),e.setMemberUnbannedPreference(o.MemberActionsOptions[t[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_UNBANNED]]),e},n}();e.GroupPreferences=s},function(t,e,n){"use strict";e.__esModule=!0,e.MutedConversation=void 0;var o=function(){function t(){}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getUntil=function(){return this.until},t.prototype.setUntil=function(t){this.until=t},t}();e.MutedConversation=o},function(t,e,n){"use strict";e.__esModule=!0,e.MutePreferences=void 0;var p=n(14),S=n(51),o=function(){function u(){}return u.prototype.getDNDPreference=function(){return this.dnd},u.prototype.setDNDPreference=function(t){this.dnd=t},u.prototype.getSchedulePreference=function(){return this.schedule},u.prototype.setSchedulePreference=function(t){this.schedule=t},u.prototype.getScheduleFor=function(t){return this.schedule.get(t)},u.prototype.setScheduleFor=function(t,e){this.schedule.set(t,e)},u.fromJSON=function(t){var e=new u;e.setDNDPreference(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_DND]);var n=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_MUTE_DND]),o=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_MUTE_DND]),s=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_MUTE_DND]),r=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_MUTE_DND]),i=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_MUTE_DND]),a=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_MUTE_DND]),E=new S.DaySchedule(t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_FROM],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_TO],t[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_MUTE_DND]),c=new Map([[p.DayOfWeek.MONDAY,n],[p.DayOfWeek.TUESDAY,o],[p.DayOfWeek.WEDNESDAY,s],[p.DayOfWeek.THURSDAY,r],[p.DayOfWeek.FRIDAY,i],[p.DayOfWeek.SATURDAY,a],[p.DayOfWeek.SUNDAY,E]]);return e.setSchedulePreference(c),e},u}();e.MutePreferences=o},function(t,e,n){"use strict";e.__esModule=!0,e.OneOnOnePreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getReactionsPreference=function(){return this.oneOnOneMessageReactions},n.prototype.setReactionsPreference=function(t){this.oneOnOneMessageReactions=t},n.prototype.getRepliesPreference=function(){return this.oneOnOneReplies},n.prototype.setRepliesPreference=function(t){this.oneOnOneReplies=t},n.prototype.getMessagesPreference=function(){return this.oneOnOneMessages},n.prototype.setMessagesPreference=function(t){this.oneOnOneMessages=t},n.fromJSON=function(t){var e=new n;return e.setMessagesPreference(o.MessagesOptions[t[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_MESSAGES]]),e.setRepliesPreference(o.RepliesOptions[t[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REPLIES]]),e.setReactionsPreference(o.ReactionsOptions[t[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REACTIONS]]),e},n}();e.OneOnOnePreferences=s},function(t,e,n){"use strict";e.__esModule=!0,e.PushPreferences=void 0;var o=n(14),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(t){this.oneOnOnePreferences=t},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(t){this.mutePreferences=t},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(t){this.groupPreferences=t},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(t){this.usePrivacyTemplate=t},n.fromJSON=function(t){var e=new n;return t.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&e.setMutePreferences(t[o.APIConstants.KEY_MUTE_PREFERENCES]),t.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&e.setGroupPreferences(t[o.APIConstants.KEY_GROUP_PREFERENCES]),t.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&e.setOneOnOnePreferences(t[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),t.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.setUsePrivacyTemplate(t[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),e},n}();e.PushPreferences=s},function(t,e,n){"use strict";e.__esModule=!0,e.UnmutedConversation=void 0;var o=function(){function t(){}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t}();e.UnmutedConversation=o}])}),function(){try{require("@cometchat/calls-sdk-react-native")&&(this.CometChatCallSDK=require("@cometchat/calls-sdk-react-native/package.json"),this.CometChatCalling={},this.CometChatCalling.isCallingComponentInstalled=!0,this.CometChatCalling.CallScreen=require("@cometchat/calls-sdk-react-native").default,this.CometChatCalling.CometChatRTC=require("@cometchat/calls-sdk-react-native").CometChatRTC,this.CometChatCalling.CometChatCalls=require("@cometchat/calls-sdk-react-native").CometChatCalls,this.CometChatCalling.CallEventListener=require("@cometchat/calls-sdk-react-native").CallEventListener)}catch(t){}try{require("@cometchat/chat-uikit-react-native")&&(this.CometChatUiKit=require("@cometchat/chat-uikit-react-native/package.json"))}catch(t){}}(); \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@react-native-async-storage/async-storage"),require("react-native"),require("react"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react-native","react"],t);else{var n="object"==typeof exports?t(require("@react-native-async-storage/async-storage"),require("react-native"),require("react")):t(e["@react-native-async-storage/async-storage"],e["react-native"],e.react);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,function(n,o,s){return function(n){var o={};function s(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}return s.m=n,s.c=o,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)s.d(n,o,function(e){return t[e]}.bind(null,o));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=52)}([function(e,W,r){"use strict";(function(K){W.__esModule=!0,W.validateQuestion=W.updatePropertiesWithDynamicValue=W.getCallSettings=W.isCallingComponentInstalled=W.getKeyprefix=W.validateConversationType=W.validateUpdateUser=W.validateCreateUser=W.validateMessage=W.validateChatType=W.validateMsgId=W.validateArray=W.validateHideMessagesFromBlockedUsers=W.validateId=W.validateCreateGroup=W.validateJoinGroup=W.validateUpdateGroup=W.validateScope=W.isAudio=W.isVideo=W.isImage=W.getUpdatedSettings=W.getAppSettings=W.getCurrentTime=W.Logger=W.createUidFromJid=W.format=W.getOrdinalSuffix=W.isFalsy=W.isTruthy=W.isObject=W.getJidHost=W.getChatHost=void 0;var o=r(15),B=r(1),e=r(5),F=r(2),i=r(20),a=r(22),E=r(24),b=r(6),t=r(10),x=r(39),V=r(53),J=r(16),c=r(26);function k(e){return null!=e&&("string"==typeof e&&(e=e.trim()),"object"==typeof e&&0===Object.keys(e).length&&(e=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(e)}function u(e){for(var o=[],t=1;ti[0]&&t[1] All store cleared successfully","true"),e(!0)})}catch(e){T.Logger.error("CometChat: clearCache",e),t(e)}})},_.connect=function(e){var t=e||{},n=t.onSuccess,o=t.onError;_.user?(pe.connection||(_.onConnectionSuccess=n,_.disconnectedByUser=!1,_.WSLogin(_.user)),_.didAnalyticsPingStart()||_.isAnalyticsDisabled||(_.pingAnalytics(),_.startAnalyticsPingTimer())):o&&o(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},_.disconnect=function(e){var t=e||{},n=t.onSuccess,o=t.onError;_.user?(_.disconnectedByUser=!0,_.disconnectInternally({onError:o}),pe.clearWSResponseTimer(),_.onDisconnectSuccess=n):o&&o(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},_.disconnectInternally=function(e){var t=(e||{}).onError;_.user?(pe.connection&&pe.WSLogout(),_.didAnalyticsPingStart()&&_.clearAnalyticsPingTimer(),_.clearWSReconnectionTimer()):t&&t(new d.CometChatException({code:f.Errors.ERROR_USER_NOT_LOGGED_IN,message:f.Errors.ERROR_USER_NOT_LOGGED_IN_MESSAGE}))},_.prototype.internalRestart=function(e){_.internalRestart||_.getInstance().internalLogout(!1).then(function(){_.internalRestart=!0,_.login(e).then(function(e){_.shouldConnectToWS=!0,_.internalRestart=!1},function(e){T.Logger.error("CometChat: internalRestart :: login",e),_.internalRestart=!1})},function(e){T.Logger.error("CometChat: internalRestart :: internalLogout",e)})},_.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(e,t){try{_.didAnalyticsPingStart()&&_.clearAnalyticsPingTimer(),_.WSReconnectionInProgress&&_.clearWSReconnectionTimer(),_.isLoggedOut=!0,_.WSReconnectionInProgress=!1,_.isAnalyticsDisabled=!1,_.clearCache().then(function(){_.apiKey=void 0,_.user=void 0,_.authToken=void 0,_.cometChat=void 0,_.mode=void 0,pe.WSLogout(),n&&_.pushToLoginListener("","Logout_Success"),e(!0)})}catch(e){T.Logger.error("CometChat: internalLogout",e),t(e)}})},_.markAsInteracted=function(e,o,t){return new Promise(function(n,t){try{T.isFalsy(e)?t(new d.CometChatException(m.ERRORS.PARAMETER_MISSING)):h.makeApiCall("markInteracted",{messageId:e},{interactions:[o]}).then(function(e){var t;t=e&&e.data&&e.data.message?e.data.message:"Marked interacted",n(t)},function(e){t(new d.CometChatException(e.error))})}catch(e){t(new d.CometChatException(e))}})},_.getConversationUpdateSettings=function(){return E(this,void 0,void 0,function(){var t;return c(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,T.getAppSettings()];case 1:return t=e.sent(),[2,ce.ConversationUpdateSettings.fromJSON(t)];case 2:return e.sent(),[2,new ce.ConversationUpdateSettings];case 3:return[2]}})})},_.initialzed=!1,_.CometChatException=d.CometChatException,_.TextMessage=g.TextMessage,_.MediaMessage=p.MediaMessage,_.CustomMessage=w.CustomMessage,_.Action=i.Action,_.Call=s.Call,_.TypingIndicator=Y.TypingIndicator,_.TransientMessage=Q.TransientMessage,_.InteractiveMessage=ee.InteractiveMessage,_.InteractionGoal=te.InteractionGoal,_.Interaction=ne.Interaction,_.InteractionReceipt=oe.InteractionReceipt,_.Group=a.Group,_.User=l.User,_.GroupMember=K.GroupMember,_.Conversation=x.Conversation,_.ReactionCount=ie.ReactionCount,_.ReactionEvent=ae.ReactionEvent,_.Reaction=Ee.Reaction,_.USER_STATUS={ONLINE:f.PresenceConstatnts.STATUS.ONLINE,OFFLINE:f.PresenceConstatnts.STATUS.OFFLINE},_.MessagesRequest=U.MessagesRequest,_.MessagesRequestBuilder=U.MessagesRequestBuilder,_.ReactionsRequest=re.ReactionsRequest,_.ReactionsRequestBuilder=re.ReactionsRequestBuilder,_.UsersRequest=v.UsersRequest,_.UsersRequestBuilder=v.UsersRequestBuilder,_.ConversationsRequest=L.ConversationsRequest,_.ConversationsRequestBuilder=L.ConversationsRequestBuilder,_.BlockedUsersRequest=B.BlockedUsersRequest,_.BlockedUsersRequestBuilder=B.BlockedUsersRequestBuilder,_.GroupsRequest=P.GroupsRequest,_.GroupsRequestBuilder=P.GroupsRequestBuilder,_.GroupMembersRequest=y.GroupMembersRequest,_.GroupMembersRequestBuilder=y.GroupMembersRequestBuilder,_.BannedMembersRequest=M.BannedMembersRequest,_.BannedMembersRequestBuilder=M.BannedMembersRequestBuilder,_.CallSettings=k.CallSettings,_.CallSettingsBuilder=k.CallSettingsBuilder,_.MainVideoContainerSetting=k.MainVideoContainerSetting,_.AppSettings=F.AppSettings,_.AppSettingsBuilder=F.AppSettingsBuilder,_.CallingComponent=H.CallingComponent,_.MessageListener=o.MessageListener,_.UserListener=o.UserListener,_.GroupListener=o.GroupListener,_.OngoingCallListener=o.OngoingCallListener,_.CallListener=o.CallListener,_.ConnectionListener=o.ConnectionListener,_.LoginListener=o.LoginListener,_.CallController=N.CallController,_.CometChatHelper=b.CometChatHelper,_.Attachment=J.Attachment,_.ConversationUpdateSettings=ce.ConversationUpdateSettings,_.GoalType=f.GoalType,_.MESSAGE_TYPE=f.MessageConstatnts.TYPE,_.CATEGORY_MESSAGE=f.MessageConstatnts.CATEGORY.MESSAGE,_.CATEGORY_ACTION=f.MessageConstatnts.CATEGORY.ACTION,_.CATEGORY_CALL=f.MessageConstatnts.CATEGORY.CALL,_.CATEGORY_CUSTOM=f.MessageConstatnts.CATEGORY.CUSTOM,_.ACTION_TYPE=f.ActionConstatnts.ACTIONS,_.CALL_TYPE=f.CallConstants.CALL_TYPE,_.CATEGORY_INTERACTIVE=f.MessageConstatnts.CATEGORY.INTERACTIVE,_.REACTION_ACTION=f.REACTION_ACTION,_.RECEIVER_TYPE=f.MessageConstatnts.RECEIVER_TYPE,_.CALL_STATUS=f.CallConstants.CALL_STATUS,_.GROUP_MEMBER_SCOPE=f.GROUP_MEMBER_SCOPE,_.GROUP_TYPE=f.GROUP_TYPE,_.MESSAGE_REQUEST=f.MessageConstatnts.PAGINATION.CURSOR_FILEDS,_.CONNECTION_STATUS=f.CONNECTION_STATUS,_.CALL_MODE=f.CallConstants.CALL_MODE,_.AUDIO_MODE=f.CallConstants.AUDIO_MODE,_.SORT_BY=f.UserConstants.SORT_BY,_.SORT_ORDER=f.UserConstants.SORT_ORDER,_.WSReconnectionInProgress=!1,_.WSReconnectionTimerInterval=5e3,_.currentConnectionStatus=f.CONNECTION_STATUS.DISCONNECTED,_.isConnectingFromInit=!1,_.loginInProgress=!1,_.internalRestart=!1,_.settingsInterval=6e4,_.isAnalyticsPingStarted=!1,_.isLoggedOut=!0,_.isAnalyticsDisabled=!1,_.disconnectedByUser=!1,_.shouldConnectToWS=!0,_.isAppInactive=!1,_.onConnectionSuccess=null,_.onDisconnectSuccess=null,_.onConnectionError=null,_.callWaitTimer=null,_.callWaitTime=30,_}();t.CometChat=Se},function(e,t,n){"use strict";t.__esModule=!0,t.BaseMessage=void 0;var o=n(1),s=n(21),r=n(0),i=function(){function e(e,t,n,o){this.reactions=[],this.mentionedUsers=[],this.mentionedMe=!1,this.receiverId=e,this.type=t,this.receiverType=n,this.category=o}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getUnreadRepliesCount=function(){return this.unreadRepliesCount},e.prototype.setUnreadRepliesCount=function(e){this.unreadRepliesCount=e},e.prototype.getConversationId=function(){return this.conversationId},e.prototype.setConversationId=function(e){this.conversationId=e},e.prototype.getParentMessageId=function(){return this.parentMessageId},e.prototype.setParentMessageId=function(e){this.parentMessageId=e},e.prototype.getMuid=function(){return this.muid},e.prototype.setMuid=function(e){this.muid=e},e.prototype.getSender=function(){return this.sender},e.prototype.setSender=function(e){this.sender=e},e.prototype.getReceiver=function(){return this.receiver},e.prototype.setReceiver=function(e){this.receiver=e},e.prototype.getReceiverId=function(){return this.receiverId},e.prototype.setReceiverId=function(e){this.receiverId=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getReceiverType=function(){return this.receiverType},e.prototype.setReceiverType=function(e){this.receiverType=e},e.prototype.getSentAt=function(){return this.sentAt},e.prototype.setSentAt=function(e){this.sentAt=e},e.prototype.getStatus=function(){return this.status},e.prototype.setStatus=function(e){this.status=e},e.prototype.getDeliveredAt=function(){return this.deliveredAt},e.prototype.setDeliveredAt=function(e){this.deliveredAt=e},e.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},e.prototype.setDeliveredToMeAt=function(e){this.deliveredToMeAt=e},e.prototype.getReadAt=function(){return this.readAt},e.prototype.setReadAt=function(e){this.readAt=e},e.prototype.getReadByMeAt=function(){return this.readByMeAt},e.prototype.setReadByMeAt=function(e){this.readByMeAt=e},e.prototype.getCategory=function(){return this.category},e.prototype.setCategory=function(e){this.category=e},e.prototype.getEditedAt=function(){return this.editedAt},e.prototype.setEditedAt=function(e){this.editedAt=e},e.prototype.getEditedBy=function(){return this.editedBy},e.prototype.setEditedBy=function(e){this.editedBy=e},e.prototype.getDeletedAt=function(){return this.deletedAt},e.prototype.setDeletedAt=function(e){this.deletedAt=e},e.prototype.getDeletedBy=function(){return this.deletedBy},e.prototype.setDeletedBy=function(e){this.deletedBy=e},e.prototype.getReplyCount=function(){return this.replyCount},e.prototype.setReplyCount=function(e){this.replyCount=e},e.prototype.getRawMessage=function(){return this.rawMessage},e.prototype.setRawMessage=function(e){this.rawMessage=e},e.prototype.setMentionedUsers=function(e){this.mentionedUsers=e},e.prototype.getMentionedUsers=function(){return this.mentionedUsers},e.prototype.setHasMentionedMe=function(e){this.mentionedMe=e},e.prototype.hasMentionedMe=function(){return this.mentionedMe},e.prototype.getData=function(){return this.data},e.prototype.setData=function(e){this.data=e},e.prototype.setReactions=function(e){try{this.setReactionsToData(e)}catch(e){return this.reactions}},e.prototype.getReactions=function(){try{return this.getReactionsFromData()}catch(e){return this.reactions}},e.prototype.setReactionsToData=function(e){var t=this.getData();if(t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]){var n=e.map(function(e){return new s.ReactionCount(e.reaction,e.count,!!e.reactedByMe&&e.reactedByMe)});t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=n,this.setData(t),this.reactions=n}else t[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS]=e,this.setData(t),this.reactions=e},e.prototype.getReactionsFromData=function(){try{var e=this.getData(),n=[];if(e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS])e[o.ResponseConstants.RESPONSE_KEYS.KEY_REACTIONS].forEach(function(e){var t=new s.ReactionCount(e.reaction,e.count,!!e.reactedByMe&&e.reactedByMe);n.push(t)});return n}catch(e){throw r.Logger.error("BaseMessageModel: getReactionsFromData",e),e}},e}();t.BaseMessage=i},function(e,t,n){"use strict";t.__esModule=!0,t.CometChatEvent=void 0;var i=n(0),o=n(4),s=function(){function e(e,t,n,o,s,r){i.isFalsy(e)||(this.appId=e),i.isFalsy(t)||(this.receiver=t),i.isFalsy(n)||(this.receiverType=n),i.isFalsy(s)||(this.deviceId=s),i.isFalsy(o)||(this.sender=o),i.isFalsy(r)||(this.messageSender=r)}return e.prototype.getAppId=function(){return this.appId},e.prototype.setAppId=function(e){this.appId=e},e.prototype.getReceiver=function(){return this.receiver},e.prototype.setReceiver=function(e){this.receiver=e},e.prototype.getSender=function(){return this.sender},e.prototype.setSender=function(e){this.sender=e},e.prototype.getReceiverType=function(){return this.receiverType},e.prototype.setReceiverType=function(e){this.receiverType=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getDeviceId=function(){return this.deviceId},e.prototype.setDeviceId=function(e){this.deviceId=e},e.prototype.getMessageSender=function(){return this.messageSender},e.prototype.setMessageSender=function(e){this.messageSender=e},e.prototype.getCometChatEventJSON=function(){var e={};return e[o.KEYS.APP_ID]=this.getAppId(),e[o.KEYS.RECEIVER]=this.getReceiver(),e[o.KEYS.RECEIVER_TYPE]=this.getReceiverType(),e[o.KEYS.DEVICE_ID]=this.getDeviceId(),e[o.KEYS.TYPE]=this.getType(),e[o.KEYS.SENDER]=this.getSender(),i.isFalsy(this.getMessageSender())||(e[o.KEYS.MESSAGE_SENDER]=this.getMessageSender()),e},e}();t.CometChatEvent=s},function(e,t,n){"use strict";t.__esModule=!0,t.Group=void 0;var o=n(1),s=function(){function e(e,t,n,o,s,r,i){this.hasJoined=!1,this.membersCount=0,this.isBanned=!1,this.guid=e,t&&(this.name=t),n&&(this.type=n),!o&&""!==o||"password"!=n||(this.password=o),(s||""===s)&&(this.icon=s),(r||""===r)&&(this.description=r),i&&(this.hasJoined=i)}return e.prototype.getGuid=function(){return this.guid},e.prototype.setGuid=function(e){this.guid=e},e.prototype.getName=function(){return this.name},e.prototype.setName=function(e){e&&(this.name=e)},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getPassword=function(){return this.password},e.prototype.setPassword=function(e){this.password=e},e.prototype.getIcon=function(){return this.icon},e.prototype.setIcon=function(e){this.icon=e},e.prototype.getDescription=function(){return this.description},e.prototype.setDescription=function(e){this.description=e},e.prototype.getOwner=function(){return this.owner},e.prototype.setOwner=function(e){this.owner=e},e.prototype.getMetadata=function(){return this.metadata},e.prototype.setMetadata=function(e){this.metadata=e},e.prototype.getCreatedAt=function(){return this.createdAt},e.prototype.setCreatedAt=function(e){this.createdAt=e},e.prototype.getUpdatedAt=function(){return this.updatedAt},e.prototype.setUpdatedAt=function(e){this.updatedAt=e},e.prototype.getHasJoined=function(){return this.hasJoined},e.prototype.setHasJoined=function(e){this.hasJoined=e},e.prototype.getWsChannel=function(){return this.wsChannel},e.prototype.setWsChannel=function(e){this.wsChannel=e},e.prototype.setScope=function(e){this.scope=e},e.prototype.getScope=function(){return this.scope},e.prototype.getJoinedAt=function(){return this.joinedAt},e.prototype.setJoinedAt=function(e){this.joinedAt=e},e.prototype.getMembersCount=function(){return this.membersCount},e.prototype.setMembersCount=function(e){this.membersCount=e},e.prototype.setTags=function(e){this.tags=e},e.prototype.getTags=function(){return this.tags},e.prototype.isBannedFromGroup=function(){return this.isBanned},e.TYPE=o.GroupType,e.Type=e.TYPE,e}();t.Group=s},function(e,t,n){"use strict";t.__esModule=!0,t.FETCH_ERROR=t.TYPINGNOTIFICATION_CONSTANTS=t.LOGIN_ERROR=t.MESSAGE_ERRORS=t.MESSAGES_REQUEST_ERRORS=t.USERS_REQUEST_ERRORS=t.GROUP_CREATION_ERRORS=t.INIT_ERROR=t.ERRORS=t.SERVER_ERRORS=void 0,t.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},t.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},t.INIT_ERROR={NO_APP_ID:{code:t.ERRORS.PARAMETER_MISSING.code,name:t.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},t.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},t.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},t.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},t.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},t.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},t.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},t.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(e,t,n){"use strict";t.__esModule=!0,t.MessageController=void 0;var _=n(7),T=n(20),d=n(22),h=n(0),R=n(1),g=n(28),A=n(29),I=n(30),r=n(2),f=n(23),O=n(24),N=n(6),i=n(12),a=n(3),m=n(26),o=function(){function l(){}return l.trasformJSONMessge=function(n){var e,t,o,s,r;try{var i=null,a=void 0;switch(n[R.MessageConstatnts.KEYS.CATEGORY]){case R.MessageConstatnts.CATEGORY.ACTION:a=g.Action.actionFromJSON(n);break;case R.MessageConstatnts.CATEGORY.CALL:a=A.Call.callFromJSON(n);break;case R.MessageConstatnts.CATEGORY.MESSAGE:switch(n[R.MessageConstatnts.KEYS.TYPE]){case R.MessageConstatnts.TYPE.TEXT:a=new T.TextMessage(n[R.MessageConstatnts.KEYS.RECEIVER],n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.TEXT],n[R.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case R.MessageConstatnts.TYPE.CUSTOM:a=new O.CustomMessage(n[R.MessageConstatnts.KEYS.RECEIVER],n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.CUSTOM_DATA],n[R.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if(a=new d.MediaMessage(n[R.MessageConstatnts.KEYS.RECEIVER],n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.URL],n[R.MessageConstatnts.KEYS.TYPE],n[R.MessageConstatnts.KEYS.RECEIVER_TYPE]),n.hasOwnProperty(R.MessageConstatnts.KEYS.DATA)){var E=n[R.MessageConstatnts.KEYS.DATA];if(E.hasOwnProperty(R.MessageConstatnts.KEYS.ATTATCHMENTS)){var c,u=E[R.MessageConstatnts.KEYS.ATTATCHMENTS];new Array;u.map(function(e){c=new f.Attachment(e)}),a.setAttachment(c)}E.hasOwnProperty(R.MessageConstatnts.KEYS.TEXT)&&a.setCaption(E[R.MessageConstatnts.KEYS.TEXT])}a.hasOwnProperty("file")&&delete a.file}break;case R.MessageConstatnts.CATEGORY.CUSTOM:a=new O.CustomMessage(n[R.MessageConstatnts.KEYS.RECEIVER],n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.CUSTOM_DATA],n[R.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type);break;case R.MessageConstatnts.CATEGORY.INTERACTIVE:a=new m.InteractiveMessage(n[R.MessageConstatnts.KEYS.RECEIVER],n[R.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type,n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.INTERACTIVE_DATA],n[R.MessageConstatnts.KEYS.DATA][R.MessageConstatnts.KEYS.INTERACTION_GOAL])}if((n[R.MessageConstatnts.KEYS.CATEGORY]===R.MessageConstatnts.CATEGORY.MESSAGE||n[R.MessageConstatnts.KEYS.CATEGORY]===R.MessageConstatnts.CATEGORY.CUSTOM)&&n[R.MessageConstatnts.KEYS.TYPE]!==R.MessageConstatnts.TYPE.TEXT&&(null==n?void 0:n[R.MessageConstatnts.KEYS.DATA])&&(null===(e=null==n?void 0:n[R.MessageConstatnts.KEYS.DATA])||void 0===e?void 0:e[R.MessageConstatnts.KEYS.ATTATCHMENTS])&&0!==(null===(o=null===(t=null==n?void 0:n[R.MessageConstatnts.KEYS.DATA])||void 0===t?void 0:t[R.MessageConstatnts.KEYS.ATTATCHMENTS])||void 0===o?void 0:o.length)&&(null===(s=N.CometChat.user)||void 0===s?void 0:s.getFat())&&N.CometChat.SECURED_MEDIA_HOST){var p=N.CometChat.SECURED_MEDIA_HOST,C=null===(r=N.CometChat.user)||void 0===r?void 0:r.getFat(),S=h.updatePropertiesWithDynamicValue(n,p,"?"+R.ADDITIONAL_CONSTANTS.SECURE_URL_PROPERTY+"="+C);S&&(n=S)}n[R.MessageConstatnts.KEYS.MY_RECEIPTS]&&(n[R.MessageConstatnts.KEYS.MY_RECEIPTS]=n[R.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(n[R.MessageConstatnts.KEYS.MY_RECEIPTS]).map(function(e){var t=new I.MessageReceipt;e==R.DELIVERY_RECEIPTS.DELIVERED_AT&&(t.setReceiptType(t.RECEIPT_TYPE.DELIVERY_RECEIPT),t.setDeliveredAt(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.DELIVERY_RECEIPTS.DELIVERED_AT]),h.isFalsy(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.DELIVERY_RECEIPTS.RECIPIENT])?n[R.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.DELIVERY_RECEIPTS.DELIVERED_AT]:t.setSender(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.DELIVERY_RECEIPTS.RECIPIENT]),t.setReceiverType(n[R.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(n[R.MessageConstatnts.KEYS.RECEIVER])),n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.READ_RECEIPTS.READ_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.READ_RECEIPT),t.setReadAt(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.READ_RECEIPTS.READ_AT]),h.isFalsy(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.READ_RECEIPTS.RECIPIENT])?n[R.READ_RECEIPTS.READ_BY_ME_AT]=n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.READ_RECEIPTS.READ_AT]:t.setSender(n[R.MessageConstatnts.KEYS.MY_RECEIPTS][R.READ_RECEIPTS.RECIPIENT]),t.setReceiverType(n[R.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(n[R.MessageConstatnts.KEYS.RECEIVER]))}));try{if(Object.assign(a,n),(n=a).parentId&&(n.parentMessageId=n.parentId,delete n.parentId),n instanceof _.BaseMessage&&(h.isFalsy(i)||n.setRawMessage(i)),n instanceof T.TextMessage)l.extractDetailsFromMentions(n),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.getData()[R.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[R.MessageConstatnts.KEYS.METADATA]);else if(n instanceof d.MediaMessage)l.extractDetailsFromMentions(n),n.getData()[R.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[R.MessageConstatnts.KEYS.METADATA]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver());else if(n instanceof g.Action)n.setSender(n.getSender()),n.setReceiver(n.getActionFor()),n.setActionBy(n.getActionBy()),n.setActionOn(n.getActionOn()),n.setActionFor(n.getActionFor()),n.setMessage(n.getMessage());else if(n instanceof A.Call){try{n.setSender(n.getSender())}catch(e){h.Logger.error("MessageController: trasformJSONMessge: setSender",e)}try{n.setCallInitiator(n.getCallInitiator())}catch(e){h.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",e)}try{n.setReceiver(n.getCallReceiver()),n.setCallReceiver(n.getCallReceiver())}catch(e){h.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",e)}}else n instanceof O.CustomMessage?(n.getData()[R.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[R.MessageConstatnts.KEYS.METADATA]),n.setCustomData(n.getData()[R.MessageConstatnts.KEYS.CUSTOM_DATA]),n.setSubType(n.getData()[R.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver())):n instanceof m.InteractiveMessage&&(n.setMetadata(n.getData()[R.MessageConstatnts.KEYS.METADATA]),n.setInteractiveData(n.getData()[R.MessageConstatnts.KEYS.INTERACTIVE_DATA]),n.setInteractionGoal(n.getInteractionGoal()),n.setInteractions(n.getInteractions()),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.setIsSenderInteractionAllowed(n.getData()[R.MessageConstatnts.KEYS.ALLOW_SENDER_INTERACTION]));n.hasOwnProperty("rawMessage")||(i=JSON.parse(JSON.stringify(n))),n instanceof _.BaseMessage&&(h.isFalsy(i)||n.setRawMessage(i))}catch(e){h.Logger.error("MessageController: trasformJSONMessge: Main",e),n=null}return n}catch(e){h.Logger.error("MessageController: trasformJSONMessge",e)}},l.extractDetailsFromMentions=function(e){if(e.getData()[R.MessageConstatnts.KEYS.MENTIONS]){var t=[],n=!1,o=N.CometChat.user,s=e.getData()[R.MessageConstatnts.KEYS.MENTIONS];for(var r in s)r.toString()==(null==o?void 0:o.getUid())&&(n=!0),t.push(new a.User(s[r]));e.setMentionedUsers(t),e.setHasMentionedMe(n)}},l.getReceiptsFromJSON=function(s){return new Promise(function(e,t){try{var o=[];N.CometChat.getLoggedInUser().then(function(n){h.isFalsy(s.receipts)?e([]):(s.receipts.data.map(function(e){var t=new I.MessageReceipt;e[R.DELIVERY_RECEIPTS.DELIVERED_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.DELIVERY_RECEIPT),t.setDeliveredAt(e[R.DELIVERY_RECEIPTS.DELIVERED_AT]),t.setTimestamp(e[R.DELIVERY_RECEIPTS.DELIVERED_AT]),h.isFalsy(e[R.DELIVERY_RECEIPTS.RECIPIENT])?t.setSender(n):t.setSender(i.UsersController.trasformJSONUser(e[R.DELIVERY_RECEIPTS.RECIPIENT])),t.setReceiverType(s[R.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(s[R.MessageConstatnts.KEYS.RECEIVER])),e[R.READ_RECEIPTS.READ_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.READ_RECEIPT),t.setReadAt(e[R.READ_RECEIPTS.READ_AT]),t.setTimestamp(e[e[R.READ_RECEIPTS.READ_AT]]),h.isFalsy(e[R.READ_RECEIPTS.RECIPIENT])?t.setSender(n):t.setSender(i.UsersController.trasformJSONUser(e[R.READ_RECEIPTS.RECIPIENT])),t.setReceiverType(s[R.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(s[R.MessageConstatnts.KEYS.RECEIVER])),o.push(t)}),e(o))})}catch(e){t(new r.CometChatException(e))}})},l}();t.MessageController=o},function(e,t,n){"use strict";t.__esModule=!0,t.UsersController=void 0;var o=n(3),s=n(0),r=function(){function e(){}return e.trasformJSONUser=function(e){var t;try{e.uid=e.uid.toString(),e.name=e.name.toString(),e.status&&"offline"!==e.status?e.status="online":e.status="offline",t=new o.User(e),Object.assign(t,e),e=t}catch(e){s.Logger.error("UsersController:transformJSONUser",e)}return e},e}();t.UsersController=r},function(e,t,n){"use strict";var o,s,r,i,a,E,c,u;t.__esModule=!0,t.DEFAULT_PROVIDER_ID=t.APIResponseConstants=t.APIConstants=t.PushPlatforms=t.MutedConversationType=t.DayOfWeek=t.DNDOptions=t.MemberActionsOptions=t.ReactionsOptions=t.RepliesOptions=t.MessagesOptions=void 0,(o=t.MessagesOptions||(t.MessagesOptions={}))[o.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",o[o.SUBSCRIBE_TO_ALL=2]="SUBSCRIBE_TO_ALL",o[o.SUBSCRIBE_TO_MENTIONS=3]="SUBSCRIBE_TO_MENTIONS",(s=t.RepliesOptions||(t.RepliesOptions={}))[s.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",s[s.SUBSCRIBE_TO_ALL=2]="SUBSCRIBE_TO_ALL",s[s.SUBSCRIBE_TO_MENTIONS=3]="SUBSCRIBE_TO_MENTIONS",(r=t.ReactionsOptions||(t.ReactionsOptions={}))[r.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",r[r.SUBSCRIBE_TO_REACTIONS_ON_OWN_MESSAGES=2]="SUBSCRIBE_TO_REACTIONS_ON_OWN_MESSAGES",r[r.SUBSCRIBE_TO_REACTIONS_ON_ALL_MESSAGES=3]="SUBSCRIBE_TO_REACTIONS_ON_ALL_MESSAGES",(i=t.MemberActionsOptions||(t.MemberActionsOptions={}))[i.DONT_SUBSCRIBE=1]="DONT_SUBSCRIBE",i[i.SUBSCRIBE=2]="SUBSCRIBE",(a=t.DNDOptions||(t.DNDOptions={}))[a.DISABLED=1]="DISABLED",a[a.ENABLED=2]="ENABLED",(E=t.DayOfWeek||(t.DayOfWeek={})).MONDAY="monday",E.TUESDAY="tuesday",E.WEDNESDAY="wednesday",E.THURSDAY="thursday",E.FRIDAY="friday",E.SATURDAY="saturday",E.SUNDAY="sunday",(c=t.MutedConversationType||(t.MutedConversationType={})).ONE_ON_ONE="oneOnOne",c.GROUP="group",(u=t.PushPlatforms||(t.PushPlatforms={})).FCM_REACT_NATIVE_ANDROID="fcm_react_native_android",u.FCM_REACT_NATIVE_IOS="fcm_react_native_ios",u.APNS_REACT_NATIVE_DEVICE="apns_react_native_device",u.APNS_REACT_NATIVE_VOIP="apns_react_native_voip",t.APIConstants={KEY_GROUP_PREFERENCES:"groupPreferences",KEY_GROUP_MESSAGES:"groupMessages",KEY_GROUP_REACTIONS:"groupReactions",KEY_GROUP_REPLIES:"groupReplies",KEY_GROUP_MEMBER_ADDED:"groupMemberAdded",KEY_GROUP_MEMBER_LEFT:"groupMemberLeft",KEY_GROUP_MEMBER_JOINED:"groupMemberJoined",KEY_GROUP_MEMBER_KICKED:"groupMemberKicked",KEY_GROUP_MEMBER_BANNED:"groupMemberBanned",KEY_GROUP_MEMBER_UNBANNED:"groupMemberUnbanned",KEY_GROUP_MEMBER_SCOPE_CHANGED:"groupMemberScopeChanged",KEY_MUTE_PREFERENCES:"mutePreferences",KEY_MUTE_DND:"dnd",KEY_MUTE_SCHEDULE:"schedule",KEY_ONE_ON_ONE_PREFERENCES:"oneOnOnePreferences",KEY_ONE_ON_ONE_MESSAGES:"oneOnOneMessages",KEY_ONE_ON_ONE_REACTIONS:"oneOnOneReactions",KEY_ONE_ON_ONE_REPLIES:"oneOnOneReplies",KEY_USE_PRIVACY_TEMPLATE:"usePrivacyTemplate",KEY_PROVIDER_ID:"providerId",KEY_TIMEZONE:"timezone",KEY_PLATFORM:"platform",KEY_FCM_TOKEN:"fcmToken",KEY_DEVICE_TOKEN:"deviceToken",KEY_VOIP_TOKEN:"voipToken",KEY_CONVERSATIONS:"conversations",KEY_GET_PREFERENCES:"getPushPreferences",KEY_UPDATE_PREFERENCES:"updatePushPreferences",KEY_RESET_PREFERENCES:"resetPushPreferences",KEY_REGISTER_TOKEN:"registerToken",KEY_UNREGISTER_TOKEN:"unregisterToken",KEY_MUTE_CONVERSATIONS:"muteConversations",KEY_UNMUTE_CONVERSATIONS:"unmuteConversations",KEY_GET_MUTED_CONVERSATIONS:"getMutedConversations",KEY_MUTED_CONVERSATIONS:"mutedConversations",KEY_FROM:"from",KEY_TO:"to",KEY_GET_TIMEZONE:"getTimezone",KEY_UPDATE_TIMEZONE:"updateTimezone"},t.APIResponseConstants={TOKEN_REGISTER_SUCCESS:"Push token registered successfully.",TOKEN_REGISTER_ERROR:"Failed to register push token.",TOKEN_UNREGISTER_SUCCESS:"Push token unregistered successfully.",TOKEN_UNREGISTER_ERROR:"Failed to unregister push token.",MUTE_CONVERSATION_SUCCESS:"Conversations muted successfully.",MUTE_CONVERSATION_ERROR:"Failed to mute conversations.",UNMUTE_CONVERSATION_SUCCESS:"Conversations unmuted successfully.",UNMUTE_CONVERSATION_ERROR:"Failed to unmute conversations.",TIMEZONE_UPDATE_SUCCESS:"Timezone updated successfully.",TIMEZONE_UPDATE_ERROR:"Failed to update Timezone.",TIMEZONE_FETCH_ERROR:"Failed to fetch Timezone."},t.DEFAULT_PROVIDER_ID="default"},function(e,t){e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.LocalStorage=void 0;var r=n(0),i=n(1),a=n(2),o=n(14),s=function(){function e(e){this.store=i.constants.DEFAULT_STORE,r.isFalsy(e)||(this.store=e);try{this.localStore=o.default}catch(e){r.Logger.error("store: constructor",{e:e})}}return e.getInstance=function(){return null==e.localStorage&&(e.localStorage=new e),e.localStorage},e.prototype.set=function(e,t){var n=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,e);return this.localStore.setItem(n,JSON.stringify(t))},e.prototype.get=function(e){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,e);return new Promise(function(n,t){try{o.localStore.getItem(s).then(function(t){try{n(JSON.parse(t))}catch(e){n(t)}},function(e){t(e)})}catch(e){t(new a.CometChatException(e))}})},e.prototype.clearStore=function(){var s=this;return new Promise(function(n,t){try{var o=[r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_USER),r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,i.LOCAL_STORE.KEY_APP_SETTINGS)];s.localStore.getAllKeys().then(function(e){if(0"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},addReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"POST"},removeReaction:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"DELETE"},getFilteredReactionsList:{endpoint:"messages/{{messageId}}/reactions/{{reaction}}",method:"GET",data:{}},getReactionsList:{endpoint:"messages/{{messageId}}/reactions",method:"GET",data:{}},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},markAsReadForUser:{endpoint:"users/{{uid}}/conversation/read",method:"POST"},markAsReadForGroup:{endpoint:"groups/{{guid}}/conversation/read",method:"POST"},markAsDeliveredForUser:{endpoint:"users/{{uid}}/conversation/delivered",method:"POST"},markAsDeliveredForGroup:{endpoint:"groups/{{guid}}/conversation/delivered",method:"POST"},markUserMessagesAsUnread:{endpoint:"users/{{uid}}/conversation/read",method:"DELETE"},markGroupMessagesAsUnread:{endpoint:"groups/{{guid}}/conversation/read",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"},getUserConversationStarter:{endpoint:"ai/conversation-starter/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationStarter:{endpoint:"ai/conversation-starter/groups/{{guid}}",method:"GET",isAIApi:!0},getUserSmartReply:{endpoint:"ai/smart-replies/users/{{uid}}",method:"GET",isAIApi:!0},getGroupSmartReply:{endpoint:"ai/smart-replies/groups/{{guid}}",method:"GET",isAIApi:!0},markInteracted:{endpoint:"messages/{{messageId}}/interacted",method:"PATCH"},getUserConversationSummary:{endpoint:"ai/conversation-summary/users/{{uid}}",method:"GET",isAIApi:!0},getGroupConversationSummary:{endpoint:"ai/conversation-summary/groups/{{guid}}",method:"GET",isAIApi:!0},getBotAssistanceInUserConversation:{endpoint:"ai/bots/{{botId}}/assistance/users/{{uid}}",method:"GET",isAIApi:!0},getBotAssistanceInGroupConversation:{endpoint:"ai/bots/{{botId}}/assistance/groups/{{guid}}",method:"GET",isAIApi:!0},getPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"GET"},updatePushPreferences:{endpoint:"notifications/push/v1/preferences",method:"PATCH"},resetPushPreferences:{endpoint:"notifications/push/v1/preferences",method:"DELETE"},registerToken:{endpoint:"notifications/push/v1/tokens",method:"POST"},unregisterToken:{endpoint:"notifications/push/v1/tokens",method:"DELETE"},muteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"PUT"},unmuteConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"DELETE"},getMutedConversations:{endpoint:"notifications/push/v1/preferences/mute",method:"GET"},updateTimezone:{endpoint:"notifications/v1/preferences/timezone",method:"PATCH"},getTimezone:{endpoint:"notifications/v1/preferences/timezone",method:"GET"}}}return a.prototype.getEndpointData=function(i){return new Promise(function(o,t){try{var s=p.CometChat.appSettings.getAdminHost(),r=p.CometChat.appSettings.getClientHost();u.LocalStorage.getInstance().get(c.LOCAL_STORE.KEY_APP_SETTINGS).then(function(e){if(E.isFalsy(e)){var t={};if((new a).uriEndpoints.hasOwnProperty(i))if((t=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi"))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+t.endpoint;t.endpoint=n,o(t)}else{n="https://"+s+"/"+t.endpoint;t.endpoint=n,o(t)}else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+t.endpoint;t.endpoint=n,o(t)}else{n="https://"+r+"/"+t.endpoint;t.endpoint=n,o(t)}}else{t={};if((new a).uriEndpoints.hasOwnProperty(i))if((t=(new a).uriEndpoints[i]).hasOwnProperty("isAdminApi")){n="https://"+e[c.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+e[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=n,o(t)}else{n="https://"+e[c.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+e[c.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+t.endpoint;t.endpoint=n,o(t)}}},function(e){var t;if((new a).uriEndpoints.hasOwnProperty(i))if((t=(new a).uriEndpoints[i]).hasOwnProperty(["isAdminApi"]))if(E.isFalsy(s)){var n=E.format((new a).adminApiUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+t.endpoint;t.endpoint=n,o(t)}else t.endpoint="https://"+s+"/"+t.endpoint,o(t);else if(E.isFalsy(r)){n=E.format((new a).baseUrl,p.CometChat.getAppId(),p.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+t.endpoint;t.endpoint=n,o(t)}else t.endpoint="https://"+r+"/"+t.endpoint,o(t)})}catch(e){t(new C.CometChatException(e))}})},a}();t.EndpointFactory=o},function(e,t,n){"use strict";t.__esModule=!0,t.getEndPoint=void 0;var o=n(37),i=n(2);t.getEndPoint=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=new o.EndpointFactory;return new Promise(function(o,s){try{t.getEndpointData(e).then(function(e){var t=e;if(t){for(var n in r)t.endpoint=t.endpoint.replace("{{"+n+"}}",r[n]);o(t)}else s({error:"Unknown endPoint name."})})}catch(e){s(new i.CometChatException(e))}})}},function(e,t,n){"use strict";t.__esModule=!0,t.MainVideoContainerSetting=t.CallSettingsBuilder=t.CallSettings=void 0;var o=n(1),s=n(0),r=function(){function e(e){this.sessionID=e.sessionID,this.defaultLayout=e.defaultLayout,this.isAudioOnly=e.isAudioOnly,this.region=e.region,this.domain=e.domain,this.user=e.user,this.listener=e.listener,this.mode=e.mode,this.ShowEndCallButton=e.ShowEndCallButton,this.ShowSwitchCameraButton=e.ShowSwitchCameraButton,this.ShowMuteAudioButton=e.ShowMuteAudioButton,this.ShowPauseVideoButton=e.ShowPauseVideoButton,this.ShowAudioModeButton=e.ShowAudioModeButton,this.StartAudioMuted=e.StartAudioMuted,this.StartVideoMuted=e.StartVideoMuted,this.analyticsSettings=e.analyticsSettings,this.appId=e.appId,this.defaultAudioMode=e.defaultAudioMode,this.ShowSwitchToVideoCallButton=e.ShowSwitchToVideoCallButton,this.AvatarMode=e.AvatarMode,this.ShowRecordingButton=e.ShowRecordingButton,this.StartRecordingOnCallStart=e.StartRecordingOnCallStart,this.MainVideoContainerSetting=e.MainVideoContainerSetting,this.EnableVideoTileClick=e.EnableVideoTileClick,this.enableDraggableVideoTile=e.enableDraggableVideoTile}return e.prototype.getSessionId=function(){return this.sessionID},e.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},e.prototype.getUser=function(){return this.user},e.prototype.getRegion=function(){return this.region},e.prototype.getAppId=function(){return this.appId},e.prototype.getDomain=function(){return this.domain},e.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},e.prototype.getCallEventListener=function(){return this.listener},e.prototype.getMode=function(){return this.mode},e.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},e.prototype.isSwitchCameraButtonEnabled=function(){return this.ShowSwitchCameraButton},e.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},e.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},e.prototype.isAudioModeButtonEnabled=function(){return this.ShowAudioModeButton},e.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},e.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},e.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},e.prototype.getDefaultAudioMode=function(){return this.defaultAudioMode},e.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},e.prototype.getAvatarMode=function(){return this.AvatarMode},e.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},e.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},e.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},e.prototype.isVideoTileClickEnabled=function(){return this.EnableVideoTileClick},e.prototype.isVideoTileDragEnabled=function(){return this.enableDraggableVideoTile},e.POSITION_TOP_LEFT="top-left",e.POSITION_TOP_RIGHT="top-right",e.POSITION_BOTTOM_LEFT="bottom-left",e.POSITION_BOTTOM_RIGHT="bottom-right",e.ASPECT_RATIO_DEFAULT="default",e.ASPECT_RATIO_CONTAIN="contain",e.ASPECT_RATIO_COVER="cover",e}();t.CallSettings=r;var i=function(){function e(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=o.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowSwitchCameraButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowAudioModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.analyticsSettings={},this.ShowSwitchToVideoCallButton=!0,this.AvatarMode="circle",this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.MainVideoContainerSetting=new a,this.EnableVideoTileClick=!0,this.enableDraggableVideoTile=!0}return e.prototype.setSessionID=function(e){return this.sessionID=e,this},e.prototype.enableDefaultLayout=function(e){return this.defaultLayout=e,this},e.prototype.setIsAudioOnlyCall=function(e){return this.isAudioOnly=e,this},e.prototype.setRegion=function(e){return this.region=e,this},e.prototype.setDomain=function(e){return this.domain=e,this},e.prototype.setUser=function(e){return this.user=e,this},e.prototype.setCallEventListener=function(e){return this.listener=e,this},e.prototype.setMode=function(e){return this.mode=e,this},e.prototype.showEndCallButton=function(e){return this.ShowEndCallButton=e,this},e.prototype.showSwitchCameraButton=function(e){return this.ShowSwitchCameraButton=e,this},e.prototype.showMuteAudioButton=function(e){return this.ShowMuteAudioButton=e,this},e.prototype.showPauseVideoButton=function(e){return this.ShowPauseVideoButton=e,this},e.prototype.showAudioModeButton=function(e){return this.ShowAudioModeButton=e,this},e.prototype.startWithAudioMuted=function(e){return this.StartAudioMuted=e,this},e.prototype.startWithVideoMuted=function(e){return this.StartVideoMuted=e,this},e.prototype.setAnalyticsSettings=function(e){return this.analyticsSettings=e,this},e.prototype.setAppId=function(e){return this.appId=e,this},e.prototype.setDefaultAudioMode=function(e){return this.defaultAudioMode=e,this},e.prototype.showSwitchToVideoCallButton=function(e){return this.ShowSwitchToVideoCallButton=e,this},e.prototype.setAvatarMode=function(e){return this.AvatarMode=e,this},e.prototype.showRecordingButton=function(e){return this.ShowRecordingButton=e,this},e.prototype.startRecordingOnCallStart=function(e){return this.StartRecordingOnCallStart=e,this},e.prototype.setMainVideoContainerSetting=function(e){return this.MainVideoContainerSetting=e,this},e.prototype.enableVideoTileClick=function(e){return this.EnableVideoTileClick=e,this},e.prototype.enableVideoTileDrag=function(e){return this.enableDraggableVideoTile=e,this},e.prototype.build=function(){return new r(this)},e}();t.CallSettingsBuilder=i;var a=function(){function e(){this.videoFit=r.ASPECT_RATIO_CONTAIN,this.zoomButton=o.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.fullScreenButton=o.CallConstants.FULL_SCREEN_BUTTON_DEFAULT_PARAMS,this.userListButton=o.CallConstants.USER_LIST_BUTTON_DEFAULT_PARAMS,this.nameLabel=o.CallConstants.NAME_LABEL_DEFAULT_PARAMS}return e.prototype.setMainVideoAspectRatio=function(e){this.videoFit=e},e.prototype.setFullScreenButtonParams=function(e,t){s.isFalsy(e)||(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),null!=t&&null!=t&&(this.fullScreenButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=t)},e.prototype.setNameLabelParams=function(e,t,n){s.isFalsy(e)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),null!=t&&null!=t&&(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=t),s.isFalsy(n)||(this.nameLabel[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=n)},e.prototype.setZoomButtonParams=function(e,t){s.isFalsy(e)||(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),null!=t&&null!=t&&(this.zoomButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=t)},e.prototype.setUserListButtonParams=function(e,t){s.isFalsy(e)||(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=e),null!=t&&null!=t&&(this.userListButton[o.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=t)},e}();t.MainVideoContainerSetting=a},function(e,t,n){"use strict";var o,s=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});t.__esModule=!0,t.CallingComponent=void 0;var i,a,E,c,u,p=n(54),C=n(17),S=n(6),l=n(3),_=n(1),T=n(16),d=n(55),h=n(0),R=n(5),r=function(t){function r(e){var r=t.call(this,e)||this;return r.state={shouldLoad:!1},a=e.callsettings,h.getCallSettings(a).then(function(e){var t=e.callSettingsNew,n=e.call,o=e.CallScreen,s=e.CometChatRTC;E=t,i=n,c=o,u=s,r.setState({shouldLoad:!0})}),r}return s(r,t),r.prototype.render=function(){return this.state.shouldLoad?p.createElement(C.View,{style:{flex:1,backgroundColor:"#000"}},p.createElement(c,{ref:function(e){return r.ref=e},style:{flex:1,backgroundColor:"#000"},callsettings:E,onCallEnded:function(){h.Logger.log("CallingComponent","oncallEnded")},onCallEndButtonPressed:function(){var e,t,n,o;i?(h.isFalsy(u)?(null===(e=null==r?void 0:r.ref)||void 0===e?void 0:e.endCall)&&(null===(t=null==r?void 0:r.ref)||void 0===t||t.endCall()):u.endCall(),setTimeout(function(){S.CometChat.endCall(a.getSessionId(),!0)},1e3)):(h.isFalsy(u)?(null===(n=null==r?void 0:r.ref)||void 0===n?void 0:n.endCall)&&(null===(o=null==r?void 0:r.ref)||void 0===o||o.endCall()):u.endCall(),T.CallController.getInstance().getCallListner()&&T.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null))},onUserJoined:function(e){if(e){var t=void 0;h.isFalsy(e.uid)||h.isFalsy(e.name)||((t=new l.User(e)).setStatus("online"),S.CometChat.user.getUid().toLowerCase()!=t.getUid().toLowerCase()&&T.CallController.getInstance().getCallListner()&&(h.isFalsy(T.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||T.CallController.getInstance().getCallListner()._eventListener.onUserJoined(t)))}},onUserLeft:function(e){if(e){var t=void 0;h.isFalsy(e.uid)||h.isFalsy(e.name)||((t=new l.User(e)).setStatus("online"),S.CometChat.user.getUid().toLowerCase()!=t.getUid().toLowerCase()&&T.CallController.getInstance().getCallListner()&&(h.isFalsy(T.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||T.CallController.getInstance().getCallListner()._eventListener.onUserLeft(t)))}},onUserListChanged:function(e){var n=[];e&&0=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function S(e,t){if(p.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return w(e).length;default:if(o)return G(e).length;t=(""+t).toLowerCase(),o=!0}}function l(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function _(e,t,n,o,s){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):2147483647=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=p.from(t,o)),p.isBuffer(t))return 0===t.length?-1:T(e,t,n,o,s);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,o,s);throw new TypeError("val must be string, number or Buffer")}function T(e,t,n,o,s){var r,i=1,a=e.length,E=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;a/=i=2,E/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(s){var u=-1;for(r=n;r>>10&1023|55296),u=56320|1023&u),o.push(u),s+=p}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var n="",o=0;for(;othis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return g(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return f(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}.apply(this,arguments)},p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===p.compare(this,e)},p.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},p.prototype.compare=function(e,t,n,o,s){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===s&&(s=this.length),t<0||n>e.length||o<0||s>this.length)throw new RangeError("out of range index");if(s<=o&&n<=t)return 0;if(s<=o)return-1;if(n<=t)return 1;if(this===e)return 0;for(var r=(s>>>=0)-(o>>>=0),i=(n>>>=0)-(t>>>=0),a=Math.min(r,i),E=this.slice(o,s),c=e.slice(t,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var r,i,a,E,c,u,p,C,S,l=!1;;)switch(o){case"hex":return d(this,e,t,n);case"utf8":case"utf-8":return C=t,S=n,K(G(e,(p=this).length-C),p,C,S);case"ascii":return h(this,e,t,n);case"latin1":case"binary":return h(this,e,t,n);case"base64":return E=this,c=t,u=n,K(w(e),E,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i=t,a=n,K(function(e,t){for(var n,o,s,r=[],i=0;i>8,s=n%256,r.push(s),r.push(o);return r}(e,(r=this).length-i),r,i,a);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function I(e,t,n){var o="";n=Math.min(e.length,n);for(var s=t;se.length)throw new RangeError("Index out of range")}function y(e,t,n,o){t<0&&(t=65535+t+1);for(var s=0,r=Math.min(e.length-n,2);s>>8*(o?s:1-s)}function M(e,t,n,o){t<0&&(t=4294967295+t+1);for(var s=0,r=Math.min(e.length-n,4);s>>8*(o?s:3-s)&255}function v(e,t,n,o,s,r){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,o,s){return s||v(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function U(e,t,n,o,s){return s||v(e,0,n,8),r.write(e,t,n,o,52,8),n+8}p.prototype.slice=function(e,t){var n,o=this.length;if((e=~~e)<0?(e+=o)<0&&(e=0):o>>8):y(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,n,o){if(e=+e,t|=0,!o){var s=Math.pow(2,8*n-1);P(this,e,t,n,s-1,-s)}var r=0,i=1,a=0;for(this[t]=255&e;++r>0)-a&255;return t+n},p.prototype.writeIntBE=function(e,t,n,o){if(e=+e,t|=0,!o){var s=Math.pow(2,8*n-1);P(this,e,t,n,s-1,-s)}var r=n-1,i=1,a=0;for(this[t+r]=255&e;0<=--r&&(i*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/i>>0)-a&255;return t+n},p.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},p.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},p.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},p.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},p.prototype.copy=function(e,t,n,o){if(n||(n=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function w(e){return o.toByteArray(function(e){var t;if((e=(t=e,t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,o){for(var s=0;s=t.length||s>=e.length);++s)t[s+n]=e[s];return s}}).call(this,t(19))},function(e,t,n){"use strict";t.__esModule=!0,t.DaySchedule=void 0;var o=function(){function e(e,t,n){this.from=e,this.to=t,this.dnd=n}return e.prototype.getFrom=function(){return this.from},e.prototype.setFrom=function(e){this.from=e},e.prototype.getTo=function(){return this.to},e.prototype.setTo=function(e){this.to=e},e.prototype.getDND=function(){return this.dnd},e.prototype.setDND=function(e){this.dnd=e},e}();t.DaySchedule=o},function(e,t,n){"use strict";t.__esModule=!0,t.CometChatNotifications=t.CometChat=t.init=void 0;var o=n(6),s=n(87);t.init=function(e){return o.CometChat.getInstance(e)},t.CometChat=o.CometChat,t.CometChatNotifications=s.CometChatNotifications},function(e,t,n){"use strict";t.__esModule=!0,t.RTCUser=void 0;var o=n(0),s=function(){function e(e){this.avatar="",o.isFalsy(e)||(this.uid=e.toString())}return e.prototype.setUID=function(e){this.uid=e?e.toString():""},e.prototype.getUID=function(){return this.uid.toString()},e.prototype.setName=function(e){this.name=e?e.toString():""},e.prototype.getName=function(){return this.name.toString()},e.prototype.setAvatar=function(e){this.avatar=e?e.toString():""},e.prototype.getAvatar=function(){return this.avatar.toString()},e.prototype.setJWT=function(e){this.jwt=e?e.toString():""},e.prototype.getJWT=function(){return this.jwt.toString()},e.prototype.setResource=function(e){this.resource=e?e.toString():""},e.prototype.getResource=function(){return this.resource.toString()},e}();t.RTCUser=s},function(e,t){e.exports=s},function(e,t,n){"use strict";t.__esModule=!0,t.AudioMode=void 0;var o=n(0),s=function(){function e(e,t){this.isSelected=!1,this.mode="",o.isFalsy(e)||(this.mode=e.toString()),this.isSelected=t||!1}return e.prototype.setMode=function(e){this.mode=e?e.toString():""},e.prototype.getMode=function(){return this.mode.toString()},e.prototype.setIsSelected=function(e){this.isSelected=e||!1},e.prototype.getIsSelected=function(){return this.isSelected},e}();t.AudioMode=s},function(e,t,n){"use strict";t.__esModule=!0,t.GroupsRequestBuilder=t.GroupsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(18),a=n(1),E=function(){function e(e){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(e)||(o.isFalsy(e.limit)||(this.limit=e.limit),o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.hasJoined)||(this.hasJoined=1),o.isFalsy(e.tags)||(this.tags=e.tags),o.isFalsy(e.showTags)||(this.withTags=e.showTags))}return e.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=100,e.DEFAULT_LIMIT=30,e}();t.GroupsRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.joinedOnly=function(e){return this.hasJoined=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.build=function(){return new E(this)},e}();t.GroupsRequestBuilder=c},function(e,t,n){"use strict";t.__esModule=!0,t.GroupMembersRequestBuilder=t.GroupMembersRequest=void 0;var s=n(5),o=n(0),r=n(15),i=n(2),a=n(42),E=n(1),c=function(){function e(e){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=r.LocalStorage.getInstance(),o.isFalsy(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.GroupMembersRequest=c;var u=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new c(this)},e}();t.GroupMembersRequestBuilder=u},function(e,t,n){"use strict";t.__esModule=!0,t.BannedMembersRequestBuilder=t.BannedMembersRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(42),a=n(1),E=function(){function e(e){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(e)||(this.limit=e.limit,this.guid=e.guid,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>a.DEFAULT_VALUES.USERS_MAX_LIMIT)return new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e}();t.BannedMembersRequest=E;var c=function(){function e(e){this.guid=e}return e.prototype.setGuid=function(e){return this.guid=e,this},e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setScopes=function(e){return this.scopes=e,this},e.prototype.build=function(){return new E(this)},e}();t.BannedMembersRequestBuilder=c},function(e,t,n){"use strict";t.__esModule=!0,t.UsersRequestBuilder=t.UsersRequest=void 0;var s=n(5),o=n(0),r=n(12),i=n(2),a=n(60),E=n(1),c=function(){function t(e){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},t.userStore=a.UserStore.getInstance(),o.isFalsy(e)||(this.limit=e.limit,o.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),o.isFalsy(e.status)||(e.status==t.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=e.status),o.isFalsy(e.shouldHideBlockedUsers)||(this.hideBlockedUsers=e.shouldHideBlockedUsers),o.isFalsy(e.showFriendsOnly)||(this.friendsOnly=e.showFriendsOnly),o.isFalsy(e.showTags)||(this.withTags=e.showTags),o.isFalsy(e.role)||(this.role=e.role),o.isFalsy(e.roles)||(this.roles=e.roles),o.isFalsy(e.tags)||(this.tags=e.tags),o.isFalsy(e.UIDs)||(this.UIDs=e.UIDs),o.isFalsy(e.SortBy)||(this.sortBy=e.SortBy),o.isFalsy(e.SearchIn)||(this.searchIn=e.SearchIn),o.isFalsy(e.SortOrder)||(this.sortOrder=e.SortOrder))}return t.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>E.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},t.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},t}();t.UsersRequest=c;var u=function(){function e(){this.shouldHideBlockedUsers=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.hideBlockedUsers=function(e){return this.shouldHideBlockedUsers=e,this},e.prototype.setRole=function(e){return this.role=e,this},e.prototype.setRoles=function(e){return this.roles=e,this},e.prototype.friendsOnly=function(e){return this.showFriendsOnly=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.showTags=e,this},e.prototype.setUIDs=function(e){return this.UIDs=e,this},e.prototype.sortBy=function(e){return this.SortBy=e,this},e.prototype.sortByOrder=function(e){return this.SortOrder=e,this},e.prototype.searchIn=function(e){return this.SearchIn=e,this},e.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},e}();t.UsersRequestBuilder=u},function(e,t,n){"use strict";t.__esModule=!0,t.UserStore=void 0;var r=n(0),i=n(1),a=n(2),o=n(14),s=function(){function e(e){this.store=i.constants.DEFAULT_STORE,r.isFalsy(e)||(this.store=e);try{this.userStore=o.default}catch(e){r.Logger.error("UserStore: constructor",{e:e})}}return e.getInstance=function(){return null==e.UserStore&&(e.UserStore=new e),e.UserStore},e.prototype.set=function(e,t){var n=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,e);return this.userStore.setItem(n,JSON.stringify(t))},e.prototype.get=function(e){var o=this,s=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,e);return new Promise(function(n,t){try{o.userStore.getItem(s).then(function(t){try{n(JSON.parse(t))}catch(e){n(t)}},function(e){t(e)})}catch(e){t(new a.CometChatException(e))}})},e.prototype.clear=function(e){},e.prototype.selectStore=function(e){this.store=e},e.prototype.storeUsers=function(e){var t=this;return e.map(function(e){t.set(e.getUid(),e)}),!0},e.prototype.storeUser=function(e){return this.set(e.getUid(),e),!0},e}();t.UserStore=s},function(e,t,n){"use strict";t.__esModule=!0,t.ConversationsRequestBuilder=t.ConversationsRequest=void 0;var s=n(5),o=n(0),r=n(2),i=n(32),a=n(1),E=function(){function e(e){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},o.isFalsy(e)||(this.limit=e.limit,o.isFalsy(e.conversationType)||(this.conversationType=e.conversationType)),o.isFalsy(e.getUserAndGroupTags)||(this.getUserAndGroupTags=e.getUserAndGroupTags),e.tags&&(this.tags=e.tags),o.isFalsy(e.WithTags)||(this.withTags=e.WithTags),e.groupTags&&(this.groupTags=e.groupTags),e.userTags&&(this.userTags=e.userTags),e.IncludeBlockedUsers&&(this.includeBlockedUsers=e.IncludeBlockedUsers),e.WithBlockedInfo&&(this.withBlockedInfo=e.WithBlockedInfo)}return e.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new r.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},e.prototype.isIncludeBlockedUsers=function(){return this.includeBlockedUsers},e.prototype.isWithBlockedInfo=function(){return this.withBlockedInfo},e.prototype.getLimit=function(){return this.limit},e.prototype.getConversationType=function(){return this.conversationType},e.prototype.isWithUserAndGroupTags=function(){return this.getUserAndGroupTags},e.prototype.getTags=function(){return this.tags},e.prototype.isWithTags=function(){return this.withTags},e.prototype.getGroupTags=function(){return this.groupTags},e.prototype.getUserTags=function(){return this.userTags},e}();t.ConversationsRequest=E;var c=function(){function e(){this.WithTags=!1,this.IncludeBlockedUsers=!1,this.WithBlockedInfo=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setConversationType=function(e){return this.conversationType=e,this},e.prototype.withUserAndGroupTags=function(e){return"boolean"==typeof e&&(this.getUserAndGroupTags=e),this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.setGroupTags=function(e){return this.groupTags=e,this},e.prototype.setUserTags=function(e){return this.userTags=e,this},e.prototype.setIncludeBlockedUsers=function(e){return this.IncludeBlockedUsers=e,this},e.prototype.includeBlockedUsers=function(e){return this.IncludeBlockedUsers=e,this},e.prototype.setWithBlockedInfo=function(e){return this.WithBlockedInfo=e,this},e.prototype.withBlockedInfo=function(e){return this.WithBlockedInfo=e,this},e.prototype.build=function(){return new E(this)},e}();t.ConversationsRequestBuilder=c},function(e,t,n){"use strict";var I=this&&this.__awaiter||function(e,i,a,E){return new(a||(a=Promise))(function(n,t){function o(e){try{r(E.next(e))}catch(e){t(e)}}function s(e){try{r(E.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(o,s)}r((E=E.apply(e,i||[])).next())})},f=this&&this.__generator||function(n,o){var s,r,i,e,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(s)throw new TypeError("Generator is already executing.");for(;a;)try{if(s=1,r&&(i=2&t[0]?r.return:t[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,t[1])).done)return i;switch(r=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,r=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]y.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void t(new O.CometChatException(JSON.parse(P.format(JSON.stringify(y.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",y.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(ae&&M.MessageListnerMaping.getInstance().set(y.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))},function(e){M.MessageListnerMaping.getInstance().set(y.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))}),this.affix==y.MessageConstatnts.PAGINATION.AFFIX.APPEND?(this.idparseInt(t.id)&&(this.id=parseInt(t.id)),this.timestamp>t.sentAt&&(this.timestamp=t.sentAt),this.updatedAt>t.updatedAt&&(this.updatedAt=t.updatedAt)),this.id&&(this.paginationMeta[y.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.timestamp&&(this.paginationMeta[y.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.updatedAt&&(this.paginationMeta[y.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),n.push(m.MessageController.trasformJSONMessge(t)),[2]})})})):n=[],s(n),[2]})})},function(e){t(new O.CometChatException(e.error))})}catch(e){t(new O.CometChatException(e))}})},e.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[y.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(P.isFalsy(this.guid)||P.isFalsy(this.uid))&&P.isFalsy(this.guid)?(P.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},e.prototype.makeData=function(){var e={};e[y.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,e[y.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(P.isFalsy(this.guid)||P.isFalsy(this.uid))&&P.isFalsy(this.guid)&&P.isFalsy(this.uid)},e.prototype.getFilteredPreviousDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e.prototype.getFilteredNextDataByReceiverId=function(t){return I(this,void 0,void 0,function(){var n,o=this;return f(this,function(e){switch(e.label){case 0:switch(n=[],t){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 2:return e.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 4:e.sent(),e.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).filter(function(e){return t[e].sender.uid==o.uid}).map(function(e){n=s(n,[t[e]])})})];case 6:return e.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(t){Object.keys(t).filter(function(e){return parseInt(e)>o.id}).map(function(e){n=s(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e}();t.MessagesRequest=o;var a=function(){function e(){this.maxLimit=y.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=y.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1,this.mentionsWithTagInfoFlag=!1,this.mentionsWithBlockedInfoFlag=!1,this.interactionGoalCompletedOnly=!1}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setGUID=function(e){return this.guid=e,this},e.prototype.setUID=function(e){return this.uid=e,this},e.prototype.setParentMessageId=function(e){return this.parentMessageId=e,this},e.prototype.setTimestamp=function(e){return void 0===e&&(e=P.getCurrentTime()),this.timestamp=e,this},e.prototype.setMessageId=function(e){return void 0===e&&(e=y.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=e,this},e.prototype.setUnread=function(e){return void 0===e&&(e=!1),this.unread=e,this},e.prototype.hideMessagesFromBlockedUsers=function(e){return void 0===e&&(e=!1),this.HideMessagesFromBlockedUsers=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKey=e,this},e.prototype.setUpdatedAfter=function(e){return this.updatedAt=e,this},e.prototype.updatesOnly=function(e){return e&&(this.onlyUpdate=1),this},e.prototype.setCategory=function(e){return this.category=e,this},e.prototype.setCategories=function(e){return this.categories=e,this},e.prototype.setType=function(e){return this.type=e,this},e.prototype.setTypes=function(e){return this.types=e,this},e.prototype.hideReplies=function(e){return this.HideReplies=e,this},e.prototype.hideDeletedMessages=function(e){return this.HideDeletedMessages=e,this},e.prototype.setTags=function(e){return this.tags=e,this},e.prototype.withTags=function(e){return this.WithTags=e,this},e.prototype.mentionsWithTagInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithTagInfoFlag=e,this},e.prototype.mentionsWithBlockedInfo=function(e){return void 0===e&&(e=!1),this.mentionsWithBlockedInfoFlag=e,this},e.prototype.setInteractionGoalCompletedOnly=function(e){return void 0===e&&(e=!1),this.interactionGoalCompletedOnly=e,this},e.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new o(this)},e}();t.MessagesRequestBuilder=a},function(e,t,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne.getId()&&(i=parseInt(e.getId().toString())),oa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(o.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return e.page=this.next_page,e;e.page=this.next_page++}return e},e.MAX_LIMIT=2,e.DEFAULT_LIMIT=1,e.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,e}();t.BlockedUsersRequest=E;var c=function(){function e(){}return e.prototype.setLimit=function(e){return this.limit=e,this},e.prototype.setSearchKeyword=function(e){return this.searchKeyword=e,this},e.prototype.setDirection=function(e){return this.direction=e,this},e.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},e.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},e.prototype.build=function(){return new E(this)},e}();t.BlockedUsersRequestBuilder=c},function(e,t,n){"use strict";t.__esModule=!0,t.AppSettingsBuilder=t.AppSettings=void 0;var o=n(1),s=function(){function t(e){this.subscriptionType=t.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=e.subscriptionType,this.roles=e.roles,this.region=e.region,this.autoJoinGroup=e.autoJoinGroup,this.establishSocketConnection=e.establishSocketConnection,this.adminHost=e.adminHost,this.clientHost=e.clientHost}return t.prototype.getSubscriptionType=function(){return this.subscriptionType},t.prototype.getRoles=function(){return this.roles},t.prototype.getRegion=function(){return this.region},t.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},t.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},t.prototype.getAdminHost=function(){return this.adminHost},t.prototype.getClientHost=function(){return this.clientHost},t.SUBSCRIPTION_TYPE_NONE="NONE",t.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",t.SUBSCRIPTION_TYPE_ROLES="ROLES",t.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",t.REGION_EU=o.DEFAULT_VALUES.REGION_DEFAULT_EU,t.REGION_US=o.DEFAULT_VALUES.REGION_DEFAULT_US,t.REGION_IN=o.DEFAULT_VALUES.REGION_DEFAULT_IN,t.REGION_PRIVATE=o.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,t}();t.AppSettings=s;var r=function(){function e(){this.subscriptionType=s.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=o.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return e.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ALL_USERS,this},e.prototype.subscribePresenceForRoles=function(e){return this.subscriptionType=s.SUBSCRIPTION_TYPE_ROLES,this.roles=e,this},e.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=s.SUBSCRIPTION_TYPE_FRIENDS,this},e.prototype.setRegion=function(e){return void 0===e&&(e=o.DEFAULT_VALUES.REGION_DEFAULT),this.region=e.toLowerCase(),this},e.prototype.enableAutoJoinForGroups=function(e){return void 0===e&&(e=!0),this.autoJoinGroup=e,this},e.prototype.autoEstablishSocketConnection=function(e){return void 0===e&&(e=!0),this.establishSocketConnection=e,this},e.prototype.overrideAdminHost=function(e){return this.adminHost=e,this},e.prototype.overrideClientHost=function(e){return this.clientHost=e,this},e.prototype.build=function(){return new s(this)},e}();t.AppSettingsBuilder=r},function(e,t,n){"use strict";var p=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;ti[0]&&t[1]>16&255,r[i++]=t>>8&255,r[i++]=255&t;var c,u;2===s&&(t=p[e.charCodeAt(E)]<<2|p[e.charCodeAt(E+1)]>>4,r[i++]=255&t);1===s&&(t=p[e.charCodeAt(E)]<<10|p[e.charCodeAt(E+1)]<<4|p[e.charCodeAt(E+2)]>>2,r[i++]=t>>8&255,r[i++]=255&t);return r},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,s=[],r=0,i=n-o;r>2]+a[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],s.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return s.join("")};for(var a=[],p=[],C="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,r=o.length;s>18&63]+a[s>>12&63]+a[s>>6&63]+a[63&s]);return r.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,o,s){var r,i,a=8*s-o-1,E=(1<>1,u=-7,p=n?s-1:0,C=n?-1:1,S=e[t+p];for(p+=C,r=S&(1<<-u)-1,S>>=-u,u+=a;0>=-u,u+=o;0>1,C=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,S=o?0:r-1,l=o?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(E=Math.pow(2,-i))<1&&(i--,E*=2),2<=(t+=1<=i+p?C/E:C*Math.pow(2,1-p))*E&&(i++,E/=2),u<=i+p?(a=0,i=u):1<=i+p?(a=(t*E-1)*Math.pow(2,s),i+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,s),i=0));8<=s;e[n+S]=255&a,S+=l,a/=256,s-=8);for(i=i<i[0]&&t[1]i[0]&&t[1]S.DEFAULT_VALUES.REACTIONS_MAX_LIMIT)return void t(new p.CometChatException(JSON.parse(C.format(JSON.stringify(S.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",S.DEFAULT_VALUES.REACTIONS_MAX_LIMIT))));if(e>>((3&t)<<3)&255;return s}}},function(e,t){for(var s=[],n=0;n<256;++n)s[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,o=s;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},function(e,t,n){"use strict";t.__esModule=!0,t.CometChatNotifications=void 0;var u=n(1),p=n(0),C=n(2),S=n(5),l=n(13),o=n(51),_=n(88),s=n(89),T=n(90),d=n(91),h=n(92),R=n(93),r=n(94),i=function(){function E(){}return E.fetchPushPreferences=function(){return new Promise(function(i,t){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,{},null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=R.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new R.PushPreferences)},function(e){return t(new C.CometChatException(e.error))})},function(e){return t(new C.CometChatException(e))})}catch(e){return t(new C.CometChatException(e))}})},E.fetchPreferences=function(){return new Promise(function(i,t){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_GET_PREFERENCES,{},null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=d.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new d.NotificationPreferences)},function(e){return t(new C.CometChatException(e.error))})},function(e){return t(new C.CometChatException(e))})}catch(e){return t(new C.CometChatException(e))}})},E.updatePushPreferences=function(c){return new Promise(function(a,E){try{p.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},t[l.APIConstants.KEY_MUTE_PREFERENCES]={},t[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},t),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],S.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,{},n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=R.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new R.PushPreferences)},function(e){return E(new C.CometChatException(e.error))})},function(e){return E(new C.CometChatException(e))})}catch(e){return E(new C.CometChatException(e))}})},E.updatePreferences=function(c){return new Promise(function(a,E){try{p.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_GROUP_PREFERENCES]={},t[l.APIConstants.KEY_MUTE_PREFERENCES]={},t[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]={},t),o=c.getGroupPreferences(),s=c.getMutePreferences(),r=c.getOneOnOnePreferences(),i=c.getUsePrivacyTemplate();o&&(o.getMessagesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MESSAGES]=o.getMessagesPreference()),o.getReactionsPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REACTIONS]=o.getReactionsPreference()),o.getRepliesPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_REPLIES]=o.getRepliesPreference()),o.getMemberAddedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_ADDED]=o.getMemberAddedPreference()),o.getMemberBannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_BANNED]=o.getMemberBannedPreference()),o.getMemberJoinedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_JOINED]=o.getMemberJoinedPreference()),o.getMemberKickedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_KICKED]=o.getMemberKickedPreference()),o.getMemberLeftPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_LEFT]=o.getMemberLeftPreference()),o.getMemberScopeChangedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]=o.getMemberScopeChangedPreference()),o.getMemberUnbannedPreference()&&(n[l.APIConstants.KEY_GROUP_PREFERENCES][l.APIConstants.KEY_GROUP_MEMBER_UNBANNED]=o.getMemberUnbannedPreference())),s&&(s.getDNDPreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_DND]=s.getDNDPreference()),s.getSchedulePreference()&&(n[l.APIConstants.KEY_MUTE_PREFERENCES][l.APIConstants.KEY_MUTE_SCHEDULE]=s.getSchedulePreference())),r&&(r.getMessagesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_MESSAGES]=r.getMessagesPreference()),r.getReactionsPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REACTIONS]=r.getReactionsPreference()),r.getRepliesPreference()&&(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][l.APIConstants.KEY_ONE_ON_ONE_REPLIES]=r.getRepliesPreference())),null!=i&&(n[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE]=i),0===Object.keys(n[l.APIConstants.KEY_GROUP_PREFERENCES]).length&&delete n[l.APIConstants.KEY_GROUP_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_MUTE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_MUTE_PREFERENCES],0===Object.keys(n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]).length&&delete n[l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES],S.makeApiCall(l.APIConstants.KEY_UPDATE_PREFERENCES,{},n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=d.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return a(r)}return a(new d.NotificationPreferences)},function(e){return E(new C.CometChatException(e.error))})},function(e){return E(new C.CometChatException(e))})}catch(e){return E(new C.CometChatException(e))}})},E.resetPushPreferences=function(){return new Promise(function(i,t){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,{},null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=R.PushPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new R.PushPreferences)},function(e){return t(new C.CometChatException(e.error))})},function(e){return t(new C.CometChatException(e))})}catch(e){return t(new C.CometChatException(e))}})},E.resetPreferences=function(){return new Promise(function(i,t){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_RESET_PREFERENCES,{},null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){if(e.data){var t=void 0,n=void 0,o=void 0,s=void 0;t=e.data.hasOwnProperty(l.APIConstants.KEY_GROUP_PREFERENCES)?_.GroupPreferences.fromJSON(e.data):new _.GroupPreferences,n=e.data.hasOwnProperty(l.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)?h.OneOnOnePreferences.fromJSON(e.data):new h.OneOnOnePreferences,o=e.data.hasOwnProperty(l.APIConstants.KEY_MUTE_PREFERENCES)?T.MutePreferences.fromJSON(e.data):new T.MutePreferences,s=!!e.data.hasOwnProperty(l.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&e.data[l.APIConstants.KEY_USE_PRIVACY_TEMPLATE];var r=d.NotificationPreferences.fromJSON({groupPreferences:t,oneOnOnePreferences:n,mutePreferences:o,usePrivacyTemplate:s});return i(r)}return i(new d.NotificationPreferences)},function(e){return t(new C.CometChatException(e.error))})},function(e){return t(new C.CometChatException(e))})}catch(e){return t(new C.CometChatException(e))}})},E.getTokensForRequest=function(e,t,n,o){var s={};return s[l.APIConstants.KEY_PROVIDER_ID]=null!=o?o:l.DEFAULT_PROVIDER_ID,s[l.APIConstants.KEY_TIMEZONE]=e,n===l.PushPlatforms.FCM_REACT_NATIVE_ANDROID&&(s[l.APIConstants.KEY_FCM_TOKEN]=t),n===l.PushPlatforms.FCM_REACT_NATIVE_IOS&&(s[l.APIConstants.KEY_FCM_TOKEN]=t),n===l.PushPlatforms.APNS_REACT_NATIVE_DEVICE&&(s[l.APIConstants.KEY_DEVICE_TOKEN]=t),n===l.PushPlatforms.APNS_REACT_NATIVE_VOIP&&(s[l.APIConstants.KEY_VOIP_TOKEN]=t),s[l.APIConstants.KEY_PLATFORM]=n,s},E.registerPushToken=function(r,i,a){return new Promise(function(o,s){try{p.getAppSettings().then(function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=E.getTokensForRequest(t,r,i,a);S.makeApiCall(l.APIConstants.KEY_REGISTER_TOKEN,{},n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.TOKEN_REGISTER_SUCCESS):o(l.APIResponseConstants.TOKEN_REGISTER_ERROR)},function(e){return s(new C.CometChatException(e.error))})},function(e){return s(new C.CometChatException(e))})}catch(e){return s(new C.CometChatException(e))}})},E.unregisterPushToken=function(){return new Promise(function(t,n){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_UNREGISTER_TOKEN,{},null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(l.APIResponseConstants.TOKEN_UNREGISTER_SUCCESS):t(l.APIResponseConstants.TOKEN_UNREGISTER_ERROR)},function(e){return n(new C.CometChatException(e.error))})},function(e){return n(new C.CometChatException(e))})}catch(e){return n(new C.CometChatException(e))}})},E.muteConversations=function(r){return new Promise(function(o,s){try{p.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);S.makeApiCall(l.APIConstants.KEY_MUTE_CONVERSATIONS,{},n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.MUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.MUTE_CONVERSATION_ERROR)},function(e){return s(new C.CometChatException(e.error))})},function(e){return s(new C.CometChatException(e))})}catch(e){return s(new C.CometChatException(e))}})},E.unmuteConversations=function(r){return new Promise(function(o,s){try{p.getAppSettings().then(function(e){var t,n=((t={})[l.APIConstants.KEY_CONVERSATIONS]=r,t);S.makeApiCall(l.APIConstants.KEY_UNMUTE_CONVERSATIONS,{},n,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?o(l.APIResponseConstants.UNMUTE_CONVERSATION_SUCCESS):o(l.APIResponseConstants.UNMUTE_CONVERSATION_ERROR)},function(e){return s(new C.CometChatException(e.error))})},function(e){return s(new C.CometChatException(e))})}catch(e){return s(new C.CometChatException(e))}})},E.getMutedConversations=function(){return new Promise(function(t,n){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_GET_MUTED_CONVERSATIONS,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){var n=[];return e.hasOwnProperty("data")&&e.data.hasOwnProperty(l.APIConstants.KEY_MUTED_CONVERSATIONS)&&e.data[l.APIConstants.KEY_MUTED_CONVERSATIONS].forEach(function(e){var t=new s.MutedConversation;t.setId(e.id),t.setType(e.type),t.setUntil(e.until),n.push(t)}),t(n)},function(e){return n(new C.CometChatException(e.error))})},function(e){return n(new C.CometChatException(e))})}catch(e){return n(new C.CometChatException(e))}})},E.updateTimezone=function(o){return new Promise(function(t,n){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_UPDATE_TIMEZONE,null,{timezone:o},!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(l.APIResponseConstants.TIMEZONE_UPDATE_SUCCESS):t(l.APIResponseConstants.TIMEZONE_UPDATE_ERROR)},function(e){return n(new C.CometChatException(e.error))})},function(e){return n(new C.CometChatException(e))})}catch(e){return n(new C.CometChatException(e))}})},E.getTimezone=function(){return new Promise(function(t,n){try{p.getAppSettings().then(function(e){S.makeApiCall(l.APIConstants.KEY_GET_TIMEZONE,null,null,!1,{chatApiVersion:e[u.APP_SETTINGS.KEYS.CHAT_API_VERSION]}).then(function(e){return e.data&&e.data.success?t(e.data):t(l.APIResponseConstants.TIMEZONE_FETCH_ERROR)},function(e){return n(new C.CometChatException(e.error))})},function(e){return n(new C.CometChatException(e))})}catch(e){return n(new C.CometChatException(e))}})},E.MessagesOptions=l.MessagesOptions,E.RepliesOptions=l.RepliesOptions,E.ReactionsOptions=l.ReactionsOptions,E.MemberActionsOptions=l.MemberActionsOptions,E.DayOfWeek=l.DayOfWeek,E.DNDOptions=l.DNDOptions,E.MutedConversationType=l.MutedConversationType,E.PushPlatforms=l.PushPlatforms,E.DaySchedule=o.DaySchedule,E.PushPreferences=R.PushPreferences,E.GroupPreferences=_.GroupPreferences,E.OneOnOnePreferences=h.OneOnOnePreferences,E.MutePreferences=T.MutePreferences,E.MutedConversation=s.MutedConversation,E.UnmutedConversation=r.UnmutedConversation,E.NotificationPreferences=d.NotificationPreferences,E}();t.CometChatNotifications=i},function(e,t,n){"use strict";t.__esModule=!0,t.GroupPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getMessagesPreference=function(){return this.groupMessages},n.prototype.getRepliesPreference=function(){return this.groupReplies},n.prototype.getReactionsPreference=function(){return this.groupReactions},n.prototype.getMemberLeftPreference=function(){return this.groupMemberLeft},n.prototype.getMemberAddedPreference=function(){return this.groupMemberAdded},n.prototype.getMemberJoinedPreference=function(){return this.groupMemberJoined},n.prototype.getMemberKickedPreference=function(){return this.groupMemberKicked},n.prototype.getMemberBannedPreference=function(){return this.groupMemberBanned},n.prototype.getMemberUnbannedPreference=function(){return this.groupMemberUnbanned},n.prototype.getMemberScopeChangedPreference=function(){return this.groupMemberScopeChanged},n.prototype.setMessagesPreference=function(e){this.groupMessages=e},n.prototype.setRepliesPreference=function(e){this.groupReplies=e},n.prototype.setReactionsPreference=function(e){this.groupReactions=e},n.prototype.setMemberLeftPreference=function(e){this.groupMemberLeft=e},n.prototype.setMemberAddedPreference=function(e){this.groupMemberAdded=e},n.prototype.setMemberJoinedPreference=function(e){this.groupMemberJoined=e},n.prototype.setMemberKickedPreference=function(e){this.groupMemberKicked=e},n.prototype.setMemberBannedPreference=function(e){this.groupMemberBanned=e},n.prototype.setMemberUnbannedPreference=function(e){this.groupMemberUnbanned=e},n.prototype.setMemberScopeChangedPreference=function(e){this.groupMemberScopeChanged=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_REACTIONS]]),t.setMemberAddedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_ADDED]]),t.setMemberJoinedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_JOINED]]),t.setMemberBannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_BANNED]]),t.setMemberKickedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_KICKED]]),t.setMemberLeftPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_LEFT]]),t.setMemberScopeChangedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_SCOPE_CHANGED]]),t.setMemberUnbannedPreference(o.MemberActionsOptions[e[o.APIConstants.KEY_GROUP_PREFERENCES][o.APIConstants.KEY_GROUP_MEMBER_UNBANNED]]),t},n}();t.GroupPreferences=s},function(e,t,n){"use strict";t.__esModule=!0,t.MutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e.prototype.getUntil=function(){return this.until},e.prototype.setUntil=function(e){this.until=e},e}();t.MutedConversation=o},function(e,t,n){"use strict";t.__esModule=!0,t.MutePreferences=void 0;var p=n(13),C=n(51),o=function(){function u(){}return u.prototype.getDNDPreference=function(){return this.dnd},u.prototype.setDNDPreference=function(e){this.dnd=e},u.prototype.getSchedulePreference=function(){return this.schedule},u.prototype.setSchedulePreference=function(e){this.schedule=e},u.prototype.getScheduleFor=function(e){return this.schedule.get(e)},u.prototype.setScheduleFor=function(e,t){this.schedule.set(e,t)},u.fromJSON=function(e){var t=new u;t.setDNDPreference(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_DND]);var n=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.MONDAY][p.APIConstants.KEY_MUTE_DND]),o=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.TUESDAY][p.APIConstants.KEY_MUTE_DND]),s=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.WEDNESDAY][p.APIConstants.KEY_MUTE_DND]),r=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.THURSDAY][p.APIConstants.KEY_MUTE_DND]),i=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.FRIDAY][p.APIConstants.KEY_MUTE_DND]),a=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SATURDAY][p.APIConstants.KEY_MUTE_DND]),E=new C.DaySchedule(e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_FROM],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_TO],e[p.APIConstants.KEY_MUTE_PREFERENCES][p.APIConstants.KEY_MUTE_SCHEDULE][p.DayOfWeek.SUNDAY][p.APIConstants.KEY_MUTE_DND]),c=new Map([[p.DayOfWeek.MONDAY,n],[p.DayOfWeek.TUESDAY,o],[p.DayOfWeek.WEDNESDAY,s],[p.DayOfWeek.THURSDAY,r],[p.DayOfWeek.FRIDAY,i],[p.DayOfWeek.SATURDAY,a],[p.DayOfWeek.SUNDAY,E]]);return t.setSchedulePreference(c),t},u}();t.MutePreferences=o},function(e,t,n){"use strict";t.__esModule=!0,t.NotificationPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(e){this.oneOnOnePreferences=e},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(e){this.mutePreferences=e},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(e){this.groupPreferences=e},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(e){this.usePrivacyTemplate=e},n.fromJSON=function(e){var t=new n;return e.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&t.setMutePreferences(e[o.APIConstants.KEY_MUTE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&t.setGroupPreferences(e[o.APIConstants.KEY_GROUP_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&t.setOneOnOnePreferences(e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.setUsePrivacyTemplate(e[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),t},n}();t.NotificationPreferences=s},function(e,t,n){"use strict";t.__esModule=!0,t.OneOnOnePreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getReactionsPreference=function(){return this.oneOnOneMessageReactions},n.prototype.setReactionsPreference=function(e){this.oneOnOneMessageReactions=e},n.prototype.getRepliesPreference=function(){return this.oneOnOneReplies},n.prototype.setRepliesPreference=function(e){this.oneOnOneReplies=e},n.prototype.getMessagesPreference=function(){return this.oneOnOneMessages},n.prototype.setMessagesPreference=function(e){this.oneOnOneMessages=e},n.fromJSON=function(e){var t=new n;return t.setMessagesPreference(o.MessagesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_MESSAGES]]),t.setRepliesPreference(o.RepliesOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REPLIES]]),t.setReactionsPreference(o.ReactionsOptions[e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES][o.APIConstants.KEY_ONE_ON_ONE_REACTIONS]]),t},n}();t.OneOnOnePreferences=s},function(e,t,n){"use strict";t.__esModule=!0,t.PushPreferences=void 0;var o=n(13),s=function(){function n(){}return n.prototype.getOneOnOnePreferences=function(){return this.oneOnOnePreferences},n.prototype.setOneOnOnePreferences=function(e){this.oneOnOnePreferences=e},n.prototype.getMutePreferences=function(){return this.mutePreferences},n.prototype.setMutePreferences=function(e){this.mutePreferences=e},n.prototype.getGroupPreferences=function(){return this.groupPreferences},n.prototype.setGroupPreferences=function(e){this.groupPreferences=e},n.prototype.getUsePrivacyTemplate=function(){return this.usePrivacyTemplate},n.prototype.setUsePrivacyTemplate=function(e){this.usePrivacyTemplate=e},n.fromJSON=function(e){var t=new n;return e.hasOwnProperty(o.APIConstants.KEY_MUTE_PREFERENCES)&&t.setMutePreferences(e[o.APIConstants.KEY_MUTE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_GROUP_PREFERENCES)&&t.setGroupPreferences(e[o.APIConstants.KEY_GROUP_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES)&&t.setOneOnOnePreferences(e[o.APIConstants.KEY_ONE_ON_ONE_PREFERENCES]),e.hasOwnProperty(o.APIConstants.KEY_USE_PRIVACY_TEMPLATE)&&t.setUsePrivacyTemplate(e[o.APIConstants.KEY_USE_PRIVACY_TEMPLATE]),t},n}();t.PushPreferences=s},function(e,t,n){"use strict";t.__esModule=!0,t.UnmutedConversation=void 0;var o=function(){function e(){}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=e},e.prototype.getType=function(){return this.type},e.prototype.setType=function(e){this.type=e},e}();t.UnmutedConversation=o}])}),function(){try{require("@cometchat/calls-sdk-react-native")&&(this.CometChatCallSDK=require("@cometchat/calls-sdk-react-native/package.json"),this.CometChatCalling={},this.CometChatCalling.isCallingComponentInstalled=!0,this.CometChatCalling.CallScreen=require("@cometchat/calls-sdk-react-native").default,this.CometChatCalling.CometChatRTC=require("@cometchat/calls-sdk-react-native").CometChatRTC,this.CometChatCalling.CometChatCalls=require("@cometchat/calls-sdk-react-native").CometChatCalls,this.CometChatCalling.CallEventListener=require("@cometchat/calls-sdk-react-native").CallEventListener)}catch(e){}try{require("@cometchat/chat-uikit-react-native")&&(this.CometChatUiKit=require("@cometchat/chat-uikit-react-native/package.json"))}catch(e){}}(); \ No newline at end of file diff --git a/README.md b/README.md index 7f3df23..f2a4fda 100644 --- a/README.md +++ b/README.md @@ -1,182 +1,22 @@ -
-
-
-

- -

-
-
-
-
-
+

+ CometChat +

-# CometChat React Native SDK +# CometChat SDK for React Native +The CometChat SDK is a robust toolkit that developers can utilize to swiftly incorporate a reliable and fully-featured chat functionality into an existing or new application. It removes the complexity of building a chat infrastructure from scratch, thus accelerating the development process and reducing time to market. -CometChat enables you to add voice, video & text chat for your website & app. -This guide demonstrates how to add chat to a React Native App using CometChat. +## Prerequisites +- [`Visual Studio Code`](https://code.visualstudio.com/) or any other code editor +- [`npm`](https://www.npmjs.com/get-npm) -## Features -
    -
  • 1-1 & Group Conversations
  • -
  • Voice & video calling & conferencing
  • -
  • Rich Media Attachments
  • -
  • Typing Indicators
  • -
  • Custom Messages
  • -
  • Read receipts
  • -
  • Online Presence Indicators
  • -
  • Message History
  • -
  • Single Sign-on
  • -
  • Webhooks
  • -
  • Bots
  • -
  • Users & Friends List
  • -
  • Groups List
  • -
  • Conversations List
  • -
  • Threaded Conversations
  • -
+## Getting Started -## Extensions +To set up React Native SDK and utilize CometChat for your chat and calls functionality, you'll need to follow these steps: +- Register at the [CometChat Dashboard](https://app.cometchat.com/) to create an account. +- After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep these credentials secure as you'll need them later. +- Check the [key concepts](https://cometchat.com/docs/sdk/react-native/key-concepts) to understand the basic components of CometChat. +- Refer to the [Integration Steps](https://cometchat.com/docs/sdk/react-native/setup) in our documentation to integrate the SDK into your app. -[Push Notification](https://prodocs.cometchat.com/docs/extensions-enhanced-push-notification) | [Email Notification](https://prodocs.cometchat.com/docs/extensions-email-notification) | [SMS Notification](https://prodocs.cometchat.com/docs/extensions-sms-notification) | [Thumbnail Generation](https://prodocs.cometchat.com/docs/extensions-thumbnail-generation) | [Link Preview](https://prodocs.cometchat.com/docs/extensions-link-preview) | [Rich Media Preview](https://prodocs.cometchat.com/docs/extensions-rich-media-preview) | [Voice Transcription](https://prodocs.cometchat.com/docs/extensions-voice-transcription) | [Smart Reply](https://prodocs.cometchat.com/docs/extensions-smart-reply) | [Message Translation](https://prodocs.cometchat.com/docs/extensions-message-translation) | [Emojis](https://prodocs.cometchat.com/docs/extensions-emojis) | [Polls](https://prodocs.cometchat.com/docs/extensions-polls) | [Reactions](https://prodocs.cometchat.com/docs/extensions-reactions) | [Stickers](https://prodocs.cometchat.com/docs/extensions-stickers) | [Video Broadcasting](https://prodocs.cometchat.com/docs/extensions-broadcast) | [Collaborative Documents](https://prodocs.cometchat.com/docs/extensions-collaborative-document) | [Collaborative Whiteboards](https://prodocs.cometchat.com/docs/extensions-collaborative-whiteboard) | [Data Masking Filter](https://prodocs.cometchat.com/docs/extensions-data-masking-filter) | [Profanity Filter](https://prodocs.cometchat.com/docs/extensions-profanity-filter) | [Image Moderation](https://prodocs.cometchat.com/docs/extensions-image-moderation)| [Sentiment Analysis](https://prodocs.cometchat.com/docs/extensions-sentiment-analysis) | [In-flight Message Moderation](https://prodocs.cometchat.com/docs/extensions-in-flight-message-moderation) | [Virus & Malware Scanner](https://prodocs.cometchat.com/docs/extensions-virus-malware-scanner) | [XSS Filter](https://prodocs.cometchat.com/docs/extensions-xss-filter) - -[![Platform](https://img.shields.io/badge/Platform-Javascript-brightgreen)](#) - -![GitHub repo size](https://img.shields.io/github/repo-size/cometchat-pro/react-native-chat-sdk) -![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/react-native-chat-sdk) -![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/react-native-chat-sdk?style=social) -![Twitter Follow](https://img.shields.io/twitter/follow/cometchat?style=social) -
- - -## Prerequisites :star: -Before you begin, ensure you have met the following requirements:
- ✅   You have [`Visual Studio Code`](https://code.visualstudio.com/) or any other code editor installed in your machine.
- ✅   To run native projects you will need to have [`Android Studio`](https://reactnative.dev/docs/environment-setup) & [`Xcode`](https://reactnative.dev/docs/environment-setup) installed in your machine.
- ✅   You have [`npm`](https://www.npmjs.com/get-npm) installed in your machine.
- ✅   You have read [CometChat Key Concepts](https://prodocs.cometchat.com/docs/concepts).
- -
- -## Installing CometChat React Native SDK -## Setup :wrench: - -To setup React Native SDK, you need to first register on CometChat Dashboard. [Click here to sign up](https://app.cometchat.com/login). - -### i. Get your Application Keys :key: - -Signup for CometChat and then: - -1. Create a new app: Click **Add App** option available → Enter App Name & other information → Create App -2. At the Top in **QuickStart** section you will find **Auth Key** & **App ID** or else you can head over to the **API & Auth Keys** section and note the **Auth Key** and **App ID** - - -
- -### ii. Add the CometChat Dependency -
    -
  • -Install via NPM
    -1. Run the following command to install the CometChat React Native SDK
    - -```javascript - npm install @cometchat/chat-sdk-react-native@latest --save -``` - - You can refer to the below link for instructions on how to do so:
    -[📝 Add CometChat Dependency](https://prodocs.cometchat.com/docs/react-native-quick-start#add-the-cometchat-dependency) -
  • -
-
- -## Configure CometChat React Native SDK - -### i. Initialize CometChat 🌟 -We suggest you call the init() method on app startup, preferably in the index.js file. - -```javascript -var appID = "APP_ID"; -var region = "REGION"; -var appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build(); -CometChat.init(appID, appSetting).then( - () => { - console.log("Initialization completed successfully"); - }, - error => { - console.log("Initialization failed with error:", error); - } -); -``` - -| :information_source:   Note: Make sure to replace `region` and `appID` with your credentials. | -|------------------------------------------------------------------------------------------------------------| - -### ii. Create User 👤 -Once initialisation is successful, you will need to create a user. You need to use createUser() method to create user on the fly. -```javascript -let authKey = "AUTH_KEY"; -var uid = "user1"; -var name = "Kevin"; - -var user = new CometChat.User(uid); - -user.setName(name); - -CometChat.createUser(user, authKey).then( - user => { - console.log("user created", user); - },error => { - console.log("error", error); - } -); -``` ->:information_source: Note: Make sure that UID and name are specified as these are mandatory fields to create a user. -
- -### iii. Login User 👤 -Once you have created the user successfully, you will need to log the user into CometChat using the login() method. -```javascript -var UID = "SUPERHERO1"; -var authKey = "AUTH_KEY"; - -CometChat.getLoggedinUser().then( - user => { - if(!user){ - CometChat.login(UID, authKey).then( - user => { - console.log("Login Successful:", { user }); - }, - error => { - console.log("Login failed with exception:", { error }); - } - ); - }else{ - // User already logged in - } - }, error => { - console.log("getLoggedinUser failed with exception:", { error }); - } -); -``` - -| :information_source:   Note - The login() method needs to be called only once. Also replace AUTH_KEY with your App Auth Key. | -|------------------------------------------------------------------------------------------------------------| - -
- -📝 Please refer to our [Developer Documentation](https://prodocs.cometchat.com/docs/react-native-quick-start) for more information on how to configure the CometChat SDK and implement various features using the same. - -
- -## Learn more about UI-Kit -[React Native UI Kit](https://github.com/cometchat-pro/react-native-chat-ui-kit) - -## Contributors :clap: -Thanks to the following people who have contributed to this project: -[👨‍💻 @mayur-bhandari](https://github.com/mayur-bhandari) -[👨‍💻 @jitvarpatil](https://github.com/jitvarpatil) - -
- -## Contact :mailbox: -Contact us via real time support present in [CometChat Dashboard.](https://app.cometchat.io/) -
\ No newline at end of file +## Help and Support +For issues running the project or integrating with our SDK, consult our [documentation](https://www.cometchat.com/docs/sdk/react-native/overview) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/). \ No newline at end of file diff --git a/package.json b/package.json index 72aedb7..5e2e3b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cometchat/chat-sdk-react-native", - "version": "4.0.9", + "version": "4.0.10", "description": "A complete chat solution.", "main": "CometChat.js", "scripts": {