@oneclick.dev/cms-core-modules 0.0.90 → 0.0.92

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.
Files changed (25) hide show
  1. package/dist/{ContentEditor-BrhHT4t0.js → ContentEditor-ClYwiqvs.js} +40 -40
  2. package/dist/{ContentEditor-B-lB0fES.mjs → ContentEditor-fwvAAH_A.mjs} +4017 -3985
  3. package/dist/{EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs → EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs} +30 -31
  4. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js +1 -0
  5. package/dist/{agenda-C5grvzSa.mjs → agenda-D9bpW3jv.mjs} +1 -1
  6. package/dist/{agenda-DXMwVWpN.js → agenda-H1NyBNr2.js} +1 -1
  7. package/dist/{availability-C1NqOFsQ.mjs → availability-B1D4Fyzi.mjs} +1 -1
  8. package/dist/{availability-D_wnfLsH.js → availability-DxrUcYbW.js} +1 -1
  9. package/dist/{exceptions-Cn7zooEu.js → exceptions-Bp5BSvxO.js} +1 -1
  10. package/dist/{exceptions-BIwMhYa4.mjs → exceptions-C97cNZYl.mjs} +1 -1
  11. package/dist/index-DOeXSG47.js +35 -0
  12. package/dist/{index-MwjeLHPP.mjs → index-DnH93MgM.mjs} +232 -231
  13. package/dist/index.cjs.js +1 -1
  14. package/dist/index.mjs +9 -9
  15. package/dist/{orders-V1pch_ih.js → orders-BAT2ciXx.js} +1 -1
  16. package/dist/{orders-DhQ2EFXS.mjs → orders-DDrZJHj2.mjs} +1 -1
  17. package/dist/{payment-BbWByERf.mjs → payment-Bosr0m3u.mjs} +1 -1
  18. package/dist/{payment-BQaAqQ5q.js → payment-DDnC03jb.js} +1 -1
  19. package/dist/{regular-slots-C2NYxLPn.mjs → regular-slots-Cc1jmKuC.mjs} +1 -1
  20. package/dist/{regular-slots-Bs3WJB3U.js → regular-slots-DBs1XVeN.js} +1 -1
  21. package/dist/{resources-CFR_s89Z.mjs → resources-B7qDBC91.mjs} +1 -1
  22. package/dist/{resources-eb0pivDL.js → resources-BtF5RUUq.js} +1 -1
  23. package/package.json +2 -2
  24. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js +0 -1
  25. package/dist/index-C9pSS15N.js +0 -35
@@ -1,22 +1,22 @@
1
- import { defineComponent as ie, inject as je, computed as W, ref as N, onMounted as Ne, nextTick as Be, onUnmounted as Oe, watch as Y, openBlock as h, createElementBlock as T, resolveComponent as w, createElementVNode as n, Fragment as ne, createVNode as l, unref as e, normalizeStyle as me, toDisplayString as z, createCommentVNode as Z, createBlock as G, isRef as oe, withCtx as b, createTextVNode as X, renderList as ve, normalizeClass as ae, provide as Ee } from "vue";
2
- import { useModuleRoute as ye, useModule as be, useFirebaseIntegration as _e, useModulePermissions as Le } from "@oneclick.dev/cms-kit";
3
- import { Layers as ge, ChevronDown as Fe, ChevronLeft as We, ChevronRight as Ge, Users as ke, RefreshCw as He, Search as Ue, X as qe, Clock as Ye, Calendar as Xe } from "lucide-vue-next";
4
- import { _ as Qe } from "./EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs";
5
- import { h as fe, t as Je, s as Ke, M as re, a3 as he, a4 as Ze, J as Se, _ as De, y as le, P as Ce, a5 as et, a6 as tt, a7 as st, q as at, j as ot, R as nt, Q as rt, Z as lt } from "./index-CMk3uhUt.mjs";
1
+ import { defineComponent as le, inject as je, computed as W, ref as N, onMounted as Ne, nextTick as Be, onUnmounted as Oe, watch as Y, openBlock as h, createElementBlock as T, resolveComponent as w, withModifiers as Le, createElementVNode as n, Fragment as ne, createVNode as i, unref as e, normalizeStyle as me, toDisplayString as z, createCommentVNode as Z, createBlock as G, isRef as oe, withCtx as b, createTextVNode as X, renderList as ve, normalizeClass as ae, provide as Ee } from "vue";
2
+ import { useModuleRoute as ye, useModule as be, useFirebaseIntegration as _e, useModulePermissions as Fe } from "@oneclick.dev/cms-kit";
3
+ import { Layers as ge, ChevronDown as We, ChevronLeft as Ge, ChevronRight as He, Users as ke, RefreshCw as Ue, Search as qe, X as Ye, Clock as Xe, Calendar as Qe } from "lucide-vue-next";
4
+ import { _ as Je } from "./EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs";
5
+ import { h as fe, t as Ke, s as Ze, M as re, a3 as he, a4 as et, J as Se, _ as De, y as ie, P as Ce, a5 as tt, a6 as st, a7 as at, q as ot, j as nt, R as rt, Q as it, Z as lt } from "./index-CMk3uhUt.mjs";
6
6
  import { componentToString as we, ChartTooltipContent as $e } from "@oneclick.dev/cms-kit/charts";
7
- import { a as it } from "./index-B-lVEpFX.mjs";
8
- import { X as ct, O as Ie, a as dt, b as ut, r as mt, D as de, S as Me, C as ue, z as Ve, A as Re } from "./index-_2lRVt_k.mjs";
9
- import { F as pt, _ as vt } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs";
10
- import { _ as ft } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs";
11
- function gt({ x: _, y: c, w: s, h: p, tl: g = !1, tr: u = !1, bl: x = !1, br: r = !1, r: o = 0 }) {
7
+ import { a as ct } from "./index-B-lVEpFX.mjs";
8
+ import { X as dt, O as Ie, a as ut, b as mt, r as pt, D as de, S as Me, C as ue, z as Ve, A as Re } from "./index-_2lRVt_k.mjs";
9
+ import { F as vt, _ as ft } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs";
10
+ import { _ as gt } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs";
11
+ function ht({ x: _, y: c, w: s, h: p, tl: g = !1, tr: m = !1, bl: x = !1, br: r = !1, r: o = 0 }) {
12
12
  let v;
13
13
  v = `M${_ + o},${c}h${s - 2 * o}`;
14
- let t = u ? o : 0, i = u ? 0 : o;
15
- return v += `a${t},${t} 0 0 1 ${t},${t}`, v += `h${i}v${i}`, v += `v${p - 2 * o}`, t = r ? o : 0, i = r ? 0 : o, v += `a${t},${t} 0 0 1 ${-t},${t}`, v += `v${i}h${-i}`, v += `h${2 * o - s}`, t = x ? o : 0, i = x ? 0 : o, v += `a${t},${t} 0 0 1 ${-t},${-t}`, v += `h${-i}v${-i}`, v += `v${2 * o - p}`, t = g ? o : 0, i = g ? 0 : o, v += `a${t},${t} 0 0 1 ${t},${-t}`, v += `v${-i}h${i}`, v += "z", v;
14
+ let t = m ? o : 0, l = m ? 0 : o;
15
+ return v += `a${t},${t} 0 0 1 ${t},${t}`, v += `h${l}v${l}`, v += `v${p - 2 * o}`, t = r ? o : 0, l = r ? 0 : o, v += `a${t},${t} 0 0 1 ${-t},${t}`, v += `v${l}h${-l}`, v += `h${2 * o - s}`, t = x ? o : 0, l = x ? 0 : o, v += `a${t},${t} 0 0 1 ${-t},${-t}`, v += `h${-l}v${-l}`, v += `v${2 * o - p}`, t = g ? o : 0, l = g ? 0 : o, v += `a${t},${t} 0 0 1 ${t},${-t}`, v += `v${-l}h${l}`, v += "z", v;
16
16
  }
17
- const ht = Object.assign(Object.assign({}, ct), { color: void 0, groupMaxWidth: void 0, groupWidth: void 0, dataStep: void 0, groupPadding: 0.05, barPadding: 0, roundedCorners: 2, barMinHeight: 2, cursor: null, orientation: Ie.Vertical }), Pe = fe`
17
+ const xt = Object.assign(Object.assign({}, dt), { color: void 0, groupMaxWidth: void 0, groupWidth: void 0, dataStep: void 0, groupPadding: 0.05, barPadding: 0, roundedCorners: 2, barMinHeight: 2, cursor: null, orientation: Ie.Vertical }), Pe = fe`
18
18
  label: grouped-bar-component;
19
- `, xt = Je`
19
+ `, yt = Ke`
20
20
  :root {
21
21
  --vis-grouped-bar-cursor: default;
22
22
  --vis-grouped-bar-fill-color: var(--vis-color-main);
@@ -48,26 +48,26 @@ const ht = Object.assign(Object.assign({}, ct), { color: void 0, groupMaxWidth:
48
48
  label: barGroup;
49
49
  `, ze = fe`
50
50
  label: barGroupExit;
51
- `, yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
+ `, bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
52
52
  __proto__: null,
53
53
  bar: pe,
54
54
  barGroup: xe,
55
55
  barGroupExit: ze,
56
- globalStyles: xt,
56
+ globalStyles: yt,
57
57
  root: Pe
58
58
  }, Symbol.toStringTag, { value: "Module" }));
59
- class Ae extends dt {
59
+ class Ae extends ut {
60
60
  constructor(c) {
61
- super(), this._defaultConfig = ht, this.config = this._defaultConfig, this.getAccessors = () => Ke(this.config.y) ? this.config.y : [this.config.y], this.events = {}, this._barData = [], c && this.setConfig(c);
61
+ super(), this._defaultConfig = xt, this.config = this._defaultConfig, this.getAccessors = () => Ze(this.config.y) ? this.config.y : [this.config.y], this.events = {}, this._barData = [], c && this.setConfig(c);
62
62
  }
63
63
  get bleed() {
64
64
  if (this._barData = this._getVisibleData(), this._barData.length === 0)
65
65
  return { top: 0, bottom: 0, left: 0, right: 0 };
66
- const c = !this.isVertical() && this.dataScale.range()[0] > this.dataScale.range()[1], s = this.dataScale.domain(), p = this._getGroupWidth() / 2, g = this._barData.map((D, E) => re(D, this.config.x, E)), u = he(g), x = Ze(g), r = this.dataScale(u), o = this.dataScale(x), v = this.dataScale.invert(r + (c ? p : -p)), t = this.dataScale.invert(o + (c ? -p : p)), i = v <= s[0] ? this.dataScale(s[0]) - this.dataScale(v) : 0, R = t > s[1] ? this.dataScale(t) - this.dataScale(s[1]) : 0;
66
+ const c = !this.isVertical() && this.dataScale.range()[0] > this.dataScale.range()[1], s = this.dataScale.domain(), p = this._getGroupWidth() / 2, g = this._barData.map((D, E) => re(D, this.config.x, E)), m = he(g), x = et(g), r = this.dataScale(m), o = this.dataScale(x), v = this.dataScale.invert(r + (c ? p : -p)), t = this.dataScale.invert(o + (c ? -p : p)), l = v <= s[0] ? this.dataScale(s[0]) - this.dataScale(v) : 0, R = t > s[1] ? this.dataScale(t) - this.dataScale(s[1]) : 0;
67
67
  return {
68
- top: this.isVertical() ? 0 : c ? -R : i,
69
- bottom: this.isVertical() ? 0 : c ? -i : R,
70
- left: this.isVertical() ? i : 0,
68
+ top: this.isVertical() ? 0 : c ? -R : l,
69
+ bottom: this.isVertical() ? 0 : c ? -l : R,
70
+ left: this.isVertical() ? l : 0,
71
71
  right: this.isVertical() ? R : 0
72
72
  };
73
73
  }
@@ -81,49 +81,49 @@ class Ae extends dt {
81
81
  return this.config.orientation === Ie.Vertical;
82
82
  }
83
83
  _render(c) {
84
- const { config: s } = this, p = Se(c) ? c : s.duration, g = this._getGroupWidth(), u = this.getAccessors(), x = [-g / 2, g / 2], r = ut().domain(mt(u.length)).range(x).paddingInner(s.barPadding).paddingOuter(s.barPadding), o = this.g.selectAll(`.${xe}`).data(this._barData, (S, P) => {
84
+ const { config: s } = this, p = Se(c) ? c : s.duration, g = this._getGroupWidth(), m = this.getAccessors(), x = [-g / 2, g / 2], r = mt().domain(pt(m.length)).range(x).paddingInner(s.barPadding).paddingOuter(s.barPadding), o = this.g.selectAll(`.${xe}`).data(this._barData, (S, P) => {
85
85
  var d;
86
86
  return `${(d = De(S, s.id, P)) !== null && d !== void 0 ? d : P}`;
87
87
  }), v = (S, P) => {
88
88
  const d = this.dataScale(re(S, s.x, P)), f = this.isVertical() ? d : 0, j = this.isVertical() ? 0 : d;
89
89
  return `translate(${f},${j})`;
90
- }, i = o.enter().append("g").attr("class", xe).attr("transform", v).style("opacity", 1).merge(o);
91
- le(i, p).attr("transform", v).style("opacity", 1);
90
+ }, l = o.enter().append("g").attr("class", xe).attr("transform", v).style("opacity", 1).merge(o);
91
+ ie(l, p).attr("transform", v).style("opacity", 1);
92
92
  const R = o.exit().attr("class", ze);
93
- le(R, p).style("opacity", 0).remove(), le(R.selectAll(`.${pe}`), p).attr("transform", (S, P, d) => this.isVertical() ? `translate(0,${this.yScale(0)}) scale(1,0)` : `translate(${this.xScale(0)},0) scale(0,1)`);
94
- const D = r.bandwidth(), E = i.selectAll(`.${pe}`).data((S) => u.map(() => S)), A = this._getValueAxisDirection(), U = E.enter().append("path").attr("class", pe).attr("d", (S, P) => {
93
+ ie(R, p).style("opacity", 0).remove(), ie(R.selectAll(`.${pe}`), p).attr("transform", (S, P, d) => this.isVertical() ? `translate(0,${this.yScale(0)}) scale(1,0)` : `translate(${this.xScale(0)},0) scale(0,1)`);
94
+ const D = r.bandwidth(), E = l.selectAll(`.${pe}`).data((S) => m.map(() => S)), A = this._getValueAxisDirection(), U = E.enter().append("path").attr("class", pe).attr("d", (S, P) => {
95
95
  const d = r(P), f = this.valueScale(0), j = D;
96
96
  return this._getBarPath(d, f, j, 0, !1, A);
97
97
  }).style("fill", (S, P) => Ce(S, s.color, P)).merge(E);
98
- le(U, p).attr("d", (S, P) => {
99
- const d = r(P), f = D, j = re(S, u[P]), m = j < 0;
100
- let O = m ? this.valueScale(0) : this.valueScale(j || 0), $ = Math.abs(this.valueScale(0) - this.valueScale(j)) || 0;
98
+ ie(U, p).attr("d", (S, P) => {
99
+ const d = r(P), f = D, j = re(S, m[P]), u = j < 0;
100
+ let O = u ? this.valueScale(0) : this.valueScale(j || 0), $ = Math.abs(this.valueScale(0) - this.valueScale(j)) || 0;
101
101
  if ($ < s.barMinHeight) {
102
102
  const Q = A === de.North ? -1 : 1;
103
103
  O = this.valueScale(0) + Q * s.barMinHeight, $ = s.barMinHeight;
104
104
  }
105
- return this._getBarPath(d, O, f, $, m, A);
106
- }).style("fill", (S, P) => Ce(S, s.color, P)).style("cursor", (S, P) => De(S, s.cursor, P)), le(E.exit(), p).remove();
105
+ return this._getBarPath(d, O, f, $, u, A);
106
+ }).style("fill", (S, P) => Ce(S, s.color, P)).style("cursor", (S, P) => De(S, s.cursor, P)), ie(E.exit(), p).remove();
107
107
  }
108
108
  _getValueAxisDirection() {
109
109
  return this.valueScale.range()[0] > this.valueScale.range()[1] ? de.North : de.South;
110
110
  }
111
111
  _getVisibleData() {
112
- const { config: c, datamodel: { data: s } } = this, p = this._getGroupWidth(), g = s.length < 2 ? 0 : p / 2, u = this.dataScale, x = Math.abs(u.invert(g) - u.invert(0));
112
+ const { config: c, datamodel: { data: s } } = this, p = this._getGroupWidth(), g = s.length < 2 ? 0 : p / 2, m = this.dataScale, x = Math.abs(m.invert(g) - m.invert(0));
113
113
  return s?.filter((o, v) => {
114
- const t = re(o, c.x, v), i = u.domain(), R = +i[0], D = +i[1];
114
+ const t = re(o, c.x, v), l = m.domain(), R = +l[0], D = +l[1];
115
115
  return t >= R - x && t <= D + x;
116
116
  });
117
117
  }
118
- _getBarPath(c, s, p, g, u, x) {
119
- const { config: r } = this, o = r.roundedCorners ? Se(r.roundedCorners) ? +r.roundedCorners : p / 2 : 0, v = ot(o, 0, Math.min(g, p) / 2), t = x === de.North, i = this.isVertical() && u !== t, R = this.isVertical() && u === t, D = !this.isVertical() && u, E = !this.isVertical() && !u;
120
- return gt({
118
+ _getBarPath(c, s, p, g, m, x) {
119
+ const { config: r } = this, o = r.roundedCorners ? Se(r.roundedCorners) ? +r.roundedCorners : p / 2 : 0, v = nt(o, 0, Math.min(g, p) / 2), t = x === de.North, l = this.isVertical() && m !== t, R = this.isVertical() && m === t, D = !this.isVertical() && m, E = !this.isVertical() && !m;
120
+ return ht({
121
121
  x: this.isVertical() ? c : s + (t ? 0 : -g),
122
122
  y: this.isVertical() ? s + (t ? 0 : -g) : c,
123
123
  w: this.isVertical() ? p : g,
124
124
  h: this.isVertical() ? g : p,
125
- tl: i || D,
126
- tr: i || E,
125
+ tl: l || D,
126
+ tr: l || E,
127
127
  bl: R || D,
128
128
  br: R || E,
129
129
  r: v
@@ -131,26 +131,26 @@ class Ae extends dt {
131
131
  }
132
132
  _getGroupWidth() {
133
133
  const { config: c, datamodel: { data: s } } = this;
134
- if (et(s))
134
+ if (tt(s))
135
135
  return 0;
136
136
  if (c.groupWidth)
137
137
  return he([c.groupWidth, c.groupMaxWidth]);
138
138
  const p = this.dataScale.bandwidth, g = this.dataScale.domain ? this.dataScale.domain() : [];
139
139
  let x = 1 + (p ? g.length : g[1] - g[0]) / c.dataStep || !p && s.filter((v, t) => {
140
- const i = re(v, c.x, t);
141
- return i >= g[0] && i <= g[1];
140
+ const l = re(v, c.x, t);
141
+ return l >= g[0] && l <= g[1];
142
142
  }).length || s.length;
143
143
  !p && x >= 2 && (x += 1);
144
144
  const o = (x < 2 ? 1 : 1 - c.groupPadding) * (this.isVertical() ? this._width : this._height) / x;
145
145
  return he([o, c.groupMaxWidth]);
146
146
  }
147
147
  getValueScaleExtent(c) {
148
- const { datamodel: s } = this, p = this.getAccessors(), g = c ? this._getVisibleData() : s.data, u = tt(g, ...p), x = st(g, ...p);
149
- return [u > 0 ? 0 : u, x < 0 ? 0 : x];
148
+ const { datamodel: s } = this, p = this.getAccessors(), g = c ? this._getVisibleData() : s.data, m = st(g, ...p), x = at(g, ...p);
149
+ return [m > 0 ? 0 : m, x < 0 ? 0 : x];
150
150
  }
151
151
  getDataScaleExtent() {
152
152
  const { config: c, datamodel: s } = this;
153
- return at(s.data, c.x);
153
+ return ot(s.data, c.x);
154
154
  }
155
155
  getYDataExtent(c) {
156
156
  return this.isVertical() ? this.getValueScaleExtent(c) : this.getDataScaleExtent();
@@ -159,8 +159,8 @@ class Ae extends dt {
159
159
  return this.isVertical() ? this.getDataScaleExtent() : this.getValueScaleExtent(!1);
160
160
  }
161
161
  }
162
- Ae.selectors = yt;
163
- const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
162
+ Ae.selectors = bt;
163
+ const _t = { "data-vis-component": "" }, Te = /* @__PURE__ */ le({
164
164
  __name: "index",
165
165
  props: {
166
166
  color: { type: [Function, String, Array, null] },
@@ -185,26 +185,26 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
185
185
  data: {}
186
186
  },
187
187
  setup(_, { expose: c }) {
188
- const s = je(nt), p = _, g = W(() => s.data.value ?? p.data), u = rt(p), x = N();
188
+ const s = je(rt), p = _, g = W(() => s.data.value ?? p.data), m = it(p), x = N();
189
189
  return Ne(() => {
190
190
  Be(() => {
191
191
  var r;
192
- x.value = new Ae(u.value), (r = x.value) == null || r.setData(g.value), s.update(x.value);
192
+ x.value = new Ae(m.value), (r = x.value) == null || r.setData(g.value), s.update(x.value);
193
193
  });
194
194
  }), Oe(() => {
195
195
  var r;
196
196
  (r = x.value) == null || r.destroy(), s.destroy();
197
- }), Y(u, (r, o) => {
197
+ }), Y(m, (r, o) => {
198
198
  var v;
199
- lt(r, o) || (v = x.value) == null || v.setConfig(u.value);
199
+ lt(r, o) || (v = x.value) == null || v.setConfig(m.value);
200
200
  }), Y(g, () => {
201
201
  var r;
202
202
  (r = x.value) == null || r.setData(g.value);
203
203
  }), c({
204
204
  component: x
205
- }), (r, o) => (h(), T("div", bt));
205
+ }), (r, o) => (h(), T("div", _t));
206
206
  }
207
- }), _t = { class: "flex flex-col sm:flex-row" }, kt = ["data-active"], St = { class: "flex items-center gap-2" }, Dt = { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, Ct = { class: "block text-lg leading-none font-bold sm:text-3xl" }, wt = { class: "mx-auto w-full max-w-sm mt-2 mb-8" }, $t = { class: "text-muted-foreground" }, Mt = { class: "text-muted-foreground" }, Vt = { class: "grid" }, Rt = { class: "flex gap-1 overflow-hidden max-w-80" }, Tt = { class: "truncate" }, Et = /* @__PURE__ */ ie({
207
+ }), kt = { class: "flex flex-col sm:flex-row" }, St = ["data-active"], Dt = { class: "flex items-center gap-2" }, Ct = { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, wt = { class: "block text-lg leading-none font-bold sm:text-3xl" }, $t = { class: "mx-auto w-full max-w-sm mt-2 mb-8" }, Mt = { class: "text-muted-foreground" }, Vt = { class: "text-muted-foreground" }, Rt = { class: "grid" }, Tt = { class: "flex gap-1 overflow-hidden max-w-80" }, Et = { class: "truncate" }, It = /* @__PURE__ */ le({
208
208
  __name: "ResourceSelector",
209
209
  props: {
210
210
  resources: {
@@ -231,55 +231,56 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
231
231
  set: (v) => {
232
232
  p("update:viewMode", v);
233
233
  }
234
- }), u = W({
234
+ }), m = W({
235
235
  get: () => s.activeChart,
236
236
  set: (v) => {
237
237
  p("update:activeChart", v);
238
238
  }
239
- }), { width: x } = it(), r = W(() => x.value < 640), o = N(!1);
239
+ }), { width: x } = ct(), r = W(() => x.value < 640), o = N(!1);
240
240
  return (v, t) => {
241
- const i = w("DrawerTitle"), R = w("DrawerDescription"), D = w("DrawerHeader"), E = w("Button"), A = w("DrawerFooter"), L = w("DrawerContent"), U = w("Drawer"), S = w("DropdownMenuTrigger"), P = w("DropdownMenuLabel"), d = w("DropdownMenuItem"), f = w("DropdownMenuContent"), j = w("DropdownMenu");
242
- return h(), T("div", _t, [
241
+ const l = w("DrawerTitle"), R = w("DrawerDescription"), D = w("DrawerHeader"), E = w("Button"), A = w("DrawerFooter"), L = w("DrawerContent"), U = w("Drawer"), S = w("DropdownMenuTrigger"), P = w("DropdownMenuLabel"), d = w("DropdownMenuItem"), f = w("DropdownMenuContent"), j = w("DropdownMenu");
242
+ return h(), T("div", kt, [
243
243
  _.resources.length > 1 ? (h(), T("button", {
244
244
  key: 0,
245
245
  "data-active": _.viewMode === "stacked",
246
246
  class: "hover:bg-muted/50 flex flex-1 flex-col justify-center gap-2 border-t px-4 py-3 text-left sm:border-t-0 sm:border-l sm:px-6 sm:py-6 cursor-pointer",
247
- onClick: t[0] || (t[0] = (m) => o.value = !0)
247
+ onClick: t[0] || (t[0] = (u) => o.value = !0),
248
+ onContextmenu: t[1] || (t[1] = Le((u) => o.value = !0, ["prevent"]))
248
249
  }, [
249
- n("div", St, [
250
+ n("div", Dt, [
250
251
  _.viewMode === "stacked" ? (h(), T(ne, { key: 0 }, [
251
- l(e(ge), { class: "size-3 text-muted-foreground" }),
252
- t[5] || (t[5] = n("span", { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, "All Resources", -1))
252
+ i(e(ge), { class: "size-3 text-muted-foreground" }),
253
+ t[6] || (t[6] = n("span", { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, "All Resources", -1))
253
254
  ], 64)) : (h(), T(ne, { key: 1 }, [
254
255
  n("div", {
255
256
  class: "size-3 rounded-full mr-2",
256
- style: me({ backgroundColor: _.resources.find((m) => m.id === _.activeChart)?.color || "#6b7280" })
257
+ style: me({ backgroundColor: _.resources.find((u) => u.id === _.activeChart)?.color || "#6b7280" })
257
258
  }, null, 4),
258
- n("span", Dt, z(_.resources.find((m) => m.id === _.activeChart)?.name || "Select Resource"), 1)
259
+ n("span", Ct, z(_.resources.find((u) => u.id === _.activeChart)?.name || "Select Resource"), 1)
259
260
  ], 64)),
260
- l(e(Fe), { class: "ml-auto size-4" })
261
+ i(e(We), { class: "ml-auto size-4" })
261
262
  ]),
262
- n("span", Ct, z(_.viewMode === "stacked" ? Object.values(_.totals).reduce((m, O) => m + O, 0).toLocaleString() : (_.totals[_.activeChart] || 0).toLocaleString()), 1)
263
- ], 8, kt)) : Z("", !0),
263
+ n("span", wt, z(_.viewMode === "stacked" ? Object.values(_.totals).reduce((u, O) => u + O, 0).toLocaleString() : (_.totals[_.activeChart] || 0).toLocaleString()), 1)
264
+ ], 40, St)) : Z("", !0),
264
265
  e(r) ? (h(), G(U, {
265
266
  key: 1,
266
267
  open: e(o),
267
- "onUpdate:open": t[2] || (t[2] = (m) => oe(o) ? o.value = m : null)
268
+ "onUpdate:open": t[3] || (t[3] = (u) => oe(o) ? o.value = u : null)
268
269
  }, {
269
270
  default: b(() => [
270
- l(L, null, {
271
+ i(L, null, {
271
272
  default: b(() => [
272
- n("div", wt, [
273
- l(D, null, {
273
+ n("div", $t, [
274
+ i(D, null, {
274
275
  default: b(() => [
275
- l(i, null, {
276
- default: b(() => [...t[6] || (t[6] = [
276
+ i(l, null, {
277
+ default: b(() => [...t[7] || (t[7] = [
277
278
  X("Resources", -1)
278
279
  ])]),
279
280
  _: 1
280
281
  }),
281
- l(R, null, {
282
- default: b(() => [...t[7] || (t[7] = [
282
+ i(R, null, {
283
+ default: b(() => [...t[8] || (t[8] = [
283
284
  X("Select the resources to display on the timeline.", -1)
284
285
  ])]),
285
286
  _: 1
@@ -287,33 +288,33 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
287
288
  ]),
288
289
  _: 1
289
290
  }),
290
- l(A, null, {
291
+ i(A, null, {
291
292
  default: b(() => [
292
- l(E, {
293
- onClick: t[1] || (t[1] = (m) => {
294
- g.value = "stacked", u.value = "", o.value = !1;
293
+ i(E, {
294
+ onClick: t[2] || (t[2] = (u) => {
295
+ g.value = "stacked", m.value = "", o.value = !1;
295
296
  }),
296
297
  variant: _.viewMode === "stacked" ? "secondary" : "outline"
297
298
  }, {
298
299
  default: b(() => [
299
- l(e(ge), { class: "size-3 text-muted-foreground" }),
300
- n("span", $t, " All Resources (" + z(Object.values(_.totals).reduce((m, O) => m + O, 0).toLocaleString()) + ") ", 1)
300
+ i(e(ge), { class: "size-3 text-muted-foreground" }),
301
+ n("span", Mt, " All Resources (" + z(Object.values(_.totals).reduce((u, O) => u + O, 0).toLocaleString()) + ") ", 1)
301
302
  ]),
302
303
  _: 1
303
304
  }, 8, ["variant"]),
304
- (h(!0), T(ne, null, ve(_.resources, (m) => (h(), G(E, {
305
- key: m.id,
305
+ (h(!0), T(ne, null, ve(_.resources, (u) => (h(), G(E, {
306
+ key: u.id,
306
307
  onClick: (O) => {
307
- g.value = "single", u.value = m.id, o.value = !1;
308
+ g.value = "single", m.value = u.id, o.value = !1;
308
309
  },
309
- variant: _.viewMode === "single" && _.activeChart === m.id ? "secondary" : "outline"
310
+ variant: _.viewMode === "single" && _.activeChart === u.id ? "secondary" : "outline"
310
311
  }, {
311
312
  default: b(() => [
312
313
  n("div", {
313
314
  class: "size-3 rounded-full",
314
- style: me({ backgroundColor: m.color || "#6b7280" })
315
+ style: me({ backgroundColor: u.color || "#6b7280" })
315
316
  }, null, 4),
316
- n("span", Mt, z(m.name) + " (" + z((_.totals[m.id] || 0).toLocaleString()) + ") ", 1)
317
+ n("span", Vt, z(u.name) + " (" + z((_.totals[u.id] || 0).toLocaleString()) + ") ", 1)
317
318
  ]),
318
319
  _: 2
319
320
  }, 1032, ["onClick", "variant"]))), 128))
@@ -329,11 +330,11 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
329
330
  }, 8, ["open"])) : (h(), G(j, {
330
331
  key: 2,
331
332
  open: e(o),
332
- "onUpdate:open": t[4] || (t[4] = (m) => oe(o) ? o.value = m : null)
333
+ "onUpdate:open": t[5] || (t[5] = (u) => oe(o) ? o.value = u : null)
333
334
  }, {
334
335
  default: b(() => [
335
- l(S, { "as-child": "" }, {
336
- default: b(() => [...t[8] || (t[8] = [
336
+ i(S, { "as-child": "" }, {
337
+ default: b(() => [...t[9] || (t[9] = [
337
338
  n("button", {
338
339
  tabindex: "-1",
339
340
  class: "size-0 opacity-0 self-end"
@@ -341,42 +342,42 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
341
342
  ])]),
342
343
  _: 1
343
344
  }),
344
- l(f, { align: "start" }, {
345
+ i(f, { align: "end" }, {
345
346
  default: b(() => [
346
- l(P, null, {
347
- default: b(() => [...t[9] || (t[9] = [
347
+ i(P, null, {
348
+ default: b(() => [...t[10] || (t[10] = [
348
349
  X("Resources", -1)
349
350
  ])]),
350
351
  _: 1
351
352
  }),
352
- n("div", Vt, [
353
- l(d, {
354
- onClick: t[3] || (t[3] = (m) => {
355
- g.value = "stacked", u.value = "", o.value = !1;
353
+ n("div", Rt, [
354
+ i(d, {
355
+ onClick: t[4] || (t[4] = (u) => {
356
+ g.value = "stacked", m.value = "", o.value = !1;
356
357
  }),
357
358
  class: ae(_.viewMode === "stacked" ? "bg-input" : "")
358
359
  }, {
359
360
  default: b(() => [
360
- l(e(ge), { class: "size-3 text-muted-foreground" }),
361
- n("span", null, " All Resources (" + z(Object.values(_.totals).reduce((m, O) => m + O, 0).toLocaleString()) + ") ", 1)
361
+ i(e(ge), { class: "size-3 text-muted-foreground" }),
362
+ n("span", null, " All Resources (" + z(Object.values(_.totals).reduce((u, O) => u + O, 0).toLocaleString()) + ") ", 1)
362
363
  ]),
363
364
  _: 1
364
365
  }, 8, ["class"]),
365
- (h(!0), T(ne, null, ve(_.resources, (m) => (h(), G(d, {
366
- key: m.id,
366
+ (h(!0), T(ne, null, ve(_.resources, (u) => (h(), G(d, {
367
+ key: u.id,
367
368
  onClick: (O) => {
368
- g.value = "single", u.value = m.id, o.value = !1;
369
+ g.value = "single", m.value = u.id, o.value = !1;
369
370
  },
370
- class: ae(_.viewMode === "single" && _.activeChart === m.id ? "bg-input" : "")
371
+ class: ae(_.viewMode === "single" && _.activeChart === u.id ? "bg-input" : "")
371
372
  }, {
372
373
  default: b(() => [
373
374
  n("div", {
374
375
  class: "size-3 rounded-full",
375
- style: me({ backgroundColor: m.color || "#6b7280" })
376
+ style: me({ backgroundColor: u.color || "#6b7280" })
376
377
  }, null, 4),
377
- n("span", Rt, [
378
- n("span", Tt, z(m.name), 1),
379
- n("span", null, "(" + z((_.totals[m.id] || 0).toLocaleString()) + ")", 1)
378
+ n("span", Tt, [
379
+ n("span", Et, z(u.name), 1),
380
+ n("span", null, "(" + z((_.totals[u.id] || 0).toLocaleString()) + ")", 1)
380
381
  ])
381
382
  ]),
382
383
  _: 2
@@ -391,16 +392,16 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
391
392
  ]);
392
393
  };
393
394
  }
394
- }), It = { class: "flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6" }, Pt = { class: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3" }, zt = { class: "flex items-center gap-1" }, At = {
395
+ }), Pt = { class: "flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6" }, zt = { class: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3" }, At = { class: "flex items-center gap-1" }, jt = {
395
396
  key: 1,
396
397
  class: "flex items-center justify-center px-6 py-4 text-muted-foreground text-sm"
397
- }, jt = {
398
+ }, Nt = {
398
399
  key: 0,
399
400
  class: "flex items-center justify-center h-[250px]"
400
- }, Nt = {
401
+ }, Bt = {
401
402
  key: 1,
402
403
  class: "flex items-center justify-center h-[250px]"
403
- }, Bt = /* @__PURE__ */ ie({
404
+ }, Ot = /* @__PURE__ */ le({
404
405
  __name: "Timeline",
405
406
  props: {
406
407
  modelValue: {},
@@ -411,13 +412,13 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
411
412
  },
412
413
  emits: ["update:modelValue", "update:selectedResource", "update:viewMode"],
413
414
  setup(_, { emit: c }) {
414
- const s = _, p = c, { params: g } = ye(), { config: u } = be(), x = _e(u.project), r = N([]), o = N([]), v = N(!0), t = N(s.viewMode || "stacked"), i = N(s.selectedResource || "");
415
+ const s = _, p = c, { params: g } = ye(), { config: m } = be(), x = _e(m.project), r = N([]), o = N([]), v = N(!0), t = N(s.viewMode || "stacked"), l = N(s.selectedResource || "");
415
416
  Y(t, (a) => {
416
417
  p("update:viewMode", a);
417
- }, { immediate: !0 }), Y(i, (a) => {
418
+ }, { immediate: !0 }), Y(l, (a) => {
418
419
  p("update:selectedResource", t.value === "single" ? a : null);
419
420
  }), Y(t, (a) => {
420
- p("update:selectedResource", a === "single" ? i.value : null);
421
+ p("update:selectedResource", a === "single" ? l.value : null);
421
422
  });
422
423
  const R = /* @__PURE__ */ new Date(), D = N(s.modelValue || /* @__PURE__ */ new Date());
423
424
  Y(() => s.modelValue, (a) => {
@@ -458,17 +459,17 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
458
459
  }), a;
459
460
  });
460
461
  Y(() => s.resources, (a) => {
461
- (a?.length || 0) > 0 && !i.value && (i.value = a[0].id);
462
+ (a?.length || 0) > 0 && !l.value && (l.value = a[0].id);
462
463
  }, { immediate: !0 });
463
464
  const f = W(() => [...s.resources || []].sort((a, y) => {
464
- const V = m.value[a.id] || 0;
465
- return (m.value[y.id] || 0) - V;
465
+ const V = u.value[a.id] || 0;
466
+ return (u.value[y.id] || 0) - V;
466
467
  })), j = W(() => {
467
468
  const a = [];
468
469
  return P.value, r.value.forEach((y, V) => {
469
470
  y.time.endsWith(":00") && a.push(V);
470
471
  }), a;
471
- }), m = W(() => {
472
+ }), u = W(() => {
472
473
  const a = {};
473
474
  return s.resources?.forEach((y) => {
474
475
  a[y.id] = o.value.filter((V) => V.resourceId === y.id).reduce((V, I) => V + (I.reserved || 0), 0);
@@ -515,7 +516,7 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
515
516
  }, se = async () => {
516
517
  v.value = !0;
517
518
  try {
518
- const a = g.value.id, y = O(D.value), V = `${a}_${y}`, I = await x.get(u.reservedSpotsCollection, V);
519
+ const a = g.value.id, y = O(D.value), V = `${a}_${y}`, I = await x.get(m.reservedSpotsCollection, V);
519
520
  o.value = [];
520
521
  for (const F of s.resources || []) {
521
522
  const q = I?.[F.id] || {};
@@ -554,29 +555,29 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
554
555
  const V = w("CardTitle"), I = w("Button"), H = w("CardDescription"), ee = w("CardHeader"), K = w("ChartContainer"), F = w("CardContent"), q = w("Card");
555
556
  return h(), G(q, { class: "py-4 sm:py-0" }, {
556
557
  default: b(() => [
557
- l(ee, { class: "flex flex-col items-stretch border-b !p-0 sm:flex-row" }, {
558
+ i(ee, { class: "flex flex-col items-stretch border-b !p-0 sm:flex-row" }, {
558
559
  default: b(() => [
559
- n("div", It, [
560
- n("div", Pt, [
561
- l(V, null, {
560
+ n("div", Pt, [
561
+ n("div", zt, [
562
+ i(V, null, {
562
563
  default: b(() => [...y[2] || (y[2] = [
563
564
  X("Reservations", -1)
564
565
  ])]),
565
566
  _: 1
566
567
  }),
567
- n("div", zt, [
568
- l(I, {
568
+ n("div", At, [
569
+ i(I, {
569
570
  variant: "ghost",
570
571
  size: "icon",
571
572
  class: "size-8",
572
573
  onClick: A
573
574
  }, {
574
575
  default: b(() => [
575
- l(e(We), { size: 16 })
576
+ i(e(Ge), { size: 16 })
576
577
  ]),
577
578
  _: 1
578
579
  }),
579
- l(I, {
580
+ i(I, {
580
581
  variant: "ghost",
581
582
  size: "sm",
582
583
  class: "h-8 px-3 text-xs",
@@ -587,43 +588,43 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
587
588
  ])]),
588
589
  _: 1
589
590
  }),
590
- l(I, {
591
+ i(I, {
591
592
  variant: "ghost",
592
593
  size: "icon",
593
594
  class: "size-8",
594
595
  onClick: L
595
596
  }, {
596
597
  default: b(() => [
597
- l(e(Ge), { size: 16 })
598
+ i(e(He), { size: 16 })
598
599
  ]),
599
600
  _: 1
600
601
  })
601
602
  ])
602
603
  ]),
603
- l(H, null, {
604
+ i(H, null, {
604
605
  default: b(() => [
605
606
  X(z(e(E)), 1)
606
607
  ]),
607
608
  _: 1
608
609
  })
609
610
  ]),
610
- _.resources.length > 0 ? (h(), G(Et, {
611
+ _.resources.length > 0 ? (h(), G(It, {
611
612
  key: 0,
612
613
  resources: _.resources,
613
- totals: e(m),
614
+ totals: e(u),
614
615
  viewMode: e(t),
615
616
  "onUpdate:viewMode": y[0] || (y[0] = (k) => oe(t) ? t.value = k : null),
616
- activeChart: e(i),
617
- "onUpdate:activeChart": y[1] || (y[1] = (k) => oe(i) ? i.value = k : null)
618
- }, null, 8, ["resources", "totals", "viewMode", "activeChart"])) : (h(), T("div", At, " No resources configured "))
617
+ activeChart: e(l),
618
+ "onUpdate:activeChart": y[1] || (y[1] = (k) => oe(l) ? l.value = k : null)
619
+ }, null, 8, ["resources", "totals", "viewMode", "activeChart"])) : (h(), T("div", jt, " No resources configured "))
619
620
  ]),
620
621
  _: 1
621
622
  }),
622
- l(F, { class: "px-2 sm:p-6" }, {
623
+ i(F, { class: "px-2 sm:p-6" }, {
623
624
  default: b(() => [
624
- e(v) ? (h(), T("div", jt, [...y[4] || (y[4] = [
625
+ e(v) ? (h(), T("div", Nt, [...y[4] || (y[4] = [
625
626
  n("div", { class: "text-muted-foreground" }, "Loading...", -1)
626
- ])])) : _.resources.length === 0 ? (h(), T("div", Nt, [...y[5] || (y[5] = [
627
+ ])])) : _.resources.length === 0 ? (h(), T("div", Bt, [...y[5] || (y[5] = [
627
628
  n("div", { class: "text-muted-foreground" }, "No resources to display", -1)
628
629
  ])])) : e(t) === "stacked" ? (h(), G(K, {
629
630
  key: 2,
@@ -632,7 +633,7 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
632
633
  cursor: ""
633
634
  }, {
634
635
  default: b(() => [
635
- l(e(Me), {
636
+ i(e(Me), {
636
637
  data: e(r),
637
638
  margin: { left: -24 },
638
639
  "y-domain": [0, e(S)]
@@ -646,7 +647,7 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
646
647
  "bar-padding": 0.1,
647
648
  "rounded-corners": 2
648
649
  }, null, 8, ["x", "y", "color"]))), 128)),
649
- l(e(ue), {
650
+ i(e(ue), {
650
651
  type: "x",
651
652
  x: (k, C) => C,
652
653
  "tick-line": !1,
@@ -655,14 +656,14 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
655
656
  "tick-values": e(j),
656
657
  "tick-format": (k) => e(r)[k]?.time || ""
657
658
  }, null, 8, ["x", "tick-values", "tick-format"]),
658
- l(e(ue), {
659
+ i(e(ue), {
659
660
  type: "y",
660
661
  "num-ticks": 3,
661
662
  "tick-line": !1,
662
663
  "domain-line": !1
663
664
  }),
664
- l(e(Ve)),
665
- l(e(Re), {
665
+ i(e(Ve)),
666
+ i(e(Re), {
666
667
  template: e(we)(e(d), e($e), {
667
668
  labelFormatter(k) {
668
669
  const C = Math.round(k);
@@ -683,20 +684,20 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
683
684
  cursor: ""
684
685
  }, {
685
686
  default: b(() => [
686
- l(e(Me), {
687
+ i(e(Me), {
687
688
  data: e(r),
688
689
  margin: { left: -24 },
689
690
  "y-domain": [0, e(S)]
690
691
  }, {
691
692
  default: b(() => [
692
- l(e(Te), {
693
+ i(e(Te), {
693
694
  x: (k, C) => C,
694
- y: (k) => k[e(i)] || 0,
695
- color: (k) => k[e(i)] > 0 ? e(d)[e(i)]?.color : "hsl(var(--muted))",
695
+ y: (k) => k[e(l)] || 0,
696
+ color: (k) => k[e(l)] > 0 ? e(d)[e(l)]?.color : "hsl(var(--muted))",
696
697
  "bar-padding": 0.1,
697
698
  "rounded-corners": !1
698
699
  }, null, 8, ["x", "y", "color"]),
699
- l(e(ue), {
700
+ i(e(ue), {
700
701
  type: "x",
701
702
  x: (k, C) => C,
702
703
  "tick-line": !1,
@@ -705,14 +706,14 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
705
706
  "tick-values": e(j),
706
707
  "tick-format": (k) => e(r)[k]?.time || ""
707
708
  }, null, 8, ["x", "tick-values", "tick-format"]),
708
- l(e(ue), {
709
+ i(e(ue), {
709
710
  type: "y",
710
711
  "num-ticks": 3,
711
712
  "tick-line": !1,
712
713
  "domain-line": !1
713
714
  }),
714
- l(e(Ve)),
715
- l(e(Re), {
715
+ i(e(Ve)),
716
+ i(e(Re), {
716
717
  template: e(we)(e(d), e($e), {
717
718
  labelFormatter(k) {
718
719
  const C = Math.round(k);
@@ -735,43 +736,43 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
735
736
  });
736
737
  };
737
738
  }
738
- }), Ot = { class: "flex flex-row items-center justify-between gap-2" }, Lt = { class: "relative mb-4" }, Ft = { class: "flex gap-1 mb-4 flex-wrap" }, Wt = {
739
+ }), Lt = { class: "flex flex-row items-center justify-between gap-2" }, Ft = { class: "relative mb-4" }, Wt = { class: "flex gap-1 mb-4 flex-wrap" }, Gt = {
739
740
  key: 0,
740
741
  class: "mb-3 text-sm text-muted-foreground"
741
- }, Gt = {
742
+ }, Ht = {
742
743
  key: 1,
743
744
  class: "flex items-center justify-center py-8"
744
- }, Ht = {
745
+ }, Ut = {
745
746
  key: 2,
746
747
  class: "flex flex-col items-center gap-2 text-center py-8 text-muted-foreground"
747
- }, Ut = {
748
+ }, qt = {
748
749
  key: 3,
749
750
  class: "text-center py-8 text-muted-foreground"
750
- }, qt = {
751
+ }, Yt = {
751
752
  key: 4,
752
753
  class: "space-y-2"
753
- }, Yt = ["onClick"], Xt = { class: "flex items-start justify-between" }, Qt = { class: "flex-1" }, Jt = { class: "font-medium" }, Kt = { class: "text-sm text-muted-foreground" }, Zt = { class: "text-sm text-muted-foreground" }, es = { class: "flex items-center gap-4 flex-wrap" }, ts = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, ss = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, as = {
754
+ }, Xt = ["onClick"], Qt = { class: "flex items-start justify-between" }, Jt = { class: "flex-1" }, Kt = { class: "font-medium" }, Zt = { class: "text-sm text-muted-foreground" }, es = { class: "text-sm text-muted-foreground" }, ts = { class: "flex items-center gap-4 flex-wrap" }, ss = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, as = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, os = {
754
755
  key: 0,
755
756
  class: "flex items-center gap-1 mt-1 text-xs text-muted-foreground"
756
- }, os = { class: "text-right" }, ns = {
757
+ }, ns = { class: "text-right" }, rs = {
757
758
  key: 0,
758
759
  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"
759
- }, rs = {
760
+ }, is = {
760
761
  key: 1,
761
762
  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"
762
763
  }, ls = {
763
764
  key: 2,
764
765
  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"
765
- }, is = {
766
+ }, cs = {
766
767
  key: 3,
767
768
  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"
768
- }, cs = {
769
+ }, ds = {
769
770
  key: 4,
770
771
  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"
771
- }, ds = {
772
+ }, us = {
772
773
  key: 5,
773
774
  class: "text-sm font-medium mt-1"
774
- }, us = /* @__PURE__ */ ie({
775
+ }, ms = /* @__PURE__ */ le({
775
776
  __name: "BookingsList",
776
777
  props: {
777
778
  activeDate: {},
@@ -779,17 +780,17 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
779
780
  resources: {}
780
781
  },
781
782
  setup(_) {
782
- const c = _, { params: s } = ye(), { config: p } = be(), g = _e(p.project), u = N([]), x = N(!0), r = N(""), o = N(null), v = W(() => ({
783
+ const c = _, { params: s } = ye(), { config: p } = be(), g = _e(p.project), m = N([]), x = N(!0), r = N(""), o = N(null), v = W(() => ({
783
784
  date: t(c.activeDate),
784
785
  resource: null
785
786
  }));
786
787
  Ee("event", v);
787
788
  const t = (d) => {
788
- const f = d.getFullYear(), j = String(d.getMonth() + 1).padStart(2, "0"), m = String(d.getDate()).padStart(2, "0");
789
- return `${f}-${j}-${m}`;
790
- }, i = W(() => {
791
- let d = u.value;
792
- return c.selectedResource && (d = d.filter((f) => f.resourceId === c.selectedResource)), r.value.trim() && (d = new pt(d, {
789
+ const f = d.getFullYear(), j = String(d.getMonth() + 1).padStart(2, "0"), u = String(d.getDate()).padStart(2, "0");
790
+ return `${f}-${j}-${u}`;
791
+ }, l = W(() => {
792
+ let d = m.value;
793
+ return c.selectedResource && (d = d.filter((f) => f.resourceId === c.selectedResource)), r.value.trim() && (d = new vt(d, {
793
794
  keys: [
794
795
  "customerInfo.firstName",
795
796
  "customerInfo.lastName",
@@ -800,22 +801,22 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
800
801
  threshold: 0.3,
801
802
  ignoreLocation: !0
802
803
  }).search(r.value).map((j) => j.item)), d;
803
- }), R = W(() => i.value.filter((d) => L.value.includes(d.reservationStatus))), D = W(() => u.value.some((d) => d.reservationStatus === "approved" || d.reservationStatus === "needs_approval")), E = W(() => ({
804
- spots: u.value.reduce((d, f) => d + (f.spots || 0), 0),
805
- bookings: u.value.length
804
+ }), R = W(() => l.value.filter((d) => L.value.includes(d.reservationStatus))), D = W(() => m.value.some((d) => d.reservationStatus === "approved" || d.reservationStatus === "needs_approval")), E = W(() => ({
805
+ spots: m.value.reduce((d, f) => d + (f.spots || 0), 0),
806
+ bookings: m.value.length
806
807
  })), A = () => {
807
808
  r.value = "";
808
809
  }, L = N(["needs_approval", "approved"]), U = (d) => {
809
810
  L.value.includes(d) ? L.value = L.value.filter((f) => f !== d) : L.value.push(d);
810
811
  }, S = async () => {
811
- x.value = !0, u.value = [];
812
+ x.value = !0, m.value = [];
812
813
  try {
813
814
  const d = s.value.id, f = t(c.activeDate), j = /* @__PURE__ */ new Set();
814
815
  c.resources?.forEach(($) => {
815
816
  const Q = `${$.id}_${f}`;
816
817
  j.add(Q);
817
818
  });
818
- const m = await g.find(p.reservationsCollection, {
819
+ const u = await g.find(p.reservationsCollection, {
819
820
  filters: [
820
821
  { field: "agendaId", operator: "==", value: d },
821
822
  { field: "status", operator: "==", value: "confirmed" },
@@ -823,7 +824,7 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
823
824
  ]
824
825
  });
825
826
  let O = [];
826
- m.forEach(($) => {
827
+ u.forEach(($) => {
827
828
  ($.reservations?.filter((B) => B.date === f) || []).forEach((B) => {
828
829
  const te = c.resources.find((se) => se.id === B.resourceId);
829
830
  O.push({
@@ -851,9 +852,9 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
851
852
  resourceColor: te?.color
852
853
  });
853
854
  });
854
- }), u.value = O.sort(($, Q) => $.startTime?.localeCompare(Q.startTime || "") || 0);
855
+ }), m.value = O.sort(($, Q) => $.startTime?.localeCompare(Q.startTime || "") || 0);
855
856
  } catch (d) {
856
- console.error("Error loading orders:", d), u.value = [];
857
+ console.error("Error loading orders:", d), m.value = [];
857
858
  } finally {
858
859
  x.value = !1;
859
860
  }
@@ -861,14 +862,14 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
861
862
  return (async () => await S())(), Y(() => c.activeDate, () => {
862
863
  S();
863
864
  }), (d, f) => {
864
- const j = w("Badge"), m = w("CardTitle"), O = w("CardDescription"), $ = w("Button"), Q = w("CardHeader"), B = w("Input"), te = w("CardContent"), se = w("Card");
865
+ const j = w("Badge"), u = w("CardTitle"), O = w("CardDescription"), $ = w("Button"), Q = w("CardHeader"), B = w("Input"), te = w("CardContent"), se = w("Card");
865
866
  return h(), G(se, null, {
866
867
  default: b(() => [
867
- l(Q, null, {
868
+ i(Q, null, {
868
869
  default: b(() => [
869
- n("div", Ot, [
870
+ n("div", Lt, [
870
871
  n("div", null, [
871
- l(m, { class: "flex items-center gap-2" }, {
872
+ i(u, { class: "flex items-center gap-2" }, {
872
873
  default: b(() => [
873
874
  f[6] || (f[6] = X(" Bookings ", -1)),
874
875
  e(E).bookings > 0 ? (h(), G(j, {
@@ -883,22 +884,22 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
883
884
  ]),
884
885
  _: 1
885
886
  }),
886
- l(O, { class: "flex items-center gap-2 mt-1" }, {
887
+ i(O, { class: "flex items-center gap-2 mt-1" }, {
887
888
  default: b(() => [
888
- l(e(ke), { size: 14 }),
889
+ i(e(ke), { size: 14 }),
889
890
  n("span", null, z(e(E).spots) + " total spots", 1)
890
891
  ]),
891
892
  _: 1
892
893
  })
893
894
  ]),
894
- l($, {
895
+ i($, {
895
896
  variant: "ghost",
896
897
  size: "icon",
897
898
  onClick: S,
898
899
  disabled: e(x)
899
900
  }, {
900
901
  default: b(() => [
901
- l(e(He), {
902
+ i(e(Ue), {
902
903
  size: 16,
903
904
  class: ae({ "animate-spin": e(x) })
904
905
  }, null, 8, ["class"])
@@ -909,14 +910,14 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
909
910
  ]),
910
911
  _: 1
911
912
  }),
912
- l(te, null, {
913
+ i(te, null, {
913
914
  default: b(() => [
914
- n("div", Lt, [
915
- l(e(Ue), {
915
+ n("div", Ft, [
916
+ i(e(qe), {
916
917
  size: 16,
917
918
  class: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
918
919
  }),
919
- l(B, {
920
+ i(B, {
920
921
  modelValue: e(r),
921
922
  "onUpdate:modelValue": f[0] || (f[0] = (M) => oe(r) ? r.value = M : null),
922
923
  placeholder: "Search by name, email, or phone...",
@@ -930,12 +931,12 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
930
931
  onClick: A
931
932
  }, {
932
933
  default: b(() => [
933
- l(e(qe), { size: 14 })
934
+ i(e(Ye), { size: 14 })
934
935
  ]),
935
936
  _: 1
936
937
  })) : Z("", !0)
937
938
  ]),
938
- n("div", Ft, [
939
+ n("div", Wt, [
939
940
  n("button", {
940
941
  onClick: f[1] || (f[1] = (M) => U("needs_approval")),
941
942
  class: ae(["px-3 py-1.5 rounded-full text-sm bg-muted", { "opacity-50 hover:opacity-75": !e(L).includes("needs_approval") }])
@@ -953,10 +954,10 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
953
954
  class: ae(["px-3 py-1.5 rounded-full text-sm bg-muted", { "opacity-50 hover:opacity-75": !e(L).includes("cancelled") }])
954
955
  }, " Cancelled ", 2)
955
956
  ]),
956
- e(r) ? (h(), T("div", Wt, " Showing " + z(e(i).length) + " of " + z(e(u).length) + " bookings ", 1)) : Z("", !0),
957
- e(x) ? (h(), T("div", Gt, [...f[7] || (f[7] = [
957
+ e(r) ? (h(), T("div", Gt, " Showing " + z(e(l).length) + " of " + z(e(m).length) + " bookings ", 1)) : Z("", !0),
958
+ e(x) ? (h(), T("div", Ht, [...f[7] || (f[7] = [
958
959
  n("div", { class: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary" }, null, -1)
959
- ])])) : e(R).length === 0 ? (h(), T("div", Ht, [
960
+ ])])) : e(R).length === 0 ? (h(), T("div", Ut, [
960
961
  f[9] || (f[9] = X(" No bookings for this day ", -1)),
961
962
  e(D) ? (h(), G($, {
962
963
  key: 0,
@@ -967,27 +968,27 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
967
968
  ])]),
968
969
  _: 1
969
970
  })) : Z("", !0)
970
- ])) : e(i).length === 0 ? (h(), T("div", Ut, " No bookings match your search ")) : (h(), T("div", qt, [
971
- (h(!0), T(ne, null, ve(e(i), (M) => (h(), T("div", {
971
+ ])) : e(l).length === 0 ? (h(), T("div", qt, " No bookings match your search ")) : (h(), T("div", Yt, [
972
+ (h(!0), T(ne, null, ve(e(l), (M) => (h(), T("div", {
972
973
  key: M.res_id || M.id,
973
974
  class: "p-3 border rounded-lg hover:bg-muted/50 transition-colors cursor-pointer",
974
975
  onClick: (a) => e(o)?.openDialog(M)
975
976
  }, [
976
- n("div", Xt, [
977
- n("div", Qt, [
978
- n("div", Jt, z(M.customerInfo?.firstName) + " " + z(M.customerInfo?.lastName || "Unknown Customer"), 1),
979
- n("div", Kt, z(M.customerInfo?.email), 1),
980
- n("div", Zt, z(M.customerInfo?.phone), 1),
981
- n("div", es, [
982
- n("div", ts, [
983
- l(e(Ye), { size: 12 }),
977
+ n("div", Qt, [
978
+ n("div", Jt, [
979
+ n("div", Kt, z(M.customerInfo?.firstName) + " " + z(M.customerInfo?.lastName || "Unknown Customer"), 1),
980
+ n("div", Zt, z(M.customerInfo?.email), 1),
981
+ n("div", es, z(M.customerInfo?.phone), 1),
982
+ n("div", ts, [
983
+ n("div", ss, [
984
+ i(e(Xe), { size: 12 }),
984
985
  n("span", null, z(M.startTime) + " - " + z(M.endTime), 1)
985
986
  ]),
986
- n("div", ss, [
987
- l(e(ke), { size: 12 }),
987
+ n("div", as, [
988
+ i(e(ke), { size: 12 }),
988
989
  n("span", null, z(M.spots) + " spots", 1)
989
990
  ]),
990
- M.resourceName ? (h(), T("div", as, [
991
+ M.resourceName ? (h(), T("div", os, [
991
992
  n("div", {
992
993
  class: "w-3 h-3 rounded-full",
993
994
  style: me({ backgroundColor: M.resourceColor || "#6b7280" })
@@ -996,17 +997,17 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
996
997
  ])) : Z("", !0)
997
998
  ])
998
999
  ]),
999
- n("div", os, [
1000
- M.reservationStatus === "needs_approval" ? (h(), T("span", ns, "Needs Approval")) : M.reservationStatus === "approved" ? (h(), T("span", rs, "Approved")) : M.reservationStatus === "rejected" ? (h(), T("span", ls, "Rejected")) : M.reservationStatus === "cancelled" ? (h(), T("span", is, "Cancelled")) : (h(), T("span", cs, "Pending")),
1001
- M.reservationPrice || M.reservationPrice === 0 ? (h(), T("div", ds, " €" + z(M.reservationPrice.toFixed(2)), 1)) : Z("", !0)
1000
+ n("div", ns, [
1001
+ M.reservationStatus === "needs_approval" ? (h(), T("span", rs, "Needs Approval")) : M.reservationStatus === "approved" ? (h(), T("span", is, "Approved")) : M.reservationStatus === "rejected" ? (h(), T("span", ls, "Rejected")) : M.reservationStatus === "cancelled" ? (h(), T("span", cs, "Cancelled")) : (h(), T("span", ds, "Pending")),
1002
+ M.reservationPrice || M.reservationPrice === 0 ? (h(), T("div", us, " €" + z(M.reservationPrice.toFixed(2)), 1)) : Z("", !0)
1002
1003
  ])
1003
1004
  ])
1004
- ], 8, Yt))), 128))
1005
+ ], 8, Xt))), 128))
1005
1006
  ]))
1006
1007
  ]),
1007
1008
  _: 1
1008
1009
  }),
1009
- l(vt, {
1010
+ i(ft, {
1010
1011
  ref_key: "reservationDetailDialog",
1011
1012
  ref: o,
1012
1013
  onCancelled: S,
@@ -1018,38 +1019,38 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
1018
1019
  });
1019
1020
  };
1020
1021
  }
1021
- }), ms = { class: "space-y-6" }, ps = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, vs = { class: "text-2xl font-semibold tracking-tight" }, fs = { class: "flex flex-col md:flex-row gap-2" }, gs = { class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3" }, hs = { class: "md:col-span-2 lg:col-span-3" }, Ms = /* @__PURE__ */ ie({
1022
+ }), ps = { class: "space-y-6" }, vs = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, fs = { class: "text-2xl font-semibold tracking-tight" }, gs = { class: "flex flex-col md:flex-row gap-2" }, hs = { class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3" }, xs = { class: "md:col-span-2 lg:col-span-3" }, Vs = /* @__PURE__ */ le({
1022
1023
  __name: "index",
1023
1024
  setup(_) {
1024
- const { hasPermission: c } = Le(), { params: s, resolvePath: p } = ye(), { config: g } = be(), u = _e(g.project), x = N(""), r = N(!0), o = N(/* @__PURE__ */ new Date()), v = N(null), t = N("stacked"), i = N(null), R = N([]);
1025
+ const { hasPermission: c } = Fe(), { params: s, resolvePath: p } = ye(), { config: g } = be(), m = _e(g.project), x = N(""), r = N(!0), o = N(/* @__PURE__ */ new Date()), v = N(null), t = N("stacked"), l = N(null), R = N([]);
1025
1026
  return (async () => {
1026
1027
  try {
1027
- const E = await u.get(g.agendaCollection, s.value.id);
1028
- x.value = E?.serviceName || "", i.value = E, R.value = E?.resources?.filter((A) => A.isActive) || [];
1028
+ const E = await m.get(g.agendaCollection, s.value.id);
1029
+ x.value = E?.serviceName || "", l.value = E, R.value = E?.resources?.filter((A) => A.isActive) || [];
1029
1030
  } catch (E) {
1030
1031
  console.error("Error loading data:", E);
1031
1032
  } finally {
1032
1033
  r.value = !1;
1033
1034
  }
1034
- })(), Ee("agendaData", i), (E, A) => {
1035
+ })(), Ee("agendaData", l), (E, A) => {
1035
1036
  const L = w("Button"), U = w("NuxtLink");
1036
- return h(), G(Qe, null, {
1037
+ return h(), G(Je, null, {
1037
1038
  default: b(() => [
1038
- n("div", ms, [
1039
- n("div", ps, [
1039
+ n("div", ps, [
1040
+ n("div", vs, [
1040
1041
  n("div", null, [
1041
- n("h1", vs, z(e(x) || "Dashboard"), 1),
1042
+ n("h1", fs, z(e(x) || "Dashboard"), 1),
1042
1043
  A[3] || (A[3] = n("p", { class: "text-muted-foreground text-sm mt-1" }, " Overview and analytics for your booking service ", -1))
1043
1044
  ]),
1044
- n("div", fs, [
1045
- e(c)("manage-reservations") ? (h(), G(ft, { key: 0 })) : Z("", !0),
1046
- l(U, {
1045
+ n("div", gs, [
1046
+ e(c)("manage-reservations") ? (h(), G(gt, { key: 0 })) : Z("", !0),
1047
+ i(U, {
1047
1048
  to: e(p)(`/edit/${e(s).id}/agenda`)
1048
1049
  }, {
1049
1050
  default: b(() => [
1050
- l(L, { class: "w-full" }, {
1051
+ i(L, { class: "w-full" }, {
1051
1052
  default: b(() => [
1052
- l(e(Xe), { class: "size-4" }),
1053
+ i(e(Qe), { class: "size-4" }),
1053
1054
  A[4] || (A[4] = X(" View Agenda ", -1))
1054
1055
  ]),
1055
1056
  _: 1
@@ -1059,18 +1060,18 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
1059
1060
  }, 8, ["to"])
1060
1061
  ])
1061
1062
  ]),
1062
- l(Bt, {
1063
+ i(Ot, {
1063
1064
  modelValue: e(o),
1064
1065
  "onUpdate:modelValue": A[0] || (A[0] = (S) => oe(o) ? o.value = S : null),
1065
1066
  "view-mode": e(t),
1066
1067
  "onUpdate:viewMode": A[1] || (A[1] = (S) => oe(t) ? t.value = S : null),
1067
1068
  "onUpdate:selectedResource": A[2] || (A[2] = (S) => v.value = S),
1068
- "agenda-data": e(i),
1069
+ "agenda-data": e(l),
1069
1070
  resources: e(R)
1070
1071
  }, null, 8, ["modelValue", "view-mode", "agenda-data", "resources"]),
1071
- n("div", gs, [
1072
- n("div", hs, [
1073
- e(R).length > 0 ? (h(), G(us, {
1072
+ n("div", hs, [
1073
+ n("div", xs, [
1074
+ e(R).length > 0 ? (h(), G(ms, {
1074
1075
  key: 0,
1075
1076
  "active-date": e(o),
1076
1077
  "selected-resource": e(v),
@@ -1086,5 +1087,5 @@ const bt = { "data-vis-component": "" }, Te = /* @__PURE__ */ ie({
1086
1087
  }
1087
1088
  });
1088
1089
  export {
1089
- Ms as default
1090
+ Vs as default
1090
1091
  };