1"use strict";(self.webpackChunkihm=self.webpackChunkihm||[]).push([[769],{90769:function(t,e,i){i.r(e),i.d(e,{AppointmentListModule:function(){return y}});var n=i(81383),s=i(77358),a=i(48873),o=i(96472),l=i(85416),r=i(37716),u=i(63423),p=i(71579),c=i(66475),g=i(60955),h=i(54616),Z=i(32176),d=i(90665),m=i(38583),A=i(77266),f=i(48897),T=i(86980),q=i(56203),_=i(12042);function v(t,e){if(1&t&&r._UZ(0,"ihm-chart",26),2&t){const t=r.oxw();r.Q6J("lineChartLabels",null==t.statistic?null:t.statistic.labels)("lineChartData",null==t.statistic?null:t.statistic.values)}}function C(t,e){1&t&&(r.TgZ(0,"span",28),r._uU(1,"(New)"),r.qZA())}function x(t,e){if(1&t&&(r.TgZ(0,"tr"),r.TgZ(1,"td"),r._uU(2),r.qZA(),r.TgZ(3,"td"),r._uU(4),r.qZA(),r.TgZ(5,"td"),r._uU(6),r.YNc(7,C,2,0,"span",27),r.qZA(),r.TgZ(8,"td"),r._uU(9),r.ALo(10,"date"),r.qZA(),r.TgZ(11,"td"),r._uU(12),r.qZA(),r.TgZ(13,"td"),r._uU(14),r.qZA(),r.TgZ(15,"td"),r._uU(16),r.qZA(),r.TgZ(17,"td"),r._uU(18),r.qZA(),r.TgZ(19,"td"),r._uU(20),r.ALo(21,"number"),r.qZA(),r.TgZ(22,"td"),r._uU(23),r.ALo(24,"titlecase"),r.qZA(),r.TgZ(25,"td"),r._uU(26),r.qZA(),r.qZA()),2&t){const t=e.$implicit;r.xp6(2),r.AsE(" ",null==t.user?null:t.user.first_name," ",null==t.user?null:t.user.last_name," "),r.xp6(2),r.Oqu("scheduled"===t.type?"Yes":"No"),r.xp6(2),r.hij(" ",null==t.consultant||null==t.consultant.consultant?null:t.consultant.consultant.publishing_name," "),r.xp6(1),r.Q6J("ngIf",null==t.consultant||null==t.consultant.consultant?null:t.consultant.consultant.is_new),r.xp6(2),r.Oqu(r.xi3(10,13,t.starts_at,"MM/dd/yyyy HH:mm")),r.xp6(3),r.Oqu(t.duration),r.xp6(2),r.Oqu("$"+(null==t.info?null:t.info.price_per_minute)),r.xp6(2),r.Oqu("$"+(null==t.info?null:t.info.amount)),r.xp6(2),r.Oqu("$"+(null==t.info?null:t.info.consultant_fee)),r.xp6(2),r.hij("$",r.xi3(21,16,null==t.info?null:t.info.ihm_fee,"1.2-2"),""),r.xp6(3),r.Oqu(r.lcZ(24,19,(null==t.info?null:t.info.type)||"-")),r.xp6(3),r.Oqu((null==t.promo_code?null:t.promo_code.code)||"-")}}function U(t,e){1&t&&(r.TgZ(0,"ihm-empty-state"),r.TgZ(1,"p"),r._uU(2,"No appointments"),r.qZA(),r.qZA())}function b(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"ihm-pagination",29),r.NdJ("paginationChange",function(e){return r.CHM(t),r.oxw().getAppointments(e)}),r.qZA()}if(2&t){const t=r.oxw();r.Q6J("config",t.paginationConfig)}}a.extend(o),a.extend(l);let w=(()=>{class t{constructor(t,e,i,n,s){this.route=t,this.appointmentService=e,this.appService=i,this.modalService=n,this.toastService=s,this.perfectScrollConfigTable={wheelPropagation:!1,suppressScrollX:!1},this.paginationConfig={current_page:1,per_page:5,total:null},this.paginationConfigAdmins={current_page:1,per_page:5,total:null},this.appointments=[],this.admins=[],this.filters={searchTerm:null},this.filtersAdmin={searchTerm:null},this.sortOptions={sort:"created_at",direction:"desc"},this.sortOptionsChartSelected="week",this.sortOptionsChart=[{id:"week",name:"Weekly Overview"},{id:"month",name:"Month Overview"},{id:"year",name:"Year Overview"}],this.statistic={labels:[],values:[]},this.showLoadingAppointments=!1,this.showLoadingAdmins=!1}ngOnInit(){this.user=this.route.parent.parent.snapshot.data.user,this.currentAppointmentRole=this.appService.getAdminType(),this.getAppointments(),this.getStatistic()}getAppointments(t){var e;this.showLoadingAppointments=!0;const i=Object.assign({include:"user,consultant.consultant,promo_code",current_page:this.paginationConfig.current_page,per_page:this.paginationConfig.per_page,timezone:(null===(e=this.user)||void 0===e?void 0:e.timezone)?this.user.timezone:a.tz.guess()},this.sortOptions);this.filters.searchTerm&&(i.search_term=this.filters.searchTerm),t&&(this.paginationConfig.current_page=t.current_page),this.appointmentService.getAppointments(i).subscribe(t=>{this.appointments=t.data,this.paginationConfig.total=t.total,this.showLoadingAppointments=!1},()=>{this.showLoadingAppointments=!1})}searchAppointments(t){this.filters.searchTerm=t.value,this.paginationConfig.current_page=1,this.paginationConfig.total=null,this.getAppointments()}getStatistic(){this.appService.getStatistic({range:this.sortOptionsChartSelected,type:"call_data"}).subscribe(t=>{this.statistic.labels=t.data.labels,this.statistic.values=[{data:t.data.values}],this.statisticMeta=t.meta},()=>{})}export(){this.modalService.open(s.t).result.then(t=>{t&&this.appointmentService.exportAppointments(t).subscribe(()=>{this.toastService.show({type:"success",message:"Successfully exported."})},t=>{this.modalService.error({errors:t})})}).catch(()=>{})}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(u.gz),r.Y36(p.O),r.Y36(c.z),r.Y36(g.Z7),r.Y36(h._))},t.\u0275cmp=r.Xpm({type:t,selectors:[["ihm-appointment-list"]],viewQuery:function(t,e){if(1&t&&r.Gf(n.$V,5),2&t){let t;r.iGM(t=r.CRH())&&(e.perfectScrollbarDirectiveRef=t.first)}},decls:80,vars:17,consts:[[1,"ihm-container","admin","pb-24"],[1,"ihm-row"],[1,"ihm-col"],[1,"admin-container","large","position-relative"],[1,"container-header"],[1,"large"],[1,"right"],["size","small","placeholder","Select...",3,"options","showClearButton","
1ngModel","ngModelChange"],[1,"overview"],[1,"current-week"],[1,"number"],[1,"ihm-fa-solid-icon","fa-dot"],[1,"text"],[1,"previous-week"],[3,"lineChartLabels","lineChartData",4,"ngIf"],[1,"ihm-col","md-12","position-relative"],[1,"admin-container","large"],[1,"left"],["type","search","size","small","placeholder","Search",3,"searchTerm"],[3,"size","click"],[1,"ihm-table__wrapper","scrollbar-visible","both",3,"perfectScrollbar"],[1,"ihm-table__classic","not-fixed","scrollable-body"],[1,"position-relative",3,"ihmLoading"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-16",3,"config","paginationChange",4,"ngIf"],[3,"lineChartLabels","lineChartData"],["class","flag-new",4,"ngIf"],[1,"flag-new"],[1,"mt-16",3,"config","paginationChange"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"div",1),r.TgZ(2,"div",2),r.TgZ(3,"div",3),r.TgZ(4,"div",4),r.TgZ(5,"h3",5),r._uU(6,"New Calls"),r.qZA(),r.TgZ(7,"div",6),r.TgZ(8,"ihm-select",7),r.NdJ("ngModelChange",function(t){return e.sortOptionsChartSelected=t})("ngModelChange",function(){return e.getStatistic()}),r.qZA(),r.qZA(),r.qZA(),r.TgZ(9,"div",8),r.TgZ(10,"div",9),r.TgZ(11,"span",10),r._UZ(12,"span",11),r._uU(13),r.qZA(),r.TgZ(14,"h3",12),r._uU(15),r.qZA(),r.qZA(),r.TgZ(16,"div",9),r.TgZ(17,"span",10),r._UZ(18,"span",11),r._uU(19),r.qZA(),r.TgZ(20,"h3",12),r._uU(21),r.qZA(),r.qZA(),r.TgZ(22,"div",9),r.TgZ(23,"span",10),r._uU(24),r.qZA(),r.TgZ(25,"h3",12),r._uU(26,"Call duration"),r.qZA(),r.qZA(),r.TgZ(27,"div",9),r.TgZ(28,"span",10),r._uU(29),r.qZA(),r.TgZ(30,"h3",12),r._uU(31,"Average revenue"),r.qZA(),r.qZA(),r.TgZ(32,"div",13),r.TgZ(33,"span",10),r._uU(34),r.qZA(),r.TgZ(35,"h3",12),r._uU(36,"Call revenue"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(37,"div"),r.YNc(38,v,1,2,"ihm-chart",14),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(39,"div",1),r.TgZ(40,"div",15),r.TgZ(41,"div",16),r.TgZ(42,"div",4),r.TgZ(43,"div",17),r.TgZ(44,"h3",5),r._uU(45,"Call List"),r.qZA(),r.TgZ(46,"ihm-input",18),r.NdJ("searchTerm",function(t){return e.searchAppointments(t)}),r.qZA(),r.qZA(),r.TgZ(47,"div",6),r.TgZ(48,"ihm-button",19),r.NdJ("click",function(){return e.export()}),r._uU(49,"Export"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(50,"div",20),r.TgZ(51,"table",21),r.TgZ(52,"thead"),r.TgZ(53,"tr"),r.TgZ(54,"th"),r._uU(55,"Parent"),r.qZA(),r.TgZ(56,"th"),r._uU(57,"Scheduled"),r.qZA(),r.TgZ(58,"th"),r._uU(59,"Consultant"),r.qZA(),r.TgZ(60,"th"),r._uU(61,"Time"),r.qZA(),r.TgZ(62,"th"),r._uU(63,"Duration"),r.qZA(),r.TgZ(64,"th"),r._uU(65,"Price per minute"),r.qZA(),r.TgZ(66,"th"),r._uU(67,"Total amount"),r.qZA(),r.TgZ(68,"th"),r._uU(69,"Consultant fee"),r.qZA(),r.TgZ(70,"th"),r._uU(71,"IHM fee"),r.qZA(),r.TgZ(72,"th"),r._uU(73,"Type"),r.qZA(),r.TgZ(74,"th"),r._uU(75,"Promo Code"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(76,"tbody",22),r.YNc(77,x,27,21,"tr",23),r.qZA(),r.qZA(),r.YNc(78,U,3,0,"ihm-empty-state",24),r.qZA(),r.qZA(),r.YNc(79,b,1,1,"ihm-pagination",25),r.qZA(),r.qZA(),r.qZA()),2&t&&(r.xp6(8),r.Q6J("options",e.sortOptionsChart)("showClearButton",!1)("ngModel",e.sortOptionsChartSelected),r.xp6(5),r.Oqu(null==e.statisticMeta?null:e.statisticMeta.total),r.xp6(2),r.hij("Current ",e.sortOptionsChartSelected,""),r.xp6(4),r.Oqu(null==e.statisticMeta?null:e.statisticMeta.previous_iteration_total),r.xp6(2),r.hij("Previous ",e.sortOptionsChartSelected,""),r.xp6(3),r.hij("",null==e.statisticMeta?null:e.statisticMeta.call_duration," min"),r.xp6(5),r.hij("$",null==e.statisticMeta?null:e.statisticMeta.average_revenue,""),r.xp6(5),r.hij("$",null==e.statisticMeta?null:e.statisticMeta.total_revenue,""),r.xp6(4),r.Q6J("ngIf",e.statistic),r.xp6(10),r.Q6J("size","small"),r.xp6(2),r.Q6J("perfectScrollbar",e.perfectScrollConfigTable),r.xp6(26),r.Q6J("ihmLoading",e.showLoadingAppointments),r.xp6(1),r.Q6J("ngForOf",e.appointments),r.xp6(1),r.Q6J("ngIf",0===e.appointments.length&&!e.showLoadingAppointments),r.xp6(1),r.Q6J("ngIf",e.paginationConfig.total&&e.appointments.length<e.paginationConfig.total))},directives:[Z.O,d.JJ,d.On,m.O5,A.b,f.Z,n.$V,T.r,m.sg,q.N,_.D],pipes:[m.uU,m.JJ,m.rS],encapsulation:2}),t})();var S=i(73450),O=i(10919);const M=[{path:"",component:w}];let y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({providers:[],imports:[[u.Bz.forChild(M),n.Xd,m.ez,d.u5,g.ih,g.Lj,g.WS,g.KE,S.m,O.e],u.Bz]}),t})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.