@oneclick.dev/cms-core-modules 0.0.122 → 0.0.123
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-CoJjsV-m.js → ContentEditor-C-Wm48ai.js} +63 -59
- package/dist/{ContentEditor-DIwqplfB.mjs → ContentEditor-MDGolnIP.mjs} +27596 -26138
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-8I_Z9cD_.mjs} +530 -530
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BVE_uURZ.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs +3566 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js +925 -0
- package/dist/TableCalculationWidget-CkQPrVUd.js +59 -0
- package/dist/TableCalculationWidget-CrqcLGfU.mjs +254 -0
- package/dist/TableDataWidget-7qvC3Egd.js +1 -0
- package/dist/TableDataWidget-DMTSoGRO.mjs +121 -0
- package/dist/TableOverviewCard-AFq-puJs.js +1 -0
- package/dist/TableOverviewCard-Ci0d4o4w.mjs +391 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +534 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +1 -0
- package/dist/TableRowActionCard-BhdnnPaq.mjs +266 -0
- package/dist/TableRowActionCard-IzB6tNN-.js +1 -0
- package/dist/TableView-BkwoKREo.js +4 -0
- package/dist/TableView-C4Zyp8d7.mjs +8228 -0
- package/dist/{agenda-BCKDYOeF.mjs → agenda-DWdbWUbb.mjs} +10 -9
- package/dist/agenda-r9Gl85GL.js +1 -0
- package/dist/dateRangePresets-B-l5b_wR.mjs +48 -0
- package/dist/dateRangePresets-CPWqst_x.js +1 -0
- package/dist/fuse-Deb-Iq39.mjs +1473 -0
- package/dist/fuse-_CGUd5Zq.js +1 -0
- package/dist/{index-DU3Ib10Z.mjs → index-B_qaX29C.mjs} +7 -6
- package/dist/{index-Bk3yLv_G.js → index-yHLT6gaZ.js} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +419 -109
- package/dist/{orders-CElKNc1v.mjs → orders-BfTLIm7U.mjs} +10 -9
- package/dist/orders-DUa2PVoa.js +1 -0
- package/dist/reports-ChCsd1Gk.mjs +1107 -0
- package/dist/reports-DmJPm8uP.js +158 -0
- package/dist/row-item-C1dUyimV.mjs +204 -0
- package/dist/row-item-Cyo3m3MZ.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +4 -2
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +9 -3
- package/dist/src/appointments/pages/edit/reports.vue.d.ts +229 -1
- package/dist/src/table/chat-components/TableCalculationWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableDataWidget.vue.d.ts +15 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +61 -0
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +48 -0
- package/dist/src/table/chat-components/TableRowActionCard.vue.d.ts +15 -0
- package/dist/src/table/components/filters/DialogTableFilterOptionItem.vue.d.ts +16 -0
- package/dist/src/table/components/filters/NumberComparisonFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberComparisonFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilter.vue.d.ts +12 -0
- package/dist/src/table/components/filters/NumberRangeFilterSettings.vue.d.ts +12 -0
- package/dist/src/table/components/filters/filter-utils.d.ts +14 -0
- package/dist/src/table/composables/useTableAgentTools.d.ts +33 -0
- package/dist/src/table/index.d.ts +339 -0
- package/dist/src/table/tool-sandbox.d.ts +13 -0
- package/dist/src/table/tool-utils.d.ts +11 -0
- package/dist/src/table/tools.d.ts +333 -1
- package/dist/src/table/types.d.ts +79 -0
- package/dist/tool-sandbox-DdkMLkDK.mjs +182 -0
- package/dist/tool-sandbox-DoF1PsyS.js +115 -0
- package/dist/useTableAgentTools-D5mzGf3A.js +1 -0
- package/dist/useTableAgentTools-DcN3kYRL.mjs +131 -0
- package/package.json +17 -17
- package/src/table/tools.ts +304 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +0 -1
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +0 -925
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +0 -5021
- package/dist/TableView-Ctnep-Qu.mjs +0 -6247
- package/dist/TableView-DJqyJL9L.js +0 -4
- package/dist/agenda-B54F8cEr.js +0 -1
- package/dist/orders-BMosTk6r.js +0 -1
- package/dist/reports-BQT_GZzU.js +0 -158
- package/dist/reports-DksZCTOw.mjs +0 -837
|
@@ -3,9 +3,10 @@ import { a as ce, b as me } from "./DateFormatter-BkKoSf_l.mjs";
|
|
|
3
3
|
import { X as De, Search as Ee, Clock as he, Users as xe, ChevronLeft as ge, ChevronRight as fe, Asterisk as Be, CalendarDays as Pe } from "lucide-vue-next";
|
|
4
4
|
import { _ as je } from "./EditLayout.vue_vue_type_script_setup_true_lang-4_t0PPqM.mjs";
|
|
5
5
|
import { useModuleRoute as ye, useModule as be, useFirebaseIntegration as _e, useModulePermissions as Oe } from "@oneclick.dev/cms-kit";
|
|
6
|
-
import {
|
|
6
|
+
import { F as Re } from "./fuse-Deb-Iq39.mjs";
|
|
7
|
+
import { u as Le, _ as Ue, a as Ne, b as Fe } from "./OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs";
|
|
7
8
|
import { _ as Ve } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
|
-
import { _ as He } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as He } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-8I_Z9cD_.mjs";
|
|
9
10
|
import { a as Qe } from "./index-hMp4p5qA.mjs";
|
|
10
11
|
const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible" }, Xe = ["onClick"], Ye = { 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" }, Je = { class: "font-medium" }, Ke = { class: "text-muted-foreground" }, Ge = { class: "w-full flex-1 flex items-end justify-center" }, Ze = {
|
|
11
12
|
key: 1,
|
|
@@ -124,7 +125,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
124
125
|
},
|
|
125
126
|
emits: ["update:searchQuery", "refresh"],
|
|
126
127
|
setup(f, { emit: T }) {
|
|
127
|
-
const _ = f, { params: A } = ye(), L = R(() => A.value?.id ?? A.id ?? _.agendaData?.id ?? ""), { metadataSchema: o } =
|
|
128
|
+
const _ = f, { params: A } = ye(), L = R(() => A.value?.id ?? A.id ?? _.agendaData?.id ?? ""), { metadataSchema: o } = Le(L), c = R(() => {
|
|
128
129
|
const v = Array.isArray(_.resources) ? _.resources : [], p = Array.isArray(_.agendaData?.resources) ? _.agendaData.resources : [], E = [...v, ...p], l = /* @__PURE__ */ new Set();
|
|
129
130
|
return E.filter((t) => {
|
|
130
131
|
const n = t?.id;
|
|
@@ -258,7 +259,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
258
259
|
e("span", null, g(t.spots), 1)
|
|
259
260
|
])
|
|
260
261
|
]),
|
|
261
|
-
u(
|
|
262
|
+
u(Ue, {
|
|
262
263
|
metadata: { ...t.metadata, ...t.reservationMetadata },
|
|
263
264
|
schema: w(o),
|
|
264
265
|
"display-filter": ["highlight", "badge"],
|
|
@@ -273,7 +274,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
273
274
|
])
|
|
274
275
|
], 8, ct))), 128))
|
|
275
276
|
])),
|
|
276
|
-
u(
|
|
277
|
+
u(Ne, {
|
|
277
278
|
ref_key: "reservationDetailDialog",
|
|
278
279
|
ref: x,
|
|
279
280
|
"agenda-data": f.agendaData,
|
|
@@ -285,7 +286,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
285
286
|
onTransferred: V,
|
|
286
287
|
onOpenOrder: p[0] || (p[0] = (t) => H(t))
|
|
287
288
|
}, null, 8, ["agenda-data", "resources"]),
|
|
288
|
-
u(
|
|
289
|
+
u(Fe, {
|
|
289
290
|
ref_key: "orderDetailDialog",
|
|
290
291
|
ref: N,
|
|
291
292
|
"agenda-data": f.agendaData,
|
|
@@ -333,7 +334,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
333
334
|
}), l;
|
|
334
335
|
}), j = R(() => Math.max(1, ...Object.values(V.value).map((l) => l.spots))), O = R(() => {
|
|
335
336
|
let l = a.value;
|
|
336
|
-
return x.value && (l = V.value[x.value]?.orders || []), N.value.trim() && (l = new
|
|
337
|
+
return x.value && (l = V.value[x.value]?.orders || []), N.value.trim() && (l = new Re(l, {
|
|
337
338
|
keys: [
|
|
338
339
|
"customerInfo.firstName",
|
|
339
340
|
"customerInfo.lastName",
|
|
@@ -938,7 +939,7 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
938
939
|
}, Ss = {
|
|
939
940
|
key: 0,
|
|
940
941
|
class: "mt-1 space-y-1"
|
|
941
|
-
}, $s = { class: "min-w-0 flex-1" }, Ts = { class: "text-sm font-medium truncate text-muted-foreground" },
|
|
942
|
+
}, $s = { class: "min-w-0 flex-1" }, Ts = { class: "text-sm font-medium truncate text-muted-foreground" }, Os = /* @__PURE__ */ ae({
|
|
942
943
|
__name: "agenda",
|
|
943
944
|
setup(f) {
|
|
944
945
|
const { hasPermission: T } = Oe(), { params: _ } = ye(), { config: A } = be(), L = _e(A.project), o = D(ce(me())), c = D(1), m = ze("container"), { width: a } = Qe(m), k = R(() => a.value < 640);
|
|
@@ -1254,5 +1255,5 @@ const We = { class: "mb-6" }, qe = { class: "flex items-end gap-px h-24 bg-muted
|
|
|
1254
1255
|
}
|
|
1255
1256
|
});
|
|
1256
1257
|
export {
|
|
1257
|
-
|
|
1258
|
+
Os as default
|
|
1258
1259
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("./DateFormatter-CSAbE3BC.js"),z=require("lucide-vue-next"),oe=require("./EditLayout.vue_vue_type_script_setup_true_lang-D1b9_iiN.js"),F=require("@oneclick.dev/cms-kit"),ne=require("./fuse-_CGUd5Zq.js"),X=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.js"),se=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-BVE_uURZ.js"),re=require("./index-CxETuRsG.js"),le={class:"mb-6"},ie={class:"flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible"},ce=["onClick"],de={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"},ue={class:"font-medium"},me={class:"text-muted-foreground"},pe={class:"w-full flex-1 flex items-end justify-center"},fe={key:1,class:"text-[10px] mt-1"},ve={key:0,class:"mt-2 text-sm text-muted-foreground flex items-center gap-2"},ge={class:"font-medium text-foreground"},he={class:"font-medium text-foreground"},xe=e.defineComponent({__name:"TimelineChart",props:{timeSlots:{},slotStats:{},selectedTimeSlot:{},maxSpots:{}},emits:["select","clear"],setup(d,{emit:b}){const h=b,w=o=>{h("select",o)},B=()=>{h("clear")};return(o,i)=>{const c=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",le,[i[2]||(i[2]=e.createElementVNode("h3",{class:"font-semibold text-sm mb-2"},"Timeline",-1)),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.timeSlots,n=>(e.openBlock(),e.createElementBlock("div",{key:n.startTime,class:"flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",onClick:x=>w(n.startTime)},[e.createElementVNode("div",de,[e.createElementVNode("div",ue,e.toDisplayString(n.startTime),1),e.createElementVNode("div",me,e.toDisplayString(d.slotStats[n.startTime]?.spots||0)+" spots",1)]),e.createElementVNode("div",pe,[e.createElementVNode("div",{class:e.normalizeClass(["w-full transition-all duration-200",[d.selectedTimeSlot===n.startTime?"bg-primary":d.slotStats[n.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:d.slotStats[n.startTime]?.spots>0?`${d.slotStats[n.startTime].spots/d.maxSpots*100}%`:"2px",minHeight:d.slotStats[n.startTime]?.spots>0?"4px":"2px"})},null,6)]),n.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":d.selectedTimeSlot===n.startTime}])},e.toDisplayString(n.label),3)):(e.openBlock(),e.createElementBlock("span",fe," "))],8,ce))),128))]),d.selectedTimeSlot?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(c,{variant:"ghost",size:"icon",class:"h-6 w-6 p-0",onClick:B},{default:e.withCtx(()=>[e.createVNode(e.unref(z.X),{size:14})]),_:1}),e.createElementVNode("span",null,[i[0]||(i[0]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",ge,e.toDisplayString(d.slotStats[d.selectedTimeSlot]?.bookings||0),1),i[1]||(i[1]=e.createTextVNode(" bookings at ",-1)),e.createElementVNode("span",he,e.toDisplayString(d.selectedTimeSlot),1)])])):e.createCommentVNode("",!0)])}}}),ye={class:"flex items-center justify-between mb-3"},ke={class:"font-semibold"},be={key:0,class:"text-muted-foreground font-normal"},_e={class:"relative mb-3"},Ne={key:0,class:"flex items-center justify-center py-8"},we={key:1,class:"text-center py-8 text-muted-foreground"},Ee={key:2,class:"space-y-2 max-h-80 overflow-y-auto"},Se=["onClick"],Ve={class:"flex items-start justify-between"},Ce={class:"flex-1"},De={class:"font-medium"},Be={class:"text-sm text-muted-foreground"},$e={class:"text-sm text-muted-foreground"},Te={class:"flex items-center gap-4"},ze={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Ie={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Me={class:"text-right"},Ae={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"},Le={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"},je={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"},Re={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"},Pe={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"},Oe={key:5,class:"text-sm font-medium mt-1"},Fe=e.defineComponent({__name:"BookingsList",props:{agendaData:{},resources:{},orders:{},filteredOrders:{},isLoading:{type:Boolean},selectedTimeSlot:{},searchQuery:{}},emits:["update:searchQuery","refresh"],setup(d,{emit:b}){const h=d,{params:w}=F.useModuleRoute(),B=e.computed(()=>w.value?.id??w.id??h.agendaData?.id??""),{metadataSchema:o}=X.useAgendaMetadataSchema(B),i=e.computed(()=>{const m=Array.isArray(h.resources)?h.resources:[],u=Array.isArray(h.agendaData?.resources)?h.agendaData.resources:[],S=[...m,...u],r=new Set;return S.filter(t=>{const a=t?.id;return!a||r.has(String(a))?!1:(r.add(String(a)),!0)})}),c=b,{config:n}=F.useModule(),x=F.useFirebaseIntegration(n.project),f=e.ref(null),T=e.ref(null),V=m=>{c("update:searchQuery",m)},_=()=>{c("update:searchQuery","")},I=()=>{c("refresh")},C=(m,u)=>{const S=m.id||m.orderId||u.orderId||"",r=i.value.find(t=>String(t.id)===String(u.resourceId));return{customerInfo:m.customerInfo,amountDue:m.amountDue,amountPaid:m.amountPaid,status:m.status,reservationStatus:u.status,subtotal:m.subtotal,total:m.total,discount:m.discount,id:S,res_id:u.id,resourceId:u.resourceId,spots:u.spots,date:u.date,createdAt:m.createdAt,startTime:u.timeslot?.startTime,endTime:u.timeslot?.endTime,reservationPrice:u.totalPrice,reservationBasePrice:u.basePrice,reservationAddOnsPrice:u.addOnsPrice,orderReservationCount:Array.isArray(m.reservations)?m.reservations.length:void 0,adjustments:m.adjustments||[],reservationAdjustments:u.adjustments||[],pricingOptionId:u.pricingOptionId,pricingOption:u.pricingOption,resourceName:r?.name,resourceColor:r?.color,metadata:m.metadata||{},reservationMetadata:u.metadata||{},refundStatus:u.refundStatus,refundedAt:u.refundedAt,refundedAmount:u.refundedAmount,refunds:Array.isArray(u.refunds)?u.refunds:[]}},D=async()=>{await e.nextTick(),await new Promise(m=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>m());return}m()})},M=async m=>{if(!m)return;const u=await x.get(n.reservationsCollection,m);if(!u)return;const S={...u,id:u.id||m},r=(S.reservations||[]).map(t=>C(S,t));r.length&&(await D(),T.value?.openDialog({id:S.id,customerInfo:S.customerInfo,status:S.status,createdAt:S.createdAt,metadata:S.metadata||{},reservations:r,adjustments:S.adjustments||[],totalPrice:typeof S.total=="number"?S.total:r.reduce((t,a)=>t+(a.reservationPrice||0),0),totalSpots:r.reduce((t,a)=>t+(a.spots||0),0)}))},q=async m=>{await D(),f.value?.openDialog(m)},R=m=>m.orderReservationCount===1&&typeof m.total=="number"?m.total:typeof m.reservationPrice=="number"?m.reservationPrice:null,U=m=>{const u=R(m);return u===null?null:`€${u.toFixed(2)}`};return(m,u)=>{const S=e.resolveComponent("Input"),r=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ye,[e.createElementVNode("h3",ke,[u[2]||(u[2]=e.createTextVNode(" Bookings ",-1)),d.selectedTimeSlot||d.searchQuery?(e.openBlock(),e.createElementBlock("span",be," ("+e.toDisplayString(d.filteredOrders.length)+" of "+e.toDisplayString(d.orders.length)+") ",1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",_e,[e.createVNode(e.unref(z.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(S,{"model-value":d.searchQuery,placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9","onUpdate:modelValue":V},null,8,["model-value"]),d.searchQuery?(e.openBlock(),e.createBlock(r,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:_},{default:e.withCtx(()=>[e.createVNode(e.unref(z.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),d.isLoading?(e.openBlock(),e.createElementBlock("div",Ne,[...u[3]||(u[3]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):d.filteredOrders.length===0?(e.openBlock(),e.createElementBlock("div",we,e.toDisplayString(d.selectedTimeSlot?"No bookings for this time slot":"No bookings for this event"),1)):(e.openBlock(),e.createElementBlock("div",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.filteredOrders,t=>(e.openBlock(),e.createElementBlock("div",{key:t.res_id||t.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors",onClick:a=>f.value?.openDialog(t)},[e.createElementVNode("div",Ve,[e.createElementVNode("div",Ce,[e.createElementVNode("div",De,e.toDisplayString(t.customerInfo.firstName+" "+t.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Be,e.toDisplayString(t.customerInfo.email),1),e.createElementVNode("div",$e,e.toDisplayString(t.customerInfo.phone),1),e.createElementVNode("div",Te,[e.createElementVNode("div",ze,[e.createVNode(e.unref(z.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(t.startTime)+" - "+e.toDisplayString(t.endTime),1)]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(z.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(t.spots),1)])]),e.createVNode(X._sfc_main,{metadata:{...t.metadata,...t.reservationMetadata},schema:e.unref(o),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Me,[t.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Ae,"Needs Approval")):t.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",Le,"Approved")):t.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",je,"Rejected")):t.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",Re,"Cancelled")):(e.openBlock(),e.createElementBlock("span",Pe,"Pending")),U(t)?(e.openBlock(),e.createElementBlock("div",Oe,e.toDisplayString(U(t)),1)):e.createCommentVNode("",!0)])])],8,Se))),128))])),e.createVNode(X._sfc_main$1,{ref_key:"reservationDetailDialog",ref:f,"agenda-data":d.agendaData,resources:d.resources,"show-order-link":"",onCancelled:I,onConfirmed:I,onRejected:I,onTransferred:I,onOpenOrder:u[0]||(u[0]=t=>M(t))},null,8,["agenda-data","resources"]),e.createVNode(X._sfc_main$2,{ref_key:"orderDetailDialog",ref:T,"agenda-data":d.agendaData,resources:d.resources,onOpenReservation:u[1]||(u[1]=t=>q(t))},null,8,["agenda-data","resources"])])}}}),Ue={class:"flex items-center gap-4 mt-2 text-sm"},qe={class:"flex items-center gap-1"},He={key:0,class:"flex items-center gap-1"},Qe={class:"flex items-center gap-1"},We={class:"py-4"},Xe=e.defineComponent({__name:"EventDialog",props:{agendaData:{},resources:{default:()=>[]}},setup(d,{expose:b}){const h=d,{config:w}=F.useModule(),{params:B}=F.useModuleRoute(),o=F.useFirebaseIntegration(w.project),i=e.ref(!1),c=e.ref(null),n=e.ref([]),x=e.ref(!1),f=e.ref(null),T=e.ref("");e.provide("event",c);const V=e.computed(()=>{if(!c.value)return[];const r=c.value.resource?.interval||60,t=[],[a,N]=c.value.startTime.split(":").map(Number),[j,L]=c.value.endTime.split(":").map(Number),y=a*60+N,k=j*60+L;for(let v=y;v<k;v+=r){const l=Math.floor(v/60),p=v%60,E=Math.min(v+r,k),g=Math.floor(E/60),$=E%60,A=`${l.toString().padStart(2,"0")}:${p.toString().padStart(2,"0")}`,s=`${g.toString().padStart(2,"0")}:${$.toString().padStart(2,"0")}`;t.push({startTime:A,endTime:s,label:A})}return t}),_=r=>{const t=r.getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),N=String(r.getDate()).padStart(2,"0");return`${t}-${a}-${N}`},I=e.computed(()=>{const r={};return V.value.forEach(t=>{r[t.startTime]={bookings:0,spots:0,orders:[]}}),n.value.forEach(t=>{V.value.forEach(a=>{t.startTime<a.endTime&&t.endTime>a.startTime&&(r[a.startTime].bookings++,r[a.startTime].spots+=t.spots||0,r[a.startTime].orders.push(t))})}),r}),C=e.computed(()=>Math.max(1,...Object.values(I.value).map(r=>r.spots))),D=e.computed(()=>{let r=n.value;return f.value&&(r=I.value[f.value]?.orders||[]),T.value.trim()&&(r=new ne.Fuse(r,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone"],threshold:.3,ignoreLocation:!0}).search(T.value).map(a=>a.item)),r}),M=e.computed(()=>({spots:n.value.reduce((r,t)=>r+(t.spots||0),0),bookings:n.value.length})),q=r=>{f.value===r?f.value=null:f.value=r},R=()=>{f.value=null},U=async r=>{i.value=!0,c.value=r,f.value=null,T.value="",await m()},m=async()=>{if(c.value){x.value=!0,n.value=[];try{const r=B.value.id,t=_(new Date(c.value.date)),a=c.value.resourceId||c.value.resource?.id,N=new Set;if(a?N.add(`${a}_${t}`):h.resources?.forEach(y=>{N.add(`${y.id}_${t}`)}),N.size===0){n.value=[];return}const j=await o.find(w.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:r},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(N)}]});let L=[];j.forEach(y=>{(y.reservations?.filter(v=>v.date!==t?!1:a?v.resourceId===a:!0)||[]).forEach(v=>{const l=h.resources.find(E=>E.id===v.resourceId),p=y.id||y.orderId||v.orderId||"";(v.status==="approved"||v.status==="needs_approval")&&L.push({customerInfo:y.customerInfo,amountDue:y.amountDue,amountPaid:y.amountPaid,status:y.status,reservationStatus:v.status,subtotal:y.subtotal,total:y.total,discount:y.discount,id:p,res_id:v.id,resourceId:v.resourceId,spots:v.spots,date:t,createdAt:y.createdAt,startTime:v.timeslot?.startTime,endTime:v.timeslot?.endTime,reservationPrice:v.totalPrice,reservationBasePrice:v.basePrice,reservationAddOnsPrice:v.addOnsPrice,orderReservationCount:Array.isArray(y.reservations)?y.reservations.length:void 0,adjustments:y.adjustments||[],reservationAdjustments:v.adjustments||[],pricingOptionId:v.pricingOptionId,pricingOption:v.pricingOption,resourceName:l?.name,resourceColor:l?.color,metadata:y.metadata||{},reservationMetadata:v.metadata||{},refundStatus:v.refundStatus,refundedAt:v.refundedAt,refundedAmount:v.refundedAmount,refunds:Array.isArray(v.refunds)?v.refunds:[]})})}),n.value=L.sort((y,k)=>y.startTime?.localeCompare(k.startTime||"")||0)}catch(r){console.error("Error loading orders:",r),n.value=[]}finally{x.value=!1}}},u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"];return b({openDialog:U}),(r,t)=>{const a=e.resolveComponent("DialogTitle"),N=e.resolveComponent("DialogDescription"),j=e.resolveComponent("DialogHeader"),L=e.resolveComponent("Button"),y=e.resolveComponent("DialogFooter"),k=e.resolveComponent("DialogScrollContent"),v=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(v,{open:i.value,"onUpdate:open":t[2]||(t[2]=l=>i.value=l)},{default:e.withCtx(()=>[e.createVNode(k,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(j,null,{default:e.withCtx(()=>[c.value?.date?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u[new Date(c.value.date).getUTCDay()])+" "+e.toDisplayString(S[new Date(c.value.date).getUTCMonth()])+" "+e.toDisplayString(new Date(c.value.date).getUTCDate())+", "+e.toDisplayString(new Date(c.value.date).getUTCFullYear()),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(N,null,{default:e.withCtx(()=>[e.createElementVNode("div",Ue,[e.createElementVNode("div",qe,[e.createVNode(e.unref(z.Clock),{size:14}),e.createElementVNode("span",null,e.toDisplayString(c.value?.startTime)+" – "+e.toDisplayString(c.value?.endTime),1)]),c.value?.resource?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",{class:"w-4 h-4 rounded-full",style:e.normalizeStyle({backgroundColor:c.value.resource.color||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(c.value.resource.name),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Qe,[e.createVNode(e.unref(z.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(M.value.spots)+" spots in "+e.toDisplayString(M.value.bookings)+" reservations",1)])])]),_:1})]),_:1}),e.createElementVNode("div",We,[V.value.length>1?(e.openBlock(),e.createBlock(xe,{key:0,"time-slots":V.value,"slot-stats":I.value,"selected-time-slot":f.value,"max-spots":C.value,onSelect:q,onClear:R,tabindex:"0"},null,8,["time-slots","slot-stats","selected-time-slot","max-spots"])):e.createCommentVNode("",!0),e.createVNode(Fe,{"agenda-data":d.agendaData,resources:d.resources,orders:n.value,"filtered-orders":D.value,"is-loading":x.value,"selected-time-slot":f.value,"search-query":T.value,"onUpdate:searchQuery":t[0]||(t[0]=l=>T.value=l),onRefresh:m},null,8,["agenda-data","resources","orders","filtered-orders","is-loading","selected-time-slot","search-query"])]),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(L,{variant:"outline",onClick:t[1]||(t[1]=l=>i.value=!1)},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),Ye={class:"flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]"},Je={class:"relative h-full min-h-[1536px]"},Ke={class:"divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80"},Ge={class:"absolute inset-0 pointer-events-none"},Ze={class:"relative mr-1 @md:mr-3 h-full ml-0.5 @md:ml-2"},et=["onClick"],tt={key:0,class:"absolute bottom-0 left-0 right-0 h-1 bg-black/20"},ot={class:"flex items-start justify-between gap-2 mb-1"},nt={class:"font-semibold text-xs @md:text-sm leading-tight line-clamp-1 flex-1"},at={class:"flex items-center gap-1 shrink-0"},st=["title"],rt={class:"font-medium"},J=e.defineComponent({__name:"EventTimeline",props:{agendaData:{},date:{},events:{},firstDay:{type:Boolean,default:!1},resources:{default:()=>[]}},setup(d){const b=d,h=e.ref(null),w=i=>{const[c,n]=i.split(":").map(Number);return c*60+n};e.computed(()=>!b.events||!b.resources?[]:b.resources.map(i=>{const n=b.events.filter(x=>x.resourceId===i.id).map(x=>{const f=w(x.startTime),V=w(x.endTime)-f,_=f/1440*100,I=V/1440*100,C=(x.bookings??0)>0,D=x.maxBookings?(x.bookings??0)/x.maxBookings*100:0;return{...x,top:`${_}%`,height:`${I}%`,color:x.resource?.color||"#3b82f6",hasBookings:C,fillPercentage:D,isSmall:V<60}});return{resource:i,events:n}}));const B=e.computed(()=>b.events?b.events.map(i=>{const c=w(i.startTime),x=w(i.endTime)-c,f=c/1440*100,T=x/1440*100,V=(i.bookings??0)>0,_=i.maxBookings?(i.bookings??0)/i.maxBookings*100:0;return{...i,top:`${f}%`,height:`${T}%`,color:i.resource?.color||"#3b82f6",hasBookings:V,fillPercentage:_,isSmall:x<60}}):[]),o=Array.from({length:24},(i,c)=>({hour:c,label:`${c.toString().padStart(2,"0")}:00`}));return(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Je,[e.createElementVNode("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),n=>(e.openBlock(),e.createElementBlock("div",{key:n.hour,class:"flex-1 flex transition-all duration-200"},[...c[0]||(c[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",Ge,[e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,style:e.normalizeStyle({top:n.top,height:n.height,opacity:n.hasBookings?"1":"0.5"}),class:"event-card absolute left-0.5 right-0.5 @md:left-2 @md:right-2 rounded-lg pointer-events-auto cursor-pointer group/event transition-all duration-200 hover:shadow-xl overflow-hidden",onClick:x=>h.value?.openDialog(n)},[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:n.color}),class:"absolute inset-0 shadow-lg"},[n.maxBookings?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",{class:"h-full bg-white/40 transition-all duration-300",style:e.normalizeStyle({width:`${n.fillPercentage}%`})},null,4)])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:e.normalizeClass(["relative h-full p-1.5 @md:p-3 flex flex-col",`${n.hasBookings?"text-white":"text-gray-600 dark:text-gray-100"}`])},[e.createElementVNode("div",ot,[e.createElementVNode("h3",nt,e.toDisplayString(n.title),1),e.createElementVNode("div",at,[n.resource?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-5 h-5 @md:w-6 @md:h-6 rounded-full flex items-center justify-center text-[10px] @md:text-xs font-bold bg-white/30 backdrop-blur-sm text-white border border-white/40",title:n.resource.name},e.toDisplayString(n.resource.avatarLabel||n.resource.name.charAt(0).toUpperCase()),9,st)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-0.5 @md:gap-1 px-1.5 @md:px-2 py-0.5 rounded-full text-[10px] @md:text-xs font-medium",n.hasBookings?"bg-white text-black backdrop-blur-sm":"bg-black/10 backdrop-blur-sm"])},[e.createVNode(e.unref(z.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(n.bookings),1)],2)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 @md:gap-2 text-[10px] @md:text-xs opacity-90 mt-auto",{"-translate-x-1 -translate-y-2 scale-80 origin-[0_0]":n.isSmall}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-1 @md:px-2 py-0.5 rounded backdrop-blur-sm",{"bg-black/10":!n.isSmall}])},[e.createVNode(e.unref(z.Clock),{size:10}),e.createElementVNode("span",rt,e.toDisplayString(n.startTime)+" – "+e.toDisplayString(n.endTime),1)],2)],2)],2),c[1]||(c[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,et))),128))])])])]),e.createVNode(Xe,{"agenda-data":d.agendaData,resources:d.resources,ref_key:"eventDialog",ref:h},null,8,["agenda-data","resources"])],64))}}),lt={class:"sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input"},it={class:"flex-shrink-0 text-[10px] @md:text-xs font-medium text-muted-foreground px-1.5 @md:px-3 pb-3 border-r border-border/50 w-10 @md:w-14"},ct={class:"flex items-center gap-1.5"},K=e.defineComponent({__name:"Event24hSidebar",setup(d){const b=Array.from({length:24},(h,w)=>({hour:w,label:`${w.toString().padStart(2,"0")}:00`}));return(h,w)=>(e.openBlock(),e.createElementBlock("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),B=>(e.openBlock(),e.createElementBlock("div",{key:B.hour,class:"flex-1 flex transition-all duration-200"},[e.createElementVNode("div",it,[e.createElementVNode("div",ct,[e.createElementVNode("span",{class:e.normalizeClass({"-translate-y-1/2":B.hour!==0})},e.toDisplayString(B.label),3)])])]))),128))]))}}),dt={class:"absolute top-0 w-full pointer-events-none"},ut={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"},G=e.defineComponent({__name:"EventTimeIndicator",props:{currentDate:{type:Object,required:!1}},setup(d){const b=e.ref(Date.now());let h;e.onMounted(()=>{h=window.setInterval(()=>{b.value=Date.now()},1e3)}),e.onUnmounted(()=>{h&&clearInterval(h)});const w=e.computed(()=>{const o=new Date(b.value);return`${(o.getHours()*60+o.getMinutes()+o.getSeconds()/60)/1440*100}%`}),B=e.computed(()=>new Date(b.value).getFullYear()+"-"+(new Date(b.value).getMonth()+1).toString().padStart(2,"0")+"-"+new Date(b.value).getDate().toString().padStart(2,"0"));return(o,i)=>(e.openBlock(),e.createElementBlock("div",dt,[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:w.value})},[i[0]||(i[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)),d.currentDate&&d.currentDate==B.value?(e.openBlock(),e.createElementBlock("div",ut," Now ")):e.createCommentVNode("",!0)],4)]))}}),mt={key:0,class:"relative flex flex-1 min-w-0 bg-card"},pt={key:1,class:"flex-1 min-w-0 relative min-h-[1616px] @md:min-h-[1658px] bg-card"},ft={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"},vt={class:"flex pb-4 min-w-[200px]"},gt=["onClick"],ht={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"},xt={class:"text-xs text-muted-foreground font-medium group-hover:text-foreground/70 transition-colors"},yt={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-orange-500"},kt=e.defineComponent({__name:"EventView",props:{agendaData:{default:()=>({})}},setup(d){const b=e.inject("activeDate",e.ref(H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))),h=e.inject("viewMode",e.ref(1)),w=e.inject("events",e.ref([])),B=e.inject("resources",e.ref([])),o=e.ref(null),i=e.ref(!1),c=e.ref(!1);e.computed(()=>B.value.length>1);const n=e.computed(()=>{const t=[],a=b.value;for(let N=0;N<h.value;N++)t.push(a.add({days:N}));return t}),x=(t,a)=>{const N=`${t.year}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`;return w.value?.filter(j=>j.date===N)||[]},f=t=>{const a=H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2());return t.year===a.year&&t.month===a.month&&t.day===a.day},T=t=>{b.value=t,h.value=1};let V=null,_=null;const I=()=>{o.value&&(D(),o.value.scrollBy({left:-300,behavior:"smooth"}),_=window.setTimeout(()=>{V=window.setInterval(()=>{o.value&&o.value.scrollBy({left:-20,behavior:"auto"})},50)},300))},C=()=>{o.value&&(D(),o.value.scrollBy({left:300,behavior:"smooth"}),_=window.setTimeout(()=>{V=window.setInterval(()=>{o.value&&o.value.scrollBy({left:20,behavior:"auto"})},50)},300))},D=()=>{_&&(clearTimeout(_),_=null),V&&(clearInterval(V),V=null)},M=()=>{if(!o.value)return;const{scrollLeft:t,scrollWidth:a,clientWidth:N}=o.value;i.value=t>10,c.value=t<a-N-10},q=t=>{o.value&&Math.abs(t.deltaY)>Math.abs(t.deltaX)&&(t.preventDefault(),o.value.scrollBy({left:t.deltaY,behavior:"auto"}))},R=e.ref(!1),U=e.ref(0),m=e.ref(0),u=t=>{!o.value||h.value===1||t.target.closest(".event-card")||(R.value=!0,U.value=t.pageX,m.value=o.value.scrollLeft,o.value.style.userSelect="none",t.preventDefault())},S=t=>{if(!R.value||!o.value)return;const a=t.pageX,N=(U.value-a)*1.2;o.value.scrollLeft=m.value+N},r=()=>{o.value&&(R.value=!1,o.value.style.userSelect="")};return e.onMounted(()=>{o.value&&(o.value.addEventListener("scroll",M),o.value.addEventListener("wheel",q,{passive:!1}),e.nextTick(()=>{M(),setTimeout(M,50),setTimeout(M,150),setTimeout(M,300),setTimeout(M,500)})),document.addEventListener("mousemove",S),document.addEventListener("mouseup",r)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",r)}),e.watch(h,()=>{h.value>1?e.nextTick(()=>{setTimeout(()=>{if(!o.value)return;const{scrollWidth:t,clientWidth:a}=o.value;t>a&&(c.value=!0,i.value=!1)},100)}):o.value&&(o.value.style.cursor="")}),e.onUnmounted(()=>{D(),o.value&&(o.value.removeEventListener("scroll",M),o.value.removeEventListener("wheel",q))}),(t,a)=>{const N=e.resolveComponent("Button"),j=e.resolveComponent("TooltipTrigger"),L=e.resolveComponent("TooltipContent"),y=e.resolveComponent("Tooltip");return e.unref(h)===1?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(K),e.createVNode(G,{class:"h-full","current-date":e.unref(b)},null,8,["current-date"]),e.createVNode(J,{"agenda-data":d.agendaData,date:e.unref(b),events:x(e.unref(b)),resources:e.unref(B)},null,8,["agenda-data","date","events","resources"])])):(e.openBlock(),e.createElementBlock("div",pt,[e.unref(h)===7?(e.openBlock(),e.createElementBlock("div",ft,[e.createVNode(e.unref(z.ChevronLeft),{size:12}),a[0]||(a[0]=e.createElementVNode("span",null,"Scroll to view all days",-1)),e.createVNode(e.unref(z.ChevronRight),{size:12})])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(N,{key:1,variant:"outline",size:"icon",onMousedown:I,onMouseup:D,onMouseleave:D,onTouchstart:I,onTouchend:D,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(z.ChevronLeft),{size:20})]),_:1})):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createBlock(N,{key:2,variant:"outline",size:"icon",onMousedown:C,onMouseup:D,onMouseleave:D,onTouchstart:C,onTouchend:D,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(z.ChevronRight),{size:20})]),_:1})):e.createCommentVNode("",!0),e.createVNode(G,{class:"h-[calc(100%-122px)] mt-[80px] @md:h-[calc(100%-164px)] @md: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",c.value?"opacity-100":"opacity-0"])},null,2),e.createElementVNode("div",{ref_key:"scrollContainer",ref:o,class:"absolute inset-0 overflow-x-auto overflow-y-hidden",onScroll:M,onMousedown:u},[e.createElementVNode("div",vt,[e.createVNode(K),a[5]||(a[5]=e.createElementVNode("div",{class:"absolute w-10 @md:w-14 h-[125px] bg-input"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(k,v)=>(e.openBlock(),e.createElementBlock("div",{key:k.toString(),class:e.normalizeClass(["flex-shrink-0",{"min-w-[200px] w-[33.33%]":e.unref(h)===3,"min-w-[280px]":e.unref(h)===7}])},[e.createElementVNode("div",{onClick:l=>T(k),class:e.normalizeClass(["relative p-3 border cursor-pointer transition-all duration-200 group relative",f(k)?"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"])},[f(k)?(e.openBlock(),e.createElementBlock("div",ht,[...a[1]||(a[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",f(k)?"text-primary group-hover:text-primary/80":"text-muted-foreground group-hover:text-foreground"])},e.toDisplayString(new Date(k.year,k.month-1,k.day).toLocaleDateString("en-US",{weekday:"short"})),3),e.createElementVNode("div",{class:e.normalizeClass(["text-2xl font-bold transition-colors",f(k)?"text-foreground":"text-foreground group-hover:text-primary"])},e.toDisplayString(k.day),3),e.createElementVNode("div",xt,e.toDisplayString(new Date(k.year,k.month-1,k.day).toLocaleDateString("en-US",{month:"long",year:"numeric"})),1),a[4]||(a[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(y,null,{default:e.withCtx(()=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[x(k).filter(l=>l.isException).length>0?(e.openBlock(),e.createBlock(e.unref(z.Asterisk),{key:0,class:"absolute top-3 right-3 size-4 text-orange-500"})):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(L,null,{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[x(k).filter(l=>l.isException).length>0?(e.openBlock(),e.createElementBlock("div",yt)):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(L,null,{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024)],10,gt),e.createVNode(J,{"agenda-data":d.agendaData,date:k,events:x(k),resources:e.unref(B)},null,8,["agenda-data","date","events","resources"])],2))),128))])],544)]))}}}),bt=ae._export_sfc(kt,[["__scopeId","data-v-a0b50ec2"]]),_t={class:"flex items-center justify-between @sm:justify-start gap-4"},Nt={class:"flex flex-col"},wt={class:"flex items-center gap-2"},Et={class:"text-lg @sm:text-2xl font-bold tracking-tight truncate"},St={class:"text-xs @sm:text-sm text-muted-foreground ml-7 truncate"},Vt={class:"flex @sm:items-center justify-between flex-col @sm:flex-row @5xl:justify-end gap-2"},Ct={class:"flex items-center gap-1 @5xl:mr-2"},Dt={key:0,class:"flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"},Bt=["onClick"],$t={class:"flex gap-2 @md:gap-4"},Tt={class:"hidden @md:flex flex-shrink-0 flex-col gap-4"},zt={key:0,class:"rounded-md border p-3 bg-card"},It={class:"space-y-1"},Mt=["onClick"],At={class:"min-w-0 flex-1"},Lt={class:"text-sm font-medium truncate"},jt={key:0,class:"pt-2 mt-2 border-t"},Rt={key:0,class:"mt-1 space-y-1"},Pt={class:"min-w-0 flex-1"},Ot={class:"text-sm font-medium truncate text-muted-foreground"},Ft=e.defineComponent({__name:"agenda",setup(d){const{hasPermission:b}=F.useModulePermissions(),{params:h}=F.useModuleRoute(),{config:w}=F.useModule(),B=F.useFirebaseIntegration(w.project),o=e.ref(H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),i=e.ref(1),c=e.useTemplateRef("container"),{width:n}=re.useElementSize(c),x=e.computed(()=>n.value<640);e.watch(x,l=>{l&&i.value!==1&&(i.value=1)},{immediate:!0});const f=e.ref(null),T=e.ref(new Map),V=e.computed(()=>f.value?.resources||[]),_=e.computed(()=>V.value.filter(l=>l.isActive)),I=e.computed(()=>V.value.filter(l=>!l.isActive)),C=e.ref(null),D=e.ref(!1);e.watch(_,l=>{l.length>0&&!C.value&&(C.value=l[0].id)},{immediate:!0});const M=e.computed(()=>{if(!C.value)return _.value.length>0?[_.value[0]]:[];const l=_.value.find(p=>p.id===C.value);return l?[l]:_.value.length>0?[_.value[0]]:[]}),q=e.computed(()=>f.value?.pricingOptions?.find(p=>p.isDefault)?.duration||30),R=l=>{C.value=l};e.watch(o,()=>{k()});const U=e.computed(()=>{const l=o.value,p=new Date(l.year,l.month-1,l.day),E=p.toLocaleDateString("en-US",{weekday:"long"}).toUpperCase(),g=l.day,$=p.toLocaleDateString("en-US",{month:"short"}).toUpperCase();return{dayName:E,day:g,monthName:$,full:`${E} ${g} ${$}`}}),m=()=>{o.value=o.value.subtract({days:i.value})},u=()=>{o.value=o.value.add({days:i.value})},S=()=>{o.value=H.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(H.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())},r=l=>{const[p,E]=l.split(":").map(Number);return p*60+E},t=(l,p)=>(f.value?.exceptions||[]).find(g=>p>=g.startDate&&p<=g.endDate?g.resourceIds===null?!0:g.resourceIds?.includes(l):!1)||null,a=(l,p,E)=>{const g=t(l.id,E);if(g)return g.isClosed?[]:g.timeslots.map(s=>({startTime:s.startTime,endTime:s.endTime,isException:!0}));const $=p.getDay(),A=l.openingHours?.[$]||[];return A.length===0?[]:A.map(s=>({startTime:s.start,endTime:s.end,isException:!1}))},N=(l,p,E,g)=>{if(!f.value)return 0;const $=T.value.get(p);return $?$.filter(s=>s.resourceId===l).reduce((s,P)=>{const O=r(P.startTime),Q=r(P.endTime),W=r(E),Y=r(g);return O<Y&&Q>W?s+(P.reserved||0):s},0):0},j=e.computed(()=>{if(!f.value)return[];T.value.size;let l=[],p=[];for(let g=0;g<i.value;g++){const $=o.value.add({days:g});p.push($)}const E=M.value.length>0?M.value:[];return E.length===0?[]:(p.forEach(g=>{let $=new Date(g.year,g.month-1,g.day);const A=`${g.year}-${String(g.month).padStart(2,"0")}-${String(g.day).padStart(2,"0")}`;E.forEach(s=>{const P=a(s,$,A);l=l.concat(P.map((O,Q)=>{const W=N(s.id,A,O.startTime,O.endTime);return{id:`block-${A}-${s.id}-${Q}`,title:f.value.serviceName,date:A,startTime:O.startTime,endTime:O.endTime,theme:s.color||"#3b82f6",bookings:W,maxBookings:s.capacity,isException:O.isException||!1,resourceId:s.id,resource:s,interval:s.interval||30,serviceDuration:q.value}}))})}),l)});let L=null;const y=async()=>{L||(L=B.get(w.agendaCollection,h.value.id).then(l=>{f.value=l}).finally(()=>{L=null})),await L},k=async()=>{if(f.value||await y(),!f.value)return;const l=h.value.id,p=o.value;T.value.clear();const E=[];for(let g=0;g<i.value;g++){const $=p.add({days:g}),A=`${$.year}-${String($.month).padStart(2,"0")}-${String($.day).padStart(2,"0")}`,s=`${l}_${A}`;E.push(B.get(w.reservedSpotsCollection,s).then(P=>{if(P){const O=[];for(const Q of _.value){const W=P?.[Q.id]||{};Object.entries(W).forEach(([Y,Z])=>{const[ee,te]=Y.split("-");O.push({resourceId:Q.id,startTime:ee,endTime:te,reserved:Z})})}T.value.set(A,O)}}).catch(()=>{}))}await Promise.all(E)};return(async()=>(await y(),await k()))(),e.watch(i,()=>{k()}),e.provide("agendaData",f),e.provide("activeDate",o),e.provide("viewMode",i),e.provide("events",j),e.provide("resources",M),e.provide("allResources",_),(l,p)=>{const E=e.resolveComponent("Button"),g=e.resolveComponent("SegmentedControlButton"),$=e.resolveComponent("SegmentedControl"),A=e.resolveComponent("Calendar");return e.openBlock(),e.createBlock(oe._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"container",ref:c,class:"flex flex-col gap-2 @md:gap-4 w-full"},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col @5xl:flex-row @5xl:items-center @5xl:justify-between gap-3 px-1",(x.value,"")])},[e.createElementVNode("div",_t,[e.createElementVNode("div",Nt,[e.createElementVNode("div",wt,[e.createVNode(e.unref(z.CalendarDays),{size:20,class:"text-primary flex-shrink-0"}),e.createElementVNode("h2",Et,e.toDisplayString(U.value.full),1)]),e.createElementVNode("p",St,e.toDisplayString(f.value?.serviceName),1)])]),e.createElementVNode("div",Vt,[e.createElementVNode("div",Ct,[e.createVNode(E,{variant:"outline",size:"icon",class:"size-8 @sm:size-9",onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronLeft),{size:16})]),_:1}),e.createVNode(E,{variant:"outline",size:"sm",class:"h-8 @sm:h-9 px-2 @sm:px-3 text-xs @sm:text-sm",onClick:S},{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(E,{variant:"outline",size:"icon",class:"size-8 @sm:size-9",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ChevronRight),{size:16})]),_:1})]),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($,{key:0,modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=s=>i.value=s)},{default:e.withCtx(()=>[e.createVNode(g,{value:1},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"1 Day",-1)])]),_:1}),e.createVNode(g,{value:3},{default:e.withCtx(()=>[...p[5]||(p[5]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"3 Days",-1)])]),_:1}),e.createVNode(g,{value:7},{default:e.withCtx(()=>[...p[6]||(p[6]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"7 Days",-1)])]),_:1})]),_:1},8,["modelValue"])),e.unref(b)("manage-reservations")?(e.openBlock(),e.createBlock(se._sfc_main,{key:1,"agenda-data":f.value},null,8,["agenda-data"])):e.createCommentVNode("",!0)])],2),x.value&&_.value.length>0?(e.openBlock(),e.createElementBlock("div",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.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":C.value===s.id,"bg-background hover:bg-muted":C.value!==s.id}]),onClick:P=>R(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:C.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,Bt))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("div",Tt,[e.createVNode(A,{modelValue:o.value,"onUpdate:modelValue":p[1]||(p[1]=s=>o.value=s),"weekday-format":"short",class:"rounded-md border bg-card"},null,8,["modelValue"]),V.value.length>0?(e.openBlock(),e.createElementBlock("div",zt,[p[7]||(p[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",It,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.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":C.value===s.id,"opacity-50":C.value&&C.value!==s.id}]),onClick:P=>R(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",At,[e.createElementVNode("div",Lt,e.toDisplayString(s.name),1)]),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full flex-shrink-0",C.value===s.id?"bg-primary":"bg-muted-foreground/30"])},null,2)],10,Mt))),128)),I.value.length>0?(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("button",{class:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",onClick:p[2]||(p[2]=s=>D.value=!D.value)},[e.createVNode(e.unref(z.ChevronRight),{size:14,class:e.normalizeClass(["transition-transform",{"rotate-90":D.value}])},null,8,["class"]),e.createElementVNode("span",null,"Inactive ("+e.toDisplayString(I.value.length)+")",1)]),D.value?(e.openBlock(),e.createElementBlock("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.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",Pt,[e.createElementVNode("div",Ot,e.toDisplayString(s.name),1)])]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createVNode(bt,{"agenda-data":f.value},null,8,["agenda-data"])])],512)]),_:1})}}});exports.default=Ft;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function t(e) {
|
|
2
|
+
return new Date(e.getTime() - e.getTimezoneOffset() * 6e4).toISOString().slice(0, 10);
|
|
3
|
+
}
|
|
4
|
+
function n() {
|
|
5
|
+
const e = /* @__PURE__ */ new Date(), a = t(e);
|
|
6
|
+
return {
|
|
7
|
+
// PAST
|
|
8
|
+
today: [a],
|
|
9
|
+
yesterday: [t(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 1))],
|
|
10
|
+
last7days: [
|
|
11
|
+
t(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 6)),
|
|
12
|
+
a
|
|
13
|
+
],
|
|
14
|
+
lastMonth: [
|
|
15
|
+
t(new Date(e.getFullYear(), e.getMonth() - 1, e.getDate())),
|
|
16
|
+
a
|
|
17
|
+
],
|
|
18
|
+
last6months: [
|
|
19
|
+
t(new Date(e.getFullYear(), e.getMonth() - 6, e.getDate())),
|
|
20
|
+
a
|
|
21
|
+
],
|
|
22
|
+
lastYear: [
|
|
23
|
+
t(new Date(e.getFullYear() - 1, e.getMonth(), e.getDate())),
|
|
24
|
+
a
|
|
25
|
+
],
|
|
26
|
+
// FUTURE
|
|
27
|
+
tomorrow: [t(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1))],
|
|
28
|
+
next7days: [
|
|
29
|
+
a,
|
|
30
|
+
t(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 6))
|
|
31
|
+
],
|
|
32
|
+
nextMonth: [
|
|
33
|
+
a,
|
|
34
|
+
t(new Date(e.getFullYear(), e.getMonth() + 1, e.getDate()))
|
|
35
|
+
],
|
|
36
|
+
next6months: [
|
|
37
|
+
a,
|
|
38
|
+
t(new Date(e.getFullYear(), e.getMonth() + 6, e.getDate()))
|
|
39
|
+
],
|
|
40
|
+
nextYear: [
|
|
41
|
+
a,
|
|
42
|
+
t(new Date(e.getFullYear() + 1, e.getMonth(), e.getDate()))
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
n as g
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function n(){const e=new Date,a=t(e);return{today:[a],yesterday:[t(new Date(e.getFullYear(),e.getMonth(),e.getDate()-1))],last7days:[t(new Date(e.getFullYear(),e.getMonth(),e.getDate()-6)),a],lastMonth:[t(new Date(e.getFullYear(),e.getMonth()-1,e.getDate())),a],last6months:[t(new Date(e.getFullYear(),e.getMonth()-6,e.getDate())),a],lastYear:[t(new Date(e.getFullYear()-1,e.getMonth(),e.getDate())),a],tomorrow:[t(new Date(e.getFullYear(),e.getMonth(),e.getDate()+1))],next7days:[a,t(new Date(e.getFullYear(),e.getMonth(),e.getDate()+6))],nextMonth:[a,t(new Date(e.getFullYear(),e.getMonth()+1,e.getDate()))],next6months:[a,t(new Date(e.getFullYear(),e.getMonth()+6,e.getDate()))],nextYear:[a,t(new Date(e.getFullYear()+1,e.getMonth(),e.getDate()))]}}exports.getDateRangePresets=n;
|