1"use strict";(self.webpackChunkwebapp=self.webpackChunkwebapp||[]).push([[2411],{2411:(re,f,s)=>{s.r(f),s.d(f,{AgendaModule:()=>le});var m=s(9808),_=s(218),w=s(591),M=s(2223),D=s(7215),y=s(5161),p=s(846),E=s(7836),e=s(5e3),S=s(7721),Z=s(5525),x=s(2582),J=s(7576),b=s(6895),A=s(3792),O=s(6630),d=s(3075),g=s(4251),r=s(1158),k=s(4563),Q=s(8929),N=s(3976),P=s(7616),F=s(4164),H=s(6304),R=s(9571);function Y(i,l){if(1&i){const n=e.EpF();e.TgZ(0,"ui-button",7),e.NdJ("click",function(){return e.CHM(n),e.oxw().newEvent.emit()}),e._uU(1,"+ Crea nuova seduta"),e.qZA()}}function z(i,l){1&i&&e._UZ(0,"ui-event-title",8),2&i&&e.Q6J("event",l.event)}const W=function(){return["single","couple","group"]},$=function(){return[]};let B=(()=>{class i{constructor(n){this.appointmentService=n,this.viewDate=new Date,this.view=g.wr.Week,this.newEvent=new e.vpe,this.openDetail=new e.vpe,this.viewDateChange=new e.vpe,this.refresh=new Q.xQ,this.viewOptions=[{label:"Settimana",value:g.wr.Week},{label:"Mese",value:g.wr.Month}]}ngOnChanges(){this.refresh.next()}openEventDetail(n){this.openDetail.emit(n.meta)}onViewDateChange(){this.viewDateChange.emit(this.viewDate)}eventTimesChanged({event:n,newStart:t,newEnd:o}){if(!r(n.start).isSame(t)||!r(n.end).isSame(o))if(r(t).isAfter()){const a=n.start,c=n.end;n.start=t,n.end=o,n.meta.start_date=r(t).toDate(),n.meta.end_date=r(o).toDate(),this.events=[...this.events],this.appointmentService.update(n.meta.id,{appointment:{start_date:r(n.meta.start_date).utc().toISOString(),end_date:r(n.meta.end_date).utc().toISOString()}}).subscribe({error:()=>{n.start=a,n.end=c,n.meta.start_date=r(a).toDate(),n.meta.end_date=r(c).toDate(),this.events=[...this.events]}})}else this.events=[...this.events]}beforeWeekViewRender(n){this.availability&&n.hourColumns.forEach(t=>{t.hours.forEach(o=>{o.segments.forEach(a=>{var c;const h=this.availability.find(v=>r(v.date).isSame(a.date,"day"));h&&(null===(c=h.times)||void 0===c||c.forEach(v=>{const u=(0,k.O)(h.date,v);let C=!1;this.availabilityType===p.X9.reception?r(a.date).isSame(u)&&(C=!0):r(a.date).isSameOrAfter(u)&&r(a.date).isSameOrBefore(r(u).add(30,"minutes"))&&(C=!0),C&&(a.cssClass="bg-accent-100")}))})})})}createEvent({date:n}){this.newEvent.emit(n)}createEventFromDay({day:n}){this.newEvent.emit(n.date)}}return i.\u0275fac=function(n){return new(n||i)(e.Y36(x.H))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-calendar"]],inputs:{events:"events",availability:"availability",viewDate:"viewDate",view:"view",availabilityType:"availabilityType"},outputs:{newEvent:"newEvent",openDetail:"openDetail",viewDateChange:"viewDateChange"},features:[e.TTD],decls:8,vars:13,consts:[[1,"flex","items-center","justify-between","flex-col","sm:flex-row","gap-y-4","p-6","border-b","border-grey-200","mb-3"],[1,"w-36",3,"options","ngModel","ngModelChange"],[3,"viewDate","view","viewDateChange"],["size","big",3,"click",4,"hasPermission","hasPermissionOp"],[1,"scroll","lg:overflow-y-auto"],[3,"viewDate","view","events","eventTitleTemplate","refresh","eventTimesChanged","hourSegmentClicked","dayClicked","beforeWeekViewRender","openEventDetail"],["eventTitleTemplate",""],["size","big",3,"click"],[3,"event"]],template:function(n,t){if(1&n&&(e.TgZ(0,"div",0)(1,"ui-select",1),e.NdJ("ngModelChange",function(a){return t.view=a}),e.qZA(),e.TgZ(2,"ui-calendar-nav",2),e.NdJ("viewDateChange",function(a){return t.viewDate=a})("viewDateChange",function(){return t.onViewDateChange()}),e.qZA(),e.YNc(3,Y,2,0,"ui-button",3),e.qZA(),e.TgZ(4,"div",4)(5,"ui-calendar",5),e.NdJ("eventTimesChanged",function(a){return t.eventTimesChanged(a)})("hourSegmentClicked",function(a){return t.createEvent(a)})("dayClicked",function(a){return t.createEventFromDay(a)})("beforeWeekViewRender",function(a){return t.beforeWeekViewRender(a)})("openEventDetail",function(a){return t.openEventDetail(a)}),e.qZA()(),e.YNc(6,z,1,1,"ng-template",null,6,e.W1O)),2&n){const o=e.MAs(7);e.xp6(1),e.Q6J("options",t.viewOptions)("ngModel",t.view),e.xp6(1),e.Q6J("viewDate",t.viewDate)("view",t.view),e.xp6(1),e.Q6J("hasPermission",e.DdM(11,W))("hasPermissionOp","OR"),e.xp6(2),e.Q6J("viewDate",t.viewD
1ate)("view",t.view)("events",t.events||e.DdM(12,$))("eventTitleTemplate",o)("refresh",t.refresh)}},directives:[N.H,d.JJ,d.On,P.z,A.A,F.r,H.e,R.D],styles:["@media (min-width: 1024px){.scroll[_ngcontent-%COMP%]{height:calc(100vh - 263px)}}"]}),i})();function V(i,l){if(1&i){const n=e.EpF();e.TgZ(0,"ui-checkbox",14),e.NdJ("ngModelChange",function(o){return e.CHM(n),e.oxw().toggleEvents(o)})("ngModelChange",function(o){return e.CHM(n),e.oxw().mainCalendars.appointments=o}),e.qZA()}if(2&i){const n=e.oxw();e.Q6J("ngModel",n.mainCalendars.appointments)}}function X(i,l){if(1&i){const n=e.EpF();e.TgZ(0,"ui-checkbox",15),e.NdJ("ngModelChange",function(o){e.CHM(n);const a=e.oxw();return a.toggleAvailability(a.AppointmentTypologies.session,o)})("ngModelChange",function(o){return e.CHM(n),e.oxw().mainCalendars.session=o}),e.qZA()}if(2&i){const n=e.oxw();e.Q6J("ngModel",n.mainCalendars.session)}}function j(i,l){if(1&i){const n=e.EpF();e.TgZ(0,"ui-checkbox",16),e.NdJ("ngModelChange",function(o){e.CHM(n);const a=e.oxw();return a.toggleAvailability(a.AppointmentTypologies.reception,o)})("ngModelChange",function(o){return e.CHM(n),e.oxw().mainCalendars.reception=o}),e.qZA()}if(2&i){const n=e.oxw();e.Q6J("ngModel",n.mainCalendars.reception)}}function I(i,l){if(1&i){const n=e.EpF();e.TgZ(0,"ui-checkbox",19),e.NdJ("ngModelChange",function(o){const c=e.CHM(n).$implicit;return e.oxw(2).toggleTherapistAvailability(c,o)})("ngModelChange",function(o){return e.CHM(n).$implicit.selected=o}),e.qZA()}if(2&i){const n=l.$implicit;e.Q6J("label",n.fullName)("ngModel",n.selected)}}function U(i,l){if(1&i&&(e.ynx(0),e.TgZ(1,"h2",17),e._uU(2,"Disponibilit\xe0 Terapeuti"),e.qZA(),e.TgZ(3,"div",6),e.YNc(4,I,1,2,"ui-checkbox",18),e.qZA(),e.BQk()),2&i){const n=e.oxw();e.xp6(4),e.Q6J("ngForOf",n.therapists)}}const L=function(){return["single","couple","group","reception"]},K=function(){return["single","couple","group"]},T=function(){return["reception"]},G=[{path:"",children:[{path:"",component:(()=>{class i{constructor(n,t,o,a){this.therapistService=n,this.overlayService=t,this.appointmentService=o,this.userService=a,this.mainCalendars={appointments:!0,session:!1,reception:!1},this.userCanEdit=this.userService.can(["single","couple","group"],"OR"),this.userCanDrag=this.userService.can(["single","couple","group","reception"],"OR"),this.calendar=new y.f(this.appointmentService.list.bind(this.appointmentService),this.userCanDrag,!1),this.updated$=new w.X(null),this.AppointmentTypologies=p.X9}ngOnInit(){this.therapistService.list({per_page:250,"q[user_status_eq]":E.sL.active}).subscribe(n=>{this.therapists=n.list})}toggleEvents(n){n?this.calendar.loadEvents():this.calendar.removeEvents()}toggleAvailability(n,t){var o;t?(this.availabilityType=n,n===p.X9.reception?this.mainCalendars.session=!1:this.mainCalendars.reception=!1,this.therapists.forEach(a=>a.selected=!1),this.userService.user&&this.calendar.loadAvailabilities(this.therapistService.listSlots.bind(this.therapistService),null===(o=this.userService.user)||void 0===o?void 0:o.id,n)):(this.availabilityType=void 0,this.calendar.removeAvailability())}toggleTherapistAvailability(n,t){t?(this.mainCalendars.session=!1,this.mainCalendars.reception=!1,this.therapists.forEach(o=>{o.id!==n.id&&(o.selected=!1)}),this.calendar.loadAvailabilities(this.therapistService.listSlots.bind(this.therapistService),n.id,p.X9.session)):this.calendar.removeAvailability()}newAppointment(n){this.userCanEdit&&this.overlayService.open(M.F,{date:n}).afterClosed$.subscribe(t=>{t.data&&this.calendar.reload()})}openDetail(n){this.overlayService.open(D.o,{appointment:n}).afterClosed$.subscribe(t=>{t.data&&this.calendar.reload()})}}return i.\u0275fac=function(n){return new(n||i)(e.Y36(S.Q),e.Y36(Z.F),e.Y36(x.H),e.Y36(J.K))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-agenda"]],decls:17,vars:20,consts:[[1,"grid","grid-cols-12","gap-5","-mt-4"],[1,"col-span-3","hidden","md:block"],[1,"rounded-lg","bg-white","shadow","mb-4"],[3,"selected","selectedChange"],[1,"rounded-lg","bg-white","shadow","flex-h","py-3","px-4","overflow-y-auto"],[1,"text-sm","text-dark","font-medium","leading-5","mb-3.5"],[1,"pl-0.5","flex","flex-col","gap-y-3.5"],["label","Appuntamenti","class","text-xs",3,"ngModel","ngModelChange",4,"hasPermission","hasPermissionOp"],["label","Disponibilit\xe0 primo colloquio","class","text-xs",3,"ngModel","ngModelChange",4,"hasPermission","hasPermissionOp"],["label","Disponibilit\xe0 accoglienza","class","text-xs",3,"ngModel","ngModelChange",4,"hasPermission"],[4,"hasPermission"],[1,"col-span-12","md:col-span-9"],[1,"rounded-lg","bg-white","shadow","overflow-hidden"],[3,"view","availabilityType","events","availability","viewDate","newEvent","openDetail","viewDateChange"],["label","Appuntamenti",1,"text-xs",3,"ngModel","ngModelChange"],["label","Disponibilit\xe0 primo colloquio",1,"text-xs",3,"ngModel","ngModelChange"],["label","Disponibilit\xe0 accoglienza",1,"text-xs",3,"ngModel","ngModelChange"],[1,"text-sm","text-dark","font-medium","leading-5","mt-10","mb-3.5"],["class","text-xs",3,"label","ngModel","ngModelChange",4,"ngFor","ngForOf"],[1,"text-xs",3,"label","ngModel","ngModelChange"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-calendar",3),e.NdJ("selectedChange",function(a){return t.calendar.viewDate=a}),e.qZA()(),e.TgZ(4,"div",4)(5,"h2",5),e._uU(6,"I miei calendari"),e.qZA(),e.TgZ(7,"div",6),e.YNc(8,V,1,1,"ui-checkbox",7),e.YNc(9,X,1,1,"ui-checkbox",8),e.YNc(10,j,1,1,"ui-checkbox",9),e.qZA(),e.YNc(11,U,5,1,"ng-container",10),e.qZA()(),e.TgZ(12,"div",11)(13,"div",12)(14,"app-calendar",13),e.NdJ("newEvent",function(a){return t.newAppointment(a)})("openDetail",function(a){return t.openDetail(a)})("viewDateChange",function(a){return t.calendar.viewDate=a}),e.ALo(15,"async"),e.ALo(16,"async"),e.qZA()()()()),2&n&&(e.xp6(3),e.Q6J("selected",t.calendar.viewDate),e.xp6(5),e.Q6J("hasPermission",e.DdM(16,L))("hasPermissionOp","OR"),e.xp6(1),e.Q6J("hasPermission",e.DdM(17,K))("hasPermissionOp","OR"),e.xp6(1),e.Q6J("hasPermission",e.DdM(18,T)),e.xp6(1),e.Q6J("hasPermission",e.DdM(19,T)),e.xp6(3),e.Q6J("view",t.calendar.view)("availabilityType",t.availabilityType)("events",e.lcZ(15,12,t.calendar.events$))("availability",e.lcZ(16,14,t.calendar.availability$))("viewDate",t.calendar.viewDate))},directives:[b._H,A.A,O.b,d.JJ,d.On,m.sg,B],pipes:[m.Ov],styles:["@media (min-width: 1024px){.flex-h[_ngcontent-%COMP%]{height:calc(100vh - 456px)}}"]}),i})(),data:{title:"Gestisci i tuoi appuntamenti dal tuo calendario"}}]}];let q=(()=>{class i{}return i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[[_.Bz.forChild(G)],_.Bz]}),i})();var ee=s(3685),ne=s(8806),te=s(2721),ae=s(2141),ie=s(1072),oe=s(292),se=s(1660);let le=(()=>{class i{}return i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[[m.ez,q,ee.g,ne.h,b.FA,te.n,d.u5,ae.A,ie.Kz,oe._,se.n]]}),i})()}}]);
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.