PageSourceSearch

https://wmtvolt2.voltsystems.net/1167.5d5a0ea52a6f4d48.js

js voltsystems.net collected 2026-10-09 21:59:53 UTC 65,503 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkvolt_walmart_dashboard=self.webpackChunkvolt_walmart_dashboard||[]).push([[1167,7730,6245],{28223:(Q,O,e)=>{e.r(O),e.d(O,{CommunicationsModule:()=>I});var M=e(36895),v=e(87396),P=e(20710),T=e(73354),f=e(42329),n=e(1908),E=e(94650);const o=[{path:"send",canActivate:[P.v],loadChildren:()=>Promise.resolve().then(e.bind(e,66145)).then(D=>D.CommunicationsSendModule),data:{titleKey:(0,n.Bv)("send"),requiredPermission:[T.J.MassCommunicationsSend,f.e.Read]}},{path:"history",canActivate:[P.v],loadChildren:()=>Promise.resolve().then(e.bind(e,44526)).then(D=>D.CommunicationsHistoryModule),data:{titleKey:(0,n.Bv)("history"),requiredPermission:[T.J.MassCommunicationsHistory,f.e.Read]}},{path:"templates",canActivate:[P.v],loadChildren:()=>Promise.resolve().then(e.bind(e,48025)).then(D=>D.CommunicationsTemplatesModule),data:{titleKey:(0,n.Bv)("templates"),requiredPermission:[T.J.MassCommunicationsTemplates,f.e.Read]}}];let t=(()=>{class D{}return D.\u0275fac=function(F){return new(F||D)},D.\u0275mod=E.oAB({type:D}),D.\u0275inj=E.cJS({imports:[v.Bz.forChild(o),v.Bz]}),D})();var J=e(97730),S=e(48025),b=e(57245),x=e(66145),B=e(44526);let I=(()=>{class D{}return D.\u0275fac=function(F){return new(F||D)},D.\u0275mod=E.oAB({type:D}),D.\u0275inj=E.cJS({imports:[M.ez,t,J.G,S.CommunicationsTemplatesModule,x.CommunicationsSendModule,b.u,B.CommunicationsHistoryModule]}),D})()},44526:(Q,O,e)=>{e.r(O),e.d(O,{CommunicationsHistoryModule:()=>A});var M=e(36895),v=e(87396),P=e(20710),T=e(73354),f=e(42329),n=e(1908),E=e(27221),o=e(94650),t=e(87545),J=e(24850),S=e(40537),b=e(591),x=e(12039);let B=(()=>{class l{constructor(s){this._communicationsHistoryClient=s,this._loading$=new b.X(!1),this.loading$=this._loading$.asObservable(),this._tableState$=new b.X({totalCount:0,offset:0,limit:20,sortBy:(0,n.FM)("createdDate"),sortAscending:!1}),this.tableState$=this._tableState$.asObservable()}get data$(){return this.tableState$.pipe((0,t.w)(s=>(this._loading$.next(!0),this._communicationsHistoryClient.get(s.offset,s.limit,s.sortBy,s.sortAscending).pipe((0,J.U)(C=>(this._tableState$.value.totalCount=C.totalCount,C.results)),(0,S.x)(()=>this._loading$.next(!1))))))}setTableState(s){this._tableState$.next(s)}}return l.\u0275fac=function(s){return new(s||l)(o.LFG(x.sNH))},l.\u0275prov=o.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"}),l})();var I=e(91712),D=e(5650),L=e(14210),F=e(22255),w=e(52824),H=e(60270),z=e(6206),K=e(19373),W=e(57771),Y=e(15439),$=e(61715),y=e(36053),u=e(1059);let p=(()=>{class l{constructor(s){this._translationService=s}transform(s,C=5e3){const R=(0,$.F)(C).pipe((0,u.O)(0));return(0,y.aj)([R,this._translationService.activeLang$]).pipe((0,J.U)(()=>this.getAgeString(s)))}getAgeString(s){const C=Y().utc(),R=C.diff(s,"years");if(1===R)return this._translationService.translate("oneYearAgo");if(R>1)return this._translationService.translate("yearsAgo",{years:R});const N=C.diff(s,"months");if(1===N)return this._translationService.translate("oneMonthAgo");if(N>1)return this._translationService.translate("monthsAgo",{months:N});const Zt=C.diff(s,"days");if(1===Zt)return this._translationService.translate("oneDayAgo");if(Zt>1)return this._translationService.translate("daysAgo",{days:Zt});const Mt=C.diff(s,"hours");if(1===Mt)return this._translationService.translate("oneHourAgo");if(Mt>1)return this._translationService.translate("hoursAgo",{hours:Mt});const Dt=C.diff(s,"minutes");return this._translationService.translate("minutesAgo",{minutes:Dt})}}return l.\u0275fac=function(s){return new(s||l)(o.Y36(I.D,16))},l.\u0275pipe=o.Yjl({name:"dateAge",type:l,pure:!0}),l})();var d=e(74325),Z=e(10805),j=e(51740),q=e(85121),X=e(24006),V=e(9764),G=e(21642),k=e(36188),et=e(28517),at=e(43458);let tt=(()=>{class l{constructor(s,C){this._datePipe=s,this._dateAgePipe=C}transform(s){const C=this._datePipe.transform(s.toDate(),"short","UTC");return this._dateAgePipe.transform(s,6e4).pipe((0,J.U)(R=>`${C} (${R})`))}}return l.\u0275fac=function(s){return new(s||l)(o.Y36(M.uU,16),o.Y36(p,16))},l.\u0275pipe=o.Yjl({name:"communicationLogDate",type:l,pure:!0}),l})(),st=(()=>{class l{transform(s){const C=new URL(s),R=C.pathname.substr(C.pathname.lastIndexOf("/")+1);return decodeURIComponent(R)}}return l.\u0275fac=function(s){return new(s||l)},l.\u0275pipe=o.Yjl({name:"urlFilename",type:l,pure:!0}),l})();function nt(l,_){if(1&l&&(o.TgZ(0,"small",10),o._uU(1),o.ALo(2,"async"),o.ALo(3,"translate"),o.qZA()),2&l){const s=o.oxw(2);o.xp6(1),o.hij("(",o.lcZ(2,1,o.lcZ(3,3,s.log.category)),")")}}function lt(l,_){if(1&l&&(o.TgZ(0,"div"),o._UZ(1,"i",8),o._uU(2),o.YNc(3,nt,4,5,"small",9),o.qZA()),2&l){const s=o.oxw();o.xp6(2),o.AsE("",s.log.numberOfRecipients," ",s.translations.recipients," "),o.xp6(1),o.Q6J("ngIf",!!s.log.category)}}function rt(l,_){if(1&l&&(o.TgZ(0,"div")(1,"label"),o._uU(2),o.qZA(),o._UZ(3,"input",12),o.qZA()),2&l){const s=o.oxw(2);o.xp6(2),o.Oqu(s.translations.accounts),o.xp6(1),o.Q6J("readOnly",!0)("value",(null==s.log.recipientAccounts?null:s.log.recipientAccounts.join(", "))||s.translations.all)}}function ct(l,_){if(1&l&&(o.TgZ(0,"div")(1,"label"),o._uU(2),o.qZA(),o._UZ(3,"input",12),o.qZA()),2&l){const s=o.oxw(2);o.xp6(2),o.Oqu(s.translations.fieldGroupType),o.xp6(1),o.Q6J("readOnly",!0)("value",(null==s.log.recipientFieldGroupTypes?null:s.log.recipientFieldGroupTypes.join(", "))||s.translations.all)}}function mt(l,_){if(1&l&&(o.TgZ(0,"div")(1,"label"),o._uU(2),o.qZA(),o._UZ(3,"input",12),o.qZA()),2&l){const s=o.oxw(2);o.xp6(2),o.Oqu(s.translations.products),o.xp6(1),o.Q6J("readOnly",!0)("value",(null==s.log.recipientProducts?null:s.log.recipientProducts.join(", "))||s.translations.all)}}function dt(l,_){if(1&l&&(o.TgZ(0,"div"),o._UZ(1,"communications-include-primary-admin",13),o.qZA()),2&l){const s=o.oxw(2);
1o.xp6(1),o.Q6J("value",s.log.includePrimaryProviderAdmins)("disabled",!0)}}function ot(l,_){if(1&l&&(o.TgZ(0,"div",11),o.YNc(1,rt,4,3,"div",7),o.YNc(2,ct,4,3,"div",7),o.TgZ(3,"div")(4,"label"),o._uU(5),o.qZA(),o._UZ(6,"input",12),o.qZA(),o.TgZ(7,"div")(8,"label"),o._uU(9),o.qZA(),o._UZ(10,"input",12),o.qZA(),o.YNc(11,mt,4,3,"div",7),o.YNc(12,dt,2,2,"div",7),o.qZA()),2&l){const s=o.oxw();o.xp6(1),o.Q6J("ngIf",s.userCanViewMultipleAccounts),o.xp6(1),o.Q6J("ngIf",s.userCanViewMultipleAccounts),o.xp6(3),o.Oqu(s.translations.roles),o.xp6(1),o.Q6J("readOnly",!0)("value",(null==s.log.recipientRoles?null:s.log.recipientRoles.join(", "))||s.translations.all),o.xp6(3),o.Oqu(s.translations.personTag),o.xp6(1),o.Q6J("readOnly",!0)("value",(null==s.log.recipientTags?null:s.log.recipientTags.join(", "))||s.translations.all),o.xp6(1),o.Q6J("ngIf",s.userCanViewMultipleAccounts),o.xp6(1),o.Q6J("ngIf",s.userCanViewMultipleAccounts)}}function pt(l,_){if(1&l&&(o.TgZ(0,"div",15)(1,"a",16),o.ALo(2,"async"),o.ALo(3,"secureUrl"),o._uU(4),o.ALo(5,"urlFilename"),o.qZA()()),2&l){const s=_.$implicit;o.xp6(1),o.Q6J("href",o.lcZ(2,2,o.lcZ(3,4,s)),o.LSH),o.xp6(3),o.Oqu(o.lcZ(5,6,s))}}function ut(l,_){if(1&l&&(o.TgZ(0,"div"),o.YNc(1,pt,6,8,"div",14),o.qZA()),2&l){const s=o.oxw();o.xp6(1),o.Q6J("ngForOf",s.log.attachmentUrls)}}let gt=(()=>{class l extends W.s{constructor(s,C){super(s,C),this._dialogReference=s,this._dialogConfig=C,this.displayModal=!0,this.log=this._dialogConfig.data.log,this.translations=this._dialogConfig.data.translations,this.currentUser=this._dialogConfig.data.currentUser,this.userCanViewMultipleAccounts=this.currentUser?.canViewMultipleAccounts()}ngOnInit(){}onDialogClose(){this._dialogReference.close()}}return l.\u0275fac=function(s){return new(s||l)(o.Y36(d.E7),o.Y36(d.S))},l.\u0275cmp=o.Xpm({type:l,selectors:[["communication-log-viewer-modal"]],features:[o._Bn([M.uU,p]),o.qOj],decls:11,vars:11,consts:[[3,"title","onClose"],[1,"modal-body"],[2,"display","flex","flex-direction","column","gap","1rem"],[3,"toggleable","collapsed"],["pTemplate","header"],["class","w-100 v-filter-grid",4,"ngIf"],[3,"ngModel","readonly"],[4,"ngIf"],[1,"fa","fas","fa-users","me-1"],["class","ms-1",4,"ngIf"],[1,"ms-1"],[1,"w-100","v-filter-grid"],["pInputText","",1,"w-100",3,"readOnly","value"],[3,"value","disabled"],["class","attachment",4,"ngFor","ngForOf"],[1,"attachment"],[3,"href"]],template:function(s,C){1&s&&(o.TgZ(0,"modal-header",0),o.NdJ("onClose",function(){return C.onDialogClose()}),o.ALo(1,"async"),o.ALo(2,"communicationLogDate"),o.qZA(),o.TgZ(3,"div",1)(4,"div",2)(5,"p-panel",3),o.YNc(6,lt,4,3,"ng-template",4),o.YNc(7,ot,13,10,"div",5),o.qZA(),o.TgZ(8,"div"),o._UZ(9,"p-editor",6),o.qZA(),o.YNc(10,ut,2,1,"div",7),o.qZA()()),2&s&&(o.Q6J("title",C.log.subject+" - "+o.lcZ(1,7,o.lcZ(2,9,C.log.createdDate))),o.xp6(5),o.Q6J("toggleable",!0)("collapsed",!0),o.xp6(2),o.Q6J("ngIf",C.displayModal),o.xp6(2),o.Q6J("ngModel",C.log.body)("readonly",!0),o.xp6(1),o.Q6J("ngIf",(null==C.log.attachmentUrls?null:C.log.attachmentUrls.length)>0))},dependencies:[M.sg,M.O5,Z.jx,j.o,q.ML,X.JJ,X.On,V.s,G.S,k.R,M.Ov,et.n,at.X,tt,st],encapsulation:2,changeDetection:0}),l})();var it=e(67911);let ht=(()=>{class l{constructor(s){this._dynamicDialogService=s}ngOnInit(){}subjectClicked(s){s.preventDefault(),s.stopPropagation(),this._dynamicDialogService.open(gt,{data:{log:this.log,translations:this.translations,currentUser:this.currentUser}})}get userCanViewMultipleAccounts(){return this.currentUser?.canViewMultipleAccounts()}}return l.\u0275fac=function(s){return new(s||l)(o.Y36(it.W))},l.\u0275cmp=o.Xpm({type:l,selectors:[["communication-log-viewer"]],inputs:{log:"log",translations:"translations",currentUser:"currentUser"},decls:2,vars:1,consts:[["href","#",3,"click"]],template:function(s,C){1&s&&(o.TgZ(0,"a",0),o.NdJ("click",function(N){return C.subjectClicked(N)}),o._uU(1),o.qZA()),2&s&&(o.xp6(1),o.Oqu(C.log.subject))},styles:[".attachment[_ngcontent-%COMP%]{background-color:#e1cfe7;border:solid #8A427A;border-width:0 0 0 6px;color:#2c1e30;padding:.5rem}.attachments-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}","[_nghost-%COMP%]     .p-editor-toolbar{display:none}[_nghost-%COMP%]     .p-editor-container{border-radius:3px;border:solid 1px #a6a6a6!important}[_nghost-%COMP%]     .p-editor-container *{border:none!important}"],changeDetection:0}),l})();function At(l,_){if(1&l&&o._UZ(0,"communication-log-viewer",2),2&l){const s=_.$implicit,C=o.oxw();o.Q6J("log",s)("translations",C.translations)("currentUser",C.currentUser)}}let vt=(()=>{class l{constructor(){this.stateChanged=new o.vpe}ngOnChanges(s){this.columns=[{field:"subject",fieldSelector:"subject",headerKey:"subject",sortable:!0},{field:"createdDate",header:`${this.translations.createdDate} (UTC)`,dateFormat:"short",timeZone:"UTC",sortable:!0},{field:"sentBy",headerKey:"sentBy",sortable:!0}]}}return l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=o.Xpm({type:l,selectors:[["communications-history-table"]],inputs:{logs:"logs",state:"state",translations:"translations",currentUser:"currentUser"},outputs:{stateChanged:"stateChanged"},features:[o.TTD],decls:2,vars:4,consts:[[3,"data","columns","state","stateChanged"],[3,"sharedTable"],[3,"log","translations","currentUser"]],template:function(s,C){1&s&&(o.TgZ(0,"shared-table",0),o.NdJ("stateChanged",function(N){return C.stateChanged.emit(N)}
1),o.YNc(1,At,1,3,"ng-template",1),o.qZA()),2&s&&(o.Q6J("data",C.logs)("columns",C.columns)("state",C.state),o.xp6(1),o.Q6J("sharedTable","subject"))},dependencies:[z.k,K.h,ht],encapsulation:2,changeDetection:0}),l})();function _t(l,_){if(1&l){const s=o.EpF();o.TgZ(0,"v-loading-container",2),o.ALo(1,"async"),o.TgZ(2,"communications-history-table",3),o.NdJ("stateChanged",function(R){o.CHM(s);const N=o.oxw();return o.KtG(N.communicationsHistoryService.setTableState(R))}),o.ALo(3,"async"),o.ALo(4,"async"),o.ALo(5,"async"),o.qZA()()}if(2&l){const s=_.translated,C=o.oxw();o.Q6J("working",o.lcZ(1,5,C.communicationsHistoryService.loading$)),o.xp6(2),o.Q6J("logs",o.lcZ(3,7,C.logs$))("state",o.lcZ(4,9,C.tableState$))("translations",s)("currentUser",o.lcZ(5,11,C.currentUser$))}}const ft=[{path:"",component:(()=>{class l{constructor(s,C,R,N){this.communicationsHistoryService=s,this._translationService=C,this._containerWrapperToastService=R,this._authService=N}ngOnInit(){this.logs$=this.communicationsHistoryService.data$.pipe((0,E.K)(s=>{throw this._containerWrapperToastService.addMessage({severity:"error",summary:this._translationService.translate("error"),detail:this._translationService.translate("anErrorHasOccurred")}),s})),this.tableState$=this.communicationsHistoryService.tableState$,this.currentUser$=this._authService.authUser$}}return l.\u0275fac=function(s){return new(s||l)(o.Y36(B),o.Y36(I.D),o.Y36(D.B),o.Y36(L.e8))},l.\u0275cmp=o.Xpm({type:l,selectors:[["communications-history-container"]],decls:2,vars:1,consts:[[3,"headerKey"],["vContainerTemplate","content"],[3,"working"],[3,"logs","state","translations","currentUser","stateChanged"]],template:function(s,C){1&s&&(o.TgZ(0,"v-container-wrapper",0),o.YNc(1,_t,6,13,"ng-template",1),o.qZA()),2&s&&o.Q6J("headerKey","history")},dependencies:[F.V,w.d,H.o,vt,M.Ov],encapsulation:2,changeDetection:0}),l})(),canActivate:[P.v],data:{titleKey:(0,n.Bv)("history"),requiredPermission:[T.J.MassCommunicationsHistory,f.e.Read]}}];let Ct=(()=>{class l{}return l.\u0275fac=function(s){return new(s||l)},l.\u0275mod=o.oAB({type:l}),l.\u0275inj=o.cJS({imports:[v.Bz.forChild(ft),v.Bz]}),l})();var Tt=e(32442),yt=e(21493),xt=e(35593);let m=(()=>{class l{}return l.\u0275fac=function(s){return new(s||l)},l.\u0275mod=o.oAB({type:l}),l.\u0275inj=o.cJS({imports:[M.ez,Z.m8]}),l})();var c=e(63054),r=e(2626),h=e(91097),i=e(55185),a=e(55811);let A=(()=>{class l{}return l.\u0275fac=function(s){return new(s||l)},l.\u0275mod=o.oAB({type:l}),l.\u0275inj=o.cJS({providers:[M.uU,p],imports:[M.ez,Ct,Tt.S,yt.S,xt.hJ,m,j.j,c.A,q.Z_,X.u5,V.Q,r.o,h.H,i.a,a.z]}),l})()},66145:(Q,O,e)=>{e.r(O),e.d(O,{CommunicationsSendModule:()=>c});var M=e(36895),v=e(87396),P=e(20710),T=e(73354),f=e(42329),n=e(1908),E=e(591),o=e(87224),t=e(94650),J=e(13598),S=e(12039),b=e(24006),x=e(17489),B=e(40537),I=e(21086),D=e(87545);let L=(()=>{class r{constructor(i,a){this._communicationsSendClient=i,this._communicationsTemplatesClient=a,this._isSending$=new E.X(!1),this.isSending$=this._isSending$.asObservable(),this._loadingRecipients$=new E.X(!1),this.loadingRecipients$=this._loadingRecipients$.asObservable()}getNumberOfRecipients(i){return(0,I.of)("").pipe((0,D.w)(()=>(this._loadingRecipients$.next(!0),this._communicationsSendClient.getNumberOfRecipients(i).pipe((0,B.x)(()=>this._loadingRecipients$.next(!1))))))}getTemplates(){return this._communicationsTemplatesClient.getAll()}sendCommunication(i){return(0,I.of)("").pipe((0,D.w)(()=>(this._isSending$.next(!0),this._communicationsSendClient.send(i).pipe((0,B.x)(()=>this._isSending$.next(!1))))))}uploadAttachment(i){return this._communicationsSendClient.uploadAttachment({data:i,fileName:i.name})}deleteAttachment(i){return this._communicationsSendClient.deleteAttachment(i.name)}}return r.\u0275fac=function(i){return new(i||r)(t.LFG(S.d3M),t.LFG(S.szd))},r.\u0275prov=t.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})();var F=e(60270);let w=(()=>{class r{transform(i){if(i<1e3)return`${i} bytes`;const a=Math.ceil(i/1e3);if(a<1e3)return`${a} KB`;const A=Math.ceil(a/1e3);return A<1e3?`${A} MB`:`${Math.ceil(A/1e3)}/1000`}}return r.\u0275fac=function(i){return new(i||r)},r.\u0275pipe=t.Yjl({name:"displayByteSize",type:r,pure:!0}),r})();function H(r,h){if(1&r&&(t.TgZ(0,"small",4),t._uU(1),t.qZA()),2&r){const i=t.oxw();
1t.xp6(1),t.Oqu(i.error)}}let z=(()=>{class r{constructor(){this.upload=new t.vpe,this.delete=new t.vpe}ngOnInit(){}handleDelete(){this.delete.emit(this.file)}}return r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=t.Xpm({type:r,selectors:[["communications-attachment"]],inputs:{file:"file",loading:"loading",error:"error"},outputs:{upload:"upload",delete:"delete"},decls:7,vars:8,consts:[[3,"working"],[1,"attachment","w-100","d-flex","justify-content-between"],[1,"fa","fa-times","fa-lg",3,"click"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(i,a){1&i&&(t.TgZ(0,"v-loading-container",0)(1,"div",1)(2,"div"),t._uU(3),t.ALo(4,"displayByteSize"),t.qZA(),t.TgZ(5,"i",2),t.NdJ("click",function(){return a.handleDelete()}),t.qZA()(),t.YNc(6,H,2,1,"small",3),t.qZA()),2&i&&(t.Q6J("working",a.loading),t.xp6(1),t.ekj("error",!!a.error),t.xp6(2),t.AsE("",a.file.name," (",t.lcZ(4,6,a.file.size),")"),t.xp6(3),t.Q6J("ngIf",a.error))},dependencies:[M.O5,F.o,w],styles:[".attachment[_ngcontent-%COMP%]{background-color:#e1cfe7;border:solid #8A427A;border-width:0 0 0 6px;color:#2c1e30;padding:.5rem}.attachments-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}",".error[_ngcontent-%COMP%]{background-color:#ffcdd2!important;color:#73000c!important;border-color:#e60017!important}.fa-times[_ngcontent-%COMP%]:hover{cursor:pointer}"],changeDetection:0}),r})();function K(r,h){if(1&r){const i=t.EpF();t.TgZ(0,"div",1)(1,"communications-attachment",2),t.NdJ("upload",function(A){t.CHM(i);const l=t.oxw();return t.KtG(l.upload(A))})("delete",function(A){t.CHM(i);const l=t.oxw();return t.KtG(l.delete(A))}),t.ALo(2,"async"),t.ALo(3,"async"),t.qZA()()}if(2&r){const i=h.$implicit;t.xp6(1),t.Q6J("file",i.file)("loading",t.lcZ(2,3,i.loading))("error",t.lcZ(3,5,i.error))}}let W=(()=>{class r{constructor(i){this._communicationsSendService=i,this.attachments=new E.X([]),this.maxAttachmentsSize=1e7}set files(i){for(let a=0;a<i.length;a++){const A=i.item(a);if(this.attachments.value.findIndex(l=>l.file.name===A.name)<0){const l={file:A,loading:new E.X(!1),error:new E.X(null)};this.attachments.next([...this.attachments.value,l]),this.upload(A)}}}ngOnInit(){}upload(i){const a=this.getAttachment(i);a.loading.next(!0),this._communicationsSendService.uploadAttachment(i).pipe((0,o.P)(),(0,B.x)(()=>a.loading.next(!1))).subscribe(A=>{a.url=A,this.updateControl()},A=>{A.errorKey===S.Thb.FileAlreadyExists&&(a.error.next(`A file with the name '${i.name}' already exists. Change the file name and upload again.`),this.updateControl())})}delete(i){const a=this.getAttachment(i);this.attachments.next(this.attachments.value.filter(A=>A!==a)),this.updateControl(),null==a.error.value&&this.deleteFile(i)}deleteAllAttachments(){for(const i of this.attachments.value)this.deleteFile(i.file);this.clearAttachments()}clearAttachments(){this.attachments.next([]),this.updateControl()}deleteFile(i){this._communicationsSendService.deleteAttachment(i).pipe((0,o.P)()).subscribe()}getAttachment(i){return this.attachments.value.find(a=>a.file===i)}updateControl(){this.control.setValue(this.attachments.value.map(i=>i.url)),this.control.markAsDirty()}get currentAttachmentsSize(){let i=0;for(const a of this.attachments.value)i+=a.file.size;return i}}return r.\u0275fac=function(i){return new(i||r)(t.Y36(L))},r.\u0275cmp=t.Xpm({type:r,selectors:[["communications-attachments"]],inputs:{control:"control"},decls:2,vars:3,consts:[["class","attachments-container",4,"ngFor","ngForOf"],[1,"attachments-container"],[3,"file","loading","error","upload","delete"]],template:function(i,a){1&i&&(t.YNc(0,K,4,7,"div",0),t.ALo(1,"async")),2&i&&t.Q6J("ngForOf",t.lcZ(1,1,a.attachments))},dependencies:[M.sg,z,M.Ov],styles:[".attachment[_ngcontent-%COMP%]{background-color:#e1cfe7;border:solid #8A427A;border-width:0 0 0 6px;color:#2c1e30;padding:.5rem}.attachments-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0}),r})();var Y=e(82210);let $=(()=>{class r{constructor(i){this._cdr=i,this.templateSelected=new t.vpe}ngOnChanges(i){const a=this.templates?.map(A=>({label:A.name,value:A}))??[];a.unshift({label:this.translations.blankTemplate,value:null}),this.options=a}selectTemplate(i){this.selectedTemplate=i,this.templateSelected.emit(i)}reset(){this.selectedTemplate=null,this._cdr.detectChanges()}}return r.\u0275fac=function(i){return new(i||r)(t.Y36(t.sBO))},r.\u0275cmp=t.Xpm({type:r,selectors:[["communications-template-dropdown"]],inputs:{templates:"templates",translations:"translations"},outputs:{templateSelected:"templateSelected"},features:[t.TTD],decls:4,vars:5,consts:[["styleClass","w-100",3,"options","placeholder","ngModel","filter","onChange"]],template:function(i,a){1&i&&(t.TgZ(0,"div")(1,"label"),t._uU(2),t.qZA(),t.TgZ(3,"p-dropdown",0),t.NdJ("onChange",function(l){return a.selectTemplate(l.value)}),t.qZA()()),2&i&&(t.xp6(2),t.Oqu(a.translations.template),t.xp6(1),t.Q6J("options",a.options)("placeholder",a.translations.blankTemplate)("ngModel",a.selectedTemplate)("filter",!0))},dependencies:[b.JJ,b.On,Y.Lt],encapsulation:2,changeDetection:0}),r})();
1var y=e(61739),u=e(67911),p=e(91712),d=e(51740),Z=e(85121),j=e(10805),q=e(13821),X=e(27893),V=e(7106),G=e(34092),k=e(20694),et=e(82435),at=e(21642),tt=e(1383),st=e(35593),nt=e(92665),lt=e(2934);function rt(r,h){if(1&r&&(t.TgZ(0,"div"),t._UZ(1,"communications-category",18),t.TgZ(2,"small",12),t._uU(3),t.qZA()()),2&r){const i=t.oxw();t.xp6(1),t.Q6J("control",i.controls.categoryId),t.xp6(1),t.ekj("hidden",!i.controls.categoryId.hasError("required")||!i.controls.categoryId.touched),t.xp6(1),t.hij(" ",i.translations.required," ")}}function ct(r,h){if(1&r){const i=t.EpF();t.TgZ(0,"span",30)(1,"button",31),t.NdJ("click",function(){t.CHM(i),t.oxw();const A=t.MAs(1);return t.KtG(A.click())}),t.qZA(),t._UZ(2,"button",32)(3,"button",33)(4,"button",34)(5,"button",35),t.qZA(),t.TgZ(6,"span",30),t._UZ(7,"select",36)(8,"select",37),t.qZA(),t.TgZ(9,"span",30),t._UZ(10,"button",38)(11,"button",39)(12,"button",40)(13,"button",41),t.qZA(),t.TgZ(14,"span",30),t._UZ(15,"button",42)(16,"button",43),t.qZA(),t.TgZ(17,"span",30),t._UZ(18,"select",44),t.qZA()}}function mt(r,h){if(1&r&&(t.TgZ(0,"div"),t._UZ(1,"p-message",45),t.ALo(2,"displayByteSize"),t.qZA()),2&r){t.oxw();const i=t.MAs(34);t.xp6(1),t.Q6J("text","Max attachment size reached ("+t.lcZ(2,1,i.maxAttachmentsSize)+" max)")}}function dt(r,h){if(1&r&&(t.TgZ(0,"div"),t._UZ(1,"v-accounts-field",18),t.qZA()),2&r){const i=t.oxw();t.xp6(1),t.Q6J("control",i.controls.recipientAccountIds)}}function ot(r,h){if(1&r&&(t.TgZ(0,"div"),t._UZ(1,"v-field-group-type-multi-select-field",18),t.qZA()),2&r){const i=t.oxw();t.xp6(1),t.Q6J("control",i.controls.recipientFieldGroupTypeIds)}}function pt(r,h){if(1&r&&(t.TgZ(0,"div",5),t._UZ(1,"v-products",18),t.qZA()),2&r){const i=t.oxw();t.xp6(1),t.Q6J("control",i.controls.recipientProductIds)}}function ut(r,h){if(1&r&&(t.TgZ(0,"div"),t._UZ(1,"communications-include-primary-admin",18),t.qZA()),2&r){const i=t.oxw();t.xp6(1),t.Q6J("control",i.controls.includePrimaryProviderAdmins)}}const gt=function(){return{height:"320px"}};let it=(()=>{class r extends J.e{constructor(i,a,A){super(),this._fb=i,this._dynamicDialogService=a,this._translationService=A,this.send=new t.vpe,this.updateRecipients=new t.vpe}ngOnInit(){this.initForm(),this.initFormSharedValues(({previous:i,current:a})=>{(!x.isEqual(i.categoryId,a.categoryId)||!x.isEqual(i.recipientTagIds,a.recipientTagIds)||!x.isEqual(i.recipientRoleIds,a.recipientRoleIds)||!x.isEqual(i.recipientProductIds,a.recipientProductIds)||!x.isEqual(i.recipientFieldGroupTypeIds,a.recipientFieldGroupTypeIds)||!x.isEqual(i.recipientAccountIds,a.recipientAccountIds)||i.includePrimaryProviderAdmins!==a.includePrimaryProviderAdmins)&&this.updateRecipients.emit(a)}),this.updateRecipients.emit(this.value)}initForm(){this.form=this._fb.group({subject:["",b.kI.required],body:["",b.kI.required],categoryId:[""],attachmentUrls:this._fb.control(null,{validators:i=>{const a={};return null!=this.attachmentsComponent?.attachments?.value?.find(A=>null!=A.error.value)&&(a.invalidFile=!0),this.attachmentsComponent?.currentAttachmentsSize>this.attachmentsComponent?.maxAttachmentsSize&&(a.maxAttachmentsSize=!0),Object.keys(a)?.length>0?a:null}}),recipientAccountIds:[],recipientFieldGroupTypeIds:[],recipientRoleIds:[],recipientTagIds:[],recipientProductIds:[],includePrimaryProviderAdmins:[!1]}),this.form.defaultValues=new S.HKh}resetForm(){this.template=new S.HKh,this.form.markAsPristine(),this.form.markAsUntouched(),this.form.updateValueAndValidity(),this.attachmentsComponent.clearAttachments(),this.controls.includePrimaryProviderAdmins.setValue(!1),this.templateDropdown.reset()}cancelWithConfirmation(){this.form.dirty?this._dynamicDialogService.open(y.z,{data:{header:this.translations.discard,message:this.translations.areYouSureYouWantToDiscardYourChanges,acceptLabel:this.translations.yes,rejectLabel:this.translations.no,accept:()=>this.cancel()}}):this.cancel()}cancel(){this.attachmentsComponent.deleteAllAttachments(),this.resetForm()}set template(i){this.controls.subject.setValue(i.subject),this.controls.body.setValue(i.body),this.editorText=i.body,this.controls.categoryId.setValue(i.categoryId?.toString()),this.attachmentsComponent.clearAttachments(),this.controls.includePrimaryProvi
1derAdmins.setValue(!1),this.controls.recipientAccountIds.setValue(i.recipientAccountIds?.map(a=>a.toString())),this.controls.recipientFieldGroupTypeIds.setValue(i.recipientFieldGroupTypeIds?.map(a=>a.toString())),this.controls.recipientRoleIds.setValue(i.recipientRoleIds?.map(a=>a.toString())),this.controls.recipientTagIds.setValue(i.recipientTagIds?.map(a=>a.toString())),this.controls.recipientProductIds.setValue(i.recipientProductIds?.map(a=>a.toString()))}sendCommunication(){this._dynamicDialogService.open(y.z,{data:{header:this.translations.areYouSureYouWantToProceed,message:this._translationService.translate("communications.send.confirmation",{count:this.recipientCount}),acceptLabel:this.translations.yes,rejectLabel:this.translations.no,accept:()=>this.send.emit(this.value)}})}get value(){return new S.HKh({subject:this.controls.subject.value,body:this.controls.body.value,categoryId:this.controls.categoryId.value,attachmentUrls:this.controls.attachmentUrls.value,recipientAccountIds:this.controls.recipientAccountIds.value,recipientFieldGroupTypeIds:this.controls.recipientFieldGroupTypeIds.value,recipientRoleIds:this.controls.recipientRoleIds.value,recipientTagIds:this.controls.recipientTagIds.value,recipientProductIds:this.controls.recipientProductIds.value,includePrimaryProviderAdmins:this.controls.includePrimaryProviderAdmins.value})}setBody(i){this.editorText=i,this.controls.body.setValue(i.htmlValue),this.controls.body.markAsTouched(),this.form.markAsDirty()}templateSelected(i){this.template={...i}}}return r.\u0275fac=function(i){return new(i||r)(t.Y36(b.QS),t.Y36(u.W),t.Y36(p.D))},r.\u0275cmp=t.Xpm({type:r,selectors:[["communications-send-email-form"]],viewQuery:function(i,a){if(1&i&&(t.Gf(W,5),t.Gf($,5)),2&i){let A;t.iGM(A=t.CRH())&&(a.attachmentsComponent=A.first),t.iGM(A=t.CRH())&&(a.templateDropdown=A.first)}},inputs:{translations:"translations",recipientCount:"recipientCount",loadingRecipientCount:"loadingRecipientCount",templates:"templates"},outputs:{send:"send",updateRecipients:"updateRecipients"},features:[t.qOj],decls:55,vars:35,consts:[["id","file-input","type","file","name","name",2,"display","none",3,"multiple","change"],["fileInput",""],[1,"card","mb-3"],[1,"card-header"],[1,"card-body","w-100"],[1,"mb-3"],["for","sender"],["id","sender","value","[email protected]","pInputText","",1,"w-100",3,"disabled"],[3,"translations","templates","templateSelected"],["for","subject"],[1,"text-danger"],["id","subject","pInputText","",1,"w-100",3,"formControl","placeholder","maxLength"],[1,"text-danger","w-100"],[4,"userCanViewMultipleAccounts"],["for","body"],["id","body",3,"ngModel","placeholder","ngModelChange","onTextChange"],["pTemplate","header"],[4,"ngIf"],[3,"control"],["attachmentsComponent",""],[1,"card-body"],[3,"working"],[1,"alert","alert-info"],[1,"w-100","v-filter-grid"],[3,"selectedAccountIds","control"],["class","mb-3",4,"userCanViewMultipleAccounts"],["styleClass","w-100"],[1,"w-100","d-flex","justify-content-end"],["pButton","","icon","pi pi-send",1,"p-button-raised","p-button-success","me-1",3,"label","disabled","click"],["pButton","",1,"p-button-raised","p-button-danger",3,"label","click"],[1,"ql-formats"],[1,"pi","pi-paperclip",3,"click"],[1,"ql-bold"],[1,"ql-italic"],[1,"ql-underline"],[1,"ql-strike"],[1,"ql-color"],[1,"ql-background"],["value","1",1,"ql-header"],["value","2",1,"ql-header"],[1,"ql-blockquote"],[1,"ql-code-block"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],[1,"ql-align"],["severity","error",3,"text"]],template:function(i,a){if(1&i){const A=t.EpF();t.TgZ(0,"input",0,1),t.NdJ("change",function(){t.CHM(A);const _=t.MAs(34),s=t.MAs(1);return t.KtG(_.files=s.files)}),t.qZA(),t.TgZ(2,"div",2)(3,"div",3),t._uU(4),t.qZA(),t.TgZ(5,"div",4)(6,"div",5)(7,"label",6),t._uU(8),t.qZA(),t._UZ(9,"input",7),t.qZA(),t.TgZ(10,"div",5)(11,"communications-template-dropdown",8),t.NdJ("templateSelected",function(_){return a.templateSelected(_)}),t.qZA()(),t.TgZ(12,"div")(13,"label",9),t._uU(14),t.TgZ(15,"small",10),t._uU(16,"*"),t.qZA()(),t._UZ(17,"input",11),t.TgZ(18,"small",12),t._uU(19),t.qZA()(),t.YNc(20,rt,4,4,"div",13),t.TgZ(21,"div")(22,"label",14),t._uU(23),t.TgZ(24,"small",10),t._uU(25,"*"),t.qZA()(),t.TgZ(26,"div")(27,"p-editor",15),t.NdJ("ngModelChange",function(_){return a.editorText=_})("onTextChange",function(_){return a.setBody(_)}),t.YNc(28,ct,19,0,"ng-template",16),t.qZA(),t.TgZ(29,"small",12),t._uU(30),t.qZA()()(),t.TgZ(31,"div"),t.YNc(32,mt,3,3,"div",17),t._UZ(33,"communications-attachments",18,19),t.qZA()()(),t.TgZ(35,"div",2)(36,"div",3),t._uU(37),t.qZA(),t.TgZ(38,"div",20)(39,"v-loading-container",21)(40,"div",22),t._uU(41),t.qZA()(),t.TgZ(42,"div",23),t.YNc(43,dt,2,1,"div",13),t.YNc(44,ot,2,1,"div",13),t.TgZ(45,"div"),t._UZ(46,"v-roles",18),t.qZA(),t.TgZ(47,"div"),t._UZ(48,"volt-tags-field",24),t.qZA(),t.YNc(49,pt,2,1,"div",25),t.YNc(50,ut,2,1,"div",13),t.qZA()()(),t.TgZ(51,"p-toolbar",26)(52,"div",27)(53,"button",28),t.NdJ("click",function(){return a.sendCommunication()}),t.qZA(),t.TgZ(54,"button",29),t.NdJ("click",function(){return a.cancelWithConfirmation()}),t.qZA()()()}2&i&&(t.Q6J("multiple",!0),t.xp6(4),t.Oqu(a.translations.message),t.xp6(4),t.Oqu(a.translations.sender),t.xp6(1),t.Q6J("disabled",!0),t.xp6(2),t.Q6J("translations",a.translations)("templates",a.templates),t.xp6(3),t.hij(" ",a.translations.subject," "),t.xp6(3),t.Q6J("formControl",a.controls.subject)("placeholder",a.translations.subject)("maxLength",100),t.xp6(1),t.ekj("hidden",!a.controls.subject.hasError("required")||!a.controls.subject.touched),t.xp6(1),t.hij(" ",a.translations.required," "),t.xp6(4),t.hij(" ",a.translations.body," "),t.xp6(4),t.Akn(t.DdM(34,gt)),t.Q6J("ngModel",a.editorText)("placeholder",a.translations.typeEmailBodyHere),t.xp6(2),t.ekj("hidden",!a.controls.body.hasError("required")||!a.controls.body.touched),t.xp6(1),t.hij(" ",a.translations.required," "),t.xp6(2),t.Q6J("ngIf",a.controls.attachmentUrls.hasError("maxAttachmentsSize")),t.xp6(1),t.Q6J("control",a.controls.attachmentUrls),t.xp6(4),t.AsE("",a.translations.recipientGroups," (",a.translations.required,")"),t.xp6(2),t.Q6J("working",a.loadingRecipientCount),t.xp6(2),t.AsE("",a.recipientCount," ",a.translations.recipientsSelected,""),t.xp6(5),t.Q6J("control",a.controls.recipientRoleIds),t.xp6(2),t.Q6J("selectedAccountIds",a.controls.recipientAccountIds.value)("control",a.controls.recipientTagIds),t.xp6(5),t.Q6J("label",a.translations.send)("disabled",!a.form.valid||!a.form.dirty),t.xp6(1),t.Q6J("label",a.translations.cancel))},dependencies:[M.O5,d.o,b.Fj,b.JJ,b.oH,Z.ML,j.jx,b.On,q.G,X.O,V.k,G.y,k.P,et.k,at.S,tt.o,st.Hq,nt.q,F.o,lt.T,W,$,w],styles:[".hidden[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),r})();var ht=e(5650),At=e(22255),vt=e(52824);function _t(r,h){if(1&r){const i=t.EpF();t.TgZ(0,"v-loading-container",2),t.ALo(1,"async"),t.TgZ(2,"communications-send-email-form",3),t.NdJ("send",function(A){t.CH
1M(i);const l=t.oxw();return t.KtG(l.sendCommunication(A))})("updateRecipients",function(A){t.CHM(i);const l=t.oxw();return t.KtG(l.updateRecipients(A))}),t.ALo(3,"async"),t.ALo(4,"async"),t.ALo(5,"async"),t.qZA()()}if(2&r){const i=h.translated,a=t.oxw();t.Q6J("working",t.lcZ(1,5,a.communicationsSendService.isSending$)),t.xp6(2),t.Q6J("translations",i)("recipientCount",t.lcZ(3,7,a.recipientCount$))("loadingRecipientCount",t.lcZ(4,9,a.communicationsSendService.loadingRecipients$))("templates",t.lcZ(5,11,a.templates$))}}const ft=[{path:"",component:(()=>{class r{constructor(i,a,A){this.communicationsSendService=i,this._containerWrapperToastService=a,this._translationService=A,this.recipientCountSubject$=new E.X(0),this.recipientCount$=this.recipientCountSubject$.asObservable()}ngOnInit(){this.templates$=this.communicationsSendService.getTemplates()}unloading(){this.ngOnDestroy()}ngOnDestroy(){this.emailFormComponent.form.dirty&&this.emailFormComponent.attachmentsComponent.deleteAllAttachments()}updateRecipients(i){this.communicationsSendService.getNumberOfRecipients(i).pipe((0,o.P)()).subscribe(a=>this.recipientCountSubject$.next(a),a=>{console.error(a),this._containerWrapperToastService.addMessage({severity:"error",summary:this._translationService.translate("error"),detail:this._translationService.translate("anErrorHasOccurred")})})}sendCommunication(i){this.communicationsSendService.sendCommunication(i).pipe((0,o.P)()).subscribe(()=>{this._containerWrapperToastService.addMessage({severity:"success",summary:this._translationService.translate("success")}),this.emailFormComponent.resetForm()},a=>{console.error(a),this._containerWrapperToastService.addMessage({severity:"error",summary:this._translationService.translate("error"),detail:a.detail})})}}return r.\u0275fac=function(i){return new(i||r)(t.Y36(L),t.Y36(ht.B),t.Y36(p.D))},r.\u0275cmp=t.Xpm({type:r,selectors:[["communications-send-container"]],viewQuery:function(i,a){if(1&i&&t.Gf(it,5),2&i){let A;t.iGM(A=t.CRH())&&(a.emailFormComponent=A.first)}},hostBindings:function(i,a){1&i&&t.NdJ("beforeunload",function(){return a.unloading()},!1,t.Jf7)},decls:2,vars:2,consts:[[3,"headerKey","withToast"],["vContainerTemplate","content"],[3,"working"],[3,"translations","recipientCount","loadingRecipientCount","templates","send","updateRecipients"]],template:function(i,a){1&i&&(t.TgZ(0,"v-container-wrapper",0),t.YNc(1,_t,6,13,"ng-template",1),t.qZA()),2&i&&t.Q6J("headerKey","send")("withToast",!0)},dependencies:[At.V,vt.d,it,F.o,M.Ov],encapsulation:2,changeDetection:0}),r})(),canActivate:[P.v],data:{titleKey:(0,n.Bv)("send"),requiredPermission:[T.J.MassCommunicationsSend,f.e.Read]}}];let Ct=(()=>{class r{}return r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[v.Bz.forChild(ft),v.Bz]}),r})();var Tt=e(71131),yt=e(2626),xt=e(96919),g=e(57245);let U=(()=>{class r{}return r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[M.ez]}),r})();var m=e(28062);let c=(()=>{class r{}return r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[M.ez,Ct,d.j,b.UX,Z.Z_,b.u5,Tt.W,yt.o,tt.V,xt.O,nt.O,g.u,U,Y.kW,m.G]}),r})()},82435:(Q,O,e)=>{e.d(O,{k:()=>b});var M=e(9706),v=e(70597),P=e(87545),T=e(1908),f=e(94650),n=e(91712),E=e(12039),o=e(36895),t=e(82210),J=e(24006);function S(x,B){if(1&x&&(f.ynx(0),f.TgZ(1,"label"),f._uU(2),f.qZA(),f._UZ(3,"p-dropdown",1),f.BQk()),2&x){const I=f.oxw();f.xp6(2),f.Oqu(I.translatedData.category),f.xp6(1),f.Q6J("options",I.items)("formControl",I.control)("placeholder",I.translatedData.selectCategory)}}let b=(()=>{class x extends M.D{constructor(I,D,L){super(I),this._translationService=I,this._cd=D,this._communicationsCategoryClient=L}ngOnInit(){this.translatedData$.pipe((0,P.w)(I=>this._communicationsCategoryClient.getCategories().pipe(T.DN.mapToMultiSelectItem(D=>D.categoryName,D=>D.id.toString(),!1,I.selectCategory,null,!1)))).pipe(v.i.takeUntilDisposed(this)).subscribe(I=>{this.items=I,this.updateSelectedItems(),this._cd.markForCheck()})}ngOnChanges(I){I.control&&I.control.firstChange&&(this.updateSelectedItem(),this.control.valueChanges.pipe(v.i.takeUntilDisposed(this)).subscribe(D=>this.updateSelectedItem()),this.control.registerOnDisabledChange(D=>this._cd.markForCheck()))}get filterDisplayLabel(){return this.translatedData?.category}}return x.\u0275fac=function(I){return new(I||x)(f.Y36(n.D),f.Y36(f.sBO),f.Y36(E.JHI))},x.\u0275cmp=f.Xpm({type:x,selectors:[["communications-category"]],features:[f.qOj,f.TTD],decls:1,vars:1,consts:[[4,"ngIf"],["styleClass","w-100",3,"options","formControl","placeholder"]],template:function(I,D){1&I&&f.YNc(0,S,4,4,"ng-container",0),2&I&&f.Q6J("ngIf",!!D.translatedData)},dependencies:[o.O5,t.Lt,J.JJ,J.oH],encapsulation:2,changeDetection:0}),x})()},21642:(Q,O,e)=>{e.d(O,{S:()=>J});var M=e(24850),v=e(94650),P=e(91712),T=e(36895),f=e(24006),n=e(85362);function E(S,b){if(1&S&&(v._UZ(0,"p-selectButton",4),v.ALo(1,"async")),2&S){const x=v.oxw(2);v.Q6J("options",v.lcZ(1,3,x.options$))("formControl",x.control)("disabled",x.disabled)}}function o(S,b){if(1&S&&(v._UZ(0,"p-selectButton",5),v.ALo(1,"async")),2&S){const x=v.oxw(2);v.Q6J("options",v.lcZ(1,3,x.options$))("disabled",x.disabled)("ngModel",x.value)}}function t(S,b){if(1&S&&(v.TgZ(0,"div")(1,"label",1),v._uU(2),v.qZA(),v.YNc(3,E,2,5,"p-selectButton",2),v.YNc(4,o,2,5,"p-selectButton",3),v.qZA()),2&S){const x=b.ngIf,B=v.oxw();
1v.xp6(2),v.Oqu(x.includePrimaryProviderAdmins),v.xp6(1),v.Q6J("ngIf",null!=B.control),v.xp6(1),v.Q6J("ngIf",null==B.control)}}let J=(()=>{class S{constructor(x){this._translationService=x,this.disabled=!1}ngOnInit(){this.translations$=this._translationService.getTranslatedObject(),this.options$=this.translations$.pipe((0,M.U)(x=>[{label:x.yes,value:!0},{label:x.no,value:!1}]))}}return S.\u0275fac=function(x){return new(x||S)(v.Y36(P.D))},S.\u0275cmp=v.Xpm({type:S,selectors:[["communications-include-primary-admin"]],inputs:{control:"control",value:"value",disabled:"disabled"},decls:2,vars:3,consts:[[4,"ngIf"],[1,"w-100"],[3,"options","formControl","disabled",4,"ngIf"],[3,"options","disabled","ngModel",4,"ngIf"],[3,"options","formControl","disabled"],[3,"options","disabled","ngModel"]],template:function(x,B){1&x&&(v.YNc(0,t,5,3,"div",0),v.ALo(1,"async")),2&x&&v.Q6J("ngIf",v.lcZ(1,1,B.translations$))},dependencies:[T.O5,f.JJ,f.oH,f.On,n.UN,T.Ov],encapsulation:2,changeDetection:0}),S})()},48025:(Q,O,e)=>{e.r(O),e.d(O,{CommunicationsTemplatesModule:()=>xt});var M=e(36895),v=e(87396),P=e(20710),T=e(73354),f=e(42329),n=e(1908),E=e(15861),o=e(87224),t=e(94650),J=e(13598),S=e(24006),b=e(12039),x=e(61739),B=e(67911),I=e(13821),D=e(27893),L=e(7106),F=e(34092),w=e(20694),H=e(85121),z=e(10805),K=e(51740),W=e(82435),Y=e(1383),$=e(35593),y=e(2934);function u(g,U){if(1&g&&(t.TgZ(0,"div"),t._UZ(1,"communications-category",13),t.TgZ(2,"small",6),t._uU(3),t.qZA()()),2&g){const m=t.oxw();
1t.xp6(1),t.Q6J("control",m.controls.categoryId),t.xp6(1),t.ekj("hidden",!m.controls.categoryId.hasError("required")||!m.controls.categoryId.touched),t.xp6(1),t.hij(" ",m.translations.required," ")}}function p(g,U){1&g&&(t.TgZ(0,"span",19),t._UZ(1,"button",20)(2,"button",21)(3,"button",22)(4,"button",23),t.qZA(),t.TgZ(5,"span",19),t._UZ(6,"select",24)(7,"select",25),t.qZA(),t.TgZ(8,"span",19),t._UZ(9,"button",26)(10,"button",27)(11,"button",28)(12,"button",29),t.qZA(),t.TgZ(13,"span",19),t._UZ(14,"button",30)(15,"button",31),t.qZA(),t.TgZ(16,"span",19),t._UZ(17,"select",32),t.qZA())}function d(g,U){if(1&g&&(t.TgZ(0,"div"),t._UZ(1,"v-accounts-field",13),t.qZA()),2&g){const m=t.oxw();t.xp6(1),t.Q6J("control",m.controls.recipientAccountIds)}}function Z(g,U){if(1&g&&(t.TgZ(0,"div"),t._UZ(1,"v-field-group-type-multi-select-field",13),t.qZA()),2&g){const m=t.oxw();t.xp6(1),t.Q6J("control",m.controls.recipientFieldGroupTypeIds)}}function j(g,U){if(1&g&&(t.TgZ(0,"div"),t._UZ(1,"v-products",13),t.qZA()),2&g){const m=t.oxw();t.xp6(1),t.Q6J("control",m.controls.recipientProductIds)}}const q=function(){return{height:"320px"}};let X=(()=>{class g extends J.e{constructor(m,c){super(),this._fb=m,this._dynamicDialogService=c,this.save=new t.vpe}ngOnInit(){this.initForm()}initForm(){this.form=this._fb.group({name:["",S.kI.required],subject:["",S.kI.required],body:["",S.kI.required],categoryId:[],recipientRoleIds:[],recipientTagIds:[],recipientAccountIds:[],recipientFieldGroupTypeIds:[],recipientProductIds:[]}),this.form.defaultValues=new b.bS$}resetWithConfirmation(){this.form.dirty?this._dynamicDialogService.open(x.z,{data:{header:this.translations.discardTemplateChanges,message:this.translations.areYouSureYouWantToDiscardYourChanges,acceptLabel:this.translations.yes,rejectLabel:this.translations.no,accept:()=>this.resetForm()}}):this.resetForm()}resetForm(){this.template=new b.bS$,this.form.markAsPristine(),this.form.markAsUntouched(),this.form.updateValueAndValidity()}saveTemplate(){this.save.emit({name:this.controls.name.value,subject:this.controls.subject.value,body:this.controls.body.value,categoryId:this.controls.categoryId.value,recipientRoleIds:this.controls.recipientRoleIds.value,recipientTagIds:this.controls.recipientTagIds.value,recipientAccountIds:this.controls.recipientAccountIds.value,recipientFieldGroupTypeIds:this.controls.recipientFieldGroupTypeIds.value,recipientProductIds:this.controls.recipientProductIds.value})}set template(m){this.controls.name.setValue(m.name),this.controls.subject.setValue(m.subject),this.controls.body.setValue(m.body),this.editorText=m.body,this.controls.categoryId.setValue(m.categoryId?.toString()),this.controls.recipientRoleIds.setValue(m.recipientRoleIds?.map(c=>c.toString())),this.controls.recipientTagIds.setValue(m.recipientTagIds?.map(c=>c.toString())),this.controls.recipientAccountIds.setValue(m.recipientAccountIds?.map(c=>c.toString())),this.controls.recipientFieldGroupTypeIds.setValue(m.recipientFieldGroupTypeIds?.map(c=>c.toString())),this.controls.recipientProductIds.setValue(m.recipientProductIds?.map(c=>c.toString()))}setBody(m){this.editorText=m,this.controls.body.setValue(m.htmlValue),this.controls.body.markAsTouched(),this.form.markAsDirty()}}return g.\u0275fac=function(m){return new(m||g)(t.Y36(S.QS),t.Y36(B.W))},g.\u0275cmp=t.Xpm({type:g,selectors:[["edit-template"]],inputs:{translations:"translations"},outputs:{save:"save"},features:[t.qOj],decls:49,vars:32,consts:[["id","container",1,"w-100"],[1,"card"],[1,"card-header"],[1,"card-body","w-100"],[1,"text-danger"],["pInputText","",1,"w-100",3,"formControl","maxLength","placeholder"],[1,"text-danger","w-100"],["pInputText","",1,"w-100",3,"formControl","maxlength","placeholder"],[4,"userCanViewMultipleAccounts"],[2,"grid-column","1/-1"],[3,"ngModel","placeholder","ngModelChange","onTextChange"],["pTemplate","header"],["id","recipient-container",1,"card-body","v-filter-grid"],[3,"control"],[3,"selectedAccountIds","control"],["styleClass","w-100"],["id","button-container"],["pButton","","icon","pi pi-save",1,"p-button-raised","p-button-success","me-1",3,"label","disabled","click"],["pButton","",1,"p-button-raised","p-button-danger",3,"label","click"],[1,"ql-formats"],[1,"ql-bold"],[1,"ql-italic"],[1,"ql-underline"],[1,"ql-strike"],[1,"ql-color"],[1,"ql-background"],["value","1",1,"ql-header"],["value","2",1,"ql-header"],[1,"ql-blockquote"],[1,"ql-code-block"],["value","ordered",1,"ql-list"],["value","bullet",1,"ql-list"],[1,"ql-align"]],template:function(m,c){1&m&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.qZA(),t.TgZ(4,"div",3)(5,"div")(6,"label"),t._uU(7),t.TgZ(8,"small",4),t._uU(9,"*"),t.qZA()(),t.TgZ(10,"div"),t._UZ(11,"input",5),t.TgZ(12,"small",6),t._uU(13),t.qZA()()(),t.TgZ(14,"div")(15,"label"),t._uU(16),t.TgZ(17,"small",4),t._uU(18,"*"),t.qZA()(),t.TgZ(19,"div"),t._UZ(20,"input",7),t.TgZ(21,"small",6),t._uU(22),t.qZA()()(),t.YNc(23,u,4,4,"div",8),t.TgZ(24,"div",9)(25,"label"),t._uU(26),t.TgZ(27,"small",4),t._uU(28,"*"),t.qZA()(),t.TgZ(29,"div")(30,"p-editor",10),t.NdJ("ngModelChange",function(h){return c.editorText=h})("onTextChange",function(h){return c.setBody(h)}),t.YNc(31,p,18,0,"ng-template",11),t.qZA(),t.TgZ(32,"small",6),t._uU(33),t.qZA()()()()(),t.TgZ(34,"div",1)(35,"div",2),t._uU(36),t.qZA(),t.TgZ(37,"div",12),t.YNc(38,d,2,1,"div",8),t.YNc(39,Z,2,1,"div",8),t.TgZ(40,"div"),t._UZ(41,"v-roles",13),t.qZA(),t.TgZ(42,"div"),t._UZ(43,"volt-tags-field",14),t.qZA(),t.YNc(44,j,2,1,"div",8),t.qZA()(),t.TgZ(45,"p-toolbar",15)(46,"div",16)(47,"button",17),t.NdJ("click",function(){return c.saveTemplate()}),t.qZA(),t.TgZ(48,"button",18),t.NdJ("click",function(){return c.resetWithConfirmation()}),t.qZA()()()()),2&m&&(t.xp6(3),t.Oqu(c.translations.details),t.xp6(4),t.hij(" ",c.translations.templateName," "),t.xp6(4),t.Q6J("formControl",c.controls.name)("maxLength",50)("placeholder",c.translations.typeTemplateNameHere),t.xp6(1),t.ekj("hidden",!c.controls.name.hasError("required")||!c.controls.name.touched),t.xp6(1),t.hij(" ",c.translations.required," "),t.xp6(3),t.hij(" ",c.translations.subject," "),t.xp6(4),t.Q6J("formControl",c.controls.subject)("maxlength",100)("placeholder",c.translations.typeEmailSubjectHere),t.xp6(1),t.ekj("hidden",!c.controls.subject.hasError("required")||!c.controls.subject.touched),t.xp6(1),t.hij(" ",c.translations.required," "),t.xp6(4),t.hij(" ",c.translations.body," "),t.xp6(4),t.Akn(t.DdM(31,q)),t.Q6J("ngModel",c.editorText)("placeholder",c.translations.typeEmailBodyHere),t.xp6(2),t.ekj("hidden",!c.controls.body.hasError("required")||!c.controls.body.touched),t.xp6(1),t.hij(" ",c.translations.required," "),t.xp6(3),t.AsE("",c.translations.recipientGroups," (",c.translations.optional,")"),t.xp6(5),t.Q6J("control",c.controls.recipientRoleIds),t.xp6(2),t.Q6J("selectedAccountIds",c.controls.recipientAccountIds.value)("control",c.controls.recipientTagIds),t.xp6(4),t.Q6J("label",c.translations.save)("disabled",!c.form.valid||!c.form.dirty),t.xp6(1),t.Q6J("label",c.translations.cancel))},dependencies:[S.Fj,S.JJ,S.nD,S.oH,I.G,D.O,L.k,F.y,w.P,H.ML,z.jx,K.o,W.k,S.On,Y.o,$.Hq,y.T],styles:["#container[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:1rem}#button-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:row;justify-content:end;gap:.25rem}.hidden[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),g})();var V=e(591),G=e(87545),k=e(2994),et=e(40537),at=e(24850),tt=e(68118);let st=(()=>{class g{constructor(m){this._communicationsTemplatesClient=m,this._savingTemplate$=new V.X(!1),this.savingTemplate$=this._savingTemplate$.asObservable(),this._loadingTemplates$=new V.X(!1),this.loadingTemplates$=this._loadingTemplates$.asObservable(),this._tableState$=new V.X({offset:0,limit:20,totalCount:0,sortBy:(0,n.FM)("name")}
1),this.tableState$=this._tableState$.asObservable(),this._templates$=new V.X([]),this._refreshTemplatesTrigger$=new V.X(0)}save(m){return(0,tt.of)("").pipe((0,G.w)(()=>(this._savingTemplate$.next(!0),this._communicationsTemplatesClient.post(new b.E8U(m)).pipe((0,k.b)(()=>this._refreshTemplatesTrigger$.next(this._refreshTemplatesTrigger$.value+1)),(0,et.x)(()=>this._savingTemplate$.next(!1))))))}getTemplate(m){for(const c of this._templates$.value)if(c.name===m)return c;throw new Error("Could not find template")}deleteTemplate(m){return(0,tt.of)("").pipe((0,G.w)(()=>(this._loadingTemplates$.next(!0),this._communicationsTemplatesClient.delete(m).pipe((0,k.b)(()=>{this._tableState$.value.totalCount--,this._templates$.next(this._templates$.value.filter(c=>c.name!==m))}),(0,et.x)(()=>this._loadingTemplates$.next(!1))))))}get templates$(){return this._refreshTemplatesTrigger$.asObservable().pipe((0,G.w)(()=>(this._loadingTemplates$.next(!0),this._communicationsTemplatesClient.getAll().pipe((0,G.w)(m=>(this._templates$.next(m),this.tableState$.pipe((0,G.w)(c=>this._templates$.asObservable().pipe((0,at.U)(r=>(this._tableState$.value.totalCount=r.length,r.sort((h,i)=>(0,n.DY)(h,i,c.sortBy,c.sortAscending)).slice(c.offset,r.length+c.limit))))),(0,k.b)(()=>this._loadingTemplates$.next(!1)))))))))}setTableState(m){this._tableState$.next(m)}}return g.\u0275fac=function(m){return new(m||g)(t.LFG(b.szd))},g.\u0275prov=t.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),g})();var nt=e(5650),lt=e(91712),rt=e(22255),ct=e(52824),mt=e(6206),dt=e(19373),ot=e(3608);function pt(g,U){if(1&g){const m=t.EpF();t.TgZ(0,"div",2)(1,"span",3),t._uU(2),t.qZA(),t.TgZ(3,"div",4)(4,"i",5),t.NdJ("click",function(){const h=t.CHM(m).$implicit,i=t.oxw();return t.KtG(i.templateSelected.emit(h.name))}),t.qZA(),t.TgZ(5,"i",6),t.NdJ("click",function(){const h=t.CHM(m).$implicit,i=t.oxw();return t.KtG(i.deleteTemplate.emit(h.name))}),t.qZA()()()}if(2&g){const m=U.$implicit,c=t.oxw();t.xp6(2),t.Oqu(m.name),t.xp6(2),t.Q6J("pTooltip",c.translations.editEmailTemplate),t.xp6(1),t.Q6J("pTooltip",c.translations.deleteEmailTemplate)}}function ut(g,U){if(1&g&&(t.TgZ(0,"span",7),t._uU(1),t.qZA()),2&g){const m=U.$implicit;t.xp6(1),t.Oqu(m.subject)}}let gt=(()=>{class g{constructor(){this.templateSelected=new t.vpe,this.deleteTemplate=new t.vpe,this.stateChanged=new t.vpe}ngOnInit(){this.columns=[{field:"name",fieldSelector:"name",headerKey:"templateName",sortable:!0},{field:"subject",fieldSelector:"subject",headerKey:"templateSubject",sortable:!0},{field:"lastEditedDate",headerKey:"dateLastEdited",dateFormat:"short",sortable:!0},{field:"lastEditedBy",headerKey:"editedBy",sortable:!0}]}}return g.\u0275fac=function(m){return new(m||g)},g.\u0275cmp=t.Xpm({type:g,selectors:[["template-table"]],inputs:{translations:"translations",templates:"templates",state:"state"},outputs:{templateSelected:"templateSelected",deleteTemplate:"deleteTemplate",stateChanged:"stateChanged"},decls:3,vars:5,consts:[[3,"data","columns","state","stateChanged"],[3,"sharedTable"],[1,"d-flex","flex-row","justify-content-between"],[1,"template-name"],[2,"display","flex","gap","0.3rem"],[1,"fa","fas","fa-edit","fa-lg",3,"pTooltip","click"],[1,"fa","fas","fa-times","fa-lg","text-danger",3,"pTooltip","click"],[1,"template-subject"]],template:function(m,c){1&m&&(t.TgZ(0,"shared-table",0),t.NdJ("stateChanged",function(h){return c.stateChanged.emit(h)}),t.YNc(1,pt,6,3,"ng-template",1),t.YNc(2,ut,2,1,"ng-template",1),t.qZA()),2&m&&(t.Q6J("data",c.templates)("columns",c.columns)("state",c.state),t.xp6(1),t.Q6J("sharedTable","name"),t.xp6(1),t.Q6J("sharedTable","subject"))},dependencies:[mt.k,dt.h,ot.u],styles:[".fa[_ngcontent-%COMP%]:hover{cursor:pointer}
1.template-name[_ngcontent-%COMP%]{padding-right:1rem;overflow:hidden;white-space:pre-line;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.template-subject[_ngcontent-%COMP%]{overflow:hidden;white-space:pre-line;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}"],changeDetection:0}),g})();var it=e(60270);function ht(g,U){if(1&g){const m=t.EpF();t.TgZ(0,"div",2)(1,"v-loading-container",3),t.ALo(2,"async"),t.TgZ(3,"edit-template",4),t.NdJ("save",function(r){t.CHM(m);const h=t.oxw();return t.KtG(h.saveEmailTemplate(r))}),t.qZA()(),t.TgZ(4,"div",5)(5,"div",6),t._uU(6),t.qZA(),t.TgZ(7,"div",7)(8,"v-loading-container",3),t.ALo(9,"async"),t.TgZ(10,"template-table",8),t.NdJ("templateSelected",function(r){t.CHM(m);const h=t.oxw();return t.KtG(h.editTemplate(r))})("deleteTemplate",function(r){t.CHM(m);const h=t.oxw();return t.KtG(h.deleteTemplate(r))})("stateChanged",function(r){t.CHM(m);const h=t.oxw();return t.KtG(h.communicationsTemplateService.setTableState(r))}),t.ALo(11,"async"),t.ALo(12,"async"),t.qZA()()()()()}if(2&g){const m=U.translated,c=t.oxw();t.xp6(1),t.Q6J("working",t.lcZ(2,7,c.communicationsTemplateService.savingTemplate$)),t.xp6(2),t.Q6J("translations",m),t.xp6(3),t.hij(" ",m.existingTemplates," "),t.xp6(2),t.Q6J("working",t.lcZ(9,9,c.communicationsTemplateService.loadingTemplates$)),t.xp6(2),t.Q6J("translations",m)("templates",t.lcZ(11,11,c.templates$))("state",t.lcZ(12,13,c.tableState$))}}const vt=[{path:"",component:(()=>{class g{constructor(m,c,r,h){this.communicationsTemplateService=m,this._containerWrapperToastService=c,this._dynamicDialogService=r,this._translationService=h}ngOnInit(){this.templates$=this.communicationsTemplateService.templates$,this.tableState$=this.communicationsTemplateService.tableState$}saveEmailTemplate(m){var c=this;return(0,E.Z)(function*(){const r=yield c._translationService.getTranslatedObject().pipe((0,o.P)()).toPromise();try{yield c.communicationsTemplateService.save({...m}).pipe((0,o.P)()).toPromise(),c._containerWrapperToastService.addMessage({severity:"success",summary:r.success,detail:r.savedEmailTemplate}),c.editEmailTemplate.resetForm()}catch{c._containerWrapperToastService.addMessage({severity:"error",summary:r.error,detail:r.anErrorHasOccurred})}})()}editTemplate(m){this.editEmailTemplate.form.dirty?this._translationService.getTranslatedObject().pipe((0,o.P)()).subscribe(c=>{this._dynamicDialogService.open(x.z,{data:{header:c.discardTemplateChanges,message:c.areYouSureYouWantToDiscardYourChanges,acceptLabel:c.yes,rejectLabel:c.no,accept:()=>{this.editEmailTemplate.resetForm(),this.editEmailTemplate.template=this.communicationsTemplateService.getTemplate(m)}}})}):this.editEmailTemplate.template=this.communicationsTemplateService.getTemplate(m)}deleteTemplate(m){this._translationService.getTranslatedObject({key:"areYouSureYouWantToDeleteTemplate",params:{templateName:m}}).pipe((0,o.P)()).subscribe(c=>{this._dynamicDialogService.open(x.z,{data:{header:c.deleteTemplate,message:c.areYouSureYouWantToDeleteTemplate,acceptLabel:c.yes,rejectLabel:c.no,accept:()=>this.communicationsTemplateService.deleteTemplate(m).pipe((0,o.P)()).subscribe(()=>{this._containerWrapperToastService.addMessage({severity:"success",summary:c.success,detail:c.deletedTemplate})},()=>{this._containerWrapperToastService.addMessage({severity:"error",summary:c.error,detail:c.anErrorHasOccurred})})}})})}}return g.\u0275fac=function(m){return new(m||g)(t.Y36(st),t.Y36(nt.B),t.Y36(B.W),t.Y36(lt.D))},g.\u0275cmp=t.Xpm({type:g,selectors:[["communications-templates-container"]],viewQuery:function(m,c){if(1&m&&t.Gf(X,5),2&m){let r;t.iGM(r=t.CRH())&&(c.editEmailTemplate=r.first)}},decls:2,vars:2,consts:[[3,"headerKey","withToast"],["vContainerTemplate","content"],[2,"display","flex","flex-direction","column","gap","2rem"],[3,"working"],[3,"translations","save"],[1,"card"],[1,"card-header"],[1,"card-body"],[3,"translations","templates","state","templateSelected","deleteTemplate","stateChanged"]],template:function(m,c){1&m&&(t.TgZ(0,"v-container-wrapper",0),t.YNc(1,ht,13,15,"ng-template",1),t.qZA()),2&m&&t.Q6J("headerKey","templates")("withToast",!0)},dependencies:[rt.V,ct.d,X,gt,it.o,M.Ov],encapsulation:2,changeDetection:0}),g})(),canActivate:[P.v],data:{titleKey:(0,n.Bv)("templates"),requiredPermission:[T.J.MassCommunicationsTemplates,f.e.Read]}}];let _t=(()=>{class g{}return g.\u0275fac=function(m){return new(m||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[v.Bz.forChild(vt),v.Bz]}),g})();var St=e(32442),ft=e(71131),Ct=e(9764),Tt=e(2626),yt=e(28062);let xt=(()=>{class g{}return g.\u0275fac=function(m){return new(m||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[M.ez,_t,S.UX,St.S,ot.z,ft.W,H.Z_,K.j,Ct.Q,Tt.o,S.u5,Y.V,$.hJ,yt.G]}),g})()},97730:(Q,O,e)=>{e.d(O,{G:()=>n});var M=e(36895),v=e(87396),P=e(57245),T=e(5650),f=e(94650);let n=(()=>{class E{}return E.\u0275fac=function(t){return new(t||E)},E.\u0275mod=f.oAB({type:E}),E.\u0275inj=f.cJS({providers:[T.B],imports:[M.ez,P.u,v.Bz]}),E})()},20694:(Q,O,e)=>{e.d(O,{P:()=>$});var M=e(9706),v=e(87545),P=e(1908),T=e(70597),f=e(65722),n=e(94650),E=e(91712),o=e(12039),t=e(36895),J=e(24006),S=e(10805),b=e(46140);function x(y,u){if(1&y&&(n.ynx(0),n.TgZ(1,"div"),n._uU(2),n.qZA(),n.BQk()),2&y){const p=n.oxw(3);n.xp6(2),n.Oqu(p.translatedData.allProducts)}}function B(y,u){if(1&y&&(n.TgZ(0,"div"),n._uU(1),n.qZA()),2&y){const p=n.oxw(5);n.xp6(1),n.AsE(" ",p.control.value.length," ",null==p.translatedData?null:p.translatedData.itemsSelected," ")}}function I(y,u){if(1&y&&(n.ynx(0),n.YNc(1,B,2,2,"div",4),n.BQk()),2&y){n.oxw(2);const p=n.MAs(6),d=n.oxw(2);n.xp6(1),n.Q6J("ngIf",(null==d.control.value?null:d.control.value.length)>=d.displayLength)("ngIfElse",p)}}function D(y,u){if(1&y&&n.YNc(0,I,2,2,"ng-container",4),2&y){n.oxw();const p=n.MAs(4),d=n.oxw(2);n.Q6J("ngIf",void 0===d.maxNumberOfSelections)("ngIfElse",p)}}
1function L(y,u){if(1&y&&(n.ynx(0),n._uU(1),n.BQk()),2&y){const p=n.oxw(4);n.xp6(1),n.lnq(" ",p.control.value.length," ",null==p.translatedData?null:p.translatedData.itemsSelected," (",p.translatedData.maxLimitReached,") ")}}function F(y,u){if(1&y&&n.YNc(0,L,2,3,"ng-container",4),2&y){n.oxw();const p=n.MAs(6),d=n.oxw(2);n.Q6J("ngIf",(null==d.control.value?null:d.control.value.length)>=d.maxNumberOfSelections)("ngIfElse",p)}}function w(y,u){1&y&&(n.TgZ(0,"span"),n._uU(1,","),n.qZA())}function H(y,u){if(1&y&&(n.TgZ(0,"span"),n._uU(1),n.YNc(2,w,2,0,"span",0),n.qZA()),2&y){const p=u.$implicit,d=u.last;n.xp6(1),n.hij(" ",p.label," "),n.xp6(1),n.Q6J("ngIf",!d)}}function z(y,u){if(1&y&&n.YNc(0,H,3,2,"span",8),2&y){const p=n.oxw(3);n.Q6J("ngForOf",p.selectedItems)}}function K(y,u){if(1&y&&(n.YNc(0,x,3,1,"ng-container",4),n.YNc(1,D,1,2,"ng-template",null,5,n.W1O),n.YNc(3,F,1,2,"ng-template",null,6,n.W1O),n.YNc(5,z,1,1,"ng-template",null,7,n.W1O)),2&y){const p=n.MAs(2),d=n.oxw(2);n.Q6J("ngIf",null==d.control.value||0==(null==d.control.value?null:d.control.value.length))("ngIfElse",p)}}function W(y,u){if(1&y){const p=n.EpF();n.TgZ(0,"multi-select-clear-button",9),n.NdJ("clear",function(Z){return n.CHM(p),n.oxw(2).resetSelection(),n.KtG(Z.stopPropagation())}),n.qZA()}if(2&y){const p=n.oxw(2);n.Q6J("visible",null==p.control||null==p.control.value?null:p.control.value.length)}}function Y(y,u){if(1&y&&(n.ynx(0),n.TgZ(1,"label"),n._uU(2),n.qZA(),n.TgZ(3,"p-multiSelect",1),n.YNc(4,K,7,2,"ng-template",2),n.YNc(5,W,1,1,"ng-template",3),n.qZA(),n.BQk()),2&y){const p=n.oxw();n.xp6(2),n.Oqu(null==p.translatedData?null:p.translatedData.products),n.xp6(1),n.Q6J("formControl",p.control)("maxSelectedLabels",p.displayLength)("options",p.items)("showToggleAll",!1)("placeholder",p.translatedData.allProducts)}}let $=(()=>{class y extends M.D{constructor(p,d,Z){super(p),this._translationService=p,this._cd=d,this._productClient=Z,this.maxNumberOfSelections=void 0}ngOnInit(){this.translatedData$.pipe((0,v.w)(p=>this._productClient.getProductList().pipe(P.DN.mapToMultiSelectItem(d=>d.productName,d=>d.productId.toString(),!1,null,null,!1)))).pipe(T.i.takeUntilDisposed(this)).subscribe(p=>{this.items=p,this.updateSelectedItems(),this._cd.markForCheck()})}get filterDisplayLabel(){return this.translatedData.product}resetSelection(){this.control.setValue([]),this._cd.markForCheck()}ngOnChanges(p){p.control&&p.control.firstChange&&(this.updateSelectedItems(),this.control.valueChanges.pipe(T.i.takeUntilDisposed(this)).subscribe(d=>this.updateSelectedItems()),this.control.registerOnDisabledChange(d=>this._cd.markForCheck()),this.control.valueCleared$.asObservable().pipe(T.i.takeUntilDisposed(this)).subscribe(this.modifyMultiSelectInstance.bind(this)))}modifyMultiSelectInstance(){this.mSelect.hide(),this.mSelect.maxSelectionLimitReached=!1}}return y.\u0275fac=function(p){return new(p||y)(n.Y36(E.D),n.Y36(n.sBO),n.Y36(o.dhh))},y.\u0275cmp=n.Xpm({type:y,selectors:[["v-products"]],viewQuery:function(p,d){if(1&p&&n.Gf(f.NU,7),2&p){let Z;n.iGM(Z=n.CRH())&&(d.mSelect=Z.first)}},inputs:{maxNumberOfSelections:"maxNumberOfSelections"},features:[n.qOj,n.TTD],decls:1,vars:1,consts:[[4,"ngIf"],["styleClass","w-100",3,"formControl","maxSelectedLabels","options","showToggleAll","placeholder"],["pTemplate","selectedItems"],["pTemplate","footer"],[4,"ngIf","ngIfElse"],["hasElements",""],["hasLimitedSelection",""],["showItem",""],[4,"ngFor","ngForOf"],[3,"visible","clear"]],template:function(p,d){1&p&&n.YNc(0,Y,6,6,"ng-container",0),2&p&&n.Q6J("ngIf",d.translatedData)},dependencies:[t.sg,t.O5,J.JJ,J.oH,S.jx,f.NU,b.u],encapsulation:2,changeDetection:0}),y})()},34092:(Q,O,e)=>{e.d(O,{y:()=>y});var M=e(87545),v=e(1908),P=e(70597),T=e(9706),f=e(65722),n=e(94650),E=e(91712),o=e(12039),t=e(36895),J=e(24006),S=e(10805),b=e(46140);function x(u,p){if(1&u&&(n.TgZ(0,"label"),n._uU(1),n.qZA()),2&u){const d=n.oxw(2);n.xp6(1),n.Oqu(d.translatedData.roles)}}function B(u,p){if(1&u&&(n.ynx(0),n.TgZ(1,"div"),n._uU(2),n.qZA(),n.BQk()),2&u){const d=n.oxw(3);n.xp6(2),n.Oqu(d.translatedData.allRoles)}}function I(u,p){if(1&u&&(n.TgZ(0,"div"),n._uU(1),n.qZA()),2&u){const d=n.oxw(5);n.xp6(1),n.AsE(" ",d.control.value.length," ",null==d.translatedData?null:d.translatedData.itemsSelected," ")}}function D(u,p){if(1&u&&(n.ynx(0),n.YNc(1,I,2,2,"div",4),n.BQk()),2&u){n.oxw(2);const d=n.MAs(6),Z=n.oxw(2);n.xp6(1),n.Q6J("ngIf",(null==Z.control.value?null:Z.control.value.length)>=Z.displayLength)("ngIfElse",d)}}function L(u,p){if(1&u&&n.YNc(0,D,2,2,"ng-container",4),2&u){n.oxw();const d=n.MAs(4),Z=n.oxw(2);n.Q6J("ngIf",void 0===Z.maxNumberOfSelections)("ngIfElse",d)}}
1function F(u,p){if(1&u&&(n.ynx(0),n._uU(1),n.BQk()),2&u){const d=n.oxw(4);n.xp6(1),n.lnq(" ",d.control.value.length," ",null==d.translatedData?null:d.translatedData.itemsSelected," (",d.translatedData.maxLimitReached,") ")}}function w(u,p){if(1&u&&n.YNc(0,F,2,3,"ng-container",4),2&u){n.oxw();const d=n.MAs(6),Z=n.oxw(2);n.Q6J("ngIf",(null==Z.control.value?null:Z.control.value.length)>=Z.maxNumberOfSelections)("ngIfElse",d)}}function H(u,p){1&u&&(n.TgZ(0,"span"),n._uU(1,","),n.qZA())}function z(u,p){if(1&u&&(n.TgZ(0,"span"),n._uU(1),n.YNc(2,H,2,0,"span",0),n.qZA()),2&u){const d=p.$implicit,Z=p.last;n.xp6(1),n.hij(" ",d.label," "),n.xp6(1),n.Q6J("ngIf",!Z)}}function K(u,p){if(1&u&&n.YNc(0,z,3,2,"span",8),2&u){const d=n.oxw(3);n.Q6J("ngForOf",d.selectedItems)}}function W(u,p){if(1&u&&(n.YNc(0,B,3,1,"ng-container",4),n.YNc(1,L,1,2,"ng-template",null,5,n.W1O),n.YNc(3,w,1,2,"ng-template",null,6,n.W1O),n.YNc(5,K,1,1,"ng-template",null,7,n.W1O)),2&u){const d=n.MAs(2),Z=n.oxw(2);n.Q6J("ngIf",null==Z.control.value||0==(null==Z.control.value?null:Z.control.value.length))("ngIfElse",d)}}function Y(u,p){if(1&u){const d=n.EpF();n.TgZ(0,"multi-select-clear-button",9),n.NdJ("clear",function(j){return n.CHM(d),n.oxw(2).resetSelection(),n.KtG(j.stopPropagation())}),n.qZA()}if(2&u){const d=n.oxw(2);n.Q6J("visible",null==d.control||null==d.control.value?null:d.control.value.length)}}function $(u,p){if(1&u&&(n.ynx(0),n.YNc(1,x,2,1,"label",0),n.TgZ(2,"p-multiSelect",1),n.YNc(3,W,7,2,"ng-template",2),n.YNc(4,Y,1,1,"ng-template",3),n.qZA(),n.BQk()),2&u){const d=n.oxw();n.xp6(1),n.Q6J("ngIf",!d.hideLabel),n.xp6(1),n.Q6J("formControl",d.control)("maxSelectedLabels",d.displayLength)("options",d.items)("selectionLimit",d.maxNumberOfSelections)("showToggleAll",!1)("placeholder",d.translatedData.allRoles)}}let y=(()=>{class u extends T.D{constructor(d,Z,j){super(d),this._translationsService=d,this._rolesClient=Z,this._cd=j,this.maxNumberOfSelections=void 0}ngOnInit(){this.translatedData$.pipe((0,M.w)(d=>this._rolesClient.getRolesFromRoleTypes().pipe(v.DN.mapToMultiSelectItem(Z=>Z.rolesName,Z=>Z.rolesId.toString(),!1,null,null,!1)))).pipe(P.i.takeUntilDisposed(this)).subscribe(d=>{this.items=d,this.updateSelectedItems(),this._cd.markForCheck()})}get filterDisplayLabel(){return this.translatedData.roles}resetSelection(){this.control.setValue([]),this._cd.markForCheck()}ngOnChanges(d){d.control&&d.control.firstChange&&(this.updateSelectedItems(),this.control.valueChanges.pipe(P.i.takeUntilDisposed(this)).subscribe(Z=>this.updateSelectedItems()),this.control.registerOnDisabledChange(Z=>this._cd.markForCheck()),this.control.valueCleared$.asObservable().pipe(P.i.takeUntilDisposed(this)).subscribe(this.modifyMultiSelectInstance.bind(this)))}modifyMultiSelectInstance(){this.mSelect.hide(),this.mSelect.maxSelectionLimitReached=!1}}return u.\u0275fac=function(d){return new(d||u)(n.Y36(E.D),n.Y36(o.KUk),n.Y36(n.sBO))},u.\u0275cmp=n.Xpm({type:u,selectors:[["v-roles"]],viewQuery:function(d,Z){if(1&d&&n.Gf(f.NU,7),2&d){let j;n.iGM(j=n.CRH())&&(Z.mSelect=j.first)}},inputs:{maxNumberOfSelections:"maxNumberOfSelections"},features:[n.qOj,n.TTD],decls:1,vars:1,consts:[[4,"ngIf"],["styleClass","w-100",3,"formControl","maxSelectedLabels","options","selectionLimit","showToggleAll","placeholder"],["pTemplate","selectedItems"],["pTemplate","footer"],[4,"ngIf","ngIfElse"],["hasElements",""],["hasLimitedSelection",""],["showItem",""],[4,"ngFor","ngForOf"],[3,"visible","clear"]],template:function(d,Z){1&d&&n.YNc(0,$,5,7,"ng-container",0),2&d&&n.Q6J("ngIf",Z.translatedData)},dependencies:[t.sg,t.O5,J.JJ,J.oH,S.jx,f.NU,b.u],encapsulation:2,changeDetection:0}),u})()},55811:(Q,O,e)=>{e.d(O,{z:()=>P});var M=e(36895),v=e(94650);let P=(()=>{class T{}return T.\u0275fac=function(n){return new(n||T)},T.\u0275mod=v.oAB({type:T}),T.\u0275inj=v.cJS({imports:[M.ez]}),T})()},39892:(Q,O,e)=>{e.d(O,{l:()=>P});var M=e(36895),v=e(94650);let P=(()=>{class T{}return T.\u0275fac=function(n){return new(n||T)},T.\u0275mod=v.oAB({type:T}),T.\u0275inj=v.cJS({imports:[M.ez]}),T})()},85131:(Q,O,e)=>{e.d(O,{x:()=>P});var M=e(36895),v=e(94650);let P=(()=>{class T{}return T.\u0275fac=function(n){return new(n||T)},T.\u0275mod=v.oAB({type:T}),T.\u0275inj=v.cJS({imports:[M.ez]}),T})()},30787:(Q,O,e)=>{e.d(O,{b:()=>P});var M=e(36895),v=e(94650);let P=(()=>{class T{}return T.\u0275fac=function(n){return new(n||T)},T.\u0275mod=v.oAB({type:T}),T.\u0275inj=v.cJS({imports:[M.ez]}),T})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.