@oneclick.dev/cms-core-modules 0.0.82 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentEditor-Dk-iDEjl.mjs → ContentEditor-DPhhOkx3.mjs} +7085 -5936
- package/dist/{ContentEditor-4e80zFyn.js → ContentEditor-DrxtH_Hq.js} +42 -42
- package/dist/{Create-DtFzwxn_.mjs → Create-6uT9HWar.mjs} +35 -35
- package/dist/{Create-CRn2sMHp.js → Create-DuZ5nZrX.js} +1 -1
- package/dist/{DateFormatter-DfIwyrnF.mjs → DateFormatter-2B0R-DY4.mjs} +213 -406
- package/dist/DateFormatter-DbtOLV0L.js +1 -0
- package/dist/{Detail-Bxi7lG9x.js → Detail-BZ-iE9vf.js} +1 -1
- package/dist/{Detail-B4b_FLDa.mjs → Detail-C1Blq61w.mjs} +90 -90
- package/dist/{Detail-BayNaAg9.js → Detail-C8wQiDcv.js} +1 -1
- package/dist/{Detail-BwDnY42G.mjs → Detail-CJVMJDP7.mjs} +17 -17
- package/dist/{Detail-CnK-qbhE.js → Detail-CPqug27l.js} +1 -1
- package/dist/Detail-CjuhjPby.js +1 -0
- package/dist/{Detail-U0mgLKt6.mjs → Detail-CtItxMX4.mjs} +62 -63
- package/dist/{Detail-CVgWHbMC.mjs → Detail-Dnpnmy4-.mjs} +158 -158
- package/dist/{Entries-D7MHylQE.mjs → Entries-BkOPae4R.mjs} +49 -49
- package/dist/Entries-CcEW98F5.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-Ds7z0qeH.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-C5YczjNb.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js} +1 -1
- package/dist/{Overview-CwCAeBnX.js → Overview-CA8wh_BI.js} +1 -1
- package/dist/{Overview-CgViRnNc.mjs → Overview-D4MFwRI_.mjs} +67 -68
- package/dist/{Overview-pCO_47Zt.js → Overview-Da0XexiT.js} +1 -1
- package/dist/Overview-DeQQ0FY3.js +1 -0
- package/dist/{Overview--XpvBbqz.mjs → Overview-DoOASlNz.mjs} +1 -3
- package/dist/{Overview-CuCQgqVp.mjs → Overview-gJSvftdE.mjs} +34 -34
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs} +0 -1
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js} +1 -1
- package/dist/{SeoHealth-CC0rW1AG.mjs → SeoHealth-Bc5chnaa.mjs} +14 -14
- package/dist/{SeoHealth-EZzDmPDM.js → SeoHealth-BkpJ1F2Y.js} +1 -1
- package/dist/TableView-BPWAx--G.mjs +5743 -0
- package/dist/TableView-D63QrVlK.js +4 -0
- package/dist/View-BL70u98U.js +1 -0
- package/dist/{View-DDXN0tKD.mjs → View-BO5N911y.mjs} +5 -5
- package/dist/{agenda-XqvbrU72.mjs → agenda-C5grvzSa.mjs} +166 -169
- package/dist/agenda-DXMwVWpN.js +1 -0
- package/dist/{availability-B-tRp8hB.mjs → availability-C1NqOFsQ.mjs} +81 -81
- package/dist/{availability-BiBbzEIM.js → availability-D_wnfLsH.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-CLgeeUSy.mjs → exceptions-BIwMhYa4.mjs} +1 -1
- package/dist/{exceptions-wEQEVzIs.js → exceptions-Cn7zooEu.js} +1 -1
- package/dist/{index-DTzdHh6g.js → index-C9pSS15N.js} +2 -2
- package/dist/{index-N0NoDEsI.mjs → index-MwjeLHPP.mjs} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +50 -36
- package/dist/orders-CG1QUCN8.js +1 -0
- package/dist/orders-CeixEBcU.mjs +396 -0
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +292 -256
- package/dist/src/contentManager/config.d.ts +28 -0
- package/dist/src/contentManager/index.d.ts +28 -0
- package/dist/src/contentManager/server.d.ts +7 -0
- package/dist/src/server-handlers.d.ts +1 -0
- package/package.json +2 -2
- package/dist/DateFormatter-C9qfmQnP.js +0 -1
- package/dist/Detail-BcboL7NF.js +0 -1
- package/dist/Entries-BPkZ7Jg5.js +0 -1
- package/dist/Overview-B-8TLLjh.js +0 -1
- package/dist/TableView-Ce8H65pL.js +0 -586
- package/dist/TableView-DRQvOW85.mjs +0 -89190
- package/dist/View-DfzaVOzS.js +0 -1
- package/dist/agenda-wNFDKn0G.js +0 -1
- package/dist/floating-ui.dom-BO2Hr6mz.mjs +0 -1292
- package/dist/floating-ui.dom-CAr9LGoC.js +0 -1
- package/dist/index-DYpruS-A-CA2jEOA3.js +0 -88
- package/dist/index-DYpruS-A-D38FBcI3.mjs +0 -4211
- package/dist/index-YMaY4uuk-BgpTtr73.js +0 -1
- package/dist/index-YMaY4uuk-C_xV5K9Z.mjs +0 -1300
- package/dist/orders-Bqa3Z3tH.mjs +0 -356
- package/dist/orders-D5GJOZXN.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("./DateFormatter-DbtOLV0L.js"),C=require("lucide-vue-next"),te=require("./EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js"),j=require("@oneclick.dev/cms-kit"),K=require("./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Q=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js"),ne={class:"mb-6"},re={class:"flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible"},se=["onClick"],ae={class:"absolute -top-8 left-1/2 -translate-x-1/2 bg-popover border shadow-md rounded px-2 py-1 text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10"},le={class:"font-medium"},ie={class:"text-muted-foreground"},ce={class:"w-full flex-1 flex items-end justify-center"},de={key:1,class:"text-[10px] mt-1"},ue={key:0,class:"mt-2 text-sm text-muted-foreground flex items-center gap-2"},me={class:"font-medium text-foreground"},pe={class:"font-medium text-foreground"},fe=e.defineComponent({__name:"TimelineChart",props:{timeSlots:{},slotStats:{},selectedTimeSlot:{},maxSpots:{}},emits:["select","clear"],setup(u,{emit:h}){const v=h,y=r=>{v("select",r)},E=()=>{v("clear")};return(r,a)=>{const i=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",ne,[a[2]||(a[2]=e.createElementVNode("h3",{class:"font-semibold text-sm mb-2"},"Timeline",-1)),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.timeSlots,o=>(e.openBlock(),e.createElementBlock("div",{key:o.startTime,class:"flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",onClick:x=>y(o.startTime)},[e.createElementVNode("div",ae,[e.createElementVNode("div",le,e.toDisplayString(o.startTime),1),e.createElementVNode("div",ie,e.toDisplayString(u.slotStats[o.startTime]?.spots||0)+" spots",1)]),e.createElementVNode("div",ce,[e.createElementVNode("div",{class:e.normalizeClass(["w-full transition-all duration-200",[u.selectedTimeSlot===o.startTime?"bg-primary":u.slotStats[o.startTime]?.spots>0?"bg-primary/60 group-hover:bg-primary/80":"bg-muted-foreground/20 group-hover:bg-muted-foreground/30"]]),style:e.normalizeStyle({height:u.slotStats[o.startTime]?.spots>0?`${u.slotStats[o.startTime].spots/u.maxSpots*100}%`:"2px",minHeight:u.slotStats[o.startTime]?.spots>0?"4px":"2px"})},null,6)]),o.startTime.endsWith(":00")?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-[10px] text-muted-foreground mt-1 transition-colors truncate",{"text-primary font-medium":u.selectedTimeSlot===o.startTime}])},e.toDisplayString(o.label),3)):(e.openBlock(),e.createElementBlock("span",de," "))],8,se))),128))]),u.selectedTimeSlot?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(i,{variant:"ghost",size:"icon",class:"h-6 w-6 p-0",onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1}),e.createElementVNode("span",null,[a[0]||(a[0]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",me,e.toDisplayString(u.slotStats[u.selectedTimeSlot]?.bookings||0),1),a[1]||(a[1]=e.createTextVNode(" bookings at ",-1)),e.createElementVNode("span",pe,e.toDisplayString(u.selectedTimeSlot),1)])])):e.createCommentVNode("",!0)])}}}),ve={class:"flex items-center justify-between mb-3"},ge={class:"font-semibold"},he={key:0,class:"text-muted-foreground font-normal"},xe={class:"relative mb-3"},ye={key:0,class:"flex items-center justify-center py-8"},ke={key:1,class:"text-center py-8 text-muted-foreground"},be={key:2,class:"space-y-2 max-h-80 overflow-y-auto"},_e=["onClick"],Ne={class:"flex items-start justify-between"},Ee={class:"flex-1"},we={class:"font-medium"},Ve={class:"text-sm text-muted-foreground"},Se={class:"text-sm text-muted-foreground"},Ce={class:"flex items-center gap-4"},Be={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},$e={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},De={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},ze={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Me={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Ie={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Le={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Re={key:5,class:"text-sm font-medium mt-1"},Ue=e.defineComponent({__name:"BookingsList",props:{orders:{},filteredOrders:{},isLoading:{type:Boolean},selectedTimeSlot:{},searchQuery:{}},emits:["update:searchQuery","refresh"],setup(u,{emit:h}){const v=h,y=e.ref(null),E=i=>{v("update:searchQuery",i)},r=()=>{v("update:searchQuery","")},a=()=>{v("refresh")};return(i,o)=>{const x=e.resolveComponent("Input"),g=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ve,[e.createElementVNode("h3",ge,[o[0]||(o[0]=e.createTextVNode(" Bookings ",-1)),u.selectedTimeSlot||u.searchQuery?(e.openBlock(),e.createElementBlock("span",he," ("+e.toDisplayString(u.filteredOrders.length)+" of "+e.toDisplayString(u.orders.length)+") ",1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",xe,[e.createVNode(e.unref(C.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(x,{"model-value":u.searchQuery,placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9","onUpdate:modelValue":E},null,8,["model-value"]),u.searchQuery?(e.openBlock(),e.createBlock(g,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:r},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),u.isLoading?(e.openBlock(),e.createElementBlock("div",ye,[...o[1]||(o[1]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):u.filteredOrders.length===0?(e.openBlock(),e.createElementBlock("div",ke,e.toDisplayString(u.selectedTimeSlot?"No bookings for this time slot":"No bookings for this event"),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.filteredOrders,p=>(e.openBlock(),e.createElementBlock("div",{key:p.res_id||p.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors",onClick:w=>e.unref(y).openDialog(p)},[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.createElementVNode("div",we,e.toDisplayString(p.customerInfo.firstName+" "+p.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Ve,e.toDisplayString(p.customerInfo.email),1),e.createElementVNode("div",Se,e.toDisplayString(p.customerInfo.phone),1),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[e.createVNode(e.unref(C.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.startTime)+" - "+e.toDisplayString(p.endTime),1)]),e.createElementVNode("div",$e,[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.spots),1)])])]),e.createElementVNode("div",De,[p.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Te,"Needs Approval")):p.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",ze,"Approved")):p.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Me,"Rejected")):p.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ie,"Cancelled")):(e.openBlock(),e.createElementBlock("span",Le,"Pending")),p.reservationPrice||p.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Re," €"+e.toDisplayString(p.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,_e))),128))])),e.createVNode(K._sfc_main,{ref_key:"reservationDetailDialog",ref:y,onCancelled:a,onConfirmed:a,onRejected:a},null,512)])}}}),je={class:"flex items-center gap-4 mt-2 text-sm"},Fe={class:"flex items-center gap-1"},Pe={key:0,class:"flex items-center gap-1"},Oe={class:"flex items-center gap-1"},Ae={class:"py-4"},qe=e.defineComponent({__name:"EventDialog",props:{resources:{default:()=>[]}},setup(u,{expose:h}){const v=u,{config:y}=j.useModule(),{params:E}=j.useModuleRoute(),r=j.useFirebaseIntegration(y.project),a=e.ref(!1),i=e.ref(null),o=e.ref([]),x=e.ref(!1),g=e.ref(null),p=e.ref("");e.provide("event",i);const w=e.computed(()=>{if(!i.value)return[];const d=i.value.resource?.interval||60,n=[],[c,_]=i.value.startTime.split(":").map(Number),[T,b]=i.value.endTime.split(":").map(Number),$=c*60+_,t=T*60+b;for(let l=$;l<t;l+=d){const f=Math.floor(l/60),m=l%60,N=Math.min(l+d,t),D=Math.floor(N/60),s=N%60,z=`${f.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`,I=`${D.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;n.push({startTime:z,endTime:I,label:z})}return n}),k=d=>{const n=d.getFullYear(),c=String(d.getMonth()+1).padStart(2,"0"),_=String(d.getDate()).padStart(2,"0");return`${n}-${c}-${_}`},M=e.computed(()=>{const d={};return w.value.forEach(n=>{d[n.startTime]={bookings:0,spots:0,orders:[]}}),o.value.forEach(n=>{w.value.forEach(c=>{n.startTime<c.endTime&&n.endTime>c.startTime&&(d[c.startTime].bookings++,d[c.startTime].spots+=n.spots||0,d[c.startTime].orders.push(n))})}),d}),V=e.computed(()=>Math.max(1,...Object.values(M.value).map(d=>d.spots))),S=e.computed(()=>{let d=o.value;return g.value&&(d=M.value[g.value]?.orders||[]),p.value.trim()&&(d=new K.Fuse(d,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone"],threshold:.3,ignoreLocation:!0}).search(p.value).map(c=>c.item)),d}),B=e.computed(()=>({spots:o.value.reduce((d,n)=>d+(n.spots||0),0),bookings:o.value.length})),F=d=>{g.value===d?g.value=null:g.value=d},L=()=>{g.value=null},P=async d=>{a.value=!0,i.value=d,g.value=null,p.value="",await U()},U=async()=>{if(i.value){x.value=!0,o.value=[];try{const d=E.value.id,n=k(new Date(i.value.date)),c=new Set;v.resources?.forEach(b=>{const $=`${b.id}_${n}`;c.add($)});const _=await r.find(y.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:d},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(c)}]});let T=[];_.forEach(b=>{(b.reservations?.filter(t=>t.date===n)||[]).forEach(t=>{const l=v.resources.find(f=>f.id===t.resourceId);(t.status==="approved"||t.status==="needs_approval")&&T.push({customerInfo:b.customerInfo,amountDue:b.amountDue,amountPaid:b.amountPaid,status:b.status,reservationStatus:t.status,subtotal:b.subtotal,total:b.total,discount:b.discount,id:b.id,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:n,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:l?.name||"Unknown",resourceColor:l?.color})})}),o.value=T.sort((b,$)=>b.startTime?.localeCompare($.startTime||"")||0)}catch(d){console.error("Error loading orders:",d),o.value=[]}finally{x.value=!1}}},q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["January","February","March","April","May","June","July","August","September","October","November","December"];return h({openDialog:P}),(d,n)=>{const c=e.resolveComponent("DialogTitle"),_=e.resolveComponent("DialogDescription"),T=e.resolveComponent("DialogHeader"),b=e.resolveComponent("Button"),$=e.resolveComponent("DialogFooter"),t=e.resolveComponent("DialogScrollContent"),l=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(l,{open:a.value,"onUpdate:open":n[2]||(n[2]=f=>a.value=f)},{default:e.withCtx(()=>[e.createVNode(t,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[i.value?.date?(e.openBlock(),e.createBlock(c,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(q[new Date(i.value.date).getUTCDay()])+" "+e.toDisplayString(O[new Date(i.value.date).getUTCMonth()])+" "+e.toDisplayString(new Date(i.value.date).getUTCDate())+", "+e.toDisplayString(new Date(i.value.date).getUTCFullYear()),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(_,null,{default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(C.Clock),{size:14}),e.createElementVNode("span",null,e.toDisplayString(i.value?.startTime)+" – "+e.toDisplayString(i.value?.endTime),1)]),i.value?.resource?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",{class:"w-4 h-4 rounded-full",style:e.normalizeStyle({backgroundColor:i.value.resource.color||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(i.value.resource.name),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Oe,[e.createVNode(e.unref(C.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(B.value.spots)+" spots in "+e.toDisplayString(B.value.bookings)+" reservations",1)])])]),_:1})]),_:1}),e.createElementVNode("div",Ae,[w.value.length>1?(e.openBlock(),e.createBlock(fe,{key:0,"time-slots":w.value,"slot-stats":M.value,"selected-time-slot":g.value,"max-spots":V.value,onSelect:F,onClear:L},null,8,["time-slots","slot-stats","selected-time-slot","max-spots"])):e.createCommentVNode("",!0),e.createVNode(Ue,{orders:o.value,"filtered-orders":S.value,"is-loading":x.value,"selected-time-slot":g.value,"search-query":p.value,"onUpdate:searchQuery":n[0]||(n[0]=f=>p.value=f),onRefresh:U},null,8,["orders","filtered-orders","is-loading","selected-time-slot","search-query"])]),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(b,{variant:"outline",onClick:n[1]||(n[1]=f=>a.value=!1)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),He={class:"flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]"},We={class:"relative h-full min-h-[1536px]"},Qe={class:"divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80"},Xe={class:"absolute inset-0 pointer-events-none"},Ye={class:"relative mr-3 h-full ml-2"},Je=["onClick"],Ke={key:0,class:"absolute bottom-0 left-0 right-0 h-1 bg-black/20"},Ge={class:"flex items-start justify-between gap-2 mb-1"},Ze={class:"font-semibold text-sm leading-tight line-clamp-1 flex-1"},et={class:"flex items-center gap-1 shrink-0"},tt=["title"],ot={class:"font-medium"},X=e.defineComponent({__name:"EventTimeline",props:{date:{},events:{},firstDay:{type:Boolean,default:!1},resources:{default:()=>[]}},setup(u){const h=u,v=e.ref(null),y=a=>{const[i,o]=a.split(":").map(Number);return i*60+o};e.computed(()=>!h.events||!h.resources?[]:h.resources.map(a=>{const o=h.events.filter(x=>x.resourceId===a.id).map(x=>{const g=y(x.startTime),w=y(x.endTime)-g,k=g/1440*100,M=w/1440*100,V=(x.bookings??0)>0,S=x.maxBookings?(x.bookings??0)/x.maxBookings*100:0;return{...x,top:`${k}%`,height:`${M}%`,color:x.resource?.color||"#3b82f6",hasBookings:V,fillPercentage:S,isSmall:w<60}});return{resource:a,events:o}}));const E=e.computed(()=>h.events?h.events.map(a=>{const i=y(a.startTime),x=y(a.endTime)-i,g=i/1440*100,p=x/1440*100,w=(a.bookings??0)>0,k=a.maxBookings?(a.bookings??0)/a.maxBookings*100:0;return{...a,top:`${g}%`,height:`${p}%`,color:a.resource?.color||"#3b82f6",hasBookings:w,fillPercentage:k,isSmall:x<60}}):[]),r=Array.from({length:24},(a,i)=>({hour:i,label:`${i.toString().padStart(2,"0")}:00`}));return(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",He,[e.createElementVNode("div",We,[e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),o=>(e.openBlock(),e.createElementBlock("div",{key:o.hour,class:"flex-1 flex transition-all duration-200"},[...i[0]||(i[0]=[e.createElementVNode("div",{class:"flex-1 relative"},[e.createElementVNode("div",{class:"absolute top-1/2 left-0 right-0 border-t border-dashed border-input/50"})],-1)])]))),128))]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,style:e.normalizeStyle({top:o.top,height:o.height,opacity:o.hasBookings?"1":"0.5"}),class:"event-card absolute left-2 right-2 rounded-lg pointer-events-auto cursor-pointer group/event transition-all duration-200 hover:shadow-xl overflow-hidden",onClick:x=>v.value?.openDialog(o)},[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:o.color}),class:"absolute inset-0 shadow-lg"},[o.maxBookings?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{class:"h-full bg-white/40 transition-all duration-300",style:e.normalizeStyle({width:`${o.fillPercentage}%`})},null,4)])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:e.normalizeClass(["relative h-full p-3 flex flex-col",`${o.hasBookings?"text-white":"text-gray-600 dark:text-gray-100"}`])},[e.createElementVNode("div",Ge,[e.createElementVNode("h3",Ze,e.toDisplayString(o.title),1),e.createElementVNode("div",et,[o.resource?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold bg-white/30 backdrop-blur-sm text-white border border-white/40",title:o.resource.name},e.toDisplayString(o.resource.avatarLabel||o.resource.name.charAt(0).toUpperCase()),9,tt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",o.hasBookings?"bg-white text-black backdrop-blur-sm":"bg-black/10 backdrop-blur-sm"])},[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(o.bookings),1)],2)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 text-xs opacity-90 mt-auto",{"-translate-x-1 -translate-y-2 scale-80 origin-[0_0]":o.isSmall}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded backdrop-blur-sm",{"bg-black/10":!o.isSmall}])},[e.createVNode(e.unref(C.Clock),{size:10}),e.createElementVNode("span",ot,e.toDisplayString(o.startTime)+" – "+e.toDisplayString(o.endTime),1)],2)],2)],2),i[1]||(i[1]=e.createElementVNode("div",{class:"absolute inset-0 border-2 border-white/0 group-hover/event:border-white/30 rounded-lg transition-colors duration-200 pointer-events-none"},null,-1))],12,Je))),128))])])])]),e.createVNode(qe,{resources:u.resources,ref_key:"eventDialog",ref:v},null,8,["resources"])],64))}}),nt={class:"sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input"},rt={class:"flex-shrink-0 text-xs font-medium text-muted-foreground px-3 pb-3 border-r border-border/50 w-14"},st={class:"flex items-center gap-1.5"},Y=e.defineComponent({__name:"Event24hSidebar",setup(u){const h=Array.from({length:24},(v,y)=>({hour:y,label:`${y.toString().padStart(2,"0")}:00`}));return(v,y)=>(e.openBlock(),e.createElementBlock("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),E=>(e.openBlock(),e.createElementBlock("div",{key:E.hour,class:"flex-1 flex transition-all duration-200"},[e.createElementVNode("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("span",{class:e.normalizeClass({"-translate-y-1/2":E.hour!==0})},e.toDisplayString(E.label),3)])])]))),128))]))}}),at={class:"absolute top-0 w-full pointer-events-none"},lt={key:0,class:"absolute -right-2 -top-0.5 px-2 py-0.5 bg-red-500 text-white text-xs font-medium rounded shadow-lg"},J=e.defineComponent({__name:"EventTimeIndicator",props:{currentDate:{type:Object,required:!1}},setup(u){const h=e.ref(Date.now());let v;e.onMounted(()=>{v=window.setInterval(()=>{h.value=Date.now()},1e3)}),e.onUnmounted(()=>{v&&clearInterval(v)});const y=e.computed(()=>{const r=new Date(h.value);return`${(r.getHours()*60+r.getMinutes()+r.getSeconds()/60)/1440*100}%`}),E=e.computed(()=>new Date(h.value).getFullYear()+"-"+(new Date(h.value).getMonth()+1).toString().padStart(2,"0")+"-"+new Date(h.value).getDate().toString().padStart(2,"0"));return(r,a)=>(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",{class:"absolute left-0 right-0 h-0.5 bg-red-500 z-30 pointer-events-none transition-[top] duration-300 ease-linear",style:e.normalizeStyle({top:y.value})},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute -left-2 -top-1.5 w-3 h-3 bg-red-500 rounded-full shadow-lg shadow-red-500/50"},null,-1)),u.currentDate&&u.currentDate==E.value?(e.openBlock(),e.createElementBlock("div",lt," Now ")):e.createCommentVNode("",!0)],4)]))}}),it={key:0,class:"relative flex flex-1 min-w-0"},ct={key:1,class:"flex-1 min-w-0 relative"},dt={key:0,class:"absolute top-0 right-0 z-10 px-3 py-1.5 bg-primary/90 text-primary-foreground text-xs font-medium rounded-bl-lg shadow-lg backdrop-blur-sm flex items-center gap-1.5 animate-pulse-subtle"},ut={class:"flex pb-4 min-w-[200px]"},mt=["onClick"],pt={key:0,class:"absolute top-2 right-2 flex items-center gap-1 px-2 py-0.5 bg-primary/20 backdrop-blur-sm rounded-full border border-primary/30"},ft={class:"text-xs text-muted-foreground font-medium group-hover:text-foreground/70 transition-colors"},vt={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-orange-500"},gt=e.defineComponent({__name:"EventView",setup(u){const h=e.inject("activeDate",e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))),v=e.inject("viewMode",e.ref(1)),y=e.inject("events",e.ref([])),E=e.inject("resources",e.ref([])),r=e.ref(null),a=e.ref(!1),i=e.ref(!1);e.computed(()=>E.value.length>1);const o=e.computed(()=>{const n=[],c=h.value;for(let _=0;_<v.value;_++)n.push(c.add({days:_}));return n}),x=(n,c)=>{const _=`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`;return y.value?.filter(T=>T.date===_)||[]},g=n=>{const c=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2());return n.year===c.year&&n.month===c.month&&n.day===c.day},p=n=>{h.value=n,v.value=1};let w=null,k=null;const M=()=>{r.value&&(S(),r.value.scrollBy({left:-300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:-20,behavior:"auto"})},50)},300))},V=()=>{r.value&&(S(),r.value.scrollBy({left:300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:20,behavior:"auto"})},50)},300))},S=()=>{k&&(clearTimeout(k),k=null),w&&(clearInterval(w),w=null)},B=()=>{if(!r.value)return;const{scrollLeft:n,scrollWidth:c,clientWidth:_}=r.value;a.value=n>10,i.value=n<c-_-10},F=n=>{r.value&&Math.abs(n.deltaY)>Math.abs(n.deltaX)&&(n.preventDefault(),r.value.scrollBy({left:n.deltaY,behavior:"auto"}))},L=e.ref(!1),P=e.ref(0),U=e.ref(0),q=n=>{!r.value||v.value===1||n.target.closest(".event-card")||(L.value=!0,P.value=n.pageX,U.value=r.value.scrollLeft,r.value.style.userSelect="none",n.preventDefault())},O=n=>{if(!L.value||!r.value)return;const c=n.pageX,_=(P.value-c)*1.2;r.value.scrollLeft=U.value+_},d=()=>{r.value&&(L.value=!1,r.value.style.userSelect="")};return e.onMounted(()=>{r.value&&(r.value.addEventListener("scroll",B),r.value.addEventListener("wheel",F,{passive:!1}),e.nextTick(()=>{B(),setTimeout(B,50),setTimeout(B,150),setTimeout(B,300),setTimeout(B,500)})),document.addEventListener("mousemove",O),document.addEventListener("mouseup",d)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",d)}),e.watch(v,()=>{v.value>1?e.nextTick(()=>{setTimeout(()=>{if(!r.value)return;const{scrollWidth:n,clientWidth:c}=r.value;n>c&&(i.value=!0,a.value=!1)},100)}):r.value&&(r.value.style.cursor="")}),e.onUnmounted(()=>{S(),r.value&&(r.value.removeEventListener("scroll",B),r.value.removeEventListener("wheel",F))}),(n,c)=>{const _=e.resolveComponent("Button"),T=e.resolveComponent("TooltipTrigger"),b=e.resolveComponent("TooltipContent"),$=e.resolveComponent("Tooltip");return e.unref(v)===1?(e.openBlock(),e.createElementBlock("div",it,[e.createVNode(Y),e.createVNode(J,{class:"h-full","current-date":e.unref(h)},null,8,["current-date"]),e.createVNode(X,{date:e.unref(h),events:x(e.unref(h)),resources:e.unref(E)},null,8,["date","events","resources"])])):(e.openBlock(),e.createElementBlock("div",ct,[e.unref(v)===7?(e.openBlock(),e.createElementBlock("div",dt,[e.createVNode(e.unref(C.ChevronLeft),{size:12}),c[0]||(c[0]=e.createElementVNode("span",null,"Scroll to view all days",-1)),e.createVNode(e.unref(C.ChevronRight),{size:12})])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(_,{key:1,variant:"outline",size:"icon",onMousedown:M,onMouseup:S,onMouseleave:S,onTouchstart:M,onTouchend:S,class:"sticky top-1/2 left-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:20})]),_:1})):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(_,{key:2,variant:"outline",size:"icon",onMousedown:V,onMouseup:S,onMouseleave:S,onTouchstart:V,onTouchend:S,class:"sticky top-1/2 right-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2 float-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:20})]),_:1})):e.createCommentVNode("",!0),e.createVNode(J,{class:"h-[calc(100%-164px)] mt-[122px]"}),e.createElementVNode("div",{class:e.normalizeClass(["absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none transition-opacity duration-300",i.value?"opacity-100":"opacity-0"])},null,2),e.createElementVNode("div",{ref_key:"scrollContainer",ref:r,class:"absolute inset-0 overflow-x-auto overflow-y-visible",onScroll:B,onMousedown:q},[e.createElementVNode("div",ut,[e.createVNode(Y),c[5]||(c[5]=e.createElementVNode("div",{class:"absolute w-14 h-[125px] bg-input"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{key:t.toString(),class:e.normalizeClass(["flex-shrink-0",{"min-w-[200px] w-[33.33%]":e.unref(v)===3,"min-w-[280px]":e.unref(v)===7}])},[e.createElementVNode("div",{onClick:f=>p(t),class:e.normalizeClass(["relative p-3 border cursor-pointer transition-all duration-200 group relative",g(t)?"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/30 hover:from-primary/20 hover:to-primary/10 hover:border-primary/50 hover:shadow-md":"bg-gradient-to-br from-muted/50 to-muted/30 border-border hover:from-accent/50 hover:to-accent/30 hover:border-accent-foreground/20 hover:shadow-md"])},[g(t)?(e.openBlock(),e.createElementBlock("div",pt,[...c[1]||(c[1]=[e.createElementVNode("div",{class:"w-1.5 h-1.5 bg-primary rounded-full animate-pulse"},null,-1),e.createElementVNode("span",{class:"text-[9px] font-bold text-primary uppercase tracking-wide"},"Today",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["text-xs font-semibold uppercase tracking-wider transition-colors",g(t)?"text-primary group-hover:text-primary/80":"text-muted-foreground group-hover:text-foreground"])},e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{weekday:"short"})),3),e.createElementVNode("div",{class:e.normalizeClass(["text-2xl font-bold transition-colors",g(t)?"text-foreground":"text-foreground group-hover:text-primary"])},e.toDisplayString(t.day),3),e.createElementVNode("div",ft,e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{month:"long",year:"numeric"})),1),c[4]||(c[4]=e.createElementVNode("div",{class:"mt-2 pt-2 border-t border-border/0 group-hover:border-border/50 transition-all"},[e.createElementVNode("div",{class:"text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/100 uppercase tracking-wide transition-all"}," Click to view ")],-1)),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createBlock(e.unref(C.Asterisk),{key:0,class:"absolute top-3 right-3 size-4 text-orange-500"})):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createElementBlock("div",vt)):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[3]||(c[3]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024)],10,mt),e.createVNode(X,{date:t,events:x(t),resources:e.unref(E)},null,8,["date","events","resources"])],2))),128))])],544)]))}}}),ht=oe._export_sfc(gt,[["__scopeId","data-v-99339cf2"]]),xt={class:"flex flex-col gap-2 md:gap-4 w-full h-full"},yt={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-1"},kt={class:"flex items-center justify-between sm:justify-start gap-4"},bt={class:"flex flex-col"},_t={class:"flex items-center gap-2"},Nt={class:"text-lg sm:text-2xl font-bold tracking-tight truncate"},Et={class:"text-xs sm:text-sm text-muted-foreground ml-7 truncate"},wt={class:"flex items-center justify-between sm:justify-end gap-2"},Vt={class:"flex items-center gap-1 sm:mr-2"},St={key:0,class:"flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"},Ct=["onClick"],Bt={class:"flex gap-4 flex-1 min-h-0 md:min-h-[1700px]"},$t={class:"hidden md:flex flex-shrink-0 flex-col gap-4"},Dt={key:0,class:"rounded-md border p-3"},Tt={class:"space-y-1"},zt=["onClick"],Mt={class:"min-w-0 flex-1"},It={class:"text-sm font-medium truncate"},Lt={key:0,class:"pt-2 mt-2 border-t"},Rt={key:0,class:"mt-1 space-y-1"},Ut={class:"min-w-0 flex-1"},jt={class:"text-sm font-medium truncate text-muted-foreground"},Ft=e.defineComponent({__name:"agenda",setup(u){const{hasPermission:h}=j.useModulePermissions(),{params:v}=j.useModuleRoute(),{config:y}=j.useModule(),E=j.useFirebaseIntegration(y.project),r=e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),a=e.ref(1),i=e.ref(typeof window<"u"?window.innerWidth:1024),o=e.computed(()=>i.value<768),x=()=>{i.value=window.innerWidth};e.onMounted(()=>{window.addEventListener("resize",x)}),e.onUnmounted(()=>{window.removeEventListener("resize",x)}),e.watch(o,t=>{t&&a.value!==1&&(a.value=1)},{immediate:!0});const g=e.ref(null),p=e.ref(new Map),w=e.computed(()=>g.value?.resources||[]),k=e.computed(()=>w.value.filter(t=>t.isActive)),M=e.computed(()=>w.value.filter(t=>!t.isActive)),V=e.ref(null),S=e.ref(!1);e.watch(k,t=>{t.length>0&&!V.value&&(V.value=t[0].id)},{immediate:!0});const B=e.computed(()=>{if(!V.value)return k.value.length>0?[k.value[0]]:[];const t=k.value.find(l=>l.id===V.value);return t?[t]:k.value.length>0?[k.value[0]]:[]}),F=e.computed(()=>g.value?.pricingOptions?.find(l=>l.isDefault)?.duration||30),L=t=>{V.value=t};e.watch(r,()=>{$()});const P=e.computed(()=>{const t=r.value,l=new Date(t.year,t.month-1,t.day),f=l.toLocaleDateString("en-US",{weekday:"long"}).toUpperCase(),m=t.day,N=l.toLocaleDateString("en-US",{month:"short"}).toUpperCase();return{dayName:f,day:m,monthName:N,full:`${f} ${m} ${N}`}}),U=()=>{r.value=r.value.subtract({days:a.value})},q=()=>{r.value=r.value.add({days:a.value})},O=()=>{r.value=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())},d=t=>{const[l,f]=t.split(":").map(Number);return l*60+f},n=(t,l)=>(g.value?.exceptions||[]).find(m=>l>=m.startDate&&l<=m.endDate?m.resourceIds===null?!0:m.resourceIds?.includes(t):!1)||null,c=(t,l,f)=>{const m=n(t.id,f);if(m)return m.isClosed?[]:m.timeslots.map(s=>({startTime:s.startTime,endTime:s.endTime,isException:!0}));const N=l.getDay(),D=t.openingHours?.[N]||[];return D.length===0?[]:D.map(s=>({startTime:s.start,endTime:s.end,isException:!1}))},_=(t,l,f,m)=>{if(!g.value)return 0;const N=p.value.get(l);return N?N.filter(s=>s.resourceId===t).reduce((s,z)=>{const I=d(z.startTime),A=d(z.endTime),H=d(f),W=d(m);return I<W&&A>H?s+(z.reserved||0):s},0):0},T=e.computed(()=>{if(!g.value)return[];p.value.size;let t=[],l=[];for(let m=0;m<a.value;m++){const N=r.value.add({days:m});l.push(N)}const f=B.value.length>0?B.value:[];return f.length===0?[]:(l.forEach(m=>{let N=new Date(m.year,m.month-1,m.day);const D=`${m.year}-${String(m.month).padStart(2,"0")}-${String(m.day).padStart(2,"0")}`;f.forEach(s=>{const z=c(s,N,D);t=t.concat(z.map((I,A)=>{const H=_(s.id,D,I.startTime,I.endTime);return{id:`block-${D}-${s.id}-${A}`,title:g.value.serviceName,date:D,startTime:I.startTime,endTime:I.endTime,theme:s.color||"#3b82f6",bookings:H,maxBookings:s.capacity,isException:I.isException||!1,resourceId:s.id,resource:s,interval:s.interval||30,serviceDuration:F.value}}))})}),t)}),b=async()=>{g.value=await E.get(y.agendaCollection,v.value.id)},$=async()=>{const t=v.value.id,l=r.value;p.value.clear();const f=[];for(let m=0;m<a.value;m++){const N=l.add({days:m}),D=`${N.year}-${String(N.month).padStart(2,"0")}-${String(N.day).padStart(2,"0")}`,s=`${t}_${D}`;f.push(E.get(y.reservedSpotsCollection,s).then(z=>{if(z){let I=[];for(const A of k.value){const H=z?.[A.id]||{};Object.entries(H).forEach(([W,G])=>{const[Z,ee]=W.split("-");I.push({resourceId:A.id,startTime:Z,endTime:ee,reserved:G})})}p.value.set(D,I)}}).catch(()=>{}))}await Promise.all(f)};return b(),$(),e.watch(a,()=>{$()}),e.provide("agendaData",g),e.provide("activeDate",r),e.provide("viewMode",a),e.provide("events",T),e.provide("resources",B),e.provide("allResources",k),(t,l)=>{const f=e.resolveComponent("Button"),m=e.resolveComponent("SegmentedControlButton"),N=e.resolveComponent("SegmentedControl"),D=e.resolveComponent("Calendar");return e.openBlock(),e.createBlock(te._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",xt,[e.createElementVNode("div",yt,[e.createElementVNode("div",kt,[e.createElementVNode("div",bt,[e.createElementVNode("div",_t,[e.createVNode(e.unref(C.CalendarDays),{size:20,class:"text-primary flex-shrink-0"}),e.createElementVNode("h2",Nt,e.toDisplayString(P.value.full),1)]),e.createElementVNode("p",Et,e.toDisplayString(g.value?.serviceName),1)]),o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",wt,[e.createElementVNode("div",Vt,[e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:U},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:16})]),_:1}),e.createVNode(f,{variant:"outline",size:"sm",class:"h-8 sm:h-9 px-2 sm:px-3 text-xs sm:text-sm",onClick:O},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:16})]),_:1})]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(N,{key:0,modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=s=>a.value=s)},{default:e.withCtx(()=>[e.createVNode(m,{value:1},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"1 Day",-1)])]),_:1}),e.createVNode(m,{value:3},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"3 Days",-1)])]),_:1}),e.createVNode(m,{value:7},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"7 Days",-1)])]),_:1})]),_:1},8,["modelValue"])),!o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:1})):e.createCommentVNode("",!0)])]),o.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 px-3 py-1.5 rounded-full border text-sm whitespace-nowrap transition-colors flex-shrink-0",{"bg-primary text-primary-foreground border-primary":V.value===s.id,"bg-background hover:bg-muted":V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",style:e.normalizeStyle({backgroundColor:V.value===s.id?"rgba(255,255,255,0.3)":s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("span",null,e.toDisplayString(s.name),1)],10,Ct))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.createElementVNode("div",$t,[e.createVNode(D,{modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=s=>r.value=s),"weekday-format":"short",class:"rounded-md border"},null,8,["modelValue"]),w.value.length>0?(e.openBlock(),e.createElementBlock("div",Dt,[l[7]||(l[7]=e.createElementVNode("div",{class:"flex items-center justify-between mb-3"},[e.createElementVNode("span",{class:"text-sm font-medium"},"Resources")],-1)),e.createElementVNode("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",{"bg-muted ring-2 ring-primary/20":V.value===s.id,"opacity-50":V.value&&V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Mt,[e.createElementVNode("div",It,e.toDisplayString(s.name),1)]),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full flex-shrink-0",V.value===s.id?"bg-primary":"bg-muted-foreground/30"])},null,2)],10,zt))),128)),M.value.length>0?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("button",{class:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",onClick:l[2]||(l[2]=s=>S.value=!S.value)},[e.createVNode(e.unref(C.ChevronRight),{size:14,class:e.normalizeClass(["transition-transform",{"rotate-90":S.value}])},null,8,["class"]),e.createElementVNode("span",null,"Inactive ("+e.toDisplayString(M.value.length)+")",1)]),S.value?(e.openBlock(),e.createElementBlock("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"flex items-center gap-2 p-2 rounded-md opacity-50"},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0 grayscale",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Ut,[e.createElementVNode("div",jt,e.toDisplayString(s.name),1)])]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createVNode(ht)])])]),_:1})}}});exports.default=Ft;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as K, ref as k, reactive as Q, resolveComponent as s, openBlock as u, createBlock as v, withCtx as
|
|
1
|
+
import { defineComponent as K, ref as k, reactive as Q, resolveComponent as s, openBlock as u, createBlock as v, withCtx as i, createVNode as t, createTextVNode as d, createElementVNode as a, createElementBlock as f, Fragment as R, renderList as U, toDisplayString as w, createCommentVNode as N, unref as A } from "vue";
|
|
2
2
|
import { _ as ee } from "./EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs";
|
|
3
3
|
import { Pencil as te, Eye as ie, EyeOff as oe, Trash2 as le, PlusCircle as ne } from "lucide-vue-next";
|
|
4
4
|
import { useModuleRoute as se, useModule as ae, useFirebaseIntegration as de } from "@oneclick.dev/cms-kit";
|
|
@@ -23,9 +23,9 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
23
23
|
{ value: "checkbox", label: "Checkbox" },
|
|
24
24
|
{ value: "radio", label: "Radio Button" },
|
|
25
25
|
{ value: "select", label: "Select" }
|
|
26
|
-
], T = (
|
|
27
|
-
l.value =
|
|
28
|
-
},
|
|
26
|
+
], T = (o) => {
|
|
27
|
+
l.value = o ? "edit" : "add", g.value = [], n.id = o?.id || "", n.fieldName = o?.fieldName || "", n.fieldDescription = o?.fieldDescription || "", n.fieldType = o?.fieldType || "text", n.required = o?.required || !1, n.isNativeField = o?.isNativeField || !1, n.options = o?.options || [], n.visible = o?.visible !== void 0 ? o.visible : !0, c.value = !0;
|
|
28
|
+
}, L = () => {
|
|
29
29
|
c.value = !1, g.value = [];
|
|
30
30
|
}, q = () => {
|
|
31
31
|
$() && (I("add-field", { ...n }), c.value = !1);
|
|
@@ -36,19 +36,19 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
36
36
|
}, g = k([]), $ = () => (g.value = [], n.fieldName = n.fieldName.trim(), n.fieldName ? !0 : (g.value.push("Field name is required."), !1));
|
|
37
37
|
return D({
|
|
38
38
|
openDialog: T
|
|
39
|
-
}), (
|
|
39
|
+
}), (o, e) => {
|
|
40
40
|
const p = s("DialogTitle"), V = s("DialogHeader"), b = s("Label"), y = s("Input"), z = s("SelectValue"), G = s("SelectTrigger"), S = s("SelectItem"), j = s("SelectContent"), O = s("Select"), H = s("TagsInputItemText"), C = s("TagsInputItemDelete"), B = s("TagsInputItem"), W = s("TagsInputInput"), x = s("TagsInput"), r = s("Checkbox"), _ = s("Button"), J = s("DialogFooter"), Y = s("DialogScrollContent"), Z = s("Dialog");
|
|
41
41
|
return u(), v(Z, {
|
|
42
42
|
open: c.value,
|
|
43
43
|
"onUpdate:open": e[5] || (e[5] = (m) => c.value = m)
|
|
44
44
|
}, {
|
|
45
|
-
default:
|
|
45
|
+
default: i(() => [
|
|
46
46
|
t(Y, { class: "sm:max-w-2xl" }, {
|
|
47
|
-
default:
|
|
47
|
+
default: i(() => [
|
|
48
48
|
t(V, null, {
|
|
49
|
-
default:
|
|
49
|
+
default: i(() => [
|
|
50
50
|
t(p, null, {
|
|
51
|
-
default:
|
|
51
|
+
default: i(() => [...e[6] || (e[6] = [
|
|
52
52
|
d("Customer Information", -1)
|
|
53
53
|
])]),
|
|
54
54
|
_: 1
|
|
@@ -62,7 +62,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
62
62
|
class: "text-bsmase font-normal mb-1.5",
|
|
63
63
|
for: "customer-info-field-dialog-fieldname"
|
|
64
64
|
}, {
|
|
65
|
-
default:
|
|
65
|
+
default: i(() => [...e[7] || (e[7] = [
|
|
66
66
|
d("Field Name", -1)
|
|
67
67
|
])]),
|
|
68
68
|
_: 1
|
|
@@ -78,7 +78,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
78
78
|
class: "text-sm font-normal mb-1.5",
|
|
79
79
|
for: "customer-info-field-dialog-field-description"
|
|
80
80
|
}, {
|
|
81
|
-
default:
|
|
81
|
+
default: i(() => [...e[8] || (e[8] = [
|
|
82
82
|
d("Field Description", -1)
|
|
83
83
|
])]),
|
|
84
84
|
_: 1
|
|
@@ -91,7 +91,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
91
91
|
]),
|
|
92
92
|
n.isNativeField ? N("", !0) : (u(), f("div", ue, [
|
|
93
93
|
t(b, { class: "text-sm font-normal mb-1.5" }, {
|
|
94
|
-
default:
|
|
94
|
+
default: i(() => [...e[9] || (e[9] = [
|
|
95
95
|
d("Field Type", -1)
|
|
96
96
|
])]),
|
|
97
97
|
_: 1
|
|
@@ -100,20 +100,20 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
100
100
|
modelValue: n.fieldType,
|
|
101
101
|
"onUpdate:modelValue": e[2] || (e[2] = (m) => n.fieldType = m)
|
|
102
102
|
}, {
|
|
103
|
-
default:
|
|
103
|
+
default: i(() => [
|
|
104
104
|
t(G, null, {
|
|
105
|
-
default:
|
|
105
|
+
default: i(() => [
|
|
106
106
|
t(z, { placeholder: "Select field type" })
|
|
107
107
|
]),
|
|
108
108
|
_: 1
|
|
109
109
|
}),
|
|
110
110
|
t(j, null, {
|
|
111
|
-
default:
|
|
112
|
-
(u(), f(R, null,
|
|
111
|
+
default: i(() => [
|
|
112
|
+
(u(), f(R, null, U(M, (m) => t(S, {
|
|
113
113
|
key: m.value,
|
|
114
114
|
value: m.value
|
|
115
115
|
}, {
|
|
116
|
-
default:
|
|
116
|
+
default: i(() => [
|
|
117
117
|
d(w(m.label), 1)
|
|
118
118
|
]),
|
|
119
119
|
_: 2
|
|
@@ -130,7 +130,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
130
130
|
class: "text-sm font-normal mb-1.5",
|
|
131
131
|
for: "customer-info-field-dialog-field-new-option"
|
|
132
132
|
}, {
|
|
133
|
-
default:
|
|
133
|
+
default: i(() => [...e[10] || (e[10] = [
|
|
134
134
|
d("Options", -1)
|
|
135
135
|
])]),
|
|
136
136
|
_: 1
|
|
@@ -139,12 +139,12 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
139
139
|
modelValue: n.options,
|
|
140
140
|
"onUpdate:modelValue": e[3] || (e[3] = (m) => n.options = m)
|
|
141
141
|
}, {
|
|
142
|
-
default:
|
|
143
|
-
(u(!0), f(R, null,
|
|
142
|
+
default: i(() => [
|
|
143
|
+
(u(!0), f(R, null, U(n.options, (m) => (u(), v(B, {
|
|
144
144
|
key: m,
|
|
145
145
|
value: m
|
|
146
146
|
}, {
|
|
147
|
-
default:
|
|
147
|
+
default: i(() => [
|
|
148
148
|
t(H),
|
|
149
149
|
t(C)
|
|
150
150
|
]),
|
|
@@ -168,28 +168,28 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
168
168
|
for: "customer-info-field-dialog-field-required",
|
|
169
169
|
class: "text-base font-normal cursor-pointer"
|
|
170
170
|
}, {
|
|
171
|
-
default:
|
|
171
|
+
default: i(() => [...e[11] || (e[11] = [
|
|
172
172
|
d(" Is this field mandatory? ", -1)
|
|
173
173
|
])]),
|
|
174
174
|
_: 1
|
|
175
175
|
})
|
|
176
176
|
]),
|
|
177
177
|
g.value.length > 0 ? (u(), f("p", fe, [
|
|
178
|
-
(u(!0), f(R, null,
|
|
178
|
+
(u(!0), f(R, null, U(g.value, (m, h) => (u(), f("span", {
|
|
179
179
|
key: h,
|
|
180
180
|
class: "text-sm text-red-600 block"
|
|
181
181
|
}, w(m), 1))), 128))
|
|
182
182
|
])) : N("", !0)
|
|
183
183
|
]),
|
|
184
184
|
t(J, { class: "gap-2" }, {
|
|
185
|
-
default:
|
|
185
|
+
default: i(() => [
|
|
186
186
|
a("div", ce, [
|
|
187
187
|
l.value === "edit" && !n.isNativeField ? (u(), v(_, {
|
|
188
188
|
key: 0,
|
|
189
189
|
variant: "destructive",
|
|
190
190
|
onClick: P
|
|
191
191
|
}, {
|
|
192
|
-
default:
|
|
192
|
+
default: i(() => [...e[12] || (e[12] = [
|
|
193
193
|
d(" Remove Field ", -1)
|
|
194
194
|
])]),
|
|
195
195
|
_: 1
|
|
@@ -197,9 +197,9 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
197
197
|
a("div", ve, [
|
|
198
198
|
t(_, {
|
|
199
199
|
variant: "outline",
|
|
200
|
-
onClick:
|
|
200
|
+
onClick: L
|
|
201
201
|
}, {
|
|
202
|
-
default:
|
|
202
|
+
default: i(() => [...e[13] || (e[13] = [
|
|
203
203
|
d(" Cancel ", -1)
|
|
204
204
|
])]),
|
|
205
205
|
_: 1
|
|
@@ -208,7 +208,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
208
208
|
key: 0,
|
|
209
209
|
onClick: q
|
|
210
210
|
}, {
|
|
211
|
-
default:
|
|
211
|
+
default: i(() => [...e[14] || (e[14] = [
|
|
212
212
|
d(" Add Field ", -1)
|
|
213
213
|
])]),
|
|
214
214
|
_: 1
|
|
@@ -216,7 +216,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
216
216
|
key: 1,
|
|
217
217
|
onClick: E
|
|
218
218
|
}, {
|
|
219
|
-
default:
|
|
219
|
+
default: i(() => [...e[15] || (e[15] = [
|
|
220
220
|
d(" Update Field ", -1)
|
|
221
221
|
])]),
|
|
222
222
|
_: 1
|
|
@@ -285,12 +285,12 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
285
285
|
maxTicketsPerReservation: "",
|
|
286
286
|
customerInformationFields: [...c],
|
|
287
287
|
needsApproval: !1
|
|
288
|
-
}), n = k(!1), M = k(!0), T = k(null),
|
|
288
|
+
}), n = k(!1), M = k(!0), T = k(null), L = async () => {
|
|
289
289
|
n.value = !0;
|
|
290
290
|
try {
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
293
|
-
await I.update(F.agendaCollection,
|
|
291
|
+
const o = D.value.id;
|
|
292
|
+
if (!o) throw new Error("Missing agenda ID");
|
|
293
|
+
await I.update(F.agendaCollection, o, {
|
|
294
294
|
minimumAdvanceNotice: {
|
|
295
295
|
value: Number(l.minimumAdvanceNotice?.value) || 0,
|
|
296
296
|
unit: l.minimumAdvanceNotice?.unit ?? "minutes"
|
|
@@ -300,40 +300,40 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
300
300
|
customerInformationFields: l.customerInformationFields ?? [],
|
|
301
301
|
needsApproval: l.needsApproval || !1
|
|
302
302
|
});
|
|
303
|
-
} catch (
|
|
304
|
-
console.error("Error saving changes:",
|
|
303
|
+
} catch (o) {
|
|
304
|
+
console.error("Error saving changes:", o);
|
|
305
305
|
} finally {
|
|
306
306
|
n.value = !1;
|
|
307
307
|
}
|
|
308
|
-
}, q = async (
|
|
309
|
-
delete
|
|
308
|
+
}, q = async (o) => {
|
|
309
|
+
delete o.isNativeField, o.fieldType !== "radio" && o.fieldType !== "select" && delete o.options;
|
|
310
310
|
let e = Math.random().toString(36).substr(2, 9);
|
|
311
311
|
for (; l.customerInformationFields.find((p) => p.id === e); )
|
|
312
312
|
e = Math.random().toString(36).substr(2, 9);
|
|
313
|
-
l.customerInformationFields.push({ ...
|
|
314
|
-
}, E = async (
|
|
315
|
-
|
|
316
|
-
const e = l.customerInformationFields.findIndex((p) => p.id ===
|
|
317
|
-
e !== -1 && (l.customerInformationFields[e] = { ...
|
|
318
|
-
}, P = async (
|
|
319
|
-
l.customerInformationFields = l.customerInformationFields.filter((e) => e.id !==
|
|
313
|
+
l.customerInformationFields.push({ ...o, id: e });
|
|
314
|
+
}, E = async (o) => {
|
|
315
|
+
o.isNativeField || delete o.isNativeField, o.fieldType !== "radio" && o.fieldType !== "select" && delete o.options;
|
|
316
|
+
const e = l.customerInformationFields.findIndex((p) => p.id === o.id);
|
|
317
|
+
e !== -1 && (l.customerInformationFields[e] = { ...o });
|
|
318
|
+
}, P = async (o) => {
|
|
319
|
+
l.customerInformationFields = l.customerInformationFields.filter((e) => e.id !== o);
|
|
320
320
|
}, g = async () => {
|
|
321
321
|
try {
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
} catch (
|
|
325
|
-
console.error("Error loading agenda data:",
|
|
322
|
+
const o = await I.get(F.agendaCollection, D.value.id);
|
|
323
|
+
o && (l.minimumAdvanceNotice = o.minimumAdvanceNotice || { value: 0, unit: "minutes" }, l.serviceVisibility = o.serviceVisibility || 60, l.maxTicketsPerReservation = Number(o.maxTicketsPerReservation) && o.maxTicketsPerReservation > 0 ? parseInt(o.maxTicketsPerReservation) : "", l.customerInformationFields = o.customerInformationFields || [...c], l.needsApproval = o.needsApproval || !1);
|
|
324
|
+
} catch (o) {
|
|
325
|
+
console.error("Error loading agenda data:", o);
|
|
326
326
|
} finally {
|
|
327
327
|
M.value = !1;
|
|
328
328
|
}
|
|
329
329
|
}, $ = () => {
|
|
330
|
-
let
|
|
331
|
-
return
|
|
330
|
+
let o = Math.abs(l.minimumAdvanceNotice.value), e = l.minimumAdvanceNotice.unit;
|
|
331
|
+
return o === 1 ? (e.endsWith("s") && (e = e.slice(0, -1)), `Lead time is negative. Bookings remain open for 1 ${e} after the slot has started.`) : `Lead time is negative. Bookings remain open for ${o} ${e} after the slot has started.`;
|
|
332
332
|
};
|
|
333
|
-
return g(), (
|
|
333
|
+
return g(), (o, e) => {
|
|
334
334
|
const p = s("Label"), V = s("InputGroupInput"), b = s("Search"), y = s("InputGroupAddon"), z = s("SelectValue"), G = s("SelectTrigger"), S = s("SelectItem"), j = s("SelectGroup"), O = s("SelectContent"), H = s("Select"), C = s("InputGroup"), B = s("Badge"), W = s("Switch"), x = s("Button");
|
|
335
335
|
return u(), v(ee, null, {
|
|
336
|
-
default:
|
|
336
|
+
default: i(() => [
|
|
337
337
|
e[31] || (e[31] = a("h1", { class: "text-lg font-medium mb-8" }, "Availability Settings", -1)),
|
|
338
338
|
M.value ? N("", !0) : (u(), f("div", be, [
|
|
339
339
|
a("div", null, [
|
|
@@ -341,13 +341,13 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
341
341
|
for: "lead-time",
|
|
342
342
|
class: "text-base font-medium mb-2"
|
|
343
343
|
}, {
|
|
344
|
-
default:
|
|
344
|
+
default: i(() => [...e[7] || (e[7] = [
|
|
345
345
|
d(" Minimum Advance Notice - Lead Time (Optional) ", -1)
|
|
346
346
|
])]),
|
|
347
347
|
_: 1
|
|
348
348
|
}),
|
|
349
349
|
t(C, { class: "max-w-md" }, {
|
|
350
|
-
default:
|
|
350
|
+
default: i(() => [
|
|
351
351
|
t(V, {
|
|
352
352
|
placeholder: "0",
|
|
353
353
|
id: "lead-time",
|
|
@@ -358,42 +358,42 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
358
358
|
class: "no-spinner"
|
|
359
359
|
}, null, 8, ["modelValue"]),
|
|
360
360
|
t(y, null, {
|
|
361
|
-
default:
|
|
361
|
+
default: i(() => [
|
|
362
362
|
t(b)
|
|
363
363
|
]),
|
|
364
364
|
_: 1
|
|
365
365
|
}),
|
|
366
366
|
t(y, { align: "inline-end" }, {
|
|
367
|
-
default:
|
|
367
|
+
default: i(() => [
|
|
368
368
|
t(H, {
|
|
369
369
|
modelValue: l.minimumAdvanceNotice.unit,
|
|
370
370
|
"onUpdate:modelValue": e[1] || (e[1] = (r) => l.minimumAdvanceNotice.unit = r)
|
|
371
371
|
}, {
|
|
372
|
-
default:
|
|
372
|
+
default: i(() => [
|
|
373
373
|
t(G, { class: "w-[180px] border-0 bg-transparent -mr-1.5" }, {
|
|
374
|
-
default:
|
|
374
|
+
default: i(() => [
|
|
375
375
|
t(z)
|
|
376
376
|
]),
|
|
377
377
|
_: 1
|
|
378
378
|
}),
|
|
379
379
|
t(O, null, {
|
|
380
|
-
default:
|
|
380
|
+
default: i(() => [
|
|
381
381
|
t(j, null, {
|
|
382
|
-
default:
|
|
382
|
+
default: i(() => [
|
|
383
383
|
t(S, { value: "minutes" }, {
|
|
384
|
-
default:
|
|
384
|
+
default: i(() => [...e[8] || (e[8] = [
|
|
385
385
|
d(" Minutes ", -1)
|
|
386
386
|
])]),
|
|
387
387
|
_: 1
|
|
388
388
|
}),
|
|
389
389
|
t(S, { value: "hours" }, {
|
|
390
|
-
default:
|
|
390
|
+
default: i(() => [...e[9] || (e[9] = [
|
|
391
391
|
d(" Hours ", -1)
|
|
392
392
|
])]),
|
|
393
393
|
_: 1
|
|
394
394
|
}),
|
|
395
395
|
t(S, { value: "days" }, {
|
|
396
|
-
default:
|
|
396
|
+
default: i(() => [...e[10] || (e[10] = [
|
|
397
397
|
d(" Days ", -1)
|
|
398
398
|
])]),
|
|
399
399
|
_: 1
|
|
@@ -422,13 +422,13 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
422
422
|
for: "service-visibility",
|
|
423
423
|
class: "text-base font-medium mb-2"
|
|
424
424
|
}, {
|
|
425
|
-
default:
|
|
425
|
+
default: i(() => [...e[12] || (e[12] = [
|
|
426
426
|
d(" Service Visibility ", -1)
|
|
427
427
|
])]),
|
|
428
428
|
_: 1
|
|
429
429
|
}),
|
|
430
430
|
t(C, { class: "max-w-md" }, {
|
|
431
|
-
default:
|
|
431
|
+
default: i(() => [
|
|
432
432
|
t(V, {
|
|
433
433
|
id: "service-visibility",
|
|
434
434
|
modelValue: l.serviceVisibility,
|
|
@@ -441,7 +441,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
441
441
|
onBlur: e[3] || (e[3] = (r) => l.serviceVisibility = Math.max(l.serviceVisibility, 1))
|
|
442
442
|
}, null, 8, ["modelValue"]),
|
|
443
443
|
t(y, { align: "inline-end" }, {
|
|
444
|
-
default:
|
|
444
|
+
default: i(() => [...e[13] || (e[13] = [
|
|
445
445
|
d(" days ", -1)
|
|
446
446
|
])]),
|
|
447
447
|
_: 1
|
|
@@ -457,13 +457,13 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
457
457
|
for: "max-capacity",
|
|
458
458
|
class: "text-base font-medium mb-2"
|
|
459
459
|
}, {
|
|
460
|
-
default:
|
|
460
|
+
default: i(() => [...e[15] || (e[15] = [
|
|
461
461
|
d(" Maximum Tickets Per Booking ", -1)
|
|
462
462
|
])]),
|
|
463
463
|
_: 1
|
|
464
464
|
}),
|
|
465
465
|
t(C, { class: "max-w-md" }, {
|
|
466
|
-
default:
|
|
466
|
+
default: i(() => [
|
|
467
467
|
t(V, {
|
|
468
468
|
placeholder: "∞",
|
|
469
469
|
type: "number",
|
|
@@ -475,7 +475,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
475
475
|
modelModifiers: { number: !0 }
|
|
476
476
|
}, null, 8, ["modelValue"]),
|
|
477
477
|
t(y, { align: "inline-end" }, {
|
|
478
|
-
default:
|
|
478
|
+
default: i(() => [...e[16] || (e[16] = [
|
|
479
479
|
d(" spots ", -1)
|
|
480
480
|
])]),
|
|
481
481
|
_: 1
|
|
@@ -489,7 +489,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
489
489
|
a("div", xe, [
|
|
490
490
|
a("div", null, [
|
|
491
491
|
t(p, { class: "text-base font-medium" }, {
|
|
492
|
-
default:
|
|
492
|
+
default: i(() => [...e[18] || (e[18] = [
|
|
493
493
|
d("Booking Approval", -1)
|
|
494
494
|
])]),
|
|
495
495
|
_: 1
|
|
@@ -499,14 +499,14 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
499
499
|
a("div", _e, [
|
|
500
500
|
a("div", Ie, [
|
|
501
501
|
t(p, { class: "text-sm font-semibold" }, {
|
|
502
|
-
default:
|
|
502
|
+
default: i(() => [...e[20] || (e[20] = [
|
|
503
503
|
d("Enable Manual Approval", -1)
|
|
504
504
|
])]),
|
|
505
505
|
_: 1
|
|
506
506
|
}),
|
|
507
507
|
e[23] || (e[23] = a("p", { class: "text-xs text-muted-foreground max-w-[300px]" }, " When enabled, you must approve bookings within your dashboard before they are finalized. ", -1)),
|
|
508
508
|
l.needsApproval ? (u(), v(B, { key: 0 }, {
|
|
509
|
-
default:
|
|
509
|
+
default: i(() => [...e[21] || (e[21] = [
|
|
510
510
|
d("Status: Manual Review", -1)
|
|
511
511
|
])]),
|
|
512
512
|
_: 1
|
|
@@ -514,7 +514,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
514
514
|
key: 1,
|
|
515
515
|
variant: "secondary"
|
|
516
516
|
}, {
|
|
517
|
-
default:
|
|
517
|
+
default: i(() => [...e[22] || (e[22] = [
|
|
518
518
|
d("Status: Auto-Confirm", -1)
|
|
519
519
|
])]),
|
|
520
520
|
_: 1
|
|
@@ -529,14 +529,14 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
529
529
|
e[30] || (e[30] = a("hr", { class: "my-8" }, null, -1)),
|
|
530
530
|
a("div", null, [
|
|
531
531
|
t(p, { class: "text-base font-medium" }, {
|
|
532
|
-
default:
|
|
532
|
+
default: i(() => [...e[24] || (e[24] = [
|
|
533
533
|
d(" Customer Information (Optional) ", -1)
|
|
534
534
|
])]),
|
|
535
535
|
_: 1
|
|
536
536
|
}),
|
|
537
537
|
e[26] || (e[26] = a("p", { class: "text-sm text-muted-foreground mb-2" }, " Collect additional details about your customer. ", -1)),
|
|
538
538
|
a("div", Ne, [
|
|
539
|
-
(u(!0), f(R, null,
|
|
539
|
+
(u(!0), f(R, null, U(l.customerInformationFields, (r) => (u(), f("div", {
|
|
540
540
|
key: r.id,
|
|
541
541
|
class: "flex items-center justify-between hover:bg-input/50 px-2 rounded"
|
|
542
542
|
}, [
|
|
@@ -550,7 +550,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
550
550
|
onClick: (_) => T.value.openDialog(r),
|
|
551
551
|
class: "active:scale-90 transition-transform duration-150"
|
|
552
552
|
}, {
|
|
553
|
-
default:
|
|
553
|
+
default: i(() => [
|
|
554
554
|
t(A(te), { class: "size-4" })
|
|
555
555
|
]),
|
|
556
556
|
_: 1
|
|
@@ -561,7 +561,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
561
561
|
onClick: (_) => r.visible = !r.visible,
|
|
562
562
|
class: "active:scale-90 transition-transform duration-150"
|
|
563
563
|
}, {
|
|
564
|
-
default:
|
|
564
|
+
default: i(() => [
|
|
565
565
|
r.visible ? (u(), v(A(ie), {
|
|
566
566
|
key: 0,
|
|
567
567
|
class: "size-4"
|
|
@@ -579,7 +579,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
579
579
|
onClick: (_) => l.customerInformationFields = l.customerInformationFields.filter((J) => J.id !== r.id),
|
|
580
580
|
class: "active:scale-90 transition-transform duration-150"
|
|
581
581
|
}, {
|
|
582
|
-
default:
|
|
582
|
+
default: i(() => [
|
|
583
583
|
t(A(le), { class: "size-4" })
|
|
584
584
|
]),
|
|
585
585
|
_: 1
|
|
@@ -591,7 +591,7 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
591
591
|
class: "mt-4",
|
|
592
592
|
onClick: e[6] || (e[6] = (r) => T.value.openDialog())
|
|
593
593
|
}, {
|
|
594
|
-
default:
|
|
594
|
+
default: i(() => [
|
|
595
595
|
t(A(ne), { class: "size-4" }),
|
|
596
596
|
e[25] || (e[25] = d(" Add New Field ", -1))
|
|
597
597
|
]),
|
|
@@ -608,10 +608,10 @@ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = {
|
|
|
608
608
|
]),
|
|
609
609
|
a("div", Fe, [
|
|
610
610
|
t(x, {
|
|
611
|
-
onClick:
|
|
611
|
+
onClick: L,
|
|
612
612
|
disabled: n.value
|
|
613
613
|
}, {
|
|
614
|
-
default:
|
|
614
|
+
default: i(() => [
|
|
615
615
|
d(w(n.value ? "Saving..." : "Save Changes"), 1)
|
|
616
616
|
]),
|
|
617
617
|
_: 1
|