/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/my-workspace-angular-lib@0.1.23/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/*! For license information please see index.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("uikit-resources-lerna"),require("uikit-utils-lerna"),require("@cometchat-pro/chat"),require("@angular/core"),require("@angular/common"),require("my-cstom-package-lit")):"function"==typeof define&&define.amd?define("my-workspace-angular-lib",["uikit-resources-lerna","uikit-utils-lerna","@cometchat-pro/chat","@angular/core","@angular/common","my-cstom-package-lit"],t):"object"==typeof exports?exports["my-workspace-angular-lib"]=t(require("uikit-resources-lerna"),require("uikit-utils-lerna"),require("@cometchat-pro/chat"),require("@angular/core"),require("@angular/common"),require("my-cstom-package-lit")):e["my-workspace-angular-lib"]=t(e["uikit-resources-lerna"],e["uikit-utils-lerna"],e["@cometchat-pro/chat"],e["@angular/core"],e["@angular/common"],e["my-cstom-package-lit"])}(this,((e,t,s,i,o,n)=>(()=>{"use strict";var r,a,l={848:e=>{e.exports=o},900:e=>{e.exports=i},127:e=>{e.exports=s},807:e=>{e.exports=n},245:t=>{t.exports=e},648:e=>{e.exports=t}},h={};function c(e){var t=h[e];if(void 0!==t)return t.exports;var s=h[e]={exports:{}};return l[e](s,s.exports,c),s.exports}a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var s=Object.create(null);c.r(s);var i={};r=r||[null,a({}),a([]),a(a)];for(var o=2&t&&e;"object"==typeof o&&!~r.indexOf(o);o=a(o))Object.getOwnPropertyNames(o).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,c.d(s,i),s},c.d=(e,t)=>{for(var s in t)c.o(t,s)&&!c.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{c.r(d),c.d(d,{AddMembersConfiguration:()=>t.AddMembersConfiguration,AuxiliaryButtonAlignment:()=>e.AuxiliaryButtonAlignment,BannedMembersConfiguration:()=>t.BannedMembersConfiguration,CallButtonsConfiguration:()=>t.CallButtonsConfiguration,CallDetailsConfiguration:()=>t.CallDetailsConfiguration,CallHistoryConfiguration:()=>t.CallHistoryConfiguration,CallingDetailsUtils:()=>t.CallingDetailsUtils,CallingExtension:()=>a,CallingExtensionDecorator:()=>r,CallscreenConfiguration:()=>t.CallscreenConfiguration,ChatConfigurator:()=>o,CollaborativeDocumentConfiguration:()=>t.CollaborativeDocumentConfiguration,CollaborativeDocumentConstants:()=>t.CollaborativeDocumentConstants,CollaborativeDocumentExtension:()=>h,CollaborativeDocumentExtensionDecorator:()=>l,CollaborativeWhiteBoardExtension:()=>p,CollaborativeWhiteBoardExtensionDecorator:()=>u,CollaborativeWhiteboardConfiguration:()=>t.CollaborativeWhiteboardConfiguration,CollaborativeWhiteboardConstants:()=>t.CollaborativeWhiteboardConstants,CometChatAddMembers:()=>va,CometChatAddMembersComponent:()=>pa,CometChatBannedMembers:()=>ba,CometChatBannedMembersComponent:()=>Sa,CometChatCallButtons:()=>Ai,CometChatCallButtonsComponent:()=>$,CometChatCallDetails:()=>_i,CometChatCallDetailsComponent:()=>ki,CometChatCallHistory:()=>Ui,CometChatCallHistoryComponent:()=>Ri,CometChatCallHistoryWithDetails:()=>ca,CometChatCallHistoryWithDetailsComponent:()=>ha,CometChatConversations:()=>Ia,CometChatConversationsComponent:()=>fa,CometChatConversationsWithMessages:()=>Pa,CometChatConversationsWithMessagesComponent:()=>wa,CometChatDetails:()=>Ga,CometChatDetailsComponent:()=>Da,CometChatDetailsOption:()=>e.CometChatDetailsOption,CometChatDetailsTemplate:()=>e.CometChatDetailsTemplate,CometChatGroupMembers:()=>Oa,CometChatGroupMembersComponent:()=>Ba,CometChatGroups:()=>ja,CometChatGroupsComponent:()=>Na,CometChatGroupsWithMessages:()=>Ka,CometChatGroupsWithMessagesComponent:()=>Ha,CometChatIncomingCall:()=>ua,CometChatIncomingCallComponent:()=>da,CometChatList:()=>Mi,CometChatLocalize:()=>e.CometChatLocalize,CometChatMessageBubble:()=>Aa,CometChatMessageBubbleComponent:()=>Ea,CometChatMessageComposer:()=>_a,CometChatMessageComposerAction:()=>e.CometChatMessageComposerAction,CometChatMessageComposerComponent:()=>Ta,CometChatMessageHeader:()=>ma,CometChatMessageHeaderComponent:()=>ga,CometChatMessageList:()=>ka,CometChatMessageListComponent:()=>Ma,CometChatMessageOption:()=>e.CometChatMessageOption,CometChatMessageTemplate:()=>e.CometChatMessageTemplate,CometChatMessages:()=>Va,CometChatMessagesComponent:()=>xa,CometChatOngoingCall:()=>Ei,CometChatOngoingCallComponent:()=>wi,CometChatOption:()=>e.CometChatOption,CometChatOutgoingCall:()=>xi,CometChatOutgoingCallComponent:()=>Q,CometChatPalette:()=>e.CometChatPalette,CometChatTabItem:()=>e.CometChatTabItem,CometChatTheme:()=>e.CometChatTheme,CometChatThemeService:()=>q,CometChatThreadedMessages:()=>Ua,CometChatThreadedMessagesComponent:()=>Ra,CometChatTransferOwnership:()=>La,CometChatTransferOwnershipComponent:()=>Fa,CometChatTypography:()=>e.CometChatTypography,CometChatUIKit:()=>U,CometChatUIKitConstants:()=>e.CometChatUIKitConstants,CometChatUsers:()=>Ca,CometChatUsersComponent:()=>ya,CometChatUsersWithMessages:()=>qa,CometChatUsersWithMessagesComponent:()=>za,CometchatListComponent:()=>Y,ConversationUtils:()=>t.ConversationUtils,ConversationsConfiguration:()=>t.ConversationsConfiguration,CreateGroupConfiguration:()=>t.CreateGroupConfiguration,DataSource:()=>D,DataSourceDecorator:()=>n,DatePatterns:()=>e.DatePatterns,DetailsConfiguration:()=>t.DetailsConfiguration,DetailsUtils:()=>t.DetailsUtils,DocumentIconAlignment:()=>e.DocumentIconAlignment,ExtensionsDataSource:()=>B,GroupMemberUtils:()=>t.GroupMemberUtils,GroupMembersConfiguration:()=>t.GroupMembersConfiguration,GroupsConfiguration:()=>t.GroupsConfiguration,IconButtonAlignment:()=>e.IconButtonAlignment,ImageModerationConfiguration:()=>t.ImageModerationConfiguration,ImageModerationConstants:()=>t.ImageModerationConstants,ImageModerationExtension:()=>m,ImageModerationExtensionDecorator:()=>g,JoinGroupConfiguration:()=>t.JoinGroupConfiguration,LinkPreviewConstants:()=>t.LinkPreviewConstants,LinkPreviewExtension:()=>C,LinkPreviewExtensionDecorator:()=>y,MessageBubbleAlignment:()=>e.MessageBubbleAlignment,MessageBubbleConfiguration:()=>t.MessageBubbleConfiguration,MessageComposerConfiguration:()=>t.MessageComposerConfiguration,MessageHeaderConfiguration:()=>t.MessageHeaderConfiguration,MessageListAlignment:()=>e.MessageListAlignment,MessageListConfiguration:()=>t.MessageListConfiguration,MessageReceiptUtils:()=>t.MessageReceiptUtils,MessageStatus:()=>e.MessageStatus,MessageTranslationConfiguration:()=>t.MessageTranslationConfiguration,MessageTranslationConstants:()=>t.MessageTranslationConstants,MessageTranslationExtension:()=>S,MessageTranslationExtensionDecorator:()=>v,MessageUtils:()=>i,MessagesConfiguration:()=>t.MessagesConfiguration,OutgoingCallConfiguration:()=>t.OutgoingCallConfiguration,Placement:()=>e.Placement,PollsConstants:()=>t.PollsConstants,PollsExtension:()=>f,PollsExtensionDecorator:()=>b,ReactionExtension:()=>T,ReactionExtensionDecorator:()=>I,ReactionsConstants:()=>t.ReactionsConstants,Receipts:()=>e.Receipts,SelectionMode:()=>e.SelectionMode,SmartRepliesConfiguration:()=>t.SmartRepliesConfiguration,SmartRepliesConstants:()=>t.SmartRepliesConstants,SmartReplyExtension:()=>x,SmartReplyExtensionDecorator:()=>M,States:()=>e.States,StickersConfiguration:()=>t.StickersConfiguration,StickersConstants:()=>t.StickersConstants,StickersExtension:()=>E,StickersExtensionDecorator:()=>w,TabAlignment:()=>e.TabAlignment,TextModeratorExtension:()=>k,TextModeratorExtensionDecorator:()=>A,ThreadedMessagesConfiguration:()=>t.ThreadedMessagesConfiguration,ThumbnailGenerationConstants:()=>t.ThumbnailGenerationConstants,ThumbnailGenerationExtension:()=>R,ThumbnailGenerationExtensionDecorator:()=>_,TimestampAlignment:()=>e.TimestampAlignment,TitleAlignment:()=>e.TitleAlignment,TransferOwnershipConfiguration:()=>t.TransferOwnershipConfiguration,UIKitSettings:()=>t.UIKitSettings,UIKitSettingsBuilder:()=>t.UIKitSettingsBuilder,UsersConfiguration:()=>t.UsersConfiguration,fontHelper:()=>e.fontHelper,localize:()=>e.localize});var e=c(245),t=c(648),s=c(127);class i{getEditOption(t){return new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.editMessage,title:(0,e.localize)("EDIT_MESSAGE"),iconURL:"assets/editicon.svg",onClick:null,iconTint:t.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent600()})}getDeleteOption(t){return new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.deleteMessage,title:(0,e.localize)("DELETE"),iconURL:"assets/deleteicon.svg",onClick:null,iconTint:t.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent600()})}getReplyInThreadOption(t){return new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.replyInThread,title:(0,e.localize)("REPLY_IN_THREAD"),iconURL:"assets/threadicon.svg",onClick:null,iconTint:t.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent600()})}getCopyOption(t){return new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.copyMessage,title:(0,e.localize)("COPY_MESSAGE"),iconURL:"assets/Copy.svg",onClick:null,iconTint:t.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent600()})}isSentByMe(e,t){return e.getUid()===t.getSender().getUid()}getTextMessageOptions(t,s,i,n){let r=this.isSentByMe(t,s),a=!1;null==n||n.getScope(),e.CometChatUIKitConstants.groupMemberScope.moderator;let l=[];return l=o.getDataSource().getCommonOptions(t,s,i,n),r&&l.push(this.getEditOption(i)),l.push(this.getCopyOption(i)),l}getImageMessageOptions(e,t,s,i){let n=[];return n=o.getDataSource().getCommonOptions(e,t,s,i),n}getVideoMessageOptions(e,t,s,i){let n=[];return n=o.getDataSource().getCommonOptions(e,t,s,i),n}getAudioMessageOptions(e,t,s,i){let n=[];return n=o.getDataSource().getCommonOptions(e,t,s,i),n}getFileMessageOptions(e,t,s,i){let n=[];return n=o.getDataSource().getCommonOptions(e,t,s,i),n}getBottomView(e,t){return null}getTextMessageTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.text,category:e.CometChatUIKitConstants.MessageCategory.message,options:o.getDataSource().getMessageOptions})}getAudioMessageTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.audio,category:e.CometChatUIKitConstants.MessageCategory.message,options:o.getDataSource().getMessageOptions})}getVideoMessageTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.video,category:e.CometChatUIKitConstants.MessageCategory.message,options:o.getDataSource().getMessageOptions})}getImageMessageTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.image,category:e.CometChatUIKitConstants.MessageCategory.message,options:o.getDataSource().getMessageOptions})}getGroupActionTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.groupMember,category:e.CometChatUIKitConstants.MessageCategory.action})}getFileMessageTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.file,category:e.CometChatUIKitConstants.MessageCategory.message,options:o.getDataSource().getMessageOptions})}getAllMessageTemplates(){return[o.getDataSource().getTextMessageTemplate(),o.getDataSource().getImageMessageTemplate(),o.getDataSource().getVideoMessageTemplate(),o.getDataSource().getAudioMessageTemplate(),o.getDataSource().getFileMessageTemplate(),o.getDataSource().getGroupActionTemplate()]}getMessageTemplate(t,s){let i=null;if(s!=e.CometChatUIKitConstants.MessageCategory.call)switch(t){case e.CometChatUIKitConstants.MessageTypes.text:i=o.getDataSource().getTextMessageTemplate();break;case e.CometChatUIKitConstants.MessageTypes.image:i=o.getDataSource().getImageMessageTemplate();break;case e.CometChatUIKitConstants.MessageTypes.video:i=o.getDataSource().getVideoMessageTemplate();break;case e.CometChatUIKitConstants.MessageTypes.groupMember:i=o.getDataSource().getGroupActionTemplate();break;case e.CometChatUIKitConstants.MessageTypes.file:i=o.getDataSource().getFileMessageTemplate();break;case e.CometChatUIKitConstants.MessageTypes.audio:i=o.getDataSource().getAudioMessageTemplate()}return i}getMessageOptions(t,s,i,n){var r;let a=[],l=!1;if(t.getUid()==(null===(r=s.getSender())||void 0===r?void 0:r.getUid())&&!0,s.getCategory()==e.CometChatUIKitConstants.MessageCategory.message)switch(s.getType()){case e.CometChatUIKitConstants.MessageTypes.text:a=o.getDataSource().getTextMessageOptions(t,s,i,n);break;case e.CometChatUIKitConstants.MessageTypes.image:a=o.getDataSource().getImageMessageOptions(t,s,i,n);break;case e.CometChatUIKitConstants.MessageTypes.video:a=o.getDataSource().getVideoMessageOptions(t,s,i,n);break;case e.CometChatUIKitConstants.MessageTypes.groupMember:a=[];break;case e.CometChatUIKitConstants.MessageTypes.file:a=o.getDataSource().getFileMessageOptions(t,s,i,n);break;case e.CometChatUIKitConstants.MessageTypes.audio:a=o.getDataSource().getAudioMessageOptions(t,s,i,n)}else s.getCategory()==e.CometChatUIKitConstants.MessageCategory.custom&&(a=o.getDataSource().getCommonOptions(t,s,i,n));return a}getCommonOptions(t,s,i,o){let n=this.isSentByMe(t,s),r=!1;(null==o?void 0:o.getScope())==e.CometChatUIKitConstants.groupMemberScope.moderator&&(r=!0);let a=[];return 1!=n&&1!=r||a.push(this.getDeleteOption(i)),s.getParentMessageId()||a.push(this.getReplyInThreadOption(i)),a}getAllMessageTypes(){return[e.CometChatUIKitConstants.MessageTypes.text,e.CometChatUIKitConstants.MessageTypes.image,e.CometChatUIKitConstants.MessageTypes.audio,e.CometChatUIKitConstants.MessageTypes.video,e.CometChatUIKitConstants.MessageTypes.file,e.CometChatUIKitConstants.MessageTypes.groupMember]}addList(){return"<Message Utils>"}getAllMessageCategories(){return[e.CometChatUIKitConstants.MessageCategory.message,e.CometChatUIKitConstants.MessageCategory.action]}getAuxiliaryOptions(e,t,s){return null}getId(){return"messageUtils"}getActionMessage(t){try{if(!(t instanceof s.CometChat.Action))return"";{const s=t.getAction(),i=t.getActionBy(),o=t.getActionOn(),n=i.getName(),r=s===e.CometChatUIKitConstants.groupMemberAction.JOINED||s===e.CometChatUIKitConstants.groupMemberAction.LEFT?"":o.getName();switch(s){case e.CometChatUIKitConstants.groupMemberAction.ADDED:return`${n} ${(0,e.localize)("ADDED")} ${r}`;case e.CometChatUIKitConstants.groupMemberAction.JOINED:return`${n} ${(0,e.localize)("JOINED")}`;case e.CometChatUIKitConstants.groupMemberAction.LEFT:return`${n} ${(0,e.localize)("LEFT")}`;case e.CometChatUIKitConstants.groupMemberAction.KICKED:return`${n} ${(0,e.localize)("KICKED")} ${r}`;case e.CometChatUIKitConstants.groupMemberAction.BANNED:return`${n} ${(0,e.localize)("BANNED")} ${r}`;case e.CometChatUIKitConstants.groupMemberAction.UNBANNED:return`${n} ${(0,e.localize)("UNBANNED")} ${r}`;case e.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE:return`${n} ${(0,e.localize)("MADE")} ${r} ${t.getNewScope()}`;default:return""}}}catch(e){return""}}imageAttachmentOption(t){return new e.CometChatMessageComposerAction({id:e.CometChatUIKitConstants.MessageTypes.image,title:(0,e.localize)("ATTACH_IMAGE"),iconURL:"assets/photolibrary.svg",onClick:null,iconTint:t.palette.getAccent700(),titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent700(),borderRadius:"8px",background:t.palette.getAccent100()})}videoAttachmentOption(t){return new e.CometChatMessageComposerAction({id:e.CometChatUIKitConstants.MessageTypes.video,title:(0,e.localize)("ATTACH_VIDEO"),iconURL:"assets/video.svg",onClick:null,iconTint:t.palette.getAccent700(),titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent700(),borderRadius:"8px",background:t.palette.getAccent100()})}audioAttachmentOption(t){return new e.CometChatMessageComposerAction({id:e.CometChatUIKitConstants.MessageTypes.audio,title:(0,e.localize)("ATTACH_AUDIO"),iconURL:"assets/audio-file.svg",onClick:null,iconTint:t.palette.getAccent700(),titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent700(),borderRadius:"8px",background:t.palette.getAccent100()})}fileAttachmentOption(t){return new e.CometChatMessageComposerAction({id:e.CometChatUIKitConstants.MessageTypes.file,title:(0,e.localize)("ATTACH_FILE"),iconURL:"assets/attachment-file.svg",onClick:null,iconTint:t.palette.getAccent700(),titleFont:(0,e.fontHelper)(t.typography.subtitle1),titleColor:t.palette.getAccent700(),borderRadius:"8px",background:t.palette.getAccent100()})}getAttachmentOptions(e,t,s,i){return[this.imageAttachmentOption(e),this.videoAttachmentOption(e),this.audioAttachmentOption(e),this.fileAttachmentOption(e)]}getLastConversationMessage(e,s){return t.ConversationUtils.getLastConversationMessage(e,s)}}class o{static init(e){this.dataSource=null!=e?e:new i,this.names.push(this.dataSource.getId())}static enable(e){let t=e(this.dataSource);this.names.find((e=>e==t.getId()))||(this.dataSource=t,this.names.push(this.dataSource.getId()))}static getDataSource(){return this.dataSource}}o.names=["message utils"];class n{constructor(e){this.dataSource=e}getTextMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getTextMessageOptions(e,t,s,o)}getImageMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getImageMessageOptions(e,t,s,o)}getVideoMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getVideoMessageOptions(e,t,s,o)}getAudioMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getAudioMessageOptions(e,t,s,o)}getFileMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getFileMessageOptions(e,t,s,o)}getTextMessageTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getTextMessageTemplate()}getImageMessageTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getImageMessageTemplate()}getVideoMessageTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getVideoMessageTemplate()}getAudioMessageTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getAudioMessageTemplate()}getFileMessageTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getFileMessageTemplate()}getGroupActionTemplate(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getGroupActionTemplate()}getAllMessageTemplates(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getAllMessageTemplates()}getMessageTemplate(e,t){var s;return(null!==(s=this.dataSource)&&void 0!==s?s:new i).getMessageTemplate(e,t)}getMessageOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getMessageOptions(e,t,s,o)}getCommonOptions(e,t,s,o){var n;return(null!==(n=this.dataSource)&&void 0!==n?n:new i).getCommonOptions(e,t,s,o)}getDeleteOption(e){var t;return(null!==(t=this.dataSource)&&void 0!==t?t:new i).getDeleteOption(e)}getReplyInThreadOption(e){var t;return(null!==(t=this.dataSource)&&void 0!==t?t:new i).getReplyInThreadOption(e)}getEditOption(e){var t;return(null!==(t=this.dataSource)&&void 0!==t?t:new i).getEditOption(e)}getAttachmentOptions(t=new e.CometChatTheme({}),s,o,n){var r;return(null!==(r=this.dataSource)&&void 0!==r?r:new i).getAttachmentOptions(t,s,o,n)}getAllMessageTypes(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getAllMessageTypes()}getAllMessageCategories(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getAllMessageCategories()}getAuxiliaryOptions(e,t,s){var o;return(null!==(o=this.dataSource)&&void 0!==o?o:new i).getAuxiliaryOptions(e,t,s)}getId(){var e;return(null!==(e=this.dataSource)&&void 0!==e?e:new i).getId()}getLastConversationMessage(e,t){var s;return(null!==(s=this.dataSource)&&void 0!==s?s:new i).getLastConversationMessage(e,t)}}class r extends n{constructor(e){super(e),this.onLogout()}onLogout(){s.CometChat.addLoginListener("logout_listener",new s.CometChat.LoginListener({logoutSuccess:()=>{let e=s.CometChat.getActiveCall();e&&s.CometChat.endCall(e.getSessionId())},logoutFailure:e=>{console.log("LoginListener :: logoutFailure",e)}}))}getAllMessageTypes(){const t=super.getAllMessageTypes();return t.includes(e.CometChatUIKitConstants.calls.meeting)||t.push(e.CometChatUIKitConstants.calls.meeting),t.includes(e.CometChatUIKitConstants.MessageTypes.audio)||t.push(e.CometChatUIKitConstants.MessageTypes.audio),t.includes(e.CometChatUIKitConstants.MessageTypes.video)||t.push(e.CometChatUIKitConstants.MessageTypes.video),t}getId(){return"calling"}getAllMessageCategories(){const t=super.getAllMessageCategories();return t.includes(e.CometChatUIKitConstants.MessageCategory.call)||t.push(e.CometChatUIKitConstants.MessageCategory.call),t.includes(e.CometChatUIKitConstants.MessageCategory.custom)||t.push(e.CometChatUIKitConstants.MessageCategory.custom),t}checkIfTemplateTypeExist(e,t){return e.some((e=>e.type===t))}checkIfTemplateCategoryExist(e,t){return e.some((e=>e.category===t))}getAllMessageTemplates(){const t=super.getAllMessageTemplates();return this.checkIfTemplateTypeExist(t,e.CometChatUIKitConstants.calls.meeting)||t.push(this.getDirectCallTemplate()),this.checkIfTemplateCategoryExist(t,e.CometChatUIKitConstants.MessageCategory.call)||t.push(...this.getDefaultCallTemplate()),t}getDirectCallTemplate(){return new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.calls.meeting,category:e.CometChatUIKitConstants.MessageCategory.custom,options:(e,t,s,i)=>o.getDataSource().getCommonOptions(e,t,s,i)})}getDefaultCallTemplate(){return[new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.audio,category:e.CometChatUIKitConstants.MessageCategory.call}),new e.CometChatMessageTemplate({type:e.CometChatUIKitConstants.MessageTypes.video,category:e.CometChatUIKitConstants.MessageCategory.call})]}getLastConversationMessage(s,i){let o="";if(s.getLastMessage()&&s.getLastMessage().category==e.CometChatUIKitConstants.MessageCategory.call){let e=s.getLastMessage();o=t.CallingDetailsUtils.getCallStatus(e,i)}else if(s.getLastMessage()&&s.getLastMessage().type==e.CometChatUIKitConstants.calls.meeting){let t=s.getLastMessage();o=t.getSender()&&t.getSender().getUid()!=i.getUid()?`${t.getSender().getName()}  ${(0,e.localize)("INITIATED_GROUP_CALL")}`:(0,e.localize)("YOU_INITIATED_GROUP_CALL")}else o=super.getLastConversationMessage(s,i);return o}}class a{constructor(){}enable(){o.enable((e=>new r(e)))}}class l extends n{constructor(e,t){super(e),this.configuration=t}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(t.CollaborativeDocumentConstants.extension_document)||e.push(t.CollaborativeDocumentConstants.extension_document),e}getId(){return"collaborativedocument"}getAllMessageCategories(){const t=super.getAllMessageCategories();return t.includes(e.CometChatUIKitConstants.MessageCategory.custom)||t.push(e.CometChatUIKitConstants.MessageCategory.custom),t}checkIfTemplateExist(e,t){return e.some((e=>e.type===t))}getAllMessageTemplates(){const e=super.getAllMessageTemplates();return this.checkIfTemplateExist(e,t.CollaborativeDocumentConstants.extension_document)||e.push(this.getDocumentTemplate()),e}getDocumentTemplate(){return new e.CometChatMessageTemplate({type:t.CollaborativeDocumentConstants.extension_document,category:e.CometChatUIKitConstants.MessageCategory.custom,options:(e,t,s,i)=>o.getDataSource().getCommonOptions(e,t,s,i)})}getAttachmentOptions(i=new e.CometChatTheme({}),o,n,r){if(null==r?void 0:r.parentMessageId)return super.getAttachmentOptions(i,o,n,r);{let a=o?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group,l=o?o.getUid():null==n?void 0:n.getGuid();const h=super.getAttachmentOptions(i,o,n,r);let c=new e.CometChatMessageComposerAction({id:t.CollaborativeDocumentConstants.document,title:(0,e.localize)("COLLABORATIVE_DOCUMENT"),iconURL:"assets/collaborativedocument.svg",iconTint:i.palette.getAccent700(),titleColor:i.palette.getAccent600(),titleFont:(0,e.fontHelper)(i.typography.subtitle1),background:i.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(t.CollaborativeDocumentConstants.document,t.CollaborativeDocumentConstants.post,t.CollaborativeDocumentConstants.v1_create,{receiver:l,receiverType:a}).then((e=>{})).catch((e=>{console.log(e)}))}});return h.push(c),h}}getLastConversationMessage(s,i){const o=s.getLastMessage();return null!=o&&o.getType()==t.CollaborativeDocumentConstants.extension_document&&o.getCategory()==e.CometChatUIKitConstants.MessageCategory.custom?(0,e.localize)("CUSTOM_MESSAGE_DOCUMENT"):super.getLastConversationMessage(s,i)}}class h{constructor({configuration:e}={}){this.configuration=e}enable(){o.enable((e=>new l(e,this.configuration)))}}class u extends n{constructor(e,t){super(e),this.configuration=t}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(t.CollaborativeWhiteboardConstants.extension_whiteboard)||e.push(t.CollaborativeWhiteboardConstants.extension_whiteboard),e}getId(){return"collaborativewhiteboard"}getAllMessageCategories(){const t=super.getAllMessageCategories();return t.includes(e.CometChatUIKitConstants.MessageCategory.custom)||t.push(e.CometChatUIKitConstants.MessageCategory.custom),t}checkIfTemplateExist(e,t){return e.some((e=>e.type===t))}getAllMessageTemplates(){const e=super.getAllMessageTemplates();return this.checkIfTemplateExist(e,t.CollaborativeWhiteboardConstants.extension_whiteboard)||e.push(this.getWhiteBoardTemplate()),e}getWhiteBoardTemplate(){return new e.CometChatMessageTemplate({type:t.CollaborativeWhiteboardConstants.extension_whiteboard,category:e.CometChatUIKitConstants.MessageCategory.custom,options:(e,t,s,i)=>o.getDataSource().getCommonOptions(e,t,s,i)})}getAttachmentOptions(i=new e.CometChatTheme({}),o,n,r){if(null==r?void 0:r.parentMessageId)return super.getAttachmentOptions(i,o,n,r);{let a=o?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group,l=o?o.getUid():null==n?void 0:n.getGuid();const h=super.getAttachmentOptions(i,o,n,r);let c=new e.CometChatMessageComposerAction({id:t.CollaborativeWhiteboardConstants.whiteboard,title:(0,e.localize)("COLLABORATIVE_WHITEBOARD"),iconURL:"assets/collaborativewhiteboard.svg",iconTint:i.palette.getAccent700(),titleColor:i.palette.getAccent600(),titleFont:(0,e.fontHelper)(i.typography.subtitle1),background:i.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(t.CollaborativeWhiteboardConstants.whiteboard,t.CollaborativeWhiteboardConstants.post,t.CollaborativeWhiteboardConstants.v1_create,{receiver:l,receiverType:a}).then((e=>{})).catch((e=>{console.log(e)}))}});return h.push(c),h}}getLastConversationMessage(s,i){const o=s.getLastMessage();return null!=o&&o.getType()==t.CollaborativeWhiteboardConstants.extension_whiteboard&&o.getCategory()==e.CometChatUIKitConstants.MessageCategory.custom?(0,e.localize)("CUSTOM_MESSAGE_WHITEBOARD"):super.getLastConversationMessage(s,i)}}class p{constructor({configuration:e}={}){this.configuration=e}enable(){o.enable((e=>new u(e,this.configuration)))}}class g extends n{constructor(e){super(e)}getId(){return"imagemoderation"}}class m{constructor(){}enable(){o.enable((e=>new g(e)))}}class y extends n{constructor(e){super(e)}getId(){return"linkpreview"}}class C{constructor(){}enable(){o.enable((e=>new y(e)))}}class v extends n{constructor(e,s=new t.MessageTranslationConfiguration({})){super(e),this.configuration=s}getTextMessageOptions(t,s,i,o){let n=super.getTextMessageOptions(t,s,i,o);if(!this.checkIfOptionExist(n,e.CometChatUIKitConstants.MessageOption.translateMessage)){let t=new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.translateMessage,title:(0,e.localize)("TRANSLATE_MESSAGE"),iconURL:"assets/translation.svg",onClick:null,iconTint:i.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(i.typography.subtitle1),titleColor:i.palette.getAccent600()});n.push(t)}return n}checkIfOptionExist(e,t){return e.some((e=>e.id===t))}getId(){return"messagetranslation"}}class S{constructor({configuration:e}={}){this.configuration=e}enable(){o.enable((e=>new v(e,this.configuration)))}}class b extends n{constructor(e){super(e)}getId(){return"polls"}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(t.PollsConstants.extension_poll)||e.push(t.PollsConstants.extension_poll),e}getAllMessageCategories(){const t=super.getAllMessageCategories();return t.includes(e.CometChatUIKitConstants.MessageCategory.custom)||t.push(e.CometChatUIKitConstants.MessageCategory.custom),t}checkIfTemplateExist(e,t){return e.some((e=>e.type===t))}getAllMessageTemplates(){const e=super.getAllMessageTemplates();return this.checkIfTemplateExist(e,t.PollsConstants.extension_poll)||e.push(this.getPollsTemplate()),e}getPollsTemplate(){return new e.CometChatMessageTemplate({type:t.PollsConstants.extension_poll,category:e.CometChatUIKitConstants.MessageCategory.custom,options:(e,t,s,i)=>o.getDataSource().getCommonOptions(e,t,s,i)})}getAttachmentOptions(s=new e.CometChatTheme({}),i,o,n){if(null==n?void 0:n.parentMessageId)return super.getAttachmentOptions(s,i,o,n);{const r=super.getAttachmentOptions(s,i,o,n);let a=new e.CometChatMessageComposerAction({id:t.PollsConstants.extension_poll,title:(0,e.localize)("POLLS"),iconURL:"assets/polls.svg",iconTint:s.palette.getAccent700(),titleColor:s.palette.getAccent600(),titleFont:(0,e.fontHelper)(s.typography.subtitle1),background:s.palette.getAccent100(),onClick:null});return r.push(a),r}}getLastConversationMessage(s,i){const o=s.getLastMessage();return null!=o&&o.getType()==t.PollsConstants.extension_poll&&o.getCategory()==e.CometChatUIKitConstants.MessageCategory.custom?(0,e.localize)("CUSTOM_MESSAGE_POLL"):super.getLastConversationMessage(s,i)}}class f{constructor(){}enable(){o.enable((e=>new b(e)))}}class I extends n{constructor(e){super(e)}getCommonOptions(t,s,i,o){let n=super.getCommonOptions(t,s,i,o);if(!this.checkIfOptionExist(n,e.CometChatUIKitConstants.MessageOption.reactToMessage)){let t=new e.CometChatMessageOption({id:e.CometChatUIKitConstants.MessageOption.reactToMessage,iconURL:"assets/Reactionsicon.svg",onClick:null,iconTint:i.palette.getAccent600(),backgroundColor:"transparent",titleFont:(0,e.fontHelper)(i.typography.subtitle1),titleColor:i.palette.getAccent600()});n.push(t)}return n}checkIfOptionExist(e,t){return e.some((e=>e.id===t))}getId(){return"reactions"}}class T{constructor(){}enable(){o.enable((e=>new I(e)))}}class M extends n{constructor(i,o=new t.SmartRepliesConfiguration({})){var n;super(i),this.LISTENER_ID="smartreply__listener",this.currentMessage=null,this.sendReply=(i,o,n,r="",a=!1)=>{let l=this.activeUser?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group;if(i&&i.trim().length>0&&o){let n;if(o.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user)n=new s.CometChat.TextMessage(o.getSender().getUid(),i.trim(),l),n.setReceiver(this.activeUser);else{const e=o.getReceiver();n=new s.CometChat.TextMessage(e.getGuid(),i.trim(),l),n.setReceiver(this.activeGroup)}o.getParentMessageId()>0&&n.setParentMessageId(o.getParentMessageId()),n.setCategory(e.CometChatUIKitConstants.MessageCategory.message),n.setSender(this.loggedInUser),n.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),n.setMuid(t.CometChatUIKitUtility.ID()),e.CometChatMessageEvents.ccMessageSent.next({message:n,status:e.MessageStatus.inprogress}),a||t.CometChatSoundManager.play(null!=r?r:t.CometChatSoundManager.Sound.outgoingMessage),s.CometChat.sendMessage(n).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((t=>{n.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:n,status:e.MessageStatus.error})}))}},this.configuration=o,this.addMessageListener(),(null===(n=this.configuration)||void 0===n?void 0:n.ccSmartRepliesClicked)||(this.configuration.ccSmartRepliesClicked=this.sendReply)}addMessageListener(){s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{console.log(e)})),s.CometChat.addMessageListener(this.LISTENER_ID,{onTextMessageReceived:t=>{null!=t&&(t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user&&null!=this.activeUser?null!=t.getSender()&&null!=t.getSender().getUid()&&this.activeUser.getUid()==t.getSender().getUid()&&e.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:t}):t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.group&&null!=this.activeGroup&&null!=this.activeGroup.getGuid()&&this.activeGroup.getGuid()==t.getReceiverId()&&e.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:t}))}}),e.CometChatUIEvents.ccActiveChatChanged.subscribe((t=>{this.currentMessage=t.message,this.activeUser=t.user,this.activeGroup=t.group,null!=t.message&&t.message.getType()==e.CometChatUIKitConstants.MessageTypes.text&&null!=t.message.getSender()&&null!=this.loggedInUser&&null!=t.message.getSender().getUid()&&t.message.getSender().getUid()!=this.loggedInUser.getUid()&&e.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:t.message})})),e.CometChatMessageEvents.ccMessageSent.subscribe((()=>{e.CometChatUIEvents.ccHidePanel.next(),this.currentMessage=null}))}getId(){return"smartreply"}}class x{constructor({configuration:e}={}){this.configuration=e}enable(){o.enable((e=>new M(e,this.configuration)))}}class w extends n{constructor(i,o=new t.StickersConfiguration({})){var n;super(i),this.sendStickerMessage=(i,o,n,r,a,l,h="",c=!1)=>{let d=(null==n?void 0:n.getUid())||(null==r?void 0:r.getGuid()),u=n?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group;try{const o={sticker_url:i.url,sticker_name:i.name},n=t.StickersConstants.sticker,r=new s.CometChat.CustomMessage(d,u,n,o);a&&r.setParentMessageId(a),r.setMetadata({incrementUnreadCount:!0}),r.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),r.setMuid(t.CometChatUIKitUtility.ID()),e.CometChatMessageEvents.ccMessageSent.next({message:r,status:e.MessageStatus.inprogress}),c||t.CometChatSoundManager.play(null!=h?h:t.CometChatSoundManager.Sound.outgoingMessage),s.CometChat.sendCustomMessage(r).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((t=>{r.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:r,status:e.MessageStatus.error})}))}catch(e){l&&l(e)}},this.newDataScorce=i,this.configuration=o,(null===(n=this.configuration)||void 0===n?void 0:n.ccStickerClicked)||(this.configuration.ccStickerClicked=this.sendStickerMessage)}getDataScorce(){return this.newDataScorce}getAllMessageTemplates(){let e=super.getAllMessageTemplates();return this.checkIfTemplateExist(e,t.StickersConstants.sticker)||e.push(this.getStickerTemplate()),e}getAuxiliaryOptions(e,s,i){return{configuration:this.configuration,id:t.StickersConstants.sticker}}getStickerTemplate(){return new e.CometChatMessageTemplate({type:t.StickersConstants.sticker,category:e.CometChatUIKitConstants.MessageCategory.custom,options:(e,t,s,i)=>o.getDataSource().getCommonOptions(e,t,s,i)})}checkIfTemplateExist(e,t){return e.some((e=>e.type===t))}getAllMessageCategories(){let t=super.getAllMessageCategories();return t.some((t=>t===e.CometChatUIKitConstants.MessageCategory.custom))||t.push(e.CometChatUIKitConstants.MessageCategory.custom),t}getAllMessageTypes(){let s=super.getAllMessageTypes();return s.some((t=>t===e.CometChatUIKitConstants.MessageCategory.custom))||s.push(t.StickersConstants.sticker),s}getId(){return"stickers"}getLastConversationMessage(s,i){const o=s.getLastMessage();return null!=o&&o.getType()==t.StickersConstants.sticker&&o.getCategory()==e.CometChatUIKitConstants.MessageCategory.custom?(0,e.localize)("CUSTOM_MESSAGE_STICKER"):super.getLastConversationMessage(s,i)}}class E{constructor({configuration:e}={}){this.configuration=e}enable(){o.enable((e=>new w(e,this.configuration)))}}class A extends n{constructor(e){super(e)}getId(){return"textmoderator"}getModeratedtext(e){var s;let i=t.CometChatUIKitUtility.getExtensionData(e);return(null===(s=null==i?void 0:i.trim())||void 0===s?void 0:s.length)>0?i:e.getText()}getLastConversationMessage(t,s){const i=t.getLastMessage();return i&&!i.getDeletedAt()&&i.getType()===e.CometChatUIKitConstants.MessageTypes.text&&i.getCategory()===e.CometChatUIKitConstants.MessageCategory.message?this.getModeratedtext(i):super.getLastConversationMessage(t,s)}}class k{constructor(){}enable(){o.enable((e=>new A(e)))}}class _ extends n{constructor(e){super(e)}getId(){return"thumbnailgeneration"}}class R{constructor(){}enable(){o.enable((e=>new _(e)))}}class U{static init(e){if(U.uiKitSettings=e,!U.checkAuthSettings())return;const t=new s.CometChat.AppSettingsBuilder;e.getRoles()?t.subscribePresenceForRoles(e.getRoles()):"ALL_USERS"===e.getSubscriptionType()?t.subscribePresenceForAllUsers():"FRIENDS"===e.getSubscriptionType()&&t.subscribePresenceForFriends(),t.autoEstablishSocketConnection(e.isAutoEstablishSocketConnection()),t.setRegion(e.getRegion());const i=t.build();return new Promise(((t,n)=>{s.CometChat.init(null==e?void 0:e.appId,i).then((()=>{s.CometChat.getLoggedinUser().then((e=>(e&&(o.init(),this.initiateAfterLogin()),t(e)))).catch((e=>(console.log(e),n(e))))})).catch((e=>n(e)))}))}static enableCalling(){window&&(window.isCallingEnabled?(console.log("call package is  available"),(new a).enable()):console.log("call package is not available"))}static initiateAfterLogin(){var e;if(null!=U.uiKitSettings){let t=(null===(e=U.uiKitSettings.getExtensions())||void 0===e?void 0:e.length)>0?U.uiKitSettings.getExtensions():this.defaultExtensions;this.enableCalling(),(null==t?void 0:t.length)>0&&t.forEach((e=>{null==e||e.enable()}))}}static async login(e){if(U.checkAuthSettings())return new Promise(((t,i)=>{s.CometChat.login(e,U.uiKitSettings.authKey).then((e=>{t(e),o.init(),this.initiateAfterLogin()})).catch((e=>{i(e)}))}))}static async createUser(e){if(U.checkAuthSettings())return new Promise(((t,i)=>{s.CometChat.createUser(e,U.uiKitSettings.authKey).then((e=>{t(e)})).catch((e=>{i(e)}))}))}static async updateUser(e){if(U.checkAuthSettings())return new Promise(((t,i)=>{s.CometChat.updateUser(e,U.uiKitSettings.authKey).then((e=>{t(e)})).catch((e=>{i(e)}))}))}static async logout(){if(U.checkAuthSettings())return new Promise(((e,t)=>{s.CometChat.logout().then((t=>{e(t)})).catch((e=>{t(e)}))}))}static checkAuthSettings(){return null!=U.uiKitSettings&&null!=U.uiKitSettings.appId}static sendCustomMessage(t){e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(t).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((s=>{t.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.error})}))}static sendTextMessage(t){e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.inprogress}),s.CometChat.sendMessage(t).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((s=>{t.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.error})}))}static sendMediaMessage(t){e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.inprogress}),s.CometChat.sendMediaMessage(t).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((s=>{t.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.error})}))}}U.defaultExtensions=[new E,new x,new p,new h,new S,new k,new R,new C,new f,new T,new m];class D{}class B{}var O=function(e,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])},O(e,t)};function F(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function s(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}function L(e,t,s,i){var o,n=arguments.length,r=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,s,r):o(t,s))||r);return n>3&&r&&Object.defineProperty(t,s,r),r}function G(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function V(e,t){var s,i,o,n,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(a){return function(l){return function(a){if(s)throw new TypeError("Generator is already executing.");for(;n&&(n=0,a[0]&&(r=0)),r;)try{if(s=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{s=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function P(e){var t="function"==typeof Symbol&&Symbol.iterator,s=t&&e[t],i=0;if(s)return s.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var s="function"==typeof Symbol&&e[Symbol.iterator];if(!s)return e;var i,o,n=s.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}}return r}function j(e,t,s){if(s||2===arguments.length)for(var i,o=0,n=t.length;o<n;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function H(e){return this instanceof H?(this.v=e,this):new H(e)}Object.create,Object.create;var K=c(900),z=c.t(K,2);let q=class{constructor(){this.theme=new e.CometChatTheme({})}};q=L([(0,K.Injectable)({providedIn:"root"})],q);var W=c(848);let $=class{constructor(i,o){this.ref=i,this.themeService=o,this.voiceCallIconURL="assets/Audio-Call2x.svg",this.voiceCallIconText=(0,e.localize)("VOICE_CALL"),this.voiceCallIconHoverText=(0,e.localize)("VOICE_CALL"),this.videoCallIconURL="assets/Video-call2x.svg",this.videoCallIconText=(0,e.localize)("VIDEO_CALL"),this.videoCallIconHoverText=(0,e.localize)("VIDEO_CALL"),this.onError=e=>{console.log(e)},this.callButtonsStyle={width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent"},this.disableButtons=!1,this.showOngoingCall=!1,this.sessionId="",this.callbuttonsListenerId="callbuttons_"+(new Date).getTime(),this.loggedInUser=null,this.buttonStyle={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},this.voiceCallButtonStyle={buttonIconTint:"RGB(51, 153, 255)",buttonTextFont:"400 12px Inter",buttonTextColor:"RGB(51, 153, 255)",padding:"8px 32px"},this.videoCallButtonStyle={buttonIconTint:"RGB(51, 153, 255)",buttonTextFont:"400 12px Inter",buttonTextColor:"RGB(51, 153, 255)",padding:"8px 32px"},this.showOutgoingCallscreen=!1,this.outgoingCallStyle={width:"360px",height:"581px",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px"},this.ongoingCallStyle={},this.activeCall=null,this.cancelOutgoingCall=()=>{t.CometChatSoundManager.pause(),s.CometChat.rejectCall(this.call.getSessionId(),e.CometChatUIKitConstants.calls.cancelled).then((t=>{this.disableButtons=!1,this.showOutgoingCallscreen=!1,e.CometChatCallEvents.ccCallRejected.next(t),this.call=null,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)})),this.showOutgoingCallscreen=!1,this.ref.detectChanges()},this.setOngoingCallStyle=()=>{let e=new t.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:this.themeService.theme.palette.getAccent900(),maximizeIconTint:this.themeService.theme.palette.getAccent900()});this.ongoingCallStyle=Object.assign(Object.assign({},e),this.ongoingCallStyle)},this.wrapperStyle=()=>({height:this.callButtonsStyle.height,width:this.callButtonsStyle.width,background:this.callButtonsStyle.background,border:this.callButtonsStyle.border,borderRadius:this.callButtonsStyle.borderRadius})}ngOnInit(){s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.setThemeStyle(),this.attachListeners(),this.subscribeToEvents()}ngOnDestroy(){this.removeListener(),this.unsubscribeToEvents()}getCallBuilder(){var t,i;let o=(null===(t=this.activeCall)||void 0===t?void 0:t.getType())==e.CometChatUIKitConstants.MessageTypes.audio;if((null===(i=this.activeCall)||void 0===i?void 0:i.getType())!=e.CometChatUIKitConstants.calls.meeting)return(new s.CometChat.CallSettingsBuilder).setSessionID(this.sessionId).enableDefaultLayout(!0).setIsAudioOnlyCall(o).setMode(s.CometChat.CALL_MODE.DEFAULT).setLocalizedStringObject(e.CometChatLocalize.getLocale())}openOngoingCallScreen(e){this.showOutgoingCallscreen=!1,this.activeCall=e,this.sessionId=e.getSessionId(),this.showOngoingCall=!0,this.ref.detectChanges()}initiateCall(t){const i=this.user?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group,o=this.user?this.user.getUid():this.group.getGuid(),n=new s.CometChat.Call(o,t,i);s.CometChat.initiateCall(n).then((t=>{this.call=t,this.showOutgoingCallscreen=!0,this.ref.detectChanges(),e.CometChatCallEvents.ccOutgoingCall.next(t)})).catch((e=>{this.onError&&this.onError(e)}))}initiateAudioCall(){this.user&&this.initiateCall(e.CometChatUIKitConstants.MessageTypes.audio)}initiateVideoCall(){this.user?this.initiateCall(e.CometChatUIKitConstants.MessageTypes.video):(this.sessionId=this.group.getGuid(),this.sendCustomMessage(),this.showOngoingCall=!0,this.ref.detectChanges())}sendCustomMessage(){const i=this.user?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group,o=this.user?this.user.getUid():this.group.getGuid(),n={sessionID:this.sessionId,sessionId:this.sessionId,callType:s.CometChat.CALL_TYPE.VIDEO},r=e.CometChatUIKitConstants.calls.meeting,a=`group_${this.sessionId}`,l=new s.CometChat.CustomMessage(o,i,r,n);l.setSender(this.loggedInUser),l.setMetadata({incrementUnreadCount:!0}),l.setReceiver(i),l.setConversationId(a),l.sentAt=t.CometChatUIKitUtility.getUnixTimestamp(),l.muid=t.CometChatUIKitUtility.ID(),e.CometChatMessageEvents.ccMessageSent.next({message:l,status:e.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(l).then((t=>{e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((e=>{this.onError&&this.onError(e)}))}getVoiceCallButtonStyle(e){const t=e?this.themeService.theme.palette.getAccent600():this.callButtonsStyle.voiceCallIconTint;return Object.assign(Object.assign({},this.videoCallButtonStyle),{buttonIconTint:t})}getVideoCallButtonStyle(e){const t=e?this.themeService.theme.palette.getAccent600():this.callButtonsStyle.videoCallIconTint;return Object.assign(Object.assign({},this.videoCallButtonStyle),{buttonIconTint:t})}attachListeners(){s.CometChat.addCallListener(this.callbuttonsListenerId,new s.CometChat.CallListener({onIncomingCallReceived:e=>{this.disableButtons=!0,this.ref.detectChanges()},onIncomingCallCancelled:e=>{this.disableButtons=!1,this.ref.detectChanges()},onOutgoingCallRejected:e=>{this.disableButtons=!1,this.call=null,this.showOutgoingCallscreen=!1,this.ref.detectChanges()},onOutgoingCallAccepted:e=>{this.openOngoingCallScreen(e)}}))}removeListener(){s.CometChat.removeCallListener(this.callbuttonsListenerId)}subscribeToEvents(){this.ccCallRejected=e.CometChatCallEvents.ccCallRejected.subscribe((e=>{this.disableButtons=!1,this.ref.detectChanges()})),this.ccOutgoingCall=e.CometChatCallEvents.ccOutgoingCall.subscribe((e=>{this.disableButtons=!0,this.ref.detectChanges()})),this.ccCallEnded=e.CometChatCallEvents.ccCallEnded.subscribe((e=>{this.disableButtons=!1,this.ref.detectChanges(),this.activeCall=null,this.showOngoingCall=!1,this.sessionId="",this.showOutgoingCallscreen=!1,this.ref.detectChanges()}))}unsubscribeToEvents(){var e,t,s;null===(e=this.ccCallRejected)||void 0===e||e.unsubscribe(),null===(t=this.ccOutgoingCall)||void 0===t||t.unsubscribe(),null===(s=this.ccCallEnded)||void 0===s||s.unsubscribe()}setThemeStyle(){this.setcallButtonsStyle(),this.setOngoingCallStyle()}setcallButtonsStyle(){let s=new t.CallButtonsStyle({width:"100%",height:"100%",background:"transparent",border:"none",borderRadius:"0",voiceCallIconTint:this.themeService.theme.palette.getPrimary(),videoCallIconTint:this.themeService.theme.palette.getPrimary(),voiceCallIconTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),videoCallIconTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),voiceCallIconTextColor:this.themeService.theme.palette.getPrimary(),videoCallIconTextColor:this.themeService.theme.palette.getPrimary(),buttonPadding:"8px 32px",buttonBackground:this.themeService.theme.palette.getAccent100(),buttonBorder:"0",buttonBorderRadius:"8px"});this.callButtonsStyle=Object.assign(Object.assign({},s),this.callButtonsStyle),this.voiceCallButtonStyle=Object.assign({buttonIconTint:this.disableButtons?this.themeService.theme.palette.getAccent600():this.callButtonsStyle.voiceCallIconTint,buttonTextFont:this.callButtonsStyle.voiceCallIconTextFont,buttonTextColor:this.callButtonsStyle.voiceCallIconTextColor,padding:this.callButtonsStyle.buttonPadding,background:this.callButtonsStyle.buttonBackground,border:this.callButtonsStyle.border,borderRadius:this.callButtonsStyle.buttonBorderRadius},this.buttonStyle),this.videoCallButtonStyle=Object.assign({buttonIconTint:this.disableButtons?this.themeService.theme.palette.getAccent600():this.callButtonsStyle.videoCallIconTint,buttonTextFont:this.callButtonsStyle.videoCallIconTextFont,buttonTextColor:this.callButtonsStyle.videoCallIconTextColor,padding:this.callButtonsStyle.buttonPadding,background:this.callButtonsStyle.buttonBackground,border:this.callButtonsStyle.border,borderRadius:this.callButtonsStyle.buttonBorderRadius},this.buttonStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.User)],$.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],$.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"voiceCallIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"voiceCallIconText",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"voiceCallIconHoverText",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"videoCallIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"videoCallIconText",void 0),L([(0,K.Input)(),G("design:type",String)],$.prototype,"videoCallIconHoverText",void 0),L([(0,K.Input)(),G("design:type",Object)],$.prototype,"onVoiceCallClick",void 0),L([(0,K.Input)(),G("design:type",Object)],$.prototype,"onVideoCallClick",void 0),L([(0,K.Input)(),G("design:type",Function)],$.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",t.CallButtonsStyle)],$.prototype,"callButtonsStyle",void 0),$=L([(0,K.Component)({selector:"cometchat-call-buttons",templateUrl:"./cometchat-call-buttons.component.html",styleUrls:["./cometchat-call-buttons.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],$);var J=c(807);let Q=class{constructor(s,i){this.ref=s,this.themeService=i,this.declineButtonText=(0,e.localize)("CANCEL"),this.declineButtonIconURL="assets/close2x.svg",this.onError=e=>{console.log(e)},this.disableSoundForCalls=!1,this.avatarStyle={borderRadius:"50%",width:"180px",height:"180px"},this.outgoingCallStyle={width:"100%",height:"100%",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonTextFont:"400 12px Inter",declineButtonTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonIconTint:"white",declineButtonIconBackground:"red"},this.buttonStyle={height:"fit-content",width:"fit-content",buttonTextFont:"400 12px Inter",buttonTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px",border:"none",buttonIconTint:"white",background:"",iconBackground:"red"},this.subtitleText=(0,e.localize)("CALLING"),this.cardStyle={height:"100%",width:"100%",border:"inherite",borderRadius:"inherite",background:"transparent",titleFont:"700 22px Inter",titleColor:"black"},this.iconAlignment=e.IconButtonAlignment.top,this.iconStyle={height:"16px",width:"16px",iconTint:"RGBA(20, 20, 20, 0.68)"},this.onClose=()=>{t.CometChatSoundManager.pause(),this.onCloseClicked&&this.onCloseClicked()},this.wrapperStyle=()=>({height:this.outgoingCallStyle.height,width:this.outgoingCallStyle.width,background:this.outgoingCallStyle.background,border:this.outgoingCallStyle.border,borderRadius:this.outgoingCallStyle.borderRadius})}ngOnChanges(e){e.call&&e.call.currentValue&&(this.disableSoundForCalls||setTimeout((()=>{this.playAudio()})),this.setThemeStyle())}ngOnInit(){}playAudio(){this.customSoundForCalls?t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.outgoingCall,this.customSoundForCalls):t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.outgoingCall)}ngOnDestroy(){t.CometChatSoundManager.pause()}getAvatarURL(){var t,s,i,o,n;return(null===(t=this.call)||void 0===t?void 0:t.getReceiverType())==e.CometChatUIKitConstants.MessageReceiverType.user?null===(i=null===(s=this.call)||void 0===s?void 0:s.getReceiver())||void 0===i?void 0:i.getAvatar():null===(n=null===(o=this.call)||void 0===o?void 0:o.getReceiver())||void 0===n?void 0:n.getIcon()}setThemeStyle(){this.setAvatarStyle(),this.setOutgoingCallStyle(),this.cardStyle.titleColor=this.outgoingCallStyle.titleTextColor,this.cardStyle.titleFont=this.outgoingCallStyle.titleTextFont}setOutgoingCallStyle(){let s=new t.OutgoingCallStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),border:"none",borderRadius:"0",titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),subtitleTextColor:this.themeService.theme.palette.getAccent600(),declineButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),declineButtonTextColor:this.themeService.theme.palette.getAccent600(),declineButtonIconTint:this.themeService.theme.palette.getAccent("dark"),declineButtonIconBackground:this.themeService.theme.palette.getError()});this.outgoingCallStyle=Object.assign(Object.assign({},s),this.outgoingCallStyle),this.buttonStyle={height:"fit-content",width:"fit-content",buttonTextFont:this.outgoingCallStyle.declineButtonTextFont,buttonTextColor:this.outgoingCallStyle.declineButtonTextColor,borderRadius:"8px",border:"none",buttonIconTint:this.outgoingCallStyle.declineButtonIconTint,background:"",iconBackground:this.outgoingCallStyle.declineButtonIconBackground}}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"50%",width:"180px",height:"180px",border:`1px solid  ${this.themeService.theme.palette.getAccent100()}`,backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}subtitleStyle(){return{textFont:this.outgoingCallStyle.subtitleTextFont,textColor:this.outgoingCallStyle.subtitleTextColor}}};L([(0,K.Input)(),G("design:type",s.CometChat.Call)],Q.prototype,"call",void 0),L([(0,K.Input)(),G("design:type",String)],Q.prototype,"declineButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],Q.prototype,"declineButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Q.prototype,"customView",void 0),L([(0,K.Input)(),G("design:type",Function)],Q.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Q.prototype,"disableSoundForCalls",void 0),L([(0,K.Input)(),G("design:type",String)],Q.prototype,"customSoundForCalls",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Q.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.OutgoingCallStyle)],Q.prototype,"outgoingCallStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],Q.prototype,"onCloseClicked",void 0),Q=L([(0,K.Component)({selector:"cometchat-outgoing-call",templateUrl:"./cometchat-outgoing-call.component.html",styleUrls:["./cometchat-outgoing-call.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Q);let Y=class{constructor(){this.list=[],this.searchText=(0,e.localize)("SEARCH"),this.searchIconURL="assets/search.svg",this.listStyle={height:"100%",width:"100%"},this.searchPlaceholderText="",this.hideSearch=!1,this.hideError=!1,this.title="",this.titleAlignment=t.TitleAlignment.left,this.state=t.States.loaded,this.errorStateText="",this.emptyStateText="",this.loadingIconURL="assets/Spinner.svg",this.showSectionHeader=!1,this.sectionHeaderField="name",this.states=t.States,this.numberOfTopScroll=0,this.searchStyle={},this.iconStyle={},this.ioBottom=()=>{const e={root:this.listScroll.nativeElement,rootMargin:"-100% 0px 100px 0px",threshold:0};new IntersectionObserver((e=>{var t;e[0].isIntersecting&&this.onScrolledToBottom&&(null===(t=this.list)||void 0===t?void 0:t.length)>0&&this.onScrolledToBottom()}),e).observe(this.bottom.nativeElement)},this.ioTop=()=>{const e={root:this.listScroll.nativeElement,rootMargin:"200px 0px 0px 0px",threshold:1};new IntersectionObserver((e=>{e[0].isIntersecting&&(this.numberOfTopScroll++,this.onScrolledToTop&&this.numberOfTopScroll>1&&this.onScrolledToTop())}),e).observe(this.top.nativeElement)},this.searchEvent=e=>{var t;this.searchText=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.searchText,this.onSearch&&this.onSearch(this.searchText)},this.chatsListStyle=()=>({height:this.listStyle.height,background:this.listStyle.background}),this.messageContainerStyle=()=>({width:this.listStyle.width}),this.errorStyle=()=>({textFont:this.listStyle.errorStateTextFont,textColor:this.listStyle.errorStateTextColor}),this.emptyStyle=()=>({textFont:this.listStyle.emptyStateTextFont,textColor:this.listStyle.emptyStateTextColor}),this.wrapperStyle=()=>({height:this.listStyle.height,width:this.listStyle.width,background:this.listStyle.background,border:this.listStyle.border,borderRadius:this.listStyle.borderRadius}),this.headerTitle=()=>{let e=this.titleAlignment==t.TitleAlignment.left?{textAlign:"left"}:{textAlign:"center"};return Object.assign({font:this.listStyle.titleTextFont,color:this.listStyle.titleTextColor},e)},this.sectionHeaderStyle=()=>{var e,t;return{font:null===(e=this.listStyle)||void 0===e?void 0:e.sectionHeaderTextFont,color:null===(t=this.listStyle)||void 0===t?void 0:t.sectionHeaderTextColor}},this.headerStyle=()=>({height:"fit-content",marginBottom:"12px"}),this.listStyles=()=>({height:"100%"})}ngOnInit(){var e,t,s,i,o,n;this.iconStyle=this.listStyle.loadingIconTint,this.searchStyle.searchTextFont=null===(e=this.listStyle)||void 0===e?void 0:e.searchTextFont,this.searchStyle.searchTextColor=null===(t=this.listStyle)||void 0===t?void 0:t.searchTextColor,this.searchStyle.placeholderTextFont=null===(s=this.listStyle)||void 0===s?void 0:s.searchPlaceholderTextFont,this.searchStyle.placeholderTextColor=null===(i=this.listStyle)||void 0===i?void 0:i.searchPlaceholderTextColor,this.searchStyle.searchIconTint=null===(o=this.listStyle)||void 0===o?void 0:o.searchIconTint,this.searchStyle.background=null===(n=this.listStyle)||void 0===n?void 0:n.searchBackground,this.searchStyle.borderRadius=this.listStyle.searchBorderRadius,this.searchStyle.border=this.listStyle.searchBorder}ngAfterViewInit(){this.ioBottom()}ngOnChanges(e){}};L([(0,K.ViewChild)("listScroll",{static:!1}),G("design:type",K.ElementRef)],Y.prototype,"listScroll",void 0),L([(0,K.ViewChild)("bottom",{static:!1}),G("design:type",K.ElementRef)],Y.prototype,"bottom",void 0),L([(0,K.ViewChild)("top",{static:!1}),G("design:type",K.ElementRef)],Y.prototype,"top",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Y.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",Function)],Y.prototype,"onScrolledToBottom",void 0),L([(0,K.Input)(),G("design:type",Function)],Y.prototype,"onScrolledToTop",void 0),L([(0,K.Input)(),G("design:type",Object)],Y.prototype,"list",void 0),L([(0,K.Input)(),G("design:type",Function)],Y.prototype,"onSearch",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"searchText",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",t.ListStyle)],Y.prototype,"listStyle",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"searchPlaceholderText",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Y.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Y.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Number)],Y.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Y.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Y.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Y.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",Number)],Y.prototype,"state",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Y.prototype,"showSectionHeader",void 0),L([(0,K.Input)(),G("design:type",String)],Y.prototype,"sectionHeaderField",void 0),Y=L([(0,K.Component)({selector:"cometchat-list",templateUrl:"./cometchat-list.component.html",styleUrls:["./cometchat-list.component.scss"]}),G("design:paramtypes",[])],Y);var Z=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function X(e){return"function"==typeof e}function ee(e){return X(null==e?void 0:e.then)}var te,se=((te=function(e){var t;t=this,Error.call(t),t.stack=(new Error).stack,this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=e}).prototype=Object.create(Error.prototype),te.prototype.constructor=te,te);function ie(e,t){if(e){var s=e.indexOf(t);0<=s&&e.splice(s,1)}}var oe=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,s,i,o;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var r=P(n),a=r.next();!a.done;a=r.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}else n.remove(this);var l=this.initialTeardown;if(X(l))try{l()}catch(e){o=e instanceof se?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var c=P(h),d=c.next();!d.done;d=c.next()){var u=d.value;try{re(u)}catch(e){o=null!=o?o:[],e instanceof se?o=j(j([],N(o)),N(e.errors)):o.push(e)}}}catch(e){s={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(s)throw s.error}}}if(o)throw new se(o)}},e.prototype.add=function(t){var s;if(t&&t!==this)if(this.closed)re(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(s=this._finalizers)&&void 0!==s?s:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ie(t,e)},e.prototype.remove=function(t){var s=this._finalizers;s&&ie(s,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function ne(e){return e instanceof oe||e&&"closed"in e&&X(e.remove)&&X(e.add)&&X(e.unsubscribe)}function re(e){X(e)?e():e.unsubscribe()}oe.EMPTY;var ae={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},le={setTimeout:function(e,t){for(var s=[],i=2;i<arguments.length;i++)s[i-2]=arguments[i];var o=le.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,j([e,t],N(s))):setTimeout.apply(void 0,j([e,t],N(s)))},clearTimeout:function(e){var t=le.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function he(e){le.setTimeout((function(){var t=ae.onUnhandledError;if(!t)throw e;t(e)}))}function ce(){}var de=ue("C",void 0,void 0);function ue(e,t,s){return{kind:e,value:t,error:s}}var pe=null,ge=function(e){function t(t){var s=e.call(this)||this;return s.isStopped=!1,t?(s.destination=t,ne(t)&&t.add(s)):s.destination=fe,s}return F(t,e),t.create=function(e,t,s){return new ve(e,t,s)},t.prototype.next=function(e){this.isStopped?be(function(e){return ue("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?be(ue("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?be(de,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(oe),me=Function.prototype.bind;function ye(e,t){return me.call(e,t)}var Ce=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Se(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Se(e)}else Se(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Se(e)}},e}(),ve=function(e){function t(t,s,i){var o,n,r=e.call(this)||this;return X(t)||!t?o={next:null!=t?t:void 0,error:null!=s?s:void 0,complete:null!=i?i:void 0}:r&&ae.useDeprecatedNextContext?((n=Object.create(t)).unsubscribe=function(){return r.unsubscribe()},o={next:t.next&&ye(t.next,n),error:t.error&&ye(t.error,n),complete:t.complete&&ye(t.complete,n)}):o=t,r.destination=new Ce(o),r}return F(t,e),t}(ge);function Se(e){var t;ae.useDeprecatedSynchronousErrorHandling?(t=e,ae.useDeprecatedSynchronousErrorHandling&&pe&&(pe.errorThrown=!0,pe.error=t)):he(e)}function be(e,t){var s=ae.onStoppedNotification;s&&le.setTimeout((function(){return s(e,t)}))}var fe={closed:!0,next:ce,error:function(e){throw e},complete:ce},Ie="function"==typeof Symbol&&Symbol.observable||"@@observable";function Te(e){return e}var Me=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var s=new e;return s.source=this,s.operator=t,s},e.prototype.subscribe=function(e,t,s){var i,o=this,n=(i=e)&&i instanceof ge||function(e){return e&&X(e.next)&&X(e.error)&&X(e.complete)}(i)&&ne(i)?e:new ve(e,t,s);return function(e){if(ae.useDeprecatedSynchronousErrorHandling){var t=!pe;if(t&&(pe={errorThrown:!1,error:null}),e(),t){var s=pe,i=s.errorThrown,o=s.error;if(pe=null,i)throw o}}else e()}((function(){var e=o,t=e.operator,s=e.source;n.add(t?t.call(n,s):s?o._subscribe(n):o._trySubscribe(n))})),n},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var s=this;return new(t=xe(t))((function(t,i){var o=new ve({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});s.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Ie]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(s=e).length?Te:1===s.length?s[0]:function(e){return s.reduce((function(e,t){return t(e)}),e)})(this);var s},e.prototype.toPromise=function(e){var t=this;return new(e=xe(e))((function(e,s){var i;t.subscribe((function(e){return i=e}),(function(e){return s(e)}),(function(){return e(i)}))}))},e.create=function(t){return new e(t)},e}();function xe(e){var t;return null!==(t=null!=e?e:ae.Promise)&&void 0!==t?t:Promise}function we(e){return X(e[Ie])}function Ee(e){return Symbol.asyncIterator&&X(null==e?void 0:e[Symbol.asyncIterator])}function Ae(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var ke="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function _e(e){return X(null==e?void 0:e[ke])}function Re(e){return function(e,t,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,o=s.apply(e,t||[]),n=[];return i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i;function r(e){o[e]&&(i[e]=function(t){return new Promise((function(s,i){n.push([e,t,s,i])>1||a(e,t)}))})}function a(e,t){try{(s=o[e](t)).value instanceof H?Promise.resolve(s.value.v).then(l,h):c(n[0][2],s)}catch(e){c(n[0][3],e)}var s}function l(e){a("next",e)}function h(e){a("throw",e)}function c(e,t){e(t),n.shift(),n.length&&a(n[0][0],n[0][1])}}(this,arguments,(function(){var t,s,i;return V(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,H(t.read())];case 3:return s=o.sent(),i=s.value,s.done?[4,H(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,H(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Ue(e){return X(null==e?void 0:e.getReader)}function De(e){if(e instanceof Me)return e;if(null!=e){if(we(e))return o=e,new Me((function(e){var t=o[Ie]();if(X(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Z(e))return i=e,new Me((function(e){for(var t=0;t<i.length&&!e.closed;t++)e.next(i[t]);e.complete()}));if(ee(e))return s=e,new Me((function(e){s.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,he)}));if(Ee(e))return Be(e);if(_e(e))return t=e,new Me((function(e){var s,i;try{for(var o=P(t),n=o.next();!n.done;n=o.next()){var r=n.value;if(e.next(r),e.closed)return}}catch(e){s={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(s)throw s.error}}e.complete()}));if(Ue(e))return Be(Re(e))}var t,s,i,o;throw Ae(e)}function Be(e){return new Me((function(t){(function(e,t){var s,i,o,n,r,a,l,h;return r=this,a=void 0,h=function(){var r,a;return V(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),s=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,s=e[Symbol.asyncIterator];return s?s.call(e):(e=P(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=e[s]&&function(t){return new Promise((function(i,o){!function(e,t,s,i){Promise.resolve(i).then((function(t){e({value:t,done:s})}),t)}(i,o,(t=e[s](t)).done,t.value)}))}}}(e),l.label=1;case 1:return[4,s.next()];case 2:if((i=l.sent()).done)return[3,4];if(r=i.value,t.next(r),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),o={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(n=s.return)?[4,n.call(s)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))},new((l=void 0)||(l=Promise))((function(e,t){function s(e){try{o(h.next(e))}catch(e){t(e)}}function i(e){try{o(h.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof l?o:new l((function(e){e(o)}))).then(s,i)}o((h=h.apply(r,a||[])).next())}))})(e,t).catch((function(e){return t.error(e)}))}))}function Oe(e){return function(t){if(function(e){return X(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Fe(e,t,s,i,o){return new Le(e,t,s,i,o)}var Le=function(e){function t(t,s,i,o,n,r){var a=e.call(this,t)||this;return a.onFinalize=n,a.shouldUnsubscribe=r,a._next=s?function(e){try{s(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return F(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;e.prototype.unsubscribe.call(this),!s&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(ge);var Ge=Array.isArray,Ve=Object.getPrototypeOf,Pe=Object.prototype,Ne=Object.keys;function je(e,t){return Oe((function(s,i){var o=0;s.subscribe(Fe(i,(function(s){i.next(e.call(t,s,o++))})))}))}var He=Array.isArray;function Ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var s,i=function(e){return X((t=e)[t.length-1])?e.pop():void 0;var t}(e),o=function(e){if(1===e.length){var t=e[0];if(Ge(t))return{args:t,keys:null};if((i=t)&&"object"==typeof i&&Ve(i)===Pe){var s=Ne(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var i;return{args:e,keys:null}}(e),n=o.args,r=o.keys,a=new Me((function(e){var t=n.length;if(t)for(var s=new Array(t),i=t,o=t,a=function(t){var a=!1;De(n[t]).subscribe(Fe(e,(function(e){a||(a=!0,o--),s[t]=e}),(function(){return i--}),void 0,(function(){i&&a||(o||e.next(r?function(e,t){return e.reduce((function(e,s,i){return e[s]=t[i],e}),{})}(r,s):s),e.complete())})))},l=0;l<t;l++)a(l);else e.complete()}));return i?a.pipe((s=i,je((function(e){return function(e,t){return He(t)?e.apply(void 0,j([],N(t))):e(t)}(s,e)})))):a}class ze{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}setProperty(e,t){this._renderer.setProperty(this._elementRef.nativeElement,e,t)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}}ze.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ze,deps:[{token:K.Renderer2},{token:K.ElementRef}],target:K["ɵɵFactoryTarget"].Directive}),ze.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ze,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ze,decorators:[{type:K.Directive}],ctorParameters:function(){return[{type:K.Renderer2},{type:K.ElementRef}]}});class qe extends ze{}qe.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:qe,deps:null,target:K["ɵɵFactoryTarget"].Directive}),qe.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:qe,usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:qe,decorators:[{type:K.Directive}]});const We=new K.InjectionToken("NgValueAccessor"),$e={provide:We,useExisting:(0,K.forwardRef)((()=>Je)),multi:!0};class Je extends qe{writeValue(e){this.setProperty("checked",e)}}Je.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Je,deps:null,target:K["ɵɵFactoryTarget"].Directive}),Je.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Je,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{listeners:{change:"onChange($event.target.checked)",blur:"onTouched()"}},providers:[$e],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Je,decorators:[{type:K.Directive,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[$e]}]}]});const Qe={provide:We,useExisting:(0,K.forwardRef)((()=>Ze)),multi:!0},Ye=new K.InjectionToken("CompositionEventMode");class Ze extends ze{constructor(e,t,s){super(e,t),this._compositionMode=s,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=(0,W["ɵgetDOM"])()?(0,W["ɵgetDOM"])().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){const t=null==e?"":e;this.setProperty("value",t)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}function Xe(e){return null==e||0===e.length}function et(e){return null!=e&&"number"==typeof e.length}Ze.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ze,deps:[{token:K.Renderer2},{token:K.ElementRef},{token:Ye,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Ze.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ze,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{listeners:{input:"$any(this)._handleInput($event.target.value)",blur:"onTouched()",compositionstart:"$any(this)._compositionStart()",compositionend:"$any(this)._compositionEnd($event.target.value)"}},providers:[Qe],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ze,decorators:[{type:K.Directive,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"$any(this)._handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"$any(this)._compositionStart()","(compositionend)":"$any(this)._compositionEnd($event.target.value)"},providers:[Qe]}]}],ctorParameters:function(){return[{type:K.Renderer2},{type:K.ElementRef},{type:void 0,decorators:[{type:K.Optional},{type:K.Inject,args:[Ye]}]}]}});const tt=new K.InjectionToken("NgValidators"),st=new K.InjectionToken("NgAsyncValidators"),it=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function ot(e){return Xe(e.value)?{required:!0}:null}function nt(e){return!0===e.value?null:{required:!0}}function rt(e){return Xe(e.value)||it.test(e.value)?null:{email:!0}}function at(e){return null}function lt(e){return null!=e}function ht(e){const t=(0,K["ɵisPromise"])(e)?De(e):e;if(!(0,K["ɵisObservable"])(t)&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error("Expected validator to return Promise or Observable.");return t}function ct(e){let t={};return e.forEach((e=>{t=null!=e?{...t,...e}:t})),0===Object.keys(t).length?null:t}function dt(e,t){return t.map((t=>t(e)))}function ut(e){return e.map((e=>function(e){return!e.validate}(e)?e:t=>e.validate(t)))}function pt(e){return null!=e?function(e){if(!e)return null;const t=e.filter(lt);return 0==t.length?null:function(e){return ct(dt(e,t))}}(ut(e)):null}function gt(e){return null!=e?function(e){if(!e)return null;const t=e.filter(lt);return 0==t.length?null:function(e){return Ke(dt(e,t).map(ht)).pipe(je(ct))}}(ut(e)):null}function mt(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function yt(e){return e._rawValidators}function Ct(e){return e._rawAsyncValidators}function vt(e){return e?Array.isArray(e)?e:[e]:[]}function St(e,t){return Array.isArray(e)?e.includes(t):e===t}function bt(e,t){const s=vt(t);return vt(e).forEach((e=>{St(s,e)||s.push(e)})),s}function ft(e,t){return vt(t).filter((t=>!St(e,t)))}class It{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=pt(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=gt(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach((e=>e())),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class Tt extends It{get formDirective(){return null}get path(){return null}}class Mt extends It{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class xt{constructor(e){this._cd=e}is(e){return"submitted"===e?!!this._cd?.submitted:!!this._cd?.control?.[e]}}class wt extends xt{constructor(e){super(e)}}wt.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:wt,deps:[{token:Mt,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),wt.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:wt,selector:"[formControlName],[ngModel],[formControl]",host:{properties:{"class.ng-untouched":'is("untouched")',"class.ng-touched":'is("touched")',"class.ng-pristine":'is("pristine")',"class.ng-dirty":'is("dirty")',"class.ng-valid":'is("valid")',"class.ng-invalid":'is("invalid")',"class.ng-pending":'is("pending")'}},usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:wt,decorators:[{type:K.Directive,args:[{selector:"[formControlName],[ngModel],[formControl]",host:{"[class.ng-untouched]":'is("untouched")',"[class.ng-touched]":'is("touched")',"[class.ng-pristine]":'is("pristine")',"[class.ng-dirty]":'is("dirty")',"[class.ng-valid]":'is("valid")',"[class.ng-invalid]":'is("invalid")',"[class.ng-pending]":'is("pending")'}}]}],ctorParameters:function(){return[{type:Mt,decorators:[{type:K.Self}]}]}});class Et extends xt{constructor(e){super(e)}}Et.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Et,deps:[{token:Tt,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),Et.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Et,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:{properties:{"class.ng-untouched":'is("untouched")',"class.ng-touched":'is("touched")',"class.ng-pristine":'is("pristine")',"class.ng-dirty":'is("dirty")',"class.ng-valid":'is("valid")',"class.ng-invalid":'is("invalid")',"class.ng-pending":'is("pending")',"class.ng-submitted":'is("submitted")'}},usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Et,decorators:[{type:K.Directive,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:{"[class.ng-untouched]":'is("untouched")',"[class.ng-touched]":'is("touched")',"[class.ng-pristine]":'is("pristine")',"[class.ng-dirty]":'is("dirty")',"[class.ng-valid]":'is("valid")',"[class.ng-invalid]":'is("invalid")',"[class.ng-pending]":'is("pending")',"[class.ng-submitted]":'is("submitted")'}}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Optional},{type:K.Self}]}]}});const At='\n  <div [formGroup]="myGroup">\n    <input formControlName="firstName">\n  </div>\n\n  In your class:\n\n  this.myGroup = new FormGroup({\n      firstName: new FormControl()\n  });',kt='\n  <div [formGroup]="myGroup">\n      <div formGroupName="person">\n        <input formControlName="firstName">\n      </div>\n  </div>\n\n  In your class:\n\n  this.myGroup = new FormGroup({\n      person: new FormGroup({ firstName: new FormControl() })\n  });',_t='\n  <form>\n      <div ngModelGroup="person">\n        <input [(ngModel)]="person.name" name="firstName">\n      </div>\n  </form>',Rt="\n  It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n  when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n  you. We recommend using this approach to avoid 'changed after checked' errors.\n\n  Example:\n  form = new FormGroup({\n    first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n    last: new FormControl('Drew', Validators.required)\n  });\n";function Ut(e,t){return e?`with name: '${t}'`:`at index: ${t}`}function Dt(e,t){return[...t.path,e]}function Bt(e,t){("undefined"==typeof ngDevMode||ngDevMode)&&(e||Nt(t,"Cannot find control with"),t.valueAccessor||Nt(t,"No value accessor for form control with")),Lt(e,t),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange((s=>{e._pendingValue=s,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&Vt(e,t)}))}(e,t),function(e,t){const s=(e,s)=>{t.valueAccessor.writeValue(e),s&&t.viewToModelUpdate(e)};e.registerOnChange(s),t._registerOnDestroy((()=>{e._unregisterOnChange(s)}))}(e,t),function(e,t){t.valueAccessor.registerOnTouched((()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&Vt(e,t),"submit"!==e.updateOn&&e.markAsTouched()}))}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){const s=e=>{t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(s),t._registerOnDestroy((()=>{e._unregisterOnDisabledChange(s)}))}}(e,t)}function Ot(e,t,s=!0){const i=()=>{s&&("undefined"==typeof ngDevMode||ngDevMode)&&function(e){Nt(e,"There is no FormControl instance attached to form control element with")}(t)};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),Gt(e,t),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange((()=>{})))}function Ft(e,t){e.forEach((e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)}))}function Lt(e,t){const s=yt(e);null!==t.validator?e.setValidators(mt(s,t.validator)):"function"==typeof s&&e.setValidators([s]);const i=Ct(e);null!==t.asyncValidator?e.setAsyncValidators(mt(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);const o=()=>e.updateValueAndValidity();Ft(t._rawValidators,o),Ft(t._rawAsyncValidators,o)}function Gt(e,t){let s=!1;if(null!==e){if(null!==t.validator){const i=yt(e);if(Array.isArray(i)&&i.length>0){const o=i.filter((e=>e!==t.validator));o.length!==i.length&&(s=!0,e.setValidators(o))}}if(null!==t.asyncValidator){const i=Ct(e);if(Array.isArray(i)&&i.length>0){const o=i.filter((e=>e!==t.asyncValidator));o.length!==i.length&&(s=!0,e.setAsyncValidators(o))}}}const i=()=>{};return Ft(t._rawValidators,i),Ft(t._rawAsyncValidators,i),s}function Vt(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function Pt(e,t){null!=e||"undefined"!=typeof ngDevMode&&!ngDevMode||Nt(t,"Cannot find control with"),Lt(e,t)}function Nt(e,t){const s=jt(e);throw new Error(`${t} ${s}`)}function jt(e){const t=e.path;return t&&t.length>1?`path: '${t.join(" -> ")}'`:t?.[0]?`name: '${t}'`:"unspecified name attribute"}function Ht(e,t){if(!e.hasOwnProperty("model"))return!1;const s=e.model;return!!s.isFirstChange()||!Object.is(t,s.currentValue)}function Kt(e,t){e._syncPendingControls(),t.forEach((e=>{const t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)}))}function zt(e,t){if(!t)return null;let s,i,o;return Array.isArray(t)||"undefined"!=typeof ngDevMode&&!ngDevMode||function(e){const t=jt(e);throw new Error(`Value accessor was not provided as an array for form control with ${t}. Check that the \`NG_VALUE_ACCESSOR\` token is configured as a \`multi: true\` provider.`)}(e),t.forEach((t=>{var n;t.constructor===Ze?s=t:(n=t,Object.getPrototypeOf(n.constructor)===qe?(i&&("undefined"==typeof ngDevMode||ngDevMode)&&Nt(e,"More than one built-in value accessor matches form control with"),i=t):(o&&("undefined"==typeof ngDevMode||ngDevMode)&&Nt(e,"More than one custom value accessor matches form control with"),o=t))})),o||i||s||(("undefined"==typeof ngDevMode||ngDevMode)&&Nt(e,"No valid value accessor for form control with"),null)}function qt(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}function Wt(e,t,s,i){var o;"never"!==i&&((null!==i&&"once"!==i||t._ngModelWarningSentOnce)&&("always"!==i||s._ngModelWarningSent)||(console.warn(`\n  It looks like you're using ngModel on the same form field as ${o=e}.\n  Support for using the ngModel input property and ngModelChange event with\n  reactive form directives has been deprecated in Angular v6 and will be removed\n  in a future version of Angular.\n\n  For more information on this, see our API docs here:\n  https://angular.io/api/forms/${"formControl"===o?"FormControlDirective":"FormControlName"}#use-with-ngmodel\n  `),t._ngModelWarningSentOnce=!0,s._ngModelWarningSent=!0))}const $t="undefined"==typeof ngDevMode||!!ngDevMode,Jt="VALID",Qt="INVALID",Yt="PENDING",Zt="DISABLED";function Xt(e){return(is(e)?e.validators:e)||null}function es(e){return Array.isArray(e)?pt(e):e||null}function ts(e,t){return(is(t)?t.asyncValidators:e)||null}function ss(e){return Array.isArray(e)?gt(e):e||null}function is(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const os=e=>e instanceof ds,ns=e=>e instanceof us,rs=e=>e instanceof ps;function as(e){return os(e)?e.value:e.getRawValue()}function ls(e,t){const s=ns(e),i=e.controls;if(!(s?Object.keys(i):i).length)throw new K["ɵRuntimeError"](1e3,$t?function(e){return`\n    There are no form controls registered with this ${e?"group":"array"} yet. If you're using ngModel,\n    you may want to check next tick (e.g. use setTimeout).\n  `}(s):"");if(!i[t])throw new K["ɵRuntimeError"](1001,$t?function(e,t){return`Cannot find form control ${Ut(e,t)}`}(s,t):"")}function hs(e,t){const s=ns(e);e._forEachChild(((e,i)=>{if(void 0===t[i])throw new K["ɵRuntimeError"](1002,$t?function(e,t){return`Must supply a value for form control ${Ut(e,t)}`}(s,i):"")}))}class cs{constructor(e,t){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=es(this._rawValidators),this._composedAsyncValidatorFn=ss(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Jt}get invalid(){return this.status===Qt}get pending(){return this.status==Yt}get disabled(){return this.status===Zt}get enabled(){return this.status!==Zt}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=es(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=ss(e)}addValidators(e){this.setValidators(bt(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(bt(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(ft(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(ft(e,this._rawAsyncValidators))}hasValidator(e){return St(this._rawValidators,e)}hasAsyncValidator(e){return St(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild((e=>e.markAllAsTouched()))}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild((e=>{e.markAsUntouched({onlySelf:!0})})),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild((e=>{e.markAsPristine({onlySelf:!0})})),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Yt,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Zt,this.errors=null,this._forEachChild((t=>{t.disable({...e,onlySelf:!0})})),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...e,skipPristineCheck:t}),this._onDisabledChange.forEach((e=>e(!0)))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Jt,this._forEachChild((t=>{t.enable({...e,onlySelf:!0})})),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors({...e,skipPristineCheck:t}),this._onDisabledChange.forEach((e=>e(!1)))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==Jt&&this.status!==Yt||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild((t=>t._updateTreeValidity(e))),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Zt:Jt}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Yt,this._hasOwnPendingAsyncValidator=!0;const t=ht(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe((t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})}))}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,s){if(null==t)return null;if(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length)return null;let i=e;return t.forEach((e=>{i=ns(i)?i.controls.hasOwnProperty(e)?i.controls[e]:null:rs(i)&&i.at(e)||null})),i}(this,e)}getError(e,t){const s=t?this.get(t):this;return s&&s.errors?s.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new K.EventEmitter,this.statusChanges=new K.EventEmitter}_calculateStatus(){return this._allControlsDisabled()?Zt:this.errors?Qt:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Yt)?Yt:this._anyControlsHaveStatus(Qt)?Qt:Jt}_anyControlsHaveStatus(e){return this._anyControls((t=>t.status===e))}_anyControlsDirty(){return this._anyControls((e=>e.dirty))}_anyControlsTouched(){return this._anyControls((e=>e.touched))}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){is(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){const t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}}class ds extends cs{constructor(e=null,t,s){super(Xt(t),ts(s,t)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),is(t)&&t.initialValueIsDefault&&(this._isBoxedValue(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach((e=>e(this.value,!1!==t.emitViewToModelChange))),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){qt(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){qt(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class us extends cs{constructor(e,t,s){super(Xt(t),ts(s,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,s={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange((()=>{})),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,s={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange((()=>{})),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){hs(this,e),Object.keys(e).forEach((s=>{ls(this,s),this.controls[s].setValue(e[s],{onlySelf:!0,emitEvent:t.emitEvent})})),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach((s=>{this.controls[s]&&this.controls[s].patchValue(e[s],{onlySelf:!0,emitEvent:t.emitEvent})})),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild(((s,i)=>{s.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})})),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},((e,t,s)=>(e[s]=as(t),e)))}_syncPendingControls(){let e=this._reduceChildren(!1,((e,t)=>!!t._syncPendingControls()||e));return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach((t=>{const s=this.controls[t];s&&e(s,t)}))}_setUpControls(){this._forEachChild((e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}))}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const s=this.controls[t];if(this.contains(t)&&e(s))return!0}return!1}_reduceValue(){return this._reduceChildren({},((e,t,s)=>((t.enabled||this.disabled)&&(e[s]=t.value),e)))}_reduceChildren(e,t){let s=e;return this._forEachChild(((e,i)=>{s=t(s,e,i)})),s}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}}class ps extends cs{constructor(e,t,s){super(Xt(t),ts(s,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,s={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:s.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange((()=>{})),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,s={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange((()=>{})),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){hs(this,e),e.forEach(((e,s)=>{ls(this,s),this.at(s).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})})),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach(((e,s)=>{this.at(s)&&this.at(s).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})})),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild(((s,i)=>{s.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})})),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map((e=>as(e)))}clear(e={}){this.controls.length<1||(this._forEachChild((e=>e._registerOnCollectionChange((()=>{})))),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce(((e,t)=>!!t._syncPendingControls()||e),!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach(((t,s)=>{e(t,s)}))}_updateValue(){this.value=this.controls.filter((e=>e.enabled||this.disabled)).map((e=>e.value))}_anyControls(e){return this.controls.some((t=>t.enabled&&e(t)))}_setUpControls(){this._forEachChild((e=>this._registerControl(e)))}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const gs={provide:Tt,useExisting:(0,K.forwardRef)((()=>ys))},ms=Promise.resolve(null);class ys extends Tt{constructor(e,t){super(),this.submitted=!1,this._directives=new Set,this.ngSubmit=new K.EventEmitter,this.form=new us({},pt(e),gt(t))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ms.then((()=>{const t=this._findContainer(e.path);e.control=t.registerControl(e.name,e.control),Bt(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)}))}getControl(e){return this.form.get(e.path)}removeControl(e){ms.then((()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name),this._directives.delete(e)}))}addFormGroup(e){ms.then((()=>{const t=this._findContainer(e.path),s=new us({});Pt(s,e),t.registerControl(e.name,s),s.updateValueAndValidity({emitEvent:!1})}))}removeFormGroup(e){ms.then((()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name)}))}getFormGroup(e){return this.form.get(e.path)}updateModel(e,t){ms.then((()=>{this.form.get(e.path).setValue(t)}))}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,Kt(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}ys.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ys,deps:[{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),ys.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ys,selector:"form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},host:{listeners:{submit:"onSubmit($event)",reset:"onReset()"}},providers:[gs],exportAs:["ngForm"],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ys,decorators:[{type:K.Directive,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",providers:[gs],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]}]},propDecorators:{options:[{type:K.Input,args:["ngFormOptions"]}]}});class Cs extends Tt{ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return Dt(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}}Cs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Cs,deps:null,target:K["ɵɵFactoryTarget"].Directive}),Cs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Cs,usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Cs,decorators:[{type:K.Directive}]});const vs={provide:Tt,useExisting:(0,K.forwardRef)((()=>Ss))};class Ss extends Cs{constructor(e,t,s){super(),this._parent=e,this._setValidators(t),this._setAsyncValidators(s)}_checkParentType(){if(!(this._parent instanceof Ss)&&!(this._parent instanceof ys)&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error(`\n    ngModelGroup cannot be used with a parent formGroup directive.\n\n    Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n    ${kt}\n\n    Option 2:  Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n    ${_t}`)}}Ss.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ss,deps:[{token:Tt,host:!0,skipSelf:!0},{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),Ss.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ss,selector:"[ngModelGroup]",inputs:{name:["ngModelGroup","name"]},providers:[vs],exportAs:["ngModelGroup"],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ss,decorators:[{type:K.Directive,args:[{selector:"[ngModelGroup]",providers:[vs],exportAs:"ngModelGroup"}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Host},{type:K.SkipSelf}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]}]},propDecorators:{name:[{type:K.Input,args:["ngModelGroup"]}]}});const bs={provide:Mt,useExisting:(0,K.forwardRef)((()=>Is))},fs=Promise.resolve(null);class Is extends Mt{constructor(e,t,s,i,o){super(),this._changeDetectorRef=o,this.control=new ds,this._registered=!1,this.update=new K.EventEmitter,this._parent=e,this._setValidators(t),this._setAsyncValidators(s),this.valueAccessor=zt(this,i)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){const t=e.name.previousValue;this.formDirective.removeControl({name:t,path:this._getPath(t)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Ht(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bt(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){if("undefined"==typeof ngDevMode||ngDevMode){if(!(this._parent instanceof Ss)&&this._parent instanceof Cs)throw new Error(`\n    ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n    Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n    ${kt}\n\n    Option 2:  Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n    ${_t}`);if(!(this._parent instanceof Ss||this._parent instanceof ys))throw new Error(`\n    ngModel cannot be used to register form controls with a parent formGroup directive.  Try using\n    formGroup's partner directive "formControlName" instead.  Example:\n\n    ${At}\n\n    Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n    Example:\n\n    \n  <div [formGroup]="myGroup">\n      <input formControlName="firstName">\n      <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n  </div>\n`)}}_checkName(){if(this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&!this.name&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n    control must be defined as \'standalone\' in ngModelOptions.\n\n    Example 1: <input [(ngModel)]="person.firstName" name="first">\n    Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">')}_updateValue(e){fs.then((()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()}))}_updateDisabled(e){const t=e.isDisabled.currentValue,s=""===t||t&&"false"!==t;fs.then((()=>{s&&!this.control.disabled?this.control.disable():!s&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()}))}_getPath(e){return this._parent?Dt(e,this._parent):[e]}}Is.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Is,deps:[{token:Tt,host:!0,optional:!0},{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0},{token:We,optional:!0,self:!0},{token:K.ChangeDetectorRef,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Is.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Is,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},providers:[bs],exportAs:["ngModel"],usesInheritance:!0,usesOnChanges:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Is,decorators:[{type:K.Directive,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[bs],exportAs:"ngModel"}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Optional},{type:K.Host}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[We]}]},{type:K.ChangeDetectorRef,decorators:[{type:K.Optional},{type:K.Inject,args:[K.ChangeDetectorRef]}]}]},propDecorators:{name:[{type:K.Input}],isDisabled:[{type:K.Input,args:["disabled"]}],model:[{type:K.Input,args:["ngModel"]}],options:[{type:K.Input,args:["ngModelOptions"]}],update:[{type:K.Output,args:["ngModelChange"]}]}});class Ts{}Ts.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ts,deps:[],target:K["ɵɵFactoryTarget"].Directive}),Ts.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ts,selector:"form:not([ngNoForm]):not([ngNativeValidate])",host:{attributes:{novalidate:""}},ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ts,decorators:[{type:K.Directive,args:[{selector:"form:not([ngNoForm]):not([ngNativeValidate])",host:{novalidate:""}}]}]});const Ms={provide:We,useExisting:(0,K.forwardRef)((()=>xs)),multi:!0};class xs extends qe{writeValue(e){const t=null==e?"":e;this.setProperty("value",t)}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}}xs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xs,deps:null,target:K["ɵɵFactoryTarget"].Directive}),xs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:xs,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{listeners:{input:"onChange($event.target.value)",blur:"onTouched()"}},providers:[Ms],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xs,decorators:[{type:K.Directive,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[Ms]}]}]});const ws={provide:We,useExisting:(0,K.forwardRef)((()=>ks)),multi:!0};class Es{}Es.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Es,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),Es.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Es}),Es.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Es}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Es,decorators:[{type:K.NgModule}]});class As{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach((t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)}))}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}As.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:As,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),As.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:As,providedIn:Es}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:As,decorators:[{type:K.Injectable,args:[{providedIn:Es}]}]});class ks extends qe{constructor(e,t,s,i){super(e,t),this._registry=s,this._injector=i,this.onChange=()=>{}}ngOnInit(){this._control=this._injector.get(Mt),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&this.name!==this.formControlName&&("undefined"==typeof ngDevMode||ngDevMode)&&function(){throw new Error('\n      If you define both a name and a formControlName attribute on your radio button, their values\n      must match. Ex: <input type="radio" formControlName="food" name="food">\n    ')}(),!this.name&&this.formControlName&&(this.name=this.formControlName)}}ks.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ks,deps:[{token:K.Renderer2},{token:K.ElementRef},{token:As},{token:K.Injector}],target:K["ɵɵFactoryTarget"].Directive}),ks.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ks,selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",inputs:{name:"name",formControlName:"formControlName",value:"value"},host:{listeners:{change:"onChange()",blur:"onTouched()"}},providers:[ws],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ks,decorators:[{type:K.Directive,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[ws]}]}],ctorParameters:function(){return[{type:K.Renderer2},{type:K.ElementRef},{type:As},{type:K.Injector}]},propDecorators:{name:[{type:K.Input}],formControlName:[{type:K.Input}],value:[{type:K.Input}]}});const _s={provide:We,useExisting:(0,K.forwardRef)((()=>Rs)),multi:!0};class Rs extends qe{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}}Rs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Rs,deps:null,target:K["ɵɵFactoryTarget"].Directive}),Rs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Rs,selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{listeners:{change:"onChange($event.target.value)",input:"onChange($event.target.value)",blur:"onTouched()"}},providers:[_s],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Rs,decorators:[{type:K.Directive,args:[{selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[_s]}]}]});const Us=new K.InjectionToken("NgModelWithFormControlWarning"),Ds={provide:Mt,useExisting:(0,K.forwardRef)((()=>Bs))};class Bs extends Mt{constructor(e,t,s,i){super(),this._ngModelWarningConfig=i,this.update=new K.EventEmitter,this._ngModelWarningSent=!1,this._setValidators(e),this._setAsyncValidators(t),this.valueAccessor=zt(this,s)}set isDisabled(e){("undefined"==typeof ngDevMode||ngDevMode)&&console.warn(Rt)}ngOnChanges(e){if(this._isControlChanged(e)){const t=e.form.previousValue;t&&Ot(t,this,!1),Bt(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}Ht(e,this.viewModel)&&(("undefined"==typeof ngDevMode||ngDevMode)&&Wt("formControl",Bs,this,this._ngModelWarningConfig),this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&Ot(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}}Bs._ngModelWarningSentOnce=!1,Bs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Bs,deps:[{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0},{token:We,optional:!0,self:!0},{token:Us,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Bs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Bs,selector:"[formControl]",inputs:{form:["formControl","form"],isDisabled:["disabled","isDisabled"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},providers:[Ds],exportAs:["ngForm"],usesInheritance:!0,usesOnChanges:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Bs,decorators:[{type:K.Directive,args:[{selector:"[formControl]",providers:[Ds],exportAs:"ngForm"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[We]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Inject,args:[Us]}]}]},propDecorators:{form:[{type:K.Input,args:["formControl"]}],isDisabled:[{type:K.Input,args:["disabled"]}],model:[{type:K.Input,args:["ngModel"]}],update:[{type:K.Output,args:["ngModelChange"]}]}});const Os={provide:Tt,useExisting:(0,K.forwardRef)((()=>Fs))};class Fs extends Tt{constructor(e,t){super(),this.validators=e,this.asyncValidators=t,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new K.EventEmitter,this._setValidators(e),this._setAsyncValidators(t)}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Gt(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange((()=>{})))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const t=this.form.get(e.path);return Bt(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}getControl(e){return this.form.get(e.path)}removeControl(e){Ot(e.control||null,e,!1),qt(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,t){this.form.get(e.path).setValue(t)}onSubmit(e){return this.submitted=!0,Kt(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach((e=>{const t=e.control,s=this.form.get(e.path);t!==s&&(Ot(t||null,e),os(s)&&(Bt(s,e),e.control=s))})),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){const t=this.form.get(e.path);Pt(t,e),t.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){const t=this.form.get(e.path);if(t){const s=function(e,t){return Gt(e,t)}(t,e);s&&t.updateValueAndValidity({emitEvent:!1})}}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange((()=>{}))}_updateValidators(){Lt(this.form,this),this._oldForm&&Gt(this._oldForm,this)}_checkFormPresent(){if(!this.form&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error(`formGroup expects a FormGroup instance. Please pass one in.\n\n      Example:\n\n      ${At}`)}}Fs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Fs,deps:[{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),Fs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Fs,selector:"[formGroup]",inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},host:{listeners:{submit:"onSubmit($event)",reset:"onReset()"}},providers:[Os],exportAs:["ngForm"],usesInheritance:!0,usesOnChanges:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Fs,decorators:[{type:K.Directive,args:[{selector:"[formGroup]",providers:[Os],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm"}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]}]},propDecorators:{form:[{type:K.Input,args:["formGroup"]}],ngSubmit:[{type:K.Output}]}});const Ls={provide:Tt,useExisting:(0,K.forwardRef)((()=>Gs))};class Gs extends Cs{constructor(e,t,s){super(),this._parent=e,this._setValidators(t),this._setAsyncValidators(s)}_checkParentType(){if(Ns(this._parent)&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error(`formGroupName must be used with a parent formGroup directive.  You'll want to add a formGroup\n    directive and pass it an existing FormGroup instance (you can create one in your class).\n\n    Example:\n\n    ${kt}`)}}Gs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Gs,deps:[{token:Tt,host:!0,optional:!0,skipSelf:!0},{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),Gs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Gs,selector:"[formGroupName]",inputs:{name:["formGroupName","name"]},providers:[Ls],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Gs,decorators:[{type:K.Directive,args:[{selector:"[formGroupName]",providers:[Ls]}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Optional},{type:K.Host},{type:K.SkipSelf}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]}]},propDecorators:{name:[{type:K.Input,args:["formGroupName"]}]}});const Vs={provide:Tt,useExisting:(0,K.forwardRef)((()=>Ps))};class Ps extends Tt{constructor(e,t,s){super(),this._parent=e,this._setValidators(t),this._setAsyncValidators(s)}ngOnInit(){this._checkParentType(),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return Dt(null==this.name?this.name:this.name.toString(),this._parent)}_checkParentType(){if(Ns(this._parent)&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error('formArrayName must be used with a parent formGroup directive.  You\'ll want to add a formGroup\n      directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      \n  <div [formGroup]="myGroup">\n    <div formArrayName="cities">\n      <div *ngFor="let city of cityArray.controls; index as i">\n        <input [formControlName]="i">\n      </div>\n    </div>\n  </div>\n\n  In your class:\n\n  this.cityArray = new FormArray([new FormControl(\'SF\')]);\n  this.myGroup = new FormGroup({\n    cities: this.cityArray\n  });')}}function Ns(e){return!(e instanceof Gs||e instanceof Fs||e instanceof Ps)}Ps.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ps,deps:[{token:Tt,host:!0,optional:!0,skipSelf:!0},{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0}],target:K["ɵɵFactoryTarget"].Directive}),Ps.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ps,selector:"[formArrayName]",inputs:{name:["formArrayName","name"]},providers:[Vs],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ps,decorators:[{type:K.Directive,args:[{selector:"[formArrayName]",providers:[Vs]}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Optional},{type:K.Host},{type:K.SkipSelf}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]}]},propDecorators:{name:[{type:K.Input,args:["formArrayName"]}]}});const js={provide:Mt,useExisting:(0,K.forwardRef)((()=>Hs))};class Hs extends Mt{constructor(e,t,s,i,o){super(),this._ngModelWarningConfig=o,this._added=!1,this.update=new K.EventEmitter,this._ngModelWarningSent=!1,this._parent=e,this._setValidators(t),this._setAsyncValidators(s),this.valueAccessor=zt(this,i)}set isDisabled(e){("undefined"==typeof ngDevMode||ngDevMode)&&console.warn(Rt)}ngOnChanges(e){this._added||this._setUpControl(),Ht(e,this.viewModel)&&(("undefined"==typeof ngDevMode||ngDevMode)&&Wt("formControlName",Hs,this,this._ngModelWarningConfig),this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return Dt(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){if("undefined"==typeof ngDevMode||ngDevMode){if(!(this._parent instanceof Gs)&&this._parent instanceof Cs)throw new Error(`formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n      that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n      Option 1:  Update the parent to be formGroupName (reactive form strategy)\n\n      ${kt}\n\n      Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n      ${_t}`);if(!(this._parent instanceof Gs||this._parent instanceof Fs||this._parent instanceof Ps))throw new Error(`formControlName must be used with a parent formGroup directive.  You'll want to add a formGroup\n      directive and pass it an existing FormGroup instance (you can create one in your class).\n\n    Example:\n\n    ${At}`)}}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}Hs._ngModelWarningSentOnce=!1,Hs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Hs,deps:[{token:Tt,host:!0,optional:!0,skipSelf:!0},{token:tt,optional:!0,self:!0},{token:st,optional:!0,self:!0},{token:We,optional:!0,self:!0},{token:Us,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Hs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Hs,selector:"[formControlName]",inputs:{name:["formControlName","name"],isDisabled:["disabled","isDisabled"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},providers:[js],usesInheritance:!0,usesOnChanges:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Hs,decorators:[{type:K.Directive,args:[{selector:"[formControlName]",providers:[js]}]}],ctorParameters:function(){return[{type:Tt,decorators:[{type:K.Optional},{type:K.Host},{type:K.SkipSelf}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[tt]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[st]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Self},{type:K.Inject,args:[We]}]},{type:void 0,decorators:[{type:K.Optional},{type:K.Inject,args:[Us]}]}]},propDecorators:{name:[{type:K.Input,args:["formControlName"]}],isDisabled:[{type:K.Input,args:["disabled"]}],model:[{type:K.Input,args:["ngModel"]}],update:[{type:K.Output,args:["ngModelChange"]}]}});const Ks={provide:We,useExisting:(0,K.forwardRef)((()=>qs)),multi:!0};function zs(e,t){return null==e?`${t}`:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}class qs extends qe{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(e){if("function"!=typeof e&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error(`compareWith must be a function, but received ${JSON.stringify(e)}`);this._compareWith=e}writeValue(e){this.value=e;const t=zs(this._getOptionId(e),e);this.setProperty("value",t)}registerOnChange(e){this.onChange=t=>{this.value=this._getOptionValue(t),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t),e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e}}qs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:qs,deps:null,target:K["ɵɵFactoryTarget"].Directive}),qs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:qs,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:{compareWith:"compareWith"},host:{listeners:{change:"onChange($event.target.value)",blur:"onTouched()"}},providers:[Ks],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:qs,decorators:[{type:K.Directive,args:[{selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",host:{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[Ks]}]}],propDecorators:{compareWith:[{type:K.Input}]}});class Ws{constructor(e,t,s){this._element=e,this._renderer=t,this._select=s,this._select&&(this.id=this._select._registerOption())}set ngValue(e){null!=this._select&&(this._select._optionMap.set(this.id,e),this._setElementValue(zs(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._setElementValue(e),this._select&&this._select.writeValue(this._select.value)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}Ws.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ws,deps:[{token:K.ElementRef},{token:K.Renderer2},{token:qs,host:!0,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Ws.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ws,selector:"option",inputs:{ngValue:"ngValue",value:"value"},ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ws,decorators:[{type:K.Directive,args:[{selector:"option"}]}],ctorParameters:function(){return[{type:K.ElementRef},{type:K.Renderer2},{type:qs,decorators:[{type:K.Optional},{type:K.Host}]}]},propDecorators:{ngValue:[{type:K.Input,args:["ngValue"]}],value:[{type:K.Input,args:["value"]}]}});const $s={provide:We,useExisting:(0,K.forwardRef)((()=>Qs)),multi:!0};function Js(e,t){return null==e?`${t}`:("string"==typeof t&&(t=`'${t}'`),t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}class Qs extends qe{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(e){if("function"!=typeof e&&("undefined"==typeof ngDevMode||ngDevMode))throw new Error(`compareWith must be a function, but received ${JSON.stringify(e)}`);this._compareWith=e}writeValue(e){let t;if(this.value=e,Array.isArray(e)){const s=e.map((e=>this._getOptionId(e)));t=(e,t)=>{e._setSelected(s.indexOf(t.toString())>-1)}}else t=(e,t)=>{e._setSelected(!1)};this._optionMap.forEach(t)}registerOnChange(e){this.onChange=t=>{const s=[],i=t.selectedOptions;if(void 0!==i){const e=i;for(let t=0;t<e.length;t++){const i=e[t],o=this._getOptionValue(i.value);s.push(o)}}else{const e=t.options;for(let t=0;t<e.length;t++){const i=e[t];if(i.selected){const e=this._getOptionValue(i.value);s.push(e)}}}this.value=s,e(s)}}_registerOption(e){const t=(this._idCounter++).toString();return this._optionMap.set(t,e),t}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t)._value,e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t)._value:e}}Qs.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Qs,deps:null,target:K["ɵɵFactoryTarget"].Directive}),Qs.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Qs,selector:"select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",inputs:{compareWith:"compareWith"},host:{listeners:{change:"onChange($event.target)",blur:"onTouched()"}},providers:[$s],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Qs,decorators:[{type:K.Directive,args:[{selector:"select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",host:{"(change)":"onChange($event.target)","(blur)":"onTouched()"},providers:[$s]}]}],propDecorators:{compareWith:[{type:K.Input}]}});class Ys{constructor(e,t,s){this._element=e,this._renderer=t,this._select=s,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){null!=this._select&&(this._value=e,this._setElementValue(Js(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Js(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}function Zs(e){return"number"==typeof e?e:parseInt(e,10)}function Xs(e){return"number"==typeof e?e:parseFloat(e)}Ys.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ys,deps:[{token:K.ElementRef},{token:K.Renderer2},{token:Qs,host:!0,optional:!0}],target:K["ɵɵFactoryTarget"].Directive}),Ys.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:Ys,selector:"option",inputs:{ngValue:"ngValue",value:"value"},ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ys,decorators:[{type:K.Directive,args:[{selector:"option"}]}],ctorParameters:function(){return[{type:K.ElementRef},{type:K.Renderer2},{type:Qs,decorators:[{type:K.Optional},{type:K.Host}]}]},propDecorators:{ngValue:[{type:K.Input,args:["ngValue"]}],value:[{type:K.Input,args:["value"]}]}});class ei{constructor(){this._validator=at}ngOnChanges(e){if(this.inputName in e){const t=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(t),this._validator=this._enabled?this.createValidator(t):at,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return null!=e}}ei.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ei,deps:[],target:K["ɵɵFactoryTarget"].Directive}),ei.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ei,usesOnChanges:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ei,decorators:[{type:K.Directive}]});const ti={provide:tt,useExisting:(0,K.forwardRef)((()=>si)),multi:!0};class si extends ei{constructor(){super(...arguments),this.inputName="max",this.normalizeInput=e=>Xs(e),this.createValidator=e=>function(e){return t=>{if(Xe(t.value)||Xe(e))return null;const s=parseFloat(t.value);return!isNaN(s)&&s>e?{max:{max:e,actual:t.value}}:null}}(e)}}si.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:si,deps:null,target:K["ɵɵFactoryTarget"].Directive}),si.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:si,selector:"input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",inputs:{max:"max"},host:{properties:{"attr.max":"_enabled ? max : null"}},providers:[ti],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:si,decorators:[{type:K.Directive,args:[{selector:"input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",providers:[ti],host:{"[attr.max]":"_enabled ? max : null"}}]}],propDecorators:{max:[{type:K.Input}]}});const ii={provide:tt,useExisting:(0,K.forwardRef)((()=>oi)),multi:!0};class oi extends ei{constructor(){super(...arguments),this.inputName="min",this.normalizeInput=e=>Xs(e),this.createValidator=e=>function(e){return t=>{if(Xe(t.value)||Xe(e))return null;const s=parseFloat(t.value);return!isNaN(s)&&s<e?{min:{min:e,actual:t.value}}:null}}(e)}}oi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:oi,deps:null,target:K["ɵɵFactoryTarget"].Directive}),oi.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:oi,selector:"input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",inputs:{min:"min"},host:{properties:{"attr.min":"_enabled ? min : null"}},providers:[ii],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:oi,decorators:[{type:K.Directive,args:[{selector:"input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",providers:[ii],host:{"[attr.min]":"_enabled ? min : null"}}]}],propDecorators:{min:[{type:K.Input}]}});const ni={provide:tt,useExisting:(0,K.forwardRef)((()=>ai)),multi:!0},ri={provide:tt,useExisting:(0,K.forwardRef)((()=>li)),multi:!0};class ai extends ei{constructor(){super(...arguments),this.inputName="required",this.normalizeInput=e=>function(e){return null!=e&&!1!==e&&"false"!=`${e}`}(e),this.createValidator=e=>ot}enabled(e){return e}}ai.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ai,deps:null,target:K["ɵɵFactoryTarget"].Directive}),ai.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ai,selector:":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",inputs:{required:"required"},host:{properties:{"attr.required":'_enabled ? "" : null'}},providers:[ni],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ai,decorators:[{type:K.Directive,args:[{selector:":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",providers:[ni],host:{"[attr.required]":'_enabled ? "" : null'}}]}],propDecorators:{required:[{type:K.Input}]}});class li extends ai{constructor(){super(...arguments),this.createValidator=e=>nt}}li.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:li,deps:null,target:K["ɵɵFactoryTarget"].Directive}),li.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:li,selector:"input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",host:{properties:{"attr.required":'_enabled ? "" : null'}},providers:[ri],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:li,decorators:[{type:K.Directive,args:[{selector:"input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",providers:[ri],host:{"[attr.required]":'_enabled ? "" : null'}}]}]});const hi={provide:tt,useExisting:(0,K.forwardRef)((()=>ci)),multi:!0};class ci extends ei{constructor(){super(...arguments),this.inputName="email",this.normalizeInput=e=>""===e||!0===e||"true"===e,this.createValidator=e=>rt}enabled(e){return e}}ci.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ci,deps:null,target:K["ɵɵFactoryTarget"].Directive}),ci.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ci,selector:"[email][formControlName],[email][formControl],[email][ngModel]",inputs:{email:"email"},providers:[hi],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ci,decorators:[{type:K.Directive,args:[{selector:"[email][formControlName],[email][formControl],[email][ngModel]",providers:[hi]}]}],propDecorators:{email:[{type:K.Input}]}});const di={provide:tt,useExisting:(0,K.forwardRef)((()=>ui)),multi:!0};class ui extends ei{constructor(){super(...arguments),this.inputName="minlength",this.normalizeInput=e=>Zs(e),this.createValidator=e=>{return t=e,e=>Xe(e.value)||!et(e.value)?null:e.value.length<t?{minlength:{requiredLength:t,actualLength:e.value.length}}:null;var t}}}ui.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ui,deps:null,target:K["ɵɵFactoryTarget"].Directive}),ui.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:ui,selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",inputs:{minlength:"minlength"},host:{properties:{"attr.minlength":"_enabled ? minlength : null"}},providers:[di],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ui,decorators:[{type:K.Directive,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[di],host:{"[attr.minlength]":"_enabled ? minlength : null"}}]}],propDecorators:{minlength:[{type:K.Input}]}});const pi={provide:tt,useExisting:(0,K.forwardRef)((()=>gi)),multi:!0};class gi extends ei{constructor(){super(...arguments),this.inputName="maxlength",this.normalizeInput=e=>Zs(e),this.createValidator=e=>{return t=e,e=>et(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null;var t}}}gi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:gi,deps:null,target:K["ɵɵFactoryTarget"].Directive}),gi.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:gi,selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",inputs:{maxlength:"maxlength"},host:{properties:{"attr.maxlength":"_enabled ? maxlength : null"}},providers:[pi],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:gi,decorators:[{type:K.Directive,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[pi],host:{"[attr.maxlength]":"_enabled ? maxlength : null"}}]}],propDecorators:{maxlength:[{type:K.Input}]}});const mi={provide:tt,useExisting:(0,K.forwardRef)((()=>yi)),multi:!0};class yi extends ei{constructor(){super(...arguments),this.inputName="pattern",this.normalizeInput=e=>e,this.createValidator=e=>function(e){if(!e)return at;let t,s;return"string"==typeof e?(s="","^"!==e.charAt(0)&&(s+="^"),s+=e,"$"!==e.charAt(e.length-1)&&(s+="$"),t=new RegExp(s)):(s=e.toString(),t=e),e=>{if(Xe(e.value))return null;const i=e.value;return t.test(i)?null:{pattern:{requiredPattern:s,actualValue:i}}}}(e)}}yi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:yi,deps:null,target:K["ɵɵFactoryTarget"].Directive}),yi.ɵdir=K["ɵɵngDeclareDirective"]({minVersion:"12.0.0",version:"13.3.12",type:yi,selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",inputs:{pattern:"pattern"},host:{properties:{"attr.pattern":"_enabled ? pattern : null"}},providers:[mi],usesInheritance:!0,ngImport:z}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:yi,decorators:[{type:K.Directive,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[mi],host:{"[attr.pattern]":"_enabled ? pattern : null"}}]}],propDecorators:{pattern:[{type:K.Input}]}});const Ci=[Ts,Ws,Ys,Ze,xs,Rs,Je,qs,Qs,ks,wt,Et,ai,ui,gi,yi,li,ci,oi,si],vi=[Is,Ss,ys],Si=[Bs,Fs,Hs,Gs,Ps];class bi{}bi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:bi,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),bi.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:bi,declarations:[Ts,Ws,Ys,Ze,xs,Rs,Je,qs,Qs,ks,wt,Et,ai,ui,gi,yi,li,ci,oi,si],imports:[Es],exports:[Ts,Ws,Ys,Ze,xs,Rs,Je,qs,Qs,ks,wt,Et,ai,ui,gi,yi,li,ci,oi,si]}),bi.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:bi,imports:[[Es]]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:bi,decorators:[{type:K.NgModule,args:[{declarations:Ci,imports:[Es],exports:Ci}]}]});class fi{}fi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:fi,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),fi.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:fi,declarations:[Is,Ss,ys],exports:[bi,Is,Ss,ys]}),fi.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:fi,imports:[bi]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:fi,decorators:[{type:K.NgModule,args:[{declarations:vi,exports:[bi,vi]}]}]});class Ii{static withConfig(e){return{ngModule:Ii,providers:[{provide:Us,useValue:e.warnOnNgModelWithFormControl}]}}}Ii.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ii,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),Ii.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ii,declarations:[Bs,Fs,Hs,Gs,Ps],exports:[bi,Bs,Fs,Hs,Gs,Ps]}),Ii.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ii,imports:[bi]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ii,decorators:[{type:K.NgModule,args:[{declarations:[Si],exports:[bi,Si]}]}]});class Ti{group(e,t=null){const s=this._reduceControls(e);let i,o=null,n=null;return null!=t&&(function(e){return void 0!==e.asyncValidators||void 0!==e.validators||void 0!==e.updateOn}(t)?(o=null!=t.validators?t.validators:null,n=null!=t.asyncValidators?t.asyncValidators:null,i=null!=t.updateOn?t.updateOn:void 0):(o=null!=t.validator?t.validator:null,n=null!=t.asyncValidator?t.asyncValidator:null)),new us(s,{asyncValidators:n,updateOn:i,validators:o})}control(e,t,s){return new ds(e,t,s)}array(e,t,s){const i=e.map((e=>this._createControl(e)));return new ps(i,t,s)}_reduceControls(e){const t={};return Object.keys(e).forEach((s=>{t[s]=this._createControl(e[s])})),t}_createControl(e){if(os(e)||ns(e)||rs(e))return e;if(Array.isArray(e)){const t=e[0],s=e.length>1?e[1]:null,i=e.length>2?e[2]:null;return this.control(t,s,i)}return this.control(e)}}Ti.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ti,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),Ti.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ti,providedIn:Ii}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ti,decorators:[{type:K.Injectable,args:[{providedIn:Ii}]}]}),new K.Version("13.3.12");let Mi=class{};Mi=L([(0,K.NgModule)({declarations:[Y],imports:[W.CommonModule,fi],exports:[Y],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Mi);let xi=class{};xi=L([(0,K.NgModule)({declarations:[Q],imports:[W.CommonModule,Mi],exports:[Q],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],xi);let wi=class{constructor(){this.ongoingCallStyle={maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"grey",minHeight:"400px",minWidth:"400px",minimizeIconTint:"white",maximizeIconTint:"white"},this.resizeIconHoverText=(0,e.localize)("RESIZE"),this.sessionID="",this.minimizeIconURL="assets/reduce-size.svg",this.maximizeIconURL="assets/increase-size.svg"}ngOnInit(){}};L([(0,K.Input)(),G("design:type",t.CallscreenStyle)],wi.prototype,"ongoingCallStyle",void 0),L([(0,K.Input)(),G("design:type",String)],wi.prototype,"resizeIconHoverText",void 0),L([(0,K.Input)(),G("design:type",String)],wi.prototype,"sessionID",void 0),L([(0,K.Input)(),G("design:type",String)],wi.prototype,"minimizeIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],wi.prototype,"maximizeIconURL",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.CallSettingsBuilder)],wi.prototype,"callSettingsBuilder",void 0),wi=L([(0,K.Component)({selector:"cometchat-ongoing-call",templateUrl:"./cometchat-ongoing-call.component.html",styleUrls:["./cometchat-ongoing-call.component.scss"]})],wi);let Ei=class{};Ei=L([(0,K.NgModule)({declarations:[wi],imports:[W.CommonModule,Mi],exports:[wi],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ei);let Ai=class{};Ai=L([(0,K.NgModule)({declarations:[$],imports:[W.CommonModule,xi,Ei],exports:[$],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ai);let ki=class{constructor(s,i){this.ref=s,this.themeService=i,this.title=(0,e.localize)("CALL_DETAILS"),this.closeButtonIconURL="assets/close2x.svg",this.hideProfile=!1,this.disableUsersPresence=!1,this.privateGroupIcon="assets/Private.svg",this.protectedGroupIcon="assets/Locked.svg",this.onError=e=>{console.log(e)},this.data=[],this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px",border:""},this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px",border:"none"},this.callDetailsStyle={width:"100%",height:"100%",padding:"0 100px"},this.callButtonsConfiguration=new t.CallButtonsConfiguration({}),this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"transparent",borderRadius:"grey",titleFont:"600 15px Inter",titleColor:"black",border:"",hoverBackground:"transparent",separatorColor:"rgb(222 222 222 / 46%)"},this.messagesList=[],this.loggedInUser=null,this.statusColor={private:"",password:"#F7A500",public:""},this.closeButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.callDetailsStyle.closeButtonIconTint||this.themeService.theme.palette.getPrimary()},this.buttonStyle={height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",buttonTextColor:this.themeService.theme.palette.getPrimary()||"rgba(51, 153, 255)",buttonTextFont:"500 16px Inter"},this.dividerStyle={background:"rgb(222 222 222 / 46%)",height:"1px",width:"100%"},this.subtitleText="",this.userListenerId="userlist_"+(new Date).getTime(),this.limit=5,this.types=[],this.categories=[],this.checkStatusType=()=>{var e,t;return this.user&&!this.disableUsersPresence?this.statusColor[null===(e=this.user)||void 0===e?void 0:e.getStatus()]:this.statusColor[null===(t=this.group)||void 0===t?void 0:t.getType()]},this.onCloseClick=()=>{this.onClose&&this.onClose()},this.subtitleStyle=()=>this.user&&this.user.getStatus()==e.CometChatUIKitConstants.userStatusType.online?{textFont:this.callDetailsStyle.subtitleTextFont,textColor:this.themeService.theme.palette.getPrimary()}:{textFont:this.callDetailsStyle.subtitleTextFont,textColor:this.callDetailsStyle.subtitleTextColor},this.getGroupIcon=t=>{let s;if(t)switch(t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=null}return s},this.getTemplateOptions=e=>e.options?e.options(this.user,this.group,e.id):[],this.wrapperStyle=()=>({width:this.callDetailsStyle.width,height:this.callDetailsStyle.height,border:this.callDetailsStyle.border,borderRadius:this.callDetailsStyle.borderRadius,background:this.callDetailsStyle.background}),this.marginStyle=()=>{var e;return{padding:null===(e=this.callDetailsStyle)||void 0===e?void 0:e.padding}}}getTitleStyle(){return{textFont:this.callDetailsStyle.titleTextFont||(0,e.fontHelper)(this.themeService.theme.typography.title1),textColor:this.callDetailsStyle.titleTextColor||this.themeService.theme.palette.getAccent()}}ngOnChanges(e){(e.user||e.group)&&this.updateSubtitle()}removeListener(){s.CometChat.removeUserListener(this.userListenerId)}ngOnDestroy(){this.removeListener(),this.onClose&&this.onClose(),this.unsubscribeToEvents()}ngOnInit(){this.setThemeStyle(),this.subscribeToEvents(),this.statusColor.online=this.callDetailsStyle.onlineStatusColor||this.themeService.theme.palette.getSuccess(),this.attachListeners(),this.updateSubtitle()}isDateDifferent(e,t){let s,i;return s=new Date(1e3*e),i=new Date(1e3*t),s.getDate()!==i.getDate()||s.getMonth()!==i.getMonth()||s.getFullYear()!==i.getFullYear()}subscribeToEvents(){this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.group=null==e?void 0:e.userAddedIn,this.group=null==e?void 0:e.userAddedIn,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.group=null==e?void 0:e.joinedGroup,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.group=null==e?void 0:e.kickedFrom,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.group=null==e?void 0:e.kickedFrom,this.updateSubtitle(),this.ref.detectChanges()})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{this.group=null==e?void 0:e.group,this.updateSubtitle(),this.ref.detectChanges()}))}unsubscribeToEvents(){var e,t,s,i,o;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberJoined)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberKicked)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberBanned)||void 0===i||i.unsubscribe(),null===(o=this.ccOwnershipChanged)||void 0===o||o.unsubscribe()}updateSubtitle(){var t;const s=null===(t=this.group)||void 0===t?void 0:t.getMembersCount(),i=(0,e.localize)(s>1?"MEMBERS":"MEMBER");this.subtitleText=this.user?this.user.getStatus():`${s} ${i}`,this.ref.detectChanges()}getButtonStyle(e){return{height:"100%",width:"100%",border:"none",borderRadius:"0",buttonTextFont:null==e?void 0:e.titleFont,buttonTextColor:null==e?void 0:e.titleColor,background:(null==e?void 0:e.backgroundColor)||"transparent"}}checkGroupType(){var t;let s="";if(this.group)switch(null===(t=this.group)||void 0===t?void 0:t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=""}return s}updateUserStatus(e){this.user&&this.user.getUid()&&this.user.getUid()===e.getUid()&&(this.user.setStatus(e.getStatus()),this.updateSubtitle())}attachListeners(){try{this.disableUsersPresence||s.CometChat.addUserListener(this.userListenerId,new s.CometChat.UserListener({onUserOnline:e=>{this.updateUserStatus(e)},onUserOffline:e=>{this.updateUserStatus(e)}}))}catch(e){console.log(e)}}getSectionHeaderStyle(){return{textFont:"500 15px Inter",textColor:"lightgrey"}}getCallStatusStyleStyle(){return{textFont:"400 15px Inter",textColor:"black"}}getDateStyle(){return{textFont:"400 15px Inter",textColor:"lightgrey"}}onCloseDetails(){this.onClose&&this.onClose()}getStatusIndicatorColor(e){return this.statusColor[null==e?void 0:e.getType()]}getCustomOptionView(e){return null==e?void 0:e.customView}showDataSectionStyle(e){return{textFont:e.titleFont,textColor:e.titleColor}}setThemeStyle(){this.setDetailsStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.setListItemStyle(),this.statusColor.private=this.callDetailsStyle.privateGroupIconBackground,this.statusColor.online=this.callDetailsStyle.onlineStatusColor,this.statusColor.password=this.callDetailsStyle.passwordGroupIconBackground}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setDetailsStyle(){let s=new t.DetailsStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",closeButtonIconTint:this.themeService.theme.palette.getPrimary(),width:"100%",height:"100%",borderRadius:"",subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subtitleTextColor:this.themeService.theme.palette.getAccent600(),padding:"0 100px"});this.callDetailsStyle=Object.assign(Object.assign({},s),this.callDetailsStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.Group)],ki.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],ki.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",String)],ki.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",String)],ki.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ki.prototype,"hideProfile",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ki.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ki.prototype,"customProfileView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ki.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",String)],ki.prototype,"privateGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],ki.prototype,"protectedGroupIcon",void 0),L([(0,K.Input)(),G("design:type",Object)],ki.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Array)],ki.prototype,"data",void 0),L([(0,K.Input)(),G("design:type",Function)],ki.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",Object)],ki.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],ki.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.DetailsStyle)],ki.prototype,"callDetailsStyle",void 0),L([(0,K.Input)(),G("design:type",t.CallButtonsConfiguration)],ki.prototype,"callButtonsConfiguration",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],ki.prototype,"listItemStyle",void 0),ki=L([(0,K.Component)({selector:"cometchat-call-details",templateUrl:"./cometchat-call-details.component.html",styleUrls:["./cometchat-call-details.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],ki);let _i=class{};_i=L([(0,K.NgModule)({declarations:[ki],imports:[W.CommonModule,Ai,Mi],exports:[ki],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],_i);let Ri=class{constructor(s,i){this.ref=s,this.themeService=i,this.hideSeparator=!1,this.selectionMode=t.SelectionMode.none,this.hideError=!1,this.title=(0,e.localize)("CALLS"),this.onError=e=>{console.log(e)},this.loadingIconURL="assets/Spinner.svg",this.datePattern=e.DatePatterns.DayDateTime,this.emptyStateText=(0,e.localize)("NO_callS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.left,this.avatarStyle={borderRadius:"16px",width:"32px",height:"32px"},this.dateStyle={},this.callHistoryStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",titleTextFont:"",titleTextColor:"",subtitleTextFont:"",subtitleTextColor:"",emptyStateTextFont:"",emptyStateTextColor:"",errorStateTextFont:"",errorStateTextColor:"",loadingIconTint:"",separatorColor:"rgb(222 222 222 / 46%)"},this.listItemStyle={},this.selectionmodeEnum=t.SelectionMode,this.state=t.States.loading,this.listStyle={},this.limit=30,this.callsList=[],this.callsListenerId="callsList_"+(new Date).getTime(),this.loggedInUser=null,this.onScrolledToBottom=null,this.iconStyle={height:"16px",width:"16px",iconTint:"RGBA(20, 20, 20, 0.68)"},this.fetchNextcallList=()=>{this.onScrolledToBottom=null,this.state=t.States.loading,this.ref.detectChanges();try{this.callsRequest.fetchPrevious().then((e=>{var s,i;(null==e?void 0:e.length)>0&&(this.onScrolledToBottom=this.fetchNextcallList,this.ref.detectChanges()),e.length<=0&&(null===(s=this.callsList)||void 0===s?void 0:s.length)<=0||0===e.length&&(null===(i=this.callsList)||void 0===i?void 0:i.length)<=0?(this.state=t.States.empty,this.ref.detectChanges()):(this.state=t.States.loaded,this.callsList=[...this.callsList,...e.reverse()],this.ref.detectChanges())}),(e=>{this.onError&&this.onError(e),this.state=t.States.error,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)}))}catch(e){this.state=t.States.error,this.ref.detectChanges(),this.onError&&this.onError(e)}},this.onClick=e=>{this.onItemClick&&this.onItemClick(e)},this.getActiveCall=e=>{var s;return(this.selectionMode==t.SelectionMode.none||!this.selectionMode)&&e.getId()==(null===(s=this.activeCall)||void 0===s?void 0:s.getId())},this.callStyle=()=>({height:this.callHistoryStyle.height,width:this.callHistoryStyle.width,background:this.callHistoryStyle.background,border:this.callHistoryStyle.border,borderRadius:this.callHistoryStyle.borderRadius}),this.subtitleStyle=()=>({font:this.callHistoryStyle.subtitleTextFont,color:this.callHistoryStyle.subtitleTextColor}),this.state=t.States.loading}ngOnInit(){this.setThemeStyle(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.callsRequest=this.getRequestBuilder(),this.fetchNextcallList(),this.attachListeners(),this.subscribeToEvents()})).catch((e=>{this.onError&&this.onError(e)})),this.state=t.States.loading}callMenuOption(e,t){var s,i;let o=null===(i=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.data)||void 0===i?void 0:i.onClick;o&&o(t)}subscribeToEvents(){this.ccCallAccepted=e.CometChatCallEvents.ccCallAccepted.subscribe((e=>{this.addCall(e)})),this.ccCallRejected=e.CometChatCallEvents.ccCallRejected.subscribe((e=>{this.addCall(e)})),this.ccOutgoingCall=e.CometChatCallEvents.ccOutgoingCall.subscribe((e=>{this.addCall(e)})),this.ccCallEnded=e.CometChatCallEvents.ccCallEnded.subscribe((e=>{e&&this.addCall(e)}))}unsubscribeToEvents(){var e,t,s,i;null===(e=this.ccCallAccepted)||void 0===e||e.unsubscribe(),null===(t=this.ccCallRejected)||void 0===t||t.unsubscribe(),null===(s=this.ccOutgoingCall)||void 0===s||s.unsubscribe(),null===(i=this.ccCallEnded)||void 0===i||i.unsubscribe()}ngOnDestroy(){this.callsRequest=null,this.ref.detach(),this.removeListener(),this.unsubscribeToEvents()}attachListeners(){s.CometChat.addCallListener(this.callsListenerId,new s.CometChat.CallListener({onIncomingCallReceived:e=>{this.addCall(e)},onIncomingCallCancelled:e=>{this.addCall(e)},onOutgoingCallAccepted:e=>{this.addCall(e)},onOutgoingCallRejected:e=>{this.addCall(e)}}))}removeListener(){s.CometChat.removeCallListener(this.callsListenerId)}getSubtitle(e){return t.CallingDetailsUtils.getCallStatus(e,this.loggedInUser)}getCallTypeIcon(t){return t.getType()==e.CometChatUIKitConstants.MessageTypes.audio?"assets/Audio-Call.svg":"VideoCallIcon"}getCallerName(e){return t.CallingDetailsUtils.isSentByMe(e,this.loggedInUser)?e.getReceiver().getName():e.getSender().getName()}getRequestBuilder(){return this.messageRequestBuilder?this.messageRequestBuilder.build():(new s.CometChat.MessagesRequestBuilder).setLimit(this.limit).setTypes([e.CometChatUIKitConstants.MessageTypes.audio,e.CometChatUIKitConstants.MessageTypes.video]).setCategories([e.CometChatUIKitConstants.MessageCategory.call]).build()}addCall(e){this.callsList.unshift(e),this.ref.detectChanges()}setThemeStyle(){this.iconStyle.iconTint=this.themeService.theme.palette.getAccent600(),this.setAvatarStyle(),this.setDateStyle(),this.setCallsStyle(),this.listStyle={titleTextFont:this.callHistoryStyle.titleTextFont,titleTextColor:this.callHistoryStyle.titleTextColor,emptyStateTextFont:this.callHistoryStyle.emptyStateTextFont,emptyStateTextColor:this.callHistoryStyle.emptyStateTextColor,errorStateTextFont:this.callHistoryStyle.errorStateTextFont,errorStateTextColor:this.callHistoryStyle.errorStateTextColor,loadingIconTint:this.callHistoryStyle.loadingIconTint,separatorColor:this.callHistoryStyle.separatorColor}}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setDateStyle(){let t=new J.DateStyle({textFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),textColor:this.themeService.theme.palette.getAccent600(),background:"transparent"});this.dateStyle=Object.assign(Object.assign({},t),this.dateStyle)}getListItemStyle(s){let i=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:this.themeService.theme.palette.getAccent100(),borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:t.CallingDetailsUtils.isMissedCall(s,this.loggedInUser)?this.themeService.theme.palette.getError():this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:this.themeService.theme.palette.getAccent50()});return Object.assign(Object.assign({},i),this.listItemStyle)}setCallsStyle(){let s=new t.CallHistoryStyle({subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subtitleTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),separatorColor:this.themeService.theme.palette.getAccent400()});this.callHistoryStyle=Object.assign(Object.assign({},this.callHistoryStyle),s)}};L([(0,K.Input)(),G("design:type",s.CometChat.MessagesRequestBuilder)],Ri.prototype,"messageRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],Ri.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",Object)],Ri.prototype,"activeCall",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ri.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",Number)],Ri.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ri.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",String)],Ri.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Function)],Ri.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],Ri.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Ri.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",Number)],Ri.prototype,"datePattern",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ri.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Ri.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Ri.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],Ri.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Ri.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",J.DateStyle)],Ri.prototype,"dateStyle",void 0),L([(0,K.Input)(),G("design:type",t.CallHistoryStyle)],Ri.prototype,"callHistoryStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Ri.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Function)],Ri.prototype,"onItemClick",void 0),Ri=L([(0,K.Component)({selector:"cometchat-call-history",templateUrl:"./cometchat-call-history.component.html",styleUrls:["./cometchat-call-history.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Ri);let Ui=class{};Ui=L([(0,K.NgModule)({declarations:[Ri],imports:[W.CommonModule,Mi],exports:[Ri],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ui);class Di extends W["ɵDomAdapter"]{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class Bi extends Di{static makeCurrent(){(0,W["ɵsetRootDomAdapter"])(new Bi)}onAndCancel(e,t,s){return e.addEventListener(t,s,!1),()=>{e.removeEventListener(t,s,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(Fi=Fi||document.querySelector("base"),Fi?Fi.getAttribute("href"):null);return null==t?null:function(e){Oi=Oi||document.createElement("a"),Oi.setAttribute("href",e);const t=Oi.pathname;return"/"===t.charAt(0)?t:`/${t}`}(t)}resetBaseElement(){Fi=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return(0,W["ɵparseCookieValue"])(document.cookie,e)}}let Oi,Fi=null;const Li=new K.InjectionToken("TRANSITION_ID"),Gi=[{provide:K.APP_INITIALIZER,useFactory:function(e,t,s){return()=>{s.get(K.ApplicationInitStatus).donePromise.then((()=>{const s=(0,W["ɵgetDOM"])(),i=t.querySelectorAll(`style[ng-transition="${e}"]`);for(let e=0;e<i.length;e++)s.remove(i[e])}))}},deps:[Li,W.DOCUMENT,K.Injector],multi:!0}];class Vi{static init(){(0,K.setTestabilityGetter)(new Vi)}addToWindow(e){K["ɵglobal"].getAngularTestability=(t,s=!0)=>{const i=e.findTestabilityInTree(t,s);if(null==i)throw new Error("Could not find testability for element.");return i},K["ɵglobal"].getAllAngularTestabilities=()=>e.getAllTestabilities(),K["ɵglobal"].getAllAngularRootElements=()=>e.getAllRootElements(),K["ɵglobal"].frameworkStabilizers||(K["ɵglobal"].frameworkStabilizers=[]),K["ɵglobal"].frameworkStabilizers.push((e=>{const t=K["ɵglobal"].getAllAngularTestabilities();let s=t.length,i=!1;const o=function(t){i=i||t,s--,0==s&&e(i)};t.forEach((function(e){e.whenStable(o)}))}))}findTestabilityInTree(e,t,s){if(null==t)return null;const i=e.getTestability(t);return null!=i?i:s?(0,W["ɵgetDOM"])().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}class Pi{build(){return new XMLHttpRequest}}Pi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Pi,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),Pi.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Pi}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Pi,decorators:[{type:K.Injectable}]});const Ni=new K.InjectionToken("EventManagerPlugins");class ji{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach((e=>e.manager=this)),this._plugins=e.slice().reverse()}addEventListener(e,t,s){return this._findPluginFor(t).addEventListener(e,t,s)}addGlobalEventListener(e,t,s){return this._findPluginFor(t).addGlobalEventListener(e,t,s)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const s=this._plugins;for(let t=0;t<s.length;t++){const i=s[t];if(i.supports(e))return this._eventNameToPlugin.set(e,i),i}throw new Error(`No event manager plugin found for event ${e}`)}}ji.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ji,deps:[{token:Ni},{token:K.NgZone}],target:K["ɵɵFactoryTarget"].Injectable}),ji.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ji}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ji,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[Ni]}]},{type:K.NgZone}]}});class Hi{constructor(e){this._doc=e}addGlobalEventListener(e,t,s){const i=(0,W["ɵgetDOM"])().getGlobalEventTarget(this._doc,e);if(!i)throw new Error(`Unsupported event target ${i} for event ${t}`);return this.addEventListener(i,t,s)}}class Ki{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach((e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))})),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}Ki.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ki,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),Ki.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ki}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ki,decorators:[{type:K.Injectable}]});class zi extends Ki{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,t,s){e.forEach((e=>{const i=this._doc.createElement("style");i.textContent=e,s.push(t.appendChild(i))}))}addHost(e){const t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)}removeHost(e){const t=this._hostNodes.get(e);t&&t.forEach(qi),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach(((t,s)=>{this._addStylesToHost(e,s,t)}))}ngOnDestroy(){this._hostNodes.forEach((e=>e.forEach(qi)))}}function qi(e){(0,W["ɵgetDOM"])().remove(e)}zi.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:zi,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),zi.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:zi}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:zi,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}});const Wi={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},$i=/%COMP%/g,Ji="undefined"==typeof ngDevMode||!!ngDevMode,Qi="%COMP%",Yi=`_nghost-${Qi}`,Zi=`_ngcontent-${Qi}`;function Xi(e,t,s){for(let i=0;i<t.length;i++){let o=t[i];Array.isArray(o)?Xi(e,o,s):(o=o.replace($i,e),s.push(o))}return s}function eo(e){return t=>{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let to=!1;class so{constructor(e,t,s){this.eventManager=e,this.sharedStylesHost=t,this.appId=s,this.rendererByCompId=new Map,this.defaultRenderer=new io(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case K.ViewEncapsulation.Emulated:{let s=this.rendererByCompId.get(t.id);return s||(s=new ro(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,s)),s.applyToHost(e),s}case 1:case K.ViewEncapsulation.ShadowDom:return"undefined"!=typeof ngDevMode&&!ngDevMode||to||1!==t.encapsulation||(to=!0,console.warn("ViewEncapsulation.Native is no longer supported. Falling back to ViewEncapsulation.ShadowDom. The fallback will be removed in v12.")),new ao(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=Xi(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}so.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:so,deps:[{token:ji},{token:zi},{token:K.APP_ID}],target:K["ɵɵFactoryTarget"].Injectable}),so.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:so}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:so,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:ji},{type:zi},{type:void 0,decorators:[{type:K.Inject,args:[K.APP_ID]}]}]}});class io{constructor(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}destroy(){}createElement(e,t){return t?document.createElementNS(Wi[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,s){e&&e.insertBefore(t,s)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error(`The selector "${e}" did not match any elements`);return t||(s.textContent=""),s}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,s,i){if(i){t=i+":"+t;const o=Wi[i];o?e.setAttributeNS(o,t,s):e.setAttribute(t,s)}else e.setAttribute(t,s)}removeAttribute(e,t,s){if(s){const i=Wi[s];i?e.removeAttributeNS(i,t):e.removeAttribute(`${s}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,s,i){i&(K.RendererStyleFlags2.DashCase|K.RendererStyleFlags2.Important)?e.style.setProperty(t,s,i&K.RendererStyleFlags2.Important?"important":""):e.style[t]=s}removeStyle(e,t,s){s&K.RendererStyleFlags2.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,s){Ji&&no(t,"property"),e[t]=s}setValue(e,t){e.nodeValue=t}listen(e,t,s){return Ji&&no(t,"listener"),"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,eo(s)):this.eventManager.addEventListener(e,t,eo(s))}}const oo="@".charCodeAt(0);function no(e,t){if(e.charCodeAt(0)===oo)throw new Error(`Unexpected synthetic ${t} ${e} found. Please make sure that:\n  - Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application.\n  - There is corresponding configuration for the animation named \`${e}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`)}class ro extends io{constructor(e,t,s,i){super(e),this.component=s;const o=Xi(i+"-"+s.id,s.styles,[]);var n;t.addStyles(o),this.contentAttr=(n=i+"-"+s.id,Zi.replace($i,n)),this.hostAttr=function(e){return Yi.replace($i,e)}(i+"-"+s.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const s=super.createElement(e,t);return super.setAttribute(s,this.contentAttr,""),s}}class ao extends io{constructor(e,t,s,i){super(e),this.sharedStylesHost=t,this.hostEl=s,this.shadowRoot=s.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const o=Xi(i.id,i.styles,[]);for(let e=0;e<o.length;e++){const t=document.createElement("style");t.textContent=o[e],this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,s){return super.insertBefore(this.nodeOrShadowRoot(e),t,s)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}class lo extends Hi{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,s){return e.addEventListener(t,s,!1),()=>this.removeEventListener(e,t,s)}removeEventListener(e,t,s){return e.removeEventListener(t,s)}}lo.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:lo,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),lo.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:lo}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:lo,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}});const ho=["alt","control","meta","shift"],co={"\b":"Backspace","\t":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},uo={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"},po={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};class go extends Hi{constructor(e){super(e)}supports(e){return null!=go.parseEventName(e)}addEventListener(e,t,s){const i=go.parseEventName(t),o=go.eventCallback(i.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular((()=>(0,W["ɵgetDOM"])().onAndCancel(e,i.domEventName,o)))}static parseEventName(e){const t=e.toLowerCase().split("."),s=t.shift();if(0===t.length||"keydown"!==s&&"keyup"!==s)return null;const i=go._normalizeKey(t.pop());let o="";if(ho.forEach((e=>{const s=t.indexOf(e);s>-1&&(t.splice(s,1),o+=e+".")})),o+=i,0!=t.length||0===i.length)return null;const n={};return n.domEventName=s,n.fullKey=o,n}static getEventFullKey(e){let t="",s=function(e){let t=e.key;if(null==t){if(t=e.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&uo.hasOwnProperty(t)&&(t=uo[t]))}return co[t]||t}(e);return s=s.toLowerCase()," "===s?s="space":"."===s&&(s="dot"),ho.forEach((i=>{i!=s&&(0,po[i])(e)&&(t+=i+".")})),t+=s,t}static eventCallback(e,t,s){return i=>{go.getEventFullKey(i)===e&&s.runGuarded((()=>t(i)))}}static _normalizeKey(e){return"esc"===e?"escape":e}}go.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:go,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),go.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:go}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:go,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}});const mo=[{provide:K.PLATFORM_ID,useValue:W["ɵPLATFORM_BROWSER_ID"]},{provide:K.PLATFORM_INITIALIZER,useValue:function(){Bi.makeCurrent(),Vi.init()},multi:!0},{provide:W.DOCUMENT,useFactory:function(){return(0,K["ɵsetDocument"])(document),document},deps:[]}],yo=((0,K.createPlatformFactory)(K.platformCore,"browser",mo),[{provide:K["ɵINJECTOR_SCOPE"],useValue:"root"},{provide:K.ErrorHandler,useFactory:function(){return new K.ErrorHandler},deps:[]},{provide:Ni,useClass:lo,multi:!0,deps:[W.DOCUMENT,K.NgZone,K.PLATFORM_ID]},{provide:Ni,useClass:go,multi:!0,deps:[W.DOCUMENT]},{provide:so,useClass:so,deps:[ji,zi,K.APP_ID]},{provide:K.RendererFactory2,useExisting:so},{provide:Ki,useExisting:zi},{provide:zi,useClass:zi,deps:[W.DOCUMENT]},{provide:K.Testability,useClass:K.Testability,deps:[K.NgZone]},{provide:ji,useClass:ji,deps:[Ni,K.NgZone]},{provide:W.XhrFactory,useClass:Pi,deps:[]}]);class Co{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:Co,providers:[{provide:K.APP_ID,useValue:e.appId},{provide:Li,useExisting:K.APP_ID},Gi]}}}function vo(){return new So((0,K["ɵɵinject"])(W.DOCUMENT))}Co.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Co,deps:[{token:Co,optional:!0,skipSelf:!0}],target:K["ɵɵFactoryTarget"].NgModule}),Co.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Co,exports:[W.CommonModule,K.ApplicationModule]}),Co.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Co,providers:yo,imports:[W.CommonModule,K.ApplicationModule]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Co,decorators:[{type:K.NgModule,args:[{providers:yo,exports:[W.CommonModule,K.ApplicationModule]}]}],ctorParameters:function(){return[{type:Co,decorators:[{type:K.Optional},{type:K.SkipSelf},{type:K.Inject,args:[Co]}]}]}});class So{constructor(e){this._doc=e,this._dom=(0,W["ɵgetDOM"])()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce(((e,s)=>(s&&e.push(this._getOrCreateElement(s,t)),e)),[]):[]}getTag(e){return e&&this._doc.querySelector(`meta[${e}]`)||null}getTags(e){if(!e)return[];const t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);const s=this.getTag(t);return s?this._setMetaElementAttributes(e,s):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){const t=this._parseSelector(e),s=this.getTags(t).filter((t=>this._containsAttributes(e,t)))[0];if(void 0!==s)return s}const s=this._dom.createElement("meta");return this._setMetaElementAttributes(e,s),this._doc.getElementsByTagName("head")[0].appendChild(s),s}_setMetaElementAttributes(e,t){return Object.keys(e).forEach((s=>t.setAttribute(this._getMetaKeyMap(s),e[s]))),t}_parseSelector(e){const t=e.name?"name":"property";return`${t}="${e[t]}"`}_containsAttributes(e,t){return Object.keys(e).every((s=>t.getAttribute(this._getMetaKeyMap(s))===e[s]))}_getMetaKeyMap(e){return bo[e]||e}}So.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:So,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),So.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:So,providedIn:"root",useFactory:vo,deps:[]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:So,decorators:[{type:K.Injectable,args:[{providedIn:"root",useFactory:vo,deps:[]}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}});const bo={httpEquiv:"http-equiv"};function fo(){return new Io((0,K["ɵɵinject"])(W.DOCUMENT))}class Io{constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}}Io.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Io,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),Io.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Io,providedIn:"root",useFactory:fo,deps:[]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Io,decorators:[{type:K.Injectable,args:[{providedIn:"root",useFactory:fo,deps:[]}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}}),"undefined"!=typeof window&&window;class To{constructor(){this.store={},this.onSerializeCallbacks={}}static init(e){const t=new To;return t.store=e,t}get(e,t){return void 0!==this.store[e]?this.store[e]:t}set(e,t){this.store[e]=t}remove(e){delete this.store[e]}hasKey(e){return this.store.hasOwnProperty(e)}onSerialize(e,t){this.onSerializeCallbacks[e]=t}toJson(){for(const e in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(e))try{this.store[e]=this.onSerializeCallbacks[e]()}catch(e){console.warn("Exception in onSerialize callback: ",e)}return JSON.stringify(this.store)}}function Mo(e,t){const s=e.getElementById(t+"-state");let i={};if(s&&s.textContent)try{i=JSON.parse(function(e){const t={"&a;":"&","&q;":'"',"&s;":"'","&l;":"<","&g;":">"};return e.replace(/&[^;]+;/g,(e=>t[e]))}(s.textContent))}catch(e){console.warn("Exception while restoring TransferState for app "+t,e)}return To.init(i)}To.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:To,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),To.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:To}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:To,decorators:[{type:K.Injectable}]});class xo{}xo.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xo,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),xo.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xo}),xo.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xo,providers:[{provide:To,useFactory:Mo,deps:[W.DOCUMENT,K.APP_ID]}]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:xo,decorators:[{type:K.NgModule,args:[{providers:[{provide:To,useFactory:Mo,deps:[W.DOCUMENT,K.APP_ID]}]}]}]});const wo={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0,doubletap:!0},Eo=new K.InjectionToken("HammerGestureConfig"),Ao=new K.InjectionToken("HammerLoader");class ko{constructor(){this.events=[],this.overrides={}}buildHammer(e){const t=new Hammer(e,this.options);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(const e in this.overrides)t.get(e).set(this.overrides[e]);return t}}ko.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ko,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),ko.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ko}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:ko,decorators:[{type:K.Injectable}]});class _o extends Hi{constructor(e,t,s,i){super(e),this._config=t,this.console=s,this.loader=i,this._loaderPromise=null}supports(e){return!(!wo.hasOwnProperty(e.toLowerCase())&&!this.isCustomEvent(e)||!window.Hammer&&!this.loader&&(("undefined"==typeof ngDevMode||ngDevMode)&&this.console.warn(`The "${e}" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.`),1))}addEventListener(e,t,s){const i=this.manager.getZone();if(t=t.toLowerCase(),!window.Hammer&&this.loader){this._loaderPromise=this._loaderPromise||this.loader();let i=!1,o=()=>{i=!0};return this._loaderPromise.then((()=>{if(!window.Hammer)return("undefined"==typeof ngDevMode||ngDevMode)&&this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(o=()=>{});i||(o=this.addEventListener(e,t,s))})).catch((()=>{("undefined"==typeof ngDevMode||ngDevMode)&&this.console.warn(`The "${t}" event cannot be bound because the custom Hammer.JS loader failed.`),o=()=>{}})),()=>{o()}}return i.runOutsideAngular((()=>{const o=this._config.buildHammer(e),n=function(e){i.runGuarded((function(){s(e)}))};return o.on(t,n),()=>{o.off(t,n),"function"==typeof o.destroy&&o.destroy()}}))}isCustomEvent(e){return this._config.events.indexOf(e)>-1}}_o.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:_o,deps:[{token:W.DOCUMENT},{token:Eo},{token:K["ɵConsole"]},{token:Ao,optional:!0}],target:K["ɵɵFactoryTarget"].Injectable}),_o.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:_o}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:_o,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]},{type:ko,decorators:[{type:K.Inject,args:[Eo]}]},{type:K["ɵConsole"]},{type:void 0,decorators:[{type:K.Optional},{type:K.Inject,args:[Ao]}]}]}});class Ro{}Ro.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ro,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),Ro.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ro}),Ro.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ro,providers:[{provide:Ni,useClass:_o,multi:!0,deps:[W.DOCUMENT,Eo,K["ɵConsole"],[new K.Optional,Ao]]},{provide:Eo,useClass:ko,deps:[]}]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Ro,decorators:[{type:K.NgModule,args:[{providers:[{provide:Ni,useClass:_o,multi:!0,deps:[W.DOCUMENT,Eo,K["ɵConsole"],[new K.Optional,Ao]]},{provide:Eo,useClass:ko,deps:[]}]}]}]});class Uo{}function Do(e){return new Bo(e.get(W.DOCUMENT))}Uo.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Uo,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),Uo.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Uo,providedIn:"root",useExisting:K.forwardRef((function(){return Bo}))}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Uo,decorators:[{type:K.Injectable,args:[{providedIn:"root",useExisting:(0,K.forwardRef)((()=>Bo))}]}]});class Bo extends Uo{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case K.SecurityContext.NONE:return t;case K.SecurityContext.HTML:return(0,K["ɵallowSanitizationBypassAndThrow"])(t,"HTML")?(0,K["ɵunwrapSafeValue"])(t):(0,K["ɵ_sanitizeHtml"])(this._doc,String(t)).toString();case K.SecurityContext.STYLE:return(0,K["ɵallowSanitizationBypassAndThrow"])(t,"Style")?(0,K["ɵunwrapSafeValue"])(t):t;case K.SecurityContext.SCRIPT:if((0,K["ɵallowSanitizationBypassAndThrow"])(t,"Script"))return(0,K["ɵunwrapSafeValue"])(t);throw new Error("unsafe value used in a script context");case K.SecurityContext.URL:return(0,K["ɵgetSanitizationBypassType"])(t),(0,K["ɵallowSanitizationBypassAndThrow"])(t,"URL")?(0,K["ɵunwrapSafeValue"])(t):(0,K["ɵ_sanitizeUrl"])(String(t));case K.SecurityContext.RESOURCE_URL:if((0,K["ɵallowSanitizationBypassAndThrow"])(t,"ResourceURL"))return(0,K["ɵunwrapSafeValue"])(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return(0,K["ɵbypassSanitizationTrustHtml"])(e)}bypassSecurityTrustStyle(e){return(0,K["ɵbypassSanitizationTrustStyle"])(e)}bypassSecurityTrustScript(e){return(0,K["ɵbypassSanitizationTrustScript"])(e)}bypassSecurityTrustUrl(e){return(0,K["ɵbypassSanitizationTrustUrl"])(e)}bypassSecurityTrustResourceUrl(e){return(0,K["ɵbypassSanitizationTrustResourceUrl"])(e)}}Bo.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Bo,deps:[{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),Bo.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Bo,providedIn:"root",useFactory:Do,deps:[{token:K.Injector}]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Bo,decorators:[{type:K.Injectable,args:[{providedIn:"root",useFactory:Do,deps:[K.Injector]}]}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}}),new K.Version("13.3.12");class Oo{}class Fo{}const Lo="*";function Go(e,t=null){return{type:2,steps:e,options:t}}function Vo(e){return{type:6,styles:e,offset:null}}function Po(e){Promise.resolve(null).then(e)}class No{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach((e=>e())),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){Po((()=>this._onFinish()))}_onStart(){this._onStartFns.forEach((e=>e())),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach((e=>e())),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach((e=>e())),t.length=0}}class jo{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,s=0,i=0;const o=this.players.length;0==o?Po((()=>this._onFinish())):this.players.forEach((e=>{e.onDone((()=>{++t==o&&this._onFinish()})),e.onDestroy((()=>{++s==o&&this._onDestroy()})),e.onStart((()=>{++i==o&&this._onStart()}))})),this.totalTime=this.players.reduce(((e,t)=>Math.max(e,t.totalTime)),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach((e=>e())),this._onDoneFns=[])}init(){this.players.forEach((e=>e.init()))}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach((e=>e())),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach((e=>e.play()))}pause(){this.players.forEach((e=>e.pause()))}restart(){this.players.forEach((e=>e.restart()))}finish(){this._onFinish(),this.players.forEach((e=>e.finish()))}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach((e=>e.destroy())),this._onDestroyFns.forEach((e=>e())),this._onDestroyFns=[])}reset(){this.players.forEach((e=>e.reset())),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach((e=>{const s=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(s)}))}getPosition(){const e=this.players.reduce(((e,t)=>null===e||t.totalTime>e.totalTime?t:e),null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach((e=>{e.beforeDestroy&&e.beforeDestroy()}))}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach((e=>e())),t.length=0}}const Ho="undefined"==typeof ngDevMode||!!ngDevMode,Ko="\n - ";function zo(e){return new K["ɵRuntimeError"](3e3,Ho&&`The provided timing value "${e}" is invalid.`)}function qo(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Wo(e){switch(e.length){case 0:return new No;case 1:return e[0];default:return new jo(e)}}function $o(e,t,s,i,o={},n={}){const r=[],a=[];let l=-1,h=null;if(i.forEach((e=>{const s=e.offset,i=s==l,c=i&&h||{};Object.keys(e).forEach((s=>{let i=s,a=e[s];if("offset"!==s)switch(i=t.normalizePropertyName(i,r),a){case"!":a=o[s];break;case Lo:a=n[s];break;default:a=t.normalizeStyleValue(s,i,a,r)}c[i]=a})),i||a.push(c),h=c,l=s})),r.length)throw function(e){return new K["ɵRuntimeError"](3502,Ho&&`Unable to animate due to the following errors:${Ko}${e.map((e=>e.message)).join(Ko)}`)}(r);return a}function Jo(e,t,s,i){switch(t){case"start":e.onStart((()=>i(s&&Qo(s,"start",e))));break;case"done":e.onDone((()=>i(s&&Qo(s,"done",e))));break;case"destroy":e.onDestroy((()=>i(s&&Qo(s,"destroy",e))))}}function Qo(e,t,s){const i=s.totalTime,o=!!s.disabled,n=Yo(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==i?e.totalTime:i,o),r=e._data;return null!=r&&(n._data=r),n}function Yo(e,t,s,i,o="",n=0,r){return{element:e,triggerName:t,fromState:s,toState:i,phaseName:o,totalTime:n,disabled:!!r}}function Zo(e,t,s){let i;return e instanceof Map?(i=e.get(t),i||e.set(t,i=s)):(i=e[t],i||(i=e[t]=s)),i}function Xo(e){const t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}let en=(e,t)=>!1,tn=(e,t,s)=>[],sn=null;function on(e){const t=e.parentNode||e.host;return t===sn?null:t}(qo()||"undefined"!=typeof Element)&&("undefined"==typeof window||void 0===window.document?en=(e,t)=>e.contains(t):(sn=(()=>document.documentElement)(),en=(e,t)=>{for(;t;){if(t===e)return!0;t=on(t)}return!1}),tn=(e,t,s)=>{if(s)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]});let nn=null,rn=!1;function an(e){nn||(nn=("undefined"!=typeof document?document.body:null)||{},rn=!!nn.style&&"WebkitAppearance"in nn.style);let t=!0;return nn.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in nn.style,!t&&rn)&&(t="Webkit"+e.charAt(0).toUpperCase()+e.substr(1)in nn.style),t}const ln=en,hn=tn;class cn{validateStyleProperty(e){return an(e)}matchesElement(e,t){return!1}containsElement(e,t){return ln(e,t)}getParentElement(e){return on(e)}query(e,t,s){return hn(e,t,s)}computeStyle(e,t,s){return s||""}animate(e,t,s,i,o,n=[],r){return new No(s,i)}}cn.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:cn,deps:[],target:K["ɵɵFactoryTarget"].Injectable}),cn.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:cn}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:cn,decorators:[{type:K.Injectable}]});class dn{}dn.NOOP=new cn;const un=1e3,pn="ng-enter",gn="ng-leave",mn="ng-trigger",yn=".ng-trigger",Cn="ng-animating",vn=".ng-animating";function Sn(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:bn(parseFloat(t[1]),t[2])}function bn(e,t){return"s"===t?e*un:e}function fn(e,t,s){return e.hasOwnProperty("duration")?e:function(e,t,s){const i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;let o,n=0,r="";if("string"==typeof e){const s=e.match(i);if(null===s)return t.push(zo(e)),{duration:0,delay:0,easing:""};o=bn(parseFloat(s[1]),s[2]);const a=s[3];null!=a&&(n=bn(parseFloat(a),s[4]));const l=s[5];l&&(r=l)}else o=e;if(!s){let s=!1,i=t.length;o<0&&(t.push(new K["ɵRuntimeError"](3100,Ho&&"Duration values below 0 are not allowed for this animation step.")),s=!0),n<0&&(t.push(new K["ɵRuntimeError"](3101,Ho&&"Delay values below 0 are not allowed for this animation step.")),s=!0),s&&t.splice(i,0,zo(e))}return{duration:o,delay:n,easing:r}}(e,t,s)}function In(e,t={}){return Object.keys(e).forEach((s=>{t[s]=e[s]})),t}function Tn(e,t,s={}){if(t)for(let t in e)s[t]=e[t];else In(e,s);return s}function Mn(e,t,s){return s?t+":"+s+";":""}function xn(e){let t="";for(let s=0;s<e.style.length;s++){const i=e.style.item(s);t+=Mn(0,i,e.style.getPropertyValue(i))}for(const s in e.style)e.style.hasOwnProperty(s)&&!s.startsWith("_")&&(t+=Mn(0,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.style[s]));e.setAttribute("style",t)}function wn(e,t,s){e.style&&(Object.keys(t).forEach((i=>{const o=Bn(i);s&&!s.hasOwnProperty(i)&&(s[i]=e.style[o]),e.style[o]=t[i]})),qo()&&xn(e))}function En(e,t){e.style&&(Object.keys(t).forEach((t=>{const s=Bn(t);e.style[s]=""})),qo()&&xn(e))}function An(e){return Array.isArray(e)?1==e.length?e[0]:Go(e):e}const kn=new RegExp("{{\\s*(.+?)\\s*}}","g");function _n(e){let t=[];if("string"==typeof e){let s;for(;s=kn.exec(e);)t.push(s[1]);kn.lastIndex=0}return t}function Rn(e,t,s){const i=e.toString(),o=i.replace(kn,((e,i)=>{let o=t[i];return t.hasOwnProperty(i)||(s.push(function(e){return new K["ɵRuntimeError"](3003,Ho&&`Please provide a value for the animation param ${e}`)}(i)),o=""),o.toString()}));return o==i?e:o}function Un(e){const t=[];let s=e.next();for(;!s.done;)t.push(s.value),s=e.next();return t}const Dn=/-+([a-z0-9])/g;function Bn(e){return e.replace(Dn,((...e)=>e[1].toUpperCase()))}function On(e,t,s){switch(t.type){case 7:return e.visitTrigger(t,s);case 0:return e.visitState(t,s);case 1:return e.visitTransition(t,s);case 2:return e.visitSequence(t,s);case 3:return e.visitGroup(t,s);case 4:return e.visitAnimate(t,s);case 5:return e.visitKeyframes(t,s);case 6:return e.visitStyle(t,s);case 8:return e.visitReference(t,s);case 9:return e.visitAnimateChild(t,s);case 10:return e.visitAnimateRef(t,s);case 11:return e.visitQuery(t,s);case 12:return e.visitStagger(t,s);default:throw i=t.type,new K["ɵRuntimeError"](3004,Ho&&`Unable to resolve animation metadata node #${i}`)}var i}function Fn(e,t){return window.getComputedStyle(e)[t]}const Ln="undefined"==typeof ngDevMode||!!ngDevMode;function Gn(e){const t="\n - ";return`${t}${e.filter(Boolean).map((e=>e)).join(t)}`}const Vn="*";function Pn(e,t){const s=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach((e=>function(e,t,s){if(":"==e[0]){const i=function(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return t.push(function(e){return new K["ɵRuntimeError"](3016,Ho&&`The transition alias value "${e}" is not supported`)}(e)),"* => *"}}(e,s);if("function"==typeof i)return void t.push(i);e=i}const i=e.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return s.push((o=e,new K["ɵRuntimeError"](3015,Ho&&`The provided transition expression "${o}" is not supported`))),t;var o;const n=i[1],r=i[2],a=i[3];t.push(Hn(n,a));const l=n==Vn&&a==Vn;"<"!=r[0]||l||t.push(Hn(a,n))}(e,s,t))):s.push(e),s}const Nn=new Set(["true","1"]),jn=new Set(["false","0"]);function Hn(e,t){const s=Nn.has(e)||jn.has(e),i=Nn.has(t)||jn.has(t);return(o,n)=>{let r=e==Vn||e==o,a=t==Vn||t==n;return!r&&s&&"boolean"==typeof o&&(r=o?Nn.has(e):jn.has(e)),!a&&i&&"boolean"==typeof n&&(a=n?Nn.has(t):jn.has(t)),r&&a}}const Kn=":self",zn=new RegExp(`s*${Kn}s*,?`,"g");function qn(e,t,s,i){return new Wn(e).build(t,s,i)}class Wn{constructor(e){this._driver=e}build(e,t,s){const i=new $n(t);this._resetContextStyleTimingState(i);const o=On(this,An(e),i);return i.unsupportedCSSPropertiesFound.size&&function(e,t){ngDevMode&&t.length&&e.push(`The provided CSS properties are not recognized properties supported for animations: ${t.join(", ")}`)}(s,[...i.unsupportedCSSPropertiesFound.keys()]),o}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let s=t.queryCount=0,i=t.depCount=0;const o=[],n=[];return"@"==e.name.charAt(0)&&t.errors.push(new K["ɵRuntimeError"](3006,Ho&&"animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))")),e.definitions.forEach((e=>{if(this._resetContextStyleTimingState(t),0==e.type){const s=e,i=s.name;i.toString().split(/\s*,\s*/).forEach((e=>{s.name=e,o.push(this.visitState(s,t))})),s.name=i}else if(1==e.type){const o=this.visitTransition(e,t);s+=o.queryCount,i+=o.depCount,n.push(o)}else t.errors.push(new K["ɵRuntimeError"](3007,Ho&&"only state() and transition() definitions can sit inside of a trigger()"))})),{type:7,name:e.name,states:o,transitions:n,queryCount:s,depCount:i,options:null}}visitState(e,t){const s=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(s.containsDynamicStyles){const o=new Set,n=i||{};if(s.styles.forEach((e=>{if(Jn(e)){const t=e;Object.keys(t).forEach((e=>{_n(t[e]).forEach((e=>{n.hasOwnProperty(e)||o.add(e)}))}))}})),o.size){const s=Un(o.values());t.errors.push(function(e,t){return new K["ɵRuntimeError"](3008,Ho&&`state("${e}", ...) must define default values for all the following style substitutions: ${t.join(", ")}`)}(e.name,s))}}return{type:0,name:e.name,style:s,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const s=On(this,An(e.animation),t);return{type:1,matchers:Pn(e.expr,t.errors),animation:s,queryCount:t.queryCount,depCount:t.depCount,options:Qn(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map((e=>On(this,e,t))),options:Qn(e.options)}}visitGroup(e,t){const s=t.currentTime;let i=0;const o=e.steps.map((e=>{t.currentTime=s;const o=On(this,e,t);return i=Math.max(i,t.currentTime),o}));return t.currentTime=i,{type:3,steps:o,options:Qn(e.options)}}visitAnimate(e,t){const s=function(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return Yn(fn(e,t).duration,0,"");const s=e;if(s.split(/\s+/).some((e=>"{"==e.charAt(0)&&"{"==e.charAt(1)))){const e=Yn(0,0,"");return e.dynamic=!0,e.strValue=s,e}const i=fn(s,t);return Yn(i.duration,i.delay,i.easing)}(e.timings,t.errors);let i;t.currentAnimateTimings=s;let o=e.styles?e.styles:Vo({});if(5==o.type)i=this.visitKeyframes(o,t);else{let o=e.styles,n=!1;if(!o){n=!0;const e={};s.easing&&(e.easing=s.easing),o=Vo(e)}t.currentTime+=s.duration+s.delay;const r=this.visitStyle(o,t);r.isEmptyStep=n,i=r}return t.currentAnimateTimings=null,{type:4,timings:s,style:i,options:null}}visitStyle(e,t){const s=this._makeStyleAst(e,t);return this._validateStyleAst(s,t),s}_makeStyleAst(e,t){const s=[];Array.isArray(e.styles)?e.styles.forEach((e=>{var i;"string"==typeof e?e==Lo?s.push(e):t.errors.push((i=e,new K["ɵRuntimeError"](3002,Ho&&`The provided style string value ${i} is not allowed.`))):s.push(e)})):s.push(e.styles);let i=!1,o=null;return s.forEach((e=>{if(Jn(e)){const t=e,s=t.easing;if(s&&(o=s,delete t.easing),!i)for(let e in t)if(t[e].toString().indexOf("{{")>=0){i=!0;break}}})),{type:6,styles:s,easing:o,offset:e.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(e,t){const s=t.currentAnimateTimings;let i=t.currentTime,o=t.currentTime;s&&o>0&&(o-=s.duration+s.delay),e.styles.forEach((e=>{"string"!=typeof e&&Object.keys(e).forEach((s=>{if(!this._driver.validateStyleProperty(s))return delete e[s],void t.unsupportedCSSPropertiesFound.add(s);const n=t.collectedStyles[t.currentQuerySelector],r=n[s];let a=!0;r&&(o!=i&&o>=r.startTime&&i<=r.endTime&&(t.errors.push(function(e,t,s,i,o){return new K["ɵRuntimeError"](3010,Ho&&`The CSS property "${e}" that exists between the times of "${t}ms" and "${s}ms" is also being animated in a parallel animation between the times of "${i}ms" and "${o}ms"`)}(s,r.startTime,r.endTime,o,i)),a=!1),o=r.startTime),a&&(n[s]={startTime:o,endTime:i}),t.options&&function(e,t,s){const i=t.params||{},o=_n(e);o.length&&o.forEach((e=>{i.hasOwnProperty(e)||s.push(function(e){return new K["ɵRuntimeError"](3001,Ho&&`Unable to resolve the local animation param ${e} in the given list of values`)}(e))}))}(e[s],t.options,t.errors)}))}))}visitKeyframes(e,t){const s={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(new K["ɵRuntimeError"](3011,Ho&&"keyframes() must be placed inside of a call to animate()")),s;let i=0;const o=[];let n=!1,r=!1,a=0;const l=e.steps.map((e=>{const s=this._makeStyleAst(e,t);let l=null!=s.offset?s.offset:function(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach((e=>{if(Jn(e)&&e.hasOwnProperty("offset")){const s=e;t=parseFloat(s.offset),delete s.offset}}));else if(Jn(e)&&e.hasOwnProperty("offset")){const s=e;t=parseFloat(s.offset),delete s.offset}return t}(s.styles),h=0;return null!=l&&(i++,h=s.offset=l),r=r||h<0||h>1,n=n||h<a,a=h,o.push(h),s}));r&&t.errors.push(new K["ɵRuntimeError"](3012,Ho&&"Please ensure that all keyframe offsets are between 0 and 1")),n&&t.errors.push(new K["ɵRuntimeError"](3200,Ho&&"Please ensure that all keyframe offsets are in order"));const h=e.steps.length;let c=0;i>0&&i<h?t.errors.push(new K["ɵRuntimeError"](3202,Ho&&"Not all style() steps within the declared keyframes() contain offsets")):0==i&&(c=1/(h-1));const d=h-1,u=t.currentTime,p=t.currentAnimateTimings,g=p.duration;return l.forEach(((e,i)=>{const n=c>0?i==d?1:c*i:o[i],r=n*g;t.currentTime=u+p.delay+r,p.duration=r,this._validateStyleAst(e,t),e.offset=n,s.styles.push(e)})),s}visitReference(e,t){return{type:8,animation:On(this,An(e.animation),t),options:Qn(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Qn(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Qn(e.options)}}visitQuery(e,t){const s=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[o,n]=function(e){const t=!!e.split(/\s*,\s*/).find((e=>e==Kn));return t&&(e=e.replace(zn,"")),[e=e.replace(/@\*/g,yn).replace(/@\w+/g,(e=>yn+"-"+e.substr(1))).replace(/:animating/g,vn),t]}(e.selector);t.currentQuerySelector=s.length?s+" "+o:o,Zo(t.collectedStyles,t.currentQuerySelector,{});const r=On(this,An(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=s,{type:11,selector:o,limit:i.limit||0,optional:!!i.optional,includeSelf:n,animation:r,originalSelector:e.selector,options:Qn(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(new K["ɵRuntimeError"](3013,Ho&&"stagger() can only be used inside of query()"));const s="full"===e.timings?{duration:0,delay:0,easing:"full"}:fn(e.timings,t.errors,!0);return{type:12,animation:On(this,An(e.animation),t),timings:s,options:null}}}class $n{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function Jn(e){return!Array.isArray(e)&&"object"==typeof e}function Qn(e){var t;return e?(e=In(e)).params&&(e.params=(t=e.params)?In(t):null):e={},e}function Yn(e,t,s){return{duration:e,delay:t,easing:s}}function Zn(e,t,s,i,o,n,r=null,a=!1){return{type:1,element:e,keyframes:t,preStyleProps:s,postStyleProps:i,duration:o,delay:n,totalTime:o+n,easing:r,subTimeline:a}}class Xn{constructor(){this._map=new Map}get(e){return this._map.get(e)||[]}append(e,t){let s=this._map.get(e);s||this._map.set(e,s=[]),s.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const er=new RegExp(":enter","g"),tr=new RegExp(":leave","g");function sr(e,t,s,i,o,n={},r={},a,l,h=[]){return(new ir).buildKeyframes(e,t,s,i,o,n,r,a,l,h)}class ir{buildKeyframes(e,t,s,i,o,n,r,a,l,h=[]){l=l||new Xn;const c=new nr(e,t,l,i,o,h,[]);c.options=a,c.currentTimeline.setStyles([n],null,c.errors,a),On(this,s,c);const d=c.timelines.filter((e=>e.containsAnimation()));if(Object.keys(r).length){let e;for(let s=d.length-1;s>=0;s--){const i=d[s];if(i.element===t){e=i;break}}e&&!e.allowOnlyTimelineStyles()&&e.setStyles([r],null,c.errors,a)}return d.length?d.map((e=>e.buildKeyframes())):[Zn(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const s=t.subInstructions.get(t.element);if(s){const i=t.createSubContext(e.options),o=t.currentTimeline.currentTime,n=this._visitSubInstructions(s,i,i.options);o!=n&&t.transformIntoNewTimeline(n)}t.previousNode=e}visitAnimateRef(e,t){const s=t.createSubContext(e.options);s.transformIntoNewTimeline(),this.visitReference(e.animation,s),t.transformIntoNewTimeline(s.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,s){let i=t.currentTimeline.currentTime;const o=null!=s.duration?Sn(s.duration):null,n=null!=s.delay?Sn(s.delay):null;return 0!==o&&e.forEach((e=>{const s=t.appendInstructionToTimeline(e,o,n);i=Math.max(i,s.duration+s.delay)})),i}visitReference(e,t){t.updateOptions(e.options,!0),On(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const s=t.subContextCount;let i=t;const o=e.options;if(o&&(o.params||o.delay)&&(i=t.createSubContext(o),i.transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=or);const e=Sn(o.delay);i.delayNextStep(e)}e.steps.length&&(e.steps.forEach((e=>On(this,e,i))),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>s&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const s=[];let i=t.currentTimeline.currentTime;const o=e.options&&e.options.delay?Sn(e.options.delay):0;e.steps.forEach((n=>{const r=t.createSubContext(e.options);o&&r.delayNextStep(o),On(this,n,r),i=Math.max(i,r.currentTimeline.currentTime),s.push(r.currentTimeline)})),s.forEach((e=>t.currentTimeline.mergeTimelineCollectedStyles(e))),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const s=e.strValue;return fn(t.params?Rn(s,t.params,t.errors):s,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const s=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;s.delay&&(t.incrementTime(s.delay),i.snapshotCurrentStyles());const o=e.style;5==o.type?this.visitKeyframes(o,t):(t.incrementTime(s.duration),this.visitStyle(o,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const s=t.currentTimeline,i=t.currentAnimateTimings;!i&&s.getCurrentStyleProperties().length&&s.forwardFrame();const o=i&&i.easing||e.easing;e.isEmptyStep?s.applyEmptyStep(o):s.setStyles(e.styles,o,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const s=t.currentAnimateTimings,i=t.currentTimeline.duration,o=s.duration,n=t.createSubContext().currentTimeline;n.easing=s.easing,e.styles.forEach((e=>{const s=e.offset||0;n.forwardTime(s*o),n.setStyles(e.styles,e.easing,t.errors,t.options),n.applyStylesToKeyframe()})),t.currentTimeline.mergeTimelineCollectedStyles(n),t.transformIntoNewTimeline(i+o),t.previousNode=e}visitQuery(e,t){const s=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?Sn(i.delay):0;o&&(6===t.previousNode.type||0==s&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=or);let n=s;const r=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=r.length;let a=null;r.forEach(((s,i)=>{t.currentQueryIndex=i;const r=t.createSubContext(e.options,s);o&&r.delayNextStep(o),s===t.element&&(a=r.currentTimeline),On(this,e.animation,r),r.currentTimeline.applyStylesToKeyframe();const l=r.currentTimeline.currentTime;n=Math.max(n,l)})),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(n),a&&(t.currentTimeline.mergeTimelineCollectedStyles(a),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const s=t.parentContext,i=t.currentTimeline,o=e.timings,n=Math.abs(o.duration),r=n*(t.currentQueryTotal-1);let a=n*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":a=r-a;break;case"full":a=s.currentStaggerTime}const l=t.currentTimeline;a&&l.delayNextStep(a);const h=l.currentTime;On(this,e.animation,t),t.previousNode=e,s.currentStaggerTime=i.currentTime-h+(i.startTime-s.currentTimeline.startTime)}}const or={};class nr{constructor(e,t,s,i,o,n,r,a){this._driver=e,this.element=t,this.subInstructions=s,this._enterClassName=i,this._leaveClassName=o,this.errors=n,this.timelines=r,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=or,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new rr(this._driver,t,0),r.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const s=e;let i=this.options;null!=s.duration&&(i.duration=Sn(s.duration)),null!=s.delay&&(i.delay=Sn(s.delay));const o=s.params;if(o){let e=i.params;e||(e=this.options.params={}),Object.keys(o).forEach((s=>{t&&e.hasOwnProperty(s)||(e[s]=Rn(o[s],e,this.errors))}))}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const s=e.params={};Object.keys(t).forEach((e=>{s[e]=t[e]}))}}return e}createSubContext(e=null,t,s){const i=t||this.element,o=new nr(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,s||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(e){return this.previousNode=or,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,s){const i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=s?s:0)+e.delay,easing:""},o=new ar(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(o),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,s,i,o,n){let r=[];if(i&&r.push(this.element),e.length>0){e=(e=e.replace(er,"."+this._enterClassName)).replace(tr,"."+this._leaveClassName);const t=1!=s;let i=this._driver.query(this.element,e,t);0!==s&&(i=s<0?i.slice(i.length+s,i.length):i.slice(0,s)),r.push(...i)}return o||0!=r.length||n.push(function(e){return new K["ɵRuntimeError"](3014,Ho&&`\`query("${e}")\` returned zero elements. (Use \`query("${e}", { optional: true })\` if you wish to allow this.)`)}(t)),r}}class rr{constructor(e,t,s,i){this._driver=e,this.element=t,this.startTime=s,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new rr(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach((e=>{this._backFill[e]=this._globalTimelineStyles[e]||Lo,this._currentKeyframe[e]=Lo})),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,s,i){t&&(this._previousKeyframe.easing=t);const o=i&&i.params||{},n=function(e,t){const s={};let i;return e.forEach((e=>{"*"===e?(i=i||Object.keys(t),i.forEach((e=>{s[e]=Lo}))):Tn(e,!1,s)})),s}(e,this._globalTimelineStyles);Object.keys(n).forEach((e=>{const t=Rn(n[e],o,s);this._pendingStyles[e]=t,this._localTimelineStyles.hasOwnProperty(e)||(this._backFill[e]=this._globalTimelineStyles.hasOwnProperty(e)?this._globalTimelineStyles[e]:Lo),this._updateStyle(e,t)}))}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach((t=>{const s=e[t];this._currentKeyframe[t]=s})),Object.keys(this._localTimelineStyles).forEach((e=>{this._currentKeyframe.hasOwnProperty(e)||(this._currentKeyframe[e]=this._localTimelineStyles[e])})))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach((e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)}))}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach((t=>{const s=this._styleSummary[t],i=e._styleSummary[t];(!s||i.time>s.time)&&this._updateStyle(t,i.value)}))}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,s=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach(((o,n)=>{const r=Tn(o,!0);Object.keys(r).forEach((s=>{const i=r[s];"!"==i?e.add(s):i==Lo&&t.add(s)})),s||(r.offset=n/this.duration),i.push(r)}));const o=e.size?Un(e.values()):[],n=t.size?Un(t.values()):[];if(s){const e=i[0],t=In(e);e.offset=0,t.offset=1,i=[e,t]}return Zn(this.element,i,o,n,this.duration,this.startTime,this.easing,!1)}}class ar extends rr{constructor(e,t,s,i,o,n,r=!1){super(e,t,n.delay),this.keyframes=s,this.preStyleProps=i,this.postStyleProps=o,this._stretchStartingKeyframe=r,this.timings={duration:n.duration,delay:n.delay,easing:n.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:s,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const o=[],n=s+t,r=t/n,a=Tn(e[0],!1);a.offset=0,o.push(a);const l=Tn(e[0],!1);l.offset=lr(r),o.push(l);const h=e.length-1;for(let i=1;i<=h;i++){let r=Tn(e[i],!1);const a=t+r.offset*s;r.offset=lr(a/n),o.push(r)}s=n,t=0,i="",e=o}return Zn(this.element,e,this.preStyleProps,this.postStyleProps,s,t,i,!0)}}function lr(e,t=3){const s=Math.pow(10,t-1);return Math.round(e*s)/s}class hr{}class cr extends hr{normalizePropertyName(e,t){return Bn(e)}normalizeStyleValue(e,t,s,i){let o="";const n=s.toString().trim();if(dr[t]&&0!==s&&"0"!==s)if("number"==typeof s)o="px";else{const t=s.match(/^[+-]?[\d\.]+([a-z]*)$/);t&&0==t[1].length&&i.push(function(e,t){return new K["ɵRuntimeError"](3005,Ho&&`Please provide a CSS unit value for ${e}:${t}`)}(e,s))}return n+o}}const dr=function(e){const t={};return e.forEach((e=>t[e]=!0)),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));function ur(e,t,s,i,o,n,r,a,l,h,c,d,u){return{type:0,element:e,triggerName:t,isRemovalTransition:o,fromState:s,fromStyles:n,toState:i,toStyles:r,timelines:a,queriedElements:l,preStyleProps:h,postStyleProps:c,totalTime:d,errors:u}}const pr={};class gr{constructor(e,t,s){this._triggerName=e,this.ast=t,this._stateStyles=s}match(e,t,s,i){return function(e,t,s,i,o){return e.some((e=>e(t,s,i,o)))}(this.ast.matchers,e,t,s,i)}buildStyles(e,t,s){const i=this._stateStyles["*"],o=this._stateStyles[e],n=i?i.buildStyles(t,s):{};return o?o.buildStyles(t,s):n}build(e,t,s,i,o,n,r,a,l,h){const c=[],d=this.ast.options&&this.ast.options.params||pr,u=r&&r.params||pr,p=this.buildStyles(s,u,c),g=a&&a.params||pr,m=this.buildStyles(i,g,c),y=new Set,C=new Map,v=new Map,S="void"===i,b={params:{...d,...g}},f=h?[]:sr(e,t,this.ast.animation,o,n,p,m,b,l,c);let I=0;if(f.forEach((e=>{I=Math.max(e.duration+e.delay,I)})),c.length)return ur(t,this._triggerName,s,i,S,p,m,[],[],C,v,I,c);f.forEach((e=>{const s=e.element,i=Zo(C,s,{});e.preStyleProps.forEach((e=>i[e]=!0));const o=Zo(v,s,{});e.postStyleProps.forEach((e=>o[e]=!0)),s!==t&&y.add(s)}));const T=Un(y.values());return ur(t,this._triggerName,s,i,S,p,m,f,T,C,v,I)}}class mr{constructor(e,t,s){this.styles=e,this.defaultParams=t,this.normalizer=s}buildStyles(e,t){const s={},i=In(this.defaultParams);return Object.keys(e).forEach((t=>{const s=e[t];null!=s&&(i[t]=s)})),this.styles.styles.forEach((e=>{if("string"!=typeof e){const o=e;Object.keys(o).forEach((e=>{let n=o[e];n.length>1&&(n=Rn(n,i,t));const r=this.normalizer.normalizePropertyName(e,t);n=this.normalizer.normalizeStyleValue(e,r,n,t),s[r]=n}))}})),s}}class yr{constructor(e,t,s){var i,o;this.name=e,this.ast=t,this._normalizer=s,this.transitionFactories=[],this.states={},t.states.forEach((e=>{const t=e.options&&e.options.params||{};this.states[e.name]=new mr(e.style,t,s)})),Cr(this.states,"true","1"),Cr(this.states,"false","0"),t.transitions.forEach((t=>{this.transitionFactories.push(new gr(e,t,this.states))})),this.fallbackTransition=(i=e,o=this.states,this._normalizer,new gr(i,{type:1,animation:{type:2,steps:[],options:null},matchers:[(e,t)=>!0],options:null,queryCount:0,depCount:0},o))}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,s,i){return this.transitionFactories.find((o=>o.match(e,t,s,i)))||null}matchStyles(e,t,s){return this.fallbackTransition.buildStyles(e,t,s)}}function Cr(e,t,s){e.hasOwnProperty(t)?e.hasOwnProperty(s)||(e[s]=e[t]):e.hasOwnProperty(s)&&(e[t]=e[s])}const vr=new Xn;class Sr{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._animations={},this._playersById={},this.players=[]}register(e,t){const s=[],i=[],o=qn(this._driver,t,s,i);if(s.length)throw function(e){return new K["ɵRuntimeError"](3503,Ho&&`Unable to build the animation due to the following errors: ${e.map((e=>e.message)).join("\n")}`)}(s);i.length&&function(e){Ln&&console.warn(`Animation built with the following warnings:${Gn(e)}`)}(i),this._animations[e]=o}_buildPlayer(e,t,s){const i=e.element,o=$o(this._driver,this._normalizer,0,e.keyframes,t,s);return this._driver.animate(i,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,s={}){const i=[],o=this._animations[e];let n;const r=new Map;if(o?(n=sr(this._driver,t,o,pn,gn,{},{},s,vr,i),n.forEach((e=>{const t=Zo(r,e.element,{});e.postStyleProps.forEach((e=>t[e]=null))}))):(i.push(new K["ɵRuntimeError"](3300,Ho&&"The requested animation doesn't exist or has already been destroyed")),n=[]),i.length)throw function(e){return new K["ɵRuntimeError"](3504,Ho&&`Unable to create the animation due to the following errors:${e.map((e=>e.message)).join("\n")}`)}(i);r.forEach(((e,t)=>{Object.keys(e).forEach((s=>{e[s]=this._driver.computeStyle(t,s,Lo)}))}));const a=Wo(n.map((e=>{const t=r.get(e.element);return this._buildPlayer(e,{},t)})));return this._playersById[e]=a,a.onDestroy((()=>this.destroy(e))),this.players.push(a),a}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const s=this.players.indexOf(t);s>=0&&this.players.splice(s,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw function(e){return new K["ɵRuntimeError"](3301,Ho&&`Unable to find the timeline player referenced by ${e}`)}(e);return t}listen(e,t,s,i){const o=Yo(t,"","","");return Jo(this._getPlayer(e),s,o,i),()=>{}}command(e,t,s,i){if("register"==s)return void this.register(e,i[0]);if("create"==s){const s=i[0]||{};return void this.create(e,t,s)}const o=this._getPlayer(e);switch(s){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}}const br="ng-animate-queued",fr="ng-animate-disabled",Ir=[],Tr={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Mr={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},xr="__ng_removed";class wr{constructor(e,t=""){this.namespaceId=t;const s=e&&e.hasOwnProperty("value"),i=s?e.value:e;if(this.value=function(e){return null!=e?e:null}(i),s){const t=In(e);delete t.value,this.options=t}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const e=this.options.params;Object.keys(t).forEach((s=>{null==e[s]&&(e[s]=t[s])}))}}}const Er="void",Ar=new wr(Er);class kr{constructor(e,t,s){this.id=e,this.hostElement=t,this._engine=s,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,Fr(t,this._hostClassName)}listen(e,t,s,i){if(!this._triggers.hasOwnProperty(t))throw function(e,t){return new K["ɵRuntimeError"](3302,Ho&&`Unable to listen on the animation trigger event "${e}" because the animation trigger "${t}" doesn't exist!`)}(s,t);if(null==s||0==s.length)throw function(e){return new K["ɵRuntimeError"](3303,Ho&&`Unable to listen on the animation trigger "${e}" because the provided event is undefined!`)}(t);if("start"!=(o=s)&&"done"!=o)throw function(e,t){return new K["ɵRuntimeError"](3400,Ho&&`The provided animation trigger event "${e}" for the animation trigger "${t}" is not supported!`)}(s,t);var o;const n=Zo(this._elementListeners,e,[]),r={name:t,phase:s,callback:i};n.push(r);const a=Zo(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(Fr(e,mn),Fr(e,mn+"-"+t),a[t]=Ar),()=>{this._engine.afterFlush((()=>{const e=n.indexOf(r);e>=0&&n.splice(e,1),this._triggers[t]||delete a[t]}))}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw function(e){return new K["ɵRuntimeError"](3401,Ho&&`The provided animation trigger "${e}" has not been registered!`)}(e);return t}trigger(e,t,s,i=!0){const o=this._getTrigger(t),n=new Rr(this.id,t,e);let r=this._engine.statesByElement.get(e);r||(Fr(e,mn),Fr(e,mn+"-"+t),this._engine.statesByElement.set(e,r={}));let a=r[t];const l=new wr(s,this.id);if(!(s&&s.hasOwnProperty("value"))&&a&&l.absorbOptions(a.options),r[t]=l,a||(a=Ar),l.value!==Er&&a.value===l.value){if(!function(e,t){const s=Object.keys(e),i=Object.keys(t);if(s.length!=i.length)return!1;for(let i=0;i<s.length;i++){const o=s[i];if(!t.hasOwnProperty(o)||e[o]!==t[o])return!1}return!0}(a.params,l.params)){const t=[],s=o.matchStyles(a.value,a.params,t),i=o.matchStyles(l.value,l.params,t);t.length?this._engine.reportError(t):this._engine.afterFlush((()=>{En(e,s),wn(e,i)}))}return}const h=Zo(this._engine.playersByElement,e,[]);h.forEach((e=>{e.namespaceId==this.id&&e.triggerName==t&&e.queued&&e.destroy()}));let c=o.matchTransition(a.value,l.value,e,l.params),d=!1;if(!c){if(!i)return;c=o.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:c,fromState:a,toState:l,player:n,isFallbackTransition:d}),d||(Fr(e,br),n.onStart((()=>{Lr(e,br)}))),n.onDone((()=>{let t=this.players.indexOf(n);t>=0&&this.players.splice(t,1);const s=this._engine.playersByElement.get(e);if(s){let e=s.indexOf(n);e>=0&&s.splice(e,1)}})),this.players.push(n),h.push(n),n}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach(((t,s)=>{delete t[e]})),this._elementListeners.forEach(((t,s)=>{this._elementListeners.set(s,t.filter((t=>t.name!=e)))}))}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach((e=>e.destroy())),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const s=this._engine.driver.query(e,yn,!0);s.forEach((e=>{if(e[xr])return;const s=this._engine.fetchNamespacesByElement(e);s.size?s.forEach((s=>s.triggerLeaveAnimation(e,t,!1,!0))):this.clearElementCache(e)})),this._engine.afterFlushAnimationsDone((()=>s.forEach((e=>this.clearElementCache(e)))))}triggerLeaveAnimation(e,t,s,i){const o=this._engine.statesByElement.get(e),n=new Map;if(o){const r=[];if(Object.keys(o).forEach((t=>{if(n.set(t,o[t].value),this._triggers[t]){const s=this.trigger(e,t,Er,i);s&&r.push(s)}})),r.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,n),s&&Wo(r).onDone((()=>this._engine.processLeaveNode(e))),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),s=this._engine.statesByElement.get(e);if(t&&s){const i=new Set;t.forEach((t=>{const o=t.name;if(i.has(o))return;i.add(o);const n=this._triggers[o].fallbackTransition,r=s[o]||Ar,a=new wr(Er),l=new Rr(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:n,fromState:r,toState:a,player:l,isFallbackTransition:!0})}))}}removeNode(e,t){const s=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(s.totalAnimations){const t=s.players.length?s.playersByQueriedElement.get(e):[];if(t&&t.length)i=!0;else{let t=e;for(;t=t.parentNode;)if(s.statesByElement.get(t)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)s.markElementAsRemoved(this.id,e,!1,t);else{const i=e[xr];i&&i!==Tr||(s.afterFlush((()=>this.clearElementCache(e))),s.destroyInnerAnimations(e),s._onRemovalComplete(e,t))}}insertNode(e,t){Fr(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach((s=>{const i=s.player;if(i.destroyed)return;const o=s.element,n=this._elementListeners.get(o);n&&n.forEach((t=>{if(t.name==s.triggerName){const i=Yo(o,s.triggerName,s.fromState.value,s.toState.value);i._data=e,Jo(s.player,t.phase,i,t.callback)}})),i.markedForDestroy?this._engine.afterFlush((()=>{i.destroy()})):t.push(s)})),this._queue=[],t.sort(((e,t)=>{const s=e.transition.ast.depCount,i=t.transition.ast.depCount;return 0==s||0==i?s-i:this._engine.driver.containsElement(e.element,t.element)?1:-1}))}destroy(e){this.players.forEach((e=>e.destroy())),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find((t=>t.element===e))||t,t}}class _r{constructor(e,t,s){this.bodyNode=e,this.driver=t,this._normalizer=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(e,t)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach((t=>{t.players.forEach((t=>{t.queued&&e.push(t)}))})),e}createNamespace(e,t){const s=new kr(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(s,t):(this.newHostElements.set(t,s),this.collectEnterElement(t)),this._namespaceLookup[e]=s}_balanceNamespaceList(e,t){const s=this._namespaceList,i=this.namespacesByHostElement,o=s.length-1;if(o>=0){let n=!1;if(void 0!==this.driver.getParentElement){let o=this.driver.getParentElement(t);for(;o;){const t=i.get(o);if(t){const i=s.indexOf(t);s.splice(i+1,0,e),n=!0;break}o=this.driver.getParentElement(o)}}else for(let i=o;i>=0;i--){const o=s[i];if(this.driver.containsElement(o.hostElement,t)){s.splice(i+1,0,e),n=!0;break}}n||s.unshift(e)}else s.push(e);return i.set(t,e),e}register(e,t){let s=this._namespaceLookup[e];return s||(s=this.createNamespace(e,t)),s}registerTrigger(e,t,s){let i=this._namespaceLookup[e];i&&i.register(t,s)&&this.totalAnimations++}destroy(e,t){if(!e)return;const s=this._fetchNamespace(e);this.afterFlush((()=>{this.namespacesByHostElement.delete(s.hostElement),delete this._namespaceLookup[e];const t=this._namespaceList.indexOf(s);t>=0&&this._namespaceList.splice(t,1)})),this.afterFlushAnimationsDone((()=>s.destroy(t)))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,s=this.statesByElement.get(e);if(s){const e=Object.keys(s);for(let i=0;i<e.length;i++){const o=s[e[i]].namespaceId;if(o){const e=this._fetchNamespace(o);e&&t.add(e)}}}return t}trigger(e,t,s,i){if(Ur(t)){const o=this._fetchNamespace(e);if(o)return o.trigger(t,s,i),!0}return!1}insertNode(e,t,s,i){if(!Ur(t))return;const o=t[xr];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const e=this.collectedLeaveElements.indexOf(t);e>=0&&this.collectedLeaveElements.splice(e,1)}if(e){const i=this._fetchNamespace(e);i&&i.insertNode(t,s)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),Fr(e,fr)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Lr(e,fr))}removeNode(e,t,s,i){if(Ur(t)){const o=e?this._fetchNamespace(e):null;if(o?o.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),s){const s=this.namespacesByHostElement.get(t);s&&s.id!==e&&s.removeNode(t,i)}}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,s,i,o){this.collectedLeaveElements.push(t),t[xr]={namespaceId:e,setForRemoval:i,hasAnimation:s,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,s,i,o){return Ur(t)?this._fetchNamespace(e).listen(t,s,i,o):()=>{}}_buildInstruction(e,t,s,i,o){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,s,i,e.fromState.options,e.toState.options,t,o)}destroyInnerAnimations(e){let t=this.driver.query(e,yn,!0);t.forEach((e=>this.destroyActiveAnimationsForElement(e))),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,vn,!0),t.forEach((e=>this.finishActiveQueriedAnimationOnElement(e))))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach((e=>{e.queued?e.markedForDestroy=!0:e.destroy()}))}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach((e=>e.finish()))}whenRenderingDone(){return new Promise((e=>{if(this.players.length)return Wo(this.players).onDone((()=>e()));e()}))}processLeaveNode(e){const t=e[xr];if(t&&t.setForRemoval){if(e[xr]=Tr,t.namespaceId){this.destroyInnerAnimations(e);const s=this._fetchNamespace(t.namespaceId);s&&s.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(fr)&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach((e=>{this.markElementAsDisabled(e,!1)}))}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach(((e,t)=>this._balanceNamespaceList(e,t))),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let e=0;e<this.collectedEnterElements.length;e++)Fr(this.collectedEnterElements[e],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const s=[];try{t=this._flushAnimations(s,e)}finally{for(let e=0;e<s.length;e++)s[e]()}}else for(let e=0;e<this.collectedLeaveElements.length;e++){const t=this.collectedLeaveElements[e];this.processLeaveNode(t)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach((e=>e())),this._flushFns=[],this._whenQuietFns.length){const e=this._whenQuietFns;this._whenQuietFns=[],t.length?Wo(t).onDone((()=>{e.forEach((e=>e()))})):e.forEach((e=>e()))}}reportError(e){throw function(e){return new K["ɵRuntimeError"](3402,Ho&&`Unable to process animations due to the following failed trigger transitions\n ${e.map((e=>e.message)).join("\n")}`)}(e)}_flushAnimations(e,t){const s=new Xn,i=[],o=new Map,n=[],r=new Map,a=new Map,l=new Map,h=new Set;this.disabledNodes.forEach((e=>{h.add(e);const t=this.driver.query(e,".ng-animate-queued",!0);for(let e=0;e<t.length;e++)h.add(t[e])}));const c=this.bodyNode,d=Array.from(this.statesByElement.keys()),u=Or(d,this.collectedEnterElements),p=new Map;let g=0;u.forEach(((e,t)=>{const s=pn+g++;p.set(t,s),e.forEach((e=>Fr(e,s)))}));const m=[],y=new Set,C=new Set;for(let e=0;e<this.collectedLeaveElements.length;e++){const t=this.collectedLeaveElements[e],s=t[xr];s&&s.setForRemoval&&(m.push(t),y.add(t),s.hasAnimation?this.driver.query(t,".ng-star-inserted",!0).forEach((e=>y.add(e))):C.add(t))}const v=new Map,S=Or(d,Array.from(y));S.forEach(((e,t)=>{const s=gn+g++;v.set(t,s),e.forEach((e=>Fr(e,s)))})),e.push((()=>{u.forEach(((e,t)=>{const s=p.get(t);e.forEach((e=>Lr(e,s)))})),S.forEach(((e,t)=>{const s=v.get(t);e.forEach((e=>Lr(e,s)))})),m.forEach((e=>{this.processLeaveNode(e)}))}));const b=[],f=[];for(let e=this._namespaceList.length-1;e>=0;e--)this._namespaceList[e].drainQueuedTransitions(t).forEach((e=>{const t=e.player,o=e.element;if(b.push(t),this.collectedEnterElements.length){const s=o[xr];if(s&&s.setForMove){if(s.previousTriggersValues&&s.previousTriggersValues.has(e.triggerName)){const t=s.previousTriggersValues.get(e.triggerName),i=this.statesByElement.get(e.element);i&&i[e.triggerName]&&(i[e.triggerName].value=t)}return void t.destroy()}}const h=!c||!this.driver.containsElement(c,o),d=v.get(o),u=p.get(o),g=this._buildInstruction(e,s,u,d,h);if(g.errors&&g.errors.length)return void f.push(g);if(h)return t.onStart((()=>En(o,g.fromStyles))),t.onDestroy((()=>wn(o,g.toStyles))),void i.push(t);if(e.isFallbackTransition)return t.onStart((()=>En(o,g.fromStyles))),t.onDestroy((()=>wn(o,g.toStyles))),void i.push(t);const m=[];g.timelines.forEach((e=>{e.stretchStartingKeyframe=!0,this.disabledNodes.has(e.element)||m.push(e)})),g.timelines=m,s.append(o,g.timelines);const y={instruction:g,player:t,element:o};n.push(y),g.queriedElements.forEach((e=>Zo(r,e,[]).push(t))),g.preStyleProps.forEach(((e,t)=>{const s=Object.keys(e);if(s.length){let e=a.get(t);e||a.set(t,e=new Set),s.forEach((t=>e.add(t)))}})),g.postStyleProps.forEach(((e,t)=>{const s=Object.keys(e);let i=l.get(t);i||l.set(t,i=new Set),s.forEach((e=>i.add(e)))}))}));if(f.length){const e=[];f.forEach((t=>{e.push(function(e,t){return new K["ɵRuntimeError"](3505,Ho&&`@${e} has failed due to:\n ${t.map((e=>e.message)).join("\n- ")}`)}(t.triggerName,t.errors))})),b.forEach((e=>e.destroy())),this.reportError(e)}const I=new Map,T=new Map;n.forEach((e=>{const t=e.element;s.has(t)&&(T.set(t,t),this._beforeAnimationBuild(e.player.namespaceId,e.instruction,I))})),i.forEach((e=>{const t=e.element;this._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach((e=>{Zo(I,t,[]).push(e),e.destroy()}))}));const M=m.filter((e=>Pr(e,a,l))),x=new Map;Br(x,this.driver,C,l,Lo).forEach((e=>{Pr(e,a,l)&&M.push(e)}));const w=new Map;u.forEach(((e,t)=>{Br(w,this.driver,new Set(e),a,"!")})),M.forEach((e=>{const t=x.get(e),s=w.get(e);x.set(e,{...t,...s})}));const E=[],A=[],k={};n.forEach((e=>{const{element:t,player:n,instruction:r}=e;if(s.has(t)){if(h.has(t))return n.onDestroy((()=>wn(t,r.toStyles))),n.disabled=!0,n.overrideTotalTime(r.totalTime),void i.push(n);let e=k;if(T.size>1){let s=t;const i=[];for(;s=s.parentNode;){const t=T.get(s);if(t){e=t;break}i.push(s)}i.forEach((t=>T.set(t,e)))}const s=this._buildAnimation(n.namespaceId,r,I,o,w,x);if(n.setRealPlayer(s),e===k)E.push(n);else{const t=this.playersByElement.get(e);t&&t.length&&(n.parentPlayer=Wo(t)),i.push(n)}}else En(t,r.fromStyles),n.onDestroy((()=>wn(t,r.toStyles))),A.push(n),h.has(t)&&i.push(n)})),A.forEach((e=>{const t=o.get(e.element);if(t&&t.length){const s=Wo(t);e.setRealPlayer(s)}})),i.forEach((e=>{e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()}));for(let e=0;e<m.length;e++){const t=m[e],s=t[xr];if(Lr(t,gn),s&&s.hasAnimation)continue;let i=[];if(r.size){let e=r.get(t);e&&e.length&&i.push(...e);let s=this.driver.query(t,vn,!0);for(let e=0;e<s.length;e++){let t=r.get(s[e]);t&&t.length&&i.push(...t)}}const o=i.filter((e=>!e.destroyed));o.length?Gr(this,t,o):this.processLeaveNode(t)}return m.length=0,E.forEach((e=>{this.players.push(e),e.onDone((()=>{e.destroy();const t=this.players.indexOf(e);this.players.splice(t,1)})),e.play()})),E}elementContainsData(e,t){let s=!1;const i=t[xr];return i&&i.setForRemoval&&(s=!0),this.playersByElement.has(t)&&(s=!0),this.playersByQueriedElement.has(t)&&(s=!0),this.statesByElement.has(t)&&(s=!0),this._fetchNamespace(e).elementContainsData(t)||s}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,s,i,o){let n=[];if(t){const t=this.playersByQueriedElement.get(e);t&&(n=t)}else{const t=this.playersByElement.get(e);if(t){const e=!o||o==Er;t.forEach((t=>{t.queued||(e||t.triggerName==i)&&n.push(t)}))}}return(s||i)&&(n=n.filter((e=>!(s&&s!=e.namespaceId||i&&i!=e.triggerName)))),n}_beforeAnimationBuild(e,t,s){const i=t.triggerName,o=t.element,n=t.isRemovalTransition?void 0:e,r=t.isRemovalTransition?void 0:i;for(const e of t.timelines){const i=e.element,a=i!==o,l=Zo(s,i,[]);this._getPreviousPlayers(i,a,n,r,t.toState).forEach((e=>{const t=e.getRealPlayer();t.beforeDestroy&&t.beforeDestroy(),e.destroy(),l.push(e)}))}En(o,t.fromStyles)}_buildAnimation(e,t,s,i,o,n){const r=t.triggerName,a=t.element,l=[],h=new Set,c=new Set,d=t.timelines.map((t=>{const d=t.element;h.add(d);const u=d[xr];if(u&&u.removedBeforeQueried)return new No(t.duration,t.delay);const p=d!==a,g=function(e){const t=[];return Vr(e,t),t}((s.get(d)||Ir).map((e=>e.getRealPlayer()))).filter((e=>{const t=e;return!!t.element&&t.element===d})),m=o.get(d),y=n.get(d),C=$o(this.driver,this._normalizer,0,t.keyframes,m,y),v=this._buildPlayer(t,C,g);if(t.subTimeline&&i&&c.add(d),p){const t=new Rr(e,r,d);t.setRealPlayer(v),l.push(t)}return v}));l.forEach((e=>{Zo(this.playersByQueriedElement,e.element,[]).push(e),e.onDone((()=>function(e,t,s){let i;if(e instanceof Map){if(i=e.get(t),i){if(i.length){const e=i.indexOf(s);i.splice(e,1)}0==i.length&&e.delete(t)}}else if(i=e[t],i){if(i.length){const e=i.indexOf(s);i.splice(e,1)}0==i.length&&delete e[t]}return i}(this.playersByQueriedElement,e.element,e)))})),h.forEach((e=>Fr(e,Cn)));const u=Wo(d);return u.onDestroy((()=>{h.forEach((e=>Lr(e,Cn))),wn(a,t.toStyles)})),c.forEach((e=>{Zo(i,e,[]).push(u)})),u}_buildPlayer(e,t,s){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,s):new No(e.duration,e.delay)}}class Rr{constructor(e,t,s){this.namespaceId=e,this.triggerName=t,this.element=s,this._player=new No,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach((t=>{this._queuedCallbacks[t].forEach((s=>Jo(e,t,void 0,s)))})),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart((()=>t.triggerCallback("start"))),e.onDone((()=>this.finish())),e.onDestroy((()=>this.destroy()))}_queueEvent(e,t){Zo(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function Ur(e){return e&&1===e.nodeType}function Dr(e,t){const s=e.style.display;return e.style.display=null!=t?t:"none",s}function Br(e,t,s,i,o){const n=[];s.forEach((e=>n.push(Dr(e))));const r=[];i.forEach(((s,i)=>{const n={};s.forEach((e=>{const s=n[e]=t.computeStyle(i,e,o);s&&0!=s.length||(i[xr]=Mr,r.push(i))})),e.set(i,n)}));let a=0;return s.forEach((e=>Dr(e,n[a++]))),r}function Or(e,t){const s=new Map;if(e.forEach((e=>s.set(e,[]))),0==t.length)return s;const i=new Set(t),o=new Map;function n(e){if(!e)return 1;let t=o.get(e);if(t)return t;const r=e.parentNode;return t=s.has(r)?r:i.has(r)?1:n(r),o.set(e,t),t}return t.forEach((e=>{const t=n(e);1!==t&&s.get(t).push(e)})),s}function Fr(e,t){e.classList?.add(t)}function Lr(e,t){e.classList?.remove(t)}function Gr(e,t,s){Wo(s).onDone((()=>e.processLeaveNode(t)))}function Vr(e,t){for(let s=0;s<e.length;s++){const i=e[s];i instanceof jo?Vr(i.players,t):t.push(i)}}function Pr(e,t,s){const i=s.get(e);if(!i)return!1;let o=t.get(e);return o?i.forEach((e=>o.add(e))):t.set(e,i),s.delete(e),!0}class Nr{constructor(e,t,s){this.bodyNode=e,this._driver=t,this._normalizer=s,this._triggerCache={},this.onRemovalComplete=(e,t)=>{},this._transitionEngine=new _r(e,t,s),this._timelineEngine=new Sr(e,t,s),this._transitionEngine.onRemovalComplete=(e,t)=>this.onRemovalComplete(e,t)}registerTrigger(e,t,s,i,o){const n=e+"-"+i;let r=this._triggerCache[n];if(!r){const e=[],t=[],s=qn(this._driver,o,e,t);if(e.length)throw function(e,t){return new K["ɵRuntimeError"](3404,Ho&&`The animation trigger "${e}" has failed to build due to the following errors:\n - ${t.map((e=>e.message)).join("\n - ")}`)}(i,e);t.length&&function(e,t){Ln&&console.warn(`The animation trigger "${e}" has built with the following warnings:${Gn(t)}`)}(i,t),r=function(e,t,s){return new yr(e,t,s)}(i,s,this._normalizer),this._triggerCache[n]=r}this._transitionEngine.registerTrigger(t,i,r)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,s,i){this._transitionEngine.insertNode(e,t,s,i)}onRemove(e,t,s,i){this._transitionEngine.removeNode(e,t,i||!1,s)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,s,i){if("@"==s.charAt(0)){const[e,o]=Xo(s),n=i;this._timelineEngine.command(e,t,o,n)}else this._transitionEngine.trigger(e,t,s,i)}listen(e,t,s,i,o){if("@"==s.charAt(0)){const[e,i]=Xo(s);return this._timelineEngine.listen(e,t,i,o)}return this._transitionEngine.listen(e,t,s,i,o)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}class jr{constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s,this._state=0;let i=jr.initialStylesByElement.get(e);i||jr.initialStylesByElement.set(e,i={}),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&wn(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(wn(this._element,this._initialStyles),this._endStyles&&(wn(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(jr.initialStylesByElement.delete(this._element),this._startStyles&&(En(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(En(this._element,this._endStyles),this._endStyles=null),wn(this._element,this._initialStyles),this._state=3)}}function Hr(e){let t=null;const s=Object.keys(e);for(let i=0;i<s.length;i++){const o=s[i];Kr(o)&&(t=t||{},t[o]=e[o])}return t}function Kr(e){return"display"===e||"position"===e}jr.initialStylesByElement=new WeakMap;class zr{constructor(e,t,s,i){this.element=e,this.keyframes=t,this.options=s,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=s.duration,this._delay=s.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach((e=>e())),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",(()=>this._onFinish()))}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,s){return e.animate(t,s)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach((e=>e())),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach((e=>e())),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};if(this.hasStarted()){const t=this._finalKeyframe;Object.keys(t).forEach((s=>{"offset"!=s&&(e[s]=this._finished?t[s]:Fn(this.element,s))}))}this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach((e=>e())),t.length=0}}class qr{validateStyleProperty(e){return an(e)}matchesElement(e,t){return!1}containsElement(e,t){return ln(e,t)}getParentElement(e){return on(e)}query(e,t,s){return hn(e,t,s)}computeStyle(e,t,s){return window.getComputedStyle(e)[t]}animate(e,t,s,i,o,n=[]){const r={duration:s,delay:i,fill:0==i?"both":"forwards"};o&&(r.easing=o);const a={},l=n.filter((e=>e instanceof zr));(function(e,t){return 0===e||0===t})(s,i)&&l.forEach((e=>{let t=e.currentSnapshot;Object.keys(t).forEach((e=>a[e]=t[e]))})),t=function(e,t,s){const i=Object.keys(s);if(i.length&&t.length){let n=t[0],r=[];if(i.forEach((e=>{n.hasOwnProperty(e)||r.push(e),n[e]=s[e]})),r.length)for(var o=1;o<t.length;o++){let s=t[o];r.forEach((function(t){s[t]=Fn(e,t)}))}}return t}(e,t=t.map((e=>Tn(e,!1))),a);const h=function(e,t){let s=null,i=null;return Array.isArray(t)&&t.length?(s=Hr(t[0]),t.length>1&&(i=Hr(t[t.length-1]))):t&&(s=Hr(t)),s||i?new jr(e,s,i):null}(e,t);return new zr(e,t,r,h)}}class Wr extends Oo{constructor(e,t){super(),this._nextAnimationId=0;const s={id:"0",encapsulation:K.ViewEncapsulation.None,styles:[],data:{animation:[]}};this._renderer=e.createRenderer(t.body,s)}build(e){const t=this._nextAnimationId.toString();this._nextAnimationId++;const s=Array.isArray(e)?Go(e):e;return Qr(this._renderer,null,t,"register",[s]),new $r(t,this._renderer)}}Wr.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Wr,deps:[{token:K.RendererFactory2},{token:W.DOCUMENT}],target:K["ɵɵFactoryTarget"].Injectable}),Wr.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Wr}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Wr,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:K.RendererFactory2},{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]}]}});class $r extends Fo{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new Jr(this._id,e,t||{},this._renderer)}}class Jr{constructor(e,t,s,i){this.id=e,this.element=t,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",s)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return Qr(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){return this._renderer.engine.players[+this.id]?.getPosition()??0}}function Qr(e,t,s,i,o){return e.setProperty(t,`@@${s}:${i}`,o)}const Yr="@",Zr="@.disabled";class Xr{constructor(e,t,s){this.delegate=e,this.engine=t,this._zone=s,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),t.onRemovalComplete=(e,t)=>{const s=t?.parentNode(e);s&&t.removeChild(s,e)}}createRenderer(e,t){const s=this.delegate.createRenderer(e,t);if(!(e&&t&&t.data&&t.data.animation)){let e=this._rendererCache.get(s);return e||(e=new ea("",s,this.engine),this._rendererCache.set(s,e)),e}const i=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);const n=t=>{Array.isArray(t)?t.forEach(n):this.engine.registerTrigger(i,o,e,t.name,t)};return t.data.animation.forEach(n),new ta(this,o,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then((()=>{this._microtaskId++}))}scheduleListenerCallback(e,t,s){e>=0&&e<this._microtaskId?this._zone.run((()=>t(s))):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then((()=>{this._zone.run((()=>{this._animationCallbacksBuffer.forEach((e=>{const[t,s]=e;t(s)})),this._animationCallbacksBuffer=[]}))})),this._animationCallbacksBuffer.push([t,s]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular((()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)})),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}Xr.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Xr,deps:[{token:K.RendererFactory2},{token:Nr},{token:K.NgZone}],target:K["ɵɵFactoryTarget"].Injectable}),Xr.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Xr}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:Xr,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:K.RendererFactory2},{type:Nr},{type:K.NgZone}]}});class ea{constructor(e,t,s){this.namespaceId=e,this.delegate=t,this.engine=s,this.destroyNode=this.delegate.destroyNode?e=>t.destroyNode(e):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,s,i=!0){this.delegate.insertBefore(e,t,s),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,s){this.engine.onRemove(this.namespaceId,t,this.delegate,s)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,s,i){this.delegate.setAttribute(e,t,s,i)}removeAttribute(e,t,s){this.delegate.removeAttribute(e,t,s)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,s,i){this.delegate.setStyle(e,t,s,i)}removeStyle(e,t,s){this.delegate.removeStyle(e,t,s)}setProperty(e,t,s){t.charAt(0)==Yr&&t==Zr?this.disableAnimations(e,!!s):this.delegate.setProperty(e,t,s)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,s){return this.delegate.listen(e,t,s)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class ta extends ea{constructor(e,t,s,i){super(t,s,i),this.factory=e,this.namespaceId=t}setProperty(e,t,s){t.charAt(0)==Yr?"."==t.charAt(1)&&t==Zr?(s=void 0===s||!!s,this.disableAnimations(e,s)):this.engine.process(this.namespaceId,e,t.substr(1),s):this.delegate.setProperty(e,t,s)}listen(e,t,s){if(t.charAt(0)==Yr){const i=function(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(e);let o=t.substr(1),n="";return o.charAt(0)!=Yr&&([o,n]=function(e){const t=e.indexOf(".");return[e.substring(0,t),e.substr(t+1)]}(o)),this.engine.listen(this.namespaceId,i,o,n,(e=>{const t=e._data||-1;this.factory.scheduleListenerCallback(t,s,e)}))}return this.delegate.listen(e,t,s)}}class sa extends Nr{constructor(e,t,s){super(e.body,t,s)}ngOnDestroy(){this.flush()}}sa.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:sa,deps:[{token:W.DOCUMENT},{token:dn},{token:hr}],target:K["ɵɵFactoryTarget"].Injectable}),sa.ɵprov=K["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:sa}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:sa,decorators:[{type:K.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:K.Inject,args:[W.DOCUMENT]}]},{type:dn},{type:hr}]}});const ia=new K.InjectionToken("AnimationModuleType"),oa=[{provide:Oo,useClass:Wr},{provide:hr,useFactory:function(){return new cr}},{provide:Nr,useClass:sa},{provide:K.RendererFactory2,useFactory:function(e,t,s){return new Xr(e,t,s)},deps:[so,Nr,K.NgZone]}],na=[{provide:dn,useFactory:()=>new qr},{provide:ia,useValue:"BrowserAnimations"},...oa],ra=[{provide:dn,useClass:cn},{provide:ia,useValue:"NoopAnimations"},...oa];class aa{static withConfig(e){return{ngModule:aa,providers:e.disableAnimations?ra:na}}}aa.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:aa,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),aa.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:aa,exports:[Co]}),aa.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:aa,providers:na,imports:[Co]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:aa,decorators:[{type:K.NgModule,args:[{exports:[Co],providers:na}]}]});class la{}la.ɵfac=K["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:la,deps:[],target:K["ɵɵFactoryTarget"].NgModule}),la.ɵmod=K["ɵɵngDeclareNgModule"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:la,exports:[Co]}),la.ɵinj=K["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:la,providers:ra,imports:[Co]}),K["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"13.3.12",ngImport:z,type:la,decorators:[{type:K.NgModule,args:[{exports:[Co],providers:ra}]}]});let ha=class{constructor(s,i,o){this.elementRef=s,this.ref=i,this.themeService=o,this.isMobileView=!1,this.messageText=(0,e.localize)("NO_CALLS_SELECTED"),this.callHistoryWithDetailsStyle={},this.callDetailsConfiguration=new t.CallDetailsConfiguration({}),this.callHistoryConfiguration=new t.CallHistoryConfiguration({}),this.onError=e=>{console.log(e)},this.labelStyle={background:"transparent",textFont:"700 22px Inter",textColor:"rgba(20, 20, 20, 0.33)"},this.closeDetailsPage=()=>{this.activeCall=null,this.user=null,this.group=null,this.ref.detectChanges()},this.onBack=()=>{this.user=null,this.group=null,this.activeCall=null},this.onItemClick=e=>{this.call=e,this.setActiveChat()},this.emptyMessageStyle=()=>({background:this.callHistoryWithDetailsStyle.background||this.themeService.theme.palette.getBackground(),height:this.callHistoryWithDetailsStyle.height,width:`calc(${this.callHistoryWithDetailsStyle.width} - 280px)`,border:this.callHistoryWithDetailsStyle.border,borderRadius:this.callHistoryWithDetailsStyle.borderRadius}),this.chatsWrapperStyles=()=>({height:this.callHistoryWithDetailsStyle.height,width:this.callHistoryWithDetailsStyle.width,border:this.callHistoryWithDetailsStyle.border,borderRadius:this.callHistoryWithDetailsStyle.borderRadius,background:this.callHistoryWithDetailsStyle.background||this.themeService.theme.palette.getBackground()})}ngOnChanges(e){(e.user||e.group)&&this.setActiveChat()}setWithDetailsStyle(){let s=new t.WithDetailsStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",messageTextColor:this.themeService.theme.palette.getAccent600(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1)});this.callHistoryWithDetailsStyle=Object.assign(Object.assign({},s),this.callHistoryWithDetailsStyle),this.labelStyle.textFont=this.callHistoryWithDetailsStyle.messageTextFont,this.labelStyle.textColor=this.callHistoryWithDetailsStyle.messageTextColor}setActiveChat(){var t;this.activeCall=this.call,this.call.getSender().getUid()==(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())?this.call.getReceiverType()==e.CometChatUIKitConstants.MessageReceiverType.user?(this.user=this.call.getReceiver(),this.group=null):(this.user=null,this.group=this.call.getReceiver()):this.user=this.call.getSender()}ngOnInit(){this.setWithDetailsStyle(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)}))}};L([(0,K.Input)(),G("design:type",Object)],ha.prototype,"call",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ha.prototype,"isMobileView",void 0),L([(0,K.Input)(),G("design:type",String)],ha.prototype,"messageText",void 0),L([(0,K.Input)(),G("design:type",t.WithDetailsStyle)],ha.prototype,"callHistoryWithDetailsStyle",void 0),L([(0,K.Input)(),G("design:type",t.CallDetailsConfiguration)],ha.prototype,"callDetailsConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.CallHistoryConfiguration)],ha.prototype,"callHistoryConfiguration",void 0),L([(0,K.Input)(),G("design:type",Object)],ha.prototype,"onError",void 0),ha=L([(0,K.Component)({selector:"cometchat-call-history-with-details",templateUrl:"./cometchat-call-history-with-details.component.html",styleUrls:["./cometchat-call-history-with-details.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ElementRef,K.ChangeDetectorRef,q])],ha);let ca=class{};ca=L([(0,K.NgModule)({declarations:[ha],imports:[W.CommonModule,Ui,_i,Co,aa],exports:[ha],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ca);let da=class{constructor(i,o){this.ref=i,this.themeService=o,this.disableSoundForCalls=!1,this.acceptButtonText=(0,e.localize)("ACCEPT"),this.declineButtonText=(0,e.localize)("DECLINE"),this.onError=e=>{console.log(e)},this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"",border:""},this.avatarStyle={borderRadius:"16px",width:"38px",height:"38px"},this.incomingCallStyle={width:"fit-content",height:"fit-content"},this.incomingcallListenerId="incomingcall_"+(new Date).getTime(),this.subtitleText=(0,e.localize)("INCOMING_CALL"),this.buttonStyle={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"8px 28px"},this.ongoingCallStyle={},this.showOngoingCall=!1,this.showIncomingCallScreen=!1,this.sessionId="",this.acceptButtonStyle={},this.declineButtonStyle={},this.loggedInUser=null,this.iconStyle={height:"16px",width:"16px",iconTint:"RGBA(20, 20, 20, 0.68)"},this.activeCall=null,this.localStorageChange=s=>{var i;if((null==s?void 0:s.key)!==e.CometChatUIKitConstants.calls.activecall)return!1;if(s.newValue||s.oldValue){let e;s.newValue?e=JSON.parse(s.newValue):s.oldValue&&(e=JSON.parse(s.oldValue)),(null===(i=this.call)||void 0===i?void 0:i.getSessionId())===(null==e?void 0:e.sessionId)&&(this.showIncomingCallScreen=!1,t.CometChatSoundManager.pause(),this.call=null,this.ref.detectChanges())}},this.setOngoingCallStyle=()=>{let e=new t.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:this.themeService.theme.palette.getAccent900(),maximizeIconTint:this.themeService.theme.palette.getAccent900()});this.ongoingCallStyle=Object.assign(Object.assign({},e),this.ongoingCallStyle)},this.startDefaultCall=()=>{let t=this.call;const i=null==t?void 0:t.getSessionId(),o=(null==t?void 0:t.getType())===e.CometChatUIKitConstants.MessageTypes.audio,n=(new s.CometChat.CallSettingsBuilder).setSessionID(i).enableDefaultLayout(!0).setMode(s.CometChat.CALL_MODE.DEFAULT).setIsAudioOnlyCall(o).showRecordingButton(!0).build();s.CometChat.startCall(n,"",new s.CometChat.OngoingCallListener({onCallEnded:t=>{t.getAction()==e.CometChatUIKitConstants.calls.ended&&e.CometChatCallEvents.ccCallEnded.next(t)}}))},this.checkForActiveCallAndEndCall=()=>{let e=s.CometChat.getActiveCall();return new Promise(((t,i)=>{if(!e)return t({success:!0});let o=null==e?void 0:e.getSessionId();s.CometChat.endCall(o).then((e=>t(e))).catch((e=>i(e)))}))},this.subtitleStyle=()=>({textFont:this.incomingCallStyle.subtitleTextFont,textColor:this.incomingCallStyle.subtitleTextColor}),this.wrapperStyle=()=>({height:this.incomingCallStyle.height,width:this.incomingCallStyle.width,background:this.incomingCallStyle.background,border:this.incomingCallStyle.border,borderRadius:this.incomingCallStyle.borderRadius,padding:"8px"})}ngOnChanges(e){e.call&&e.call.currentValue&&this.showCall(this.call)}playAudio(){this.customSoundForCalls?t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.incomingCall,this.customSoundForCalls):t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.incomingCall)}isCallActive(s){let i=!1;if(t.StorageUtils.getItem(e.CometChatUIKitConstants.calls.activecall)){let o=t.StorageUtils.getItem(e.CometChatUIKitConstants.calls.activecall);i=!(!o||o.sessionId!=s.getSessionId())}else i=!1;return i}showCall(s){var i,o;this.isCallActive(s)||(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())==(null===(o=null==s?void 0:s.getSender())||void 0===o?void 0:o.getUid())||this.call?(t.CometChatSoundManager.pause(),this.rejectIncomingCall(e.CometChatUIKitConstants.calls.busy)):(this.disableSoundForCalls||this.playAudio(),this.call=s,this.showIncomingCallScreen=!0,this.ref.detectChanges())}attachListeners(){s.CometChat.addCallListener(this.incomingcallListenerId,new s.CometChat.CallListener({onIncomingCallReceived:e=>{this.showCall(e),this.ref.detectChanges()},onIncomingCallCancelled:e=>{t.CometChatSoundManager.pause(),this.call=null,this.ref.detectChanges()}}))}removeListener(){s.CometChat.removeCallListener(this.incomingcallListenerId)}ngOnInit(){s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),t.StorageUtils.attachChangeDetection(this.localStorageChange),this.attachListeners(),this.setThemeStyle(),this.ccCallEnded=e.CometChatCallEvents.ccCallEnded.subscribe((e=>{this.showOngoingCall=!1,this.activeCall=null,this.call=null,this.sessionId="",this.ref.detectChanges()}))}ngOnDestroy(){var e;t.StorageUtils.detachChangeDetection(this.localStorageChange),this.removeListener(),null===(e=this.ccCallEnded)||void 0===e||e.unsubscribe()}getCallTypeIcon(){var t;return(null===(t=this.call)||void 0===t?void 0:t.getType())==e.CometChatUIKitConstants.MessageTypes.audio?"assets/Audio-Call.svg":"assets/Video-call.svg"}acceptIncomingCall(){t.CometChatSoundManager.pause(),this.onAccept&&this.call?this.onAccept(this.call):this.checkForActiveCallAndEndCall().then((i=>{s.CometChat.acceptCall(this.call.getSessionId()).then((s=>{e.CometChatCallEvents.ccCallAccepted.next(s),t.StorageUtils.setItem(e.CometChatUIKitConstants.calls.activecall,s),this.showOngoingCall=!0,this.activeCall=s,this.sessionId=null==s?void 0:s.getSessionId(),this.showIncomingCallScreen=!1,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)}))})).catch((e=>{this.onError&&this.onError(e)}))}rejectIncomingCall(i=e.CometChatUIKitConstants.calls.rejected){t.CometChatSoundManager.pause(),this.onDecline&&this.call?this.onDecline(this.call):s.CometChat.rejectCall(this.call.getSessionId(),i).then((s=>{t.StorageUtils.setItem(e.CometChatUIKitConstants.calls.activecall,s),e.CometChatCallEvents.ccCallRejected.next(s),this.showOngoingCall=!1,this.activeCall=null,this.call=null,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)}))}getCallBuilder(){var t;let i=(null===(t=this.call)||void 0===t?void 0:t.getType())==e.CometChatUIKitConstants.MessageTypes.audio;return(new s.CometChat.CallSettingsBuilder).setSessionID(this.sessionId).enableDefaultLayout(!0).setIsAudioOnlyCall(i).setMode(s.CometChat.CALL_MODE.DEFAULT).setLocalizedStringObject(e.CometChatLocalize.getLocale())}setThemeStyle(){this.setincomingCallStyle(),this.setAvatarStyle(),this.setOngoingCallStyle(),this.iconStyle.iconTint=this.incomingCallStyle.subtitleTextColor}setListItemStyle(){let e=new J.ListItemStyle({height:"100%",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:this.incomingCallStyle.titleTextFont,titleColor:this.incomingCallStyle.titleTextColor,border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},e),this.listItemStyle)}setincomingCallStyle(){let s=new t.IncomingCallStyle({width:"fit-content",height:"fit-content",background:this.themeService.theme.palette.getAccent800("light"),border:"none",borderRadius:"8px",titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleTextColor:this.themeService.theme.palette.getAccent("dark"),subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subtitleTextColor:this.themeService.theme.palette.getAccent800("dark"),acceptButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),acceptButtonTextColor:this.themeService.theme.palette.getAccent("dark"),acceptButtonBackground:this.themeService.theme.palette.getPrimary(),acceptButtonBorderRadius:"8px",acceptButtonBorder:"none",declineButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),declineButtonTextColor:this.themeService.theme.palette.getAccent("dark"),declineButtonBackground:this.themeService.theme.palette.getError(),declineButtonBorderRadius:"8px",declineButtonBorder:"none"});this.incomingCallStyle=Object.assign(Object.assign({},s),this.incomingCallStyle),this.setListItemStyle(),this.acceptButtonStyle=Object.assign({border:this.incomingCallStyle.acceptButtonBorder,borderRadius:this.incomingCallStyle.acceptButtonBorderRadius,background:this.incomingCallStyle.acceptButtonBackground,buttonTextFont:this.incomingCallStyle.acceptButtonTextFont,buttonTextColor:this.incomingCallStyle.acceptButtonTextColor},this.buttonStyle),this.declineButtonStyle=Object.assign({border:this.incomingCallStyle.declineButtonBorder,borderRadius:this.incomingCallStyle.declineButtonBorderRadius,background:this.incomingCallStyle.declineButtonBackground,buttonTextFont:this.incomingCallStyle.declineButtonTextFont,buttonTextColor:this.incomingCallStyle.declineButtonTextColor},this.buttonStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"16px",width:"38px",height:"38px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}};L([(0,K.Input)(),G("design:type",Object)],da.prototype,"call",void 0),L([(0,K.Input)(),G("design:type",Boolean)],da.prototype,"disableSoundForCalls",void 0),L([(0,K.Input)(),G("design:type",String)],da.prototype,"customSoundForCalls",void 0),L([(0,K.Input)(),G("design:type",Function)],da.prototype,"onAccept",void 0),L([(0,K.Input)(),G("design:type",Function)],da.prototype,"onDecline",void 0),L([(0,K.Input)(),G("design:type",String)],da.prototype,"acceptButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],da.prototype,"declineButtonText",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],da.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",Function)],da.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],da.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],da.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.IncomingCallStyle)],da.prototype,"incomingCallStyle",void 0),da=L([(0,K.Component)({selector:"cometchat-incoming-call",templateUrl:"./cometchat-incoming-call.component.html",styleUrls:["./cometchat-incoming-call.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],da);let ua=class{};ua=L([(0,K.NgModule)({declarations:[da],imports:[W.CommonModule,Mi,Ei],exports:[da],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ua);let pa=class{constructor(i,o){this.ref=i,this.themeService=o,this.disableUsersPresence=!1,this.backButtonIconURL="assets/backbutton.svg",this.closeButtonIconURL="assets/close2x.svg",this.showBackButton=!0,this.hideSeparator=!1,this.selectionMode=t.SelectionMode.multiple,this.searchPlaceholder="Search Members",this.hideError=!1,this.searchIconURL="assets/search.svg",this.hideSearch=!1,this.title=(0,e.localize)("ADD_MEMBERS"),this.onError=e=>{console.log(e)},this.buttonText=(0,e.localize)("ADD_MEMBERS"),this.loadingIconURL="assets/Spinner.svg",this.listItemStyle={},this.showSectionHeader=!1,this.sectionHeaderField="name",this.emptyStateText=(0,e.localize)("NO_GROUPS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.center,this.titleAlignmentEnum=t.TitleAlignment,this.selectionmodeEnum=t.SelectionMode,this.addMembersStyle={},this.actionMessagesList=[],this.addMemberButtonStyle={height:"100%",width:"100%",background:"rgb(51, 153, 255)",padding:"8px",buttonTextColor:"white",buttonTextFont:"",display:"flex",justifyContent:"center",alignItems:"center",border:"none",borderRadius:"8px"},this.searchKeyword="",this.usersList=[],this.userListenerId="userlist_"+(new Date).getTime(),this.usersStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",searchBackground:"#efefef",onlineStatusColor:"",separatorColor:"rgb(222 222 222 / 46%)",sectionHeaderTextFont:"",sectionHeaderTextColor:""},this.membersList=[],this.addedMembers=[],this.addRemoveUsers=t=>{if(this.onSelect)this.onSelect(t);else{let i=this.membersList.findIndex((e=>e.getUid()===t.getUid()));if(i>=0)this.membersList.splice(i,1);else{let i=new s.CometChat.GroupMember(t.getUid(),e.CometChatUIKitConstants.groupMemberScope.participant);i.setName(t.getName()),i.setGuid(this.group.getGuid()),this.membersList.push(i)}}this.ref.detectChanges()},this.addMembersToGroup=()=>{if(this.group&&this.membersList.length>0)return this.onAddMembersButtonClick?(this.onAddMembersButtonClick(this.group.getGuid(),this.membersList),void this.ref.detectChanges()):void s.CometChat.addMembersToGroup(this.group.getGuid(),this.membersList,[]).then((t=>{var s;for(const e in t)if(t.hasOwnProperty(e)&&"success"===t[e]){const t=this.membersList.find((t=>t.getUid()===e));t&&(this.createActionMessage(t),this.addedMembers.push(t))}this.group.setMembersCount(this.group.getMembersCount()+(null===(s=this.addedMembers)||void 0===s?void 0:s.length)||0),e.CometChatGroupEvents.ccGroupMemberAdded.next({messages:this.actionMessagesList,usersAdded:this.addedMembers,userAddedIn:this.group,userAddedBy:this.loggedInUser}),this.membersList=[],this.addedMembers=[],this.actionMessagesList=[],this.onBack&&this.onBack(),this.ref.detectChanges()})).catch((e=>{console.log(e),this.membersList=[],this.ref.detectChanges()}))},this.backButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.addMembersStyle.backButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.closeButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.addMembersStyle.closeButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.wrapperStyle=()=>({height:this.addMembersStyle.height,width:this.addMembersStyle.width,background:this.addMembersStyle.background,border:this.addMembersStyle.border,borderRadius:this.addMembersStyle.borderRadius}),this.addMembersStyles=()=>({padding:this.addMembersStyle.padding})}ngOnInit(){this.setUsersStyle(),this.setAddMembersStyle(),this.membersList=[],this.addedMembers=[],this.actionMessagesList=[],s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)}))}closeClicked(){this.onClose&&this.onClose()}backClicked(){this.onBack&&this.onBack()}createActionMessage(i){var o;let n=new s.CometChat.Action(this.group.getGuid(),e.CometChatUIKitConstants.MessageTypes.groupMember,e.CometChatUIKitConstants.MessageReceiverType.group,e.CometChatUIKitConstants.MessageCategory.action);n.setAction(e.CometChatUIKitConstants.groupMemberAction.ADDED),n.setActionBy(this.loggedInUser),n.setActionFor(this.group),n.setActionOn(i),n.setReceiver(this.group),n.setSender(this.loggedInUser),n.setConversationId("group_"+this.group.getGuid()),n.setMuid(t.CometChatUIKitUtility.ID()),n.setMessage(`${null===(o=this.loggedInUser)||void 0===o?void 0:o.getName()} added ${i.getUid()}`),n.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),this.actionMessagesList.push(n)}setAddMembersStyle(){let s=new t.AddMembersStyle({background:this.themeService.theme.palette.getBackground(),border:"none",titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),separatorColor:this.themeService.theme.palette.getAccent400(),width:"100%",height:"100%",borderRadius:"none",searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),searchTextColor:this.themeService.theme.palette.getAccent400(),searchIconTint:this.themeService.theme.palette.getAccent600(),searchBorder:`1px solid ${this.themeService.theme.palette.getAccent100()}`,searchBorderRadius:"8px",searchBackground:this.themeService.theme.palette.getAccent50(),closeButtonIconTint:this.themeService.theme.palette.getPrimary(),backButtonIconTint:this.themeService.theme.palette.getPrimary(),addMembersButtonBackground:this.themeService.theme.palette.getPrimary(),addMembersButtonTextColor:this.themeService.theme.palette.getAccent900("light"),addMembersButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),padding:"0 100px"});this.addMembersStyle=Object.assign(Object.assign({},s),this.addMembersStyle),this.addMemberButtonStyle.background=this.addMembersStyle.addMembersButtonBackground,this.addMemberButtonStyle.buttonTextFont=this.addMembersStyle.addMembersButtonTextFont,this.addMemberButtonStyle.buttonTextColor=this.addMembersStyle.addMembersButtonTextColor}setUsersStyle(){let s=new t.UsersStyle({background:this.themeService.theme.palette.getBackground(),border:"none",titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),separatorColor:this.themeService.theme.palette.getAccent400(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3)});this.usersStyle=Object.assign(Object.assign({},s),this.addMembersStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.UsersRequestBuilder)],pa.prototype,"usersRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.UsersRequestBuilder)],pa.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],pa.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"backButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"showBackButton",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",Number)],pa.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Object)],pa.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],pa.prototype,"onBack",void 0),L([(0,K.Input)(),G("design:type",Function)],pa.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",Function)],pa.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"buttonText",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],pa.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],pa.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Boolean)],pa.prototype,"showSectionHeader",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"sectionHeaderField",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],pa.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],pa.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Function)],pa.prototype,"onAddMembersButtonClick",void 0),L([(0,K.Input)(),G("design:type",Number)],pa.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",t.AddMembersStyle)],pa.prototype,"addMembersStyle",void 0),pa=L([(0,K.Component)({selector:"cometchat-add-members",templateUrl:"./cometchat-add-members.component.html",styleUrls:["./cometchat-add-members.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],pa);let ga=class{constructor(t,s){this.ref=t,this.themeService=s,this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px",border:"none"},this.statusIndicatorStyle={borderRadius:"16px",width:"10px",height:"10px",border:"none"},this.messageHeaderStyle={width:"100%",height:"100%"},this.listItemStyle={width:"",height:"100%",border:"none",borderRadius:"2px",separatorColor:"",activeBackground:"transparent",hoverBackground:"transparent"},this.disableUsersPresence=!1,this.disableTyping=!1,this.protectedGroupIcon="assets/Locked.svg",this.privateGroupIcon="assets/Private.svg",this.backButtonIconURL="assets/backbutton.svg",this.hideBackButton=!1,this.onError=e=>{console.log(e)},this.onBack=()=>{},this.msgListenerId="message_"+(new Date).getTime(),this.groupsListenerId="groupsList_"+(new Date).getTime(),this.userListenerId="userlist_"+(new Date).getTime(),this.subtitleText="",this.isTyping=!1,this.theme=new e.CometChatTheme({}),this.statusColor={online:"#00f300",private:"#00f300",password:"#F7A500",public:""},this.backButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"none",background:"transparent",buttonIconTint:"#3399FF"},this.checkStatusType=()=>{var e,t;return this.user&&!this.disableUsersPresence?this.statusColor[null===(e=this.user)||void 0===e?void 0:e.getStatus()]:this.statusColor[null===(t=this.group)||void 0===t?void 0:t.getType()]},this.setTypingIndicatorText=t=>{var s;const i=t.getSender(),o=t.getReceiverId(),n=this.loggedInUser;this.user&&i.getUid()===(null===(s=this.user)||void 0===s?void 0:s.getUid())&&(null==n?void 0:n.getUid())===o?(this.subtitleText=(0,e.localize)("IS_TYPING"),this.ref.detectChanges()):this.group&&this.group.getGuid()===o&&(this.subtitleText=`${i.getName()} ${(0,e.localize)("IS_TYPING")}`,this.ref.detectChanges())},this.headerStyle=()=>({width:this.messageHeaderStyle.width,height:this.messageHeaderStyle.height,border:this.messageHeaderStyle.border,borderRadius:this.messageHeaderStyle.borderRadius,background:this.messageHeaderStyle.background}),this.subtitleStyle=()=>this.user&&this.user.getStatus()==e.CometChatUIKitConstants.userStatusType.online?{textFont:this.messageHeaderStyle.subtitleTextFont,textColor:this.themeService.theme.palette.getPrimary()}:{textFont:this.isTyping?this.messageHeaderStyle.typingIndicatorTextFont:this.messageHeaderStyle.subtitleTextFont,textColor:this.isTyping?this.messageHeaderStyle.typingIndicatorTextColor:this.messageHeaderStyle.subtitleTextColor}}ngOnChanges(e){(e.user||e.group)&&(this.removeListener(),this.loggedInUser?(this.attachListeners(),this.updateSubtitle()):s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.attachListeners(),this.updateSubtitle()})).catch((e=>{this.onError&&this.onError(e)})))}ngOnInit(){var e;this.setListItemStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.setHeadersStyle(),this.subscribeToEvents(),this.backButtonStyle.buttonIconTint=null===(e=this.messageHeaderStyle)||void 0===e?void 0:e.backButtonIconTint,this.statusColor.online=this.messageHeaderStyle.onlineStatusColor}subscribeToEvents(){this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.userAddedIn.getGuid())&&(this.group,null==e||e.userAddedIn,this.ref.detectChanges(),this.updateSubtitle())})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group,null==e||e.kickedFrom,this.ref.detectChanges(),this.updateSubtitle())})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.joinedGroup.getGuid())&&(this.group,null==e||e.joinedGroup,this.ref.detectChanges(),this.updateSubtitle())})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group,null==e||e.kickedFrom,this.ref.detectChanges(),this.updateSubtitle())})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.group.getGuid())&&(this.group,null==e||e.group,this.ref.detectChanges(),this.updateSubtitle())})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{var t,s;this.group&&this.group.getGuid()==(null==e?void 0:e.leftGroup.getGuid())&&(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())==(null===(s=null==e?void 0:e.userLeft)||void 0===s?void 0:s.getUid())&&(this.group,null==e||e.leftGroup,this.ref.detectChanges(),this.updateSubtitle())}))}unsubscribeToEvents(){var e,t,s,i,o,n;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberBanned)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberJoined)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberKicked)||void 0===i||i.unsubscribe(),null===(o=this.ccOwnershipChanged)||void 0===o||o.unsubscribe(),null===(n=this.ccGroupLeft)||void 0===n||n.unsubscribe()}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:"",hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setHeadersStyle(){let s=new t.MessageHeaderStyle({background:this.themeService.theme.palette.getBackground(),border:"none",onlineStatusColor:this.themeService.theme.palette.getSuccess(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",backButtonIconTint:this.themeService.theme.palette.getPrimary(),subtitleTextColor:this.themeService.theme.palette.getAccent600(),subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),typingIndicatorTextColor:this.themeService.theme.palette.getPrimary(),typingIndicatorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1)});this.messageHeaderStyle=Object.assign(Object.assign({},s),this.messageHeaderStyle)}onBackClicked(){this.onBack&&this.onBack()}updateSubtitle(){var t;const s=null===(t=this.group)||void 0===t?void 0:t.getMembersCount(),i=(0,e.localize)(s>1?"MEMBERS":"MEMBER");this.user?(this.subtitleText=this.disableUsersPresence?"":this.user.getStatus(),this.ref.detectChanges()):(this.subtitleText=`${s} ${i}`,this.ref.detectChanges())}getSubtitleView(){return this.subtitleView(this.user||this.group)}checkGroupType(){var t;let s="";if(this.group)switch(null===(t=this.group)||void 0===t?void 0:t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=""}return s}updateUserStatus(e){this.user&&this.user.getUid()&&this.user.getUid()===e.getUid()&&(this.user.setStatus(e.getStatus()),this.updateSubtitle())}attachListeners(){try{this.disableUsersPresence||s.CometChat.addUserListener(this.userListenerId,new s.CometChat.UserListener({onUserOnline:e=>{this.updateUserStatus(e)},onUserOffline:e=>{this.updateUserStatus(e)}})),this.disableTyping||s.CometChat.addMessageListener(this.msgListenerId,new s.CometChat.MessageListener({onTypingStarted:e=>{this.isTyping=!0,this.setTypingIndicatorText(e)},onTypingEnded:e=>{this.isTyping=!1,this.updateSubtitle()}})),s.CometChat.addGroupListener(this.groupsListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,s,i,o)=>{var n;t.getUid()==(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())&&o.setScope(s),this.group=o,this.ref.detectChanges(),this.updateSubtitle()},onGroupMemberKicked:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!1),this.group=i,this.ref.detectChanges(),this.updateSubtitle()},onMemberAddedToGroup:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!0),this.group=i,this.ref.detectChanges(),this.updateSubtitle()},onGroupMemberLeft:(e,t,s)=>{var i;t.getUid()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())&&s.setHasJoined(!1),this.group=s,this.ref.detectChanges(),this.updateSubtitle()},onGroupMemberJoined:(e,t,s)=>{var i;t.getUid()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())&&s.setHasJoined(!0),this.group=s,this.ref.detectChanges(),this.updateSubtitle()}}))}catch(e){console.log(e)}}removeListener(){s.CometChat.removeMessageListener(this.msgListenerId),s.CometChat.removeUserListener(this.userListenerId)}ngOnDestroy(){this.removeListener(),this.unsubscribeToEvents()}};L([(0,K.Input)(),G("design:type",J.AvatarStyle)],ga.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",J.BaseStyle)],ga.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",t.MessageHeaderStyle)],ga.prototype,"messageHeaderStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],ga.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],ga.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ga.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ga.prototype,"disableTyping",void 0),L([(0,K.Input)(),G("design:type",String)],ga.prototype,"protectedGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],ga.prototype,"privateGroupIcon",void 0),L([(0,K.Input)(),G("design:type",Object)],ga.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],ga.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],ga.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",String)],ga.prototype,"backButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ga.prototype,"hideBackButton",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ga.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",Function)],ga.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],ga.prototype,"onBack",void 0),ga=L([(0,K.Component)({selector:"cometchat-message-header",templateUrl:"./cometchat-message-header.component.html",styleUrls:["./cometchat-message-header.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],ga);let ma=class{};ma=L([(0,K.NgModule)({declarations:[ga],imports:[W.CommonModule],exports:[ga],providers:[W.DatePipe],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ma);let ya=class{constructor(t,s){this.ref=t,this.themeService=s,this.disableUsersPresence=!1,this.hideSeparator=!1,this.searchPlaceholder=(0,e.localize)("SEARCH"),this.hideError=!1,this.selectionMode=e.SelectionMode.none,this.searchIconURL="assets/search.svg",this.hideSearch=!1,this.title=(0,e.localize)("USERS"),this.onError=e=>{console.log(e)},this.loadingIconURL="assets/Spinner.svg",this.showSectionHeader=!0,this.sectionHeaderField="name",this.emptyStateText=(0,e.localize)("NO_USERS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=e.TitleAlignment.left,this.usersStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",titleTextFont:"",titleTextColor:"",searchPlaceholderTextFont:"",searchPlaceholderTextColor:"",searchTextFont:"",searchTextColor:"",emptyStateTextFont:"",emptyStateTextColor:"",errorStateTextFont:"",errorStateTextColor:"",loadingIconTint:"",searchIconTint:"",searchBorder:"",searchBorderRadius:"",searchBackground:"",onlineStatusColor:"",separatorColor:"rgb(222 222 222 / 46%)",sectionHeaderTextFont:"",sectionHeaderTextColor:""},this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"",borderRadius:"grey",titleFont:"",titleColor:"",border:"",separatorColor:"rgb(222 222 222 / 46%)"},this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px"},this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px"},this.searchKeyword="",this.userChecked="",this.listStyle={},this.state=e.States.loading,this.selectionmodeEnum=e.SelectionMode,this.usersList=[],this.limit=30,this.userListenerId="userlist_"+(new Date).getTime(),this.onScrolledToBottom=null,this.onClick=e=>{this.onItemClick&&this.onItemClick(e)},this.getActiveUser=t=>{var s;return(this.selectionMode==e.SelectionMode.none||!this.selectionMode)&&t.getUid()==(null===(s=this.activeUser)||void 0===s?void 0:s.getUid())},this.getStatusIndicatorColor=t=>this.disableUsersPresence?null:(null==t?void 0:t.getStatus())==e.CometChatUIKitConstants.userStatusType.online?this.usersStyle.onlineStatusColor||this.themeService.theme.palette.getSuccess():null,this.updateUser=e=>{let t=[...this.usersList],s=t.findIndex(((t,s)=>t.getUid()==e.getUid()));s>-1&&(t.splice(s,1,e),this.usersList=[...t],this.ref.detectChanges())},this.addMembersToList=e=>{this.userChecked=e.getUid(),this.ref.detectChanges(),this.onSelect&&this.onSelect(e)},this.fetchNextUsersList=()=>{if(this.onScrolledToBottom=null,this.usersRequest&&this.usersRequest.pagination&&(0==this.usersRequest.pagination.current_page||this.usersRequest.pagination.current_page!=this.usersRequest.pagination.total_pages)){this.onScrolledToBottom=this.fetchNextUsersList,this.state=e.States.loading,this.ref.detectChanges();try{this.usersRequest.fetchNext().then((t=>{var s,i;this.state=e.States.loading,t.length<=0&&(null===(s=this.usersList)||void 0===s?void 0:s.length)<=0||0===t.length&&(null===(i=this.usersList)||void 0===i?void 0:i.length)<=0?(this.state=e.States.empty,this.ref.detectChanges()):(this.state=e.States.loaded,this.usersList=[...this.usersList,...t],this.ref.detectChanges())}),(t=>{this.state=e.States.error,this.ref.detectChanges()}))}catch(t){this.state=e.States.error,this.ref.detectChanges()}}else this.state=e.States.loaded,this.ref.detectChanges()},this.onSearch=e=>{try{this.searchKeyword=e,clearTimeout(this.timeout),this.timeout=setTimeout((()=>{this.usersRequest=this.searchRequestBuilder?this.searchRequestBuilder.setSearchKeyword(this.searchKeyword).build():this.getRequestBuilder(),this.usersList=[],this.ref.detectChanges(),this.fetchNextUsersList()}),500)}catch(e){this.onError&&this.onError(e)}},this.userStyle=()=>({height:this.usersStyle.height,width:this.usersStyle.width,background:this.usersStyle.background,border:this.usersStyle.border,borderRadius:this.usersStyle.borderRadius}),this.state=e.States.loading}ngOnInit(){this.onScrolledToBottom=this.fetchNextUsersList,this.setThemeStyle(),this.subscribeToEvents(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.state=e.States.loading,this.usersRequest=this.getRequestBuilder(),this.fetchNextUsersList(),this.attachListeners()}subscribeToEvents(){this.ccUserBlocked=e.CometChatUserEvents.ccUserBlocked.subscribe((e=>{this.activeUser&&e.getUid()==this.activeUser.getUid()&&(this.activeUser=e,this.updateUser(e),this.ref.detectChanges())})),this.ccUserUnBlocked=e.CometChatUserEvents.ccUserUnblocked.subscribe((e=>{this.activeUser&&e.getUid()==this.activeUser.getUid()&&(this.activeUser=e,this.updateUser(e),this.ref.detectChanges())}))}unsubscribeToEvents(){var e,t;null===(e=this.ccUserBlocked)||void 0===e||e.unsubscribe(),null===(t=this.ccUserUnBlocked)||void 0===t||t.unsubscribe()}ngOnDestroy(){this.usersRequest=null,this.ref.detach(),this.removeListener(),this.state=e.States.loaded,this.unsubscribeToEvents()}isUserSelected(e){return e.getUid()===this.userChecked}attachListeners(){s.CometChat.addUserListener(this.userListenerId,new s.CometChat.UserListener({onUserOnline:e=>{this.updateUser(e)},onUserOffline:e=>{this.updateUser(e)}}))}removeListener(){s.CometChat.removeUserListener(this.userListenerId),this.userListenerId=""}getRequestBuilder(){return this.searchRequestBuilder?this.searchRequestBuilder.build():this.usersRequestBuilder?this.usersRequestBuilder.build():(new s.CometChat.UsersRequestBuilder).friendsOnly(!1).setLimit(this.limit).setSearchKeyword(this.searchKeyword).build()}setThemeStyle(){this.setUsersStyle(),this.setListItemStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.listStyle={titleTextFont:this.usersStyle.titleTextFont,titleTextColor:this.usersStyle.titleTextColor,emptyStateTextFont:this.usersStyle.emptyStateTextFont,emptyStateTextColor:this.usersStyle.emptyStateTextColor,errorStateTextFont:this.usersStyle.errorStateTextFont,errorStateTextColor:this.usersStyle.errorStateTextColor,loadingIconTint:this.usersStyle.loadingIconTint,separatorColor:this.usersStyle.separatorColor,searchIconTint:this.usersStyle.searchIconTint,searchBorder:this.usersStyle.searchBorder,searchBorderRadius:this.usersStyle.searchBorderRadius,searchBackground:this.usersStyle.searchBackground,searchPlaceholderTextFont:this.usersStyle.searchPlaceholderTextFont,searchPlaceholderTextColor:this.usersStyle.searchPlaceholderTextColor,searchTextFont:this.usersStyle.searchTextFont,searchTextColor:this.usersStyle.searchTextColor,sectionHeaderTextColor:this.usersStyle.sectionHeaderTextColor,sectionHeaderTextFont:this.usersStyle.sectionHeaderTextFont},this.ref.detectChanges()}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:this.themeService.theme.palette.getAccent100(),borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:this.themeService.theme.palette.getAccent50()});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"28px",height:"28px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setUsersStyle(){let s=new t.UsersStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),separatorColor:this.themeService.theme.palette.getAccent400(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),sectionHeaderTextColor:this.themeService.theme.palette.getAccent600(),sectionHeaderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3)});this.usersStyle=Object.assign(Object.assign({},s),this.usersStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.UsersRequestBuilder)],ya.prototype,"usersRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.UsersRequestBuilder)],ya.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ya.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],ya.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",Object)],ya.prototype,"activeUser",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ya.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ya.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",Number)],ya.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ya.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Function)],ya.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",Function)],ya.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],ya.prototype,"showSectionHeader",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"sectionHeaderField",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],ya.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],ya.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],ya.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",t.UsersStyle)],ya.prototype,"usersStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],ya.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",J.BaseStyle)],ya.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],ya.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",Function)],ya.prototype,"onItemClick",void 0),ya=L([(0,K.Component)({selector:"cometchat-users",templateUrl:"./cometchat-users.component.html",styleUrls:["./cometchat-users.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],ya);let Ca=class{};Ca=L([(0,K.NgModule)({declarations:[ya],imports:[W.CommonModule,fi,Mi],exports:[ya],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ca);let va=class{};va=L([(0,K.NgModule)({declarations:[pa],imports:[W.CommonModule,fi,ma,Ca],exports:[pa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],va);let Sa=class{constructor(i,o){this.ref=i,this.themeService=o,this.disableUsersPresence=!1,this.backButtonIconURL="assets/backbutton.svg",this.closeButtonIconURL="assets/close2x.svg",this.showBackButton=!0,this.hideSeparator=!1,this.selectionMode=t.SelectionMode.none,this.searchPlaceholder="Search Members",this.searchIconURL="assets/search.svg",this.hideSearch=!0,this.title=(0,e.localize)("BANNED_MEMBERS"),this.onError=e=>{console.log(e)},this.loadingIconURL="assets/Spinner.svg",this.emptyStateText=(0,e.localize)("NO_BANNED_MEMBERS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.center,this.unbanIconURL="assets/close2x.svg",this.menuListStyle={width:"",height:"",border:"none",borderRadius:"8px",background:"white",textFont:"400 15px Inter",textColor:"black",iconTint:"rgb(51, 153, 255)",iconBackground:"transparent",iconBorder:"none",iconBorderRadius:"0",submenuWidth:"100%",submenuHeight:"100%",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:"white"},this.unbanIconStyle={border:"none",background:"transparent",buttonIconTint:"rgb(51, 153, 255)"},this.titleAlignmentEnum=t.TitleAlignment,this.selectionmodeEnum=t.SelectionMode,this.avatarStyle={borderRadius:"16px",width:"32px",height:"32px"},this.bannedMembersStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",padding:"0 100px"},this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"transparent",borderRadius:"grey",titleFont:"",titleColor:"",border:"",hoverBackground:"transparent",separatorColor:"rgb(222 222 222 / 46%)"},this.searchKeyword="",this.listStyle=new t.ListStyle({}),this.limit=30,this.state=t.States.loading,this.bannedMembers=[],this.scopes=[],this.membersListenerId="bannedMembers_"+(new Date).getTime(),this.membersList=[],this.onScrolledToBottom=null,this.unBanMember=t=>{s.CometChat.unbanGroupMember(this.group.getGuid(),t.getUid()).then((()=>{e.CometChatGroupEvents.ccGroupMemberUnbanned.next({unbannedBy:this.loggedInUser,unbannedFrom:this.group,unbannedUser:t}),this.updateMember(t)})).catch((e=>{console.log(e)}))},this.updateMember=e=>{let t=[...this.bannedMembers],s=t.findIndex(((t,s)=>t.getUid()==e.getUid()));s>-1?(t.splice(s,1),this.bannedMembers=[...t],this.ref.detectChanges()):(t.push(e),this.bannedMembers=[...t],this.ref.detectChanges())},this.fetchNextBannedMembers=()=>{if(this.onScrolledToBottom=null,this.bannedMembersRequest&&this.bannedMembersRequest.pagination&&(0==this.bannedMembersRequest.pagination.current_page||this.bannedMembersRequest.pagination.current_page!=this.bannedMembersRequest.pagination.total_pages)){this.onScrolledToBottom=this.fetchNextBannedMembers,this.state=t.States.loading,this.ref.detectChanges();try{this.bannedMembersRequest.fetchNext().then((e=>{var s,i;this.state=t.States.loading,e.length<=0&&(null===(s=this.bannedMembers)||void 0===s?void 0:s.length)<=0||0===e.length&&(null===(i=this.bannedMembers)||void 0===i?void 0:i.length)<=0?(this.state=t.States.empty,this.ref.detectChanges()):(this.state=t.States.loaded,this.bannedMembers=[...this.bannedMembers,...e],this.ref.detectChanges())}),(e=>{console.log(e),this.state=t.States.error,this.ref.detectChanges()}))}catch(e){console.log(e),this.state=t.States.error,this.ref.detectChanges()}}else this.state=t.States.loaded},this.onSearch=e=>{try{this.searchKeyword=e,clearTimeout(this.timeout),this.timeout=setTimeout((()=>{const e=this.searchRequestBuilder?this.searchRequestBuilder.setSearchKeyword(this.searchKeyword).build():this.getRequestBuilder();this.bannedMembersRequest=e,this.bannedMembers=[],this.fetchNextBannedMembers()}),500)}catch(e){this.onError&&this.onError(e)}},this.membersStyles=()=>({padding:this.bannedMembersStyle.padding}),this.backButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.bannedMembersStyle.backButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.closeButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.bannedMembersStyle.closeButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.wrapperStyle=()=>({height:this.bannedMembersStyle.height,width:this.bannedMembersStyle.width,background:this.bannedMembersStyle.background,border:this.bannedMembersStyle.border,borderRadius:this.bannedMembersStyle.borderRadius})}ngOnInit(){this.onScrolledToBottom=this.fetchNextBannedMembers,this.setThemeStyle(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.bannedMembersRequest=this.getRequestBuilder(),this.fetchNextBannedMembers()})).catch((e=>{this.onError&&this.onError(e)}))}backClicked(){this.onBack&&this.onBack()}closeClicked(){this.onClose&&this.onClose()}attachListeners(){s.CometChat.addGroupListener(this.membersListenerId,new s.CometChat.GroupListener({onGroupMemberBanned:(e,t,s,i)=>{this.updateMember(t)},onGroupMemberUnbanned:(e,t,s,i)=>{this.updateMember(t)}}))}removeListener(){s.CometChat.removeUserListener(this.membersListenerId),this.membersListenerId=""}getRequestBuilder(){var e;return this.searchRequestBuilder?this.searchRequestBuilder.build():this.bannedMembersRequestBuilder?this.bannedMembersRequestBuilder.build():new s.CometChat.BannedMembersRequestBuilder(null===(e=this.group)||void 0===e?void 0:e.getGuid()).setLimit(this.limit).setSearchKeyword(this.searchKeyword).build()}subscribeToEvents(){this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{var t;(null===(t=null==e?void 0:e.kickedFrom)||void 0===t?void 0:t.getGuid())==this.group.getGuid()&&this.updateMember(null==e?void 0:e.kickedUser)}))}unsubscribeToEvents(){this.ccGroupMemberBanned.unsubscribe()}setThemeStyle(){this.setBanMembersStyle(),this.setListItemStyle(),this.setAvatarStyle(),this.menuListStyle.background=this.themeService.theme.palette.getBackground(),this.menuListStyle.iconBackground=this.themeService.theme.palette.getBackground(),this.menuListStyle.iconTint=this.themeService.theme.palette.getAccent400(),this.menuListStyle.submenuBackground=this.themeService.theme.palette.getBackground(),this.menuListStyle.textFont=(0,e.fontHelper)(this.themeService.theme.typography.caption1),this.menuListStyle.textColor=this.themeService.theme.palette.getAccent500(),this.unbanIconStyle.buttonIconTint=this.bannedMembersStyle.unbanIconTint}setBanMembersStyle(){let s=new t.BannedMembersStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),separatorColor:this.themeService.theme.palette.getAccent400(),width:"100%",height:"100%",borderRadius:"none",searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchBorderRadius:"8px",closeButtonIconTint:this.themeService.theme.palette.getPrimary(),backButtonIconTint:this.themeService.theme.palette.getPrimary(),padding:"0 100px",unbanIconTint:this.themeService.theme.palette.getPrimary()});this.bannedMembersStyle=Object.assign(Object.assign({},s),this.bannedMembersStyle),this.listStyle={titleTextFont:this.bannedMembersStyle.titleTextFont,titleTextColor:this.bannedMembersStyle.titleTextColor,emptyStateTextFont:this.bannedMembersStyle.emptyStateTextFont,emptyStateTextColor:this.bannedMembersStyle.emptyStateTextColor,errorStateTextFont:this.bannedMembersStyle.errorStateTextFont,errorStateTextColor:this.bannedMembersStyle.errorStateTextColor,loadingIconTint:this.bannedMembersStyle.loadingIconTint,separatorColor:this.bannedMembersStyle.separatorColor,searchIconTint:this.bannedMembersStyle.searchIconTint,searchBorder:this.bannedMembersStyle.searchBorder,searchBorderRadius:this.bannedMembersStyle.searchBorderRadius,searchBackground:this.bannedMembersStyle.searchBackground,searchPlaceholderTextFont:this.bannedMembersStyle.searchPlaceholderTextFont,searchPlaceholderTextColor:this.bannedMembersStyle.searchPlaceholderTextColor,searchTextFont:this.bannedMembersStyle.searchTextFont,searchTextColor:this.bannedMembersStyle.searchTextColor}}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:""});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.BannedMembersRequestBuilder)],Sa.prototype,"bannedMembersRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.BannedMembersRequestBuilder)],Sa.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Sa.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],Sa.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"backButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Sa.prototype,"showBackButton",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Sa.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",Number)],Sa.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Sa.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Object)],Sa.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],Sa.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",Function)],Sa.prototype,"onBack",void 0),L([(0,K.Input)(),G("design:type",Function)],Sa.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Sa.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Sa.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],Sa.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",String)],Sa.prototype,"unbanIconURL",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Sa.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.BannedMembersStyle)],Sa.prototype,"bannedMembersStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Sa.prototype,"listItemStyle",void 0),Sa=L([(0,K.Component)({selector:"cometchat-banned-members",templateUrl:"./cometchat-banned-members.component.html",styleUrls:["./cometchat-banned-members.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Sa);let ba=class{};ba=L([(0,K.NgModule)({declarations:[Sa],imports:[W.CommonModule,fi,ma,Ca,Mi],exports:[Sa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ba);let fa=class{constructor(i,n,r){this.ngZone=i,this.ref=n,this.themeService=r,this.title=(0,e.localize)("CHATS"),this.searchPlaceHolder=(0,e.localize)("SEARCH"),this.disableUsersPresence=!1,this.disableReceipt=!0,this.disableTyping=!1,this.deliveredIcon="assets/message-delivered.svg",this.readIcon="assets/message-read.svg",this.errorIcon="assets/warning-small.svg",this.datePattern=e.DatePatterns.DayDateTime,this.onError=e=>{console.log(e)},this.sentIcon="assets/message-sent.svg",this.privateGroupIcon="assets/Private.svg",this.protectedGroupIcon="assets/Locked.svg",this.customSoundForMessages="",this.activeConversation=null,this.searchIconURL="assets/search.svg",this.hideSearch=!0,this.loadingIconURL="assets/Spinner.svg",this.emptyStateText=(0,e.localize)("NO_CHATS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.left,this.hideSeparator=!1,this.searchPlaceholder=(0,e.localize)("SEARCH"),this.hideError=!1,this.selectionMode=t.SelectionMode.none,this.disableSoundForMessages=!1,this.confirmDialogTitle=(0,e.localize)("DELETE_CONVERSATION"),this.confirmButtonText=(0,e.localize)("DELETE"),this.cancelButtonText=(0,e.localize)("CANCEL"),this.confirmDialogMessage=(0,e.localize)("WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION"),this.deleteConversationDialogStyle={confirmButtonBackground:"",cancelButtonBackground:"",confirmButtonTextColor:"",confirmButtonTextFont:"",cancelButtonTextColor:"",cancelButtonTextFont:"",titleFont:"",titleColor:"",messageTextFont:"",messageTextColor:"",background:"",border:"1px solid #f2f2f2",height:"100%",width:"100%"},this.backdropStyle={height:"100%",width:"100%",background:"rgba(0, 0, 0, 0.5)"},this.badgeStyle={width:"25px",height:"15px",background:"#5aaeff",textColor:"white",textFont:"400 13px Inter, sans-serif",borderRadius:"16px"},this.dateStyle={textFont:"400 11px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.58)"},this.conversationsStyle={width:"",height:"",border:"",borderRadius:""},this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"",borderRadius:"grey",titleFont:"",titleColor:"",border:"",separatorColor:"rgb(232, 232, 232)"},this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px"},this.typingIndicatorText=(0,e.localize)("IS_TYPING"),this.threadIndicatorText=(0,e.localize)("IN_A_THREAD"),this.avatarStyle={},this.receiptStyle={},this.iconStyle={iconTint:"lightgrey",height:"20px",width:"20px"},this.listStyle=new t.ListStyle({}),this.menustyle={width:"",height:"",border:"none",borderRadius:"8px",background:"transparent",textFont:"",textColor:"black",iconTint:"grey",iconBackground:"transparent",iconBorder:"none",iconBorderRadius:"0",submenuWidth:"70px",submenuHeight:"20px",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:"white"},this.typingListenerId="conversation__LISTENER"+(new Date).getTime(),this.selectionmodeEnum=t.SelectionMode,this.isDialogOpen=!1,this.isEmpty=!1,this.isLoading=!0,this.state=t.States.loading,this.statusColor={online:"",private:"",password:"#F7A500",public:""},this.limit=30,this.isError=!1,this.conversationList=[],this.scrolledToBottom=!1,this.checkItemChange=!1,this.showConfirmDialog=!1,this.conversationToBeDeleted=null,this.conversationListenerId="chatlist_"+(new Date).getTime(),this.userListenerId="chatlist_user_"+(new Date).getTime(),this.groupListenerId="chatlist_group_"+(new Date).getTime(),this.groupToUpdate={},this.enablePolls=!1,this.enableStickers=!1,this.enableWhiteboard=!1,this.enableDocument=!1,this.threadIconURL="assets/thread-arrow.svg",this.confirmDialogStyle={height:"100%",width:"100%",borderRadius:"8px"},this.modalStyle={height:"230px",width:"270px"},this.localize=e.localize,this.deleteConversationOnClick=()=>{this.showConfirmationDialog(this.conversationToBeDeleted)},this.onConfirmClick=()=>{this.deleteSelectedConversation()},this.setStatusIndicatorStyle=t=>t.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.group?{height:"12px",width:"12px",borderRadius:"16px"}:this.statusIndicatorStyle,this.setSubtitle=t=>{var s,i,n,r,a;if(this.typingIndicator){if((null===(s=null==t?void 0:t.conversationWith)||void 0===s?void 0:s.guid)==this.typingIndicator.getReceiverId())return`${this.typingIndicator.getSender().getName()} ${this.typingIndicatorText}`;if((null===(i=null==t?void 0:t.conversationWith)||void 0===i?void 0:i.uid)==(null===(n=this.typingIndicator)||void 0===n?void 0:n.getSender().getUid())&&this.typingIndicator.getReceiverType()!==e.CometChatUIKitConstants.MessageReceiverType.group)return this.typingIndicatorText}let l=o.getDataSource().getLastConversationMessage(t,this.loggedInUser),h=(null===(r=null==t?void 0:t.getLastMessage())||void 0===r?void 0:r.getType())==e.CometChatUIKitConstants.MessageTypes.audio?"📞 ":"📹 ";return(null===(a=null==t?void 0:t.getLastMessage())||void 0===a?void 0:a.getCategory())==e.CometChatUIKitConstants.MessageCategory.call?h+l:l},this.onCancelClick=()=>{this.isDialogOpen=!1,this.conversationToBeDeleted=null,this.ref.detectChanges()},this.getMessageReceipt=e=>t.MessageReceiptUtils.getReceiptStatus(e.getLastMessage()),this.optionsStyle={background:"transparent",border:"none"},this.isActive=!0,this.contactsNotFound=!1,this.getConversation=()=>{var e;if(this.conversationsRequestBuilder&&!(null===(e=this.conversationsRequestBuilder)||void 0===e?void 0:e.pagination)||0==this.conversationsRequestBuilder.pagination.current_page||this.conversationsRequestBuilder.pagination.current_page!=this.conversationsRequestBuilder.pagination.total_pages){this.state=t.States.loading;try{s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.fetchNextConversation().then((e=>{var s,i;e.forEach((e=>{this.activeConversation&&null!==this.activeConversation&&this.activeConversation.getConversationType()===e.getConversationType()&&this.activeConversation.getConversationId()==e.getConversationId()&&e.setUnreadMessageCount(0)})),this.conversationList=[...this.conversationList,...e],e.length<=0&&(null===(s=this.conversationList)||void 0===s?void 0:s.length)<=0||0===e.length&&(null===(i=this.conversationList)||void 0===i?void 0:i.length)<=0?this.ngZone.run((()=>{this.state!=t.States.empty&&(this.state=t.States.empty),this.ref.detach()})):this.ngZone.run((()=>{this.state!=t.States.loaded&&(this.state=t.States.loaded,this.ref.detectChanges()),this.ref.detach()}))})).catch((e=>{this.state=t.States.error,this.ref.detectChanges()}))})).catch((e=>{this.state=t.States.error,this.ref.detectChanges()}))}catch(e){this.onError&&this.onError(e)}}else this.state=t.States.loaded},this.conversationUpdated=(t,s=null,i,o=null)=>{try{switch(t){case e.CometChatUIKitConstants.userStatusType.online:case e.CometChatUIKitConstants.userStatusType.online:this.updateUser(s);break;case e.CometChatUIKitConstants.messages.MESSAGE_READ:case e.CometChatUIKitConstants.messages.MESSAGE_DELIVERED:this.updateConversation(i,!1);break;case e.CometChatUIKitConstants.messages.TEXT_MESSAGE_RECEIVED:case e.CometChatUIKitConstants.messages.MEDIA_MESSAGE_RECEIVED:case e.CometChatUIKitConstants.messages.CUSTOM_MESSAGE_RECEIVED:this.disableReceipt||this.markMessageAsDelivered(i),this.updateConversation(i);break;case e.CometChatUIKitConstants.groupMemberAction.ADDED:case e.CometChatUIKitConstants.groupMemberAction.BANNED:case e.CometChatUIKitConstants.groupMemberAction.JOINED:case e.CometChatUIKitConstants.groupMemberAction.KICKED:case e.CometChatUIKitConstants.groupMemberAction.LEFT:case e.CometChatUIKitConstants.groupMemberAction.UNBANNED:case e.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE:this.updateConversation(i);break;case e.CometChatUIKitConstants.messages.MESSAGE_EDITED:case e.CometChatUIKitConstants.messages.MESSAGE_DELETED:this.conversationEditedDeleted(i)}}catch(e){this.onError&&this.onError(e)}},this.markMessageAsDelivered=t=>{var i,o,n,r,a,l;(null===(i=this.activeConversation)||void 0===i?void 0:i.getConversationType())==e.CometChatUIKitConstants.MessageReceiverType.user?this.activeConversation&&(null===(n=null===(o=this.activeConversation)||void 0===o?void 0:o.getConversationWith())||void 0===n?void 0:n.getUid())===(null===(r=null==t?void 0:t.getSender())||void 0===r?void 0:r.getUid())||t.hasOwnProperty("deliveredAt")||s.CometChat.markAsDelivered(t):this.activeConversation&&(null===(l=null===(a=this.activeConversation)||void 0===a?void 0:a.getConversationWith())||void 0===l?void 0:l.getGuid())===(null==t?void 0:t.getReceiverId())||t.hasOwnProperty("deliveredAt")||s.CometChat.markAsDelivered(t)},this.getUinx=()=>String(Math.round(+new Date/1e3)),this.showConfirmationDialog=e=>{this.isDialogOpen=!0,this.conversationToBeDeleted=e,this.ref.detectChanges()},this.styles={wrapperStyle:()=>({height:this.conversationsStyle.height,width:this.conversationsStyle.width,border:this.conversationsStyle.border||`1px solid ${this.themeService.theme.palette.getAccent400()}`,borderRadius:this.conversationsStyle.borderRadius,background:this.conversationsStyle.background||this.themeService.theme.palette.getBackground()})},this.subtitleStyle=t=>{var s,i;return this.typingIndicator&&(this.typingIndicator.getReceiverType()==e.CometChatUIKitConstants.MessageReceiverType.user&&this.typingIndicator.getSender().getUid()==(null===(s=t.conversationWith)||void 0===s?void 0:s.uid)||this.typingIndicator.getReceiverId()==(null===(i=t.conversationWith)||void 0===i?void 0:i.guid))?{font:this.conversationsStyle.typingIndictorTextColor,color:this.conversationsStyle.typingIndictorTextColor}:{font:this.conversationsStyle.lastMessageTextFont,color:this.conversationsStyle.lastMessageTextColor}},this.itemThreadIndicatorStyle=()=>({textFont:this.conversationsStyle.threadIndicatorTextFont||(0,e.fontHelper)(this.themeService.theme.typography.caption2),textColor:this.conversationsStyle.threadIndicatorTextColor||this.themeService.theme.palette.getAccent400()})}checkStatusType(t){let s=t.getConversationWith();return t.getConversationType()!=e.CometChatUIKitConstants.MessageReceiverType.user||this.disableUsersPresence?this.statusColor[t.getConversationType()]:this.statusColor[s.getStatus()]}getExtensionData(e){let s;const i=t.CometChatUIKitUtility.checkMessageForExtensionsData(e,"xss-filter");i&&t.CometChatUIKitUtility.checkHasOwnProperty(i,"sanitized_text")&&t.CometChatUIKitUtility.checkHasOwnProperty(i,"hasXSS")&&"yes"===i.hasXSS&&(s=i.sanitized_text);const o=t.CometChatUIKitUtility.checkMessageForExtensionsData(e,"data-masking");o&&t.CometChatUIKitUtility.checkHasOwnProperty(o,"data")&&t.CometChatUIKitUtility.checkHasOwnProperty(o.data,"sensitive_data")&&t.CometChatUIKitUtility.checkHasOwnProperty(o.data,"message_masked")&&"yes"===o.data.sensitive_data&&(s=o.data.message_masked);const n=t.CometChatUIKitUtility.checkMessageForExtensionsData(e,"profanity-filter");return n&&t.CometChatUIKitUtility.checkHasOwnProperty(n,"profanity")&&t.CometChatUIKitUtility.checkHasOwnProperty(n,"message_clean")&&"yes"===n.profanity&&(s=n.message_clean),s||e.text}checkGroupType(t){let s="";if(t.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.group)switch(t.getConversationType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=""}return s}getDate(){return this.datePattern||e.DatePatterns.DayDateTime}ngOnInit(){var e;this.setThemeStyle(),this.subscribeToEvents(),this.conversationsRequestBuilder?null===(e=this.conversationsRequestBuilder)||void 0===e||e.build():this.conversationsRequestBuilder=(new s.CometChat.ConversationsRequestBuilder).setLimit(this.limit).build(),this.state=t.States.loading,this.setConversationOptions();try{this.getConversation(),this.attachListeners(this.conversationUpdated)}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()}updateConversationObject(e){let t=this.conversationList.findIndex((t=>t.getConversationId()==e.getConversationId()));this.conversationList.splice(t,1,e),this.ref.detectChanges()}subscribeToEvents(){this.ccGroupMemberScopeChanged=e.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe((e=>{let t=this.getConversationFromGroup(e.group);t&&(t.setLastMessage(e.message),this.updateConversationObject(t))})),this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{let t=e.userAddedIn,s=e.messages,i=this.getConversationFromGroup(e.userAddedIn);null==i||i.setConversationWith(t),null==i||i.setLastMessage(s[(null==s?void 0:s.length)-1]),this.updateConversationObject(i)})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{let t=this.getConversationFromGroup(e.kickedFrom);t&&(t.setLastMessage(e.message),this.updateConversationObject(t))})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{let t=this.getConversationFromGroup(e.kickedFrom);t&&(t.setLastMessage(e.message),this.updateConversationObject(t))})),this.ccGroupDeleted=e.CometChatGroupEvents.ccGroupDeleted.subscribe((e=>{let t=this.getConversationFromGroup(e);t&&this.removeConversation(t)})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{this.updateConversation(e.message),this.ref.detectChanges()})),this.ccUserBlocked=e.CometChatUserEvents.ccUserBlocked.subscribe((e=>{let t=this.getConversationFromUser(e);t&&this.removeConversation(t)})),this.ccMessageEdit=e.CometChatMessageEvents.ccMessageEdited.subscribe((e=>{let s=e.message;e.status==t.MessageStatus.success&&this.updateEditedMessage(s)})),this.ccMessageSent=e.CometChatMessageEvents.ccMessageSent.subscribe((e=>{let s=e.message;e.status==t.MessageStatus.success&&this.updateConversation(s)})),this.ccMessageDelete=e.CometChatMessageEvents.ccMessageDeleted.subscribe((e=>{this.updateConversation(e),this.ref.detectChanges()})),this.ccMessageRead=e.CometChatMessageEvents.ccMessageRead.subscribe((e=>{s.CometChat.CometChatHelper.getConversationFromMessage(e).then((t=>{var s;t&&this.activeConversation&&(null==t?void 0:t.getConversationId())==(null===(s=this.activeConversation)||void 0===s?void 0:s.getConversationId())&&(this.updateEditedMessage(e),this.resetUnreadCount())}))}))}unsubscribeToEvents(){var e,t,s,i,o,n,r,a,l,h,c;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberKicked)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberBanned)||void 0===s||s.unsubscribe(),null===(i=this.ccMessageEdit)||void 0===i||i.unsubscribe(),null===(o=this.ccMessageSent)||void 0===o||o.unsubscribe(),null===(n=this.ccMessageEdited)||void 0===n||n.unsubscribe(),null===(r=this.ccMessageDelete)||void 0===r||r.unsubscribe(),null===(a=this.ccGroupDeleted)||void 0===a||a.unsubscribe(),null===(l=this.ccGroupLeft)||void 0===l||l.unsubscribe(),null===(h=this.ccUserBlocked)||void 0===h||h.unsubscribe(),null===(c=this.ccMessageRead)||void 0===c||c.unsubscribe()}getConversationFromUser(t){let s=this.conversationList.findIndex((s=>s.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.user&&s.getConversationWith().getUid()==t.getUid()));return s>=0?this.conversationList[s]:null}getConversationFromGroup(t){let s=this.conversationList.findIndex((s=>s.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.group&&s.getConversationWith().getGuid()==t.getGuid()));return s>=0?this.conversationList[s]:null}ngOnChanges(e){try{e.activeConversation&&this.resetUnreadCount()}catch(e){this.onError&&this.onError(e)}}ngOnDestroy(){try{this.removeListeners(),this.unsubscribeToEvents()}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()}setConversationOptions(){this.options||(this.conversationOptions=t.ConversationUtils.getDefaultOptions(),this.conversationOptions.forEach((t=>{t.onClick||t.id!=e.CometChatUIKitConstants.ConversationOptions.delete||(t.onClick=this.deleteConversationOnClick)})))}onClick(e){this.onItemClick&&this.onItemClick(e)}resetUnreadCount(){var e;if(this.activeConversation){const t=[...this.conversationList],s=t.findIndex((e=>{var t;return(null==e?void 0:e.getConversationId())===(null===(t=this.activeConversation)||void 0===t?void 0:t.getConversationId())}));if(s>-1){let i=t[s];i.setUnreadMessageCount(0),null===(e=i.getLastMessage())||void 0===e||e.setMuid(this.getUinx()),t.splice(s,1,i),this.conversationList=[...t],this.ref.detectChanges()}}}setThemeStyle(){var e,t,s;this.setAvatarStyle(),this.setBadgeStyle(),this.setConfirmDialogStyle(),this.setConversationsStyle(),this.setListItemStyle(),this.setDateStyle(),this.setStatusStyle(),this.setReceiptStyle(),this.statusColor.private=null===(e=this.conversationsStyle)||void 0===e?void 0:e.privateGroupIconBackground,this.statusColor.online=null===(t=this.conversationsStyle)||void 0===t?void 0:t.onlineStatusColor,this.statusColor.password=null===(s=this.conversationsStyle)||void 0===s?void 0:s.passwordGroupIconBackground,this.listStyle={titleTextFont:this.conversationsStyle.titleTextFont,titleTextColor:this.conversationsStyle.titleTextColor,emptyStateTextFont:this.conversationsStyle.emptyStateTextFont,emptyStateTextColor:this.conversationsStyle.emptyStateTextColor,errorStateTextFont:this.conversationsStyle.errorStateTextFont,errorStateTextColor:this.conversationsStyle.errorStateTextColor,loadingIconTint:this.conversationsStyle.loadingIconTint,separatorColor:this.conversationsStyle.separatorColor},this.iconStyle.iconTint=this.themeService.theme.palette.getAccent400()}setListItemStyle(){let t=new J.ListItemStyle({height:"100%",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:this.themeService.theme.palette.getAccent50(),borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:this.themeService.theme.palette.getAccent50()});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:`1px solid ${this.themeService.theme.palette.getAccent200()}`,backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setConversationsStyle(){let s=new t.ConversationsStyle({lastMessageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),lastMessageTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),separatorColor:this.themeService.theme.palette.getAccent400(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",typingIndictorTextColor:this.themeService.theme.palette.getPrimary(),typingIndictorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),threadIndicatorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),threadIndicatorTextColor:this.themeService.theme.palette.getAccent600()});this.conversationsStyle=Object.assign(Object.assign({},s),this.conversationsStyle)}setDateStyle(){let t=new J.DateStyle({textFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),textColor:this.themeService.theme.palette.getAccent600(),background:"transparent"});this.dateStyle=Object.assign(Object.assign({},t),this.dateStyle)}setReceiptStyle(){let e=new J.ReceiptStyle({waitIconTint:this.themeService.theme.palette.getAccent700(),sentIconTint:this.themeService.theme.palette.getAccent600(),deliveredIconTint:this.themeService.theme.palette.getAccent600(),readIconTint:this.themeService.theme.palette.getPrimary(),errorIconTint:this.themeService.theme.palette.getError()});this.receiptStyle=Object.assign(Object.assign({},e),this.receiptStyle)}setBadgeStyle(){let t=new J.BadgeStyle({textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),textColor:this.themeService.theme.palette.getAccent("dark"),background:this.themeService.theme.palette.getPrimary(),borderRadius:"16px",width:"24px"});this.badgeStyle=Object.assign(Object.assign({},t),this.badgeStyle)}setConfirmDialogStyle(){let t=new J.ConfirmDialogStyle({confirmButtonBackground:this.themeService.theme.palette.getError(),cancelButtonBackground:this.themeService.theme.palette.getSecondary(),confirmButtonTextColor:this.themeService.theme.palette.getAccent900("light"),confirmButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),cancelButtonTextColor:this.themeService.theme.palette.getAccent900("dark"),cancelButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleColor:this.themeService.theme.palette.getAccent(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),messageTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),height:"100%",width:"350px"});this.deleteConversationDialogStyle=Object.assign(Object.assign({},t),this.deleteConversationDialogStyle)}fetchNextConversation(){var e;try{return null===(e=this.conversationsRequestBuilder)||void 0===e?void 0:e.fetchNext()}catch(e){this.onError&&this.onError(e)}}updateEditedMessage(e){this.conversationList.findIndex((t=>t.getLastMessage()&&t.getLastMessage().getId()==(null==e?void 0:e.getId())))>=0&&this.conversationEditedDeleted(e)}attachListeners(t){try{this.disableUsersPresence||s.CometChat.addUserListener(this.userListenerId,new s.CometChat.UserListener({onUserOnline:s=>{t(e.CometChatUIKitConstants.userStatusType.online,s)},onUserOffline:s=>{t(e.CometChatUIKitConstants.userStatusType.offline,s)}})),s.CometChat.addGroupListener(this.groupListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,s,i,o)=>{this.updateConversation(e)},onGroupMemberKicked:(e,t,s,i)=>{this.updateConversation(e)},onGroupMemberBanned:(e,t,s,i)=>{this.updateConversation(e)},onGroupMemberUnbanned:(e,t,s,i)=>{},onMemberAddedToGroup:(e,t,s,i)=>{this.updateConversation(e)},onGroupMemberLeft:(e,t,s)=>{this.updateConversation(e)},onGroupMemberJoined:(e,t,s)=>{this.updateConversation(e)}})),s.CometChat.addMessageListener(this.conversationListenerId,new s.CometChat.MessageListener({onTextMessageReceived:s=>{t(e.CometChatUIKitConstants.messages.TEXT_MESSAGE_RECEIVED,null,s)},onMediaMessageReceived:s=>{t(e.CometChatUIKitConstants.messages.MEDIA_MESSAGE_RECEIVED,null,s)},onCustomMessageReceived:s=>{t(e.CometChatUIKitConstants.messages.CUSTOM_MESSAGE_RECEIVED,null,s)},onMessagesRead:e=>{this.disableReceipt||this.markAsRead(e)},onMessageDeleted:s=>{t(e.CometChatUIKitConstants.messages.MESSAGE_DELETED,null,s)},onMessageEdited:s=>{t(e.CometChatUIKitConstants.messages.MESSAGE_EDITED,null,s)},onMessagesDelivered:e=>{this.disableReceipt||this.updateDeliveredMessage(e)},onTypingStarted:e=>{this.disableTyping||(this.typingIndicator=e,this.ref.detectChanges())},onTypingEnded:e=>{this.typingIndicator=null,this.ref.detectChanges()}}))}catch(e){this.onError&&this.onError(e)}}removeListeners(){try{s.CometChat.removeMessageListener(this.conversationListenerId),s.CometChat.removeUserListener(this.userListenerId),s.CometChat.removeGroupListener(this.groupListenerId)}catch(e){this.onError&&this.onError(e)}}isReceiptDisable(t){var s,i;let o=t.getConversationWith(),n=t.getLastMessage();return!(this.disableReceipt||!n||(null==n?void 0:n.getCategory())==e.CometChatUIKitConstants.MessageCategory.action||(null==n?void 0:n.getCategory())==e.CometChatUIKitConstants.MessageCategory.call||this.typingIndicator&&((null==o?void 0:o.uid)==this.typingIndicator.getReceiverId()||(null==o?void 0:o.guid)==this.typingIndicator.getReceiverId())||(null===(s=n.getSender())||void 0===s?void 0:s.getUid())!=(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid()))}markAsRead(e){let t=[...this.conversationList];const s=t.findIndex((t=>t.getLastMessage().getReceiverId()==e.getSender().getUid()));if(s>-1){let i;t[s].getLastMessage().getReadAt()||(i=t[s],i.getLastMessage().setReadAt(e.getReadAt()),i.getLastMessage().setMuid(this.getUinx()),t.splice(s,1,i),this.conversationList=[...t])}}updateUser(t){try{const s=[...this.conversationList],i=s.findIndex((s=>s.getConversationType()===e.CometChatUIKitConstants.MessageReceiverType.user&&s.getConversationWith().getUid()===t.getUid()));if(i>-1){let e=s[i],o=e.getConversationWith();o.setStatus(t.getStatus());let n=e;n.setConversationWith(o),n.getLastMessage().setMuid(this.getUinx()),s.splice(i,1,n),this.conversationList=s,this.ref.detectChanges()}}catch(e){this.onError&&this.onError(e),this.ref.detectChanges()}}makeLastMessage(e,t={}){return e}updateConversation(e,t=!0){try{this.makeConversation(e).then((s=>{var i,o,n,r,a,l;const h=s.conversationKey,c=s.conversationObj,d=s.conversationList;if(h>-1){let s=(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())!=e.getSender().getUid()||(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())==e.getReceiverId()?this.makeUnreadMessageCount(c):this.makeUnreadMessageCount(c)-1,a=this.makeLastMessage(e,c),l=c;l.setLastMessage(a),l.setUnreadMessageCount(s),l.getLastMessage().setMuid(this.getUinx()),d.splice(h,1),d.unshift(l),this.conversationList=[...d],t&&(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())!=(null===(r=null==e?void 0:e.getSender())||void 0===r?void 0:r.getUid())&&(this.playAudio(),this.ref.detectChanges())}else{let s=this.makeLastMessage(e);c.setLastMessage(s),c.setUnreadMessageCount(1),d.unshift(c),this.conversationList=d,this.ref.detectChanges(),t&&(null===(a=this.loggedInUser)||void 0===a?void 0:a.getUid())!=(null===(l=null==e?void 0:e.getSender())||void 0===l?void 0:l.getUid())&&(this.playAudio(),this.ref.detectChanges())}this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e),this.ref.detectChanges()}))}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()}updateDeliveredMessage(e){let t,s=[...this.conversationList],i=s.findIndex((t=>t.getLastMessage().getId()==Number(e.getMessageId())));i>-1&&(t=s[i],t.getLastMessage().getDeliveredAt()||(t.getLastMessage().setDeliveredAt(Number(this.getUinx())),t.getLastMessage().setMuid(this.getUinx()),s.splice(i,1,t),this.conversationList=[...s],this.ref.detectChanges()))}makeUnreadMessageCount(e,t=null){if(0===Object.keys(e).length)return 1;let s=e.getUnreadMessageCount();return this.activeConversation&&this.activeConversation.getConversationId()===e.getConversationId()?s+=1:this.activeConversation&&this.activeConversation.hasOwnProperty("guid")&&e.getConversationWith().hasOwnProperty("guid")&&this.activeConversation.getConversationWith().getGuid()===e.getConversationWith().getGuid()||this.activeConversation&&this.activeConversation.hasOwnProperty("uid")&&e.getConversationWith().hasOwnProperty("uid")&&this.activeConversation.getConversationWith().getUid()===e.getConversationWith().getUid()?s=0:t&&"decrement"===t?s=s?s-1:0:s+=1,s}makeConversation(e){return new Promise(((t,i)=>{s.CometChat.CometChatHelper.getConversationFromMessage(e).then((e=>{let s=[...this.conversationList],i=s.findIndex((t=>(null==t?void 0:t.getConversationId())===e.getConversationId())),o=e;i>-1&&(o=s[i]),t({conversationKey:i,conversationObj:o,conversationList:s}),this.ref.detectChanges()})).catch((e=>i(e)))}))}conversationEditedDeleted(e){try{this.makeConversation(e).then((t=>{const s=t.conversationKey,i=t.conversationObj,o=t.conversationList;s>-1&&i.getLastMessage().getId()===e.getId()&&(i.setLastMessage(e),i.getLastMessage().setMuid(this.getUinx()),o.splice(s,1,i),this.conversationList=[...o],this.ref.detectChanges())})).catch((e=>{this.onError&&this.onError(e),this.ref.detectChanges()}))}catch(e){this.onError&&this.onError(e)}}playAudio(){try{if(this.disableSoundForMessages)return;this.customSoundForMessages?t.CometChatSoundManager.play(this.customSoundForMessages):t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.incomingMessageFromOther)}catch(e){this.onError&&this.onError(e)}}updateConversationList(e){let t=this.conversationList.findIndex((t=>(null==t?void 0:t.getConversationId())==(null==e?void 0:e.getConversationId())));this.conversationList.splice(t,1),this.ref.detectChanges()}onOptionClick(e,t){var s;let i=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.data;this.conversationToBeDeleted=t,i&&i.onClick()}getActiveConversation(e){var s;return(this.selectionMode==t.SelectionMode.none||!this.selectionMode)&&this.activeConversation&&(null===(s=this.activeConversation)||void 0===s?void 0:s.conversationId)==(null==e?void 0:e.conversationId)}deleteSelectedConversation(){if(this.conversationToBeDeleted){let t;this.activeConversation&&this.activeConversation.getConversationId()==this.conversationToBeDeleted.getConversationId()&&(this.activeConversation=null);let i=this.conversationToBeDeleted.getConversationType();t=i===e.CometChatUIKitConstants.MessageReceiverType.user?this.conversationToBeDeleted.getConversationWith().getUid():this.conversationToBeDeleted.getConversationWith().getGuid(),s.CometChat.deleteConversation(t,i).then((t=>{e.CometChatConversationEvents.ccConversationDeleted.next(this.conversationToBeDeleted),this.updateConversationList(this.conversationToBeDeleted),this.conversationToBeDeleted=null,this.ref.detectChanges()})),this.isDialogOpen=!1,this.ref.detectChanges()}}updateLastMessage(e){this.updateConversation(e)}removeConversation(e){this.updateConversationList(e)}};L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"searchPlaceHolder",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"disableReceipt",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"disableTyping",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"deliveredIcon",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"readIcon",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"errorIcon",void 0),L([(0,K.Input)(),G("design:type",Number)],fa.prototype,"datePattern",void 0),L([(0,K.Input)(),G("design:type",Function)],fa.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"sentIcon",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"privateGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"protectedGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"customSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"activeConversation",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"conversationsRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",Function)],fa.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],fa.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],fa.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",Number)],fa.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",Boolean)],fa.prototype,"disableSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"confirmDialogTitle",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"confirmButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"cancelButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"confirmDialogMessage",void 0),L([(0,K.Input)(),G("design:type",Function)],fa.prototype,"onItemClick",void 0),L([(0,K.Input)(),G("design:type",J.ConfirmDialogStyle)],fa.prototype,"deleteConversationDialogStyle",void 0),L([(0,K.Input)(),G("design:type",t.BaseStyle)],fa.prototype,"backdropStyle",void 0),L([(0,K.Input)(),G("design:type",J.BadgeStyle)],fa.prototype,"badgeStyle",void 0),L([(0,K.Input)(),G("design:type",J.DateStyle)],fa.prototype,"dateStyle",void 0),L([(0,K.Input)(),G("design:type",t.ConversationsStyle)],fa.prototype,"conversationsStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],fa.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"typingIndicatorText",void 0),L([(0,K.Input)(),G("design:type",String)],fa.prototype,"threadIndicatorText",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],fa.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",J.ReceiptStyle)],fa.prototype,"receiptStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],fa.prototype,"loggedInUser",void 0),fa=L([(0,K.Component)({selector:"cometchat-conversations",templateUrl:"./cometchat-conversations.component.html",styleUrls:["./cometchat-conversations.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.NgZone,K.ChangeDetectorRef,q])],fa);let Ia=class{};Ia=L([(0,K.NgModule)({declarations:[fa],imports:[W.CommonModule,Mi],exports:[fa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ia);let Ta=class{constructor(t,s){this.ref=t,this.themeService=s,this.disableSoundForMessages=!1,this.customSoundForMessage="",this.disableTypingEvents=!1,this.text="",this.placeholderText=(0,e.localize)("SEND_MESSAGE"),this.attachmentIconURL="assets/Plus.svg",this.auxiliaryButtonsAlignment=e.AuxiliaryButtonAlignment.right,this.parentMessageId=0,this.hideLiveReaction=!1,this.LiveReactionIconURL="assets/heart-reaction.png",this.messageComposerStyle={height:"100%",width:"100%",borderRadius:"12px",maxInputHeight:"100px"},this.onError=e=>{console.log(e)},this.backdropStyle={height:"100%",width:"100%",background:"rgba(0, 0, 0, 0.5)"},this.composerActions=[],this.showCreatePolls=!1,this.showStickerKeyboard=!1,this.showActionSheetItem=!1,this.showPreview=!1,this.acceptHandlers={"image/*":this.onImageChange.bind(this),"video/*":this.onVideoChange.bind(this),"audio/*":this.onAudioChange.bind(this),"file/*":this.onFileChange.bind(this)},this.enableStickerKeyboard=!1,this.stickerConfiguration={},this.closeIconURL="assets/plus-rotated.svg",this.sendButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:"rgba(20, 20, 20, 0.58)",background:"transparent"},this.liveReactionStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:"red",background:"transparent",display:"flex",justifyContent:"center",alignItems:"center"},this.localize=e.localize,this.emojiButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:"grey",background:"transparent"},this.emojiKeyboardStyle={width:"100%",height:"100%",border:"none",textFont:"500 12px Inter, sans-serif",textColor:"",background:"",borderRadius:"12px"},this.stickerKeyboardStyle={},this.messageInputStyle={},this.previewStyle={height:"100%",width:"100%"},this.createPollStyle={},this.emojiPopover={width:"315px",height:"320px",border:"none",background:"transparent",borderRadius:"8px",boxShadow:"0px 0px 32px rgba(20, 20, 20, 0.2)"},this.stickerPopover={width:"100%",height:"100%",border:"none",background:"transparent",borderRadius:"8px",boxShadow:"0px 0px 32px rgba(20, 20, 20, 0.2)"},this.popoverStyle={width:"275px",height:"280px",border:"none",background:"transparent",borderRadius:"8px",boxShadow:"0px 0px 32px rgba(20, 20, 20, 0.2)"},this.sendButtonIconURL="assets/Send.svg",this.emojiButtonIconURL="assets/Stipop.svg",this.stickerButtonIconURL="assets/Stickers.svg",this.actionsheetStyle={layoutModeIconTint:"rgba(20, 20, 20, 0.04)",borderRadius:"inherit",background:"rgb(255,255,255)",border:"none",width:"100%",height:"100%",titleFont:"500 15px Inter, sans-serif",titleColor:"#141414",listItemBackground:"",ActionSheetSeparatorTint:"1px solid RGBA(20, 20, 20, 0.08)"},this.messageText="",this.attachmentButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:"grey",background:"transparent"},this.auxilaryPlacement=e.Placement.top,this.messageSending=!1,this.showSendButton=!1,this.showEmojiKeyboard=!1,this.sendMessageOnEnter=e=>{var t,s;this.showSendButton=!1,this.sendTextMessage(e.detail.value),null===(s=null===(t=this.inputRef)||void 0===t?void 0:t.nativeElement)||void 0===s||s.emptyInputField()},this.messageInputChanged=e=>{var t,s;const i=null===(s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.value)||void 0===s?void 0:s.trim();this.sendButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:i?this.messageComposerStyle.sendIconTint:this.themeService.theme.palette.getAccent600(),background:"transparent"},this.showSendButton=!0,this.onTextChange&&this.onTextChange(i),this.messageText=i,i?this.startTyping():this.endTyping()},this.appendEmoji=e=>{this.text===(null==e?void 0:e.detail.id)&&(this.text="",this.ref.detectChanges()),this.text=null==e?void 0:e.detail.id,this.ref.detectChanges()},this.openCreatePolls=()=>{this.showCreatePolls=!0,this.showActionSheetItem&&(this.actionSheetRef.nativeElement.click(),this.showActionSheetItem=!this.showActionSheetItem),this.ref.detectChanges()},this.closeCreatePolls=()=>{this.showCreatePolls=!1,this.ref.detectChanges()},this.handleActions=e=>{var t;let s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.action;s.onClick&&s.onClick()},this.inputChangeHandler=e=>{(this.acceptHandlers[this.inputElementRef.nativeElement.accept]||this.onFileChange.bind(this))(e)},this.sendSticker=e=>{var t,s,i,o,n,r;let a=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.stickerURL,l=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.stickerName;(null===(o=null===(i=this.stickerConfiguration)||void 0===i?void 0:i.configuration)||void 0===o?void 0:o.ccStickerClicked)&&(null===(r=null===(n=this.stickerConfiguration)||void 0===n?void 0:n.configuration)||void 0===r||r.ccStickerClicked({name:l,url:a},this.loggedInUser,this.user,this.group,this.parentMessageId,this.onError,this.customSoundForMessage,this.disableSoundForMessages))},this.openImagePicker=()=>{this.inputElementRef.nativeElement.type="file",this.inputElementRef.nativeElement.accept="image/*",this.inputElementRef.nativeElement.click(),this.closePopovers()},this.openFilePicker=()=>{this.inputElementRef.nativeElement.type="file",this.inputElementRef.nativeElement.accept="file/*",this.inputElementRef.nativeElement.click(),this.closePopovers()},this.openvideoPicker=()=>{this.inputElementRef.nativeElement.type="file",this.inputElementRef.nativeElement.accept="video/*",this.inputElementRef.nativeElement.click(),this.closePopovers()},this.openAudioPicker=()=>{this.inputElementRef.nativeElement.type="file",this.inputElementRef.nativeElement.accept="audio/*",this.inputElementRef.nativeElement.click(),this.closePopovers()},this.openActionSheet=e=>{this.showActionSheetItem=!this.showActionSheetItem,this.showEmojiKeyboard&&(this.emojiButtonRef.nativeElement.click(),this.showEmojiKeyboard=!this.showEmojiKeyboard),this.showStickerKeyboard&&(this.stickerButtonRef.nativeElement.click(),this.showStickerKeyboard=!this.showStickerKeyboard,this.ref.detectChanges())},this.openEmojiKeyboard=e=>{this.showEmojiKeyboard=!this.showEmojiKeyboard,this.showActionSheetItem&&(this.actionSheetRef.nativeElement.click(),this.showActionSheetItem=!this.showActionSheetItem),this.showStickerKeyboard&&(this.stickerButtonRef.nativeElement.click(),this.showStickerKeyboard=!this.showStickerKeyboard,this.ref.detectChanges())},this.openStickerKeyboard=e=>{if(this.enableStickerKeyboard){if(this.showStickerKeyboard=!this.showStickerKeyboard,this.ref.detectChanges(),this.ref.detectChanges(),this.showActionSheetItem&&(this.actionSheetRef.nativeElement.click(),this.showActionSheetItem=!this.showActionSheetItem),!this.showEmojiKeyboard)return;this.emojiButtonRef.nativeElement.click(),this.showEmojiKeyboard=!this.showEmojiKeyboard}}}sendReaction(){var t,i;let o=this.user?null===(t=this.user)||void 0===t?void 0:t.getUid():null===(i=this.group)||void 0===i?void 0:i.getGuid(),n=this.user?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group,r={LIVE_REACTION:this.LiveReactionIconURL},a=new s.CometChat.TransientMessage(o,n,r);s.CometChat.sendTransientMessage(a),e.CometChatMessageEvents.ccLiveReaction.next(this.LiveReactionIconURL)}addAttachmentCallback(){var t;null===(t=this.composerActions)||void 0===t||t.forEach((t=>{switch(t.id){case e.CometChatUIKitConstants.MessageTypes.audio:t.onClick=this.openAudioPicker;break;case e.CometChatUIKitConstants.MessageTypes.video:t.onClick=this.openvideoPicker;break;case e.CometChatUIKitConstants.MessageTypes.file:t.onClick=this.openFilePicker;break;case e.CometChatUIKitConstants.MessageTypes.image:t.onClick=this.openImagePicker;break;case"extension_poll":t.onClick=this.openCreatePolls}}))}subscribeToEvents(){this.ccMessageEdit=e.CometChatMessageEvents.ccMessageEdited.subscribe((t=>{(null==t?void 0:t.status)==e.MessageStatus.inprogress&&(this.messageToBeEdited=t.message,this.openEditPreview())}))}openEditPreview(){this.showPreview=!0,this.text=this.messageToBeEdited.getText(),this.ref.detectChanges()}unsubscribeToEvents(){var e;null===(e=this.ccMessageEdit)||void 0===e||e.unsubscribe()}ngOnChanges(e){}customSendMethod(e){this.showSendButton=!1,this.sendTextMessage(e),this.showSendButton=!1,this.ref.detectChanges()}sendTextMessage(i=""){var o,n,r,a,l;this.endTyping();try{if(0==(null===(n=null===(o=this.messageText)||void 0===o?void 0:o.trim())||void 0===n?void 0:n.length)&&0==(null===(r=null==i?void 0:i.trim())||void 0===r?void 0:r.length))return!1;if(this.messageSending)return!1;if(this.messageSending=!0,this.messageToBeEdited)return this.editMessage(),this.ref.detectChanges(),!1;let h,{receiverId:c,receiverType:d}=this.getReceiverDetails();h=null!==i?i.trim():this.messageText.trim();let u=new s.CometChat.TextMessage(c,h,d);this.parentMessageId&&u.setParentMessageId(this.parentMessageId),u.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),u.setMuid(t.CometChatUIKitUtility.ID()),this.disableSoundForMessages||this.playAudio(),this.messageText="",null===(l=null===(a=this.inputRef)||void 0===a?void 0:a.nativeElement)||void 0===l||l.emptyInputField(),this.text="",this.messageSending=!1,this.closePopovers(),this.onSendButtonClick?this.onSendButtonClick(u):(e.CometChatMessageEvents.ccMessageSent.next({message:u,status:e.MessageStatus.inprogress}),s.CometChat.sendMessage(u).then((t=>{let s=t;e.CometChatMessageEvents.ccMessageSent.next({message:s,status:e.MessageStatus.success}),setTimeout((()=>{this.showSendButton=!1,this.ref.detectChanges()}),500)})).catch((t=>{u.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:u,status:e.MessageStatus.error})})))}catch(e){this.onError(e)}return!0}editMessage(){var t,i;try{const o=this.messageToBeEdited;let{receiverId:n,receiverType:r}=this.getReceiverDetails(),a=this.messageText.trim(),l=new s.CometChat.TextMessage(n,a,r);l.setId(o.id),this.closePreview(),this.endTyping(),null===(i=null===(t=this.inputRef)||void 0===t?void 0:t.nativeElement)||void 0===i||i.emptyInputField(),s.CometChat.editMessage(l).then((t=>{this.messageSending=!1,e.CometChatMessageEvents.ccMessageEdited.next({message:t,status:e.MessageStatus.success})})).catch((e=>{this.messageSending=!1,this.onError&&this.onError(e)}))}catch(e){this.onError(e)}}getReceiverDetails(){let t,s;return this.user&&this.user.getUid()?(t=this.user.getUid(),s=e.CometChatUIKitConstants.MessageReceiverType.user):this.group&&this.group.getGuid()&&(t=this.group.getGuid(),s=e.CometChatUIKitConstants.MessageReceiverType.group),{receiverId:t,receiverType:s}}playAudio(){this.customSoundForMessage?t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.outgoingMessage,this.customSoundForMessage):t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.outgoingMessage)}startTyping(e=null,t=""){if(!this.disableTypingEvents)try{let i=e||5e3,{receiverId:o,receiverType:n}=this.getReceiverDetails(),r=t||void 0,a=new s.CometChat.TypingIndicator(o,n,r);s.CometChat.startTyping(a),this.storeTypingInterval=setTimeout((()=>{this.endTyping()}),i)}catch(e){this.onError(e)}}endTyping(e=null){if(!this.disableTypingEvents)try{let{receiverId:t,receiverType:i}=this.getReceiverDetails(),o=e||void 0,n=new s.CometChat.TypingIndicator(t,i,o);s.CometChat.endTyping(n),clearTimeout(this.storeTypingInterval),this.storeTypingInterval=null}catch(e){this.onError(e)}}sendMediaMessage(i,o){try{if(this.messageSending)return!1;this.messageSending=!0;const{receiverId:n,receiverType:r}=this.getReceiverDetails();let a=new s.CometChat.MediaMessage(n,i,o,r);this.parentMessageId&&a.setParentMessageId(this.parentMessageId),a.setType(o),a.setMetadata({file:i}),a.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),a.setMuid(t.CometChatUIKitUtility.ID()),this.disableSoundForMessages||this.playAudio(),this.messageSending=!1,this.closePopovers(),this.onSendButtonClick?this.onSendButtonClick(a):(e.CometChatMessageEvents.ccMessageSent.next({message:a,status:e.MessageStatus.inprogress}),s.CometChat.sendMessage(a).then((t=>{this.messageSending=!1,t.setMuid(a.getMuid()),e.CometChatMessageEvents.ccMessageSent.next({message:t,status:e.MessageStatus.success})})).catch((t=>{a.setMetadata({error:!0}),e.CometChatMessageEvents.ccMessageSent.next({message:a,status:e.MessageStatus.error}),this.messageSending=!1})))}catch(e){this.onError(e)}return!0}onVideoChange(e){try{if(!e.target.files[0])return!1;const t=e.target.files[0],i=new FileReader;i.addEventListener("load",(()=>{const e=new File([i.result],t.name,t);this.sendMediaMessage(e,s.CometChat.MESSAGE_TYPE.VIDEO)}),!1),i.readAsArrayBuffer(t)}catch(e){this.onError(e)}return!0}onAudioChange(e){try{if(!e.target.files[0])return!1;const t=e.target.files[0],i=new FileReader;i.addEventListener("load",(()=>{const e=new File([i.result],t.name,t);this.sendMediaMessage(e,s.CometChat.MESSAGE_TYPE.AUDIO)}),!1),i.readAsArrayBuffer(t)}catch(e){this.onError(e)}return!0}onImageChange(e){try{if(!e.target.files[0])return!1;const t=e.target.files[0],i=new FileReader;i.addEventListener("load",(()=>{const e=new File([i.result],t.name,t);this.sendMediaMessage(e,s.CometChat.MESSAGE_TYPE.IMAGE)}),!1),i.readAsArrayBuffer(t)}catch(e){this.onError(e)}return!0}onFileChange(e){try{if(!e.target.files[0])return!1;const i=e.target.files[0];var t=new FileReader;t.addEventListener("load",(()=>{const e=new File([t.result],i.name,i);this.sendMediaMessage(e,s.CometChat.MESSAGE_TYPE.FILE)}),!1),t.readAsArrayBuffer(i)}catch(e){this.onError(e)}return!0}closePopovers(){this.showEmojiKeyboard&&(this.emojiButtonRef.nativeElement.click(),this.showEmojiKeyboard=!this.showEmojiKeyboard),this.showActionSheetItem&&(this.actionSheetRef.nativeElement.click(),this.showActionSheetItem=!this.showActionSheetItem)}getComposerId(){const e=this.user;if(void 0!==e)return{user:null==e?void 0:e.getUid(),group:null,parentMessageId:this.parentMessageId};const t=this.group;return void 0!==t?{user:null,group:null==t?void 0:t.getGuid(),parentMessageId:this.parentMessageId}:{user:null,group:null,parentMessageId:this.parentMessageId}}ngOnInit(){var e,i,n;s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.composerId=this.getComposerId(),this.setTheme(),this.subscribeToEvents(),this.attachmentOptions?this.composerActions=this.attachmentOptions(this.user||this.group,this.composerId):(this.composerActions=null===(e=o.getDataSource())||void 0===e?void 0:e.getAttachmentOptions(this.themeService.theme,this.user,this.group,this.composerId),this.addAttachmentCallback()),this.enableStickerKeyboard=!0,this.stickerConfiguration=null===(i=o.getDataSource())||void 0===i?void 0:i.getAuxiliaryOptions(this.composerId,this.user,this.group),(null===(n=this.stickerConfiguration)||void 0===n?void 0:n.id)==t.StickersConstants.sticker?this.enableStickerKeyboard=!0:this.enableStickerKeyboard=!1}setTheme(){this.setComposerStyle(),this.actionsheetStyle={layoutModeIconTint:this.messageComposerStyle.ActionSheetLayoutModeIconTint||this.themeService.theme.palette.getAccent(),borderRadius:"inherit",background:this.themeService.theme.palette.getBackground(),border:"none",width:"100%",height:"100%",titleFont:this.messageComposerStyle.ActionSheetTitleFont||(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.messageComposerStyle.ActionSheetTitleColor||this.themeService.theme.palette.getAccent(),ActionSheetSeparatorTint:this.messageComposerStyle.ActionSheetSeparatorTint||`1px solid ${this.themeService.theme.palette.getAccent400()}`},this.messageInputStyle={height:"100%",width:"100%",maxHeight:this.messageComposerStyle.maxInputHeight||"100px",border:this.messageComposerStyle.border,borderRadius:"",background:this.messageComposerStyle.background,textFont:this.messageComposerStyle.textFont,textColor:this.messageComposerStyle.textColor,dividerColor:this.messageComposerStyle.dividerTint,inputBorder:this.messageComposerStyle.inputBorder,inputBorderRadius:"0",inputBackground:this.messageComposerStyle.inputBackground},this.sendButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:this.themeService.theme.palette.getAccent200(),background:"transparent"},this.previewStyle={height:"100%",width:"100%",border:`1px solid ${this.themeService.theme.palette.getAccent200()}`,background:this.themeService.theme.palette.getBackground(),previewTitleFont:this.messageComposerStyle.previewTitleFont||(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),previewTitleColor:this.messageComposerStyle.previewTitleColor||this.themeService.theme.palette.getAccent400(),previewSubtitleColor:this.messageComposerStyle.previewSubtitleColor||this.themeService.theme.palette.getAccent400(),previewSubtitleFont:this.messageComposerStyle.previewSubtitleFont||(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),closeButtonIconTint:this.messageComposerStyle.closePreviewTint||this.themeService.theme.palette.getAccent600()},this.emojiButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:this.messageComposerStyle.emojiIconTint||this.themeService.theme.palette.getAccent600(),background:"transparent"},this.emojiKeyboardStyle={width:"100%",height:"100%",border:"none",textFont:this.messageComposerStyle.emojiKeyboardTextFont,textColor:this.messageComposerStyle.emojiKeyboardTextColor,background:this.themeService.theme.palette.getBackground(),borderRadius:"12px"},this.stickerKeyboardStyle={width:"100%",height:"100%",border:"none",emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),borderRadius:"12px"},this.attachmentButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:this.messageComposerStyle.attachIcontint||this.themeService.theme.palette.getAccent600(),background:"transparent"},this.createPollStyle={placeholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),placeholderTextColor:this.themeService.theme.palette.getAccent600(),deleteIconTint:this.themeService.theme.palette.getAccent600(),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleColor:this.themeService.theme.palette.getAccent(),closeIconTint:this.themeService.theme.palette.getPrimary(),questionInputBackground:this.themeService.theme.palette.getAccent100(),optionInputBackground:this.themeService.theme.palette.getAccent100(),answerHelpTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),answerHelpTextColor:this.themeService.theme.palette.getAccent400(),addAnswerIconTint:this.themeService.theme.palette.getPrimary(),createPollButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),createPollButtonTextColor:this.themeService.theme.palette.getAccent("dark"),createPollButtonBackground:this.themeService.theme.palette.getPrimary(),addAnswerTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),addAnswerTextColor:this.themeService.theme.palette.getPrimary(),errorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),errorTextColor:this.themeService.theme.palette.getError(),optionPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),optionPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),questionInputTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),questionInputTextColor:this.themeService.theme.palette.getAccent600(),optionInputTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),optionInputTextColor:this.themeService.theme.palette.getAccent600(),width:"360px",height:"620px",border:"",borderRadius:"8px",background:this.themeService.theme.palette.getAccent900()}}setComposerStyle(){let s=new t.MessageComposerStyle({background:this.themeService.theme.palette.getAccent100(),border:"none",height:"100%",width:"100%",borderRadius:"12px",attachIcontint:this.themeService.theme.palette.getAccent500(),sendIconTint:"#2fb5e9d1",emojiIconTint:this.themeService.theme.palette.getAccent500(),inputBackground:"transparent",inputBorder:"none",dividerTint:this.themeService.theme.palette.getAccent200(),textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent(),ActionSheetSeparatorTint:this.themeService.theme.palette.getAccent200(),ActionSheetTitleColor:this.themeService.theme.palette.getAccent(),ActionSheetTitleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),ActionSheetLayoutModeIconTint:this.themeService.theme.palette.getPrimary(),emojiKeyboardTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),emojiKeyboardTextColor:this.themeService.theme.palette.getAccent400(),previewTitleFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),previewTitleColor:this.themeService.theme.palette.getAccent(),previewSubtitleFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),previewSubtitleColor:this.themeService.theme.palette.getAccent600(),closePreviewTint:this.themeService.theme.palette.getAccent500(),maxInputHeight:"100px"});this.messageComposerStyle=Object.assign(Object.assign({},s),this.messageComposerStyle)}closePreview(){var e,t;this.showPreview=!1,null===(t=null===(e=this.inputRef)||void 0===e?void 0:e.nativeElement)||void 0===t||t.emptyInputField()}};L([(0,K.ViewChild)("inputElement",{static:!1}),G("design:type",K.ElementRef)],Ta.prototype,"inputElementRef",void 0),L([(0,K.ViewChild)("inputRef",{static:!1}),G("design:type",K.ElementRef)],Ta.prototype,"inputRef",void 0),L([(0,K.ViewChild)("emojiButtonRef",{static:!1}),G("design:type",K.ElementRef)],Ta.prototype,"emojiButtonRef",void 0),L([(0,K.ViewChild)("actionSheetRef",{static:!1}),G("design:type",K.ElementRef)],Ta.prototype,"actionSheetRef",void 0),L([(0,K.ViewChild)("stickerButtonRef",{static:!1}),G("design:type",K.ElementRef)],Ta.prototype,"stickerButtonRef",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],Ta.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Ta.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ta.prototype,"disableSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",String)],Ta.prototype,"customSoundForMessage",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ta.prototype,"disableTypingEvents",void 0),L([(0,K.Input)(),G("design:type",String)],Ta.prototype,"text",void 0),L([(0,K.Input)(),G("design:type",String)],Ta.prototype,"placeholderText",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ta.prototype,"headerView",void 0),L([(0,K.Input)(),G("design:type",Function)],Ta.prototype,"onTextChange",void 0),L([(0,K.Input)(),G("design:type",String)],Ta.prototype,"attachmentIconURL",void 0),L([(0,K.Input)(),G("design:type",Object)],Ta.prototype,"attachmentOptions",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ta.prototype,"secondaryButtonView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ta.prototype,"auxilaryButtonView",void 0),L([(0,K.Input)(),G("design:type",Number)],Ta.prototype,"auxiliaryButtonsAlignment",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ta.prototype,"sendButtonView",void 0),L([(0,K.Input)(),G("design:type",Number)],Ta.prototype,"parentMessageId",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ta.prototype,"hideLiveReaction",void 0),L([(0,K.Input)(),G("design:type",String)],Ta.prototype,"LiveReactionIconURL",void 0),L([(0,K.Input)(),G("design:type",t.MessageComposerStyle)],Ta.prototype,"messageComposerStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],Ta.prototype,"onSendButtonClick",void 0),L([(0,K.Input)(),G("design:type",Function)],Ta.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",t.BaseStyle)],Ta.prototype,"backdropStyle",void 0),Ta=L([(0,K.Component)({selector:"cometchat-message-composer",templateUrl:"./cometchat-message-composer.component.html",styleUrls:["./cometchat-message-composer.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Ta);let Ma=class{constructor(i,o,n){this.ngZone=i,this.ref=o,this.themeService=n,this.hideError=!1,this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.emptyStateText=(0,e.localize)("NO_MESSAGES_FOUND"),this.loadingIconURL="assets/Spinner.svg",this.disableReceipt=!0,this.disableSoundForMessages=!1,this.customSoundForMessages="",this.readIcon="assets/message-read.svg",this.deliveredIcon="assets/message-delivered.svg",this.sentIcon="assets/message-sent.svg",this.waitIcon="assets/wait.svg",this.errorIcon="assets/warning-small.svg",this.alignment=e.MessageListAlignment.standard,this.showAvatar=!0,this.datePattern=e.DatePatterns.time,this.timestampAlignment=e.TimestampAlignment.bottom,this.DateSeparatorPattern=e.DatePatterns.DayDateTime,this.templates=[],this.newMessageIndicatorText="",this.scrollToBottomOnNewMessages=!1,this.thresholdValue=1e3,this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px"},this.backdropStyle={height:"100%",width:"100%",background:"rgba(0, 0, 0, 0.5)"},this.dateSeparatorStyle={height:"",width:""},this.messageListStyle={nameTextFont:"600 15px Inter",nameTextColor:"white",TimestampTextFont:"",TimestampTextColor:"",threadReplySeparatorColor:"",threadReplyTextFont:"",threadReplyIconTint:"",threadReplyTextColor:"",emptyStateTextFont:"700 22px Inter",emptyStateTextColor:"#bcbcbc",errorStateTextFont:"700 22px Inter",errorStateTextColor:"#bcbcbc",loadingIconTint:"grey"},this.onError=e=>{console.log(e)},this.state=e.States.loading,this.optionsStyle={width:"",height:"",border:"1px solid #e8e8e8",borderRadius:"8px",background:"white",submenuWidth:"100%",submenuHeight:"100%",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:"white",moreIconTint:"grey"},this.receiptStyle={},this.documentBubbleAlignment=e.DocumentIconAlignment.right,this.callBubbleAlignment=e.DocumentIconAlignment.left,this.imageModerationStyle={},this.timestampEnum=e.TimestampAlignment,this.chatChanged=!0,this.timer=null,this.timeStampColor="",this.timeStampFont="",this.smartReplyStyle={width:"100%",height:"100%",border:"none"},this.showSmartReply=!1,this.smartReplyMessage=null,this.enableSmartReply=!1,this.timeStampBackground="",this.linkPreviewStyle={},this.unreadMessagesStyle={height:"100%",width:"100%",background:"#3399FF",display:"flex",justifyContent:"center",buttonTextFont:"400 13px Inter",color:"white",border:"none",borderRadius:"12px"},this.dividerStyle={height:"1px",width:"100%",background:"grey"},this.pollBubbleStyle={},this.labelStyle={textFont:"400 11px Inter",textColor:"grey"},this.imageBubbleStyle={height:"128px",width:"128px",border:"none",borderRadius:"0",background:"transparent"},this.messagesList=[],this.bubbleDateStyle={},this.whiteboardIconURL="assets/collaborativewhiteboard.svg",this.documentIconURL="assets/collaborativedocument.svg",this.directCallIconURL="assets/Video-call2x.svg",this.placeholderIconURL="/assets/placeholder.png",this.downloadIconURL="assets/download.svg",this.translationStyle={},this.documentBubbleStyle={},this.callBubbleStyle={},this.whiteboardTitle=(0,e.localize)("COLLABORATIVE_WHITEBOARD"),this.whiteboardSubitle=(0,e.localize)("DRAW_WHITEBOARD_TOGETHER"),this.whiteboardButtonText=(0,e.localize)("OPEN_WHITEBOARD"),this.documentTitle=(0,e.localize)("COLLABORATIVE_DOCUMENT"),this.documentSubitle=(0,e.localize)("DRAW_DOCUMENT_TOGETHER"),this.documentButtonText=(0,e.localize)("OPEN_DOCUMENT"),this.joinCallButtonText=(0,e.localize)("JOIN"),this.localize=e.localize,this.reinitialized=!1,this.MessageTypesConstant=e.CometChatUIKitConstants.MessageTypes,this.callConstant=e.CometChatUIKitConstants.MessageCategory.call,this.typesMap={},this.messageTypesMap={},this.theme=new e.CometChatTheme({}),this.msgListenerId="message_"+(new Date).getTime(),this.groupListenerId="group_"+(new Date).getTime(),this.callListenerId="call_"+(new Date).getTime(),this.states=e.States,this.MessageCategory=e.CometChatUIKitConstants.MessageCategory,this.numberOfTopScroll=0,this.keepRecentMessages=!0,this.messageTemplate=[],this.isOnBottom=!1,this.UnreadCount=[],this.newMessageCount=0,this.type="",this.confirmText=(0,e.localize)("YES"),this.cancelText=(0,e.localize)("NO"),this.warningText="Are you sure want to see unsafe content?",this.threadedAlignment=e.MessageBubbleAlignment.left,this.openEmojiKeyboard=!1,this.keyboardAlignment=e.Placement.right,this.popoverStyle={height:"330px",width:"325px"},this.videoBubbleStyle={height:"130px",width:"230px",border:"none",borderRadius:"8px",background:"transparent"},this.threadViewAlignment=e.MessageBubbleAlignment.left,this.enableDataMasking=!1,this.enableThumbnailGeneration=!1,this.enableLinkPreview=!1,this.enablePolls=!1,this.enableReactions=!1,this.enableImageModeration=!1,this.enableStickers=!1,this.enableWhiteboard=!1,this.enableDocument=!1,this.showOngoingCall=!1,this.enableCalling=!1,this.ongoingCallStyle={},this.sessionId="",this.closeIconURL="assets/close2x.svg",this.threadOpenIcon="assets/side-arrow.svg",this.confirmDialogStyle={},this.messageToReact=null,this.limit=30,this.types=[],this.categories=[],this.addReaction=e=>{var t;let s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id;this.popoverRef.nativeElement.openContentView(e),this.reactToMessages(s)},this.getCallActionMessage=e=>t.CallingDetailsUtils.getCallStatus(e,this.loggedInUser),this.showEmojiKeyboard=(t,s)=>{var i,o;let n=this.getMessageById(t);n&&(this.messageToReact=n,this.keyboardAlignment=(null===(i=n.getSender())||void 0===i?void 0:i.getUid())==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())?e.Placement.left:e.Placement.right,this.ref.detectChanges(),this.popoverRef.nativeElement.openContentView(s))},this.setBubbleView=()=>{this.messageTemplate.forEach((e=>{this.messageTypesMap[e.type]=e}))},this.openThreadView=e=>{this.onThreadRepliesClick&&this.onThreadRepliesClick(e,this.threadMessageBubble)},this.threadCallback=e=>{let t=this.getMessageById(e);this.openThreadView(t)},this.deleteCallback=e=>{let t=this.getMessageById(e);this.deleteMessage(t)},this.editCallback=e=>{let t=this.getMessageById(e);this.onEditMessage(t)},this.copyCallback=e=>{let t=this.getMessageById(e);this.onCopyMessage(t)},this.updateTranslatedMessage=e=>{const s=e,i=s.translations[0].message_translated;let o,n=[...this.messagesList],r=n.findIndex((e=>e.getId()===s.msgId));if(r>-1){const e=n[r];e.getMetadata()||e.setMetadata({}),o=e.getMetadata(),o[t.MessageTranslationConstants.translated_message]=i;const s=e;n.splice(r,1,s),this.messagesList=[...n],this.ref.detectChanges()}},this.translateMessage=e=>{let i=this.getMessageById(e);i&&s.CometChat.callExtension(t.MessageTranslationConstants.message_translation,t.MessageTranslationConstants.post,t.MessageTranslationConstants.v2_translate,{msgId:i.getId(),text:i.getText(),languages:navigator.languages}).then((e=>{var t;(null===(t=null==e?void 0:e.translations[0])||void 0===t?void 0:t.message_translated)!=(null==i?void 0:i.getText())&&(this.updateTranslatedMessage(e),this.ref.detectChanges())})).catch((e=>{}))},this.getContentView=e=>{var t,s;return this.messageTypesMap[null==e?void 0:e.getType()]&&(null===(t=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===t?void 0:t.contentView)?null===(s=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===s?void 0:s.contentView(e):e.getDeletedAt()?this.typesMap.text:this.typesMap[null==e?void 0:e.getType()]},this.setBubbleAlignment=t=>{let s=e.MessageBubbleAlignment.center;return s=this.alignment==e.MessageListAlignment.left?e.MessageBubbleAlignment.left:(null==t?void 0:t.getType())==e.CometChatUIKitConstants.MessageTypes.groupMember||t.getCategory()==this.callConstant?e.MessageBubbleAlignment.center:!(null==t?void 0:t.getSender())||(null==t?void 0:t.getSender().getUid())==this.loggedInUser.getUid()&&(null==t?void 0:t.getType())!=e.CometChatUIKitConstants.MessageTypes.groupMember?e.MessageBubbleAlignment.right:e.MessageBubbleAlignment.left,s},this.getBubbleWrapper=e=>{let t;return this.messageTypesMap&&this.messageTypesMap[null==e?void 0:e.getType()]&&this.messageTypesMap[null==e?void 0:e.getType()].bubbleView?(t=this.messageTypesMap[null==e?void 0:e.getType()].bubbleView(e),t):(t=null,t)},this.setTranslationStyle=s=>{const i=this.alignment!==e.MessageListAlignment.left,o=!(null==s?void 0:s.getSender())||this.loggedInUser.getUid()===(null==s?void 0:s.getSender().getUid());return i&&o?new t.MessageTranslationStyle({translatedTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),translatedTextColor:this.themeService.theme.palette.getAccent("dark"),helpTextColor:this.themeService.theme.palette.getAccent700("dark"),helpTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),background:"transparent"}):new t.MessageTranslationStyle({translatedTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),translatedTextColor:this.themeService.theme.palette.getAccent("light"),helpTextColor:this.themeService.theme.palette.getAccent700(),helpTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),background:"transparent"})},this.setTextBubbleStyle=t=>{const s=t.getDeletedAt(),i=this.alignment!==e.MessageListAlignment.left,o=t.getCategory()===e.CometChatUIKitConstants.MessageCategory.message&&(null==t?void 0:t.getType())===e.CometChatUIKitConstants.MessageTypes.text,n=!(null==t?void 0:t.getSender())||this.loggedInUser.getUid()===(null==t?void 0:t.getSender().getUid()),r=(null==t?void 0:t.getType())===e.CometChatUIKitConstants.MessageTypes.groupMember;return this.getLinkPreview(t)?{textFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),textColor:this.themeService.theme.palette.getAccent()}:!s&&i&&o&&n?{textFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),textColor:this.themeService.theme.palette.getAccent900("light")}:s||!i||!o||n||r?r?{textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),textColor:this.themeService.theme.palette.getAccent600()}:{textFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),textColor:this.themeService.theme.palette.getAccent400()}:{textFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),textColor:this.themeService.theme.palette.getAccent()}},this.startDirectCall=e=>{this.sessionId=e,this.showOngoingCall=!0,this.ref.detectChanges()},this.launchCollaborativeWhiteboardDocument=e=>{window.open(e,"","fullscreen=yes, scrollbars=auto")},this.openConfirmDialog=!1,this.openFullscreenView=!1,this.imageurlToOpen="",this.fullScreenViewerStyle={height:"100%",width:"100%",closeIconTint:"blue"},this.onConfirmClick=()=>{this.openConfirmDialog=!1,this.closeImageModeration&&this.closeImageModeration(),this.ref.detectChanges()},this.setOngoingCallStyle=()=>{let e=new t.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:this.themeService.theme.palette.getAccent900(),maximizeIconTint:this.themeService.theme.palette.getAccent900()});this.ongoingCallStyle=Object.assign(Object.assign({},e),this.ongoingCallStyle)},this.fetchPreviousMessages=()=>{this.reinitialized&&(this.messagesRequestBuilder?this.requestBuilder=this.messagesRequestBuilder.setMessageId(this.messagesList[0].getId()).build():this.user?this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setUID(this.user.getUid()).setLimit(this.limit).setTypes(this.types).setMessageId(this.messagesList[0].getId()).setCategories(this.categories).hideReplies(!0).build():this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setGUID(this.group.getGuid()).setLimit(this.limit).setTypes(this.types).setMessageId(this.messagesList[0].getId()).setCategories(this.categories).hideReplies(!0).build()),this.requestBuilder.fetchPrevious().then((t=>{var i;if(this.state=e.States.loading,0===t.length&&0===this.messagesList.length)return this.state=e.States.empty,void this.ref.detectChanges();if(t&&t.length>0){let o=t[t.length-1];(null==o?void 0:o.getSender().getUid())==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())||o.getDeliveredAt()||this.disableReceipt||s.CometChat.markAsDelivered(o).then((e=>{let t=this.messagesList.findIndex((t=>t.getId()===Number(null==e?void 0:e.getMessageId())));t>-1&&this.markAllMessagAsDelivered(t)})),(null==o?void 0:o.getReadAt())||(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(o).then((e=>{let t=this.messagesList.findIndex((t=>t.getId()===Number(null==e?void 0:e.getMessageId())));t>-1&&this.markAllMessagAsRead(t)})).catch((e=>{this.onError&&this.onError(e)}))),this.state=e.States.loaded,this.ref.detectChanges();let n=this.listScroll.nativeElement.scrollHeight;setTimeout((()=>{this.listScroll.nativeElement.scrollTop=this.listScroll.nativeElement.scrollHeight-n})),this.showSmartReply=!1,this.smartReplyMessage=null,this.prependMessages(t)}else this.state=e.States.loaded;this.ref.detectChanges()}),(t=>{this.state=e.States.error,this.onError&&this.onError(t),this.ref.detectChanges()})).catch((t=>{console.log(t),this.state=e.States.error,this.ref.detectChanges()}))},this.fetchNextMessage=()=>{let t=this.messagesList.length-1;this.reinitialized&&(this.messagesRequestBuilder?this.requestBuilder=this.messagesRequestBuilder.setMessageId(this.messagesList[t].getId()).build():this.user?this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setUID(this.user.getUid()).setLimit(this.limit).setTypes(this.types).setMessageId(this.messagesList[t].getId()).setCategories(this.categories).hideReplies(!0).build():this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setGUID(this.group.getGuid()).setLimit(this.limit).setTypes(this.types).setMessageId(this.messagesList[t].getId()).setCategories(this.categories).hideReplies(!0).build(),this.requestBuilder.fetchNext().then((t=>{var i,o;if(this.state=e.States.loading,0===t.length&&0===this.messagesList.length)return this.state=e.States.empty,void this.ref.detectChanges();if(t&&t.length){let n=t[t.length-1];(null==n?void 0:n.getReadAt())||(null==n?void 0:n.getSender().getUid())==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())||(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(n)),(null==n?void 0:n.getDeliveredAt())||(null==n?void 0:n.getSender().getUid())==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())||(this.markMessageAsDelivered(n),this.markAllMessagAsDelivered(t.length-1)),this.state=e.States.loaded;let r=this.listScroll.nativeElement.scrollHeight;setTimeout((()=>{this.listScroll.nativeElement.scrollTop=this.listScroll.nativeElement.scrollHeight-r})),this.appendMessages(t),this.ref.detectChanges()}}),(t=>{this.state=e.States.error,console.log(t),this.onError&&this.onError(t),this.ref.detectChanges()})).catch((t=>{console.log(t),this.state=e.States.error,this.ref.detectChanges()})))},this.appendMessages=t=>{this.messagesList.push(...t),this.messageCount=this.messagesList.length,this.messageCount>this.thresholdValue&&(this.keepRecentMessages=!0,this.reInitializeMessageBuilder()),this.state=e.States.loaded,this.ref.detectChanges()},this.markMessageAsDelivered=e=>{var t;this.disableReceipt||(null==e?void 0:e.getSender().getUid())===(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())||!1!==e.hasOwnProperty("deliveredAt")||s.CometChat.markAsDelivered(e)},this.messageReceivedHandler=(t,i)=>{if(++this.messageCount,t.getParentMessageId())this.updateReplyCount(t),this.addMessage(t);else if(this.messageCount>this.thresholdValue&&(this.keepRecentMessages=!0,this.reInitializeMessageBuilder()),this.addMessage(t),!this.isOnBottom)if(this.scrollToBottomOnNewMessages)setTimeout((()=>{this.scrollToBottom()}),100);else{let s=(0,e.localize)("NEW_MESSAGES");s=this.newMessageIndicatorText&&""!=this.newMessageIndicatorText?this.newMessageIndicatorText:this.UnreadCount.length>0?(0,e.localize)("NEW_MESSAGES"):(0,e.localize)("NEW_MESSAGE"),this.UnreadCount.push(t),this.newMessageCount=" ↓ "+this.UnreadCount.length+" "+s,this.ref.detectChanges()}this.playAudio(),!1===t.hasOwnProperty("parentMessageId")&&this.parentMessageId?(++this.messageCount,this.ref.detectChanges()):!0===t.hasOwnProperty("parentMessageId")&&this.parentMessageId&&t.getParentMessageId()===this.parentMessageId&&this.isOnBottom&&(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(t).then((()=>{e.CometChatMessageEvents.ccMessageRead.next(t)})),this.ref.detectChanges())},this.reInitializeMessageBuilder=()=>{this.parentMessageId||(this.messageCount=0),this.requestBuilder=null,s.CometChat.removeMessageListener(this.msgListenerId),s.CometChat.removeGroupListener(this.groupListenerId),s.CometChat.removeCallListener(this.callListenerId),this.reInitializeMessageList()},this.messageEdited=t=>{var s,i,o,n,r;try{(this.group&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.group&&t.getReceiverId()===(null===(s=this.group)||void 0===s?void 0:s.getGuid())||this.user&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user&&(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())===t.getReceiverId()&&(null==t?void 0:t.getSender().getUid())===(null===(o=this.user)||void 0===o?void 0:o.getUid())||this.user&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user&&(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())===(null==t?void 0:t.getSender().getUid())&&t.getReceiverId()===(null===(r=this.user)||void 0===r?void 0:r.getUid()))&&this.updateEditedMessage(t)}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()},this.updateEditedMessage=e=>{const t=this.messagesList,s=t.findIndex((t=>t.getId()===e.getId()));s>-1&&(this.messagesList=[...t.slice(0,s),e,...t.slice(s+1)]),this.ref.detectChanges()},this.customMessageReceivedHandler=(t,i)=>{if(++this.messageCount,t.getParentMessageId())this.updateReplyCount(t),this.addMessage(t);else if(this.messageCount>this.thresholdValue&&(this.keepRecentMessages=!0,this.reInitializeMessageBuilder()),this.addMessage(t),!this.isOnBottom)if(this.scrollToBottomOnNewMessages)setTimeout((()=>{this.scrollToBottom()}),100);else{let s=(0,e.localize)("NEW_MESSAGES");s=this.newMessageIndicatorText&&""!=this.newMessageIndicatorText?this.newMessageIndicatorText:this.UnreadCount.length>0?(0,e.localize)("NEW_MESSAGES"):(0,e.localize)("NEW_MESSAGE"),this.UnreadCount.push(t),this.newMessageCount=" ↓ "+this.UnreadCount.length+" "+s,this.ref.detectChanges()}this.playAudio(),!1!==t.hasOwnProperty("parentMessageId")||this.parentMessageId?!0===t.hasOwnProperty("parentMessageId")&&this.parentMessageId&&this.isOnBottom&&t.getParentMessageId()===this.parentMessageId&&(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(t).then((()=>{e.CometChatMessageEvents.ccMessageRead.next(t)}))):++this.messageCount,this.ref.detectChanges()},this.addMessage=t=>{var s,i;(null==t?void 0:t.getParentMessageId())&&!this.parentMessageId||(this.messagesList.push(t),(null==t?void 0:t.getSender())&&(null===(s=this.loggedInUser)||void 0===s?void 0:s.getUid())!=(null===(i=null==t?void 0:t.getSender())||void 0===i?void 0:i.getUid())&&!this.isOnBottom||(this.scrollToBottom(),this.ref.detectChanges())),0==this.messagesList.length&&this.state!=e.States.loaded&&(this.state=e.States.loaded,this.ref.detectChanges()),this.ref.detectChanges()},this.onCopyMessage=e=>{navigator.clipboard.writeText(e.getText())},this.onEditMessage=t=>{e.CometChatMessageEvents.ccMessageEdited.next({message:t,status:e.MessageStatus.inprogress})},this.removeMessage=e=>{try{const t=this.messagesList.findIndex((t=>(null==t?void 0:t.getId())===e.getId()));t>-1&&(this.messagesList.splice(t,1,e),this.messagesList=[...this.messagesList],this.ref.detectChanges())}catch(e){this.onError&&this.onError(e)}},this.deleteMessage=t=>{try{const i=t.getId();s.CometChat.deleteMessage(i).then((t=>{e.CometChatMessageEvents.ccMessageDeleted.next(t)})).catch((e=>{this.onError&&this.onError(e)}))}catch(e){this.onError&&this.onError(e)}},this.scrollToBottom=()=>{try{setTimeout((()=>{this.listScroll.nativeElement.scroll({top:this.listScroll.nativeElement.scrollHeight,left:0}),this.isOnBottom=!0,this.ref.detectChanges()}),10)}catch(e){this.onError&&this.onError(e)}},this.closeSmartReply=()=>{this.showSmartReply=!1,this.smartReplyMessage=null,this.ref.detectChanges()},this.sendReply=e=>{var t;let s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.reply;this.smartReplyConfig.ccSmartRepliesClicked&&(this.smartReplyConfig.ccSmartRepliesClicked(s,this.smartReplyMessage,this.onError,this.customSoundForMessages,this.disableSoundForMessages),this.closeSmartReply())},this.chatsListStyle=()=>({height:this.messageListStyle.height,background:this.messageListStyle.background}),this.messageContainerStyle=()=>({width:this.messageListStyle.width}),this.errorStyle=()=>({textFont:this.messageListStyle.errorStateTextFont,textColor:this.messageListStyle.errorStateTextColor}),this.emptyStyle=()=>({textFont:this.messageListStyle.emptyStateTextFont,textColor:this.messageListStyle.emptyStateTextColor}),this.loadingStyle=()=>({iconTint:this.messageListStyle.loadingIconTint}),this.wrapperStyle=()=>({height:this.messageListStyle.height,width:this.messageListStyle.width,background:this.messageListStyle.background,border:this.messageListStyle.border,borderRadius:this.messageListStyle.borderRadius})}getThreadViewStyle(s){return(null==s?void 0:s.getSender())&&(null==s?void 0:s.getSender().getUid())!=this.loggedInUser.getUid()||(null==s?void 0:s.getType())==e.CometChatUIKitConstants.MessageTypes.text||!t.CometChatUIKitUtility.getExtensionData(s)?{height:"30px",width:"100%",border:"none",borderRadius:"0",background:"transparent",padding:"0 8px",buttonIconTint:"grey",display:"flex",flexFlow:"row-reverse",alignItems:"center",justifyContent:"space-between",buttonTextColor:this.themeService.theme.palette.getPrimary()}:{height:"30px",width:"100%",border:"none",borderRadius:"0",background:"transparent",padding:"0 8px",buttonIconTint:this.themeService.theme.palette.getAccent600(),display:"flex",flexFlow:"row-reverse",alignItems:"center",justifyContent:"space-between",buttonTextColor:this.themeService.theme.palette.getAccent("dark")}}ngOnChanges(t){try{(t[e.CometChatUIKitConstants.MessageReceiverType.user]||t[e.CometChatUIKitConstants.MessageReceiverType.group])&&(this.showEnabledExtensions(),this.numberOfTopScroll=0,this.loggedInUser||s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})),this.messagesList=[],this.user?Object.keys(this.user).length>1?(this.user=this.user,this.type=e.CometChatUIKitConstants.MessageReceiverType.user,this.createRequestBuilder()):s.CometChat.getUser(this.user).then((t=>{this.user=t,this.type=e.CometChatUIKitConstants.MessageReceiverType.user,this.createRequestBuilder()})):this.group&&(Object.keys(this.group).length>1?(this.group=this.group,this.type=e.CometChatUIKitConstants.MessageReceiverType.group,this.createRequestBuilder()):s.CometChat.getGroup(this.group).then((t=>{this.group=t,this.type=e.CometChatUIKitConstants.MessageReceiverType.group,this.createRequestBuilder()}))),s.CometChat.removeMessageListener(this.msgListenerId),s.CometChat.removeGroupListener(this.groupListenerId),s.CometChat.removeCallListener(this.callListenerId),this.msgListenerId="message_"+(new Date).getTime(),this.groupListenerId="group_"+(new Date).getTime(),this.callListenerId="call_"+(new Date).getTime(),this.addMessageEventListeners())}catch(e){this.onError&&this.onError(e)}}getCallBubbleTitle(t){return t.getSender()&&t.getSender().getUid()!=this.loggedInUser.getUid()?`${t.getSender().getName()}  ${(0,e.localize)("INITIATED_GROUP_CALL")}`:(0,e.localize)("YOU_INITIATED_GROUP_CALL")}reactToMessages(e){var i,o,n,r,a,l;let h,c=!1,d={},u=this.messageToReact;const p={};(null===(i=this.loggedInUser)||void 0===i?void 0:i.getAvatar())&&(p.avatar=null===(o=this.loggedInUser)||void 0===o?void 0:o.getAvatar()),(null===(n=this.loggedInUser)||void 0===n?void 0:n.getName())&&(p.name=null===(r=this.loggedInUser)||void 0===r?void 0:r.getName());let g=null===(a=this.loggedInUser)||void 0===a?void 0:a.getUid();const m={[e]:{[g]:p}},y=t.CometChatUIKitUtility.checkMessageForExtensionsData(this.messageToReact,"reactions");if(y)if(y[e])if(y[e][g])delete y[e],c=!0;else{let t=u.metadata["@injected"].extensions.reactions;t[e][g]=p,d=Object.assign({},t)}else{(null==u?void 0:u.hasOwnProperty("metadata"))||(u.metadata={}),u.metadata.hasOwnProperty("@injected")||(u.metadata["@injected"]={}),u.metadata["@injected"].hasOwnProperty("extensions")||(u.metadata["@injected"].extensions={}),u.metadata["@injected"].extensions.hasOwnProperty("reactions")||(u.metadata["@injected"].extensions.reactions={});let e=u.metadata["@injected"].extensions.reactions;d=Object.assign(Object.assign({},e),m)}else(null==u?void 0:u.hasOwnProperty("metadata"))||(u.metadata={}),u.metadata.hasOwnProperty("@injected")||(u.metadata["@injected"]={}),u.metadata["@injected"].hasOwnProperty("extensions")||(u.metadata["@injected"].extensions={}),u.metadata["@injected"].extensions.hasOwnProperty("reactions")||(u.metadata["@injected"].extensions.reactions={}),d=Object.assign({},m);var C;C=c?Object.assign({},u.metadata):Object.assign(Object.assign({},u.metadata),{"@injected":Object.assign(Object.assign({},u.metadata["@injected"]),{extensions:Object.assign(Object.assign({},u.metadata["@injected"].extensions),{reactions:Object.assign({},d)})})}),h=this.messageToReact,h.setMetadata(C),this.updateMessage(h);try{s.CometChat.callExtension(t.ReactionsConstants.reactions,t.ReactionsConstants.post,t.ReactionsConstants.v1,{msgId:null===(l=this.messageToReact)||void 0===l?void 0:l.getId(),emoji:e}).then((e=>{})).catch((e=>{console.log(e)}))}catch(e){console.log(e)}}ngOnDestroy(){this.unsubscribeToEvents();try{s.CometChat.removeMessageListener(this.msgListenerId),s.CometChat.removeGroupListener(this.groupListenerId),s.CometChat.removeCallListener(this.callListenerId)}catch(e){this.onError&&this.onError(e)}}reactionsStyle(t){var s;let i=!(null==t?void 0:t.getSender())||t.getSender().getUid()==(null===(s=this.loggedInUser)||void 0===s?void 0:s.getUid());return this.alignment!=e.MessageListAlignment.left&&i&&(null==t?void 0:t.getCategory())==e.CometChatUIKitConstants.MessageCategory.message?{height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",textFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),textColor:this.themeService.theme.palette.getAccent("dark"),activeTextColor:this.themeService.theme.palette.getPrimary(),activeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),addReactionIconTint:this.themeService.theme.palette.getAccent("dark"),activeReactionBackground:this.themeService.theme.palette.getAccent("dark"),reactionBackground:"transparent",reactionBorder:`1px solid ${this.themeService.theme.palette.getAccent100()}`,reactionBorderRadius:"12px",addReactionIconBackground:this.themeService.theme.palette.getAccent100("light")}:{height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent600(),activeTextColor:this.themeService.theme.palette.getAccent("dark"),activeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),addReactionIconTint:this.themeService.theme.palette.getAccent600(),activeReactionBackground:this.themeService.theme.palette.getPrimary(),reactionBackground:"transparent",reactionBorder:`1px solid ${this.themeService.theme.palette.getAccent100()}`,reactionBorderRadius:"12px",addReactionIconBackground:this.themeService.theme.palette.getAccent100()}}getMessageById(e){let t=this.messagesList.findIndex((t=>t.getId()===e));return t>-1&&this.messagesList[t]}isTranslated(e){var s,i;let o=e;return o&&(null===(s=null==o?void 0:o.data)||void 0===s?void 0:s.metadata)&&(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.metadata[t.MessageTranslationConstants.translated_message])?o.data.metadata[t.MessageTranslationConstants.translated_message]:null}setOptionsCallback(t){return null==t||t.forEach((t=>{switch(t.id){case e.CometChatUIKitConstants.MessageOption.deleteMessage:t.onClick||(t.onClick=this.deleteCallback);break;case e.CometChatUIKitConstants.MessageOption.editMessage:t.onClick||(t.onClick=this.editCallback);break;case e.CometChatUIKitConstants.MessageOption.translateMessage:t.onClick||(t.onClick=this.translateMessage);break;case e.CometChatUIKitConstants.MessageOption.copyMessage:t.onClick||(t.onClick=this.copyCallback);break;case e.CometChatUIKitConstants.MessageOption.reactToMessage:t.onClick||(t.onClick=this.showEmojiKeyboard);break;case e.CometChatUIKitConstants.MessageOption.replyInThread:t.onClick||(t.onClick=this.threadCallback)}})),t}setMessageOptions(t){let s;return this.messageTemplate&&this.messageTemplate.length>0&&!(null==t?void 0:t.getDeletedAt())&&(null==t?void 0:t.getType())!=e.CometChatUIKitConstants.MessageTypes.groupMember?this.messageTemplate.forEach((e=>{(null==t?void 0:t.getId())&&e.type==(null==t?void 0:t.getType())&&(null==e?void 0:e.options)&&(s=this.setOptionsCallback(null==e?void 0:e.options(this.loggedInUser,t,this.themeService.theme,this.group))||[])})):s=[],s}setMessageBubbleStyle(s){let i;return i=(null==s?void 0:s.getDeletedAt())?{background:"transparent",border:`1px dashed ${this.themeService.theme.palette.getAccent400()}`,borderRadius:"12px"}:(null==s?void 0:s.getType())!=e.CometChatUIKitConstants.calls.meeting||(null==s?void 0:s.getSender())&&(null==s?void 0:s.getSender().getUid())!=this.loggedInUser.getUid()?this.getLinkPreview(s)?{borderRadius:"8px",background:this.themeService.theme.palette.getAccent100()}:(null==s?void 0:s.getType())==t.StickersConstants.sticker?{background:"transparent",borderRadius:"12px"}:(null==s?void 0:s.getDeletedAt())||(null==s?void 0:s.getCategory())!=e.CometChatUIKitConstants.MessageCategory.message||(null==s?void 0:s.getType())!=e.CometChatUIKitConstants.MessageTypes.text||(null==s?void 0:s.getSender())&&this.loggedInUser.getUid()!=(null==s?void 0:s.getSender().getUid())?(null==s?void 0:s.getDeletedAt())||(null==s?void 0:s.getCategory())!=e.CometChatUIKitConstants.MessageCategory.message||(null==s?void 0:s.getType())!=e.CometChatUIKitConstants.MessageTypes.audio?(null==s?void 0:s.getType())==e.CometChatUIKitConstants.MessageTypes.groupMember||(null==s?void 0:s.getCategory())==this.callConstant?{background:"transparent",borderRadius:"12px",border:`1px solid ${this.themeService.theme.palette.getAccent100()}`}:((null==s?void 0:s.getSender())&&(null==s||s.getSender().getUid(),this.loggedInUser.getUid()),{background:this.themeService.theme.palette.getAccent100(),borderRadius:"12px"}):{borderRadius:"",background:this.themeService.theme.palette.getAccent100()}:{background:this.alignment==e.MessageListAlignment.left?this.themeService.theme.palette.getAccent100():this.themeService.theme.palette.getPrimary(),borderRadius:"12px"}:{background:this.themeService.theme.palette.getPrimary(),border:"none",borderRadius:"12px"},i}getSessionId(e){var t;let s=e.getData();return null===(t=null==s?void 0:s.customData)||void 0===t?void 0:t.sessionID}getWhiteboardDocument(e){try{if(null==e?void 0:e.getData()){const s=e.getData();if(null==s?void 0:s.metadata){const e=null==s?void 0:s.metadata;if(t.CometChatUIKitUtility.checkHasOwnProperty(e,"@injected")){const s=e["@injected"];if(null==s?void 0:s.extensions){const e=s.extensions;return e[t.CollaborativeWhiteboardConstants.whiteboard]?e[t.CollaborativeWhiteboardConstants.whiteboard].board_url:e[t.CollaborativeDocumentConstants.document].document_url}}}}}catch(e){this.onError&&this.onError(e)}}openLinkURL(e){var t;window.open(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.url,"_blank")}getSticker(e){try{let s=null;return t.CometChatUIKitUtility.checkHasOwnProperty(e,t.StickersConstants.data)&&t.CometChatUIKitUtility.checkHasOwnProperty(e.getData(),t.StickersConstants.custom_data)?(s=e.data.customData,t.CometChatUIKitUtility.checkHasOwnProperty(s,t.StickersConstants.sticker_url)?s.sticker_url:""):""}catch(e){this.onError&&this.onError(e)}}getHeaderView(e){var t,s;let i=null;return this.messageTypesMap[null==e?void 0:e.getType()]&&(null===(t=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===t?void 0:t.headerView)?(i=null===(s=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===s?void 0:s.headerView(e),i):null}getFooterView(e){var t,s;let i=null;return this.messageTypesMap[null==e?void 0:e.getType()]&&(null===(t=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===t?void 0:t.footerView)?(i=null===(s=this.messageTypesMap[null==e?void 0:e.getType()])||void 0===s?void 0:s.footerView(e),i):null}getCallBubbleStyle(t){const s=this.alignment==e.MessageListAlignment.left;return(null==t?void 0:t.getSender())&&this.loggedInUser.getUid()!==(null==t?void 0:t.getSender().getUid())||s?{titleFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleColor:this.themeService.theme.palette.getAccent(),iconTint:this.themeService.theme.palette.getPrimary(),buttonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),buttonTextColor:this.themeService.theme.palette.getPrimary(),buttonBackground:this.themeService.theme.palette.getAccent("dark"),width:"240px"}:{titleFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleColor:this.themeService.theme.palette.getAccent("dark"),iconTint:this.themeService.theme.palette.getAccent("dark"),buttonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),buttonTextColor:this.themeService.theme.palette.getPrimary(),buttonBackground:this.themeService.theme.palette.getAccent("dark"),width:"240px"}}getBubbleAlignment(t){return this.alignment==e.MessageListAlignment.left||t.getSender()&&t.getSender().getUid()!=this.loggedInUser.getUid()?e.MessageBubbleAlignment.left:e.MessageBubbleAlignment.right}getCallTypeIcon(t){return t.getType()==e.CometChatUIKitConstants.MessageTypes.audio?"assets/Audio-Call.svg":"assets/Video-call.svg"}callStatusStyle(s){return s.getCategory()==this.callConstant?{buttonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),buttonTextColor:t.CallingDetailsUtils.isMissedCall(s,this.loggedInUser)?this.themeService.theme.palette.getError():this.themeService.theme.palette.getAccent600(),borderRadius:"10px",border:t.CallingDetailsUtils.isMissedCall(s,this.loggedInUser)?"1px solid RGBA(255, 59, 48, 0.2)":`1px solid ${this.themeService.theme.palette.getAccent100()}`,buttonIconTint:t.CallingDetailsUtils.isMissedCall(s,this.loggedInUser)?this.themeService.theme.palette.getError():this.themeService.theme.palette.getAccent600(),background:"transparent",iconBackground:"transparent",padding:"2px 12px 2px 0",gap:"0",height:"25px",justifyContent:"center"}:null}setFileBubbleStyle(t){return t.getCategory()===e.CometChatUIKitConstants.MessageCategory.message&&(null==t?void 0:t.getType())===e.CometChatUIKitConstants.MessageTypes.file?{titleFont:(0,e.fontHelper)(this.theme.typography.subtitle1),titleColor:this.themeService.theme.palette.getAccent(),subtitleFont:(0,e.fontHelper)(this.theme.typography.subtitle2),subtitleColor:this.themeService.theme.palette.getAccent600(),iconTint:this.themeService.theme.palette.getPrimary()}:void 0}ngAfterViewInit(){this.ioBottom(),this.ioTop(),this.checkMessageTemplate()}checkMessageTemplate(){this.typesMap={text:this.textBubble,file:this.fileBubble,audio:this.audioBubble,video:this.videoBubble,image:this.imageBubble,groupMember:this.textBubble,extension_sticker:this.stickerBubble,extension_whiteboard:this.whiteboardBubble,extension_document:this.documentBubble,extension_poll:this.pollBubble,meeting:this.directCalling},this.setBubbleView()}getPollBubbleData(e,t){let s=e.getCustomData();return t?s[t]:e.getSender().getUid()}getThreadCount(t){const s=(null==t?void 0:t.getReplyCount())||0,i=1===s?(0,e.localize)("REPLY"):(0,e.localize)("REPLIES");return`${(0,e.localize)("VIEW")} ${s} ${i}`}showEnabledExtensions(){o.names.includes("textmoderator")&&(this.enableDataMasking=!0),o.names.includes("thumbnailgeneration")&&(this.enableThumbnailGeneration=!0),o.names.includes("linkpreview")&&(this.enableLinkPreview=!0),o.names.includes("polls")&&(this.enablePolls=!0),o.names.includes("reactions")&&(this.enableReactions=!0),o.names.includes("imagemoderation")&&(this.enableImageModeration=!0),o.names.includes("stickers")&&(this.enableStickers=!0),o.names.includes("collaborativewhiteboard")&&(this.enableWhiteboard=!0),o.names.includes("collaborativedocument")&&(this.enableDocument=!0),o.names.includes("calling")&&(this.enableCalling=!0)}openImageInFullScreen(e){var t,s;this.imageurlToOpen=null===(s=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.attachments[0])||void 0===s?void 0:s.url,this.openFullscreenView=!0,this.ref.detectChanges()}closeImageInFullScreen(){this.imageurlToOpen="",this.openFullscreenView=!1,this.ref.detectChanges()}openWarningDialog(e){var t;this.closeImageModeration=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.onConfirm,this.openConfirmDialog=!0,this.ref.detectChanges()}onCancelClick(){this.openConfirmDialog=!1,this.ref.detectChanges()}getTextMessage(e){var s;const i=this.enableDataMasking?t.CometChatUIKitUtility.getExtensionData(e):null;return(null===(s=null==i?void 0:i.trim())||void 0===s?void 0:s.length)>0?i:e.getText()}getLinkPreview(e){try{if(!(null==e?void 0:e.getMetadata())||!this.enableLinkPreview)return null;{const s=e.getMetadata()[t.LinkPreviewConstants.injected];if(s&&(null==s?void 0:s.extensions)){const e=s.extensions;if(e&&t.CometChatUIKitUtility.checkHasOwnProperty(e,t.LinkPreviewConstants.link_preview)){const s=e[t.LinkPreviewConstants.link_preview];return s&&t.CometChatUIKitUtility.checkHasOwnProperty(s,t.LinkPreviewConstants.links)&&s[t.LinkPreviewConstants.links].length?s[t.LinkPreviewConstants.links][0]:null}return null}}}catch(e){this.onError&&this.onError(e)}}downloadImage(e){return new Promise(((t,s)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=()=>{4===i.readyState?200===i.status?(this.timer=null,t(i.response)):403===i.status&&(this.timer=setTimeout((()=>{this.downloadImage(e).then((e=>t(e))).catch((e=>s(e)))}),800)):s(i.statusText)},i.onerror=e=>s(new Error("There was a network error.")),i.ontimeout=e=>s(new Error("There was a timeout error.")),i.send()}))}getImageThumbnail(e){var s,i,o,n,r,a;const l=e;let h="";if(this.enableThumbnailGeneration)try{const e=l.getMetadata(),n=null==e?void 0:e[t.ThumbnailGenerationConstants.injected],r=(null==n?void 0:n.extensions)[t.ThumbnailGenerationConstants.thumbnail_generation];h=(null==r?void 0:r.url_small)||((null===(s=null==l?void 0:l.data)||void 0===s?void 0:s.attachments)?null===(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.attachments[0])||void 0===o?void 0:o.url:"")}catch(e){this.onError&&this.onError(e)}else h=(null===(n=null==l?void 0:l.data)||void 0===n?void 0:n.attachments)?null===(a=null===(r=null==l?void 0:l.data)||void 0===r?void 0:r.attachments[0])||void 0===a?void 0:a.url:"";return h}getLinkPreviewDetails(e,t){let s=this.getLinkPreview(t);return Object.keys(s).length>0?s[e]:""}ngOnInit(){this.setMessagesStyle(),this.setAvatarStyle(),this.setDateStyle(),this.setReceiptStyle(),this.subscribeToEvents(),this.setOngoingCallStyle(),this.state=e.States.loading,s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.dateSeparatorStyle.background=this.dateSeparatorStyle.background||this.themeService.theme.palette.getAccent600(),this.dividerStyle.background=this.themeService.theme.palette.getAccent100()}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"28px",height:"28px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setDateStyle(){let t=new J.DateStyle({textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getAccent100(),height:"100%",width:"100%",border:`1px solid ${this.themeService.theme.palette.getAccent100()}`,borderRadius:"8px"});this.dateSeparatorStyle=Object.assign(Object.assign({},t),this.dateSeparatorStyle)}setMessagesStyle(){this.smartReplyStyle=Object.assign({replyTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption1),replyTextColor:this.themeService.theme.palette.getAccent(),replyBackground:this.themeService.theme.palette.getBackground(),boxShadow:`0px 0px 1px ${this.themeService.theme.palette.getAccent600()}`,closeIconTint:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground()},this.smartReplyStyle),this.fullScreenViewerStyle.closeIconTint=this.themeService.theme.palette.getPrimary();let s=new t.MessageListStyle({background:this.themeService.theme.palette.getBackground(),border:"none",emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),nameTextColor:this.themeService.theme.palette.getAccent600(),threadReplySeparatorColor:this.themeService.theme.palette.getAccent400(),threadReplyTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),threadReplyIconTint:this.themeService.theme.palette.getAccent600(),threadReplyTextColor:this.themeService.theme.palette.getAccent600(),TimestampTextFont:(0,e.fontHelper)(this.themeService.theme.typography.caption2),TimestampTextColor:this.themeService.theme.palette.getAccent600()});this.messageListStyle=Object.assign(Object.assign({},s),this.messageListStyle),this.bubbleDateStyle={textColor:this.messageListStyle.TimestampTextColor||this.themeService.theme.palette.getAccent600(),textFont:this.messageListStyle.TimestampTextFont||(0,e.fontHelper)(this.themeService.theme.typography.caption2)},this.linkPreviewStyle=new t.LinkPreviewStyle({titleColor:this.themeService.theme.palette.getAccent(),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),descriptionColor:this.themeService.theme.palette.getAccent600(),descriptionFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),background:"transparent",height:"100%",width:"100%"}),this.documentBubbleStyle={titleFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleColor:this.themeService.theme.palette.getAccent(),subtitleFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subtitleColor:this.themeService.theme.palette.getAccent600(),iconTint:this.themeService.theme.palette.getAccent700(),buttonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),buttonTextColor:this.themeService.theme.palette.getPrimary(),buttonBackground:"transparent",separatorColor:this.themeService.theme.palette.getAccent200()},this.pollBubbleStyle={borderRadius:"8px",background:"transparent",votePercentTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),votePercentTextColor:this.themeService.theme.palette.getAccent600(),pollQuestionTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),pollQuestionTextColor:this.themeService.theme.palette.getAccent(),pollOptionTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),pollOptionTextColor:this.themeService.theme.palette.getAccent(),pollOptionBackground:this.themeService.theme.palette.getAccent900(),optionsIconTint:this.themeService.theme.palette.getAccent600(),totalVoteCountTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),totalVoteCountTextColor:this.themeService.theme.palette.getAccent600(),selectedPollOptionBackground:this.themeService.theme.palette.getAccent200(),userSelectedOptionBackground:this.themeService.theme.palette.getPrimary(),pollOptionBorder:`1px solid ${this.themeService.theme.palette.getAccent100()}`,pollOptionBorderRadius:"8px"},this.imageModerationStyle={filterColor:this.themeService.theme.palette.getPrimary(),height:"100%",width:"100%",border:"none",warningTextColor:this.themeService.theme.palette.getAccent("dark"),warningTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2)},this.confirmDialogStyle={confirmButtonBackground:this.themeService.theme.palette.getError(),cancelButtonBackground:this.themeService.theme.palette.getSecondary(),confirmButtonTextColor:this.themeService.theme.palette.getAccent900("light"),confirmButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),cancelButtonTextColor:this.themeService.theme.palette.getAccent900("dark"),cancelButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleColor:this.themeService.theme.palette.getAccent(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),messageTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),height:"100%",width:"100%",border:`1px solid ${this.themeService.theme.palette.getAccent100()}`,borderRadius:"8px"}}setReceiptStyle(){this.receiptStyle=new J.ReceiptStyle({waitIconTint:this.themeService.theme.palette.getAccent700(),sentIconTint:this.themeService.theme.palette.getAccent600(),deliveredIconTint:this.themeService.theme.palette.getAccent600(),readIconTint:this.themeService.theme.palette.getPrimary(),errorIconTint:this.themeService.theme.palette.getError()}),this.receiptStyle=Object.assign({},this.receiptStyle)}createRequestBuilder(){var t;this.templates&&0!=(null===(t=this.templates)||void 0===t?void 0:t.length)?this.messageTemplate=this.templates:(this.messageTemplate=o.getDataSource().getAllMessageTemplates(),this.categories=o.getDataSource().getAllMessageCategories(),this.types=o.getDataSource().getAllMessageTypes()),this.state=e.States.loading,this.requestBuilder=null,(this.user||this.group)&&(this.messagesRequestBuilder?this.requestBuilder=this.messagesRequestBuilder.build():this.user?this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setUID(this.user.getUid()).setLimit(this.limit).setTypes(this.types).setCategories(this.categories).hideReplies(!0).build():this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setGUID(this.group.getGuid()).setLimit(this.limit).setTypes(this.types).hideReplies(!0).setCategories(this.categories).build(),this.fetchPreviousMessages())}addMessageEventListeners(){try{s.CometChat.addMessageListener(this.msgListenerId,new s.CometChat.MessageListener({onTextMessageReceived:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.TEXT_MESSAGE_RECEIVED,t)},onCustomMessageReceived:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.CUSTOM_MESSAGE_RECEIVED,t)},onMediaMessageReceived:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.MEDIA_MESSAGE_RECEIVED,t)},onMessagesDelivered:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.MESSAGE_DELIVERED,t)},onMessagesRead:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.MESSAGE_READ,t)},onMessageDeleted:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.MESSAGE_DELETED,t)},onMessageEdited:t=>{this.messageUpdate(e.CometChatUIKitConstants.messages.MESSAGE_EDITED,t)},onTransientMessageReceived:t=>{var s,i;let o=t.getData();(t.getReceiverType()==e.CometChatUIKitConstants.MessageReceiverType.user&&this.user&&(null==t?void 0:t.getSender().getUid())==this.user.getUid()&&t.getReceiverId()==(null===(s=this.loggedInUser)||void 0===s?void 0:s.getUid())||t.getReceiverType()==e.CometChatUIKitConstants.MessageReceiverType.group&&this.group&&t.getReceiverId()==this.group.getGuid()&&(null==t?void 0:t.getSender().getUid())!=(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid()))&&e.CometChatMessageEvents.ccLiveReaction.next(o.LIVE_REACTION)}})),s.CometChat.addGroupListener(this.groupListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(t,s,i,o,n)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE,t,n,{user:s,scope:i})},onGroupMemberKicked:(t,s,i,o)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.KICKED,t,o,{user:s,hasJoined:!1})},onGroupMemberBanned:(t,s,i,o)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.BANNED,t,o,{user:s})},onGroupMemberUnbanned:(t,s,i,o)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.UNBANNED,t,o,{user:s})},onMemberAddedToGroup:(t,s,i,o)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.ADDED,t,o,{user:s,hasJoined:!0})},onGroupMemberLeft:(t,s,i)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.LEFT,t,i,{user:s})},onGroupMemberJoined:(t,s,i)=>{this.messageUpdate(e.CometChatUIKitConstants.groupMemberAction.JOINED,t,i,{user:s})}})),this.enableCalling&&s.CometChat.addCallListener(this.callListenerId,new s.CometChat.CallListener({onIncomingCallReceived:e=>{this.addMessage(e)},onIncomingCallCancelled:e=>{this.addMessage(e)},onOutgoingCallRejected:e=>{this.addMessage(e)},onOutgoingCallAccepted:e=>{this.addMessage(e)}}))}catch(e){this.onError&&this.onError(e)}}messageUpdate(t=null,s=null,i=null,o=null){try{switch(t){case e.CometChatUIKitConstants.messages.TEXT_MESSAGE_RECEIVED:case e.CometChatUIKitConstants.messages.MEDIA_MESSAGE_RECEIVED:this.messageReceived(s);break;case e.CometChatUIKitConstants.messages.MESSAGE_DELIVERED:case e.CometChatUIKitConstants.messages.MESSAGE_READ:this.messageReadAndDelivered(s);break;case e.CometChatUIKitConstants.messages.MESSAGE_DELETED:case e.CometChatUIKitConstants.messages.MESSAGE_EDITED:this.messageEdited(s);break;case e.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE:case e.CometChatUIKitConstants.groupMemberAction.JOINED:case e.CometChatUIKitConstants.groupMemberAction.LEFT:case e.CometChatUIKitConstants.groupMemberAction.ADDED:case e.CometChatUIKitConstants.groupMemberAction.KICKED:case e.CometChatUIKitConstants.groupMemberAction.BANNED:case e.CometChatUIKitConstants.groupMemberAction.UNBANNED:this.addMessage(s);break;case e.CometChatUIKitConstants.messages.CUSTOM_MESSAGE_RECEIVED:this.customMessageReceived(s);break;default:return}this.ref.detectChanges()}catch(e){this.onError&&this.onError(e)}}messageReceived(t){var i,o;this.markMessageAsDelivered(t);try{this.group&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.group&&t.getReceiverId()===(null===(i=this.group)||void 0===i?void 0:i.getGuid())?this.messageReceivedHandler(t,e.CometChatUIKitConstants.MessageReceiverType.group):this.user&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user&&(null==t?void 0:t.getSender().getUid())===(null===(o=this.user)||void 0===o?void 0:o.getUid())&&((!(null==t?void 0:t.getReadAt())&&!(null==t?void 0:t.getParentMessageId())&&this.isOnBottom||!(null==t?void 0:t.getReadAt())&&t.getParentMessageId()&&this.parentMessageId&&this.isOnBottom)&&(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(t).then((()=>{e.CometChatMessageEvents.ccMessageRead.next(t)})),e.CometChatMessageEvents.ccMessageRead.next(t)),this.messageReceivedHandler(t,e.CometChatUIKitConstants.MessageReceiverType.user))}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()}updateReplyCount(e){try{const t=e;let s=[...this.messagesList],i=s.findIndex((e=>e.getId()===t.getParentMessageId()));if(i>-1){const e=s[i];let t=e.getReplyCount()?e.getReplyCount():0;t+=1,e.setReplyCount(t),s.splice(i,1,e),this.messagesList=[...s],this.ref.detectChanges()}}catch(e){this.onError&&this.onError(e)}}playAudio(){this.disableSoundForMessages||(this.customSoundForMessages?t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.incomingMessage,this.customSoundForMessages):t.CometChatSoundManager.play(t.CometChatSoundManager.Sound.incomingMessage))}reInitializeMessageList(){this.reinitialized=!0,this.msgListenerId="message_"+(new Date).getTime(),this.groupListenerId="group_"+(new Date).getTime(),this.callListenerId="call_"+(new Date).getTime(),this.addMessageEventListeners(),this.messagesRequestBuilder?(this.keepRecentMessages?this.messagesList.splice(1,this.messagesList.length-30):this.messagesList.splice(30),this.requestBuilder=this.messagesRequestBuilder):this.keepRecentMessages?(this.messagesList.splice(1,this.messagesList.length-30),this.scrollToBottom()):this.messagesList.splice(30),this.ref.detectChanges()}getMessageReceipt(e){return t.MessageReceiptUtils.getReceiptStatus(e)}messageReadAndDelivered(t){var s,i,o;try{if(t.getReceiverType()==e.CometChatUIKitConstants.MessageReceiverType.user&&(null==t?void 0:t.getSender().getUid())==(null===(s=this.user)||void 0===s?void 0:s.getUid())&&t.getReceiver()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())){if(t.getReceiptType()==e.CometChatUIKitConstants.messages.DELIVERY){let e=this.messagesList.findIndex((e=>e.getId()==Number(t.getMessageId())));e>-1&&(this.messagesList[e].setDeliveredAt(t.getDeliveredAt()),this.ref.detectChanges()),this.markAllMessagAsDelivered(e)}else if(t.getReceiptType()==e.CometChatUIKitConstants.messages.READ){let e=this.messagesList.findIndex((e=>e.getId()==Number(t.getMessageId())));e>-1&&(this.messagesList[e].setReadAt(null==t?void 0:t.getReadAt()),this.ref.detectChanges()),this.ref.detectChanges(),this.markAllMessagAsRead(e)}}else if(t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.group&&t.getReceiver()===(null===(o=this.group)||void 0===o?void 0:o.getGuid()))return}catch(e){this.onError&&this.onError(e)}this.ref.detectChanges()}markAllMessagAsRead(s){for(let e=s;e>=0;e--)this.messagesList[e].getReadAt()||(this.messagesList[e].setReadAt(t.CometChatUIKitUtility.getUnixTimestamp()),this.ref.detectChanges());e.CometChatMessageEvents.ccMessageRead.next(this.messagesList[s])}markAllMessagAsDelivered(e){for(let s=e;s>=0;s--)this.messagesList[s].getDeliveredAt()||(this.messagesList[s].setDeliveredAt(t.CometChatUIKitUtility.getUnixTimestamp()),this.ref.detectChanges())}customMessageReceived(t){var i,o,n,r,a;try{this.markMessageAsDelivered(t),this.group&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.group&&t.getReceiverId()===(null===(i=this.group)||void 0===i?void 0:i.getGuid())?((!(null==t?void 0:t.getReadAt())&&!(null==t?void 0:t.getParentMessageId())&&this.isOnBottom||!(null==t?void 0:t.getReadAt())&&t.getParentMessageId()&&this.parentMessageId&&this.isOnBottom)&&(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(t).then((()=>{e.CometChatMessageEvents.ccMessageRead.next(t)}))),this.customMessageReceivedHandler(t,e.CometChatUIKitConstants.MessageReceiverType.group)):this.user&&t.getReceiverType()===e.CometChatUIKitConstants.MessageReceiverType.user&&((null==t?void 0:t.getSender().getUid())===(null===(o=this.user)||void 0===o?void 0:o.getUid())&&t.getReceiverId()===(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())||(null===(r=this.loggedInUser)||void 0===r?void 0:r.getUid())===(null==t?void 0:t.getSender().getUid())&&t.getReceiverId()===(null===(a=this.user)||void 0===a?void 0:a.getUid()))&&((!(null==t?void 0:t.getReadAt())&&!(null==t?void 0:t.getParentMessageId())&&this.isOnBottom||!(null==t?void 0:t.getReadAt())&&t.getParentMessageId()&&this.parentMessageId&&this.isOnBottom)&&(this.disableReceipt?(this.UnreadCount=[],this.ref.detectChanges()):s.CometChat.markAsRead(t).then((()=>{e.CometChatMessageEvents.ccMessageRead.next(t)}))),this.customMessageReceivedHandler(t,e.CometChatUIKitConstants.MessageReceiverType.user))}catch(e){this.onError&&this.onError(e)}return this.ref.detectChanges(),!0}getMessageId(e,t){return t.editedAt||t.readAt||t.deliveredAt||t.id}isDateDifferent(e,t){let s,i;return s=new Date(1e3*e),i=new Date(1e3*t),s.getDate()!==i.getDate()||s.getMonth()!==i.getMonth()||s.getFullYear()!==i.getFullYear()}prependMessages(t){try{this.messagesList=[...t,...this.messagesList],this.messageCount=this.messagesList.length,this.messageCount>this.thresholdValue&&(this.keepRecentMessages=!1,this.reInitializeMessageBuilder()),this.ngZone.run((()=>{this.state!=e.States.loaded&&(this.state=e.States.loaded),this.ref.detach()})),this.chatChanged&&(e.CometChatUIEvents.ccActiveChatChanged.next({user:this.user,group:this.group,message:t[(null==t?void 0:t.length)-1]}),this.chatChanged=!1,this.scrollToBottom())}catch(t){this.state=e.States.error,this.onError&&this.onError(t)}}ioBottom(){const t={root:this.listScroll.nativeElement,rootMargin:"-100% 0px 100px 0px",threshold:0};new IntersectionObserver((t=>{var i;this.isOnBottom=!1;const o=this.UnreadCount[this.UnreadCount.length-1];this.isOnBottom=t[0].isIntersecting,this.isOnBottom&&(this.fetchNextMessage(),!this.disableReceipt&&(null===(i=this.UnreadCount)||void 0===i?void 0:i.length)>0?s.CometChat.markAsRead(o).then((t=>{this.UnreadCount=[];let s=this.messagesList.findIndex((e=>e.getId()===Number(null==t?void 0:t.getMessageId())));s>-1&&this.markAllMessagAsRead(s),this.ref.detectChanges(),e.CometChatMessageEvents.ccMessageRead.next(o)})):(this.UnreadCount=[],this.ref.detectChanges()))}),t).observe(this.bottom.nativeElement)}ioTop(){const e={root:this.listScroll.nativeElement,rootMargin:"200px 0px 0px 0px",threshold:1};new IntersectionObserver((e=>{this.isOnBottom=!1,e[0].isIntersecting&&(this.numberOfTopScroll++,this.numberOfTopScroll>1&&this.fetchPreviousMessages())}),e).observe(this.top.nativeElement)}messageSent(e){const t=e,s=[...this.messagesList];let i=s.findIndex((e=>e.getMuid()===t.getMuid()));i>-1&&s.splice(i,1,t),this.messagesList=s,this.ref.detectChanges(),this.scrollToBottom()}updateMessage(e,t=!1){t?this.messageSent(e):this.updateEditedMessage(e)}showHeaderTitle(t){var s;return this.alignment==e.MessageListAlignment.left||!(!this.group||(null==t?void 0:t.getCategory())==e.CometChatUIKitConstants.MessageCategory.action||(null==t?void 0:t.getDeletedAt())||!(null==t?void 0:t.getSender())||(null==t?void 0:t.getSender().getUid())==(null===(s=this.loggedInUser)||void 0===s?void 0:s.getUid())||this.alignment!=e.MessageListAlignment.standard)}subscribeToEvents(){this.ccShowPanel=e.CometChatUIEvents.ccShowPanel.subscribe((e=>{this.smartReplyConfig=e.configuration,this.smartReplyMessage=e.message,this.enableSmartReply=!0,this.showSmartReply=!0,this.ref.detectChanges()})),this.ccHidePanel=e.CometChatUIEvents.ccHidePanel.subscribe((()=>{this.smartReplyMessage=null,this.enableSmartReply=!1,this.showSmartReply=!1})),this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.appendMessages(e.messages)})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.addMessage(e.message)})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.addMessage(e.message)})),this.ccGroupMemberScopeChanged=e.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe((e=>{this.addMessage(e.message)})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{this.addMessage(e.message)})),this.ccMessageEdit=e.CometChatMessageEvents.ccMessageEdited.subscribe((t=>{(null==t?void 0:t.status)==e.MessageStatus.success&&this.updateMessage(t.message)})),this.ccMessageSent=e.CometChatMessageEvents.ccMessageSent.subscribe((t=>{let s=t.message;switch(t.status){case e.MessageStatus.inprogress:this.addMessage(s),this.playAudio();break;case e.MessageStatus.success:(s.getParentMessageId()||this.parentMessageId)&&this.updateReplyCount(s),this.updateMessage(s,!0);break;case e.MessageStatus.success:this.updateMessage(s)}})),this.ccMessageDelete=e.CometChatMessageEvents.ccMessageDeleted.subscribe((e=>{this.removeMessage(e),this.ref.detectChanges()})),this.ccCallEnded=e.CometChatCallEvents.ccCallEnded.subscribe((e=>{this.showOngoingCall=!1,this.sessionId="",e&&this.addMessage(e),this.ref.detectChanges()})),this.ccCallRejected=e.CometChatCallEvents.ccCallRejected.subscribe((e=>{this.addMessage(e)})),this.ccOutgoingCall=e.CometChatCallEvents.ccOutgoingCall.subscribe((e=>{this.addMessage(e)}))}getReplies(){var e,s,i;let o=this.smartReplyMessage;const n=null===(i=null===(s=null===(e=null==o?void 0:o.metadata)||void 0===e?void 0:e[t.SmartRepliesConstants.injected])||void 0===s?void 0:s.extensions)||void 0===i?void 0:i[t.SmartRepliesConstants.smart_reply];if((null==n?void 0:n.reply_positive)&&(null==n?void 0:n.reply_neutral)&&(null==n?void 0:n.reply_negative)){const{reply_positive:e,reply_neutral:t,reply_negative:s}=n;return[e,t,s]}return null}unsubscribeToEvents(){var e,t,s,i,o,n,r,a,l,h,c;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberBanned)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberJoined)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberKicked)||void 0===i||i.unsubscribe(),null===(o=this.ccOwnershipChanged)||void 0===o||o.unsubscribe(),null===(n=this.ccGroupLeft)||void 0===n||n.unsubscribe(),null===(r=this.ccMessageEdit)||void 0===r||r.unsubscribe(),null===(a=this.ccMessageSent)||void 0===a||a.unsubscribe(),null===(l=this.ccLiveReaction)||void 0===l||l.unsubscribe(),null===(h=this.ccMessageDelete)||void 0===h||h.unsubscribe(),null===(c=this.ccGroupMemberScopeChanged)||void 0===c||c.unsubscribe()}};L([(0,K.ViewChild)("listScroll",{static:!1}),G("design:type",K.ElementRef)],Ma.prototype,"listScroll",void 0),L([(0,K.ViewChild)("bottom",{static:!1}),G("design:type",K.ElementRef)],Ma.prototype,"bottom",void 0),L([(0,K.ViewChild)("top",{static:!1}),G("design:type",K.ElementRef)],Ma.prototype,"top",void 0),L([(0,K.ViewChild)("textBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"textBubble",void 0),L([(0,K.ViewChild)("threadMessageBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"threadMessageBubble",void 0),L([(0,K.ViewChild)("fileBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"fileBubble",void 0),L([(0,K.ViewChild)("audioBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"audioBubble",void 0),L([(0,K.ViewChild)("videoBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"videoBubble",void 0),L([(0,K.ViewChild)("imageBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"imageBubble",void 0),L([(0,K.ViewChild)("stickerBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"stickerBubble",void 0),L([(0,K.ViewChild)("documentBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"documentBubble",void 0),L([(0,K.ViewChild)("whiteboardBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"whiteboardBubble",void 0),L([(0,K.ViewChild)("popoverRef",{static:!1}),G("design:type",Object)],Ma.prototype,"popoverRef",void 0),L([(0,K.ViewChild)("directCalling",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"directCalling",void 0),L([(0,K.ViewChild)("pollBubble",{static:!1}),G("design:type",K.TemplateRef)],Ma.prototype,"pollBubble",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ma.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ma.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ma.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ma.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],Ma.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Ma.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ma.prototype,"disableReceipt",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ma.prototype,"disableSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"customSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"readIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"deliveredIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"sentIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"waitIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"errorIcon",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"alignment",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ma.prototype,"showAvatar",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"datePattern",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"timestampAlignment",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"DateSeparatorPattern",void 0),L([(0,K.Input)(),G("design:type",Array)],Ma.prototype,"templates",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.MessagesRequestBuilder)],Ma.prototype,"messagesRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",String)],Ma.prototype,"newMessageIndicatorText",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ma.prototype,"scrollToBottomOnNewMessages",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"thresholdValue",void 0),L([(0,K.Input)(),G("design:type",Object)],Ma.prototype,"onThreadRepliesClick",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ma.prototype,"headerView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ma.prototype,"footerView",void 0),L([(0,K.Input)(),G("design:type",Number)],Ma.prototype,"parentMessageId",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Ma.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",J.BaseStyle)],Ma.prototype,"backdropStyle",void 0),L([(0,K.Input)(),G("design:type",J.DateStyle)],Ma.prototype,"dateSeparatorStyle",void 0),L([(0,K.Input)(),G("design:type",t.MessageListStyle)],Ma.prototype,"messageListStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],Ma.prototype,"onError",void 0),Ma=L([(0,K.Component)({selector:"cometchat-message-list",templateUrl:"./cometchat-message-list.component.html",styleUrls:["./cometchat-message-list.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.NgZone,K.ChangeDetectorRef,q])],Ma);let xa=class{constructor(s,i){this.ref=s,this.themeService=i,this.hideMessageComposer=!1,this.messageHeaderConfiguration=new t.MessageHeaderConfiguration({}),this.messageListConfiguration=new t.MessageListConfiguration({}),this.messageComposerConfiguration=new t.MessageComposerConfiguration({}),this.threadedMessageConfiguration=new t.ThreadedMessagesConfiguration({}),this.detailsConfiguration=new t.DetailsConfiguration({}),this.messagesStyle={width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)",messageTextColor:"rgba(20, 20, 20, 0.33)",messageTextFont:"700 22px Inter"},this.hideMessageHeader=!1,this.hideDetails=!1,this.callButtonsStyle={width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent",buttonPadding:"0",buttonBackground:"transparent",buttonBorder:"0 4px",buttonBorderRadius:"8px"},this.messageToBeEdited=null,this.liveReaction=!1,this.reactionName="assets/heart-reaction.png",this.messageToReact=null,this.composerStyles={width:"100%",height:"100%",border:"none",borderRadius:"12px",background:this.themeService.theme.palette.getAccent900(),inputBackground:this.themeService.theme.palette.getSecondary(),textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent()},this.liveReactionTimeout=0,this.openThreadedMessages=!1,this.disableUsersPresence=!1,this.protectedGroupIcon="assets/Locked.svg",this.privateGroupIcon="assets/Private.svg",this.headerStyle=new t.MessageHeaderStyle({}),this.backButtonIconURL="assets/backbutton.svg",this.hideBackIcon=!0,this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px",border:"none",backgroundColor:"white",nameTextColor:"rgb(20,20,20)",backgroundSize:"cover",nameTextFont:"500 16px Inter",outerViewBorder:"",outerViewBorderSpacing:""},this.statusIndicatorStyle={borderRadius:"16px",width:"10px",height:"10px",border:"none"},this.messageHeaderStyle={width:"100%",height:"100%",background:"transparent",border:"none",borderRadius:"0",backButtonIconTint:"#3399FF",onlineStatusColor:"#00f300",subtitleTextColor:"grey",subtitleTextFont:"400 14px Inter",typingIndicatorTextColor:"#3399FF",typingIndicatorTextFont:"400 13px Inter"},this.listItemStyle={background:"white",titleColor:"black",titleFont:"500 16px Inter",width:"",height:"100%",border:"none",borderRadius:"2px",separatorColor:"",activeBackground:"transparent",hoverBackground:"transparent"},this.infoIconStyle="assets/Info.svg",this.detailsButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:"#3399FF",padding:"0 8px"},this.enableCalling=!1,this.openDetails=!1,this.openThreadView=(e,t)=>{this.threadMessageObject=e,this.parentBubbleView=t,this.openThreadedMessages=!0,this.ref.detectChanges()},this.openDetailsPage=()=>{this.openDetails=!0},this.closeDetailsPage=()=>{this.openDetails=!1},this.closeThreadView=()=>{this.threadMessageObject=null,this.openThreadedMessages=!1,this.ref.detectChanges()},this.liveReactionStart=e=>{this.liveReaction&&(this.reactionName="",this.liveReaction=!1,this.ref.detectChanges()),this.reactionName=e,this.liveReaction=!0,this.ref.detectChanges(),setTimeout((()=>{this.reactionName="",this.liveReaction=!1,this.ref.detectChanges()}),1500),this.ref.detectChanges()}}ngOnInit(){this.subscribeToEvents(),this.setMessagesStyle(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),o.names.includes("calling")&&(this.enableCalling=!0)}subscribeToEvents(){this.ccLiveReaction=e.CometChatMessageEvents.ccLiveReaction.subscribe((e=>{this.liveReactionStart(e),this.ref.detectChanges()})),this.ccGroupDeleted=e.CometChatGroupEvents.ccGroupDeleted.subscribe((e=>{this.group&&this.group.getGuid()==e.getGuid()&&(this.openDetails=!1,this.openThreadedMessages=!1,this.group=e,this.ref.detectChanges())})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{var t;this.group&&this.group.getGuid()==e.leftGroup.getGuid()&&((null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())==(null==e?void 0:e.userLeft.getUid())&&(this.openDetails=!1,this.openThreadedMessages=!1),this.group=e.leftGroup,this.ref.detectChanges())})),this.ccUserBlocked=e.CometChatUserEvents.ccUserBlocked.subscribe((e=>{this.user&&e.getUid()==this.user.getUid()&&(this.user=e,this.ref.detectChanges())})),this.ccUserUnBlocked=e.CometChatUserEvents.ccUserUnblocked.subscribe((e=>{this.user&&e.getUid()==this.user.getUid()&&(this.user=e,this.ref.detectChanges())}))}unsubscribeToEvents(){var e,t,s,i,o;null===(e=this.ccLiveReaction)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupDeleted)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupLeft)||void 0===s||s.unsubscribe(),null===(i=this.ccUserBlocked)||void 0===i||i.unsubscribe(),null===(o=this.ccUserUnBlocked)||void 0===o||o.unsubscribe()}setMessagesStyle(){let s=new t.MessagesStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",messageTextColor:this.themeService.theme.palette.getAccent600(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1)});this.messagesStyle=Object.assign(Object.assign({},s),this.messagesStyle)}getAuxilaryView(){return this.messageHeaderConfiguration.menu?this.messageHeaderConfiguration.menu:this.auxiliaryMenu?this.auxiliaryMenu:null}ngOnChanges(t){try{(t[e.CometChatUIKitConstants.MessageReceiverType.user]||t[e.CometChatUIKitConstants.MessageReceiverType.group])&&(this.openThreadedMessages=!1,this.openDetails=!1,this.user?1===Object.keys(this.user).length&&s.CometChat.getUser(this.user).then((e=>{this.user=e})):this.group&&1===Object.keys(this.group).length&&s.CometChat.getGroup(this.group).then((e=>{this.group=e})))}catch(e){this.onError&&this.onError(e)}}ngOnDestroy(){this.ccLiveReaction.unsubscribe(),this.openThreadedMessages=!1,this.openDetails=!1}chatListStyle(){return{background:this.messagesStyle.background||this.themeService.theme.palette.getBackground(),height:this.messagesStyle.height,width:this.messagesStyle.width,border:this.messagesStyle.border,borderRadius:this.messagesStyle.borderRadius}}addMessage(e){this.messageListRef.addMessage(e)}updateMessage(e,t=!1){this.messageListRef.updateMessage(e,t)}removeMessage(e){this.messageListRef.removeMessage(e)}deleteMessage(e){this.messageListRef.deleteMessage(e)}sendTextMessage(e){this.messageComposerRef.sendTextMessage(e)}previewMessage(e,t=""){this.messageComposerRef.messageToBeEdited=e,this.messageComposerRef.openEditPreview()}};L([(0,K.ViewChild)("messageComposerRef",{static:!1}),G("design:type",Ta)],xa.prototype,"messageComposerRef",void 0),L([(0,K.ViewChild)("messageListRef",{static:!1}),G("design:type",Ma)],xa.prototype,"messageListRef",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],xa.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],xa.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",Boolean)],xa.prototype,"hideMessageComposer",void 0),L([(0,K.Input)(),G("design:type",Boolean)],xa.prototype,"disableTyping",void 0),L([(0,K.Input)(),G("design:type",t.MessageHeaderConfiguration)],xa.prototype,"messageHeaderConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.MessageListConfiguration)],xa.prototype,"messageListConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.MessageComposerConfiguration)],xa.prototype,"messageComposerConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.ThreadedMessagesConfiguration)],xa.prototype,"threadedMessageConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.DetailsConfiguration)],xa.prototype,"detailsConfiguration",void 0),L([(0,K.Input)(),G("design:type",String)],xa.prototype,"customSoundForIncomingMessages",void 0),L([(0,K.Input)(),G("design:type",String)],xa.prototype,"customSoundForOutgoingMessages",void 0),L([(0,K.Input)(),G("design:type",Boolean)],xa.prototype,"disableSoundForMessages",void 0),L([(0,K.Input)(),G("design:type",t.MessagesStyle)],xa.prototype,"messagesStyle",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],xa.prototype,"messageHeaderView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],xa.prototype,"messageComposerView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],xa.prototype,"messageListView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],xa.prototype,"hideMessageHeader",void 0),L([(0,K.Input)(),G("design:type",Boolean)],xa.prototype,"hideDetails",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],xa.prototype,"auxiliaryMenu",void 0),xa=L([(0,K.Component)({selector:"cometchat-messages",templateUrl:"./cometchat-messages.component.html",styleUrls:["./cometchat-messages.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],xa);let wa=class{constructor(s,i,o){this.elementRef=s,this.ref=i,this.themeService=o,this.isMobileView=!1,this.messageText=(0,e.localize)("NO_CHATS_SELECTED"),this.conversationsWithMessagesStyle={},this.messagesConfiguration=new t.MessagesConfiguration({}),this.conversationConfiguration=new t.ConversationsConfiguration({}),this.onError=e=>{console.log(e)},this.theme=new e.CometChatTheme({}),this.labelStyle={background:"transparent",textFont:"700 22px Inter",textColor:"rgba(20, 20, 20, 0.33)"},this.hideSearch=!0,this.onBack=()=>{this.user=null,this.group=null,this.activeConversation=null},this.onItemClick=t=>{this.activeConversation=t,t.getConversationType()&&t.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.user?(this.group=null,this.user=t.getConversationWith(),this.ref.detectChanges()):t.getConversationType()&&t.getConversationType()==e.CometChatUIKitConstants.MessageReceiverType.group&&(this.user=null,this.group=t.getConversationWith(),this.ref.detectChanges())},this.emptyMessageStyle=()=>({background:this.conversationsWithMessagesStyle.background||this.themeService.theme.palette.getBackground(),height:this.conversationsWithMessagesStyle.height,width:`calc(${this.conversationsWithMessagesStyle.width} - 280px)`,border:this.conversationsWithMessagesStyle.border,borderRadius:this.conversationsWithMessagesStyle.borderRadius}),this.chatsWrapperStyles=()=>({height:this.conversationsWithMessagesStyle.height,width:this.conversationsWithMessagesStyle.width,border:this.conversationsWithMessagesStyle.border,borderRadius:this.conversationsWithMessagesStyle.borderRadius,background:this.conversationsWithMessagesStyle.background||this.themeService.theme.palette.getBackground()})}ngOnChanges(e){e.isMobileView&&(this.isMobileView?(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!1,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration)):this.isMobileView||(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!0,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration)),this.updateBackdropHeight()),(e.user||e.group)&&this.setActiveChat()}setWithMessagesStyle(){let s=new t.WithMessagesStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",messageTextColor:this.themeService.theme.palette.getAccent600(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1)});this.conversationsWithMessagesStyle=Object.assign(Object.assign({},s),this.conversationsWithMessagesStyle),this.labelStyle.textFont=this.conversationsWithMessagesStyle.messageTextFont,this.labelStyle.textColor=this.conversationsWithMessagesStyle.messageTextColor}ngAfterViewInit(){this.updateBackdropHeight()}updateBackdropHeight(){let e={height:this.elementRef.nativeElement.offsetHeight+"px",width:this.elementRef.nativeElement.offsetWidth+"px",background:"rgba(0, 0, 0, 0.5)"};this.messagesConfiguration.messageListConfiguration.backdropStyle=e,this.conversationConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.backdropStyle=e,this.messagesConfiguration.messageComposerConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.groupMembersConfiguration.backdropStyle=e,this.ref.detectChanges()}setActiveChat(){var t,i;let o=this.user?e.CometChatUIKitConstants.MessageReceiverType.user:e.CometChatUIKitConstants.MessageReceiverType.group;this.activeConversation=null;let n=(null===(t=this.user)||void 0===t?void 0:t.getUid())||(null===(i=this.group)||void 0===i?void 0:i.getGuid());s.CometChat.getConversation(n,o).then((e=>{this.activeConversation=e,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)}))}ngOnInit(){this.setWithMessagesStyle(),this.messagesConfiguration.messageHeaderConfiguration.onBack||(this.messagesConfiguration.messageHeaderConfiguration.onBack=this.onBack),this.subscribeToEvents(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)}))}ngOnDestroy(){this.unsubscribeToEvents()}subscribeToEvents(){this.ccConversationDeleted=e.CometChatConversationEvents.ccConversationDeleted.subscribe((e=>{this.removeActiveChatList(e)})),this.ccGroupDeleted=e.CometChatGroupEvents.ccGroupDeleted.subscribe((e=>{this.group&&e.getGuid()==this.group.getGuid()&&(this.group=null,this.activeConversation=null,this.ref.detectChanges())})),this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.userAddedIn.getGuid())&&(this.group,null==e||e.userAddedIn,this.ref.detectChanges())})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group,null==e||e.kickedFrom,this.ref.detectChanges())})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.joinedGroup.getGuid())&&(this.group,null==e||e.joinedGroup,this.ref.detectChanges())})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group,null==e||e.kickedFrom,this.ref.detectChanges())})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{var t;this.group&&this.group.getGuid()==(null==e?void 0:e.group.getGuid())&&(this.group,null==e||e.group,null===(t=this.activeConversation)||void 0===t||t.setConversationWith(this.group),this.ref.detectChanges())})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{var t,s;this.group&&this.group.getGuid()==(null==e?void 0:e.leftGroup.getGuid())&&(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())==(null===(s=null==e?void 0:e.userLeft)||void 0===s?void 0:s.getUid())&&(this.group,this.activeConversation=null)}))}unsubscribeToEvents(){var e,t,s,i,o,n,r,a;null===(e=this.ccConversationDeleted)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupDeleted)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberAdded)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberBanned)||void 0===i||i.unsubscribe(),null===(o=this.ccGroupMemberJoined)||void 0===o||o.unsubscribe(),null===(n=this.ccGroupMemberKicked)||void 0===n||n.unsubscribe(),null===(r=this.ccOwnershipChanged)||void 0===r||r.unsubscribe(),null===(a=this.ccGroupLeft)||void 0===a||a.unsubscribe()}removeActiveChatList(t){const s=t.getConversationType(),i=t.getConversationWith();if(s===e.CometChatUIKitConstants.MessageReceiverType.user&&this.user&&this.user.getUid()===i.getUid())this.user=null,this.ref.detectChanges();else{if(s!==e.CometChatUIKitConstants.MessageReceiverType.group||!this.group||this.group.getGuid()!==i.getGuid())return;this.group=null,this.ref.detectChanges()}}};L([(0,K.ViewChild)("conversationRef",{static:!1}),G("design:type",fa)],wa.prototype,"conversationRef",void 0),L([(0,K.ViewChild)("messagesRef",{static:!1}),G("design:type",xa)],wa.prototype,"messageListRef",void 0),L([(0,K.Input)(),G("design:type",Object)],wa.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",Object)],wa.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",Boolean)],wa.prototype,"isMobileView",void 0),L([(0,K.Input)(),G("design:type",String)],wa.prototype,"messageText",void 0),L([(0,K.Input)(),G("design:type",t.WithMessagesStyle)],wa.prototype,"conversationsWithMessagesStyle",void 0),L([(0,K.Input)(),G("design:type",t.MessagesConfiguration)],wa.prototype,"messagesConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.ConversationsConfiguration)],wa.prototype,"conversationConfiguration",void 0),L([(0,K.Input)(),G("design:type",Object)],wa.prototype,"onError",void 0),wa=L([(0,K.Component)({selector:"cometchat-conversations-with-messages",templateUrl:"./cometchat-conversations-with-messages.component.html",styleUrls:["./cometchat-conversations-with-messages.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ElementRef,K.ChangeDetectorRef,q])],wa);let Ea=class{constructor(s,i){this.ref=s,this.themeService=i,this.messageBubbleStyle={width:"100%",height:"auto",background:"",borderRadius:"12px",border:"none"},this.alignment=t.MessageBubbleAlignment.right,this.options=[],this.id=void 0,this.optionsStyle={width:"",height:"",border:"1px solid #e8e8e8",borderRadius:"8px",submenuWidth:"100%",submenuHeight:"100%",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",moreIconTint:"grey"},this.moreIconURL="assets/moreicon.svg",this.topMenuSize=3,this.theme=new e.CometChatTheme({}),this.uikitConstant=t.MessageBubbleAlignment,this.isHovering=!1,this.wrapperStyle=()=>{switch(this.alignment){case t.MessageBubbleAlignment.right:return{display:"flex",justifyContent:"flex-end"};case t.MessageBubbleAlignment.left:return{display:"flex",justifyContent:"flex-start"};case t.MessageBubbleAlignment.center:default:return{display:"flex",justifyContent:"center"}}},this.bubbleStyle=()=>Object.assign(Object.assign({},this.messageBubbleStyle),{display:"flex",flexDirection:"column",alignItems:"flex-start"}),this.optionsStyles=()=>({justifyContent:this.alignment==t.MessageBubbleAlignment.left?"flex-start":"flex-end",top:this.headerView&&this.alignment==t.MessageBubbleAlignment.left?"-4px":"-24px",background:this.themeService.theme.palette.getBackground()})}ngOnChanges(e){}ngOnInit(){this.optionsStyle=new J.MenuListStyle({border:`1px solid ${this.themeService.theme.palette.getAccent200()}`,borderRadius:"8px",background:this.themeService.theme.palette.getBackground(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${this.themeService.theme.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:this.themeService.theme.palette.getBackground(),moreIconTint:this.themeService.theme.palette.getAccent()})}hideShowMenuOption(e){this.isHovering="mouseenter"===(null==e?void 0:e.type),this.ref.detectChanges()}onOptionClick(e){var t,s,i;const o=null===(s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.data)||void 0===s?void 0:s.onClick;o&&o(this.id,null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.event)}bubbleAlignmentStyle(){return{display:"flex",justifyContent:"flex-start",alignItems:this.alignment==t.MessageBubbleAlignment.left?"flex-start":"flex-end"}}titleStyle(){return{display:"flex",justifyContent:this.alignment==t.MessageBubbleAlignment.left?"flex-start":"flex-end",alignItems:"flex-start"}}};L([(0,K.Input)(),G("design:type",t.BaseStyle)],Ea.prototype,"messageBubbleStyle",void 0),L([(0,K.Input)(),G("design:type",Number)],Ea.prototype,"alignment",void 0),L([(0,K.Input)(),G("design:type",Array)],Ea.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"id",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"leadingView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"headerView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"replyView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"contentView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"threadView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"footerView",void 0),L([(0,K.Input)(),G("design:type",Object)],Ea.prototype,"bottomView",void 0),L([(0,K.Input)(),G("design:type",String)],Ea.prototype,"moreIconURL",void 0),L([(0,K.Input)(),G("design:type",Number)],Ea.prototype,"topMenuSize",void 0),Ea=L([(0,K.Component)({selector:"cometchat-message-bubble",templateUrl:"./cometchat-message-bubble.component.html",styleUrls:["./cometchat-message-bubble.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Ea);let Aa=class{};Aa=L([(0,K.NgModule)({declarations:[Ea],imports:[W.CommonModule],exports:[Ea],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Aa);let ka=class{};ka=L([(0,K.NgModule)({declarations:[Ma],imports:[W.CommonModule,Aa,Ei],exports:[Ma],providers:[W.DatePipe],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ka);let _a=class{};_a=L([(0,K.NgModule)({declarations:[Ta],imports:[W.CommonModule],exports:[Ta],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],_a);let Ra=class{constructor(s,i){this.ref=s,this.themeService=i,this.title=(0,e.localize)("THREAD"),this.closeIconURL="assets/close2x.svg",this.messageListConfiguration=new t.MessageListConfiguration({}),this.messageComposerConfiguration=new t.MessageComposerConfiguration({}),this.threadedMessagesStyle={width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)",titleColor:"rgba(20, 20, 20)",titleFont:"700 22px Inter",closeIconTint:"#3399FF"},this.limit=30,this.composerStyles={width:"100%",height:"100%",border:"none",borderRadius:"12px",background:this.themeService.theme.palette.getAccent900(),inputBackground:this.themeService.theme.palette.getSecondary(),textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent()},this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px",border:"none",backgroundColor:"white",nameTextColor:"rgb(20,20,20)",backgroundSize:"cover",nameTextFont:"500 16px Inter",outerViewBorder:"",outerViewBorderSpacing:""},this.statusIndicatorStyle={borderRadius:"16px",width:"10px",height:"10px",border:"none"},this.listItemStyle={background:"white",titleColor:"black",titleFont:"500 16px Inter",width:"",height:"100%",border:"none",borderRadius:"2px",separatorColor:"",activeBackground:"transparent",hoverBackground:"transparent"},this.actionButtonStyle={height:"100%",width:"100%",border:"none",borderTop:"1px solid #e1e1e1",borderBottom:"1px solid #e1e1e1",borderRadius:"0",background:"transparent",buttonTextFont:"500 15px Inter",buttonTextColor:"black",padding:"8px"},this.buttonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:"#7dbfff"},this.titleStyle={textFont:"700 22px Inter",textColor:"black",background:"transparent"},this.msgListenerId="message_"+(new Date).getTime()}ngOnInit(){this.requestBuilder=(new s.CometChat.MessagesRequestBuilder).setCategories(o.getDataSource().getAllMessageCategories()).setTypes(o.getDataSource().getAllMessageTypes()).hideReplies(!0).setLimit(this.limit).setParentMessageId(this.parentMessage.getId()),this.addMessageEventListeners(),s.CometChat.getLoggedinUser().then((e=>{var t,i,o,n,r,a,l;this.loggedInUser=e,(null===(t=this.parentMessage)||void 0===t?void 0:t.getSender().getUid())===(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())?((null===(o=this.parentMessage)||void 0===o?void 0:o.getReceiverType())===s.CometChat.RECEIVER_TYPE.USER?this.user=this.parentMessage.getReceiver():this.group=this.parentMessage.getReceiver(),this.ref.detectChanges()):(null===(n=this.parentMessage)||void 0===n?void 0:n.getReceiverType())===s.CometChat.RECEIVER_TYPE.USER?(this.user=null===(r=this.parentMessage)||void 0===r?void 0:r.getSender(),this.ref.detectChanges()):(null===(a=this.parentMessage)||void 0===a?void 0:a.getReceiverType())===s.CometChat.RECEIVER_TYPE.GROUP&&(this.group=null===(l=this.parentMessage)||void 0===l?void 0:l.getReceiver(),this.ref.detectChanges())})).catch((e=>{this.onError&&this.onError(e)})),this.setTheme(),this.subscribeToEvents()}ngOnChanges(e){}ngOnDestroy(){this.unsubscribeToEvents();try{s.CometChat.removeMessageListener(this.msgListenerId)}catch(e){this.onError&&this.onError(e)}}updateMessage(e){var t;(null===(t=this.parentMessage)||void 0===t?void 0:t.getId())==e.getId()&&(this.parentMessage=e,this.ref.detectChanges())}updateReceipt(e){var t;Number(null==e?void 0:e.getMessageId())==(null===(t=this.parentMessage)||void 0===t?void 0:t.getId())&&(e.getReadAt()?this.parentMessage.setReadAt(e.getReadAt()):e.getDeliveredAt()&&this.parentMessage.setDeliveredAt(e.getDeliveredAt()),this.ref.detectChanges())}addMessageEventListeners(){try{s.CometChat.addMessageListener(this.msgListenerId,new s.CometChat.MessageListener({onMessagesDelivered:e=>{this.updateReceipt(e)},onMessagesRead:e=>{this.updateReceipt(e)},onMessageDeleted:e=>{this.updateMessage(e)},onMessageEdited:e=>{this.updateMessage(e)}}))}catch(e){this.onError&&this.onError(e)}}getThreadCount(){var t;const s=(null===(t=this.parentMessage)||void 0===t?void 0:t.getReplyCount())||0;return`${s} ${1===s?(0,e.localize)("REPLY"):(0,e.localize)("REPLIES")}`}subscribeToEvents(){this.ccMessageSent=e.CometChatMessageEvents.ccMessageSent.subscribe((({status:t,message:s})=>{var i;t===e.MessageStatus.success&&(null==s?void 0:s.getParentMessageId())===(null===(i=this.parentMessage)||void 0===i?void 0:i.getId())&&this.ref.detectChanges()})),this.ccMessageEdited=e.CometChatMessageEvents.ccMessageEdited.subscribe((({status:t,message:s})=>{var i;t===e.MessageStatus.success&&(null==s?void 0:s.getId())===(null===(i=this.parentMessage)||void 0===i?void 0:i.getId())&&this.ref.detectChanges()})),this.ccMessageDeleted=e.CometChatMessageEvents.ccMessageDeleted.subscribe((e=>{var t;(null==e?void 0:e.getId())===(null===(t=this.parentMessage)||void 0===t?void 0:t.getId())&&this.ref.detectChanges()})),this.ccMessageRead=e.CometChatMessageEvents.ccMessageRead.subscribe((e=>{var t;(null==e?void 0:e.getId())===(null===(t=this.parentMessage)||void 0===t?void 0:t.getId())&&this.ref.detectChanges()}))}unsubscribeToEvents(){var e,t,s,i;null===(e=this.ccMessageDeleted)||void 0===e||e.unsubscribe(),null===(t=this.ccMessageEdited)||void 0===t||t.unsubscribe(),null===(s=this.ccMessageRead)||void 0===s||s.unsubscribe(),null===(i=this.ccMessageSent)||void 0===i||i.unsubscribe()}closeView(){this.onClose&&this.onClose()}setThreadedMessagesStyle(){let s=new t.ThreadedMessagesStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",titleColor:this.themeService.theme.palette.getAccent(),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),closeIconTint:this.themeService.theme.palette.getPrimary()});this.threadedMessagesStyle=Object.assign(Object.assign({},s),this.threadedMessagesStyle)}setTheme(){this.setThreadedMessagesStyle(),this.buttonStyle.buttonIconTint=this.threadedMessagesStyle.closeIconTint||this.themeService.theme.palette.getPrimary(),this.actionButtonStyle.background=this.themeService.theme.palette.getBackground(),this.actionButtonStyle.buttonTextFont=(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),this.actionButtonStyle.buttonTextColor=this.themeService.theme.palette.getAccent600(),this.titleStyle={textFont:this.threadedMessagesStyle.titleFont||(0,e.fontHelper)(this.themeService.theme.typography.title1),textColor:this.threadedMessagesStyle.titleColor||this.themeService.theme.palette.getAccent(),background:"transparent"},this.ref.detectChanges()}wrapperStyle(){return{background:this.threadedMessagesStyle.background||this.themeService.theme.palette.getBackground(),height:this.threadedMessagesStyle.height,width:this.threadedMessagesStyle.width,border:this.threadedMessagesStyle.border,borderRadius:this.threadedMessagesStyle.borderRadius}}};L([(0,K.ViewChild)("messageComposerRef",{static:!1}),G("design:type",Ta)],Ra.prototype,"messageComposerRef",void 0),L([(0,K.ViewChild)("messageListRef",{static:!1}),G("design:type",Ma)],Ra.prototype,"messageListRef",void 0),L([(0,K.Input)(),G("design:type",Object)],Ra.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",Object)],Ra.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Object)],Ra.prototype,"parentMessage",void 0),L([(0,K.Input)(),G("design:type",String)],Ra.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",String)],Ra.prototype,"closeIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ra.prototype,"bubbleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ra.prototype,"messageActionView",void 0),L([(0,K.Input)(),G("design:type",t.MessageListConfiguration)],Ra.prototype,"messageListConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.MessageComposerConfiguration)],Ra.prototype,"messageComposerConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.ThreadedMessagesStyle)],Ra.prototype,"threadedMessagesStyle",void 0),Ra=L([(0,K.Component)({selector:"cometchat-threaded-messages",templateUrl:"./cometchat-threaded-messages.component.html",styleUrls:["./cometchat-threaded-messages.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Ra);let Ua=class{};Ua=L([(0,K.NgModule)({declarations:[Ra],imports:[W.CommonModule,ma,ka,_a],exports:[Ra],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ua);let Da=class{constructor(s,i){this.ref=s,this.themeService=i,this.title=(0,e.localize)("DETAILS"),this.closeButtonIconURL="assets/close2x.svg",this.hideProfile=!1,this.data=[],this.disableUsersPresence=!1,this.privateGroupIcon="assets/Private.svg",this.protectedGroupIcon="assets/Locked.svg",this.onError=e=>{console.log(e)},this.leaveButtonText=(0,e.localize)("TRANSFER_OWNERSHIP"),this.cancelButtonText=(0,e.localize)("CANCEL"),this.confirmDialogMessage=(0,e.localize)("TRANSFER_CONFIRM"),this.addMembersConfiguration=new t.AddMembersConfiguration({}),this.bannedMembersConfiguration=new t.BannedMembersConfiguration({}),this.groupMembersConfiguration=new t.GroupMembersConfiguration({}),this.transferOwnershipConfiguration=new t.TransferOwnershipConfiguration({}),this.leaveDialogStyle={confirmButtonBackground:"RGB(51, 153, 255)",cancelButtonBackground:"RGBA(20, 20, 20, 0.06)",confirmButtonTextColor:"white",confirmButtonTextFont:"600 15px Inter",cancelButtonTextColor:"black",cancelButtonTextFont:"600 15px Inter",titleFont:"",titleColor:"",messageTextFont:"400 13px Inter",messageTextColor:"RGBA(20, 20, 20, 0.58)",background:"white",border:"1px solid #F2F2F2",height:"220px",width:"360px"},this.backiconurl="assets/backbutton.svg",this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px",border:""},this.backdropStyle={height:"100%",width:"100%",background:"rgba(0, 0, 0, 0.5)"},this.avatarStyle={borderRadius:"16px",width:"28px",height:"28px",border:"none"},this.detailsStyle={width:"100%",height:"100%",border:"",borderRadius:"",padding:"0 100px"},this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"transparent",borderRadius:"grey",titleFont:"600 15px Inter",titleColor:"black",border:"",hoverBackground:"transparent",separatorColor:"rgb(222 222 222 / 46%)"},this.leaveGroupText=(0,e.localize)("LEAVE_GROUP"),this.leaveGroupMessage=(0,e.localize)("LEAVE_CONFIRM"),this.transferText=(0,e.localize)("TRANSFER_OWNERSHIP"),this.transferConfirm=(0,e.localize)("TRANSFER_CONFIRM"),this.defaultTemplate=[],this.loggedInUser=null,this.openViewMembersPage=!1,this.openBannedMembersPage=!1,this.openAddMembersPage=!1,this.confirmLeaveGroupModal=!1,this.openTransferOwnershipModal=!1,this.selectionmodeEnum=t.SelectionMode.multiple,this.statusColor={private:"",password:"#F7A500",public:""},this.closeButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.detailsStyle.closeButtonIconTint||this.themeService.theme.palette.getPrimary()},this.buttonStyle={height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",buttonTextColor:this.themeService.theme.palette.getPrimary()||"rgba(51, 153, 255)",buttonTextFont:"500 16px Inter"},this.dividerStyle={background:"rgb(222 222 222 / 46%)",height:"1px",width:"100%"},this.subtitleText="",this.userListenerId="userlist_"+(new Date).getTime(),this.checkStatusType=()=>{var e,t;return this.user&&!this.disableUsersPresence?this.statusColor[null===(e=this.user)||void 0===e?void 0:e.getStatus()]:this.statusColor[null===(t=this.group)||void 0===t?void 0:t.getType()]},this.onCloseClick=()=>{this.onClose&&this.onClose()},this.viewMembers=()=>{this.openViewMembersPage=!this.openViewMembersPage,this.openBannedMembersPage=!1,this.openAddMembersPage=!1},this.addMembers=()=>{this.openAddMembersPage=!this.openAddMembersPage,this.openBannedMembersPage=!1,this.openViewMembersPage=!1},this.bannedMembers=()=>{this.openAddMembersPage=!1,this.openViewMembersPage=!1,this.openBannedMembersPage=!this.openBannedMembersPage},this.openTransferOwnership=()=>{this.openTransferOwnershipModal=!this.openTransferOwnershipModal,this.confirmLeaveGroupModal=!1},this.subtitleStyle=()=>this.user&&this.user.getStatus()==e.CometChatUIKitConstants.userStatusType.online?{textFont:this.detailsStyle.subtitleTextFont,textColor:this.themeService.theme.palette.getPrimary()}:{textFont:this.detailsStyle.subtitleTextFont,textColor:this.detailsStyle.subtitleTextColor},this.getGroupIcon=t=>{let s;if(t)switch(t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=null}return s},this.getTemplateOptions=e=>e.options?e.options(this.user,this.group,e.id):[],this.wrapperStyle=()=>({width:this.detailsStyle.width,height:this.detailsStyle.height,border:this.detailsStyle.border,borderRadius:this.detailsStyle.borderRadius,background:this.detailsStyle.background}),this.marginStyle=()=>{var e;return{padding:null===(e=this.detailsStyle)||void 0===e?void 0:e.padding}}}getTitleStyle(){return{textFont:this.detailsStyle.titleTextFont||(0,e.fontHelper)(this.themeService.theme.typography.title1),textColor:this.detailsStyle.titleTextColor||this.themeService.theme.palette.getAccent()}}getCustomOptionView(e){return null==e?void 0:e.customView}ngOnChanges(e){(e.user||e.group)&&(this.loggedInUser?this.getTemplate():s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.getTemplate()})).catch((e=>{this.onError&&this.onError(e)})))}getTemplate(){var e;this.data&&(null===(e=this.data)||void 0===e?void 0:e.length)>0?(this.defaultTemplate=this.data,this.ref.detectChanges()):(this.defaultTemplate=t.DetailsUtils.getDefaultDetailsTemplate(this.loggedInUser,this.user,this.group,this.themeService.theme),this.ref.detectChanges())}removeListener(){s.CometChat.removeUserListener(this.userListenerId)}ngOnDestroy(){this.removeListener(),this.data=[],this.defaultTemplate=[],this.onClose&&this.onClose(),this.unsubscribeToEvents()}ngOnInit(){this.setThemeStyle(),this.subscribeToEvents(),this.statusColor.online=this.detailsStyle.onlineStatusColor||this.themeService.theme.palette.getSuccess(),this.attachListeners(),this.updateSubtitle()}subscribeToEvents(){this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.group=null==e?void 0:e.userAddedIn,this.group=null==e?void 0:e.userAddedIn,this.openAddMembersPage=!1,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.group=null==e?void 0:e.joinedGroup,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.group=null==e?void 0:e.kickedFrom,this.updateSubtitle(),this.ref.detectChanges()})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.group=null==e?void 0:e.kickedFrom,this.updateSubtitle(),this.ref.detectChanges()})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{this.group=null==e?void 0:e.group,this.updateSubtitle(),this.confirmLeaveGroupModal=!1,this.openTransferOwnershipModal=!1,this.ref.detectChanges()}))}unsubscribeToEvents(){var e,t,s,i,o;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberJoined)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberKicked)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberBanned)||void 0===i||i.unsubscribe(),null===(o=this.ccOwnershipChanged)||void 0===o||o.unsubscribe()}updateSubtitle(){var t;const s=null===(t=this.group)||void 0===t?void 0:t.getMembersCount(),i=(0,e.localize)(s>1?"MEMBERS":"MEMBER");this.subtitleText=this.user?this.user.getStatus():`${s} ${i}`,this.ref.detectChanges()}getButtonStyle(e){return{height:"100%",width:"100%",border:"none",borderRadius:"0",buttonTextFont:null==e?void 0:e.titleFont,buttonTextColor:null==e?void 0:e.titleColor,background:(null==e?void 0:e.backgroundColor)||"transparent"}}checkGroupType(){var t;let s="";if(this.group)switch(null===(t=this.group)||void 0===t?void 0:t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=""}return s}updateUserStatus(e){this.user&&this.user.getUid()&&this.user.getUid()===e.getUid()&&(this.user.setStatus(e.getStatus()),this.updateSubtitle())}attachListeners(){try{this.disableUsersPresence||s.CometChat.addUserListener(this.userListenerId,new s.CometChat.UserListener({onUserOnline:e=>{this.updateUserStatus(e)},onUserOffline:e=>{this.updateUserStatus(e)}}))}catch(e){console.log(e)}}getSectionHeaderStyle(e){return{textFont:e.titleFont,textColor:e.titleColor}}onOptionClick(t){var s,i;const{onClick:o,id:n}=t;if(o)o(null!==(s=this.user)&&void 0!==s?s:this.group);else switch(n){case e.CometChatUIKitConstants.UserOptions.viewProfile:(null===(i=this.user)||void 0===i?void 0:i.getLink())&&(window.location.href=this.user.getLink());break;case e.CometChatUIKitConstants.UserOptions.block:this.blockUser();break;case e.CometChatUIKitConstants.UserOptions.unblock:this.unBlockUser();break;case e.CometChatUIKitConstants.GroupOptions.viewMembers:this.viewMembers();break;case e.CometChatUIKitConstants.GroupOptions.addMembers:this.addMembers();break;case e.CometChatUIKitConstants.GroupOptions.bannedMembers:this.bannedMembers();break;case e.CometChatUIKitConstants.GroupOptions.leave:this.leaveGroup();break;case e.CometChatUIKitConstants.GroupOptions.delete:this.deleteGroup()}}onLeaveClick(){var t;this.group.getOwner()==(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())?(this.openTransferOwnershipModal=!0,this.confirmLeaveGroupModal=!1):s.CometChat.leaveGroup(this.group.getGuid()).then((t=>{this.group.setMembersCount(this.group.getMembersCount()-1),this.group.setHasJoined(!1),this.updateSubtitle(),this.ref.detectChanges(),this.openTransferOwnershipModal=!1,this.confirmLeaveGroupModal=!1,this.onClose&&this.onClose(),e.CometChatGroupEvents.ccGroupLeft.next({userLeft:this.loggedInUser,leftGroup:this.group,message:this.createUserLeftAction(this.loggedInUser,e.CometChatUIKitConstants.groupMemberAction.LEFT)})})).catch((e=>{this.onError&&this.onError(e)}))}createActionMessage(i,o){var n;let r=new s.CometChat.Action(this.group.getGuid(),e.CometChatUIKitConstants.MessageTypes.groupMember,e.CometChatUIKitConstants.MessageReceiverType.group,e.CometChatUIKitConstants.MessageCategory.action);return r.setAction(o),r.setActionBy(this.loggedInUser),r.setActionFor(this.group),r.setActionOn(i),r.setReceiver(this.group),r.setSender(this.loggedInUser),r.setConversationId("group_"+this.group.getGuid()),r.setMuid(t.CometChatUIKitUtility.ID()),r.setMessage(`${null===(n=this.loggedInUser)||void 0===n?void 0:n.getName()} ${o} ${i.getUid()}`),r.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),r.setNewScope(i.getScope()),r}createUserLeftAction(i,o){var n;let r=new s.CometChat.Action(this.group.getGuid(),e.CometChatUIKitConstants.MessageTypes.groupMember,e.CometChatUIKitConstants.MessageReceiverType.group,e.CometChatUIKitConstants.MessageCategory.action);return r.setAction(o),r.setActionBy(this.loggedInUser),r.setActionFor(this.group),r.setActionOn(i),r.setReceiver(this.group),r.setSender(this.loggedInUser),r.setConversationId("group_"+this.group.getGuid()),r.setMuid(t.CometChatUIKitUtility.ID()),r.setMessage(`${null===(n=this.loggedInUser)||void 0===n?void 0:n.getName()} ${o} ${i.getUid()}`),r.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),r}onCancelClick(){this.confirmLeaveGroupModal=!1}blockUser(){this.user&&!this.user.getBlockedByMe()&&s.CometChat.blockUsers([this.user.getUid()]).then((()=>{this.user.setBlockedByMe(!0),e.CometChatUserEvents.ccUserBlocked,this.getTemplate(),this.onClose&&this.onClose()})).catch((e=>{this.onError&&this.onError(e)}))}unBlockUser(){this.user&&this.user.getBlockedByMe()&&s.CometChat.unblockUsers([this.user.getUid()]).then((()=>{this.user.setBlockedByMe(!1),e.CometChatUserEvents.ccUserUnblocked.next(this.user),this.getTemplate()})).catch((e=>{this.onError&&this.onError(e)}))}leaveGroup(){var e;this.group.getOwner()==(null===(e=this.loggedInUser)||void 0===e?void 0:e.getUid())?(this.leaveButtonText=this.transferText,this.confirmDialogMessage=this.transferConfirm):(this.leaveButtonText=this.leaveGroupText,this.confirmDialogMessage=this.leaveGroupMessage),this.confirmLeaveGroupModal=!0,this.ref.detectChanges()}deleteGroup(){var t;s.CometChat.deleteGroup(null===(t=this.group)||void 0===t?void 0:t.getGuid()).then((()=>{e.CometChatGroupEvents.ccGroupDeleted.next(this.group),this.onClose&&this.onClose()})).catch((e=>{this.onError&&this.onError(e)}))}onCloseDetails(){this.onClose&&this.onClose()}getStatusIndicatorColor(e){return this.statusColor[null==e?void 0:e.getType()]}setThemeStyle(){this.setDetailsStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.setListItemStyle(),this.setConfirmDialogStyle(),this.statusColor.private=this.detailsStyle.privateGroupIconBackground,this.statusColor.online=this.detailsStyle.onlineStatusColor,this.statusColor.password=this.detailsStyle.passwordGroupIconBackground}setConfirmDialogStyle(){let t=new J.ConfirmDialogStyle({confirmButtonBackground:this.themeService.theme.palette.getPrimary(),cancelButtonBackground:this.themeService.theme.palette.getSecondary(),confirmButtonTextColor:this.themeService.theme.palette.getAccent900("light"),confirmButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),cancelButtonTextColor:this.themeService.theme.palette.getAccent900("dark"),cancelButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleColor:this.themeService.theme.palette.getAccent(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),messageTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),height:"100%",width:"350px",border:`1px solid ${this.themeService.theme.palette.getAccent200()}`,borderRadius:"8px"});this.leaveDialogStyle=Object.assign(Object.assign({},t),this.leaveDialogStyle)}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setDetailsStyle(){let s=new t.DetailsStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",closeButtonIconTint:this.themeService.theme.palette.getPrimary(),width:"100%",height:"100%",borderRadius:"",subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subtitleTextColor:this.themeService.theme.palette.getAccent600(),padding:"0 100px"});this.detailsStyle=Object.assign(Object.assign({},s),this.detailsStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Da.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.User)],Da.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Da.prototype,"hideProfile",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Da.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Da.prototype,"customProfileView",void 0),L([(0,K.Input)(),G("design:type",Array)],Da.prototype,"data",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Da.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"privateGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"protectedGroupIcon",void 0),L([(0,K.Input)(),G("design:type",Object)],Da.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],Da.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"leaveButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"cancelButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],Da.prototype,"confirmDialogMessage",void 0),L([(0,K.Input)(),G("design:type",t.AddMembersConfiguration)],Da.prototype,"addMembersConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.BannedMembersConfiguration)],Da.prototype,"bannedMembersConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.GroupMembersConfiguration)],Da.prototype,"groupMembersConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.TransferOwnershipConfiguration)],Da.prototype,"transferOwnershipConfiguration",void 0),L([(0,K.Input)(),G("design:type",J.ConfirmDialogStyle)],Da.prototype,"leaveDialogStyle",void 0),L([(0,K.Input)(),G("design:type",Object)],Da.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",t.BaseStyle)],Da.prototype,"backdropStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Da.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.DetailsStyle)],Da.prototype,"detailsStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Da.prototype,"listItemStyle",void 0),Da=L([(0,K.Component)({selector:"cometchat-details",templateUrl:"./cometchat-details.component.html",styleUrls:["./cometchat-details.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Da);let Ba=class{constructor(i,o){this.ref=i,this.themeService=o,this.disableUsersPresence=!1,this.backButtonIconURL="assets/backbutton.svg",this.closeButtonIconURL="assets/close2x.svg",this.showBackButton=!0,this.hideSeparator=!1,this.selectionMode=t.SelectionMode.none,this.searchPlaceholder="Search Members",this.searchIconURL="assets/search.svg",this.hideSearch=!0,this.title=(0,e.localize)("MEMBERS"),this.onError=e=>{console.log(e)},this.backdropStyle={height:"100%",width:"100%",background:"rgba(0, 0, 0, 0.5)"},this.loadingIconURL="assets/Spinner.svg",this.emptyStateText=(0,e.localize)("NO_GROUPS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.center,this.dropdownIconURL="assets/down-arrow.svg",this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px",border:""},this.avatarStyle={borderRadius:"16px",width:"32px",height:"32px"},this.groupMemberStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",padding:"0 100px"},this.groupScopeStyle=new J.ChangeScopeStyle({height:"200px",width:"280px"}),this.listItemStyle={height:"100%",width:"100%",background:"",activeBackground:"transparent",borderRadius:"grey",titleFont:"",titleColor:"",border:"",hoverBackground:"transparent",separatorColor:"rgba(222 222 222 / 46%)"},this.listStyle={},this.menuListStyle={width:"",height:"",border:"none",borderRadius:"8px",background:"white",submenuWidth:"100%",submenuHeight:"100%",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:"white",moreIconTint:"rgb(51, 153, 255)"},this.modalStyle={height:"212px",width:"360px",background:"white",borderRadius:"12px",border:"none"},this.limit=30,this.moreIconURL="assets/moreicon.svg",this.searchKeyword="",this.onScrolledToBottom=null,this.isString=e=>"string"==typeof e,this.isArray=e=>"object"==typeof e&&(null==e?void 0:e.length)>0,this.getOptions=e=>{var s;return t.GroupMemberUtils.getViewMemberOptions(e,this.group,null===(s=this.loggedInUser)||void 0===s?void 0:s.getUid(),this.themeService.theme)},this.titleAlignmentEnum=t.TitleAlignment,this.selectionmodeEnum=t.SelectionMode,this.state=t.States.loading,this.groupMembers=[],this.scopes=[],this.membersListenerId="memberlist_"+(new Date).getTime(),this.changeScope=!1,this.memberScope=[],this.membersList=[],this.getStatusIndicatorColor=t=>this.disableUsersPresence?null:(null==t?void 0:t.getStatus())==e.CometChatUIKitConstants.userStatusType.online?this.groupMemberStyle.onlineStatusColor||this.themeService.theme.palette.getSuccess():null,this.handleMenuAction=(s,i)=>{var o,n,r,a,l,h;if(null===(n=null===(o=null==s?void 0:s.detail)||void 0===o?void 0:o.data)||void 0===n?void 0:n.onClick)return void(null===(a=null===(r=null==s?void 0:s.detail)||void 0===r?void 0:r.data)||void 0===a||a.onClick(i));let c=null===(h=null===(l=null==s?void 0:s.detail)||void 0===l?void 0:l.data)||void 0===h?void 0:h.id;this.selectedMember=i,this.memberScope=t.GroupMemberUtils.allowScopeChange(this.group,i),c==e.CometChatUIKitConstants.GroupMemberOptions.changeScope?(this.changeScope=!0,this.scopes=[]):c==e.CometChatUIKitConstants.GroupMemberOptions.ban?(this.changeScope=!1,this.blockMember(i)):c==e.CometChatUIKitConstants.GroupMemberOptions.kick&&this.kickMember(i)},this.blockMember=t=>{s.CometChat.banGroupMember(this.group.getGuid(),t.getUid()).then((()=>{this.group.setMembersCount(this.group.getMembersCount()-1),this.addRemoveMember(t),this.ref.detectChanges(),e.CometChatGroupEvents.ccGroupMemberBanned.next({kickedBy:this.loggedInUser,kickedFrom:this.group,kickedUser:t,message:this.createActionMessage(t,e.CometChatUIKitConstants.groupMemberAction.BANNED)})}))},this.kickMember=t=>{s.CometChat.kickGroupMember(this.group.getGuid(),t.getUid()).then((()=>{this.group.setMembersCount(this.group.getMembersCount()-1),this.addRemoveMember(t),this.ref.detectChanges(),e.CometChatGroupEvents.ccGroupMemberKicked.next({kickedBy:this.loggedInUser,kickedFrom:this.group,kickedUser:t,message:this.createActionMessage(t,e.CometChatUIKitConstants.groupMemberAction.KICKED)})})).catch((e=>{this.onError&&this.onError(e)}))},this.updateMemberStatus=e=>{let t=[...this.groupMembers],s=t.findIndex(((t,s)=>t.getUid()==e.getUid()));if(s>-1){let i=t[s];i.setStatus(e.getStatus()),t.splice(s,1,i),this.groupMembers=[...t],this.ref.detectChanges()}},this.updateMember=e=>{let t=[...this.groupMembers],s=t.findIndex(((t,s)=>t.getUid()==e.getUid()));if(s>-1){let e=t[s];t.splice(s,1,e),this.groupMembers=[...t],this.ref.detectChanges()}},this.addRemoveMember=e=>{let t=[...this.groupMembers],s=t.findIndex(((t,s)=>t.getUid()==e.getUid()));s>-1?(t.splice(s,1),this.groupMembers=[...t],this.ref.detectChanges()):(this.groupMembers.push(e),this.ref.detectChanges())},this.fetchNextGroupMembers=()=>{if(this.onScrolledToBottom=null,this.groupsRequest&&this.groupsRequest.pagination&&(0==this.groupsRequest.pagination.current_page||this.groupsRequest.pagination.current_page!=this.groupsRequest.pagination.total_pages)){this.onScrolledToBottom=this.fetchNextGroupMembers,this.state=t.States.loading,this.ref.detectChanges();try{this.groupsRequest.fetchNext().then((e=>{var s,i;this.state=t.States.loading,e.length<=0&&(null===(s=this.groupMembers)||void 0===s?void 0:s.length)<=0||0===e.length&&(null===(i=this.groupMembers)||void 0===i?void 0:i.length)<=0?(this.state=t.States.empty,this.ref.detectChanges()):(this.state=t.States.loaded,this.groupMembers=[...this.groupMembers,...e],this.ref.detectChanges())}),(e=>{console.log(e),this.state=t.States.error,this.ref.detectChanges()}))}catch(e){console.log(e),this.state=t.States.error,this.ref.detectChanges()}}else this.state=t.States.loaded},this.onSearch=e=>{this.searchKeyword=e,clearTimeout(this.timeout),this.timeout=setTimeout((()=>{const e=this.searchRequestBuilder?this.searchRequestBuilder.setSearchKeyword(this.searchKeyword).build():this.getRequestBuilder();this.groupsRequest=e,this.groupMembers=[],this.fetchNextGroupMembers()}),500)},this.membersStyle=()=>({padding:this.groupMemberStyle.padding}),this.backButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.groupMemberStyle.backButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.closeButtonStyle=()=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:this.groupMemberStyle.closeButtonIconTint||this.themeService.theme.palette.getPrimary()}),this.wrapperStyle=()=>({height:this.groupMemberStyle.height,width:this.groupMemberStyle.width,background:this.groupMemberStyle.background||this.themeService.theme.palette.getBackground(),border:this.groupMemberStyle.border,borderRadius:this.groupMemberStyle.borderRadius}),this.getScopeStyle=()=>({textFont:this.groupScopeStyle.textFont,textColor:this.groupScopeStyle.textColor})}closeClicked(){this.onClose&&this.onClose()}backClicked(){this.onBack&&this.onBack()}ngOnInit(){this.onScrolledToBottom=this.fetchNextGroupMembers,this.setThemeStyle(),this.attachListeners(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e,this.groupsRequest=this.getRequestBuilder(),this.fetchNextGroupMembers()})).catch((e=>{this.onError&&this.onError(e)}))}ngOnDestroy(){this.removeListener()}changeMemberScope(t){var i;s.CometChat.updateGroupMemberScope(this.group.getGuid(),this.selectedMember.getUid(),null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.value).then((s=>{var i,o,n;let r=null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.value;this.changeScope=!1,null===(o=this.selectedMember)||void 0===o||o.setScope(r),this.updateMember(this.selectedMember),this.ref.detectChanges(),e.CometChatGroupEvents.ccGroupMemberScopeChanged.next({scopeChangedFrom:null===(n=this.selectedMember)||void 0===n?void 0:n.getScope(),scopeChangedTo:r,message:this.createActionMessage(this.selectedMember,e.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE),group:this.group,updatedUser:this.selectedMember}),this.selectedMember=null,this.changeScope=!1})).catch((e=>{this.changeScope=!1,this.selectedMember=null,this.ref.detectChanges()}))}createActionMessage(i,o){var n;let r=new s.CometChat.Action(this.group.getGuid(),e.CometChatUIKitConstants.MessageTypes.groupMember,e.CometChatUIKitConstants.MessageReceiverType.group,e.CometChatUIKitConstants.MessageCategory.action);return r.setAction(o),r.setActionBy(this.loggedInUser),r.setActionFor(this.group),r.setActionOn(i),r.setReceiver(this.group),r.setSender(this.loggedInUser),r.setConversationId("group_"+this.group.getGuid()),r.setMuid(t.CometChatUIKitUtility.ID()),r.setMessage(`${null===(n=this.loggedInUser)||void 0===n?void 0:n.getName()} ${o} ${i.getUid()}`),r.setSentAt(t.CometChatUIKitUtility.getUnixTimestamp()),r.setReceiverType(e.CometChatUIKitConstants.MessageReceiverType.group),r.data={extras:{scope:{new:i.getScope()}}},r}attachListeners(){s.CometChat.addUserListener(this.membersListenerId,new s.CometChat.UserListener({onUserOnline:e=>{this.updateMemberStatus(e)},onUserOffline:e=>{this.updateMemberStatus(e)}})),s.CometChat.addGroupListener(this.membersListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,s,i,o)=>{var n;t.getUid()==(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())&&o.setScope(s),this.updateMember(t)},onGroupMemberKicked:(e,t,s,i)=>{this.addRemoveMember(t)},onGroupMemberBanned:(e,t,s,i)=>{this.addRemoveMember(t)},onGroupMemberUnbanned:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!1),this.addRemoveMember(t)},onMemberAddedToGroup:(e,t,i,o)=>{var n;let r=new s.CometChat.GroupMember(t.getUid(),s.CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT);r.setName(t.getName()),r.setGuid(this.group.getGuid()),r.setUid(t.getUid()),t.getUid()==(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())&&o.setHasJoined(!0),this.addRemoveMember(r)},onGroupMemberLeft:(e,t,s)=>{var i;t.getUid()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())&&s.setHasJoined(!1),this.addRemoveMember(t)},onGroupMemberJoined:(e,t,s)=>{this.addRemoveMember(t)}}))}removeListener(){s.CometChat.removeUserListener(this.membersListenerId),this.membersListenerId=""}getRequestBuilder(){return this.searchRequestBuilder?this.searchRequestBuilder.build():this.groupMemberRequestBuilder?this.groupMemberRequestBuilder.build():new s.CometChat.GroupMembersRequestBuilder(this.group.getGuid()).setLimit(this.limit).setSearchKeyword(this.searchKeyword).build()}setThemeStyle(){this.setGroupMembersStyle(),this.setScopeStyle(),this.setListItemStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.menuListStyle=new J.MenuListStyle({border:"none",borderRadius:"8px",background:"transparent",submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${this.themeService.theme.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:this.themeService.theme.palette.getBackground(),moreIconTint:this.themeService.theme.palette.getPrimary()}),this.modalStyle.boxShadow=`0px 0px 1px ${this.themeService.theme.palette.getAccent600()}`,this.modalStyle.background=this.themeService.theme.palette.getBackground(),this.ref.detectChanges()}setGroupMembersStyle(){let s=new t.GroupMembersStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),separatorColor:this.themeService.theme.palette.getAccent400(),width:"100%",height:"100%",borderRadius:"none",searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchBorderRadius:"8px",closeButtonIconTint:this.themeService.theme.palette.getPrimary(),backButtonIconTint:this.themeService.theme.palette.getPrimary(),padding:"0 100px"});this.groupMemberStyle=Object.assign(Object.assign({},s),this.groupMemberStyle),this.listStyle={titleTextFont:this.groupMemberStyle.titleTextFont||(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.groupMemberStyle.titleTextColor||this.themeService.theme.palette.getAccent(),emptyStateTextFont:this.groupMemberStyle.emptyStateTextFont,emptyStateTextColor:this.groupMemberStyle.emptyStateTextColor,errorStateTextFont:this.groupMemberStyle.errorStateTextFont,errorStateTextColor:this.groupMemberStyle.errorStateTextColor,loadingIconTint:this.groupMemberStyle.loadingIconTint,separatorColor:this.groupMemberStyle.separatorColor,searchIconTint:this.groupMemberStyle.searchIconTint,searchBorder:this.groupMemberStyle.searchBorder,searchBorderRadius:this.groupMemberStyle.searchBorderRadius,searchBackground:this.groupMemberStyle.searchBackground,searchPlaceholderTextFont:this.groupMemberStyle.searchPlaceholderTextFont,searchPlaceholderTextColor:this.groupMemberStyle.searchPlaceholderTextColor,searchTextFont:this.groupMemberStyle.searchTextFont,searchTextColor:this.groupMemberStyle.searchTextColor},this.ref.detectChanges()}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:""});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setScopeStyle(){let t=new J.ChangeScopeStyle({titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),activeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),activeTextColor:this.themeService.theme.palette.getAccent(),activeTextBackground:this.themeService.theme.palette.getAccent200(),arrowIconTint:this.themeService.theme.palette.getAccent900(),textFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),textColor:this.themeService.theme.palette.getAccent600(),optionBackground:this.themeService.theme.palette.getBackground(),optionBorder:"none",optionBorderRadius:"0",hoverTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),hoverTextColor:this.themeService.theme.palette.getAccent900(),hoverTextBackground:this.themeService.theme.palette.getAccent100(),buttonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),buttonTextColor:this.themeService.theme.palette.getAccent("dark"),buttonBackground:this.themeService.theme.palette.getPrimary(),closeIconTint:this.themeService.theme.palette.getPrimary(),background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent200()}`,borderRadius:"8px",height:"200px",width:"280px"});this.groupScopeStyle=Object.assign(Object.assign({},t),this.groupScopeStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.GroupMembersRequestBuilder)],Ba.prototype,"groupMemberRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.GroupMembersRequestBuilder)],Ba.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"tailView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ba.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],Ba.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"backButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ba.prototype,"showBackButton",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ba.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",Number)],Ba.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ba.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Object)],Ba.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",t.BaseStyle)],Ba.prototype,"backdropStyle",void 0),L([(0,K.Input)(),G("design:type",Function)],Ba.prototype,"onBack",void 0),L([(0,K.Input)(),G("design:type",Function)],Ba.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",Function)],Ba.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Ba.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Ba.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],Ba.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",String)],Ba.prototype,"dropdownIconURL",void 0),L([(0,K.Input)(),G("design:type",Object)],Ba.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Ba.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.GroupMembersStyle)],Ba.prototype,"groupMemberStyle",void 0),L([(0,K.Input)(),G("design:type",J.ChangeScopeStyle)],Ba.prototype,"groupScopeStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Ba.prototype,"listItemStyle",void 0),Ba=L([(0,K.Component)({selector:"cometchat-group-members",templateUrl:"./cometchat-group-members.component.html",styleUrls:["./cometchat-group-members.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Ba);let Oa=class{};Oa=L([(0,K.NgModule)({declarations:[Ba],imports:[W.CommonModule,fi,ma,Ca,Mi],exports:[Ba],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Oa);let Fa=class{constructor(t,i){this.ref=t,this.themeService=i,this.disableUsersPresence=!1,this.closeButtonIconURL="assets/close2x.svg",this.hideSeparator=!1,this.searchPlaceholder=(0,e.localize)("SEARCH"),this.searchIconURL="assets/search.svg",this.hideSearch=!0,this.title=(0,e.localize)("TRANSFER_OWNERSHIP"),this.onError=e=>{console.log(e)},this.loadingIconURL="assets/Spinner.svg",this.emptyStateText=(0,e.localize)("NO_GROUPS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.statusIndicatorStyle={height:"10px",width:"10px",borderRadius:"16px",border:""},this.transferOwnershipStyle={width:"360px",height:"650px",borderRadius:"8px"},this.transferButtonText=(0,e.localize)("TRANSFER_OWNERSHIP"),this.cancelButtonText=(0,e.localize)("CANCEL"),this.avatarStyle={borderRadius:"16px",width:"32px",height:"32px"},this.groupMemberStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"8px",padding:"0"},this.listItemStyle={height:"100%",width:"100%",background:"",borderRadius:"grey",titleFont:"",titleColor:"",border:"",separatorColor:"rgb(222 222 222 / 46%)"},this.titleAlignment=e.TitleAlignment.center,this.selectionMode=e.SelectionMode.single,this.showBackButton=!1,this.transferButtonStyle={height:"100%",width:"100%",background:"rgb(51, 153, 255)",padding:"8px",buttonTextColor:"white",buttonTextFont:"600 15px Inter, sans-serif",display:"flex",justifyContent:"center",alignItems:"center",border:"none",borderRadius:"8px"},this.cancelButtonStyle={height:"100%",width:"100%",background:"white",padding:"8px",buttonTextColor:"black",buttonTextFont:"600 15px Inter, sans-serif",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #e0e0e0",borderRadius:"8px"},this.onOwnerSelected=e=>{this.selectedMember=e},this.onTransferClick=()=>{var t;s.CometChat.getUser(null===(t=this.selectedMember)||void 0===t?void 0:t.getUid()).then((e=>{this.selectedUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.onTransferOwnership?(this.onTransferOwnership(this.selectedMember),this.selectedMember=null):this.selectedMember&&s.CometChat.transferGroupOwnership(this.group.getGuid(),this.selectedMember.getUid()).then((t=>{this.group.setOwner(this.selectedMember.getUid()),e.CometChatGroupEvents.ccOwnershipChanged.next({group:this.group,newOwner:this.selectedMember}),this.selectedMember=null})).catch((e=>{this.onError&&this.onError(e)}))},this.closeClicked=()=>{this.onClose&&this.onClose()},this.membersStyle=()=>({height:this.groupMemberStyle.height,width:this.groupMemberStyle.width,background:this.groupMemberStyle.background,border:this.groupMemberStyle.border,borderRadius:this.groupMemberStyle.borderRadius}),this.wrapperStyle=()=>({height:this.transferOwnershipStyle.height||"80vh",width:this.transferOwnershipStyle.width||"360px",background:this.transferOwnershipStyle.background,border:this.transferOwnershipStyle.border,borderRadius:this.transferOwnershipStyle.borderRadius}),this.getScopeStyle=()=>({textFont:this.transferOwnershipStyle.MemberScopeTextFont,textColor:this.transferOwnershipStyle.MemberScopeTextColor})}ngOnInit(){s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.setThemeStyle()}setThemeStyle(){this.setGroupMembersStyle(),this.setListItemStyle(),this.setAvatarStyle(),this.setownershipStyle(),this.setStatusStyle(),this.transferButtonStyle.buttonTextFont=this.transferOwnershipStyle.transferButtonTextFont||(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),this.transferButtonStyle.buttonTextColor=this.transferOwnershipStyle.transferButtonTextColor||this.themeService.theme.palette.getAccent900(),this.transferButtonStyle.background=this.themeService.theme.palette.getPrimary(),this.cancelButtonStyle.background=this.themeService.theme.palette.getSecondary(),this.cancelButtonStyle.buttonTextFont=this.transferOwnershipStyle.cancelButtonTextFont||(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),this.cancelButtonStyle.buttonTextColor=this.transferOwnershipStyle.cancelButtonTextColor||this.themeService.theme.palette.getAccent(),this.ref.detectChanges()}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setGroupMembersStyle(){let s=new t.GroupMembersStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),onlineStatusColor:this.themeService.theme.palette.getSuccess(),separatorColor:this.themeService.theme.palette.getAccent400(),width:"100%",height:"100%",borderRadius:"none",searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchBorderRadius:"8px",closeButtonIconTint:this.themeService.theme.palette.getPrimary(),backButtonIconTint:this.themeService.theme.palette.getPrimary(),padding:"0 100px"});this.groupMemberStyle=Object.assign(Object.assign({},s),this.groupMemberStyle),this.ref.detectChanges()}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"28px",height:"28px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"10px",width:"10px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setownershipStyle(){let s=new t.TransferOwnershipStyle({background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,MemberScopeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),MemberScopeTextColor:this.themeService.theme.palette.getAccent600(),transferButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),transferButtonTextColor:this.themeService.theme.palette.getAccent("dark"),cancelButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),cancelButtonTextColor:this.themeService.theme.palette.getAccent("light"),width:"360px",height:"650px",borderRadius:"8px"});this.transferOwnershipStyle=Object.assign(Object.assign({},s),this.transferOwnershipStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.GroupMembersRequestBuilder)],Fa.prototype,"groupMemberRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.GroupMembersRequestBuilder)],Fa.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Fa.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Fa.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Fa.prototype,"disableUsersPresence",void 0),L([(0,K.Input)(),G("design:type",Object)],Fa.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"closeButtonIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Fa.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Fa.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Object)],Fa.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],Fa.prototype,"onClose",void 0),L([(0,K.Input)(),G("design:type",Function)],Fa.prototype,"onTransferOwnership",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.Group)],Fa.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Fa.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Fa.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Fa.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Object)],Fa.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",t.TransferOwnershipStyle)],Fa.prototype,"transferOwnershipStyle",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"transferButtonText",void 0),L([(0,K.Input)(),G("design:type",String)],Fa.prototype,"cancelButtonText",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Fa.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.GroupMembersStyle)],Fa.prototype,"groupMemberStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Fa.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Number)],Fa.prototype,"titleAlignment",void 0),Fa=L([(0,K.Component)({selector:"cometchat-transfer-ownership",templateUrl:"./cometchat-transfer-ownership.component.html",styleUrls:["./cometchat-transfer-ownership.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Fa);let La=class{};La=L([(0,K.NgModule)({declarations:[Fa],imports:[W.CommonModule,fi,Oa],exports:[Fa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],La);let Ga=class{};Ga=L([(0,K.NgModule)({declarations:[Da],imports:[W.CommonModule,va,ba,Oa,La],exports:[Da],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ga);let Va=class{};Va=L([(0,K.NgModule)({declarations:[xa],imports:[W.CommonModule,ma,ka,_a,Ua,Ga,Ai],exports:[xa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Va);let Pa=class{};Pa=L([(0,K.NgModule)({declarations:[wa],imports:[W.CommonModule,Ia,Va,Co,aa],exports:[wa],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Pa);let Na=class{constructor(s,i){this.ref=s,this.themeService=i,this.hideSeparator=!1,this.selectionMode=t.SelectionMode.none,this.searchPlaceholder="Search Groups",this.hideError=!1,this.searchIconURL="assets/search.svg",this.hideSearch=!1,this.title=(0,e.localize)("GROUPS"),this.onError=e=>{console.log(e)},this.loadingIconURL="assets/Spinner.svg",this.privateGroupIcon="assets/Private.svg",this.protectedGroupIcon="assets/Locked.svg",this.emptyStateText=(0,e.localize)("NO_GROUPS_FOUND"),this.errorStateText=(0,e.localize)("SOMETHING_WRONG"),this.titleAlignment=t.TitleAlignment.left,this.selectionmodeEnum=t.SelectionMode,this.state=t.States.loading,this.statusIndicatorStyle={height:"12px",width:"12px",borderRadius:"16px"},this.avatarStyle={borderRadius:"16px",width:"32px",height:"32px"},this.groupsStyle={width:"100%",height:"100%",background:"",border:"",borderRadius:"",titleTextFont:"",titleTextColor:"",subTitleTextFont:"",subTitleTextColor:"",searchPlaceholderTextFont:"",searchPlaceholderTextColor:"",searchTextFont:"",searchTextColor:"",emptyStateTextFont:"",emptyStateTextColor:"",errorStateTextFont:"",errorStateTextColor:"",loadingIconTint:"",searchIconTint:"",searchBorder:"",searchBorderRadius:"",searchBackground:"",separatorColor:"rgb(222 222 222 / 46%)",privateGroupIconBackground:"",passwordGroupIconBackground:""},this.listItemStyle={},this.listStyle={},this.limit=30,this.searchKeyword="",this.groupsList=[],this.groupsListenerId="groupsList_"+(new Date).getTime(),this.loggedInUser=null,this.statusColor={private:"",password:"#F7A500",public:""},this.onScrolledToBottom=null,this.getGroupIcon=t=>{let s;if(t)switch(t.getType()){case e.CometChatUIKitConstants.GroupTypes.password:s=this.protectedGroupIcon;break;case e.CometChatUIKitConstants.GroupTypes.private:s=this.privateGroupIcon;break;default:s=null}return s},this.fetchNextGroupList=()=>{var e,s,i;if(this.onScrolledToBottom=null,this.state=t.States.loading,this.ref.detectChanges(),this.groupsRequest&&(null===(e=this.groupsRequest)||void 0===e?void 0:e.pagination)&&(0==(null===(s=this.groupsRequest.pagination)||void 0===s?void 0:s.current_page)||(null===(i=this.groupsRequest.pagination)||void 0===i?void 0:i.current_page)!=this.groupsRequest.pagination.total_pages)){this.onScrolledToBottom=this.fetchNextGroupList;try{this.groupsRequest.fetchNext().then((e=>{var s,i;e.length<=0&&(null===(s=this.groupsList)||void 0===s?void 0:s.length)<=0||0===e.length&&(null===(i=this.groupsList)||void 0===i?void 0:i.length)<=0?(this.state=t.States.empty,this.ref.detectChanges()):(this.state=t.States.loaded,this.groupsList=[...this.groupsList,...e],this.ref.detectChanges())}),(e=>{this.state=t.States.error,this.ref.detectChanges()}))}catch(e){this.state=t.States.error,this.ref.detectChanges()}}else this.state=t.States.loaded,this.ref.detectChanges()},this.onClick=e=>{this.onItemClick&&this.onItemClick(e)},this.getMemberCount=t=>t.getMembersCount()>1?t.getMembersCount()+" "+(0,e.localize)("MEMBERS"):t.getMembersCount()+" "+(0,e.localize)("MEMBER"),this.getActiveGroup=e=>{var s;return(this.selectionMode==t.SelectionMode.none||!this.selectionMode)&&e.getGuid()==(null===(s=this.activeGroup)||void 0===s?void 0:s.getGuid())},this.onSearch=e=>{try{this.searchKeyword=e,clearTimeout(this.timeout),this.timeout=setTimeout((()=>{this.groupsRequest=this.searchRequestBuilder?this.searchRequestBuilder.setSearchKeyword(this.searchKeyword).build():this.getRequestBuilder(),this.groupsList=[],this.ref.detectChanges(),this.fetchNextGroupList()}),500)}catch(e){this.onError&&this.onError(e)}},this.groupStyle=()=>({height:this.groupsStyle.height,width:this.groupsStyle.width,background:this.groupsStyle.background,border:this.groupsStyle.border,borderRadius:this.groupsStyle.borderRadius}),this.subtitleStyle=()=>({font:this.groupsStyle.subTitleTextFont,color:this.groupsStyle.subTitleTextColor}),this.state=t.States.loading}ngOnChanges(e){}ngOnInit(){this.onScrolledToBottom=this.fetchNextGroupList,this.setThemeStyle(),this.subscribeToEvents(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)})),this.state=t.States.loading,this.groupsRequest=this.getRequestBuilder(),this.fetchNextGroupList(),this.attachListeners()}subscribeToEvents(){this.ccGroupDeleted=e.CometChatGroupEvents.ccGroupDeleted.subscribe((e=>{this.removeGroup(e),this.activeGroup&&e.getGuid()==this.activeGroup.getGuid()&&(this.activeGroup=null,this.ref.detectChanges())})),this.ccGroupCreated=e.CometChatGroupEvents.ccGroupCreated.subscribe((e=>{this.addGroup(e),this.activeGroup||(this.activeGroup=e)})),this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.activeGroup&&this.activeGroup.getGuid()==(null==e?void 0:e.userAddedIn.getGuid())&&(this.activeGroup,null==e||e.userAddedIn,this.ref.detectChanges()),this.updateGroup(null==e?void 0:e.userAddedIn)})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.activeGroup&&this.activeGroup.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.activeGroup,null==e||e.kickedFrom,this.ref.detectChanges()),this.updateGroup(null==e?void 0:e.kickedFrom)})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.activeGroup&&this.activeGroup.getGuid()==(null==e?void 0:e.joinedGroup.getGuid())&&(this.activeGroup,null==e||e.joinedGroup,this.ref.detectChanges()),this.updateGroup(null==e?void 0:e.joinedGroup)})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.activeGroup&&this.activeGroup.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.activeGroup,null==e||e.kickedFrom,this.ref.detectChanges()),this.updateGroup(null==e?void 0:e.kickedFrom)})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{this.activeGroup&&this.activeGroup.getGuid()==(null==e?void 0:e.group.getGuid())&&(this.activeGroup,null==e||e.group,this.ref.detectChanges()),this.updateGroup(null==e?void 0:e.group)})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((t=>{t.leftGroup.getType()==e.CometChatUIKitConstants.GroupTypes.private?this.removeGroup(t.leftGroup):this.updateGroup(t.leftGroup)}))}unsubscribeToEvents(){var e,t,s,i,o,n;null===(e=this.ccGroupMemberAdded)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberBanned)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberJoined)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberKicked)||void 0===i||i.unsubscribe(),null===(o=this.ccOwnershipChanged)||void 0===o||o.unsubscribe(),null===(n=this.ccGroupLeft)||void 0===n||n.unsubscribe()}ngOnDestroy(){this.unsubscribeToEvents(),this.groupsRequest=null,this.ref.detach(),this.removeListener()}updateGroup(e){let t=[...this.groupsList],s=t.findIndex(((t,s)=>t.getGuid()===e.getGuid()));s>-1&&(t.splice(s,1,e),this.groupsList=t,this.ref.detectChanges())}attachListeners(){s.CometChat.addGroupListener(this.groupsListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,s,i,o)=>{var n;t.getUid()==(null===(n=this.loggedInUser)||void 0===n?void 0:n.getUid())&&o.setScope(s),this.updateGroup(o)},onGroupMemberKicked:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!1),this.updateGroup(i)},onGroupMemberBanned:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())?this.removeGroup(i):this.updateGroup(i)},onGroupMemberUnbanned:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!1),this.addGroup(i)},onMemberAddedToGroup:(e,t,s,i)=>{var o;t.getUid()==(null===(o=this.loggedInUser)||void 0===o?void 0:o.getUid())&&i.setHasJoined(!0),this.updateGroup(i)},onGroupMemberLeft:(e,t,s)=>{var i;t.getUid()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())&&s.setHasJoined(!1),this.updateGroup(s)},onGroupMemberJoined:(e,t,s)=>{var i;t.getUid()==(null===(i=this.loggedInUser)||void 0===i?void 0:i.getUid())&&s.setHasJoined(!0),this.updateGroup(s)}}))}removeListener(){s.CometChat.removeGroupListener(this.groupsListenerId)}getStatusIndicatorColor(e){return this.statusColor[null==e?void 0:e.getType()]}getRequestBuilder(){return this.searchRequestBuilder?this.searchRequestBuilder.build():this.groupsRequestBuilder?this.groupsRequestBuilder.build():(new s.CometChat.GroupsRequestBuilder).setLimit(this.limit).setSearchKeyword(this.searchKeyword).build()}removeGroup(e){let t=[...this.groupsList],s=t.findIndex(((t,s)=>t.getGuid()===e.getGuid()));s>-1&&(t.splice(s,1),this.groupsList=t,this.ref.detectChanges())}addGroup(e){this.groupsList.unshift(e),this.ref.detectChanges()}setThemeStyle(){var e,t;this.setListItemStyle(),this.setAvatarStyle(),this.setStatusStyle(),this.setGroupsStyle(),this.statusColor.private=null!==(e=this.groupsStyle.privateGroupIconBackground)&&void 0!==e?e:this.themeService.theme.palette.getSuccess(),this.statusColor.password=null!==(t=this.groupsStyle.passwordGroupIconBackground)&&void 0!==t?t:"#F7A500",this.listStyle={titleTextFont:this.groupsStyle.titleTextFont,titleTextColor:this.groupsStyle.titleTextColor,emptyStateTextFont:this.groupsStyle.emptyStateTextFont,emptyStateTextColor:this.groupsStyle.emptyStateTextColor,errorStateTextFont:this.groupsStyle.errorStateTextFont,errorStateTextColor:this.groupsStyle.errorStateTextColor,loadingIconTint:this.groupsStyle.loadingIconTint,separatorColor:this.groupsStyle.separatorColor,searchIconTint:this.groupsStyle.searchIconTint,searchBorder:this.groupsStyle.searchBorder,searchBorderRadius:this.groupsStyle.searchBorderRadius,searchBackground:this.groupsStyle.searchBackground,searchPlaceholderTextFont:this.groupsStyle.searchPlaceholderTextFont,searchPlaceholderTextColor:this.groupsStyle.searchPlaceholderTextColor,searchTextFont:this.groupsStyle.searchTextFont,searchTextColor:this.groupsStyle.searchTextColor}}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:this.themeService.theme.palette.getAccent100(),borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:this.themeService.theme.palette.getAccent200(),hoverBackground:this.themeService.theme.palette.getAccent50()});this.listItemStyle=Object.assign(Object.assign({},t),this.listItemStyle)}setAvatarStyle(){let t=new J.AvatarStyle({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:this.themeService.theme.palette.getAccent700(),nameTextColor:this.themeService.theme.palette.getAccent900(),backgroundSize:"cover",nameTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});this.avatarStyle=Object.assign(Object.assign({},t),this.avatarStyle)}setStatusStyle(){this.statusIndicatorStyle=Object.assign(Object.assign({},{height:"12px",width:"12px",border:"none",borderRadius:"24px"}),this.statusIndicatorStyle)}setGroupsStyle(){let s=new t.GroupsStyle({subTitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),subTitleTextColor:this.themeService.theme.palette.getAccent600(),background:this.themeService.theme.palette.getBackground(),border:`1px solid ${this.themeService.theme.palette.getAccent50()}`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),emptyStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),emptyStateTextColor:this.themeService.theme.palette.getAccent600(),errorStateTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),errorStateTextColor:this.themeService.theme.palette.getAccent600(),loadingIconTint:this.themeService.theme.palette.getAccent600(),separatorColor:this.themeService.theme.palette.getAccent400(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",searchIconTint:this.themeService.theme.palette.getAccent600(),searchPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),searchBackground:this.themeService.theme.palette.getAccent100(),searchPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3),searchTextColor:this.themeService.theme.palette.getAccent600(),searchTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text3)});this.groupsStyle=Object.assign(Object.assign({},s),this.groupsStyle)}};L([(0,K.Input)(),G("design:type",s.CometChat.GroupsRequestBuilder)],Na.prototype,"groupsRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",s.CometChat.GroupsRequestBuilder)],Na.prototype,"searchRequestBuilder",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"subtitleView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"listItemView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"menu",void 0),L([(0,K.Input)(),G("design:type",Object)],Na.prototype,"options",void 0),L([(0,K.Input)(),G("design:type",Object)],Na.prototype,"activeGroup",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Na.prototype,"hideSeparator",void 0),L([(0,K.Input)(),G("design:type",Number)],Na.prototype,"selectionMode",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"searchPlaceholder",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Na.prototype,"hideError",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"searchIconURL",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Na.prototype,"hideSearch",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"title",void 0),L([(0,K.Input)(),G("design:type",Function)],Na.prototype,"onError",void 0),L([(0,K.Input)(),G("design:type",Function)],Na.prototype,"onSelect",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"emptyStateView",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"errorStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"loadingIconURL",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"privateGroupIcon",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"protectedGroupIcon",void 0),L([(0,K.Input)(),G("design:type",K.TemplateRef)],Na.prototype,"loadingStateView",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"emptyStateText",void 0),L([(0,K.Input)(),G("design:type",String)],Na.prototype,"errorStateText",void 0),L([(0,K.Input)(),G("design:type",Number)],Na.prototype,"titleAlignment",void 0),L([(0,K.Input)(),G("design:type",Object)],Na.prototype,"statusIndicatorStyle",void 0),L([(0,K.Input)(),G("design:type",J.AvatarStyle)],Na.prototype,"avatarStyle",void 0),L([(0,K.Input)(),G("design:type",t.GroupsStyle)],Na.prototype,"groupsStyle",void 0),L([(0,K.Input)(),G("design:type",J.ListItemStyle)],Na.prototype,"listItemStyle",void 0),L([(0,K.Input)(),G("design:type",Function)],Na.prototype,"onItemClick",void 0),Na=L([(0,K.Component)({selector:"cometchat-groups",templateUrl:"./cometchat-groups.component.html",styleUrls:["./cometchat-groups.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ChangeDetectorRef,q])],Na);let ja=class{};ja=L([(0,K.NgModule)({declarations:[Na],imports:[W.CommonModule,Mi],exports:[Na],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],ja);let Ha=class{constructor(i,o,n){this.elementRef=i,this.ref=o,this.themeService=n,this.isMobileView=!1,this.hideCreateGroup=!0,this.messageText=(0,e.localize)("NO_CHATS_SELECTED"),this.groupsWithMessagesStyle={width:"100%",height:"100%",borderRadius:"none",border:"none"},this.messagesConfiguration=new t.MessagesConfiguration({}),this.createGroupConfiguration=new t.CreateGroupConfiguration({}),this.joinGroupConfiguration=new t.JoinGroupConfiguration({}),this.groupsConfiguration=new t.GroupsConfiguration({}),this.onError=e=>{console.log(e)},this.theme=new e.CometChatTheme({}),this.backdropStyle={},this.createGroupStyle={},this.joinGroupStyle={},this.messageHeaderStyle={},this.listItemStyle={},this.createIconURL="assets/create-button.svg",this.createGroupButtonStyle={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:"RGB(51, 153, 255)"},this.labelStyle={background:"transparent",textFont:"700 22px Inter",textColor:"rgba(20, 20, 20, 0.33)"},this.openCreateGroupPage=!1,this.openPasswordModal=!1,this.onBack=()=>{this.group=null},this.closeCreateGroup=()=>{this.openCreateGroupPage=!1,this.ref.detectChanges()},this.closeJoinGroup=()=>{this.openPasswordModal=!1},this.onItemClick=t=>(this.openPasswordModal=!1,t.getHasJoined()?(this.group=t,void this.ref.detectChanges()):t.getType()==e.CometChatUIKitConstants.GroupTypes.password?(this.group=null,this.protectedGroup=t,this.openPasswordModal=!0,void this.ref.detectChanges()):void s.CometChat.joinGroup(t).then((()=>{e.CometChatGroupEvents.ccGroupMemberJoined.next({joinedGroup:t,joinedUser:this.loggedInUser}),t.setHasJoined(!0),this.ref.detectChanges(),this.group=t,this.ref.detectChanges()})).catch((e=>{this.onError&&this.onError(e)}))),this.setCreateGroupStyles=()=>{let t=new J.CreateGroupStyle({boxShadow:`${this.themeService.theme.palette.getAccent100()} 4px 16px 32px 4px`,groupTypeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),groupTypeBorder:`1px solid ${this.themeService.theme.palette.getAccent600()}`,groupTypeBorderRadius:"0",groupTypeTextColor:this.themeService.theme.palette.getAccent(),groupTypeTextBackground:"transparent",groupTypeBackground:this.themeService.theme.palette.getAccent100(),groupTypeBoxShadow:"",activeGroupTypeTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),activeGroupTypeTextColor:this.themeService.theme.palette.getAccent(),activeGroupTypeBackground:this.themeService.theme.palette.getAccent900(),activeGroupTypeBoxShadow:`${this.themeService.theme.palette.getAccent200()} 0 3px 8px 0`,activeGroupTypeBorderRadius:"8px",activeGroupTypeBorder:"none",groupTypeTextBoxShadow:"none",groupTypeTextBorderRadius:"0",closeIconTint:this.themeService.theme.palette.getPrimary(),titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),errorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),errorTextBackground:this.themeService.theme.palette.getError(),errorTextBorderRadius:"8px",errorTextBorder:"none",errorTextColor:this.themeService.theme.palette.getError(),nameInputPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),nameInputPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),nameInputBackground:this.themeService.theme.palette.getAccent100(),nameInputTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),nameInputTextColor:this.themeService.theme.palette.getAccent(),nameInputBorder:"none",nameInputBorderRadius:"8px",nameInputBoxShadow:`${this.themeService.theme.palette.getAccent100()} 0 0 0 1px`,passwordInputPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),passwordInputPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),passwordInputBackground:this.themeService.theme.palette.getAccent100(),passwordInputBorder:"none",passwordInputBorderRadius:"8px",passwordInputBoxShadow:`${this.themeService.theme.palette.getAccent100()} 0 0 0 1px`,passwordInputTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),passwordInputTextColor:this.themeService.theme.palette.getAccent(),createGroupButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.text2),createGroupButtonTextColor:this.themeService.theme.palette.getAccent900("light"),createGroupButtonBackground:this.themeService.theme.palette.getPrimary(),createGroupButtonBorderRadius:"8px",createGroupButtonBorder:"none",height:"620px",width:"360px",borderRadius:"8px",background:this.themeService.theme.palette.getBackground()});this.createGroupStyle=Object.assign(Object.assign({},t),this.createGroupConfiguration.createGroupStyle)},this.setJoinGroupStyles=()=>{let t=new J.JoinGroupStyle({boxShadow:`${this.themeService.theme.palette.getAccent100()} 0px 16px 32px 0px`,titleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1),titleTextColor:this.themeService.theme.palette.getAccent(),passwordInputPlaceholderTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),passwordInputPlaceholderTextColor:this.themeService.theme.palette.getAccent600(),passwordInputBackground:this.themeService.theme.palette.getAccent100(),passwordInputBorder:"none",passwordInputBorderRadius:"8px",passwordInputBoxShadow:`${this.themeService.theme.palette.getAccent100()} 0 0 0 1px`,passwordInputTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),passwordInputTextColor:this.themeService.theme.palette.getAccent(),height:"100%",width:"100%",joinButtonTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1),joinButtonTextColor:this.themeService.theme.palette.getAccent("dark"),joinButtonBackground:this.themeService.theme.palette.getPrimary(),joinButtonBorderRadius:"8px",joinButtonBorder:"none",background:this.themeService.theme.palette.getBackground()});this.joinGroupStyle=Object.assign(Object.assign({},t),this.joinGroupConfiguration.joinGroupStyle)},this.onGroupJoined=e=>{var t;let s=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.response;this.openPasswordModal=!1,this.protectedGroup=null,s&&(this.group=s)},this.emptyMessageStyle=()=>({background:this.groupsWithMessagesStyle.background||this.themeService.theme.palette.getBackground(),height:this.groupsWithMessagesStyle.height,width:`calc(${this.groupsWithMessagesStyle.width} - 280px)`,border:this.groupsWithMessagesStyle.border,borderRadius:this.groupsWithMessagesStyle.borderRadius}),this.groupsWrapperStyles=()=>({height:this.groupsWithMessagesStyle.height,width:this.groupsWithMessagesStyle.width,border:this.groupsWithMessagesStyle.border,borderRadius:this.groupsWithMessagesStyle.borderRadius,background:this.groupsWithMessagesStyle.background||this.themeService.theme.palette.getBackground()})}ngOnChanges(e){e.isMobileView&&(this.isMobileView?(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!1,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration),this.joinGroupConfiguration.messageHeaderConfiguration.hideBackButton=!1,this.joinGroupConfiguration.messageHeaderConfiguration=Object.assign({},this.joinGroupConfiguration.messageHeaderConfiguration),this.joinGroupConfiguration=Object.assign({},this.joinGroupConfiguration)):this.isMobileView||(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!0,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration),this.joinGroupConfiguration.messageHeaderConfiguration.hideBackButton=!0,this.joinGroupConfiguration.messageHeaderConfiguration=Object.assign({},this.joinGroupConfiguration.messageHeaderConfiguration),this.joinGroupConfiguration=Object.assign({},this.joinGroupConfiguration)),this.updateBackdropHeight())}ngAfterViewInit(){this.updateBackdropHeight()}openCreateGroup(){this.openCreateGroupPage=!0}updateBackdropHeight(){let e={height:this.elementRef.nativeElement.offsetHeight+"px",width:this.elementRef.nativeElement.offsetWidth+"px",background:"rgba(0, 0, 0, 0.5)"};this.backdropStyle=e,this.messagesConfiguration.messageListConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.backdropStyle=e,this.messagesConfiguration.messageComposerConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.groupMembersConfiguration.backdropStyle=e,this.ref.detectChanges()}ngOnInit(){this.setWithMessagesStyle(),this.setCreateGroupStyles(),this.setListItemStyle(),this.setJoinGroupStyles(),this.messagesConfiguration.messageHeaderConfiguration.onBack||(this.messagesConfiguration.messageHeaderConfiguration.onBack=this.onBack),this.subscribeToEvents(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)}))}setWithMessagesStyle(){let s=new t.WithMessagesStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",messageTextColor:this.themeService.theme.palette.getAccent600(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1)});this.groupsWithMessagesStyle=Object.assign(Object.assign({},s),this.groupsWithMessagesStyle),this.labelStyle.textFont=this.groupsWithMessagesStyle.messageTextFont,this.labelStyle.textColor=this.groupsWithMessagesStyle.messageTextColor}setHeadersStyle(){let s=new t.MessageHeaderStyle({background:this.themeService.theme.palette.getBackground(),border:"none",onlineStatusColor:this.themeService.theme.palette.getSuccess(),privateGroupIconBackground:this.themeService.theme.palette.getSuccess(),passwordGroupIconBackground:"RGB(247, 165, 0)",backButtonIconTint:this.themeService.theme.palette.getPrimary(),subtitleTextColor:this.themeService.theme.palette.getAccent600(),subtitleTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle2),typingIndicatorTextColor:this.themeService.theme.palette.getPrimary(),typingIndicatorTextFont:(0,e.fontHelper)(this.themeService.theme.typography.subtitle1)});this.messageHeaderStyle=Object.assign(Object.assign({},s),this.joinGroupConfiguration.messageHeaderConfiguration.messageHeaderStyle)}setListItemStyle(){let t=new J.ListItemStyle({height:"45px",width:"100%",background:this.themeService.theme.palette.getBackground(),activeBackground:"transparent",borderRadius:"0",titleFont:(0,e.fontHelper)(this.themeService.theme.typography.title2),titleColor:this.themeService.theme.palette.getAccent(),border:"none",separatorColor:"",hoverBackground:"transparent"});this.listItemStyle=Object.assign(Object.assign({},t),this.joinGroupConfiguration.messageHeaderConfiguration.listItemStyle)}ngOnDestroy(){this.unsubscribeToEvents()}updatedCreatedGroup(t){var s;let i=null===(s=null==t?void 0:t.detail)||void 0===s?void 0:s.group;i&&(this.group=i,this.openCreateGroupPage=!1,this.ref.detectChanges(),e.CometChatGroupEvents.ccGroupCreated.next(i))}subscribeToEvents(){this.ccGroupDeleted=e.CometChatGroupEvents.ccGroupDeleted.subscribe((e=>{this.group&&e.getGuid()==this.group.getGuid()&&(this.group=null,this.ref.detectChanges())})),this.ccGroupCreated=e.CometChatGroupEvents.ccGroupCreated.subscribe((e=>{e&&(this.group=e,this.openCreateGroupPage=!1,this.ref.detectChanges())})),this.ccGroupMemberAdded=e.CometChatGroupEvents.ccGroupMemberAdded.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.userAddedIn.getGuid())&&(this.group=null==e?void 0:e.userAddedIn,this.ref.detectChanges())})),this.ccGroupMemberBanned=e.CometChatGroupEvents.ccGroupMemberBanned.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group=null==e?void 0:e.kickedFrom,this.ref.detectChanges())})),this.ccGroupMemberJoined=e.CometChatGroupEvents.ccGroupMemberJoined.subscribe((e=>{this.protectedGroup&&this.protectedGroup.getGuid()==(null==e?void 0:e.joinedGroup.getGuid())&&(this.openPasswordModal=!1,this.protectedGroup=null,this.group=null==e?void 0:e.joinedGroup,this.ref.detectChanges())})),this.ccGroupMemberKicked=e.CometChatGroupEvents.ccGroupMemberKicked.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.kickedFrom.getGuid())&&(this.group=null==e?void 0:e.kickedFrom,this.ref.detectChanges())})),this.ccOwnershipChanged=e.CometChatGroupEvents.ccOwnershipChanged.subscribe((e=>{this.group&&this.group.getGuid()==(null==e?void 0:e.group.getGuid())&&(this.group=null==e?void 0:e.group,this.ref.detectChanges())})),this.ccGroupLeft=e.CometChatGroupEvents.ccGroupLeft.subscribe((e=>{var t,s;this.group&&this.group.getGuid()==(null==e?void 0:e.leftGroup.getGuid())&&(null===(t=this.loggedInUser)||void 0===t?void 0:t.getUid())==(null===(s=null==e?void 0:e.userLeft)||void 0===s?void 0:s.getUid())&&(this.group=null==e?void 0:e.leftGroup,this.ref.detectChanges())}))}unsubscribeToEvents(){var e,t,s,i,o,n,r;null===(e=this.ccGroupDeleted)||void 0===e||e.unsubscribe(),null===(t=this.ccGroupMemberAdded)||void 0===t||t.unsubscribe(),null===(s=this.ccGroupMemberBanned)||void 0===s||s.unsubscribe(),null===(i=this.ccGroupMemberJoined)||void 0===i||i.unsubscribe(),null===(o=this.ccGroupMemberKicked)||void 0===o||o.unsubscribe(),null===(n=this.ccOwnershipChanged)||void 0===n||n.unsubscribe(),null===(r=this.ccGroupLeft)||void 0===r||r.unsubscribe()}};L([(0,K.ViewChild)("groupRef",{static:!1}),G("design:type",fa)],Ha.prototype,"groupRef",void 0),L([(0,K.ViewChild)("messagesRef",{static:!1}),G("design:type",xa)],Ha.prototype,"messageListRef",void 0),L([(0,K.Input)(),G("design:type",Object)],Ha.prototype,"group",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ha.prototype,"isMobileView",void 0),L([(0,K.Input)(),G("design:type",Boolean)],Ha.prototype,"hideCreateGroup",void 0),L([(0,K.Input)(),G("design:type",String)],Ha.prototype,"messageText",void 0),L([(0,K.Input)(),G("design:type",t.WithMessagesStyle)],Ha.prototype,"groupsWithMessagesStyle",void 0),L([(0,K.Input)(),G("design:type",t.MessagesConfiguration)],Ha.prototype,"messagesConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.CreateGroupConfiguration)],Ha.prototype,"createGroupConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.JoinGroupConfiguration)],Ha.prototype,"joinGroupConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.GroupsConfiguration)],Ha.prototype,"groupsConfiguration",void 0),L([(0,K.Input)(),G("design:type",Object)],Ha.prototype,"onError",void 0),Ha=L([(0,K.Component)({selector:"cometchat-groups-with-messages",templateUrl:"./cometchat-groups-with-messages.component.html",styleUrls:["./cometchat-groups-with-messages.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ElementRef,K.ChangeDetectorRef,q])],Ha);let Ka=class{};Ka=L([(0,K.NgModule)({declarations:[Ha],imports:[W.CommonModule,ja,Va,Co,aa,ma],exports:[Ha],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],Ka);let za=class{constructor(s,i,o){this.elementRef=s,this.ref=i,this.themeService=o,this.isMobileView=!1,this.messageText=(0,e.localize)("NO_CHATS_SELECTED"),this.usersWithMessagesStyle={width:"100%",height:"100%",borderRadius:"none",border:"none"},this.messagesConfiguration=new t.MessagesConfiguration({}),this.usersConfiguration=new t.UsersConfiguration({}),this.onError=e=>{console.log(e)},this.theme=new e.CometChatTheme({}),this.labelStyle={background:"transparent",textFont:"700 22px Inter",textColor:"rgba(20, 20, 20, 0.33)"},this.onBack=()=>{this.user=null},this.onItemClick=e=>{this.user=e,this.ref.detectChanges()},this.emptyMessageStyle=()=>({background:this.usersWithMessagesStyle.background||this.themeService.theme.palette.getBackground(),height:this.usersWithMessagesStyle.height,width:`calc(${this.usersWithMessagesStyle.width} - 280px)`,border:this.usersWithMessagesStyle.border,borderRadius:this.usersWithMessagesStyle.borderRadius}),this.usersWrapperStyles=()=>({height:this.usersWithMessagesStyle.height,width:this.usersWithMessagesStyle.width,border:this.usersWithMessagesStyle.border,borderRadius:this.usersWithMessagesStyle.borderRadius,background:this.usersWithMessagesStyle.background||this.themeService.theme.palette.getBackground()})}ngAfterViewInit(){this.updateBackdropHeight()}updateBackdropHeight(){let e={height:this.elementRef.nativeElement.offsetHeight+"px",width:this.elementRef.nativeElement.offsetWidth+"px",background:"rgba(0, 0, 0, 0.5)"};this.messagesConfiguration.messageListConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.backdropStyle=e,this.messagesConfiguration.messageComposerConfiguration.backdropStyle=e,this.messagesConfiguration.detailsConfiguration.groupMembersConfiguration.backdropStyle=e,this.ref.detectChanges()}ngOnChanges(e){e.isMobileView&&(this.isMobileView?(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!1,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration)):this.isMobileView||(this.messagesConfiguration.messageHeaderConfiguration.hideBackButton=!0,this.messagesConfiguration.messageHeaderConfiguration=Object.assign({},this.messagesConfiguration.messageHeaderConfiguration),this.messagesConfiguration=Object.assign({},this.messagesConfiguration)),this.updateBackdropHeight())}ngOnInit(){this.setWithMessagesStyle(),this.messagesConfiguration.messageHeaderConfiguration.onBack||(this.messagesConfiguration.messageHeaderConfiguration.onBack=this.onBack),this.subscribeToEvents(),s.CometChat.getLoggedinUser().then((e=>{this.loggedInUser=e})).catch((e=>{this.onError&&this.onError(e)}))}setWithMessagesStyle(){let s=new t.WithMessagesStyle({width:"100%",height:"100%",background:this.themeService.theme.palette.getBackground(),borderRadius:"none",border:"none",messageTextColor:this.themeService.theme.palette.getAccent600(),messageTextFont:(0,e.fontHelper)(this.themeService.theme.typography.title1)});this.usersWithMessagesStyle=Object.assign(Object.assign({},s),this.usersWithMessagesStyle),this.labelStyle.textFont=this.usersWithMessagesStyle.messageTextFont,this.labelStyle.textColor=this.usersWithMessagesStyle.messageTextColor}ngOnDestroy(){this.unsubscribeToEvents()}subscribeToEvents(){this.ccUserBlocked=e.CometChatUserEvents.ccUserBlocked.subscribe((e=>{this.user&&e.getUid()==this.user.getUid()&&(this.user=e,this.ref.detectChanges())})),this.ccUserUnBlocked=e.CometChatUserEvents.ccUserUnblocked.subscribe((e=>{this.user&&e.getUid()==this.user.getUid()&&(this.user=e,this.ref.detectChanges())}))}unsubscribeToEvents(){var e,t;null===(e=this.ccUserBlocked)||void 0===e||e.unsubscribe(),null===(t=this.ccUserUnBlocked)||void 0===t||t.unsubscribe()}};L([(0,K.ViewChild)("usersRef",{static:!1}),G("design:type",fa)],za.prototype,"userRef",void 0),L([(0,K.ViewChild)("messagesRef",{static:!1}),G("design:type",xa)],za.prototype,"messageListRef",void 0),L([(0,K.Input)(),G("design:type",Object)],za.prototype,"user",void 0),L([(0,K.Input)(),G("design:type",Boolean)],za.prototype,"isMobileView",void 0),L([(0,K.Input)(),G("design:type",String)],za.prototype,"messageText",void 0),L([(0,K.Input)(),G("design:type",t.WithMessagesStyle)],za.prototype,"usersWithMessagesStyle",void 0),L([(0,K.Input)(),G("design:type",t.MessagesConfiguration)],za.prototype,"messagesConfiguration",void 0),L([(0,K.Input)(),G("design:type",t.UsersConfiguration)],za.prototype,"usersConfiguration",void 0),L([(0,K.Input)(),G("design:type",Object)],za.prototype,"onError",void 0),za=L([(0,K.Component)({selector:"cometchat-users-with-messages",templateUrl:"./cometchat-users-with-messages.component.html",styleUrls:["./cometchat-users-with-messages.component.scss"],changeDetection:K.ChangeDetectionStrategy.OnPush}),G("design:paramtypes",[K.ElementRef,K.ChangeDetectorRef,q])],za);let qa=class{};qa=L([(0,K.NgModule)({declarations:[za],imports:[W.CommonModule,Ca,Va,Co,aa],exports:[za],schemas:[K.CUSTOM_ELEMENTS_SCHEMA]})],qa)})(),d})()));
//# sourceMappingURL=index.js.map
(function() {try{if(require('@cometchat-pro/web-calls')){window["isCallingEnabled"] = true}}catch(e){window["isCallingEnabled"] = false}})();