PageSourceSearch

https://app.waitwhile.com/chunk-U7IKD6UG.js

js waitwhile.com collected 2026-09-24 08:48:33 UTC 319,655 bytes, 228 lines download raw bytes

1import{$c as Xa,C as Br,Cc as Ie,Ec as jt,Fc as Mt,Ha as Or,Hc as X,Ia as ii,L as Fr,bd as Qa,cd as Ge,db as Nr,dd as fe,ed as he,fd as ye,gd as Ce,hd as Za,i as Rr,id as Ja,k as Wr,l as xr,m as Ir,ma as Si,o as Mr,pa as qa,re as en,se as Me,ta as Ka,te as Vr,ue as Pr,v as ja,ve as tn,we as zr,x as Ne,ye as an}from"./chunk-6QDVQ5WV.js";import{$a as ee,$e as Vo,$j as Zo,$k as di,$n as Mi,$o as mr,$u as Ha,A as ki,Aa as si,Ay as Lr,Ba as I,Bn as lr,Bo as cr,Bp as _t,By as Er,Ca as Re,Cc as Te,Cl as ir,Co as ue,D as L,Db as Zt,De as Ra,Dl as Je,Dm as it,Ed as Ye,Em as Na,F as Aa,Fa as bo,Fl as Fa,Fo as pr,Gm as or,H as _o,Ha as g,Hc as Ea,Hf as xi,Hl as Oa,Ia as ke,Ib as o,Ja as _,Jb as r,K as M,Ka as Nt,Kb as pe,Kd as W,Ke as Oo,Kn as me,L as ba,La as Rt,Lf as vn,M as Li,Ma as Be,Mb as Wt,Mc as li,Me as Yt,Mt as Ar,N as ne,Na as Fe,Ne as No,O as Xe,Oa as p,Oi as qo,On as de,Pa as u,Pc as zt,Pd as oe,Pi as Ko,Q as Ta,Qa as m,Qf as Po,Qi as Dn,Qk as Ma,Ra as v,Rf as zo,Rm as xe,Rn as fi,S as ri,Sb as Lo,Sc as Ro,Sd as ci,Sf as Yo,Sl as ar,Sn as _e,Ub as ka,Um as rr,V as Et,Va as Pe,Vb as Pt,Vm as sr,Vt as It,W as So,Wa as ze,Wb as k,We as qe,Wf as Wa,Wn as Ii,Xa as Qe,Xp as K,Xt as Ya,Xu as Ua,Ya as ie,Yb as La,Yf as xa,Ym as mt,Z as w,Za as Da,Zk as Jo,Zl as nr,Zt as St,_a as $a,_b as se,_j as Qo,_k as z,ac as Eo,al as ui,ap as dr,as as Pa,bb as ht,bl as Ba,bo as Bi,bp as ur,bs as wr,bv as Dr,c as $e,ca as G,cb as ft,cg as xt,cl as $n,cq as fr,cs as gr,da as U,db as To,de as Ri,dq as yr,ds as _r,du as br,dv as $r,e as gn,ea as vo,eb as R,eg as Ia,es as Sr,ev as Ht,fb as f,fs as vr,gd as Wo,gl as gt,go as ei,gq as Cr,gs as ti,he as Se,hg as An,hl as er,i as b,iu as Ga,jg as bn,jl as te,ju as _i,k as Ee,kg as Tn,ko as Fi,kq as Va,l as c,la as V,ls as za,m as D,md as Jt,me as Ze,mo as Oi,mu as Tr,nd as le,ng as pi,nj as Xo,nl as ve,o as Ot,ob as st,og as Go,pa as Ei,pb as Do,pe as Bo,pm as ge,qb as yt,qd as Dt,rb as $o,rd as xo,rm as Ut,sa as l,sb as ko,sg as Uo,so as yi,tb as H,tc as be,tg as We,tl as Le,tm as hi,to as Ci,ub as we,uf as Gt,ug as Ho,v as Ke,vb as Ve,ve as _n,vg as jo,vl as tr,vy as kr,wd as je,we as Fo,wo as Ni,xb as O,xe as Sn,ya as $,yb as P,yc as Oe,yd as Io,ye as Wi,yj as mi,yo as wi,yp as gi,za as Ao,zb as F,zd as Mo,zp as hr}from"./chunk-6VDOBKBI.js";import"./chunk-UNNH6OJB.js";import{a as Y,b as q,h as pt}from"./chunk-HE2D45TV.js";var Yr=100,Gr=400,vt={pageIndex:0,pageSize:18,length:18},kn={overview:$localize`Overview`,visits:$localize`Visits`,"guest-experience":$localize`Guest experience`,messages:$localize`Messages`,operations:$localize`Operations`,services:$localize`Services`,"
1input-fields":$localize`Input fields`,financials:$localize`Financials`,csat:$localize`CSAT`,"more-analytics":$localize`More analytics`,upgrade:$localize`Upgrade`},Ln={overview:$localize`Overview`,visits:$localize`Visits`,"guest-experience":$localize`Guest experience`,messages:$localize`Messages`,operations:$localize`Operations`,services:$localize`Services`,"input-fields":$localize`Input fields`,financials:$localize`Financials`,csat:$localize`CSAT`,"more-analytics":Oa({components:[$localize`More analytics`,ve(Mr)]}),upgrade:$localize`Upgrade`},Vi=je()(["numVisits","numRegistrations.booking","numRegistrations.waitlist","numRegistrations.waitlistedBooking","numDropoff","numServed.total","numCompleted.total","numNoShowed.total","numCancelled.total","numRemoved.total","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]),nn=[...Vi].filter(a=>!["avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"].includes(a)),Z={numVisits:$localize`All visits`,"numRegistrations.booking":$localize`Bookings`,"numRegistrations.waitlist":$localize`Waitlisted`,"numRegistrations.waitlistedBooking":$localize`Waitlisted bookings`,numDropoff:$localize`Dropoff`,"numServed.total":$localize`Served`,"numCompleted.total":$localize`Completed`,"numNoShowed.total":$localize`No-show`,"numCancelled.total":$localize`Cancelled`,"numRemoved.total":$localize`Removed`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,maxWaitDuration:$localize`Longest wait`,maxServeDuration:$localize`Longest serve duration`},vi=je()(["date","week","month","dayOfWeek","hourOfDay"]),on={date:$localize`Date`,week:$localize`Week`,month:$localize`Month`,dayOfWeek:$localize`Day of week`,hourOfDay:$localize`Hour of day`},Ur={SUNDAY:"sun",MONDAY:"mon",TUESDAY:"tue",WEDNESDAY:"wed",THURSDAY:"thu",FRIDAY:"fri",SATURDAY:"sat"},Hr={1:"MONDAY",2:"TUESDAY",3:"WEDNESDAY",4:"THURSDAY",5:"FRIDAY",6:"SATURDAY",7:"SUNDAY"},jr=[Ii,ei,Bi,Mi,Oi,Fi,Ci,Ni],qr={[Ii.id]:$localize`Compared to the previous day`,[ei.id]:$localize`Compared to the previous 7 days`,[Bi.id]:$localize`Compared to the same days in the previous week`,[Mi.id]:$localize`Compared to the previous week`,[Oi.id]:$localize`Compared to the same days in the previous month`,[Fi.id]:$localize`Compared to the previous month`,[Ci.id]:$localize`Compared to the same days in the previous year`,[Ni.id]:$localize`Compared to the previous year`};function Kr(a){try{let t=new Intl.Locale(a).getWeekInfo()?.firstDay;return le(t)?t:1}catch(d){return 1}}function rn(a){return vi.includes(a)}function qt(a){let d=a;return a!==null&&Array.isArray(d.data)&&_n(d.fromDate)&&_n(d.toDate)}function Xr(a){return a==="date"||a==="month"||a==="weekStarting"||a==="dayOfWeekNumber"}function Kt(a){return je()(["numVisits","numRegistrations.booking","numRegistrations.waitlist","numRegistrations.waitlistedBooking","numDropoff","numServed.total","numCompleted.total","numNoShowed.total","numCancelled.total","numRemoved.total","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]).includes(a)}var En=200,Qr=160,Zr=140,Ai=20,sn=je()(["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]);function ln(a){return a.reduce((d,e)=>{let t=e;for(let i in Object.keys(t))if(t[i]?.isOpen)for(let n of Se(t[i].periods)){d===null&&(d={first:23,last:0});let s=parseInt(n.from.split(":")[0]);s<d.first&&(d.first=s);let h=parseInt(n.to.split(":")[0]);h>d.last&&(d.last=h)}return d},null)}function Ds(a){let d=-1,e=-1;if(a.length>0){for(let[t,i]of a.entries())i>0&&(t<d||d===-1)&&(d=t);for(let[t,i]of[...a].reverse().entries())i>0&&(t<e||e===-1)&&(e=t);e=a.length-e}return{first:d,last:e}}function ts(a){let d=-1,e=-1;for(let t of a){let i=Ds(t);(i.first>d||d===-1)&&(d=i.first),(i.last<e||e===-1)&&(e=i.last)}return{first:d,last:e}}var Jr=["#3B6BC5","#6DBC45","#ED7DEC","#49B8D6","#AE76F6","#F2B053","#39C295","#EB5252","#023FB2","#42A60E","#E859E6","#14A2C9","#9850F4","#EE9922","#00AE74","#E52020","#7497D8","#98D27C","#F2A1F2","#7ECEE3","#C49CF8","#F6C784","#72D6B6","#F18484"],es=[["#3B6BC5","#9CA4FD"],["#6DBC45","#D5E5A7"],["#ED7DEC","#FCA4F9"],["#49B8D6","#AADEE9"],["#AE76F6","#D0B1F6"],["#F2B053","#FEDA7B"],["#39C295","#AFE6AD"],["#EB5252","#F98E75"],["#023FB2","#9CA4FD"]];function Ct(a){return Jr[a%Jr.length]}function Ae(a,d=!1){return es[a%es.length][d?1:0]}function cn(a,d){if(a===1)return d;let e=sn.indexOf(d),t=(a-1+e)%sn.length;return sn[t]}function Vt(a,d=!1){let e=Ur[a];return d?Zo[e]:Qo[e]}function $s(a){let d=oe(a);return(e,t)=>{let i=t?.seriesIndex??0;return`${(a[i]/d*100).toFixed(0)}%`}}function ks(a){return(d,e)=>e?`${a[e.seriesIndex]}`:`${d}`}function Bt(a,d,e,t,i,n){return a.extend({chart:{parentHeightOffset:0,height:En,events:{click:()=>{n||i()}}},responsive:[{breakpoint:1024,options:{chart:{height:En}}},{breakpoint:1280,options:{chart:{height:Zr}}},{breakpoint:1400,options:{chart:{height:Qr}}}],colors:e,series:d,labels:t,legend:{show:!1},dataLabels:{enabled:!0,formatter:$s(d),background:{enabled:!0,padding:6,borderRadius:4,borderWidth:1,borderColor:"#fff"},style:{colors:e,fontSize:"12px"}},tooltip:{enabled:!0,y:{formatter:ks(d)}}},a.donut)}function is(a){return a==="channels"||a==="state"||a==="type"||a==="recipient"}var Rn={channels:$localize`Channels`,state:$localize`State`,type:$localize`Type`,recipient:$localize`Recipient`},pn={channels:["numMessagesByChannel","numMessageSegmentsByChannel"],state:["numMessagesByState","numMessageSegmentsByState"],type:["numMessagesByIncomingOutgoing","numMessageSegmentsByIncomingOutgoing"],recipient:["numMessagesByRecipient","numMessageSegmentsByRecipient"]},$t={email:$localize`Email`,sms:$localize`SMS`,app:$localize`Push`,call:$localize`Call`,other:$localize`Other`}
1,bi={email:Ae(0,!1),sms:Ae(1,!1),app:Ae(2,!1),call:Ae(3,!1),other:Ae(4,!1)},Fd={email:Ae(0,!0),sms:Ae(1,!0),app:Ae(2,!0),call:Ae(3,!0),other:Ae(4,!0)},dt={blocked:$localize`Blocked`,delivered:$localize`Delivered`,failed:$localize`Failed`,other:$localize`Other`,pending:$localize`Pending`,received:$localize`Received`},Xt={delivered:Ae(0),received:Ae(1),pending:Ae(2),failed:Ae(3),blocked:Ae(4),other:Ae(5)},Od={delivered:Ae(0,!0),received:Ae(1,!0),pending:Ae(2,!0),failed:Ae(3,!0),blocked:Ae(4,!0),other:Ae(5,!0)},Pi={incoming:$localize`Incoming`,outgoing:$localize`Outgoing`},Wn={incoming:Ae(0),outgoing:Ae(1)},Nd={incoming:Ae(0,!0),outgoing:Ae(1,!0)},zi={guest:$localize`Customer`,user:$localize`User`},xn={guest:Ae(0),user:Ae(1)},Vd={guest:Ae(0,!1),user:Ae(1,!1)};var mn="analytics-source",dn="analytics-location",un="analytics-resources",hn="analytics-services",fn="analytics-deleted",yn="analytics-labels",Cn="analytics-type",In={DRAFT:$localize`Draft`,BOOKING_FROM_WAITLIST:$localize`Booking from waitlist`,BOOKING:$localize`Booking`,WAITLIST:$localize`Waitlist`,WAITLISTED_BOOKING:$localize`Waitlisted booking`,DIRECT_SERVED:$localize`Direct served`,DIRECT_COMPLETED:$localize`Direct completed`,OTHER:$localize`Other`};var as=(()=>{class a{constructor(){this.dataOptions=w(Ga),this.maxNumberOfNamesInComponent=3}displayNames(e,t){if(e.length>this.maxNumberOfNamesInComponent){let i=e.slice(0,this.maxNumberOfNamesInComponent),n=t.filter(s=>i.includes(s.id)).map(s=>s.name).join(", ");return $localize`${n} + ${e.length-this.maxNumberOfNamesInComponent} more`}return t.filter(i=>e.includes(i.id)).map(i=>i.name).join(", ")}displayResourceNames(e){return Je({$rx:{content:this.dataOptions.resources$.pipe(c(t=>this.displayNames(e,t)))}})}displayServiceNames(e){return Je({$rx:{content:this.dataOptions.services$.pipe(c(t=>this.displayNames(e,t)))}})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Et({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function Mn(a){return q(Y({},a),{isCategory:Jt(a.parentId)})}var Ls=tr(er),Bn=(()=>{class a extends Ls{constructor(){super(...arguments),this.changeDetectorRef=w(Lo),this.selection="single",this.fields$=this.observe("fields").pipe(this.shareReplay()),this.formControl=new Oe([],{nonNullable:!0}),this.fieldsByNameHashed$=this.fields$.pipe(c(e=>e.reduce((t,i)=>{let n=t.find(s=>s.nameHashed===i.nameHashed);if(n)n.fieldIds.push(i.id);else if(i.isCategory)t.push({name:i.name,nameHashed:i.nameHashed,fieldIds:[i.id]});else{let s=e.find(h=>h.id===i.parentId);t.push({name:i.name,nameHashed:i.nameHashed,fieldIds:[i.id],parentId:s?.id,parentNameHashed:s?.nameHashed})}return t},[])),this.shareReplay()),this.recordByNameHashed$=this.fieldsByNameHashed$.pipe(c(e=>Bo(e,t=>t.nameHashed)),this.shareReplay()),this.data$=this.fieldsByNameHashed$.pipe(c(e=>e.map(t=>t.nameHashed))),this.isLoading$=this.data$.pipe(c(()=>!1),Li(!0),L(),this.shareReplay()),this.pluckParent$=this.recordByNameHashed$.pipe(c(e=>t=>e[t]?.parentNameHashed)),this.pluckTrigger$=this.recordByNameHashed$.pipe(c(e=>t=>{let i=e[t];return i?i.fieldIds.length>1?`${i.name} (${i.fieldIds.length})`:i.name:$localize`Unknown`})),this.pluckLabel$=this.recordByNameHashed$.pipe(c(e=>t=>{let i=e[t];return i?i.fieldIds.length>1?`${i.name} (${i.fieldIds.length})`:i.name:$localize`Unknown`})),this.pluckSearchLabel$=this.recordByNameHashed$.pipe(c(e=>t=>e[t]?.name??"")),this.viewValue$=D([this.fieldsByNameHashed$,this.formControl.valueChanges]).pipe(Ke(()=>this.formControl.dirty),c(([e,t])=>e.filter(n=>t.includes(n.nameHashed)).flatMap(n=>n.fieldIds)))}writeValue(e){return pt(this,null,function*(){let t=Se(e);if(t.length>0){let n=(yield Ee(this.fields$)).filter(h=>t.includes(h.id)),s=Ze(n.map(h=>h.nameHashed));this.formControl.setValue(s,{emitEvent:!1})}else this.formControl.setValue([],{emitEvent:!1});this.changeDetectorRef.markForCheck()})}registerOnChange(e){this.viewValue$.pipe(Xe(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formControl.disable():this.formControl.enable()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-field-select"]],hostAttrs:[1,"ww-analytics-field-select"],inputs:{ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
1ocus:"autoFocus",hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",layout:"layout",appearance:"appearance",selection:"selection",fields:"fields"},features:[I],decls:7,vars:26,consts:[[3,"label","sublabel","layout","placeholder","appearance","loading","pluckLabel","pluckParent","pluckSearchLabel","pluckTrigger","data","formControl","selection","searchable"]],template:function(t,i){t&1&&(v(0,"ww-select",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async")),t&2&&p("label",i.label)("sublabel",i.sublabel)("layout",i.layout)("placeholder",i.placeholder)("appearance",i.appearance)("loading",r(1,14,i.isLoading$))("pluckLabel",r(2,16,i.pluckLabel$))("pluckParent",r(3,18,i.pluckParent$))("pluckSearchLabel",r(4,20,i.pluckSearchLabel$))("pluckTrigger",r(5,22,i.pluckTrigger$))("data",r(6,24,i.data$))("formControl",i.formControl)("selection",i.selection)("searchable",!0)},dependencies:[Ea,be,Te,an,Va,_e,k],encapsulation:2,changeDetection:0})}}return a})();var ns=(()=>{class a{constructor(){this.analyticsFilterDisplay=w(as),this.commonDisplay=w(Br),this.dataOptions=w(Ga),this.eventLogger=w(Ha),this.labelRx=w(_i),this.defaultLocationFilter=Or(dn,this.commonDisplay),this.resources$=this.dataOptions.resources$.pipe(c(e=>e.map(Mn)),M({refCount:!0,bufferSize:1})),this.services$=this.dataOptions.services$.pipe(c(e=>e.map(Mn)),M({refCount:!0,bufferSize:1})),this.locationsFilter=q(Y({},this.defaultLocationFilter),{component:ve(this.defaultLocationFilter.component,{$hooks:{onCreate:e=>e.instance._viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"locations"}}))}}),toQueryArgs:void 0}),this.visitSourcesFilter={id:ii("visit-source"),name:$localize`Source`,categoryId:mn,pluckLabel:e=>e.map(t=>Ma[t]).join(", "),stringify:e=>e.join(","),parse:e=>e.split(",").filter(Ar),component:ve(_e,{selection:"multiple",label:$localize`Visit source`,placeholder:$localize`Any`,data:Object.keys(Ma),pluckLabel:e=>Ma[e],$hooks:{onCreate:e=>e.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-source"}}))}})},this.deletedVisitsFilter={id:ii("visit-include-deleted"),name:$localize`Include deleted visits`,categoryId:fn,stringify:e=>e.toString(),parse:e=>e?.toLocaleLowerCase()==="true",pluckLabel:e=>e?$localize`Include deleted visits`:$localize`Exclude deleted visits`,component:ve(Cr,{label:$localize`Include deleted visits`,$hooks:{onCreate:e=>e.instance.checked$.pipe(ba(1)).subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-include-deleted"}}))}})},this.resourcesFilter$=this.resources$.pipe(c(e=>({id:ii("resources"),name:$localize`Resources`,categoryId:un,stringify:t=>{let i=e.filter(s=>t.includes(s.id)).map(s=>s.nameHashed);return Array.from(new Set(i)).join(",")},parse:t=>{let i=t.split(",").filter(Dt);return e.filter(h=>i.includes(h.nameHashed)).map(h=>h.id)},pluckLabel:t=>this.analyticsFilterDisplay.displayResourceNames(t),component:ve(Bn,{selection:"multiple",label:$localize`Resources`,placeholder:$localize`Any`,fields:e,$hooks:{onCreate:t=>t.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"resources"}}))}})}))),this.servicesFilter$=this.services$.pipe(c(e=>({id:ii("services"),name:$localize`Services`,categoryId:hn,stringify:t=>{let i=e.filter(s=>t.includes(s.id)).map(s=>s.nameHashed);return Array.from(new Set(i)).join(",")},parse:t=>{let i=t.split(",").filter(Dt);return e.filter(h=>i.includes(h.nameHashed)).map(h=>h.id)},pluckLabel:t=>this.analyticsFilterDisplay.displayServiceNames(t),component:ve(Bn,{selection:"multiple",label:$localize`Services`,placeholder:$localize`Any`,fields:e,$hooks:{onCreate:t=>t.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"services"}}))}})}))),this.visitTypeFilter={id:ii("visit-type"),name:$localize`Visit Type`,categoryId:Cn,stringify:e=>e.join(","),parse:e=>e.split(",").filter(wr),pluckLabel:e=>e.map(t=>In[t]).join(", "),component:ve(_e,{selection:"multiple",label:$localize`Visit type`,placeholder:$localize`Any`,data:Jo,pluckLabel:e=>In[e],$hooks:{onCreate:e=>e.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"visit-type"}}))}})},this.labelFilters$=this.labelRx.labelGroups$.pipe(c(e=>e.map(t=>{let i=t.name.toLocaleLowerCase();return{id:ii("label-"+i),name:t.name,categoryId:yn+"-"+i,stringify:n=>n.join(","),parse:n=>n.split(",").filter(Dt),pluckLabel:n=>n.join(", "),component:ve(_e,{selection:"multiple",label:t.name,placeholder:$localize`Any`,data:t.values,$hooks:{onCreate:n=>n.instance.viewValue$.subscribe(()=>this.eventLogger.log("updated_analytics_filter",{params:{filter:"label"}}))}})}})))}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Et({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var Ti=(()=>{class a extends Fr{constructor(){let e=w(vo);super(e),this.analyticsFilterComponents=w(ns),this.filters$=D([this.analyticsFilterComponents.labelFilters$,this.analyticsFilterComponents.resourcesFilter$,this.analyticsFilterComponents.servicesFilter$]).pipe(c(([t,i,n])=>[this.analyticsFilterComponents.locationsFilter,this.analyticsFilterComponents.visitSourcesFilter,this.analyticsFilterComponents.visitTypeFilter,i,n,...t,this.analyticsFilterComponents.deletedVisitsFilter])),this.filterValues$=this.state$.pipe(ki(Gr),c(t=>t.reduce((i,n)=>{if(n.source.categoryId.startsWith(yn))i=q(Y({},i),{labels:q(Y({},i.labels),{[n.source.name]:n.value})});else switch(n.source.categoryId){case fn:i=q(Y({},i),{includeDeleted:!!n.value});break;case dn:i=q(Y({},i),{locationIds:n.value});break;case mn:i=q(Y({},i),{source:n.value});break;case hn:i=q(Y({},i),{serviceId:[...i.serviceId??[],...n.value]});break;case un:i=q(Y({},i),{resourceId:[...i.resourceId??[],...n.value]});break;case Cn:i=q(Y({},i),{visitType:n.value});break}return i},{})),M({refCount:!0,bufferSize:1})),this.injector=e}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Et({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var os={compareCsatMetricsReportData:!1,compareCsatMetricsSurveyData:!1,compareReportData:!1,compareReportDataForLocations:!1,csatAnswersData:!1,csatByLocationData:!1,csatByResourceData:!1,csatByServiceData:!1,csatDimensionsData:!1,csatMetricsReportData:!1,csatMetricsSurveyData:!1,csatResponseTrendData:!1,dayOfReport:!1,dayOfReportResources:!1,dayOfReportServices:!1,distributionsData:!1,reportData:!1,reportDataByCreatorSource:!1,reportDataByDate:!1,reportDataByDayOfWeek:!1,reportDataByLocation:!1,reportDataByMonth:!1,reportDataByResourceService:!1,reportDataByWeek:!1,reportDataForDataFields:!1,reportDataForFinancialsLocations:!1,reportDataForFinancialsServices:!1,reportDataForFinancialsValue:!1,reportDataForLabels:!1,reportDataForLocations:!1,reportDataForMessageDetails:!1,resourcesReportData:!1,serviceCombinationsReportData:!1,servicesReportData:!1,usersReportData:!1},ae=(()=>{class a{constructor(){this.accountRx=w(It),this.analyticsRx=w(br),this.coreDataFieldRx=w(kr),this.coreResourceRx=w(Lr),this.coreServiceRx=w(Er),this.filterStore=w(Ti),this.labelRx=w(_i),this.localeService=w(Xo),this.locationRx=w(St),this.queryParams=w(Vo),this.dateRangeSub=new $e(null),this.dateRange$=this.dateRangeSub.asObservable(),this.compareDateRangeSub=new $e(null),this.compareDateRange$=this.compareDateRangeSub.asObservable(),this.creatorSourceDimensionSub=new $e("agent"),this.creatorSourceDimension$=this.creatorSourceDimensionSub.asObservable(),this.resourceServiceDimensionSub=new $e("resourceName"),this.resourceServiceDimension$=this.resourceServiceDimensionSub.asObservable(),this.financialsValueCostsDimensionSub=new $e(["date"]),this.financialsValueCostsDimension$=this.financialsValueCostsDimensionSub.asObservable(),this.messageDetailsMetricsSub=new $e(pn.channels),this.messageDetailsMetrics$=this.messageDetailsMetricsSub.asObservable(),this.defaultFormControlValues={},this.labelGroupSub=new $e(null),this.labelGroup$=this.labelGroupSub.asObservable(),this.weekdayStartSub=new $e(null),this.weekdayStart$=this.weekdayStartSub.asObservable(),this.loadingStateSub=new $e(os),this.loadingState$=this.loadingStateSub.asObservable(),this.hoursOfDay=[...Array(24).keys()],this.loading$=this.loadingState$.pipe(c(e=>Object.values(q(Y({},e),{dayOfReport:!1,dayOfReportResources:!1,dayOfReportServices:!1,compareReportData:!1})).some(t=>t===!0))),this.compareLoading$=this.loadingState$.pipe(c(e=>e.compareReportData)),this.dayOfReportLoading$=this.loadingState$.pipe(c(e=>Object.values({dayOfReport:e.dayOfReport,dayOfReportResources:e.dayOfReportResources,dayOfReportServices:e.dayOfReportServices}).some(t=>t===!0))),this.hasDataFields$=this.coreDataFieldRx.collection(Pa(za,{limit:[1]})).pipe(c(e=>e.length>0),M({refCount:!0,bufferSize:1})),this.hasResources$=this.coreResourceRx.collection(Pa(za,{limit:[1]})).pipe(c(e=>e.length>0),M({refCount:!0,bufferSize:1})),this.hasServices$=this.coreServiceRx.collection(Pa(za,{limit:[1]})).pipe(c(e=>e.length>0),M({refCount:!0,bufferSize:1})),this.reportingGroupKeyAndValue$=D([this.filterStore.filterValues$,this.accountRx.getAccount(["id"]).pipe(c(e=>e.id)),this.locationRx.locationId$]).pipe(c(([e,t,i])=>{let n=e.locationIds?"locationId":"accountId",s=e.locationIds?e.locationIds:[i],h=e.locationIds?s:[t];return{key:n,value:h}})),this.minFromDateForAccount$=this.accountRx.getAccount(["features"]).pipe(c(e=>e.features?.maxAnalyticsHistoricalDays&&e.features.maxAnalyticsHistoricalDays>0?xt(Ia(),e.features.maxAnalyticsHistoricalDays):new Date(2020,0,1))),this.distributionsData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("distributionsData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getDistributionsData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("distributionsData",!1),M({refCount:!0,bufferSize:1})),this.reportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportData",!1),M({refCount:!0,bufferSize:1})),this.reportDataByDate$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByDate",!0),ne(([e,t,i])=>{if(!ue(e))return b(null);let n=e.id===yi.id||e.id===Ci.id,s=e.start,h=n?new Date:void 0;return this.analyticsRx.getReportDataByDate(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),Dn,!0,s,h)}),this.updateLoadingState("reportDataByDate",!1),M({refCount:!0,bufferSize:1})),this.reportDataByWeek$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataByWeek",!0),ne(([e,t,i,n])=>ue(e)?this.analyticsRx.getReportDataByWeek(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),Dn,n??void 0):b(null)),this.updateLoadingState("reportDataByWeek",!1),M({refCount:!0,bufferSize:1})),this.reportDataByMonth$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByMonth",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportDataByMonth(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByMonth",!1),M({refCount:!0,bufferSize:1}
1)),this.reportDataByDayOfWeek$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataByDayOfWeek",!0),ne(([e,t,i,n])=>ue(e)?this.analyticsRx.getReportDataByDayOfWeek(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),n??void 0):b(null)),this.updateLoadingState("reportDataByDayOfWeek",!1),M({refCount:!0,bufferSize:1})),this.reportDataBySource$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataByCreatorSource",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportDataBySource(e.start,e.end,i.key,i.value,["agent","source"],this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByCreatorSource",!1),M({refCount:!0,bufferSize:1})),this.reportDataByResourceService$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.resourceServiceDimension$]).pipe(this.updateLoadingState("reportDataByResourceService",!0),ne(([e,t,i,n])=>ue(e)?this.analyticsRx.getReportDataBySource(e.start,e.end,i.key,i.value,n,this.toAnalyticsReportFilters(t)):b(null)),this.updateLoadingState("reportDataByResourceService",!1),M({refCount:!0,bufferSize:1})),this.reportDataForLabels$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.labelRx.labelGroups$]).pipe(this.updateLoadingState("reportDataForLabels",!0),ne(([e,t,i,n])=>ue(e)?D(n.map(s=>this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),s?[`label:${s.name}`]:[]))):b(null)),this.updateLoadingState("reportDataForLabels",!1),M({refCount:!0,bufferSize:1})),this.reportDataForDataFields$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForDataFields",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["dataFieldName","dataFieldNameHashed","dataFieldValues","dataFieldType"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("reportDataForDataFields",!1),M({refCount:!0,bufferSize:1})),this.reportDataForFinancialsLocations$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForFinancialsLocations",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName","orderValueCurrency"],["numVisits","orderValue"]):b(null)),this.updateLoadingState("reportDataForFinancialsLocations",!1),M({refCount:!0,bufferSize:1})),this.reportDataForFinancialsServices$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForFinancialsServices",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCategoryName","serviceCategoryNameHashed","serviceName","orderValueCurrency"],["orderValue"]):b(null)),this.updateLoadingState("reportDataForFinancialsServices",!1),M({refCount:!0,bufferSize:1})),this.reportDataForFinancialsValue$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.financialsValueCostsDimension$,this.weekdayStart$]).pipe(this.updateLoadingState("reportDataForFinancialsValue",!0),ne(([e,t,i,n,s])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[...n,"orderValueCurrency"],["orderValue"],s??void 0):b(null)),this.updateLoadingState("reportDataForFinancialsValue",!1),M({refCount:!0,bufferSize:1})),this.reportDataForLocations$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("reportDataForLocations",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("reportDataForLocations",!1),M({refCount:!0,bufferSize:1})),this.reportDataForMessageDetails$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.messageDetailsMetrics$]).pipe(this.updateLoadingState("reportDataForMessageDetails",!0),ne(([e,t,i,n])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],n):b(null)),this.updateLoadingState("reportDataForMessageDetails",!1),M({refCount:!0,bufferSize:1})),this.usersReportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("usersReportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["updatedBy","updatedByName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("usersReportData",!1),M({refCount:!0,bufferSize:1})),this.resourcesReportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("resourcesReportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["resourceCategoryName","resourceCategoryNameHashed","resourceName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("resourcesReportData",!1),M({refCount:!0,bufferSize:1})),this.servicesReportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("servicesReportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCategoryName","serviceCategoryNameHashed","serviceName"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("servicesReportData",!1),M({refCount:!0,bufferSize:1})),this.serviceCombinationsReportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("serviceCombinationsReportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["serviceCombinations"],["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]):b(null)),this.updateLoadingState("serviceCombinationsReportData",!1),M({refCount:!0,bufferSize:1})),this.csatDimensionsData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatDimensionsData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["surveyAnswerValues"],[...ti(this.toAnalyticsReportFilters(t)),{key:"surveyQuestionId",operator:"=",value:
1Ba}],["numSurveyAnswers","avgVisitOriginalPosition","avgVisitWaitDuration","avgVisitServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatDimensionsData",!1),M({refCount:!0,bufferSize:1})),this.csatByLocationData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByLocationData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["locationName"],ti(this.toAnalyticsReportFilters(t)),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByLocationData",!1),M({refCount:!0,bufferSize:1})),this.csatByResourceData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByResourceData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["resourceCombinations"],ti(this.toAnalyticsReportFilters(t)),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByResourceData",!1),M({refCount:!0,bufferSize:1})),this.csatByServiceData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatByServiceData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,["serviceCombinations"],ti(this.toAnalyticsReportFilters(t)),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"]):b(null)),this.updateLoadingState("csatByServiceData",!1),M({refCount:!0,bufferSize:1})),this.csatResponseTrendData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatResponseTrendData",!0),ne(([e,t,i])=>{if(!ue(e))return b(null);let n=[],s=vn(e.end,e.start);return s<=31?n.push("surveyAnswerDate"):s<=180?n.push("weekStarting"):n.push("month"),this.analyticsRx.getAnalyticsCsatData(e.start,e.end,i.key,i.value,n,ti(this.toAnalyticsReportFilters(t)),["numSurveyAnswers","avgSurveyAnswerValue","avgVisitOriginalPosition","avgVisitServeDuration","avgVisitWaitDuration","dropoffRatio"])}),this.updateLoadingState("csatResponseTrendData",!1),M({refCount:!0,bufferSize:1})),this.csatMetricsReportData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatMetricsReportData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],["numVisits","numSurveysSent"]):b(null)),this.updateLoadingState("csatMetricsReportData",!1),M({refCount:!0,bufferSize:1})),this.csatMetricsSurveyData$=D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatMetricsSurveyData",!0),ne(([e,t,i])=>ue(e)?this.analyticsRx.getAnalyticsCsatMetrics(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t),{key:"surveyQuestionId",operator:"in",value:[Ba,$n]}]):b(null)),this.updateLoadingState("csatMetricsSurveyData",!1),M({refCount:!0,bufferSize:1})),this.compareDateRangeLabel$=this.dateRange$.pipe(c(e=>ue(e)&&e.id?qr[e.id]??null:null),L(),M({refCount:!0,bufferSize:1})),this.compareReportData$=D([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareReportData",!0),ne(([e,t,i,n])=>ue(e)&&xi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],Ko):b(null)),this.updateLoadingState("compareReportData",!1),M({refCount:!0,bufferSize:1})),this.compareReportDataForLocations$=D([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareReportDataForLocations",!0),ne(([e,t,i,n])=>ue(e)&&xi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),["locationId","locationName"],["numRegistrations","numIndividuals","numVisits","totalWaitlist","totalBookings","numServed","numCompleted","numDropoff","numNoShowedByVisitType","numCancelledByVisitType","numRemovedByVisitType","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration","dropoffRatio"]):b(null)),this.updateLoadingState("compareReportDataForLocations",!1),M({refCount:!0,bufferSize:1})),this.compareCsatMetricsReportData$=D([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareCsatMetricsReportData",!0),ne(([e,t,i,n])=>ue(e)&&xi(e.start,n)===1?this.analyticsRx.getReportData(e.start,e.end,i.key,i.value,this.toAnalyticsReportFilters(t),[],["numVisits"]):b(null)),this.updateLoadingState("compareCsatMetricsReportData",!1),M({refCount:!0,bufferSize:1})),this.compareCsatMetricsSurveyData$=D([this.compareDateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$,this.minFromDateForAccount$]).pipe(this.updateLoadingState("compareCsatMetricsSurveyData",!0),ne(([e,t,i,n])=>ue(e)&&xi(e.start,n)===1?this.analyticsRx.getAnalyticsCsatMetrics(e.start,e.end,i.key,i.value,[...this.toAnalyticsReportFilters(t),{key:"surveyQuestionId",operator:"in",value:[Ba,$n]}]):b(null)),this.updateLoadingState("compareCsatMetricsSurveyData",!1),M({refCount:!0,bufferSize:1})),this.subscribeToLocationChanges(),this.subscribeToLocaleChanges()}setLoadingState(e,t){this.loadingStateSub.next(q(Y({},this.loadingStateSub.value),{[e]:t}))}setDateRange(e){this.dateRangeSub.next(e),this.compareDateRangeSub.next(this.getCompareDateRange(e))}setLabelGroup(e){this.labelGroupSub.next(e)}setCreatorSourceDimension(e){this.creatorSourceDimensionSub.next(e)}setResourceServiceLocationDimension(e){this.resourceServiceDimensionSub.next(e)}setFinancialsValueCostsDimension(e){e==="dayOfWeekNumber"?this.financialsValueCostsDimensionSub.next(["dayOfWeekNumber","dayOfWeek"]):this.financialsValueCostsDimensionSub.next([e])}setMessageDetailsMetrics(e){this.messageDetailsMetricsSub.next(e)}setWeekdayStart(e){this.weekdayStartSub.next(e)}getCsatAnswers(e,t){return D([this.dateRange$,this.filterStore.filterValues$,this.reportingGroupKeyAndValue$]).pipe(this.updateLoadingState("csatAnswersData",Jt(t)),ne(([i,n,s])=>ue(i)?this.analyticsRx.getCsatAnswers(i.start,i.end,s.key,s.value,ti(this.toAnalyticsReportFilters(n)),e,t):b(null)),this.updateLoadingState("csatAnswersData",!1),M({refCount:!0,bufferSize:1}))}getInitialFormControlValue(e,t,i){return this.defaultFormControlValues[e]=t,this.queryParams.get(e,t,i)}persistFormControlValue(e,t){if(this.defaultFormControlValues[e]===t){this.queryParams.update({remove:[e]});return}this.queryParams.set(e,t,{navigation:"replace",disableEmitEvent:!0})}createCsvData(e,t,i){let s=e.join(",")+`
2`,h=i.map(S=>t.map(T=>this.convertValueToCsvCompatibleValue(S[T])).join(",")).join(`
3`);return s+h}updateLoadingState(e,t){return i=>i.pipe(Ta(()=>this.setLoadingState(e,t)),Aa(()=>this.setLoadingState(e,!1)))}convertValueToCsvCompatibleValue(e){if(e==null)return"";
3if(e instanceof Date)return e.toLocaleString();let t=e.toString().replace(/"/g,'""');return t.search(/("|,|\n)/g)>=0?`"${t}"`:t}subscribeToLocationChanges(){this.locationRx.nullableLocationId$.pipe(_o()).subscribe(([e,t])=>{e!==t&&this.loadingStateSub.next(os)})}subscribeToLocaleChanges(){this.localeService.locale$.subscribe(e=>{let t=Kr(e),i=Hr[t];this.weekdayStartSub.next(i)})}getCompareDateRange(e){if(!ue(e))return null;let t=vn(e.end,e.start);switch(e.id){case Ii.id:return{start:xt(e.start,1),end:xt(e.end,1)};case ei.id:return{start:xt(e.start,8),end:xt(e.end,8)};case Bi.id:case Mi.id:return{start:bn(e.start,1),end:bn(e.end,1)};case Oi.id:case Fi.id:return{start:An(e.start,1),end:An(e.end,1)};case Ci.id:case Ni.id:return{start:Tn(e.start,1),end:Tn(e.end,1)};default:return{start:xt(e.start,t+1),end:xt(e.end,t+1)}}}toAnalyticsReportFilters(e){let t=[];if(e.source&&t.push({key:"source",operator:"in",value:e.source}),e.resourceId&&t.push({key:"resourceId",operator:"in",value:e.resourceId}),e.serviceId&&t.push({key:"serviceId",operator:"in",value:e.serviceId}),e.includeDeleted||t.push({key:"isDeleted",operator:"=",value:"false"}),e.visitType&&t.push({key:"visitType",operator:"in",value:e.visitType}),e.labels)for(let[i,n]of Object.entries(e.labels))t.push({key:`label:${i}`,operator:"in",value:n});return t}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Et({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();function Es(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messages,"1.0-0"))}}function Rs(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Fn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Messages: The total number of sent and received customer messagess and users across all channels (email, sms, chat) regardless of delivered state.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messages,response:t,previous:t?.data[0]?.numMessages??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.numMessages}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-messages"]],hostAttrs:[1,"ww-analytics-alerts-messages"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Messages`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,Es,5,10,"ww-metric-value",3)(9,Rs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function xs(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messagesPerCustomer,"1.0-1"))}}function Is(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var On=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Messages per customer: The average number of sent and received messages per unique customer. All channels (email, sms, chat) regardless of delivered state. The count of unique customers used in this calculation is an approximation.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>{let n=(t?.data[0]?.approxUniqueCustomers??0)>0?Math.fround((t?.data[0]?.numMessagesByRecipient?.guest??0)/(t?.data[0]?.approxUniqueCustomers??0)):0;return he({current:e.messagesPerCustomer,response:t,previous:n,rangeLabel:i})}),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messagesPerCustomer:t.approxUniqueCustomers>0?Math.fround(t.numMessagesByRecipient.guest/t.approxUniqueCustomers):0}:{messagesPerCustomer:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-messages-per-customer"]],hostAttrs:[1,"ww-analytics-alerts-messages-per-customer"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Messages per customer`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,xs,5,10,"ww-metric-value",3)(9,Is,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Bs(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messageSegments,"1.0-0"))}}function Fs(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Nn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Message segments: The total number of incoming and outgoing message segments to customers and users across all channels regardless of delivered state.
4
5  Messages longer than 160 characters are automatically split into parts (called ""segments"") and then re-assembled when they are received. Message concatenation allows you to send long SMS messages, but this increases your per-message cost, because SMS are billed per segment.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messageSegments,response:t,previous:t?.data[0]?.numMessageSegments??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messageSegments:t.numMessageSegments}:{messageSegments:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-messages-segments"]],hostAttrs:[1,"ww-analytics-alerts-messages-segments"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Message segments`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,Bs,5,10,"ww-metric-value",3)(9,Fs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Ns(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messages,"1.0-0"))}}function Vs(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Vn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Automatic SMS: The number of SMS messages that were automatically sent as a result of an event (e.g. customer registered to a Waitlist, customer cancelled a visit)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.automatic??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.automatic}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-sms-automatic"]],hostAttrs:[1,"ww-analytics-alerts-sms-automatic"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Automatic SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,Ns,5,10,"ww-metric-value",3)(9,Vs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function zs(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messages,"1.0-0"))}}function Ys(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var Pn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Custom SMS: The number of SMS messages that were sent manually as custom messages (e.g. saved replies, individual messages sent/received from a specific customer)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.custom??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.custom}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-sms-custom"]],hostAttrs:[1,"ww-analytics-alerts-sms-custom"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Custom SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,zs,5,10,"ww-metric-value",3)(9,Ys,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Us(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messages,"1.0-0"))}}function Hs(a,d){a&1&&v(0,"ww-skeleton-placeholder",4),a&2&&p("height",30)("width",75)}var zn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Triggered SMS: The number of SMS messages that were sent as a result of a triggered manual action (e.g. User alerts customer, marks customer as a no show, or rejects a customers appointment request)`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messages,response:t,previous:t?.data[0]?.smsMessagesByOriginType?.triggered??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.smsMessagesByOriginType.triggered}:{messages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-alerts-sms-triggered"]],hostAttrs:[1,"ww-analytics-alerts-sms-triggered"],standalone:!1,decls:10,vars:6,consts:()=>{let e;return e=$localize`Triggered SMS`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",1)(3,"ww-metric")(4,"ww-metric-title",2),ee(5,0),m(),O(6),o(7,"async"),g(8,Us,5,10,"ww-metric-value",3)(9,Hs,1,2,"ww-skeleton-placeholder",4),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(7,3,i.currentData$));l(2),_(n?8:9)}},dependencies:[Ce,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();var J=(()=>{class a extends gt{constructor(){super(...arguments),this.analyticsService=w(ae),this.breakpoints=w(Le),this.chartInputs=w(en),this.layout=w(Ht),this.route=w(li),this.router=w(zt),this.currentTab$=this.route.params.pipe(c(e=>e.tab)),this.currentChart$=this.route.params.pipe(c(e=>e.chart)),this.hasData$=Ot(()=>this.dataMap$).pipe(c(e=>e?.rows.length??!1)),this.exportData$=Ot(()=>this.dataMap$).pipe(c(e=>{if(!e||e.rows.length<1)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows.map(s=>Object.keys(s).reduce((h,S)=>(h[S]=jt(s,S),h),{}));return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.dateRange}.csv`}})),this.fullscreen$=this.currentChart$.pipe(c(e=>le(e)))}onTitleClicked(){return pt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$);this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return pt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$);this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}${window.location.search}`)})}export(){return pt(this,null,function*(){let e=yield Ee(Ot(()=>this.exportData$));if(e){let t=this.analyticsService.createCsvData(e.columns,e.keys,e.rows);Wo(t,e.fileName)}})}setTitleForFullscreenChart(){D([this.currentTab$,this.title$,this.fullscreen$]).pipe(Ke(([e,t,i])=>i===!0),Xe(this.ngOnDestroy$)).subscribe(([e,t,i])=>{this.layout.updateFeatureContext({name:or({component:Je({content:t,truncate:!0}),content:t,withTouch:!0}),breadcrumbName:t,breadcrumbs:[{name:$localize`Analytics`,routerLink:`/account/analytics/${e}${window.location.search}`}]})})}ngOnInit(){this.setTitleForFullscreenChart()}
5persistObservableInQueryString(e,t){e.pipe(ba(1),Xe(this.ngOnDestroy$)).subscribe(i=>{this.analyticsService.persistFormControlValue(t,`${i}`)})}getDayOfWeekName(e,t){return Vt(e.dayOfWeek,!t)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275dir=si({type:a,features:[I]})}}return a})();function Ks(a,d){if(a&1&&v(0,"img",6),a&2){let e=f().$implicit;p("src",e.image,Ei)}}function Xs(a,d){if(a&1&&(u(0,"div",3)(1,"div",4),H(2),m(),u(3,"div",5),g(4,Ks,1,1,"img",6),u(5,"div",7),v(6,"ww-text",8),m()()()),a&2){let e=d.$implicit,t=f(3);l(2),Ve(" ",e.x," "),l(),p("wwBackgroundColor",e.fillColor)("wwBorderColor",e.fillColor)("wwTooltip",e.x)("wwTooltipWithTouch",!0),l(),_(e.image?4:-1),l(2),p("content",t.getDuration(e.y))("truncate",!0)}}function Qs(a,d){if(a&1&&(u(0,"div",1),Be(1,Xs,7,8,"div",3,Nt),m()),a&2){let e=f();l(),Fe(e.series)}}function Zs(a,d){if(a&1&&(u(0,"td",4),H(1),m()),a&2){let e=f().$implicit;l(),Ve(" ",e.x," ")}}function Js(a,d){if(a&1&&v(0,"img",6),a&2){let e=f(3).$implicit;p("src",e.image,Ei)}}function el(a,d){if(a&1&&(u(0,"td")(1,"div",11),g(2,Js,1,1,"img",6),u(3,"div",7),v(4,"ww-text",8),m()()()),a&2){let e=f(2).$implicit;f(2);let t=F(0),i=f();Do("width",e.right-e.left,"%"),bo("colspan",t?3:1),l(),p("wwBackgroundColor",e.fillColor)("wwBorderColor",e.fillColor)("wwTooltip",e.x)("wwTooltipWithTouch",!0),l(),_(e.image?2:-1),l(2),p("content",i.getDuration(e.y))("truncate",!0)}}function tl(a,d){a&1&&v(0,"td")}function il(a,d){if(a&1&&g(0,el,5,10,"td",10)(1,tl,1,0,"td"),a&2){let e=d.$implicit;f();let t=F(0);_(e===t?0:1)}}function al(a,d){if(a&1&&(O(0),u(1,"tr"),g(2,Zs,2,1,"td",4),Be(3,il,2,1,null,null,Rt),m()),a&2){let e=d.$index,t=f(2);f();let i=F(0);P(e),l(2),_(i?2:-1),l(),Fe(t.indexes)}}function nl(a,d){if(a&1){let e=ie();u(0,"table",9),R("click",function(){G(e);let i=f(2);return U(i.onChartClicked())}),u(1,"tbody"),Be(2,al,5,2,"tr",null,Nt),m()()}if(a&2){let e=f();f();let t=F(0);yt("cursor-pointer",!t),l(2),Fe(e.series)}}function ol(a,d){if(a&1&&(O(0),o(1,"async"),g(2,Qs,3,0,"div",1)(3,nl,4,2,"table",2)),a&2){let e=f(),t=F(0),i=P(r(1,1,e.breakpoints.isBelowSmall$));l(2),_(i&&t?2:3)}}var rl=je()(["avgBookingLeadDuration","avgBookingToServeDuration","avgWaitDuration","avgAlertToServeDuration","avgServeDuration"]),rs={avgBookingLeadDuration:$localize`Booking lead`,avgBookingToServeDuration:$localize`Booking to serve`,avgWaitDuration:$localize`Wait`,avgAlertToServeDuration:$localize`Alert to serve`,avgServeDuration:$localize`Serve duration`},Yn={avgBookingLeadDuration:z["average-durations-booking-lead"],avgBookingToServeDuration:z["average-durations-booking-to-serve"],avgWaitDuration:z["average-durations-wait"],avgAlertToServeDuration:z["average-durations-alert-to-serve"],avgServeDuration:z["average-durations-serve-duration"]},Yi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="average-durations",this.durationService=w(We),this.locationRx=w(St),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=D([this.analyticsService.reportData$,this.locationRx.getCurrentLocation(["isBookingActive"])]).pipe(c(([e,{isBookingActive:t}])=>this.createDataMap(e,t===!0)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Average durations`),this.tooltip$=b($localize`The Average durations chart summarizes the average durations for various steps in the customer flow.
6
7These steps include:
8- Booking lead: The average time between when the booking was submitted and the time of the appointment.
9- Booking to serve: The average duration between the appointment time and when the appointment was moved to the serving list.
10- Wait: The average time a visit was in the waitlist. This number excludes bookings that are automatically synced to the waitlist.
11- Alert to serve: The average time between a visit being alerted and being served.
12- Serve Duration: The average time a visit was in the serving list.`)}getDuration(e){let t=e??[];return t.length>1?this.durationService.transform(t[1]-t[0]):""}createDataMap(e,t){let i=e?.data[0];if(!i)return{series:[],indexes:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=0,s=t?rl:["avgWaitDuration","avgAlertToServeDuration","avgServeDuration"],h=[];s.reduce((x,C)=>{let j=((A,B)=>{let re=A[B]??0;return re>0?re:0})(i,C);return j===0?x:(n+=j,h.push({x:rs[C],y:[x,x+j],fillColor:Yn[C],left:0,right:0,image:Ri(Yn[C])}),x+j+1)},0);let T=100/(h[h.length-1]?.y[1]??0);for(let x of h)x.left=x.y[0]*T,x.right=x.y[1]*T;if(n===0)return{series:[],indexes:[],legendItems:[],dateRange:"",columns:[],rows:[]};let E=[{key:"name",label:$localize`State`,sortable:!0},{key:"avgDuration",label:$localize`Avg Duration`,sortable:!0}];return{hasData:!0,series:h,indexes:Array.from({length:h.length},(x,C)=>C),legendItems:s.map(x=>({color:Yn[x],label:rs[x],key:x})),dateRange:`${e.fromDate}-${e.toDate}`,columns:E,rows:h.map(x=>({name:x.x,avgDuration:this.durationService.transform(x.y[1]-x.y[0]-1)}))}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-average-durations"]],hostAttrs:[1,"ww-analytics-average-durations"],standalone:!1,features:[I],decls:9,vars:20,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"flex","flex-col","gap-1","w-full"],[1,"w-full","border-separate","border-spacing-1",3,"cursor-pointer"],[1,"flex","items-center","justify-between","gap-1"],[1,"ww-analytics-average-durations-row-label"],[1,"ww-analytics-average-durations-row-duration-container","w-full",3,"wwBackgroun
12dColor","wwBorderColor","wwTooltip","wwTooltipWithTouch"],[1,"print:visible","invisible",2,"height","100%","width","100%",3,"src"],[1,"ww-analytics-average-durations-row-duration-value"],[3,"content","truncate"],[1,"w-full","border-separate","border-spacing-1",3,"click"],[3,"width"],[1,"ww-analytics-average-durations-row-duration-container",3,"wwBackgroundColor","wwBorderColor","wwTooltip","wwTooltipWithTouch"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",0),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,ol,4,4),o(8,"async"),m()),t&2){let n,s=P(r(1,7,i.fullscreen$));l(2),p("chartTitle",r(3,10,i.title$))("tooltip",r(4,12,i.tooltip$))("loading",r(5,14,i.loading$))("dataMap",r(6,16,i.dataMap$))("isFullscreen",s)("showTable",s),l(5),_((n=r(8,18,i.dataMap$))?7:-1,n)}},dependencies:[X,ge,ir,Na,k],styles:[`.ww-analytics-average-durations .apexcharts-xaxis line,.ww-analytics-average-durations .apexcharts-yaxis line{display:none}.ww-analytics-average-durations .ww-chart-layout.ww-chart-layout-fullscreen .ww-chart-layout-graph{padding-left:24px;padding-right:24px}.ww-breakpoints-below-small .ww-analytics-average-durations .ww-chart-layout.ww-chart-layout-fullscreen .ww-chart-layout-graph{padding-left:12px;padding-right:12px}.ww-analytics-average-durations .ww-analytics-average-durations-row-label{font-family:var(--ww-typography-caption1-font-family);font-size:var(--ww-typography-caption1-font-size);font-weight:var(--ww-typography-caption1-font-weight);line-height:var(--ww-typography-caption1-line-height);letter-spacing:var(--ww-typography-caption1-letter-spacing);min-width:128px;color:var(--ww-color-darkerGrey)}.ww-analytics-average-durations .ww-analytics-average-durations-row-duration-container{display:flex;justify-content:center;border-radius:6px;border-width:1px;border-style:solid;min-width:96px;height:40px;position:relative}.ww-analytics-average-durations .ww-analytics-average-durations-row-duration-value{font-family:var(--ww-typography-caption2-font-family);font-size:var(--ww-typography-caption2-font-size);font-weight:var(--ww-typography-caption2-font-weight);line-height:var(--ww-typography-caption2-line-height);letter-spacing:var(--ww-typography-caption2-letter-spacing);color:var(--ww-color-white);display:inline-flex;padding:2px 6px;border-radius:4px;border:1px solid var(--ww-color-white);min-width:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
13/*noopaverage-durations.component-DLEH4M45.css.map */
14`],encapsulation:2,changeDetection:0})}}return a})();function ll(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",2),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var Gi=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="csat-by-location",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByLocationData)),this.dataMap$=this.analyticsService.csatByLocationData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Location CSAT`),this.tooltip$=b($localize`The Location CSAT chart shows the top locations, ordered by the number of CSAT responses. The bar represents the number of CSAT responses, and the dot represents the average CSAT score.
15
16The Location CSAT table displays the top locations sorted by default by the number of responses.
17
18The metrics available by location include: Responses, Average CSAT score, Average Original Position, Average wait, Average serve duration, and Dropoff rate`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=`${t.locationName}`,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=di,T=ui,E=Yt(h-T,S-T);return{key:t.locationName,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:z["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:E,formattedValue:h.toString(),color:z["csat-avg-score"]}}})))}createDataMap(e){let t=Se(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"locationName",label:$localize`Location`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>le(s.locationName)).sort(qe("locationName")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({locationName:s.locationName??$localize`(No location)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:z["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:z["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-by-location"]],hostAttrs:[1,"ww-analytics-csat-by-location"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,ll,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[X,xe,k],encapsulation:2,changeDetection:0})}}return a})();function pl(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",2),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var Ui=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="csat-by-resource",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByResourceData)),this.dataMap$=this.analyticsService.csatByResourceData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Resource CSAT`),this.tooltip$=b($localize`The Resource CSAT chart shows the top resource combinations across resource categories, ordered by the number of CSAT responses. The bar represents the number of CSAT responses, and the dot represents the average CSAT score.
19
20The Resource CSAT table displays the top resource combinations across resource categories, sorted by default by the number of responses.
21
22The metrics available by resource combination include: Responses, Average CSAT score, Average Original Position, Average wait, Average serve duration, and Dropoff rate
23
24The resource combinations data will only be meaningful if you allow your customers to 
24select more than one resource when registering, thereby creating resource combinations. If your business does not allow multiple resources, the data in this chart and table will be displayed on a per-resource basis instead.`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=t.resourceCombinations,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=di,T=ui,E=Yt(h-T,S-T);return{key:i,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:z["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:E,formattedValue:h.toString(),color:z["csat-avg-score"]}}})))}createDataMap(e){let t=Se(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"resourceCombinations",label:$localize`Resource`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>le(s.resourceCombinations)).sort(qe("locationName")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({resourceCombinations:s.resourceCombinations??$localize`(No resource)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:z["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:z["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-by-resource"]],hostAttrs:[1,"ww-analytics-csat-by-resource"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,pl,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[X,xe,k],encapsulation:2,changeDetection:0})}}return a})();function dl(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",2),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var Hi=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="csat-by-service",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatByServiceData)),this.dataMap$=this.analyticsService.csatByServiceData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Service CSAT`),this.tooltip$=b($localize`The Service CSAT chart shows the top service combinations across service categories ordered by the number of CSAT responses. The bar represents the number of CSAT responses, and the dot represents the average CSAT score.
25
26The Service CSAT table displays the top service combinations across service categories, sorted by default by the number of responses.
27
28The metrics available by service combination include: Responses, Average CSAT score, Average Original Position, Average wait, Average serve duration, and Dropoff rate
29
30The service combinations data will only be meaningful if you allow your customers to 
30select more than one service when registering, thereby creating service combinations. If your business does not allow multiple services, the data in this chart and table will be displayed on a per-service basis instead.`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i=`${t.serviceCombinations}`,n=t.numSurveyAnswers,s=n.toLocaleString(),h=t.avgSurveyAnswerValue,S=di,T=ui,E=Yt(h-T,S-T);return{key:i,label:i,formattedValue:s,values:[{label:$localize`Responses`,value:n,formattedValue:s,color:z["csat-responses"]}],dataLabel:{label:$localize`Avg score`,value:h,valueAsPercentOfMax:E,formattedValue:h.toString(),color:z["csat-avg-score"]}}})))}createDataMap(e){let t=Se(e?.data);if(!e||t.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"serviceCombinations",label:$localize`Service`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],n=t.filter(s=>le(s.serviceCombinations)).sort(qe("serviceCombinations")).sort((s,h)=>s.numSurveyAnswers<h.numSurveyAnswers?1:-1).map(s=>({serviceCombinations:s.serviceCombinations??$localize`(No service)`,numSurveyAnswers:s.numSurveyAnswers,avgSurveyAnswerValue:s.avgSurveyAnswerValue??0,avgVisitOriginalPosition:s.avgVisitOriginalPosition??0,avgVisitWaitDuration:s.avgVisitWaitDuration?this.durationService.transform(s.avgVisitWaitDuration):"-",avgVisitServeDuration:s.avgVisitServeDuration?this.durationService.transform(s.avgVisitServeDuration):"-",dropoffRatio:s.dropoffRatio>=0?`${Math.round(s.dropoffRatio*100).toFixed(0)}%`:"-"}));return{hasData:oe(n.map(s=>s.numSurveyAnswers))>0,legendItems:[{key:"responses",label:$localize`Responses`,color:z["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:z["csat-avg-score"]}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-by-service"]],hostAttrs:[1,"ww-analytics-csat-by-service"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,dl,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[X,xe,k],encapsulation:2,changeDetection:0})}}return a})();var ss=["1","2","3","4","5"],ls={1:"#E52020",2:"#F18484",3:"#86868B",4:"#98D27C",5:"#42A60E"};function hl(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",2),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var ji=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="csat-distribution",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatDimensionsData)),this.dataMap$=D([this.fullscreen$,this.analyticsService.csatDimensionsData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`CSAT distribution`),this.tooltip$=b($localize`The CSAT distribution chart shows the number of responses by CSAT score.
31
32The CSAT distribution table displays the following metrics broken down by the response score: Responses, Average Original Position, Average wait, Average serve duration, and Dropoff rate`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>
32{let i=t.score,n=t.score,s=t.responses,h=s.toLocaleString();return{key:i,label:n,formattedValue:h,values:[{label:n,value:s,formattedValue:h,color:ls[t.score]}]}})))}createDataMap(e,t){let i=Se(t?.data);if(!t||i.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"score",label:$localize`CSAT score`,sortable:!0},{key:"responses",label:$localize`Responses`,sortable:!0}];e&&n.push({key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0});let s=i.filter(S=>S.surveyAnswerValues&&S.surveyAnswerValues.length>0).map(S=>({score:S.surveyAnswerValues,responses:S.numSurveyAnswers??0,avgVisitOriginalPosition:S.avgVisitOriginalPosition??0,avgVisitWaitDuration:S.avgVisitWaitDuration??0,avgVisitServeDuration:S.avgVisitServeDuration??0,dropoffRatio:S.dropoffRatio??0})),h=ss.map(S=>{let T=s.find(E=>E.score===S);return{score:S,responses:T?T.responses:0,avgVisitOriginalPosition:T?T.avgVisitOriginalPosition:0,avgVisitWaitDuration:T?this.durationService.transform(T.avgVisitWaitDuration):"-",avgVisitServeDuration:T?this.durationService.transform(T.avgVisitServeDuration):"-",dropoffRatio:T?`${(T.dropoffRatio*100).toFixed(0)}%`:"-"}});return{hasData:oe(h.map(S=>S.responses))>0,legendItems:[],hideLegend:!0,dateRange:`${t.fromDate}-${t.toDate}`,columns:n,rows:h}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-distribution"]],hostAttrs:[1,"ww-analytics-csat-distribution"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,hl,2,4,"ww-bar-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.bars$))?7:-1,n)}},dependencies:[X,xe,k],encapsulation:2,changeDetection:0})}}return a})();function yl(a,d){if(a&1&&(u(0,"ww-metric-value",4),H(1),o(2,"number"),m()),a&2){f();let e=F(8),t=F(10),i=F(12);p("compare",t)("loading",i),l(),we(pe(2,3,e.avg,"1.0-1"))}}function Cl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function wl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function gl(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,1),m())}var Gn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`The average CSAT score of the responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),L()),this.compareData$=D([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.avg,response:t,previous:t?.data?.[0]?.avgSurveyAnswerValue,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),L())}createDataMap(e){return{avg:(Array.isArray(e?.data)?e?.data?.[0]:null)?.avgSurveyAnswerValue??0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-metric-average"]],hostAttrs:[1,"ww-analytics-csat-metric-average"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Avg. CSAT`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),ee(5,0),m(),O(6),o(7,"async"),O(8),o(9,"async"),O(10),o(11,"async"),O(12),o(13,"async"),g(14,yl,3,6,"ww-metric-value",4)(15,Cl,1,2,"ww-skeleton-placeholder",5),g(16,wl,1,2,"ww-skeleton-placeholder",5)(17,gl,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=P(r(9,6,i.currentData$));l(2);let h=P(r(11,9,i.compareData$));l(2);let S=P(r(13,12,i.compareLoading$));l(2),_(s&&!n?14:15),l(2),_(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();
32function Sl(a,d){if(a&1&&(u(0,"ww-metric-value",4),H(1),o(2,"number"),m()),a&2){f();let e=F(8),t=F(10),i=F(12);p("compare",t)("loading",i),l(),Ve("",pe(2,3,e.rate,"1.0-0"),"%")}}function vl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function Al(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function bl(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,1),m())}var Un=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`The percent of CSAT responses with written feedback divided by the number of CSAT responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),L()),this.compareData$=D([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>{let n=this.getResponseWithFeedback(t),s=this.getResponses(t),h=this.getRate(n,s);return he({current:e.rate,response:t,previous:h,valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:i})}),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),L())}createDataMap(e){let t=this.getResponseWithFeedback(e),i=this.getResponses(e);return{rate:this.getRate(t,i)}}getRate(e,t){return!e||!t?0:Math.round(e/t*100)}getResponseWithFeedback(e){return e?.data?.[0]?.numAnswersWithFeedback}getResponses(e){return e?.data?.[0]?.numSurveyAnswers}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-metric-feedback-rate"]],hostAttrs:[1,"ww-analytics-csat-metric-feedback-rate"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Feedback rate`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),ee(5,0),m(),O(6),o(7,"async"),O(8),o(9,"async"),O(10),o(11,"async"),O(12),o(13,"async"),g(14,Sl,3,6,"ww-metric-value",4)(15,vl,1,2,"ww-skeleton-placeholder",5),g(16,Al,1,2,"ww-skeleton-placeholder",5)(17,bl,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=P(r(9,6,i.currentData$));l(2);let h=P(r(11,9,i.compareData$));l(2);let S=P(r(13,12,i.compareLoading$));l(2),_(s&&!n?14:15),l(2),_(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Dl(a,d){if(a&1&&(u(0,"ww-metric-value",4),H(1),o(2,"number"),m()),a&2){f();let e=F(8),t=F(10),i=F(12);p("compare",t)("loading",i),l(),we(pe(2,3,e.count,"1.0-0"))}}function $l(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function kl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function Ll(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,1),m())}var Hn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`The number of CSAT responses with written feedback`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),L()),this.compareData$=D([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.count,response:t,previous:t?.data?.[0]?.numAnswersWithFeedback,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),L())}createDataMap(e){return{count:(Array.isArray(e?.data)?e?.data?.[0]:null)?.numAnswersWithFeedback??0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-metric-response-feedback"]],hostAttrs:[1,"ww-analytics-csat-metric-response-feedback"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Responses with feedback`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),ee(5,0),m(),O(6),o(7,"async"),O(8),o(9,"async"),O(10),o(11,"async"),O(12),o(13,"async"),g(14,Dl,3,6,"ww-metric-value",4)(15,$l,1,2,"ww-skeleton-placeholder",5),g(16,kl,1,2,"ww-skeleton-placeholder",5)(17,Ll,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=P(r(9,6,i.currentData$));l(2);let h=P(r(11,9,i.compareData$));l(2);let S=P(r(13,12,i.compareLoading$));l(2),_(s&&!n?14:15),l(2),_(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();
32function Rl(a,d){if(a&1&&(u(0,"ww-metric-value",4),H(1),o(2,"number"),m()),a&2){f();let e=F(8),t=F(10),i=F(12);p("compare",t)("loading",i),l(),Ve("",pe(2,3,e.rate,"1.0-0"),"%")}}function Wl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function xl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function Il(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,1),m())}var jn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`The number of CSAT responses divided by the number of surveys sent`,this.currentData$=D([this.analyticsService.csatMetricsReportData$,this.analyticsService.csatMetricsSurveyData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData||e.csatMetricsReportData),L()),this.compareData$=D([this.currentData$,this.analyticsService.compareCsatMetricsReportData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i,n])=>{let s=this.getRate(t,i);return he({current:e.rate,response:t,previous:s,valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:n})}),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),L())}createDataMap(e,t){return{rate:this.getRate(e,t)}}getRate(e,t){let i=Array.isArray(e?.data)?e?.data?.[0]:null,n=Array.isArray(t?.data)?t?.data?.[0]:null;if(!n||!i)return 0;let s=n.numAnswersWithFeedback??0,h=i.numSurveysSent??0;return s===0||h===0?0:Math.round(s/h*100)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-metric-response-rate"]],hostAttrs:[1,"ww-analytics-csat-metric-response-rate"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Response rate`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),ee(5,0),m(),O(6),o(7,"async"),O(8),o(9,"async"),O(10),o(11,"async"),O(12),o(13,"async"),g(14,Rl,3,6,"ww-metric-value",4)(15,Wl,1,2,"ww-skeleton-placeholder",5),g(16,xl,1,2,"ww-skeleton-placeholder",5)(17,Il,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=P(r(9,6,i.currentData$));l(2);let h=P(r(11,9,i.compareData$));l(2);let S=P(r(13,12,i.compareLoading$));l(2),_(s&&!n?14:15),l(2),_(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Bl(a,d){if(a&1&&(u(0,"ww-metric-value",4),H(1),o(2,"number"),m()),a&2){f();let e=F(8),t=F(10),i=F(12);p("compare",t)("loading",i),l(),we(pe(2,3,e.count,"1.0-0"))}}function Fl(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function Ol(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",75)}function Nl(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,1),m())}var qn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`The number of CSAT responses`,this.currentData$=this.analyticsService.csatMetricsSurveyData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatMetricsSurveyData),L()),this.compareData$=D([this.currentData$,this.analyticsService.compareCsatMetricsSurveyData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.count,response:t,previous:t?.data?.[0]?.numSurveyAnswers,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.loadingState$.pipe(c(e=>e.compareCsatMetricsSurveyData),L())}createDataMap(e){let t=Array.isArray(e?.data)?e?.data?.[0]:null;return t?{count:t.numSurveyAnswers??0}:{count:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-metric-responses"]],hostAttrs:[1,"ww-analytics-csat-metric-responses"],standalone:!1,decls:18,vars:15,consts:()=>{let e;e=$localize`Responses`;let t;return t=$localize` No data from previous period`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(Pe(0),u(1,"ww-section")(2,"ww-section-content",2)(3,"ww-metric")(4,"ww-metric-title",3),ee(5,0),m(),O(6),o(7,"async"),O(8),o(9,"async"),O(10),o(11,"async"),O(12),o(13,"async"),g(14,Bl,3,6,"ww-metric-value",4)(15,Fl,1,2,"ww-skeleton-placeholder",5),g(16,Ol,1,2,"ww-skeleton-placeholder",5)(17,Nl,2,0,"ww-metric-summary"),m()()(),ze()),t&2){l(2),p("padding","none"),l(2),p("tooltip",i.tooltip);let n=r(7,4,i.loading$);l(4);let s=P(r(9,6,i.currentData$));l(2);let h=P(r(11,9,i.compareData$));l(2);let S=P(r(13,12,i.compareLoading$));l(2),_(s&&!n?14:15),l(2),_(S?16:h&&!h.previous?17:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Pl(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var qi=(()=>{class a extends J{constructor(){super(...arguments),this.datePipe=w(La),this.decimalPipe=w(se),this.durationService=w(We),this.chartId="csat-response-trend",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatResponseTrendData)),this.dataMap$=this.analyticsService.csatResponseTrendData$.pipe(ri(this.analyticsService.dateRange$),c(([e,t])=>this.createDataMap(e,t?.id??null)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i])=>this.createChart(e,t.period,t.numSurveyAnswers,t.avgSurveyAnswerValue,t.labels,i))),this.title$=b($localize`Response trend`),this.tooltip$=b($localize`The Response trend chart is a trend over time of the average CSAT score and the number of CSAT responses.
33
34Avg score: The average of the CSAT scores for all responses on that date.
35
36Responses: The total number of CSAT responses on that date
37
38For visual clarity, the chart will dynamically roll up dates to weeks or months depending on the number of days selected.`)}createDataMap(e,t){let i=e?.dimensions?.[0];if(!e||!Sr(i))return{numSurveyAnswers:[],avgSurveyAnswerValue:[],labels:[],legendItems:[],dateRange:"",columns:[],rows:[],peri
38od:"surveyAnswerDate",pluckCellLabel:null};let n=[{key:"responses",label:$localize`Responses`,color:z["csat-responses"]},{key:"avgScore",label:$localize`Avg score`,color:z["csat-avg-score"]}],s=[{key:"period",label:$localize`Period`,sortable:!0},{key:"numSurveyAnswers",label:$localize`Responses`,sortable:!0},{key:"avgSurveyAnswerValue",label:$localize`Avg score`,sortable:!0},{key:"avgVisitOriginalPosition",label:$localize`Avg original position`,sortable:!0},{key:"avgVisitWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgVisitServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"dropoffRatio",label:$localize`Dropoff rate`,sortable:!0}],h=Se(e?.data).filter(y=>i==="weekStarting"?(y.weekStarting??"").length>0:i==="month"?(y.month??"").length>0:(y.surveyAnswerDate??"").length>0),S=t!==yi.id,T=vr(h,i,e.fromDate,S?e.toDate:Ra(Wa()),e.weekdayStart),E=T.map(y=>i==="weekStarting"?y.weekStarting:i==="month"?`${y.month??"2020-01"}-01`:y.surveyAnswerDate).map(y=>`${y}T00:00`),x=T.map(y=>{let j=y.surveyAnswerDate,A="shortDate";return i==="weekStarting"?(j=y.weekStarting,A="shortDate"):i==="month"&&(j=`${y.month??"2020-01"}-01`,A="yyyy MMM"),{period:{value:this.datePipe.transform(j,A)??j,sortableValue:j},numSurveyAnswers:y.numSurveyAnswers,avgSurveyAnswerValue:Math.round(y.avgSurveyAnswerValue*100)/100,avgVisitOriginalPosition:Math.round(y.avgVisitOriginalPosition*100)/100,avgVisitServeDuration:y.avgVisitServeDuration?this.durationService.transform(y.avgVisitServeDuration):"-",avgVisitWaitDuration:y.avgVisitWaitDuration?this.durationService.transform(y.avgVisitWaitDuration):"-",dropoffRatio:y.dropoffRatio>=0?`${Math.round(y.dropoffRatio*100).toFixed(0)}%`:"-"}}),C={numSurveyAnswers:x.map(y=>y.numSurveyAnswers),avgSurveyAnswerValue:x.map(y=>y.avgSurveyAnswerValue),avgVisitOriginalPosition:T.map(y=>y.avgVisitOriginalPosition),avgVisitServeDuration:T.map(y=>y.avgVisitServeDuration),avgVisitWaitDuration:T.map(y=>y.avgVisitWaitDuration),dropoffRatio:T.map(y=>y.dropoffRatio),labels:E,legendItems:n,dateRange:`${e.fromDate}-${e.toDate}`,columns:s,rows:x,period:i};return q(Y({},C),{hasData:oe(C.numSurveyAnswers)>0||oe(C.avgSurveyAnswerValue)>0,hasInternalPadding:!0})}createChart(e,t,i,n,s,h){let S={bar:{borderRadius:4}};return this.breakpoints.isAboveMobile&&t==="month"&&(S=q(Y({},S),{bar:q(Y({},S.bar),{columnWidth:"32"})})),this.chartInputs.extend({plotOptions:S,legend:{show:!1},series:[{name:$localize`Responses`,type:"column",data:i,color:z["csat-responses"]},{name:$localize`Avg score`,type:"line",data:n,color:z["csat-avg-score"]}],stroke:{width:[0,4],curve:"straight"},dataLabels:{enabled:!0,enabledOnSeries:[1],style:{fontSize:"11px"},background:{borderRadius:4,padding:4}},labels:s,tooltip:{x:{formatter:(T,E)=>t==="month"?`${this.datePipe.transform(s[E.dataPointIndex??0],"LLL yyyy")}`:t==="weekStarting"?`Week starting on ${this.datePipe.transform(s[E.dataPointIndex??0],"dd MMM")}`:this.datePipe.transform(s[E.dataPointIndex??0],"dd MMM")??""}},xAxis:{type:"category",labels:{show:!0,rotate:0,rotateAlways:!1,hideOverlappingLabels:!0,style:{colors:te("darkerGrey"),fontWeight:200},datetimeFormatter:{year:"yyyy",month:"MMM yy",day:"dd MMM",hour:"HH:mm"},formatter:T=>t==="month"?this.datePipe.transform(T,"LLL yyyy")??"":t==="weekStarting"?this.datePipe.transform(T,"dd MMM")??"":this.datePipe.transform(T,"dd MMM")??""},axisBorder:{show:!1},axisTicks:{show:!1},tooltip:{enabled:!1}},yAxis:[{axisBorder:{show:!1},axisTicks:{show:!1},labels:{show:!1,formatter:T=>this.decimalPipe.transform(T)??"",style:{colors:te("darkerGrey")}}},{axisBorder:{show:!1},axisTicks:{show:!1},min:0,max:6,labels:{show:!1,formatter:T=>this.decimalPipe.transform(T)??"",style:{colors:te("darkerGrey")}}}],chart:{parentHeightOffset:0,height:e?"400":"240",events:{click:()=>{h||this.onChartClicked()}}},responsive:[]},this.chartInputs.line)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-response-trend"]],hostAttrs:[1,"ww-analytics-csat-response-trend"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","line",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Pl,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function Yl(a,d){if(a&1){let e=ie();u(0,"div",3)(1,"ww-link",5),R("click",function(){G(e);let i=f(2);return U(i.onTitleClicked())}),u(2,"span"),H(3),m(),v(4,"ww-icon",6),m()()}
38if(a&2){let e=f();l(3),Ve("Show all ",e.total," responses")}}function Gl(a,d){if(a&1){let e=ie();u(0,"div",4)(1,"ww-link",7),R("click",function(){G(e);let i=f(2);return U(i.loadNextPage())}),u(2,"span"),H(3,"Show more"),m()()()}if(a&2){f();let e=F(0);l(),p("disabled",e)("wwColor",e?"darkGrey":"black")}}function Ul(a,d){if(a&1){let e=ie();O(0),o(1,"async"),u(2,"ww-table",2),o(3,"async"),R("rowClicked",function(){G(e);let i=f();return U(i.onChartClicked())}),m(),g(4,Yl,5,1,"div",3),g(5,Gl,4,2,"div",4),o(6,"async")}if(a&2){let e=d,t=f(),i=st(11),n=F(0),s=P(r(1,11,t.nextPageLoading$)??!1),h=e.showFullscreenLink&&!n;l(2),yt("ww-chart-layout-table-with-bottom-border",h),p("placeholder",i)("columns",e.columns)("data",r(3,14,t.tableRows$))("pluckCellLabel",e.pluckCellLabel)("selection","none")("withPointerStyles",!n)("loading",s),l(2),_(h?4:-1),l(),_(n&&r(6,16,t.hasNextPage$)?5:-1)}}function Hl(a,d){a&1&&Qe(0)}function jl(a,d){if(a&1&&Re(0,Hl,1,0,"ng-container",8),a&2){f();let e=st(11);p("ngTemplateOutlet",e)}}function ql(a,d){a&1&&(u(0,"span",9),H(1,"No data available"),m())}var Xi=(()=>{class a extends J{constructor(){super(...arguments),this.datePipe=w(Go),this.chartId="csat-responses",this.nextPageTokenSub=new $e(null),this.nextPageLoadingSub=new $e(!1),this.nextPageLoading$=this.nextPageLoadingSub.asObservable(),this.tableRowsSub=new $e([]),this.tableRows$=this.tableRowsSub.asObservable(),this.hasNextPage$=this.nextPageTokenSub.asObservable().pipe(c(e=>e&&e.length>0)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.csatAnswersData)),this.dataMap$=this.fullscreen$.pipe(ne(e=>{let t=e?20:5;return this.analyticsService.getCsatAnswers(t).pipe(c(i=>this.createDataMap(e,i)),L((i,n)=>W(i,n)),M({bufferSize:1,refCount:!0}))})),this.exportData$=this.analyticsService.getCsatAnswers().pipe(c(e=>{let t=this.getColumns(!0);if(!e)return{columns:t.map(h=>`${h.label}`),keys:t.map(h=>h.key),rows:[],fileName:`${this.chartId}-empty.csv`};let n=this.getTableRows(e).map(h=>Object.keys(h).reduce((S,T)=>(S[T]=jt(h,T),S),{})),s=`${e.fromDate}-${e.toDate}`;return{columns:t.map(h=>`${h.label}`),keys:t.map(h=>h.key),rows:n,fileName:`${this.chartId}-${s}.csv`}})),this.chart$=b(null),this.title$=b($localize`Responses`),this.tooltip$=b($localize`A table of the individual CSAT responses. The table includes the following metrics:
39
40- Time: The timestamp of when the CSAT response was created
41- Location: The name of the location associated with the CSAT response
42- Visit ID: The Visit ID associated with the CSAT response
43- Position: The position of the visit when it was first placed on the waitlist (if applicable)
44- Service: The services associated with the visit (if applicable)
45- Resources: The resources associated with the visit (if applicable)
46- Tags: Any tags associated with the visit, such as ALERTED, NO-SHOW, DELAYED, etc.
47- Feedback: The written feedback associated with the CSAT score (if provided)`)}loadNextPage(){return pt(this,null,function*(){let e=this.nextPageTokenSub.value;if(e){this.nextPageLoadingSub.next(!0);let t=yield Ee(this.analyticsService.getCsatAnswers(20,e));t?.pagination?.nextPageToken?this.nextPageTokenSub.next(t.pagination.nextPageToken):this.nextPageTokenSub.next(null);let i=this.getTableRows(t);this.tableRowsSub.next([...this.tableRowsSub.value,...i]),this.nextPageLoadingSub.next(!1)}})}getTableRows(e){let t=Se(e?.data);return!e||t.length<1?[]:t.filter(i=>le(i.csatScore)).map(i=>q(Y({},i),{csatScore:Oo(i.csatScore)}))}createDataMap(e,t){let i=this.getTableRows(t);if(this.nextPageTokenSub.next(t?.pagination?.nextPageToken||null),this.tableRowsSub.next(i),!t||i.length<1)return{legendItems:[],hideLegend:!0,dateRange:"",columns:[],rows:i,pluckCellLabel:null};let n=t.pagination?.totalRows??i.length,s=e?i:i.slice(0,5),h=this.getColumns(e);return{hasData:i.length>0,legendItems:[],hideLegend:!0,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:s,total:n,showFullscreenLink:!e&&n>5,pluckCellLabel:S=>h.reduce((T,E)=>{if(E.key==="answerLocalTimestamp"){let x=S[E.key];if(Dt(x)&&Fo(x))return q(Y({},T),{[E.key]:Je({content:this.datePipe.transform(Wi(x))})})}if(E.key==="visitId"){let x=S[E.key];if(Dt(x))return q(Y({},T),{[E.key]:hr({content:x,inline:!0,type:"router-link",href:"/visits",queryParams:{params:{visitId:x}},$element:{color:"black"}})})}return q(Y({},T),{[E.key]:S[E.key]})},{})}}getColumns(e){return e?[{key:"answerLocalTimestamp",label:$localize`Local time`,sortable:!0},{key:"locationName",label:$localize`Location`,sortable:!0},{key:"visitId",label:$localize`Visit ID`,sortable:!0},{key:"originalPosition",label:$localize`Position`,sortable:!0},{key:"serviceCombinations",label:$localize`Services`,sortable:!0},{key:"resourceCombinations",label:$localize`Resources`,sortable:!0},{key:"visitTags",label:$localize`Tags`,sortable:!0},{key:"csatScore",label:$localize`Score`,sortable:!0},{key:"csatFeedback",label:$localize`Feedback`,sortable:!0}]:[{key:"answerLocalTimestamp",label:$localize`Local time`,sortable:!0},{key:"locationName",label:$localize`Location`,sortable:!0},{key:"csatScore",label:$localize`Score`,sortable:!0},{key:"csatFeedback",label:$localize`Feedback`,sortable:!0}]}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat-responses"]],hostAttrs:[1,"ww-analytics-csat-responses"],standalone:!1,features:[I],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"rowClicked","placeholder","columns","data","pluckCellLabel","selection","withPointerStyles","loading"],[1,"flex","justify-center","w-full","pt-5"],[1,"flex","justify-center","gap-2","w-full","pt-5"],["type","internal-in-same-tab","wwColor","black",3,"click"],["icon","bx-chevron-right","size","small"],["type","internal-in-same-tab",3,"click","disabled","wwColor"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Ul,7,18),o(8,"async"),ke(9,jl,1,1,"ng-container"),m(),Re(10,ql,2,0,"ng-template",null,0,Wt)),t&2){let n,s=P(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),_((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Pt,X,ge,Ut,gi,_t,it,k],encapsulation:2,changeDetection:0})}}return a})();function Xl(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var Qi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="customer-distribution",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.distributionNew,e.distributionReturning],e.legendItems))),this.title$=b($localize`New vs returning`),this.tooltip$=b($localize`New vs returning customers is visualized by a pie chart breaking down the number of new vs returning visits. Visits are counted as returning if a visit used the same phone number, email, or external 
47customer id as a previous visit in within the Waitwhile account (across locations).`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{distributionNew:0,distributionReturning:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numNewCustomers.total>0||t.numCreated>0,distributionNew:t.numNewCustomers.total,distributionReturning:t.numCreated-t.numNewCustomers.total,isDonutChart:!0,legendItems:[{color:z["customer-distribution-new"],label:$localize`New`,key:"new"},{color:z["customer-distribution-returning"],label:$localize`Returning`,key:"returning"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`New`,count:t.numNewCustomers.total},{name:$localize`Returning`,count:t.numCreated-t.numNewCustomers.total}]}}createChart(e,t){return Bt(this.chartInputs,e,t.map(i=>i.color),t.map(i=>i.label),()=>this.onChartClicked(),this.breakpoints.isBelowMobile)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-customer-distribution"]],hostAttrs:[1,"ww-analytics-customer-distribution"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","donut",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Xl,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function Jl(a,d){if(a&1){let e=ie();u(0,"ww-funnel",3),o(1,"async"),R("click",function(){G(e);let i=f();return U(i.onChartClicked())}),m()}if(a&2){let e=f(),t=F(0);yt("cursor-pointer",!t),p("data",d)("showLegend",!1)("trimLabelSegments",!!r(1,5,e.trimLabelSegments$))}}function ec(a,d){a&1&&(u(0,"span",2),H(1,"No data available"),m()),a&2&&p("wwTypography","body2")}var ni=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="customer-path",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.funnel$=D([this.fullscreen$,this.dataMap$]).pipe(c(([e,t])=>this.createChart(e,t.series,t.legendItems))),this.title$=b($localize`Customer path`),this.tooltip$=b($localize`The Customer path chart gives you insight into the path of visits through the steps in Waitwhile.
48
49The Customer Flow steps include:
50
51- Registration: The first step of the flow where visits are created as bookings or waitlisted visits.
52- Served: The second step of the flow where visits are marked as being served.
53- Completed: The final step of the flow where visits are marked as completed and are no longer an active visit.
54
55Breakdowns within each step:
56
57- Bookings: Scheduled appointments that are not waitlisted and did not drop off in the associated step. Tracked across all three steps.
58- Waitlisted bookings: Scheduled appointments that were waitlisted and did not drop off in the associated step. Tracked across all three steps.
59- Waitlist:  Waitlisted visits that were not bookings and did not drop off in the associated step. Tracked across all three steps.
60- Direct to served: Visits that bypassed the registration step and were placed directly into the serving list.
61- Direct to completed: Visits that bypassed the registration and served steps and were directly marked as completed (only possible via the API).
62- Auto-completed: Given the default setting is to auto-complete customers after a certain amount of time, we provide details on customers who were auto-completed so you can choose to count them or not count them as a completed customer.
63- Dropoff: Any created visit that was cancelled or marked as a no-show. Drop-offs can occur in either the registration or serving steps.`),this.trimLabelSegments$=D([this.breakpoints.isBelowMedium$,this.breakpoints.isBelowMobile$]).pipe(ri(this.fullscreen$),c(([[e,t],i])=>t?!1:e||i))}createDataMap(e){let t=e?.data?.[0];if(!t)return{series:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[[t.numRegistrations.booking,t.numRegistrations.waitlistedBooking,t.numRegistrations.waitlist,NaN,NaN,NaN,t.numRegistrations.dropoff],[t.numServed.booking,t.numServed.waitlistedBooking,t.numServed.waitlist,t.numServed.directToServed,NaN,NaN,t.numServed.dropoff],[t.numCompleted.booking,t.numCompleted.waitlistedBooking,t.numCompleted.waitlist,t.numCompleted.directToServed,t.numCompleted.directToCompleted,t.numCompleted.autoCompleted,NaN]];if(oe(i.flatMap(s=>s.map(h=>isNaN(h)?0:h)))===0)return{series:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:$localize`Type`,sortable:!0},{key:"total",label:$localize`Total`,sortable:!0},{key:"booking",label:$localize`Bookings`,sortable:!0},{key:"waitlistedBooking",label:$localize`Waitlisted bookings`,sortable:!0},{key:"waitlist",label:$localize`Waitlist`,sortable:!0},{key:"directToServed",label:$localize`Direct to served`,sortable:!0},{key:"directToCompleted",label:$localize`Direct to completed`,sortable:!0},{key:"autoCompleted",label:$localize`Auto Completed`,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0},{key:"other",label:$localize`Other`,sortable:!0}];return{hasData:!0,series:i,legendItems:[{color:Ct(0),key:"bookings",label:$localize`Bookings`},{color:Ct(1),key:"waitlisted-bookings",label:$localize`Waitlisted bookings`},{color:Ct(2),key:"waitlist",label:$localize`Waitlist`},{color:Ct(3),key:"direct-to-served",label:$localize`Direct to served`},{color:Ct(4),key:"direct-to-completed",label:$localize`Direct to completed`},{color:Ct(5),key:"auto-completed",label:$localize`Auto Completed`},{color:Ct(6),key:"dropoff",label:$localize`Dropoff`}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{name:$localize`Registration`,total:t.numRegistrations.total,booking:t.numRegistrations.booking,waitlistedBooking:t.numRegistrations.waitlistedBooking,waitlist:t.numRegistrations.waitlist,directToServed:0,directToCompleted:0,autoCompleted:0,dropoff:t.numRegistrations.dropoff,other:t.numRegistrations.other},{name:$localize`Served`,total:t.numServed.total,booking:t.numServed.booking,waitlistedBooking:t.numServed.waitlistedBooking,waitlist:t.numServed.waitlist,directToServed:t.numServed.directToServed,directToCompleted:0,autoCompleted:0,dropoff:t.numServed.dropoff,other:t.numServed.other},{name:$localize`Completed`,total:t.numCompleted.total,booking:t.numCompleted.booking,waitlistedBooking:t.numCompleted.waitlistedBooking,waitlist:t.numCompleted.waitlist,directToServed:t.numC
63ompleted.directToServed,directToCompleted:t.numCompleted.directToCompleted,autoCompleted:t.numCompleted.autoCompleted,dropoff:0,other:t.numCompleted.other}]}}createChart(e,t,i){return t.length<1?null:{labels:[$localize`Registration`,$localize`Served`,$localize`Completed`],subLabels:[$localize`Bookings`,$localize`Waitlisted bookings`,$localize`Waitlist`,$localize`Direct to served`,$localize`Direct to completed`,$localize`Auto Completed`,$localize`Dropoff`],colors:i.map(n=>n.color),values:t,maxHeight:e?400:150}}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-customer-path"]],hostAttrs:[1,"ww-analytics-customer-path"],standalone:!1,features:[I],decls:11,vars:22,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["id","path-funnel-graph",3,"cursor-pointer","data","showLegend","trimLabelSegments"],[1,"flex","self-center",3,"wwTypography"],["id","path-funnel-graph",3,"click","data","showLegend","trimLabelSegments"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",0),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),o(7,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(8,Jl,2,7,"ww-funnel",1),o(9,"async"),ke(10,ec,2,1,"span",2),m()),t&2){let n,s=P(r(1,7,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,10,i.title$))("tooltip",r(4,12,i.tooltip$))("loading",r(5,14,i.loading$))("dataMap",r(6,16,i.dataMap$))("isFullscreen",s)("showTable",r(7,18,i.fullscreen$)),l(6),_((n=r(9,20,i.funnel$))?8:10,n)}},dependencies:[tn,X,it,k],styles:[`.ww-analytics-customer-path{position:relative;width:100%}.ww-analytics-customer-path .ww-funnel{width:100%}
64/*noopcustomer-path.component-4XTH7WBP.css.map */
65`],encapsulation:2,changeDetection:0})}}return a})();function tc(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var Zi=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="customer-registrations",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t])=>this.createFunnelChart([e.customersIndividuals,e.customersTotalVisits,e.customersUnique],e.legendItems,t))),this.title$=b($localize`Customers`),this.tooltip$=b($localize`The Customer funnel chart shows the breakdown of number of people, number of parties, and the number of unique contacts within the time frame selected.
66
67- Total people: The summation of party size across all visits created in the time period selected.
68- Total parties: The total number of visits started. Bookings count based on the date of the appointment, not the date of creation. Direct to served and direct to completed visits also account for in this metric.
69- Unique parties: An approximate count of the unique customers with created visits in the time period selected. Example: If Customer 1 has two separate visits in November, the November report will count them as 1 unique customer. This number does not cleanly sum with any other number as Customer 1 could exist in different visit types or days.
70`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{customersIndividuals:0,customersTotalVisits:0,customersUnique:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numIndividuals.total+t.numCreated+t.approxUniqueCustomers>0,customersIndividuals:t.numIndividuals.total,customersTotalVisits:t.numCreated,customersUnique:t.approxUniqueCustomers,legendItems:[{color:z["customers-total-people"],label:$localize`Total people`,key:"total-people"},{color:z["customers-total-parties"],label:$localize`Total parties`,key:"total-parties"},{color:z["customers-unique"],label:$localize`Unique parties`,key:"unique-parties"}],dateRange:`${e.fromDate} - ${e.toDate}`,columns:i,rows:[{name:$localize`Total people`,count:t.numIndividuals.total},{name:$localize`Total parties`,count:t.numCreated},{name:$localize`Unique parties`,count:t.approxUniqueCustomers}]}}createFunnelChart(e,t,i){return this.chartInputs.extend({chart:{height:200,events:{click:()=>{i||this.onChartClicked()}}},colors:t.map(n=>n.color),series:[{data:e,name:""}],labels:e.map(n=>`${n}`),dataLabels:{formatter:n=>`${n}`,distributed:!0,style:{colors:t.map(n=>n.color),fontSize:"10px"},background:{enabled:!0,borderWidth:1,borderColor:te("white"),foreColor:te("white"),borderRadius:4,opacity:1}},tooltip:{enabled:!1}},this.chartInputs.funnel)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-customer-registrations"]],hostAttrs:[1,"ww-analytics-customer-registrations"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","funnel",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,tc,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function ac(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var Ji=(()=>{class a extends J{constructor(){super(...arguments),this.decimalPipe=w(se),this.chartId="dropoff-by-position",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData||e.distributionsData)),this.dataMap$=D([this.analyticsService.reportData$,this.analyticsService.distributionsData$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i])=>this.createChart(e,t.entries,t.avgDropoffPosition,t.legendItems,i))),this.title$=b($localize`Dropoff by waitlist position`),this.tooltip$=b($localize`In the dropoff by waitlist position chart you'll see the frequency and rate of dropoffs based on how long the line was when they first entered it.
71- The column bars represent the number of dropped off visits broken out by their original position in line when the visit was created.
72- The line represents the percentage of all visits that dropped off broken out by their original position in line.
73- The average dropoff position annotation is the average line length of all visits that dropped off. Visits that get in a line longer than this number are more likely to dropoff.`)}createDataMap(e,t){let i=(n,s)=>n<=1?`< ${s}`:n===s?`${n}`:n+1>=s?`> ${n}`:`${n}-${s}`;if(e&&e.data.length>0&&t&&t.data.length>=0){let n=t.data.find(s=>s.distributionType==="dropoffPosition");if(n&&n.data){let s=n.data.map(S=>({range:i(S.lowerBound??0,S.upperBound??0),lower:S.lowerBound??0,upper:S.upperBound??0,frequency:S.dropoffFrequency??0,rate:S.dropoffRate??0})),h=[{key:"range",label:$localize`Range`,sortable:!0},{key:"lower",label:$localize`Lower`,sortable:!0},{key:"upper",label:$localize`Upper`,sortable:!0},{key:"frequency",label:$localize`Dropoffs`,sortable:!0},{key:"rate",label:$localize`Dropoff rate`,sortable:!0}];return{hasData:s.length>0,hasInternalPadding:!0,avgDropoffPosition:e.data[0].avgDropoffPosition,entries:s,legendItems:[{color:z.dropoff,label:$localize`Dropoffs`,key:"dropoffs"},{color:z["dropoff-rate"],label:$localize`Dropoff rate`,key:"dropoff-rate"}],dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:s.map(S=>q(Y({},S),{rate:`${S.rate*100}%`}))}}}return{avgDropoffPosition:0,entries:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null}}createChart(e,t,i,n,s){let h=Math.round(i),S=`${h}`;if(h>0)for(let T of t)h>=T.lower&&h<=T.upper&&(S=T.range);return this.chartInputs.extend({plotOptions:{bar:{borderRadius:4,columnWidth:this.breakpoints.isAboveMobile?"40":"32"}},legend:{show:!1},series:[{name:$localize`Dropoffs`,type:"column",data:t.map(T=>T.frequency)},{name:$localize`Dropoff rate`,type:"line",data:t.map(T=>T.rate)}],colors:n.map(T=>T.color),dataLabels:{enabled:!1},stroke:{width:[0,4],curve:"straight"},labels:t.map(T=>T.range),xAxis:{type:"category",labels:{show:!0,style:{colors:te("darkerGrey"),fontWeight:200}},axisBorder:{show:!1},axisTicks:{show:!1},tooltip:{enabled:!1}},yAxis:[q(Y({},this.chartInputs.line.yAxis),{axisBorder:{show:!1,offsetX:1}
73,axisTicks:{show:!1},labels:{show:!1,formatter:T=>`${this.decimalPipe.transform(T,"1.0-1")}`,style:{colors:Ct(0),fontWeight:200}}}),q(Y({},this.chartInputs.line.yAxis),{axisBorder:{show:!1},axisTicks:{show:!1},opposite:!0,labels:{show:!1,formatter:T=>`${this.decimalPipe.transform(T*100,"1.0-0")}%`,style:{colors:Ct(1),fontWeight:200}}})],annotations:{xaxis:[{x:`${S}`,borderColor:z["dropoff-avg-position"],label:{borderColor:z["dropoff-avg-position"],style:{color:"#fff",background:z["dropoff-avg-position"]},offsetY:-10,text:$localize`Avg dropoff position: ${i}`,orientation:"horizontal"}}]},chart:{parentHeightOffset:0,height:e?"400":"272",events:{click:()=>{s||this.onChartClicked()}}},responsive:[]},this.chartInputs.line)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-dropoff-by-position"]],hostAttrs:[1,"ww-analytics-dropoff-by-position"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","dataMap","isFullscreen","loading","showTable"],["preset","line",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,ac,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("dataMap",r(3,11,i.dataMap$))("isFullscreen",r(4,13,i.fullscreen$))("loading",r(5,15,i.loading$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function oc(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var ea=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="dropoffs",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.dropoffCancelled,e.dropoffNoShows,e.dropoffDeleted],e.legendItems))),this.title$=b($localize`Dropoffs`),this.tooltip$=b($localize`A pie chart showing the breakdown of the number of dropped-off visits.
74
75Dropped-off visits include:
76
77- Cancelled visits.
78- No-showed visits.
79- Deleted visits.
80`)}createDataMap(e){let t=[{color:z["dropoffs-cancelled"],label:$localize`Cancelled`,key:"cancelled"},{color:z["dropoffs-no-show"],label:$localize`No-shows`,key:"no-show"},{color:z["dropoffs-deleted"],label:$localize`Deleted`,key:"deleted"}],i=e?.data?.[0];if(!i)return{dropoffCancelled:0,dropoffNoShows:0,dropoffDeleted:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:i.numCancelledByVisitType.total+i.numNoShowedByVisitType.total+i.numRemovedByVisitType.total>0,dropoffCancelled:i.numCancelledByVisitType.total,dropoffNoShows:i.numNoShowedByVisitType.total,dropoffDeleted:i.numRemovedByVisitType.total,isDonutChart:!0,legendItems:t,dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{name:$localize`Cancelled`,count:i.numCancelledByVisitType.total},{name:$localize`No-shows`,count:i.numNoShowedByVisitType.total},{name:$localize`Deleted`,count:i.numRemovedByVisitType.total}]}}createChart(e,t){return Bt(this.chartInputs,e,t.map(i=>i.color),t.map(i=>i.label),()=>this.onChartClicked(),this.breakpoints.isBelowMobile)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-dropoffs"]],hostAttrs:[1,"ww-analytics-dropoffs"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","donut",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,oc,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function sc(a,d){if(a&1){let e=ie();u(0,"ww-table",3),o(1,"async"),o(2,"async"),R("headerClicked",function(i){G(e);
80let n=f();return U(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return U(i.onChartClicked())}),m()}if(a&2){let e=d,t=f(),i=st(11),n=F(0);p("placeholder",i)("columns",e.columns)("data",r(1,7,t.rows$))("pluckCellLabel",e.pluckCellLabel)("selection","none")("orderBy",r(2,9,t.orderBy$))("withPointerStyles",!n)}}function lc(a,d){a&1&&Qe(0)}function cc(a,d){if(a&1&&Re(0,lc,1,0,"ng-container",4),a&2){f();let e=st(11);p("ngTemplateOutlet",e)}}function pc(a,d){a&1&&(u(0,"span",5),H(1,"No data available"),m())}var ta=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="financials-locations",this.decimalPipe=w(se),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=D([this.analyticsService.reportDataForFinancialsLocations$,this.rowCountInTable$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Location revenue`),this.tooltip$=b($localize`The locations revenue table shows a breakdown of revenue and revenue per visit by location and currency. The table displays the top locations based on revenue.`),this.baseColumns=[{key:"orderValue",label:$localize`Revenue`,sortable:!0},{key:"orderValuePerVisit",label:$localize`Revenue per visit`,sortable:!0}],this.orderBySub=new $e({property:"orderValue",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rows$=this.dataMap$.pipe(ne(e=>this.orderBy$.pipe(c(t=>!e?.rows||!t?e?.rows||[]:Mt(e.rows,t)))))}createDataMap(e,t){if(!qt(e)||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=(h,S)=>h&&h>0?h/S:0,n=[{key:"name",label:$localize`Location`,sortable:!0},...this.baseColumns],s=e.data.filter(h=>h.numVisits>0&&h.orderValueCurrency&&h.orderValueCurrency.length>0).sort(qe("locationName")).sort((h,S)=>S.orderValue.total-h.orderValue.total).map(h=>({id:h.locationId,name:h.locationName??"<Unknown>",orderValue:`${this.decimalPipe.transform(h.orderValue.total,"1.0-2")} ${h.orderValueCurrency}`,orderValuePerVisit:`${this.decimalPipe.transform(i(h.orderValue.total,h.numVisits),"1.0-2")} ${h.orderValueCurrency}`})).slice(0,t);return{hasData:s.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:s,pluckCellLabel:h=>n.reduce((S,T)=>q(Y({},S),{[T.key]:Je({content:h[T.key]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-financials-locations"]],hostAttrs:[1,"ww-analytics-financials-locations"],standalone:!1,features:[I],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,sc,3,11,"ww-table",2),o(8,"async"),ke(9,cc,1,1,"ng-container"),m(),Re(10,pc,2,0,"ng-template",null,0,Wt)),t&2){let n,s=P(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),_((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Pt,X,ge,_t,it,k],styles:[`.ww-analytics-financials-locations .ww-chart-layout-partial .ww-table tbody tr{cursor:pointer}
81/*noopfinancials-locations.component-ODO7TCZU.css.map */
82`],encapsulation:2,changeDetection:0})}}return a})();function dc(a,d){if(a&1){let e=ie();u(0,"ww-table",3),o(1,"async"),o(2,"async"),R("headerClicked",function(i){G(e);
82let n=f();return U(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return U(i.onChartClicked())}),m()}if(a&2){let e=d,t=f(),i=st(11),n=F(0);p("placeholder",i)("columns",e.columns)("data",r(1,7,t.rows$))("pluckCellLabel",e.pluckCellLabel)("selection","none")("orderBy",r(2,9,t.orderBy$))("withPointerStyles",!n)}}function uc(a,d){a&1&&Qe(0)}function hc(a,d){if(a&1&&Re(0,uc,1,0,"ng-container",4),a&2){f();let e=st(11);p("ngTemplateOutlet",e)}}function fc(a,d){a&1&&(u(0,"span",5),H(1,"No data available"),m())}var ia=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="financials-service-price",this.decimalPipe=w(se),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForFinancialsServices)),this.dataMap$=D([this.analyticsService.reportDataForFinancialsServices$,this.rowCountInTable$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Service revenue`),this.tooltip$=b($localize`The service revenue chart shows a breakdown of the revenue by service and currency. The table displays the top services based on revenue.`),this.baseColumns=[{key:"orderValue",label:$localize`Revenue`,sortable:!0}],this.orderBySub=new $e({property:"orderValue",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rows$=this.dataMap$.pipe(ne(e=>this.orderBy$.pipe(c(t=>!e?.rows||!t?e?.rows||[]:Mt(e.rows,t)))))}createDataMap(e,t){if(!qt(e)||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Service`,sortable:!0},{key:"categoryName",label:$localize`Category`,sortable:!0},...this.baseColumns],n=e.data.filter(s=>s.orderValueCurrency&&s.orderValueCurrency.length>0&&s.serviceName&&s.serviceName.length>0&&s.serviceCategoryName&&s.serviceCategoryName.length>0).sort(qe("serviceName")).sort(qe("serviceCategoryName")).sort((s,h)=>h.orderValue.total-s.orderValue.total).map(s=>({id:s.serviceId,name:s.serviceName??"<Unknown>",categoryName:s.serviceCategoryName??"<Unknown>",orderValue:`${this.decimalPipe.transform(s.orderValue.total,"1.0-2")} ${s.orderValueCurrency}`})).slice(0,t);return{hasData:n.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:n,pluckCellLabel:s=>i.reduce((h,S)=>q(Y({},h),{[S.key]:Je({content:s[S.key]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-financials-service-price"]],hostAttrs:[1,"ww-analytics-financials-service-price"],standalone:!1,features:[I],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,dc,3,11,"ww-table",2),o(8,"async"),ke(9,hc,1,1,"ng-container"),m(),Re(10,fc,2,0,"ng-template",null,0,Wt)),t&2){let n,s=P(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),_((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Pt,X,ge,_t,it,k],styles:[`.ww-analytics-financials-service-price .ww-chart-layout-partial .ww-table tbody tr{cursor:pointer}
83/*noopfinancials-service-price.component-KSDK6U25.css.map */
84`],encapsulation:2,changeDetection:0})}}return a})();var ds={date:$localize`Date`,dayOfWeekNumber:$localize`Day of Week`,month:$localize`Month`,weekStarting:$localize`Week`},Qn=["#023fb2","#42a60e","#e859e6","#e52020"];function Cc(a,d){a&1&&v(0,"ww-chart",2),a&2&&p("options",d)}var aa=(()=>{class a extends J{constructor(){super(),this.chartId="financials-value-costs",this.dateService=w(pi),this.title$=b($localize`Revenue`),this.tooltip$=b($localize`The revenue by currency chart visualizes a trend over time of the revenue broken down by currency.
85
86The drop-down list at the top right of the chart allows you to select different time breakouts:
87
88- Date (default): The total for each metric by day across the time range selected.
89- Day of Week: The average for each metric by day of week across the time range selected.
90- Month: The total for each metric by month across the time range selected.
91- Week: The total for each metric by week starting across the time range selected.`),this.dimensions=je()(["date","dayOfWeekNumber","month","weekStarting"]),this.dimensionsFormControl=new Oe(this.analyticsService.getInitialFormControlValue("value-costs-dimension","date",Xr),{nonNullable:!0}),this.dimension$=Ye(this.dimensionsFormControl),this.pluckDimensionsLabel=e=>ds[e],this.pluckDimensionEventLoggerParams=e=>({chart_dimension:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForFinancialsValue)),this.dataMap$=this.analyticsService.reportDataForFinancialsValue$.pipe(ri(this.analyticsService.dateRange$),c(([e,t])=>this.createDataMap(e,t?.id??null)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i])=>this.createChart(e,t.period,t.periods,t.series,t.legendItems,i))),this.populateMissingPerio
91dsWithEmptyData=(e,t,i=null)=>{if(!qt(e)||!this.dimensions.includes(t))return null;let{fromDate:n,toDate:s}=e,h=Wi(n),S=i||Wi(s),T=e.data.filter(y=>le(y[t])&&le(y.orderValue)&&le(y.orderValue?.total)&&y.orderValueCurrency&&y.orderValueCurrency.length>0),E=Ze(T.map(y=>y.orderValueCurrency)),x=[],C=qe(t);switch(t){case"date":x=Po({start:h,end:S}).map(y=>xa(y,"yyyy-MM-dd"));break;case"dayOfWeekNumber":x=[1,2,3,4,5,6,7],C=(y,j)=>y.dayOfWeekNumber-j.dayOfWeekNumber;break;case"weekStarting":x=Yo({start:h,end:S}).map(y=>xa(y,"yyyy-MM-dd"));break;case"month":x=zo({start:h,end:S}).map(y=>xa(y,"yyyy-MM"));break}for(let y of E){let j=T.filter(A=>A.orderValueCurrency===y).map(A=>A[t]);for(let A of x){if(j.includes(A))continue;let B={orderValue:{booking:0,directToCompleted:0,directToServed:0,other:0,total:0,waitlist:0,waitlistedBooking:0},orderValueCurrency:y};B[t]=A,t==="dayOfWeekNumber"&&typeof A=="number"&&(B.dayOfWeek=cn(A,e.weekdayStart)),T.push(B)}}return q(Y({},e),{data:T.sort(C)})},this.subscribe()}subscribe(){this.dimension$.pipe(Xe(this.ngOnDestroy$)).subscribe(e=>{this.analyticsService.setFinancialsValueCostsDimension(e)}),this.persistObservableInQueryString(this.dimension$,"value-costs-dimension")}createDataMap(e,t){let i=e?.dimensions?.[0]??"date",n=this.populateMissingPeriodsWithEmptyData(e,i,t===yi.id?Wa():null),s=Se(n?.data).filter(B=>B.orderValueCurrency&&B.orderValueCurrency.length>0&&le(B[i])),h=Ze(s.map(B=>B.orderValueCurrency??"")),S=h.map((B,re)=>({color:Qn[re%Qn.length],label:B,key:B})),T=h.map(B=>({name:B,data:s.filter(re=>re.orderValueCurrency===B).map(re=>re.orderValue.total)})),E=oe(T.flatMap(B=>B.data.map(re=>re??0)??[]))>0,x=[],C=[];i==="dayOfWeekNumber"?(x=[{key:"name",label:$localize`Weekday`,sortable:!0}],C=Ze(s.map(B=>B.dayOfWeek)).map(B=>Vt(B))):i==="month"?(x=[{key:"name",label:$localize`Month`,sortable:!0}],C=Ze(s.map(B=>`${B.month}-01`))):i==="weekStarting"?(x=[{key:"name",label:$localize`Week`,sortable:!0}],C=Ze(s.map(B=>B.weekStarting))):(x=[{key:"name",label:$localize`Day`,sortable:!0}],C=Ze(s.map(B=>B.date))),x=[...x,...h.map(B=>({key:B,label:B,sortable:!0}))];let y=s.reduce((B,re)=>{let ce=re[i==="dayOfWeekNumber"?"dayOfWeek":i]?.toString()??"",ct=re.orderValueCurrency,Ts=re.orderValue.total;return ce&&!B[ce]&&(B[ce]={}),ct&&(B[ce]=q(Y({},B[ce]),{[ct]:Ts})),B},{}),j=Object.keys(y).map(B=>{let re=y[B];return Y({name:B},re)}),A=i==="date"&&C.length===1?"bar":"area";return{period:i,preset:A,hasData:E,hasInternalPadding:!0,series:T,periods:C,legendItems:S,dateRange:`${n?.fromDate}-${n?.toDate}`,columns:x,rows:j}}createChart(e,t,i,n,s,h){if(t==="date"&&i.length<=1)return this.chartInputs.extend({series:n,plotOptions:{bar:{horizontal:!1}},chart:{parentHeightOffset:0,height:e?"400":"240",stacked:!0,events:{click:()=>{h||this.onChartClicked()}}},xAxis:{type:"category",categories:i,axisBorder:{show:e,color:te("darkerGrey")},axisTicks:{show:!0,color:te("darkerGrey")},labels:{show:!0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200}},tooltip:{enabled:!1}},yAxis:{show:!1},tooltip:{followCursor:!0,intersect:!1,shared:!0,x:{show:!0}},legend:{show:!1},fill:{opacity:1},colors:s.map(T=>T.color)},this.chartInputs.bar);let S=t==="date"||t==="weekStarting"||t==="month";return this.chartInputs.extend({chart:{parentHeightOffset:0,height:e?"400":"240",events:{click:()=>{h||this.onChartClicked()}}},labels:S?i:void 0,xAxis:{type:S?"datetime":"category",categories:S?void 0:i,axisBorder:{show:e,color:te("darkerGrey")},axisTicks:{show:!0,color:te("darkerGrey")},labels:{show:!0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200},formatter:T=>t==="month"?`${this.dateService.transform(new Date(T),{hideTime:!0,hideDate:!0})??`${T}`}`:t==="weekStarting"||t==="date"?`${this.dateService.transform(new Date(T),{hideTime:!0})??`${T}`}`:`${T}`,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm"}},group:{style:{fontWeight:200}},tooltip:{enabled:!1}},yAxis:{show:!1},tooltip:{x:{show:!0,formatter:(T,E)=>{if(t==="month")return`${this.dateService.transform(new Date(T),{hideTime:!0,hideDate:!0})??`${T}`}`;if(t==="weekStarting"){let x=new Date(T),C=Gt(x,6);return this.dateService.transformDateRange({start:x,end:C},{hideTime:!0})}return t==="date"?this.dateService.transform(new Date(T),{hideTime:!0})??T:t==="dayOfWeekNumber"&&typeof T=="number"?i[E.dataPointIndex]??`${T}`:`${T}`}}},legend:{show:!1},series:n,stroke:{curve:"straight"},fill:{type:"gradient",gradient:{opacityFrom:.2,opacityTo:.4}},colors:s.map(T=>T.color)},this.chartInputs.area)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-financials-value-costs"]],hostAttrs:[1,"ww-analytics-financials-value-costs"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-financials-value-costs-dimensions",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],["preset","bar",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Cc,1,1,"ww-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.dimensionsFormControl)("data",i.dimensions)("pluckLabel",i.pluckDimensionsLabel)("searchable",!1)("wwEventLogger","updated_analytics_dimension")("wwEventLoggerPluckControlParams",i.pluckDimensionEventLoggerParams),l(),_((n=r(10,25,i.chart$))?9:-1,n)}},dependencies:[be,Te,Me,X,Ie,Ne,_e,k],encapsulation:2,changeDetection:0})}}return a})();function gc(a,d){if(a&1&&(u(0,"ww-select",2),R("click",function(t){return t.stopPropagation()}),m()),a&2){let e=f();p("formControl",e.metricsFormControl)("data",e.metrics)("pluckLabel",e.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",e.pluckEventLoggerParams)}}function _c(a,d){a&1&&v(0,"ww-chart",3),a&2&&p("options",d)}function Sc(a,d){if(a&1&&(g(0,_c,1,1,"ww-chart",3),o(1,"async")),a&2){let e,t=f();_((e=r(1,1,t.chart$))?0:-1,e)}}function vc(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",5),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f(2);return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f(2);return U(i.onTitleClicked())}),m()}if(a&2){let e=f(2);p("data",d)("hiddenRowCount",r(1,3,e.hiddenRowCount$))("fullscreen",r(2,5,e.fullscreen$))}}function Ac(a,d){if(a&1&&(g(0,vc,3,7,"ww-bar-chart",4),o(1,"async")),a&2){let e,t=f();_((e=r(1,1,t.bars$))?0:-1,e)}}var na=(()=>{class a extends J{constructor(){super(),this.durationService=w(We),this.chartId="input-field",this.hash=null,this.hash$=this.observe("hash"),this.metrics=Vi,this.metricsFormControl=new Oe("numVisits",{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricsLabel=e=>Z[e],this.pluckEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForDataFields)),this.dataMap$=D([this.fullscreen$,this.analyticsService.reportDataForDataFields$,this.hash$,this.metric$]).pipe(c(([e,t,i,n])=>this.createDataMap(e,t,i,n))),this.isCheckbox$=this.dataMap$.pipe(c(e=>e.isCheckbox)),this.chart$=this.dataMap$.pipe(c(e=>this.createChart(e.isCheckbox,e.series,e.legendItems))),this.title$=this.dataMap$.pipe(c(e=>e.title?e.title:$localize`Unknown input field`)),this.tooltip$=b($localize`The input field charts show a breakdown of the input values per custom input field.
92
93The metrics include:
94
95- Total visits
96- Bookings
97- Waitlisted parties
98- Waitlisted bookings
99- Dropoff
100- Served
101- Completed
102- No-show
103- Cancelled
104- Removed
105- Avg wait duration
106- Avg serve duration`),this.bars$=this.dataMap$.pipe(c(e=>e.isCheckbox?null:e.rows.map(t=>{let i=t.name,n=t.metricValue??void 0,h=this.getFormatter(e.metric)(n);return{key:t.name,label:i,formattedValue:h,values:[{label:i,value:n,formattedValue:h}]}}))),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount??0)),this.columns=[{key:"name",label:$localize`Value`,sortable:!0}
106,{key:"numVisits",label:Z.numVisits,sortable:!0},{key:"numRegistrations.booking",label:Z["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:Z["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:Z["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:Z.numDropoff,sortable:!0},{key:"numServed",label:Z["numServed.total"],sortable:!0},{key:"numNoShowed",label:Z["numNoShowed.total"],sortable:!0},{key:"numCancelled",label:Z["numCancelled.total"],sortable:!0},{key:"numRemoved",label:Z["numRemoved.total"],sortable:!0},{key:"avgWaitDuration",label:Z.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:Z.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:Z.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:Z.maxServeDuration,sortable:!0}],this.subscribe()}ngOnInit(){super.ngOnInit();let e=this.analyticsService.getInitialFormControlValue(`field-metric-${this.hash}`,"numVisits",Kt);e&&this.metricsFormControl.setValue(e)}onTitleClicked(){return pt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$),i=yield Ee(this.hash$);i?this.router.navigateByUrl(`/account/analytics/${t}/${this.chartId}/${i}${window.location.search}`):this.router.navigateByUrl(`/account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return pt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$),n=yield Ee(this.hash$);n?this.router.navigateByUrl(`/account/analytics/${i}/${this.chartId}/${n}${window.location.search}`):this.router.navigateByUrl(`/account/analytics/${i}/${this.chartId}${window.location.search}`)})}subscribe(){this.hash$.pipe(Ke(le),Xe(this.ngOnDestroy$)).subscribe(e=>this.persistObservableInQueryString(this.metric$,`field-metric-${e}`))}getFormatter(e){switch(e){case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t=>t==null?"-":t>0?this.durationService.transform(t):"-";default:return t=>t==null?"-":`${Math.ceil(t)}`}}displayName(e){return e===!0||e==="true"?$localize`Yes`:e===!1||e==="false"?$localize`No`:e?`${e}`:$localize`Unknown`}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i,n){let s=(t?.data||[]).filter(C=>C.dataFieldNameHashed===i&&le(C.dataFieldValues)&&`${C.dataFieldValues}`.length>0).sort((C,y)=>this.displayName(C.dataFieldValues).localeCompare(this.displayName(y.dataFieldValues))).sort((C,y)=>y.numVisits-C.numVisits);if(!i||!t||s.length===0)return{isCheckbox:!1,title:"",metric:n,series:[],legendItems:[],hideLegend:!0,dateRange:"",columns:this.columns,rows:[],pluckCellLabel:()=>({})};let h=e?s:s.slice(0,Ai),S=s.length-h.length,T=h.map(C=>({name:this.displayName(C.dataFieldValues),metricValue:this.getValue(n,C),numVisits:C.numVisits,"numRegistrations.booking":C.numRegistrations.booking,"numRegistrations.waitlist":C.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":C.numRegistrations.waitlistedBooking,numDropoff:C.numDropoff,numServed:C.numServed.total,numCompleted:C.numCompleted.total,numNoShowed:C.numNoShowedByVisitType.total,numCancelled:C.numCancelledByVisitType.total,numRemoved:C.numRemovedByVisitType.total,avgWaitDuration:(C.avgWaitDuration??0)>0?this.durationService.transform(C.avgWaitDuration):"-",avgServeDuration:(C.avgServeDuration??0)>0?this.durationService.transform(C.avgServeDuration):"-",maxWaitDuration:(C.maxWaitDuration??0)>0?this.durationService.transform(C.maxWaitDuration):"-",maxServeDuration:(C.maxServeDuration??0)>0?this.durationService.transform(C.maxServeDuration):"-"})),E=T.map(C=>C.metricValue??0),x=h?.[0]?.dataFieldType==="CHECKBOX";return{hasData:oe(E)>0,isCheckbox:x,title:h?.[0]?.dataFieldName,metric:n,series:E,hideLegend:!x,isDonutChart:x,legendItems:x?T.map((C,y)=>({color:y===0?z["input-field-yes"]:z["input-field-no"],label:C.name,key:C.name})):[],dateRange:`${t.fromDate}-${t.toDate}`,columns:this.columns,rows:T,hiddenRowCount:S,pluckCellLabel:C=>
106this.columns.reduce((y,j)=>{let A=jt(C,j.key);return q(Y({},y),{[j.key]:Je({content:`${A}`,$element:{typography:"body1"}})})},{})}}createChart(e,t,i){return e?Bt(this.chartInputs,t,i.map(n=>n.color),i.map(n=>n.label),()=>this.onChartClicked(),this.breakpoints.isBelowMobile):this.chartInputs.bar}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-input-field"]],hostAttrs:[1,"ww-analytics-input-field"],inputs:{hash:"hash"},standalone:!1,features:[I],decls:13,vars:24,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-input-field-metrics",3,"formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[1,"ww-analytics-select","ww-analytics-input-field-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],["preset","donut",3,"options"],[3,"data","hiddenRowCount","fullscreen"],[3,"chartClicked","linkClicked","data","hiddenRowCount","fullscreen"]],template:function(t,i){t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select"),g(8,gc,1,6,"ww-select",1),o(9,"async"),m(),g(10,Sc,2,3),o(11,"async"),ke(12,Ac,2,3),m()),t&2&&(p("chartTitle",r(1,8,i.title$))("tooltip",r(2,10,i.tooltip$))("loading",r(3,12,i.loading$))("dataMap",r(4,14,i.dataMap$))("isFullscreen",r(5,16,i.fullscreen$))("showTable",r(6,18,i.fullscreen$)),l(8),_(r(9,20,i.hasData$)?8:-1),l(2),_(r(11,22,i.isCheckbox$)?10:12))},dependencies:[be,Te,Me,X,Ie,Ne,xe,_e,k],encapsulation:2,changeDetection:0})}}return a})();function Tc(a,d){a&1&&v(0,"ww-chart",2),a&2&&p("options",d)}var oa=(()=>{class a extends J{constructor(){super(),this.dateService=w(pi),this.decimalPipe=w(se),this.locationRx=w(St),this.chartId="line-length",this.periods=vi,this.periodsFormControl=new Oe("hourOfDay",{nonNullable:!0}),this.period$=Ye(this.periodsFormControl),this.pluckPeriodLabel=e=>on[e],this.pluckEventLoggerParams=e=>({chart_period:e,chart_type:this.chartId}),this.response$=this.period$.pipe(ne(e=>e==="dayOfWeek"?this.analyticsService.reportDataByDayOfWeek$:e==="hourOfDay"?this.analyticsService.reportData$:e==="week"?this.analyticsService.reportDataByWeek$:e==="month"?this.analyticsService.reportDataByMonth$:this.analyticsService.reportDataByDate$),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.hoursByWeekday$=this.response$.pipe(c(e=>e?.locationIds??[]),ne(e=>this.locationRx.getLocationsByIds(e,["hours"])),c(e=>e.map(({hours:t})=>t).filter(le))),this.loading$=this.period$.pipe(ne(e=>e==="dayOfWeek"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDayOfWeek)):e==="hourOfDay"?this.analyticsService.loadingState$.pipe(c(t=>t.reportData)):e==="week"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByWeek)):e==="month"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByMonth)):this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDate))),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.dataMap$=D([this.period$,this.response$,this.hoursByWeekday$,this.fullscreen$]).pipe(c(([e,t,i,n])=>this.createDataMap(e,t,i,n))),this.chart$=D([this.period$,this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i,n])=>this.createChart(t,e,i.maxLineLength,i.avgLineLength,i.labels,n))),this.title$=b($localize`Line length`),this.tooltip$=b($localize`A trend over time of the average length of the waitlist and the longest length of the waitlist.
107
108- Avg line length: The average starting position of all visits that were added to the waitlist. Assigned to the date the visit was waitlisted.
109- Max line length: The longest starting position of all visits that were added to the waitlisted. Assigned to the date the visit was waitlisted.
110
111The dropdown list at the top right of the chart allows you to select different time breakouts:
112
113- Hour of day (default): The average line length and longest line length by hour of day across the time range selected.
114- Date: The average line length and longest line length by day across the time range selected.
115- Day of week: The average line length and longest line length by day of week across the time range selected.`),this.subscribe()}ngOnInit(){super.ngOnInit();let e=this.analyticsService.getInitialFormControlValue("line-length-period","hourOfDay",rn);e&&this.periodsFormControl.setValue(e)}
115subscribe(){this.persistObservableInQueryString(this.period$,"line-length-period")}getHourFormat(e,t){let i=this.dateService.transform(`2001-01-01T${e<10?"0"+e:e}:00`,{hideDate:!0})??`${e}:00`;return t?i:i.replace(":00","")}createDataMap(e,t,i,n){if(!t)return{maxLineLength:[],avgLineLength:[],labels:[],legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let s=[{key:"maxLineLength",label:$localize`Max line length`,color:z["line-length-max"]},{key:"avgLineLength",label:$localize`Avg line length`,color:z["line-length-avg"]}],h=[{key:"period",label:$localize`Period`,sortable:!0},{key:"maxLineLength",label:$localize`Max line length`,sortable:!0},{key:"avgLineLength",label:$localize`Avg line length`,sortable:!0}];if(e==="hourOfDay"){let C=ln(i)??{first:0,last:23},y=Se(t?.data)[0],j=ts([y?.maxLineLengthByHourOfDay??[],y?.avgLineLengthByHourOfDay??[]]);j.first>=0&&j.first<C.first&&(C.first=j.first),j.last>=0&&j.last>C.last&&(C.last=j.last);let A={maxLineLength:[],avgLineLength:[],labels:this.analyticsService.hoursOfDay.map(B=>this.getHourFormat(B,n)).slice(C.first,C.last+1),legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:[]};return y&&(A.maxLineLength=y.maxLineLengthByHourOfDay.slice(C.first,C.last+1),A.avgLineLength=y.avgLineLengthByHourOfDay.slice(C.first,C.last+1)),q(Y({},A),{hasData:oe(A.maxLineLength)>0||oe(A.avgLineLength)>0,hasInternalPadding:!0,rows:A.labels.map((B,re)=>({period:{value:B,sortableValue:re},maxLineLength:A.maxLineLength[re],avgLineLength:A.avgLineLength[re]}))})}if(e==="dayOfWeek"){let C=Se(t?.data).filter(j=>j.dayOfWeekNumber>0).sort((j,A)=>j.dayOfWeekNumber>A.dayOfWeekNumber?1:-1),y={maxLineLength:C.map(j=>j.maxLineLength),avgLineLength:C.map(j=>j.avgLineLength),labels:C.map(j=>Vt(j.dayOfWeek)),legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:[]};return q(Y({},y),{hasData:oe(y.maxLineLength)>0||oe(y.avgLineLength)>0,hasInternalPadding:!0,rows:y.labels.map((j,A)=>({period:{value:j,sortableValue:A},maxLineLength:y.maxLineLength[A],avgLineLength:y.avgLineLength[A]}))})}let S=Se(t?.data).filter(C=>e==="week"?(C.weekStarting??"").length>0:e==="month"?(C.month??"").length>0:(C.date??"").length>0),T=S.map(C=>e==="week"?C.weekStarting:e==="month"?`${C.month}-01`:C.date),E=S.map(C=>{let y=C.date;return e==="week"?y=C.weekStarting:e==="month"&&(y=C.month),{period:{value:this.dateService.transform(y,{hideTime:!0})??y,sortableValue:y},maxLineLength:C.maxLineLength,avgLineLength:C.avgLineLength}}),x={maxLineLength:E.map(C=>C.maxLineLength),avgLineLength:E.map(C=>C.avgLineLength),labels:T,legendItems:s,dateRange:`${t.fromDate}-${t.toDate}`,columns:h,rows:E};return q(Y({},x),{hasData:oe(x.maxLineLength)>0||oe(x.avgLineLength)>0,hasInternalPadding:!0})}createChart(e,t,i,n,s,h){let S={bar:{borderRadius:4}};this.breakpoints.isAboveMobile&&(t==="dayOfWeek"||t==="month")&&(S=q(Y({},S),{bar:q(Y({},S.bar),{columnWidth:"32"})}));let T=t==="date"||t==="week",E=s.map(x=>t==="hourOfDay"&&typeof x=="number"?this.getHourFormat(x,!this.dateService.isAmPm):x);return this.chartInputs.extend({plotOptions:S,legend:{show:!1},series:[{name:$localize`Max line length`,type:"column",data:i,color:z["line-length-max"]},{name:$localize`Avg line length`,type:"line",data:n,color:z["line-length-avg"]}],stroke:{width:[0,4],curve:"straight"},dataLabels:{enabled:!T||i.length<=31,enabledOnSeries:[1],style:{fontSize:"11px"},background:{borderRadius:4,padding:4}},labels:T?s.map(x=>`${x}`):void 0,xAxis:{type:T?"datetime":"category",categories:E,labels:{show:!0,rotate:0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200},formatter:x=>t==="hourOfDay"&&typeof x=="number"?this.getHourFormat(x,e):t==="month"?`${this.dateService.transform(new Date(x),{hideTime:!0,hideDate:!0})??`${x}`}`:t==="week"||t==="date"?`${this.dateService.transform(new Date(x),{hideTime:!0})??`${x}`}`:`${x}`,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm"}},axisBorder:{show:!1},axisTicks:{show:!1},tooltip:{enabled:!1}},yAxis:{axisBorder:{show:!1},axisTicks:{show:!1},labels:{show:!1,formatter:x=>this.decimalPipe.transform(x)??"",style:{colors:te("darkerGrey")}}},tooltip:{x:{show:!0,formatter:(x,C)=>{if(!x||typeof x!="number")return`${x}`;if(t==="hourOfDay")return`${this.getHourFormat(C.dataPointIndex,!this.dateService.isAmPm)}`;if(t==="dayOfWeek")return`${s[C.dataPointIndex]}`;if(t==="month")return`${this.dateService.transform(s[C.dataPointIndex],{hideTime:!0,hideDate:!0})??`${x}`}`;if(t==="week"){let y=new Date(x),j=Gt(y,6);return this.dateService.transformDateRange({start:y,end:j},{hideTime:!0})}return t==="date"?this.dateService.transform(new Date(x),{hideTime:!0})??x:`${x}`}}
115},chart:{parentHeightOffset:0,height:e?"400":"240",events:{click:()=>{h||this.onChartClicked()}}},responsive:[]},this.chartInputs.line)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-line-length"]],hostAttrs:[1,"ww-analytics-line-length"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","dataMap","loading","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-line-length-period",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],["preset","line",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Tc,1,1,"ww-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("dataMap",r(3,17,i.dataMap$))("loading",r(4,19,i.loading$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.periodsFormControl)("data",i.periods)("pluckLabel",i.pluckPeriodLabel)("searchable",!1)("wwEventLogger","updated_analytics_period")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),_((n=r(10,25,i.chart$))?9:-1,n)}},dependencies:[be,Te,Me,X,Ie,Ne,_e,k],styles:[`.ww-analytics-line-length .apexcharts-xaxis-label{text-transform:uppercase;font-weight:200}
116/*noopline-length.component-Y5WKJEKL.css.map */
117`],encapsulation:2,changeDetection:0})}}return a})();function $c(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var ra=(()=>{class a extends J{constructor(){super(),this.chartId="message-details",this.levelOfDetails=je()(["channels","state","type","recipient"]),this.levelOfDetailFormControl=new Oe(this.analyticsService.getInitialFormControlValue("message-detail-lod","channels",is),{nonNullable:!0}),this.levelOfDetail$=Ye(this.levelOfDetailFormControl),this.pluckLevelOfDetailLabel=e=>Rn[e],this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForMessageDetails)),this.dataMap$=this.levelOfDetail$.pipe(ne(e=>D([this.analyticsService.reportDataForMessageDetails$,b(e)])),c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Message details`),this.tooltip$=b($localize`In the Message details bar chart, you'll find a summary of the different message breakdowns. Where possible it details out the messages vs the message segments.
118
119- Channels: Breakdown of the channel of the message (email, SMS, app, call)
120- State: Breakdown of the state of the message (delivered, blocked, failed, pending, received)
121- Type: Breakdown of incoming vs outgoing messages
122- Recipient: Breakdown of who sent/received the messages (customers or user)`),this.bars$=this.dataMap$.pipe(c(e=>e.rows.map(t=>{let i="segments"in t&&le(t.segments)?t.segments:t.messages,n=["segments"in t&&le(t.segments)&&t.segments>t.messages?{label:$localize`Segments`,value:t.segments-t.messages,formattedValue:`${t.segments}`,color:z["message-details-segments"]}:null,{label:$localize`Messages`,value:t.messages,formattedValue:`${t.messages}`,color:z["message-details-messages"]}].filter(le),s=["segments"in t&&le(t.segments)?{label:$localize`Segments`,value:t.segments-t.messages,formattedValue:`${t.segments}`,color:z["message-details-segments"]}:null,{label:$localize`Messages`,value:t.messages,formattedValue:`${t.messages}`,color:z["message-details-messages"]}].filter(le);return{key:t.key,label:t.name,formattedValue:`${i}`,values:n,tooltips:s}}))),this.subscribe()}subscribe(){this.levelOfDetail$.pipe(Xe(this.ngOnDestroy$)).subscribe(e=>{this.analyticsService.setMessageDetailsMetrics(pn[e])}
122),this.persistObservableInQueryString(this.levelOfDetail$,"message-detail-lod")}createDataMap(e,t){let i=e?.data?.[0];if(!i)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n=[{key:"name",label:Rn[t],sortable:!0},{key:"messages",label:$localize`Messages`,sortable:!0},{key:"segments",label:$localize`Segments`,sortable:!0}];if(t==="state"){let h=[i.numMessagesByState.delivered,i.numMessagesByState.blocked,i.numMessagesByState.failed,i.numMessagesByState.pending,i.numMessagesByState.received,i.numMessagesByState.other,i.numMessageSegmentsByState.delivered,i.numMessageSegmentsByState.blocked,i.numMessageSegmentsByState.failed,i.numMessageSegmentsByState.pending,i.numMessageSegmentsByState.received,i.numMessageSegmentsByState.other];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:Xt.delivered,label:dt.delivered,key:"delivered"},{color:Xt.blocked,label:dt.blocked,key:"blocked"},{color:Xt.failed,label:dt.failed,key:"failed"},{color:Xt.pending,label:dt.pending,key:"pending"}
122,{color:Xt.pending,label:dt.pending,key:"pending"},{color:Xt.received,label:dt.received,key:"received"},{color:Xt.other,label:dt.other,key:"other"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"delivered",name:dt.delivered,messages:i.numMessagesByState.delivered,segments:i.numMessageSegmentsByState.delivered},{key:"blocked",name:dt.blocked,messages:i.numMessagesByState.blocked,segments:i.numMessageSegmentsByState.blocked},{key:"failed",name:dt.failed,messages:i.numMessagesByState.failed,segments:i.numMessageSegmentsByState.failed},{key:"pending",name:dt.pending,messages:i.numMessagesByState.pending,segments:i.numMessageSegmentsByState.pending},{key:"received",name:dt.received,messages:i.numMessagesByState.received,segments:i.numMessageSegmentsByState.received},{key:"other",name:dt.other,messages:i.numMessagesByState.other,segments:i.numMessageSegmentsByState.other}]}}if(t==="type"){let h=[i.numMessagesByIncomingOutgoing.outgoing,i.numMessagesByIncomingOutgoing.incoming,i.numMessageSegmentsByIncomingOutgoing.outgoing,i.numMessageSegmentsByIncomingOutgoing.incoming];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:Wn.outgoing,label:Pi.outgoing,key:"outgoing"},{color:Wn.incoming,label:Pi.incoming,key:"incoming"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"outgoing",name:Pi.outgoing,messages:i.numMessagesByIncomingOutgoing.outgoing,segments:i.numMessageSegmentsByIncomingOutgoing.outgoing},{key:"incoming",name:Pi.incoming,messages:i.numMessagesByIncomingOutgoing.incoming,segments:i.numMessageSegmentsByIncomingOutgoing.incoming}]}}if(t==="recipient"){let h=[i.numMessagesByRecipient.guest,i.numMessagesByRecipient.user,i.numMessageSegmentsByRecipient.guest,i.numMessageSegmentsByRecipient.user];return{hasData:oe(h)>0,hideLegend:!0,legendItems:[{color:xn.guest,label:zi.guest,key:"guest"},{color:xn.user,label:zi.user,key:"user"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"guest",name:zi.guest,messages:i.numMessagesByRecipient.guest,segments:i.numMessageSegmentsByRecipient.guest},{key:"user",name:zi.user,messages:i.numMessagesByRecipient.user,segments:i.numMessageSegmentsByRecipient.user}]}}let s=[i.numMessagesByChannel.email,i.numMessagesByChannel.sms,i.numMessagesByChannel.app,i.numMessagesByChannel.call,i.numMessagesByChannel.other,i.numMessageSegmentsByChannel.sms];return{hasData:oe(s)>0,hideLegend:!0,legendItems:[{color:bi.email,label:$t.email,key:"email"},{color:bi.sms,label:$t.sms,key:"sms"},{color:bi.app,label:$t.app,key:"app"},{color:bi.call,label:$t.call,key:"call"},{color:bi.other,label:$t.other,key:"other"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:[{key:"email",name:$t.email,messages:i.numMessagesByChannel.email},{key:"sms",name:$t.sms,messages:i.numMessagesByChannel.sms,segments:i.numMessageSegmentsByChannel.sms},{key:"app",name:$t.app,messages:i.numMessagesByChannel.app},{key:"call",name:$t.call,messages:i.numMessagesByChannel.call},{key:"other",name:$t.other,messages:i.numMessagesByChannel.other}]}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-message-details"]],hostAttrs:[1,"ww-analytics-message-details"],standalone:!1,features:[I],decls:11,vars:25,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-message-details-level-of-detail",3,"click","formControl","data","pluckLabel","searchable"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,$c,2,4,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,11,i.title$))("tooltip",r(2,13,i.tooltip$))("loading",r(3,15,i.loading$))("dataMap",r(4,17,i.dataMap$))("isFullscreen",r(5,19,i.fullscreen$))("showTable",r(6,21,i.fullscreen$)),l(8),p("formControl",i.levelOfDetailFormControl)("data",i.levelOfDetails)("pluckLabel",i.pluckLevelOfDetailLabel)("searchable",!1),l(),_((n=r(10,23,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,xe,_e,k],styles:[`.ww-analytics-message-details .ww-analytics-message-details-tooltip{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);
122font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing)}
123/*noopmessage-details.component-2ZPYMPYV.css.map */
124`],encapsulation:2,changeDetection:0})}}return a})();function Lc(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var sa=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="message-recipient",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.guest,e.user],e.legendItems))),this.title$=b($localize`Message recipient`),this.tooltip$=b($localize`The recipient chart shows a breakdown of messages by recipient (Guest, User). This includes incoming and outgoing messages to any recipient regardless of delivery state.`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{hasData:!0,guest:0,user:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Channel`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}];return{hasData:t.numMessagesByRecipient.guest+t.numMessagesByRecipient.user>0,guest:t.numMessagesByRecipient.guest,user:t.numMessagesByRecipient.user,isDonutChart:!0,legendItems:[{color:z["message-recipient-guest"],label:$localize`Guest`,key:"guest"},{color:z["message-recipient-user"],label:$localize`User`,key:"user"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`Guest`,count:t.numMessagesByRecipient.guest},{name:$localize`User`,count:t.numMessagesByRecipient.user}]}}createChart(e,t){return Bt(this.chartInputs,e,t.map(i=>i.color),t.map(i=>i.label),()=>this.onChartClicked(),this.breakpoints.isBelowMobile)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-message-recipient"]],hostAttrs:[1,"ww-analytics-message-recipient"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","donut",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Lc,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function Rc(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var la=(()=>{class a extends J{constructor(){super(...arguments),this.chartId="message-type",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData)),this.dataMap$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=this.dataMap$.pipe(c(e=>this.createChart([e.incoming,e.outgoing],e.legendItems))),this.title$=b($localize`Message type`),this.tooltip$=b($localize`The Message type chart shows a breakdown of messages by incoming vs outgoing. This includes all channels and recipients, regardless of delivery state.`)}createDataMap(e){let t=e?.data?.[0];if(!t)return{incoming:0,outgoing:0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let i=[{key:"name",label:$localize`Type`,sortable:!0},{key:"count",label:$localize`Count`,sortable:!0}],n=[t.numMessagesByIncomingOutgoing.incoming,t.numMessagesByIncomingOutgoing.outgoing];return{hasData:oe(n)>0,incoming:t.numMessagesByIncomingOutgoing.incoming,outgoing:t.numMessagesByIncomingOutgoing.outgoing,isDonutChart:!0,legendItems:[{color:z["message-type-incoming"],label:$localize`Incoming`,key:"incoming"},{color:z["message-type-outgoing"],label:$localize`Outgoing`,key:"outgoing"}],dateRange:`${e.fromDate}-${e.toDate}`,columns:i,rows:[{name:$localize`Incoming`,count:t.numMessagesByIncomingOutgoing.incoming},{name:$localize`Outgoing`,count:t.numMessagesByIncomingOutgoing.outgoing}]}}createChart(e,t){return Bt(this.chartInputs,e,t.map(i=>i.color),t.map(i=>i.label),()=>this.onChartClicked(),this.breakpoints.isBelowMobile)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-message-type"]],hostAttrs:[1,"ww-analytics-message-type"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","donut",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Rc,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function us(a){return je()(["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]).includes(a)}var Lt={numVisits:$localize`All visits`,totalWaitlist:$localize`Waitlisted`,totalBookings:$localize`Bookings`,numServed:$localize`Served`,numDropoff:$localize`Dropoff`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,maxWaitDuration:$localize`Longest wait`,maxServeDuration:$localize`Longest serve duration`};var Qt=(()=>{class a extends J{constructor(){super(...arguments),this.hash=null,this.hash$=this.observe("hash"),this.categoryName=null,this.categoryName$=this.observe("categoryName"),this.durationService=w(We),this.columns$=Ot(()=>this.categoryName$).pipe(c(e=>[{key:"name",label:e,sortable:!0},{key:"numVisits",label:Lt.numVisits,sortable:!0},{key:"totalWaitlist",label:Lt.totalWaitlist,sortable:!0},{key:"totalBookings",label:Lt.totalBookings,sortable:!0},{key:"numServed",label:Lt.numServed,sortable:!0},{key:"numDropoff",label:Lt.numDropoff,sortable:!0},{key:"avgWaitDuration",label:Lt.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:Lt.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:Lt.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:Lt.maxServeDuration,sortable:!0}])),this.loading$=Ot(()=>this.loadingSource$),this.dataMap$=D([this.fullscreen$,Ot(()=>this.dataSource$),this.hash$,this.columns$,Ot(()=>this.primaryMetric$)]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=this.categoryName$.pipe(c(e=>e??"")),this.bars$=this.dataMap$.pipe(c(e=>{let t=this.getFormatter(e.metric);return e.rows.map(i=>{let n=i.name??$localize`<No value>`,s=i[e.metric],h=t(s);return{key:i.name,label:n,formattedValue:h,values:[{label:n,value:s,formattedValue:t(s)}]}})})),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount)),this.metrics=je()(["numVisits","totalWaitlist","totalBookings","numServed","numDropoff","avgWaitDuration","avgServeDuration","maxWaitDuration","maxServeDuration"]),this.primaryMetricsF
124ormControl=new Oe("numVisits",{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>Lt[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId})}onTitleClicked(){return pt(this,null,function*(){if(yield Ee(this.fullscreen$))return;let t=yield Ee(this.currentTab$),i=yield Ee(this.hash$);i?this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}/${i}${window.location.search}`):this.router.navigateByUrl(`account/analytics/${t}/${this.chartId}${window.location.search}`)})}onChartClicked(){return pt(this,null,function*(){if((yield Ee(this.fullscreen$))||(yield Ee(this.breakpoints.isBelowMobile$)))return;let i=yield Ee(this.currentTab$),n=yield Ee(this.hash$);n?this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}/${n}${window.location.search}`):this.router.navigateByUrl(`account/analytics/${i}/${this.chartId}${window.location.search}`)})}getFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":case"maxWaitDuration":case"maxServeDuration":return t=>t>0?this.durationService.transform(t):"-";default:return t=>`${typeof t=="number"?Math.ceil(t):t}`}}createDataMap(e,t,i,n,s){let h=(t?.data||[]).filter(y=>le(y[this.nameColumn])&&`${y[this.nameColumn]}`.length>0);if(!t||h.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:n,rows:[],hiddenRowCount:0,pluckCellLabel:()=>({}),metric:s};let T=(i!==null&&this.idColumn!==null?h.filter(y=>this.idColumn!==null&&y[this.idColumn]===i):h).map(y=>({name:y[this.nameColumn]??"",numVisits:y.numVisits??0,totalWaitlist:y.totalWaitlist??0,totalBookings:y.totalBookings??0,numServed:y.numServed?.total??0,numDropoff:y.numDropoff??0,avgWaitDuration:y.avgWaitDuration??0,avgServeDuration:y.avgServeDuration??0,maxWaitDuration:y.maxWaitDuration??0,maxServeDuration:y.maxServeDuration??0})).sort(qe("name")).sort((y,j)=>j.numVisits-y.numVisits),E=e?T:T.slice(0,Ai),x=T.length-E.length,C=E.map((y,j)=>({color:Ct(j),label:y.name,key:y.name}));return{hasData:E.length>0,hideLegend:!0,legendItems:C,dateRange:`${t.fromDate}-${t.toDate}`,columns:n,rows:E,hiddenRowCount:x,pluckCellLabel:y=>n.reduce((j,A)=>q(Y({},j),{[A.key]:Je({content:A.key==="avgWaitDuration"||A.key==="avgServeDuration"||A.key==="maxWaitDuration"||A.key==="maxServeDuration"?y[A.key]>0?this.durationService.transform(y[A.key]):"-":y[A.key],$element:{typography:"body1"}})}),{}),metric:s}}ngOnInit(){super.ngOnInit(),this.subscribe()}subscribe(){this.hash$.pipe(Xe(this.ngOnDestroy$)).subscribe(e=>{let t=e&&e.length>0?`${this.chartId}-${e}-metric`:`${this.chartId}-metric`;this.persistObservableInQueryString(this.primaryMetric$,t),this.primaryMetricsFormControl.setValue(this.analyticsService.getInitialFormControlValue(t,"numVisits",us),{emitEvent:!1})})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275dir=si({type:a,inputs:{hash:"hash",categoryName:"categoryName"},features:[I]})}}return a})();function xc(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",d)("fullscreen",r(2,5,e.fullscreen$))}}var ca=(()=>{class a extends Qt{constructor(){super(...arguments),this.chartId="operations-resources",this.type="resources",this.idColumn="resourceCategoryNameHashed",this.nameColumn="resourceName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.resourcesReportData)),this.dataSource$=this.analyticsService.resourcesReportData$,this.tooltip$=b($localize`The Resource category bar charts show the top resources within the resource category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
125
126The Resource category table shows the top resources within the resource category ordered by the number of served visits. The metrics available by resource include: Waitlisted, Bookings, Served, No-shows, Cancelled.`),this.title$=D([this.dataSource$,this.hash$]).pipe(c(([e,t])=>{let i=Se(e?.data).filter(n=>n.resourceCategoryNameHashed===t&&n.resourceCategoryName&&n.resourceCategoryName.length>0);return i.length<1?$localize`Unknown category`:i[0].resourceCategoryName})),this.categoryName$=b($localize`Resource`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-operations-resources"]],hostAttrs:[1,"ww-analytics-operations-resources","ww-analytics-operations-table"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,xc,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsF
126ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
127/*noopoperations-table-base-5234GOFA.css.map */
128`],encapsulation:2,changeDetection:0})}}return a})();function Mc(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",d)("fullscreen",r(2,5,e.fullscreen$))}}var pa=(()=>{class a extends Qt{constructor(){super(...arguments),this.chartId="operations-service-combinations",this.type="service-combinations",this.idColumn=null,this.nameColumn="serviceCombinations",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.serviceCombinationsReportData)),this.dataSource$=this.analyticsService.serviceCombinationsReportData$,this.title$=b($localize`Service combinations`),this.tooltip$=b($localize`The Service combinations bar charts show the top service combinations across service category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
129
130The Service combinations table shows the top service combinations across service category ordered by the number of served visits.
131
132The metrics available by service include: Waitlisted, Bookings, Served, No-shows, Cancelled.
133
134The service combinations data will only be meaningful if you allow your customers to select more than one service when registering, thereby creating service combinations. If your business does not allow multiple services, the data in this chart and table will be displayed on a per-service basis instead.`),this.categoryName$=b($localize`Service combination`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-operations-service-combinations"]],hostAttrs:[1,"ww-analytics-operations-service-combinations","ww-analytics-operations-table"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Mc,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
135/*noopoperations-table-base-5234GOFA.css.map */
136`],encapsulation:2,changeDetection:0})}}return a})();function Fc(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",d)("fullscreen",r(2,5,e.fullscreen$))}}var ma=(()=>{class a extends Qt{constructor(){super(...arguments),this.chartId="operations-services",this.type="services",this.idColumn="serviceCategoryNameHashed",this.nameColumn="serviceName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.servicesReportData)),this.dataSource$=this.analyticsService.servicesReportData$,this.tooltip$=b($localize`The Service category bar charts show the top services within the service category ordered by the number of served visits. The bar represents the number of served visits and the dot represents the average serve duration.
137
138The Service category table shows the top services within the service category ordered by the number of served visits. The metrics available by service include: Waitlisted, Bookings, Served, No-shows, Cancelled.`),this.title$=D([this.dataSource$,this.hash$]).pipe(c(([e,t])=>{let i=Se(e?.data).filter(n=>n.serviceCategoryNameHashed===t&&n.serviceCategoryName&&n.serviceCategoryName.length>0);return i.length<1?$localize`Unknown category`:i[0].serviceCategoryName})),this.categoryName$=b($localize`Service`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-operations-services"]],hostAttrs:[1,"ww-analytics-operations-services","ww-analytics-operations-table"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Fc,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsF
138ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
139/*noopoperations-table-base-5234GOFA.css.map */
140`],encapsulation:2,changeDetection:0})}}return a})();function Nc(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("hiddenRowCount",r(1,3,e.hiddenRowCount$))("data",d)("fullscreen",r(2,5,e.fullscreen$))}}var da=(()=>{class a extends Qt{constructor(){super(...arguments),this.chartId="operations-users",this.type="users",this.idColumn=null,this.nameColumn="updatedByName",this.loadingSource$=this.analyticsService.loadingState$.pipe(c(e=>e.usersReportData)),this.dataSource$=this.analyticsService.usersReportData$,this.title$=b($localize`Users`),this.tooltip$=b($localize`Shows the top users by visits served. Bars show served-visit counts; dots show average serve duration.
141
142The table lists the same users with metrics for Waitlisted, Bookings, Served, No-shows, and Cancelled.
143
144All metrics are attributed to the last user who touched the visit.`),this.categoryName$=b($localize`User`)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-operations-users"]],hostAttrs:[1,"ww-analytics-operations-users","ww-analytics-operations-table"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-operations-table-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"hiddenRowCount","data","fullscreen"],[3,"chartClicked","linkClicked","hiddenRowCount","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Nc,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],styles:[`.ww-analytics-operations-table:empty{display:none}.ww-analytics-operations-table .ww-chart-layout .ww-chart-layout-graph{padding:24px 12px 0 0}.ww-analytics-operations-table .ww-table thead th,.ww-analytics-operations-table .ww-table tbody td{padding:0 8px}.ww-analytics-operations-table .ww-table .mat-mdc-row.mat-mdc-row .mat-mdc-cell:last-child{text-align:left}
145/*noopoperations-table-base-5234GOFA.css.map */
146`],encapsulation:2,changeDetection:0})}}return a})();function Pc(a,d){if(a&1&&(u(0,"ww-metric-value",5),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.bookings,"1.0-0"))}}function zc(a,d){a&1&&v(0,"ww-skeleton-placeholder",6)(1,"ww-skeleton-placeholder",6),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function Yc(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,1),o(2,"number"),m()),a&2){f();let e=F(5);l(2),ht(pe(2,1,e==null?null:e.dropoffPercent,"1.0-0")),ft(1)}}function Gc(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,2),m())}var Zn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Bookings: The number of parties that have scheduled appointments for the dates selected. If they were a booking that later turned into waitlisted, they are counted here (not under Waitlisted parties).\r\n\r\nBookings dropoff rate: The percentage of bookings that did not get served because they cancelled or were no-shows.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.bookings,response:t,previous:t?.data[0]?.totalBookings??0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;if(!t)return{bookings:0,dropoff:0,dropoffPercent:0};let i=t.totalBookings,n=t.numNoShowedByVisitType.booking+t.numNoShowedByVisitType.waitlistedBooking+t.numCancelledByVisitType.booking+t.numCancelledByVisitType.waitlistedBooking+t.numRemovedByVisitType.booking+t.numRemovedByVisitType.waitlistedBooking;return{bookings:i,dropoff:n,dropoffPercent:n>0&&i>0?Math.round(n/i*100):0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-bookings"]],hostAttrs:[1,"ww-analytics-overview-bookings"],standalone:!1,decls:11,vars:7,consts:()=>{let e;e=$localize`Bookings`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:% dropped off`;let i;return i=$localize`No dropoffs`,[e,t,i,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",3)(2,"ww-metric")(3,"ww-metric-title",4),ee(4,0),m(),O(5),o(6,"async"),g(7,Pc,5,10,"ww-metric-value",5)(8,zc,2,4),g(9,Yc,3,4,"
146ww-metric-summary")(10,Gc,2,0,"ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(6,4,i.currentData$));l(2),_(n?7:8);let s=(n==null?null:n.dropoffPercent)??null;l(2),_(s&&s>0?9:10)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Hc(a,d){if(a&1&&(u(0,"ww-metric-value",5),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),Ve("",pe(4,7,t.dropoffPercent,"1.0-0"),"%")}}function jc(a,d){a&1&&v(0,"ww-skeleton-placeholder",6)(1,"ww-skeleton-placeholder",6),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function qc(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,1),o(2,"number"),m()),a&2){f(2);let e=F(5);l(2),ht(pe(2,1,e==null?null:e.dropoff,"1.0-0")),ft(1)}}function Kc(a,d){a&1&&(u(0,"ww-metric-summary"),ee(1,2),m())}function Xc(a,d){if(a&1&&g(0,qc,3,4,"ww-metric-summary")(1,Kc,2,0,"ww-metric-summary"),a&2){f();let e=F(9);_(e>0?0:1)}}var Jn=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Dropoff rate: The percentage of registered visits that were cancelled, no-showed, removed (deleted).\r\n\r\nTotal dropoffs: The total number of registered visits that were cancelled, no-showed, or removed (deleted).\r\n\r\nRemoved visits will only show if "Hide deleted visits" is turned off in the analytics filters.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.dropoffPercent,response:t,previous:Math.round((t?.data[0]?.dropoffRatio??0)*100),valueType:"percent",invertNegativeAndPositive:!0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{dropoff:t.numDropoff,dropoffPercent:Math.round(t.dropoffRatio*100)}:{dropoff:0,dropoffPercent:0,noShows:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-dropoff"]],hostAttrs:[1,"ww-analytics-overview-dropoff"],standalone:!1,decls:11,vars:8,consts:()=>{let e;e=$localize`Dropoff rate`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: dropped off`;let i;return i=$localize`No dropoffs`,[e,t,i,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",3)(2,"ww-metric")(3,"ww-metric-title",4),ee(4,0),m(),O(5),o(6,"async"),g(7,Hc,5,10,"ww-metric-value",5)(8,jc,2,4),O(9),g(10,Xc,2,1),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(6,4,i.currentData$));l(2),_(n?7:8),l(2);let s=P((n==null?null:n.dropoffPercent)??null);l(),_(s!==null?10:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function Zc(a,d){if(a&1&&(u(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.messages,"1.0-0"))}}function Jc(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",30)("width",75)}function ep(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,1),o(2,"number"),m()),a&2){f();let e=F(5);l(2),ht(pe(2,1,e.avgMessages,"1.0-1")),ft(1)}}function tp(a,d){a&1&&v(0,"ww-skeleton-placeholder",5),a&2&&p("height",14)("width",130)}var eo=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Messages: The total number of sent and received customer messagess and users across all channels (email, sms, chat) regardless of delivered state.\r\n\r\nAvg messages per visit: The average number of messages sent and received by a single visit.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.messages,response:t,previous:t?.data[0]?.numMessages,withNeutralIndicator:!0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{messages:t.numMessages,avgMessages:t.numVisits>0?Math.ceil(t.numMessages/t.numCreated):0}:{messages:0,avgMessages:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-messages"]],hostAttrs:[1,"ww-analytics-overview-messages"],standalone:!1,decls:11,vars:7,consts:()=>{let e;e=$localize`Messages`;let t;return t=$localize`On avg ${"\uFFFD0\uFFFD"}:INTERPOLATION: message(s) per visit`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),ee(4,0),m(),O(5),o(6,"async"),g(7,Zc,5,10,"ww-metric-value",4)(8,Jc,1,2,"ww-skeleton-placeholder",5),g(9,ep,3,4,"ww-metric-summary")(10,tp,1,2,"ww-skeleton-placeholder",5),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(6,4,i.currentData$));l(2),_(n?7:8),l(2),_(n?9:10)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();var hs={current:100,previous:99,valueType:"percent",negative:!1,positive:!0,percent:1,days:null,range:null,rangeLabel:null},fs={current:99,previous:100,valueType:"percent",negative:!0,positive:!1,percent:1,days:null,range:null,rangeLabel:null};function ap(a,d){a&1&&v(0,"ww-metric-compare",4),a&2&&p("loading",!1)("compare",d)}var to=(()=>{class a extends gt{constructor(){super(...arguments),this.positive=!1,this.positive$=this.observe("positive"),this.compareData$=this.positive$.pipe(c(e=>e?hs:fs))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-placeholder"]],hostAttrs:[1,"ww-analytics-overview-placeholder"],inputs:{positive:"positive"},standalone:!1,features:[I],decls:9,vars:10,consts:[[1,"gap-3",3,"padding"],[3,"height","width"],[1,"flex","flex-col","gap-1"],[1,"flex","gap-2"],[3,"loading","compare"]],template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",0),v(2,"ww-skeleton-placeholder",1),u(3,"div",2)(4,"div",3),v(5,"ww-skeleton-placeholder",1),g(6,ap,1,2,"ww-metric-compare",4),o(7,"async"),m(),v(8,"ww-skeleton-placeholder",1),m()()()),t&2){let n;l(),p("padding","none"),l(),p("height",14)("width",73),l(3),p("height",20)("width",53),l(),_((n=r(7,8,i.compareData$))?6:-1,n),l(2),p("height",8)("width",53)}},dependencies:[Qa,de,me,K,k],encapsulation:2,changeDetection:0})}}return a})();function op(a,d){if(a&1&&(u(0,"ww-metric-value",3),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.served,"1.0-0"))}}function rp(a,d){a&1&&v(0,"ww-skeleton-placeholder",4)(1,"ww-skeleton-placeholder",4),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function sp(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,0),o(2,"number"),m()),a&2){f();let e=F(6);l(2),ht(pe(2,1,e==null?null:e.serveRatio,"1.0-0")),ft(1)}}var io=(()=>{class a{constructor(){this.analyticsService=w(ae),this.locationRx=w(St),this.title$=this.locationRx.getCurrentLocation(["showPartySize"]).pipe(c(e=>e.showPartySize?$localize`Served parties`:$localize`Served`)),this.tooltip=$localize`Served parties: The total number of parties that were served in the time frame selected. This include bookings, waitlisted, and directly served parties.\r\n\r\nServe ratio: The percentage of visits that were served in the time range selected. While it is not common, this can be greater than 100% if enough of the served visits originally registered outside of the time window selected.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.served,response:t,previous:t?.data[0]?.numServed?.total,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return Jt(t?.numServed?.total)||Jt(t.serveRatio)?{served:0,serveRatio:0}:{served:t.numServed.total,serveRatio:Math.round(t.serveRatio*100)}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-served"]],hostAttrs:[1,"ww-analytics-overview-served"],standalone:!1,decls:11,vars:10,consts:()=>{let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:% of visits were served`,[e,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",1)(2,"ww-metric")(3,"ww-metric-title",2),H(4),o(5,"async"),m(),O(6),o(7,"async"),g(8,op,5,10,"ww-metric-value",3)(9,rp,2,4),g(10,sp,3,4,"ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(),we(r(5,5,i.title$)),l(2);let n=P(r(7,7,i.currentData$));l(2),_(n?8:9),l(2),_((n==null?null:n.serveRatio)!==null?10:-1)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function cp(a,d){if(a&1&&(u(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),H(3),o(4,"number"),m()),a&2){let e=f(),t=F(6);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),we(pe(4,7,t.waitlisted,"1.0-0"))}}function pp(a,d){a&1&&v(0,"ww-skeleton-placeholder",5)(1,"ww-skeleton-placeholder",5),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}function mp(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,0),o(2,"number"),o(3,"number"),m()),a&2){f();let e=F(6);l(3),ht(pe(2,2,e==null?null:e.totalIndividuals,"1.0-0"))(pe(3,5,e==null?null:e.avgPartySize,"1.0-1")),ft(1)}}function dp(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,1),o(2,"number"),m()),a&2){f();let e=F(6);l(2),ht(pe(2,1,e==null?null:e.avgPartySize,"1.0-1")),ft(1)}}var ao=(()=>{class a{constructor(){this.analyticsService=w(ae),this.locationRx=w(St),this.showPartySize$=this.locationRx.getCurrentLocation(["showPartySize","showPartySizeWaitlist"]).pipe(c(e=>e.showPartySize&&e.showPartySizeWaitlist)),this.title$=this.showPartySize$.pipe(c(e=>e?$localize`Waitlisted parties`:$localize`Waitlist`)),this.tooltip=$localize`Waitlisted parties: The number of parties that were placed on the waitlist for the dates selected. Waitlisted bookings are excluded from this number and instead counted under Bookings.\r\n\r\nTotal people: The number of people (not parties) that were placed on the waitlist for the dates selected. Waitlisted bookings are excluded from this number but counted under Bookings.\r\n\r\nAvg party size: The average party size for all visits within the dates selected.`,this.currentData$=D([this.analyticsService.reportData$,this.showPartySize$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.waitlisted,response:t,previous:t?.data[0]?.totalWaitlist,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e,t){let i=Array.isArray(e?.data)?e?.data[0]:null;return i?{waitlisted:i.totalWaitlist,avgPartySize:i.avgPartySize,showPartySize:t,totalIndividuals:i.numIndividuals.waitlist}:{waitlisted:0,avgPartySize:1,showPartySize:t,totalIndividuals:0}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-waitlist"]],hostAttrs:[1,"ww-analytics-overview-waitlist"],standalone:!1,decls:12,vars:10,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: total people (avg. party size ${"\uFFFD1\uFFFD"}:INTERPOLATION_1:)`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: avg. party size`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),H(4),o(5,"async"),m(),O(6),o(7,"async"),g(8,cp,5,10,"ww-metric-value",4)(9,pp,2,4),g(10,mp,4,8,"ww-metric-summary")(11,dp,3,4,"
146ww-metric-summary"),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(),we(r(5,5,i.title$)),l(2);let n=P(r(7,7,i.currentData$));l(2),_(n?8:9),l(2),_(n!=null&&n.showPartySize?10:11)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,se],encapsulation:2,changeDetection:0})}}return a})();function hp(a,d){if(a&1&&(u(0,"ww-metric-value",4),o(1,"async"),o(2,"async"),H(3),o(4,"duration"),m()),a&2){let e=f(2),t=F(5);p("compare",r(1,3,e.compareData$))("loading",r(2,5,e.compareLoading$)),l(3),Ve("",pe(4,7,t.avgWaitDuration,"short")," ")}}function fp(a,d){a&1&&(u(0,"ww-metric-value"),H(1,"-"),m())}function yp(a,d){if(a&1&&(u(0,"ww-metric-summary"),ee(1,1),o(2,"duration"),m()),a&2){f(2);let e=F(5);l(2),ht(r(2,1,e.maxWaitDuration)),ft(1)}}function Cp(a,d){if(a&1&&(g(0,hp,5,10,"ww-metric-value",4)(1,fp,2,0,"ww-metric-value"),g(2,yp,3,3,"ww-metric-summary")),a&2){f();let e=F(5);_((e.avgWaitDuration??-1)>=0?0:1),l(2),_((e.maxWaitDuration??-1)>=0?2:-1)}}function wp(a,d){a&1&&v(0,"ww-skeleton-placeholder",5)(1,"ww-skeleton-placeholder",5),a&2&&(p("height",30)("width",75),l(),p("height",14)("width",130))}var no=(()=>{class a{constructor(){this.analyticsService=w(ae),this.tooltip=$localize`Avg wait times: The average amount of time the parties were in the waitlist before being moved to the serve list.\r\n\r\nLongest wait time: The longest a single party was in the waitlist before being moved to the serve list.`,this.currentData$=this.analyticsService.reportData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t))),this.compareData$=D([this.currentData$,this.analyticsService.compareReportData$,this.analyticsService.compareDateRangeLabel$]).pipe(c(([e,t,i])=>he({current:e.avgWaitDuration??null,response:t,previous:t?.data[0]?.avgWaitDuration??void 0,valueType:"duration",invertNegativeAndPositive:!0,rangeLabel:i})),L((e,t)=>W(e,t))),this.compareLoading$=this.analyticsService.compareLoading$}createDataMap(e){let t=Array.isArray(e?.data)?e?.data[0]:null;return t?{avgWaitDuration:(t.avgWaitDuration??0)>0?t.avgWaitDuration:null,maxWaitDuration:(t.maxWaitDuration??0)>0?t.maxWaitDuration:null}:{avgWaitDuration:null,maxWaitDuration:null}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview-waittimes"]],hostAttrs:[1,"ww-analytics-overview-waittimes"],standalone:!1,decls:9,vars:6,consts:()=>{let e;e=$localize`Avg wait times`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: was the longest wait`,[e,t,[3,"padding"],[3,"tooltip"],[3,"compare","loading"],[3,"height","width"]]},template:function(t,i){if(t&1&&(u(0,"ww-section")(1,"ww-section-content",2)(2,"ww-metric")(3,"ww-metric-title",3),ee(4,0),m(),O(5),o(6,"async"),g(7,Cp,3,2)(8,wp,2,4),m()()()),t&2){l(),p("padding","none"),l(2),p("tooltip",i.tooltip),l(2);let n=P(r(6,3,i.currentData$));l(2),_(n?7:8)}},dependencies:[Ce,Ge,fe,ye,de,me,K,k,Ho],encapsulation:2,changeDetection:0})}}return a})();function _p(a,d){if(a&1&&(u(0,"div",6)(1,"div",8)(2,"span",9),H(3,"\u2691"),m()(),v(4,"ww-skeleton-placeholder",4),m()),a&2){let e=d.$implicit;l(4),p("height",8)("width",e)}}var ua=(()=>{class a{constructor(){this.breakpoints=w(Le),this.labelWidths=[60,30,50,100,70,40,110,25],this.trimLabelSegments$=D([this.breakpoints.isBelowMedium$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t])=>t?!1:e)),this.legendItems=[{color:te("aqua3"),label:$localize`First`},{color:te("aqua3"),label:$localize`Second`},{color:te("aqua3"),label:$localize`Third`},{color:te("aqua3"),label:$localize`Fourth`},{color:te("aqua3"),label:$localize`Fifth`},{color:te("aqua3"),label:$localize`Sixth`},{color:te("aqua3"),label:$localize`Seventh`}],this.series=[[100,0,140,NaN,NaN,NaN,40],[80,0,120,0,NaN,NaN,40],[60,0,100,0,0,0,NaN]],this.funnel={labels:[$localize`Segment`,$localize`Segment`,$localize`Segment`],subLabels:this.legendItems.map(e=>e.label),colors:this.legendItems.map(e=>e.color),values:this.series,maxHeight:150}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-placeholder-funnel"]],hostAttrs:[1,"ww-analytics-placeholder-funnel"],standalone:!1,decls:11,vars:10,consts:[["wwBackgroun
146dColor","lighterGrey",1,"flex","flex-col","gap-1","px-6","py-4",3,"bordered"],[1,"flex","items-end","justify-between","max-w-full"],[1,"flex","flex-col","gap-1"],[1,"flex","gap-2"],[3,"height","width"],[1,"flex","flex-wrap","items-center","gap-x-2","h-8"],[1,"flex","gap-x-0.5"],["id","path-funnel-graph",3,"data","showLegend","trimLabelSegments"],["wwBackgroundColor","aqua2",1,"block","w-2","h-2"],["wwColor","aqua2",1,"hidden"]],template:function(t,i){t&1&&(u(0,"ww-card",0)(1,"div",1)(2,"div",2)(3,"div",3),v(4,"ww-skeleton-placeholder",4)(5,"ww-skeleton-placeholder",4),m(),u(6,"div",5),Be(7,_p,5,2,"div",6,Rt),m()()(),v(9,"ww-funnel",7),o(10,"async"),m()),t&2&&(p("bordered",!1),l(4),p("height",32)("width",72),l(),p("height",32)("width",107),l(2),Fe(i.labelWidths),l(2),p("data",i.funnel)("showLegend",!1)("trimLabelSegments",!!r(10,8,i.trimLabelSegments$)))},dependencies:[tn,mt,ge,K,k],encapsulation:2,changeDetection:0})}}return a})();var ha=(()=>{class a{constructor(){this.data=Array.from({length:10}).map(()=>({a:Math.ceil(Math.random()*100)+40,b:Math.ceil(Math.random()*100)+30,c:Math.ceil(Math.random()*100)+50,d:Math.ceil(Math.random()*100)+70,e:Math.ceil(Math.random()*100)+20,f:Math.ceil(Math.random()*100)+30,g:Math.ceil(Math.random()*100)+40,h:Math.ceil(Math.random()*100)+50,k:Math.ceil(Math.random()*100)+40})),this.columns=[{key:"a",label:ve(K,{height:20,width:60})},{key:"b",label:ve(K,{height:20,width:60})},{key:"c",label:ve(K,{height:20,width:60})},{key:"d",label:ve(K,{height:20,width:60})},{key:"e",label:ve(K,{height:20,width:60})},{key:"f",label:ve(K,{height:20,width:60})},{key:"g",label:ve(K,{height:20,width:60})},{key:"h",label:ve(K,{height:20,width:60})},{key:"k",label:ve(K,{height:20,width:60})}],this.pluckCellLabel=e=>({a:ve(K,{height:14,width:e.a}),b:ve(K,{height:14,width:e.b}),c:ve(K,{height:14,width:e.c}),d:ve(K,{height:14,width:e.d}),e:ve(K,{height:14,width:e.e}),f:ve(K,{height:14,width:e.f}),g:ve(K,{height:14,width:e.g}),h:ve(K,{height:14,width:e.h}),k:ve(K,{height:14,width:e.k})})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-placeholder-table"]],hostAttrs:[1,"ww-analytics-placeholder-table"],standalone:!1,decls:7,vars:8,consts:[["wwBackgroundColor","lighterGrey",1,"flex","flex-col","gap-1",3,"bordered"],["wwBorderColor","mediumGrey",1,"flex","flex-col","gap-1","p-6","pt-4","border-b"],[1,"flex","gap-2"],[3,"height","width"],[1,"flex","flex-col","px-4"],["selection","none",3,"data","columns","pluckCellLabel"]],template:function(t,i){t&1&&(u(0,"ww-card",0)(1,"div",1)(2,"div",2),v(3,"ww-skeleton-placeholder",3)(4,"ww-skeleton-placeholder",3),m()(),u(5,"div",4),v(6,"ww-table",5),m()()),t&2&&(p("bordered",!1),l(3),p("height",24)("width",100),l(),p("height",24)("width",130),l(2),p("data",i.data)("columns",i.columns)("pluckCellLabel",i.pluckCellLabel))},dependencies:[mt,ge,K,_t],styles:[`.ww-analytics-placeholder-table .ww-table .mat-mdc-row.mat-mdc-row,.ww-analytics-placeholder-table .ww-table .mat-mdc-header-row.mat-mdc-header-row{background-color:transparent}
147/*noopplaceholder-table.component-VGQBV7A4.css.map */
148`],encapsulation:2,changeDetection:0})}}return a})();function Ap(a,d){if(a&1&&(u(0,"div",4)(1,"div",6)(2,"span",7),H(3,"\u2691"),m()(),v(4,"ww-skeleton-placeholder",2),m()),a&2){let e=d.$implicit;l(4),p("height",8)("width",e)}}var fa=(()=>{class a{constructor(){this.businessTerms=w(Ua),this.chartInputs=w(en),this.labelWidths=[60,40,50,100],this.periods=Array.from({length:7},(e,t)=>Ra(Gt(new Date,7-t))),this.chart=this.chartInputs.extend({chart:{parentHeightOffset:0,height:"240"},labels:this.periods,xAxis:{type:"datetime",categories:this.periods,axisBorder:{show:!1,color:te("darkerGrey")},axisTicks:{show:!0,color:te("darkerGrey")},labels:{show:!0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200},datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm"}},group:{style:{fontWeight:200}},tooltip:{enabled:!1}},yAxis:{show:!1,axisBorder:{offsetX:-1},labels:{show:!0,style:{colors:te("darkerGrey"),fontWeight:200}},title:{text:$localize`Visits`,style:{color:te("darkerGrey"),fontWeight:200}}},tooltip:{x:{show:!0}},legend:{show:!1},series:[{name:this.businessTerms.businessTerms.waitingStateTerm.capitalized,data:[10,12,28,15,10,17,20]},{name:this.businessTerms.businessTerms.bookedStateTerm.capitalized,data:[15,10,15,20,15,15,17]},{name:this.businessTerms.businessTerms.servingStateTerm.capitalized,data:[25,22,33,35,25,32,37]},{name:$localize`Dropoff`,data:[2,1,0,1,1,2,4]}],fill:{type:"gradient",gradient:{opacityFrom:.2,opacityTo:.4}},colors:Array.from({length:7},()=>te("aqua2"))},this.chartInputs.area)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-placeholder-traffic"]],hostAttrs:[1,"ww-analytics-placeholder-traffic"],standalone:!1,decls:7,vars:4,consts:[["wwBackgroun
148dColor","lighterGrey",1,"flex","flex-col","gap-1","px-6","py-4",3,"bordered"],[1,"flex","flex-col","gap-1"],[3,"height","width"],[1,"flex","gap-2","py-3"],[1,"flex","gap-x-0.5"],["preset","area",3,"options"],["wwBackgroundColor","aqua2",1,"block","w-2","h-2"],["wwColor","aqua2",1,"hidden"]],template:function(t,i){t&1&&(u(0,"ww-card",0)(1,"div",1),v(2,"ww-skeleton-placeholder",2),u(3,"div",3),Be(4,Ap,5,2,"div",4,Rt),m()(),v(6,"ww-chart",5),m()),t&2&&(p("bordered",!1),l(2),p("height",32)("width",155),l(2),Fe(i.labelWidths),l(2),p("options",i.chart))},dependencies:[Me,mt,ge,K],encapsulation:2,changeDetection:0})}}return a})();function Tp(a,d){if(a&1){let e=ie();u(0,"div",3)(1,"ww-link",4),R("click",function(){G(e);let i=f(2);return U(i.onTitleClicked())}),u(2,"span"),H(3),m(),v(4,"ww-icon",5),m()()}if(a&2){let e=f();l(3),Ve("Show all ",e.total," locations")}}function Dp(a,d){if(a&1){let e=ie();u(0,"ww-table",2),o(1,"async"),R("headerClicked",function(i){G(e);let n=f();return U(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f();return U(i.onChartClicked())}),m(),g(2,Tp,5,1,"div",3)}if(a&2){let e=d,t=f(),i=st(11),n=F(0),s=e.showFullscreenLink&&!n;yt("ww-chart-layout-table-with-bottom-border",s),p("placeholder",i)("columns",e.columns)("data",e.rows)("pluckCellLabel",e.pluckCellLabel)("selection","none")("orderBy",r(1,10,t.orderBy$))("withPointerStyles",!n),l(2),_(s?2:-1)}}function $p(a,d){a&1&&Qe(0)}function kp(a,d){if(a&1&&Re(0,$p,1,0,"ng-container",6),a&2){f();let e=st(11);p("ngTemplateOutlet",e)}}function Lp(a,d){a&1&&(u(0,"span",7),H(1,"No data available"),m())}var ya=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="top-visited-locations",this.orderBySub=new $e({property:"numVisits",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.rowCountInTable$=this.fullscreen$.pipe(c(e=>e?void 0:5)),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=D([this.analyticsService.reportDataForLocations$,this.analyticsService.compareReportDataForLocations$,this.analyticsService.compareDateRangeLabel$,this.rowCountInTable$,this.orderBySub]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Top locations`),this.tooltip$=b($localize`The top locations table shows the top locations based on visits. Other available metrics are Waitlisted, Bookings, Served, Completed, Dropoff, Avg wait duration and Avg serve duration.`),this.baseColumns=[{key:"numVisits",label:$localize`Visits`,sortable:!0},{key:"totalWaitlist",label:$localize`Waitlisted`,sortable:!0},{key:"totalBookings",label:$localize`Bookings`,sortable:!0},{key:"numServed",label:$localize`Served`,sortable:!0},{key:"numCompleted",label:$localize`Completed`,sortable:!0},{key:"numDropoff",label:$localize`Dropoff`,sortable:!0},{key:"avgWaitDuration",label:$localize`Avg wait`,sortable:!0},{key:"avgServeDuration",label:$localize`Avg serve duration`,sortable:!0},{key:"maxWaitDuration",label:$localize`Longest wait`,sortable:!0},{key:"maxServeDuration",label:$localize`Longest serve duration`,sortable:!0}]}getValueForCompare(e,t){if(!e)return null;if(t==="numServed")return e.numServed.total;if(t==="numCompleted")return e.numCompleted.total;let i=e[t];return typeof i=="number"?i:null}getCompareComponent(e,t,i,n,s){if(t.key==="name")return null;let h=i?.data.find(y=>y.locationId===e)??null,S=n?.data.find(y=>y.locationId===e)??null,T=this.getValueForCompare(h,t.key),E=this.getValueForCompare(S,t.key),x=t.key==="avgServeDuration"||t.key==="avgWaitDuration"||t.key==="maxWaitDuration"||t.key==="maxServeDuration"?"duration":void 0,C=t.key==="numDropoff"||t.key==="avgServeDuration"||t.key==="avgWaitDuration"||t.key==="maxWaitDuration"||t.key==="maxServeDuration";return ve(Qa,{compare:he({current:T??0,response:n,previous:E??void 0,valueType:x,invertNegativeAndPositive:C,rangeLabel:s}),loading:!1})}createDataMap(e,t,i,n,s){if(!e?.data||e.data.length===0)return{hideLegend:!0,legendItems:[],dateRange:"",columns:[],rows:[],pluckCellLabel:null};let h=[{key:"name",label:$localize`Location`,sortable:!0},...this.baseColumns],S=e.data.map(E=>({id:E.locationId,name:E.locationName??"",numVisits:E.numVisits,totalWaitlist:E.totalWaitlist,totalBookings:E.totalBookings,numServed:E.numServed.total,numCompleted:E.numCompleted.total,numDropoff:E.numDropoff,avgWaitDuration:(E.avgWaitDuration??0)>0?this.durationService.transform(E.avgWaitDuration):"-",avgServeDuration:(E.avgServeDuration??0)>0?this.durationService.transform(E.avgServeDuration):"-",maxWaitDuration:(E.maxWaitDuration??0)>0?this.durationService.transform(E.maxWaitDuration):"-",maxServeDuration:(E.maxServeDuration??0)>0?this.durationService.transform(E.maxServeDuration):"-"})).filter(E=>E.numVisits>0).sort(qe("name"));s?S=Mt(S,s):S=Mt(S,{property:"numVisits",direction:"desc"});let T=S.length;return S=S.slice(0,n),{hasData:S.length>0,hideLegend:!0,legendItems:[],dateRange:`${e.fromDate}-${e.toDate}`,columns:h,rows:S,total:T,showFullscreenLink:T>5,pluckCellLabel:E=>h.reduce((x,C)=>q(Y({},x),{[C.key]:Oa({$element:{classList:["!flex-nowrap"]},components:[Je({content:E[C.key]}),this.getCompareComponent(E.id,C,e,t,i)]})}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-top-visited-locations"]],hostAttrs:[1,"ww-analytics-top-visited-locations"],standalone:!1,features:[I],decls:12,vars:21,consts:[["noData",""],[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable","tableOnly"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","placeholder","columns","data","pluckCellLabel","selection","orderBy","withPointerStyles"],[1,"flex","justify-center","w-full","pt-5"],["type","internal-in-same-tab","wwColor","black",3,"click"],["icon","bx-chevron-right","size","small"],[4,"ngTemplateOutlet"],["wwTypography","body2","wwColor","black"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),u(2,"ww-chart-layout",1),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,Dp,3,12),o(8,"async"),ke(9,kp,1,1,"ng-container"),m(),Re(10,Lp,2,0,"ng-template",null,0,Wt)),t&2){let n,s=P(r(1,8,i.fullscreen$)??!1);l(2),p("chartTitle",r(3,11,i.title$))("tooltip",r(4,13,i.tooltip$))("loading",r(5,15,i.loading$))("dataMap",r(6,17,i.dataMap$))("isFullscreen",s)("showTable",!1)("tableOnly",!0),l(5),_((n=r(8,19,i.dataMap$))?7:9,n)}},dependencies:[Pt,X,ge,Ut,gi,_t,it,k],styles:[`.ww-analytics-top-visited-locations{--ww-analytics-table-name-column-width: 300px}.ww-breakpoints-below-large .ww-analytics-top-visited-locations{--ww-analytics-table-name-column-width: 200px}.ww-analytics-top-visited-locations .ww-table thead th:first-of-type,.ww-analytics-top-visited-locations .ww-table thead td:first-of-type,.ww-analytics-top-visited-locations .ww-table tbody th:first-of-type,.ww-analytics-top-visited-locations .ww-table tbody td:first-of-type{min-width:var(--ww-analytics-table-name-column-width);max-width:var(--ww-analytics-table-name-column-width);width:var(--ww-analytics-table-name-column-width)}.ww-analytics-top-visited-locations .ww-table.ww-chart-layout-table-with-bottom-border .mat-mdc-table.mat-mdc-table tbody .mat-mdc-row:last-of-type .mat-mdc-cell{border-bottom:1px solid var(--ww-color-mediumGrey)}.ww-analytics-top-visited-locations .ww-chart-layout-partial .ww-table tbody tr{cursor:pointer}
149/*nooptop-visited-locations.component-P5BEUOK4.css.map */
150`],encapsulation:2,changeDetection:0})}}return a})();function Rp(a,d){if(a&1&&v(0,"ww-chart",2),a&2){let e=f();p("preset",e.preset)("options",d)}}function Wp(a,d){if(a&1&&(g(0,Rp,1,2,"ww-chart",2),o(1,"async")),a&2){let e,t=f();_((e=r(1,1,t.chart$))?0:-1,e)}}var oi=(()=>{class a extends J{constructor(){super(),this.businessTerms=w(Ua),this.dateService=w(pi),this.chartId="traffic-by-period",this.periods=vi,this.periodsFormControl=new Oe(this.analyticsService.getInitialFormControlValue("traffic-period","date",rn),{nonNullable:!0}),this.period$=Ye(this.periodsFormControl),this.pluckEventLoggerParams=e=>({chart_period:e,chart_type:this.chartId}),this.pluckPeriodLabel=e=>on[e],this.loading$=this.period$.pipe(ne(e=>e==="dayOfWeek"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDayOfWeek)):e==="hourOfDay"?this.analyticsService.loadingState$.pipe(c(t=>t.reportData)):e==="week"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByWeek)):e==="month"?this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByMonth)):this.analyticsService.loadingState$.pipe(c(t=>t.reportDataByDate)))),this.dataMap$=D([this.period$,this.businessTerms.businessTerms$,this.fullscreen$]).pipe(ne(([e,t,i])=>e==="dayOfWeek"?this.analyticsService.reportDataByDayOfWeek$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="hourOfDay"?this.analyticsService.reportData$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="week"?this.analyticsService.reportDataByWeek$.pipe(c(n=>this.createDataMap(e,n,t,i))):e==="month"?this.analyticsService.reportDataByMonth$.pipe(c(n=>this.createDataMap(e,n,t,i))):this.analyticsService.reportDataByDate$.pipe(c(n=>this.createDataMap(e,n,t,i)))),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i])=>this.createChart(e,t.period,t.periods,t.series,t.legendItems,i))),this.title$=b($localize`Visit trend`),this.tooltip$=b($localize`The Visit trend chart visualizes a trend over time of the number of waitlisted parties, bookings, served parties, and dropoff.
151
152The dropdown list at the top right of the chart allows you to select different time breakouts:
153
154- Date (default): The total for each metric by day across the time range selected.
155- Hour of day: The average for each metric by hour of day across the time range selected.
156- Day of week: The average for each metric by day of week across the time range selected.
157`),this.exportData$=this.dataMap$.pipe(c(e=>{if(!e)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows.map(s=>Object.keys(s).reduce((h,S)=>(h[S]=jt(s,S),h),{}));return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.period}-${e.dateRange}.csv`}})),this.subscribe()}
157subscribe(){this.persistObservableInQueryString(this.period$,"traffic-period")}createSeries(e,t,i,n,s){return[{name:s.waitingStateTerm.capitalized,data:e},{name:s.bookedStateTerm.capitalized,data:t},{name:s.servingStateTerm.capitalized,data:i},{name:$localize`Dropoff`,data:n}]}getHourFormat(e,t){let i=this.dateService.transform(`2001-01-01T${e<10?"0"+e:e}:00`,{hideDate:!0})??`${e}:00`;return t?i:i.replace(":00","")}createDataMap(e,t,i,n){let s=[{color:z["traffic-waitlist"],label:i.waitingStateTerm.capitalized,key:"waitlist"},{color:z["traffic-bookings"],label:i.bookedStateTerm.capitalized,key:"bookings"},{color:z["traffic-serving"],label:i.servingStateTerm.capitalized,key:"serving"},{color:z["traffic-dropoff"],label:$localize`Dropoff`,key:"dropoff"}];if(e==="hourOfDay"){let A=t?.data?.[0];if(!A)return{period:e,preset:"area",series:this.createSeries([],[],[],[],i),periods:this.analyticsService.hoursOfDay,legendItems:s,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let B=[{key:"name",label:$localize`Time`,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],re=this.createSeries(A.numWaitlistedByHourOfDay,A.numBookedByHourOfDay,A.numServedByHourOfDay,A.numDropoffByHourOfDay,i);return{hasData:oe(re.flatMap(ce=>ce.data.map(ct=>ct??0)??[]))>0,hasInternalPadding:!0,preset:"area",series:re,period:e,periods:this.analyticsService.hoursOfDay,legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:B,rows:this.analyticsService.hoursOfDay.map((ce,ct)=>({name:{value:this.getHourFormat(ce,n),sortableValue:ct},waitlist:A.numWaitlistedByHourOfDay[ct],bookings:A.numBookedByHourOfDay[ct],serving:A.numServedByHourOfDay[ct],dropoff:A.numDropoffByHourOfDay[ct]}))}}if(e==="dayOfWeek"){let A=Se(t?.data).filter(ce=>ce.dayOfWeekNumber>0).sort((ce,ct)=>ce.dayOfWeekNumber>ct.dayOfWeekNumber?1:-1),B=[{key:"name",label:$localize`Day`,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],re=this.createSeries(A.map(ce=>ce.numRegistrations.waitlist),A.map(ce=>ce.numRegistrations.booking+ce.numRegistrations.waitlistedBooking),A.map(ce=>ce.numServed.total),A.map(ce=>ce.numDropoff),i),rt=oe(re.flatMap(ce=>ce.data.map(ct=>ct??0)??[]))>0;return{period:e,preset:"area",hasData:rt,hasInternalPadding:!0,series:re,periods:A.map(ce=>Vt(ce.dayOfWeek)),legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:B,rows:A.map(ce=>({name:{value:Vt(ce.dayOfWeek),sortableValue:ce.dayOfWeekNumber},waitlist:ce.numRegistrations.waitlist,bookings:ce.numRegistrations.booking+ce.numRegistrations.waitlistedBooking,serving:ce.numServed.total,dropoff:ce.numDropoff}))}}let h=Se(t?.data).filter(A=>e==="week"?(A.weekStarting??"").length>0:e==="month"?(A.month??"").length>0:(A.date??"").length>0),S=$localize`Date`;e==="week"?S=$localize`Week`:e==="month"&&(S=$localize`Month`);let T=[{key:"name",label:S,sortable:!0},{key:"waitlist",label:i.waitingStateTerm.capitalized,sortable:!0},{key:"bookings",label:i.bookedStateTerm.capitalized,sortable:!0},{key:"serving",label:i.servingStateTerm.capitalized,sortable:!0},{key:"dropoff",label:$localize`Dropoff`,sortable:!0}],E=this.createSeries(h.map(A=>A.numRegistrations.waitlist),h.map(A=>A.numRegistrations.booking+A.numRegistrations.waitlistedBooking),h.map(A=>A.numServed.total),h.map(A=>A.numDropoff),i),x=oe(E.flatMap(A=>A.data.map(B=>B??0)??[]))>0,C=h.map(A=>e==="week"?A.weekStarting:e==="month"?`${A.month}-01`:A.date),y=e==="date"&&C.length===1?"bar":"area",j=h.map(A=>{let B=A.date;return e==="week"?B=A.weekStarting:e==="month"&&(B=A.month),{name:{value:this.dateService.transform(B,{hideTime:!0,hideDate:e==="month"})??B,sortableValue:B},waitlist:A.numRegistrations.waitlist,bookings:A.numRegistrations.booking+A.numRegistrations.waitlistedBooking,serving:A.numServed.total,dropoff:A.numDropoff}});return{period:e,preset:y,hasData:x,hasInternalPadding:!0,series:E,periods:C,legendItems:s,dateRange:`${t?.fromDate}-${t?.toDate}`,columns:T,rows:j}}createChart(e,t,i,n,s,h){if(t==="date"&&i.length<=1)return this.chartInputs.extend({series:n,plotOptions:{bar:{horizontal:!1}},chart:{parentHeightOffset:0,height:e?"400":"240",stacked:!0,events:{click:()=>{h||this.onChartClicked()}}},xAxis:{type:"category",categories:i,axisBorder:{show:e,color:te("darkerGrey")},axisTicks:{show:!0,color:te("darkerGrey")},labels:{show:!0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200}},tooltip:{enabled:!1}},yAxis:{show:e,axisBorder:{offsetX:-1},labels:{show:!0,style:{colors:te("darkerGrey"),fontWeight:200}},title:{text:$localize`Visits`,style:{color:te("darkerGrey"),fontWeight:200}}},tooltip:{followCursor:!0,intersect:!1,shared:!0,x:{show:!0}},legend:{show:!1},fill:{opacity:1},colors:s.map(E=>E.color)},this.chartInputs.bar);let S=t==="date"||t==="week"||t==="month",T=i.map(E=>t==="hourOfDay"&&typeof E=="number"?this.getHourFormat(E,!this.dateService.isAmPm):E);return this.chartInputs.extend({chart:{parentHeightOffset:0,height:e?"400":"272",events:{click:()=>{h||this.onChartClicked()}}},labels:S?i.map(E=>`${E}`):void 0,stroke:{curve:"straight"},xAxis:{type:S?"datetime":"category",categories:T,axisBorder:{show:e,color:te("darkerGrey")},axisTicks:{show:!0,color:te("darkerGrey")},labels:{show:!0,rotateAlways:!1,style:{colors:te("darkerGrey"),fontWeight:200,fontSize:this.dateService.isAmPm?"10px":"12px"},formatter:E=>t==="hourOfDay"?`${E}`:t==="month"?`${this.dateService.transform(new Date(E),{hideTime:!0,hideDate:!0})??`${E}`}`:t==="week"||t==="date"?`${this.dateService.transform(new Date(E),{hideTime:!0})??`${E}`}`:`${E}`,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm"}},group:{style:{fontWeight:200}},tooltip:{enabled:!1}},yAxis:{show:!1},tooltip:{x:{show:!0,formatter:(E,x)=>
157{if(!E||typeof E!="number")return`${E}`;if(t==="hourOfDay")return`${this.getHourFormat(x.dataPointIndex,!this.dateService.isAmPm)}`;if(t==="dayOfWeek")return`${i[x.dataPointIndex]}`;if(t==="month")return`${this.dateService.transform(new Date(E),{hideTime:!0,hideDate:!0})??`${E}`}`;if(t==="week"){let C=new Date(E),y=Gt(C,6);return this.dateService.transformDateRange({start:C,end:y},{hideTime:!0})}return t==="date"?this.dateService.transform(new Date(E),{hideTime:!0})??E:`${E}`}}},legend:{show:!1},series:n,fill:{type:"gradient",gradient:{opacityFrom:.2,opacityTo:.4}},colors:s.map(E=>E.color)},this.chartInputs.area)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-traffic-by-period"]],hostAttrs:[1,"ww-analytics-traffic-by-period"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-traffic-by-period-period",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"preset","options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Wp,2,3),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.periodsFormControl)("data",i.periods)("pluckLabel",i.pluckPeriodLabel)("searchable",!1)("wwEventLogger","updated_analytics_period")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),_((n=r(10,25,i.dataMap$))?9:-1,n)}},dependencies:[be,Te,Me,X,Ie,Ne,_e,k],styles:[`.ww-analytics-traffic-by-period .apexcharts-xaxis-label{text-transform:uppercase;font-weight:200}
158/*nooptraffic-by-period.component-YVW4R6WE.css.map */
159`],encapsulation:2,changeDetection:0})}}return a})();var oo={agent:$localize`Creator`,source:$localize`Source`},Cs={STAFF:$localize`Staff`,GUEST:$localize`Guest`,API:$localize`API`,OTHER:$localize`Other`},ro={"ANDROID-APP":"Android app","IOS-APP":"iOS app","IOS-APP-CLIP":"iOS app clip","WEB-APP":"Web app",API:"API",EMAIL:"Email",IMPORT:"Import",KIOSK:"Kiosk",PUBLIC:"Public",QR:"QR",RWG:"Google",SMS:"SMS",OTHER:$localize`Other`},ws={STAFF:"#023fb2",GUEST:"#42a60e",API:"#e859e6",OTHER:"#e859e6"},gs={STAFF:100,GUEST:200,API:300,OTHER:400},_s={"ANDROID-APP":120,"IOS-APP":130,"IOS-APP-CLIP":260,"WEB-APP":140,API:310,EMAIL:210,IMPORT:110,KIOSK:240,PUBLIC:250,QR:240,RWG:220,SMS:230,OTHER:410};function xp(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}var Ca=(()=>{class a extends J{constructor(){super(),this.chartId="visits-by-creator-source",this.title$=b($localize`Registration details`),this.tooltip$=b($localize`In the Registration details bar chart, you'll find a summary of the different registration types.
160
161- Creator: Breakdown of the visits that were created by staff vs customers
162- Source: Breakdown of the specific source where the visit was created
163
164The bars are broken out by the creator and are stacked by the associated sources.
165
166These levels of detail can be compared using multiple metrics:
167
168- Total Visits
169- Bookings
170- Waitlisted
171- Waitlisted bookings
172- Dropoff
173- Served
174- Completed
175- No-show
176- Cancelled
177- Removed`),this.metrics=nn,this.metricsFormControl=new Oe(this.analyticsService.getInitialFormControlValue("reg-details-metric","numVisits",Kt),{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricsLabel=e=>Z[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataByCreatorSource)),this.dataMap$=D([this.analyticsService.reportDataBySource$,this.metric$]).pipe(c(([e,t])=>this.createDataMap(e,t)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.bars$=this.dataMap$.pipe(c(e=>Ze(e.values.map(i=>i.agent)).map(i=>{let n=e.values.filter(h=>h.agent===i),s=oe(n.map(h=>h.value??0));
177return{key:i,label:Cs[i],formattedValue:s.toLocaleString(),values:n.map(h=>({label:ro[h.source],value:h.value,formattedValue:h.value?.toLocaleString(),color:h.color,opacity:h.opacity}))}}).filter(le))),this.persistObservableInQueryString(this.metric$,"reg-details-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t){let i=Se(e?.data);if(!qt(e)||i.length<1)return{values:[],legendItems:[],metric:t,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let n="source",h=i.filter(C=>le(C.source)&&le(C.agent)).map(C=>{let y=gr(C.agent)?C.agent:"OTHER",j=_r(C.source)?C.source:"OTHER";return y==="API"&&(y="OTHER"),{agent:y,source:j,value:this.getValue(t,C)}}).reduce((C,y)=>{let j=C.findIndex(A=>A.agent===y.agent&&A.source===y.source);return j>-1?C[j].value+=y.value:C.push(y),C},[]).map(C=>{let{agent:y,source:j,value:A}=C;return{agent:y,source:j,value:A,color:ws[y],agentOrder:gs[y],order:_s[j]}}).sort((C,y)=>C.order<y.order?-1:1).reduce((C,y)=>(C[y.agent]?C[y.agent].push(y):C[y.agent]=[y],C),{}),S=Object.keys(h).map(C=>h[C].map((j,A,B)=>{let rt=.8/B.length,ce=.2+rt+A*rt;return q(Y({},j),{opacity:ce})})).flat().filter(C=>C.value>0),T=[{key:"agent",label:oo.agent,sortable:!0},{key:"source",label:oo.source,sortable:!0},{key:"numVisits",label:Z.numVisits,sortable:!0},{key:"numRegistrations.booking",label:Z["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:Z["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:Z["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:Z.numDropoff,sortable:!0},{key:"numServed.total",label:Z["numServed.total"],sortable:!0},{key:"numCompleted.total",label:Z["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:Z["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:Z["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:Z["numRemoved.total"],sortable:!0}],E=i.filter(C=>le(C[n])&&`${C[n]}`.length>0).map(C=>({agent:C.agent??"",source:C.source??"",numVisits:C.numVisits??0,"numRegistrations.booking":C.numRegistrations?.booking??0,"numRegistrations.waitlist":C.numRegistrations?.waitlist??0,"numRegistrations.waitlistedBooking":C.numRegistrations?.waitlistedBooking??0,numDropoff:C.numDropoff??0,"numServed.total":C.numServed?.total??0,"numCompleted.total":C.numCompleted?.total??0,"numNoShowed.total":C.numNoShowed?.total??0,"numCancelled.total":C.numCancelled?.total??0,"numRemoved.total":C.numRemoved?.total??0})).sort((C,y)=>C.numVisits<y.numVisits?1:-1),x=[...S].reverse().sort((C,y)=>C.agentOrder-y.agentOrder).map(C=>({key:`${C.agent}-${C.source}`,label:ro[C.source],color:C.color,style:{opacity:C.opacity}}));return{hasData:oe(S.map(C=>C.value))>0,values:S,legendItems:x,dimension:n,metric:t,dateRange:`${e.fromDate}-${e.toDate}`,columns:T,rows:E}}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-visits-by-creator-source"]],hostAttrs:[1,"ww-analytics-visits-by-creator-source"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-visits-by-creator-source-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","fullscreen"],[3,"chartClicked","linkClicked","data","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,xp,2,4,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.metricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],encapsulation:2,changeDetection:0})}}return a})();var Mp=(a,d)=>d.group;function Bp(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",5),o(1,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("fullscreen",r(1,2,e.fullscreen$))}}function Fp(a,d){a&1&&(u(0,"div",9),v(1,"ww-illustration",11),u(2,"span",12),ee(3,0),m()())}function Op(a,d){if(a&1){let e=ie();u(0,"ww-table",13),o(1,"async"),R("headerClicked",function(i){G(e);let n=f(4);return U(n.onTableHeaderClicked(i))})("rowClicked",function(){G(e);let i=f(4);return U(i.onChartClicked())}),m()}if(a&2){f(2);let e=F(0),t=f(2),i=F(2);
177p("columns",i.groupColumns)("data",e)("pluckCellLabel",i.pluckCellLabel)("selection","none")("orderBy",r(1,5,t.orderBy$))}}function Np(a,d){if(a&1&&(u(0,"div"),g(1,Fp,4,0,"div",9)(2,Op,2,7,"ww-table",10),m()),a&2){f();let e=F(0);l(),_(!e||e.length===0?1:2)}}function Vp(a,d){if(a&1&&(O(0),u(1,"ww-expansion",6)(2,"ww-expansion-header",7),H(3),m(),Re(4,Np,3,1,"div",8),m()),a&2){let e=d.$implicit,t=d.$index;f(2);let i=F(2);P(i.rowsByGroup[e.group]),l(),p("initiallyOpened",t===0)("bordered",!1),l(2),Ve(" ",e.group," ")}}function Pp(a,d){if(a&1&&(u(0,"div",4),Be(1,Vp,5,4,"ww-expansion",6,Mp),m()),a&2){f();let e=F(2);l(),Fe(e.groups)}}var wa=(()=>{class a extends J{constructor(){super(),this.chartId="visits-by-label",this.metrics=nn,this.primaryMetricsFormControl=new Oe(this.analyticsService.getInitialFormControlValue("label-metric","numVisits",Kt),{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>Z[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.orderBySub=new $e({property:"numVisits",direction:"desc"}),this.orderBy$=this.orderBySub.asObservable(),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLabels)),this.dataMap$=D([this.analyticsService.reportDataForLabels$,this.primaryMetric$,this.orderBy$]).pipe(c(([e,t,i])=>this.createDataMap(e,t,i)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Labels`),this.tooltip$=b($localize`The Labels chart is a bar chart summarizing location groupings through labels. Each bar represents the label group and is stacked by the values available within that label grouping.
178
179The metrics include:
180
181- Total Visits
182- Bookings
183- Waitlisted Parties
184- Waitlisted bookings
185- Dropoff
186- Served
187- Completed
188- No-show
189- Cancelled
190- Removed`),this.bars$=this.dataMap$.pipe(c(e=>e.groups.map(t=>({key:t.group,label:t.group??$localize`<No value>`,formattedValue:`${oe(t.labels.map(i=>this.getValue(e.primaryMetric,i)))}`,values:t.labels.map((i,n,s)=>{let S=.8/s.length,T=.2+S+n*S,E=this.getValue(e.primaryMetric,i),x=Math.ceil(E).toLocaleString();return{label:i.label,value:E,formattedValue:x,opacity:T}})})))),this.persistObservableInQueryString(this.primaryMetric$,"label-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i){if(!e||e.length<1)return{groups:[],rowsByGroup:{},dataRows:[],hideLegend:!0,legendItems:[],primaryMetric:t,dateRange:"",columns:[],groupColumns:[],rows:[],pluckCellLabel:null};let n=e.filter(le),s=n[0]?.fromDate??"",h=n[0]?.toDate??"",S=n.map(A=>{let B=A.data??[],re=A.dimensions?.[0]?.replace("label:","");if(!re||!Dt(re))return console.warn("No label group found in response dimensions",A.dimensions),null;let rt=B.filter(ce=>(ce.labels?.[re]?.length??0)>0&&this.getValue(t,ce)>0);return{group:re,labels:rt.map(ce=>q(Y({},ce),{label:ce.labels?.[re]?.[0]??$localize`<No value>`}))??[]}}).filter(le),T=S.flatMap(A=>A.labels.map(B=>Y({group:A.group},B))),E=T.sort((A,B)=>(B.numVisits??0)-(A.numVisits??0)).sort(qe("group")),x=T.flatMap(A=>this.getValue(t,A));if(oe(x)<=0)return{dataRows:[],groups:[],rowsByGroup:{},hideLegend:!0,legendItems:[],primaryMetric:t,labelGroup:null,dateRange:"",columns:[],groupColumns:[],rows:[],pluckCellLabel:null};let C=[{key:"group",label:$localize`Group`,sortable:!0},{key:"label",label:$localize`Label`,sortable:!0},{key:"numVisits",label:Z.numVisits,sortable:!0},{key:"numRegistrations.booking",label:Z["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:Z["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:Z["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:Z.numDropoff,sortable:!0},{key:"numServed.total",label:Z["numServed.total"],sortable:!0},{key:"numCompleted.total",label:Z["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:Z["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:Z["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:Z["numRemoved.total"],sortable:!0}],y=E.map(A=>({group:A.group,label:A.label,numVisits:A.numVisits,"numRegistrations.booking":A.numRegistrations.booking,"
190numRegistrations.waitlist":A.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":A.numRegistrations.waitlistedBooking,numDropoff:A.numDropoff,"numServed.total":A.numServed.total,"numCompleted.total":A.numCompleted.total,"numNoShowed.total":A.numNoShowedByVisitType.total,"numCancelled.total":A.numCancelledByVisitType.total,"numRemoved.total":A.numRemovedByVisitType.total}));i?y=Mt(y,i):y=Mt(y,{property:"numVisits",direction:"desc"});let j=y.reduce((A,B)=>(A[B.group]||(A[B.group]=[]),A[B.group].push(B),A),{});return{hasData:!0,hideLegend:!0,legendItems:[],groups:S,rowsByGroup:j,dataRows:E,primaryMetric:t,dateRange:`${s}-${h}`,columns:C,groupColumns:C.slice(1),rows:y,pluckCellLabel:A=>C.reduce((B,re)=>q(Y({},B),{[re.key]:A[re.key]}),{})}}onTableHeaderClicked(e){this.orderBySub.value?this.orderBySub.value.property!==e?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="asc"?this.orderBySub.next({property:e,direction:"desc"}):this.orderBySub.value.direction==="desc"&&this.orderBySub.next({property:e,direction:"asc"}):this.orderBySub.next({property:e,direction:"desc"})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-visits-by-label"]],hostAttrs:[1,"ww-analytics-visits-by-label"],standalone:!1,features:[I],decls:13,vars:27,consts:()=>{let e;return e=$localize`No data available`,[e,[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-visits-by-label-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","fullscreen"],[1,"flex","flex-col","gap-6","pt-6","max-w-full","min-w-full"],[3,"chartClicked","linkClicked","data","fullscreen"],[1,"max-w-full","min-w-full",3,"initiallyOpened","bordered"],["openIcon","bx-chevron-up","closedIcon","bx-chevron-down","wwColor","black","wwTypography","h5",1,"!justify-start","gap-2","py-2"],[4,"wwExpansionContent"],[1,"flex","flex-col","items-center","justify-center","gap-2","w-full","py-2"],[1,"w-full","ww-chart-layout-table",3,"columns","data","pluckCellLabel","selection","orderBy"],["icon","ww-analytics-chart-no-data-fullscreen","wwColor","black"],["wwColor","black"],[1,"w-full","ww-chart-layout-table",3,"headerClicked","rowClicked","columns","data","pluckCellLabel","selection","orderBy"]]},template:function(t,i){if(t&1&&(O(0),o(1,"async"),O(2),o(3,"async"),u(4,"ww-chart-layout",1),o(5,"async"),o(6,"async"),o(7,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(8,"ww-chart-layout-select")(9,"ww-select",2),R("click",function(s){return s.stopPropagation()}),m()(),g(10,Bp,2,4,"ww-bar-chart",3),o(11,"async"),g(12,Pp,3,0,"div",4),m()),t&2){let n,s=r(1,14,i.fullscreen$)??!1;l(2);let h=P(r(3,16,i.dataMap$));l(2),p("chartTitle",r(5,19,i.title$))("tooltip",r(6,21,i.tooltip$))("loading",r(7,23,i.loading$))("dataMap",h)("isFullscreen",s)("showTable",!1),l(5),p("formControl",i.primaryMetricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(11,25,i.bars$))?10:-1,n),l(2),_(s&&h&&h.groups.length>0&&h.rowsByGroup?12:-1)}},dependencies:[be,Te,X,Ie,Ne,xe,ge,dr,mr,ur,hi,_e,_t,it,k],styles:[`.ww-analytics-visits-by-label .ww-expansion:not(.ww-expansion-opened) .ww-expansion-header{border-bottom:1px solid var(--ww-color-mediumGrey)}
191/*noopvisits-by-label.component-MAX7LW3F.css.map */
192`],encapsulation:2,changeDetection:0})}}return a})();function Yp(a,d){if(a&1){let e=ie();u(0,"ww-bar-chart",3),o(1,"async"),o(2,"async"),R("chartClicked",function(){G(e);let i=f();return U(i.onChartClicked())})("linkClicked",function(){G(e);let i=f();return U(i.onTitleClicked())}),m()}if(a&2){let e=f();p("data",d)("hiddenRowCount",r(1,3,e.hiddenRowCount$))("fullscreen",r(2,5,e.fullscreen$))}}var ga=(()=>{class a extends J{constructor(){super(),this.durationService=w(We),this.chartId="visits-by-location",this.metrics=Vi,this.primaryMetricsF
192ormControl=new Oe(this.analyticsService.getInitialFormControlValue("location-p-metric","numVisits",Kt),{nonNullable:!0}),this.primaryMetric$=Ye(this.primaryMetricsFormControl),this.pluckMetricsLabel=e=>Z[e],this.pluckMetricEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportDataForLocations)),this.dataMap$=D([this.fullscreen$,this.analyticsService.reportDataForLocations$,this.primaryMetric$]).pipe(c(([e,t,i])=>this.createDataMap(e,t,i)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Locations`),this.tooltip$=b($localize`The Locations chart is a bar chart summarizing locations using different metrics.
193
194The metrics include:
195
196- Total Visits
197- Bookings
198- Waitlisted Parties
199- Waitlisted bookings
200- Dropoff
201- Served
202- Completed
203- No-show
204- Cancelled
205- Removed
206- Avg wait duration
207- Avg serve duration`),this.bars$=this.dataMap$.pipe(c(e=>e.dataRows.map(t=>{let i=t.locationName??$localize`Unknown/None`,n=this.getValue(e.primaryMetric,t),h=this.getFormatter(e.primaryMetric)(n);return{key:t.locationId,label:i,formattedValue:h,values:[{label:i,value:n,formattedValue:h}]}}))),this.hiddenRowCount$=this.dataMap$.pipe(c(e=>e.hiddenRowCount??0)),this.subscribe()}ngOnInit(){super.ngOnInit()}subscribe(){this.persistObservableInQueryString(this.primaryMetric$,"location-p-metric")}getValue(e,t){switch(e){case"numCancelled.total":return t.numCancelledByVisitType.total;case"numCompleted.total":return t.numCompleted.total;case"numNoShowed.total":return t.numNoShowedByVisitType.total;case"numRegistrations.booking":return t.numRegistrations.booking;case"numRegistrations.waitlist":return t.numRegistrations.waitlist;case"numRegistrations.waitlistedBooking":return t.numRegistrations.waitlistedBooking;case"numRemoved.total":return t.numRemovedByVisitType.total;case"numServed.total":return t.numServed.total;case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t[e]??0;default:return t[e]}}createDataMap(e,t,i){let n=t?.data??[],s=t?.dimensions?.[1];if(!t||n.length<1||!s)return{dataRows:[],legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let h=n.sort((y,j)=>this.getValue(i,j)-this.getValue(i,y)),S=e?h:h.slice(0,Ai),T=h.length-S.length,E=S.map(y=>this.getValue(i,y));if(oe(E)<=0)return{dataRows:[],legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:"",columns:[],rows:[],pluckCellLabel:null};let x=[{key:"name",label:$localize`Location`,sortable:!0},{key:"numVisits",label:Z.numVisits,sortable:!0},{key:"numRegistrations.booking",label:Z["numRegistrations.booking"],sortable:!0},{key:"numRegistrations.waitlist",label:Z["numRegistrations.waitlist"],sortable:!0},{key:"numRegistrations.waitlistedBooking",label:Z["numRegistrations.waitlistedBooking"],sortable:!0},{key:"numDropoff",label:Z.numDropoff,sortable:!0},{key:"numServed.total",label:Z["numServed.total"],sortable:!0},{key:"numCompleted.total",label:Z["numCompleted.total"],sortable:!0},{key:"numNoShowed.total",label:Z["numNoShowed.total"],sortable:!0},{key:"numCancelled.total",label:Z["numCancelled.total"],sortable:!0},{key:"numRemoved.total",label:Z["numRemoved.total"],sortable:!0},{key:"avgWaitDuration",label:Z.avgWaitDuration,sortable:!0},{key:"avgServeDuration",label:Z.avgServeDuration,sortable:!0},{key:"maxWaitDuration",label:Z.maxWaitDuration,sortable:!0},{key:"maxServeDuration",label:Z.maxServeDuration,sortable:!0}],C=S.map(y=>({name:y[s]?.toString()??$localize`Unknown/None`,numVisits:y.numVisits,"numRegistrations.booking":y.numRegistrations.booking,"numRegistrations.waitlist":y.numRegistrations.waitlist,"numRegistrations.waitlistedBooking":y.numRegistrations.waitlistedBooking,numDropoff:y.numDropoff,"numServed.total":y.numServed.total,"numCompleted.total":y.numCompleted.total,"numNoShowed.total":y.numNoShowedByVisitType.total,"numCancelled.total":y.numCancelledByVisitType.total,"numRemoved.total":y.numRemovedByVisitType.total,avgWaitDuration:(y.avgWaitDuration??0)>0?this.durationService.transform(y.avgWaitDuration):"-",avgServeDuration:(y.avgServeDuration??0)>0?this.durationService.transform(y.avgServeDuration):"-",maxWaitDuration:(y.maxWaitDuration??0)>0?this.durationService.transform(y.maxWaitDuration):"-",maxServeDuration:(y.maxServeDuration??0)>0?this.durationService.transform(y.maxServeDuration):"-"})).sort((y,j)=>y.numVisits<j.numVisits?1:-1);return{hasData:!0,dataRows:S,legendItems:[],hideLegend:!0,primaryMetric:i,dateRange:`${t.fromDate}-${t.toDate}`,columns:x,rows:C,hiddenRowCount:T}}getFormatter(e){switch(e){case"avgServeDuration":case"avgWaitDuration":case"maxServeDuration":case"maxWaitDuration":return t=>this.durationService.transform(t);default:return t=>`${typeof t=="number"?Math.ceil(t):t}`}}createChart(e,t,i,n){return this.chartInputs.extend({chart:{height:e?"400":"240"},responsive:[],series:[{name:Z[i],data:t.map(s=>this.getValue(i,s))}],colors:n.map(s=>s.color),dataLabels:{formatter:this.getFormatter(i)},xAxis:{categories:t.map(s=>s.locationName)},yAxis:{labels:{formatter:this.getFormatter(i)}}},this.chartInputs.bar)}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-visits-by-location"]],hostAttrs:[1,"ww-analytics-visits-by-location"],standalone:!1,features:[I],decls:11,vars:27,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-visits-by-location-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[3,"data","hiddenRowCount","fullscreen"],[3,"chartClicked","linkClicked","data","hiddenRowCount","fullscreen"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(7,"ww-chart-layout-select")(8,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(9,Yp,3,7,"ww-bar-chart",2),o(10,"async"),m()),t&2){let n;p("chartTitle",r(1,13,i.title$))("tooltip",r(2,15,i.tooltip$))("loading",r(3,17,i.loading$))("dataMap",r(4,19,i.dataMap$))("isFullscreen",r(5,21,i.fullscreen$))("showTable",r(6,23,i.fullscreen$)),l(8),p("formControl",i.primaryMetricsF
207ormControl)("data",i.metrics)("pluckLabel",i.pluckMetricsLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckMetricEventLoggerParams),l(),_((n=r(10,25,i.bars$))?9:-1,n)}},dependencies:[be,Te,X,Ie,Ne,xe,_e,k],encapsulation:2,changeDetection:0})}}return a})();function Up(a,d){if(a&1&&v(0,"img",8),a&2){let e=f().$implicit;p("src",e.image,Ei)}}function Hp(a,d){if(a&1&&(u(0,"td",7),g(1,Up,1,1,"img",8),m()),a&2){let e=d.$implicit,t=f().$implicit;f();let i=F(0);$o(e.style),p("wwTooltip",`${t.name} ${e.x}: ${i?i(e.y):e.y}`)("wwTooltipWithTouch",!0),l(),_(e.image?1:-1)}}function jp(a,d){if(a&1&&(u(0,"tr")(1,"td",5),H(2),m(),Be(3,Hp,2,5,"td",6,Nt),m()),a&2){let e=d.$implicit;l(2),Ve(" ",e.shortName," "),l(),Fe(e.data)}}function qp(a,d){if(a&1&&(u(0,"td",4),H(1),m()),a&2){let e=d.$implicit,t=d.$index;l(),Ve(" ",t===0?"":e.label," ")}}function Kp(a,d){if(a&1){let e=ie();O(0),u(1,"table",3),R("click",function(){G(e);let i=f();return U(i.onChartClicked())}),u(2,"tbody"),Be(3,jp,5,1,"tr",null,Nt),u(5,"tr"),Be(6,qp,2,1,"td",4,Nt),m()()()}if(a&2){f();let e=F(0),t=F(2);P(e.tooltipFormatter),l(),yt("cursor-pointer",!t);let i=e.reversedSeries;l(2),Fe(i),l(3),Fe(e.columns)}}function Xp(a){return a==="totalVisits"||a==="waitlisted"||a==="bookings"||a==="served"||a==="dropoff"||a==="dropoffRatio"||a==="avgWaitDuration"||a==="avgServeDuration"||a==="avgLineLength"||a==="maxLineLength"}var Qp={totalVisits:$localize`Total visits`,waitlisted:$localize`Waitlisted`,bookings:$localize`Bookings`,served:$localize`Served`,dropoff:$localize`Dropoffs`,dropoffRatio:$localize`Dropoff rate`,avgWaitDuration:$localize`Avg wait duration`,avgServeDuration:$localize`Avg serve duration`,avgLineLength:$localize`Avg line length`,maxLineLength:$localize`Max line length`},Zp={totalVisits:"numVisitsByHourOfDay",waitlisted:"numWaitlistedByHourOfDay",bookings:"numBookedByHourOfDay",served:"numServedByHourOfDay",dropoff:"numDropoffByHourOfDay",dropoffRatio:"dropoffRatioByHourOfDay",avgWaitDuration:"avgWaitDurationByHourOfDay",avgServeDuration:"avgServeDurationByHourOfDay",avgLineLength:"avgLineLengthByHourOfDay",maxLineLength:"maxLineLengthByHourOfDay"},_a=(()=>{class a extends J{constructor(){super(),this.datePipe=w(La),this.durationService=w(We),this.locationRx=w(St),this.chartId="visits-distribution",this.metrics=je()(["totalVisits","waitlisted","bookings","served","dropoff","dropoffRatio","avgWaitDuration","avgServeDuration","avgLineLength","maxLineLength"]),this.metricsFormControl=new Oe(this.analyticsService.getInitialFormControlValue("visits-dist-metric","totalVisits",Xp),{nonNullable:!0}),this.metric$=Ye(this.metricsFormControl),this.pluckMetricLabel=e=>Qp[e],this.pluckEventLoggerParams=e=>({chart_metric:e,chart_type:this.chartId}),this.hoursByWeekday$=this.analyticsService.reportDataByDayOfWeek$.pipe(c(e=>e?.locationIds??[]),ne(e=>this.locationRx.getLocationsByIds(e,["hours"])),c(e=>e.map(({hours:t})=>t).filter(le))),this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.reportData||e.reportDataByDayOfWeek)),this.dataMap$=D([this.metric$,this.analyticsService.reportData$,this.analyticsService.reportDataByDayOfWeek$,this.hoursByWeekday$,this.fullscreen$]).pipe(c(([e,t,i,n,s])=>this.createDataMap(e,t,i,n,s)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=b(null),this.title$=b($localize`Heatmap`),this.tooltip$=b($localize`A heatmap of when visits most typically occur, broken out by weekday and hour of day.
208
209The dropdown list in the top right corner lets you pick from a number of different metrics to compare:
210
211- Waitlisted parties
212- Bookings
213- Served parties
214- Dropoffs
215- Avg wait duration
216- Avg serve duration
217- Avg line length
218- Max line length`),this.exportData$=this.dataMap$.pipe(c(e=>{if(!e)return null;let t=e.columns.map(s=>`${s.label}`),i=e.columns.map(s=>s.key),n=e.rows;return{columns:t,keys:i,rows:n,fileName:`${this.chartId}-${e.metric}-${e.dateRange}.csv`}})),this.valuesToSeries=(e,t)=>t?t.map((i,n)=>({x:this.getHourFormat(n,e),y:i??0}
218)):[],this.subscribe()}subscribe(){this.persistObservableInQueryString(this.metric$,"visits-dist-metric")}getHourFormat(e,t){let i=this.datePipe.transform(`2001-01-01T${e<10?"0"+e:e}:00`,"shortTime")??`${e}:00`;return t?i:i.replace(":00","")}getDataLabelFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":return t=>typeof t!="number"?"":t<1?t.toString():this.durationService.transform(t);case"dropoffRatio":return t=>typeof t!="number"?"":`${Math.round(t*100)}%`}}getTooltipFormatter(e){switch(e){case"avgWaitDuration":case"avgServeDuration":return t=>typeof t!="number"?"":t<1?t.toString():this.durationService.transform(t);case"dropoffRatio":return t=>typeof t!="number"?"":`${Math.round(t*100)}%`}}ensureAllDaysOfWeekArePresent(e){let t=e.data.map(i=>i.dayOfWeekNumber);for(let i=1;i<=7;i++)t.includes(i)||e.data.push(q(Y({},qo),{dayOfWeekNumber:i,dayOfWeek:cn(i,e.weekdayStart),numVisitsByHourOfDay:Array(24).fill(0),numWaitlistedByHourOfDay:Array(24).fill(0),numBookedByHourOfDay:Array(24).fill(0),numServedByHourOfDay:Array(24).fill(0),numDropoffByHourOfDay:Array(24).fill(0),avgWaitDurationByHourOfDay:Array(24).fill(0),avgServeDurationByHourOfDay:Array(24).fill(0),avgLineLengthByHourOfDay:Array(24).fill(0),maxLineLengthByHourOfDay:Array(24).fill(0)}));return e}removeZeroValuesFromSeriesOutsideCommonHours(e,t){if(t===null||t.first>t.last||t.first===0&&t.last===23)return e;let i=e.reduce((S,T)=>{let E=T.data.findIndex(x=>x.y>0);return E>=0&&E<S&&(S=E),S},23),n=e.reduce((S,T)=>{let x=[...T.data].reverse().findIndex(y=>y.y>0),C=x>-1?23-x:-1;return C>=0&&C>S&&(S=C),S},0),s=i<t.first?i:t.first,h=n>t.last?n:t.last;return e.map(S=>({name:S.name,shortName:S.shortName,data:S.data.slice(s,h+1)}))}createDataMap(e,t,i,n,s){if(t&&i){let h=ln(n),S=this.ensureAllDaysOfWeekArePresent(i).data.filter(A=>A.dayOfWeekNumber>0).sort((A,B)=>A.dayOfWeekNumber<B.dayOfWeekNumber?1:-1).map(A=>({name:this.getDayOfWeekName(A,!0),shortName:this.getDayOfWeekName(A,!1),data:this.valuesToSeries(s,A[Zp[e]])})),T=this.removeZeroValuesFromSeriesOutsideCommonHours(S,h),E=this.getDataLabelFormatter(e),x=this.getTooltipFormatter(e),C=[{key:"name",label:$localize`Day`,sortable:!0},...this.analyticsService.hoursOfDay.map(A=>{let B=this.datePipe.transform(`2001-01-01T${A<10?"0"+A:A}:00`,"shortTime")??`${A}:00`,re=s?B:B.replace(":00","");return{key:`${A}:00`,label:re.trim().replace(" ",`\r
219`),sortable:!0}})],y=Math.max(...T.flatMap(A=>A.data.map(B=>B.y))),j=T.map(A=>({name:A.name,shortName:A.shortName,data:A.data.map(B=>{if(B.y<1)return q(Y({},B),{image:Ri(te("lighterGrey")),style:{opacity:1,backgroundColor:"var(--ww-color-lighterGrey)"}});let re=Yt(B.y,y),rt=1;return re<10?rt=.1:re<100&&(rt=No(re,5)/100),q(Y({},B),{image:Ri(`rgba(2, 63, 178, ${rt})`),style:{opacity:`${rt}`,backgroundColor:"#023fb2"}})})}));return{hasData:!this.isSeriesEmpty(T),series:j,reversedSeries:[...j].reverse(),dataLabelFormatter:E,tooltipFormatter:x,hideLegend:!0,legendItems:[],metric:e,dateRange:`${t.fromDate}-${t.toDate}`,columns:C,rows:S.map(A=>Y({name:A.name},A.data.reduce((B,re,rt)=>q(Y({},B),{[`${rt}:00`]:E?E(re.y):re.y}),{}))).reverse()}}return{series:[],reversedSeries:[],hideLegend:!0,legendItems:[],metric:e,dateRange:"",columns:[],rows:[],pluckCellLabel:null}}isSeriesEmpty(e){if(e.length<1)return!0;let t=e.flatMap(i=>i.data.map(n=>n.y??0));return t.length<1||oe(t)<1}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-visits-distribution"]],hostAttrs:[1,"ww-analytics-visits-distribution"],standalone:!1,features:[I],decls:13,vars:29,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],[1,"ww-analytics-select","ww-analytics-visits-distribution-metrics",3,"click","formControl","data","pluckLabel","searchable","wwEventLogger","wwEventLoggerPluckControlParams"],[1,"ww-analytics-visits-distribution-heatmap","border-separate","border-spacing-1",3,"cursor-pointer"],[1,"ww-analytics-visits-distribution-heatmap","border-separate","border-spacing-1",3,"click"],["wwTypography","caption2","wwColor","darkerGrey",1,"whitespace-break-spaces"],["wwTypography","caption2","wwColor","darkerGrey",1,"uppercase"],[3,"style","wwTooltip","wwTooltipWithTouch"],[3,"wwTooltip","wwTooltipWithTouch"],[1,"print:visible","invisible",2,"height","100%","width","100%",3,"src"]],template:function(t,i){if(t&1&&(O(0),o(1,"async"),O(2),o(3,"async"),u(4,"ww-chart-layout",0),o(5,"async"),o(6,"async"),o(7,"async"),o(8,"async"),o(9,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),u(10,"ww-chart-layout-select")(11,"ww-select",1),R("click",function(s){return s.stopPropagation()}),m()(),g(12,Kp,8,3,"table",2),m()),t&2){let n=P(r(1,13,i.dataMap$));l(2),P(r(3,16,i.fullscreen$)),l(2),p("chartTitle",r(5,19,i.title$))("tooltip",r(6,21,i.tooltip$))("loading",r(7,23,i.loading$))("dataMap",n)("isFullscreen",r(8,25,i.fullscreen$))("showTable",r(9,27,i.fullscreen$)),l(7),p("formControl",i.metricsFormControl)("data",i.metrics)("pluckLabel",i.pluckMetricLabel)("searchable",!1)("wwEventLogger","updated_analytics_metric")("wwEventLoggerPluckControlParams",i.pluckEventLoggerParams),l(),_(n?12:-1)}},dependencies:[be,Te,X,Ie,Ne,ge,_e,Na,it,k],styles:[`.ww-analytics-visits-distribution .ww-chart-layout-graph{overflow:auto;align-items:flex-start}.ww-analytics-visits-distribution .ww-chart-layout-graph .ww-analytics-visits-distribution-heatmap{width:100%}.ww-analytics-visits-distribution .ww-chart-layout-graph .ww-analytics-visits-distribution-heatmap td{width:4%;min-width:4%;height:32px;min-height:32px;text-align:center;border-radius:4px;white-space-collapse:preserve-breaks}.ww-analytics-visits-distribution .ww-chart-layout-loading .ww-chart-layout-graph{align-items:center}
220/*noopvisits-distribution.component-YBBXJIAY.css.map */
221`],encapsulation:2,changeDetection:0})}}return a})();function em(a,d){a&1&&v(0,"ww-chart",1),a&2&&p("options",d)}var Sa=(()=>{class a extends J{constructor(){super(...arguments),this.durationService=w(We),this.chartId="wait-serve-durations",this.loading$=this.analyticsService.loadingState$.pipe(c(e=>e.distributionsData)),this.dataMap$=this.analyticsService.distributionsData$.pipe(c(e=>this.createDataMap(e)),L((e,t)=>W(e,t)),M({bufferSize:1,refCount:!0})),this.chart$=D([this.fullscreen$,this.dataMap$,this.breakpoints.isBelowMobile$]).pipe(c(([e,t,i])=>this.createChart(e,t.entries,t.legendItems,i))),this.title$=b($localize`Wait & serve durations`),this.tooltip$=b($localize`The Wait & serve durations chart shows the frequency of waitlisted and served visits by different duration increments.`)}createDataMap(e){if(!e)return{entries:[],legendItems:[],dateRange:"",columns:[],rows:[]};let t=(s,h,S)=>s<=1?`< ${this.durationService.transform(s,{format:S})}`:s+1>=h?`> ${this.durationService.transform(s,{format:S})}`:`${this.durationService.transform(s,{format:S})} - ${this.durationService.transform(h,{format:S})}`,i=e?.data.find(s=>s.distributionType==="durations")?.data?.map(s=>({range:t(s.lowerBound??0,s.upperBound??0,"short"),rangeLong:t(s.lowerBound??0,s.upperBound??0,"medium"),served:s.serveDurationFrequency??0,waitlisted:s.waitDurationFrequency??0}
221))??[],n=[{key:"range",label:$localize`Range`,sortable:!0},{key:"served",label:$localize`Served`,sortable:!0},{key:"waitlisted",label:$localize`Waitlisted`,sortable:!0}];return{hasData:oe(i.flatMap(s=>s.served+s.waitlisted))>0,hasInternalPadding:!0,entries:i,legendItems:[{key:"waitlisted",color:z["wait-serve-durations-waitlisted"],label:$localize`Waitlisted`},{key:"served",color:z["wait-serve-durations-served"],label:$localize`Served`}],dateRange:`${e.fromDate}-${e.toDate}`,columns:n,rows:i.map(s=>({range:s.rangeLong,waitlisted:s.waitlisted,served:s.served}))}}createChart(e,t,i,n){return this.chartInputs.extend({chart:{parentHeightOffset:0,height:e?"400":"280",events:{click:()=>{n||this.onChartClicked()}}},responsive:[],legend:{show:!1},series:[{name:$localize`Waitlisted`,data:t.map(s=>s.waitlisted)},{name:$localize`Served`,data:t.map(s=>s.served)}],dataLabels:{enabled:!1},colors:i.map(s=>s.color),stroke:{curve:"straight"},xAxis:{type:"category",categories:t.map(s=>s.range),axisBorder:{show:e},axisTicks:{show:!0,offsetY:e?0:-1,color:te("darkerGrey")},labels:{style:{colors:te("darkerGrey"),fontWeight:200}},title:e?{text:$localize`Duration range`,style:{color:te("darkerGrey"),fontWeight:200}}:{}},yAxis:{show:!1,axisBorder:{show:e},axisTicks:{show:e},labels:{show:e,style:{colors:te("darkerGrey"),fontWeight:200}},title:{text:e?$localize`Waitlisted / Served`:$localize`Frequency`,style:{color:te("darkerGrey"),fontWeight:200}}}},this.chartInputs.area)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-wait-serve-durations"]],hostAttrs:[1,"ww-analytics-wait-serve-durations"],standalone:!1,features:[I],decls:9,vars:21,consts:[[3,"exported","titleClicked","chartClicked","chartTitle","tooltip","loading","dataMap","isFullscreen","showTable"],["preset","area",3,"options"]],template:function(t,i){if(t&1&&(u(0,"ww-chart-layout",0),o(1,"async"),o(2,"async"),o(3,"async"),o(4,"async"),o(5,"async"),o(6,"async"),R("exported",function(){return i.export()})("titleClicked",function(){return i.onTitleClicked()})("chartClicked",function(){return i.onChartClicked()}),g(7,em,1,1,"ww-chart",1),o(8,"async"),m()),t&2){let n;p("chartTitle",r(1,7,i.title$))("tooltip",r(2,9,i.tooltip$))("loading",r(3,11,i.loading$))("dataMap",r(4,13,i.dataMap$))("isFullscreen",r(5,15,i.fullscreen$))("showTable",r(6,17,i.fullscreen$)),l(7),_((n=r(8,19,i.chart$))?7:-1,n)}},dependencies:[Me,X,k],encapsulation:2,changeDetection:0})}}return a})();function im(a,d){if(a&1&&v(0,"ww-date-range-picker",0),a&2){let e=f(),t=F(0),i=f(),n=f();p("filters",e)("formControl",n.dateRangePickerFormControl)("min",i)("wwTypography","button")("size",t)}}function am(a,d){if(a&1&&(O(0),o(1,"async"),g(2,im,1,5,"ww-date-range-picker",0)),a&2){let e=P(r(1,1,f(2).size$));l(2),_(e?2:-1)}}function nm(a,d){if(a&1&&(g(0,am,3,4),o(1,"async")),a&2){let e,t=f();_((e=r(1,1,t.dateRangeFilters$))?0:-1,e)}}var va=(()=>{class a extends gt{constructor(){super(),this.breakpoints=w(Le),this.accountRx=w(It),this.analyticsService=w(ae),this.eventLogger=w(Ha),this.defaultDateRangeMinDate=new Date(2023,0,1),this.defaultDateRangeFilters=jr,this.dateRangePickerFormControl=new Oe(null),this.size$=this.breakpoints.isBelowSmall$.pipe(c(e=>e?"full":"auto")),this.maxAnalyticsHistoricalDays$=this.accountRx.getAccount(["features"]).pipe(c(e=>e.features.maxAnalyticsHistoricalDays)),this.dateRangeMinDate$=this.maxAnalyticsHistoricalDays$.pipe(c(e=>e?xt(Ia(),e):this.defaultDateRangeMinDate)),this.dateRangeFilters$=this.dateRangeMinDate$.pipe(c(e=>this.defaultDateRangeFilters.filter(t=>t.createDateRange().start.getTime()>=e.getTime()))),this.dateRange$=Ye(this.dateRangePickerFormControl).pipe(Ke(ue),Ke(e=>e.start.getTime()<=e.end.getTime())),this.subscribeToDateRange()}subscribeToDateRange(){this.dateRange$.pipe(Xe(this.ngOnDestroy$)).subscribe(e=>{let t=this.defaultDateRangeFilters.find(i=>W(i.createDateRange(),e));this.analyticsService.setDateRange(q(Y({},e),{id:t?.id??wi.id})),this.eventLogger.log("updated_analytics_date_range",{params:{range:t?.id??wi.id}}),t&&t.id!==wi.id?(this.analyticsService.persistFormControlValue("date-range",t.id),this.analyticsService.persistFormControlValue("date-start",null),this.analyticsService.persistFormControlValue("date-end",null)):(this.analyticsService.persistFormControlValue("date-range",null),this.analyticsService.persistFormControlValue("date-start",e.start.toISOString()),this.analyticsService.persistFormControlValue("date-end",e.end.toISOString()))})}syncDateRangeWithQueryParams(){let e=ei.createDateRange(),t=this.analyticsService.getInitialFormControlValue("date-range",wi.id,Dt),i=this.analyticsService.getInitialFormControlValue("date-start",e.start.toISOString(),Sn),n=this.analyticsService.getInitialFormControlValue("date-end",e.end.toISOString(),Sn),s=this.defaultDateRangeFilters.find(S=>S.id===t),h=s&&s.id!==wi.id?s.createDateRange():cr({start:i,end:n});h.start.getTime()<this.defaultDateRangeMinDate.getTime()&&(h.start=this.defaultDateRangeMinDate),this.dateRangePickerFormControl.setValue(h)}ngOnInit(){this.syncDateRangeWithQueryParams()}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-date-range-picker"]],hostAttrs:[1,"ww-analytics-date-range-picker"],standalone:!1,features:[I],decls:2,vars:3,consts:[[1,"flex","flex-col","items-start","w-full",3,"filters","formControl","min","wwTypography","size"]],template:function(t,i){if(t&1&&(g(0,nm,2,3),o(1,"async")),t&2){let n;_((n=r(1,1,i.dateRangeMinDate$))?0:-1,n)}},dependencies:[be,Te,pr,it,k],styles:[`.ww-analytics-date-range-picker{display:flex;flex-direction:column}.ww-breakpoints-below-small .ww-analytics-date-range-picker .ww-form-field{width:100%}.ww-breakpoints-below-small .ww-analytics-date-range-picker .ww-form-field .ww-form-field-control{justify-content:flex-start}
222/*noopanalytics-date-range-picker.component-5HKMVTJJ.css.map */
223`],encapsulation:2,changeDetection:0})}}return a})();var pm=()=>({order:110}),mm=()=>({order:120}),dm=()=>({});function um(a,d){if(a&1&&(u(0,"div",0),v(1,"ww-analytics-date-range-picker",2)(2,"ww-page-filter-button",3),m()),a&2){let e=f(2);l(2),p("buttonType","secondary")("store",e.analyticsFilterStore)("title",e.filterTitle)}}function hm(a,d){if(a&1&&v(0,"ww-page-filter-button",6),a&2){let e=f(3);p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function fm(a,d){a&1&&v(0,"ww-analytics-date-range-picker",7)}function ym(a,d){a&1&&Re(0,hm,1,2,"ww-page-filter-button",4)(1,fm,1,0,"ww-analytics-date-range-picker",5),a&2&&(p("wwLayoutTertiaryAction",Zt(2,pm)),l(),p("wwLayoutTertiaryAction",Zt(3,mm)))}function Cm(a,d){if(a&1&&(u(0,"ww-page-toolbar"),v(1,"ww-page-filter-chips",8),m()),a&2){let e=f(2);l(),p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function wm(a,d){a&1&&Qe(0)}function gm(a,d){if(a&1&&(Re(0,wm,1,0,"ng-container",9),o(1,"async")),a&2){let e=f(),t=f();p("ngComponentOutlet",e)("ngComponentOutletInputs",r(1,2,t.chartInputs$)??Zt(4,dm))}}function _m(a,d){a&1&&Qe(0)}function Sm(a,d){if(a&1&&Re(0,_m,1,0,"ng-container",10),a&2){let e=f();p("ngComponentOutlet",e)}}function vm(a,d){if(a&1&&(g(0,um,3,3,"div",0),o(1,"async"),ke(2,ym,2,4),g(3,Cm,2,2,"ww-page-toolbar"),o(4,"async"),u(5,"div",1),g(6,gm,2,5,"ng-container"),o(7,"async"),ke(8,Sm,1,1,"ng-container"),m()),a&2){let e=f();_(r(1,3,e.breakpoints.isBelowSmall$)?0:2),l(3),_(r(4,5,e.analyticsFilterStore.hasData$)?3:-1),l(3),_(r(7,7,e.hash$)?6:8)}}var Am={"average-durations":Yi,"csat-by-location":Gi,"csat-by-resource":Ui,"csat-by-service":Hi,"csat-distribution":ji,"csat-response-trend":qi,"csat-responses":Xi,"customer-distribution":Qi,"customer-path":ni,"customer-registrations":Zi,"dropoff-by-position":Ji,dropoffs:ea,"financials-locations":ta,"financials-service-price":ia,"financials-value-costs":aa,"input-field":na,"line-length":oa,"message-recipient":sa,"message-details":ra,"message-type":la,"operations-resources":ca,"operations-service-combinations":pa,"operations-services":ma,"operations-users":da,"placeholder-funnel":ua,"placeholder-table":ha,"placeholder-traffic":fa,"top-visited-locations":ya,"traffic-by-period":oi,"visits-by-creator-source":Ca,"visits-by-label":wa,"visits-by-location":ga,"visits-distribution":_a,"wait-serve-durations":Sa},so=(()=>{class a extends gt{constructor(){super(),this.analyticsFilterStore=w(Ti),this.breakpoints=w(Le),this.layout=w(Ht),this.activatedRoute=w(li),this.analyticsService=w(ae),this.filterTitle=$localize`Filter analytics`,this.currentTab$=this.activatedRoute.params.pipe(c(e=>e.tab)),this.currentChart$=this.activatedRoute.params.pipe(c(e=>e.chart)),this.hash$=this.activatedRoute.params.pipe(c(e=>e.hash)),this.chartInputs$=this.hash$.pipe(c(e=>({hash:e}))),this.chartComponent$=this.currentChart$.pipe(c(e=>Am[e])),this.queryStringArgs$=D([this.currentTab$,this.analyticsService.dateRange$,this.analyticsFilterStore.queryParams$.pipe(L((e,t)=>W(e,t)))]).pipe(ki(0,gn),c(([e,t,i])=>({tab:e,dateRange:t,queryParams:i}
223))),this.layout.updateFeatureContext({name:$localize`Some chart name`,parentPath:"account/analytics"}),this.subscribe()}subscribe(){this.queryStringArgs$.pipe(ki(Yr,gn),Xe(this.ngOnDestroy$)).subscribe(e=>{let t=new URLSearchParams(window.location.search);for(let[n,s]of Object.entries(e.queryParams))t.set(n,s);let i=t.size>0?`?${t.toString()}`:"";this.layout.updateFeatureContext({parentPath:`account/analytics/${e.tab}${i}`})})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-chart"]],hostAttrs:[1,"ww-analytics-chart","flex","flex-col","small:gap-6","gap-4","below-small:px-4"],standalone:!1,features:[I],decls:2,vars:3,consts:[[1,"flex","items-center","justify-between","gap-2","small:px-4"],["wwBorderColor","mediumGrey","wwLayoutPadding","",1,"flex","flex-col","small:gap-6","gap-4","border-t"],[1,"w-full"],[3,"buttonType","store","title"],[3,"store","title",4,"wwLayoutTertiaryAction"],["class","ml-1",4,"wwLayoutTertiaryAction"],[3,"store","title"],[1,"ml-1"],[1,"small:pl-6",3,"store","title"],[4,"ngComponentOutlet","ngComponentOutletInputs"],[4,"ngComponentOutlet"]],template:function(t,i){if(t&1&&(g(0,vm,9,9),o(1,"async")),t&2){let n;_((n=r(1,1,i.chartComponent$))?0:-1,n)}},dependencies:[ka,qa,Ka,Za,Ja,Xa,ge,va,k],encapsulation:2,changeDetection:0})}}return a})();var He=(()=>{class a extends gt{constructor(){super(...arguments),this.layout=w(Ht)}ngOnInit(){this.layout.updateFeatureContext({name:$localize`Analytics`})}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275dir=si({type:a,features:[I]})}}return a})();function bm(a,d){if(a&1&&v(0,"ww-analytics-csat-by-resource",6),a&2){f();let e=F(9);yt("medium:col-span-3",e)}}function Tm(a,d){if(a&1&&v(0,"ww-analytics-csat-by-service",6),a&2){f();let e=F(7);yt("medium:col-span-3",e)}}function Dm(a,d){if(a&1&&(u(0,"ww-card",0)(1,"div",1),v(2,"ww-analytics-csat-metric-average")(3,"ww-analytics-csat-metric-responses")(4,"ww-analytics-csat-metric-response-rate")(5,"ww-analytics-csat-metric-response-feedback")(6,"ww-analytics-csat-metric-feedback-rate"),m()(),O(7),o(8,"async"),O(9),o(10,"async"),u(11,"div",2),v(12,"ww-analytics-csat-distribution",3)(13,"ww-analytics-csat-by-location",4),g(14,bm,1,2,"ww-analytics-csat-by-resource",5),g(15,Tm,1,2,"ww-analytics-csat-by-service",5),v(16,"ww-analytics-csat-response-trend",6)(17,"ww-analytics-csat-responses",6),m()),a&2){let e=f();l(7);let t=P(r(8,2,e.analyticsService.hasResources$));l(2);let i=P(r(10,5,e.analyticsService.hasServices$));l(5),_(t?14:-1),l(),_(i?15:-1)}}var lo=(()=>{class a extends He{constructor(){super(...arguments),this.analyticsService=w(ae),this.permissionRx=w(Ya),this.hasSurveyPermissions$=this.permissionRx.hasPermission("surveys.show")}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-csat"]],hostAttrs:[1,"ww-analytics-csat","ww-analytics-tab"],standalone:!1,features:[I],decls:2,vars:3,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-5","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"grid","grid-cols-6","small:gap-6","gap-4"],[1,"medium:col-span-2","col-span-6"],[1,"medium:col-span-4","col-span-6"],[1,"col-span-6",3,"medium:col-span-3"],[1,"col-span-6"]],template:function(t,i){t&1&&(g(0,Dm,18,8),o(1,"async")),t&2&&_(r(1,1,i.hasSurveyPermissions$)?0:-1)},dependencies:[mt,ge,Gi,Ui,Hi,ji,Gn,Un,Hn,jn,qn,qi,Xi,k],encapsulation:2,changeDetection:0})}}return a})();var co="analytics-financials-bubble-hidden";function $m(a,d){if(a&1){let e=ie();u(0,"ww-info-bubble",1)(1,"div",4)(2,"span"),Da(3,0),v(4,"ww-link",5),u(5,"ww-link",6),R("click",function(){G(e);let i=f();return U(i.intercom.showArticle(10006688))}),m(),$a(),m(),u(6,"button",7),R("click",function(){G(e);let i=f();return U(i.hideBubble())}),v(7,"ww-icon",8),m()()()}a&2&&(l(4),p("inline",!0),l(),p("inline",!0))}function km(a,d){a&1&&(u(0,"div",2),v(1,"ww-analytics-financials-value-costs",9)(2,"ww-analytics-financials-locations")(3,"ww-analytics-financials-service-price"),m())}function Lm(a,d){a&1&&(u(0,"div",3),v(1,"ww-analytics-financials-value-costs")(2,"ww-analytics-financials-locations")(3,"ww-analytics-financials-service-price"),m())}var po=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le),this.intercom=w(Dr),this.bubbleHidden=Io(co,!1,xo)}hideBubble(){Mo(co,!0),this.bubbleHidden=!0}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-financials"]],hostAttrs:[1,"ww-analytics-financials","ww-analytics-tab"],standalone:!1,features:[I],decls:4,vars:4,consts:()=>{let e;e=$localize`service options`;let t;t=$localize`Learn more`;let i;i=$localize`Hide`;let n;n=$localize`Hide`;let s;return s=$localize`To view revenue data, set up revenue tracking in ${"\uFFFD#4\uFFFD"}:START_TAG_WW_LINK:${"[\uFFFD/#4\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_WW_LINK: in location settings. ${"\uFFFD#5\uFFFD"}:START_TAG_WW_LINK_1:${"[\uFFFD/#4\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_WW_LINK:`,s=To(s),[s,[1,"!max-w-full","!w-full"],[1,"grid","grid-cols-2","gap-6"],[1,"flex","flex-col","small:gap-6","gap-4"],[1,"flex","items-center","justify-between","w-full"],["type","router-link","href","/settings/services/service-options","content",e,3,"inline"],["type","external-in-same-tab","content",t,3,"click","inline"],["aria-label",i,"title",n,3,"click"],["icon","bx-x"],[1,"col-span-2"]]},template:function(t,i){t&1&&(g(0,$m,8,2,"ww-info-bubble",1),g(1,km,4,0,"div",2),o(2,"async"),ke(3,Lm,4,0,"div",3)),t&2&&(_(i.bubbleHidden?-1:0),l(),_(r(2,2,i.breakpoints.isAboveLarge$)?1:3))},dependencies:[Ut,lr,gi,ta,ia,aa,k],encapsulation:2,changeDetection:0})}}return a})();function Em(a,d){a&1&&(u(0,"div",1),v(1,"ww-analytics-dropoff-by-position",2)(2,"ww-analytics-dropoffs",3),m(),u(3,"div",1),v(4,"ww-analytics-customer-path",3)(5,"ww-analytics-line-length",2),m(),u(6,"div",1),v(7,"ww-analytics-visits-by-creator-source",3)(8,"ww-analytics-wait-serve-durations",2),m(),u(9,"div",4),v(10,"ww-analytics-average-durations"),m())}function Rm(a,d){a&1&&(u(0,"div",0),v(1,"ww-analytics-dropoff-by-position")(2,"ww-analytics-dropoffs")(3,"ww-analytics-customer-path")(4,"ww-analytics-line-length")(5,"ww-analytics-visits-by-creator-source")(6,"ww-analytics-wait-serve-durations")(7,"ww-analytics-average-durations"),m())}var mo=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-guest-experience"]],hostAttrs:[1,"ww-analytics-guest-experience","ww-analytics-tab"],standalone:!1,features:[I],decls:3,vars:3,consts:[[1,"flex","flex-col","small:gap-6","gap-4"],[1,"grid","grid-cols-3","gap-6"],[1,"col-span-2"],[1,"col-span-1"],[1,"flex","flex-col","gap-6"]],template:function(t,i){t&1&&(g(0,Em,11,0),o(1,"async"),ke(2,Rm,8,0,"div",0)),t&2&&_(r(1,1,i.breakpoints.isAboveMedium$)?0:2)},dependencies:[Yi,ni,Ji,ea,oa,Ca,Sa,k],encapsulation:2,changeDetection:0})}}return a})();var uo=(()=>{class a{static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-placeholder-graph"]],hostAttrs:[1,"ww-placeholder-graph","flex","grow","
223justify-center","items-center"],standalone:!1,decls:4,vars:6,consts:[[1,"flex","flex-row","items-end","gap-2"],[3,"width","height"]],template:function(t,i){t&1&&(u(0,"div",0),v(1,"ww-skeleton-placeholder",1)(2,"ww-skeleton-placeholder",1)(3,"ww-skeleton-placeholder",1),m()),t&2&&(l(),p("width",32)("height",64),l(),p("width",32)("height",128),l(),p("width",32)("height",96))},dependencies:[K],encapsulation:2,changeDetection:0})}}return a})();function xm(a,d){a&1&&(u(0,"div",2),v(1,"ww-analytics-placeholder-graph"),m())}function Im(a,d){a&1&&(u(0,"div",3),v(1,"ww-illustration",5),u(2,"span",6),ee(3,0),m()())}function Mm(a,d){if(a&1&&v(0,"ww-analytics-input-field",7),a&2){let e=d.$implicit;p("hash",e)}}function Bm(a,d){if(a&1&&(u(0,"div",4),Be(1,Mm,1,1,"ww-analytics-input-field",7,Rt),o(3,"async"),m()),a&2){let e=f();l(),Fe(r(3,0,e.hashes$))}}var ho=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le),this.analyticsService=w(ae),this.layoutComponent=w(Si),this.pageEventSub=new $e(vt),this.pageEvent$=this.pageEventSub.pipe(Ke(e=>e!==null),ci(["pageIndex","pageSize","length"])),this.loadingSub=new $e(!0),this.loading$=this.loadingSub.asObservable(),this.dataRows$=this.analyticsService.reportDataForDataFields$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.dataFieldNameHashed&&t.dataFieldNameHashed.length>0&&t.dataFieldName&&t.dataFieldName.length>0).sort((t,i)=>t.dataFieldName.localeCompare(i.dataFieldName))),this.updateLoadingState()),this.hashes$=mi(this.dataRows$.pipe(c(e=>e.map(t=>t.dataFieldNameHashed??null).filter(le)),c(e=>Ze(e))),this.pageEvent$),this.noMoreFields$=D([this.hashes$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length)),this.noInputFields$=this.dataRows$.pipe(c(e=>e.length===0))}updateLoadingState(){return e=>e.pipe(Ta(()=>this.loadingSub.next(!1)),Aa(()=>this.loadingSub.next(!1)))}onScrolledToEnd(){this.pageEventSub.next(q(Y({},vt),{pageSize:this.pageEventSub.value.pageSize+vt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-input-fields"]],hostAttrs:[1,"ww-analytics-input-fields","ww-analytics-tab"],standalone:!1,features:[I],decls:9,vars:14,consts:()=>{let e;return e=$localize`No data available`,[e,[1,"overflow-y-auto","h-full",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"w-full"],[1,"flex","flex-col","items-center","justify-center","gap-2","w-full","min-h-96"],[1,"grid","medium:grid-cols-3","small:grid-cols-2","grid-cols-1","small:gap-6","gap-4"],["icon","ww-analytics-chart-no-data-partial","color","mediumGrey"],["wwColor","mediumGrey"],[3,"hash"]]},template:function(t,i){t&1&&(u(0,"ww-infinite-scroll",1),o(1,"async"),o(2,"async"),o(3,"async"),R("scrolledToEnd",function(){return i.onScrolledToEnd()}),g(4,xm,2,0,"div",2),o(5,"async"),o(6,"async"),ke(7,Im,4,0,"div",3)(8,Bm,4,2,"div",4),m()),t&2&&(p("disabled",r(1,4,i.noMoreFields$))("scrollElement",r(2,6,i.layoutComponent.scrollElement$))("overflowElement",r(3,8,i.layoutComponent.overflowElement$)),l(4),_(r(5,10,i.loading$)?4:r(6,12,i.noInputFields$)?7:8))},dependencies:[ge,hi,fi,uo,na,k],encapsulation:2,changeDetection:0})}}return a})();var fo=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-messages"]],hostAttrs:[1,"ww-analytics-messages","ww-analytics-tab"],standalone:!1,features:[I],decls:12,vars:0,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"grid","grid-cols-4","small:gap-6","gap-4"],[1,"medium:col-span-2","col-span-4"],[1,"medium:col-span-1","small:col-span-2","col-span-4"]],template:function(t,i){t&1&&(u(0,"ww-card",0)(1,"div",1),v(2,"ww-analytics-alerts-messages")(3,"ww-analytics-alerts-messages-per-customer")(4,"ww-analytics-alerts-sms-automatic")(5,"ww-analytics-alerts-sms-triggered")(6,"ww-analytics-alerts-sms-custom")(7,"ww-analytics-alerts-messages-segments"),m()(),u(8,"div",2),v(9,"ww-analytics-message-details",3)(10,"ww-analytics-message-type",4)(11,"ww-analytics-message-recipient",4),m())},dependencies:[mt,ge,Fn,On,Nn,Vn,Pn,zn,ra,sa,la],encapsulation:2,changeDetection:0})}}return a})();var Fm=(a,d)=>d.hash;
223function Om(a,d){a&1&&(u(0,"div",4),v(1,"ww-analytics-visits-by-location",5)(2,"ww-analytics-visits-by-label"),m())}function Nm(a,d){a&1&&v(0,"ww-analytics-visits-by-location")(1,"ww-analytics-visits-by-label")}function Vm(a,d){if(a&1&&(g(0,Om,3,0,"div",4),o(1,"async"),ke(2,Nm,2,0)),a&2){let e=f();_(r(1,1,e.breakpoints.isAboveMobile$)?0:2)}}function Pm(a,d){a&1&&v(0,"ww-analytics-visits-by-location")}function zm(a,d){if(a&1&&v(0,"ww-analytics-operations-resources",3),a&2){let e=d.$implicit;p("hash",e.hash)("categoryName",e.name)}}var yo=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le),this.labelRx=w(_i),this.layoutComponent=w(Si),this.analyticsService=w(ae),this.pageEventSub=new $e(vt),this.pageEvent$=this.pageEventSub.pipe(Ke(e=>e!==null),ci(["pageIndex","pageSize","length"])),this.dataRows$=this.analyticsService.resourcesReportData$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.resourceCategoryNameHashed&&t.resourceCategoryNameHashed.length>0&&t.resourceName&&t.resourceName.length>0).sort((t,i)=>t.resourceCategoryName.localeCompare(i.resourceCategoryName)))),this.resourceCategories$=mi(this.dataRows$.pipe(c(e=>e.filter(t=>t.resourceCategoryNameHashed&&t.resourceCategoryNameHashed.length>0).map(t=>({hash:t.resourceCategoryNameHashed??null,name:t.resourceCategoryName}))),c(e=>Ze(e,(t,i)=>t.hash===i.hash))),this.pageEvent$),this.noMoreFields$=D([this.resourceCategories$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length))}onScrolledToEnd(){this.pageEventSub.next(q(Y({},vt),{pageSize:this.pageEventSub.value.pageSize+vt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-operations"]],hostAttrs:[1,"ww-analytics-operations","ww-analytics-tab"],standalone:!1,features:[I],decls:14,vars:14,consts:[[1,"overflow-y-auto","h-full","gap-6",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"flex","flex-col","small:gap-6","gap-4"],[1,"grid","medium:grid-cols-2","grid-cols-1","gap-6"],[3,"hash","categoryName"],[1,"grid","gap-6","medium:grid-cols-3","grid-cols-1"],[1,"medium:col-span-2"]],template:function(t,i){if(t&1&&(u(0,"ww-infinite-scroll",0),o(1,"async"),o(2,"async"),o(3,"async"),R("scrolledToEnd",function(){return i.onScrolledToEnd()}),O(4),o(5,"async"),u(6,"div",1),g(7,Vm,3,3)(8,Pm,1,0,"ww-analytics-visits-by-location"),v(9,"ww-analytics-operations-users"),u(10,"div",2),Be(11,zm,1,2,"ww-analytics-operations-resources",3,Fm),o(13,"async"),m()()()),t&2){p("disabled",r(1,4,i.noMoreFields$))("scrollElement",r(2,6,i.layoutComponent.scrollElement$))("overflowElement",r(3,8,i.layoutComponent.overflowElement$));let n=r(5,10,i.labelRx.hasLabels$);l(7),_(n?7:8),l(4),Fe(r(13,12,i.resourceCategories$))}},dependencies:[fi,ca,da,wa,ga,k],encapsulation:2,changeDetection:0})}}return a})();var Co=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-overview"]],hostAttrs:[1,"ww-analytics-overview","ww-analytics-tab"],standalone:!1,features:[I],decls:12,vars:0,consts:[["wwBorderColor","mediumGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","small:gap-6","gap-4"],[1,"medium:col-span-2"],[1,"medium:col-span-1"],[1,"medium:col-span-3"]],template:function(t,i){t&1&&(u(0,"ww-card",0)(1,"div",1),v(2,"ww-analytics-overview-bookings")(3,"ww-analytics-overview-waitlist")(4,"ww-analytics-overview-served")(5,"ww-analytics-overview-waittimes")(6,"ww-analytics-overview-dropoff")(7,"ww-analytics-overview-messages"),m()(),u(8,"div",2),v(9,"ww-analytics-traffic-by-period",3)(10,"ww-analytics-customer-path",4)(11,"ww-analytics-top-visited-locations",5),m())},dependencies:[mt,ge,ni,Zn,Jn,eo,io,ao,no,ya,oi],encapsulation:2,changeDetection:0})}}return a})();function Gm(a,d){if(a&1&&(u(0,"ww-bullet-list-item"),H(1),m()),a&2){let e=d.$implicit;l(),we(e)}}function Um(a,d){if(a&1&&(u(0,"ww-bullet-list",8),Be(1,Gm,2,1,"ww-bullet-list-item",null,Rt),o(3,"async"),m()),a&2){let e=f(2);l(),Fe(r(3,0,e.bulletPoints$))}}function Hm(a,d){a&1&&Qe(0)}function jm(a,d){if(a&1&&(u(0,"div",4)(1,"div",5)(2,"ww-call-out",6)(3,"ww-call-out-title"),H(4),o(5,"async"),m(),u(6,"ww-call-out-content",7)(7,"p"),H(8),o(9,"async"),m(),g(10,Um,4,2,"ww-bullet-list",8),o(11,"async"),m(),u(12,"ww-call-out-actions"),Re(13,Hm,1,0,"ng-container",9),m()()()(),u(14,"div",10)(15,"ww-card",11)(16,"div",12),v(17,"ww-analytics-overview-placeholder",13)(18,"ww-analytics-overview-placeholder")(19,"ww-analytics-overview-placeholder",13)(20,"ww-analytics-overview-placeholder")(21,"ww-analytics-overview-placeholder",13)(22,"ww-analytics-overview-placeholder"),m()(),u(23,"div",14),v(24,"ww-analytics-placeholder-traffic",15)(25,"ww-analytics-placeholder-funnel",16)(26,"ww-analytics-placeholder-table",17),m()()),a&2){let e=f(),t=st(4);l(2),p("backgroundColor","upgrade2")("illustration","ww-analytics-upgrade"),l(2),we(r(5,9,e.title$)),l(4),Ve(" ",r(9,11,e.description$)," "),l(2),_(r(11,13,e.breakpoints.isAboveMobile$)?10:-1),l(3),p("wwOutlet",t),l(4),p("positive",!0),l(2),p("positive",!0),l(2),p("positive",!0)}}function qm(a,d){a&1&&Qe(0)}function Km(a,d){if(a&1&&(u(0,"div",3)(1,"div",18),v(2,"ww-illustration",19),u(3,"div",20)(4,"h3"),H(5),o(6,"async"),m(),u(7,"p",21),H(8),o(9,"async"),m()()(),u(10,"div",20),Re(11,qm,1,0,"ng-container",9),m()()),a&2){let e=f(),t=st(4);l(5),we(r(6,3,e.title$)),l(3),Ve(" ",r(9,5,e.description$)," "),l(3),p("wwOutlet",t)}}function Xm(a,d){if(a&1){let e=ie();u(0,"a",24),R("click",function(){G(e);let i=f(2);return U(i.upgrade())}),Da(1,2),v(2,"ww-icon",25),$a(),m()}}function Qm(a,d){if(a&1&&(g(0,Xm,3,0,"a",22),o(1,"async"),u(2,"a",23),ee(3,1),m()),a&2){let e=f();_(r(1,1,e.featuresRx.withBilling$)?0:-1)}}var $i=(()=>{class a extends He{constructor(){super(),this.breakpoints=w(Le),this.featuresRx=w(Tr),this.accountRx=w(It),this.internalLinks=w($r),this.router=w(zt),this.enableAnalytics$=this.accountRx.hasAccountFeature
223("enableAnalytics"),this.enableAdvancedAnalytics$=this.accountRx.hasAccountFeature("enableAdvancedAnalytics"),this.title$=this.enableAnalytics$.pipe(c(e=>e?$localize`Upgrade to Business plan to access more analytics`:$localize`Upgrade to Starter plan to access analytics`)),this.description$=this.enableAnalytics$.pipe(c(e=>e?$localize`The Business plan allows for up to 10 locations and 1,000 visits per location per month included. With advanced analytics, API access, and custom user roles, the Business plan gives you full control of every location’s operations and customer experience.`:$localize`The Starter plan comes with 4 locations and up to 3,000 visits/mo. It equips you with everything you need to manage your growing business, including high-level analytics and customizable communication tools`)),this.bulletPoints$=this.enableAnalytics$.pipe(c(e=>e?[$localize`Build customized experiences with API and webhooks`,$localize`Access advanced analytics and 365 days of data`,$localize`Create custom user roles that fit your needs`]:[$localize`Analyze and compare data across locations`,$localize`Customize default customer messages`,$localize`Initiate customer chats`])),this.subscribe()}subscribe(){this.enableAdvancedAnalytics$.subscribe(e=>{e&&this.router.navigate(["/account"])})}upgrade(){this.internalLinks.navigateToUpgrade()}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-paywall"]],hostAttrs:[1,"ww-analytics-paywall","ww-analytics-tab"],standalone:!1,features:[I],decls:5,vars:3,consts:()=>{let e;e=$localize` Learn more `;let t;return t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_WW_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_WW_ICON: Upgrade `,[["actionsTmpl",""],e,t,[1,"ww-analytics-paywall-background","flex","flex-col","flex-grow","justify-between","gap-4","p-6"],[1,"ww-analytics-paywall-overlay","block","absolute","top-0","left-0","w-full","h-full","z-20"],[1,"ww-analytics-paywall-overlay-container","flex","flex-col","items-center","pt-6","small:pt-24","w-full","h-full"],[1,"ww-analytics-paywall-overlay-content",3,"backgroundColor","illustration"],[1,"flex","flex-col","gap-4"],["icon","bx-check-circle"],[4,"wwOutlet"],[1,"z-10"],["wwBackgroundColor","lighterGrey","wwBorderColor","lighterGrey",1,"flex","flex-col"],[1,"grid","medium:grid-cols-6","small:grid-cols-3","grid-cols-2","gap-6","px-6","py-4","ww-analytics-grid-divider-container"],[3,"positive"],[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","gap-6"],[1,"medium:col-span-2"],[1,"medium:col-span-1"],[1,"medium:col-span-3"],[1,"flex","flex-col","gap-2","flex-grow","justify-center"],["icon","ww-analytics-upgrade",1,"ww-analytics-paywall-illustration"],[1,"flex","flex-col","gap-2"],[1,"ww-analytics-paywall-description"],["wwButton","secondary","wwBackgroundColor","black","wwColor","white"],["wwButton","tertiary","href","https://help.waitwhile.com/en/articles/9250541-analytics-overview","target","_blank"],["wwButton","secondary","wwBackgroundColor","black","wwColor","white",3,"click"],["icon","bxs-bolt"]]},template:function(t,i){t&1&&(g(0,jm,27,15),o(1,"async"),ke(2,Km,12,7,"div",3),Re(3,Qm,4,3,"ng-template",null,0,Wt)),t&2&&_(r(1,1,i.breakpoints.isAboveSmall$)?0:2)},dependencies:[Rr,Wr,xr,Ir,rr,sr,ar,mt,ge,Ut,hi,Fa,to,ua,ha,fa,k],styles:[`.ww-analytics-paywall .ww-analytics-paywall-overlay{background-color:#fff3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.ww-analytics-paywall .ww-analytics-paywall-overlay .ww-analytics-paywall-overlay-content{box-shadow:0 4px 8px #0000000f,0 12px 24px #0000000d;-webkit-backdrop-filter:none;backdrop-filter:none;background-color:var(--ww-color-white);max-width:832px}.ww-breakpoints-below-small .ww-analytics-paywall{--top-nav-bar-height: 48px;--layout-header-height: 56px;--layout-bottom-height: 64px;--analytics-date-range-picker-height: 40px;min-height:calc(100vh - var(--berg-layout-top-inset) - var(--top-nav-bar-height) - var(--layout-header-height) - var(--analytics-date-range-picker-height) - var(--layout-bottom-height))}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-background{background:radial-gradient(circle at 50% 50%,var(--ww-color-upgrade2),transparent 100%)}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-illustration{dis
223play:flex;justify-content:center}.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-illustration svg{max-height:160px;max-width:160px}@media screen and (max-height:700px){.ww-breakpoints-below-small .ww-analytics-paywall .ww-analytics-paywall-description{display:none}}
224/*noopanalytics-paywall.component-5HHLM2CZ.css.map */
225`],encapsulation:2,changeDetection:0})}}return a})();var Jm=(a,d)=>d.hash;function ed(a,d){if(a&1&&v(0,"ww-analytics-operations-services",3),a&2){let e=d.$implicit;p("hash",e.hash)("categoryName",e.name)}}var wo=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le),this.analyticsService=w(ae),this.layoutComponent=w(Si),this.pageEventSub=new $e(vt),this.pageEvent$=this.pageEventSub.pipe(Ke(e=>e!==null),ci(["pageIndex","pageSize","length"])),this.dataRows$=this.analyticsService.servicesReportData$.pipe(c(e=>e?.data??[]),c(e=>e.filter(t=>t.serviceCategoryNameHashed&&t.serviceCategoryNameHashed.length>0&&t.serviceName&&t.serviceName.length>0).sort((t,i)=>t.serviceCategoryName.localeCompare(i.serviceCategoryName)))),this.serviceCategories$=mi(this.dataRows$.pipe(c(e=>e.filter(t=>t.serviceCategoryNameHashed&&t.serviceCategoryNameHashed.length>0&&t.serviceName&&t.serviceName.length>0).map(t=>({hash:t.serviceCategoryNameHashed??null,name:t.serviceCategoryName}))),c(e=>Ze(e,(t,i)=>t.hash===i.hash))),this.pageEvent$),this.noMoreFields$=D([this.serviceCategories$,this.pageEventSub]).pipe(c(([e,t])=>t.pageSize>e.length))}onScrolledToEnd(){this.pageEventSub.next(q(Y({},vt),{pageSize:this.pageEventSub.value.pageSize+vt.pageSize}))}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-services"]],hostAttrs:[1,"ww-analytics-services","ww-analytics-tab"],standalone:!1,features:[I],decls:9,vars:11,consts:[[1,"overflow-y-auto","h-full",3,"scrolledToEnd","disabled","scrollElement","overflowElement"],[1,"grid","medium:grid-cols-2","grid-cols-1","small:gap-6","gap-4"],[1,"medium:col-span-2"],[3,"hash","categoryName"]],template:function(t,i){t&1&&(u(0,"ww-infinite-scroll",0),o(1,"async"),o(2,"async"),o(3,"async"),R("scrolledToEnd",function(){return i.onScrolledToEnd()}),u(4,"div",1),v(5,"ww-analytics-operations-service-combinations",2),Be(6,ed,1,2,"ww-analytics-operations-services",3,Jm),o(8,"async"),m()()),t&2&&(p("disabled",r(1,3,i.noMoreFields$))("scrollElement",r(2,5,i.layoutComponent.scrollElement$))("overflowElement",r(3,7,i.layoutComponent.overflowElement$)),l(6),Fe(r(8,9,i.serviceCategories$)))},dependencies:[fi,pa,ma,k],encapsulation:2,changeDetection:0})}}return a})();var go=(()=>{class a extends He{constructor(){super(...arguments),this.breakpoints=w(Le)}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=V(a)))(i||a)}})()}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics-visits"]],hostAttrs:[1,"ww-analytics-visits","ww-analytics-tab"],standalone:!1,features:[I],decls:5,vars:0,consts:[[1,"medium:grid","medium:grid-cols-3","below-medium:flex","below-medium:flex-col","small:gap-6","gap-4"],[1,"medium:col-span-2"],[1,"medium:col-span-1"]],template:function(t,i){t&1&&(u(0,"div",0),v(1,"ww-analytics-traffic-by-period",1)(2,"ww-analytics-customer-distribution",2)(3,"ww-analytics-customer-registrations",2)(4,"ww-analytics-visits-distribution",1),m())},dependencies:[Qi,Zi,oi,_a],encapsulation:2,changeDetection:0})}}return a})();var td=()=>({order:110}),id=()=>({order:120});function ad(a,d){if(a&1&&(u(0,"div",1),v(1,"ww-analytics-date-range-picker",2)(2,"ww-page-filter-button",3),m()),a&2){let e=f(2);l(2),p("buttonType","secondary")("store",e.analyticsFilterStore)("title",e.filterTitle)}}function nd(a,d){if(a&1&&(g(0,ad,3,3,"div",1),o(1,"async")),a&2){let e=f();_(r(1,1,e.withFilter$)?0:-1)}}function od(a,d){if(a&1&&v(0,"ww-page-filter-button",6),a&2){let e=f(3);p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function rd(a,d){a&1&&v(0,"ww-analytics-date-range-picker",7)}function sd(a,d){a&1&&Re(0,od,1,2,"ww-page-filter-button",4)(1,rd,1,0,"ww-analytics-date-range-picker",5),a&2&&(p("wwLayoutTertiaryAction",Zt(2,td)),l(),p("wwLayoutTertiaryAction",Zt(3,id)))}function ld(a,d){if(a&1&&(g(0,sd,2,4),o(1,"async")),a&2){let e=f();_(r(1,1,e.withFilter$)?0:-1)}}function cd(a,d){a&1&&(u(0,"a",9)(1,"span"),ee(2,0),m()())}function pd(a,d){a&1&&Qe(0)}function md(a,d){if(a&1){let e=ie();u(0,"a",13),R("click",function(){let i=G(e).$implicit,n=f(3);return U(n.onTabClick(i.segment))}),Re(1,pd,1,0,"ng-container",14),m()}if(a&2){let e=d.$implicit,t=f();ko("ww-analytics-tab-"+e.segment),p("active",e.segment===t.segment)("label",e.title.text),l(),p("wwOutlet",e.title.component)}}function dd(a,d){if(a&1&&(u(0,"ww-page-toolbar"),v(1,"ww-page-filter-chips",6),m()),a&2){let e=f(4);l(),p("store",e.analyticsFilterStore)("title",e.filterTitle)}}function ud(a,d){if(a&1&&(g(0,dd,2,2,"ww-page-toolbar"),o(1,"async")),a&2){let e=f(3);_(r(1,1,e.analyticsFilterStore.hasData$)?0:-1)}}function hd(a,d){a&1&&Qe(0)}function fd(a,d){if(a&1&&(u(0,"ww-tab-bar",8),O(1),o(2,"async"),g(3,cd,3,0,"a",9),Be(4,md,2,5,"a",10,Nt),o(6,"async"),m(),u(7,"div",11),g(8,ud,2,3),o(9,"async"),Re(10,hd,1,0,"ng-container",12),m()),a&2){let e=f(2);p("type","fill");let t=r(2,4,e.loadingTabs$);l(3),_(t?3:-1),l(),Fe(r(6,6,e.tabs$)),l(4),_(r(9,8,e.withFilter$)?8:-1),l(2),p("ngComponentOutlet",d.component)}}function yd(a,d){if(a&1&&(g(0,fd,11,10),o(1,"async")),a&2){let e,t=f();_((e=r(1,1,t.activeTab$))?0:-1,e)}}function Cd(a,d){a&1&&v(0,"ww-analytics-paywall")}var wd={overview:Co,visits:go,"guest-experience":mo,messages:fo,operations:yo,services:wo,"input-fields":ho,financials:po,csat:lo,"more-analytics":$i,upgrade:$i},bs=(()=>{class a extends gt{constructor(){super(),this.analyticsFilterStore=w(Ti),this.breakpoints=w(Le),this.accountRx=w(It),this.analyticsService=w(ae),this.layout=w(Ht),this.permissionRx=w(Ya),this.route=w(li),this.router=w(zt),this.filterTitle=$localize`Filter analytics`,this.enableAnalytics$=this.accountRx.hasAccountFeature
225("enableAnalytics"),this.advancedTabs=["overview","visits","guest-experience","messages","operations","services","input-fields","financials","csat"],this.basicTabs=["overview","more-analytics"],this.noTabs=["upgrade"],this.availableTabs$=D([this.enableAnalytics$,this.accountRx.hasAccountFeature("enableAdvancedAnalytics"),this.analyticsService.hasServices$,this.analyticsService.hasDataFields$,this.accountRx.hasAccountFeature("enableSurveys"),this.permissionRx.hasPermission("surveys.show")]).pipe(c(([e,t,i,n,s,h])=>{if(!e)return this.noTabs;if(!t)return this.basicTabs;let S=[...this.advancedTabs];return i||(S=S.filter(T=>T!=="services")),n||(S=S.filter(T=>T!=="input-fields")),(!s||!h)&&(S=S.filter(T=>T!=="csat")),S})),this.tabs$=this.availableTabs$.pipe(c(e=>e.map(t=>({segment:t,title:{text:kn[t],component:Ln[t]}})))),this.loadingTabs$=this.tabs$.pipe(c(e=>e.length===0),Li(!0)),this.activeTab$=this.route.params.pipe(c(e=>{let t=e.tab;return t?{segment:t,title:{text:kn[t],component:Ln[t]},component:wd[t]}:null})),this.withFilter$=this.activeTab$.pipe(Ke(le),c(({segment:e})=>["no-analytics","more-analytics"].includes(e)===!1),Li(!1)),this.layout.setFeatureContext({name:$localize`Analytics`,withResourceSwitcher:!1}),this.analyticsFilterStore.syncStateWithQueryParams()}onTabClick(e){this.router.navigate([`/account/analytics/${e}`],{queryParamsHandling:"merge"})}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275cmp=$({type:a,selectors:[["ww-analytics"]],hostAttrs:[1,"ww-analytics"],standalone:!1,features:[I],decls:6,vars:6,consts:()=>{let e;return e=$localize`Loading analytics...`,[e,[1,"flex","items-center","justify-between","gap-2","px-4"],[1,"w-full"],[3,"buttonType","store","title"],[3,"store","title",4,"wwLayoutTertiaryAction"],["class","ml-1",4,"wwLayoutTertiaryAction"],[3,"store","title"],[1,"ml-1"],[1,"flex","w-full",3,"type"],["wwTabBarItem",""],["wwTabBarItem","",3,"class","active","label"],["wwLayoutPadding","",1,"h-full","flex","flex-col","small:gap-6","gap-4"],[4,"ngComponentOutlet"],["wwTabBarItem","",3,"click","active","label"],[4,"wwOutlet"]]},template:function(t,i){t&1&&(g(0,nd,2,3),o(1,"async"),ke(2,ld,2,3),g(3,yd,2,3),o(4,"async"),ke(5,Cd,1,0,"ww-analytics-paywall")),t&2&&(_(r(1,2,i.breakpoints.isBelowSmall$)?0:2),l(3),_(r(4,4,i.enableAnalytics$)?3:5))},dependencies:[ka,qa,Ka,Za,Ja,Xa,Fa,yr,fr,va,$i,k],styles:[`.ww-analytics{display:flex;flex-direction:column;gap:24px;height:100%}.ww-analytics .ww-analytics-tab{display:flex;flex-direction:column;gap:24px;position:relative}.ww-analytics .ww-analytics-tab .ww-card{flex-direction:column;flex-grow:1;min-height:100%}.ww-analytics .ww-analytics-tab .ww-card .ww-section,.ww-analytics .ww-analytics-tab .ww-card .ww-section .ww-section-content{flex-grow:1}.ww-analytics .ww-analytics-tab .ww-placeholder-graph{min-height:400px}.ww-breakpoints-below-small .ww-analytics .ww-analytics-tab{gap:16px}.ww-breakpoints-above-large .ww-analytics .ww-analytics-tab .ww-analytics-grid-divider-container>*{position:relative}.ww-breakpoints-above-large .ww-analytics .ww-analytics-tab .ww-analytics-grid-divider-container>*:not(:last-child):after{content:"";position:absolute;top:0;right:0;display:block;height:100%;width:1px;background-color:var(--ww-color-mediumGrey)}.ww-breakpoints-below-small .ww-analytics{gap:16px}
226/*noopanalytics.component-U4NPPCQL.css.map */
227`],encapsulation:2,changeDetection:0})}}return a})();var wn=(()=>{class a{constructor(){this.accountRx=w(It),this.router=w(zt)}
227canActivate(e,t){return D([this.accountRx.hasAccountFeature("enableAnalytics"),this.accountRx.hasAccountFeature("enableAdvancedAnalytics")]).pipe(c(([i,n])=>i&&n||t.url.startsWith("/account/analytics/upgrade")?!0:!i&&!n?(this.router.navigate(["/account/analytics/upgrade"]),!1):t.url.startsWith("/account/analytics/overview")||t.url.startsWith("/account/analytics/more-analytics")?!0:(this.router.navigate(["/account/analytics/more-analytics"]),!1)))}static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275prov=Et({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var q$=(()=>{class a{static{this.\u0275fac=function(t){return new(t||a)}}static{this.\u0275mod=Ao({type:a})}static{this.\u0275inj=So({providers:[se,{provide:We,useClass:Uo},{provide:nr,useValue:{size:"auto"}}],imports:[Eo,Vr,Ea,Ro.forChild([{path:"",pathMatch:"full",redirectTo:"overview"},{path:":tab",pathMatch:"full",component:bs,canActivate:[wn,ja({permissions:["analytics.show"]})]},{path:":tab/:chart",pathMatch:"full",component:so,canActivate:[wn,ja({permissions:["analytics.show"]})]},{path:":tab/:chart/:hash",pathMatch:"full",component:so,canActivate:[wn,ja({permissions:["analytics.show"]})]}]),Pr,jo,zr,an,Nr,Va]})}}return a})();export{ns as AnalyticsFilterComponents,Ti as AnalyticsFilterStore,wn as AnalyticsGuard,Fn as WwAnalyticsAlertsMessagesChartComponent,On as WwAnalyticsAlertsMessagesPerCustomerChartComponent,Nn as WwAnalyticsAlertsMessagesSegmentsChartComponent,Vn as WwAnalyticsAlertsSmsAutomaticChartComponent,Pn as WwAnalyticsAlertsSmsCustomChartComponent,zn as WwAnalyticsAlertsSmsTriggeredChartComponent,Yi as WwAnalyticsAverageDurationsChartComponent,J as WwAnalyticsChartBase,so as WwAnalyticsChartComponent,bs as WwAnalyticsComponent,Gi as WwAnalyticsCsatByLocationChartComponent,Ui as WwAnalyticsCsatByResourceChartComponent,Hi as WwAnalyticsCsatByServiceChartComponent,ji as WwAnalyticsCsatDistributionChartComponent,Gn as WwAnalyticsCsatMetricAverageChartComponent,Un as WwAnalyticsCsatMetricFeedbackRateChartComponent,Hn as WwAnalyticsCsatMetricResponseFeedbackChartComponent,jn as WwAnalyticsCsatMetricResponseRateChartComponent,qn as WwAnalyticsCsatMetricResponsesChartComponent,qi as WwAnalyticsCsatResponseTrendChartComponent,Xi as WwAnalyticsCsatResponsesChartComponent,Qi as WwAnalyticsCustomerDistributionChartComponent,ni as WwAnalyticsCustomerPathChartComponent,Zi as WwAnalyticsCustomerRegistrationsChartComponent,va as WwAnalyticsDateRangePickerComponent,Ji as WwAnalyticsDropoffByPositionChartComponent,ea as WwAnalyticsDropoffsChartComponent,Bn as WwAnalyticsFieldSelectComponent,ta as WwAnalyticsFinancialsLocationsComponent,ia as WwAnalyticsFinancialsServicePriceComponent,aa as WwAnalyticsFinancialsValueCostsComponent,na as WwAnalyticsInputFieldChartComponent,oa as WwAnalyticsLineLengthChartComponent,ra as WwAnalyticsMessageDetailsChartComponent,sa as WwAnalyticsMessageRecipientChartComponent,la as WwAnalyticsMessageTypeChartComponent,q$ as WwAnalyticsModule,ca as WwAnalyticsOperationsResourcesComponent,pa as WwAnalyticsOperationsServiceCombinationsComponent,ma as WwAnalyticsOperationsServicesComponent,Qt as WwAnalyticsOperationsTableBase,da as WwAnalyticsOperationsUsersComponent,Zn as WwAnalyticsOverviewBookingsChartComponent,Jn as WwAnalyticsOverviewDropoffChartComponent,eo as WwAnalyticsOverviewMessagesChartComponent,to as WwAnalyticsOverviewPlaceholderChartComponent,io as WwAnalyticsOverviewServedChartComponent,ao as WwAnalyticsOverviewWaitlistChartComponent,no as WwAnalyticsOverviewWaittimesChartComponent,ua as WwAnalyticsPlaceholderFunnelChartComponent,uo as WwAnalyticsPlaceholderGraphComponent,ha as WwAnalyticsPlaceholderTableChartComponent,fa as WwAnalyticsPlaceholderTrafficChartComponent,lo as WwAnalyticsTabCsatComponent,po as WwAnalyticsTabFinancialsComponent,mo as WwAnalyticsTabGuestExperienceComponent,ho as WwAnalyticsTabInputFieldsComponent,fo as WwAnalyticsTabMessagesComponent,yo as WwAnalyticsTabOperationsComponent,Co as WwAnalyticsTabOverviewComponent,$i as WwAnalyticsTabPaywallComponent,wo as WwAnalyticsTabServicesComponent,go as WwAnalyticsTabVisitsComponent,ya as WwAnalyticsTopVisitedLocationsComponent,oi as WwAnalyticsTrafficByPeriodChartComponent,_a as WwAnalyticsVisitDistributionChartComponent,Ca as WwAnalyticsVisitsByCreatorSourceChartComponent,wa as WwAnalyticsVisitsByLabelChartComponent,ga as WwAnalyticsVisitsByLocationChartComponent,Sa as WwAnalyticsWaitServeDurationsChartComponent,Xp as isMetric};
228//noopchunk-U7IKD6UG.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.