PageSourceSearch

https://salmaz.herokuapp.com/main-DRK74AVN.js

js salmaz.herokuapp.com collected 2026-10-03 14:51:46 UTC 283,051 bytes, 42 lines download raw bytes

1import{a as si,b as cs,c as Yn,d as ps}from"./chunk-DJ74QFOP.js";import{a as us,b as hs,c as fs,d as Zn,e as gs,f as _s,g as ys,h as vs,i as ws,j as Cs,k as Kn}from"./chunk-VE3TZA4D.js";import{e as rs,f as as,o as ss,p as ls,r as Qn,s as ms,t as ds,u as je,v as li}from"./chunk-GUU6ONHE.js";import{a as Bn,b as Hn,c as Ln,d as Ka,e as Ci,f as Vi}from"./chunk-JYXHYXX6.js";import{a as Ya,b as Ai,c as Oi,d as ir,e as Xi}from"./chunk-XQGRJ3Q6.js";import{a as Pi}from"./chunk-5GB3ERJM.js";import{a as ns,b as Gn}from"./chunk-J73WJUPG.js";import{a as Re,b as er,c as ai,d as Ha,e as Tn,f as Rn,g as La,h as $a,i as An,j as Wa}from"./chunk-B2NFQN2H.js";import{a as qn}from"./chunk-BZOZXFEM.js";import{a as Za}from"./chunk-G5USRSOP.js";import{a as Fn,b as Ri,e as On,f as tr,g as Vn,i as jn,j as zn,k as Xa,l as es,m as Un,n as rr,p as is}from"./chunk-63BMG23M.js";import{b as $n,c as Wn,d as nr,h as ts}from"./chunk-M3G3YZ7S.js";import{a as Ba,d as ja,g as Pn,h as za,i as Ua,k as Ga,l as Nn,m as qa,n as Qa,o as Ja,p as or,q as _t}from"./chunk-QIEKL5EK.js";import{a as Ti,i as Ji}from"./chunk-B52EB2VN.js";import{a as wi}from"./chunk-ZN7ZW2IR.js";import{B as K,F as At,G as z,H as dt,I as os,a as qr,b as We,c as ga,d as xn,e as _a,f as ya,g as Ho,h as zo,i as mt,j as qo,k as bn,m as Tt,n as Rt,o as En,r as Ko,s as we,t as Ce,u as Jo,v as ni,w as oi,x as ri,y as Xo,z as Va}from"./chunk-FUTXYZ6Q.js";import{a as Q,b as Jt,c as Ye,d as Yi}from"./chunk-QCOHHDM4.js";import{a as Po}from"./chunk-C7PO525T.js";import{b as na}from"./chunk-COIMUU3Q.js";import"./chunk-LOWO27BU.js";import"./chunk-L73SJY3Q.js";import{a as xe,b as Fi,d as Mn,e as Pa,f as Na,g as Ki}from"./chunk-OFMMEF63.js";import{A as Mi,C as ii,E as lt,F as Ra,G as ct,H as Uo,I as ve,J as Go,K as Et,L as Yo,N as Mt,O as Ft,P as Zo,a as fn,e as $r,f as Wr,h as jr,i as zr,j as Ur,m as Me,o as de,p as Ea,q as Ma,r as pe,s as Fa,u as Xt,v as ei,w as ti,x as Ta}from"./chunk-B6UZW5EE.js";import{$ as zi,$b as L,A as hi,Aa as Tr,Ab as ee,Ae as Aa,Cb as M,Ce as Oa,D as kr,De as In,Eb as Vr,Ee as kn,F as Er,Fa as Rr,Fb as D,Fe as Qo,G as Co,Gb as Pr,Hb as p,I as Mr,Ib as ot,Jb as Ve,Kb as re,Kc as un,Kd as Ca,Ld as xa,Mb as bt,Nb as Pt,Nc as Lr,Ob as ce,Pb as te,Pd as Da,Qb as ie,R as xo,Ra as So,Sa as Ke,Sd as ba,T as ut,Tb as Nt,Tc as me,Ub as d,Uc as q,Va as a,Vb as T,Vd as st,Wa as b,Wb as w,X as Do,Xb as be,Y as jt,Yb as St,Yc as hn,Z as Be,Zb as Nr,ab as Ar,ac as $,ba as Ui,bc as W,ca as zt,cb as Io,cc as Gt,dc as rt,dd as Gr,ec as Br,ed as Eo,f as Wt,fc as Si,ga as O,gb as ht,ha as He,hd as Mo,he as $o,ia as Gi,id as Fo,jd as To,kb as v,lb as pn,mb as f,nb as Ut,oa as C,ob as le,p as wo,pa as x,pd as Dn,qb as Or,qd as va,rb as ko,re as Wo,sa as dn,sb as Dt,sc as Hr,se as Ei,te as Sa,ua as bo,ue as Zi,ve as Ia,w as Sr,wa as fi,wb as c,wd as wa,xa as gi,xb as l,xc as qt,xd as vi,xe as jo,ya as Fr,yb as k,yd as Lo,ye as ka,z as Ir,za as Vt,zb as X,ze as Sn}from"./chunk-DWZALUZU.js";import"./chunk-BIETX53I.js";import{a as yi,b as ia}from"./chunk-5XICOUL5.js";import{$a as ca,A as Zr,Aa as Vo,B as Qt,Ba as ft,Bb as fa,Ca as wn,Cb as Qe,E as It,Ea as oa,Fa as ra,G as Kr,Ga as G,J as _e,Ja as aa,K as ne,L as Ee,M as kt,N as Ao,Na as Zt,Oa as gt,P as Z,Pa as Kt,Q as Qi,R as $e,Ra as ae,S as A,Sa as No,Va as sa,X as Jr,Xa as la,Y as F,Z as Xr,_ as yn,a as S,ab as Cn,b as _,db as ma,ea,fa as V,ga as B,gb as da,h as g,ia as fe,j as Qr,ja as Oo,k as Ro,la as Bt,lb as pa,ma as Ie,n as Ii,o as _i,oa as ye,p as Le,pa as Ge,pb as Bo,qb as ua,ra as ki,s as gn,sa as Yt,sb as Ht,t as Yr,tb as P,u as _n,ub as qe,va as ta,wa as vn,x as at,y as Y,ya as Pe,yb as ha,z as qi,za as se}from"./chunk-GCWMHM5R.js";import"./chunk-BJSGW7AU.js";import{a as Dr,b as br,h,i as bi}from"./chunk-AWJWB36Z.js";var Je=class{static resetPassword(n){return h(this,null,function*(){yield g.repo(G).query({where:{id:n}}).forEach(e=>h(this,null,function*(){e.realStoredPassword="",yield e.save()}))})}static invalidatePassword(n){return h(this,null,function*(){yield g.repo(G).query({where:{id:n}}).forEach(e=>h(this,null,function*(){e.passwordChangeDate=new Date(1901,1,1),yield e.save()}))})}static sendInvite(n){return h(this,null,function*(){let e=yield g.repo(G).findId(n);if(!e)return Z().unfitForInvite;if(!(e.admin||e.distCenterAdmin))return Z().unfitForInvite;let i=g.context.getOrigin()+"/"+kt.getOrganizationFromContext()+"/login",t=yield P.getAsync(),o=e.password&&e.password.length>0,s=Z().hello+` ${e.name}
2  `+Z().welcomeTo+` ${t.organisationName}.
3  `+Z().pleaseEnterUsing+`
4  ${i}
5  `;return o||(s+=Z().enterFirstTime),yield new wn().sendSms(e.phone.thePhone,s,e),Z().inviteSentSuccesfully})}static clearCommentsOnServer(){return h(this,null,function*(){try{for(var n=bi(g.repo(G).query({where:{eventComment:{"!=":""}}})),e,i,t;e=!(i=yield n.next()).done;e=!1){let o=i.value;o.eventComment="",yield o.save()}}catch{t=[i]}finally{try{e&&(i=n.return)&&(yield i.call(n))}finally{if(t)throw t[0]}}})}static clearEscortsOnServer(){return h(this,null,function*(){try{for(var n=bi(g.repo(G).query()),e,i,t;e=!(i=yield n.next()).done;e=!1){let o=i.value;o.escort=null,o.needEscort=!1,o.theHelperIAmEscorting=null,yield o.save()}}catch{t=[i]}finally{try{e&&(i=n.return)&&(yield i.call(n))}finally{if(t)throw t[0]}}})}};S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[String]),_("design:returntype",Promise)],Je,"resetPassword",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[String]),_("design:returntype",Promise)],Je,"invali
5datePassword",null);S([Y({allowed:V.distCenterAdmin}),_("design:type",Function),_("design:paramtypes",[String]),_("design:returntype",Promise)],Je,"sendInvite",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],Je,"clearCommentsOnServer",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],Je,"clearEscortsOnServer",null);var Xs=()=>({standalone:!0}),ci=class ci{constructor(n,e,i){this.dialog=n,this.busy=e,this.settings=i,this.remult=g,this.city="",this.destroyHelper=new dt,this.showDeleted=!1,this.searchString="",this.numOfColsInGrid=4,this.helpers=new Ee(g.repo(G),{allowDelete:!1,allowInsert:!0,allowUpdate:!0,knowTotalRows:!0,rowCssClass:t=>t.archive?"deliveredProblem":t.isFrozen?"forzen":"",gridButtons:[{name:F.language.filterCity,click:()=>h(this,null,function*(){let t=this.city;K(At,o=>o.args={title:F.language.filterCity,helpText:F.language.filterCityHelp,fields:[Le(this).city],ok:()=>h(this,null,function*(){this.helpers.reloadData()}),cancel:()=>{this.city="",this.helpers.reloadData()}})})},{name:F.language.exportToExcel,click:()=>h(this,null,function*(){yield yi(this.settings,g.repo(G),this.helpers,F.language.volunteer,this.dialog,(t,o)=>o==t.$.id||o==t.$.password||o==t.$.totalKm||o==t.$.totalTime||o==t.$.smsDate||o==t.$.reminderSmsDate||o==t.$.realStoredPassword||o==t.$.shortUrlKey||o==t.$.admin,void 0,(t,o)=>h(this,null,function*(){o(F.language.city,t.preferredDistributionAreaAddressHelper.getGeocodeInformation.getCity(),"s"),o(F.language.city+"2",t.preferredFinishAddressHelper.getGeocodeInformation.getCity(),"s")}))}),visible:()=>g.isAllowed(V.admin)},{name:F.language.showDeletedHelpers,click:()=>{this.showDeleted=!this.showDeleted,this.helpers.reloadData()}},{name:F.language.clearAllVolunteerComments,click:()=>h(this,null,function*(){(yield K(wi,t=>t.args={question:F.language.clearAllVolunteerCommentsAreYouSure},t=>t.yes))&&(yield Je.clearCommentsOnServer(),this.helpers.reloadData())}),visible:()=>this.settings.showHelperComment&&g.isAllowed(V.admin)},{name:F.language.clearEscortInfo,click:()=>h(this,null,function*(){(yield K(wi,t=>t.args={question:F.language.clearEscortInfoAreYouSure},t=>t.yes))&&(yield Je.clearEscortsOnServer(),this.helpers.reloadData())}),visible:()=>g.isAllowed(V.admin)},{name:F.language.sendMessageToInviteVolunteers,click:()=>h(this,null,function*(){let t=new Po;K(At,o=>o.args={title:F.language.sendMessageToInviteVolunteers,helpText:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9 \u05E2\u05D9\u05E8 \u05D1\u05D4 \u05D4\u05DE\u05EA\u05E0\u05D3\u05D1 \u05D7\u05D9\u05DC\u05E7 \u05D1\u05E2\u05D1\u05E8, \u05D5\u05DC\u05D4\u05D2\u05D1\u05D9\u05DC \u05D0\u05EA \u05DE\u05E1\u05E4\u05E8 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E9\u05D9\u05E9\u05DC\u05D7\u05D5 \u05DB\u05D0\u05E9\u05E8 \u05D0\u05DD \u05D9\u05E9 \u05D4\u05D2\u05D1\u05DC\u05D4 - \u05D4\u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05EA\u05E9\u05DC\u05D7\u05E0\u05D4 \u05DC\u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD \u05DC\u05D4\u05DD \u05E9\u05DC\u05D7\u05E0\u05D5 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D4\u05DB\u05D9 \u05DE\u05D6\u05DE\u05DF. \u05D1\u05DE\u05E1\u05DA \u05D4\u05D1\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E0\u05E1\u05D7 \u05D0\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05DC\u05E9\u05DC\u05D5\u05D7, \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4",fields:[t.$.city,t.$.limit,t.$.hours],ok:()=>h(this,null,function*(){t.sendBulkDialog(this.dialog,this.helpers.currentRow)}),cancel:()=>{}})}),visible:()=>g.isAllowed(V.admin)&&this.settings.bulkSmsEnabled}],rowButtons:[{name:"",icon:"edit",showInLine:!0,textInMenu:()=>F.language.volunteerInfo,click:t=>h(this,null,function*(){t.displayEditDialog(this.dialog)})},{name:F.language.assignDeliveryMenu,icon:"list_alt",visible:t=>!t.isNew(),click:t=>h(this,null,function*(){return K(Pi,o=>o.argsHelper=t)})},{name:this.settings.lang.sendWhats,click:t=>t.phone.sendWhatsapp(),icon:"textsms"},{name:this.settings.lang.smsMessages,click:t=>t.smsMessages(this.dialog)},{name:F.language.resetPassword,click:t=>h(this,null,function*(){this.dialog.YesNoQuestion(F.language.resetPasswordAreYouSureFor+" "+t.name,()=>h(this,null,function*(){yield Je.resetPassword(t.id),this.dialog.Info(F.language.passwordWasReset)}))}),visible:t=>g.isAllowed(V.admin)||!t.admin}
5,{name:F.language.invalidatePassword,click:t=>h(this,null,function*(){this.dialog.YesNoQuestion(F.language.invalidatePassword+" "+t.name,()=>h(this,null,function*(){yield Je.invalidatePassword(t.id),this.dialog.Info(F.language.passwordInvalidated)}))}),visible:t=>(g.isAllowed(V.admin)||!t.admin)&&this.settings.daysToForcePasswordChange>0},{name:F.language.sendInviteBySms,click:t=>h(this,null,function*(){let o=yield Je.sendInvite(t.id);this.dialog.Info(o)}),visible:t=>t.admin||t.distCenterAdmin},{name:F.language.freezeHelper,visible:()=>g.isAllowed(V.admin)&&this.settings.isSytemForMlt,click:t=>h(this,null,function*(){return this.editFreezeDate(t)})},{textInMenu:t=>t.archive?F.language.unDeleteHelper:F.language.archiveHelper,visible:()=>g.isAllowed(V.admin),click:t=>h(this,null,function*(){t.archive?yield t.reactivate():(yield K(wi,o=>o.args={question:Z().areYouSureYouWantToDelete+" "+t.name+"?"},o=>o.yes))&&(yield t.deactivate(),this.helpers.items.splice(this.helpers.items.indexOf(t),1))})},{name:F.language.deliveries,visible:t=>!t.isNew(),click:t=>h(this,null,function*(){yield t.showDeliveryHistory(this.dialog)})},new Po().sendSingleHelperButton(this.dialog),{name:F.language.changeLog,visible:t=>g.isAllowed(V.admin),click:t=>K(qn,o=>o.args={for:t})},{name:F.language.assignHistory,visible:t=>g.repo(Vo).metadata.apiReadAllowed,click:t=>K(si,o=>o.args={title:F.language.assignHistory+" - "+t.name,settings:new Ee(g.repo(Vo),{numOfColumnsInGrid:8,columnSettings:s=>[s.deliveryName,s.courier,s.previousCourier,s.status,s.previousDeliveryStatus,s.deleted,s.userName,s.changeDate,s.appUrl,s.apiUrl],where:{$or:[{courier:t},{previousCourier:t}]}})})}],orderBy:{name:"asc"},rowsInPage:25,where:()=>({name:{$contains:this.searchString},archive:this.showDeleted?void 0:!1,$and:[this.city&&G.deliveredPreviously({city:this.city})]}),columnSettings:t=>(this.numOfColsInGrid=4,g.isAllowed(V.admin)&&this.numOfColsInGrid++,this.settings.isSytemForMlt&&(this.numOfColsInGrid+=6),[...G.selectColumns(t),t.lastDeliveryDate,t.preferredDistributionAreaAddressCity,t.preferredFinishAddressCity]),confirmDelete:t=>this.dialog.confirmDelete(t.name)}),this.dialog.onDistCenterChange(()=>h(this,null,function*(){this.helpers.reloadData()}),this.destroyHelper)}quickAdd(){let n=Qt(G).create();n.displayEditDialog(this.dialog,()=>{this.helpers.addNewRowToGrid(n)})}ngOnDestroy(){this.destroyHelper.destroy()}clearSearch(){this.searchString="",this.helpers.reloadData()}freezeDateEntry(n){return[{field:n.$.frozenTill,width:"150"},{field:n.$.internalComment,width:"150"}]}editFreezeDate(n){K(At,e=>e.args={title:Z().freezeHelper,ok:()=>{n.save()},cancel:()=>{},fields:this.freezeDateEntry(n)})}
5doSearch(){return h(this,null,function*(){this.helpers.currentRow&&this.helpers.currentRow._.wasChanged()||this.busy.donotWait(()=>h(this,null,function*(){return yield this.helpers.reloadData()}))})}ngOnInit(){return h(this,null,function*(){let n=yield P.getAsync();this.helpers.columns.numOfColumnsInGrid=this.numOfColsInGrid,new Za(this.helpers).load("helpers")})}};ci.route={path:"helpers",component:ci,canActivate:[Re]},ci.\u0275fac=function(e){return new(e||ci)(b(z),b(we),b(P))},ci.\u0275cmp=O({type:ci,selectors:[["app-helpers"]],decls:12,vars:6,consts:[[1,"full-page"],[2,"display","flex","justify-content","space-between"],["matInput","",3,"ngModelChange","input","ngModel","placeholder","ngModelOptions"],["matSuffix","",3,"click"],["mat-flat-button","","color","primary",1,"primary",3,"click"],[1,"grow-item",3,"settings"]],template:function(e,i){e&1&&(c(0,"div",0)(1,"div",1)(2,"div")(3,"mat-form-field")(4,"input",2),W("ngModelChange",function(o){return $(i.searchString,o)||(i.searchString=o),o}),D("input",function(){return i.doSearch()}),l(),c(5,"mat-icon",3),D("click",function(){return i.clearSearch()}),d(6,"clear"),l()(),k(7,"br"),l(),c(8,"div")(9,"button",4),D("click",function(){return i.quickAdd()}),d(10),l()()(),k(11,"data-grid",5),l()),e&2&&(a(4),re("placeholder",i.settings.lang.searchVolunteer),L("ngModel",i.searchString),f("ngModelOptions",Si(5,Xs)),a(6),w(" ",i.settings.lang.addVolunteer," "),a(),f("settings",i.helpers))},dependencies:[Me,de,pe,lt,ii,Q,ve,ct,Tt]});var xi=ci;S([A.string(),_("design:type",String)],xi.prototype,"city",void 0);function el(r,n){if(r&1&&k(0,"data-area",4),r&2){let e=p();f("settings",e.area)}}function tl(r,n){if(r&1){let e=M();c(0,"button",2),D("click",function(){C(e);let t=p();return x(t.signout())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.exit," ")}}var nn=(()=>{let n=class n{constructor(i,t,o,s,m){this.dialog=i,this.auth=t,this.sessionManager=o,this.settings=s,this.helper=m,this.confirmPassword=new It({caption:this.settings.lang.confirmPassword,inputType:"password",defaultValue:()=>G.emptyPassword})}ngAfterViewInit(){}ngOnInit(){return h(this,null,function*(){this.h=yield g.context.getCurrentUser(),yield this.h._.reload(),this.h.password||(this.confirmPassword.value=""),this.area=new ne({fields:()=>[this.h.$.name,this.h.$.phone,this.h.$.email,{field:this.h.$.preferredDistributionAreaAddress},{field:this.h.$.preferredFinishAddress},{field:this.h.$.eventComment,visible:()=>this.settings.volunteerCanUpdateComment},this.h.$.password,{field:this.confirmPassword}]})})}register(){return h(this,null,function*(){try{this.h.password!=this.confirmPassword.value?this.dialog.Error(this.settings.lang.passwordDoesntMatchConfirmPassword):(yield this.h.save(),this.dialog.Info(this.settings.lang.updateSaved),this.confirmPassword.value=this.h.password?G.emptyPassword:"",this.helper.navigateToComponent((yield import("./chunk-K3SWX4M4.js")).MyFamiliesComponent))}catch{}})}signout(){this.sessionManager.signout()}};n.route={path:"update-info",component:n,canActivate:[En]},n.\u0275fac=function(t){return new(t||n)(b(z),b(_t),b(_t),b(P),b(Rt))},n.\u0275cmp=O({type:n,selectors:[["app-update-info"]],decls:6,vars:3,consts:[[3,"settings",4,"ngIf"],[2,"display","flex","justify-content","space-between"],["mat-raised-button","","color","accent",3,"click"],["mat-raised-button","","color","accent",3,"click",4,"ngIf"],[3,"settings"]],template:function(t,o){t&1&&(c(0,"mat-card"),v(1,el,1,1,"data-area",0),c(2,"div",1)(3,"button",2),D("click",function(){return o.register()}),d(4),l(),v(5,tl,2,1,"button",3),l()()),t&2&&(a(),f("ngIf",o.area),a(3),w(" ",o.settings.lang.updateInfo," "),a(),f("ngIf",o.settings.isSytemForMlt))},dependencies:[q,Q,xe,Ce]});let r=n;return r})();_t.UpdateInfoComponent=nn;var ar,Di=ar=class extends gn{static getAsync(){return h(this,null,function*(){return g.repo(ar).findFirst(void 0)})}};S([A.integer(),_("design:type",Number)],Di.prototype,"id",void 0);S([A.string({caption:"\u05D0\u05D9\u05E7\u05D5\u05DF \u05D3\u05E3 base64"}),_("design:type",String)],Di.prototype,"base64Icon",void 0);S([A.string({caption:"\u05D0\u05D9\u05E7\u05D5\u05DF \u05D3\u05E3 \u05D4\u05D1\u05D9\u05EA \u05D1\u05D8\u05DC\u05E4\u05D5\u05DF base64"}),_("design:type",String)],Di.prototype,"base64PhoneHomeImage",void 0);Di=ar=S([_n("ApplicationImages",{allowApiRead:V.admin,allowApiUp
5date:V.admin})],Di);var Ni=(()=>{let n=class n{constructor(i){this.http=i}init(){return h(this,null,function*(){this.instance=yield P.getAsync(),fa(kt.getValidSchemaFromContext(),this.instance),Jr.forWho=()=>this.instance.forWho,B.usingSelfPickupModule=this.instance.usingSelfPickupModule,(yield import("./chunk-QMY3D56I.js")).Helpers.usingCompanyModule=this.instance.showCompanies,qe.assignerOrOrg.name=this.instance.lang.assignerOrOrg,qe.familyHelpPhone.name=this.instance.lang.familyHelpPhone,qe.familySource.name=this.instance.lang.familySourcePhone,qe.otherPhone.name=this.instance.lang.otherPhone,Ht.displayAsError.caption=this.instance.lang.RemovedFromListExcelImportStrategy_displayAsError,Ht.showInUpdate.caption=this.instance.lang.RemovedFromListExcelImportStrategy_showInUpdate,Ht.ignore.caption=this.instance.lang.RemovedFromListExcelImportStrategy_ignore,this.instance.updateStaticTexts()})}};n.\u0275fac=function(t){return new(t||n)(Ui(fn))},n.\u0275prov=jt({token:n,factory:n.\u0275fac});let r=n;return r})();var Xn=(()=>{let n=class n{constructor(){}ngOnInit(){}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=O({type:n,selectors:[["app-button-data"]],decls:2,vars:1,consts:[["mat-raised-button","",3,"click"]],template:function(t,o){t&1&&(c(0,"button",0),D("click",function(){return o.args.settings.click(void 0,void 0)}),d(1),l()),t&2&&(a(),w(" ",o.args.settings.caption,`
6`))},dependencies:[Q]});let r=n;return r})();function rl(r,n){if(r&1){let e=M();c(0,"button",5),D("click",function(){C(e);let t=p(2);return x(t.showGeneralListing())}),d(1),l()}if(r&2){let e=p(2);a(),w(" ",e.settings.lang.show," ")}}function al(r,n){if(r&1&&(c(0,"li"),d(1),l()),r&2){let e=p(2);a(),w(" !\u05DE\u05E9\u05E4\u05D7\u05D4! - ",e.settings.lang.replacedByFamilyName," ")}}function sl(r,n){if(r&1&&(c(0,"li"),d(1),l()),r&2){let e=p(2);a(),w(" !\u05EA\u05D5\u05E8\u05DD! - ",e.settings.lang.replacedByFamilyName," ")}}function ll(r,n){if(r&1){let e=M();c(0,"mat-card")(1,"mat-card-title"),d(2),l(),d(3),c(4,"textarea",13),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.settings.registerFamilyReplyEmailText,t)||(o.settings.registerFamilyReplyEmailText=t),x(t)}),l(),c(5,"h4"),d(6),l(),k(7,"pre",22),l()}if(r&2){let e=p(2);a(2),w(" ",e.settings.$.registerFamilyReplyEmailText.metadata.caption," "),a(),w(" ",e.settings.lang.registerFamilyReplyEmailText," "),a(),L("ngModel",e.settings.registerFamilyReplyEmailText),a(2),T(e.settings.lang.sampleMessage),a(),f("innerHTML",e.testEmailDonor(),So)}}function cl(r,n){if(r&1){let e=M();c(0,"mat-card")(1,"mat-card-title"),d(2),l(),d(3),c(4,"textarea",13),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.settings.registerHelperReplyEmailText,t)||(o.settings.registerHelperReplyEmailText=t),x(t)}),l(),c(5,"h4"),d(6),l(),k(7,"pre",22),l()}if(r&2){let e=p(2);a(2),w(" ",e.settings.$.registerHelperReplyEmailText.metadata.caption," "),a(),w(" ",e.settings.lang.registerHelperReplyEmailText," "),a(),L("ngModel",e.settings.registerHelperReplyEmailText),a(2),T(e.settings.lang.sampleMessage),a(),f("innerHTML",e.testEmailHelper(),So)}}function ml(r,n){if(r&1){let e=M();c(0,"mat-card")(1,"mat-card-title"),d(2," \u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05DE\u05D9\u05D9\u05DC "),l(),k(3,"data-area",7),c(4,"button",5),D("click",function(){C(e);let t=p(2);return x(t.sendTestEmail())}),d(5," \u05E9\u05DC\u05D7 \u05DE\u05D9\u05D9\u05DC \u05E0\u05E1\u05D9\u05D5\u05DF "),l()()}if(r&2){let e=p(2);a(3),f("settings",e.emailConfiguration)}}function dl(r,n){if(r&1&&k(0,"data-control",23),r&2){let e=p(2);f("field",e.settings.$.sendSuccessMessageToFamily)}}function pl(r,n){if(r&1){let e=M();c(0,"button",16),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.moveQuestion(t,-1))}),c(1,"mat-icon"),d(2,"arrow_drop_up"),l()()}}function ul(r,n){if(r&1){let e=M();c(0,"button",16),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.moveQuestion(t,1))}),c(1,"mat-icon"),d(2,"arrow_drop_down"),l()()}}function hl(r,n){if(r&1){let e=M();c(0,"tr",24)(1,"td",25),d(2),l(),c(3,"td",26)(4,"mat-form-field",27)(5,"mat-label"),d(6),l(),c(7,"input",28),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.question,t)||(o.question=t),x(t)}),l()(),c(8,"mat-form-field",27)(9,"mat-label"),d(10),l(),c(11,"textarea",29),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.answer,t)||(o.answer=t),x(t)}),l()()(),c(12,"td")(13,"button",16),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.deleteQuestion(t))}),c(14,"mat-icon"),d(15,"delete"),l()()(),c(16,"td"),v(17,pl,3,0,"button",30),l(),c(18,"td"),v(19,ul,3,0,"button",30),l()()}if(r&2){let e=n.$implicit,i=n.index,t=p(2);a(2),w("",i+1,"."),a(4),T(t.settings.lang.question),a(),L("ngModel",e.question),a(3),T(t.settings.lang.answer),a(),L("ngModel",e.answer),a(6),f("ngIf",i>0),a(2),f("ngIf",i<t.qaItems.length-1)}}
6function fl(r,n){if(r&1&&(c(0,"option",35),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function gl(r,n){if(r&1){let e=M();c(0,"input",36),W("ngModelChange",function(t){C(e);let o=p().$implicit;return $(o.name,t)||(o.name=t),x(t)}),l()}if(r&2){let e=p().$implicit,i=p(2);re("placeholder",i.settings.lang.volunteerName),L("ngModel",e.name)}}function _l(r,n){if(r&1){let e=M();c(0,"input",37),W("ngModelChange",function(t){C(e);let o=p().$implicit;return $(o.phone,t)||(o.phone=t),x(t)}),l()}if(r&2){let e=p().$implicit,i=p(2);re("placeholder",i.settings.lang.phone),L("ngModel",e.phone)}}function yl(r,n){if(r&1){let e=M();c(0,"button",16),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.move(t,-1))}),c(1,"mat-icon"),d(2,"arrow_drop_up"),l()()}}function vl(r,n){if(r&1){let e=M();c(0,"button",16),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.move(t,1))}),c(1,"mat-icon"),d(2,"arrow_drop_down"),l()()}}function wl(r,n){if(r&1){let e=M();c(0,"tr",24)(1,"td",31),d(2),l(),c(3,"td",26)(4,"select",11),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.option,t)||(o.option=t),x(t)}),v(5,fl,2,2,"option",32),l(),v(6,gl,1,2,"input",33)(7,_l,1,2,"input",34),l(),c(8,"td")(9,"button",16),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.delete(t))}),c(10,"mat-icon"),d(11,"delete"),l()()(),c(12,"td"),v(13,yl,3,0,"button",30),l(),c(14,"td"),v(15,vl,3,0,"button",30),l()()}if(r&2){let e=n.$implicit,i=n.index,t=p(2);a(2),w(" ",i+1,". "),a(2),L("ngModel",e.option),a(),f("ngForOf",t.phoneOptions),a(),f("ngIf",t.showNameAndPhone(e)),a(),f("ngIf",t.showNameAndPhone(e)),a(6),f("ngIf",i>0),a(2),f("ngIf",i<t.helpPhones.length-1)}}function Cl(r,n){if(r&1&&k(0,"img",38),r&2){let e=p(2);f("src",e.getIcon(),Ke)}}function xl(r,n){if(r&1&&k(0,"img",38),r&2){let e=p(2);f("src",e.getLogo(),Ke)}}function Dl(r,n){if(r&1){let e=M();c(0,"mat-expansion-panel")(1,"mat-expansion-panel-header"),d(2," superadmin "),l(),k(3,"data-area",7),c(4,"button",5),D("click",function(){C(e);let t=p(2);return x(t.forNoam())}),d(5,"debug noam"),l()()}if(r&2){let e=p(2);a(3),f("settings",e.superAdmin)}}function bl(r,n){if(r&1){let e=M();c(0,"mat-accordion",6)(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"mat-panel-title"),d(4),l()(),k(5,"data-area",7),v(6,rl,2,1,"button",8),c(7,"mat-card")(8,"mat-card-title"),d(9),l(),d(10),k(11,"br")(12,"data-area",7),l()(),c(13,"mat-expansion-panel")(14,"mat-expansion-panel-header")(15,"mat-panel-title"),d(16),l()(),k(17,"data-grid",9),l(),c(18,"mat-expansion-panel")(19,"mat-expansion-panel-header")(20,"mat-panel-title"),d(21),l()(),k(22,"data-grid",9),l(),c(23,"mat-expansion-panel")(24,"mat-expansion-panel-header")(25,"mat-panel-title"),d(26),l()(),k(27,"data-grid",9),l(),c(28,"mat-expansion-panel")(29,"mat-expansion-panel-header")(30,"mat-panel-title"),d(31),l()(),d(32),k(33,"data-grid",9),l(),c(34,"mat-expansion-panel")(35,"mat-expansion-panel-header")(36,"mat-panel-title"),d(37),l()(),c(38,"mat-card")(39,"mat-card-title"),d(40),l(),d(41),c(42,"ul")(43,"li"),d(44),l(),v(45,al,2,1,"li",10)(46,sl,2,1,"li",10),c(47,"li"),d(48),l(),c(49,"li"),d(50),l(),c(51,"li"),d(52),l()(),c(53,"textarea",11),W("ngModelChange",function(t){C(e);let o=p();return $(o.settings.smsText,t)||(o.settings.smsText=t),x(t)}),l(),c(54,"H4"),d(55),l(),c(56,"pre"),d(57),l()(),k(58,"data-area",7),c(59,"button",12),D("click",function(){C(e);let t=p();return x(t.saveAndPreview())}),d(60),l(),k(61,"data-area",7),c(62,"mat-card")(63,"mat-card-title"),d(64),l(),d(65),c(66,"textarea",13),W("ngModelChange",function(t){C(e);let o=p();return $(o.settings.reminderSmsText,t)||(o.settings.reminderSmsText=t),x(t)}),l(),c(67,"h4"),d(68),l(),c(69,"pre"),d(70),l()(),v(71,ll,8,5,"mat-card",10)(72,cl,8,5,"mat-card",10)(73,ml,6,1,"mat-card",10),c(74,"mat-card")(75,"mat-card-title"),d(76," \u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05D5\u05D3\u05E2\u05EA \u05D5\u05D5\u05D8\u05E1\u05D0\u05E4 \u05DE\u05DE\u05EA\u05E0\u05D3\u05D1 \u05DC\u05DE\u05E9\u05E4\u05D7\u05D4 "),l(),v(77,dl,1,1,"data-control",14),X(78),d(79," \u
605D4\u05D5\u05D3\u05E2\u05D4 \u05D6\u05D5 \u05EA\u05D5\u05E4\u05D9\u05E2 \u05DB\u05D0\u05E9\u05E8 \u05D4\u05DE\u05EA\u05E0\u05D3\u05D1 \u05DC\u05D5\u05D7\u05E5 \u05E2\u05DC \u05E6\u05DC\u05DE\u05D9\u05EA \u05D4\u05D5\u05D5\u05D8\u05E1\u05D0\u05E4 \u05DC\u05E6\u05D3 \u05D4\u05D8\u05DC\u05E4\u05D5\u05DF \u05E9\u05DC \u05D4\u05DE\u05E9\u05E4\u05D7\u05D4 "),c(80,"ul")(81,"li"),d(82,"!\u05DE\u05E9\u05E4\u05D7\u05D4! \u05D9\u05D5\u05D7\u05DC\u05E3 \u05D1\u05E9\u05DD \u05D4\u05DE\u05E9\u05E4\u05D7\u05D4"),l()(),c(83,"textarea",13),W("ngModelChange",function(t){C(e);let o=p();return $(o.settings.successMessageText,t)||(o.settings.successMessageText=t),x(t)}),l(),c(84,"h4"),d(85,"\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05D3\u05D5\u05D2\u05DE\u05D0"),l(),c(86,"pre"),d(87),l(),ee(),l()(),c(88,"mat-expansion-panel")(89,"mat-expansion-panel-header")(90,"mat-panel-title"),d(91),l()(),d(92),c(93,"table"),v(94,hl,20,7,"tr",15),l(),c(95,"button",16),D("click",function(){C(e);let t=p();return x(t.addQuestion())}),c(96,"mat-icon"),d(97,"add"),l()()(),c(98,"mat-expansion-panel")(99,"mat-expansion-panel-header")(100,"mat-panel-title"),d(101),l()(),d(102),k(103,"br"),d(104),c(105,"table"),v(106,wl,16,7,"tr",15),l(),c(107,"button",16),D("click",function(){C(e);let t=p();return x(t.addPhoneOption())}),c(108,"mat-icon"),d(109,"add"),l()()(),c(110,"mat-expansion-panel")(111,"mat-expansion-panel-header")(112,"mat-panel-title"),d(113),l()(),k(114,"data-area",7),c(115,"button",5),D("click",function(){C(e);let t=p();return x(t.resetToDefault())}),d(116),l(),c(117,"button",5),D("click",function(){C(e);let t=p();return x(t.configureSmsGlobal())}),d(118),l()(),c(119,"mat-expansion-panel")(120,"mat-expansion-panel-header")(121,"mat-panel-title"),d(122),l()(),k(123,"data-area",7),d(124),c(125,"a",17),d(126,"Favicon generator"),l(),d(127),c(128,"mat-card")(129,"mat-card-title"),d(130),l(),k(131,"br"),c(132,"input",18),D("change",function(){C(e);let t=p();return x(t.onFileChange("icon",t.images.currentRow.$.base64Icon))}),l(),k(133,"br"),v(134,Cl,1,1,"img",19),l(),k(135,"br")(136,"br"),c(137,"mat-card")(138,"mat-card-title"),d(139),l(),k(140,"br"),c(141,"input",20),D("change",function(t){C(e);let o=p();return x(o.onFileInput(t))}),l(),k(142,"br"),v(143,xl,1,1,"img",19),k(144,"br"),l()(),c(145,"mat-expansion-panel")(146,"mat-expansion-panel-header"),d(147),l(),d(148),k(149,"br")(150,"br"),c(151,"button",21),D("click",function(){C(e);let t=p();return x(t.deleteFamilies())}),d(152),l()(),v(153,Dl,6,1,"mat-expansion-panel",10),l()}if(r&2){let e=p();a(4),be(" ",e.settings.lang.organizationInfo," - ",e.settings.organisationName," "),a(),f("settings",e.settingsArea),a(),f("ngIf",e.hasGeneralListing()),a(3),w(" ",e.settings.lang.defaultHelpPhone," "),a(),w(" ",e.settings.lang.defaulyHelpPhoneExplanation," "),a(2),f("settings",e.settingsMore),a(4),w(" ",e.settings.lang.basketTypes," "),a(),f("settings",e.basketType),a(4),w(" ",e.settings.lang.distributionLists," "),a(),f("settings",e.distributionCenters),a(4),w(" ",e.settings.lang.familySources," "),a(),f("settings",e.sources),a(4),w(" ",e.settings.lang.familyGroups," "),a(),w(" ",e.settings.lang.distributionListsHelp," "),a(),f("settings",e.groups),a(4),w(" ",e.settings.lang.volunteerTexts," "),a(3),w(" ",e.settings.$.smsText.metadata.caption," "),a(),w(" ",e.settings.lang.smsTextHelpTitle," "),a(3),w("!\u05DE\u05EA\u05E0\u05D3\u05D1! - ",e.settings.lang.replacedByVolunteerName,""),a(),f("ngIf",e.settings.isSytemForMlt),a(),f("ngIf",e.settings.isSytemForMlt),a(2),w("!\u05E9\u05D5\u05DC\u05D7! - ",e.settings.lang.replcaedBySenderName,""),a(2),w("!\u05D0\u05E8\u05D2\u05D5\u05DF! - ",e.settings.lang.replacedByOrgName,""),a(2),w("!\u05D0\u05EA\u05E8! - ",e.settings.lang.replaceBySiteUrl,""),a(),L("ngModel",e.settings.smsText),a(2),T(e.settings.lang.sampleMessage),a(2),T(e.testSms()),a(),f("settings",e.settingsMessages),a(2),w(" ",e.settings.lang.saveAndPreview," "),a(),f("settings",e.settings2Messages),a(3),w(" ",e.settings.$.reminderSmsText.metadata.caption," "),a(),w(" ",e.settings.lang.reminderSmsTextHelp," "),a(),L("ngModel",e.settings.reminderSmsText),a(2),T(e.settings.lang.sampleReminderSms),a(2),T(e.testSmsReminder()),a(),f("ngIf",e.settings.isSytemForMlt),a(),f("ngIf",e.settings.isSytemForMlt),a(),f("ngIf",e.settings.isSytemForMlt||e.settings.familySelfOrderEnabled),a(4),f("ngIf",e.settings.allowSendSuccessMessageOption&&e.settings.helpPhone),a(6),L("ngModel",e.settings.successMessageText),a(4),T(e.testSuccessSms()),a(4),w(" ",e.settings.lang.volunteerQAndA," "),a(),w(" ",e.settings.lang.volunteerQAndAHelp," "),a(2),f("ngForOf",e.qaItems),a(7),w(" ",e.settings.lang.voluntreeHelpPhones," "),a(),w(" ",e.settings.lang.volunteerHelpPhonesHelpLine1," "),a(2),w(" ",e.settings.lang.volunteerHelpPhonesHelpLine2," "),a(2),f("ngForOf",e.helpPhones),a(7),w(" ",e.settings.lang.preferences," "),a(),f("settings",e.prefereces),a(2),w(" ",e.settings.lang.resetTextsToLanguageDefaults," "),a(2),w(" ",e.settings.lang.smsProviderConfiguration," "),a(4),w(" ",e.settings.lang.logoAndIcons," "),a(),f("settings",e.settingsLogo),a(),w(" ",e.settings.lang.logoRecommendTool," "),a(3),w(" ",e.settings.lang.logoRecommendAfter," "),a(3),w("",e.settings.lang.iconForWebSite," (favicon.ico)"),a(4),f("ngIf",e.images.currentRow),a(5),w(" ",e.settings.lang.logoForWebsiteAndPhone," - (apple-icon-120x120.png)"),a(4),f("ngIf",e.images.currentRow),a(4),w(" ",e.settings.lang.deleteFamilies," "),a(),w(" ",e.settings.lang.deleteFamiliesHelp," "),a(4),w(" ",e.settings.lang.deleteFamiliesButton," "),a(),f("ngIf",e.isSuperAdmin())}}var eo=(()=>{let n=class n{wasChange(){return this.settings&&this.images.currentRow&&(this.settings._.wasChanged()||this.images.currentRow._.wasChanged()||this.settings.$.phoneStrategy.originalValue!=this.serializePhones()||this.settings.$.commonQuestions.originalValue!=this.serializeQa())}save(){return h(this,null,function*(){this.settings.phoneStrategy=this.serializePhones(),this.settings.commonQuestions=this.serializeQa();try{yield this.settings.save(),g.clearAllCache(),this.dialog.refreshFamiliesAndDistributionCenters(),yield this.settingService.init()}catch{let t="\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05E9\u05DE\u05D9\u05E8\u05D4: ";for(let o of this.settings.$)o.error&&(t+=o.metadata.caption+" - "+o.error+" ");this.dialog.Error(t)}this.images.currentRow.save()})}reset(){this.settings._.undoChanges(),this.images.currentRow._.undoChanges(),this.helpPhones=this.settings.getPhoneStrategy(),this.qaItems=this.settings.getQuestions()}constructor(i,t,o,s,m){this.dialog=i,this.sanitization=t,this.settings=o,this.busy=s,this.settingService=m,this.basketType=new Ee(g.repo(Ie),{columnSettings:u=>[u.name,{field:u.boxes,width:"100px"},{field:u.boxes2,width:"100px"},{field:u.whatToTake},{field:u.intakeCommentInstructions}],saving:()=>this.refreshEnvironmentAfterSave(),rowsInPage:25,orderBy:{name:"asc"},newRow:u=>u.boxes=1,allowUpdate:!0,allowInsert:!0,allowDelete:!1,confirmDelete:u=>this.dialog.confirmDelete(u.name)}
6),this.showArchivedDistributionCenters=!1,this.distributionCenters=new Ee(g.repo(ye),{gridButtons:[{name:this.settings.lang.showDeletedDistributionCenters,click:()=>{this.showArchivedDistributionCenters=!this.showArchivedDistributionCenters,this.distributionCenters.reloadData()}},{name:this.settings.lang.exportToExcel,click:()=>h(this,null,function*(){yield yi(this.settings,g.repo(ye),this.distributionCenters,this.settings.lang.distributionLists,this.dialog,(u,y)=>y==u.$.id)}),visible:()=>g.isAllowed(V.admin)}],rowCssClass:u=>u.archive?"deliveredProblem":u.isFrozen?"forzen":"",rowButtons:[{name:this.settings.lang.distributionCenterDetails,click:u=>h(this,null,function*(){K(At,y=>y.args={title:u.name,ok:()=>h(this,null,function*(){return yield u.save()}),fields:[u.$.name,u.$.address,{caption:this.settings.lang.addressByGoogle,getValue:()=>u.addressHelper.getGeocodeInformation.getAddress()},u.$.comments,[u.$.phone1,u.$.phone1Description],[u.$.phone2,u.$.phone2Description],u.$.isFrozen,u.$.semel]})})},{textInMenu:u=>u.archive?this.settings.lang.unDeleteDistributionCenter:this.settings.lang.deleteDistributionCenter,icon:"delete",click:u=>h(this,null,function*(){if(!u.archive&&(yield g.repo(ye).count({$and:[ye.isActive],id:{"!=":u.id}}))==0){this.dialog.Error(this.settings.lang.mustHaveAtLeastOneActiveDistributionList);return}u.archive=!u.archive,yield u.save(),this.refreshEnvironmentAfterSave()})}],columnSettings:u=>[u.name,{field:u.address},{caption:this.settings.lang.addressByGoogle,getValue:y=>y.addressHelper.getGeocodeInformation.getAddress()},u.comments,u.isFrozen,u.phone1,u.phone1Description,u.phone2,u.phone2Description,{field:u.semel,width:"100px"}],rowsInPage:25,where:()=>({archive:this.showArchivedDistributionCenters?void 0:!1}),orderBy:{name:"asc"},saving:u=>{this.refreshEnvironmentAfterSave()},numOfColumnsInGrid:this.settings.isSytemForMlt?7:4,allowUpdate:!0,allowInsert:!0,confirmDelete:u=>this.dialog.confirmDelete(u.name)}),this.sources=new Ee(g.repo(Bt),{columnSettings:u=>[u.name,u.phone,u.contactPerson],allowUpdate:!0,allowInsert:!0,allowDelete:!0,rowsInPage:25,orderBy:{name:"asc"},confirmDelete:u=>this.dialog.confirmDelete(u.name)}),this.groups=new Ee(g.repo(ki),{saving:()=>this.refreshEnvironmentAfterSave(),columnSettings:u=>[u.name],allowUpdate:!0,allowInsert:!0,allowDelete:!0,rowsInPage:25,orderBy:{name:"asc"},confirmDelete:u=>this.dialog.confirmDelete(u.name)}),this.settingsArea=new ne({fields:()=>[this.settings.$.organisationName,this.settings.$.address,{caption:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05DB\u05E4\u05D9 \u05E9\u05D2\u05D5\u05D2\u05DC \u05D4\u05D1\u05D9\u05DF",getValue:u=>this.settings.addressHelper.getGeocodeInformation.getAddress()},this.settings.$.volunteerNeedStatus,{visible:()=>this.hasGeneralListing(),field:this.settings.$.descriptionInOrganizationList},{visible:()=>this.hasGeneralListing(),field:this.settings.$.phoneInOrganizationList}]}),this.settingsMore=new ne({fields:u=>[this.settings.$.helpText,this.settings.$.helpPhone]}),this.settingsLogo=new ne({fields:u=>[this.settings.$.logoUrl]}),this.superAdmin=new ne({fields:u=>[this.settings.$.customSmsOriginForSmsToVolunteer,{caption:"test sms to volunteer",click:()=>{this.testSmsMessage()},customComponent:{component:Xn}},this.settings.$.allowSmsToFamily,this.settings.$.sendOnTheWaySMSToFamily,{field:this.settings.$.sendOnTheWaySMSToFamilyOnSendSmsToVolunteer,visible:()=>this.settings.sendOnTheWaySMSToFamily},{field:this.settings.$.customSmsOriginForSmsToFamily,visible:()=>this.settings.sendOnTheWaySMSToFamily||this.settings.allowSmsToFamily},{caption:"test sms to family",click:()=>{this.testSmsMessage(!0)},customComponent:{component:Xn}},{caption:"\u05D0\u05E4\u05E9\u05E8 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05DC\u05DE\u05E9\u05E4\u05D7\u05D4 \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 \u05E4\u05E8\u05D8\u05D9\u05DD",field:this.settings.$.familyConfirmDetailsEnabled},{field:this.settings.$.enableOtp}]}),this.settingsMessages=new ne({fields:u=>[this.settings.$.message1Text,this.settings.$.message1Link,this.settings.$.message1OnlyWhenDone,this.settings.$.message2Text,this.settings.$.message2Link,this.settings.$.message2OnlyWhenDone,this.settings.$.hideVolunteerVideo,this.settings.$.showDistCenterAsEndAddressForVolunteer,this.settings.$.volunteerCanUpdateDeliveryComment,this.settings.$.deliveredButtonText,this.settings.$.commentForSuccessDelivery,this.settings.$.showLeftThereButton,this.settings.$.commentForSuccessLeft,this.settings.$.problemButtonText,this.settings.$.commentForProblem,[this.settings.$.questionForVolunteer1Caption,this.settings.$.questionForVolunteer1Values],[this.settings.$.questionForVolunteer2Caption,this.settings.$.questionForVolunteer2Values],[this.settings.$.questionForVolunteer3Caption,this.settings.$.questionForVolunteer3Values],[this.settings.$.questionForVolunteer4Caption,this.settings.$.questionForVolunteer4Values],this.settings.$.askVolunteerForLocationOnDelivery,this.settings.$.askVolunteerForAPhotoToHelp,this.settings.$.questionForVolunteerWhenUploadingPhoto]}),this.settings2Messages=new ne({fields:u=>[this.settings.$.messageForDoneDelivery,this.settings.$.AddressProblemStatusText,this.settings.$.NotHomeProblemStatusText,this.settings.$.DoNotWantProblemStatusText,this.settings.$.OtherProblemStatusText,{caption:F.language.smsMessageToFamilyWhenVolunteerOnTheWay,visible:()=>this.settings.sendOnTheWaySMSToFamily,click:()=>h(this,null,function*(){let y=la(yield g.repo(ae).findFirst()),E=yield y.fetchTemplateRow();K(Qn,I=>I.args={message:y,templateText:E.template,helpText:"",title:F.language.smsMessageToFamilyWhenVolunteerOnTheWay,buttons:[{name:F.language.save,click:()=>h(this,null,function*(){E.template=I.args.templateText,yield E.save(),I.ref.close()})}]})}),customComponent:{component:Xn}}]}),this.emailConfiguration=new ne({fields:()=>[this.settings.$.gmailUserName,this.settings.$.gmailPassword]}),this.prefereces=new ne({fields:u=>{let y=[this.settings.$.requireEULA,this.settings.$.requireConfidentialityApprove,this.settings.$.requireComplexPassword,this.settings.$.daysToForcePasswordChange,this.settings.$.timeToDisconnect,this.settings.$.hideFamilyPhoneFromVolunteer,this.settings.$.showOnlyLastNamePartToVolunteer,this.settings.$.showTzToVolunteer,this.settings.$.defaultStatusType,this.settings.$.usingSelfPickupModule,this.settings.$.usingCallModule,{field:this.settings.$.defaultDeliveryStatusIsEnquireDetails,visible:()=>this.settings.usingCallModule},this.settings.$.volunteerCanUpdateComment,this.settings.$.allowVolunteerToSeePreviousActivities,this.settings.$.showDeliverySummaryToVolunteerOnFirstSignIn,this.settings.$.boxes1Name,this.settings.$.boxes2Name,this.settings.$.showCompanies,this.settings.$.showHelperComment,this.settings.$.routeStrategy,this.settings.$.defaultPrefixForExcelImport,this.settings.$.emailForV
6olunteerRegistrationNotification,this.settings.$.redTitleBar,this.settings.$.manageEscorts,[this.settings.$.familyCustom1Caption,this.settings.$.familyCustom1Values],[this.settings.$.familyCustom2Caption,this.settings.$.familyCustom2Values],[this.settings.$.familyCustom3Caption,this.settings.$.familyCustom3Values],[this.settings.$.familyCustom4Caption,this.settings.$.familyCustom4Values],this.settings.$.forWho,this.settings.$.webhookUrl];return this.settings.isSytemForMlt&&y.push(this.settings.$.BusyHelperAllowedFreq_nom,this.settings.$.BusyHelperAllowedFreq_denom,this.settings.$.MaxItemsQuantityInDeliveryThatAnIndependentVolunteerCanSee,this.settings.$.MaxDeliverisQuantityThatAnIndependentVolunteerCanAssignHimself),y}}),this.images=new Ee(g.repo(Di),{numOfColumnsInGrid:0,allowUpdate:!0,columnSettings:u=>[u.base64Icon,u.base64PhoneHomeImage]}),this.helpPhones=[{option:qe.assignerOrOrg}],this.qaItems=[],this.phoneOptions=[qe.assignerOrOrg,qe.familyHelpPhone,qe.defaultVolunteer,qe.familySource,qe.otherPhone]}refreshEnvironmentAfterSave(){
6setTimeout(()=>{this.dialog.refreshFamiliesAndDistributionCenters()},1e3)}isSuperAdmin(){return g.isAllowed(V.superAdmin)}previewVolunteer(){return h(this,null,function*(){K(Vi)})}saveAndPreview(){return h(this,null,function*(){yield this.save();let i=g.repo(se).create();K(Ga,t=>t.args={family:i,comment:i.courierComments,helpText:()=>this.settings.commentForSuccessDelivery,questionsArea:new ne({fields:()=>[i.$.a1,i.$.a2,i.$.a3,i.$.a4]}),ok:o=>h(this,null,function*(){}),cancel:()=>{}})})}sendTestEmail(){return h(this,null,function*(){var i=new It({caption:"email"});yield K(At,t=>t.args={fields:[i],title:"\u05D1\u05D3\u05D9\u05E7\u05EA \u05DE\u05D9\u05D9\u05DC",ok:()=>h(this,null,function*(){if(yield Bo.TestSendEmail(i.value,this.testEmailDonor()))this.dialog.Info("\u05E0\u05E9\u05DC\u05D7 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4");else throw"\u05DC\u05D0 \u05E0\u05E9\u05DC\u05D7"})})})}configureSmsGlobal(){K(At,i=>i.args={title:F.language.smsProviderConfiguration,fields:[this.settings.$.smsClientNumber,this.settings.$.smsUsername,this.settings.$.smsPasswordInput,this.settings.$.smsVirtualPhoneNumber],ok:()=>this.settings.save(),buttons:[{text:F.language.testSmsMessage,click:()=>h(this,null,function*(){yield this.testSmsMessage()})}]})}testSmsMessage(i=!1){return h(this,null,function*(){yield this.settings.save();var t=new ua(g);t.phone=(yield g.context.getCurrentUser()).phone.thePhone,t.message=this.testSms(),K(At,o=>o.args={fields:t.$.toArray(),title:F.language.testSmsMessage,ok:()=>h(this,null,function*(){let s=yield t.sendTestMessage(i);this.dialog.Error(s)})})})}testSms(){return ft.getMessage(this.settings.smsText,this.settings.organisationName,"\u05DE\u05E9\u05E4\u05D7\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9","\u05D9\u05E9\u05E8\u05D0\u05DC \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9",g.user.name,window.location.origin+"/x/zxcvdf")}testSmsReminder(){return ft.getMessage(this.settings.reminderSmsText,this.settings.organisationName,"\u05DE\u05E9\u05E4\u05D7\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9","\u05D9\u05E9\u05E8\u05D0\u05DC \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9",g.user.name,window.location.origin+"/x/zxcvdf")}testEmailHelper(){if(this.settings.registerHelperReplyEmailText)return ft.getMessage(this.settings.registerHelperReplyEmailText,this.settings.organisationName,"\u05DE\u05E9\u05E4\u05D7\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9","\u05D9\u05E9\u05E8\u05D0\u05DC \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9",g.user.name,window.location.origin+"/x/zxcvdf")}testEmailDonor(){if(this.settings.registerFamilyReplyEmailText)return ft.getMessage(this.settings.registerFamilyReplyEmailText,this.settings.organisationName,"\u05DE\u05E9\u05E4\u05D7\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9","\u05D9\u05E9\u05E8\u05D0\u05DC \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9",g.user.name,window.location.origin+"/x/zxcvdf")}testSuccessSms(){return ft.getSuccessMessage(this.settings.successMessageText,this.settings.organisationName,"\u05D9\u05E9\u05E8\u05D0\u05DC \u05D9\u05E9\u05E8\u05D0\u05DC\u05D9")}ngOnInit(){try{this.helpPhones=this.settings.getPhoneStrategy(),this.qaItems=this.settings.getQuestions()}catch{this.helpPhones=[]}this.images.reloadData()}addPhoneOption(){let i={option:qe.otherPhone};for(let t of this.phoneOptions)if(!this.helpPhones.find(s=>s.option==t)){i.option=t;break}this.helpPhones.push(i)}addQuestion(){let i={};this.qaItems.push(i)}showNameAndPhone(i){return i.option==qe.otherPhone}move(i,t){let o=this.helpPhones.indexOf(i);this.helpPhones.splice(o,1),this.helpPhones.splice(o+t,0,i)}moveQuestion(i,t){let o=this.qaItems.indexOf(i);this.qaItems.splice(o,1),this.qaItems.splice(o+t,0,i)}delete(i){let t=this.helpPhones.indexOf(i);this.helpPhones.splice(t,1)}deleteQuestion(i){let t=this.qaItems.indexOf(i);this.qaItems.splice(t,1)}serializePhones(){return JSON.stringify(this.helpPhones.map(i=>({name:i.name,phone:i.phone,option:i.option.key})))}serializeQa(){return JSON.stringify(this.qaItems)}getLogo(){return this.sanitization.bypassSecurityTrustResourceUrl("data:image;base64,"+this.images.currentRow.base64PhoneHomeImage)}onFileChange(i,t){let o=document.querySelector("#"+i);if(typeof FileReader<"u"){let s=new FileReader;s.onload=m=>{let u=m.target.result,y=u.indexOf(",");t.value=u.substring(y+1).trim()},s.readAsDataURL(o.files[0])}}loadFiles(i){return h(this,null,function*(){for(let t=0;t<i.length;t++){let s=i[t];yield new Promise(m=>{var u=new FileReader;u.onload=y=>h(this,null,function*(){var E=new Image,I=document.createElement("canvas");E.onload=()=>h(this,null,function*(){var j=I.getContext("2d");j.drawImage(E,0,0);var N=120,H=120,R=E.width,U=E.height;R>U?R>N&&(U*=N/R,R=N):U>H&&(R*=H/U,U=H),I.width=R,I.height=U;var j=I.getContext("2d");j.drawImage(E,0,0,R,U);var De=I.toDataURL("image/png");let he=De.indexOf(",");this.images.currentRow.base64PhoneHomeImage=De.substring(he+1).trim()}),E.src=y.target.result.toString(),m({})}
6),u.readAsDataURL(s)})}})}onFileInput(i){this.loadFiles(i.target.files)}getIcon(){return this.sanitization.bypassSecurityTrustResourceUrl("data:image;base64,"+this.images.currentRow.base64Icon)}deleteFamilies(){return h(this,null,function*(){let i=new It({caption:this.settings.lang.codeWord}),t=["\u05E0\u05D5\u05E2\u05DD","\u05D9\u05E2\u05DC","\u05E2\u05D5\u05E4\u05E8\u05D9","\u05DE\u05E2\u05D9\u05D9\u05DF","\u05D0\u05D9\u05EA\u05DE\u05E8","\u05D9\u05D5\u05E0\u05D9","\u05E0\u05D9\u05E6\u05DF","\u05D7\u05D2\u05D9","\u05E0\u05D2\u05D4"];this.settings.lang.languageCode!="iw"&&(t=["Noam","Yoni","Itamar","Maayan","Nitzan","Hagai","Noga","Ofri"]);let o=t[Math.trunc(Math.random()*t.length)],s=!1,m=yield g.repo(ae).count({status:Ge.ToDelete});if(m==0){this.dialog.messageDialog("\u05D0\u05D9\u05DF \u05DE\u05E9\u05E4\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA \u05DC\u05DE\u05D7\u05D9\u05E7\u05D4");return}if(!(yield this.dialog.YesNoPromise(this.settings.lang.areYouSureYouWantToDelete+" "+m+this.settings.lang.families+"?"))||(yield K(At,y=>{y.args={title:this.settings.lang.toConfirmPleaseTypeTheCodeWord+'"'+o+'"',fields:[i],ok:()=>s=!0,cancel:()=>s=!1}}),!s))return;if(i.value!=o){this.dialog.Error(this.settings.lang.wrongCodeWordProcessAborted);return}let u=yield Bo.deleteFamiliesOnServer();this.dialog.Info(this.settings.lang.deleted+" "+u+" "+this.settings.lang.families)})}resetToDefault(){return h(this,null,function*(){this.settings.id=1,this.settings.smsText=this.settings.lang.defaultSmsText,this.settings.reminderSmsText=this.settings.lang.reminderSmsText,this.settings.commentForSuccessDelivery=this.settings.lang.commentForSuccessDelivery,this.settings.commentForSuccessLeft=this.settings.lang.commentForSuccessLeft,this.settings.commentForProblem=this.settings.lang.commentForProblem,this.settings.messageForDoneDelivery=this.settings.lang.messageForDoneDelivery,this.settings.deliveredButtonText=this.settings.lang.deliveredButtonText,this.settings.setDefaultsForProblemStatuses(),this.settings.boxes1Name=this.settings.lang.boxes1Name,this.settings.boxes2Name=this.settings.lang.boxes2Name,this.settings.questionForVolunteerWhenUploadingPhoto=this.settings.lang.defaultQuestionForVolunteerWhenUploadingPhoto;var i=yield g.repo(Ie).findFirst();i&&(i.name=this.settings.lang.foodParcel,yield i.save(),this.basketType.reloadData());let t=yield g.repo(ye).findFirst();t&&(t.name=this.settings.lang.defaultDistributionListName,yield t.save(),this.distributionCenters.reloadData())})}changeLog(){K(qn,i=>i.args={for:this.settings})}hasGeneralListing(){return this.settings.volunteerNeedStatus?.includeInList}showGeneralListing(){K(Ln,i=>i.e=Hn.createOrgEvent({volunteerNeedStatus:this.settings.volunteerNeedStatus,addressHelper:this.settings.addressHelper,descriptionInOrganizationList:this.settings.descriptionInOrganizationList,logoUrl:this.settings.logoUrl,organisationName:this.settings.organisationName,phoneInOrganizationList:this.settings.phoneInOrganizationList?.thePhone,phoneInOrganizationListDisplay:this.settings.phoneInOrganizationList?.displayValue},""))}forNoam(){Object.assign(globalThis,{forNoam:{remult:g,repo:g.repo,families:g.repo(ae),familyDeliveries:g.repo(se),helpers:g.repo(G)}})}};n.route={path:"manage",component:n,data:{name:"\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05DE\u05E2\u05E8\u05DB\u05EA"},canActivate:[Re]},n.\u0275fac=function(t){return new(t||n)(b(z),b(Ur),b(P),b(we),b(Ni))},n.\u0275cmp=O({type:n,selectors:[["app-manage"]],decls:13,vars:5,consts:[[1,"full-page"],["mat-icon-button","",3,"click","disabled"],["color","warning"],["mat-button","",3,"click"],["style","margin-top: 10px","class","grow-item",4,"ngIf"],["mat-raised-button","",3,"click"],[1,"grow-item",2,"margin-top","10px"],[3,"settings"],["mat-raised-button","",3,"click",4,"ngIf"],["height","300",3,"settings"],[4,"ngIf"],[1,"form-control",3,"ngModelChange","ngModel"],["mat-raised-button","","color","primary",2,"left","0px","margin-bottom","5px",3,"click"],["lines","3",1,"form-control",3,"ngModelChange","ngModel"],[3,"field",4,"ngIf"],["style",`
7            border-bottom: solid;
8            border-bottom-width: thin;
9            border-bottom-color: lightgray;
10          `,4,"ngFor","ngForOf"],["mat-icon-button","",3,"click"],["href","https://www.favicon-generator.org/","target","_blank"],["type","file","id","icon",3,"change"],[3,"src",4,"ngIf"],["type","file","id","logo",3,"change"],["mat-raised-button","","color","accent",3,"click"],[3,"innerHTML"],[3,"field"],[2,"border-bottom","solid","border-bottom-width","thin","border-bottom-color","lightgray"],[2,"vertical-align","top","padding","9px"],[2,"padding-bottom","9px","padding-top","9px"],["appearance","outline",1,"full-width-form-field","dense-form-field"],["matInput","",3,"ngModelChange","ngModel"],["matInput","",2,"height","50px",3,"ngModelChange","ngModel"],["mat-icon-button","",3,"click",4,"ngIf"],[2,"vertical-align","top","padding","9px","padding-top","18px"],[3,"ngValue",4,"ngFor","ngForOf"],["class","form-control",3,"ngModel","placeholder","ngModelChange",4,"ngIf"],["input","tel","class","form-control",3,"ngModel","placeholder","ngModelChange",4,"ngIf"],[3,"ngValue"],[1,"form-control",3,"ngModelChange","ngModel","placeholder"],["input","tel",1,"form-control",3,"ngModelChange","ngModel","placeholder"],[3,"src"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"div")(2,"button",1),D("click",function(){return o.save()}),c(3,"mat-icon"),d(4,"check"),l()(),c(5,"button",1),D("click",function(){return o.reset()}),c(6,"mat-icon",2),d(7,"clear"),l()(),c(8,"button",3),D("click",function(){return o.previewVolunteer()}),d(9),l()(),v(10,bl,154,65,"mat-accordion",4),c(11,"button",5),D("click",function(){return o.changeLog()}),d(12),l()()),t&2&&(a(2),f("disabled",!o.wasChange()),a(3),f("disabled",!o.wasChange()),a(4),w(" ",o.settings.lang.previewVolunteerScreen," "),a(),f("ngIf",o.settings),a(2),w(" ",o.settings.lang.changeLog," "))},dependencies:[me,q,ei,ti,Me,Xt,de,pe,lt,Mi,Q,Ye,xe,Fi,Un,jn,zn,es,ve,ct,bn,Tt,Ce],styles:[`textarea[_ngcontent-%COMP%]{height:100px}pre[_ngcontent-%COMP%]{word-wrap:break-word;white-space:pre-wrap;border-radius:5px;box-shadow:0 3px 3px -2px #0003,0 3px 4px #00000024,0 1px 8px #0000001f;background-color:#dcf8c6;padding:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;width:fit-content}
11/*# sourceMappingURL=manage.component-CJUAQWTS.css.map */`]});let r=n;return r})();function Sl(r,n){for(let e in n.prototype)r.prototype[e]=n.prototype[e]}
11var io=class r{constructor(){Sl(r,google.maps.OverlayView)}};function sr(r){return Object.keys(r).reduce((n,e)=>(r[e]&&n.push(e+":"+r[e]),n),[]).join(";")}function tt(r){return r?r+"px":void 0}var lr=class extends io{constructor(n,e){super(),this.cluster_=n,this.styles_=e,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.style=null,this.setMap(n.getMap())}onAdd(){let n,e,i=this.cluster_.getMarkerClusterer(),[t,o]=google.maps.version.split("."),s=parseInt(t,10)*100+parseInt(o,10);this.div_=document.createElement("div"),this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){e=n}),google.maps.event.addDomListener(this.div_,"mousedown",()=>{n=!0,e=!1}),s>=332&&google.maps.event.addDomListener(this.div_,"touchstart",m=>{m.stopPropagation()}),google.maps.event.addDomListener(this.div_,"click",m=>{if(n=!1,!e){if(google.maps.event.trigger(i,"click",this.cluster_),google.maps.event.trigger(i,"clusterclick",this.cluster_),i.getZoomOnClick()){let u=i.getMaxZoom(),y=this.cluster_.getBounds();i.getMap().fitBounds(y),setTimeout(function(){i.getMap().fitBounds(y),u!==null&&i.getMap().getZoom()>u&&i.getMap().setZoom(u+1)},100)}m.cancelBubble=!0,m.stopPropagation&&m.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",()=>{google.maps.event.trigger(i,"mouseover",this.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",()=>{google.maps.event.trigger(i,"mouseout",this.cluster_)})}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)}draw(){if(this.visible_){let n=this.getPosFromLatLng_(this.center_);this.div_.style.top=n.y+"px",this.div_.style.left=n.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){this.div_&&(this.div_.className=this.className_,this.div_.style.cssText=this.createCss_(this.getPosFromLatLng_(this.center_)),this.div_.innerHTML=(this.style.url?this.getImageElementHtml():"")+this.getLabelDivHtml(),typeof this.sums_.title>"u"||this.sums_.title===""?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""),this.visible_=!0}getLabelDivHtml(){let e=this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text),i={position:"absolute",top:tt(this.anchorText_[0]),left:tt(this.anchorText_[1]),color:this.style.textColor,"font-size":tt(this.style.textSize),"font-family":this.style.fontFamily,"font-weight":this.style.fontWeight,"font-style":this.style.fontStyle,"text-decoration":this.style.textDecoration,"text-align":"center",width:tt(this.style.width),"line-height":tt(this.style.textLineHeight)};return`
12<div aria-label="${e}" style="${sr(i)}" tabindex="0">
13  <span aria-hidden="true">${this.sums_.text}</span>
14</div>
15`}getImageElementHtml(){let n=(this.style.backgroundPosition||"0 0").split(" "),e=parseInt(n[0].replace(/^\s+|\s+$/g,""),10),i=parseInt(n[1].replace(/^\s+|\s+$/g,""),10),t={};if(this.cluster_.getMarkerClusterer().getEnableRetinaIcons())t={width:tt(this.style.width),height:tt(this.style.height)};else{let[s,m,u,y]=[-1*i,-1*e+this.style.width,-1*i+this.style.height,-1*e];t={clip:`rect(${s}px, ${m}px, ${u}px, ${y}px)`}}let o=sr(Object.assign({position:"absolute",top:tt(i),left:tt(e)},t));return`<img alt="${this.sums_.text}" aria-hidden="true" src="${this.style.url}" style="${o}"/>`}useStyle(n){this.sums_=n;let e=Math.max(0,n.index-1);e=Math.min(this.styles_.length-1,e),this.style=this.styles_[e],this.anchorText_=this.style.anchorText||[0,0],this.anchorIcon_=this.style.anchorIcon||[Math.floor(this.style.height/2),Math.floor(this.style.width/2)],this.className_=this.cluster_.getMarkerClusterer().getClusterClass()+" "+(this.style.className||"cluster-"+e)}setCenter(n){this.center_=n}createCss_(n){return sr({"z-index":`${this.cluster_.getMarkerClusterer().getZIndex()}`,top:tt(n.y),left:tt(n.x),width:tt(this.style.width),height:tt(this.style.height),cursor:"pointer",position:"absolute","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-o-user-select":"none","user-select":"none"})}getPosFromLatLng_(n){let e=this.getProjection().fromLatLngToDivPixel(n);return e.x=Math.floor(e.x-this.anchorIcon_[1]),e.y=Math.floor(e.y-this.anchorIcon_[0]),e}},cr=class{constructor(n){this.markerClusterer_=n,this.map_=this.markerClusterer_.getMap(),this.minClusterSize_=this.markerClusterer_.getMinimumClusterSize(),this.averageCenter_=this.markerClusterer_.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new lr(this,this.markerClusterer_.getStyles())}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}getMap(){return this.map_}
15getMarkerClusterer(){return this.markerClusterer_}getBounds(){let n=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers();for(let i=0;i<e.length;i++)n.extend(e[i].getPosition());return n}remove(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_}addMarker(n){if(this.isMarkerAlreadyAdded_(n))return!1;if(!this.center_)this.center_=n.getPosition(),this.calculateBounds_();else if(this.averageCenter_){let t=this.markers_.length+1,o=(this.center_.lat()*(t-1)+n.getPosition().lat())/t,s=(this.center_.lng()*(t-1)+n.getPosition().lng())/t;this.center_=new google.maps.LatLng(o,s),this.calculateBounds_()}n.isAdded=!0,this.markers_.push(n);let e=this.markers_.length,i=this.markerClusterer_.getMaxZoom();if(i!==null&&this.map_.getZoom()>i)n.getMap()!==this.map_&&n.setMap(this.map_);else if(e<this.minClusterSize_)n.getMap()!==this.map_&&n.setMap(this.map_);else if(e===this.minClusterSize_)for(let t=0;t<e;t++)this.markers_[t].setMap(null);else n.setMap(null);return!0}isMarkerInClusterBounds(n){return this.bounds_.contains(n.getPosition())}calculateBounds_(){let n=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(n)}updateIcon(){let n=this.markers_.length,e=this.markerClusterer_.getMaxZoom();if(e!==null&&this.map_.getZoom()>e){this.clusterIcon_.hide();return}if(n<this.minClusterSize_){this.clusterIcon_.hide();return}let i=this.markerClusterer_.getStyles().length,t=this.markerClusterer_.getCalculator()(this.markers_,i);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(t),this.clusterIcon_.show()}isMarkerAlreadyAdded_(n){if(this.markers_.indexOf)return this.markers_.indexOf(n)!==-1;for(let e=0;e<this.markers_.length;e++)if(n===this.markers_[e])return!0;return!1}},to=(r,n,e)=>r[n]!==void 0?r[n]:e,Il=(()=>{class r extends io{constructor(e,i=[],t={}){super(),this.options=t,this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.ariaLabelFn=this.options.ariaLabelFn||(()=>""),this.zIndex_=this.options.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=this.options.gridSize||60,this.minClusterSize_=this.options.minimumClusterSize||2,this.maxZoom_=this.options.maxZoom||null,this.styles_=this.options.styles||[],this.title_=this.options.title||"",this.zoomOnClick_=to(this.options,"zoomOnClick",!0),this.averageCenter_=to(this.options,"averageCenter",!1),this.ignoreHidden_=to(this.options,"ignoreHidden",!1),this.enableRetinaIcons_=to(this.options,"enableRetinaIcons",!1),this.imagePath_=this.options.imagePath||r.IMAGE_PATH,this.imageExtension_=this.options.imageExtension||r.IMAGE_EXTENSION,this.imageSizes_=this.options.imageSizes||r.IMAGE_SIZES,this.calculator_=this.options.calculator||r.CALCULATOR,this.batchSize_=this.options.batchSize||r.BATCH_SIZE,this.batchSizeIE_=this.options.batchSizeIE||r.BATCH_SIZE_IE,this.clusterClass_=this.options.clusterClass||"cluster",navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(i,!0),this.setMap(e)}onAdd(){this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.prevZoom_=this.getMap().getZoom(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",()=>{let e=this.getMap(),i=e.minZoom||0,t=Math.min(e.maxZoom||100,e.mapTypes[e.getMapTypeId()].maxZoom),o=Math.min(Math.max(this.getMap().getZoom(),i),t);this.prevZoom_!=o&&(this.prevZoom_=o,this.resetViewport_(!1))}),google.maps.event.addListener(this.getMap(),"idle",()=>{this.redraw_()})]}onRemove(){for(let e=0;e<this.markers_.length;e++)this.markers_[e].getMap()!==this.activeMap_&&this.markers_[e].setMap(this.activeMap_);for(let e=0;
15e<this.clusters_.length;e++)this.clusters_[e].remove();this.clusters_=[];for(let e=0;e<this.listeners_.length;e++)google.maps.event.removeListener(this.listeners_[e]);this.listeners_=[],this.activeMap_=null,this.ready_=!1}draw(){}setupStyles_(){if(!(this.styles_.length>0))for(let e=0;e<this.imageSizes_.length;e++){let i=this.imageSizes_[e];this.styles_.push(r.withDefaultStyle({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:i,width:i}))}}fitMapToMarkers(e){let i=this.getMarkers(),t=new google.maps.LatLngBounds;for(let o=0;o<i.length;o++)(i[o].getVisible()||!this.getIgnoreHidden())&&t.extend(i[o].getPosition());this.getMap().fitBounds(t,e)}getGridSize(){return this.gridSize_}setGridSize(e){this.gridSize_=e}getMinimumClusterSize(){return this.minClusterSize_}setMinimumClusterSize(e){this.minClusterSize_=e}getMaxZoom(){return this.maxZoom_}setMaxZoom(e){this.maxZoom_=e}getZIndex(){return this.zIndex_}setZIndex(e){this.zIndex_=e}getStyles(){return this.styles_}setStyles(e){this.styles_=e}getTitle(){return this.title_}setTitle(e){this.title_=e}getZoomOnClick(){return this.zoomOnClick_}setZoomOnClick(e){this.zoomOnClick_=e}getAverageCenter(){return this.averageCenter_}setAverageCenter(e){this.averageCenter_=e}getIgnoreHidden(){return this.ignoreHidden_}setIgnoreHidden(e){this.ignoreHidden_=e}getEnableRetinaIcons(){return this.enableRetinaIcons_}setEnableRetinaIcons(e){this.enableRetinaIcons_=e}getImageExtension(){return this.imageExtension_}setImageExtension(e){this.imageExtension_=e}getImagePath(){return this.imagePath_}setImagePath(e){this.imagePath_=e}getImageSizes(){return this.imageSizes_}setImageSizes(e){this.imageSizes_=e}getCalculator(){return this.calculator_}setCalculator(e){this.calculator_=e}getBatchSizeIE(){return this.batchSizeIE_}setBatchSizeIE(e){this.batchSizeIE_=e}getClusterClass(){return this.clusterClass_}setClusterClass(e){this.clusterClass_=e}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}getClusters(){return this.clusters_}getTotalClusters(){return this.clusters_.length}addMarker(e,i){this.pushMarkerTo_(e),i||this.redraw_()}addMarkers(e,i){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.pushMarkerTo_(e[t]);i||this.redraw_()}pushMarkerTo_(e){e.getDraggable()&&google.maps.event.addListener(e,"dragend",()=>{this.ready_&&(e.isAdded=!1,this.repaint())}),e.isAdded=!1,this.markers_.push(e)}removeMarker(e,i){let t=this.removeMarker_(e);return!i&&t&&this.repaint(),t}removeMarkers(e,i){let t=!1;for(let o=0;o<e.length;o++){let s=this.removeMarker_(e[o]);t=t||s}return!i&&t&&this.repaint(),t}removeMarker_(e){let i=-1;if(this.markers_.indexOf)i=this.markers_.indexOf(e);else for(let t=0;t<this.markers_.length;t++)if(e===this.markers_[t]){i=t;break}return i===-1?!1:(e.setMap(null),this.markers_.splice(i,1),!0)}clearMarkers(){this.resetViewport_(!0),this.markers_=[]}
15repaint(){let e=this.clusters_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout(function(){for(let i=0;i<e.length;i++)e[i].remove()},0)}getExtendedBounds(e){let i=this.getProjection(),t=new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()),o=new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()),s=i.fromLatLngToDivPixel(t);s.x+=this.gridSize_,s.y-=this.gridSize_;let m=i.fromLatLngToDivPixel(o);m.x-=this.gridSize_,m.y+=this.gridSize_;let u=i.fromDivPixelToLatLng(s),y=i.fromDivPixelToLatLng(m);return e.extend(u),e.extend(y),e}redraw_(){this.createClusters_(0)}resetViewport_(e){for(let i=0;i<this.clusters_.length;i++)this.clusters_[i].remove();this.clusters_=[];for(let i=0;i<this.markers_.length;i++){let t=this.markers_[i];t.isAdded=!1,e&&t.setMap(null)}}distanceBetweenPoints_(e,i){let o=(i.lat()-e.lat())*Math.PI/180,s=(i.lng()-e.lng())*Math.PI/180,m=Math.sin(o/2)*Math.sin(o/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(i.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m)))}isMarkerInBounds_(e,i){return i.contains(e.getPosition())}addToClosestCluster_(e){let i=4e4,t=null;for(let o=0;
15o<this.clusters_.length;o++){let s=this.clusters_[o],m=s.getCenter();if(m){let u=this.distanceBetweenPoints_(m,e.getPosition());u<i&&(i=u,t=s)}}if(t&&t.isMarkerInClusterBounds(e))t.addMarker(e);else{let o=new cr(this);o.addMarker(e),this.clusters_.push(o)}}createClusters_(e){if(!this.ready_)return;e===0&&(google.maps.event.trigger(this,"clusteringbegin",this),typeof this.timerRefStatic<"u"&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic));let i;this.getMap().getZoom()>3?i=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):i=new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));let t=this.getExtendedBounds(i),o=Math.min(e+this.batchSize_,this.markers_.length);for(let s=e;s<o;s++){let m=this.markers_[s];!m.isAdded&&this.isMarkerInBounds_(m,t)&&(!this.ignoreHidden_||this.ignoreHidden_&&m.getVisible())&&this.addToClosestCluster_(m)}if(o<this.markers_.length)this.timerRefStatic=window.setTimeout(()=>{this.createClusters_(o)},0);else{delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this);for(let s=0;
15s<this.clusters_.length;s++)this.clusters_[s].updateIcon()}}static CALCULATOR(e,i){let t=0,o=e.length,s=o;for(;s!==0;)s=Math.floor(s/10),t++;return t=Math.min(t,i),{text:o.toString(),index:t,title:""}}static withDefaultStyle(e){return Object.assign({textColor:"black",textSize:11,textDecoration:"none",textLineHeight:e.height,fontWeight:"bold",fontStyle:"normal",fontFamily:"Arial,sans-serif",backgroundPosition:"0 0"},e)}}return r.BATCH_SIZE=2e3,r.BATCH_SIZE_IE=500,r.IMAGE_PATH="../images/m",r.IMAGE_EXTENSION="png",r.IMAGE_SIZES=[53,56,66,78,90],r})(),bs=Il;var kl=["gmap"];function El(r,n){if(r&1){let e=M();c(0,"div",14)(1,"canvas",15),D("chartClick",function(t){C(e);let o=p();return x(o.pie.chartClicked(t))}),l()()}if(r&2){let e=p();a(),f("data",e.pie.data)("options",e.pie.options)}}function Ml(r,n){if(r&1){let e=M();c(0,"button",16),D("click",function(){C(e);let t=p();return x(t.selectDeliveries())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.selectDeliveriesOnMap," ")}}function Fl(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p();a(),T(e.settings.lang.drawingHelpText)}}function Tl(r,n){if(r&1&&(c(0,"strong"),d(1),l()),r&2){let e=p(2);a(),be("",e.selectedDeliveries.length," ",e.settings.lang.selectedDeliveries,"")}}function Rl(r,n){if(r&1){let e=M();c(0,"button",20),D("click",function(){C(e);let t=p().$implicit;return x(t.click())}),d(1),l()}if(r&2){let e=p().$implicit;a(),w(" ",e.textInMenu?e.textInMenu():e.name," ")}}function Al(r,n){if(r&1&&(X(0),v(1,Rl,2,1,"button",19),ee()),r&2){let e=n.$implicit;a(),f("ngIf",!e.visible||e.visible())}}function Ol(r,n){if(r&1&&(c(0,"div"),v(1,Tl,2,2,"strong",8),c(2,"mat-menu",null,1),v(4,Al,2,1,"ng-container",17),l(),c(5,"button",18)(6,"mat-icon"),d(7,"more_vert"),l()()()),r&2){let e=Nt(3),i=p();a(),f("ngIf",!i.drawing&&i.selectedDeliveries.length),a(3),f("ngForOf",i.buttons),a(),f("matMenuTriggerFor",e)}}function Vl(r,n){r&1&&(c(0,"mat-icon"),d(1,"unfold_less"),l())}function Pl(r,n){r&1&&(c(0,"mat-icon"),d(1,"unfold_more"),l())}function Nl(r,n){if(r&1){let e=M();c(0,"mat-checkbox",21),D("change",function(){C(e);let t=p();return x(t.refreshDeliveries())}),W("ngModelChange",function(t){C(e);let o=p();return $(o.showHelper,t)||(o.showHelper=t),x(t)}),l()}if(r&2){let e=p();L("ngModel",e.showHelper)}}var no=(()=>{let n=class n{constructor(i,t,o){this.dialog=i,this.settings=o,this.showChart=!0,this.showHelper=!1,this.buttons=[...[new ls,new gs,new hs,new ss,new _s,new fs,new us].map(s=>s.gridButton({afterAction:()=>h(this,null,function*(){return yield this.refreshDeliveries()}),ui:this.dialog,userWhere:()=>({id:this.selectedDeliveries.map(m=>m.id)}),settings:this.settings}))],this.destroyHelper=new dt,this.gridView=!0,this.drawing=!1,this.selectedDeliveries=[],this.mapVisible=!0,this.mapInit=!1,this.bounds=new google.maps.LatLngBounds,this.dict=new Map,this.statuses=new Vn(this.settings),this.filterCourier=new It({valueType:ra,caption:this.settings.lang.volunteer,valueChange:()=>this.refreshDeliveries(),clickWithTools:(s,m,u)=>h(this,null,function*(){return u.selectHelper({onSelect:y=>this.filterCourier.value=y,filter:{allDeliveires:{">":0}}})})}),this.filterArea=new It({caption:F.language.filterRegion,defaultValue:()=>F.language.allRegions,valueChange:()=>this.refreshDeliveries(),valueList:()=>h(this,null,function*(){return g.isAllowed(V.admin)?yield ae.getAreas().then(s=>[{caption:F.language.allRegions,id:F.language.allRegions},...s.map(m=>({caption:m.area+" - "+m.count,id:m.area}))]):[]})}),this.area=new ne,this.overviewMap=!1,this.first=!0,this.pie=new li({click:s=>{this.selectedStatus=this.statuses.statuses[s],this.refreshDeliveries()}}),i.onStatusChange(()=>{t.donotWait(()=>h(this,null,function*(){yield this.refreshDeliveries()}))},this.destroyHelper),this.dialog.onDistCenterChange(()=>h(this,null,function*(){this.clearMap(),this.bounds=new google.maps.LatLngBounds,yield this.refreshDeliveries(),this.map.fitBounds(this.bounds)}),this.destroyHelper)}clearMap(){for(let i of this.dict.values())i.marker.setMap(null);this.selectedDeliveries=[],this.dict=new Map,this.activePolygon&&(this.activePolygon.setMap(null),this.activePolygon=void 0)}hasVisibleButtons(){return this.buttons.find(i=>!i.visible||i.visible())}ngOnDestroy(){this.destroyHelper.destroy()}calcSelectedDeliveries(){if(this.selectedDeliveries=[],!!this.activePolygon)for(let i of this.dict.values())i.marker.getVisible()&&i.marker.getMap()&&ma(this.activePolygon,i.marker.getPosition())&&this.selectedDeliveries.push(i)}selectDeliveries(){this.drawing=!0,this.activePolygon&&this.activePolygon.setMap(null);let i=new google.maps.drawing.DrawingManager({drawingMode:google.maps.drawing.OverlayType.POLYGON,drawingControl:!1,polygonOptions:{editable:!0}});google.maps.event.addListener(i,"polygoncomplete",t=>{this.activePolygon=t,this.drawing=!1,this.calcSelectedDeliveries(),t.addListener("mouseup",()=>{this.calcSelectedDeliveries()}),i.setDrawingMode(null)}),i.setMap(this.map)}test(){return h(this,null,function*(){var i={center:new google.maps.LatLng(32.3215,34.8532),zoom:13,mapTypeId:google.maps.MapTypeId.ROADMAP};this.mapInit||(this.dict=new Map,this.bounds=new google.maps.LatLngBounds,this.map=new google.maps.Map(this.gmapElement.nativeElement,i),this.mapInit=!0,yield this.refreshDeliveries(),this.map.fitBounds(this.bounds)),this.mapVisible=!this.mapVisible})}refreshDeliveries(){return h(this,null,function*(){let i=!1,t;g.isAllowed(V.overview)?(this.overviewMap=!0,t=yield tr.GetLocationsForOverview(),i=!0):t=yield tr.GetDeliveriesLocation(!1,void 0,void 0,this.dialog.distCenter,this.filterArea.value!=F.language.allRegions?this.filterArea.value:void 0),this.statuses.statuses.forEac
15h(u=>{u.value=0}),this.area=new ne({fields:()=>[[this.filterCourier,this.filterArea]]});let o=[],s=new Map;t.forEach(u=>{s.set(u.id,!0);let y=this.dict.get(u.id),E=!1;y?y.marker.setPosition({lat:u.lat,lng:u.lng}):(E=!0,y={marker:new google.maps.Marker({position:{lat:u.lat,lng:u.lng}}),prevStatus:void 0,prevCourier:void 0,id:u.id},this.dict.set(u.id,y),o.push(y.marker),i||google.maps.event.addListener(y.marker,"click",()=>h(this,null,function*(){yield(yield g.repo(se).findId(y.id)).showDetailsDialog({onSave:()=>h(this,null,function*(){y.marker.setMap(null),this.dict.delete(u.id),this.refreshDeliveries()}),ui:this.dialog})})));let I=this.statuses.getBy(u.status,u.courier);I&&I.value++,(I!=y.prevStatus||u.courier!=y.prevCourier)&&(y.marker.setIcon(I.icon),E||(y.marker.setAnimation(google.maps.Animation.DROP),setTimeout(()=>{y.marker.setAnimation(null)},1e3)),y.prevStatus=I,y.prevCourier=u.courier),y.marker.setVisible((!this.selectedStatus||this.selectedStatus==I)&&(!this.filterCourier.value||this.filterCourier.value.id==y.prevCourier)),y.marker.setLabel(this.showHelper&&u.courierName?u.courierName+"...":""),this.bounds.extend(y.marker.getPosition())});for(let u of this.dict.keys())s.get(u)||(this.dict.get(u).marker.setMap(null),this.dict.delete(u));if(i||o.length>1e4)var m=new bs(this.map,o,{imagePath:"http://localhost:4200/assets/test",clusterClass:"map-cluster",minimumClusterSize:13,averageCenter:!0,styles:[{textColor:"black",height:17,width:50,anchorText:[2,0]}],calculator:(u,y)=>({index:2,text:u.length.toString(),title:u.length.toString()+"title"}),gridSize:40});else for(let u of o)u.setMap(this.map);this.updateChart(),this.calcSelectedDeliveries()})}ngOnInit(){return h(this,null,function*(){this.test()})}updateChart(){this.pie.reset(),this.statuses.statuses.forEach(i=>{this.pie.add(i.name+" "+i.value,i.value,i.color)}),this.chart?.update()}};n.route={path:"addresses",component:n,canActivate:[ai]},n.\u0275fac=function(t){return new(t||n)(b(z),b(we),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-distribution-map"]],viewQuery:function(t,o){if(t&1&&(ce(kl,7),ce(je,5)),t&2){let s;te(s=ie())&&(o.gmapElement=s.first),te(s=ie())&&(o.chart=s.first)}},decls:25,vars:12,consts:[["gmap",""],["appMenu77",""],[1,"full-page"],["style","display: block; width: 350px; height: 188px",4,"ngIf"],[2,"display","inline"],[2,"display","inline",3,"click"],[2,"display","flex","justify-content","space-between","margin-bottom","5px","height","37px","width","100%"],["mat-raised-button","",3,"click",4,"ngIf"],[4,"ngIf"],[1,"grow-item"],["mat-mini-fab","","color","primary",2,"margin","5px",3,"click"],["mat-mini-fab","","color","primary",2,"margin-bottom","5px",3,"click"],["style","margin-right: 10px",3,"ngModel","change","ngModelChange",4,"ngIf"],[2,"display","inline-block",3,"settings"],[2,"display","block","width","350px","height","188px"],["baseChart","","type","pie",3,"chartClick","data","options"],["mat-raised-button","",3,"click"],[4,"ngFor","ngForOf"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"],[2,"margin-right","10px",3,"change","ngModelChange","ngModel"]],template:function(t,o){if(t&1){let s=M();c(0,"div",2)(1,"div"),v(2,El,2,2,"div",3),c(3,"h4",4),d(4),l(),c(5,"a",5),D("click",function(){return C(s),o.selectedStatus=void 0,x(o.refreshDeliveries())}),d(6),l(),c(7,"div",6)(8,"div"),v(9,Ml,2,1,"button",7)(10,Fl,2,1,"span",8),k(11,"br"),l(),c(12,"div"),v(13,Ol,8,3,"div",8),l()()(),k(14,"div",9,0),c(16,"div")(17,"button",10),D("click",function(){return C(s),x(o.refreshDeliveries())}),c(18,"mat-icon"),d(19,"refresh"),l()(),c(20,"button",11),D("click",function(){return C(s),x(o.showChart=!o.showChart)}),v(21,Vl,2,0,"mat-icon",8)(22,Pl,2,0,"mat-icon",8),l(),v(23,Nl,1,1,"mat-checkbox",12),k(24,"data-area",13),l()()}t&2&&(a(2),f("ngIf",o.showChart),a(2),w(" ",o.selectedStatus?o.selectedStatus.name:o.settings.lang.deliveries," "),a(),Ut("visibility",o.selectedStatus?"visible":"hidden"),a(),T(o.settings.lang.showAll),a(3),f("ngIf",!o.drawing),a(),f("ngIf",o.drawing),a(3),f("ngIf",!o.drawing&&o.selectedDeliveries.length),a(8),f("ngIf",o.showChart),a(),f("ngIf",!o.showChart),a(),f("ngIf",!o.overviewMap),a(),f("settings",o.area))},dependencies:[me,q,de,pe,Q,Ye,Jt,mt,ve,oi,ni,ri,Ce,je],styles:[`h4[_ng
15content-%COMP%]{margin:0}
16/*# sourceMappingURL=distribution-map.component-OZQXMN2E.css.map */`]});let r=n;return r})();var Ss=(()=>{let n=class n{constructor(i,t,o,s,m,u){this.route=i,this.router=t,this.authServer=o,this.dialog=s,this.routeHelper=m,this.settings=u}ngOnInit(){this.route.paramMap.subscribe(i=>h(this,null,function*(){var t=i.get("id");yield this.authServer.loginFromSms(t)}))}};n.route={path:"x/:id",component:n},n.\u0275fac=function(t){return new(t||n)(b(We),b(xn),b(_t),b(z),b(Rt),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-login-from-sms"]],decls:2,vars:1,template:function(t,o){t&1&&(c(0,"p"),d(1),l()),t&2&&(a(),w(" ",o.settings.lang.pleaseWaitVerifyingDetails,`
17`))}});let r=n;return r})();var mi=class r{static helpersStatus(n){return h(this,null,function*(){let e=gt(g.repo(Pe)),i=gt(g.repo(G));var t=new Zt;return t.addEntity(e,"fd"),(yield Kt().execute(yield t.build((yield t.query({from:e,outerJoin:()=>[{to:i,on:()=>[t.eq(e.courier,i.id)]}],select:()=>[t.columnWithAlias(e.courier,"id"),t.columnWithAlias(i.name,"couriername"),t.columnWithAlias(i.phone,"phone"),t.columnWithAlias(i.smsDate,"smsdate"),t.columnWithAlias(i.lastSignInDate,"signindate"),t.columnWithAlias(i.eventComment,"comment1"),t.columnWithAlias(t.func("max",e.courierAssingTime),"maxasign"),t.sumWithAlias(1,"deliveries",e.where({deliverStatus:{"!=":[B.SelfPickup,B.SuccessPickedUp]}})),t.sumWithAlias(1,"inprogress",e.where({deliverStatus:[B.ReadyForDelivery,B.DriverPickedUp]})),t.sumWithAlias(1,"problem",e.where({deliverStatus:B.isProblem()}))],where:()=>[t.eq(e.archive,!1),e.where({courier:{"!=":null},distributionCenter:g.context.filterDistCenter(n)})]})).replace(/distributionCenter/g,"fd.distributionCenter")," group by ",[e.courier,i.name,i.phone,i.smsDate,i.eventComment,i.lastSignInDate]," order by ",t.func("max",e.courierAssingTime)," desc"))).rows.map(s=>{let m=s.smsdate,u=s.maxasign,y=s.signindate;return{id:s.id,name:s.couriername,phone:s.phone,deliveries:+s.deliveries,inProgress:+s.inprogress,problem:+s.problem,viewedSms:y&&m&&y>m,smsDateName:m?ea({d:m}):"",smsWasSent:m&&m>u,eventComment:s.comment1}})})}static sendAttendanceReminder(n){return h(this,null,function*(){let e=yield g.repo(vn).findId("simpleAttendanceReminder",{createIfNotFound:!0});for(let i of yield g.repo(G).find({where:{id:n}}))yield new wn().sendSms(i.phone.thePhone,r.createMessage(i).merge(e.template),i,{});return"\u05E0\u05E9\u05DC\u05D7\u05D5 "+n.length+" \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA"})}static createMessage(n){return new ta([{token:"\u05DE\u05EA\u05E0\u05D3\u05D1",caption:"\u05E9\u05DD \u05D4\u05DE\u05EA\u05E0\u05D3\u05D1",value:n.name},{token:"\u05D0\u05E8\u05D2\u05D5\u05DF",value:Qe().organisationName}])}};S([Y({allowed:V.distCenterAdmin,paramTypes:[ye]}),_("design:type",Function),_("design:paramtypes",[ye]),_("design:returntype",Promise)],mi,"helpersStatus",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[Array]),_("design:returntype",Promise)],mi,"sendAttendanceReminder",null);var Bl=()=>({standalone:!0});function Hl(r,n){if(r&1&&(c(0,"h4"),d(1),l()),r&2){let e=p();a(),be(" ",e.currentStatFilter.name," - ",e.currentStatFilter.value,`
18`)}}function Ll(r,n){if(r&1){let e=M();c(0,"a",14),D("click",function(){C(e);let t=p();return x(t.clearFilter())}),d(1),l()}if(r&2){let e=p();a(),T(e.settings.lang.showAll)}}function $l(r,n){if(r&1&&(c(0,"h4"),d(1),l()),r&2){let e=p();a(),be(" ",e.settings.lang.all," - ",e.helpers.length,`
19`)}}function Wl(r,n){if(r&1){let e=M();c(0,"button",10),D("click",function(){C(e);let t=p();return x(t.sendAttendanceReminderSms())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.sendAttendanceReminder," ")}}function jl(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(2).$implicit;a(),w(", ",e.eventComment,"")}}function zl(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(2).$implicit,i=p();a(),be("",i.settings.lang.smsSent," ",e.smsDateName,"")}}function Ul(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(3);a(),T(e.settings.lang.smsNotOpened)}}function Gl(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(3);a(),T(e.settings.lang.smsNotSent)}}function ql(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(2).$implicit,i=p();a(),be("\xA0 (",e.problem," ",i.settings.lang.notDelivered,")")}}function Ql(r,n){if(r&1){let e=M();c(0,"mat-list-item",16),D("click",function(){C(e);let t=p().$implicit,o=p();return x(o.deliveryDetails(t))}),c(1,"div",17)(2,"div",18)(3,"a"),d(4),v(5,jl,2,1,"span",4),l()(),c(6,"div"),v(7,zl,2,2,"span",4)(8,Ul,2,1,"span",4)(9,Gl,2,1,"span",4),l()(),c(10,"div",19),d(11),v(12,ql,2,2,"span",4),l()()}if(r&2){let e=p().$implicit,i=p();a(4),w("",e.name," "),a(),f("ngIf",e.eventComment),a(2),f("ngIf",e.viewedSms&&e.smsWasSent),a(),f("ngIf",!e.viewedSms&&e.smsWasSent),a(),f("ngIf",!e.smsWasSent),a(2),St(" ",i.settings.lang.completed," ",e.deliveries-e.inProgress,"/",e.deliveries," "),a(),f("ngIf",e.problem>0)}}function Yl(r,n){if(r&1&&(X(0),v(1,Ql,13,9,"mat-list-item",15),k(2,"mat-divider"),ee()),r&2){let e=n.$implicit,i=p();a(),f("ngIf",i.showHelper(e))}}var so=(()=>{let n=class n{deliveryDetails(i){return h(this,null,function*(){let t=yield g.repo(G).findId(i.id);yield K(Pi,o=>o.argsHelper=t),this.refresh()})}ngOnDestroy(){this.destroyHelper.destroy()}selectCourier(i){return h(this,null,function*(){this.currentlHelper=i;let t=yield g.repo(G).findId(i.id);t||(t.id=i.id),this.familyLists.initForHelper(t)})}seeAllCenters(){return!this.dialog.distCenter}showHelper(i){return(!this.searchString||i.name&&i.name.toLowerCase().indexOf(this.searchString.toLowerCase())>=0)&&(!this.currentStatFilter||this.currentStatFilter.rule(i))}clearFilter(){this.currentStatFilter=void 0}refresh(){this.refreshStats()}admin(){return g.isAllowed(V.admin)}sendSmsToAll(){return h(this,null,function*(){(yield this.dialog.YesNoPromise(this.settings.lang.shouldSe
19ndSmsTo+" "+this.stats.notOutYet.value+" "+this.settings.lang.volunteers+"?"))&&(yield this.busy.doWhileShowingBusy(()=>h(this,null,function*(){for(let i of this.helpers)i.smsWasSent||(yield ft.SendSms(yield g.repo(G).findId(i.id),!1))})),this.refresh())})}sendAttendanceReminderSms(){return h(this,null,function*(){let i=yield g.repo(vn).findId("simpleAttendanceReminder",{createIfNotFound:!0}),t=this.helpers.filter(o=>!o.smsWasSent);if(t.length==0){this.dialog.messageDialog("\u05E0\u05E9\u05DC\u05D7 \u05DB\u05D1\u05E8 SMS \u05E2\u05DD \u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05DB\u05D5\u05DC\u05DD");return}this.dialog.editCustomMessageDialog({helpText:"\u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5 \u05EA\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD \u05D0\u05E9\u05E8 \u05D8\u05E8\u05DD \u05E0\u05E9\u05DC\u05D7 \u05DC\u05D4\u05DD SMS \u05E2\u05DD \u05E7\u05D9\u05E9\u05D5\u05E8 - \u05DB\u05D3\u05D9 \u05DC\u05D4\u05D6\u05DB\u05D9\u05E8 \u05DC\u05D4\u05DD \u05DC\u05D4\u05D2\u05D9\u05E2 \u05DC\u05D0\u05E8\u05D5\u05E2 \u05D4\u05D7\u05DC\u05D5\u05E7\u05D4 - \u05D0\u05DA \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05E9\u05DE\u05D5\u05E8 \u05D0\u05D5\u05EA\u05DD \u05DE\u05E1\u05D5\u05DE\u05E0\u05D9\u05DD \u05DB\u05D8\u05E8\u05DD \u05E7\u05D9\u05D1\u05DC\u05D5 SMS ",title:Z().sendAttendanceReminder+" - "+t.length,message:mi.createMessage(t[0]),templateText:i.template,buttons:[{name:"\u05E9\u05DE\u05D5\u05E8 \u05D4\u05D5\u05D3\u05E2\u05D4",click:s=>h(this,[s],function*({templateText:o}){i.template=o,yield i.save(),this.dialog.Info("\u05D4\u05E2\u05D3\u05DB\u05D5\u05DF \u05E0\u05E9\u05DE\u05E8")})},{name:"\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D4",click:m=>h(this,[m],function*({templateText:o,close:s}){if(yield this.dialog.YesNoPromise(`\u05DC\u05E9\u05DC\u05D5\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC ${t.length} \u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD?`)){i.template=o,yield i.save();let u=yield mi.sendAttendanceReminder(t.map(y=>y.id));this.dialog.Info(u),s()}})}]})})}updateChart(){this.stats=new oo;for(let i of this.helpers)this.stats.process(i);this.pieChartStatObjects=[],this.pie.reset(),this.hasChart=!1,[this.stats.notOutYet,this.stats.onTheWay,this.stats.smsNotOpenedYet,this.stats.problem,this.stats.delivered].forEach(i=>{i.value>0&&(this.hasChart=!0,this.pie.add(i.name+" "+i.value,i.value,i.color),this.pieChartStatObjects.push(i))}),this.chart?.update()}refreshStats(){return h(this,null,function*(){this.helpers=yield mi.helpersStatus(this.dialog.distCenter),this.updateChart()})}constructor(i,t,o){this.busy=i,this.dialog=t,this.settings=o,this.destroyHelper=new dt,this.familyLists=new Ba(this.settings,this.destroyHelper),this.pieChartStatObjects=[],this.currentStatFilter=void 0,this.pie=new li({click:s=>{this.currentStatFilter=this.pieChartStatObjects[s]}}),this.helpers=[],this.stats=new oo,this.first=!0,this.hasChart=!0,t.onDistCenterChange(()=>this.refresh(),this.destroyHelper)}ngOnInit(){this.refreshStats()}};n.route={path:"delivery-follow-up",component:n,canActivate:[ai]},n.\u0275fac=function(t){return new(t||n)(b(we),b(z),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-delivery-follow-up"]],viewQuery:function(t,o){if(t&1&&ce(je,5),t&2){let s;te(s=ie())&&(o.chart=s.first)}},decls:25,vars:13,consts:[["appMenu","matMenu"],["mat-mini-fab","","color","primary",2,"margin-bottom","5px",3,"click"],[2,"display","block","width","350px","height","188px"],["baseChart","","type","pie",3,"chartClick","data","options"],[4,"ngIf"],[3,"click",4,"ngIf"],[2,"width","100%","display","flex","justify-content","space-between"],[1,"full-width"],["matInput","",3,"ngModelChange","ngModel","placeholder","ngModelOptions"],["matSuffix","",3,"click"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-icon-button","",3,"matMenuTriggerFor"],[4,"ngFor","ngForOf"],[3,"click"],["class","followup-list-item",3,"click",4,"ngIf"],[1,"followup-list-item",3,"click"],["matLine","",2,"display","flex","justify-content","space-between"],[2,"font-weight","500"],["matLine","",2,"font-size","0.8em"]],template:function(t,o){if(t&1){let s=M();c(0,"button",1),D("click",function(){return C(s),x(o.refresh())}),c(1,"mat-icon"),d(2,"refresh"),l()(),c(3,"div")(4,"div",2)(5,"canvas",3),D("chartClick",function(u){return C(s),x(o.pie.chartClicked(u))}),l()()(),v(6,Hl,2,2,"h4",4)(7,Ll,2,1,"a",5)(8,$l,2,2,"h4",4),c(9,"div",6)(10,"mat-form-field",7)(11,"input",8),W("ngModelChange",function(u){return C(s),$(o.searchString,u)||(o.searchString=u),x(u)}),l(),c(12,"mat-icon",9),D("click",function(){return C(s),x(o.searchString="")}
19),d(13,"clear"),l()(),c(14,"mat-menu",null,0)(16,"button",10),D("click",function(){return C(s),x(o.sendSmsToAll())}),d(17),l(),v(18,Wl,2,1,"button",11),l(),c(19,"button",12)(20,"mat-icon"),d(21,"more_vert"),l()()(),c(22,"mat-card")(23,"mat-nav-list"),v(24,Yl,3,1,"ng-container",13),l()()}if(t&2){let s=Nt(15);a(5),f("data",o.pie.data)("options",o.pie.options),a(),f("ngIf",o.currentStatFilter),a(),f("ngIf",o.currentStatFilter),a(),f("ngIf",!o.currentStatFilter),a(3),re("placeholder",o.settings.lang.searchVolunteer),L("ngModel",o.searchString),f("ngModelOptions",Si(12,Bl)),a(6),w(" ",o.settings.lang.sendSmsToAllVolunteersThatDidntGetOne," "),a(),f("ngIf",o.admin()),a(),f("matMenuTriggerFor",s),a(5),f("ngForOf",o.helpers)}},dependencies:[me,q,Me,de,pe,lt,ii,Ye,Jt,xe,Et,ve,ct,Ft,Mt,oi,ni,ri,je]});let r=n;return r})(),oo=class{constructor(){this.notOutYet=new di(Z().smsNotSent,n=>n.inProgress>=1&&!n.smsWasSent,Ti.blue),this.onTheWay=new di(Z().onTheWay,n=>n.inProgress>=1&&n.smsWasSent&&n.viewedSms,Ti.blue),this.smsNotOpenedYet=new di(Z().smsNotOpened,n=>n.inProgress>=1&&n.smsWasSent&&!n.viewedSms,Ti.yellow),this.delivered=new di(Z().doneVolunteers,n=>n.inProgress==0&&n.problem==0,Ti.green),this.problem=new di(Z().problems,n=>n.problem>0,Ti.red)}process(n){for(let e in this){let i=this[e];i instanceof di&&i.loadFrom(n)}}},di=class{constructor(n,e,i){this.name=n,this.rule=e,this.color=i,this.value=0}loadFrom(n){return h(this,null,function*(){this.rule(n)&&this.value++})}};var lo=(()=>{let n=class n{constructor(i){this.settings=i,this.filters=[{name:this.settings.lang.allNew,where:{archive:!1}},{name:this.settings.lang.problemsThatRequireFollowup,where:{deliverStatus:B.isProblem(),needsWork:!0}},{name:this.settings.lang.requireFollowUp,where:{needsWork:!0}},{name:this.settings.lang.problems,where:{deliverStatus:B.isProblem(),archive:!1}},{name:this.settings.lang.commentsWrittenByVolunteers,where:{courierComments:{"!=":""},deliverStatus:B.isAResultStatus(),archive:!1}}],this.currentFilter=this.filters[0],this.currentFamilySource=void 0}setToNeedsWork(){this.currentFilter=this.filters[2]}where(){return{familySource:this.currentFamilySource?this.currentFamilySource:void 0,$and:[this.currentFilter.where]}}};n.\u0275fac=function(t){return new(t||n)(Ui(P))},n.\u0275prov=jt({token:n,factory:n.\u0275fac});let r=n;return r})();function Kl(r,n){if(r&1&&(c(0,"a",8),d(1),l()),r&2){let e=p();a(),T(e.settings.lang.volunteerFeedbackVideo)}}function Jl(r,n){if(r&1&&(c(0,"option",9),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function Xl(r,n){if(r&1&&(c(0,"option",9),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e.id),a(),w(" ",e.name," ")}}function ec(r,n){if(r&1){let e=M();c(0,"div",16)(1,"mat-checkbox",17),D("change",function(t){C(e);let o=p().$implicit,s=p();return x(s.needWorkWasChanged(o,t))}),d(2),l()()}if(r&2){let e=p().$implicit,i=p();a(),le("handled",!e.needsWork),f("checked",!e.needsWork),a(),T(i.settings.lang.done)}}function tc(r,n){if(r&1){let e=M();c(0,"a",14),D("click",function(){C(e);let t=p().$implicit,o=p();return x(o.deliveryImages(t))}),c(1,"button",15)(2,"mat-icon"),d(3,"photo_camera"),l()(),d(4),l()}if(r&2){let e=p(2);a(4),w(" ",e.settings.lang.photos_taken_by_volunteer," ")}}function ic(r,n){if(r&1){let e=M();c(0,"a",14),D("click",function(){C(e);let t=p().$implicit,o=p();return x(o.showHelper(t))}),c(1,"button",15)(2,"mat-icon"),d(3,"list_alt"),l()(),d(4),l()}if(r&2){let e=p().$implicit,i=p();a(4),St(" ",i.settings.lang.deliveries," ",i.settings.lang.for," ",e.courier.name," ")}}function nc(r,n){if(r&1){let e=M();c(0,"mat-card")(1,"mat-card-header")(2,"div",10)(3,"mat-icon"),d(4),l()(),c(5,"mat-card-title",11)(6,"div"),d(7),v(8,ec,3,4,"div",12),l()(),c(9,"mat-card-subtitle"),d(10),v(11,tc,5,1,"a",13),c(12,"a",14),D("click",function(){let t=C(e).$implicit,o=p();return x(o.updateFamily(t))}),c(13,"button",15)(14,"mat-icon"),d(15,"edit"),l()(),d(16),l(),v(17,ic,5,3,"a",13),l()()()}if(r&2){let e=n.$implicit,i=p();a(4),T(i.icon(e)),a(3),w(" ",e.describe()," "),a(),f("ngIf",i.showNeedsWork(e)),a(2),St("",e.relativeDeliveryStatusDate(),", ",i.settings.lang.updatedBy," ",e.deliveryStatusUser==null?null:e.deliveryStatusUser.name," "),a(),f("ngIf",e.numOfPhotos>0&&i.isAdmin()),a(5),w(" ",i.settings.lang.deliveryDetails," "),a(),f("ngIf",e.courier)}}function oc(r,n){if(r&1){let e=M();c(0,"button",18),D("click",function(){C(e);let t=p();return x(t.moreNews())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.moreNews,`
20`)}}var co=(()=>{let n=class n{isAdmin(){return g.isAllowed(V.admin)}filterChange(){this.refresh()}deliveryImages(i){K(ys,t=>t.args=i)}constructor(i,t,o,s,m){this.dialog=i,this.busy=t,this.filters=o,this.activatedRoute=s,this.settings=m,this.shouldShowNeedsWork=new Map,this.destroyHelper=new dt,this.news=[],this.familySources=[{id:void 0,name:this.settings.lang.allFamilySources}],this.newsRows=50,i.onStatusChange(()=>this.refresh(),this.destroyHelper),i.onDistCenterChange(()=>this.refresh(),this.destroyHelper)}
20updateFamily(i){return h(this,null,function*(){i.showDetailsDialog({ui:this.dialog})})}showNeedsWork(i){return this.shouldShowNeedsWork.has(i.id)||this.shouldShowNeedsWork.set(i.id,i.needsWork),this.shouldShowNeedsWork.get(i.id)}needWorkWasChanged(i,t){i.needsWork=!t.checked,this.busy.donotWait(()=>h(this,null,function*(){return yield i.save()}))}showHelper(i){return h(this,null,function*(){K(Pi,t=>h(this,null,function*(){return t.argsHelper=i.courier}))})}ngOnDestroy(){this.destroyHelper.destroy()}ngOnInit(){return h(this,null,function*(){this.activatedRoute.routeConfig.path==n.needsWorkRoute.path&&this.filters.setToNeedsWork(),this.refresh(),this.familySources.push(...(yield g.repo(Bt).find({orderBy:{name:"asc"}})).map(i=>({id:i.id,name:i.name})))})}refresh(){return h(this,null,function*(){this.busy.donotWait(()=>h(this,null,function*(){this.news=yield g.repo(Pe).find({where:{distributionCenter:this.dialog.filterDistCenter(),$and:[this.filters.where()]},orderBy:{deliveryStatusDate:"desc"},limit:this.newsRows})}))})}moreNews(){this.newsRows*=2,this.refresh()}icon(i){switch(i.deliverStatus){case B.ReadyForDelivery:case B.DriverPickedUp:break;case B.Success:case B.SuccessLeftThere:case B.SuccessPickedUp:return"check";case B.FailedBadAddress:case B.FailedNotHome:case B.FailedDoNotWant:case B.FailedNotReady:case B.FailedTooFar:case B.FailedOther:return"error"}return"create"}};n.needsWorkRoute={path:"needsWork",component:n,canActivate:[ai]},n.\u0275fac=function(t){return new(t||n)(b(z),b(we),b(lo),b(We),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-news"]],decls:17,vars:9,consts:[["mat-mini-fab","","color","primary",2,"margin-bottom","5px",3,"click"],["href","https://youtu.be/Pa7QJTE3cqo","target","_blank","class","no-print","style","margin-right: 10px",4,"ngIf"],[2,"display","flex"],["appearance","outline",1,"full-width-form-field","dense-form-field"],["matNativeControl","",3,"ngModelChange","change","ngModel"],[3,"ngValue",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["mat-raised-button","","color","accent",3,"click",4,"ngIf"],["href","https://youtu.be/Pa7QJTE3cqo","target","_blank",1,"no-print",2,"margin-right","10px"],[3,"ngValue"],["mat-card-avatar","",1,"example-header-image"],[1,"newsHeader"],["style","margin-top: 7px",4,"ngIf"],["style","display: block",3,"click",4,"ngIf"],[2,"display","block",3,"click"],["mat-icon-button",""],[2,"margin-top","7px"],["color","primary",2,"padding","5px","border-radius","7px","border","solid 1px #2196f3","padding-top","2px","/* display","flex",3,"change","checked"],["mat-raised-button","","color","accent",3,"click"]],template:function(t,o){t&1&&(c(0,"button",0),D("click",function(){return o.refresh()}),c(1,"mat-icon"),d(2,"refresh"),l()(),v(3,Kl,2,1,"a",1),c(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),d(7),l(),c(8,"select",4),W("ngModelChange",function(m){return $(o.filters.currentFilter,m)||(o.filters.currentFilter=m),m}),D("change",function(){return o.filterChange()}),v(9,Jl,2,2,"option",5),l()(),c(10,"mat-form-field",3)(11,"mat-label"),d(12),l(),c(13,"select",4),W("ngModelChange",function(m){return $(o.filters.currentFamilySource,m)||(o.filters.currentFamilySource=m),m}),D("change",function(){return o.filterChange()}),v(14,Xl,2,2,"option",5),l()()(),v(15,nc,18,9,"mat-card",6)(16,oc,2,1,"button",7)),t&2&&(a(3),f("ngIf",o.settings.showVideo()),a(4),T(o.settings.lang.filter),a(),L("ngModel",o.filters.currentFilter),a(),f("ngForOf",o.filters.filters),a(3),T(o.settings.lang.familySource),a(),L("ngModel",o.filters.currentFamilySource),a(),f("ngForOf",o.familySources),a(),f("ngForOf",o.news),a(),f("ngIf",o.news.length==o.newsRows))},dependencies:[me,q,ei,ti,Xt,de,pe,lt,Mi,Q,Ye,Jt,xe,Na,Pa,Mn,Fi,mt,ve,ct],styles:[`.icon[_ngcontent-%COMP%]{font-size:36px}.newsHeader[_ngcontent-%COMP%]{font-size:14px}.handled[_ngcontent-%COMP%]{background-color:#c8e1ff}
21/*# sourceMappingURL=news.component-VQOGRPHW.css.map */`]});let r=n;return r})();function ac(r,n){if(r&1){let e=M();c(0,"mat-panel-description",7)(1,"mat-checkbox",8),W("ngModelChange",function(t){C(e);let o=p().$implicit;return $(o.selected,t)||(o.selected=t),x(t)}),d(2),l()()}if(r&2){let e=p().$implicit;a(),L("ngModel",e.selected),a(),w(" ",e.name," ")}}function sc(r,n){if(r&1&&(c(0,"mat-panel-description",7),d(1),l()),r&2){let e=p().$implicit;a(),w(" ",e.name," ")}}function lc(r,n){if(r&1){let e=M();c(0,"mat-list-item",5),D("click",function(){let t=C(e).$implicit,o=p();return x(o.select(t))}),v(1,ac,3,2,"mat-panel-description",6)(2,sc,2,1,"mat-panel-description",6),k(3,"mat-divider"),l()}if(r&2){let e=p();a(),f("ngIf",e.args.multiSelect),a(),f("ngIf",!e.args.multiSelect)}}function cc(r,n){if(r&1){let e=M();c(0,"button",9),D("click",function(){C(e);let t=p();return x(t.confirm())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.confirm," ")}}var Is=(()=>{let n=class n{constructor(i,t){this.d=i,this.settings=t}ngOnInit(){}select(i){return this.args.multiSelect?i.selected?i.selected=!1:i.selected=!0:(this.args.onSelect&&this.args.onSelect([i]),this.close()),!1}confirm(){this.args.onSelect(this.args.options.filter(i=>i.selected)),this.close()}close(){this.d.close()}};n.\u0275fac=function(t){return new(t||n)(b(Sn),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-select-list"]],decls:9,vars:4,consts:[["mat-dialog-title",""],["role","list"],["style","height: max-content",3,"click",4,"ngFor","ngForOf"],["mat-raised-button","","color","warning",3,"click"],["mat-raised-button","","color","accent",3,"click",4,"ngIf"],[2,"height","max-content",3,"click"],["style","height: max-content",4,"ngIf"],[2,"height","max-content"],[3,"ngModelChange","ngModel"],["mat-raised-button","","color","accent",3,"click"]],template:function(t,o){t&1&&(c(0,"h3",0),d(1),l(),c(2,"mat-dialog-content")(3,"mat-nav-list",1),v(4,lc,4,2,"mat-list-item",2),l()(),c(5,"mat-dialog-actions")(6,"button",3),D("click",function(){return o.close()}),d(7),l(),v(8,cc,2,1,"button",4),l()),t&2&&(a(),T(o.args.title),a(3),f("ngForOf",o.args.options),a(3),w(" ",o.settings.lang.cancel," "),a(),f("ngIf",o.args.multiSelect))},dependencies:[me,q,de,pe,Q,mt,Oa,kn,In,Et,Xa,Ft,Mt]});let r=n;return r})();var it=class r{static insertRows(n,e){return h(this,null,function*(){let i=new yn(10);for(let t of n){let o=g.repo(ae).create(),s=g.repo(se).create();for(let u in t.values){let y=an(o,s,u);y!=o.$.id&&y!=s.$.id&&(y.inputValue=t.values[u].newValue,yield y.load())}o.name||(o.name="\u05DC\u05DC\u05D0 \u05E9\u05DD");let m=()=>h(this,null,function*(){yield o.save(),e&&(s._disableMessageToUsers=!0,o.updateDelivery(s),Qe().isSytemForMlt&&(s.distributionCenter=yield g.context.findClosestDistCenter(o.addressHelper.location)),yield s.save())});yield i.push(m())}yield i.done()})}static updateColsOnServer(n,e,i,t){return h(this,null,function*(){for(let o of n)yield r.actualUpdateCol(o,e,i,t,yield g.context.getSettings());return n})}static actualUpdateCol(n,e,i,t,o){return h(this,null,function*(){let s=r.actualGetColInfo(n,e);if(s.existingDisplayValue==s.newDisplayValue)return;let m=yield g.repo(Ie).findId(n.basketType),u=yield g.repo(ye).findId(n.distCenter),y=yield g.repo(ae).findId(n.duplicateFamilyInfo[0].id),E=yield g.repo(se).findFirst({family:n.duplicateFamilyInfo[0].id,distributionCenter:u,deliverStatus:B.isNotAResultStatus(),basketType:t?m:void 0});
21E||(E=y.createDelivery(u),E.basketType=m);let I=s.newValue;I===null&&(I="");let N=an(y,E,e);if(N.inputValue=I,yield y.save(),y.updateDelivery(E),i){for(let H of E.$)if(H==N){E._disableMessageToUsers=!0,o.isSytemForMlt&&(E.distributionCenter=yield g.context.findClosestDistCenter(y.addressHelper.location)),yield E.save();break}}s.existingDisplayValue=yield mo(an(y,E,e)),s.existingValue=an(y,E,e).inputValue})}static actualGetColInfo(n,e){let i=n.values[e];return i||(i={newDisplayValue:"",existingDisplayValue:"",newValue:"",existingValue:""}),i}static checkExcelInput(n,e,i){return h(this,null,function*(){let t={errorRows:[],identicalRows:[],newRows:[],updateRows:[]},o=yield P.getAsync();for(let s of n){s.duplicateFamilyInfo=[];let m=u=>h(this,null,function*(){s.duplicateFamilyInfo.length==0&&(s.duplicateFamilyInfo=(yield g.repo(ae).find({where:{status:{"!=":Ge.ToDelete},$and:[u]}})).map(y=>({id:y.id,address:y.address,name:y.name,tz:!0,removedFromList:y.status==Ge.RemovedFromList,rank:9})))});if(s.idInHagai?yield m({id:s.idInHagai}):(s.iDinExcel&&s.duplicateFamilyInfo.length==0&&(yield m({iDinExcel:s.iDinExcel})),s.tz&&s.duplicateFamilyInfo.length==0&&(yield m({tz:s.tz})),s.duplicateFamilyInfo.length==0&&(s.duplicateFamilyInfo=yield ae.checkDuplicateFamilies(s.name,s.tz,s.tz2,s.phone1ForDuplicateCheck,s.phone2ForDuplicateCheck,s.phone3ForDuplicateCheck,s.phone4ForDuplicateCheck,void 0,!0,s.address),s.duplicateFamilyInfo.length>1&&s.duplicateFamilyInfo.find(u=>u.nameDup&&u.sameAddress)&&(s.duplicateFamilyInfo=s.duplicateFamilyInfo.filter(u=>!mc(u))))),o.removedFromListStrategy==Ht.ignore&&(s.duplicateFamilyInfo=s.duplicateFamilyInfo.filter(u=>!u.removedFromList)),!s.duplicateFamilyInfo||s.duplicateFamilyInfo.length==0)t.newRows.push(s);else if(s.duplicateFamilyInfo.length>1)s.error=Z().moreThanOneRowInDbMatchesExcel,t.errorRows.push(s);else{let u=!1,y;if({ef:y,hasDifference:u}=yield pr(s,s.duplicateFamilyInfo[0].id,i,e),y.status==Ge.RemovedFromList)switch(o.removedFromListStrategy){case Ht.displayAsError:s.error=F.language.familyAlreadyRemovedFromList,t.errorRows.push(s);break;case Ht.showInUpdate:t.updateRows.push(s);break;case Ht.ignore:t.newRows.push(s);break}else u?t.updateRows.push(s):t.identicalRows.push(s)}}return t})}};S([Y({allowed:V.familyAdmin}),_("design:type",Function),_("design:paramtypes",[Array,Boolean]),_("design:returntype",Promise)],it,"insertRows",null);S([Y({allowed:V.familyAdmin}),_("design:type",Function),_("design:paramtypes",[Array,String,Boolean,Boolean]),_("design:returntype",Promise)],it,"updateColsOnServer",null);S([Y({allowed:V.familyAdmin}),_("design:type",Function),_("design:paramtypes",[Array,Array,Boolean]),_("design:returntype",Promise)],it,"checkExcelInput",null);function pr(r,n,e,i){return h(this,null,function*(){let t=!1,o=yield g.repo(Ie).findId(r.basketType),s=yield g.repo(ye).findId(r.distCenter),m=yield g.repo(ae).findId(n),u=yield g.repo(se).findFirst({family:m.id,distributionCenter:s,deliverStatus:B.isNotAResultStatus(),basketType:e?o:void 0});u||(u=m.createDelivery(s),e&&(o=o),u.deliverStatus=void 0);for(let y of i){let E=r.values[y];E||(E={newDisplayValue:"",newValue:"",existingDisplayValue:"",existingV
21alue:""},r.values[y]=E);let I=an(m,u,y);if(E.existingValue=I.inputValue,E.existingDisplayValue=yield mo(I),E.existingValue==E.newValue&&E.existingValue==""&&(E.newDisplayValue=E.existingDisplayValue),E.existingDisplayValue!=E.newDisplayValue){if(I==m.$.groups){let N=m.groups.evilGet(),H=E.newValue;if(!H||H.toString()=="")E.newValue=E.existingValue,E.newDisplayValue=E.existingDisplayValue;else if(N&&N.trim().length>0){let R=N.toString().split(",").map(U=>U.trim());for(let U of H.split(",").map(j=>j.trim()))R.indexOf(U)<0&&R.push(U);E.newValue=R.join(", "),E.newDisplayValue=E.newValue}}E.existingDisplayValue!=E.newDisplayValue&&(t=!0)}}return{ef:m,hasDifference:t}})}function an(r,n,e){let i=e.split(".");return i[0]==r._.repository.metadata.key?r.$[i[1]]:n.$[i[1]]}function mc(r){return r.nameDup&&!r.sameAddress&&!r.phone1&&!r.phone2&&!r.phone3&&!r.phone4&&!r.tz&&!r.tz2}function mo(r){return h(this,null,function*(){return r.displayValue?.trim()})}var pc=["stepper"],uc=["file"];function hc(r,n){if(r&1&&(c(0,"a",11),d(1),l()),r&2){let e=p();a(),T(e.settings.lang.excelImportVideo)}}function fc(r,n){if(r&1&&(c(0,"option",19),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function gc(r,n){if(r&1){let e=M();c(0,"li")(1,"select",15),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.field,t)||(o.field=t),x(t)}),c(2,"option",16),d(3),l(),v(4,fc,2,2,"option",17),l(),c(5,"input",15),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.value,t)||(o.value=t),x(t)}),l(),c(6,"button",18),D("click",function(){let t=C(e).index,o=p(2);return x(o.additionalColumns.splice(t,1))}),d(7),l()()}if(r&2){let e=n.$implicit,i=p(2);a(),L("ngModel",e.field),a(2),T(i.settings.lang.excelColumnIgnore),a(),f("ngForOf",i.columns),a(),L("ngModel",e.value),a(2),w(" ",i.settings.lang.remove," ")}}function _c(r,n){if(r&1&&(c(0,"option",19),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function yc(r,n){if(r&1){let e=M();c(0,"th"),d(1),k(2,"br"),c(3,"select",15),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.field,t)||(o.field=t),x(t)}),c(4,"option",16),d(5),l(),v(6,_c,2,2,"option",17),l()()}if(r&2){let e=n.$implicit,i=p(2);a(),w(" ",e.title," "),a(2),L("ngModel",e.field),a(2),w(" ",i.settings.lang.excelColumnIgnore," "),a(),f("ngForOf",i.columns)}}function vc(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getTheData(e.excelField+i)," ")}}function wc(r,n){if(r&1&&(X(0),c(1,"tr")(2,"td"),d(3),l(),v(4,vc,2,1,"td",12),l(),ee()),r&2){let e=n.$implicit,i=p(2);a(3),T(e),a(),f("ngForOf",i.excelColumns)}}function Cc(r,n){if(r&1){let e=M();X(0),c(1,"button",10),D("click",function(){C(e);let t=p();return x(t.loadSettings())}),d(2),l(),c(3,"button",10),D("click",function(){C(e);let t=p();return x(t.clearSettings())}),d(4),l(),c(5,"button",7),D("click",function(){C(e);let t=p();return t.saveSettings(),x(t.moveToAdvancedSettings())}),d(6),l(),c(7,"h4"),d(8),l(),c(9,"ul"),v(10,gc,8,5,"li",12),l(),c(11,"button",10),D("click",function(){C(e);let t=p();return x(t.additionalColumns.push({}))}),d(12),l(),c(13,"h4"),d(14),l(),c(15,"div",13)(16,"table",14)(17,"tr")(18,"th"),d(19,"#"),l(),v(20,yc,7,4,"th",12),l(),v(21,wc,5,2,"ng-container",12),l()(),d(22),ee()}if(r&2){let e=p();a(2),w(" ",e.settings.lang.loadExcelSettings," "),a(2),w(" ",e.settings.lang.deleteExcelSettings," "),a(2),w(" ",e.settings.lang.nextStep," "),a(2),T(e.settings.lang.addColumnsThatAreNotInTheFile),a(2),f("ngForOf",e.additionalColumns),a(2),w(" ",e.settings.lang.addExcelColumn," "),a(2),Nr(" ",e.settings.lang.columnSelectionInFile,' "',e.filename,'", ',e.settings.lang.excelSheet,': "',e.sheet,'" '),a(6),f("ngForOf",e.excelColumns),a(),f("ngForOf",e.rows),a(),St(" ",e.settings.lang.total," ",e.rows.length," ",e.settings.lang.linesInExcel," ")}}function xc(r,n){if(r&1&&k(0,"data-area",20),r&2){let e=p();f("settings",e.settingsArea)}}function Dc(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.c.caption," ")}}function bc(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function Sc(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(7);
21a(),T(e.settings.lang.excelCompareToThisFamilyAnd)}}function Ic(r,n){if(r&1){let e=M();c(0,"li"),d(1),c(2,"a",18),D("click",function(){let t=C(e).$implicit,o=p(6);return x(o.updateFamily(t))}),d(3),l(),k(4,"br"),c(5,"a",18),D("click",function(){let t=C(e).$implicit,o=p(4).$implicit,s=p(2);return x(s.moveFromErrorToUpdate(o,t))}),v(6,Sc,2,1,"span",6),d(7),l()()}if(r&2){let e=n.$implicit,i=p(4).$implicit,t=p(2);le("error",e.removedFromList),a(),be(" ",e.name," - ",t.displayDupInfo(e)," - "),a(2),T(t.settings.lang.familyDetails),a(3),f("ngIf",i.duplicateFamilyInfo.length>1),a(),w(" ",t.settings.lang.moveToUpdateFamilies,"")}}function kc(r,n){if(r&1&&(c(0,"ul"),v(1,Ic,8,7,"li",26),l()),r&2){let e=p(3).$implicit;a(),f("ngForOf",e.duplicateFamilyInfo)}}function Ec(r,n){if(r&1&&(c(0,"span"),d(1),l()),r&2){let e=p(5);a(),w(" ",e.settings.lang.excelNoneOfTheseFamiliesMatch,"")}}function Mc(r,n){if(r&1){let e=M();c(0,"tr")(1,"td",24)(2,"span",25),d(3),l(),v(4,kc,2,1,"ul",6),c(5,"a",18),D("click",function(){C(e);let t=p(2).$implicit,o=p(2);return x(o.moveFromErrorToAdd(t))}),v(6,Ec,2,1,"span",6),d(7),l()()()}if(r&2){let e=p(2).$implicit,i=p(2);a(3),T(e.error),a(),f("ngIf",e.duplicateFamilyInfo&&e.duplicateFamilyInfo.length>=1),a(2),f("ngIf",e.duplicateFamilyInfo&&e.duplicateFamilyInfo.length>1),a(),w(" ",i.settings.lang.moveToNewFamilies,"")}}function Fc(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p(3).$implicit,t=p(2);le("match",t.getColInfo(i.otherExcelRow,e).newDisplayValue==t.getColInfo(i,e).newDisplayValue),a(),w(" ",t.getColInfo(i.otherExcelRow,e).newDisplayValue," ")}}function Tc(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td",24)(3,"span",25),d(4),l()()(),c(5,"tr",27)(6,"td"),d(7),l(),v(8,Fc,2,3,"td",28),l(),c(9,"tr")(10,"td",24)(11,"a",18),D("click",function(){C(e);let t=p(2).$implicit,o=p(2);return x(o.moveFromErrorToProcess(t))}),d(12),l()()(),ee()}if(r&2){let e=p(2).$implicit,i=p(2);a(4),T(e.error),a(3),T(e.otherExcelRow.rowInExcel),a(),f("ngForOf",i.columnsInCompare),a(4),St("",i.settings.lang.readExcelRow," ",e.rowInExcel," ",i.settings.lang.excelReadLineAnyhow,"")}}function Rc(r,n){if(r&1&&(X(0),v(1,Mc,8,4,"tr",6)(2,Tc,13,6,"ng-container",6),ee()),r&2){let e=p().$implicit;a(),f("ngIf",!e.otherExcelRow),a(),f("ngIf",e.otherExcelRow)}}function Ac(r,n){if(r&1){let e=M();X(0),c(1,"tr",23)(2,"td")(3,"mat-checkbox",15),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.userIgnoreError,t)||(o.userIgnoreError=t),x(t)}),l(),d(4),l(),v(5,bc,2,1,"td",12),l(),v(6,Rc,3,2,"ng-container",6),ee()}if(r&2){let e=n.$implicit,i=p(2);a(),le("disabledErrorRow",e.userIgnoreError),a(2),L("ngModel",e.userIgnoreError),a(),w(" ",e.rowInExcel," "),a(),f("ngForOf",i.columnsInCompare),a(),f("ngIf",!e.userIgnoreError)}}function Oc(r,n){if(r&1){let e=M();c(0,"mat-tab",3)(1,"div",13)(2,"table",21)(3,"tr"),k(4,"th"),v(5,Dc,2,1,"th",12),l(),v(6,Ac,7,6,"ng-container",12),l()(),c(7,"div",22)(8,"mat-checkbox",15),W("ngModelChange",function(t){C(e);let o=p();return $(o.stopAskingQuestions,t)||(o.stopAskingQuestions=t),x(t)}),d(9),l()()()}if(r&2){let e=p();bt("label","",e.settings.lang.errors," -  ",e.errorRows.length,""),a(5),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.errorRows),a(2),L("ngModel",e.stopAskingQuestions),a(),T(e.settings.lang.stopAskingForConfirmation)}}function Vc(r,n){if(r&1){let e=M();c(0,"mat-icon",30),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.updateAllCol(t))}),d(1,"done_all "),l()}}function Pc(r,n){if(r&1&&(c(0,"th"),d(1),v(2,Vc,2,0,"mat-icon",29),l()),r&2){let e=n.$implicit,i=p(2);a(),w(" ",e.c.caption," "),a(),f("ngIf",i.getColUpdateCount(e)>0)}}function Nc(r,n){if(r&1){let e=M();X(0),k(1,"br"),c(2,"span",33),d(3),l(),c(4,"mat-icon",34),D("click",function(){C(e);let t=p().$implicit,o=p().$implicit,s=p(2);return x(s.clearColumnUpdate(o,t))}),d(5,"close "),l(),c(6,"mat-icon",30),D("click",function(){C(e);let t=p().$implicit,o=p().$implicit,s=p(2);return x(s.updateCol(o,t))}),d(7,"done"),l(),ee()}if(r&2){let e=p().$implicit,i=p().$implicit,t=p(2);a(3),T(t.getColInfo(i,e).existingDisplayValue)}}function Bc(r,n){if(r&1&&(c(0,"td")(1,"span"),d(2),l(),v(3,Nc,8,1,"ng-container",6),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),le("newValue",i.duplicateFamilyInfo&&i.duplicateFamilyInfo.length==1&&t.getColInfo(i,e).newDisplayValue!=t.getColInfo(i,e).existingDisplayValue),a(),w(" ",t.getColInfo(i,e).newDisplayValue,""),a(),f("ngIf",i.duplicateFamilyInfo&&i.duplicateFamilyInfo.length==1&&t.getColInfo(i,e).newDisplayValue!=t.getColInfo(i,e).existingDisplayValue)}}function Hc(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td")(3,"mat-menu",null,2)(5,"button",31),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.openFamilyInfo(t))}),d(6),l(),c(7,"button",31),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.familyHistory(t))}),d(8),l(),c(9,"button",31),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.updateRows.splice(o.updateRows.indexOf(t),1))}),d(10),l(),c(11,"button",31),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.moveFromUpdateToAdd(t))}),d(12),l()(),c(13,"button",32)(14,"mat-icon"),d(15,"more_vert"),l()()(),c(16,"td"),d(17
21),k(18,"br"),l(),v(19,Bc,4,4,"td",12),l(),ee()}if(r&2){let e=n.$implicit,i=Nt(4),t=p(2);a(6),w(" ",t.settings.lang.familyDetails," "),a(2),w(" ",t.settings.lang.familyHistory," "),a(2),w(" ",t.settings.lang.removeFromFamiliesToUpdate," "),a(2),w(" ",t.settings.lang.moveToNewFamilies," "),a(),f("matMenuTriggerFor",i),a(4),T(e.rowInExcel),a(2),f("ngForOf",t.columnsInCompare)}}function Lc(r,n){if(r&1&&(c(0,"mat-tab",3)(1,"div",13)(2,"table",21)(3,"tr"),k(4,"th")(5,"th"),v(6,Pc,3,2,"th",12),l(),v(7,Hc,20,7,"ng-container",12),l()()()),r&2){let e=p();bt("label","",e.settings.lang.familiesForUpdate," - ",e.updateRows.length,""),a(6),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.updateRows)}}function $c(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.c.caption," ")}}function Wc(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function jc(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td")(3,"mat-icon",34),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.newRows.splice(o.newRows.indexOf(t),1))}),d(4," delete_forever"),l()(),c(5,"td"),d(6),k(7,"br"),l(),v(8,Wc,2,1,"td",12),l(),ee()}if(r&2){let e=n.$implicit,i=p(2);a(6),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare)}}function zc(r,n){if(r&1){let e=M();c(0,"mat-tab",3)(1,"button",7),D("click",function(){C(e);let t=p();return x(t.addAll())}),d(2),l(),c(3,"div",13)(4,"table",21)(5,"tr"),k(6,"th")(7,"th"),v(8,$c,2,1,"th",12),l(),v(9,jc,9,2,"ng-container",12),l()()()}if(r&2){let e=p();bt("label","",e.settings.lang.newFamilies," - ",e.newRows.length,""),a(2),w(" ",e.settings.lang.addAllFamilies," "),a(6),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.newRows)}}function Uc(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.c.caption," ")}}function Gc(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function qc(r,n){if(r&1&&(X(0),c(1,"tr")(2,"td"),d(3),k(4,"br"),l(),v(5,Gc,2,1,"td",12),l(),ee()),r&2){let e=n.$implicit,i=p(2);a(3),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare)}}function Qc(r,n){if(r&1&&(c(0,"mat-tab",3)(1,"div",13)(2,"table",21)(3,"tr"),k(4,"th"),v(5,Uc,2,1,"th",12),l(),v(6,qc,6,2,"ng-container",12),l()()()),r&2){let e=p();bt("label","",e.settings.lang.existingFamilies," - ",e.identicalRows.length,""),a(5),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.identicalRows)}}var Bi=class Bi{constructor(n,e,i,t){this.dialog=n,this.busy=e,this.routeHelper=i,this.settings=t,this.excelColumns=[],this.additionalColumns=[],this.columns=[],this.rows=[],this.columnsInCompare=[],this.settingsArea=new ne,this.errorRows=[],this.newRows=[],this.identicalRows=[],this.updateRows=[],this.stopAskingQuestions=!1}getData(){return this.getTheData(this.cell)}getTheData(n){let e=this.worksheet[n];return!e||!e.w?"":e.w.trim()}getColInfo(n,e){return it.actualGetColInfo(n,ze(e))}addAll(){return h(this,null,function*(){let n=this.newRows.length;(yield this.dialog.YesNoPromise(F.language.shouldAdd+" "+n+" "+F.language.families+"?"))&&this.busy.doWhileShowingBusy(()=>h(this,null,function*(){try{let e=[],i=new Date().valueOf(),t=i,o=0,s=[...this.newRows];for(let m of s)if(e.push(m),o++,e.length==35){if(new Date().valueOf()-i>1e4){let u=(new Date().valueOf()-t)/o*(n-o)/1e3/60;this.dialog.Info(m.rowInExcel+" "+m.name+" "+u.toFixed(1)+" "+F.language.minutesRemaining)}yield it.insertRows(e,this.addDelivery);for(let u of e)u.created=!0;this.identicalRows.push(...e);for(let u of e)this.newRows.splice(this.newRows.indexOf(u),1);e=[]}if(e.length>0){yield it.insertRows(e,this.addDelivery);for(let m of e)m.created=!0;this.identicalRows.push(...e)}this.newRows=[],this.sortRows(),this.dialog.Info(F.language.familiesAddedSuccesfull)}catch(e){yield this.dialog.exception("Excel Import",e),this.newRows=this.newRows.filter(i=>this.identicalRows.indexOf(i)<0)}this.createImportReport(),(yield this.dialog.YesNoPromise(F.language.gotoDeliveriesScreen))&&this.routeHelper.navigateToComponent((yield import("./chunk-XYEVH7IQ.js")).FamiliesComponent)}))})}updateAllCol(n){return h(this,null,function*(){let e=this.getColUpdateCount(n),i=F.language.shouldUpdateColumn+" "+n.c.caption+" "+F.language.for+" "+e+" "+F.language.families+"?";n.c==this.f.address&&(i+=F.language.updateOfAddressMayTakeLonger),this.dialog.YesNoQuestion(i,()=>{this.busy.doWhileShowingBusy(()=>h(this,null,function*(){let t=[],o=[],s=new Date().valueOf();for(let m of this.updateRows){let u=this.getColInfo(m,n);u.newDisplayValue!=u.existingDisplayValue?t.push(m):o.push(m),t.length==35&&(o.push(...yield it.updateColsOnServer(t,ze(n),this.addDelivery,this.compareBasketType)),new Date().valueOf()-s>1e3&&this.dialog.Info(m.rowInExcel+" "+m.name),t=[])}t.length>0&&o.push(...yield it.updateColsOnServer(t,ze(n),this.addDelivery,this.compareBasketType)),this.sortRows(),this.updateRows=o}))})})}updateCol(n,e){return h(this,null,function*(){let i=yield it.updateColsOnServer([n],ze(e),this.addDelivery,this.compareBasketType);n.values=i[0].values})}clearColumnUpdate(n,e){return h(this,null,function*(){let i=this.getColInfo(n,e);
21i.newDisplayValue=i.existingDisplayValue,i.newValue=i.existingValue})}getColUpdateCount(n){let e=0,i=ze(n);for(let t of this.updateRows){let o=t.values[i];o&&o.newDisplayValue!=o.existingDisplayValue&&e++}return e}fileChange(n){return h(this,null,function*(){var e=n.target.files,i;if(!(!e||e.length==0)){i=e[0];var t=new FileReader;t.onload=o=>h(this,null,function*(){try{yield this.busy.doWhileShowingBusy(()=>h(this,null,function*(){this.filename=i.name;for(var m="",u=new Uint8Array(o.target.result),y=u.byteLength,E=0;E<y;E++)m+=String.fromCharCode(u[E]);this.oFile=(yield import("./chunk-WDWKR4NF.js")).read(m,{type:"binary",cellDates:!0,cellStyles:!0});let I=this.oFile.SheetNames,N=I[0];I.length>1&&(yield new Promise(oe=>setTimeout(()=>{oe({})},500)),yield K(Is,oe=>{oe.args={title:F.language.selectExcelSheet,options:I.map(ke=>({name:ke,item:ke})),onSelect:ke=>N=ke[0].name}})),this.sheet=N,this.worksheet=this.oFile.Sheets[N];let H=this.worksheet["!ref"];if(!H)throw F.language.excelSheel+' "'+this.sheet+'" '+F.language.excelSheetIsEmpty;let R=H.substr(H.indexOf(":")+1),U="A";for(let oe=0;oe<R.length;oe++){let ke=R[oe];if("1234567890".indexOf(ke)>=0){U=R.substring(0,oe),this.totalRows=+R.substring(oe,20);break}}if(!this.totalRows)debugger;this.totalRows>5e5&&(this.totalRows=0);let j="",De="A",he=0;for(this.excelColumns=[];;){this.excelColumns.push({excelField:j+De,field:void 0,title:this.getTheData(j+De+1)});let oe=!1;j+De==U&&(oe=!0);let ke=De.charCodeAt(0);if(ke++,De=String.fromCharCode(ke),De>"Z"&&(De="A",j=="A"?j="B":j="A"),oe||this.excelColumns.length>100)break}for(let oe of this.excelColumns){let ke=oe.title;switch(ke){case this.f.status.caption:case this.f.fixedCourier.caption:break;default:for(let Ot of this.columns)if(ke==Ot.name||Ot.searchNames&&Ot.searchNames.indexOf(ke)>=0){oe.field=Ot;break}break}}this.rows=[];for(let oe=2;oe<=this.totalRows;oe++)this.rows.push(oe)}))}catch(m){throw this.fileInput.nativeElement.value="",m}this.fileInput.nativeElement.value="",localStorage.getItem(Es)==this.filename&&this.loadSettings(),this.stepper.next()}),t.readAsArrayBuffer(i)}})}readLine(n,e){return h(this,null,function*(){let i=g.repo(ae).create(),t=g.repo(se).create();t.basketType=this.defaultBasketType,t.distributionCenter=this.distributionCenter,t.deliverStatus=this.settings.getDefaultStatus(),i.status=Ge.Active,t.quantity=1,i._disableAutoDuplicateCheck=!0;let o=new ur(this.dialog,this.settings.excelImportAutoAddValues,t);for(let E of this.excelColumns)if(E.field){let I=this.getTheData(E.excelField+n);I&&I.length>0&&(yield E.field.updateFamily(I,i,o))}for(let E of this.additionalColumns)yield E.field.updateFamily(E.value,i,o);o.laterSteps.sort((E,I)=>E.step-I.step);for(let E of o.laterSteps)yield E.what();this.useFamilyMembersAsNumOfBaskets&&!e.get(this.fd.quantity)&&(t.quantity=i.familyMembers),this.settings.excelImportUpdateFamilyDefaultsBasedOnCurrentDelivery&&(t.$.basketType.valueChanged()&&(i.basketType=t.basketType),t.$.distributionCenter.valueChanged()&&(i.defaultDistributionCenter=t.distributionCenter),t.$.quantity.valueChanged()&&(i.quantity=t.quantity),t.$.items.valueChanged()&&(i.items=t.items),t.$.deliveryComments.valueChanged()&&(i.deliveryComments=t.deliveryComments),t.$.courier.valueChanged()&&(i.fixedCourier=t.courier)),i.phone1?.displayValue==i.phone2?.displayValue&&(i.phone2=new fe(""));let s={name:i.name,tz:i.tz,tz2:i.tz2,address:i.address,phone1ForDuplicateCheck:i.phone1?.thePhone,phone2ForDuplicateCheck:i.phone2?.thePhone,phone3ForDuplicateCheck:i.phone3?.thePhone,phone4ForDuplicateCheck:i.phone4?.thePhone,distCenter:t.distributionCenter?.id,basketType:t.basketType.id,idInHagai:e.get(this.f.id)?i.id:"",iDinExcel:i.iDinExcel,valid:!0,rowInExcel:n,values:{}};i.name||(s.error=this.settings.lang.lineWithNoName);for(let E of[i,t])for(let I of E.$)if(I.error&&(I.error&&(I.error+=", "),I.error+=I.metadata.caption+": "+I.error,s.valid=!1),I.value!==void 0){var m=I.inputValue,u=I.metadata.valueConverter.toInput(I.value),y=I.metadata.options.valueConverter.toInput(I.value);s.values[ze({e:E._.repository.metadata,c:I.metadata})]={newDisplayValue:yield mo(I),newValue:I.inputValue}}return s})}ngOnInit(){return h(this,null,function*(){this.addDelivery=!0,this.defaultBasketType=yield g.context.defaultBasketType(),this.distributionCenter=this.dialog.distCenter,this.distributionCenter==null&&(this.distributionCenter=yield g.context.defaultDistributionCenter());let n=(t,o,s=" ")=>{t.value?t.inputValue=(t.inputValue+s+o).trim():t.inputValue=o};if(this.fDefs=g.repo(ae).metadata,this.f=this.fDefs.fields,this.fdDefs=g.repo(se).metadata,this.fd=this.fdDefs.fields,0)try{}catch(t){}let e=(t,o)=>{this.columns.push({key:t.key,name:t.caption,updateFamily:(s,m)=>h(this,null,function*(){n(m.$.find(t),s)}),searchNames:o,columns:[t]})},i=t=>{for(let o of t)e(o)};e(this.f.name,[F.language.lastName,F.language.family]),e(this.f.area),this.columns.push({key:"firstName",name:F.language.firstName,updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:2,what:()=>h(this,null,function*(){return n(o.$.name,t)})})}),columns:[this.f.name],searchNames:[F.language.firstNameShort]}),i([this.f.postalCode]),this.columns.push({key:"id",name:this.f.id.c
21aption,updateFamily:(t,o,s)=>h(this,null,function*(){o.id=t}),columns:[this.f.id],searchNames:[this.f.id.caption]}),this.columns.push({key:"address",name:F.language.address,searchNames:[F.language.streetName],updateFamily:(t,o)=>h(this,null,function*(){if(this.settings.lang.languageCode=="iw"){let s=No(t);s.address&&n(o.$.address,s.address),s.dira&&n(o.$.appartment,s.dira),s.floor&&n(o.$.floor,s.floor),s.knisa&&n(o.$.entrance,s.knisa)}else o.address=t}),columns:[this.f.address,this.f.appartment,this.f.floor,this.f.entrance]}),this.columns.push({key:"city",name:F.language.city,searchNames:["\u05D9\u05E9\u05D5\u05D1","\u05D9\u05D9\u05E9\u05D5\u05D1"],updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:3,what:()=>h(this,null,function*(){return n(o.$.address,t)})})}),columns:[this.f.address]}),this.columns.push({key:"houseNum",name:F.language.houseNumber,searchNames:["\u05D1\u05D9\u05EA","\u05DE\u05E1' \u05D1\u05D9\u05EA","\u05DE\u05E1 \u05D1\u05D9\u05EA"],updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:2,what:()=>h(this,null,function*(){let m=No(t);m.address&&n(o.$.address,m.address),m.dira&&n(o.$.appartment,m.dira),m.floor&&n(o.$.floor,m.floor),m.knisa&&n(o.$.entrance,m.knisa)})})}),columns:[this.f.address]}),this.columns.push({key:"boxes",name:F.language.quantity,updateFamily:(t,o,s)=>h(this,null,function*(){let m=+da(t);m<1&&(m=1),s.fd.quantity=m}),columns:[this.fd.quantity]}),this.columns.push({key:"deliveryComments",name:this.fd.deliveryComments.caption,updateFamily:(t,o,s)=>h(this,null,function*(){n(s.fd.$.deliveryComments,t)}),columns:[this.fd.deliveryComments]}),this.columns.push({key:"basketType",name:this.fd.basketType.caption,updateFamily:(t,o,s)=>h(this,null,function*(){yield s.lookupAndInsert(Ie,m=>({name:m}),t,m=>m,s.fd.$.basketType)}),columns:[this.fd.basketType]}),this.columns.push({key:"items",name:this.fd.items.caption,updateFamily:(t,o,s)=>h(this,null,function*(){return n(s.fd.$.items,t,", ")}),columns:[this.fd.items]}),this.columns.push({key:"itemKey",name:this.settings.lang.item,updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:2,what:()=>h(this,null,function*(){s.fd.items+=t})})}),columns:[this.fd.items]}),this.columns.push({key:"itemQuantityKey",name:this.settings.lang.itemQuantity,updateFamily:(t,o,s)=>h(this,null,function*(){s.fd.items+=t+" "}),columns:[this.fd.items]}),this.columns.push({key:"distCenterName",name:this.fd.distributionCenter.caption,updateFamily:(t,o,s)=>h(this,null,function*(){yield s.lookupAndInsert(ye,m=>({name:m}),t,m=>m,s.fd.$.distributionCenter)}),columns:[this.fd.distributionCenter]}),this.columns.push({key:"familySource",name:this.f.familySource.caption,updateFamily:(t,o,s)=>h(this,null,function*(){yield s.lookupAndInsert(Bt,m=>({name:m}),t,m=>m,o.$.familySource)}),columns:[this.f.familySource]}),this.columns.push({key:"volunteer",name:this.fd.courier.caption+" "+F.language.volunteerName,updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:3,what:()=>h(this,null,function*(){if(s.gotVolunteerPhone){if(s.fd.courier){let m=s.fd.courier;m.isNew()||(m.name=t,yield m.save())}}else yield s.lookupAndInsert(G,m=>({name:m}),t,m=>m,s.fd.$.courier,m=>{m._disableDuplicateCheck=!0})})})}),columns:[this.fd.courier]}),this.columns.push({key:"volunteerPhone",name:this.fd.courier.caption+" "+F.language.phone,updateFamily:(t,o,s)=>h(this,null,function*(){s.gotVolunteerPhone=!0,t=fe.fixPhoneInput(t),yield s.lookupAndInsert(G,m=>({phone:m}),new fe(t),m=>m,s.fd.$.courier,m=>{m.name="\u05DE\u05EA\u05E0\u05D3\u05D1 "+t})}),columns:[this.fd.courier]});for(let t of[this.f.phone1,this.f.phone2,this.f.phone3,this.f.phone4,this.f.socialWorkerPhone1,this.f.socialWorkerPhone2])this.columns.push({key:t.key,name:t.caption,columns:[t],updateFamily:(o,s)=>h(this,null,function*(){s.$.find(t).value=new fe(po(o,this.settings.defaultPrefixForExcelImport))})});e(this.f.familyMembers,["\u05E0\u05E4\u05E9\u05D5\u05EA","\u05DE\u05E1 \u05E0\u05E4\u05E9\u05D5\u05EA"]),e(this.f.tz,["\u05EA.\u05D6.",'\u05EA"\u05D6']),e(this.f.tz2);for(let t of[this.f.custom1,this.f.custom2,this.f.custom3,this.f.custom4])ha(t)&&e(t);i([this.f.iDinExcel,this.f.floor,this.f.appartment,this.f.entrance,this.f.buildingCode,this.f.socialWorker,this.f.email]);for(let t of[this.f.phone1Description,this.f.phone2Description,this.f.phone3Description,this.f.phone4Description,this.f.internalComment,this.f.addressComment])this.columns.push({key:t.key,name:t.caption,updateFamily:(o,s,m)=>h(this,null,function*(){n(s.$.find(t),o,", ")}
21),columns:[t]});this.columns.push({key:this.f.groups.key,name:this.f.groups.caption,updateFamily:(t,o,s)=>h(this,null,function*(){if(t&&t.trim().length>0){let m=yield g.repo(ki).findFirst({name:t.trim()},{createIfNotFound:!0,useCache:!0});m.isNew()&&(yield m.save())}o.groups=o.groups.addGroup(t)}),columns:[this.f.groups]}),this.columns.push({key:"phone_complex",name:F.language.phone,updateFamily:(t,o,s)=>h(this,null,function*(){s.laterSteps.push({step:2,what:()=>h(this,null,function*(){Zc(t,o,this.settings.defaultPrefixForExcelImport)})})}),columns:[this.f.phone1,this.f.phone1Description,this.f.phone2,this.f.phone2Description,this.f.phone3,this.f.phone3Description,this.f.phone4,this.f.phone4Description]}),this.columns.sort((t,o)=>t.name>o.name?1:t.name<o.name?-1:0)})}get $(){return Le(this,g)}moveToAdvancedSettings(){this.stepper.next();let n=this.buildUpdatedColumns();this.settingsArea=new ne({fields:()=>{let e=this.settings,i=[];return i=[this.$.addDelivery,{field:e.$.defaultDeliveryStatusIsEnquireDetails,visible:()=>this.addDelivery&&e.usingCallModule},{field:this.$.defaultBasketType,visible:()=>this.addDelivery&&!n.get(this.fd.basketType)&&!n.get(this.f.basketType)},{field:e.$.excelImportUpdateFamilyDefaultsBasedOnCurrentDelivery,visible:()=>this.addDelivery},{field:this.$.compareBasketType,visible:()=>this.addDelivery},{field:this.$.distributionCenter,visible:()=>this.addDelivery&&!n.get(this.fd.distributionCenter)&&this.dialog.hasManyCenters},{field:this.$.useFamilyMembersAsNumOfBaskets,visible:()=>this.addDelivery&&!n.get(this.fd.quantity)&&n.get(this.f.familyMembers)},e.$.defaultPrefixForExcelImport,e.$.checkIfFamilyExistsInFile,e.$.checkDuplicatePhones,e.$.excelImportAutoAddValues,e.$.checkIfFamilyExistsInDb,e.$.removedFromListStrategy],i}})}iterateExcelFile(n=!1){return h(this,null,function*(){this.errorRows=[],this.newRows=[],this.updateRows=[],this.identicalRows=[];let e=[],i,t=new Map,o=new Map;this.stepper.next();let s=this.buildUpdatedColumns();yield this.busy.doWhileShowingBusy(()=>h(this,null,function*(){let m=this.buildUpdatedColumns();if(this.addDelivery)s.set(this.fd.basketType,!0),s.set(this.fd.distributionCenter,!0),s.set(this.fd.quantity,!0);else for(let N of this.fd)s.set(N,!1);s.set(this.f.status,!0),s.set(this.fd.deliverStatus,!0),this.columnsInCompare=[],this.columnsInCompareMemberName=[];var u=[];for(let N of[this.fDefs,this.fdDefs])for(let H of N.fields)if(s.get(H)){if(H==this.fd.distributionCenter&&!this.dialog.hasManyCenters)continue;H==this.f.basketType||H==this.f.quantity||H==this.f.items||H==this.f.deliveryComments||H==this.f.fixedCourier||H==this.f.defaultDistributionCenter?u.push(H):(this.columnsInCompare.push({c:H,e:N}),this.columnsInCompareMemberName.push(ze({e:N,c:H})))}for(let N of u)this.columnsInCompare.push({c:N,e:this.fDefs}),this.columnsInCompareMemberName.push(ze({e:this.fDefs,c:N}));yield new Promise(N=>setTimeout(()=>{N({})},500));let y;var E=new Date().valueOf();try{for(y=2;y<=this.totalRows;y++){if(y%1e4==0){var I=(new Date().valueOf()-E)/y*(this.totalRows-y)/1e3/60;this.dialog.Info(y+" "+F.language.linesProcessed+" "+I.toFixed(1)+" "+F.language.minutesRemaining),yield new Promise(j=>{setTimeout(()=>{j({})},100)})}let R=yield this.readLine(y,m),U=!0;if(!i)U=!1;else for(let j in R.values)if(j!=ze({e:this.fdDefs,c:this.fd.items})&&j!=ze({e:this.fDefs,c:this.f.id})&&j!=ze({e:this.fdDefs,c:this.fd.id})&&Object.prototype.hasOwnProperty.call(R.values,j)&&R.values[j]?.newValue!==i.values[j]?.newValue){U=!1;break}if(U){let j=ze({e:this.fdDefs,c:this.fd.items});i.values[j].newValue+=", "+R.values[j].newValue,i.values[j].newDisplayValue+=", "+R.values[j].newDisplayValue,e.length==0&&e.push(i)}else if(R.error)this.errorRows.push(R);else{i=R;let j=(De,he,oe)=>{let ke=De;if(!De||(De=De.replace(/\D/g,""),De.length==0)||+De==0)return!1;let Ot=he.get(+De);return Ot&&Ot.rowInExcel<y?(R.error=oe+" - "+ke+" - "+F.language.alreadyExistsInLine+" "+Ot.rowInExcel,R.otherExcelRow=Ot,!0):(he.set(+De,R),!1)};this.settings.checkDuplicatePhones||(R.phone1ForDuplicateCheck="",R.phone2ForDuplicateCheck="",R.phone3ForDuplicateCheck="",R.phone4ForDuplicateCheck=""),this.settings.checkIfFamilyExistsInFile&&(j(R.tz,t,F.language.socialSecurityNumber)||this.settings.checkDuplicatePhones&&
21(j(R.phone1ForDuplicateCheck,o,F.language.phone1)||j(R.phone2ForDuplicateCheck,o,F.language.phone2)||j(R.phone3ForDuplicateCheck,o,F.language.phone3)||j(R.phone4ForDuplicateCheck,o,F.language.phone4)))?this.errorRows.push(R):e.push(R)}e.length==50&&(this.dialog.Info(y-1+" "+(R.name?R.name:F.language.unnamed)+" "+(R.error?R.error:"")),yield this.processExcelRowsAndCheckOnServer(e),e=[])}e.length>0&&(yield this.processExcelRowsAndCheckOnServer(e));let N=new Map,H=[];for(let R of this.updateRows)if(R.duplicateFamilyInfo&&R.duplicateFamilyInfo.length==1){let U;if(U=N.get(R.duplicateFamilyInfo[0].id))U.push(R);else{let j=[R];N.set(R.duplicateFamilyInfo[0].id,j),H.push(j)}}this.sortRows();for(let R of H)if(R.length>1)for(let U of R)U.error=F.language.sameLineExcelMatchesSeveralRowsInTheDatabase+" "+R.map(j=>j.rowInExcel.toString()).join(", "),this.errorRows.push(U),this.updateRows.splice(this.updateRows.indexOf(U),1);if(this.newRows.length>0&&this.settings.lang.languageCode=="iw"){let R=0;for(let j of this.newRows)(!j.address||j.address.match(/[0-9]$/))&&R++;let U=R*100/this.newRows.length;U>30&&s.get(this.f.address)&&(yield this.dialog.YesNoPromise(U.toFixed()+"% "+F.language.manyAddressesEndWithNumber))&&(this.stepper.previous(),this.stepper.previous())}sessionStorage.setItem("columnsInCompare",JSON.stringify(this.columnsInCompareMemberName))}catch(N){this.stepper.previous(),this.dialog.exception("import aborted in line - "+y+": ",N)}}))})}processExcelRowsAndCheckOnServer(n){return h(this,null,function*(){if(this.settings.checkIfFamilyExistsInDb){let e=yield it.checkExcelInput(n,this.columnsInCompareMemberName,this.compareBasketType);this.errorRows.push(...e.errorRows),this.newRows.push(...e.newRows),this.updateRows.push(...e.updateRows),this.identicalRows.push(...e.identicalRows)}else this.newRows.push(...n)})}buildUpdatedColumns(){let n=new Map;this.additionalColumns=this.additionalColumns.filter(e=>e.field);for(let e of[...this.excelColumns.map(i=>i.field),...this.additionalColumns.map(i=>i.field)])if(e)for(let i of e.columns)n.set(i,!0);return this.settings.excelImportUpdateFamilyDefaultsBasedOnCurrentDelivery&&(n.get(this.fd.basketType)&&n.set(this.f.basketType,!0),n.get(this.fd.distributionCenter)&&n.set(this.f.defaultDistributionCenter,!0),n.get(this.fd.courier)&&n.set(this.f.fixedCourier,!0),n.get(this.fd.quantity)&&n.set(this.f.quantity,!0),n.get(this.fd.items)&&n.set(this.f.items,!0),n.get(this.fd.deliveryComments)&&n.set(this.f.deliveryComments,!0)),n}displayDupInfo(n){let e="";return n.removedFromList&&(e=F.language.removedFromList+"! "),e+sa(n)}saveSettings(){let n={storedColumns:[],additionalColumns:[]};for(let e of this.excelColumns)n.storedColumns.push({excelField:e.excelField,columnKey:e.field?e.field.key:void 0});for(let e of this.additionalColumns)n.additionalColumns.push({value:e.value,columnKey:e.field?e.field.key:void 0});localStorage.setItem(ks,JSON.stringify(n)),localStorage.setItem(Es,this.filename)}loadSettings(){let n=JSON.parse(localStorage.getItem(ks));if(n){for(let e of this.excelColumns)for(let i of n.storedColumns)if(i.excelField==e.excelField){e.field=void 0;for(let t of this.columns)t.key==i.columnKey&&(e.field=t)}this.additionalColumns=[];for(let e of n.additionalColumns)for(let i of this.columns)i.key==e.columnKey&&this.additionalColumns.push({field:i,value:e.value})}}clearSettings(){for(let n of this.excelColumns)n.field=void 0}moveFromErrorToAdd(n){return h(this,null,function*(){let e=n.name;if(e||(e=F.language.unnamed),yield this.ask(F.language.moveTheFamily+" "+e+" "+F.language.toNewFamilies+"?")){n.name||(n.name=e,n.values[ze({e:this.fDefs,c:this.f.name})]={newValue:n.name,newDisplayValue:n.name});let i=this.errorRows.indexOf(n);this.errorRows.splice(i,1),this.newRows.push(n),this.sortRows()}})}openFamilyInfo(n){return h(this,null,function*(){let e=yield g.repo(ae).findId(n.duplicateFamilyInfo[0].id);yield this.dialog.updateFamilyDialog({family:e})})}familyHistory(n){return h(this,null,function*(){let e=yield g.repo(ae).findId(n.duplicateFamilyInfo[0].id),i=new Ee(g.repo(Pe),{numOfColumnsInGrid:7,rowCssClass:t=>t.getCss(),columnSettings:t=>{let o=[t.deliverStatus,t.deliveryStatusDate,t.courierComments,{field:t.address,caption:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05DB\u05E4\u05D9 \u05E9\u05D9\u05D3\u05E2\u05E0\u05D5 \u05D0\u05D6"},t.floor,t.appartment,t.entrance,t.addressComment,t.internalDeliveryComment,t.distributionCenter];return o.push(...[...t].filter(s=>!o.includes(s)&&s!=t.id&&s!=t.familySource).sort((s,m)=>s.caption.localeCompare(m.caption))),o}
21,where:{family:e.id},orderBy:{deliveryStatusDate:"desc"},rowsInPage:25});K(si,t=>t.args={title:Z().familyHistory+" "+e.name,settings:i})})}moveFromErrorToProcess(n){return h(this,null,function*(){let e=n.name;if(e||(e=F.language.unnamed),yield this.ask(F.language.importFamily+" "+e+"?")){n.name||(n.name=e,n.values[ze({e:this.fDefs,c:this.f.name})]={newValue:n.name,newDisplayValue:n.name}),n.otherExcelRow=void 0;let i=this.errorRows.indexOf(n);this.errorRows.splice(i,1),yield this.processExcelRowsAndCheckOnServer([n]),this.sortRows()}})}moveFromErrorToUpdate(n,e){return h(this,null,function*(){(yield this.ask(F.language.shouldCompare+` "${n.name}" `+F.language.compareTo+`" ${e.name}" `+F.language.andMoveToUpdateFamilies))&&(yield this.actualMoveFromErrorToUpdate(n,e))})}ask(n){return h(this,null,function*(){return this.stopAskingQuestions?!0:yield this.dialog.YesNoPromise(n)})}actualMoveFromErrorToUpdate(n,e){return h(this,null,function*(){let i=yield pr(n,e.id,this.compareBasketType,this.columnsInCompareMemberName);n.duplicateFamilyInfo=[e],i.hasDifference?(this.updateRows.push(n),this.sortRows()):(this.identicalRows.push(n),this.sortRows()),this.errorRows.splice(this.errorRows.indexOf(n),1);for(let t of this.errorRows)if(t.duplicateFamilyInfo){let o=t.duplicateFamilyInfo.findIndex(s=>s.id==e.id);o>=0&&(t.duplicateFamilyInfo.splice(o,1),t.duplicateFamilyInfo.length==1&&this.actualMoveFromErrorToUpdate(t,t.duplicateFamilyInfo[0]))}})}moveFromUpdateToAdd(n){this.dialog.YesNoQuestion(F.language.moveTheFamily+" "+n.name+" "+F.language.toNewFamilies+"?",()=>{let e=this.updateRows.indexOf(n);this.updateRows.splice(e,1),this.newRows.push(n),this.sortRows()})}sortRows(){this.updateRows.sort((n,e)=>n.rowInExcel-e.rowInExcel),this.identicalRows.sort((n,e)=>n.rowInExcel-e.rowInExcel),this.newRows.sort((n,e)=>n.rowInExcel-e.rowInExcel),this.errorRows.sort((n,e)=>n.rowInExcel-e.rowInExcel)}testImport(){return h(this,null,function*(){g.isAllowed(V.admin)&&(yield this.settings.save()),yield this.iterateExcelFile(!1)})}createImportReport(){return h(this,null,function*(){let n=[],e=(i,t,o)=>{for(let s of i){let m={excelLine:s.rowInExcel,"import-status":t,error:s.error};s.created&&(m["import-status"]=F.language.addedToDb,s.error="");for(let u of this.columnsInCompare){let y=s.values[ze(u)];y&&(m[u.c.caption]=o?y.existingDisplayValue:y.newDisplayValue),m[u.c.caption]===void 0&&(m[u.c.caption]="")}n.push(m)}};e(this.newRows,F.language.notImported),e(this.updateRows,F.language.existsWithAnUpdate,!0),e(this.identicalRows,F.language.existsIdenticat),e(this.errorRows,F.language.error),n.sort((i,t)=>i.excelLine-t.excelLine),yield ia(this.busy,n,kt.getOrganizationFromContext()+" import summary "+new Date().toLocaleString("he").replace(/:/g,"-").replace(/\./g,"-").replace(/,/g,"")+this.filename)})}updateFamily(n){return h(this,null,function*(){let e=yield g.repo(ae).findId(n.id);this.dialog.updateFamilyDialog({family:e})})}};Bi.\u0275fac=function(e){return new(e||Bi)(b(z),b(we),b(Rt),b(P))},Bi.\u0275cmp=O({type:Bi,selectors:[["app-excel-import"]],viewQuery:function(e,i){if(e&1&&(ce(pc,7),ce(uc,7)),e&2){let t;te(t=ie())&&(i.stepper=t.first),te(t=ie())&&(i.fileInput=t.first)}},decls:27,vars:16,consts:[["stepper",""],["file",""],["updatedRowOptions","matMenu"],[3,"label"],["href","https://youtu.be/Jtmhyf8-E4g","target","_blank","class","no-print","style","margin-right: 10px",4,"ngIf"],["type","file",3,"input"],[4,"ngIf"],["mat-flat-button","",3,"click"],[3,"settings",4,"ngIf"],[3,"label",4,"ngIf"],["mat-raised-button","",3,"click"],["href","https://youtu.be/Jtmhyf8-E4g","target","_blank",1,"no-print",2,"margin-right","10px"],[4,"ngFor","ngForOf"],[1,"table-div"],[1,"table","table-bordered"],[3,"ngModelChange","ngModel"],["value",""],[3,"ngValue",4,"ngFor","ngForOf"],[3,"click"],[3,"ngValue"],[3,"settings"],[1,"table","table-bordered",2,"white-space","nowrap"],[2,"height","35px"],[1,"top-error-row"],["colspan","100"],[1,"error"],[3,"error",4,"ngFor","ngForOf"],[2,"background-color","lightgoldenrodyellow"],[3,"match",4,"ngFor","ngForOf"],["style","color: green",3,"click",4,"ngIf"],[2,"color","green",3,"click"],["mat-menu-item","",3,"click"],["mat-icon-button","",3,"matMenuTriggerFor"],[2,"color","red","text-decoration-line","line-through"],[2,"color","red",3,"click"]],template:function(e,i){if(e&1){let t=M();c(0,"mat-card")(1,"mat-horizontal-stepper",null,0)(3,"mat-step",3),v(4,hc,2,1,"a",4),c(5,"h3"),d(6),l(),c(7,"input",5,1),D("input",function(s){return C(t),x(i.fileChange(s))}),l()(),c(9,"mat-step",3),v(10,Cc,23,15,"ng-container",6),l(),c(11,"mat-step",3)(12,"button",7),D("click",function(){return C(t),x(i.testImport())}),d(13),l(),c(14,"h3"),d(15),l(),v(16,xc,1,1,"data-area",8),l(),c(17,"mat-step",3)(18,"h3"),d(19),l(),c(20,"mat-tab-group"),v(21,Oc,10,7,"mat-tab",9)(22,Lc,8,5,"mat-tab",9)(23,zc,10,6,"mat-tab",9)(24,Qc,7,5,"mat-tab",9),l(),c(25,"button",10),D("click",function(){return C(t),x(i.createImportReport())}),d(26),l()()()()}e&2&&(a(3),re("label",i.settings.lang.selectExcelFile),a(),f("ngIf",i.settings.showVideo()),a(2),T(i.settings.lang.selectExcelFile),a(3),re("label",i.settings.lang.mapExcelColumns),a(),f("ngIf",i.filename),a(),re("label",i.settings.lang.excelImportFinalSettings),a(2),w(" ",i.settings.lang.nextStep," "),a(2),T(i.settings.lang.excelImportFinalSettings),a(),f("ngIf",i.settingsArea),a(),re("label",i.settings.lang.executeExcelImport),a(2),T(i.settings.lang.excelImportResults),a(2),f("ngIf",i.errorRows&&i.errorRows.length),a(),f("ngIf",i.updateRows&&i.updateRows.length),a(),f("ngIf",i.newRows&&i.newRows.length),a(),f("ngIf",i.identicalRows&&i.identicalRows.length),a(2),w(" ",i.settings.lang.saveExcelImportReport," "))},dependencies:[me,q,ei,ti,Me,Xt,de,pe,$n,Wn,Q,Ye,xe,mt,ve,oi,ni,ri,Ai,Oi,Ce],styles:[`th[_ngcontent-%COMP%]{text-align:right}.table-div[_ngcontent-%COMP%]{width:100%;overflow:scroll;max-height:500px}.mat-icon-button[_ngcontent-%COMP%]{width:20px;height:20px;line-height:20px}.newValue[_ngcontent-%COMP%]{color:green}td[_ngcontent-%COMP%]{white-space:nowrap;word-wrap:none;max-width:300px;overflow:hidden}.disabledErrorRow[_ngcontent-%COMP%]{text-decoration:line-through}.error[_ngcontent-%COMP%]{color:red}.match[_ngcontent-%COMP%]{color:green}.top-error-row[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-top-width:8px;border-top-color:#a9a9a9}
22/*# sourceMappingURL=import-from-excel.component-QIY4LHM4.css.map */`]});var Ct=Bi;S([A.boolean({translation:r=>r.defineDeliveriesForFamiliesInExcel}),_("design:type",Boolean)],Ct.prototype,"addDelivery",void 0);S([A.boolean({translation:r=>r.ifBasketTypeInExcelIsDifferentFromExistingOneCreateNewDelivery}),_("design:type",Boolean)],Ct.prototype,"compareBasketType",void 0);S([$e(()=>Ie,{translation:r=>r.basketType}),_("design:type",Ie)],Ct.prototype,"defaultBasketType",void 0);S([$e(()=>ye,{translation:r=>r.distributionList}),_("design:type",ye)],Ct.prototype,"distributionCenter",void 0);S([A.boolean({translation:r=>r.useFamilyMembersAsQuantity}),_("design:type",Boolean)],Ct.prototype,"useFamilyMembersAsNumOfBaskets",void 0);var ks="excelSettingsSave",Es="excelLastFileName",ur=class{constructor(n,e,i){this.dialog=n,this.autoAdd=e,this.fd=i,this.laterSteps=[],this.gotVolunteerPhone=!1}lookupAndInsert(n,e,i,t,o,s){return h(this,null,function*(){let m=yield g.repo(n).findFirst(e(i),{createIfNotFound:!0,useCache:!0});if(m.isNew()){let u=o.metadata.caption+' "'+i+'" '+F.language.doesNotExist;if(this.autoAdd||(yield this.dialog.YesNoPromise(u+", "+F.language.questionAddToApplication+"?")))s&&s(m),yield m.save(),this.dialog.refreshFamiliesAndDistributionCenters();else throw u}o.value=t(m)})}};function po(r,n){return!r||r.startsWith("0")?r:(r.startsWith("o")||r.startsWith("O"))&&r[1]>="0"&&r[1]<="9"?"0"+r.substring(1,100):r.length==8||r.length==9?"0"+r:r.length==7&&n&&n.length>0?n+r:r}function Yc(r){if(!r)return[];let n=[],e=[],i="";for(let s=0;s<r.length;s++){let m=r[s];switch(m=="\u2013"&&(m="-"),m){case" ":case"/":case"\\":case",":case"-":case"|":(e.length==0||e[s-1]!=m)&&(i.length>0?(e.push(i),e.push(m),i=""):m=="-"&&(e.length>0?e.push(e.pop().trim()+m):e.push(m)));break;default:let u=Fs(m);u&&(i=="o"||i=="O")&&(i="0");let y=sn(i);u==y||i==""?i+=m:(e.push(i),i=m);break}}i>""&&e.push(i);let t=[];for(;e.length>0;){let s=e.pop();if(s==" "||s==","||s=="-"||s=="/"){let m=t.pop();if(m){let u=e.pop();u===void 0&&(u="");let y=sn(m),E=sn(u);if(s==" "&&m=="-"){if(s=m,m=e.pop(),!m)continue;y=sn(m)}if(y==E){if(!y){e.push(u+s+m);continue}if(y){if(u.length<2&&s==" "){e.push(u+m);continue}if(!u.startsWith("0")&&m.startsWith("0")&&m.length<4){e.push(m+s+u);continue}if(s=="/"&&m.length<4&&u.length>6){let I=u.substring(0,u.length-m.length)+m;t.push(I),t.push(u);continue}if((s=="-"||s==" ")&&u.length<7&&m.length<9){e.push(u+s+m);continue}}}t.push(m),t.push(u);continue}else continue}t.push(s)}t.reverse();let o={phone:"",comment:""};for(let s of t)s.trim().length!=0&&(sn(s)?o.phone?o.phone.length<5?o.phone+=s:(n.push(o),o={phone:s,comment:""}):o.phone=s:o.comment?(n.push(o),o={phone:"",comment:s}
22):o.comment=s);return o.phone?n.push(o):o.comment&&n.length>0&&(n[0].comment+=" "+o.comment),n.length==0||n[0].phone.length<7?[{phone:r,comment:""}]:n}function Zc(r,n,e){let i=Yc(r),t=1;for(let o of i){for(;t<=4&&n.$["phone"+t].value&&n.$["phone"+t].value.thePhone;)t++;if(t==4)return;n.$["phone"+t].value=new fe(po(o.phone,e));let s=n.$["phone"+t+"Description"];o.comment&&(s.value?s.value+=", ":s.value="",s.value+=o.comment)}}function sn(r){for(let n=0;n<r.length;n++){let e=r[n];if(e!=" "&&!Fs(e))return!1}return!0}function Fs(r){switch(r){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":case"+":return!0}return!1}function ze(r){return r.e.key+"."+r.c.key}var Jc=()=>({standalone:!0});function Xc(r,n){if(r&1&&(c(0,"mat-expansion-panel",null,1)(2,"mat-expansion-panel-header"),k(3,"app-family-in-list",9),l(),k(4,"app-family-info",10),l()),r&2){let e=n.$implicit,i=n.index;a(2),ko("mat-expansion-panel-header ",e.getCss(),""),a(),f("f",e)("i",i+1),a(),f("partOfAssign",!0)("f",e)("selfPickupScreen",!0)}}function em(r,n){if(r&1){let e=M();c(0,"button",11),D("click",function(){C(e);let t=p();return x(t.moreFamilies())}),d(1),l()}if(r&2){let e=p();a(),w(" ",e.settings.lang.moreFamilies,`
23`)}}var Hi=(()=>{let n=class n{constructor(i,t,o){this.busy=i,this.dialog=t,this.settings=o,this.destroyHelper=new dt,this.searchString="",this.showAllFamilies=!1,this.families=[],this.totalRows=0,this.pageSize=7,this.dialog.onDistCenterChange(()=>h(this,null,function*(){this.getRows()}),this.destroyHelper)}ngOnDestroy(){this.destroyHelper.destroy()}doFilter(){return h(this,null,function*(){yield this.busy.donotWait(()=>h(this,null,function*(){return this.getRows()}))})}getRows(){return h(this,null,function*(){let i=g.repo(se).query({where:{name:{$contains:this.searchString},distributionCenter:g.context.filterDistCenter(this.dialog.distCenter),deliverStatus:this.showAllFamilies?void 0:B.SelfPickup},orderBy:{name:"asc"},pageSize:this.pageSize});return Promise.all([i.count().then(t=>this.totalRows=t),i.getPage(0).then(t=>this.families=t)])})}clearHelper(){this.searchString="",this.doFilter()}showStatus(i){return i.deliverStatus==B.ReadyForDelivery?i.courier?"\u05DE\u05E9\u05D5\u05D9\u05D9\u05DA \u05DC\u05DE\u05EA\u05E0\u05D3\u05D1":"":i.deliverStatus.caption}ngOnInit(){return h(this,null,function*(){this.busy.donotWait(()=>h(this,null,function*(){return yield this.getRows()}))})}moreFamilies(){this.pageSize+=7,this.getRows()}};n.route={path:"self-pickup-families",component:n,canActivate:[An],data:{name:"\u05D1\u05D0\u05D9\u05DD \u05DC\u05E7\u05D7\u05EA",seperator:!0}},n.\u0275fac=function(t){return new(t||n)(b(we),b(z),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-self-pickup"]],decls:11,vars:8,consts:[["search",""],["myPanel",""],[1,"full-width"],["matInput","",3,"ngModelChange","input","ngModel","placeholder","ngModelOptions"],["matSuffix","",3,"click"],[3,"ngModelChange","change","ngModel"],[1,"no-print"],[4,"ngFor","ngForOf"],["mat-raised-button","","color","accent",3,"click",4,"ngIf"],[2,"width","100%",3,"f","i"],[3,"partOfAssign","f","selfPickupScreen"],["mat-raised-button","","color","accent",3,"click"]],template:function(t,o){if(t&1){let s=M();c(0,"mat-form-field",2)(1,"input",3,0),W("ngModelChange",function(u){return C(s),$(o.searchString,u)||(o.searchString=u),x(u)}),D("input",function(){return C(s),x(o.doFilter())}),l(),c(3,"mat-icon",4),D("click",function(){return C(s),x(o.clearHelper())}),d(4,"clear"),l()(),c(5,"mat-checkbox",5),W("ngModelChange",function(u){return C(s),$(o.showAllFamilies,u)||(o.showAllFamilies=u),x(u)}),D("change",function(){return C(s),x(o.doFilter())}),d(6),l(),c(7,"mat-accordion",6),v(8,Xc,5,8,"mat-expansion-panel",7),l(),k(9,"br"),v(10,em,2,1,"button",8)}t&2&&(a(),re("placeholder",o.settings.lang.searchFamily),L("ngModel",o.searchString),f("ngModelOptions",Si(7,Jc)),a(4),L("ngModel",o.showAllFamilies),a(),w("",o.settings.lang.showAllFamilies,`
24`),a(2),f("ngForOf",o.families),a(2),f("ngIf",o.families.length!=o.totalRows))},dependencies:[me,q,Me,de,pe,lt,ii,Q,mt,Un,jn,zn,ve,ct,Nn,is]});let r=n;return r})();var Ts=24*60*60*1e3,Li=class Li{get $(){return Le(this)}getEndOfMonth(){return new Date(this.fromDate.getFullYear(),this.fromDate.getMonth()+1,0)}today(){this.fromDate=new Date,this.toDate=new Date,this.dateChanged.emit()}next(){this.setRange(1)}previous(){this.setRange(-1)}setRange(n){if(this.fromDate.getDate()==1&&this.toDate.toDateString()==this.getEndOfMonth().toDateString())this.fromDate=new Date(this.fromDate.getFullYear(),this.fromDate.getMonth()+n,1),this.toDate=this.getEndOfMonth();else{let e=Math.abs(this.toDate.getTime()-this.fromDate.getTime());e<Ts&&(e=Ts),e*=n;let i=this.toDate;this.fromDate=new Date(this.fromDate.getTime()+e),this.toDate=new Date(i.getTime()+e)}this.dateChanged.emit()}constructor(n){this.settings=n,this.rangeWeekly=!1,this.dateChanged=new fi,this.rangeArea=new ne({fields:()=>[[this.$.fromDate,this.$.toDate]]})}ngOnInit(){let n=new Date;if(this.rangeWeekly){let e=new Date;e.setDate(n.getDate()-7),this.fromDate=e,this.toDate=n}else this.fromDate=new Date(n.getFullYear(),n.getMonth(),1),this.toDate=this.getEndOfMonth(),console.log({from:this.fromDate,to:this.toDate})}};Li.\u0275fac=function(e){return new(e||Li)(b(P))}
24,Li.\u0275cmp=O({type:Li,selectors:[["app-date-range"]],inputs:{rangeWeekly:"rangeWeekly"},outputs:{dateChanged:"dateChanged"},decls:15,vars:1,consts:[[2,"margin-bottom","10px","display","flex","justify-content","center","gap","10px"],["mat-raised-button","",3,"click"],["mat-mini-fab","","color","primary",2,"margin","0px",3,"click"],[2,"display","flex","align-content","flex-end"],[3,"settings"]],template:function(e,i){e&1&&(c(0,"div",0)(1,"button",1),D("click",function(){return i.previous()}),c(2,"mat-icon"),d(3,"keyboard_arrow_right"),l()(),c(4,"button",1),D("click",function(){return i.today()}),c(5,"mat-icon"),d(6,"today"),l()(),c(7,"button",1),D("click",function(){return i.next()}),c(8,"mat-icon"),d(9,"keyboard_arrow_left"),l()(),c(10,"button",2),D("click",function(){return i.dateChanged.emit()}),c(11,"mat-icon"),d(12,"refresh"),l()()(),c(13,"div",3),k(14,"data-area",4),l()),e&2&&(a(14),f("settings",i.rangeArea))},dependencies:[Q,Jt,ve,Ce]});var pt=Li;S([A.dateOnly(),_e({valueChange:r=>{r.toDate<r.fromDate&&(r.toDate=r.getEndOfMonth())}}),_("design:type",Date)],pt.prototype,"fromDate",void 0);S([A.dateOnly(),_("design:type",Date)],pt.prototype,"toDate",void 0);var ln=class{static getHelperHistoryInfo(n,e,i,t,o){return h(this,null,function*(){e=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);var s=new Zt,m=yield gt(g.repo(Pe)),u=yield gt(g.repo(G));let y=m.where({deliveryStatusDate:{">=":n,"<":e},distributionCenter:g.context.filterDistCenter(i),deliverStatus:t?B.isAResultStatus():void 0,archive:o?!0:void 0}),E=yield s.build("select ",[m.courier.getDbName(),s.columnInnerSelect(m,{select:()=>[u.name],from:u,where:()=>[s.build(u.id,"=",m.courier.getDbName())]}),s.columnInnerSelect(m,{select:()=>[u.company],from:u,where:()=>[s.build(u.id,"=",m.courier.getDbName())]}),s.columnInnerSelect(m,{select:()=>[u.phone],from:u,where:()=>[s.build(u.id,"=",m.courier.getDbName())]}),"deliveries","dates","families","succesful","selfassigned","firstd","lastd"]," from (",(yield s.build("select ",[m.courier,"count(*) deliveries",s.build("count (distinct date (",m.courierAssingTime,")) dates"),s.build("count (distinct ",m.family,") families"),s.build("sum (case when ",s.eq(m.courierAssignUser,m.courier)," and ",s.and(m.where({deliverStatus:B.isSuccess()}))," then 1 else 0 end) selfassigned"),s.build("sum (",s.case([{when:[m.where({deliverStatus:B.isSuccess()})],then:1}],0),") succesful"),s.build(s.func("to_char",s.func("min",m.deliveryStatusDate),"'YY-MM'")," firstd"),s.build(s.func("to_char",s.func("max",m.deliveryStatusDate),"'YY-MM'")," lastd")]," from ",m," where ",s.and(y)))+(yield s.build(" group by ",m.courier)),") x");return(yield Kt().execute(E)).rows})}};S([Y({allowed:V.admin,paramTypes:[Date,Date,ye,Boolean,Boolean]}),_("design:type",Function),_("design:paramtypes",[Date,Date,ye,Boolean,Boolean]),_("design:returntype",Promise)],ln,"getHelperHistoryInfo",null);var cn=class{static GetTimeline(n,e){return h(this,null,function*(){let i=gt(g.repo(Pe));e=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);let t=new Zt;t.addEntity(i,"Families");let o=yield Kt().execute(yield t.query({select:()=>[i.id,i.addressLatitude,i.addressLongitude,i.deliverStatus,i.courier,i.courierAssingTime,i.deliveryStatusDate],from:i,where:()=>[i.where({deliverStatus:B.isAResultStatus(),deliveryStatusDate:{">=":n,"<":e}})],orderBy:[i.addressLatitude,i.addressLongitude]}));return o.rows.map(s=>({id:s[o.getColumnKeyInResultForIndexInSelect(0)],lat:+s[o.getColumnKeyInResultForIndexInSelect(1)],lng:+s[o.getColumnKeyInResultForIndexInSelect(2)],status:+s[o.getColumnKeyInResultForIndexInSelect(3)],courier:s[o.getColumnKeyInResultForIndexInSelect(4)],courierTime:Ii.Date.toJson(s[o.getColumnKeyInResultForIndexInSelect(5)]),statusTime:Ii.Date.toJson(s[o.getColumnKeyInResultForIndexInSelect(6)])}))})}};S([Y({allowed:V.admin,paramTypes:[Date,Date]}),_("design:type",Function),_("design:paramtypes",[Date,Date]),_("design:returntype",Promise)],cn,"GetTimeline",null);var tm=["gmap"];function im(r,n){if(r&1){let e=M();X(0),k(1,"app-date-range"),c(2,"button",9),D("click",function(){C(e);let t=p();return x(t.select())}),d(3,"\u05D1\u05D7\u05E8"),l(),ee()}}function nm(r,n){if(r&1&&(c(0,"h3"),d(1),l()),r&2){let e=p();a(),T(e.settings.organisationName)}}function om(r,n){if(r&1&&(c(0,"div")(1,"div"),k(2,"img",10),l()()),r&2){let e=p();a(2),re("src",e.settings.logoUrl,Ke)}}function rm(r,n){if(r&1){let e=M();c(0,"h4",11),D("click",function(){C(e);let t=p();return x(t.animate())}),d(1),l()}if(r&2){let e=p();f("hidden",!e.ready),a(),w(" ",e.currentTime()," ")}}function am(r,n){if(r&1){let e=M();c(0,"button",12),D("click",function(){C(e);let t=p();return x(t.animate())}),d(1," \u05DC\u05D7\u05E6\u05D5 \u05E2\u05DC\u05D9 \u05D5\u05EA\u05D4\u05E0\u05D5 "),l()}if(r&2){let e=p();f("hidden",!e.ready)}}function sm(r,n){r&1&&(c(0,"div"),k(1,"img",13),l())}function lm(r,n){if(r&1){let e=M();c(0,"input",17),W("ngModelChange",function(t){C(e);let o=p(3);return $(o.height,t)||(o.height=t),x(t)}),l()}if(r&2){let e=p(3);L("ngModel",e.height)}}function cm(r,n){if(r&1){let e=M();c(0,"input",17),W("ngModelChange",function(t){C(e);let o=p(3);return $(o.zoom,t)||(o.zoom=t),x(t)}),l()}if(r&2){let e=p(3);L("ngModel",e.zoom)}}function mm(r,n){if(r&1){let e=M();c(0,"input",17),W("ngModelChange",function(t){C(e);let o=p(3);return $(o.speed,t)||(o.speed=t),x(t)}),l()}if(r&2){let e=p(3);L("ngModel",e.speed)}}function dm(r,n){if(r&1){let e=M();X(0),v(1,lm,1,1,"input",15),d(2),v(3,cm,1,1,"input",15),c(4,"button",16),D("click",function(){C(e);let t=p(2);return x(t.map.setZoom(+t.zoom))}),d(5," set "),l(),v(6,mm,1,1,"input",15),c(7,"mat-checkbox",17),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.showOnLeft,t)||(o.showOnLeft=t),x(t)}
24),d(8,"\u05D4\u05E6\u05D2 \u05DE\u05E9\u05DE\u05D0\u05DC"),l(),c(9,"mat-checkbox",17),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.showOrgLogo,t)||(o.showOrgLogo=t),x(t)}),d(10,"\u05D4\u05E6\u05D2 \u05DC\u05D5\u05D2\u05D5 \u05D0\u05E8\u05D2\u05D5\u05DF"),l(),c(11,"mat-checkbox",17),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.showOrgTitle,t)||(o.showOrgTitle=t),x(t)}),d(12,"\u05D4\u05E6\u05D2 \u05DB\u05D5\u05EA\u05E8\u05EA \u05D0\u05E8\u05D2\u05D5\u05DF"),l(),c(13,"mat-checkbox",17),W("ngModelChange",function(t){C(e);let o=p(2);return $(o.showHagaiLogo,t)||(o.showHagaiLogo=t),x(t)}),d(14,"\u05D4\u05E6\u05D2 \u05DC\u05D5\u05D2\u05D5 \u05D7\u05D2\u05D9"),l(),ee()}if(r&2){let e=p(2);a(),f("ngIf",e.ready),a(),w(" ",e.map.getZoom()," "),a(),f("ngIf",e.ready),a(3),f("ngIf",e.ready),a(),L("ngModel",e.showOnLeft),a(2),L("ngModel",e.showOrgLogo),a(2),L("ngModel",e.showOrgTitle),a(2),L("ngModel",e.showHagaiLogo)}}function pm(r,n){if(r&1){let e=M();c(0,"div"),v(1,dm,15,8,"ng-container",2),c(2,"a",14),D("click",function(){C(e);let t=p();return x(t.reset())}),d(3,"reset"),l()()}if(r&2){let e=p();a(),f("ngIf",!e.dialog.isScreenSmall())}}var $i=(()=>{let n=class n{constructor(i,t){this.settings=i,this.dialog=t,this.bounds=new google.maps.LatLngBounds,this.dict=new Map,this.mapInit=!1,this.statuses=new Vn(this.settings),this.ready=!1,this.height=600,this.position=0,this.zoom=0,this.speed=30,this.showOnLeft=!1,this.showOrgTitle=!1,this.showOrgLogo=!1,this.showHagaiLogo=!1,this.playing=!1,this.pie=new li({}),this.timeline=[]}select(){return h(this,null,function*(){this.ready=!0;let i=this.dateRange.fromDate,t=this.dateRange.toDate;var o={center:new google.maps.LatLng(32.3215,34.8532),zoom:17,mapTypeId:google.maps.MapTypeId.ROADMAP};this.mapInit||(this.map=new google.maps.Map(this.gmapElement.nativeElement,o),this.mapInit=!0);let s=yield cn.GetTimeline(i,t);for(let m of s){let u={marker:new google.maps.Marker({map:this.map,position:{lat:m.lat,lng:m.lng}}),prevStatus:void 0,prevCourier:void 0};this.bounds.extend(u.marker.getPosition());let y=this.statuses.ready;(m.status==B.SelfPickup.id||m.status==B.SuccessPickedUp.id)&&(y=this.statuses.selfPickup),y.value++,u.marker.setIcon(y.icon);let E=y,I=(H,R)=>{if(H==E)return;let U=E;R=new Date(R.valueOf()),this.timeline.push({caption:E.name+" > "+H.name,timeline:R,do:()=>{u.marker.setMap(void 0),u.marker=new google.maps.Marker({map:this.map,position:{lat:m.lat,lng:m.lng}}),u.marker.setAnimation(google.maps.Animation.DROP),u.marker.setIcon(H.icon),U.value--,H.value++},revert:()=>{U.value++,H.value--,u.marker.setMap(void 0),u.marker=new google.maps.Marker({map:this.map,position:{lat:m.lat,lng:m.lng}}),u.marker.setAnimation(google.maps.Animation.DROP),u.marker.setIcon(H.icon),u.marker.setIcon(U.icon)},orig:m}),E=H};m.courierTime&&y!=this.statuses.selfPickup&&I(this.statuses.onTheWay,Ii.Date.fromJson(m.courierTime));let N=this.statuses.getBy(m.status,m.courier);N!=y&&I(N,Ii.Date.fromJson(m.statusTime))}this.map.fitBounds(this.bounds),this.timeline.sort((m,u)=>m.timeline.valueOf()-u.timeline.valueOf()),this.timeline.splice(0,0,{caption:"start",do:()=>{},revert:()=>{},timeline:new Date(this.timeline[0].timeline.valueOf()-1),orig:void 0}),this.updateChart(),this.zoom=this.map.getZoom()})}getHeight(){return this.height.toString()+"px"}ngOnInit(){return h(this,null,function*(){var i={center:new google.maps.LatLng(32.3215,34.8532),zoom:17,mapTypeId:google.maps.MapTypeId.ROADMAP};this.mapInit||(this.map=new google.maps.Map(this.gmapElement.nativeElement,i),this.mapInit=!0)})}next(){let i=this.timeline[this.position].timeline.valueOf();do{if(this.position==this.timeline.length-1)break;this.position++,this.timeline[this.position].do()}while(this.timeline[this.position].timeline.valueOf()<i+1*1e3);this.updateChart()}prev(){let i=this.timeline[this.position].timeline.valueOf();do{if(this.position==0)break;this.timeline[this.position].revert(),this.position--}while(this.timeline[this.position].timeline.valueOf()>=i-60*1e3);this.updateChart()}animate(){this.playing=!0,setTimeout(()=>{this.next(),this.position<this.timeline.length-1&&this.animate()},+(this.speed*1e3/this.timeline.length))}reset(){for(;this.position>0;)this.prev();this.playing=!1}currentTime(){return this.timeline.length>
240?this.timeline[this.position].timeline.toLocaleString("he-il"):""}updateChart(){this.pie.reset(),this.statuses.statuses.forEach(i=>{this.pie.add(i.name,i.value,i.color)}),this.chart?.update()}};n.\u0275fac=function(t){return new(t||n)(b(P),b(z))},n.\u0275cmp=O({type:n,selectors:[["app-playback"]],viewQuery:function(t,o){if(t&1&&(ce(tm,7),ce(pt,5),ce(je,5)),t&2){let s;te(s=ie())&&(o.gmapElement=s.first),te(s=ie())&&(o.dateRange=s.first),te(s=ie())&&(o.chart=s.first)}},decls:16,vars:13,consts:[["gmap",""],[1,"full-page"],[4,"ngIf"],[2,"display","flex","justify-content","space-between","align-items","center"],["style","display: inline; margin-left: 15px",3,"hidden","click",4,"ngIf"],["mat-raised-button","","color","primary",3,"hidden","click",4,"ngIf"],[2,"display","block","width","350px","height","188px",3,"hidden"],["baseChart","","type","pie",3,"chartClick","data","options"],[1,"grow-item",3,"hidden"],["mat-raised-button","","color","primary",3,"click"],[3,"src"],[2,"display","inline","margin-left","15px",3,"click","hidden"],["mat-raised-button","","color","primary",3,"click","hidden"],["src","/assets/hagai-full.png"],[2,"position","fixed","bottom","0",3,"click"],[3,"ngModel","ngModelChange",4,"ngIf"],[3,"click"],[3,"ngModelChange","ngModel"]],template:function(t,o){if(t&1){let s=M();c(0,"div",1)(1,"div"),v(2,im,4,0,"ng-container",2)(3,nm,2,1,"h3",2),c(4,"div",3),v(5,om,3,1,"div",2),c(6,"div"),v(7,rm,2,2,"h4",4)(8,am,2,1,"button",5),c(9,"div",6)(10,"canvas",7),D("chartClick",function(u){return C(s),x(o.pie.chartClicked(u))}),l()()(),v(11,sm,2,0,"div",2),l()(),c(12,"div",1),k(13,"div",8,0),v(15,pm,4,1,"div",2),l()()}t&2&&(le("container",o.showOnLeft),a(2),f("ngIf",!o.ready),a(),f("ngIf",o.showOrgTitle),a(2),f("ngIf",o.showOrgLogo),a(2),f("ngIf",o.timeline.length>0),a(),f("ngIf",!o.playing&&o.ready),a(),f("hidden",!o.ready),a(),f("data",o.pie.data)("options",o.pie.options),a(),f("ngIf",o.showHagaiLogo),a(2),f("hidden",!o.ready),a(2),f("ngIf",o.ready))},dependencies:[q,Me,de,pe,Q,mt,je,pt],styles:[`@media screen and (min-width: 600px){.container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.container[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(1) > div[_ngcontent-%COMP%]{flex-direction:column}}
25/*# sourceMappingURL=playback.component-CLYD4PX7.css.map */`]});let r=n;return r})();var pi=class pi{get $(){return Le(this,g)}refresh(){return h(this,null,function*(){this.deliveries.reloadData(),yield this.refreshHelpers()})}ngOnDestroy(){this.destroyHelper.destroy()}constructor(n,e,i,t){this.busy=n,this.settings=e,this.dialog=i,this.routeHelper=t,this.onlyDone=!0,this.onlyArchived=!1,this.rangeArea=new ne({fields:()=>[this.$.onlyDone,this.$.onlyArchived]}),this.destroyHelper=new dt,this.mltColumns=[],this.deliveries=new Ee(g.repo(Pe),{rowCssClass:o=>o.getCss(),gridButtons:[{name:"playback",click:()=>this.routeHelper.navigateToComponent($i)},{name:this.settings.lang.exportToExcel,click:()=>h(this,null,function*(){let o=yield this.dialog.YesNoPromise(this.settings.lang.includeFamilyInfoInExcelFile);yield yi(this.settings,g.repo(Pe),this.deliveries,this.settings.lang.deliveries,this.dialog,(s,m)=>m==s.$.id||m==s.$.family,void 0,(s,m)=>h(this,null,function*(){yield Ie.addBasketTypes(s.basketType,s.quantity,m),s.addStatusExcelColumn(m),o&&(yield s.addFamilyInfoToExcelFile(m))}),s=>h(this,null,function*(){o&&(yield Pe.loadFamilyInfoForExcepExport(s))}))}),visible:()=>g.isAllowed(V.admin)}],columnSettings:o=>{let s=[o.name,{caption:this.settings.lang.deliverySummary,field:o.deliverStatus,readonly:!0,getValue:m=>m.getShortDeliveryDescription(),width:"300"},o.basketType,o.quantity,o.city,o.familySource,o.courierComments,o.courierAssignUser,o.courierAssingTime,o.deliveryStatusUser];for(let m of o)!s.includes(m)&&m!=o.id&&m!=o.family&&s.push(m);return this.settings.isSytemForMlt?this.mltColumns=[o.name,o.basketType,o.quantity,o.city,o.distributionCenter,o.receptionComments]:this.mltColumns=[],s},numOfColumnsInGrid:this.mltColumns.length?this.mltColumns.length:6,knowTotalRows:!0,rowsInPage:50,where:()=>{var o=this.dateRange.toDate;return o=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),{deliveryStatusDate:{">=":this.dateRange.fromDate,"<":o},distributionCenter:this.dialog.filterDistCenter(),deliverStatus:this.onlyDone?B.isAResultStatus():void 0,archive:this.onlyArchived?!0:void 0}},rowButtons:[{name:"",icon:"edit",showInLine:!0,click:o=>
25h(this,null,function*(){o.showDetailsDialog({ui:this.dialog})}),textInMenu:()=>Z().deliveryDetails},{name:"",icon:"replay",showInLine:!0,visible:o=>o.archive&&g.isAllowed(V.admin),click:o=>h(this,null,function*(){o.archive=!1,yield o.save(),this.refresh()}),textInMenu:()=>Z().revertArchive}]}),this.helperStorage=new Zr,this.dialog.onDistCenterChange(()=>this.refresh(),this.destroyHelper),this.helperInfo=new Ee(g.repo(Oe,this.helperStorage),{allowSelection:!0,liveQuery:!1,numOfColumnsInGrid:this.settings.isSytemForMlt?12:9,gridButtons:[{name:this.settings.lang.exportToExcel,visible:()=>g.isAllowed(V.admin),click:()=>h(this,null,function*(){yield yi(this.settings,g.repo(Oe,this.helperStorage),this.helperInfo,this.settings.lang.volunteers,this.dialog,(o,s)=>s==o.$.courier)})}],rowButtons:[{name:this.settings.lang.deliveries,click:o=>h(this,null,function*(){(yield g.repo(G).findId(o.courier)).showDeliveryHistory(this.dialog)})}],columnSettings:o=>{let s=[{field:o.name,width:"150"},{field:o.phone,width:"140"},{field:o.company,width:"150"},{field:o.deliveries,width:"75"},{field:o.succesful,width:"75"},{field:o.families,width:"75"},{field:o.dates,width:"75"},{field:o.firstDelivery,width:"75"},{field:o.lastDelivery,width:"75"}];
25return e.isSytemForMlt&&s.push({field:o.selfassigned,width:"75"},{field:o.giftsConsumed,width:"75"},{field:o.giftsPending,width:"75"}),s},rowsInPage:100,orderBy:{deliveries:"desc"},knowTotalRows:!0})}refreshHelpers(){return h(this,null,function*(){var n=yield ln.getHelperHistoryInfo(this.dateRange.fromDate,this.dateRange.toDate,this.dialog.distCenter,this.onlyDone,this.onlyArchived);let e=this.helperStorage.rows[yield g.repo(Oe).metadata.getDbName()];n=n.map(i=>(i.deliveries=+i.deliveries,i.dates=+i.dates,i.families=+i.families,i.succesful=+i.succesful,i.selfassigned=+i.selfassigned,i.giftsConsumed=+i.consumed,i.giftsPending=+i.pending,i.firstDelivery=i.firstd,i.lastDelivery=i.lastd,i)),e.splice(0,e.length,...n),this.helperInfo.reloadData()})}ngOnInit(){return h(this,null,function*(){this.mltColumns.length>0&&Xr(this.deliveries,this.mltColumns),this.dateRange.ngOnInit(),this.refreshHelpers()})}};pi.route={path:"history",component:pi,canActivate:[Re]},pi.\u0275fac=function(e){return new(e||pi)(b(we),b(P),b(z),b(Rt))},pi.\u0275cmp=O({type:pi,selectors:[["app-delivery-history"]],viewQuery:function(e,i){if(e&1&&ce(pt,7),e&2){let t;te(t=ie())&&(i.dateRange=t.first)}},decls:10,vars:9,consts:[[3,"dateChanged"],[3,"settings"],[3,"settings","height"]],template:function(e,i){e&1&&(c(0,"mat-card")(1,"app-date-range",0),D("dateChanged",function(){return i.refresh()}),l(),k(2,"data-area",1)(3,"br"),c(4,"h4"),d(5),l(),k(6,"data-grid",2),c(7,"h4"),d(8),l(),k(9,"data-grid",2),l()),e&2&&(a(2),f("settings",i.rangeArea),a(3),be("",i.settings.lang.deliveries," ",i.deliveries.totalRows,""),a(),f("settings",i.deliveries)("height","400"),a(2),be("",i.settings.lang.volunteers," ",i.helperInfo.totalRows,""),a(),f("settings",i.helperInfo)("height","400"))},dependencies:[xe,Tt,Ce,pt]});var ui=pi;S([A.boolean({translation:r=>r.showOnlyCompletedDeliveries}),_("design:type",Boolean)],ui.prototype,"onlyDone",void 0);S([A.boolean({translation:r=>r.showOnlyArchivedDeliveries}),_("design:type",Boolean)],ui.prototype,"onlyArchived",void 0);var Oe=class extends gn{};S([A.string(),_("design:type",String)],Oe.prototype,"courier",void 0);S([A.string({translation:r=>r.volunteerName}),_("design:type",String)],Oe.prototype,"name",void 0);S([$e(()=>fe,{translation:r=>r.phone}),_("design:type",fe)],Oe.prototype,"phone",void 0);S([oa(),_("design:type",String)],Oe.prototype,"company",void 0);S([A.integer({translation:r=>r.deliveries}),_("design:type",Number)],Oe.prototype,"deliveries",void 0);S([A.integer({translation:r=>r.delveriesSuccesfull}),_("design:type",Number)],Oe.prototype,"succesful",void 0);S([A.integer({translation:r=>r.selfAssigned}),_("design:type",Number)],Oe.prototype,"selfassigned",void 0);S([A.integer({translation:r=>r.families}),_("design:type",Number)],Oe.prototype,"families",void 0);S([A.integer({translation:r=>r.dates}),_("design:type",Number)],Oe.prototype,"dates",void 0);S([A.integer({caption:"\u05DE\u05EA\u05E0\u05D5\u05EA \u05E9\u05DE\u05D5\u05DE\u05E9\u05D5"}),_("design:type",Number)],Oe.prototype,"giftsConsumed",void 0);S([A.integer({caption:"\u05DE\u05EA\u05E0\u05D5\u05EA \u05D6\u05DE\u05D9\u05E0\u05D5\u05EA"}),_("design:type",Number)],Oe.prototype,"giftsPending",void 0);S([A.string({translation:r=>r.firstDelivery}),_("design:type",String)],Oe.prototype,"firstDelivery",void 0);S([A.string({translation:r=>r.lastDelivery}),_("design:type",String)],Oe.prototype,"lastDelivery",void 0);Oe=S([_n(void 0)],Oe);var Ze=class r{static insertHelperRows(n){return h(this,null,function*(){for(let e of n){let i=g.repo(G).create();for(let t in e.values)i[t]=e.values[t].newValue;yield i.save()}})}static updateHelperColsOnServer(n,e){return h(this,null,function*(){for(let i of n)yield r.actualUpdateCol(i,e);return n})}static actualUpdateCol(n,e){return h(this,null,function*(){let i=r.actualGetColInfo(n,e);if(i.existingDisplayValue==i.newDisplayValue)return;let t=yield g.repo(G).findId(n.duplicateHelperInfo[0].id),o=i.newValue;o===null&&(o=""),t.$[e].inputValue=o,yield t.save(),i.existingDisplayValue=yield uo(t.$[e]),i.existingValue=t.$[e].inputValue})}static checkExcelInputHelpers(n,e){return h(this,null,function*(){let i={errorRows:[],identicalRows:[],newRows:[],updateRows:[]};for(let t of n)if(t.duplicateHelperInfo=(yield g.repo(G).find({where:{phone:new fe(t.phone)}})).map(o=>({id:o.id,name:o.name})),!t.duplicateHelperInfo||t.duplicateHelperInfo.length==0)i.newRows.push(t);else if(t.duplicateHelperInfo.length>1)t.error="\u05DE\u05EA\u05E0\u05D3\u05D1 \u05E7\u05D9\u05D9\u05DD \u05D9\u05D5\u05EA\u05E8 \u05DE\u05E4\u05E2\u05DD \u05D0\u05D7\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD",i.errorRows.push(t);else{let o=yield g.repo(G).findId(t.duplicateHelperInfo[0].id),s=!1;for(let m of e){let u=t.values[m];u||(u={newDisplayValue:"",newValue:"",existingDisplayValue:"",existingV
25alue:""},t.values[m]=u);let y=o.$[m];u.existingValue=y.inputValue,u.existingDisplayValue=yield uo(y),u.existingDisplayValue!=u.newDisplayValue&&u.existingDisplayValue!=u.newDisplayValue&&(s=!0)}s?i.updateRows.push(t):i.identicalRows.push(t)}return i})}static actualGetColInfo(n,e){let i=n.values[e];return i||(i={newDisplayValue:"",existingDisplayValue:"",newValue:""}),i}};S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[Array]),_("design:returntype",Promise)],Ze,"insertHelperRows",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[Array,String]),_("design:returntype",Promise)],Ze,"updateHelperColsOnServer",null);S([Y({allowed:V.admin}),_("design:type",Function),_("design:paramtypes",[Array,Array]),_("design:returntype",Promise)],Ze,"checkExcelInputHelpers",null);function uo(r){return h(this,null,function*(){return r.displayValue?.trim()})}var um=["stepper"];function hm(r,n){if(r&1&&(c(0,"option",14),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function fm(r,n){if(r&1){let e=M();c(0,"li")(1,"select",10),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.column,t)||(o.column=t),x(t)}),c(2,"option",11),d(3),l(),v(4,hm,2,2,"option",12),l(),c(5,"input",10),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.value,t)||(o.value=t),x(t)}),l(),c(6,"button",13),D("click",function(){let t=C(e).index,o=p(2);return x(o.additionalColumns.splice(t,1))}),d(7),l()()}if(r&2){let e=n.$implicit,i=p(2);a(),L("ngModel",e.column),a(2),T(i.settings.lang.excelColumnIgnore),a(),f("ngForOf",i.columns),a(),L("ngModel",e.value),a(2),w(" ",i.settings.lang.remove," ")}}function gm(r,n){if(r&1&&(c(0,"option",14),d(1),l()),r&2){let e=n.$implicit;f("ngValue",e),a(),w(" ",e.name," ")}}function _m(r,n){if(r&1){let e=M();c(0,"th"),d(1),k(2,"br"),c(3,"select",10),W("ngModelChange",function(t){let o=C(e).$implicit;return $(o.column,t)||(o.column=t),x(t)}),c(4,"option",11),d(5),l(),v(6,gm,2,2,"option",12),l()()}if(r&2){let e=n.$implicit,i=p(2);a(),w(" ",e.title," "),a(2),L("ngModel",e.column),a(2),w(" ",i.settings.lang.excelColumnIgnore," "),a(),f("ngForOf",i.columns)}}function ym(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getTheData(e.excelColumn+i)," ")}}function vm(r,n){if(r&1&&(X(0),c(1,"tr")(2,"td"),d(3),l(),v(4,ym,2,1,"td",7),l(),ee()),r&2){let e=n.$implicit,i=p(2);a(3),T(e),a(),f("ngForOf",i.excelColumns)}}function wm(r,n){if(r&1){let e=M();X(0),c(1,"button",5),D("click",function(){C(e);let t=p();return x(t.loadSettings())}),d(2),l(),c(3,"button",5),D("click",function(){C(e);let t=p();return x(t.saveSettings())}),d(4),l(),c(5,"button",6),D("click",function(){C(e);let t=p();return x(t.testImport())}),d(6),l(),c(7,"h3"),d(8),l(),c(9,"ul"),v(10,fm,8,5,"li",7),l(),c(11,"button",5),D("click",function(){C(e);let t=p();return x(t.additionalColumns.push({}))}),d(12),l(),c(13,"h3"),d(14),l(),c(15,"div",8)(16,"table",9)(17,"tr")(18,"th"),d(19,"#"),l(),v(20,_m,7,4,"th",7),l(),v(21,vm,5,2,"ng-container",7),l()(),d(22),ee()}if(r&2){let e=p();a(2),w(" ",e.settings.lang.loadExcelSettings," "),a(2),w(" ",e.settings.lang.saveExcelSettings," "),a(2),w(" ",e.settings.lang.nextStep," "),a(2),T(e.settings.lang.addColumnsThatAreNotInTheFile),a(2),f("ngForOf",e.additionalColumns),a(2),w(" ",e.settings.lang.addExcelColumn," "),a(2),T(e.settings.lang.mapExcelColumns),a(6),f("ngForOf",e.excelColumns),a(),f("ngForOf",e.rows),a(),St(" >",e.settings.lang.total," ",e.rows.length," ",e.settings.lang.linesInExcel," ")}}function Cm(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.caption," ")}}function xm(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function Dm(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td")(3,"mat-icon",16),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.newRows.splice(o.newRows.indexOf(t),1))}),d(4," delete_forever"),l()(),c(5,"td"),d(6),k(7,"br"),l(),v(8,xm,2,1,"td",7),l(),ee()}if(r&2){let e=n.$implicit,i=p(2);a(6),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare)}}function bm(r,n){if(r&1){let e=M();c(0,"mat-tab",1)(1,"div",8)(2,"table",15)(3,"tr"),k(4,"th")(5,"th"),v(6,Cm,2,1,"th",7),l(),v(7,Dm,9,2,"ng-container",7),l()(),c(8,"button",6),D("click",function(){C(e);let t=p();return x(t.addAll())}),d(9),l()()}if(r&2){let e=p();bt("label","",e.settings.lang.newVolunteers," - ",e.newRows.length,""),a(6),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.newRows),a(2),w(" ",e.settings.lang.addAllVolunteers," ")}}function Sm(r,n){if(r&1){let e=M();c(0,"mat-icon",18),D("click",function(){C(e);let t=p().$implicit,o=p(2);return x(o.updateAllCol(t))}),d(1,"done_all "),l()}}function Im(r,n){if(r&1&&(c(0,"th"),d(1),v(2,Sm,2,0,"mat-icon",17),l()),r&2){let e=n.$implicit,i=p(2);a(),w(" ",e.caption," "),a(),f("ngIf",i.getColUpdateCount(e)>0)}}function km(r,n){if(r&1){let e=M();X(0),k(1,"br"),c(2,"span",19),d(3),l(),c(4,"mat-icon",16),D("click",function(){C(e);let t=p().$implicit,o=p().$implicit,s=p(2);return x(s.clearColumnUpdate(o,t))}),d(5,"close "),l(),c(6,"mat-icon",18),D("click",function(){C(e);let t=p().$implicit,o=p().$implicit,s=p(2);return x(s.updateCol(o,t))}),d(7,"done"),l(),ee()}if(r&2){let e=p().$implicit,i=p().$implicit,t=p(2);a(3),T(t.getColInfo(i,e).existingDisplayValue)}}function Em(r,n){if(r&1&&(c(0,"td")(1,"span"),d(2),l(),v(3,km,8,1,"ng-container",3),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),le("newValue",i.duplicateHelperInfo&&i.duplicateHelperInfo.length==1&&t.getColInfo(i,e).newDisplayValue!=t.getColInfo(i,e).existingDisplayValue),a(),w(" ",t.getColInfo(i,e).newDisplayValue,""),a(),f("ngIf",i.duplicateHelperInfo&&i.duplicateHelperInfo.length==1&&t.getColInfo(i,e).newDisplayValue!=t.getColInfo(i,e).existingDisplayValue)}}function Mm(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td")(3,"mat-icon",16),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.updateRows.splice(o.updateRows.indexOf(t),1))}
25),d(4," remove_circle_outline"),l()(),c(5,"td"),d(6),k(7,"br"),l(),v(8,Em,4,4,"td",7),l(),ee()}if(r&2){let e=n.$implicit,i=p(2);a(6),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare)}}function Fm(r,n){if(r&1&&(c(0,"mat-tab",1)(1,"div",8)(2,"table",15)(3,"tr"),k(4,"th")(5,"th"),v(6,Im,3,2,"th",7),l(),v(7,Mm,9,2,"ng-container",7),l()()()),r&2){let e=p();bt("label","",e.settings.lang.updateVolunteers," - ",e.updateRows.length,""),a(6),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.updateRows)}}function Tm(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.caption," ")}}function Rm(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function Am(r,n){if(r&1&&(X(0),c(1,"tr")(2,"td"),d(3),k(4,"br"),l(),v(5,Rm,2,1,"td",7),l(),ee()),r&2){let e=n.$implicit,i=p(2);a(3),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare)}}function Om(r,n){if(r&1&&(c(0,"mat-tab",1)(1,"div",8)(2,"table",15)(3,"tr"),k(4,"th"),v(5,Tm,2,1,"th",7),l(),v(6,Am,6,2,"ng-container",7),l()()()),r&2){let e=p();bt("label","",e.settings.lang.existingVolunteers," - ",e.identicalRows.length,""),a(5),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.identicalRows)}}function Vm(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=n.$implicit;a(),w(" ",e.caption," ")}}function Pm(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=n.$implicit,i=p().$implicit,t=p(2);a(),w(" ",t.getColInfo(i,e).newDisplayValue," ")}}function Nm(r,n){if(r&1&&(c(0,"li"),d(1),l()),r&2){let e=n.$implicit,i=p(4);a(),be(" ",e.name," - ",i.displayDupInfo(e)," ")}}function Bm(r,n){if(r&1&&(c(0,"ul"),v(1,Nm,2,2,"li",7),l()),r&2){let e=p().$implicit;a(),f("ngForOf",e.duplicateHelperInfo)}}function Hm(r,n){if(r&1){let e=M();X(0),c(1,"tr")(2,"td"),d(3),k(4,"br"),l(),v(5,Pm,2,1,"td",7),l(),c(6,"tr")(7,"td",20),d(8),v(9,Bm,2,1,"ul",3),c(10,"a",13),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.moveFromErrorToAdd(t))}),d(11),l()()(),ee()}if(r&2){let e=n.$implicit,i=p(2);a(3),T(e.rowInExcel),a(2),f("ngForOf",i.columnsInCompare),a(3),w(" ",e.error," "),a(),f("ngIf",e.duplicateHelperInfo&&e.duplicateHelperInfo.length>=1),a(2),T(i.settings.lang.moveToNewVolunteers)}}function Lm(r,n){if(r&1&&(c(0,"mat-tab",1)(1,"div",8)(2,"table",15)(3,"tr"),k(4,"th"),v(5,Vm,2,1,"th",7),l(),v(6,Hm,12,5,"ng-container",7),l()()()),r&2){let e=p();bt("label","",e.settings.lang.errors," -  ",e.errorRows.length,""),a(5),f("ngForOf",e.columnsInCompare),a(),f("ngForOf",e.errorRows)}}var ho=(()=>{let n=class n{constructor(i,t,o){this.dialog=i,this.busy=t,this.settings=o,this.excelColumns=[],this.additionalColumns=[],this.columns=[],this.rows=[],this.columnsInCompare=[],this.errorRows=[],this.newRows=[],this.identicalRows=[],this.updateRows=[]}getData(){return this.getTheData(this.cell)}getTheData(i){let t=this.worksheet[i];return!t||!t.w?"":t.w.trim()}getColInfo(i,t){return Ze.actualGetColInfo(i,t.key)}addAll(){return h(this,null,function*(){let i=this.newRows.length;this.dialog.YesNoQuestion("\u05D4\u05D0\u05DD \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 "+i+" \u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD?",()=>{this.busy.doWhileShowingBusy(()=>h(this,null,function*(){let t=[],o=new Date().valueOf();for(let s of this.newRows)t.push(s),t.length==35&&(yield Ze.insertHelperRows(t),new Date().valueOf()-o>1e3&&this.dialog.Info(s.rowInExcel+" "+s.name),this.identicalRows.push(...t),t=[]);t.length>0&&(yield Ze.insertHelperRows(t),this.identicalRows.push(...t)),this.newRows=[],this.identicalRows.sort((s,m)=>s.rowInExcel-m.rowInExcel)}))})})}updateAllCol(i){return h(this,null,function*(){let t=this.getColUpdateCount(i),o="\u05D4\u05D0\u05DD \u05DC\u05E2\u05D3\u05DB\u05DF \u05D0\u05EA \u05D4\u05E9\u05D3\u05D4 "+i.caption+" \u05DC"+t+" \u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD?";this.dialog.YesNoQuestion(o,()=>{this.busy.doWhileShowingBusy(()=>h(this,null,function*(){let s=[],m=[],u=new Date().valueOf();for(let y of this.updateRows){let E=this.getColInfo(y,i);E.newDisplayValue!=E.existingDisplayValue?s.push(y):m.push(y),s.length==35&&(m.push(...yield Ze.updateHelperColsOnServer(s,i.key)),new Date().valueOf()-u>1e3&&this.dialog.Info(y.rowInExcel+" "+y.name),s=[])}s.length>0&&m.push(...yield Ze.updateHelperColsOnServer(s,i.key)),m.sort((y,E)=>y.rowInExcel-E.rowInExcel),this.updateRows=m}))})})}updateCol(i,t){return h(this,null,function*(){yield Ze.actualUpdateCol(i,t.key)})}clearColumnUpdate(i,t){return h(this,null,function*(){let o=this.getColInfo(i,t);
25o.newDisplayValue=o.existingDisplayValue,o.newValue=o.existingValue})}getColUpdateCount(i){let t=0,o=i.key;for(let s of this.updateRows){let m=s.values[o];m&&m.newDisplayValue!=m.existingDisplayValue&&t++}return t}fileChange(i){return h(this,null,function*(){var t=i.target.files,o;if(!(!t||t.length==0)){o=t[0];var s=new FileReader;s.onload=m=>h(this,null,function*(){this.filename=o.name;for(var u="",y=new Uint8Array(m.target.result),E=y.byteLength,I=0;I<E;I++)u+=String.fromCharCode(y[I]);this.oFile=(yield import("./chunk-WDWKR4NF.js")).read(u,{type:"binary",cellDates:!0,cellStyles:!0}),this.worksheet=this.oFile.Sheets[this.oFile.SheetNames[0]];let N=this.worksheet["!ref"],H=N.substr(N.indexOf(":")+1),R="A";for(let he=0;he<H.length;he++){let oe=H[he];if("1234567890".indexOf(oe)>=0){R=H.substring(0,he),this.totalRows=+H.substring(he,20);break}}if(!this.totalRows)debugger;let U="",j="A",De=0;for(this.excelColumns=[];;){this.excelColumns.push({excelColumn:U+j,column:void 0,title:this.getTheData(U+j+1)});let he=!1;U+j==R&&(he=!0);let oe=j.charCodeAt(0);if(oe++,j=String.fromCharCode(oe),j>"Z"&&(j="A",U=="A"?U="B":U="A"),he)break}for(let he of this.excelColumns){let oe=he.title;for(let ke of this.columns)if(oe==ke.name||ke.searchNames&&ke.searchNames.indexOf(oe)>=0){he.column=ke;break}}this.rows=[];for(let he=2;he<=this.totalRows;he++)this.rows.push(he);this.stepper.next()}),s.readAsArrayBuffer(o)}})}readLine(i){return h(this,null,function*(){let t=g.repo(G).create(),o=new hr;for(let m of this.excelColumns)if(m.column){let u=this.getTheData(m.excelColumn+i);u&&u.length>0&&(yield m.column.updateFamily(u,t,o))}for(let m of this.additionalColumns)yield m.column.updateFamily(m.value,t,o);o.laterSteps.sort((m,u)=>m.step-u.step);for(let m of o.laterSteps)m.what();t.phone=new fe(fe.fixPhoneInput(t.phone?.thePhone));let s={name:t.name,phone:t.phone?.thePhone,valid:!0,rowInExcel:i,values:{}};t.name||(s.error=this.settings.lang.lineWithNoName);for(let m of t.$)m.error&&(m.error&&(m.error+=", "),m.error+=m.error+": "+m.error,s.valid=!1),m&&(s.values[m.metadata.key]={newDisplayValue:yield uo(m),newValue:m.value});return s})}ngOnInit(){return h(this,null,function*(){let i=(o,s,m=" ")=>{o.inputValue?o.inputValue=(o.inputValue+m+s).trim():o.inputValue=s};if(this.helper=g.repo(G).metadata.fields,0)try{}catch(o){}let t=(o,s)=>{this.columns.push({key:o.key,name:o.caption,updateFamily:(m,u)=>h(this,null,function*(){i(u.$.find(o),m)}),searchNames:s,columns:[o]})};t(this.helper.name),t(this.helper.eventComment),t(this.helper.preferredDistributionAreaAddress),t(this.helper.preferredFinishAddress),t(this.helper.email),t(this.helper.eventComment),t(this.helper.company),t(this.helper.socialSecurityNumber),this.columns.push({key:"firstName",name:"\u05E9\u05DD \u05E4\u05E8\u05D8\u05D9",updateFamily:(o,s,m)=>h(this,null,function*(){m.laterSteps.push({step:2,what:()=>i(s.$.name,o)})}),columns:[this.helper.name],searchNames:["\u05E4\u05E8\u05D8\u05D9"]}),this.columns.push({key:"city",name:"\u05E2\u05D9\u05E8 \u05D0\u05D6\u05D5\u05E8 \u05D7\u05DC\u05D5\u05E7\u05D4",updateFamily:(o,s,m)=>h(this,null,function*(){m.laterSteps.push({step:2,what:()=>h(this,null,function*(){return i(s.$.preferredDistributionAreaAddress,o)})})}),columns:[this.helper.preferredFinishAddress],searchNames:["\u05E2\u05D9\u05E8"]});for(let o of[this.helper.phone])this.columns.push({key:o.key,name:o.caption,columns:[o],updateFamily:(s,m)=>h(this,null,function*(){m.$.find(o).value=new fe(po(s,this.settings.defaultPrefixForExcelImport).replace(/\D/g,""))})});this.columns.sort((o,s)=>o.name>s.name?1:o.name<s.name?-1:0)})}doImport(){return h(this,null,function*(){this.dialog.YesNoQuestion("\u05D4\u05D0\u05DD \u05D0\u05EA\u05D4 \u05D1\u05D8\u05D5\u05D7 \u05E9\u05D0\u05EA\u05D4 \u05DE\u05E2\u05D5\u05E0\u05D9\u05D9\u05DF \u05DC\u05E7\u05DC\u05D5\u05D8 "+(this.totalRows-1)+" \u05DE\u05E9\u05E4\u05D7\u05D5\u05EA \u05DE\u05D0\u05E7\u05E1\u05DC?",()=>h(this,null,function*(){yield this.iterateExcelFile(!0)}))})}iterateExcelFile(i=!1){return h(this,null,function*(){this.errorRows=[],this.newRows=[],this.updateRows=[],this.identicalRows=[];let t=[],o=new Map,s=new Map;this.stepper.next(),yield this.busy.doWhileShowingBusy(()=>h(this,null,function*(){let m=new Map;for(let y of[...this.excelColumns.map(E=>E.column),...this.additionalColumns.map(E=>E.column)])if(y)for(let E of y.columns)m.set(E,!0);this.columnsInCompare=[];for(let y of this.helper)m.get(y)&&this.columnsInCompare.push(y);let u=this.columnsInCompare.map(y=>y.key);yield new Promise(y=>setTimeout(()=>{y({})},500));try{for(let I=2;I<=this.totalRows;I++){let N=yield this.readLine(I);if(N.error?this.errorRows.push(N):((R,U,j)=>{let De=R;if(!R||(R=R.replace(/\D/g,""),R.length==0))return!1;let he=U.get(+R);return he>0&&he<I?(N.error=j+" - "+De+" - \u05DB\u05D1\u05E8 \u05E7\u05D9\u05D9\u05DD \u05D1\u05E7\u05D5\u05D1\u05E5 \u05D1\u05E9\u05D5\u05E8\u05D4 "+he,!0):(U.set(+R,I),!1)})(N.phone,s,"\u05D8\u05DC\u05E4\u05D5\u05DF")?this.errorRows.push(N):t.push(N),t.length==200){this.dialog.Info(I-1+" "+(N.name?N.name:"\u05DC\u05DC\u05D0 \u05E9\u05DD")+" "+(N.error?N.error:""));let H=yield Ze.checkExcelInputHelpers(t,u);this.errorRows.push(...H.errorRows),this.newRows.push(...H.newRows),this.updateRows.push(...H.updateRows),this.identicalRows.push(...H.identicalRows),t=[]}}if(t.length>0){let I=yield Ze.checkExcelInputHelpers(t,u);this.errorRows.push(...I.errorRows),this.newRows.push(...I.newRows),this.updateRows.push(...I.updateRows),this.identicalRows.push(...I.identicalRows)}let y=new Map,E=[];for(let I of this.updateRows)if(I.duplicateHelperInfo&&I.duplicateHelperInfo.length==1){let N;if(N=y.get(I.duplicateHelperInfo[0].id))N.push(I);else{let H=[I];y.set(I.duplicateHelperInfo[0].id,H),E.push(H)}}this.errorRows.sort((I,N)=>I.rowInExcel-N.rowInExcel);for(let I of E)if(I.length>1)for(let N of I)N.error="\u05D0\u05D5\u05EA\u05D4 \u05DE\u05E9\u05E4\u05D7\u05D4 \u05D1\u05D0\u05EA\u05E8 \u05DE\u05EA\u05D0\u05D9\u05DE\u05D4 \u05DC\u05DE\u05E1\u05E4\u05E8 \u05E9\u05D5\u05E8\u05D5\u05EA \u05D1\u05D0\u05E7\u05E1\u05DC: "+I.map(H=>H.rowInExcel.toString()).join(", "),this.errorRows.push(N),this.updateRows.splice(this.updateRows.indexOf(N),1);sessionStorage.setItem("errorRowsHelpers",JSON.stringify(this.errorRows)),sessionStorage.setItem("newRows
25Helpers",JSON.stringify(this.newRows)),sessionStorage.setItem("updateRowsHelpers",JSON.stringify(this.updateRows)),sessionStorage.setItem("identicalRowsHelpers",JSON.stringify(this.identicalRows)),sessionStorage.setItem("columnsInCompare",JSON.stringify(u))}catch(y){this.stepper.previous(),this.dialog.Error("\u05D4\u05E7\u05DC\u05D9\u05D8\u05D4 \u05D4\u05D5\u05E4\u05E1\u05E7\u05D4 - "+y)}}))})}displayDupInfo(i){return"\u05D8\u05DC\u05E4\u05D5\u05DF \u05D6\u05D4\u05D4"}saveSettings(){let i={storedColumns:[],additionalColumns:[]};for(let t of this.excelColumns)i.storedColumns.push({excelColumn:t.excelColumn,columnKey:t.column?t.column.key:void 0});for(let t of this.additionalColumns)i.additionalColumns.push({value:t.value,columnKey:t.column?t.column.key:void 0});localStorage.setItem(As,JSON.stringify(i))}loadSettings(){let i=JSON.parse(localStorage.getItem(As));if(i){for(let t of this.excelColumns)for(let o of i.storedColumns)if(o.excelColumn==t.excelColumn){t.column=void 0;for(let s of this.columns)s.key==o.columnKey&&(t.column=s)}this.additionalColumns=[];for(let t of i.additionalColumns)for(let o of this.columns)o.key==t.columnKey&&this.additionalColumns.push({column:o,value:t.value})}}moveFromErrorToAdd(i){this.dialog.YesNoQuestion("\u05DC\u05D4\u05E2\u05D1\u05D9\u05E8 \u05D0\u05EA \u05D4\u05DE\u05EA\u05E0\u05D3\u05D1 "+i.name+" \u05DC\u05DE\u05EA\u05E0\u05D3\u05D1\u05D9\u05DD \u05DC\u05D4\u05D5\u05E1\u05E4\u05D4?",()=>{let t=this.errorRows.indexOf(i);this.errorRows.splice(t,1),this.newRows.push(i),this.newRows.sort((o,s)=>o.rowInExcel-s.rowInExcel)})}testImport(){return h(this,null,function*(){yield this.iterateExcelFile(!1)})}};n.\u0275fac=function(t){return new(t||n)(b(z),b(we),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-import-helpers-from-excel"]],viewQuery:function(t,o){if(t&1&&ce(um,7),t&2){let s;te(s=ie())&&(o.stepper=s.first)}},decls:17,vars:10,consts:[["stepper",""],[3,"label"],["type","file",3,"change"],[4,"ngIf"],[3,"label",4,"ngIf"],["mat-raised-button","",3,"click"],["mat-raised-button","","color","accent",3,"click"],[4,"ngFor","ngForOf"],[1,"table-div"],[1,"table","table-bordered"],[3,"ngModelChange","ngModel"],["value",""],[3,"ngValue",4,"ngFor","ngForOf"],[3,"click"],[3,"ngValue"],[1,"table","table-bordered",2,"white-space","nowrap"],[2,"color","red",3,"click"],["style","color: green",3,"click",4,"ngIf"],[2,"color","green",3,"click"],[2,"color","red","text-decoration-line","line-through"],["colspan","10",2,"color","red"]],template:function(t,o){if(t&1){let s=M();c(0,"mat-card")(1,"mat-horizontal-stepper",null,0)(3,"mat-step",1)(4,"h3"),d(5),l(),c(6,"input",2),D("change",function(u){return C(s),x(o.fileChange(u))}),l()(),c(7,"mat-step",1),v(8,wm,23,12,"ng-container",3),l(),c(9,"mat-step",1)(10,"h3"),d(11),l(),c(12,"mat-tab-group"),v(13,bm,10,6,"mat-tab",4)(14,Fm,8,5,"mat-tab",4)(15,Om,7,5,"mat-tab",4)(16,Lm,7,5,"mat-tab",4),l()()()()}t&2&&(a(3),re("label",o.settings.lang.selectExcelFile),a(2),T(o.settings.lang.selectExcelFile),a(2),re("label",o.settings.lang.mapExcelColumns),a(),f("ngIf",o.filename),a(),re("label",o.settings.lang.executeExcelImport),a(2),T(o.settings.lang.excelImportResults),a(2),f("ngIf",o.newRows&&o.newRows.length),a(),f("ngIf",o.updateRows&&o.updateRows.length),a(),f("ngIf",o.identicalRows&&o.identicalRows.length),a(),f("ngIf",o.errorRows&&o.errorRows.length))},dependencies:[me,q,ei,ti,Me,Xt,de,pe,$n,Wn,Q,xe,ve,Ai,Oi],styles:[`th[_ngcontent-%COMP%]{text-align:right}.table-div[_ngcontent-%COMP%]{width:100%;overflow:scroll;max-height:500px}.mat-icon-button[_ngcontent-%COMP%]{width:20px;height:20px;line-height:20px}.newValue[_ngcontent-%COMP%]{color:green}td[_ngcontent-%COMP%]{white-space:nowrap;word-wrap:none;max-width:300px;overflow:hidden}
26/*# sourceMappingURL=import-helpers-from-excel.component-P4GWGP3A.css.map */`]});let r=n;return r})(),As="excelSettingsSaveHelper",hr=class{constructor(){this.laterSteps=[]}};var $m=["phoneInput"];function Wm(r,n){if(r&1){let e=M();c(0,"button",2),D("click",function(){C(e);let t=p();return x(t.saveHelper())}),d(1),l()}r&2&&(a(),w(" ","\u05E9\u05DE\u05D5\u05E8 \u05E4\u05E8\u05D8\u05D9 \u05DE\u05DC\u05D5\u05D5\u05D4 \u05D5\u05E2\u05D1\u05D5\u05E8 \u05DC\u05DE\u05DC\u05D5\u05D5\u05D4 \u05D4\u05D1\u05D0"," "))}function jm(r,n){if(r&1&&k(0,"data-area",11),r&2){let e=p();f("settings",e.area)}}function zm(r,n){if(r&1){let e=M();c(0,"mat-card")(1,"mat-card-title"),d(2),l(),c(3,"button",12),D("click",function(){C(e);let t=p();return x(t.clearEscort())}),d(4," \u05D1\u05D8\u05DC \u05E9\u05D9\u05D5\u05DA \u05DB\u05DE\u05DC\u05D5\u05D5\u05D4 "),l(),c(5,"button",13),D("click",function(){C(e);let t=p();return x(t.sendSms())}),d(6," \u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05EA SMS "),l()()}if(r&2){let e=p();a(2),w(" \u05DE\u05D5\u05D2\u05D3\u05E8 \u05DB\u05DE\u05DC\u05D5\u05D5\u05D4 \u05E9\u05DC ",e.alreadyEscortingDriver.name," ")}}function Um(r,n){if(r&1){let e=M();c(0,"mat-list-item",8),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.assignForDriver(t))}),d(1),k(2,"mat-divider"),l()}if(r&2){let e=n.$implicit;a(),be(" ",e.name," - ",e.deliveriesInProgress," ")}}function Gm(r,n){if(r&1&&(c(0,"mat-card")(1,"mat-card-title"),d(2," \u05E0\u05D4\u05D2\u05D9\u05DD \u05DC\u05DC\u05D0 \u05DE\u05DC\u05D5\u05D5\u05D9\u05DD "),l(),c(3,"mat-card-subtitle"),d(4," \u05DC\u05D7\u05E6\u05D5 \u05E2\u05DC \u05E9\u05DD \u05D4\u05E0\u05D4\u05D2 \u05DC\u05E9\u05D9\u05D5\u05DA "),l(),c(5,"mat-nav-list"),v(6,Um,3,2,"mat-list-item",14),l()()),r&2){let e=p();a(6),f("ngForOf",e.optionalDrivers)}}var Wi=(()=>{let n=class n{constructor(i,t){this.dialog=i,this.settings=t,this.phone="",this.optionalDrivers=[]}ngOnInit(){return h(this,null,function*(){Fn.production||(this.phone="0507330590",yield this.searchPhone())})}searchPhone(){return h(this,null,function*(){if(this.clearHelperInfo(!1),this.phone.length==10){let i=yield g.repo(Ri).findFirst({phone:new fe(this.phone)});if(i)this.initHelper(i);else{let t=g.repo(G).create();t.phone=new fe(this.phone),this.initHelper(t)}}})}assignForDriver(i){return h(this,null,function*(){yield this.helper.save();
26let t=yield g.repo(G).findFirst({id:i.id});t.escort=yield this.helper.getHelper(),yield t.save(),(yield K(wi,o=>o.args={question:"\u05D4\u05D0\u05DD \u05D2\u05DD \u05DC\u05E9\u05DC\u05D5\u05D7 SMS \u05DC"+this.helper.name},o=>o.yes))&&(yield ft.SendSms(this.helper,!1)),this.dialog.Info(this.helper.name+" \u05D4\u05D5\u05D2\u05D3\u05E8 \u05DB\u05DE\u05DC\u05D5\u05D5\u05D4 \u05E9\u05DC "+this.helper.name),this.clearHelperInfo()})}saveHelper(){return h(this,null,function*(){this.helper.save(),this.clearHelperInfo()})}sendSms(){return h(this,null,function*(){yield ft.SendSms(this.helper,!1),this.dialog.Info("\u05E0\u05E9\u05DC\u05D7\u05D4 \u05D4\u05D5\u05D3\u05E2\u05EA SMS \u05DC\u05DE\u05DC\u05D5\u05D5\u05D4 "+this.helper.name),this.clearHelperInfo()})}clearEscort(){return h(this,null,function*(){this.alreadyEscortingDriver.escort=null,yield this.alreadyEscortingDriver.save();let i=yield g.repo(Ri).findFirst({id:this.helper.id});this.clearHelperInfo(),this.initHelper(i)})}initHelper(i){return h(this,null,function*(){if(!i.isNew()){let t=0;if(i instanceof Ri?t=i.deliveriesInProgress:t=yield(yield g.repo(Ri).findFirst({id:i.id})).deliveriesInProgress,t>0){yield K(wi,o=>o.args={question:"\u05DC\u05DE\u05EA\u05E0\u05D3\u05D1 "+i.name+" \u05DB\u05D1\u05E8 \u05DE\u05D5\u05D2\u05D3\u05E8\u05D5\u05EA \u05DE\u05E9\u05E4\u05D7\u05D5\u05EA, \u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05D4\u05D2\u05D3\u05D9\u05E8 \u05D0\u05D5\u05EA\u05D5 \u05DB\u05DE\u05DC\u05D5\u05D5\u05D4",showOnlyConfirm:!0}),this.clearHelperInfo();return}G.addToRecent(i)}this.helper=i,this.phone=i.phone.thePhone,this.area=new ne({fields:()=>{let t=[];return this.settings.showCompanies?t.push([this.helper.name,this.helper.company]):t.push([this.helper.name]),this.settings.showHelperComment&&t.push(this.helper.eventComment),t}}),this.helper.theHelperIAmEscorting?this.alreadyEscortingDriver=this.helper.theHelperIAmEscorting:this.optionalDrivers=yield g.repo(Ri).find({where:{needEscort:!0,escort:null,theHelperIAmEscorting:null,id:this.helper.id},orderBy:{deliveriesInProgress:"desc",name:"asc"}})})}findHelper(){K(On,i=>i.args={onSelect:t=>h(this,null,function*(){t?this.initHelper(t):this.clearHelperInfo()})})}clearHelperInfo(i=!0){i&&(this.phone=""),this.area=void 0,this.optionalDrivers=[],this.alreadyEscortingDriver=void 0,this.helper=void 0,this.phoneInput&&i&&setTimeout(()=>{this.phoneInput.nativeElement.focus()},200)}showSave(){return this.helper&&this.helper._.wasChanged()}};n.\u0275fac=function(t){return new(t||n)(b(z),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-assign-escort"]],viewQuery:function(t,o){if(t&1&&ce($m,5),t&2){let s;te(s=ie())&&(o.phoneInput=s.first)}},decls:27,vars:8,consts:[["appMenu77",""],["phoneInput",""],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-icon-button","",3,"matMenuTriggerFor"],["appearance","outline",1,"full-width-form-field","dense-form-field"],["matInput","","type","tel",3,"ngModelChange","input","ngModel"],["matSuffix","",2,"display","flex"],[3,"click"],[3,"settings",4,"ngIf"],[4,"ngIf"],[3,"settings"],["mat-raised-button","","color","primary",3,"click"],["mat-raised-button","","color","accent",2,"margin-right","5px",3,"click"],[3,"click",4,"ngFor","ngForOf"]],template:function(t,o){if(t&1){let s=M();c(0,"mat-card")(1,"mat-card-title"),d(2," \u05E4\u05E8\u05D8\u05D9 \u05DE\u05DC\u05D5\u05D5\u05D4 "),c(3,"div")(4,"mat-menu",null,0)(6,"button",2),D("click",function(){return C(s),x(o.findHelper())}),d(7),l(),c(8,"button",2),D("click",function(){return C(s),x(o.clearHelperInfo())}),d(9),l(),v(10,Wm,2,1,"button",3),l(),c(11,"button",4)(12,"mat-icon"),d(13,"more_vert"),l()()()(),c(14,"mat-form-field",5)(15,"mat-label"),d(16,"\u05DE\u05E1\u05E4\u05E8 \u05D4\u05D8\u05DC\u05E4\u05D5\u05DF \u05E9\u05DC \u05D4\u05DE\u05DC\u05D5\u05D5\u05D4"),l(),c(17,"input",6,1),W("ngModelChange",function(u){return C(s),$(o.phone,u)||(o.phone=u),x(u)}),D("input",function(){return C(s),x(o.searchPhone())}),l(),c(19,"div",7)(20,"mat-icon",8),D("click",function(){return C(s),x(o.clearHelperInfo())}),d(21,"clear"),l(),c(22,"mat-icon",8),D("click",function(){return C(s),x(o.findHelper())}),d(23,"search"),l()()(),v(24,jm,1,1,"data-area",9),l(),v(25,zm,7,1,"mat-card",10)(26,Gm,7,1,"mat-card",10)}if(t&2){let s=Nt(5);a(7),T("\u05D7\u05E4\u05E9 \u05DC\u05E4\u05D9 \u05E9\u05DD"),a(2),w(" ","\u05E0\u05E7\u05D4 \u05E4\u05E8\u05D8\u05D9 \u05DE\u05DC\u05D5\u05D5\u05D4"," "),a(),f("ngIf",o.showSave()),a(),f("matMenuTriggerFor",s),a(6),L("ngModel",o.phone),a(7),f("ngIf",o.area&&o.phone&&o.phone.length==10),a(),f("ngIf",o.helper&&o.alreadyEscortingDriver),a(),f("ngIf",o.helper&&!o.helper.theHelperIAmEscorting&&o.helper.name)}
26},dependencies:[me,q,Me,de,pe,lt,Mi,ii,Q,Ye,xe,Mn,Fi,Et,ve,ct,Ft,Mt,oi,ni,ri,Ce]});let r=n;return r})();var Os=(()=>{let n=class n{constructor(){this.listOfSchemas="test,test1,test2,test3",this.token="test1",this.sql="select city from test1.families",this.seperator=" union all "}build(){this.result="";for(let i of this.listOfSchemas.split(","))i&&(i=i.trim(),i.length>0&&(this.result!=""&&(this.result+=this.seperator+`\r
27`),this.result+=this.sql.split(this.token).join(i)))}ngOnInit(){this.build(),ja.getSites().then(i=>{this.listOfSchemas=i,this.build()})}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=O({type:n,selectors:[["app-token-replacer"]],decls:6,vars:5,consts:[[2,"display","flex","direction","ltr","flex-direction","column"],[3,"ngModelChange","ngModel"],[2,"direction","ltr",3,"ngModelChange","keyup","ngModel"],["readonly","",2,"direction","ltr",3,"ngModelChange","ngModel"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"input",1),W("ngModelChange",function(m){return $(o.listOfSchemas,m)||(o.listOfSchemas=m),m}),l(),c(2,"input",1),W("ngModelChange",function(m){return $(o.token,m)||(o.token=m),m}),l(),c(3,"input",1),W("ngModelChange",function(m){return $(o.seperator,m)||(o.seperator=m),m}),l(),c(4,"textarea",2),W("ngModelChange",function(m){return $(o.sql,m)||(o.sql=m),m}),D("keyup",function(){return o.build()}),l(),c(5,"textarea",3),W("ngModelChange",function(m){return $(o.result,m)||(o.result=m),m}),l()()),t&2&&(a(),L("ngModel",o.listOfSchemas),a(),L("ngModel",o.token),a(),L("ngModel",o.seperator),a(),L("ngModel",o.sql),a(),L("ngModel",o.result))},dependencies:[Me,de,pe]});let r=n;return r})();function qm(r,n){if(r&1&&(c(0,"div"),d(1),l()),r&2){let e=p();a(),w(" ",e.exist(),`
28`)}}var Vs=(()=>{let n=class n{constructor(){this.dialog=zt(Aa),this.pie=new li({}),this.pieChartOptions={plugins:{legend:{display:!0,position:"top"}}},this.pieChartData={labels:[["Download","Sales"],["In","Store","Sales"],"Mail Sales"],datasets:[{data:[300,500,100]}]},this.first=!0}ngOnInit(){}exist(){return console.count("exist"),1}update(){this.pieChartData.datasets[0].data=[],this.pieChartData.datasets[0].data.push(Math.random()*100,Math.random()*100,Math.random()*100),this.pieChartData.labels=["a","b","c"],this.pie.reset(),this.pieChartData.datasets[0].data.forEach((i,t)=>{this.pie.add(this.pieChartData.labels[t],i,this.pie.usefulColors[t])}),this.chart?.update()}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=O({type:n,selectors:[["app-test-map"]],viewQuery:function(t,o){if(t&1&&ce(je,5),t&2){let s;te(s=ie())&&(o.chart=s.first)}},decls:5,vars:3,consts:[[3,"click"],["baseChart","","type","pie",3,"data","options"],[2,"display","block","width","350px","height","188px"]],template:function(t,o){t&1&&(v(0,qm,2,1,"div"),c(1,"button",0),D("click",function(){return o.update()}),d(2,"update"),l(),k(3,"canvas",1)(4,"div",2)),t&2&&(Dt(-1),a(3),f("data",o.pieChartData)("options",o.pieChartOptions))},dependencies:[je]});let r=n;return r})();var mn=class{static familiesInSameAddress(n){return h(this,null,function*(){if(!n.address&&!n.name&&!n.phone&&!n.tz)throw"some column needs to be selected for compare";let e=new Zt,i=gt(g.repo(ae)),t=gt(g.repo(se)),o="";for(let u of[i.tz,i.tz2])for(let y of[i.phone1,i.phone2,i.phone3,i.phone4])o.length>0&&(o+=`\r
29 union all \r
30`),o+=yield e.query({select:()=>[e.columnWithAlias(i.addressLatitude,"lat"),e.columnWithAlias(i.addressLongitude,"lng"),e.columnWithAlias(i.address,"address"),i.name,e.columnWithAlias(i.id,"id"),e.columnWithAlias(e.extractNumber(u),"tz"),e.columnWithAlias(e.extractNumber(y),"phone")],from:i,where:()=>{let E=[i.where({status:{"!=":Ge.ToDelete}})];return n.onlyActive&&E.push(e.build(i.id," in (",e.query({select:()=>[t.family],from:t}),")")),E}});let s=[],m=[];return n.address&&(m.push("lat"),m.push("lng")),n.phone&&(m.push("phone"),s.push("phone<>0")),n.tz&&(m.push("tz"),s.push("tz<>0")),n.name&&m.push("name"),o=yield e.build("select ",[e.columnWithAlias(e.max("address"),"address"),e.columnWithAlias(e.max("name"),'"name"'),e.columnWithAlias(e.max("tz"),"tz"),e.columnWithAlias(e.max("p
30hone"),"phone"),"count (distinct id) c","string_agg(id::text, ',') ids"]," from (",o,") as result"),s.length>0&&(o+=" where "+(yield e.and(...s))),o+=" group by "+(yield e.build([m])),o+=" having count(distinct id)>1",(yield Kt().execute(o)).rows.map(u=>({address:u.address,name:u.name,phone:Qe().forWho.formatPhone(u.phone),tz:u.tz,count:+u.c,ids:u.ids.split(",").filter((y,E,I)=>I.indexOf(y)==E).join(",")}))})}};S([Y({allowed:!0,paramTypes:[Object]}),_("design:type",Function),_("design:paramtypes",[Object]),_("design:returntype",Promise)],mn,"familiesInSameAddress",null);function Qm(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=p(2);a(),T(e.settings.lang.familyName)}}function Ym(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=p(2);a(),T(e.settings.lang.socialSecurityNumber)}}function Zm(r,n){if(r&1){let e=M();c(0,"th",6),D("click",function(){C(e);let t=p(2);return x(t.sortByAddress())}),d(1),l()}if(r&2){let e=p(2);a(),w(" ",e.settings.lang.address," ")}}function Km(r,n){if(r&1&&(c(0,"th"),d(1),l()),r&2){let e=p(2);a(),T(e.settings.lang.phone)}}function Jm(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=p().$implicit;a(),T(e.name)}}function Xm(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=p().$implicit;a(),T(e.tz)}}function ed(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=p().$implicit;a(),T(e.address)}}function td(r,n){if(r&1&&(c(0,"td"),d(1),l()),r&2){let e=p().$implicit;a(),T(e.phone)}}function id(r,n){if(r&1){let e=M();c(0,"tr")(1,"td"),d(2),l(),v(3,Jm,2,1,"td",4)(4,Xm,2,1,"td",4)(5,ed,2,1,"td",4)(6,td,2,1,"td",4),c(7,"td"),d(8),l(),c(9,"td")(10,"a",6),D("click",function(){let t=C(e).$implicit,o=p(2);return x(o.showFamilies(t))}),d(11),l()()()}if(r&2){let e=n.$implicit,i=n.index,t=p(2);le("deliveredOk",t.viewdFamilies.get(e.ids)),a(2),T(i+1),a(),f("ngIf",t.name),a(),f("ngIf",t.tz),a(),f("ngIf",t.address),a(),f("ngIf",t.phone),a(2),T(e.count),a(3),T(t.settings.lang.showFamilies)}}function nd(r,n){if(r&1){let e=M();c(0,"table",3)(1,"tr"),k(2,"th"),v(3,Qm,2,1,"th",4)(4,Ym,2,1,"th",4)(5,Zm,2,1,"th",5)(6,Km,2,1,"th",4),c(7,"th",6),D("click",function(){C(e);let t=p();return x(t.sortByCount())}),d(8),l(),c(9,"th"),d(10),l()(),v(11,id,12,9,"tr",7),l()}if(r&2){let e=p();a(3),f("ngIf",e.name),a(),f("ngIf",e.tz),a(),f("ngIf",e.address),a(),f("ngIf",e.phone),a(2),T(e.settings.lang.families),a(2),be("",e.settings.lang.total," ",e.duplicateFamilies.length,""),a(),f("ngForOf",e.duplicateFamilies)}}var ji=class ji{get $(){return Le(this,g)}constructor(n,e,i){this.dialog=n,this.settings=e,this.busy=i,this.name=!1,this.phone=!1,this.onlyActive=!0,this.tz=!1,this.area=new ne({fields:()=>[[this.$.address,this.$.name,this.$.phone,this.$.tz,this.$.onlyActive]]}),this.duplicateFamilies=[],this.viewdFamilies=new Map,this.post=()=>{}}ngOnInit(){return h(this,null,function*(){if(this.duplicateFamilies=[],!(!this.address&&!this.name&&!this.phone&&!this.tz))try{this.duplicateFamilies=yield mn.familiesInSameAddress({address:this.address,name:this.name,phone:this.phone,tz:this.tz,onlyActive:this.onlyActive}),this.post()}catch(n){this.dialog.Error(n)}})}sortByAddress(){this.duplicateFamilies.sort((n,e)=>n.address.localeCompare(e.address)),this.post=()=>this.sortByAddress()}sortByCount(){this.duplicateFamilies.sort((n,e)=>e.count-n.count),this.post=()=>this.sortByCount()}showFamilies(n){return h(this,null,function*(){yield K(si,e=>e.args={title:this.settings.lang.familiesAt+n.address,stateName:"duplicate-families",buttons:[{text:this.settings.lang.mergeFamilies,click:()=>h(this,null,function*(){yield this.mergeFamilies(e)})}],settings:new Ee(g.repo(ae),{columnSettings:i=>{let t=[i.name,i.address,i.status,i.phone1,i.previousDeliveryDate,i.previousDeliveryStatus,i.phone2,i.phone3,i.phone4,i.addressByGoogle,i.addressOk];for(let o of i)!t.includes(o)&&o!=i.id&&t.push(o);return t},numOfColumnsInGrid:6,gridButtons:[...[new as,new rs].map(i=>i.gridButton({afterAction:()=>h(this,null,function*(){return yield e.args.settings.reloadData()}),ui:this.dialog,userWhere:()=>h(this,null,function*(){return(yield e.args.settings.getFilterWithSelectedRows()).where}),settings:this.settings})),{name:this.settings.lang.mergeFamilies,click:()=>h(this,null,function*(){yield this.mergeFamilies(e)}),visible:()=>g.isAllowed(V.admin)&&(e.args.settings.selectedRows.length>1||e.args.settings.totalRows<10)},{name:this.settings.lang.exportToExcel,click:()=>h(this,null,function*(){yield ps(e.args.settings,this.dialog,this.settings.lang.families)})}],allowSelection:!0,knowTotalRows:!0,rowButtons:[{name:this.settings.lang.familyDetails,click:i=>this.dialog.updateFamilyDialog({family:i})},{name:this.settings.lang.deliveries,click:i=>i.showDeliveryHistoryDialog({settings:this.settings,ui:this.dialog})}],rowsInPage:25,where:{status:{$ne:Ge.ToDelete},id:n.ids.split(",")},orderBy:{name:"asc"}})}),this.viewdFamilies.set(n.ids,!0)})}mergeFamilies(n){return h(this,null,function*(){let e=n.args.settings.selectedRows.length>0?[...n.args.settings.selectedRows]:[...n.args.settings.items];if(e.length==0){yield this.dialog.Error(this.settings.lang.noFamiliesSelected);return}if(e.length==1){yield this.dialog.Error(this.settings.lang.cantMergeOneFamily);return}if(e.length>10){yield this.dialog.Error(this.settings.lang.tooManyFamiliesForMerge);return}yield K(cs,i=>i.families=e,i=>{i.merged&&n.args.settings.reloadData()})})}};ji.\u0275fac=function(e){return new(e||ji)(b(z),b(P),b(we))}
30,ji.\u0275cmp=O({type:ji,selectors:[["app-duplicate-families"]],decls:6,vars:4,consts:[[3,"settings"],["mat-raised-button","","color","primary",3,"click"],["class","table table-bordered",4,"ngIf"],[1,"table","table-bordered"],[4,"ngIf"],[3,"click",4,"ngIf"],[3,"click"],[3,"deliveredOk",4,"ngFor","ngForOf"]],template:function(e,i){e&1&&(c(0,"h3"),d(1),l(),k(2,"data-area",0),c(3,"button",1),D("click",function(){return i.ngOnInit()}),d(4),l(),v(5,nd,12,8,"table",2)),e&2&&(a(),T(i.settings.lang.DuplicateFamiliesComponent),a(),f("settings",i.area),a(2),w(" ",i.settings.lang.search,`
31`),a(),f("ngIf",i.duplicateFamilies&&i.duplicateFamilies.length>0))},dependencies:[me,q,Q,Ce]});var xt=ji;S([A.boolean({translation:r=>r.address}),_e({valueChange:r=>r.ngOnInit()}),_("design:type",Boolean)],xt.prototype,"address",void 0);S([A.boolean({translation:r=>r.familyName}),_e({valueChange:r=>r.ngOnInit()}),_("design:type",Boolean)],xt.prototype,"name",void 0);S([A.boolean({translation:r=>r.phone}),_e({valueChange:r=>r.ngOnInit()}),_("design:type",Boolean)],xt.prototype,"phone",void 0);S([A.boolean({translation:r=>r.activeDeliveries}),_e({valueChange:r=>r.ngOnInit()}),_("design:type",Boolean)],xt.prototype,"onlyActive",void 0);S([A.boolean({translation:r=>r.socialSecurityNumber}),_e({valueChange:r=>r.ngOnInit()}),_("design:type",Boolean)],xt.prototype,"tz",void 0);var fo=(()=>{let n=class n{constructor(i,t){this.dialog=i,this.busy=t,this.showAll=!0,this.grid=new Ee(g.repo(na),{where:()=>({incoming:this.showAll?void 0:!0}),knowTotalRows:!0,columnSettings:o=>[o.message,o.phone,o.volunteer,o.incoming,o.createDate,o.automaticAction,o.createUser,o.apiResponse,o.eventId],rowButtons:[{textInMenu:g.context.lang.volunteerInfo,click:o=>h(this,null,function*(){(yield o.volunteer.getHelper()).displayEditDialog(this.dialog)}),visible:o=>!!o.volunteer},{textInMenu:g.context.lang.smsMessages,click:o=>h(this,null,function*(){(yield o.volunteer.getHelper()).smsMessages(this.dialog)}),visible:o=>!!o.volunteer},{textInMenu:g.context.lang.customSmsMessage,click:o=>h(this,null,function*(){(yield o.volunteer.getHelper()).sendSmsToCourier(this.dialog)}),visible:o=>!!o.volunteer}],gridButtons:[{name:g.context.lang.showOnlyIncoming,click:()=>{this.showAll=!this.showAll,this.grid.reloadData()}}]})}ngOnInit(){}};n.\u0275fac=function(t){return new(t||n)(b(z),b(we))},n.\u0275cmp=O({type:n,selectors:[["app-incoming-messages"]],decls:1,vars:1,consts:[[3,"settings"]],template:function(t,o){t&1&&k(0,"data-grid",0),t&2&&f("settings",o.grid)},dependencies:[Tt]});let r=n;return r})();var Ue=class{constructor(){this.familyUrl="",this.familyName="",this.titulim="",this.size="",this.message="",this.area=new ne({fields:()=>[this.$.basket,this.$.titulim,this.$.size,this.$.gerber,this.$.daisa,this.$.comment]})}get $(){return Le(this)}load(){return h(this,null,function*(){let n=yield this.loadFamily();n&&(this.familyName=n.name)})}update(){return h(this,null,function*(){let n=yield this.loadFamily();if(!n)return;let e=n.createDelivery(void 0);e.basketType=yield g.repo(Ie).findId(this.basket),e.items="",e.deliveryComments=this.comment;for(let i of[this.titulim,this.size,this.gerber?"\u05D2\u05E8\u05D1\u05E8":"",this.daisa?"\u05D3\u05D9\u05E1\u05D4":""])i&&(e.items.length>0&&(e.items+=", "),e.items+=i);yield e.save(),this.message="\u05D4\u05DE\u05E9\u05DC\u05D5\u05D7 \u05E2\u05D5\u05D3\u05DB\u05DF, \u05D9\u05D5\u05DD \u05DE\u05E7\u05E1\u05D9\u05DD"})}loadFamily(){return h(this,null,function*(){let n=yield ae.getFamilyByShortUrl(this.familyUrl);if(!n){this.message="\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0";return}if(yield g.repo(se).count({family:n.id})){this.message="\u05D4\u05DE\u05E9\u05DC\u05D5\u05D7 \u05DB\u05D1\u05E8 \u05DE\u05E2\u05D5\u05D3\u05DB\u05DF \u05D1\u05DE\u05E2\u05E8\u05DB\u05EA, \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05E0\u05D0 \u05DC\u05D9\u05E6\u05D5\u05E8 \u05E7\u05E9\u05E8 \u05D8\u05DC\u05E4\u05D5\u05E0\u05D9";return}return n})}};S([A.string(),_("design:type",String)],Ue.prototype,"familyUrl",void 0);S([A.string(),_("design:type",String)],Ue.prototype,"familyName",void 0);S([A.string({caption:"\u05E1\u05D5\u05D2 \u05DE\u05D6\u05D5\u05DF"}),_e({valueList:()=>h(void 0,null,function*(){return Kr(g.repo(Ie))})}),_("design:type",String)],Ue.prototype,"basket",void 0);S([_e({valueList:[{id:"",caption:"\u05DC\u05DC\u05D0"},...["NB","1","2","3","4","4+","5","6"].map(r=>({id:"\u05D8\u05D9\u05D8\u05D5\u05DC\u05D9\u05DD "+r,caption:r}))]}),A.string({caption:"\u05DE\u05D9\u05D3\u05EA \u05D8\u05D9\u05D8\u05D5\u05DC\u05D9\u05DD"}),_("design:type",String)],Ue.prototype,"titulim",void 0);S([_e({valueList:[{id:"",caption:"\u05DC\u05DC\u05D0"},...["0-3","3-6","6-9","9-12","12-18","18-24"].map(r=>({id:"\u05D1\u05D2\u05D3 "+r,caption:r}))]}),A.string({caption:"\u05DE\u05D9\u05D3\u05EA \u05D1\u05D2\u05D3"}),_("design:type",String)],Ue.prototype,"size",void 0);S([A.boolean({caption:"\u05D2\u05E8\u05D1\u05E8"}),_("design:type",Boolean)],Ue.prototype,"gerber",void 0);S([A.boolean({caption:"\u05D3\u05D9\u05D9\u05E1\u05D4"}),_("design:type",Boolean)],Ue.prototype,"daisa",void 0);S([A.string({caption:"\u05D4\u05E2\u05E8\u05D4"}),_("design:type",String)],Ue.prototype,"comment",void 0);S([A.string(),_("design:type",String)],Ue.prototype,"message",void 0);S([Y({allowed:(r,n)=>Qe().familySelfOrderEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],Ue.prototype,"load",null);S([Y({allowed:(r,n)=>Qe().familySelfOrderEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],Ue.prototype,"update",null);Ue=S([at("family-self-order"),_("design:paramtypes",[])],Ue);function od(r,n){if(r&1){let e=M();X(0),c(1,"div",6),d(2),k(3,"br"),d(4," \u05E9\u05DE\u05D7\u05D9\u05DD \u05DC\u05D4\u05D9\u05D5\u05EA \u05DB\u05D0\u05DF \u05D1\u05E9\u05D1\u05D9\u05DC\u05DA! \u05DE\u05D0\u05E8\u05D6 \u05DE\u05E4\u05E0\u05E7 \u05DE\u05D7\u05DB\u05D4 \u05DC\u05EA\u05D9\u05E0\u05D5\u05E7 \u05E9\u05DC\u05DA.."),k(5,"br"),d(6," \u05D0\u05E0\u05D7\u05E0\u05D5 \u05E8\u05D5\u05E6\u05D9\u05DD \u05DC\u05D4\u05E2\u05E0\u05D9\u05E7 \u05DC\u05DA \u05D5\u05DC\u05EA\u05D9\u05E0\u05D5\u05E7\u05DA \u05D0\u05EA \u05D4\u05D8\u05D5\u05D1 \u05D1\u05D9\u05D5\u05EA\u05E8 \u05D5\u05E2\u05DC \u05DB\u05DF \u05E0\u05E9\u05DE\u05D7 \u05E9\u05EA\u05DE\u05DC\u05D0\u05D9 \u05D8\u05D5\u05E4\u05E1 \u05D6\u05D4 \u05E2\u05DC \u05DE\u05E0\u05EA \u05E9\u05E0\u05D5\u05DB\u05DC \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05D0\u05EA \u05D4\u05E1\u05DC \u05D1\u05DE\u05D9\u05D5\u05D7\u05D3 \u05E2\u05D1\u05D5\u05E8\u05DB\u05DD. "),l(),k(7,"data-area",7),c(8,"button",8),D("click",function(){C(e);let t=p();
31return x(t.update())}),d(9," \u05E9\u05DC\u05D7 \u05D4\u05D6\u05DE\u05E0\u05D4 "),l(),ee()}if(r&2){let e=p();a(2),w(" ",e.familyName," \u05D4\u05D9\u05E7\u05E8\u05D4!\u{1F496}"),a(5),f("settings",e.area)}}var Lt,go=(Lt=class extends Ue{constructor(n,e){super(),this.settings=n,this.route=e}ngOnInit(){this.familyUrl=this.route.snapshot.params.id,this.load()}},Lt.\u0275fac=function(e){return new(e||Lt)(b(P),b(We))},Lt.\u0275cmp=O({type:Lt,selectors:[["app-family-self-order"]],features:[ht],decls:9,vars:4,consts:[[2,"display","flex","justify-content","center"],[2,"max-width","400px"],[2,"width","100%","text-align","center"],[3,"src"],[2,"text-align","center"],[4,"ngIf"],[2,"font-size","larger"],[3,"settings"],["mat-raised-button","","color","primary",3,"click"]],template:function(e,i){e&1&&(c(0,"div",0)(1,"mat-card",1)(2,"div",2),k(3,"img",3),l(),c(4,"p",4),d(5),l(),v(6,od,10,2,"ng-container",5),c(7,"h2"),d(8),l()()()),e&2&&(a(3),re("src",i.settings.logoUrl,Ke),a(2),T(i.settings.organisationName),a(),f("ngIf",!i.message&&i.familyName),a(2),T(i.message))},dependencies:[q,Q,xe,Ce]}),Lt);go=S([at("family-self-order"),_("design:paramtypes",[P,We])],go);var Ps=(()=>{let n=class n{constructor(i){this.ui=i,this.grid=new Ee(g.repo(ca),{rowCssClass:t=>Cn.fromString(t.googleApiResult).ok()?"":"addressProblem",rowButtons:[{icon:"edit",textInMenu:"\u05E2\u05E8\u05D5\u05DA",showInLine:!0,click:t=>{new pa(g).edit(this.ui,t.id,()=>t._.reload())}},{name:"\u05DE\u05E4\u05D4",showInLine:!0,click:t=>{Cn.fromString(t.googleApiResult).openGoogleMaps()}}],columnSettings:t=>[t.id,{caption:"\u05E2\u05D9\u05E8",getValue:o=>Cn.fromString(o.googleApiResult).getCity(),width:"100"}],orderBy:{createDate:"desc"}})}ngOnInit(){}};n.\u0275fac=function(t){return new(t||n)(b(z))},n.\u0275cmp=O({type:n,selectors:[["app-adjust-geocode"]],decls:1,vars:1,consts:[[3,"settings"]],template:function(t,o){t&1&&k(0,"data-grid",0),t&2&&f("settings",o.grid)},dependencies:[Tt]});let r=n;return r})();function rd(r,n){if(r&1&&(c(0,"mat-card",2),k(1,"app-event-info",3),l()),r&2){let e=p();a(),f("e",e.events)("noClose",!0)}}var fr=(()=>{let n=class n{constructor(i){this.route=i}ngOnInit(){return h(this,null,function*(){let i=this.route.snapshot.params;this.events=yield Hn.getAllEvents(Bn.volunteerInfo.phone,i.site).then(t=>t.filter(o=>o.id===i.id)).then(t=>t.length>0?t[0]:void 0)})}};n.\u0275fac=function(t){return new(t||n)(b(We))},n.\u0275cmp=O({type:n,selectors:[["app-specific-event"]],decls:2,vars:1,consts:[[2,"display","flex","justify-content","center"],["style","max-width: 300px",4,"ngIf"],[2,"max-width","300px"],[3,"e","noClose"]],template:function(t,o){t&1&&(c(0,"div",0),v(1,rd,2,2,"mat-card",1),l()),t&2&&(a(),f("ngIf",o.events))},dependencies:[q,xe,Ln]});let r=n;return r})();var nt=class{constructor(){this.deliveryId="",this.familyName="",this.message="",this.text="",this.familyDelivery=g.repo(se).create(),this.fields=[this.familyDelivery.$.address,this.familyDelivery.$.entrance,this.familyDelivery.$.floor,this.familyDelivery.$.appartment,this.familyDelivery.$.buildingCode]}get $(){return Le(this)}load(){return h(this,null,function*(){let n=yield this.loadFamily();if(!n)return;let e={},i=n.name.split(" ");i.length>0&&(this.familyName=i[i.length-1]);for(let t of[...this.fields,n.$.addressOk])e[t.metadata.key]=n.$.find(t.metadata.key).value;switch(n.deliverStatus){case B.ReadyForDelivery:this.message="\u05E2\u05D5\u05D3\u05DB\u05DF \u05E9\u05D0\u05EA\u05DD \u05DE\u05E2\u05D5\u05E0\u05D9\u05D9\u05DD \u05D1\u05DE\u05E9\u05DC\u05D5\u05D7";break;case B.FailedDoNotWant:this.message="\u05E2\u05D5\u05D3\u05DB\u05DF \u05E9\u05D0\u05D9\u05E0\u05DB\u05DD \u05DE\u05E2\u05D5\u05E0\u05D9\u05D9\u05E0\u05D9\u05DD \u05D1\u05DE\u05E9\u05DC\u05D5\u05D7";break;case B.waitingForAdmin:this.message="\u05D4\u05E2\u05E8\u05EA\u05DB\u05DD \u05E2\u05D5\u05D3\u05DB\u05E0\u05D4";break}return this.text=yield(yield n.createConfirmDetailsUserText()).mergeFromTemplate(),e})}interested(){return h(this,null,function*(){let n=yield this.loadFamily();n&&(n.deliverStatus=B.ReadyForDelivery,n.callerComment="\u05E2\u05D5\u05D3\u05DB\u05DF \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05E9\u05E4\u05D7\u05D4:",yield n.save(),this.updatedReceived())})}updatedReceived(){this.message="\u05D4\u05DE\u05E9\u05DC\u05D5\u05D7 \u05E2\u05D5\u05D3\u05DB\u05DF, \u05D9\u05D5\u05DD \u05DE\u05E7\u05E1\u05D9\u05DD",this.familyName=""}notInterested(){return h(this,null,function*(){let n=yield this.loadFamily();n&&(n.deliverStatus=B.FailedDoNotWant,n.callerComment="\u05E2\u05D5\u05D3\u05DB\u05DF \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05E9\u05E4\u05D7\u05D4:",yield n.save(),this.updatedReceived())})}updateComment(){return h(this,null,function*(){let n=yield this.loadFamily();n&&(n.callerComment="\u05E2\u05D5\u05D3\u05DB\u05DF \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05E9\u05E4\u05D7\u05D4: "+this.comment,n.deliverStatus=B.waitingForAdmin,yield n.save(),this.updatedReceived())})}loadFamily(){return h(this,null,function*(){let n=yield g.repo(se).findId(this.deliveryId);if(!n){this.message="\u05DE\u05E9\u05DC\u05D5\u05D7 \u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0";return}if(ad.includes(n.deliverStatus))return n})}};S([A.string(),_("design:type",String)],nt.prototype,"deliveryId",void 0);S([A.string(),_("design:type",String)],nt.prototype,"familyName",void 0);S([A.string({caption:"\u05DE\u05D4 \u05DC\u05E2\u05D3\u05DB\u05DF?",customInput:r=>r.textArea()}),_("design:type",String)],nt.prototype,"comment",void 0);S([A.string(),_("design:type",String)],nt.prototype,"message",void 0);S([A.string(),_("design:type",String)],nt.prototype,"text",void 0);S([Y({allowed:()=>Qe().familyConfirmDetailsEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],nt.prototype,"load",null);S([Y({allowed:()=>Qe().familyConfirmDetailsEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],nt.prototype,"interested",null);S([Y({allowed:()=>Qe().familyConfirmDetailsEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],nt.prototype,"notInterested",null);S([Y({allowed:()=>Qe().familyConfirmDetailsEnabled}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],nt.prototype,"updateComment",null);nt=S([at("family-confirm-details"),_("design:paramtypes",[])],nt);var ad=[B.enquireDetails,B.waitingForAdmin,B.ReadyForDelivery,B.FailedDoNotWant];function sd(r,n){if(r&1&&(c(0,"tr")(1,"th"),d(2),l(),c(3,"td"),d(4),l()()),r&2){let e=n.$implicit,i=p(2);a(2),w("",e.metadata.caption,":"),a(2),T(i.familyDelivery.$.find(e.metadata).value)}}function ld(r,n){if(r&1){let e=M();X(0),c(1,"div",6),d(2),c(3,"table"),v(4,sd,5,2,"tr",7),c(5,"tr")(6,"th",8),d(7),l()(),c(8,"tr")(9,"td",8),d(10),l()()()(),c(11,"div",9)(12,"button",10),D("click",function(){C(e);let t=p();return x(t.interested())}
31),d(13," \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05EA\u05E7\u05D9\u05E0\u05D9\u05DD "),l(),c(14,"button",11),D("click",function(){C(e);let t=p();return x(t.provideComment())}),d(15," \u05E2\u05D3\u05DB\u05D5\u05DF \u05E4\u05E8\u05D8\u05D9\u05DD "),l(),c(16,"button",12),D("click",function(){C(e);let t=p();return x(t.notInterested())}),d(17," \u05DC\u05D0 \u05DE\u05E2\u05D5\u05E0\u05D9\u05D9\u05E0\u05D9\u05DD \u05D1\u05DE\u05E9\u05DC\u05D5\u05D7 "),l()(),ee()}if(r&2){let e=p();a(2),w(" ",e.text," "),a(2),f("ngForOf",e.fields),a(3),w(" ",e.familyDelivery.$.addressComment.metadata.caption,": "),a(3),w(" ",e.familyDelivery.addressComment||"\u05DC\u05D0 \u05E6\u05E8\u05D9\u05DA \u05D4\u05E0\u05D7\u05D9\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA"," ")}}var $t,_o=($t=class extends nt{constructor(n,e,i){super(),this.settings=n,this.route=e,this.ui=i}provideComment(){this.ui.inputAreaDialog({title:"\u05E2\u05D3\u05DB\u05D5\u05DF \u05E4\u05E8\u05D8\u05D9\u05DD",fields:[this.$.comment],ok:()=>{this.updateComment()},cancel:()=>{}})}ngOnInit(){return h(this,null,function*(){this.deliveryId=this.route.snapshot.params.id;let n=yield this.load();n&&(this.familyDelivery=yield g.repo(se).fromJson(n))})}},$t.\u0275fac=function(e){return new(e||$t)(b(P),b(We),b(z))},$t.\u0275cmp=O({type:$t,selectors:[["app-family-confirm-details"]],features:[ht],decls:9,vars:4,consts:[[2,"display","flex","justify-content","center"],[2,"max-width","400px"],[2,"width","100%","text-align","center"],[3,"src"],[2,"text-align","center"],[4,"ngIf"],[2,"white-space","pre-line"],[4,"ngFor","ngForOf"],["colspan","2"],[2,"display","flex","gap","16px","place-content","center","flex-wrap","wrap","margin-top","16px"],["mat-raised-button","","color","primary",3,"click"],["mat-raised-button","",3,"click"],["mat-raised-button","","color","accent",3,"click"]],template:function(e,i){e&1&&(c(0,"div",0)(1,"mat-card",1)(2,"div",2),k(3,"img",3),l(),c(4,"p",4),d(5),l(),c(6,"h3"),d(7),l(),v(8,ld,18,4,"ng-container",5),l()()),e&2&&(a(3),re("src",i.settings.logoUrl,Ke),a(2),T(i.settings.organisationName),a(2),T(i.message),a(),f("ngIf",i.familyName))},dependencies:[me,q,Q,xe]}),$t);_o=S([at("family-confirm-details"),_("design:paramtypes",[P,We,z])],_o);var Ns,ue=Ns=class extends Yr{constructor(){super(...arguments),this.role=""}static getBasketTypes(){return h(this,null,function*(){return Qt(Ie).find({}).then(n=>n.map(({id:e,name:i,intakeCommentInstructions:t})=>({id:e,name:i,intakeCommentInstructions:t})))})}submit(){return h(this,null,function*(){let n=yield Qt(Bt).findFirst({id:"\u05D8\u05D5\u05E4\u05E1 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8"});n||(n=yield Qt(Bt).insert({id:"\u05D8\u05D5\u05E4\u05E1 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8",name:"\u05D8\u05D5\u05E4\u05E1 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8"}));let i=yield(yield Qt(ae).insert({name:this.firstName+" "+this.name,tz:this.tz,address:this.address,autoCompleteResult:this.addressApiResult,floor:this.floor,appartment:this.appartment,entrance:this.entrance,addressComment:this.addressComment,phone1:this.phone1,phone1Description:this.phone1Description,phone2:this.phone2,phone2Description:this.phone2Description,basketType:yield Qt(Ie).findId(this.basketType),deliveryComments:this.deliveryComments,socialWorker:this.fillerName+" "+this.role,socialWorkerPhone1:this.fillerPhone})).createDelivery(yield g.context.defaultDistributionCenter());return i.deliverStatus=B.enquireDetails,yield i.save(),"\u05D4\u05E4\u05E0\u05D9\u05D9\u05D4 \u05D4\u05EA\u05E7\u05D1\u05DC\u05D4"})}};S([A.string({translation:r=>r.socialSecurityNumber}),_("design:type",String)],ue.prototype,"tz",void 0);S([A.string({translation:r=>r.firstName,validate:_i.required.withMessage(F.language.nameIsTooShort)}),_("design:type",String)],ue.prototype,"firstName",void 0);S([A.string({translation:r=>r.lastName,validate:_i.required.withMessage(F.language.nameIsTooShort)}),_("design:type",String)],ue.prototype,"name",void 0);S([A.string({translation:r=>r.address,customInput:r=>r.addressInput((n,e)=>{e.addressByGoogle=n.addressByGoogle,e.addressApiResult=JSON.stringify({address:e.address,result:n.autoCompleteResult})}),validate:r=>{if(!r.addressByGoogle&&!Qr())throw"\u05E0\u05D0 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05DB\u05EA\u05D5\u05D1\u05EA \u05E9\u05D2\u05D5\u05D2\u05DC \u05DE\u05D5\u05E6\u05D0"}}),_("design:type",String)],ue.prototype,"address",void 0);S([A.string(),_("design:type",String)],ue.prototype,"addressApiResult",void 0);S([A.string(),_("design:type",String)],ue.prototype,"floor",void 0);S([A.string(),_("design:type",String)],ue.prototype,"appartment",void 0);S([A.string(),_("design:type",String)],ue.prototype,"entrance",void 0);S([A.string(),_("design:type",String)],ue.prototype,"addressComment",void 0);S([$e(()=>fe,{validate:[(r,n)=>{if(!Oo(n.value?.thePhone))throw"\u05D8\u05DC\u05E4\u05D5\u05DF \u05E9\u05D2\u05D5\u05D9"}]}),_("design:type",fe)],ue.prototype,"phone1",void 0);S([A.string(),_("design:type",String)],ue.prototype,"phone1Description",void 0);S([$e(()=>fe),_("design:type",fe)],ue.prototype,"phone2",void 0);S([A.string(),_("design:type",String)],ue.prototype,"phone2Description",void 0);S([A.string({caption:"\u05E9\u05DD \u05DE\u05DE\u05DC\u05D0 \u05D4\u05D8\u05D5\u05E4\u05E1",validate:_i.required}),_("design:type",String)],ue.prototype,"fillerName",void 0);S([$e(()=>fe,{caption:"\u05D8\u05DC\u05E4\u05D5\u05DF \u05DE\u05DE\u05DC\u05D0 \u05D4\u05D8\u05D5\u05E4\u05E1",validate:[_i.required,(r,n)=>{if(!Oo(n.value?.thePhone))throw"\u05D8\u05DC\u05E4\u05D5\u05DF \u05E9\u05D2\u05D5\u05D9"}]}),_("design:type",fe)],ue.prototype,"fillerPhone",void 0);S([_e({valueList:["","\u05DE\u05D5\u05E7\u05D3","\u05E2\u05D5\u05D1\u05D3\u05EA \u05E1\u05D5\u05E6\u05D9\u05D0\u05DC\u05D9\u05EA","\u05DE\u05EA\u05E0\u05D3\u05D1"]}),A.string({caption:"\u05EA\u05E4\u05E7\u05D9\u05D3",validate:_i.required}),_("design:type",String)],ue.prototype,"role",void 0);S([A.string({caption:"\u05D0\u05D9\u05DA \u05D0\u05E4\u05E9\u05E8 \u05DC\u05E2\u05D6\u05D5\u05E8?",validate:(r,n)=>h(void 0,null,function*(){if(r.basketTypes||(r.basketTypes=yield ue.getBasketTypes()),!r.basketTypes.find(e=>e.id==n.value))throw Error("\u05E0\u05D0 \u05DC\u05D1\u05D7\u05D5\u05E8 "+n.metadata.caption)})}),_("design:type",String)],ue.prototype,"basketType",void 0);S([A.string({caption:"\u05DE\u05D9\u05D3\u05E2 \u05E0\u05D5\u05E1\u05E3"}),_("design:type",String)],ue.prototype,"deliveryComments",void 0);S([Y({allowed:Qi}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],ue.prototype,"submit",null);S([Y({allowed:Qi}),_("design:type",Function),_("design:paramtypes",[]),_("design:returntype",Promise)],ue,"getBasketTypes",null);ue=Ns=S([at("intake-form")],ue);_i.required.defaultMessage="\u05D7\u05E1\u05E8 \u05E2\u05E8\u05DA";function cd(r,n){if(r&1&&k(0,"data-area",8),r&2){let e=p(2);f("settings",e.area)}}function md(r,n){if(r&1){let e=M();c(0,"div"),v(1,cd,1,1,"data-area",5),c(2,"div")(3,"strong"),d(4),l(),k(5,"data-control",6),l(),c(6,"button",7),D("click",function(){C(e);let t=p();return x(t.send())}),d(7,"\u05E9\u05DC\u05D9\u05D7\u05EA \u05D1\u05E7\u05E9\u05D4"),l()()}if(r&2){let e=p();a(),f("ngIf",e.area),a(3),T(e.getInstructions()),a(),f("field",e.i.$.deliveryComments)}}function dd(r,n){r&1&&(c(0,"div"),d(1,"\u05D4\u05E4\u05E0\u05D9\u05D9\u05D4 \u05D4\u05EA\u05E7\u05D1\u05DC\u05D4, \u05EA\u05D5\u05D3\u05D4 \u05E8\u05D1\u05D4"),l())}var Bs=(()=>{let n=class n{constructor(i,t){this.settings=i,this.ui=t,this.i=new ue,this.response=""}ngOnInit(){ue.getBasketTypes().then(i=>{this.i.basketTypes=i,this.area=new ne({fields:()=>{let t=this.i.$;return[t.tz,t.firstName,t.name,t.address,{caption:this.settings.lang.addressByGoogle,getValue:()=>this.i.addressByGoogle},[t.appartment,t.floor,t.entrance],t.addressComment,[t.fillerName,t.fillerPhone,t.role],[t.phone1,t.phone1Description],[t.phone2,t.phone2Description],{field:t.basketType,valueList:i.map(({id:o,name:s})=>({id:o,caption:s}))}]}})})}getInstructions(){return this.i.basketTypes.find(i=>i.id===this.i.basketType)?.intakeCommentInstructions}send(){return h(this,null,function*(){try{this.response=yield this.i.submit(),this.area=void 0}catch(i){this.ui.Error(i)}})}};n.\u0275fac=function(t){return new(t||n)(b(P),b(z))},n.\u0275cmp=O({type:n,selectors:[["app-intake-form"]],decls:7,vars:4,consts:[[2,"text-align","center"],["href","https://hagai.co"],[2,"max-width","120px",3,"src"],[1,"mat-headline",2,"align-self","center"],[4,"ngIf"],[3,"settings",4,"ngIf"],[3,"field"],["mat-raised-button","","color","primary",3,"click"],[3,"settings"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"a",1),k(2,"img",2),l(),c(3,"div",3),d(4),l()(),v(5,md,8,3,"div",4)(6,dd,2,0,"div",4)),t&2&&(a(2),re("src",o.settings.logoUrl,Ke),a(2),w(" ",o.settings.organisationName," "),a(),f("ngIf",o.area),a(),f("ngIf",o.response))},dependencies:[q,Q,bn,Ce]});let r=n;return r})();var Hs=(()=>{let n=class n{canActivate(i,t){return Qi()}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=jt({token:n,factory:n.\u0275fac});let r=n;return r})(),pd=(()=>{let n=class n{canActivate(i,t){return kt.getOrganizationFromContext()=="mlt"?g.isAllowed(V.admin):!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=jt({token:n,factory:n.\u0275fac});let r=n;return r}
31)(),ud=[Gn.route,{path:"assign-escort",component:Wi,canActivate:[Re]},Hi.route,Kn.route,Yn.route,so.route,co.needsWorkRoute,{path:"overview",component:Pn,canActivate:[Tn]},no.route,{path:"fso/:id",component:go},{path:"fcd/:id",component:_o},xi.route,{path:"tr",component:Os,canActivate:[Tn],data:{hide:!0}},ui.route,{path:"playback",component:$i,canActivate:[Re],data:{hide:!0,noBar:!0}},{path:"fix-address",component:Ps,canActivate:[Re],data:{hide:!0}},{path:"print-volunteers",component:vs,canActivate:[Re],data:{hide:!0,noBar:!0}},{path:"print-stickers",component:ws,canActivate:[Re],data:{hide:!0,noBar:!0,noConfHeaderAndBorders:!0}},{path:"print-volunteer",component:Cs,canActivate:[Re],data:{hide:!0,noBar:!0,noConfHeaderAndBorders:!0}},{path:"testmap",component:Vs,data:{hide:!0}},{path:"intake",component:Bs,canActivate:[Hs],data:{hide:!0}},{path:"import-from-excel",component:Ct,canActivate:[er]},{path:"import-helpers-from-excel",component:ho,canActivate:[Re]},{path:"duplicate-families",component:xt,canActivate:[Re]},eo.route,{path:"sms-messages",component:fo,canActivate:[Re]},Ss.route,Vi.route,{path:"caller",component:Qa,canActivate:[Rn],data:{name:"\u05D8\u05DC\u05E4\u05D5\u05E0\u05D9\u05DD \u05DC\u05D1\u05D9\u05E8\u05D5\u05E8 \u05E4\u05E8\u05D8\u05D9\u05DD"}},{path:"manage-callers",component:qa,canActivate:[Rn,Re],data:{name:"\u05E0\u05D9\u05D4\u05D5\u05DC \u05D8\u05DC\u05E4\u05E0\u05D9\u05DD",hide:!0}},{path:"events",component:Ci},{path:"events/:id",component:Ci},{path:"event/:site/:id/:remote",component:fr},{path:"event/:site/:id",component:fr},nn.route,Xi.route,{path:"",redirectTo:"/assign-families",pathMatch:"full"},{path:"**",redirectTo:"/assign-families",pathMatch:"full"}],Ls=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({providers:[Re,Hs,er,Tn,ai,Ha,La,An,pd,$a,Wa,Rn],imports:[hn,Ho.forRoot(ud),Ho]});let r=n;return r})();En.componentToNavigateIfNotAllowed=Ci;var vo=["*"],gd=["content"],_d=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],yd=["mat-drawer","mat-drawer-content","*"];function vd(r,n){if(r&1){let e=M();c(0,"div",1),D("click",function(){C(e);let t=p();return x(t._onBackdropClicked())}),l()}if(r&2){let e=p();le("mat-drawer-shown",e._isShowingBackdrop())}}function wd(r,n){r&1&&(c(0,"mat-drawer-content"),Ve(1,2),l())}var Cd=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],xd=["mat-sidenav","mat-sidenav-content","*"];function Dd(r,n){if(r&1){let e=M();c(0,"div",1),D("click",function(){C(e);let t=p();return x(t._onBackdropClicked())}),l()}if(r&2){let e=p();le("mat-drawer-shown",e._isShowingBackdrop())}}function bd(r,n){r&1&&(c(0,"mat-sidenav-content"),Ve(1,2),l())}var Sd='.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}',Ws={transformDrawer:Gr("transform",[Fo("open, open-instant",Mo({transform:"none",visibility:"visible"})),Fo("void",Mo({"box-shadow":"none",visibility:"hidden"})),To("void => open-instant",Eo("0ms")),To("void <=> open, open-instant => void",Eo("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])};var Id=new zi("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:kd}),gr=new zi("MAT_DRAWER_CONTAINER");function kd(){return!1}var yo=(()=>
31{let n=class n extends Ei{constructor(i,t,o,s,m){super(o,s,m),this._changeDetectorRef=i,this._container=t}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}};n.\u0275fac=function(t){return new(t||n)(b(qt),b(Do(()=>zs)),b(Vt),b(Wo),b(gi))},n.\u0275cmp=O({type:n,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(t,o){t&2&&Ut("margin-left",o._container._contentMargins.left,"px")("margin-right",o._container._contentMargins.right,"px")},standalone:!0,features:[Gt([{provide:Ei,useExisting:n}]),ht,rt],ngContentSelectors:vo,decls:1,vars:0,template:function(t,o){t&1&&(ot(),Ve(0))},encapsulation:2,changeDetection:0});let r=n;return r})(),js=(()=>{let n=class n{get position(){return this._position}set position(i){i=i==="end"?"end":"start",i!==this._position&&(this._isAttached&&this._updatePositionInParent(i),this._position=i,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(i){this._mode=i,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(i){this._disableClose=vi(i)}get autoFocus(){let i=this._autoFocus;return i??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(i){(i==="true"||i==="false"||i==null)&&(i=vi(i)),this._autoFocus=i}get opened(){return this._opened}set opened(i){this.toggle(vi(i))}constructor(i,t,o,s,m,u,y,E){this._elementRef=i,this._focusTrapFactory=t,this._focusMonitor=o,this._platform=s,this._ngZone=m,this._interactivityChecker=u,this._doc=y,this._container=E,this._focusTrap=null,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new Wt,this._animationEnd=new Wt,this._animationState="void",this.openedChange=new fi(!0),this._openedStream=this.openedChange.pipe(hi(I=>I),wo(()=>{})),this.openedStart=this._animationStarted.pipe(hi(I=>I.fromState!==I.toState&&I.toState.indexOf("open")===0),Co(void 0)),this._closedStream
31=this.openedChange.pipe(hi(I=>!I),wo(()=>{})),this.closedStart=this._animationStarted.pipe(hi(I=>I.fromState!==I.toState&&I.toState==="void"),Co(void 0)),this._destroyed=new Wt,this.onPositionChanged=new fi,this._modeChanged=new Wt,this._injector=zt(bo),this._changeDetectorRef=zt(qt),this.openedChange.pipe(ut(this._destroyed)).subscribe(I=>{I?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{Sr(this._elementRef.nativeElement,"keydown").pipe(hi(I=>I.keyCode===27&&!this.disableClose&&!wa(I)),ut(this._destroyed)).subscribe(I=>this._ngZone.run(()=>{this.close(),I.stopPropagation(),I.preventDefault()}))}),this._animationEnd.pipe(Mr((I,N)=>I.fromState===N.fromState&&I.toState===N.toState)).subscribe(I=>{let{fromState:N,toState:H}=I;(H.indexOf("open")===0&&N==="void"||H==="void"&&N.indexOf("open")===0)&&this.openedChange.emit(this._opened)})}_forceFocus(i,t){this._interactivityChecker.isFocusable(i)||(i.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{i.removeEventListener("blur",o),i.removeEventListener("mousedown",o),i.removeAttribute("tabindex")};i.addEventListener("blur",o),i.addEventListener("mousedown",o)})),i.focus(t)}_focusByCssSelector(i,t){let o=this._elementRef.nativeElement.querySelector(i);o&&this._forceFocus(o,t)}_takeFocus(){if(!this._focusTrap)return;let i=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Io(()=>{!this._focusTrap.focusInitialElement()&&typeof i.focus=="function"&&i.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(i){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,i):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let i=this._doc.activeElement;return!!i&&this._elementRef.nativeElement.contains(i)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(i){return this.toggle(!0,i)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(i=!this.opened,t){i&&t&&(this._openedVia=t);let o=this._setOpen(i,!i&&this._isFocusWithinDrawer(),this._openedVia||"program");return i||(this._openedVia=null),o}_setOpen(i,t,o){return this._opened=i,i?this._animationState=this._enableAnimations?"open":"open-instant":(this._animationState="void",t&&this._restoreFocus(o)),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(s=>{this.openedChange.pipe(Er(1)).subscribe(m=>s(m?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(i){if(!this._platform.isBrowser)return;let t=this._elementRef.nativeElement,o=t.parentNode;i==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),o.insertBefore(this._anchor,t)),o.appendChild(t)):this._anchor&&this._anchor.parentNode.insertBefore(t,this._anchor)}};n.\u0275fac=function(t){return new(t||n)(b(Vt),b(xa),b(Da),b(Dn),b(gi),b(Ca),b(un,8),b(gr,8))},n.\u0275cmp=O({type:n,selectors:[["mat-drawer"]],viewQuery:function(t,o){if(t&1&&ce(gd,5),t&2){let s;te(s=ie())&&(o._content=s.first)}},hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(t,o){t&1&&Pr("@transform.start",function(m){return o._animationStarted.next(m)})("@transform.done",function(m){return o._animationEnd.next(m)}),t&2&&(Vr("@transform",o._animationState),pn("align",null),le("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side")("mat-drawer-opened",o.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],standalone:!0,features:[rt],ngContentSelectors:vo,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(t,o){t&1&&(ot(),c(0,"div",1,0),Ve(2),l())},dependencies:[Ei],encapsulation:2,data:{animation:[Ws.transformDrawer]},changeDetection:0});let r=n;return r})(),zs=(()=>{let n=class n{get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(i){this._autosize=vi(i)}get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(i){this._backdropOverride=i==null?null:vi(i)}get scrollable(){return this._userContent||this._content}constructor(i,t,o,s,m,u=!1,y){this._dir=i,this._element=t,this._ngZone=o,this._changeDetectorRef=s,this._animationMode=y,this._drawers=new Tr,this.backdropClick=new fi,this._destroyed=new Wt,this._doCheckSubject=ne
31w Wt,this._contentMargins={left:null,right:null},this._contentMarginChanges=new Wt,this._injector=zt(bo),i&&i.change.pipe(ut(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),m.change().pipe(ut(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=u}ngAfterContentInit(){this._allDrawers.changes.pipe(xo(this._allDrawers),ut(this._destroyed)).subscribe(i=>{this._drawers.reset(i.filter(t=>!t._container||t._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(xo(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(i=>{this._watchDrawerToggle(i),this._watchDrawerPosition(i),this._watchDrawerMode(i)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(kr(10),ut(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(i=>i.open())}close(){this._drawers.forEach(i=>i.close())}updateContentMargins(){let i=0,t=0;if(this._left&&this._left.opened){if(this._left.mode=="side")i+=this._left._getWidth();else if(this._left.mode=="push"){let o=this._left._getWidth();i+=o,t-=o}}if(this._right&&this._right.opened){if(this._right.mode=="side")t+=this._right._getWidth();else if(this._right.mode=="push"){let o=this._right._getWidth();t+=o,i-=o}}i=i||null,t=t||null,(i!==this._contentMargins.left||t!==this._contentMargins.right)&&(this._contentMargins={left:i,right:t},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(i){i._animationStarted.pipe(hi(t=>t.fromState!==t.toState),ut(this._drawers.changes)).subscribe(t=>{t.toState!=="open-instant"&&this._animationMode!=="NoopAnimations"&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),i.mode!=="side"&&i.openedChange.pipe(ut(this._drawers.changes)).subscribe(()=>this._setContainerClass(i.opened))}_watchDrawerPosition(i){i&&i.onPositionChanged.pipe(ut(this._drawers.changes)).subscribe(()=>{Io(()=>{this._validateDrawers()},{injector:this._injector,phase:Ar.Read})})}_watchDrawerMode(i){i&&i._modeChanged.pipe(ut(Ir(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(i){let t=this._element.nativeElement.classList,o="mat-drawer-container-has-open";i?t.add(o):t.remove(o)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(i=>{i.position=="end"?(this._end!=null,this._end=i):(this._start!=null,this._start=i)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(i=>i&&!i.disableClose&&this._drawerHasBackdrop(i)).forEach(i=>i._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(i){return i!=null&&i.opened}_drawerHasBackdrop(i){return this._backdropOverride==null?!!i&&i.mode!=="side":this._backdropOverride}};n.\u0275fac=function(t){return new(t||n)(b(ba,8),b(Vt),b(gi),b(qt),b(Sa),b(Id),b(Rr,8))},n.\u0275cmp=O({type:n,selectors:[["mat-drawer-container"]],contentQueries:function(t,o,s){if(t&1&&(Pt(s,yo,5),Pt(s,js,5)),t&2){let m;te(m=ie())&&(o._content=m.first),te(m=ie())&&(o._allDrawers=m)}},viewQuery:function(t,o){if(t&1&&ce(yo,5),t&2){let s;
31te(s=ie())&&(o._userContent=s.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(t,o){t&2&&le("mat-drawer-container-explicit-backdrop",o._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],standalone:!0,features:[Gt([{provide:gr,useExisting:n}]),rt],ngContentSelectors:yd,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(t,o){t&1&&(ot(_d),v(0,vd,1,2,"div",0),Ve(1),Ve(2,1),v(3,wd,2,0,"mat-drawer-content")),t&2&&(Dt(o.hasBackdrop?0:-1),a(3),Dt(o._content?-1:3))},dependencies:[yo],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0});let r=n;return r})(),$s=(()=>{let n=class n extends yo{constructor(i,t,o,s,m){super(i,t,o,s,m)}};n.\u0275fac=function(t){return new(t||n)(b(qt),b(Do(()=>yr)),b(Vt),b(Wo),b(gi))},n.\u0275cmp=O({type:n,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(t,o){t&2&&Ut("margin-left",o._container._contentMargins.left,"px")("margin-right",o._container._contentMargins.right,"px")},standalone:!0,features:[Gt([{provide:Ei,useExisting:n}]),ht,rt],ngContentSelectors:vo,decls:1,vars:0,template:function(t,o){t&1&&(ot(),Ve(0))},encapsulation:2,changeDetection:0});let r=n;return r})(),_r=(()=>{let n=class n extends js{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(i){this._fixedInViewport=vi(i)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(i){this._fixedTopGap=Lo(i)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(i){this._fixedBottomGap=Lo(i)}};n.\u0275fac=(()=>{let i;return function(o){return(i||(i=dn(n)))(o||n)}})(),n.\u0275cmp=O({type:n,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(t,o){t&2&&(pn("align",null),Ut("top",o.fixedInViewport?o.fixedTopGap:null,"px")("bottom",o.fixedInViewport?o.fixedBottomGap:null,"px"),le("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side")("mat-drawer-opened",o.opened)("mat-sidenav-fixed",o.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],standalone:!0,features:[ht,rt],ngContentSelectors:vo,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(t,o){t&1&&(ot(),c(0,"div",1,0),Ve(2),l())},dependencies:[Ei],encapsulation:2,data:{animation:[Ws.transformDrawer]},changeDetection:0});let r=n;return r})(),yr=(()=>{let n=class n extends zs{constructor(){super(...arguments),this._allDrawers=void 0,this._content=void 0}};n.\u0275fac=(()=>{let i;return function(o){return(i||(i=dn(n)))(o||n)}})(),n.\u0275cmp=O({type:n,selectors:[["mat-sidenav-container"]],contentQueries:function(t,o,s){if(t&1&&(Pt(s,$s,5),Pt(s,_r,5)),t&2){let m;te(m=ie())&&(o._content=m.first),te(m=ie())&&(o._allDrawers=m)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(t,o){t&2&&le("mat-drawer-container-explicit-backdrop",o._backdropOverride)},exportAs:["matSidenavContainer"],standalone:!0,features:[Gt([{provide:gr,useExisting:n}]),ht,rt],ngContentSelectors:xd,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(t,o){t&1&&(ot(Cd),v(0,Dd,1,2,"div",0),Ve(1),Ve(2,1),v(3,bd,2,0,"mat-sidenav-content")),t&2&&(Dt(o.hasBackdrop?0:-1),a(3),Dt(o._content?-1:3))},dependencies:[$s],styles:[Sd],encapsulation:2,changeDetection:0});let r=n;return r})(),vr=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({imports:[st,Zi,Zi,st]});let r=n;return r})();var Ne=class{constructor(){this.archiveHelper=new Zn,this.useFamilyDistributionList=!0,this.allDistCenters=!1}get selectedDistributionList(){return this.allDistCenters?null:this._selectedDistributionList}isAllowed(){return g.isAllowed(V.admin)}get $(){return Le(this,g)}createNewEvent(n){return h(this,null,function*(){let e=yield P.getAsync();for(let y of[[this.$.createNewDelivery,e.$.createBasketsForAllFamiliesInCreateEvent],[this.$.includeGroups,e.$.includeGroupsInCreateEvent],[this.$.excludeGroups,e.$.excludeGroupsInCreateEvent]])y[1].value=y[0].value;yield e.save();let i=new yn(10);try{for(var o=bi(g.repo(se).query({where:{distributionCenter:g.context.filterDistCenter(this.selectedDistributionList)}})),s,m,u;s=!(m=yield o.next()).done;s=!1){let y=m.value;this.archiveHelper.forEach(y),y.archive=!0,yield i.push(y.save())}}catch{u=[m]}
31finally{try{s&&(m=o.return)&&(yield m.call(o))}finally{if(u)throw u[0]}}yield i.done();let t=0;return this.createNewDelivery&&(t=yield this.iterateFamilies(y=>h(this,null,function*(){let E=yield y.createDelivery(this.useFamilyDistributionList?null:this.distributionCenter);E._disableMessageToUsers=!0,this.moreOptions&&(this.useFamilyBasket||(E.basketType=this.basketType)),yield E.save()}),n),ae.SendMessageToBrowsers(t+" "+Z().deliveriesCreated,"")),t})}iterateFamilies(n,e){return h(this,null,function*(){let i=0;try{for(var t=bi(g.repo(ae).query({where:{status:Ge.Active},progress:e})),o,s,m;o=!(s=yield t.next()).done;o=!1){let u=s.value;let y=!0;if(this.moreOptions){if(this.includeGroups?.hasAny()){y=!1;for(let E of this.includeGroups.listGroups())u.groups.selected(E.trim())&&(y=!0)}if(this.excludeGroups?.hasAny())for(let E of this.excludeGroups.listGroups())u.groups.selected(E.trim())&&(y=!1)}y&&(i++,yield n(u))}}catch{m=[s]}finally{try{o&&(s=t.return)&&(yield s.call(t))}finally{if(m)throw m[0]}}return i})}show(n,e){return h(this,null,function*(){this.ui=n,yield e._.reload();for(let m of[[this.$.createNewDelivery,e.$.createBasketsForAllFamiliesInCreateEvent],[this.$.includeGroups,e.$.includeGroupsInCreateEvent],[this.$.excludeGroups,e.$.excludeGroupsInCreateEvent]])m[0].value=m[1].value;this.includeGroups.evilGet()!=""&&(this.moreOptions=!0),this._selectedDistributionList=n.distCenter,n.distCenter==null&&(this.allDistCenters=!0);let i=yield g.repo(se).count(br(Dr({},Pe.readyFilter()),{distributionCenter:g.context.filterDistCenter(this.selectedDistributionList)}));if(i>0){yield n.messageDialog(Z().thereAre+" "+i+" "+Z().notDoneDeliveriesShouldArchiveThem),n.navigateToComponent((yield import("./chunk-3HU6A6EA.js")).FamilyDeliveriesComponent);return}let t=new Date;t.setHours(t.getHours()-3);let o=yield g.repo(se).count({$and:[Pe.onTheWayFilter()],courierAssingTime:{">=":t},distributionCenter:g.context.filterDistCenter(this.selectedDistributionList)});if(o>0&&!(yield n.YesNoPromise(Z().thereAre+" "+o+" "+Z().deliveresOnTheWayAssignedInTheLast3Hours))){n.navigateToComponent((yield import("./chunk-3HU6A6EA.js")).FamilyDeliveriesComponent);return}this.useFamilyBasket=!0;let s=yield this.archiveHelper.initArchiveHelperBasedOnCurrentDeliveryInfo({distributionCenter:g.context.filterDistCenter(this.selectedDistributionList)},e.usingSelfPickupModule);yield n.inputAreaDialog({title:e.lang.createNewEvent,helpText:e.lang.createNewEventHelp,fields:[...s,...[...this.$].filter(m=>m!=this.$.archiveHelper)],ok:()=>h(this,null,function*(){let m=yield this.createNewEvent();n.refreshFamiliesAndDistributionCenters(),n.distCenter=n.distCenter,n.Error(m+" "+e.lang.deliveriesCreated)}),cancel:()=>{},validate:()=>h(this,null,function*(){let m=yield g.repo(se).count({distributionCenter:g.context.filterDistCenter(this.selectedDistributionList)});if(m>0&&!(yield n.YesNoPromise(Z().confirmArchive+" "+m+" "+Z().deliveries)))throw Z().actionCanceled;if(this.createNewDelivery&&!(yield n.YesNoPromise(Z().create+" "+(yield this.countNewDeliveries())+" "+Z().newDeliveriesQM)))throw Z().actionCanceled})})})}countNewDeliveries(n){return h(this,null,function*(){return this.iterateFamilies(()=>h(this,null,function*(){}),n)})}};S([$e(()=>Zn),_("design:type",Zn)],Ne.prototype,"archiveHelper",void 0);S([A.boolean({translation:r=>r.createNewDeliveryForAllFamilies}),_("design:type",Boolean)],Ne.prototype,"createNewDelivery",void 0);S([A.boolean(),_e({visible:r=>r.ui?.hasManyCenters&&r.createNewDelivery&&r.moreOptions}),_("design:type",Boolean)],Ne.prototype,"useFamilyDistributionList",void 0);S([$e(()=>ye),_e({visible:r=>r.ui?.hasManyCenters&&r.createNewDelivery&&r.moreOptions&&!r.useFamilyDistributionList}),_("design:type",ye)],Ne.prototype,"distributionCenter",void 0);S([_e({visible:()=>!1}),$e(()=>ye),_("design:type",ye)],Ne.prototype,"_selectedDistributionList",void 0);S([_e({visible:()=>!1}),A.boolean(),_("design:type",Boolean)],Ne.prototype,"allDistCenters",void 0);S([A.boolean({translation:r=>r.moreOptions}),_e({visible:r=>r.createNewDelivery}),_("design:type",Boolean)],Ne.prototype,"moreOptions",void 0);S([$e(()=>Yt,{translation:r=>r.includeGroups}),_e({visible:r=>r.createNewDelivery&&r.moreOptions}),_("design:type",Yt)],Ne.prototype,"includeGroups",void 0);S([$e(()=>Yt,{translation:r=>r.excludeGroups}),_e({visible:r=>r.createNewDelivery&&r.moreOptions}),_("design:type",Yt)],Ne.prototype,"excludeGroups",void 0);S([A.boolean({translation:r=>r.useFamilyDefaultBasketType}),_e({visible:r=>r.createNewDelivery&&r.moreOptions}),_("design:type",Boolean)],Ne.prototype,"useFamilyBasket",void 0);S([_e({visible:r=>!r.useFamilyBasket}),$e(()=>Ie),_("design:type",Ie)],Ne.prototype,"basketType",void 0);S([Y({queue:!0,allowed:V.admin,paramTypes:[qi]}),_("design:type",Function),_("design:paramtypes",[qi]),_("design:returntype",Promise)],Ne.prototype,"createNewEvent",null);S([Y({queue:!0,allowed:V.admin,paramTypes:[qi]}),_("design:type",Function),_("design:paramtypes",[qi]),_("design:returntype",Promise)],Ne.prototype,"countNewDeliveries",null);Ne=S([at("createNewEvent")],Ne);function Md(r,n){r&1&&(c(0,"mat-icon"),d(1,"check"),l())}function Fd(r,n){if(r&1){let e=M();c(0,"mat-list-item",9),D("click",function(){let t=C(e).$implicit,o=p();return x(o.select(t.name))}),c(1,"div",10),v(2,Md,2,0,"mat-icon",11),d(3),l(),k(4,"mat-divider"),l()}if(r&2){let e=n.$implicit,i=p();a(2),f("ngIf",i.selected(e.name)),a(),w(" ",e.name," ")}}var Us=(()=>{let n=class n{constructor(i,t,o){this.dialog=i,this.dialogRef=t,this.settings=o,this.availableGroups=[],this.groups=new It({valueType:Yt})}init(i){this.groups.value=new Yt(i.groups||""),this.ok=i.ok}ngOnInit(){return h(this,null,function*(){this.availableGroups=yield g.repo(ki).find({limit:1e3})})}selected(i){return this.groups.value.selected(i)}select(i){this.selected(i)?(this.groups.value=this.groups.value.removeGroup(i),this.selected(i)&&this.dialog.messageDialog("\u
3105DC\u05D0 \u05D4\u05E6\u05DC\u05D7\u05EA\u05D9 \u05DC\u05D1\u05D8\u05DC \u05D0\u05EA \u05D4\u05E7\u05D1\u05D5\u05E6\u05D4 "+i+" \u05DB\u05E0\u05E8\u05D0\u05D4 \u05E9\u05D4\u05D9\u05D0 \u05DC\u05D0 \u05DE\u05D5\u05E4\u05D9\u05E2\u05D4 \u05D1\u05E4\u05E0\u05D9 \u05E2\u05E6\u05DE\u05D4 \u05D0\u05DC\u05D0 \u05DB\u05D7\u05DC\u05E7 \u05DE\u05E9\u05DD \u05E7\u05D1\u05D5\u05E6\u05D4 \u05D0\u05D7\u05E8\u05EA, \u05D0\u05E0\u05D0 \u05D5\u05D5\u05D3\u05D0 \u05E9\u05D9\u05E9 \u05E4\u05E1\u05D9\u05E7\u05D9\u05DD \u05D1\u05D9\u05DF \u05D4\u05E7\u05D1\u05D5\u05E6\u05D5\u05EA")):this.groups.value=this.groups.value.addGroup(i)}cancel(){this.dialogRef.close()}confirm(){return h(this,null,function*(){yield this.ok(this.groups.value.evilGet()),this.dialogRef.close()})}};n.\u0275fac=function(t){return new(t||n)(b(z),b(Sn),b(P))},n.\u0275cmp=O({type:n,selectors:[["app-update-group-dialog"]],decls:13,vars:5,consts:[[1,"myDiv"],["mat-dialog-header",""],["mat-dialog-content",""],[1,"dialog-content-fixer"],["role","list"],[3,"click",4,"ngFor","ngForOf"],["mat-input","",3,"ngModelChange","ngModel"],["mat-raised-button","","color","warning",3,"click"],["mat-raised-button","","color","accent",3,"click"],[3,"click"],[2,"min-width","100px","display","flex"],[4,"ngIf"]],template:function(t,o){t&1&&(c(0,"div",0)(1,"h3",1),d(2),l(),c(3,"div",2)(4,"div",3)(5,"mat-nav-list",4),v(6,Fd,5,2,"mat-list-item",5),l(),c(7,"input",6),W("ngModelChange",function(m){return $(o.groups.inputValue,m)||(o.groups.inputValue=m),m}),l()()(),c(8,"mat-dialog-actions")(9,"button",7),D("click",function(){return o.cancel()}),d(10),l(),c(11,"button",8),D("click",function(){return o.confirm()}),d(12),l()()()),t&2&&(a(2),T(o.settings.lang.familyGroups),a(4),f("ngForOf",o.availableGroups),a(),L("ngModel",o.groups.inputValue),a(3),w(" ",o.settings.lang.cancel," "),a(2),w(" ",o.settings.lang.save," "))},dependencies:[me,q,Me,de,pe,Q,kn,In,Et,ve,Ft,Mt]});let r=n;return r})();var Td=["*",[["mat-toolbar-row"]]],Rd=["*","mat-toolbar-row"],Ad=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=Gi({type:n,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"],standalone:!0});let r=n;return r})(),Gs=(()=>{let n=class n{constructor(i,t,o){this._elementRef=i,this._platform=t,this._document=o}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){this._toolbarRows.length}};n.\u0275fac=function(t){return new(t||n)(b(Vt),b(Dn),b(un))},n.\u0275cmp=O({type:n,selectors:[["mat-toolbar"]],contentQueries:function(t,o,s){if(t&1&&Pt(s,Ad,5),t&2){let m;te(m=ie())&&(o._toolbarRows=m)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(t,o){t&2&&(Or(o.color?"mat-"+o.color:""),le("mat-toolbar-multiple-rows",o._toolbarRows.length>0)("mat-toolbar-single-row",o._toolbarRows.length===0))},inputs:{color:"color"},exportAs:["matToolbar"],standalone:!0,features:[rt],ngContentSelectors:Rd,decls:2,vars:0,template:function(t,o){t&1&&(ot(Td),Ve(0),Ve(1,1))},styles:[".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface));color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-app-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-app-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-app-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-app-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-app-title-large-tracking));margin:0}.cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height)}}"],encapsulation:2,changeDetection:0});let r=n;return r})();var wr=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({imports:[st,st]});let r=n;return r})();var Vd=["sidenav"];function Pd(r,n){if(r&1&&(c(0,"div",4),d(1),l()),r&2){let e=p();a(),w(" ",e.settings.lang.infoIsConfidential,`
32`)}}function Nd(r,n){r&1&&k(0,"router-outlet")}function Bd(r,n){if(r&1&&(c(0,"p",19),d(1),l()),r&2){let e=p(3);a(),w(" ",e.settings.organisationName," ")}}function Hd(r,n){if(r&1&&(c(0,"p",19),d(1),l()),r&2){let e=p(4);a(),w(" ",e.dialog.dc.addressHelper.getGeocodeInformation.getAddress()," ")}}function Ld(r,n){if(r&1&&(c(0,"div")(1,"p",19),d(2),l(),v(3,Hd,2,1,"p",14),l()),r&2){let e=p(3);a(2),T(e.dialog.dc.name),a(),f("ngIf",e.dialog.dc.addressHelper.ok)}}function $d(r,n){if(r&1&&(c(0,"h4"),d(1),l()),r&2){let e=p(3);a(),be("",e.lang.hello," ",e.remult.user.name,"")}}function Wd(r,n){r&1&&(c(0,"a",20),d(1,"\u05DE\u05D3\u05E8\u05D9\u05DA \u05DC\u05DE\u05E0\u05D4\u05DC"),l(
32))}function jd(r,n){if(r&1){let e=M();c(0,"a",21),D("click",function(){C(e);let t=p(3);return x(t.createNewEventAction.show(t.dialog,t.settings))}),d(1),l()}if(r&2){let e=p(3);a(),w(" ",e.settings.lang.createNewEvent," ")}}function zd(r,n){if(r&1){let e=M();c(0,"a",23),D("click",function(){C(e);let t=p(4);return x(t.routeClicked())}),d(1),l()}if(r&2){let e=p().$implicit,i=p(3);f("routerLink",e.path),a(),w(" ",i.routeName(e)," ")}}function Ud(r,n){r&1&&k(0,"mat-divider")}function Gd(r,n){if(r&1&&(X(0),v(1,zd,2,2,"a",22)(2,Ud,1,0,"mat-divider",2),ee()),r&2){let e=n.$implicit,i=p(3);a(),f("ngIf",i.shouldDisplayRoute(e)),a(),f("ngIf",i.showSeperator(e))}}function qd(r,n){if(r&1){let e=M();c(0,"a",21),D("click",function(){C(e);let t=p(3);return x(t.signOut())}),d(1),l()}if(r&2){let e=p(3);a(),w(" ",e.lang.exit," ")}}function Qd(r,n){if(r&1&&(c(0,"mat-sidenav",11,0)(2,"div",12),k(3,"img",13),l(),v(4,Bd,2,1,"p",14)(5,Ld,4,2,"div",2)(6,$d,2,2,"h4",2)(7,Wd,2,0,"a",15),c(8,"mat-nav-list",16),v(9,jd,2,1,"a",17),k(10,"mat-divider"),v(11,Gd,3,2,"ng-container",18)(12,qd,2,1,"a",17),l()()),r&2){let e=p(2);f("opened",!e.dialog.isScreenSmall())("mode",e.dialog.isScreenSmall()?"over":"side"),a(3),re("src",e.getLogo(),Ke),a(),f("ngIf",!e.dialog.dc),a(),f("ngIf",e.dialog.dc),a(),f("ngIf",e.remult.user),a(),f("ngIf",e.isAdmin()&&!e.showEnglishUrl()),a(2),f("ngIf",e.createNewEventAction.isAllowed()),a(2),f("ngForOf",e.router.config),a(),f("ngIf",e.remult.user)}}function Yd(r,n){if(r&1&&k(0,"data-area",31),r&2){let e=p(4);f("settings",e.dialog.distCenterArea)}}function Zd(r,n){if(r&1&&(c(0,"div",29),v(1,Yd,1,1,"data-area",30),l()),r&2){let e=p(3);a(),f("ngIf",e.dialog.distCenterArea&&e.dialog.canSeeCenter())}}function Kd(r,n){if(r&1){let e=M();c(0,"mat-toolbar",24)(1,"div",25)(2,"button",26),D("click",function(){C(e);let t=p(2);return x(t.sidenav.toggle())}),c(3,"mat-icon"),d(4,"menu"),l()(),c(5,"span",27),d(6),l()(),v(7,Zd,2,1,"div",28),l()}if(r&2){let e=p(2);re("color",e.toolbarColor),a(6),T(e.currentTitle()),a(),f("ngIf",e.dialog.canSeeCenter()&&e.dialog.distCenterArea)}}function Jd(r,n){if(r&1&&(c(0,"a",36),d(1),l()),r&2){let e=p(3);a(),T(e.lang.copyright)}}function Xd(r,n){if(r&1&&(c(0,"a",37),d(1),l()),r&2){let e=p(3);a(),T(e.lang.copyright)}}function ep(r,n){if(r&1&&(c(0,"footer",32),k(1,"hr",33),v(2,Jd,2,1,"a",34)(3,Xd,2,1,"a",35),l()),r&2){let e=p(2);a(2),f("ngIf",!e.showEnglishUrl()),a(),f("ngIf",e.showEnglishUrl())}}function tp(r,n){if(r&1&&(c(0,"mat-sidenav-container",5),v(1,Qd,13,10,"mat-sidenav",6),c(2,"div",7),v(3,Kd,8,3,"mat-toolbar",8),c(4,"div",9)(5,"div"),k(6,"router-outlet"),l()(),v(7,ep,4,2,"footer",10),l()()),r&2){let e=p();a(),f("ngIf",e.showSideBar()),a(2),f("ngIf",e.showSideBar()),a(2),le("wrapper",!e.noConfHeaderAndBorders())("edge-fix",e.isEdge),a(2),f("ngIf",!e.noConfHeaderAndBorders())}}var qs=(()=>{let n=class n{isAdmin(){return g.isAllowed(V.admin)}constructor(i,t,o,s,m,u,y){this.sessionManager=i,this.router=t,this.activeRoute=o,this.dialog=s,this.helper=m,this.settings=u,this.busy=y,this.remult=g,this.isEdge=/msie\s|trident\/|edge\//i.test(window.navigator.userAgent),this.createNewEventAction=new Ne,this.prevLogoUrl="",this.toolbarColor="primary",this.lang=u.lang,this.toolbarColor="primary",u.redTitleBar&&(this.toolbarColor="accent")}showSeperator(i){return!!(i.data&&i.data.seperator)}routeName(i){let t=i.component;if(t){let s=ge.get(t);if(s)return s}let o=i.path;return i.data&&i.data.name&&(o=i.data.name),o}getLogo(){let i=P.get().logoUrl;return i&&(this.prevLogoUrl=i),this.prevLogoUrl}currentTitle(){if(this.activeRoute&&this.activeRoute.snapshot&&this.activeRoute.firstChild){let i=this.activeRoute.firstChild.component;if(i){let t=ge.get(i);if(t)return t}if(this.activeRoute.firstChild.data&&this.activeRoute.snapshot.firstChild.data.name)return this.activeRoute.snapshot.firstChild.data.name}return P.get().organisationName}showConfidentialityApproveInPrint(){return this.noConfHeaderAndBorders()?!1:this.settings.requireConfidentialityApprove}noConfHeaderAndBorders(){return this.activeRoute?.firstChild?.snapshot?.routeConfig?.data?.noConfHeaderAndBorders}showSideBar(){return!(!g.authenticated()||this.activeRoute?.firstChild?.snapshot?.routeConfig?.data?.noBar||this.settings.isSytemForMlt&&!g.isAllowed([V.admin,V.lab,V.distCenterAdmin]))}signOut(){this.routeClicked(),this.sessionManager.signout()}shouldDisplayRoute(i){if(!(i.path&&i.path.indexOf(":")<0&&i.path.indexOf("**")<0))return!1;if(!(i.data&&i.data.hide))return!B.usingSelfPickupModule&&i.component==Hi||i.component==Wi&&!this.settings.manageEscorts?!1:this.helper.canNavigateToRoute(i)}routeClicked(){this.dialog.isScreenSmall()&&this.sidenav.close()}test(){}
32showEnglishUrl(){return this.settings.lang.languageCode!="iw"}};n.\u0275fac=function(t){return new(t||n)(b(_t),b(xn),b(We),b(z),b(Rt),b(P),b(we))},n.\u0275cmp=O({type:n,selectors:[["app-root"]],viewQuery:function(t,o){if(t&1&&ce(Vd,5),t&2){let s;te(s=ie())&&(o.sidenav=s.first)}},decls:3,vars:3,consts:[["sidenav",""],["class","print-only",4,"ngIf"],[4,"ngIf"],["class","app-sidenav-container",4,"ngIf"],[1,"print-only"],[1,"app-sidenav-container"],["class","app-sidenav no-print",3,"opened","mode",4,"ngIf"],[1,"full-page"],["class","no-print","style","justify-content: space-between",3,"color",4,"ngIf"],[1,"app-sidenav-content",2,"justify-content","space-between"],["style","text-align: center; font-size: 70%; padding-bottom: 5px",4,"ngIf"],[1,"app-sidenav","no-print",3,"opened","mode"],[2,"width","100%","text-align","center"],[3,"src"],["style","text-align: center",4,"ngIf"],["href","https://noam-honig.github.io/hagai-docs/","style","padding-right: 15px","target","_blank",4,"ngIf"],["role","list"],["mat-list-item","",3,"click",4,"ngIf"],[4,"ngFor","ngForOf"],[2,"text-align","center"],["href","https://noam-honig.github.io/hagai-docs/","target","_blank",2,"padding-right","15px"],["mat-list-item","",3,"click"],["mat-list-item","","routerLinkActive","active-route",3,"routerLink","click",4,"ngIf"],["mat-list-item","","routerLinkActive","active-route",3,"click","routerLink"],[1,"no-print",2,"justify-content","space-between",3,"color"],[2,"display","flex","align-items","center"],["mat-icon-button","",1,"sidenav-toggle",3,"click"],[2,"padding-left","10px"],["style",`
33          background-color: white;
34          color: rgba(0, 0, 0, 0.87);
35          border-radius: 10px;
36          height: 3em;
37          padding-top: 4px;
38          padding-left: 6px;
39          padding-right: 6px;
40        `,4,"ngIf"],[2,"background-color","white","color","rgba(0, 0, 0, 0.87)","border-radius","10px","height","3em","padding-top","4px","padding-left","6px","padding-right","6px"],[3,"settings",4,"ngIf"],[3,"settings"],[2,"text-align","center","font-size","70%","padding-bottom","5px"],[2,"padding","0px"],["href","https://hagai.co","target","_blank",4,"ngIf"],["href","https://hagai.co/en.html","target","_blank",4,"ngIf"],["href","https://hagai.co","target","_blank"],["href","https://hagai.co/en.html","target","_blank"]],template:function(t,o){t&1&&v(0,Pd,2,1,"div",1)(1,Nd,1,0,"router-outlet",2)(2,tp,8,7,"mat-sidenav-container",3),t&2&&(f("ngIf",o.showConfidentialityApproveInPrint()),a(),f("ngIf",o.noConfHeaderAndBorders()),a(),f("ngIf",!o.noConfHeaderAndBorders()))},dependencies:[me,q,Ye,Et,ve,Ft,Mt,_r,yr,Gs,Ce,ga,_a,ya],styles:[`.active-route[_ngcontent-%COMP%]{background-color:#f2f2f2}.mat-toolbar[_ngcontent-%COMP%]{font-size:16px}.app-sidenav-container[_ngcontent-%COMP%]{flex:1;width:100%;height:100%;background-color:#fafafa;min-width:100%;min-height:100%}.app-sidenav-content[_ngcontent-%COMP%]{display:flex;height:100%;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]{width:240px;box-shadow:var(--mat-app-elevation-shadow-level-10, none)}@media not print{.wrapper[_ngcontent-%COMP%]{margin:5px 10px 0;height:10px;flex-grow:1;overflow-x:auto}@media (max-width: 720px){.wrapper[_ngcontent-%COMP%]{margin:5px 2px 0}}}@media (max-width: 720px){.sidenav-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}}.sidenav-toggle[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:var(--sys-on-primary)}h4[_ngcontent-%COMP%]{margin-left:10px;margin-right:10px}@media not print{.footer[_ngcontent-%COMP%]{height:75px}}.edge-fix[_ngcontent-%COMP%]     .dataGridHeaderArea{position:inherit!important}
41/*# sourceMappingURL=app.component-2FWTQYEG.css.map */`]});let r=n;return r})(),ge=new Map;z.EditCustomMessageComponent=Qn;z.GridDialogComponent=si;z.SelectHelperComponent=On;z.UpdateGroupDialogComponent=Us;var op=new zi("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=zt(jo);return()=>r.scrollStrategies.reposition()}});function rp(r){return()=>r.scrollStrategies.reposition()}var ap={provide:op,deps:[jo],useFactory:rp};var Cr=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({providers:[ap],imports:[hn,ka,$o,st,Zi,Ra,$o,st]});let r=n;return r})();var Ys=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({imports:[zo,Yi,nr,Ji,Ki,qo,Cr,Qo,Yo,rr,Go,Uo,Zo,Xo,ir,Ko,vr,wr,Jo,zo,Ji,nr,Cr,Yi,Ki,qo,Qo,Yo,rr,Go,Uo,Zo,Xo,Ko,vr,wr,Jo,ir]});let r=n;return r})();var Zs=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({imports:[Ia]});let r=n;return r})();var Ks=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n}),n.\u0275inj=Be({imports:[st,Zs,st]});let r=n;return r})();logSomething("app module source loaded");var lp=kt.initOnBrowserAndReturnAngularBaseHref(),xr=class extends zr{constructor(){super(...arguments),this.overrides={swipe:{direction:6},pan:{direction:6},pinch:{enable:!1},rotate:{enable:!1}}}},Js=(()=>{let n=class n{};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=He({type:n,bootstrap:[qs]}),n.\u0275inj=Be({providers:[ds(ms()),z,{provide:Fr,useClass:os},lo,or,_t,{provide:Lr,useFactory:()=>"/"+lp},{provide:P,useFactory:i=>i.instance,deps:[Ni]},{provide:Hr,deps:[or,Ni,Ro,fn],useFactory:cp,multi:!0},{provide:jr,useClass:xr},Ni],imports:[Wr,Ta,ts,Ys,qr,Va,Ls,va,za.forRoot({config:{tokenGetter:Ja}}),Yi,Ki,Ji,Ks,ns]});let r=n;return r})();Br(Xi,function(){return[q,Fa,Ea,Ma,Q,xe,Ai,Ya,Oi,Ce,Ci]},[]);function cp(r,n,e,i){return g.apiClient.httpClient=i,e.apiClient.url=g.apiClient.url,()=>h(this,null,function*(){logSomething("initApp start");try{try{e.context.getSite=()=>Ao(window.location.pathname),g.context.getSite=()=>Ao(window.location.pathname),yield r.loadUserInfo()}catch{r.setToken(void 0,!0),console.error("Failed to init existing user")}r.initContext=()=>h(this,null,function*(){yield aa(e),n.instance&&n.instance._.reload()}),yield r.initContext(),e.context.getOrigin=()=>window.location.origin;for(let s in e.context)Object.prototype.hasOwnProperty.call(e.context,s)&&(g.context[s]=e.context[s]);yield n.init();var t=n.instance;let o=n.instance.lang;ge.set(Gn,o.assignDeliveryMenu),ge.set(Wi,o.AssignEscortComponent),ge.set(Hi,o.SelfPickupComponent),ge.set(Kn,o.FamilyDeliveriesComponent),ge.set(Yn,o.FamiliesComponent),ge.set(so,o.DeliveryFollowUpComponent),ge.set(co,o.NewsComponent),ge.set(no,o.DistributionMapComponent),ge.set(Pn,o.OverviewComponent),ge.set(xi,o.HelpersComponent),ge.set(ui,o.DeliveryHistoryComponent),ge.set($i,o.PlaybackComponent),ge.set(Ct,o.ImportFromExcelComponent),ge.set(ho,o.ImportHelpersFromExcelComponent),ge.set(xt,o.DuplicateFamiliesComponent),ge.set(eo,o.ManageComponent),ge.set(fo,o.smsMessages),ge.set(Vi,o.MyFamiliesComponent),ge.set(nn,o.UpdateInfoComponent),ge.set(Xi,o.LoginComponent),ge.set(Ka,o.eventsComponent),ge.set(Ci,o.volunteerOpportunities),Bn.init(),logSomething("initApp end")}catch(o){o?.message===Ua?(r.setToken(void 0,!0),window.location.reload()):console.error("failed to get settings ",o)}return""})}Ro.onFind=r=>{};Fn.production&&void 0;$r().bootstrapModule(Js).catch(r=>console.error(r));
42//# sourceMappingURL=main-DRK74AVN.js.map

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.