1"use strict";(self.webpackChunkvish_webapp=self.webpackChunkvish_webapp||[]).push([[475],{10475:(mn,le,l)=>{l.r(le),l.d(le,{CustomersModule:()=>un});var xe=l(57857),Ve=l(47145),we=l(76910),ce=l(38132),_=l(59640),W=l(7673),de=l(19369),C=l(96354),y=l(31397),k=l(62428);const j=(0,_.UX)("editCustomer"),ze=(0,_.Mz)(j,t=>t.record),Ye=(0,_.Mz)(j,t=>t.loading),Be=(0,_.Mz)(j,t=>t.saving),He=(0,_.Mz)(j,t=>t.error);var R=function(t){return t.NAVIGATE="[Edit Customer] Navigate",t.LOAD_DATA="[Edit Customer] Load Data",t.LOAD_DATA_SUCCESS="[Edit Customer] Load Data Success",t.LOAD_DATA_FAIL="[Edit Customer] Load Data Fail",t.ADD="[Edit Customer] Add",t.EDIT="[Edit Customer] Edit",t.SUCCESS="[Edit Customer] Success",t.FAIL="[Edit Customer] Fail",t.CLOSE="[Edit Customer] Close",t}(R||{});class ue{constructor(s){this.payload=s,this.type=R.NAVIGATE}}class Je{constructor(s){this.payload=s,this.type=R.LOAD_DATA}}class We{constructor(s){this.payload=s,this.type=R.LOAD_DATA_SUCCESS}}class Ke{constructor(s){this.payload=s,this.type=R.LOAD_DATA_FAIL}}class Ze{constructor(s){this.payload=s,this.type=R.ADD}}class Qe{constructor(s){this.payload=s,this.type=R.EDIT}}class me{constructor(s){this.payload=s,this.type=R.SUCCESS}}class Ce{constructor(s){this.payload=s,this.type=R.FAIL}}class ge{constructor(){this.type=R.CLOSE}}var e=l(73664),c=l(2615),et=l(43694),b=l(72200),K=l(43660),pe=l(48782),tt=l(38416),A=l(89417),Z=l(36522),Q=l(93406),ot=l(33746),q=l(5404),fe=l(76945);function nt(t,s){if(1&t&&(e.j41(0,"div")(1,"alert-component",21)(2,"h4"),e.pXf(3,6),e.k0s(),e.j41(4,"p"),e.EFF(5),e.k0s()()()),2&t){const o=e.XpG();e.R7$(5),e.JRh(o.error)}}function rt(t,s){1&t&&(e.j41(0,"mat-error"),e.pXf(1,7),e.k0s())}function it(t,s){1&t&&(e.j41(0,"mat-error"),e.pXf(1,8),e.k0s())}function st(t,s){1&t&&(e.j41(0,"mat-error"),e.pXf(1,9),e.k0s())}function _t(t,s){1&t&&(e.j41(0,"mat-error"),e.pXf(1,10),e.k0s())}let at=(()=>{class t{constructor(o){this._fb=o,this.save=new e.bkB(!0),this.close=new e.bkB(!0)}ngOnInit(){this._createForm()}saveCustomer(o,r){if(this.form.valid){const n={...r,...o};this.save.emit(n)}}_createForm(){const o=this.record;this.form=this._fb.group({firstName:[o.firstName?.trim(),[A.k0.required,Z._d]],lastName:[o.lastName?.trim(),[A.k0.required,Z._d]],email:[o.email,[A.k0.required,A.k0.email]],homePhone:[o.homePhone],mobilePhone:[o.mobilePhone]})}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(A.ze))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["edit-customer-component"]],inputs:{record:"record",error:"error"},outputs:{close:"close",save:"save"},standalone:!1,decls:32,vars:9,consts:()=>{let o,r,n,i,d,a,u,f,T,E,N;return o=$localize`:âc83b838d845690bcb897f775f53b5316535306dcâ6028371114637047813:First Name`,r=$localize`:â166b2cc65003221ff5f3ec05d5baca41e6821396â4407559560004943843:Last Name`,n=$localize`:â244aae9346da82b0922506c2d2581373a15641ccâ4768749765465246664:Email`,i=$localize`:â75880feeca47bbb8b174f4f2f441cc75201c2499â1975911575458860904:Home Phone`,d=$localize`:â4a2f89fdc4cb456f4ff1cd59317354380d7a9096â7384398735090623067:Mobile Phone`,a=$localize`:â52c9a103b812f258bcddc3d90a6e3f46871d25feâ3768927257183755959:Save`,u=$localize`:â0a513244b322789dc91766b9e51a3b4d86f4987câ569078577347083357:An Error Has Occured`,f=$localize`:âe5f24fc7a2bf50bd61d109dd9cad3fbff6ec7addâ7045123878111147511:Required`,T=$localize`:âe5f24fc7a2bf50bd61d109dd9cad3fbff6ec7addâ7045123878111147511:Required`,E=$localize`:âe5f24fc7a2bf50bd61d109dd9cad3fbff6ec7addâ7045123878111147511:Required`,N=$localize`:âe527ace700a5dfcd97e170b854de7b539afacc0câ8876822653942344131:Please enter a valid email address`,[o,r,n,i,d,a,u,f,T,E,N,[4,"ngIf"],["novalidate","",3,"submit","formGroup"],[1,"full-width"],["matInput","","formControlName","firstName"],["matInput","","formControlName","lastName"],["matInput","","formControlName","email"],["matInput","","formControlName","homePhone"],["matInput","","formControlName","mobilePhone"],[1,"controls",2,"position","relative","margin","0 10%"],["type","button",1,"button","primary",2,"float","right","width","100%","padding-top","12px","padding-bottom","12px",3,"click","disabled"],["type","danger"]]},template:function(r,n){1&r&&(e.j41(0,"div"),e.DNE(1,nt,6,1,"div",11),e.nI1(2,"notEmpty"),e.j41(3,"form",12),e.bIt("submit",function(){return n.saveCustomer(n.form.value,n.record)}),e.j41(4,"mat-form-field",13)(5,"mat-label"),e.pXf(6,0),e.k0s(),e.nrm(7,"input",14),e.DNE(8,rt,2,0,"mat-error",11),e.k0s(),e.j41(9,"mat-form-field",13)(10,"mat-label"),e.pXf(11,1),e.k0s(),e.nrm(12,"input",15),e.DNE(13,it,2,0,"mat-error",11),e.k0s(),e.j41(14,"mat-form-field",13)(15,"mat-label"),e.pXf(16,2),e.k0s(),e.nrm(17,"input",16),e.DNE(18,st,2,0,"mat-error",11)(19,_t,2,0,"mat-error",11),e.k0s(),e.j41(20,"mat-form-field",13)(21,"mat-label"),e.pXf(22,3),e.k0s(),e.nrm(23,"input",17),e.k0s(),e.j41(24,"mat-form-field",13)(25,"mat-label"),e.pXf(26,4),e.k0s(),e.nrm(27,"input",18),e.k0s()(),e.j41(28,"div",19)(29,"button",20),e.bIt("click",function(){return n.saveCustomer(n.form.value,n.record)}),e.j41(30,"span"),e.pXf(31,5),e.k0s()()()()),2&r&&(e.R7$(),e.Y8G("ngIf",e.bMT(2,7,n.error)),e.R7$(2),e.Y8G("formGroup",n.form),e.R7$(5),e.Y8G("ngIf",n.form.get("firstName").hasError("required")),e.R7$(5),e.Y8G("ngIf",n.form.get("lastName").hasError("required")),e.R7$(5),e.Y8G("ngIf",n.form.get("email").hasError("required")),e.R7$(),e.Y8G("ngIf",n.form.get("email").hasError("email")),e.R7$(10),e.Y8G("disabled",n.form.invali
1d))},dependencies:[b.bT,Q.C,A.qT,A.me,A.BC,A.cb,A.j4,A.JD,ot.fg,q.j,q.M,q.b,fe.J],encapsulation:2,changeDetection:0})}return t})();var ee=l(76874),Te=l(36784);function lt(t,s){1&t&&(e.j41(0,"div",6),e.pXf(1,1),e.k0s())}function ct(t,s){1&t&&(e.j41(0,"div",6),e.pXf(1,2),e.k0s())}function dt(t,s){if(1&t){const o=e.RV6();e.j41(0,"edit-customer-component",7),e.nI1(1,"async"),e.nI1(2,"async"),e.bIt("save",function(n){c.eBV(o);const i=e.XpG();return c.Njj(i.save(n))})("close",function(){c.eBV(o);const n=e.XpG();return c.Njj(n.close())}),e.k0s()}if(2&t){const o=e.XpG();e.Y8G("record",e.bMT(1,2,o.record$))("error",e.bMT(2,4,o.error$))}}function ut(t,s){1&t&&e.nrm(0,"large-loading-indicator")}let Ee=(()=>{class t{constructor(o,r){this._store=o,this.record$=r.params.pipe((0,C.T)(n=>n.id),(0,y.Z)(n=>(0,k.O9)(n)?o.pipe((0,_.Lt)(ze)):(0,W.of)(new de.nD))),this.customerId$=r.paramMap.pipe((0,C.T)(n=>n.get("id"))),this.customerIdSubscription=this.customerId$.pipe((0,C.T)(n=>new Je(n))).subscribe(n=>this._store.dispatch(n)),this.loading$=o.pipe((0,_.Lt)(Ye)),this.error$=o.pipe((0,_.Lt)(He)),this.saving$=o.pipe((0,_.Lt)(Be))}save(o){this._store.dispatch((t=>(0,k.O9)(t.customer._id)?new Qe(t):new Ze(t))({customer:o}))}close(){this._store.dispatch(new ge)}ngOnDestory(){this.customerIdSubscription.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(_.il),e.rXU(et.nX))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["edit-customer-container"]],standalone:!1,decls:12,vars:17,consts:()=>{let o,r;return o=$localize`:â9d2a5d2f84db1f50d1fd0870791943a400a16e24â291124791462216680: Create Client `,r=$localize`:â24da810739a51e60e281eec984fedb3fcd6b900aâ6358879237578673775: Edit Client `,[["loadingElement",""],o,r,[3,"close","progressIndicator"],["panel-header","",4,"ngIf"],["panel-body","",3,"record","error","save","close",4,"ngIf","ngIfElse"],["panel-header",""],["panel-body","",3,"save","close","record","error"]]},template:function(r,n){if(1&r){const i=e.RV6();e.j41(0,"slideout-panel",3),e.nI1(1,"async"),e.bIt("close",function(){return c.eBV(i),c.Njj(n.close())}),e.DNE(2,lt,2,0,"div",4),e.nI1(3,"async"),e.nI1(4,"isNil"),e.DNE(5,ct,2,0,"div",4),e.nI1(6,"async"),e.nI1(7,"isDefined"),e.DNE(8,dt,3,6,"edit-customer-component",5),e.nI1(9,"async"),e.DNE(10,ut,1,0,"ng-template",null,0,e.C5r),e.k0s()}if(2&r){const i=e.sdS(11);e.Y8G("progressIndicator",e.bMT(1,5,n.saving$)?"Saving...":void 0),e.R7$(2),e.Y8G("ngIf",e.bMT(4,9,e.bMT(3,7,n.customerId$))),e.R7$(3),e.Y8G("ngIf",e.bMT(7,13,e.bMT(6,11,n.customerId$))),e.R7$(3),e.Y8G("ngIf",!1===e.bMT(9,15,n.loading$))("ngIfElse",i)}},dependencies:[b.bT,K.P,pe.c,tt.E,at,b.Jj,ee.g,Te.W],encapsulation:2,changeDetection:0})}return t})();var Se=l(18633),te=l(84572),mt=l(64779),Ct=l(23294),U=l(53993),X=l(60143),gt=l(28249),Me=l(41519),Oe=l(68488),pt=l(85550),g=l(56634),I=l(72355);const M=(0,_.EQ)({source:"Merge Customers",events:{autoMerge:(0,_.w5)(),autoMergeSuccess:(0,_.xk)(),autoMergeFail:(0,_.xk)(),navigate:(0,_.w5)(),merge:(0,_.w5)(),success:(0,_.xk)(),fail:(0,_.xk)(),close:(0,_.w5)(),done:(0,_.w5)(),updatePrimary:(0,_.xk)(),initiate:(0,_.xk)()}}),v=(0,_.UX)("mergeCustomers"),ft=(0,_.Mz)(v,t=>t.autoMerging),Re=(0,_.Mz)(v,t=>t.primary),Tt=(0,_.Mz)(v,t=>t.merging),Et=(0,_.Mz)(v,t=>t.adminValidOptions),St=(0,_.Mz)(v,t=>t.adminInvalidOptions),Mt=(0,_.Mz)(v,t=>t.userValidOptions),Ot=(0,_.Mz)(v,t=>t.userInvalidOptions),Rt=(0,_.Mz)(v,t=>t.result),Nt=(0,_.Mz)(v,t=>t.error),Pt=(0,_.Mz)(v,t=>t.adminWarning);var Ne=l(76108),It=l(23714),x=l(92500),$t=l(83203),bt=l(74062),At=l(52571),ht=l(94915),Pe=l(8053),vt=l(38421),Ie=l(25609),Ft=l(67984),V=l(91262),oe=l(90810),yt=l(21406),Gt=l(29314),Ut=l(52998),Xt=l(34198),Lt=l(75747),ne=l(59115),Dt=l(50137),re=l(20060);function kt(t,s){if(1&t){const o=e.RV6();e.j41(0,"text-filter",26),e.nI1(1,"async"),e.bIt("filter",function(n){c.eBV(o);const i=e.XpG();return c.Njj(i.updateTableFilter({firstName:n}))}),e.k0s()}if(2&t){let o;const r=s.column,n=e.XpG();e.Y8G("title",r.title)("value",null==(o=e.bMT(1,2,n.tableFilter$))?null:o.firstName)}}function jt(t,s){if(1&t){const o=e.RV6();e.j41(0,"text-filter",26),e.nI1(1,"async"),e.bIt("filter",function(n){c.eBV(o);const i=e.XpG();return c.Njj(i.updateTableFilter({email:n}))}),e.k0s()}if(2&t){let o;const r=s.column,n=e.XpG();e.Y8G("title",r.title)("value",null==(o=e.bMT(1,2,n.tableFilter$))?null:o.email)}}function xt(t,s){1&t&&e.nrm(0,"column",27)}function Vt(t,s){if(1&t){const o=e.RV6();e.j41(0,"selection-cell",35),e.bIt("change",function(){c.eBV(o);const n=e.XpG().$implicit,i=e.XpG();return c.Njj(i.toggleSelected(n))}),e.k0s()}if(2&t){const o=e.XpG().$implicit;e.Y8G("checked",o.selected)}}function wt(t,s){if(1&t&&e.nrm(0,"colored-icon-cell",36),2&t){const o=e.XpG().$implicit;e.Y8G("title",o.firstName.trim().charAt(0)+o.lastName.trim().charAt(0))}}function zt(t,s){if(1&t){const o=e.RV6();e.j41(0,"text-cell")(1,"text-cell-text",37),e.bIt("action",function(){c.eBV(o);const n=e.XpG().$implicit,i=e.XpG();return c.Njj(i.editCustomer(n))}),e.k0s()()}if(2&t){const o=e.XpG().$implicit;e.R7$(),e.Y8G("value",o.firstName+" "+o.lastName)}}function Yt(t,s){if(1&t&&(e.j41(0,"text-cell"),e.nrm(1,"text-cell-text",38),e.k0s()),2&t){const o=e.XpG().$implicit;e.R7$(),e.Y8G("value",o.email)}}function Bt(t,s){if(1&t&&(e.j41(0,"text-cell"),e.nrm(1,"text-cell-text",38),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(),e.Y8G("value",o.integrated?"Yes":"No")}}function Ht(t,s){1&t&&(e.j41(0,"cell",39),e.DNE(1,Bt,2,1,"ng-template"),e.k0s())}function Jt(t,s){if(1&t){const o=e.RV6();e.j41(0,"menu-cell-item",42),e.bIt("action",function(){c.eBV(o);const n=e.XpG(2).$implicit,i=e.XpG();return c.Njj(i.removeCustomer(n))}),e.k0s()}}function Wt(t,s){if(1&t){const o=e.RV6();e.j41(0,"menu-cell")(1,"menu-cell-item",40),e.bIt("action",function(){c.eBV(o);const n=e.XpG().$implicit,i=e.XpG();return c.Njj(i.editCustomer(n))}),e.k0s(),e.DNE(2,Jt,1,0,"menu-cell-item",41),e.nI1(3,"async"),e.k0s()}if(2&t){const o=e.XpG().$implicit,r=e.XpG();e.R7$(2),e.Y8G("ngIf",r.showRemoveCustomer(e.bMT(3,1,r.user$),o))}}function Kt(t,s){if(1&t&&(e.j41(0,"row",28)(1,"cell",29),e.DNE(2,Vt,1,1,"ng-template"),e.k0s(),e.j41(3,"cell",30),e.DNE(4,wt,1,1,"ng-template"),e.k0s(),e.j41(5,"cell",31),e.DNE(6,zt,2,1,"ng-template"),e.k0s(),e.j41(7,"cell",32),e.DNE(8,Yt,2,1,"ng-template"),e.k0s(),e.DNE(9,Ht,2,0,"cell",33),e.nI1(10,"async"),e.j41(11,"cell",34),e.DNE(12,Wt,4,3,"ng-template"),e.k0s()()),2&t){const o=s.$implicit,r=e.XpG();e.Y8G("id",o._id),e.R7$(9),e.Y8G("ngIf",e.bMT(10,2,r.posIntegrationActive$))}}let Zt=(()=>{class t{constructor(o){this._store=o,o.dispatch(new $t.bV),this.limit=50,this.customers$=this._store.pipe((0,_.Lt)(I.od));const r=o.select(I.D4).pipe((0,C.T)(u=>(0,Se.Fs)(u,X.Tj(f=>f.count),X.WL(()=>0))));this.loading$=(0,te.z)([o.select(I.NE),o.select(ft)]).pipe((0,C.T)(([u,f])=>u||f)),this.deleting$=o.select(I.XU),this.selectedRecords$=this._store.pipe((0,_.Lt)(I.ef)),this.mergeAvailable$=this.selectedRecords$.pipe((0,C.T)(u=>(0,It.A)(u)>1)),this.posIntegrationActive$=this._store.pipe((0,_.Lt)(pt.Z0)),this.customers$=(0,te.z)([this.selectedRecords$,this._store.pipe((0,_.Lt)(I.od))]).pipe((0,C.T)(([u,f])=>f.map(T=>({...T,selected:u.some(E=>
1E._id===T._id)})))),this.filter$=this._store.pipe((0,_.Lt)(I.vD));const n=this._store.pipe((0,_.Lt)(x.OP)).pipe((0,C.T)(u=>u.get("page")),(0,C.T)(u=>(0,gt.A)((0,Me.A)(u))?Number(u):1)),i=this._store.pipe((0,_.Lt)(x.OP),(0,C.T)(u=>u.get("filter"))),d=this._store.pipe((0,_.Lt)(x.OP),(0,C.T)(u=>null!=u.get("tableFilter")?JSON.parse(u.get("tableFilter")):void 0)),a=this._store.pipe((0,_.Lt)(x.OP),(0,C.T)(u=>null!=u.get("sort")?JSON.parse(u.get("sort")):void 0));this.urlParamsSubscription=(0,mt.y)(n,i,d,a).pipe((0,Ct.F)((u,f)=>JSON.stringify(u)===JSON.stringify(f)),(0,C.T)(([u,f,T,E])=>new g.eQ({page:u,limit:this.limit,filter:f,tableFilter:T,sort:E}))).subscribe(u=>this._store.dispatch(u)),this.paging$=(0,te.z)([r,n]).pipe((0,C.T)(([u,f])=>({count:u,currentPage:f,limit:this.limit,changePage:this.navigateToPage.bind(this)}))),this.selections$=this.selectedRecords$.pipe((0,C.T)(u=>({selection:{count:u.length,clearSelections:this.clearSelected.bind(this)}}))),this.sort$=this._store.pipe((0,_.Lt)(I.FD)),this.tableFilter$=this._store.pipe((0,_.Lt)(I.PC)),this.tableFilter$.subscribe(u=>{this.tableFilter=u}),this.user$=this._store.select(Oe.wz)}editCustomer(o){this._store.dispatch(new ue({customerId:o._id}))}newCustomer(){this._store.dispatch(new ue)}showRemoveCustomer(o,r){return(0,Ne.qc)(o)||!1===r.integrated}removeCustomer(o){this._store.dispatch(new g.n$({id:o._id}))}importCustomers(){this._store.dispatch(new g.Un)}navigateToPage(o){this._store.dispatch(new g.yS({page:o}))}clearSelected(){this._store.dispatch(new g.vI)}toggleSelected(o){this._store.dispatch(new g.UD(o))}navigateToMergeCustomersPanel(){this._store.dispatch(M.navigate())}mergeSelectedCustomers(){this._store.dispatch(M.merge())}updateFilter(o){this._store.dispatch(new g.vj({filter:o}))}updateTableFilter(o){const r={...this.tableFilter??{}};Object.keys(o).forEach(n=>{r[n]=null==o[n]?void 0:o[n]}),this._store.dispatch(new g.K3(r))}updateSort(o){this._store.dispatch(new g.WO(o))}ngOnDestroy(){this.urlParamsSubscription.unsubscribe()}getProgressText(){return this.loading$.pipe((0,U.E)(this.deleting$),(0,C.T)(([o,r])=>o?$localize`Loading...`:r?$localize`Deleting...`:void 0))}autoMergeCustomers(){this._store.dispatch(M.autoMerge())}customerRowTrackBy(o,r){return r._id}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(_.il))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["customers-container"]],standalone:!1,decls:47,vars:38,consts:()=>{let o,r,n,i,d,a,u,f,T,E,N,O,G,$;return o=$localize`:â7ffe39df9d88c972792bd8688b215392deb8313dâ5910845130937645353:Clients`,r=$localize`:â326530ec0111f0758aaf6d59514fe4ab64f04869â5923356425721681839:Search Clients...`,n=$localize`:â52d3dc1a92749eb02e837906487328516607a35câ874772611248436135:Merge Selected Clients`,i=$localize`:âcff1428d10d59d14e45edec3c735a27b5482db59â8953033926734869941:Name`,d=$localize`:â244aae9346da82b0922506c2d2581373a15641ccâ4768749765465246664:Email`,a=$localize`:â282c1e7d6befdae10fca066350b1154dd51f7ea9â4336467119528049143:Integrated`,u=$localize`:âa9e6297d7474892336dd45142f3ba57e2780c5b6â1120507555218135210:No Clients here`,f=$localize`:âdb4f7e559746d1b1b744eb5d1340a5ec278e3b0eâ1741593461264448821: New Client `,T=$localize`:â96cc00f774af4bbe735141ab335afabadd3ff7d1â2343996803531830280: Import CSV `,E=$localize`:â5f53c147cab4796815da9bcf08e0dea28fc1ef63â8745239291916550984: Auto Merge `,N=$localize`:â0eb28baca3c6dc9a864e02f43c699e8190955395â4974463413923608736: Adjust your search to find Clients, or, add a Client if none exist `,O=$localize`:â28f86ffd419b869711aa13f5e5ff54be6d70731câ7585826646011739428:Edit`,G=$localize`:â28f86ffd419b869711aa13f5e5ff54be6d70731câ7585826646011739428:Edit`,$=$localize`:â826b25211922a1b46436589233cb6f1a163d89b7â7022070615528435141:Delete`,[["moreOptionsMenu","matMenu"],f,T,E,N,["pageTitle",o,1,"full-height-table",3,"progressText"],["page-header",""],[1,"search-input-control"],["placeholder",r,3,"filter","searchFilter","minLength","maxTerms"],["matTooltip",n,1,"button","outline","secondary",3,"click","disabled"],["icon","code-merge"],[1,"button","outline",3,"click"],["mat-menu-item","",3,"click"],[1,"button","secondary","transparent",3,"matMenuTriggerFor"],["icon","ellipsis-v"],["page-body",""],["card-body","",3,"paging","selections","filter"],["id","selection"],["id","icon"],["id","name","title",i],[3,"change","direction"],["id","email","title",d],["id","integrated","title",a,4,"ngIf"],["id","menu"],[3,"id",4,"ngFor","ngForOf","ngForTrackBy"],["title",u,"icon","user-circle","data-table-empty-state",""],[3,"filter","title","value"],["id","integrated","title",a],[3,"id"],["columnId","selection"],["columnId","icon"],["columnId","name"],["columnId","email"],["columnId","integrated",4,"ngIf"],["columnId","menu"],[3,"change","checked"],[3,"title"],["title",O,"className","primary",3,"action","value"],[3,"value"],["columnId","integrated"],["title",G,3,"action"],["title",$,3,"action",4,"ngIf"],["title",$,3,"action"]]},template:function(r,n){if(1&r){const i=e.RV6();
1e.j41(0,"page",5),e.nI1(1,"async"),e.j41(2,"header-controls",6)(3,"div",7)(4,"search-input",8),e.nI1(5,"async"),e.bIt("filter",function(a){return c.eBV(i),c.Njj(n.updateFilter(a))}),e.k0s()(),e.j41(6,"button",9),e.nI1(7,"async"),e.nI1(8,"isNil"),e.nI1(9,"async"),e.bIt("click",function(){return c.eBV(i),c.Njj(n.navigateToMergeCustomersPanel())}),e.nrm(10,"fa-icon",10),e.k0s(),e.j41(11,"button",11),e.bIt("click",function(){return c.eBV(i),c.Njj(n.newCustomer())}),e.pXf(12,1),e.k0s(),e.j41(13,"mat-menu",null,0)(15,"button",12),e.bIt("click",function(){return c.eBV(i),c.Njj(n.importCustomers())}),e.pXf(16,2),e.k0s(),e.j41(17,"button",12),e.bIt("click",function(){return c.eBV(i),c.Njj(n.autoMergeCustomers())}),e.pXf(18,3),e.k0s()(),e.j41(19,"button",13),e.nrm(20,"fa-icon",14),e.k0s()(),e.j41(21,"card",15)(22,"data-table",16),e.nI1(23,"async"),e.nI1(24,"async"),e.nI1(25,"async"),e.j41(26,"columns"),e.nrm(27,"column",17)(28,"column",18),e.j41(29,"column",19)(30,"column-sort",20),e.nI1(31,"async"),e.bIt("change",function(a){return c.eBV(i),c.Njj(n.updateSort({firstName:a.direction,lastName:a.direction}))}),e.k0s(),e.j41(32,"column-filter"),e.DNE(33,kt,2,4,"ng-template"),e.k0s()(),e.j41(34,"column",21)(35,"column-sort",20),e.nI1(36,"async"),e.bIt("change",function(a){return c.eBV(i),c.Njj(n.updateSort({email:a.direction}))}),e.k0s(),e.j41(37,"column-filter"),e.DNE(38,jt,2,4,"ng-template"),e.k0s()(),e.DNE(39,xt,1,0,"column",22),e.nI1(40,"async"),e.nrm(41,"column",23),e.k0s(),e.j41(42,"body"),e.DNE(43,Kt,13,4,"row",24),e.nI1(44,"async"),e.k0s(),e.j41(45,"empty-state-message",25),e.pXf(46,4),e.k0s()()()()}if(2&r){let i,d;const a=e.sdS(14);e.Y8G("progressText",e.bMT(1,14,n.getProgressText())),e.R7$(4),e.Y8G("searchFilter",e.bMT(5,16,n.filter$))("minLength",3)("maxTerms",3),e.R7$(2),e.Y8G("disabled",e.bMT(8,20,e.bMT(7,18,n.mergeAvailable$))||!1===e.bMT(9,22,n.mergeAvailable$)),e.R7$(13),e.Y8G("matMenuTriggerFor",a),e.R7$(3),e.Y8G("paging",e.bMT(23,24,n.paging$))("selections",e.bMT(24,26,n.selections$))("filter",e.bMT(25,28,n.tableFilter$)),e.R7$(8),e.Y8G("direction",null==(i=e.bMT(31,30,n.sort$))?null:i.firstName),e.R7$(5),e.Y8G("direction",null==(d=e.bMT(36,32,n.sort$))?null:d.email),e.R7$(4),e.Y8G("ngIf",e.bMT(40,34,n.posIntegrationActive$)),e.R7$(4),e.Y8G("ngForOf",e.bMT(44,36,n.customers$))("ngForTrackBy",n.customerRowTrackBy)}},dependencies:[bt.i,At.u,ht.X,Pe.d,Pe.w,vt.u,Ie.t,Ie.l,Ft.J,V.ee,V._T,V.WE,V.rF,oe.sA,oe.YP,oe.Qw,yt.H,b.Sq,b.bT,Gt.x,Ut.i,Xt.F,Lt.e,ne.kk,ne.fb,ne.Cp,Dt.Y,re.aY,b.Jj,ee.g],styles:["card[_ngcontent-%COMP%]{padding:20px!important}"],changeDetection:0})}return t})();const w=(0,_.UX)("importCustomers"),$e=(0,_.Mz)(w,t=>t.records),Qt=(0,_.Mz)($e,t=>(0,Me.A)(t)?[]:t.slice(0,200)),qt=(0,_.Mz)(w,t=>t.loading),eo=(0,_.Mz)(w,t=>t.numRecordsImported),to=(0,_.Mz)(w,t=>t.numRecordsParsed);var oo=l(67575);function no(t,s){if(1&t&&(e.j41(0,"div")(1,"alert-component",12),e.PLo(2,1),e.nrm(3,"em"),e.YFu(),e.k0s()()),2&t){const o=e.XpG();e.R7$(3),e.uP7(o.numRecordsImported),e.nnv(2)}}function ro(t,s){if(1&t){const o=e.RV6();e.j41(0,"div")(1,"input",14),e.bIt("change",function(n){c.eBV(o);const i=e.XpG(2);return c.Njj(i.onFileChange(n))}),e.k0s(),e.j41(2,"label",15),e.nrm(3,"fa-icon",16),e.k0s()()}}function io(t,s){if(1&t&&(e.j41(0,"div"),e.DNE(1,ro,4,0,"div",13),e.k0s()),2&t){const o=e.XpG(),r=e.sdS(7);e.R7$(),e.Y8G("ngIf",!o.loading)("ngIfElse",r)}}function so(t,s){if(1&t&&(e.j41(0,"tr")(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s()()),2&t){const o=s.$implicit;e.R7$(2),e.JRh(o.firstName),e.R7$(2),e.JRh(o.lastName),e.R7$(2),e.JRh(o.email)}}function _o(t,s){if(1&t){const o=e.RV6();e.j41(0,"div")(1,"div",18)(2,"button",19),e.bIt("click",function(){c.eBV(o);const n=e.XpG(3);return c.Njj(n.uploadCustomers.emit())}),e.pXf(3,3),e.k0s()(),e.j41(4,"h6"),e.pXf(5,4),e.k0s(),e.j41(6,"table")(7,"tr")(8,"th"),e.pXf(9,5),e.k0s(),e.j41(10,"th"),e.pXf(11,6),e.k0s(),e.j41(12,"th"),e.pXf(13,7),e.k0s()(),e.DNE(14,so,7,3,"tr",20),e.k0s()()}if(2&t){const o=e.XpG(3);e.R7$(14),e.Y8G("ngForOf",o.records)}}function ao(t,s){if(1&t&&(e.qex(0),e.j41(1,"alert-component",17),e.PLo(2,2),e.nrm(3,"em"),e.YFu(),e.k0s(),e.DNE(4,_o,15,1,"div",13),e.bVm()),2&t){const o=e.XpG(2),r=e.sdS(7);e.R7$(3),e.uP7(o.numRecordsParsed),e.nnv(2),e.R7$(),e.Y8G("ngIf",!o.loading)("ngIfElse",r)}}function lo(t,s){if(1&t){const o=e.RV6();e.qex(0),e.j41(1,"alert-component",21),e.pXf(2,8),e.k0s(),e.j41(3,"button",19),e.bIt("click",function(){c.eBV(o);const n=e.XpG(2);return c.Njj(n.reset.emit())}),e.pXf(4,9),e.k0s(),e.bVm()}}function co(t,s){if(1&t&&(e.j41(0,"div"),e.DNE(1,ao,5,3,"ng-container",11)(2,lo,5,0,"ng-container",11),e.k0s()),2&t){const o=e.XpG();e.R7$(),e.Y8G("ngIf",o.numRecordsParsed>0),e.R7$(),e.Y8G("ngIf",0===o.numRecordsParsed)}}function uo(t,s){1&t&&e.nrm(0,"mat-progress-bar",22)}let mo=(()=>{class t{constructor(){this.fileChange=new e.bkB(!0),this.uploadCustomers=new e.bkB(!0),this.reset=new e.bkB(!0)}onFileChange(o){if(o.target.files&&o.target.files.length){const[r]=o.target.files,n=window.URL.createObjectURL(r);this.fileChange.emit(n)}}static#e=this.\u0275fac=function(r){return new(r||t)};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["import-customers-form"]],inputs:{loading:"loading",numRecordsImported:"numRecordsImported",numRecordsParsed:"numRecordsParsed",re
1cords:"records"},outputs:{fileChange:"fileChange",uploadCustomers:"uploadCustomers",reset:"reset"},standalone:!1,decls:8,vars:7,consts:()=>{let o,r,n,i,d,a,u,f,T;return o=$localize`:â4a0dae0496de38ed5d21ac941e525c6039a486d9â725925763270088873:Imported ${"\ufffd#3\ufffd"}:START_EMPHASISED_TEXT:${"\ufffd0\ufffd"}:INTERPOLATION:${"\ufffd/#3\ufffd"}:CLOSE_EMPHASISED_TEXT: customers.`,r=$localize`:âc085d397c4ae06af2a2f22f001bfcd68e1c473abâ6176704733702164005:Parsed ${"\ufffd#3\ufffd"}:START_EMPHASISED_TEXT:${"\ufffd0\ufffd"}:INTERPOLATION:${"\ufffd/#3\ufffd"}:CLOSE_EMPHASISED_TEXT: records.`,n=$localize`:â16924b6f074dc5734b9aac92dd46aa9af7eda473â87781252943505376: Upload Now `,i=$localize`:â2990390fda72611aeb9c0827ac10260f9f3f58cbâ77415186500739779:Preview of data:`,d=$localize`:âc83b838d845690bcb897f775f53b5316535306dcâ6028371114637047813:First Name`,a=$localize`:â166b2cc65003221ff5f3ec05d5baca41e6821396â4407559560004943843:Last Name`,u=$localize`:â244aae9346da82b0922506c2d2581373a15641ccâ4768749765465246664:Email`,f=$localize`:âe672c4159f5f41b004f2b7be216d755535bf7e5dâ1304805806683121158:Did not find any customer records. Please ensure your file is in the correct format and try again.`,T=$localize`:âe88691605585e45bd9e3d7cdd10132a324ed5d7eâ6834911193618002890: Try Again `,[["uploading",""],o,r,n,i,d,a,u,f,T,["id","container"],[4,"ngIf"],["type","success"],[4,"ngIf","ngIfElse"],["id","file","name","file","type","file",3,"change"],["for","file","id","upload-csv-label"],["icon","cloud-upload-alt"],["type","info"],[2,"margin-bottom","30px"],[1,"button",3,"click"],[4,"ngFor","ngForOf"],["type","warning"],["mode","indeterminate"]]},template:function(r,n){1&r&&(e.j41(0,"div",10),e.DNE(1,no,4,1,"div",11)(2,io,2,2,"div",11),e.nI1(3,"isNil"),e.DNE(4,co,3,2,"div",11),e.nI1(5,"isDefined"),e.DNE(6,uo,1,0,"ng-template",null,0,e.C5r),e.k0s()),2&r&&(e.R7$(),e.Y8G("ngIf",n.numRecordsImported),e.R7$(),e.Y8G("ngIf",e.bMT(3,3,n.numRecordsParsed)),e.R7$(2),e.Y8G("ngIf",e.bMT(5,5,n.numRecordsParsed)))},dependencies:[b.Sq,b.bT,Q.C,oo.HM,re.aY,ee.g,Te.W],styles:["[_ngcontent-%COMP%]:root{--color-blue-gray-100: #f4f7f8;--color-slate-50: #f8f9fa;--color-slate-100: #f1f5f9;--color-slate-200: #e2e8f0;--color-slate-300: #cbd5e1;--color-slate-400: #94a3b8;--color-slate-500: #64748b;--color-slate-600: #475569;--color-slate-700: #334155;--color-slate-800: #1e293b;--color-slate-900: #0f172b;--color-slate-950: #020617;--color-cyan-50: #ecfeff;--color-cyan-100: #cffafe;--color-cyan-200: #a5f3fc;--color-cyan-300: #67e8f9;--color-cyan-400: #22d3ee;--color-cyan-500: #06b6d4;--color-cyan-600: #0891b2;--color-cyan-700: #0e7490;--color-cyan-800: #155e75;--color-cyan-900: #164e63;--color-cyan-950: #083344;--color-blue-50: #eff6ff;--color-blue-100: #dbeafe;--color-blue-200: #bfdbfe;--color-blue-300: #93c5fd;--color-blue-400: #60a5fa;--color-blue-500: #3b82f6;--color-blue-600: #2563eb;--color-blue-700: #1d4ed8;--color-blue-800: #1e40af;--color-blue-900: #1e3a8a;--color-blue-950: #172554;--color-red-50: #fef2f2;--color-red-100: #fee2e2;--color-red-200: #fecaca;--color-red-300: #fca5a5;--color-red-400: #f87171;--color-red-500: #ef4444;--color-red-600: #dc2626;--color-red-700: #b91c1c;--color-red-800: #991b1b;--color-red-900: #7f1d1d;--color-red-950: #450a0a;--color-green-50: #ecfdf5;--color-green-100: #d1fae5;--color-green-200: #a7f3d0;--color-green-300: #6ee7b7;--color-green-400: #34d399;--color-green-500: #10b981;--color-green-600: #059669;--color-green-700: #047857;--color-green-800: #065f46;--color-green-900: #064e3b;--color-green-950: #022c22;--color-purple-50: #f5f3ff;--color-purple-100: #ede9fe;--color-purple-200: #ddd6fe;--color-purple-300: #c4b5fd;--color-purple-400: #a78bfa;--color-purple-500: #8b5cf6;--color-purple-600: #7c3aed;--color-purple-700: #6d28d9;--color-purple-800: #5b21b6;--color-purple-900: #4c1d95;--color-purple-950: #2e1065;--color-teal-50: #f0fdfa;--color-teal-100: #ccfbf1;--color-teal-200: #99f6e4;--color-teal-300: #5eead4;--color-teal-400: #2dd4bf;--color-teal-500: #14b8a6;--color-teal-600: #0d9488;--color-teal-700: #0f766e;--color-teal-800: #115e59;--color-teal-900: #134e4a;--color-teal-950: #042f2e;--color-gray-50: #f9fafb;--color-gray-100: #f3f4f6;--color-gray-200: #e5e7eb;--color-gray-300: #d1d5db;--color-gray-400: #9ca3af;--color-gray-500: #6b7280;--color-rose-50: #fff1f2;--color-rose-100: #ffe4e6;
1--color-rose-200: #fecdd3;--color-rose-300: #fda4af;--color-rose-400: #fb7185;--color-rose-500: #f43f5e;--color-rose-600: #e11d48;--color-rose-700: #be123c;--color-rose-800: #9f1239;--color-rose-900: #881337;--color-rose-950: #4c0519;--color-pink-50: #fdf2f8;--color-pink-100: #fce7f3;--color-pink-200: #fbcfe8;--color-pink-300: #f9a8d4;--color-pink-400: #f472b6;--color-pink-500: #ec4899;--color-pink-600: #db2777;--color-pink-700: #be185d;--color-pink-800: #9d174d;--color-pink-900: #831843;--color-pink-950: #500724;--color-amber-50: #fffbeb;--color-amber-100: #fef3c7;--color-amber-200: #fde68a;--color-amber-300: #fcd34d;--color-amber-400: #fbbf24;--color-amber-500: #f59e0b;--color-amber-600: #d97706;--color-amber-700: #b45309;--color-amber-800: #92400e;--color-amber-900: #78350f;--color-amber-950: #451a03}.turquoise[_ngcontent-%COMP%]{color:#2dd4bf}.turquoise-background[_ngcontent-%COMP%]{background:#2dd4bf}.turquoise-border[_ngcontent-%COMP%]{border-color:#2dd4bf}.emerald[_ngcontent-%COMP%]{color:#84cc16}.emerald-background[_ngcontent-%COMP%]{background:#84cc16}.emerald-border[_ngcontent-%COMP%]{border-color:#84cc16}.peteriver[_ngcontent-%COMP%]{color:#0ea5e9}.peteriver-background[_ngcontent-%COMP%]{background:#0ea5e9}.peteriver-border[_ngcontent-%COMP%]{border-color:#0ea5e9}.wisteria[_ngcontent-%COMP%]{color:#7c3aed}.wisteria-background[_ngcontent-%COMP%]{background:#7c3aed}.wisteria-border[_ngcontent-%COMP%]{border-color:#7c3aed}.sunflower[_ngcontent-%COMP%]{color:#eab308}.sunflower-background[_ngcontent-%COMP%]{background:#eab308}.sunflower-border[_ngcontent-%COMP%]{border-color:#eab308}.pumpkin[_ngcontent-%COMP%]{color:#f97316}.pumpkin-background[_ngcontent-%COMP%]{background:#f97316}.pumpkin-border[_ngcontent-%COMP%]{border-color:#f97316}.alizarin[_ngcontent-%COMP%]{color:#e74c3c}.alizarin-background[_ngcontent-%COMP%]{background:#e74c3c}.alizarin-border[_ngcontent-%COMP%]{border-color:#e74c3c}.pink[_ngcontent-%COMP%]{color:#ed0d6c}.pink-background[_ngcontent-%COMP%]{background:#ed0d6c}.pink-border[_ngcontent-%COMP%]{border-color:#ed0d6c}.yellow[_ngcontent-%COMP%]{color:#eed531}.yellow-background[_ngcontent-%COMP%]{background:#eed531}.yellow-border[_ngcontent-%COMP%]{border-color:#eed531}.orange[_ngcontent-%COMP%]{color:#f98450}.orange-background[_ngcontent-%COMP%]{background:#f98450}.orange-border[_ngcontent-%COMP%]{border-color:#f98450}.error[_ngcontent-%COMP%]{color:red}.success[_ngcontent-%COMP%]{color:#0cce6b}#container[_ngcontent-%COMP%]{text-align:center;padding:40px}#upload-csv-label[_ngcontent-%COMP%]{color:#ed0d6c;opacity:.6;font-size:11em;transition:all .3s}#upload-csv-label[_ngcontent-%COMP%]:hover{opacity:1;cursor:pointer}input[type=file][_ngcontent-%COMP%]{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}"]})}return t})(),Co=(()=>{class t{constructor(o){this._store=o,this.loading$=this._store.pipe((0,_.Lt)(qt)),this.numRecordsImported$=this._store.pipe((0,_.Lt)(eo)),this.numRecordsParsed$=this._store.pipe((0,_.Lt)(to)),this.records$=this._store.pipe((0,_.Lt)(Qt))}reset(){this._store.dispatch(new g.Un)}close(){this._store.dispatch(new g.eD)}fileChange(o){this._store.dispatch(new g.R9({url:o}))}uploadCustomers(){this._store.dispatch(new g.b5)}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(_.il))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["import-customers-container"]],standalone:!1,decls:8,vars:12,consts:()=>{let o;return o=$localize`:â2b003193f5461402117c3d5ea1b88cd8be48a22eâ2858919516242536430: Import Clients `,[o,[3,"close"],["panel-header",""],["panel-body","",3,"fileChange","uploadCustomers","reset","close","loading","numRecordsImported","numRecordsParsed","records"]]},template:function(r,n){1&r&&(e.j41(0,"slideout-panel",1),e.bIt("close",function(){return n.close()}),e.j41(1,"div",2),e.pXf(2,0),e.k0s(),e.j41(3,"import-customers-form",3),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"async"),e.nI1(7,"async"),e.bIt("fileChange",function(d){return n.fileChange(d)})("uploadCustomers",function(){return n.uploadCustomers()})("reset",function(){return n.reset()})("close",function(){return n.close()}),e.k0s()()),2&r&&(e.R7$(3),e.Y8G("loading",e.bMT(4,4,n.loading$))("numRecordsImported",e.bMT(5,6,n.numRecordsImported$))("numRecordsParsed",e.bMT(6,8,n.numRecordsParsed$))("records",e.bMT(7,10,n.records$)))},dependencies:[K.P,mo,b.Jj],encapsulation:2})}return t})();var be=l(5951),go=l(21204);function po(t,s){1&t&&(e.j41(0,"span"),e.pXf(1,7),e.k0s())}function fo(t,s){1&t&&(e.j41(0,"span"),e.pXf(1,8),e.k0s())}function To(t,s){if(1&t){const o=e.RV6();e.j41(0,"div",41)(1,"button",42),e.bIt("click",function(){c.eBV(o);const n=e.XpG(3);return c.Njj(n.toggleView())}),e.DNE(2,po,2,0,"span",29)(3,fo,2,0,"span",29),e.k0s()()}if(2&t){const o=e.XpG(3);e.R7$(2),e.Y8G("ngIf",o.showAdminView),e.R7$(),e.Y8G("ngIf",!o.showAdminView)}}
1function Eo(t,s){if(1&t&&(e.j41(0,"alert-component",43)(1,"h4"),e.pXf(2,9),e.k0s(),e.j41(3,"p"),e.EFF(4),e.k0s()()),2&t){const o=e.XpG(3);e.R7$(4),e.JRh(o.adminWarning)}}function So(t,s){1&t&&(e.j41(0,"alert-component",44)(1,"h4"),e.pXf(2,10),e.k0s(),e.j41(3,"p"),e.pXf(4,11),e.k0s()())}function Mo(t,s){if(1&t&&(e.j41(0,"div")(1,"alert-component",44)(2,"h4"),e.pXf(3,12),e.k0s(),e.j41(4,"p"),e.EFF(5),e.k0s()()()),2&t){const o=e.XpG(3);e.R7$(5),e.JRh(o.error)}}function Oo(t,s){1&t&&(e.j41(0,"label",45),e.PLo(1,13),e.nrm(2,"i"),e.YFu(),e.k0s())}function Ro(t,s){1&t&&(e.j41(0,"label",45),e.PLo(1,14),e.nrm(2,"i"),e.YFu(),e.k0s())}function No(t,s){1&t&&(e.j41(0,"span"),e.EFF(1,"\u24d8"),e.k0s())}function Po(t,s){1&t&&(e.j41(0,"span"),e.EFF(1,"\u2715"),e.k0s())}function Io(t,s){if(1&t){const o=e.RV6();e.j41(0,"button",52),e.bIt("click",function(){c.eBV(o);const n=e.XpG().$implicit,i=e.XpG(3);return c.Njj(i.toggleDetails(n))}),e.DNE(1,No,2,0,"span",29)(2,Po,2,0,"span",29),e.k0s()}if(2&t){const o=e.XpG().$implicit,r=e.XpG(3);e.R7$(),e.Y8G("ngIf",!r.isExpanded(o)),e.R7$(),e.Y8G("ngIf",r.isExpanded(o))}}function $o(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,15),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.state)}}function bo(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,16),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.mergedTo)}}function Ao(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,17),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.externalId)}}function ho(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,18),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.locationPriority," ")}}function vo(t,s){if(1&t&&(e.j41(0,"div",53),e.DNE(1,$o,4,1,"div",29)(2,bo,4,1,"div",29)(3,Ao,4,1,"div",29)(4,ho,4,1,"div",29),e.k0s()),2&t){const o=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",o.state),e.R7$(),e.Y8G("ngIf",o.mergedTo),e.R7$(),e.Y8G("ngIf",o.externalId),e.R7$(),e.Y8G("ngIf",void 0!==o.locationPriority)}}function Fo(t,s){if(1&t&&(e.j41(0,"div",46)(1,"div",47)(2,"mat-radio-button",48)(3,"b"),e.EFF(4),e.k0s(),e.j41(5,"span",49),e.EFF(6),e.k0s()(),e.DNE(7,Io,3,2,"button",50),e.k0s(),e.DNE(8,vo,5,4,"div",51),e.k0s()),2&t){const o=s.$implicit,r=e.XpG(3);e.R7$(2),e.Y8G("value",o),e.R7$(2),e.JRh(r.getDisplayName(o)),e.R7$(),e.AVh("live",o.verified),e.R7$(),e.JRh(r.getDataSourceLabel(o)),e.R7$(),e.Y8G("ngIf",r.hasAdditionalInfo(o)),e.R7$(),e.Y8G("ngIf",r.isExpanded(o)&&r.hasAdditionalInfo(o))}}function yo(t,s){1&t&&(e.j41(0,"span"),e.EFF(1,"\u24d8"),e.k0s())}function Go(t,s){1&t&&(e.j41(0,"span"),e.EFF(1,"\u2715"),e.k0s())}function Uo(t,s){if(1&t){const o=e.RV6();e.j41(0,"button",57),e.bIt("click",function(){c.eBV(o);const n=e.XpG().$implicit,i=e.XpG(3);return c.Njj(i.toggleDetails(n.customer))}),e.DNE(1,yo,2,0,"span",29)(2,Go,2,0,"span",29),e.k0s()}if(2&t){const o=e.XpG().$implicit,r=e.XpG(3);e.R7$(),e.Y8G("ngIf",!r.isExpanded(o.customer)),e.R7$(),e.Y8G("ngIf",r.isExpanded(o.customer))}}function Xo(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,19),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.customer.state)}}function Lo(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,20),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.customer.mergedTo)}}function Do(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,21),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.customer.externalId)}}function ko(t,s){if(1&t&&(e.j41(0,"div")(1,"strong"),e.pXf(2,22),e.k0s(),e.EFF(3),e.k0s()),2&t){const o=e.XpG(2).$implicit;e.R7$(3),e.SpI(" ",o.customer.locationPriority," ")}}function jo(t,s){if(1&t&&(e.j41(0,"div",53),e.DNE(1,Xo,4,1,"div",29)(2,Lo,4,1,"div",29)(3,Do,4,1,"div",29)(4,ko,4,1,"div",29),e.k0s()),2&t){const o=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",o.customer.state),e.R7$(),e.Y8G("ngIf",o.customer.mergedTo),e.R7$(),e.Y8G("ngIf",o.customer.externalId),e.R7$(),e.Y8G("ngIf",void 0!==o.customer.locationPriority)}}function xo(t,s){if(1&t&&(e.j41(0,"div",46)(1,"div",47)(2,"mat-radio-button",54)(3,"b"),e.EFF(4),e.k0s(),e.j41(5,"span",49),e.EFF(6),e.k0s()(),e.DNE(7,Uo,3,2,"button",55),e.k0s(),e.j41(8,"div",56),e.EFF(9),e.k0s(),e.DNE(10,jo,5,4,"div",51),e.k0s()),2&t){const o=s.$implicit,r=e.XpG(3);e.R7$(2),e.Y8G("value",o.customer)("disabled",!0),e.R7$(2),e.JRh(r.getDisplayName(o.customer)),e.R7$(),e.AVh("live",o.customer.verified),e.R7$(),e.JRh(r.getDataSourceLabel(o.customer)),e.R7$(),e.Y8G("ngIf",r.hasAdditionalInfo(o.customer)),e.R7$(2),e.JRh(o.reason),e.R7$(),e.Y8G("ngIf",r.isExpanded(o.customer)&&r.hasAdditionalInfo(o.customer))}}function Vo(t,s){if(1&t){const o=e.RV6();e.j41(0,"div"),e.DNE(1,To,4,2,"div",31)(2,Eo,5,1,"alert-component",32)(3,So,5,0,"alert-component",33),e.nI1(4,"isEmpty"),e.DNE(
15,Mo,6,1,"div",29),e.nI1(6,"notEmpty"),e.j41(7,"div",34),e.DNE(8,Oo,3,0,"label",35)(9,Ro,3,0,"label",35),e.j41(10,"mat-radio-group",36),e.bIt("change",function(n){c.eBV(o);const i=e.XpG(2);return c.Njj(i.updatePrimary(n))}),e.DNE(11,Fo,9,7,"div",37)(12,xo,11,9,"div",37),e.k0s()(),e.j41(13,"div",38)(14,"b"),e.pXf(15,1),e.k0s(),e.j41(16,"ul")(17,"li"),e.PLo(18,2),e.nrm(19,"i"),e.YFu(),e.k0s(),e.j41(20,"li"),e.pXf(21,3),e.k0s(),e.j41(22,"li"),e.PLo(23,4),e.nrm(24,"i"),e.YFu(),e.k0s(),e.j41(25,"li"),e.PLo(26,5),e.nrm(27,"i"),e.YFu(),e.k0s()()(),e.j41(28,"div",39)(29,"button",40),e.nI1(30,"isEmpty"),e.bIt("click",function(){c.eBV(o);const n=e.XpG(2);return c.Njj(n.mergeCustomers())}),e.pXf(31,6),e.k0s()()()}if(2&t){const o=e.XpG(2);e.R7$(),e.Y8G("ngIf",o.isAdmin),e.R7$(),e.Y8G("ngIf",o.showAdminView&&o.adminWarning),e.R7$(),e.Y8G("ngIf",!o.isAdmin&&e.bMT(4,10,o.userValidOptions)),e.R7$(2),e.Y8G("ngIf",e.bMT(6,12,o.error)),e.R7$(3),e.Y8G("ngIf",1===o.displayedValidOptions.length),e.R7$(),e.Y8G("ngIf",o.displayedValidOptions.length>1),e.R7$(),e.Y8G("value",o.primary),e.R7$(),e.Y8G("ngForOf",o.displayedValidOptions),e.R7$(),e.Y8G("ngForOf",o.displayedInvalidOptions),e.R7$(17),e.Y8G("disabled",e.bMT(30,14,o.primary))}}function wo(t,s){1&t&&e.nrm(0,"large-loading-indicator")}function zo(t,s){if(1&t&&(e.j41(0,"div"),e.DNE(1,Vo,32,16,"div",30)(2,wo,1,0,"ng-template",null,0,e.C5r),e.k0s()),2&t){const o=e.sdS(3),r=e.XpG();e.R7$(),e.Y8G("ngIf",!r.loading)("ngIfElse",o)}}function Yo(t,s){1&t&&(e.j41(0,"div")(1,"alert-component",44)(2,"h4"),e.pXf(3,23),e.k0s(),e.j41(4,"p"),e.pXf(5,24),e.k0s()()())}function Bo(t,s){if(1&t){const o=e.RV6();e.j41(0,"div")(1,"alert-component",58)(2,"h4"),e.pXf(3,25),e.k0s(),e.j41(4,"ul")(5,"li"),e.pXf(6,26),e.k0s(),e.j41(7,"li"),e.pXf(8,27),e.k0s()()(),e.j41(9,"div",39)(10,"button",59),e.bIt("click",function(){c.eBV(o);const n=e.XpG();return c.Njj(n.done.emit())}),e.pXf(11,28),e.k0s()()()}if(2&t){const o=e.XpG();e.R7$(6),e.uP7(o.result.numUpdatedAppointments)(1===o.result.numUpdatedAppointments?" was":"s were"),e.nnv(6),e.R7$(2),e.uP7(o.result.numDeletedCustomers)(1===o.result.numDeletedCustomers?" was":"s were"),e.nnv(8)}}let Ho=(()=>{class t{constructor(){this.showAdminView=!1,this.merge=new e.bkB(!0),this.close=new e.bkB(!0),this.done=new e.bkB(!0),this.changePrimary=new e.bkB(!0),this.expandedCustomerId=null}get displayedValidOptions(){return this.showAdminView?this.adminValidOptions:this.userValidOptions}get displayedInvalidOptions(){return this.showAdminView?this.adminInvalidOptions:this.userInvalidOptions}toggleView(){this.showAdminView=!this.showAdminView}updatePrimary(o){this.changePrimary.emit(o.value)}mergeCustomers(){this.merge.emit()}getDisplayName(o){return o.email?`${o.firstName} ${o.lastName} (${o.email})`:`${o.firstName} ${o.lastName}`}hasAdditionalInfo(o){return!!(o.state||o.mergedTo||o.externalId||void 0!==o.locationPriority)}toggleDetails(o){this.expandedCustomerId=this.expandedCustomerId===o._id?null:o._id}isExpanded(o){return this.expandedCustomerId===o._id}getDataSourceLabel(o){return o.verified?"Live POS Data":o.integrated?"Cached Data":"Vish Only"}static#e=this.\u0275fac=function(r){return new(r||t)};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["merge-customers-component"]],inputs:{isAdmin:"isAdmin",adminValidOptions:"adminValidOptions",adminInvalidOptions:"adminInvalidOptions",userValidOptions:"userValidOptions",userInvalidOptions:"userInvalidOptions",primary:"primary",loading:"loading",result:"result",error:"error",adminWarning:"adminWarning"},outputs:{close:"close",done:"done",merge:"merge",changePrimary:"changePrimary"},standalone:!1,decls:9,vars:15,consts:()=>{let o,r,n,i,d,a,u,f,T,E,N,O,G,$,P,B,p,H,J,ae,ve,Fe,ye,Ge,Ue,Xe,Le,De,ke,je;return o=$localize`:â8d51b208295b94dcbb28169607ade2890663c88eâ213811153296540527:When merging clients, the following rules apply:`,r=$localize`:âd8dcb79f8f5ca226d445671bf0911d556d7fc086â6283906709724451416:All clients' history will be merged to the ${"\ufffd#19\ufffd"}:START_ITALIC_TEXT:primary${"\ufffd/#19\ufffd"}:CLOSE_ITALIC_TEXT:`,n=$localize`:âe665081c867f9b8baa3472a48ccfc66649efb568â6641234135046870649:Information will be combined where no duplicate data exists`,i=$localize`:âdd243fb2775fd0c0b754c37909bea4c136f37d04â2419460937262839133:For duplicate information, the ${"\ufffd#24\ufffd"}:START_ITALIC_TEXT:primary${"\ufffd/#24\ufffd"}:CLOSE_ITALIC_TEXT: account will be used`,d=$localize`:â292d10a829c5d3e25830fef0e07a6c9ebe7c8904â2924293735334967790:All Clients except the ${"\ufffd#27\ufffd"}:START_ITALIC_TEXT:Primary${"\ufffd/#27\ufffd"}:CLOSE_ITALIC_TEXT: will be removed`,a=$localize`:â37e52bf9d86a1f5da1c699e8bed84187965a0163â6521129074303336452: Continue `,u=$localize`:âc2d9fef996740272b7e0934dc4c42019d0891a17â1893164229891935641:Switch to User View`,f=$localize`:â08f49ab4d948f1638851d4b00bbb32773549be60â5821402870334588846:Switch to Admin View`,T=$localize`:â4c2ca7fa27c16996f8bcd99a8819e063fb986b7eâ7956964717893528926:Admin Warning`,E=$localize`:â618959fa6b0998b1b21ebaa9042effb4d34fde16â2818787788950082841:Admin Approval Required`,N=$localize`:âb883a74e90774088c53e75e7bf1c3fd3ce6a2f38â5471220431288461041:This merge requires administrator review. Please contact an admin to complete this merge.`,O=$localize`:â0a513244b322789dc91766b9e51a3b4d86f4987câ569078577347083357:An Error Has Occured`,G=$localize`:âe89a7cba436d4c26f2ae3105e90f3af5c83c7ff2â1427344193839713223:${"\ufffd#2\ufffd"}:START_ITALIC_TEXT:Primary${"\ufffd/#2\ufffd"}:CLOSE_ITALIC_TEXT: auto selected:`,$=$localize`:âd80e2d907d49dab4e10f458416d57a8885cbfeb5â5891909931265339425:Select a client as ${"\ufffd#2\ufffd"}:START_ITALIC_TEXT:primary${"\ufffd/#2\ufffd"}:CLOSE_ITALIC_TEXT::`,P=$localize`:â4ce322cda90897689baa79d63f3a3d44928ad111â3430187305544200900:Show additional information`,B=$localize`:âcaeaea23981b9730ff04e00174619919105e94a5â416077535002182849:State:`,p=$localize`:âfaa08ec415eaeee2637a0efcbe0f624f503e9af2â2664263322856764287:Merged To:`,H=$localize`:â42a4cf7cb5b2ebaa0b1156613408f2323da61505â2937658856539339437:External ID:`,J=$localize`:â4fe1192f6741340a4ce45547752b8fd2a19829d6â2805583424744256112:Location Priority:`,ae=$localize`:â4ce322cda90897689baa79d63f3a3d44928ad111â3430187305544200900:Show additional information`,ve=$localize`:âcaeaea23981b9730ff04e00174619919105e94a5â416077535002182849:State:`,Fe=$localize`:âfaa08ec415eaeee2637a0efcbe0f624f503e9af2â2664263322856764287:Merged To:`,ye=$localize`:â42a4cf7cb5b2ebaa0b1156613408f2323da61505â2937658856539339437:External ID:`,Ge=$localize`:â4fe1192f6741340a4ce45547752b8fd2a19829d6â2805583424744256112:Location Priority:`,Ue=$localize`:â2e48416b4ca0c63ab9f3fb990b0e7d69ed954580â8634466487927972530:No Clients Selected`,Xe=$localize`:â5735eb6bbc58d8dd8ae64cd76daf37981fa7f338â7279159099705572701:Seems like you haven't selected any Clients to merge. Close this panel and try again.`,Le=$localize`:â36c86d2bd322f7568b55fd9d1389a55fe02c3a8dâ2123757603020067706:Clients merged successfully`,De=$localize`:â4df331cf084862f3fcc6fdf8a8221174e44587c2â7319497781509707185:${"\ufffd0\ufffd"}:INTERPOLATION: appointment${"\ufffd1\ufffd"}:INTERPOLATION_1: modified`,ke=$localize`:â4115e512b991d35c8a867528aebe3c79f6dc566aâ3221148580344231718:${"\ufffd0\ufffd"}:INTERPOLATION: client${"\ufffd1\ufffd"}:INTERPOLATION_1: deleted`,je=$localize`:âf031826de4d223f5af8f4fcec0c4f2ed1c035e87â2559990622163579351: Done `,[["loadingElement",""],o,r,n,i,d,a,u,f,T,E,N,O,G,$,B,p,H,J,ve,Fe,ye,Ge,Ue,Xe,Le,De,ke,je,[4,"ngIf"],[4,"ngIf","ngIfElse"],["class","view-toggle",4,"ngIf"],["type","warning",4,"ngIf"],["type","danger",4,"ngIf"],[1,"page-content"],["id","primary-radio-group-label",4,"ngIf"],[3,"change","value"],["class","customer-option",4,"ngFor","ngForOf"],[1,"card"],[1,"controls"],["type","button",1,"button","primary",3,"click","disabled"],[1,"view-toggle"],["type","button",1,"button","secondary",3,"click"],["type","warning"],["type","danger"],["id","primary-radio-group-label"],[1,"customer-option"],[1,"customer-option-row"],[3,"value"],[1,"data-source-badge"],["type","button","class","info-button","title",P,3,"click",4,"ngIf"],["class","customer-details",4,"ngIf"],["type","button","title",P,1,"info-button",3,"click"],[1,"customer-details"],[3,"value","disabled"],["type","button","class","info-button","title",ae,3,"click",4,"ngIf"],[1,"invalid-reason"],["type","button","title",ae,1,"info-button",3,"click"],["type","success"],["type","button",1,"button","primary",3,"click"]]},template:function(r,n){1&r&&(e.DNE(0,zo,4,2,"div",29),e.nI1(1,"isEmpty"),e.nI1(2,"notEmpty"),e.nI1(3,"notEmpty"),e.DNE(4,Yo,6,0,"div",29),e.nI1(5,"isEmpty"),e.nI1(6,"isEmpty"),e.DNE(7,Bo,12,4,"div",29),e.nI1(8,"notEmpty")),2&r&&(e.Y8G("ngIf",e.bMT(1,3,n.result)&&(e.bMT(2,5,n.displayedValidOptions)||e.bMT(3,7,n.displayedInvalidOptions))),e.R7$(4),e.Y8G("ngIf",e.bMT(5,9,n.displayedValidOptions)&&e.bMT(6,11,n.displayedInvalidOptions)),e.R7$(3),e.Y8G("ngIf",e.bMT(8,13,n.result)))},dependencies:[b.Sq,b.bT,Q.C,pe.c,be.VT,be._g,go.Y,fe.J],styles:["[_ngcontent-%COMP%]:root{--color-blue-gray-100: #f4f7f8;--color-slate-50: #f8f9fa;--color-slate-100: #f1f5f9;--color-slate-200: #e2e8f0;--color-slate-300: #cbd5e1;--color-slate-400: #94a3b8;--color-slate-500: #64748b;--color-slate-600: #475569;--color-slate-700: #334155;--color-slate-800: #1e293b;--color-slate-900: #0f172b;--color-slate-950: #020617;
1--color-cyan-50: #ecfeff;--color-cyan-100: #cffafe;--color-cyan-200: #a5f3fc;--color-cyan-300: #67e8f9;--color-cyan-400: #22d3ee;--color-cyan-500: #06b6d4;--color-cyan-600: #0891b2;--color-cyan-700: #0e7490;--color-cyan-800: #155e75;--color-cyan-900: #164e63;--color-cyan-950: #083344;--color-blue-50: #eff6ff;--color-blue-100: #dbeafe;--color-blue-200: #bfdbfe;--color-blue-300: #93c5fd;--color-blue-400: #60a5fa;--color-blue-500: #3b82f6;--color-blue-600: #2563eb;--color-blue-700: #1d4ed8;--color-blue-800: #1e40af;--color-blue-900: #1e3a8a;--color-blue-950: #172554;--color-red-50: #fef2f2;--color-red-100: #fee2e2;--color-red-200: #fecaca;--color-red-300: #fca5a5;--color-red-400: #f87171;--color-red-500: #ef4444;--color-red-600: #dc2626;--color-red-700: #b91c1c;--color-red-800: #991b1b;--color-red-900: #7f1d1d;--color-red-950: #450a0a;--color-green-50: #ecfdf5;--color-green-100: #d1fae5;--color-green-200: #a7f3d0;--color-green-300: #6ee7b7;--color-green-400: #34d399;--color-green-500: #10b981;--color-green-600: #059669;--color-green-700: #047857;--color-green-800: #065f46;--color-green-900: #064e3b;--color-green-950: #022c22;--color-purple-50: #f5f3ff;--color-purple-100: #ede9fe;--color-purple-200: #ddd6fe;--color-purple-300: #c4b5fd;--color-purple-400: #a78bfa;--color-purple-500: #8b5cf6;--color-purple-600: #7c3aed;--color-purple-700: #6d28d9;--color-purple-800: #5b21b6;--color-purple-900: #4c1d95;--color-purple-950: #2e1065;--color-teal-50: #f0fdfa;--color-teal-100: #ccfbf1;--color-teal-200: #99f6e4;--color-teal-300: #5eead4;--color-teal-400: #2dd4bf;--color-teal-500: #14b8a6;--color-teal-600: #0d9488;--color-teal-700: #0f766e;--color-teal-800: #115e59;--color-teal-900: #134e4a;--color-teal-950: #042f2e;--color-gray-50: #f9fafb;--color-gray-100: #f3f4f6;--color-gray-200: #e5e7eb;--color-gray-300: #d1d5db;--color-gray-400: #9ca3af;--color-gray-500: #6b7280;--color-rose-50: #fff1f2;--color-rose-100: #ffe4e6;--color-rose-200: #fecdd3;--color-rose-300: #fda4af;--color-rose-400: #fb7185;--color-rose-500: #f43f5e;--color-rose-600: #e11d48;--color-rose-700: #be123c;--color-rose-800: #9f1239;--color-rose-900: #881337;--color-rose-950: #4c0519;--color-pink-50: #fdf2f8;--color-pink-100: #fce7f3;--color-pink-200: #fbcfe8;--color-pink-300: #f9a8d4;--color-pink-400: #f472b6;--color-pink-500: #ec4899;--color-pink-600: #db2777;--color-pink-700: #be185d;--color-pink-800: #9d174d;--color-pink-900: #831843;--color-pink-950: #500724;--color-amber-50: #fffbeb;--color-amber-100: #fef3c7;--color-amber-200: #fde68a;--color-amber-300: #fcd34d;--color-amber-400: #fbbf24;--color-amber-500: #f59e0b;--color-amber-600: #d97706;--color-amber-700: #b45309;--color-amber-800: #92400e;--color-amber-900: #78350f;--color-amber-950: #451a03}.turquoise[_ngcontent-%COMP%]{color:#2dd4bf}.turquoise-background[_ngcontent-%COMP%]{background:#2dd4bf}.turquoise-border[_ngcontent-%COMP%]{border-color:#2dd4bf}.emerald[_ngcontent-%COMP%]{color:#84cc16}.emerald-background[_ngcontent-%COMP%]{background:#84cc16}.emerald-border[_ngcontent-%COMP%]{border-color:#84cc16}.peteriver[_ngcontent-%COMP%]{color:#0ea5e9}.peteriver-background[_ngcontent-%COMP%]{background:#0ea5e9}.peteriver-border[_ngcontent-%COMP%]{border-color:#0ea5e9}.wisteria[_ngcontent-%COMP%]{color:#7c3aed}.wisteria-background[_ngcontent-%COMP%]{background:#7c3aed}.wisteria-border[_ngcontent-%COMP%]{border-color:#7c3aed}.sunflower[_ngcontent-%COMP%]{color:#eab308}.sunflower-background[_ngcontent-%COMP%]{background:#eab308}.sunflower-border[_ngcontent-%COMP%]{border-color:#eab308}.pumpkin[_ngcontent-%COMP%]{color:#f97316}.pumpkin-background[_ngcontent-%COMP%]{background:#f97316}.pumpkin-border[_ngcontent-%COMP%]{border-color:#f97316}.alizarin[_ngcontent-%COMP%]{color:#e74c3c}.alizarin-background[_ngcontent-%COMP%]{background:#e74c3c}.alizarin-border[_ngcontent-%COMP%]{border-color:#e74c3c}.pink[_ngcontent-%COMP%]{color:#ed0d6c}.pink-background[_ngcontent-%COMP%]{background:#ed0d6c}.pink-border[_ngcontent-%COMP%]{border-color:#ed0d6c}.yellow[_ngcontent-%COMP%]{color:#eed531}.yellow-background[_ngcontent-%COMP%]{background:#eed531}.yellow-border[_ngcontent-%COMP%]{border-color:#eed531}.orange[_ngcontent-%COMP%]{color:#f98450}.orange-background[_ngcontent-%COMP%]{background:#f98450}.orange-border[_ngcontent-%COMP%]{border-color:#f98450}.error[_ngcontent-%COMP%]{color:red}.success[_ngcontent-%COMP%]{color:#0cce6b}h5[_ngcontent-%COMP%]{color:#ed0d6c;margin-top:2rem;text-align:center}h5[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{padding:.5rem}mat-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:1.5rem 0}input[type=radio][_ngcontent-%COMP%]:disabled{visibility:hidden}.card[_ngcontent-%COMP%]{background-color:var(--color-blue-gray-100);margin:2rem}.card[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:.5rem}
1.controls[_ngcontent-%COMP%]{position:relative;margin:0 10%}.controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{float:right;width:100%;padding:12px 0}.info-button[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:#ed0d6c;font-size:1.2rem;margin-left:.5rem;padding:.25rem;vertical-align:middle;transition:opacity .2s}.info-button[_ngcontent-%COMP%]:hover{opacity:.7}.customer-option[_ngcontent-%COMP%]{margin-bottom:1rem}.customer-option-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.data-source-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.7rem;padding:.2rem .5rem;margin-left:.5rem;border-radius:3px;background-color:#ed0d6c33;color:#bd0a56;font-weight:600;text-transform:uppercase}.data-source-badge.live[_ngcontent-%COMP%]{background-color:#00800033;color:#003400}.invalid-reason[_ngcontent-%COMP%]{margin-left:2rem;margin-top:.25rem;margin-bottom:.5rem;color:#bd0a56;font-size:.85rem;font-style:italic}.customer-details[_ngcontent-%COMP%]{margin-left:2rem;margin-top:.5rem;padding:.75rem;background-color:var(--color-blue-gray-100);border-left:3px solid #ed0d6c;font-size:.9rem}.customer-details[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{margin:.25rem 0}.customer-details[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#ed0d6c}"]})}return t})();const Jo=[{path:"",component:Zt},{path:"new",component:Ee,outlet:"panel"},{path:"edit/:id",component:Ee,outlet:"panel"},{path:"import",component:Co,outlet:"panel"},{path:"merge",component:(()=>{class t{constructor(o){this._store=o,this.adminValidOptions$=this._store.pipe((0,_.Lt)(Et)),this.adminInvalidOptions$=this._store.pipe((0,_.Lt)(St)),this.userValidOptions$=this._store.pipe((0,_.Lt)(Mt)),this.userInvalidOptions$=this._store.pipe((0,_.Lt)(Ot)),this.primary$=this._store.pipe((0,_.Lt)(Re)),this.result$=this._store.pipe((0,_.Lt)(Rt)),this.merging$=this._store.pipe((0,_.Lt)(Tt)),this.error$=this._store.pipe((0,_.Lt)(Nt)),this.isAdmin$=this._store.select(Oe.wz).pipe((0,C.T)(Ne.qc)),this.adminWarning$=this._store.pipe((0,_.Lt)(Pt))}close(){this._store.dispatch(M.close())}done(){this._store.dispatch(M.done())}merge(){this._store.dispatch(M.merge())}changePrimary(o){this._store.dispatch(M.updatePrimary({customer:o}))}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(_.il))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["merge-customers"]],standalone:!1,decls:14,vars:30,consts:()=>{let o;return o=$localize`:â3af4db596e08687ac9ca9dda94a34e7c14e6b27bâ5498555436923924151: Merge Clients `,[o,[3,"close"],["panel-header",""],["panel-body","",3,"merge","changePrimary","done","close","isAdmin","adminValidOptions","adminInvalidOptions","userValidOptions","userInvalidOptions","primary","loading","result","error","adminWarning"]]},template:function(r,n){1&r&&(e.j41(0,"slideout-panel",1),e.bIt("close",function(){return n.close()}),e.j41(1,"div",2),e.pXf(2,0),e.k0s(),e.j41(3,"merge-customers-component",3),e.nI1(4,"async"),e.nI1(5,"async"),e.nI1(6,"async"),e.nI1(7,"async"),e.nI1(8,"async"),e.nI1(9,"async"),e.nI1(10,"async"),e.nI1(11,"async"),e.nI1(12,"async"),e.nI1(13,"async"),e.bIt("merge",function(){return n.merge()})("changePrimary",function(d){return n.changePrimary(d)})("done",function(){return n.done()})("close",function(){return n.close()}),e.k0s()()),2&r&&(e.R7$(3),e.Y8G("isAdmin",e.bMT(4,10,n.isAdmin$))("adminValidOptions",e.bMT(5,12,n.adminValidOptions$))("adminInvalidOptions",e.bMT(6,14,n.adminInvalidOptions$))("userValidOptions",e.bMT(7,16,n.userValidOptions$))("userInvalidOptions",e.bMT(8,18,n.userInvalidOptions$))("primary",e.bMT(9,20,n.primary$))("loading",e.bMT(10,22,n.merging$))("result",e.bMT(11,24,n.result$))("error",e.bMT(12,26,n.error$))("adminWarning",e.bMT(13,28,n.adminWarning$)))},dependencies:[K.P,Ho,b.Jj],encapsulation:2,changeDetection:0})}return t})(),outlet:"panel"}];let Wo=(()=>{class t{static#e=this.\u0275fac=function(r){return new(r||t)};static#t=this.\u0275mod=e.$C({type:t});static#o=this.\u0275inj=c.G2t({imports:[ce.iI.forChild(Jo),ce.iI]})}return t})();var L=l(50604),m=l(89944),Ko=l(87701),z=l(32167),D=l(56486),ie=l(70152),F=l(25558),Zo=l(99437),h=l(11930),Ae=l(97579);let Qo=(()=>{class t{constructor(o,r,n){this._customerService=o,this._store=r,this._actions$=n,this.handleFilter$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.SEARCH),(0,ie.B)(500),(0,C.T)(i=>i.payload),(0,C.T)(i=>h.go({path:["/clients"],query:{filter:i.filter,page:void 0},extras:{queryParamsHandling:"merge"}})))),this.handleTableFilter$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.UPDATE_TABLE_FILTER),(0,ie.B)(500),(0,C.T)(i=>i.payload),(0,C.T)(i=>h.go({path:["/clients"],query:{tableFilter:JSON.stringify(i),page:void 0},extras:{queryParamsHandling:"merge"}})))),this.handleSort$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.UPDATE_SORT),(0,ie.B)(500),(0,C.T)(i=>i.payload),(0,C.T)(i=>h.go({path:["/clients"],query:{sort:JSON.stringify(i),page:void 0},extras:{queryParamsHandling:"merge"}})))),this.loadAll$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.LOAD_ALL),(0,C.T)(i=>i.payload),(0,F.n)(i=>this._customerService.find(i.criteria,i.sort,i.page,i.limit).pipe((0,y.Z)(d=>[new g.fo(d.records,d.paging)]),(0,Zo.W)(d=>(0,W.of)(new g.aI({errors:d}))))))),this.reload$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.RELOAD),(0,U.E)(this._store.pipe((0,_.Lt)(I.vD)),this._store.pipe((0,_.Lt)(I.PC)
1),this._store.pipe((0,_.Lt)(I.FD)),this._store.pipe((0,_.Lt)(I.D4)).pipe((0,C.T)(X.WL(()=>({}))))),(0,C.T)(([i,d,a,u,f])=>new g.eQ({filter:d,tableFilter:a,sort:u,page:f.page,limit:f.limit})))),this.navigateToPage$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.NAVIGATE_TO_PAGE),(0,C.T)(i=>i.payload.page),(0,U.E)(this._store.pipe((0,_.Lt)(I.vD))),(0,C.T)(([i,d])=>h.go({path:["/clients"],query:{filter:d,page:i}})))),this.remove$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.REMOVE),(0,C.T)(i=>i.payload.id),(0,F.n)(i=>this._customerService.remove(i).pipe((0,C.T)((0,D.AU)(d=>new g.XT({errors:d}),d=>new g.Ko(d)))))))}static#e=this.\u0275fac=function(r){return new(r||t)(c.KVO(Ae.f),c.KVO(_.il),c.KVO(m.En))};static#t=this.\u0275prov=c.jDH({token:t,factory:t.\u0275fac})}return t})();var qo=l(61405),se=l(97665);let en=(()=>{class t{constructor(o,r){this._actions$=o,this._customerService=r,this.navigateToEditCustomer$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.NAVIGATE),(0,C.T)(n=>(0,k.O9)(n.payload)?`edit/${n.payload.customerId}`:"new"),(0,C.T)(n=>h.go({path:["/clients",{outlets:{panel:n}}],extras:{queryParamsHandling:"merge"}})))),this.loadCustomerData$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.LOAD_DATA),(0,C.T)(n=>n.payload),(0,F.n)(n=>((0,k.O9)(n)?this._customerService.findById(n):(0,W.of)((0,X.zN)(new de.nD))).pipe((0,C.T)(i=>(0,Se.Fs)(i,X.AU(()=>new Ke({error:new Error("Customer not found")}),d=>new We({customer:d})))))))),this.add$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.ADD),(0,C.T)(n=>n.payload.customer),(0,F.n)(n=>this._customerService.insert(n).pipe((0,y.Z)(D.AU(i=>[new Ce({errors:i})],i=>[new me(i),new g.Mv])))))),this.addOrUpdateSuccess$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.SUCCESS),(0,C.T)(()=>new ge))),this.update$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.EDIT),(0,C.T)(n=>n.payload.customer),(0,F.n)(n=>this._customerService.update(n).pipe((0,y.Z)(D.AU(i=>[new Ce({errors:i})],()=>[new me(n),new g.Mv])))))),this.close$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(R.CLOSE),(0,C.T)(()=>h.go({path:["/clients"],extras:{queryParamsHandling:"merge"}}))))}static#e=this.\u0275fac=function(r){return new(r||t)(c.KVO(m.En),c.KVO(se.m))};static#t=this.\u0275prov=c.jDH({token:t,factory:t.\u0275fac})}return t})();const tn={record:void 0,saving:!1,loading:!1,error:void 0};function on(t=tn,s){switch(s.type){case R.NAVIGATE:case R.LOAD_DATA:return{...t,loading:!0};case R.LOAD_DATA_SUCCESS:{const r=s.payload.customer;return{...t,loading:!1,record:r}}case R.LOAD_DATA_FAIL:{const r=s.payload;return{...t,loading:!1,error:r}}case R.EDIT:case R.ADD:return{...t,saving:!0,error:void 0};case R.SUCCESS:return{...t,saving:!1,error:void 0};default:return t}}var _e=l(73703),nn=l(19852),rn=l(95154);let sn=(()=>{class t{constructor(o,r,n,i){this._customerService=o,this._customerParserService=r,this._store=n,this._actions$=i,this.navigateImportCustomers$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.NAVIGATE_IMPORT_CUSTOMERS),(0,_e.u)(h.go({path:["/clients",{outlets:{panel:"import"}}],extras:{queryParamsHandling:"merge"}})))),this.importCustomersFromFile$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.IMPORT_CUSTOMERS_FROM_FILE),(0,C.T)(d=>d.payload.url),(0,y.Z)(d=>this._customerParserService.parseCsvFile(d).pipe((0,nn.T)((a,u)=>[...a,u],[]),(0,C.T)(a=>new g.AO({records:a})))))),this.uploadCustomers$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.UPLOAD_CUSTOMERS),(0,U.E)(this._store.pipe((0,_.Lt)($e))),(0,C.T)(([d,a])=>new g.xz({customers:a})))),this.insertMany$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.INSERT_MANY),(0,C.T)(d=>d.payload.customers),(0,F.n)(d=>this._customerService.insertMany(d).pipe((0,y.Z)(a=>[new g.QT({numInserted:a}),new g.Mv]))))),this.closeCustomerImport$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(g.Or.CLOSE_CUSTOMER_IMPORT),(0,_e.u)(h.go({path:["/clients"],extras:{queryParamsHandling:"merge"}}))))}static#e=this.\u0275fac=function(r){return new(r||t)(c.KVO(se.m),c.KVO(rn.B),c.KVO(_.il),c.KVO(m.En))};static#t=this.\u0275prov=c.jDH({token:t,factory:t.\u0275fac})}return t})();const he={loading:!1,records:[],numRecordsImported:void 0,numRecordsParsed:void 0};function _n(t=he,s){switch(s.type){case g.Or.NAVIGATE_IMPORT_CUSTOMERS:return{...t,loading:!1,numRecordsImported:void 0,numRecordsParsed:void 0};case g.Or.IMPORT_CUSTOMERS_FROM_FILE:return{...t,loading:!0,numRecordsImported:void 0};case g.Or.IMPORT_CUSTOMERS_FROM_FILE_SUCCESS:{const r=s.payload.records,n=r.length;return{...t,loading:!1,records:r,numRecordsParsed:n}}case g.Or.UPLOAD_CUSTOMERS:return{...t,loading:!0};case g.Or.UPLOAD_CUSTOMERS_SUCCESS:{const i=s.payload.numInserted;return{...t,loading:!1,records:void 0,numRecordsParsed:void 0,numRecordsImported:i}}case g.Or.CLOSE_CUSTOMER_IMPORT:return he;default:return t}}var an=l(88141),ln=l(27468);let cn=(()=>{class t{constructor(o,r,n,i,d){this._customerService=o,this._integratedCustomerService=r,this._store=n,this._actions$=i,this._snackbarService=d,this.automerge$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.autoMerge),(0,F.n)(()=>this._customerService.autoMergeCustomers().pipe((0,C.T)((0,D.AU)(a=>M.autoMergeFail({error:a}),a=>M.autoMergeSuccess({result:a}))))))),this.openMergeSelectedCustomersPanel$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.navigate),(0,U.E)(this._store.pipe((0,_.Lt)(I.ef))),(0,C.T)(([a,u])=>u),(0,C.T)(a=>a.map(u=>this._integratedCustomerService.validate(u))),(0,F.n)(a=>
1(0,ln.p)(a)),(0,y.Z)(a=>[h.go({path:["/clients",{outlets:{panel:"merge"}}],extras:{queryParamsHandling:"merge"}}),M.initiate({selectedCustomers:a})]))),this.mergeSelectedCustomers$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.merge),(0,U.E)(this._store.pipe((0,_.Lt)(Re)),this._store.pipe((0,_.Lt)(I.ef))),(0,F.n)(([a,u,f])=>this._customerService.mergeCustomers(u,f).pipe((0,C.T)((0,D.AU)(T=>M.fail({error:T}),T=>M.success({result:T}))))))),this.done$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.done),(0,y.Z)(()=>[new g.vI,new g.Mv,h.go({path:["/clients"],extras:{queryParamsHandling:"merge"}})]))),this.mergeFailed$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.fail),(0,an.M)(({error:a})=>{console.error(a),this._snackbarService.info($localize`An error occurred merging clients.`)})),{dispatch:!1}),this.closeCustomerMerge$=(0,m.EH)(()=>this._actions$.pipe((0,m.gp)(M.close),(0,_e.u)(h.go({path:["/clients"],extras:{queryParamsHandling:"merge"}}))))}static#e=this.\u0275fac=function(r){return new(r||t)(c.KVO(se.m),c.KVO(Ae.f),c.KVO(_.il),c.KVO(m.En),c.KVO(Z.zR))};static#t=this.\u0275prov=c.jDH({token:t,factory:t.\u0275fac})}return t})();const Y={primary:void 0,adminValidOptions:void 0,adminInvalidOptions:void 0,userValidOptions:void 0,userInvalidOptions:void 0,merging:!1,result:void 0,autoMergeResult:void 0,error:void 0,autoMerging:!1,adminWarning:void 0},dn=(0,_.vy)(Y,(0,_.on)(M.autoMerge,t=>({...t,autoMerging:!0})),(0,_.on)(M.autoMergeSuccess,(t,s)=>({...t,autoMerging:!1,autoMergeResult:s.result})),(0,_.on)(M.autoMergeFail,(t,s)=>({...t,autoMerging:!1,error:s.error.message})),(0,_.on)(M.initiate,(t,s)=>{let d,o=[],r=[],n=[],i=[];const a=(p,H)=>p.map(J=>({customer:J,reason:H})),u=s.selectedCustomers.filter(p=>p.integrated&&p.verified&&"Active"===p.state),f=s.selectedCustomers.filter(p=>p.integrated&&p.verified&&"Active"!==p.state),T=s.selectedCustomers.filter(p=>p.integrated&&!p.verified&&"Active"===p.state),E=s.selectedCustomers.filter(p=>p.integrated&&!p.verified&&"Active"!==p.state),N=s.selectedCustomers.filter(p=>!p.integrated&&"Active"===p.state),O=s.selectedCustomers.filter(p=>!p.integrated&&"Active"!==p.state),G=new Set(s.selectedCustomers.map(p=>p.externalId).filter(p=>p)),$=s.selectedCustomers.some(p=>p.mergedTo&&!G.has(p.mergedTo)),P=s.selectedCustomers.some(p=>p.verified),B=s.selectedCustomers.some(p=>p.integrated);return o=[...u,...f,...T,...E,...N,...O],r=[],P?0===u.length?(n=[],i=[...a(f,"Not Active"),...a(T,"Not Verified"),...a(E,"Not Verified"),...a(N,"Not Integrated"),...a(O,"Not Integrated")],d=$?"Unsatisfied POS merged link and no active verified customers.":"No active verified customers."):1===u.length?$?(d="Unsatisfied POS merged link",n=[],i=[...a(u,"Unsatisfied POS merged link"),...a(f,"Not Active"),...a(T,"Not Verified"),...a(E,"Not Verified"),...a(N,"Not Integrated"),...a(O,"Not Integrated")]):(n=u,i=[...a(f,"Not Active"),...a(T,"Not Verified"),...a(E,"Not Verified"),...a(N,"Not Integrated"),...a(O,"Not Integrated")]):(n=[],i=[...a(u,"Multiple verified active customers found."),...a(f,"Not Active"),...a(T,"Not Verified"),...a(E,"Not Verified"),...a(N,"Not Integrated"),...a(O,"Not Integrated")],d=$?"Unsatisfied POS merged link and multiple active verified customers.":"Multiple active verified customers."):B?0===T.length?(n=[],i=[...a(E,"Not Active"),...a(N,"Not Integrated"),...a(O,"Not Integrated")],d=$?"Unsatisfied POS merged link and no active integrated customers.":"No active integrated customers."):1===T.length?$?(d="Unsatisfied POS merged link",n=[],i=[...a(T,"Unsatisfied POS merged link"),...a(E,"Not Active"),...a(N,"Not Integrated"),...a(O,"Not Integrated")]):(n=T,i=[...a(E,"Not Active"),...a(N,"Not Integrated"),...a(O,"Not Integrated")]):(n=[],i=[...a(T,"Multiple integrated active customers found."),...a(E,"Not Active"),...a(N,"Not Integrated"),...a(O,"Not Integrated")],d=$?"Unsatisfied POS merged link and multiple active integrated customers.":"Multiple active integrated customers."):(o=[...N,...O],r=[],n=[...N,...O],i=[]),{...Y,primary:1===n.length?n[0]:void 0,adminValidOptions:o,adminInvalidOptions:r,userValidOptions:n,userInvalidOptions:i,adminWarning:d}}),(0,_.on)(M.merge,t=>({...t,merging:!0})),(0,_.on)(M.success,(t,s)=>({...t,merging:!1,result:s.result})),(0,_.on)(M.fail,(t,s)=>({...t,merging:!1,error:s.error.message})),(0,_.on)(M.updatePrimary,(t,s)=>({...t,primary:s.customer})),(0,_.on)(M.close,()=>Y),(0,_.on)(M.done,()=>Y));let un=(()=>{class t{constructor(o){o.addIcons(L.Dy7,L.vaG,L.yLS,L.rOd,L.s4k)}static#e=this.\u0275fac=function(r){return new(r||t)(c.KVO(re.QB))};static#t=this.\u0275mod=e.$C({type:t});
1static#o=this.\u0275inj=c.G2t({imports:[z.Dw,z.hN,z.wq,xe.G,Ko.c1,Wo,we.n.forRoot(),Ve.Yf,_.md.forFeature("customers",qo.d),_.md.forFeature("importCustomers",_n),_.md.forFeature("mergeCustomers",dn),_.md.forFeature("editCustomer",on),m.Vm.forFeature([Qo,sn,cn,en]),z.bA]})}return 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.