diff --git a/CometChat.js b/CometChat.js index 6d2fc47..ace6732 100644 --- a/CometChat.js +++ b/CometChat.js @@ -1 +1 @@ -!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 +!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/package.json b/package.json index 80ee758..45c60a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cometchat/chat-sdk-react-native", - "version": "4.0.11", + "version": "4.0.12", "description": "A complete chat solution.", "main": "CometChat.js", "scripts": {