1"use strict";(self.webpackChunkwebapp=self.webpackChunkwebapp||[]).push([[6902],{6902:(pt,m,o)=>{o.r(m),o.d(m,{AppointmentsModule:()=>lt});var d=o(218),u=o(1158),x=o(5241),f=o(7146),b=o(8809),v=o(846),A=o(2654),h=o(4563),y=o(4350),r=o(3075),t=o(5e3),T=o(9665),C=o(6165),I=o(7721),Z=o(5765),p=o(9808),S=o(1927),g=o(4164),J=o(5268),_=o(5850);function N(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"h1",2),t._uU(2,"Invita il tuo partner"),t.qZA(),t.TgZ(3,"p",3),t._uU(4,"Inserisci i dati del tuo partner: in questo modo potremmo consentirgli di accedere alla piattaforma e alle sedute con il vostro terapeuta."),t.qZA(),t.TgZ(5,"form",4)(6,"div",5),t._UZ(7,"ui-input",6)(8,"ui-input",7),t.qZA(),t._UZ(9,"ui-input",8),t.TgZ(10,"div",9)(11,"ui-button",10),t.NdJ("click",function(){return t.CHM(e),t.oxw().skip()}),t._uU(12,"Salta per ora"),t.qZA(),t.TgZ(13,"ui-button",11),t.NdJ("click",function(){return t.CHM(e),t.oxw().add()}),t._uU(14,"Invita"),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("formGroup",e.form),t.xp6(8),t.Q6J("loading",e.loading)}}function Y(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"ui-time-selector",17),t.NdJ("timeSelect",function(a){return t.CHM(e),t.oxw(2).selectTime(a)}),t.qZA()}2&n&&t.Q6J("times",s.ngIf)("height",266)}function Q(n,s){1&n&&(t.TgZ(0,"div",18),t._UZ(1,"ui-spinner",19),t.qZA()),2&n&&(t.xp6(1),t.Q6J("diameter",80))}function U(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"h1",2),t._uU(2),t.qZA(),t.YNc(3,Y,1,2,"ui-time-selector",12),t.ALo(4,"async"),t.YNc(5,Q,2,1,"ng-template",null,13,t.W1O),t.TgZ(7,"div",14)(8,"div",15)(9,"ui-button",16),t.NdJ("click",function(){return t.CHM(e),t.oxw().reserve()}),t._uU(10,"Prenota colloquio"),t.qZA()()()()}if(2&n){const e=t.MAs(6),i=t.oxw();t.xp6(2),t.hij("Prenota un appuntamento con ",null==i.therapy.therapist?null:i.therapy.therapist.fullName,""),t.xp6(1),t.Q6J("ngIf",t.lcZ(4,5,i.times$))("ngIfElse",e),t.xp6(6),t.Q6J("block",!0)("disabled",!i.selectedTime)}}let M=(()=>{class n{constructor(e,i,a,l,c){this.ref=e,this.fb=i,this.formErrorsService=a,this.therapistService=l,this.therapyService=c,this.form=this.fb.group({first_name:["",r.kI.required],last_name:["",r.kI.required],email:["",[r.kI.required,r.kI.email]]})}ngOnInit(){var e,i,a,l;(null===(e=this.ref.data)||void 0===e?void 0:e.therapy)&&(this.therapy=null===(i=this.ref.data)||void 0===i?void 0:i.therapy,this.step=this.therapy.typology===y.N3.couple?1:2,(null===(a=this.therapy.therapist)||void 0===a?void 0:a.id)&&(this.times$=this.therapistService.listSlots(null===(l=this.therapy.therapist)||void 0===l?void 0:l.id,{end_date:u().add(11,"days").format("YYYY-MM-DD")})))}selectTime(e){this.selectedTime=e}add(){this.form.valid?(this.loading=!0,this.therapyService.invitePartner(this.form.value).subscribe(()=>{this.step++},e=>{this.formErrorsService.setErrors(this.form,e),this.loading=!1})):this.formErrorsService.markAllAsTouched(this.form)}reserve(){const e=(0,h.O)(this.selectedTime.date,this.selectedTime.time),i=(0,h.O)(this.selectedTime.date,this.selectedTime.time,60);this.therapyService.createAppointment(this.therapy.id,{start_date:e,end_date:i}).subscribe(a=>{this.ref.close(a)})}skip(){this.step++}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(T.S),t.Y36(r.qu),t.Y36(C.u),t.Y36(I.Q),t.Y36(Z.C))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-reserve-appointment"]],decls:2,vars:2,consts:[["class","sm:w-134",4,"ngIf"],[1,"sm:w-134"],[1,"text-dark","text-xl","font-semibold","leading-7","mb-5"],[1,"text-sm","mb-5"],[3,"formGroup"],[1,"grid","grid-cols-2","gap-8","mb-4"],["placeholder","Nome","formControlName","first_name"],["placeholder","Cognome","formControlName","last_name"],["placeholder","Email","formControlName","email","type","email"],[1,"border-t","border-grey-200","mt-8","pt-6","flex","items-center","justify-end"],["fill","outline",1,"mr-5",3,"click"],[3,"loading","click"],[3,"times","height","timeSelect",4,"ngIf","ngIfElse"],["loading",""],[1,"flex","justify-center","pt-4"],[1,"w-72"],[3,"block","disabled","click"],[3,"times","height","timeSelect"],[1,"flex","justify-center","mt-5"],[3,"diameter"]],template:function(e,i){1&e&&(t.YNc(0,N,15,2,"div",0),t.YNc(1,U,11,7,"div",0)),2&e&&(t.Q6J("ngIf",1===i.step),t.xp6(1),t.Q6J("ngIf",2===i.step))},directives:[p.O5,r._Y,r.JL,r.sg,S.a,r.JJ,r.u,g.r,J.K,_.O],pipes:[p.Ov],styles:[""]}),n})();var E=o(2582),O=o(4445),P=o(7576),R=o(5525),F=o(1769);function z(n,s){1&n&&(t.ynx(0),t._uU(1,"seduta"),t.BQk())}function j(n,s){1&n&&(t.ynx(0),t._uU(1,"sedute"),t.BQk())}function B(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"ui-button",13),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).confirm()}),t._uU(1),t.YNc(2,z,2,0,"ng-container",7),t.YNc(3,j,2,0,"ng-container",7),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(1),t.hij("Paga e conferma ",e.table.selectedItems.size," "),t.xp6(1),t.Q6J("ngIf",1===e.table.selectedItems.size),t.xp6(1),t.Q6J("ngIf",e.table.selectedItems.size>1)}}function H(n,s){1&n&&(t.TgZ(0,"ui-button",14),t._uU(1,"Seleziona una seduta"),t.qZA()),2&n&&t.Q6J("disabled",!0)}function L(n,s){if(1&n&&(t.TgZ(0,"div",10),t.YNc(1,B,4,3,"ui-button",11),t.YNc(2,H,2,1,"ui-button",12),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.table.selectedItems.size),t.xp6(1),t.Q6J("ngIf",!e.table.selectedItems.size)}}function k(n,s){1&n&&(t.ynx(0),t.TgZ(1,"h2",15),t._uU(2," Non ci sono prossimi appuntamenti prenotati. "),t.qZA(),t.TgZ(3,"p",16),t._uU(4,"Per prenotare un appuntamento o per qualunque domanda, contatta il tuo terapeuta."),t.qZA(),t.BQk())}
1function $(n,s){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"h2",17),t._uU(2),t.qZA(),t.TgZ(3,"ui-button",13),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).reserve()}),t._uU(4,"Prenota ora"),t.qZA(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(2),t.hij(" Prenota il tuo primo appuntamento con ",e.therapyToSchedule.therapist.fullName," ")}}function D(n,s){1&n&&(t.ynx(0),t._uU(1,"Per iniziare il video colloquio apri l'agenda e clicca su il tuo appuntamento"),t.BQk())}function q(n,s){1&n&&(t.ynx(0),t._uU(1,"Il colloquio risulter\xe0 confermato dopo aver effettuato il pagamento"),t.BQk())}function K(n,s){if(1&n&&(t.TgZ(0,"div",5)(1,"div",6)(2,"h2",15),t.YNc(3,D,2,0,"ng-container",7),t.YNc(4,q,2,0,"ng-container",7),t.qZA(),t.TgZ(5,"p",16),t._uU(6,"Se avessi bisogno di spostare l'appuntamento o comunicare con l'accoglienza vai nell'area messaggi."),t.qZA()(),t._UZ(7,"img",8),t.qZA()),2&n){const e=t.oxw().ngIf,i=t.oxw();t.xp6(3),t.Q6J("ngIf",e[0].status===i.AppointmentStatuses.confirmed),t.xp6(1),t.Q6J("ngIf",e[0].status!==i.AppointmentStatuses.confirmed)}}function W(n,s){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"ui-table",2),t.NdJ("nextPage",function(){return t.CHM(e),t.oxw().table.nextPage()})("selected",function(a){return t.CHM(e),t.oxw().table.select(a)}),t.YNc(2,L,3,2,"div",3),t.TgZ(3,"div",4)(4,"div",5)(5,"div",6),t.YNc(6,k,5,0,"ng-container",7),t.YNc(7,$,5,1,"ng-container",7),t.qZA(),t._UZ(8,"img",8),t.qZA()()(),t.YNc(9,K,8,2,"div",9),t.qZA()}if(2&n){const e=s.ngIf,i=t.oxw();t.xp6(1),t.Q6J("columns",i.columns)("isLastPage",i.table.isLastPage)("isTherapist",!1)("selectable",!0)("heightOffset",e.length>3?400:void 0)("checkedItems",i.checkedItems)("data",e),t.xp6(1),t.Q6J("ngIf",e.length>1||1===e.length&&e[0].status===i.AppointmentStatuses.pending),t.xp6(4),t.Q6J("ngIf",!i.therapyToSchedule),t.xp6(1),t.Q6J("ngIf",i.therapyToSchedule),t.xp6(2),t.Q6J("ngIf",e.length)}}function X(n,s){1&n&&(t.TgZ(0,"div",18),t._UZ(1,"ui-spinner",19),t.qZA()),2&n&&(t.xp6(1),t.Q6J("diameter",80))}const G=[{path:"",component:(()=>{class n{constructor(e,i,a,l,c){this.appointmentService=e,this.videocallService=i,this.patientService=a,this.userService=l,this.overlayService=c,this.table=new x.i(this.appointmentService.list.bind(this.appointmentService)),this.columns=[{label:"Data e ora",field:"start_date",type:"start_end_date"},{label:"Terapeuta",field:"therapist",type:"therapist"},{label:"Tipologia",field:"typologyLabel"},{label:"Status",field:"statusLabel",type:"status"},{label:"Pagamento",field:"paymentLabel",type:"status",statusColorField:"paymentStatusColor"},{label:"",field:"actions",type:"videocall",buttonAction:mt=>this.table.reload()}],this.subscription=new A.w,this.AppointmentStatuses=v.lx,this.checkedItems={}}ngOnInit(){this.table.addFilter({"q[start_date_gteq]":u().subtract(90,"minutes").utc().toISOString(),"q[s]":"start_date+asc","q[status_not_eq]":v.e_.done}),this.getTherapyToSchedule(),this.subscription.add(this.appointmentService.statusChange$.subscribe(()=>{this.table.reload()}))}getTherapyToSchedule(){this.subscription.add(this.table.empty.subscribe(()=>{var e;this.patientService.listTherapies(null===(e=this.userService.user)||void 0===e?void 0:e.id).subscribe(i=>{i.list.forEach(a=>{a.completedReception&&1===a.total_appointments&&(this.therapyToSchedule=a)})})}))}ngOnDestroy(){this.subscription.unsubscribe()}openVideocall(e){this.videocallService.open({appointment:e}).afterClosed$.subscribe(()=>{this.table.reload()})}confirm(){this.overlayService.open(b.E,{appointments:Array.from(this.table.selectedItems)}).afterClosed$.subscribe(()=>{this.table.reload(),this.table.selectedItems.clear(),this.checkedItems={}})}reserve(){this.overlayService.open(M,{therapy:this.therapyToSchedule}).afterClosed$.subscribe(e=>{this.table.reload()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(E.H),t.Y36(f.N),t.Y36(O.e),t.Y36(P.K),t.Y36(R.F))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-appointments"]],features:[t._Bn([f.N])],decls:4,vars:4,consts:[[4,"ngIf","ngIfElse"],["loading",""],[3,"columns","isLastPage","isTherapist","selectable","heightOffset","checkedItems","data","nextPage","selected"],["slot","footer","class","flex p-6 justify-end border-t border-grey-200",4,"ngIf"],["slot","empty"],[1,"bg-brand-200","text-dark","p-8","rounded","sm:mt-24","relative"],[1,"sm:w-1/2"],[4,"ngIf"],["src","/assets/images/appointment.png",1,"absolute","right-0","w-72","-top-0","xl:right-24","md:-top-20","xl:-top-28","md:w-96","hidden","sm:inline"],["class","bg-brand-200 text-dark p-8 rounded sm:mt-24 relative",4,"ngIf"],["slot","footer",1,"flex","p-6","justify-end","border-t","border-grey-200"],[3,"click",4,"ngIf"],[3,"disabled",4,"ngIf"],[3,"click"],[3,"disabled"],[1,"font-serif","text-xl","font-bold","mb-2"],[1,"font-serif","text-base"],[1,"font-serif","text-xl","font-bold","mb-4"],[1,"flex","justify-center","mt-20"],[3,"diameter"]],template:function(e,i){if(1&e&&(t.YNc(0,W,10,11,"div",0),t.ALo(1,"async"),t.YNc(2,X,2,1,"ng-template",null,1,t.W1O)),2&e){const a=t.MAs(3);t.Q6J("ngIf",t.lcZ(1,2,i.table.items$))("ngIfElse",a)}},directives:[p.O5,F.a,g.r,_.O],pipes:[p.Ov],styles:[""]}),n})()}];let V=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[d.Bz.forChild(G)],d.Bz]}),n})();var w=o(8806),tt=o(6891),et=o(1072),nt=o(8917),it=o(209),ot=o(1148),st=o(1332),at=o(3685),rt=o(9655);let lt=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}
1),n.\u0275inj=t.cJS({imports:[[nt.e,V,w.h,tt.h,et.Kz,it.U,ot.F,st.U,r.UX,at.g,rt.W]]}),n})()}}]);
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.