1import{_ as Y}from"./COVqWkPb.js";import{j as L,N as K,m as o,M as c,o as i,c as u,z as S,a as t,p as f,f as Q,r as p,x as W,H as I,s as h,l as X,a2 as Z,a3 as tt,b as g,w as R,ac as $,t as M,y as et,O as z,R as st,V as P,a4 as ot,C as at,A as nt,_ as rt,n as lt}from"./DKDe9nDc.js";import{T as it}from"./CNKzAJ8y.js";import{u as ut}from"./DmB7ABWg.js";import{_ as ct}from"./DetF0yK4.js";import{B as dt}from"./DKxw77Xi.js";import"./D3sGwlad.js";import"./C-fFQLFl.js";import"./Cwt1y8Qz.js";import"./DMGfPaAh.js";import"./Bc-xZx3L.js";import"./DMMVrzfY.js";import"./BBtG4qUg.js";import"./BZa8qonJ.js";import"./JFwMpiFk.js";import"./MmYoX3xB.js";const mt={key:0,class:"d-flex justify-content-between align-items-center justify-content-md-start w-100"},pt={class:"fw-bold text-capitalize me-4","data-format":"LLLL"},ft={class:"badge border border-primary text-primary fs-tiny","data-format":"y"},vt=L({__name:"SlotHeader",props:{slotTimestamp:{},prevSlot:{}},setup(x){const d=x;return(_,y)=>{const v=K("timestamp-to-format");return!d.prevSlot||o(c).fromSeconds(d.prevSlot.timestamp).month!==o(c).fromSeconds(d.slotTimestamp).month?(i(),u("div",mt,[S(t("span",pt,null,512),[[v,d.slotTimestamp]]),S(t("span",ft,null,512),[[v,d.slotTimestamp]])])):f("",!0)}}}),bt={class:"container mt-3"},gt={class:"d-flex flex-column w-100 justify-content-center align-items-center gap-3"},_t={class:"form-check-label"},yt={class:"form-check-label"},ht={key:0,class:"d-flex align-items-center gap-2"},St={key:0,class:"btn p-0",type:"button"},xt={class:"mt-4 mt-md-8"},wt={class:"section-profile rounded-5 rounded-top-0 px-md-4 pt-md-4 pb-md-8 mt-4 mt-md-0"},kt={key:0,class:"d-flex mt-4 justify-content-center"},Tt={key:1,class:"text-center bg-primary bg-opacity-10 rounded-5 p-4 mt-8"},Mt={class:"d-flex flex-column flex-md-row flex-md-wrap gap-4 mt-4"},Ct={key:2,class:"pagination-controls d-flex justify-content-center align-items-center mt-4"},Lt=["disabled"],jt={class:"mx-2"},Bt=["disabled"],C=12,Nt=L({__name:"SlotList",setup(x){const d=new nt,_=Q(),y=p(null),v=p(!1),w=W().$toast,U=async()=>{v.value=!0;try{await d.fetch("therapist/my/slot-moving-request-tutorial",{method:"post",body:JSON.stringify({tutorial:!0})}),w.info("Grazie per aver visto il tutorial! Se hai bisogno di rivederlo, lo trovi sempre disponibile nella sezione tutorial."),_.setTutorialMovingRequestTrue()}catch(a){a instanceof Error?w.error(`Errore nell'aggiornamento del tutorial: ${a.message}`):w.error("Errore nell'aggiornamento del tutorial: errore sconosciuto.")}finally{v.value=!1}},s=ut(),m=p(c.now().year),E=p(c.now().year),n=p(!0),O=p(c.now().toSeconds()),k=p(null),V=()=>{O.value=c.now().toSeconds()},q=()=>{k.value=ot(()=>{V()},1e3*60)},A=()=>{m.value=m.value+1},D=()=>{m.value=m.value-1},j=()=>{s.datetimeFrom=n.value?c.now().minus({milliseconds:at.SESSION_DURATION}).setLocale("it"):c.fromObject({year:m.value}).setLocale("it").startOf("year"),s.datetimeTo=n.value?s.datetimeFrom.plus({year:1}):c.now()};I(()=>[m.value,n.value],j),I(()=>n.value,()=>{r.value=1});const r=p(1),F=h(()=>{const a=[...s.slotsList].sort((e,T)=>e.timestamp-T.timestamp);return n.value?a:a.reverse()}),B=h(()=>{const a=(r.value-1)*C;return F.value.slice(a,a+C)}),H=h(()=>s.slotsList.length),b=h(()=>Math.ceil(H.value/C)),G=()=>{r.value<b.value&&r.value++},J=()=>{r.value>1&&r.value--};return X(()=>{var a,e;j(),s.filters={available:{paid:!1,free:!1},assigned:{paid:!0,free:!0,bonus:!0,welfare:!0,covid:!0,giftcard:!1}},s.fetchSlots(),q(),(a=_.profile)!=null&&a.slotMovingRequestTutorial||(e=y.value)==null||e.show()}),Z("updateTherapySlot",()=>s.fetchSlots()),tt(()=>{s.reset(),k.value&&clearInterval(k.value)}),(a,e)=>{const T=Y;return i(),u("div",bt,[g(dt,{ref_key:"tutorialModal",ref:y,"class-custom":"bg-mercury bs-modal","hide-header":""},{"body-content":R(()=>[g(ct)]),"footer-content":R(()=>[t("div",gt,[t("p",null,[t("button",{class:"fw-semibold text-body bg-transparent border-0 p-0 text-decoration-underline",type:"button","aria-label":"chiudi",onClick:e[0]||(e[0]=()=>{var l;U(),(l=y.value)==null||l.hide()})}," Chiudi ")])])]),_:1},512),t("form",{class:"d-flex justify-content-center align-items-center gap-4 flex-wrap mb-4",onSubmit:e[3]||(e[3]=et(()=>{},["prevent"]))},[t("label",_t,[S(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>n.value=l),value:!0,class:"form-check-input",type:"radio"},null,512),[[$,n.value]]),e[4]||(e[4]=t("span",{class:"text-uppercase ms-2"},"prenotazioni",-1))]),t("label",yt,[S(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>n.value=l),value:!1,class:"form-check-input",type:"radio"},null,512),[[$,n.value]]),e[5]||(e[5]=t("span",{class:"text-uppercase ms-2"},"storico prenotazioni",-1))]),n.value?f("",!0):(i(),u("div",ht,[t("button",{class:"btn p-0",type:"button"},[t("i",{class:"bi-chevron-left",onClick:D})]),t("span",null,M(m.value),1),m.value<E.value?(i(),u("button",St,[t("i",{class:"bi-chevron-right",onClick:A})])):f("",!0)]))],32),t("div",xt,[e[9]||(e[9]=t("div",{class:"d-none d-md-block title-section-profile text-center text-md-start rounded-5 rounded-bottom-0 px-4 py-2 mt-4 mt-md-0"},[t("div",{class:"text-uppercase fw-semibold"},"Agenda")],-1)),t("div",wt,[o(s).loadingSlots?(i(),u("div",kt,[g(T,{size:"lg"})])):f("",!0),!o(s).loadingSlots&&o(s).slotsList.length===0?(i(),u("div",Tt,e[6]||(e[6]=[t("div",{class:"badge bg-white"},[t("div",{class:"fw-semibold text-black text-uppercase"}," Nessun appuntamento trovato ")],-1)]))):f("",!0),t("div",Mt,[(i(!0),u(z,null,st(o(B),(l,N)=>(i(),u(z,{key:l.id},[g(vt,{"slot-timestamp":l.timestamp,"prev-slot":N>0?o(B)[N-1]:void 0},null,8,["slot-timestamp","prev-slot"]),g(it,{"future-slots":n.value,"show-actions":!0,"therapy-slot":l,onMoveRequestSent:o(s).fetchSlots,onRatingSent:o(s).fetchSlots},null,8,["future-slots","therapy-slot","onMoveRequestSent","onRatingSent"])],64))),128))]),!o(s).loadingSlots&&o(b)>=1?(i(),u("div",Ct,[t("button",{disabled:r.value===1,class:"border-0 bg-transparent",onClick:J},[t("span",{class:P([{"opacity-50":r.value===1},"bg-pearl-bush p-0 rounded-circle d-flex justify-content-center align-items-center"]),style:{width:"2.5rem",height:"2.5rem"}},e[7]||(e[7]=[t("i",{class:"prev-icon gpo-icon gpo-icon-arrow text-black fs-4 mt-1"},null,-1)]),2)],8,Lt),t("span",jt,M(r.value)+" / "+M(o(b)),1),t("button",{disabled:r.value===o(b),class:"border-0 bg-transparent",onClick:G},[t("span",{class:P([{"opacity-50":r.value===o(b)},"bg-pearl-bush p-0 rounded-circle d-flex justify-content-center align-items-center"]),style:{width:"2.5rem",height:"2.5rem"}},e[8]||(e[8]=[t("i",{class:"gpo-icon gpo-icon-arrow text-black fs-4"},null,-1)]),2)],8,Bt)])):f("",!0)])])])}}}),It=rt(Nt,[["__scopeId","data-v-3f26180f"]]),Kt=L({__name:"appuntamenti",setup(x){return(d,_)=>(i(),lt(It))}});
1export{Kt as default};
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.