diff --git a/CometChat.d.ts b/CometChat.d.ts index 2948798..0f7426c 100644 --- a/CometChat.d.ts +++ b/CometChat.d.ts @@ -556,6 +556,13 @@ export namespace CometChat { */ export function getActiveCall(): Call; + /** + * Function to start a call. + * @param {CallSettings} callSettings + * @memberof CometChat + */ + export function startCall(callSettings: CallSettings): void; + /** * Function to fetch participant count of an ongoing call. * @param {string} sessionId diff --git a/CometChat.js b/CometChat.js index db44000..6aecd51 100644 --- a/CometChat.js +++ b/CometChat.js @@ -1 +1 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@react-native-async-storage/async-storage"),require("react"),require("react-native"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react","react-native"],e);else{var n="object"==typeof exports?e(require("@react-native-async-storage/async-storage"),require("react"),require("react-native")):e(t["@react-native-async-storage/async-storage"],t.react,t["react-native"]);for(var s in n)("object"==typeof exports?exports:t)[s]=n[s]}}(window,function(n,s,o){return function(n){var s={};function o(t){if(s[t])return s[t].exports;var e=s[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=n,o.c=s,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)o.d(n,s,function(t){return e[t]}.bind(null,s));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=40)}([function(t,T,_){"use strict";(function(t){T.__esModule=!0,T.isCallingComponentInstalled=T.getKeyprefix=T.validateConversationType=T.validateUpdateUser=T.validateCreateUser=T.validateMessage=T.validateChatType=T.validateMsgId=T.validateArray=T.validateHideMessagesFromBlockedUsers=T.validateId=T.validateCreateGroup=T.validateJoinGroup=T.validateUpdateGroup=T.validateScope=T.isAudio=T.isVideo=T.isImage=T.getUpdatedSettings=T.getAppSettings=T.getCurrentTime=T.Logger=T.createUidFromJid=T.format=T.getOrdinalSuffix=T.isFalsy=T.isTruthy=T.isObject=T.getJidHost=T.getChatHost=void 0;var s=_(14),r=_(1),o=_(6),i=_(2),a=_(16),E=_(17),c=_(19),u=_(5),e=_(13);function S(t){return null!=t&&("string"==typeof t&&(t=t.trim()),"object"==typeof t&&0===Object.keys(t).length&&(t=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(t)}function C(t){for(var s=[],e=1;ei[0]&&e[1] All store cleared successfully","true"),t(!0)})}catch(t){_.Logger.error("CometChat: clearCache",t),e(t)}})},T.connect=function(){T.user&&(z.connection||(T.disconnectedByUser=!1,T.WSLogin(T.user)),T.didAnalyticsPingStart()||T.isAnalyticsDisabled||(T.pingAnalytics(),T.startAnalyticsPingTimer()))},T.disconnect=function(){T.user&&(T.disconnectedByUser=!0,z.connection&&z.WSLogout(),T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer())},T.prototype.internalRestart=function(t){T.internalRestart||T.getInstance().internalLogout(!1).then(function(){T.internalRestart=!0,T.login(t).then(function(t){T.shouldConnectToWS=!0,T.internalRestart=!1},function(t){_.Logger.error("CometChat: internalRestart :: login",t),T.internalRestart=!1})},function(t){_.Logger.error("CometChat: internalRestart :: internalLogout",t)})},T.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(t,e){try{T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.WSReconnectionInProgress&&T.clearWSReconnectionTimer(),T.isLoggedOut=!0,T.WSReconnectionInProgress=!1,T.isAnalyticsDisabled=!1,T.clearCache().then(function(){T.apiKey=void 0,T.user=void 0,T.authToken=void 0,T.cometChat=void 0,T.mode=void 0,z.WSLogout(),n&&T.pushToLoginListener("","Logout_Success"),t(!0)})}catch(t){_.Logger.error("CometChat: internalLogout",t),e(t)}})},T.initialzed=!1,T.CometChatException=l.CometChatException,T.TextMessage=R.TextMessage,T.MediaMessage=S.MediaMessage,T.CustomMessage=w.CustomMessage,T.Action=i.Action,T.Call=o.Call,T.TypingIndicator=Y.TypingIndicator,T.TransientMessage=Q.TransientMessage,T.Group=a.Group,T.User=d.User,T.GroupMember=K.GroupMember,T.Conversation=b.Conversation,T.USER_STATUS={ONLINE:O.PresenceConstatnts.STATUS.ONLINE,OFFLINE:O.PresenceConstatnts.STATUS.OFFLINE},T.MessagesRequest=U.MessagesRequest,T.MessagesRequestBuilder=U.MessagesRequestBuilder,T.UsersRequest=P.UsersRequest,T.UsersRequestBuilder=P.UsersRequestBuilder,T.ConversationsRequest=v.ConversationsRequest,T.ConversationsRequestBuilder=v.ConversationsRequestBuilder,T.BlockedUsersRequest=F.BlockedUsersRequest,T.BlockedUsersRequestBuilder=F.BlockedUsersRequestBuilder,T.GroupsRequest=y.GroupsRequest,T.GroupsRequestBuilder=y.GroupsRequestBuilder,T.GroupMembersRequest=L.GroupMembersRequest,T.GroupMembersRequestBuilder=L.GroupMembersRequestBuilder,T.BannedMembersRequest=M.BannedMembersRequest,T.BannedMembersRequestBuilder=M.BannedMembersRequestBuilder,T.CallSettings=H.CallSettings,T.CallSettingsBuilder=H.CallSettingsBuilder,T.AppSettings=x.AppSettings,T.AppSettingsBuilder=x.AppSettingsBuilder,T.CallingComponent=k.CallingComponent,T.MessageListener=s.MessageListener,T.UserListener=s.UserListener,T.GroupListener=s.GroupListener,T.OngoingCallListener=s.OngoingCallListener,T.CallListener=s.CallListener,T.ConnectionListener=s.ConnectionListener,T.LoginListener=s.LoginListener,T.CallController=f.CallController,T.CometChatHelper=B.CometChatHelper,T.Attachment=V.Attachment,T.MESSAGE_TYPE=O.MessageConstatnts.TYPE,T.CATEGORY_MESSAGE=O.MessageConstatnts.CATEGORY.MESSAGE,T.CATEGORY_ACTION=O.MessageConstatnts.CATEGORY.ACTION,T.CATEGORY_CALL=O.MessageConstatnts.CATEGORY.CALL,T.CATEGORY_CUSTOM=O.MessageConstatnts.CATEGORY.CUSTOM,T.ACTION_TYPE=O.ActionConstatnts.ACTIONS,T.CALL_TYPE=O.CallConstants.CALL_TYPE,T.RECEIVER_TYPE=O.MessageConstatnts.RECEIVER_TYPE,T.CALL_STATUS=O.CallConstants.CALL_STATUS,T.GROUP_MEMBER_SCOPE=O.GROUP_MEMBER_SCOPE,T.GROUP_TYPE=O.GROUP_TYPE,T.MESSAGE_REQUEST=O.MessageConstatnts.PAGINATION.CURSOR_FILEDS,T.CONNECTION_STATUS=O.CONNECTION_STATUS,T.CALL_MODE=O.CallConstants.CALL_MODE,T.AUDIO_MODE=O.CallConstants.AUDIO_MODE,T.WSReconnectionInProgress=!1,T.WSReconnectionTimerInterval=5e3,T.currentConnectionStatus=O.CONNECTION_STATUS.DISCONNECTED,T.isConnectingFromInit=!1,T.loginInProgress=!1,T.internalRestart=!1,T.settingsInterval=6e4,T.isAnalyticsPingStarted=!1,T.isLoggedOut=!0,T.isAnalyticsDisabled=!1,T.disconnectedByUser=!1,T.shouldConnectToWS=!0,T}();e.CometChat=tt},function(t,e,n){"use strict";e.__esModule=!0,e.postData=e.makeAdminApiCall=e.makeApiCall=void 0;var E=n(31),c=n(5),u=n(0),S=n(2),C=n(13),p=n(1);function T(n,t,s,e,o){var r;return void 0===n&&(n=""),void 0===t&&(t="GET"),void 0===s&&(s={}),void 0===e&&(e={}),s=u.isFalsy(s)?void 0:("GET"==t&&(n+="?",Object.keys(s).map(function(t,e){n=e===Object.keys(s).length-1?n+t+"="+s[t]:n+t+"="+s[t]+"&"}),s=void 0),o&&(r=new FormData,Object.keys(s).map(function(e){"data"!=e?"tags"==e?s[e].forEach(function(t){r.append(e+"[]",t)}):"metadata"!=e&&r.append(e,s[e]):r.append(e,JSON.stringify(s[e]))})),JSON.stringify(s)),fetch(n,{method:t,mode:"cors",cache:"no-cache",headers:e,redirect:"follow",referrer:"no-referrer",body:o?r:s})}e.makeApiCall=function(o,t,r,i){void 0===o&&(o=""),void 0===t&&(t={}),void 0===r&&(r={});var a=c.CometChat.getInstance(c.CometChat.getAppId());return new Promise(function(n,s){try{E.getEndPoint(o,t).then(function(t){var e={resource:c.CometChat.getSessionId(),appId:c.CometChat.getAppId(),Accept:"application/json",sdk:u.format(p.SDKHeader.sdk,p.SDKHeader.platform,p.SDKHeader.sdkVersion)};i||(e["Content-Type"]="application/json"),t.hasOwnProperty("isAdminApi")&&t.isAdminApi?a.getApiKey()?e.apiKey=a.getApiKey():s({error:{code:"API_KEY_NOT_SET",message:"An apiKey is needed to use the "+o+" api.",name:"API_KEY_NOT_SET"}}):a.getAuthToken()?e.authToken=a.getAuthToken():s({error:{code:"USER_NOT_LOGED_IN",message:"An authToken is need to use the "+o+" end-point. PS- We are aware of the spelling mistake, but in order to maintain backward compatibility we cannot change it :(",name:"User not logged-in"}}),T(t.endpoint,t.method,r,e,i).then(function(t){return t.json()}).then(function(t){if(t.hasOwnProperty("data"))t.data.hasOwnProperty("authToken")&&c.CometChat.setAuthToken(t.data.authToken),n(t);else{if(t.hasOwnProperty("error")){var e=t.error;e.hasOwnProperty("code")&&e.code===p.API_ERROR_CODES.AUTH_ERR_AUTH_TOKEN_NOT_FOUND&&c.CometChat.getInstance().internalLogout().then(function(){u.Logger.log("CometChat: makeApiCall","User logged out")})}s(t)}}).catch(function(t){var e={error:C.FETCH_ERROR.ERROR_IN_API_CALL};s(e)})}).catch(function(t){return s})}catch(t){s(new S.CometChatException(t))}})},e.makeAdminApiCall=function(o,t,r,i){void 0===o&&(o=""),void 0===t&&(t={}),void 0===r&&(r={});var a=c.CometChat.getInstance(c.CometChat.getAppId());return new Promise(function(n,s){E.getEndPoint(o,t).then(function(t){var e={appId:c.CometChat.getAppId(),Accept:"application/json",sdk:u.format(p.SDKHeader.sdk,p.SDKHeader.platform,p.SDKHeader.sdkVersion)};i||(e["Content-Type"]="application/json"),t.hasOwnProperty("isAdminApi")&&t.isAdminApi?a.getApiKey()?e.apiKey=a.getApiKey():s({error:"An apiKey is need to use the "+o+" api."}):a.getAuthToken()?e.authToken=a.getAuthToken():s({error:"An authToken is need to use the "+o+" api."}),T(t.endpoint,t.method,r,e,i).then(function(t){return t.json()}).then(function(t){t.hasOwnProperty("data")?(t.data.hasOwnProperty("authToken")&&c.CometChat.setAuthToken(t.data.authToken),n(t)):s(t)}).catch(function(t){var e={error:C.FETCH_ERROR.ERROR_IN_API_CALL};s(e)})}).catch(function(t){return s})})},e.postData=T},function(t,e,n){"use strict";e.__esModule=!0,e.BaseMessage=void 0;var s=function(){function t(t,e,n,s){this.receiverId=t,this.type=e,this.receiverType=n,this.category=s}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(t){this.id=t},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.setConversationId=function(t){this.conversationId=t},t.prototype.getParentMessageId=function(){return this.parentMessageId},t.prototype.setParentMessageId=function(t){this.parentMessageId=t},t.prototype.getMuid=function(){return this.muid},t.prototype.setMuid=function(t){this.muid=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(t){this.receiverId=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getSentAt=function(){return this.sentAt},t.prototype.setSentAt=function(t){this.sentAt=t},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(t){this.status=t},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.setDeliveredAt=function(t){this.deliveredAt=t},t.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},t.prototype.setDeliveredToMeAt=function(t){this.deliveredToMeAt=t},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setReadAt=function(t){this.readAt=t},t.prototype.getReadByMeAt=function(){return this.readByMeAt},t.prototype.setReadByMeAt=function(t){this.readByMeAt=t},t.prototype.getCategory=function(){return this.category},t.prototype.setCategory=function(t){this.category=t},t.prototype.getEditedAt=function(){return this.editedAt},t.prototype.setEditedAt=function(t){this.editedAt=t},t.prototype.getEditedBy=function(){return this.editedBy},t.prototype.setEditedBy=function(t){this.editedBy=t},t.prototype.getDeletedAt=function(){return this.deletedAt},t.prototype.setDeletedAt=function(t){this.deletedAt=t},t.prototype.getDeletedBy=function(){return this.deletedBy},t.prototype.setDeletedBy=function(t){this.deletedBy=t},t.prototype.getReplyCount=function(){return this.replyCount},t.prototype.setReplyCount=function(t){this.replyCount=t},t.prototype.getRawMessage=function(){return this.rawMessage},t.prototype.setRawMessage=function(t){this.rawMessage=t},t}();e.BaseMessage=s},function(t,e,n){"use strict";e.__esModule=!0,e.Group=void 0;var s=n(1),o=function(){function t(t,e,n,s,o,r,i){this.hasJoined=!1,this.membersCount=0,this.guid=t,e&&(this.name=e),n&&(this.type=n),!s&&""!==s||"password"!=n||(this.password=s),(o||""===o)&&(this.icon=o),(r||""===r)&&(this.description=r),i&&(this.hasJoined=i)}return t.prototype.getGuid=function(){return this.guid},t.prototype.setGuid=function(t){this.guid=t},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){t&&(this.name=t)},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getPassword=function(){return this.password},t.prototype.setPassword=function(t){this.password=t},t.prototype.getIcon=function(){return this.icon},t.prototype.setIcon=function(t){this.icon=t},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(t){this.description=t},t.prototype.getOwner=function(){return this.owner},t.prototype.setOwner=function(t){this.owner=t},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(t){this.metadata=t},t.prototype.getCreatedAt=function(){return this.createdAt},t.prototype.setCreatedAt=function(t){this.createdAt=t},t.prototype.getUpdatedAt=function(){return this.updatedAt},t.prototype.setUpdatedAt=function(t){this.updatedAt=t},t.prototype.getHasJoined=function(){return this.hasJoined},t.prototype.setHasJoined=function(t){this.hasJoined=t},t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.setWsChannel=function(t){this.wsChannel=t},t.prototype.setScope=function(t){this.scope=t},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(t){this.joinedAt=t},t.prototype.getMembersCount=function(){return this.membersCount},t.prototype.setMembersCount=function(t){this.membersCount=t},t.prototype.setTags=function(t){this.tags=t},t.prototype.getTags=function(){return this.tags},t.TYPE=s.GroupType,t.Type=t.TYPE,t}();e.Group=o},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatEvent=void 0;var i=n(0),s=n(4),o=function(){function t(t,e,n,s,o,r){i.isFalsy(t)||(this.appId=t),i.isFalsy(e)||(this.receiver=e),i.isFalsy(n)||(this.receiverType=n),i.isFalsy(o)||(this.deviceId=o),i.isFalsy(s)||(this.sender=s),i.isFalsy(r)||(this.messageSender=r)}return t.prototype.getAppId=function(){return this.appId},t.prototype.setAppId=function(t){this.appId=t},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(t){this.receiver=t},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(t){this.sender=t},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(t){this.receiverType=t},t.prototype.getType=function(){return this.type},t.prototype.setType=function(t){this.type=t},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.setDeviceId=function(t){this.deviceId=t},t.prototype.getMessageSender=function(){return this.messageSender},t.prototype.setMessageSender=function(t){this.messageSender=t},t.prototype.getCometChatEventJSON=function(){var t={};return t[s.KEYS.APP_ID]=this.getAppId(),t[s.KEYS.RECEIVER]=this.getReceiver(),t[s.KEYS.RECEIVER_TYPE]=this.getReceiverType(),t[s.KEYS.DEVICE_ID]=this.getDeviceId(),t[s.KEYS.TYPE]=this.getType(),t[s.KEYS.SENDER]=this.getSender(),i.isFalsy(this.getMessageSender())||(t[s.KEYS.MESSAGE_SENDER]=this.getMessageSender()),t},t}();e.CometChatEvent=o},function(t,e,n){"use strict";e.__esModule=!0,e.MessageController=void 0;var i=n(7),a=n(16),E=n(17),c=n(0),u=n(1),S=n(20),C=n(21),p=n(22),r=n(2),T=n(18),_=n(19),l=n(5),g=n(11),s=function(){function t(){}return t.trasformJSONMessge=function(n){try{var t=null;n.hasOwnProperty("rawMessage")||(t=JSON.parse(JSON.stringify(n)));var e=void 0;switch(n[u.MessageConstatnts.KEYS.CATEGORY]){case u.MessageConstatnts.CATEGORY.ACTION:e=S.Action.actionFromJSON(n);break;case u.MessageConstatnts.CATEGORY.CALL:e=C.Call.callFromJSON(n);break;case u.MessageConstatnts.CATEGORY.MESSAGE:switch(n[u.MessageConstatnts.KEYS.TYPE]){case u.MessageConstatnts.TYPE.TEXT:e=new a.TextMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.TEXT],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case u.MessageConstatnts.TYPE.CUSTOM:e=new _.CustomMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.CUSTOM_DATA],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if(e=new E.MediaMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.URL],n[u.MessageConstatnts.KEYS.TYPE],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),n.hasOwnProperty(u.MessageConstatnts.KEYS.DATA)){var s=n[u.MessageConstatnts.KEYS.DATA];if(s.hasOwnProperty(u.MessageConstatnts.KEYS.ATTATCHMENTS)){var o,r=s[u.MessageConstatnts.KEYS.ATTATCHMENTS];new Array;r.map(function(t){o=new T.Attachment(t)}),e.setAttachment(o)}s.hasOwnProperty(u.MessageConstatnts.KEYS.TEXT)&&e.setCaption(s[u.MessageConstatnts.KEYS.TEXT])}e.hasOwnProperty("file")&&delete e.file}break;case u.MessageConstatnts.CATEGORY.CUSTOM:e=new _.CustomMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.CUSTOM_DATA],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type)}n[u.MessageConstatnts.KEYS.MY_RECEIPTS]&&(n[u.MessageConstatnts.KEYS.MY_RECEIPTS]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(n[u.MessageConstatnts.KEYS.MY_RECEIPTS]).map(function(t){var e=new p.MessageReceipt;t==u.DELIVERY_RECEIPTS.DELIVERED_AT&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.DELIVERED_AT]),c.isFalsy(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.RECIPIENT])?n[u.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.DELIVERED_AT]:e.setSender(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.RECIPIENT]),e.setReceiverType(n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[u.MessageConstatnts.KEYS.RECEIVER])),n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]),c.isFalsy(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.RECIPIENT])?n[u.READ_RECEIPTS.READ_BY_ME_AT]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]:e.setSender(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.RECIPIENT]),e.setReceiverType(n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(n[u.MessageConstatnts.KEYS.RECEIVER]))}));try{if(Object.assign(e,n),(n=e).parentId&&(n.parentMessageId=n.parentId,delete n.parentId),n instanceof i.BaseMessage&&(c.isFalsy(t)||n.setRawMessage(t)),n instanceof a.TextMessage)n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]);else if(n instanceof E.MediaMessage)n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver());else if(n instanceof S.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 C.Call){try{n.setSender(n.getSender())}catch(t){c.Logger.error("MessageController: trasformJSONMessge: setSender",t)}try{n.setCallInitiator(n.getCallInitiator())}catch(t){c.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",t)}try{n.setReceiver(n.getCallReceiver()),n.setCallReceiver(n.getCallReceiver())}catch(t){c.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",t)}}else n instanceof _.CustomMessage&&(n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]),n.setSubType(n.getData()[u.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()))}catch(t){c.Logger.error("MessageController: trasformJSONMessge: Main",t),n=null}return n}catch(t){c.Logger.error("MessageController: trasformJSONMessge",t)}},t.getReceiptsFromJSON=function(o){return new Promise(function(t,e){try{var s=[];l.CometChat.getLoggedInUser().then(function(n){c.isFalsy(o.receipts)?t([]):(o.receipts.data.map(function(t){var e=new p.MessageReceipt;t[u.DELIVERY_RECEIPTS.DELIVERED_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.DELIVERY_RECEIPT),e.setDeliveredAt(t[u.DELIVERY_RECEIPTS.DELIVERED_AT]),e.setTimestamp(t[u.DELIVERY_RECEIPTS.DELIVERED_AT]),c.isFalsy(t[u.DELIVERY_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(g.UsersController.trasformJSONUser(t[u.DELIVERY_RECEIPTS.RECIPIENT])),e.setReceiverType(o[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(o[u.MessageConstatnts.KEYS.RECEIVER])),t[u.READ_RECEIPTS.READ_AT]&&(e.setReceiptType(e.RECEIPT_TYPE.READ_RECEIPT),e.setReadAt(t[u.READ_RECEIPTS.READ_AT]),e.setTimestamp(t[t[u.READ_RECEIPTS.READ_AT]]),c.isFalsy(t[u.READ_RECEIPTS.RECIPIENT])?e.setSender(n):e.setSender(g.UsersController.trasformJSONUser(t[u.READ_RECEIPTS.RECIPIENT])),e.setReceiverType(o[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),e.setReceiver(o[u.MessageConstatnts.KEYS.RECEIVER])),s.push(e)}),t(s))})}catch(t){e(new r.CometChatException(t))}})},t}();e.MessageController=s},function(t,e,n){"use strict";e.__esModule=!0,e.UsersController=void 0;var s=n(3),o=n(0),r=function(){function t(){}return t.trasformJSONUser=function(t){var e;try{t.uid=t.uid.toString(),t.name=t.name.toString(),t.status&&"offline"!==t.status?t.status="online":t.status="offline",e=new s.User(t),Object.assign(e,t),t=e}catch(t){o.Logger.error("UsersController:transformJSONUser",t)}return t},t}();e.UsersController=r},function(t,e){t.exports=n},function(t,e,n){"use strict";e.__esModule=!0,e.FETCH_ERROR=e.TYPINGNOTIFICATION_CONSTANTS=e.LOGIN_ERROR=e.MESSAGE_ERRORS=e.MESSAGES_REQUEST_ERRORS=e.USERS_REQUEST_ERRORS=e.GROUP_CREATION_ERRORS=e.INIT_ERROR=e.ERRORS=e.SERVER_ERRORS=void 0,e.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},e.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},e.INIT_ERROR={NO_APP_ID:{code:e.ERRORS.PARAMETER_MISSING.code,name:e.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},e.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},e.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},e.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},e.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},e.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},e.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},e.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(t,e,n){"use strict";e.__esModule=!0,e.LocalStorage=void 0;var r=n(0),i=n(1),a=n(2),s=n(12),o=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.localStore=s.default}catch(t){r.Logger.error("store: constructor",{e:t})}}return t.getInstance=function(){return null==t.localStorage&&(t.localStorage=new t),t.localStorage},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return this.localStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var s=this,o=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,t);return new Promise(function(n,e){try{s.localStore.getItem(o).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clearStore=function(){var o=this;return new Promise(function(n,e){try{var s=[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)];o.localStore.getAllKeys().then(function(t){if(0"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},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"},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"}}}return r.prototype.getEndpointData=function(o){return new Promise(function(s,e){try{E.LocalStorage.getInstance().get(a.LOCAL_STORE.KEY_APP_SETTINGS).then(function(t){if(i.isFalsy(t)){var e={};if((new r).uriEndpoints.hasOwnProperty(o))if((e=(new r).uriEndpoints[o]).hasOwnProperty("isAdminApi")){var n=i.format((new r).adminApiUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).adminApiVersion+"/"+e.endpoint;e.endpoint=n}else{n=i.format((new r).baseUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).apiVersion+"/"+e.endpoint;e.endpoint=n}s(e)}else{e={};if((new r).uriEndpoints.hasOwnProperty(o))if((e=(new r).uriEndpoints[o]).hasOwnProperty("isAdminApi"))e.endpoint="https://"+t[a.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+(new r).adminApiVersion+"/"+e.endpoint;else{n="https://"+t[a.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+(new r).apiVersion+"/"+e.endpoint;e.endpoint=n}s(e)}},function(t){var e;(new r).uriEndpoints.hasOwnProperty(o)&&((e=(new r).uriEndpoints[o]).hasOwnProperty(["isAdminApi"])?e.endpoint=i.format((new r).adminApiUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).adminApiVersion+"/"+e.endpoint:e.endpoint=i.format((new r).baseUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).apiVersion+"/"+e.endpoint),s(e)})}catch(t){e(new u.CometChatException(t))}})},r}();e.EndpointFactory=s},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.__esModule=!0,e.getEndPoint=void 0;var s=n(29),i=n(2);e.getEndPoint=function(t,r){void 0===t&&(t=""),void 0===r&&(r={});var e=new s.EndpointFactory;return new Promise(function(s,o){try{e.getEndpointData(t).then(function(t){var e=t;if(e){for(var n in r)e.endpoint=e.endpoint.replace("{{"+n+"}}",r[n]);s(e)}else o({error:"Unknown endPoint name."})})}catch(t){o(new i.CometChatException(t))}})}},function(t,e,n){"use strict";e.__esModule=!0,e.KeyStore=void 0;var r=n(0),i=n(1),a=n(2),s=n(12),o=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.keyStore=s.default}catch(t){r.Logger.error("KeyStore: constructor",{e:t})}}return t.getInstance=function(){return null==t.KeyStore&&(t.KeyStore=new t),t.KeyStore},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.KEYS_STORE,t);return this.keyStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var s=this,o=r.getKeyprefix(i.LOCAL_STORE.KEYS_STORE,t);return new Promise(function(n,e){try{s.keyStore.getItem(o).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t}();e.KeyStore=o},function(t,e,E){"use strict";(function(g){var s,n=this&&this.__extends||(s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});e.__esModule=!0,e.CallingComponent=void 0;var d,A,R,h,I,O,N,f,m,y,o=E(41),r=E(42),L=E(5),M=E(43),i=E(3),P=E(34),v=E(1),U=E(24),D=E(2),Y=E(0),a=E(44),G={},t=function(e){function t(t){var s=e.call(this,t)||this;s.state={shouldLoad:!1},h=t.callsettings,R=L.CometChat.getActiveCall(),O=L.CometChat.user,G={};var o,r,i,a,E,c,u,S,C,p,T,_,l=!0;return L.CometChat.getAppSettings().then(function(t){if(f=t[v.APP_SETTINGS.KEYS.WEBRTC_HOST],t.hasOwnProperty(v.APP_SETTINGS.KEYS.ANALYTICS_HOST)?G[v.APP_SETTINGS.KEYS.ANALYTICS_HOST]=t[v.APP_SETTINGS.KEYS.ANALYTICS_HOST]:G[v.APP_SETTINGS.KEYS.ANALYTICS_HOST]=Y.format(v.ANALYTICS.analyticsHost,L.CometChat.appSettings.getRegion()),t.hasOwnProperty(v.APP_SETTINGS.KEYS.ANALYTICS_VERSION)?G[v.APP_SETTINGS.KEYS.ANALYTICS_VERSION]=t[v.APP_SETTINGS.KEYS.ANALYTICS_VERSION]:G[v.APP_SETTINGS.KEYS.ANALYTICS_VERSION]=v.ANALYTICS.analyticsVersion,t.hasOwnProperty(v.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED)?G[v.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]=t[v.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]:G[v.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]=!1,t.hasOwnProperty(v.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL)?G[v.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]=t[v.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]:G[v.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]=!0,h.getCallEventListener()&&U.CallController.getInstance().setCallListner(h.getCallEventListener()),Y.isCallingComponentInstalled()&&(m=g.CometChatCalling.CallScreen,y=g.CometChatCalling.CometChatRTC),Y.isFalsy(m)&&Y.isFalsy(y))U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.MODULE_NOT_INSTALLED));else if(Y.isFalsy(L.CometChat.appSettings))U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.NOT_INITIALIZED));else{if(!(d=L.CometChat.appSettings.getRegion().toLowerCase()))return l=!1,void(U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.NOT_INITIALIZED)));if(L.CometChat.getAppId()){if(A=L.CometChat.getAppId(),!O)return l=!1,void(U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.NOT_LOGGED_IN)));if(R){var e=R.getType();o=e===v.CallConstants.CALL_TYPE.AUDIO,r=R.getSessionId()}else{if(o=h.isAudioOnlyCall(),Y.isFalsy(h.getSessionId()))return void(U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.SESSION_ID_REQUIRED)));r=("v1."+d+"."+L.CometChat.getAppId()+"."+h.getSessionId()).toLowerCase()}if(!r)return l=!1,void(U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.SESSION_ID_REQUIRED)));if(i=h.isDefaultLayoutEnabled(),a=h.isAudioModeButtonEnabled(),E=h.isPauseVideoButtonEnabled(),c=h.isMuteAudioButtonEnabled(),u=h.isSwitchCameraButtonEnabled(),S=h.isEndCallButtonEnabled(),C=h.getMode(),p=h.getStartWithAudioMuted(),T=h.getStartWithVideoMuted(),(_=h.getDefaultAudioMode())||(_=o?v.CallConstants.AUDIO_MODE.EARPIECE:v.CallConstants.AUDIO_MODE.SPEAKER),l){var n={uid:O.getUid(),sessionId:r};L.CometChat.getInstance().getJWT(n).then(function(t){t.hasOwnProperty("token")?((N=new M.RTCUser(O.getUid())).setName(O.getName()),N.setAvatar(O.getAvatar()),N.setResource(L.CometChat.getSessionId()),N.setJWT(t.token),I=(new P.CallSettingsBuilder).setSessionID(r).enableDefaultLayout(i).setIsAudioOnlyCall(o).setUser(N).setRegion(d).setAppId(A).setDomain(f).showAudioModeButton(a).showEndCallButton(S).showMuteAudioButton(c).showPauseVideoButton(E).showSwitchCameraButton(u).setMode(C).setAnalyticsSettings(G).startWithAudioMuted(p).startWithVideoMuted(T).setDefaultAudioMode(_).build(),U.CallController.getInstance().callStarted(),s.setState({shouldLoad:!0})):U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.JWT_NOT_FOUND))},function(t){U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(t))})}}else U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onError(new D.CometChatException(v.CALL_ERROR.NOT_INITIALIZED))}}),s}return n(t,e),t.prototype.render=function(){return this.state.shouldLoad?o.createElement(r.View,{style:{flex:1,backgroundColor:"#000"}},o.createElement(m,{style:{flex:1,backgroundColor:"#000"},callsettings:I,onCallEnded:function(){},onCallEndButtonPressed:function(){R?setTimeout(function(){L.CometChat.endCall(h.getSessionId(),!0)},1e3):U.CallController.getInstance().getCallListner()&&U.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null),y.endCall()},onUserJoined:function(t){if(t){var e=void 0;Y.isFalsy(t.uid)||Y.isFalsy(t.name)||((e=new i.User(t)).setStatus("online"),L.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&U.CallController.getInstance().getCallListner()&&(Y.isFalsy(U.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||U.CallController.getInstance().getCallListner()._eventListener.onUserJoined(e)))}},onUserLeft:function(t){if(t){var e=void 0;Y.isFalsy(t.uid)||Y.isFalsy(t.name)||((e=new i.User(t)).setStatus("online"),L.CometChat.user.getUid().toLowerCase()!=e.getUid().toLowerCase()&&U.CallController.getInstance().getCallListner()&&(Y.isFalsy(U.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||U.CallController.getInstance().getCallListner()._eventListener.onUserLeft(e)))}},onUserListChanged:function(t){var n=[];t&&0a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();e.GroupsRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.joinedOnly=function(t){return this.hasJoined=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.GroupsRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.GroupMembersRequestBuilder=e.GroupMembersRequest=void 0;var o=n(6),s=n(0),r=n(14),i=n(2),a=n(35),E=n(1),c=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=r.LocalStorage.getInstance(),s.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,s.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),s.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(s.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(s.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(s.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.GroupMembersRequest=c;var u=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new c(this)},t}();e.GroupMembersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.BannedMembersRequestBuilder=e.BannedMembersRequest=void 0;var o=n(6),s=n(0),r=n(2),i=n(35),a=n(1),E=function(){function t(t){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},s.isFalsy(t)||(this.limit=t.limit,this.guid=t.guid,s.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),s.isFalsy(t.scopes)||(this.scopes=t.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(s.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(s.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();e.BannedMembersRequest=E;var c=function(){function t(t){this.guid=t}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setScopes=function(t){return this.scopes=t,this},t.prototype.build=function(){return new E(this)},t}();e.BannedMembersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.UsersRequestBuilder=e.UsersRequest=void 0;var o=n(6),s=n(0),r=n(11),i=n(2),a=n(49),E=n(1),c=function(){function e(t){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=a.UserStore.getInstance(),s.isFalsy(t)||(this.limit=t.limit,s.isFalsy(t.searchKeyword)||(this.searchKeyword=t.searchKeyword),s.isFalsy(t.status)||(t.status==e.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=t.status),s.isFalsy(t.shouldHideBlockedUsers)||(this.hideBlockedUsers=t.shouldHideBlockedUsers),s.isFalsy(t.showFriendsOnly)||(this.friendsOnly=t.showFriendsOnly),s.isFalsy(t.showTags)||(this.withTags=t.showTags),s.isFalsy(t.role)||(this.role=t.role),s.isFalsy(t.roles)||(this.roles=t.roles),s.isFalsy(t.tags)||(this.tags=t.tags),s.isFalsy(t.UIDs)||(this.UIDs=t.UIDs))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(s.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(s.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(s.format(JSON.stringify(E.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",E.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},e.USER_STATUS={ONLINE:E.PresenceConstatnts.STATUS.ONLINE,OFFLINE:E.PresenceConstatnts.STATUS.OFFLINE},e}();e.UsersRequest=c;var u=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setStatus=function(t){return this.status=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.hideBlockedUsers=function(t){return this.shouldHideBlockedUsers=t,this},t.prototype.setRole=function(t){return this.role=t,this},t.prototype.setRoles=function(t){return this.roles=t,this},t.prototype.friendsOnly=function(t){return this.showFriendsOnly=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.showTags=t,this},t.prototype.setUIDs=function(t){return this.UIDs=t,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new c(this)},t}();e.UsersRequestBuilder=u},function(t,e,n){"use strict";e.__esModule=!0,e.UserStore=void 0;var r=n(0),i=n(1),a=n(2),s=n(12),o=function(){function t(t){this.store=i.constants.DEFAULT_STORE,r.isFalsy(t)||(this.store=t);try{this.userStore=s.default}catch(t){r.Logger.error("UserStore: constructor",{e:t})}}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(t,e){var n=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return this.userStore.setItem(n,JSON.stringify(e))},t.prototype.get=function(t){var s=this,o=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,t);return new Promise(function(n,e){try{s.userStore.getItem(o).then(function(e){try{n(JSON.parse(e))}catch(t){n(e)}},function(t){e(t)})}catch(t){e(new a.CometChatException(t))}})},t.prototype.clear=function(t){},t.prototype.selectStore=function(t){this.store=t},t.prototype.storeUsers=function(t){var e=this;return t.map(function(t){e.set(t.getUid(),t)}),!0},t.prototype.storeUser=function(t){return this.set(t.getUid(),t),!0},t}();e.UserStore=o},function(t,e,n){"use strict";e.__esModule=!0,e.ConversationsRequestBuilder=e.ConversationsRequest=void 0;var o=n(6),s=n(0),r=n(2),i=n(25),a=n(1),E=function(){function t(t){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},s.isFalsy(t)||(this.limit=t.limit,s.isFalsy(t.conversationType)||(this.conversationType=t.conversationType)),s.isFalsy(t.getUserAndGroupTags)||(this.getUserAndGroupTags=t.getUserAndGroupTags),t.tags&&(this.tags=t.tags),s.isFalsy(t.WithTags)||(this.withTags=t.WithTags)}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(s.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(s.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t}();e.ConversationsRequest=E;var c=function(){function t(){this.WithTags=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setConversationType=function(t){return this.conversationType=t,this},t.prototype.withUserAndGroupTags=function(t){return"boolean"==typeof t&&(this.getUserAndGroupTags=t),this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.build=function(){return new E(this)},t}();e.ConversationsRequestBuilder=c},function(t,e,n){"use strict";var A=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function s(t){try{r(E.next(t))}catch(t){e(t)}}function o(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(s,o)}r((E=E.apply(t,i||[])).next())})},R=this&&this.__generator||function(n,s){var o,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]f.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void e(new h.CometChatException(JSON.parse(N.format(JSON.stringify(f.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",f.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(rt&&m.MessageListnerMaping.getInstance().set(f.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(e.id))},function(t){m.MessageListnerMaping.getInstance().set(f.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(e.id))}),s.affix==f.MessageConstatnts.PAGINATION.AFFIX.APPEND?(s.idparseInt(e.id)&&(s.id=parseInt(e.id)),s.timestamp>e.sentAt&&(s.timestamp=e.sentAt),s.updatedAt>e.updatedAt&&(s.updatedAt=e.updatedAt)),s.id&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.ID]=s.id),s.timestamp&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=s.timestamp),s.updatedAt&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=s.updatedAt),n.push(O.MessageController.trasformJSONMessge(e))})):n=[],o(n),[2]})})},function(t){e(new h.CometChatException(t.error))})}catch(t){e(new h.CometChatException(t))}})},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(N.isFalsy(this.guid)||N.isFalsy(this.uid))&&N.isFalsy(this.guid)?(N.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var t={};t[f.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,t[f.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(N.isFalsy(this.guid)||N.isFalsy(this.uid))&&N.isFalsy(this.guid)&&N.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(e){return A(this,void 0,void 0,function(){var n,s=this;return R(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).filter(function(t){return e[t].sender.uid==s.uid}).map(function(t){n=o(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t.prototype.getFilteredNextDataByReceiverId=function(e){return A(this,void 0,void 0,function(){var n,s=this;return R(this,function(t){switch(t.label){case 0:switch(n=[],e){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,r.MessagesStore.getInstance().get(this.uid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 2:return t.sent(),[3,9];case 3:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 4:t.sent(),t.label=5;case 5:return[4,r.MessagesStore.getInstance().get(this.guid).then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).filter(function(t){return e[t].sender.uid==s.uid}).map(function(t){n=o(n,[e[t]])})})];case 6:return t.sent(),[3,9];case 7:return[4,r.MessagesStore.getInstance().getAllMessages().then(function(e){Object.keys(e).filter(function(t){return parseInt(t)>s.id}).map(function(t){n=o(n,[e[t]])})})];case 8:return t.sent(),[3,9];case 9:return[2,n]}})})},t}();e.MessagesRequest=s;var a=function(){function t(){this.maxLimit=f.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=f.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setGUID=function(t){return this.guid=t,this},t.prototype.setUID=function(t){return this.uid=t,this},t.prototype.setParentMessageId=function(t){return this.parentMessageId=t,this},t.prototype.setTimestamp=function(t){return void 0===t&&(t=N.getCurrentTime()),this.timestamp=t,this},t.prototype.setMessageId=function(t){return void 0===t&&(t=f.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=t,this},t.prototype.setUnread=function(t){return void 0===t&&(t=!1),this.unread=t,this},t.prototype.hideMessagesFromBlockedUsers=function(t){return void 0===t&&(t=!1),this.HideMessagesFromBlockedUsers=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKey=t,this},t.prototype.setUpdatedAfter=function(t){return this.updatedAt=t,this},t.prototype.updatesOnly=function(t){return t&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(t){return this.category=t,this},t.prototype.setCategories=function(t){return this.categories=t,this},t.prototype.setType=function(t){return this.type=t,this},t.prototype.setTypes=function(t){return this.types=t,this},t.prototype.hideReplies=function(t){return this.HideReplies=t,this},t.prototype.hideDeletedMessages=function(t){return this.HideDeletedMessages=t,this},t.prototype.setTags=function(t){return this.tags=t,this},t.prototype.withTags=function(t){return this.WithTags=t,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new s(this)},t}();e.MessagesRequestBuilder=a},function(t,e,n){"use strict";var a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,s=arguments.length;nt.getId()&&(i=parseInt(t.getId().toString())),sa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",a.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limitthis.total_pages)return t.page=this.next_page,t;t.page=this.next_page++}return t},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();e.BlockedUsersRequest=E;var c=function(){function t(){}return t.prototype.setLimit=function(t){return this.limit=t,this},t.prototype.setSearchKeyword=function(t){return this.searchKeyword=t,this},t.prototype.setDirection=function(t){return this.direction=t,this},t.prototype.blockedByMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=a.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new E(this)},t}();e.BlockedUsersRequestBuilder=c},function(t,e,n){"use strict";e.__esModule=!0,e.AppSettingsBuilder=e.AppSettings=void 0;var s=n(1),o=function(){function e(t){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=s.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.subscriptionType=t.subscriptionType,this.roles=t.roles,this.region=t.region,this.autoJoinGroup=t.autoJoinGroup,this.establishSocketConnection=t.establishSocketConnection}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=s.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=s.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=s.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=s.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();e.AppSettings=o;var r=function(){function t(){this.subscriptionType=o.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=s.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=o.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(t){return this.subscriptionType=o.SUBSCRIPTION_TYPE_ROLES,this.roles=t,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=o.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(t){return void 0===t&&(t=s.DEFAULT_VALUES.REGION_DEFAULT),this.region=t.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(t){return void 0===t&&(t=!0),this.autoJoinGroup=t,this},t.prototype.autoEstablishSocketConnection=function(t){return void 0===t&&(t=!0),this.establishSocketConnection=t,this},t.prototype.build=function(){return new o(this)},t}();e.AppSettingsBuilder=r},function(t,e,n){"use strict";e.__esModule=!0,e.CometChatHelper=void 0;var S=n(10),C=n(1),p=n(11),T=n(15),_=n(25),s=n(5),o=n(2),r=n(0),i=function(){function t(){}return t.processMessage=function(t){try{return S.MessageController.trasformJSONMessge(t)}catch(t){r.Logger.error("CometChatHelper: processMessage",t)}},t.getConversationFromMessage=function(u){return new Promise(function(E,c){try{s.CometChat.getLoggedinUser().then(function(t){if(null!==t){var e=S.MessageController.trasformJSONMessge(u),n=e.receiverType,s=e.conversationId,o=void 0,r=S.MessageController.trasformJSONMessge(u);if(n==C.MessageConstatnts.RECEIVER_TYPE.USER){var i=p.UsersController.trasformJSONUser(e[C.MessageConstatnts.KEYS.SENDER]);o=i.getUid()==t.getUid()?p.UsersController.trasformJSONUser(e[C.MessageConstatnts.KEYS.RECEIVER]):i}else o=T.GroupsController.trasformJSONGroup(e[C.MessageConstatnts.KEYS.RECEIVER]);var a=_.ConversationController.trasformJSONConversation(s,n,r,o,0,[]);E(a)}else c(C.UserErrors.USER_NOT_LOGGED_IN)},function(t){c(new o.CometChatException(t.error))})}catch(t){c(new o.CometChatException(t))}})},t}();e.CometChatHelper=i},function(t,e,n){"use strict";var s=this&&this.__awaiter||function(t,i,a,E){return new(a||(a=Promise))(function(n,e){function s(t){try{r(E.next(t))}catch(t){e(t)}}function o(t){try{r(E.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(s,o)}r((E=E.apply(t,i||[])).next())})},o=this&&this.__generator||function(n,s){var o,r,i,t,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(i=2&e[0]?r.return:e[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,e[1])).done)return i;switch(r=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,r=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(i=0<(i=a.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]>>((3&e)<<3)&255;return o}}},function(t,e){for(var o=[],n=0;n<256;++n)o[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,s=o;return[s[t[n++]],s[t[n++]],s[t[n++]],s[t[n++]],"-",s[t[n++]],s[t[n++]],"-",s[t[n++]],s[t[n++]],"-",s[t[n++]],s[t[n++]],"-",s[t[n++]],s[t[n++]],s[t[n++]],s[t[n++]],s[t[n++]],s[t[n++]]].join("")}}])}),function(){try{require("@cometchat-pro/react-native-calls")&&(this.CometChatCalling={},this.CometChatCalling.CallScreen=require("@cometchat-pro/react-native-calls").default,this.CometChatCalling.CometChatRTC=require("@cometchat-pro/react-native-calls").CometChatRTC)}catch(t){}}(); \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@react-native-async-storage/async-storage"),require("react"),require("react-native"));else if("function"==typeof define&&define.amd)define(["@react-native-async-storage/async-storage","react","react-native"],t);else{var n="object"==typeof exports?t(require("@react-native-async-storage/async-storage"),require("react"),require("react-native")):t(e["@react-native-async-storage/async-storage"],e.react,e["react-native"]);for(var s in n)("object"==typeof exports?exports:e)[s]=n[s]}}(window,function(n,s,o){return function(n){var s={};function o(e){if(s[e])return s[e].exports;var t=s[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=s,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)o.d(n,s,function(e){return t[e]}.bind(null,s));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=41)}([function(e,x,E){"use strict";(function(P){x.__esModule=!0,x.getCallSettings=x.isCallingComponentInstalled=x.getKeyprefix=x.validateConversationType=x.validateUpdateUser=x.validateCreateUser=x.validateMessage=x.validateChatType=x.validateMsgId=x.validateArray=x.validateHideMessagesFromBlockedUsers=x.validateId=x.validateCreateGroup=x.validateJoinGroup=x.validateUpdateGroup=x.validateScope=x.isAudio=x.isVideo=x.isImage=x.getUpdatedSettings=x.getAppSettings=x.getCurrentTime=x.Logger=x.createUidFromJid=x.format=x.getOrdinalSuffix=x.isFalsy=x.isTruthy=x.isObject=x.getJidHost=x.getChatHost=void 0;var s=E(14),v=E(1),e=E(6),U=E(2),r=E(17),i=E(18),a=E(20),D=E(5),t=E(13),Y=E(32),G=E(42),w=E(15);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 F(e){for(var s=[],t=1;ti[0]&&t[1] All store cleared successfully","true"),e(!0)})}catch(e){l.Logger.error("CometChat: clearCache",e),t(e)}})},T.connect=function(){T.user&&($.connection||(T.disconnectedByUser=!1,T.WSLogin(T.user)),T.didAnalyticsPingStart()||T.isAnalyticsDisabled||(T.pingAnalytics(),T.startAnalyticsPingTimer()))},T.disconnect=function(){T.user&&(T.disconnectedByUser=!0,$.connection&&$.WSLogout(),T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer())},T.prototype.internalRestart=function(e){T.internalRestart||T.getInstance().internalLogout(!1).then(function(){T.internalRestart=!0,T.login(e).then(function(e){T.shouldConnectToWS=!0,T.internalRestart=!1},function(e){l.Logger.error("CometChat: internalRestart :: login",e),T.internalRestart=!1})},function(e){l.Logger.error("CometChat: internalRestart :: internalLogout",e)})},T.prototype.internalLogout=function(n){return void 0===n&&(n=!0),new Promise(function(e,t){try{T.didAnalyticsPingStart()&&T.clearAnalyticsPingTimer(),T.WSReconnectionInProgress&&T.clearWSReconnectionTimer(),T.isLoggedOut=!0,T.WSReconnectionInProgress=!1,T.isAnalyticsDisabled=!1,T.clearCache().then(function(){T.apiKey=void 0,T.user=void 0,T.authToken=void 0,T.cometChat=void 0,T.mode=void 0,$.WSLogout(),n&&T.pushToLoginListener("","Logout_Success"),e(!0)})}catch(e){l.Logger.error("CometChat: internalLogout",e),t(e)}})},T.initialzed=!1,T.CometChatException=_.CometChatException,T.TextMessage=R.TextMessage,T.MediaMessage=C.MediaMessage,T.CustomMessage=w.CustomMessage,T.Action=i.Action,T.Call=o.Call,T.TypingIndicator=Y.TypingIndicator,T.TransientMessage=Q.TransientMessage,T.Group=a.Group,T.User=d.User,T.GroupMember=K.GroupMember,T.Conversation=b.Conversation,T.USER_STATUS={ONLINE:O.PresenceConstatnts.STATUS.ONLINE,OFFLINE:O.PresenceConstatnts.STATUS.OFFLINE},T.MessagesRequest=U.MessagesRequest,T.MessagesRequestBuilder=U.MessagesRequestBuilder,T.UsersRequest=P.UsersRequest,T.UsersRequestBuilder=P.UsersRequestBuilder,T.ConversationsRequest=v.ConversationsRequest,T.ConversationsRequestBuilder=v.ConversationsRequestBuilder,T.BlockedUsersRequest=F.BlockedUsersRequest,T.BlockedUsersRequestBuilder=F.BlockedUsersRequestBuilder,T.GroupsRequest=y.GroupsRequest,T.GroupsRequestBuilder=y.GroupsRequestBuilder,T.GroupMembersRequest=L.GroupMembersRequest,T.GroupMembersRequestBuilder=L.GroupMembersRequestBuilder,T.BannedMembersRequest=M.BannedMembersRequest,T.BannedMembersRequestBuilder=M.BannedMembersRequestBuilder,T.CallSettings=H.CallSettings,T.CallSettingsBuilder=H.CallSettingsBuilder,T.AppSettings=x.AppSettings,T.AppSettingsBuilder=x.AppSettingsBuilder,T.CallingComponent=k.CallingComponent,T.MessageListener=s.MessageListener,T.UserListener=s.UserListener,T.GroupListener=s.GroupListener,T.OngoingCallListener=s.OngoingCallListener,T.CallListener=s.CallListener,T.ConnectionListener=s.ConnectionListener,T.LoginListener=s.LoginListener,T.CallController=f.CallController,T.CometChatHelper=B.CometChatHelper,T.Attachment=V.Attachment,T.MESSAGE_TYPE=O.MessageConstatnts.TYPE,T.CATEGORY_MESSAGE=O.MessageConstatnts.CATEGORY.MESSAGE,T.CATEGORY_ACTION=O.MessageConstatnts.CATEGORY.ACTION,T.CATEGORY_CALL=O.MessageConstatnts.CATEGORY.CALL,T.CATEGORY_CUSTOM=O.MessageConstatnts.CATEGORY.CUSTOM,T.ACTION_TYPE=O.ActionConstatnts.ACTIONS,T.CALL_TYPE=O.CallConstants.CALL_TYPE,T.RECEIVER_TYPE=O.MessageConstatnts.RECEIVER_TYPE,T.CALL_STATUS=O.CallConstants.CALL_STATUS,T.GROUP_MEMBER_SCOPE=O.GROUP_MEMBER_SCOPE,T.GROUP_TYPE=O.GROUP_TYPE,T.MESSAGE_REQUEST=O.MessageConstatnts.PAGINATION.CURSOR_FILEDS,T.CONNECTION_STATUS=O.CONNECTION_STATUS,T.CALL_MODE=O.CallConstants.CALL_MODE,T.AUDIO_MODE=O.CallConstants.AUDIO_MODE,T.WSReconnectionInProgress=!1,T.WSReconnectionTimerInterval=5e3,T.currentConnectionStatus=O.CONNECTION_STATUS.DISCONNECTED,T.isConnectingFromInit=!1,T.loginInProgress=!1,T.internalRestart=!1,T.settingsInterval=6e4,T.isAnalyticsPingStarted=!1,T.isLoggedOut=!0,T.isAnalyticsDisabled=!1,T.disconnectedByUser=!1,T.shouldConnectToWS=!0,T}();t.CometChat=te},function(e,t,n){"use strict";t.__esModule=!0,t.postData=t.makeAdminApiCall=t.makeApiCall=void 0;var E=n(31),c=n(5),u=n(0),C=n(2),S=n(13),p=n(1);function T(n,e,s,t,o){var r;return void 0===n&&(n=""),void 0===e&&(e="GET"),void 0===s&&(s={}),void 0===t&&(t={}),s=u.isFalsy(s)?void 0:("GET"==e&&(n+="?",Object.keys(s).map(function(e,t){n=t===Object.keys(s).length-1?n+e+"="+s[e]:n+e+"="+s[e]+"&"}),s=void 0),o&&(r=new FormData,Object.keys(s).map(function(t){"data"!=t?"tags"==t?s[t].forEach(function(e){r.append(t+"[]",e)}):"metadata"!=t&&r.append(t,s[t]):r.append(t,JSON.stringify(s[t]))})),JSON.stringify(s)),fetch(n,{method:e,mode:"cors",cache:"no-cache",headers:t,redirect:"follow",referrer:"no-referrer",body:o?r:s})}t.makeApiCall=function(o,e,r,i){void 0===o&&(o=""),void 0===e&&(e={}),void 0===r&&(r={});var a=c.CometChat.getInstance(c.CometChat.getAppId());return new Promise(function(n,s){try{E.getEndPoint(o,e).then(function(e){var t={resource:c.CometChat.getSessionId(),appId:c.CometChat.getAppId(),Accept:"application/json",sdk:u.format(p.SDKHeader.sdk,p.SDKHeader.platform,p.SDKHeader.sdkVersion)};i||(t["Content-Type"]="application/json"),e.hasOwnProperty("isAdminApi")&&e.isAdminApi?a.getApiKey()?t.apiKey=a.getApiKey():s({error:{code:"API_KEY_NOT_SET",message:"An apiKey is needed to use the "+o+" api.",name:"API_KEY_NOT_SET"}}):a.getAuthToken()?t.authToken=a.getAuthToken():s({error:{code:"USER_NOT_LOGED_IN",message:"An authToken is need to use the "+o+" end-point. PS- We are aware of the spelling mistake, but in order to maintain backward compatibility we cannot change it :(",name:"User not logged-in"}}),T(e.endpoint,e.method,r,t,i).then(function(e){return e.json()}).then(function(e){if(e.hasOwnProperty("data"))e.data.hasOwnProperty("authToken")&&c.CometChat.setAuthToken(e.data.authToken),n(e);else{if(e.hasOwnProperty("error")){var t=e.error;t.hasOwnProperty("code")&&t.code===p.API_ERROR_CODES.AUTH_ERR_AUTH_TOKEN_NOT_FOUND&&c.CometChat.getInstance().internalLogout().then(function(){u.Logger.log("CometChat: makeApiCall","User logged out")})}s(e)}}).catch(function(e){var t={error:S.FETCH_ERROR.ERROR_IN_API_CALL};s(t)})}).catch(function(e){return s})}catch(e){s(new C.CometChatException(e))}})},t.makeAdminApiCall=function(o,e,r,i){void 0===o&&(o=""),void 0===e&&(e={}),void 0===r&&(r={});var a=c.CometChat.getInstance(c.CometChat.getAppId());return new Promise(function(n,s){E.getEndPoint(o,e).then(function(e){var t={appId:c.CometChat.getAppId(),Accept:"application/json",sdk:u.format(p.SDKHeader.sdk,p.SDKHeader.platform,p.SDKHeader.sdkVersion)};i||(t["Content-Type"]="application/json"),e.hasOwnProperty("isAdminApi")&&e.isAdminApi?a.getApiKey()?t.apiKey=a.getApiKey():s({error:"An apiKey is need to use the "+o+" api."}):a.getAuthToken()?t.authToken=a.getAuthToken():s({error:"An authToken is need to use the "+o+" api."}),T(e.endpoint,e.method,r,t,i).then(function(e){return e.json()}).then(function(e){e.hasOwnProperty("data")?(e.data.hasOwnProperty("authToken")&&c.CometChat.setAuthToken(e.data.authToken),n(e)):s(e)}).catch(function(e){var t={error:S.FETCH_ERROR.ERROR_IN_API_CALL};s(t)})}).catch(function(e){return s})})},t.postData=T},function(e,t,n){"use strict";t.__esModule=!0,t.BaseMessage=void 0;var s=function(){function e(e,t,n,s){this.receiverId=e,this.type=t,this.receiverType=n,this.category=s}return e.prototype.getId=function(){return this.id},e.prototype.setId=function(e){this.id=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}();t.BaseMessage=s},function(e,t,n){"use strict";t.__esModule=!0,t.Group=void 0;var s=n(1),o=function(){function e(e,t,n,s,o,r,i){this.hasJoined=!1,this.membersCount=0,this.guid=e,t&&(this.name=t),n&&(this.type=n),!s&&""!==s||"password"!=n||(this.password=s),(o||""===o)&&(this.icon=o),(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.TYPE=s.GroupType,e.Type=e.TYPE,e}();t.Group=o},function(e,t,n){"use strict";t.__esModule=!0,t.CometChatEvent=void 0;var i=n(0),s=n(4),o=function(){function e(e,t,n,s,o,r){i.isFalsy(e)||(this.appId=e),i.isFalsy(t)||(this.receiver=t),i.isFalsy(n)||(this.receiverType=n),i.isFalsy(o)||(this.deviceId=o),i.isFalsy(s)||(this.sender=s),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[s.KEYS.APP_ID]=this.getAppId(),e[s.KEYS.RECEIVER]=this.getReceiver(),e[s.KEYS.RECEIVER_TYPE]=this.getReceiverType(),e[s.KEYS.DEVICE_ID]=this.getDeviceId(),e[s.KEYS.TYPE]=this.getType(),e[s.KEYS.SENDER]=this.getSender(),i.isFalsy(this.getMessageSender())||(e[s.KEYS.MESSAGE_SENDER]=this.getMessageSender()),e},e}();t.CometChatEvent=o},function(e,t,n){"use strict";t.__esModule=!0,t.MessageController=void 0;var i=n(7),a=n(17),E=n(18),c=n(0),u=n(1),C=n(22),S=n(23),p=n(24),r=n(2),T=n(19),l=n(20),_=n(5),g=n(11),s=function(){function e(){}return e.trasformJSONMessge=function(n){try{var e=null;n.hasOwnProperty("rawMessage")||(e=JSON.parse(JSON.stringify(n)));var t=void 0;switch(n[u.MessageConstatnts.KEYS.CATEGORY]){case u.MessageConstatnts.CATEGORY.ACTION:t=C.Action.actionFromJSON(n);break;case u.MessageConstatnts.CATEGORY.CALL:t=S.Call.callFromJSON(n);break;case u.MessageConstatnts.CATEGORY.MESSAGE:switch(n[u.MessageConstatnts.KEYS.TYPE]){case u.MessageConstatnts.TYPE.TEXT:t=new a.TextMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.TEXT],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case u.MessageConstatnts.TYPE.CUSTOM:t=new l.CustomMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.CUSTOM_DATA],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if(t=new E.MediaMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.URL],n[u.MessageConstatnts.KEYS.TYPE],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),n.hasOwnProperty(u.MessageConstatnts.KEYS.DATA)){var s=n[u.MessageConstatnts.KEYS.DATA];if(s.hasOwnProperty(u.MessageConstatnts.KEYS.ATTATCHMENTS)){var o,r=s[u.MessageConstatnts.KEYS.ATTATCHMENTS];new Array;r.map(function(e){o=new T.Attachment(e)}),t.setAttachment(o)}s.hasOwnProperty(u.MessageConstatnts.KEYS.TEXT)&&t.setCaption(s[u.MessageConstatnts.KEYS.TEXT])}t.hasOwnProperty("file")&&delete t.file}break;case u.MessageConstatnts.CATEGORY.CUSTOM:t=new l.CustomMessage(n[u.MessageConstatnts.KEYS.RECEIVER],n[u.MessageConstatnts.KEYS.DATA][u.MessageConstatnts.KEYS.CUSTOM_DATA],n[u.MessageConstatnts.KEYS.RECEIVER_TYPE],n.type)}n[u.MessageConstatnts.KEYS.MY_RECEIPTS]&&(n[u.MessageConstatnts.KEYS.MY_RECEIPTS]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(n[u.MessageConstatnts.KEYS.MY_RECEIPTS]).map(function(e){var t=new p.MessageReceipt;e==u.DELIVERY_RECEIPTS.DELIVERED_AT&&(t.setReceiptType(t.RECEIPT_TYPE.DELIVERY_RECEIPT),t.setDeliveredAt(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.DELIVERED_AT]),c.isFalsy(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.RECIPIENT])?n[u.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.DELIVERED_AT]:t.setSender(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.DELIVERY_RECEIPTS.RECIPIENT]),t.setReceiverType(n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(n[u.MessageConstatnts.KEYS.RECEIVER])),n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.READ_RECEIPT),t.setReadAt(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]),c.isFalsy(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.RECIPIENT])?n[u.READ_RECEIPTS.READ_BY_ME_AT]=n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.READ_AT]:t.setSender(n[u.MessageConstatnts.KEYS.MY_RECEIPTS][u.READ_RECEIPTS.RECIPIENT]),t.setReceiverType(n[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(n[u.MessageConstatnts.KEYS.RECEIVER]))}));try{if(Object.assign(t,n),(n=t).parentId&&(n.parentMessageId=n.parentId,delete n.parentId),n instanceof i.BaseMessage&&(c.isFalsy(e)||n.setRawMessage(e)),n instanceof a.TextMessage)n.setSender(n.getSender()),n.setReceiver(n.getReceiver()),n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]);else if(n instanceof E.MediaMessage)n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver());else if(n instanceof C.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 S.Call){try{n.setSender(n.getSender())}catch(e){c.Logger.error("MessageController: trasformJSONMessge: setSender",e)}try{n.setCallInitiator(n.getCallInitiator())}catch(e){c.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",e)}try{n.setReceiver(n.getCallReceiver()),n.setCallReceiver(n.getCallReceiver())}catch(e){c.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",e)}}else n instanceof l.CustomMessage&&(n.getData()[u.MessageConstatnts.KEYS.METADATA]&&n.setMetadata(n.getData()[u.MessageConstatnts.KEYS.METADATA]),n.setSubType(n.getData()[u.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),n.setSender(n.getSender()),n.setReceiver(n.getReceiver()))}catch(e){c.Logger.error("MessageController: trasformJSONMessge: Main",e),n=null}return n}catch(e){c.Logger.error("MessageController: trasformJSONMessge",e)}},e.getReceiptsFromJSON=function(o){return new Promise(function(e,t){try{var s=[];_.CometChat.getLoggedInUser().then(function(n){c.isFalsy(o.receipts)?e([]):(o.receipts.data.map(function(e){var t=new p.MessageReceipt;e[u.DELIVERY_RECEIPTS.DELIVERED_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.DELIVERY_RECEIPT),t.setDeliveredAt(e[u.DELIVERY_RECEIPTS.DELIVERED_AT]),t.setTimestamp(e[u.DELIVERY_RECEIPTS.DELIVERED_AT]),c.isFalsy(e[u.DELIVERY_RECEIPTS.RECIPIENT])?t.setSender(n):t.setSender(g.UsersController.trasformJSONUser(e[u.DELIVERY_RECEIPTS.RECIPIENT])),t.setReceiverType(o[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(o[u.MessageConstatnts.KEYS.RECEIVER])),e[u.READ_RECEIPTS.READ_AT]&&(t.setReceiptType(t.RECEIPT_TYPE.READ_RECEIPT),t.setReadAt(e[u.READ_RECEIPTS.READ_AT]),t.setTimestamp(e[e[u.READ_RECEIPTS.READ_AT]]),c.isFalsy(e[u.READ_RECEIPTS.RECIPIENT])?t.setSender(n):t.setSender(g.UsersController.trasformJSONUser(e[u.READ_RECEIPTS.RECIPIENT])),t.setReceiverType(o[u.MessageConstatnts.KEYS.RECEIVER_TYPE]),t.setReceiver(o[u.MessageConstatnts.KEYS.RECEIVER])),s.push(t)}),e(s))})}catch(e){t(new r.CometChatException(e))}})},e}();t.MessageController=s},function(e,t,n){"use strict";t.__esModule=!0,t.UsersController=void 0;var s=n(3),o=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 s.User(e),Object.assign(t,e),e=t}catch(e){o.Logger.error("UsersController:transformJSONUser",e)}return e},e}();t.UsersController=r},function(e,t){e.exports=n},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.LocalStorage=void 0;var r=n(0),i=n(1),a=n(2),s=n(12),o=function(){function e(e){this.store=i.constants.DEFAULT_STORE,r.isFalsy(e)||(this.store=e);try{this.localStore=s.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 s=this,o=r.getKeyprefix(i.LOCAL_STORE.COMMON_STORE,e);return new Promise(function(n,t){try{s.localStore.getItem(o).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 o=this;return new Promise(function(n,t){try{var s=[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)];o.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"},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"},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"}}}return r.prototype.getEndpointData=function(o){return new Promise(function(s,t){try{E.LocalStorage.getInstance().get(a.LOCAL_STORE.KEY_APP_SETTINGS).then(function(e){if(i.isFalsy(e)){var t={};if((new r).uriEndpoints.hasOwnProperty(o))if((t=(new r).uriEndpoints[o]).hasOwnProperty("isAdminApi")){var n=i.format((new r).adminApiUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).adminApiVersion+"/"+t.endpoint;t.endpoint=n}else{n=i.format((new r).baseUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).apiVersion+"/"+t.endpoint;t.endpoint=n}s(t)}else{t={};if((new r).uriEndpoints.hasOwnProperty(o))if((t=(new r).uriEndpoints[o]).hasOwnProperty("isAdminApi"))t.endpoint="https://"+e[a.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+(new r).adminApiVersion+"/"+t.endpoint;else{n="https://"+e[a.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+(new r).apiVersion+"/"+t.endpoint;t.endpoint=n}s(t)}},function(e){var t;(new r).uriEndpoints.hasOwnProperty(o)&&((t=(new r).uriEndpoints[o]).hasOwnProperty(["isAdminApi"])?t.endpoint=i.format((new r).adminApiUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).adminApiVersion+"/"+t.endpoint:t.endpoint=i.format((new r).baseUrl,c.CometChat.getAppId(),c.CometChat.appSettings.getRegion())+(new r).apiVersion+"/"+t.endpoint),s(t)})}catch(e){t(new u.CometChatException(e))}})},r}();t.EndpointFactory=s},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.getEndPoint=void 0;var s=n(29),i=n(2);t.getEndPoint=function(e,r){void 0===e&&(e=""),void 0===r&&(r={});var t=new s.EndpointFactory;return new Promise(function(s,o){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]);s(t)}else o({error:"Unknown endPoint name."})})}catch(e){o(new i.CometChatException(e))}})}},function(e,t,n){"use strict";t.__esModule=!0,t.CallSettingsBuilder=t.CallSettings=void 0;var s=n(1),o=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}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}();t.CallSettings=o;var r=function(){function e(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=s.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={}}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.build=function(){return new o(this)},e}();t.CallSettingsBuilder=r},function(e,t,n){"use strict";var s,o=this&&this.__extends||(s=function(e,t){return(s=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}s(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,r=n(43),C=n(44),S=n(5),p=n(3),T=n(1),l=n(15),_=n(34),g=n(0),d=function(t){function e(e){var r=t.call(this,e)||this;return r.state={shouldLoad:!1},a=e.callsettings,g.getCallSettings(a).then(function(e){var t=e.callSettingsNew,n=e.call,s=(e.CometChatCalls,e.CallEventListener,e.CallScreen),o=e.CometChatRTC;E=t,i=n,c=s,u=o,r.setState({shouldLoad:!0})}),r}return o(e,t),e.prototype.render=function(){return this.state.shouldLoad?r.createElement(C.View,{style:{flex:1,backgroundColor:"#000"}},r.createElement(c,{style:{flex:1,backgroundColor:"#000"},callsettings:E,onCallEnded:function(){g.Logger.log("CallingComponent","oncallEnded")},onCallEndButtonPressed:function(){i?setTimeout(function(){S.CometChat.endCall(a.getSessionId(),!0)},1e3):l.CallController.getInstance().getCallListner()&&l.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null),u.endCall()},onUserJoined:function(e){if(e){var t=void 0;g.isFalsy(e.uid)||g.isFalsy(e.name)||((t=new p.User(e)).setStatus("online"),S.CometChat.user.getUid().toLowerCase()!=t.getUid().toLowerCase()&&l.CallController.getInstance().getCallListner()&&(g.isFalsy(l.CallController.getInstance().getCallListner()._eventListener.onUserJoined)||l.CallController.getInstance().getCallListner()._eventListener.onUserJoined(t)))}},onUserLeft:function(e){if(e){var t=void 0;g.isFalsy(e.uid)||g.isFalsy(e.name)||((t=new p.User(e)).setStatus("online"),S.CometChat.user.getUid().toLowerCase()!=t.getUid().toLowerCase()&&l.CallController.getInstance().getCallListner()&&(g.isFalsy(l.CallController.getInstance().getCallListner()._eventListener.onUserLeft)||l.CallController.getInstance().getCallListner()._eventListener.onUserLeft(t)))}},onUserListChanged:function(e){var n=[];e&&0a.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new r.CometChatException(JSON.parse(s.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 o=n(6),s=n(0),r=n(14),i=n(2),a=n(36),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(),s.isFalsy(e)||(this.limit=e.limit,this.guid=e.guid,s.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),s.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(s.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(s.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(s.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.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 o=n(6),s=n(0),r=n(2),i=n(36),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:[]},s.isFalsy(e)||(this.limit=e.limit,this.guid=e.guid,s.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),s.isFalsy(e.scopes)||(this.scopes=e.scopes))}return e.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new r.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new r.CometChatException(JSON.parse(s.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(s.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.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 o=n(6),s=n(0),r=n(11),i=n(2),a=n(49),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(),s.isFalsy(e)||(this.limit=e.limit,s.isFalsy(e.searchKeyword)||(this.searchKeyword=e.searchKeyword),s.isFalsy(e.status)||(e.status==t.USER_STATUS.ONLINE?this.status=E.PresenceConstatnts.STATUS.AVAILABLE:this.status=e.status),s.isFalsy(e.shouldHideBlockedUsers)||(this.hideBlockedUsers=e.shouldHideBlockedUsers),s.isFalsy(e.showFriendsOnly)||(this.friendsOnly=e.showFriendsOnly),s.isFalsy(e.showTags)||(this.withTags=e.showTags),s.isFalsy(e.role)||(this.role=e.role),s.isFalsy(e.roles)||(this.roles=e.roles),s.isFalsy(e.tags)||(this.tags=e.tags),s.isFalsy(e.UIDs)||(this.UIDs=e.UIDs))}return t.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new i.CometChatException(JSON.parse(s.format(JSON.stringify(E.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new i.CometChatException(JSON.parse(s.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(s.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.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),s=n(12),o=function(){function e(e){this.store=i.constants.DEFAULT_STORE,r.isFalsy(e)||(this.store=e);try{this.userStore=s.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 s=this,o=r.getKeyprefix(i.LOCAL_STORE.USERS_STORE,e);return new Promise(function(n,t){try{s.userStore.getItem(o).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=o},function(e,t,n){"use strict";t.__esModule=!0,t.ConversationsRequestBuilder=t.ConversationsRequest=void 0;var o=n(6),s=n(0),r=n(2),i=n(25),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:[]},s.isFalsy(e)||(this.limit=e.limit,s.isFalsy(e.conversationType)||(this.conversationType=e.conversationType)),s.isFalsy(e.getUserAndGroupTags)||(this.getUserAndGroupTags=e.getUserAndGroupTags),e.tags&&(this.tags=e.tags),s.isFalsy(e.WithTags)||(this.withTags=e.WithTags)}return e.prototype.validateConversationBuilder=function(){return void 0===this.limit?new r.CometChatException(JSON.parse(s.format(JSON.stringify(a.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new r.CometChatException(JSON.parse(s.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(s.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}();t.ConversationsRequest=E;var c=function(){function e(){this.WithTags=!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.build=function(){return new E(this)},e}();t.ConversationsRequestBuilder=c},function(e,t,n){"use strict";var A=this&&this.__awaiter||function(e,i,a,E){return new(a||(a=Promise))(function(n,t){function s(e){try{r(E.next(e))}catch(e){t(e)}}function o(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(s,o)}r((E=E.apply(e,i||[])).next())})},R=this&&this.__generator||function(n,s){var o,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(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=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]f.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void t(new h.CometChatException(JSON.parse(N.format(JSON.stringify(f.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",f.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(re&&m.MessageListnerMaping.getInstance().set(f.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))},function(e){m.MessageListnerMaping.getInstance().set(f.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(t.id))}),s.affix==f.MessageConstatnts.PAGINATION.AFFIX.APPEND?(s.idparseInt(t.id)&&(s.id=parseInt(t.id)),s.timestamp>t.sentAt&&(s.timestamp=t.sentAt),s.updatedAt>t.updatedAt&&(s.updatedAt=t.updatedAt)),s.id&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.ID]=s.id),s.timestamp&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=s.timestamp),s.updatedAt&&(s.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=s.updatedAt),n.push(O.MessageController.trasformJSONMessge(t))})):n=[],o(n),[2]})})},function(e){t(new h.CometChatException(e.error))})}catch(e){t(new h.CometChatException(e))}})},e.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[f.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(N.isFalsy(this.guid)||N.isFalsy(this.uid))&&N.isFalsy(this.guid)?(N.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[f.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,e[f.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(N.isFalsy(this.guid)||N.isFalsy(this.uid))&&N.isFalsy(this.guid)&&N.isFalsy(this.uid)},e.prototype.getFilteredPreviousDataByReceiverId=function(t){return A(this,void 0,void 0,function(){var n,s=this;return R(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)>s.id}).map(function(e){n=o(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)>s.id}).map(function(e){n=o(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)>s.id}).filter(function(e){return t[e].sender.uid==s.uid}).map(function(e){n=o(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)>s.id}).map(function(e){n=o(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e.prototype.getFilteredNextDataByReceiverId=function(t){return A(this,void 0,void 0,function(){var n,s=this;return R(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)>s.id}).map(function(e){n=o(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)>s.id}).map(function(e){n=o(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)>s.id}).filter(function(e){return t[e].sender.uid==s.uid}).map(function(e){n=o(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)>s.id}).map(function(e){n=o(n,[t[e]])})})];case 8:return e.sent(),[3,9];case 9:return[2,n]}})})},e}();t.MessagesRequest=s;var a=function(){function e(){this.maxLimit=f.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=f.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!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=N.getCurrentTime()),this.timestamp=e,this},e.prototype.setMessageId=function(e){return void 0===e&&(e=f.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.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new s(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,s=arguments.length;ne.getId()&&(i=parseInt(e.getId().toString())),sa.DEFAULT_VALUES.USERS_MAX_LIMIT)return new i.CometChatException(JSON.parse(s.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 s=n(1),o=function(){function t(e){this.subscriptionType=t.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=s.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.subscriptionType=e.subscriptionType,this.roles=e.roles,this.region=e.region,this.autoJoinGroup=e.autoJoinGroup,this.establishSocketConnection=e.establishSocketConnection}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.SUBSCRIPTION_TYPE_NONE="NONE",t.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",t.SUBSCRIPTION_TYPE_ROLES="ROLES",t.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",t.REGION_EU=s.DEFAULT_VALUES.REGION_DEFAULT_EU,t.REGION_US=s.DEFAULT_VALUES.REGION_DEFAULT_US,t.REGION_IN=s.DEFAULT_VALUES.REGION_DEFAULT_IN,t.REGION_PRIVATE=s.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,t}();t.AppSettings=o;var r=function(){function e(){this.subscriptionType=o.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=s.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0}return e.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=o.SUBSCRIPTION_TYPE_ALL_USERS,this},e.prototype.subscribePresenceForRoles=function(e){return this.subscriptionType=o.SUBSCRIPTION_TYPE_ROLES,this.roles=e,this},e.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=o.SUBSCRIPTION_TYPE_FRIENDS,this},e.prototype.setRegion=function(e){return void 0===e&&(e=s.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.build=function(){return new o(this)},e}();t.AppSettingsBuilder=r},function(e,t,n){"use strict";t.__esModule=!0,t.CometChatHelper=void 0;var C=n(10),S=n(1),p=n(11),T=n(16),l=n(25),s=n(5),o=n(2),r=n(0),i=function(){function e(){}return e.processMessage=function(e){try{return C.MessageController.trasformJSONMessge(e)}catch(e){r.Logger.error("CometChatHelper: processMessage",e)}},e.getConversationFromMessage=function(u){return new Promise(function(E,c){try{s.CometChat.getLoggedinUser().then(function(e){if(null!==e){var t=C.MessageController.trasformJSONMessge(u),n=t.receiverType,s=t.conversationId,o=void 0,r=C.MessageController.trasformJSONMessge(u);if(n==S.MessageConstatnts.RECEIVER_TYPE.USER){var i=p.UsersController.trasformJSONUser(t[S.MessageConstatnts.KEYS.SENDER]);o=i.getUid()==e.getUid()?p.UsersController.trasformJSONUser(t[S.MessageConstatnts.KEYS.RECEIVER]):i}else o=T.GroupsController.trasformJSONGroup(t[S.MessageConstatnts.KEYS.RECEIVER]);var a=l.ConversationController.trasformJSONConversation(s,n,r,o,0,[]);E(a)}else c(S.UserErrors.USER_NOT_LOGGED_IN)},function(e){c(new o.CometChatException(e.error))})}catch(e){c(new o.CometChatException(e))}})},e}();t.CometChatHelper=i},function(e,y,L){"use strict";(function(o){var n=this&&this.__awaiter||function(e,i,a,E){return new(a||(a=Promise))(function(n,t){function s(e){try{r(E.next(e))}catch(e){t(e)}}function o(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(s,o)}r((E=E.apply(e,i||[])).next())})},s=this&&this.__generator||function(n,s){var o,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(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=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]>>((3&t)<<3)&255;return o}}},function(e,t){for(var o=[],n=0;n<256;++n)o[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,s=o;return[s[e[n++]],s[e[n++]],s[e[n++]],s[e[n++]],"-",s[e[n++]],s[e[n++]],"-",s[e[n++]],s[e[n++]],"-",s[e[n++]],s[e[n++]],"-",s[e[n++]],s[e[n++]],s[e[n++]],s[e[n++]],s[e[n++]],s[e[n++]]].join("")}}])}),function(){try{require("@cometchat-pro/react-native-calls")&&(this.CometChatCalling={},this.CometChatCalling.isCallingComponentInstalled=!0,this.CometChatCalling.CallScreen=require("@cometchat-pro/react-native-calls").default,this.CometChatCalling.CometChatRTC=require("@cometchat-pro/react-native-calls").CometChatRTC,this.CometChatCalling.CometChatCalls=require("@cometchat-pro/react-native-calls").CometChatCalls,this.CometChatCalling.CallEventListener=require("@cometchat-pro/react-native-calls").CallEventListener)}catch(e){}}(); \ No newline at end of file diff --git a/README.md b/README.md index 8ca597e..a8446fb 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This guide demonstrates how to add chat to a React Native App using CometChat Pr [Push Notification](https://prodocs.cometchat.com/docs/extensions-enhanced-push-notification) | [Email Notification](https://prodocs.cometchat.com/docs/extensions-email-notification) | [SMS Notification](https://prodocs.cometchat.com/docs/extensions-sms-notification) | [Thumbnail Generation](https://prodocs.cometchat.com/docs/extensions-thumbnail-generation) | [Link Preview](https://prodocs.cometchat.com/docs/extensions-link-preview) | [Rich Media Preview](https://prodocs.cometchat.com/docs/extensions-rich-media-preview) | [Voice Transcription](https://prodocs.cometchat.com/docs/extensions-voice-transcription) | [Smart Reply](https://prodocs.cometchat.com/docs/extensions-smart-reply) | [Message Translation](https://prodocs.cometchat.com/docs/extensions-message-translation) | [Emojis](https://prodocs.cometchat.com/docs/extensions-emojis) | [Polls](https://prodocs.cometchat.com/docs/extensions-polls) | [Reactions](https://prodocs.cometchat.com/docs/extensions-reactions) | [Stickers](https://prodocs.cometchat.com/docs/extensions-stickers) | [Video Broadcasting](https://prodocs.cometchat.com/docs/extensions-broadcast) | [Collaborative Documents](https://prodocs.cometchat.com/docs/extensions-collaborative-document) | [Collaborative Whiteboards](https://prodocs.cometchat.com/docs/extensions-collaborative-whiteboard) | [Data Masking Filter](https://prodocs.cometchat.com/docs/extensions-data-masking-filter) | [Profanity Filter](https://prodocs.cometchat.com/docs/extensions-profanity-filter) | [Image Moderation](https://prodocs.cometchat.com/docs/extensions-image-moderation)| [Sentiment Analysis](https://prodocs.cometchat.com/docs/extensions-sentiment-analysis) | [In-flight Message Moderation](https://prodocs.cometchat.com/docs/extensions-in-flight-message-moderation) | [Virus & Malware Scanner](https://prodocs.cometchat.com/docs/extensions-virus-malware-scanner) | [XSS Filter](https://prodocs.cometchat.com/docs/extensions-xss-filter) [![Platform](https://img.shields.io/badge/Platform-Javascript-brightgreen)](#) - + ![GitHub repo size](https://img.shields.io/github/repo-size/cometchat-pro/react-native-chat-sdk) ![GitHub contributors](https://img.shields.io/github/contributors/cometchat-pro/react-native-chat-sdk) ![GitHub stars](https://img.shields.io/github/stars/cometchat-pro/react-native-chat-sdk?style=social) @@ -79,7 +79,7 @@ To setup React Native SDK, you need to first register on CometChat Dashboard. [ 1. Run the following command to install the CometChat Pro React Native SDK
```javascript - npm install @cometchat-pro/react-native-chat@3.0.5 --save + npm install @cometchat-pro/react-native-chat@3.0.6 --save ``` You can refer to the below link for instructions on how to do so:
diff --git a/package.json b/package.json index ebbe1b4..093ce62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cometchat-pro/react-native-chat", - "version": "3.0.5", + "version": "3.0.6", "description": "A complete chat solution.", "main": "CometChat.js", "scripts": {