1import t0 from"./D4BlskUX.js";import{_ as l0}from"./D0-Z8c3K.js";import{_ as a0}from"./Bbj6j9yC.js";import s0 from"./1v0TbjZW.js";import o0 from"./CrVSDMO2.js";import{j as Z,k as S,y as j,f as i0,u as n0,B as c0,l as r0,o as i,c as d,a as l,n as r,v as D,F as M,r as E,t as I,b as y,w as u0,q as m0,s as d0}from"./C7zEIAeD.js";import{u as N}from"./BkL0yvWL.js";import{u as k,a as L}from"./DIx7YeN0.js";import"./DA4EYZAb.js";import{u as A}from"./Dk1M-Ra9.js";import{x as p0,y as v0,z as h0}from"./DtbbvXvV.js";import"./BVBpBAVB.js";import"./Cxk7pjc8.js";import{b as F}from"./Rlssfzup.js";import"./BHyqgs87.js";import"./Dl__5uAE.js";import"./Cd6xApvY.js";import"./ByRl81Lu.js";import"./CT0bwiz6.js";import"./DTmj8o4_.js";import"./C331zzYY.js";import"./BrCFPWGt.js";import"./n2mPyVL2.js";import"./DmkYupTN.js";import"./CcmYQ047.js";import"./frkSSV2b.js";import"./CKVi2TRU.js";import"./GsWMJOgR.js";import"./CyqyKP3X.js";import"./BwCY_19y.js";function f0(){const b=Z(),_=L(),C=S(null),{data:w,loading:p,action:v}=A(async n=>p0(n),{autoExecute:!1,onSuccess:n=>{_.success(b,"Schedule saved successfully!"),j().setDoctorAvailability(n.data.data.availability)},onError:n=>{k(n,b)}});return{data:w,error:C,loading:p,action:v}}function b0(){const b=Z(),_=L(),C=S(null),{data:w,loading:p,action:v}=A(async n=>v0(n),{autoExecute:!1,onSuccess:n=>{_.success(b,"Schedule saved successfully!"),j().setDoctorAvailability(n.data.availability)},onError:n=>{k(n,b)}});return{data:w,error:C,loading:p,action:v}}function _0(){const b=Z(),{data:_,error:C,loading:w,action:p}=A(async()=>h0(),{autoExecute:!1,onSuccess:v=>{N().setDoctorSchedules(v.data.data)},onError:v=>{k(v,b)}});return{data:_,error:C,loading:w,action:p}}const C0="data:image/svg+xml,%3csvg%20width='98'%20height='69'%20viewBox='0%200%2098%2069'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M98%207.17969H0V68.2053H98V7.17969Z'%20fill='%23E6E6E6'/%3e%3cpath%20d='M24.5204%2018.9375H6.57166V30.6042H24.5204V18.9375Z'%20fill='white'/%3e%3cpath%20d='M46.823%2018.9375H28.8743V30.6042H46.823V18.9375Z'%20fill='white'/%3e%3cpath%20d='M69.1257%2018.9375H51.177V30.6042H69.1257V18.9375Z'%20fill='white'/%3e%3cpath%20d='M91.4283%2018.9375H73.4796V30.6042H91.4283V18.9375Z'%20fill='white'/%3e%3cpath%20d='M24.5204%2035.4492H6.57166V47.1159H24.5204V35.4492Z'%20fill='white'/%3e%3cpath%20d='M46.823%2035.4492H28.8743V47.1159H46.823V35.4492Z'%20fill='white'/%3e%3cpath%20d='M69.1257%2035.4492H51.177V47.1159H69.1257V35.4492Z'%20fill='white'/%3e%3cpath%20d='M91.4283%2035.4492H73.4796V47.1159H91.4283V35.4492Z'%20fill='white'/%3e%3cpath%20d='M24.5204%2051.9609H6.57166V63.6276H24.5204V51.9609Z'%20fill='white'/%3e%3cpath%20d='M46.823%2051.9609H28.8743V63.6276H46.823V51.9609Z'%20fill='white'/%3e%3cpath%20d='M69.1257%2051.9609H51.177V63.6276H69.1257V51.9609Z'%20fill='white'/%3e%3cpath%20d='M91.4283%2051.9609H73.4796V63.6276H91.4283V51.9609Z'%20fill='white'/%3e%3cpath%20d='M25.6667%2014.3612C27.1536%2014.3612%2028.359%2013.1558%2028.359%2011.6689C28.359%2010.1819%2027.1536%208.97656%2025.6667%208.97656C24.1798%208.97656%2022.9744%2010.1819%2022.9744%2011.6689C22.9744%2013.1558%2024.1798%2014.3612%2025.6667%2014.3612Z'%20fill='white'/%3e%3cpath%20d='M70.1795%2014.3612C71.6664%2014.3612%2072.8718%2013.1558%2072.8718%2011.6689C72.8718%2010.1819%2071.6664%208.97656%2070.1795%208.97656C68.6926%208.97656%2067.4872%2010.1819%2067.4872%2011.6689C67.4872%2013.1558%2068.6926%2014.3612%2070.1795%2014.3612Z'%20fill='white'/%3e%3cpath%20d='M26.7436%200H24.5898V12.3846H26.7436V0Z'%20fill='%23E6E6E6'/%3e%3cpath%20d='M71.2564%200H69.1025V12.3846H71.2564V0Z'%20fill='%23E6E6E6'/%3e%3cpath%20d='M86.5129%2024.77C86.5119%2025.7448%2086.1593%2026.6864%2085.5197%2027.4219C84.8802%2028.1575%2083.9967%2028.6375%2083.0316%2028.7739C82.0664%2028.9102%2081.0845%2028.6937%2080.2662%2028.1641C79.448%2027.6345%2078.8483%2026.8274%2078.5774%2025.8911C78.3065%2024.9547%2078.3826%2023.9521%2078.7917%2023.0674C79.2008%2022.1827%2079.9154%2021.4754%2080.8043%2021.0753C81.6931%2020.6753%2082.6964%2020.6095%2083.6299%2020.8899C84.5634%2021.1703%2085.3644%2021.7782%2085.8856%2022.6019C86.296%2023.2505%2086.5136%2024.0025%2086.5129%2024.77Z'%20fill='white'/%3e%3cpath%20d='M85.8855%2022.600
15L81.8901%2026.5951C81.639%2026.2064%2080.24%2024.3997%2080.24%2024.3997C80.4193%2024.2185%2080.6106%2024.0496%2080.8127%2023.8942L81.9728%2025.441L85.4176%2021.9961C85.5923%2022.1823%2085.749%2022.3847%2085.8855%2022.6005Z'%20fill='white'/%3e%3cpath%20d='M41.9075%2041.2818C41.9066%2042.2565%2041.5539%2043.1981%2040.9144%2043.9336C40.2748%2044.6692%2039.3913%2045.1492%2038.4262%2045.2856C37.4611%2045.4219%2036.4792%2045.2054%2035.6609%2044.6758C34.8426%2044.1462%2034.243%2043.3391%2033.9721%2042.4028C33.7012%2041.4665%2033.7773%2040.4638%2034.1864%2039.5791C34.5955%2038.6944%2035.3101%2037.9871%2036.1989%2037.5871C37.0878%2037.187%2038.0911%2037.1212%2039.0246%2037.4016C39.9581%2037.6821%2040.759%2038.2899%2041.2802%2039.1136C41.6907%2039.7622%2041.9082%2040.5142%2041.9075%2041.2818Z'%20fill='white'/%3e%3cpath%20d='M41.2803%2039.1161L37.2849%2043.1108C37.0338%2042.722%2035.6348%2040.9153%2035.6348%2040.9153C35.8141%2040.7341%2036.0054%2040.5652%2036.2074%2040.4098L37.3675%2041.9566L40.8124%2038.5117C40.9871%2038.698%2041.1437%2038.9003%2041.2803%2039.1161Z'%20fill='white'/%3e%3cpath%20d='M19.6049%2041.2818C19.604%2042.2565%2019.2514%2043.1981%2018.6118%2043.9337C17.9723%2044.6692%2017.0888%2045.1493%2016.1236%2045.2856C15.1585%2045.4219%2014.1766%2045.2054%2013.3583%2044.6758C12.54%2044.1462%2011.9403%2043.3391%2011.6695%2042.4028C11.3986%2041.4665%2011.4747%2040.4639%2011.8838%2039.5792C12.2929%2038.6945%2013.0075%2037.9871%2013.8963%2037.5871C14.7852%2037.187%2015.7885%2037.1212%2016.722%2037.4016C17.6555%2037.6821%2018.4564%2038.29%2018.9777%2039.1136C19.3881%2039.7622%2019.6057%2040.5142%2019.6049%2041.2818Z'%20fill='white'/%3e%3cpath%20d='M18.9777%2039.1161L14.9823%2043.1108C14.7312%2042.722%2013.3322%2040.9153%2013.3322%2040.9153C13.5114%2040.7341%2013.7028%2040.5652%2013.9048%2040.4098L15.0649%2041.9566L18.5098%2038.5117C18.6845%2038.698%2018.8411%2038.9003%2018.9777%2039.1161Z'%20fill='white'/%3e%3c/svg%3e",g0="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6%2016.2L17.65%209.15L16.25%207.75L10.6%2013.4L7.75%2010.55L6.35%2011.95L10.6%2016.2ZM5%2021C4.45%2021%203.97917%2020.8042%203.5875%2020.4125C3.19583%2020.0208%203%2019.55%203%2019V5C3%204.45%203.19583%203.97917%203.5875%203.5875C3.97917%203.19583%204.45%203%205%203H19C19.55%203%2020.0208%203.19583%2020.4125%203.5875C20.8042%203.97917%2021%204.45%2021%205V19C21%2019.55%2020.8042%2020.0208%2020.4125%2020.4125C20.0208%2020.8042%2019.55%2021%2019%2021H5ZM5%2019H19V5H5V19Z'%20fill='%2300C896'/%3e%3c/svg%3e",y0="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%2021C4.45%2021%203.97917%2020.8042%203.5875%2020.4125C3.19583%2020.0208%203%2019.55%203%2019V5C3%204.45%203.19583%203.97917%203.5875%203.5875C3.97917%203.19583%204.45%203%205%203H19C19.55%203%2020.0208%203.19583%2020.4125%203.5875C20.8042%203.97917%2021%204.45%2021%205V19C21%2019.55%2020.8042%2020.0208%2020.4125%2020.4125C20.0208%2020.8042%2019.55%2021%2019%2021H5ZM5%2019H19V5H5V19Z'%20fill='%23E8EAED'/%3e%3c/svg%3e",w0={class:"w-full h-auto min-h-screen px-[26px] py-12"},x0=l("div",{class:"text-2xl mb-5"},"Schedules",-1),T0={key:0,class:"flex flex-col gap-y-7 lg:gap-y-0 lg:flex-row lg:gap-x-16"},S0={class:"w-full lg:w-3/5 doc-dash-shadow p-8 rounded"},V0={class:"flex justify-end"},H0={class:"flex flex-col"},M0=["onClick"],k0=["src"],E0={class:"day"},I0={class:"w-full lg:w-2/5 doc-dash-shadow p-8 rounded"},Z0={key:0},D0=l("div",{class:"text-lg mb-4"},"Available Days and Time",-1),L0={class:"flex justify-between"},A0={class:"text-lg"},B0={class:"flex gap-x-3 text-base"},W0=["onClick"],U0={key:1,class:"min-h-40 flex justify-center items-center flex-col gap-y-1"},$0=l("img",{src:C0},null,-1),F0=l("div",{class:"text-lg text-primary-900"},"No Avaliable Schedule",-1),j0=l("div",{class:"text-sm text-surface-300"},"Set your schedule",-1),N0=[$0,F0,j0],O0={key:1,class:"text-center mt-5"},R0={class:""},G0={class:"col-span-2"},q0=l("label",{class:"text-sm"},"From",-1),z0={class:"col-span-2"},Y0=l("label",{class:"text-sm"},"To",-1),J0={class:"flex justify-between gap-x-3 pt-6"},V2=i0({__name:"index",setup(b){n0({title:"MySmartMedic - Doctor Schedules",meta:[{name:"",content:""}]});const _=b0(),C=_0(),w=N(),p=c0(()=>w.doctorSchedules),v=[{label:"1:00am",value:"1:00"},{label:"1:30am",value:"1:30"},{label:"2:00am",value:"2:00"},{label:"2:30am",value:"2:30"},{label:"3:00am",value:"3:00"},{label:"3:30am",value:"3:30"},{label:"4:00am",value:"4:00"},{label:"4:30am",value:"4:30"},{label:"5:00am",value:"5:00"},{label:"5:30am",value:"5:30"},{label:"6:00am",value:"6:00"},{label:"6:30am",value:"6:30"},{label:"7:00am",value:"7:00"},{label:"7:30am",value:"7:30"},{label:"8:00am",value:"8:00"},{label:"8:30am",value:"8:30"},{label:"9:00am",value:"9:00"},{label:"9:30am",value:"9:30"},{label:"10:00am",value:"10:00"},{label:"10:30am",value:"10:30"},{label:"11:00am",value:"11:00"},{label:"11:30am",value:"11:30"},{label:"12:00pm",value:"12:00"},{label:"12:30pm",value:"12:30"},{label:"1:00pm",value:"13:00"},{label:"1:30pm",value:"13:30"},{label:"2:00pm",value:"14:00"},{label:"2:30pm",value:"14:30"},{label:"3:00pm",value:"15:00"},{label:"3:30pm",value:"15:30"},{label:"4:00pm",value:"16:00"},{label:"4:30pm",value:"16:30"},{label:"5:00pm",value:"17:00"},{label:"5:30pm",value:"17:30"},{label:"6:00pm",value:"18:00"},{label:"6:30pm",value:"18:30"},{label:"7:00pm",value:"19:00"},{label:"7:30pm",value:"19:30"},{label:"8:00pm",value:"20:00"},{label:"8:30pm",value:"20:30"},{label:"9:00pm",value:"21:00"},{label:"9:30pm",value:"21:30"},{label:"10:00pm",value:"22:00"},{label:"10:30pm",value:"22:30"},{label:"11:00pm",value:"23:00"},{label:"11:30pm",value:"23:30"},{label:"12:00am",value:"24:00"},{label:"12:30am",value:"24:30"}
1],n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],c=S(p.value),V=S(!1),B=S(""),s=S({day:"",timeIntervals:[]}),O=e=>{B.value=e,V.value=!0;const t=c.value.find(a=>a.day===e);t?s.value=t:s.value={day:e,timeIntervals:[]}},R=e=>e.timeIntervals.some(t=>!t.startTime||!t.endTime),G=e=>e.timeIntervals.some(t=>{let a=parseInt(t.startTime.split(":")[0]),u=parseInt(t.endTime.split(":")[0]);return t.endTime.endsWith(":30")&&(u+=.5),t.startTime.endsWith(":30")&&(a+=.5),a>=u}),q=e=>{const t=e.timeIntervals,a=m=>{const[g,H]=m.split(":").map(Number);return g*60+H},u=t.slice().sort((m,g)=>a(m.startTime)-a(g.startTime));for(let m=0;m<u.length-1;m++){const g=a(u[m].endTime),H=a(u[m+1].startTime);if(g>H)return!1}return!0},z=()=>{const e=R(s.value),t=q(s.value),a=G(s.value);if(e){x.error(f,"You cannot have empty time!");return}if(a){x.error(f,"Endtime cannot be earlier than starttime!");return}if(!t){x.error(f,"Time must not overlap!");return}V.value=!1,c.value.find(m=>m.day===s.value.day)||c.value.push({...s.value}),p.value.length==0?U():$()},Y=e=>{const t=s.value.timeIntervals[s.value.timeIntervals.length-2];if(t){let a=parseInt(t.endTime.split(":")[0]),u=parseInt(e.split(":")[0]);if(t.endTime.endsWith(":30")&&(a+=.5),a>u){x.error(f,"Time cannot overlap!"),s.value.timeIntervals[s.value.timeIntervals.length-1].startTime="";return}}},J=e=>{c.value.splice(e,1)},W=e=>c.value.some(t=>t.day===e),K=()=>{const e=s.value.timeIntervals[s.value.timeIntervals.length-1];if(e){let t=parseInt(e.startTime.split(":")[0]),a=parseInt(e.endTime.split(":")[0]);if(e.endTime.endsWith(":30")&&(a+=.5),e.startTime.endsWith(":30")&&(t+=.5),t>=a){x.error(f,"Endtime cannot be earlier than starttime.");return}}s.value.timeIntervals.push({startTime:"",endTime:""})},P=e=>{s.value.timeIntervals.splice(e,1)},f=Z(),x=L(),{action:Q,loading:X}=f0();async function U(){if(c.value.length==0){x.error(f,"Cannot save an empty data!");return}try{await Q(c.value)}catch(e){k(e,f)}}async function $(){if(c.value.length==0){x.error(f,"Schedule saved successfully!");return}try{await _.action(c.value)}catch(e){k(e,f)}}return r0(async()=>{await C.action(),c.value=p.value}),(e,t)=>{const a=t0,u=l0,m=a0,g=s0,H=o0;return i(),d(M,null,[l("div",w0,[x0,r(C).loading.value==!1?(i(),d("div",T0,[l("div",S0,[l("div",V0,[r(p).length==0?(i(),D(a,{key:0,type:"button",label:"Save All",loading:r(X),onClick:U},null,8,["loading"])):(i(),D(a,{key:1,type:"button",label:"Save All Edits",loading:r(_).loading.value,onClick:$},null,8,["loading"]))]),l("div",H0,[(i(),d(M,null,E(n,(o,T)=>l("button",{key:T,class:"flex gap-x-2 text-primary-900",onClick:h=>O(o)},[l("img",{src:W(o)||W(o.toLowerCase())?r(g0):r(y0),class:"w-6 h-6"},null,8,k0),l("span",E0,I(o),1)],8,M0)),64))])]),l("div",I0,[r(c).length>0?(i(),d("div",Z0,[D0,(i(!0),d(M,null,E(r(c),(o,T)=>(i(),d("div",{key:o.day,class:"w-full border border-w-slate py-[10px] px-4 text-sm mt-3 rounded"},[l("div",L0,[l("div",A0,I(o.day),1),l("div",B0,[l("button",{onClick:h=>J(T)},[y(u,{name:"mingcute:delete-2-line"})],8,W0)])]),(i(!0),d(M,null,E(o.timeIntervals,(h,e0)=>(i(),d("div",{class:"flex items-center gap-x-1 mt-1 text-surface-600",key:e0},[y(u,{name:"mingcute:time-line",class:"text-lg"}),l("div",null,I(r(F)(h.startTime))+" - "+I(r(F)(h.endTime)),1)]))),128))]))),128))])):(i(),d("div",U0,N0))])])):(i(),d("div",O0,[y(m)]))]),y(H,{visible:r(V),"onUpdate:visible":t[0]||(t[0]=o=>d0(V)?V.value=o:null),header:`${r(B)}`,position:"right",class:"lg:min-w-[30rem]"},{default:u0(()=>[l("div",R0,[(i(!0),d(M,null,E(r(s).timeIntervals,(o,T)=>(i(),d("div",{key:T,class:"grid grid-cols-5 gap-x-2 items-center"},[l("div",G0,[q0,y(g,{modelValue:o.startTime,"onUpdate:modelValue":h=>o.startTime=h,options:v,optionValue:"value",optionLabel:"label",onChange:h=>Y(o.startTime),placeholder:"Start Time",class:"time-select"},null,8,["modelValue","onUpdate:modelValue","onChange"])]),l("div",z0,[Y0,y(g,{modelValue:o.endTime,"onUpdate:modelValue":h=>o.endTime=h,options:v,placeholder:"End Time",optionValue:"value",optionLabel:"label",class:"time-select"},null,8,["modelValue","onUpdate:modelValue"])]),y(a,{icon:"pi pi-trash",class:"bg-red-600 h-[40px] border-0 min-w-[40px] w-full mt-6",onClick:h=>P(T)},null,8,["onClick"])]))),128)),l("div",J0,[y(a,{label:"Add Time Interval",icon:"pi pi-plus",onClick:K,class:"bg-primary-500"}),r(s).timeIntervals.length>0?(i(),D(a,{key:0,label:"Close & Save",icon:"pi pi-check",class:"bg-primary-900",onClick:z})):m0("",!0)])])]),_:1},8,["visible","header"])],64)}}});
1export{V2 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.