@oneclick.dev/cms-core-modules 0.0.110 → 0.0.111

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 (62) hide show
  1. package/dist/{Acquisition-Dt2rREU8.js → Acquisition-DgzDQH51.js} +1 -1
  2. package/dist/{Acquisition-DNCy8nQz.mjs → Acquisition-FV3QpaUX.mjs} +2 -2
  3. package/dist/{Audience-Bs7b0TNm.js → Audience-BSgNvcVb.js} +1 -1
  4. package/dist/{Audience-CUeMVYRy.mjs → Audience-ka0b7YPE.mjs} +2 -2
  5. package/dist/{ContentEditor-D9-1SJ5F.mjs → ContentEditor-pZPfo0qN.mjs} +4384 -4282
  6. package/dist/{ContentEditor-BprPiHMJ.js → ContentEditor-tYkh4vRV.js} +42 -42
  7. package/dist/{Create-89z41K73.js → Create--MOBOTA-.js} +1 -1
  8. package/dist/{Create-BCklc_T1.mjs → Create-BXNLRQag.mjs} +1 -1
  9. package/dist/DateFormatter-CSAbE3BC.js +1 -0
  10. package/dist/{DateFormatter-DUxlo8X8.mjs → DateFormatter-qbhRYxI_.mjs} +226 -222
  11. package/dist/{Detail-CNlljBfH.mjs → Detail-ChD5XurA.mjs} +1 -1
  12. package/dist/{Detail-C857g62L.js → Detail-RISEJJab.js} +1 -1
  13. package/dist/{Find-DIISO5GO.mjs → Find-zN_dKz4p.mjs} +1 -1
  14. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +1 -0
  15. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +1263 -0
  16. package/dist/{Overview-Di84CsR5.mjs → Overview-98nkJUWN.mjs} +162 -157
  17. package/dist/{Overview-C-Jb_BxY.mjs → Overview-BR_y8x3W.mjs} +1 -1
  18. package/dist/{Overview-DC9io1bk.js → Overview-CX-n6W7d.js} +1 -1
  19. package/dist/Overview-Dl8cMlsr.js +1 -0
  20. package/dist/{Overview-BKAti8nc.mjs → Overview-MpgkLB6m.mjs} +36 -36
  21. package/dist/{SeoHealth-az1YuNF2.js → SeoHealth-C5npw7mE.js} +1 -1
  22. package/dist/{SeoHealth-MC3lSCOY.mjs → SeoHealth-bVQj_Xgm.mjs} +29 -29
  23. package/dist/{TableView-DXHhJ-jm.mjs → TableView-Bf1fdJrD.mjs} +1838 -1822
  24. package/dist/TableView-DNcXyIMu.js +4 -0
  25. package/dist/{agenda-IOqtALWf.js → agenda-BaJu3-1c.js} +1 -1
  26. package/dist/{agenda-DcatSSYQ.mjs → agenda-BwVY_8oM.mjs} +3 -3
  27. package/dist/cms-core-modules.css +1 -1
  28. package/dist/{exceptions-CI0B4xVj.js → exceptions-B6P9UiCj.js} +1 -1
  29. package/dist/{exceptions-YCQkHa6a.mjs → exceptions-De9-FvdP.mjs} +67 -67
  30. package/dist/{index-CpzDEMeC.mjs → index-B8GvmAwh.mjs} +438 -478
  31. package/dist/{index-wjkEPsNx.mjs → index-BIF2RB7k.mjs} +1212 -1316
  32. package/dist/index-ByRsp77L.js +70 -0
  33. package/dist/{index-BhWvXMOp.mjs → index-CFzn2Lus.mjs} +5 -9
  34. package/dist/{index-BFLV54kw.mjs → index-CkVwMqpn.mjs} +1114 -1100
  35. package/dist/index-DL6orwdK.js +35 -0
  36. package/dist/index-DUlYrnXH.js +58 -0
  37. package/dist/index-DZV720u-.mjs +439 -0
  38. package/dist/index-D_nfGegA.js +184 -0
  39. package/dist/index-DtSvAFLL.js +54 -0
  40. package/dist/{index-D30apIn-.mjs → index-L54VBzwJ.mjs} +2 -3
  41. package/dist/{index-BzWmWCo5.mjs → index-hH3e-IYz.mjs} +267 -267
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.mjs +15 -15
  44. package/dist/math-BJ-oX_IM.mjs +80 -0
  45. package/dist/math-emotyaF6.js +1 -0
  46. package/dist/{resources-CYOb5Bl6.mjs → resources-DwYxn2Vi.mjs} +1 -1
  47. package/dist/src/contentManager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +1 -2
  48. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/useFocus.d.ts +1 -0
  49. package/package.json +2 -2
  50. package/dist/DateFormatter-CYAD4GBN.js +0 -1
  51. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +0 -1
  52. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +0 -1255
  53. package/dist/Overview-UoZHUMUz.js +0 -1
  54. package/dist/TableView-DQW0A1oG.js +0 -4
  55. package/dist/array-CbATeQbk.js +0 -1
  56. package/dist/array-DT5pE8Gm.mjs +0 -108
  57. package/dist/index-A2kp8Isi.js +0 -75
  58. package/dist/index-B5aBwdxY.js +0 -54
  59. package/dist/index-BiT55eU0.js +0 -58
  60. package/dist/index-G7cIlnGN.js +0 -158
  61. package/dist/index-V78huaSJ.mjs +0 -442
  62. package/dist/index-vHmvbEwa.js +0 -35
@@ -1,442 +0,0 @@
1
- import { defineComponent as pt, inject as Et, computed as Ot, ref as mt, onMounted as Tt, nextTick as zt, onUnmounted as vt, watch as lt, openBlock as bt, createElementBlock as yt, toRefs as Nt, reactive as Wt, watchEffect as Ft, provide as nt, renderSlot as Ht, toRaw as at } from "vue";
2
- import { c as Mt, b as Gt, f as it, a2 as et, a as Bt, s as At, I as $t, n as J, H as Pt, C as jt, S as It, y as dt, P as Ut, l as Yt, a7 as Xt, Z as xt, R as Rt, p as Vt, a0 as qt, a3 as Zt } from "./index-BFLV54kw.mjs";
3
- import { w as Jt, p as ct, g as U, s as M, f as C, i as gt, h as E, t as tt, k as Z, j as ot, a as ht, e as L, m as Kt, d as ft, b as Qt, c as te } from "./array-DT5pE8Gm.mjs";
4
- const ee = Object.assign(Object.assign({}, Mt), { tooltip: void 0, annotations: void 0 });
5
- class ne extends Gt {
6
- constructor(n, e, a) {
7
- var o;
8
- super(n), this._defaultConfig = ee, this.config = this._defaultConfig, e && (this.updateContainer(e, !0), this.component = e.component), a && this.setData(a, !0), !((o = this.component) === null || o === void 0) && o.datamodel.data && this.render();
9
- }
10
- setData(n, e) {
11
- var a;
12
- const { config: o } = this;
13
- this.component && this.component.setData(n), e || this.render(), (a = o.tooltip) === null || a === void 0 || a.hide();
14
- }
15
- updateContainer(n, e) {
16
- super.updateContainer(n), this._removeAllChildren(), this.component = n.component, n.sizing && (this.component.sizing = n.sizing), this.element.appendChild(this.component.element);
17
- const a = n.tooltip;
18
- a && (a.hasContainer() || a.setContainer(this._container), a.setComponents([this.component]));
19
- const o = n.annotations;
20
- o && this.element.appendChild(o.element), this.element.appendChild(this._svgDefs.node()), this.element.appendChild(this._svgDefsExternal.node()), e || this.render();
21
- }
22
- updateComponent(n, e) {
23
- this.component.setConfig(n), e || this.render();
24
- }
25
- update(n, e, a) {
26
- n && this.updateContainer(n, !0), e && this.updateComponent(e, !0), a && this.setData(a, !0), this.render();
27
- }
28
- getFitWidthScale() {
29
- const { config: n, component: e } = this, a = e;
30
- if (!a.getWidth)
31
- return 1;
32
- const o = a.getWidth() + n.margin.left + n.margin.right;
33
- return this.width / o;
34
- }
35
- _preRender() {
36
- var n, e;
37
- super._preRender(), this.component.setSize(this.width, this.height, this.containerWidth, this.containerHeight), this.component.setContainerMargin(this.config.margin), (n = this.config.annotations) === null || n === void 0 || n.setSize(this.width, this.height, this.containerWidth, this.containerHeight), (e = this.config.annotations) === null || e === void 0 || e.setContainerMargin(this.config.margin);
38
- }
39
- _render(n) {
40
- var e, a;
41
- const { config: o, component: c } = this;
42
- super._render(n), c.g.attr("transform", `translate(${o.margin.left},${o.margin.top})`), c.render(n), (e = o.annotations) === null || e === void 0 || e.render(n), o.tooltip && o.tooltip.update(), (a = o.onRenderComplete) === null || a === void 0 || a.call(o, this.svg.node(), o.margin, this.containerWidth, this.containerHeight, this.width, this.height);
43
- }
44
- // Re-defining the `render()` function to handle different sizing techniques (`Sizing.Extend` and `Sizing.FitWidth`)
45
- // Not calling `super.render()` because we don't want it to interfere with setting the SVG size here.
46
- render(n = this.config.duration) {
47
- const { config: e, component: a } = this;
48
- if (e.sizing === it.Extend || e.sizing === it.FitWidth) {
49
- const o = e.sizing === it.FitWidth, c = a, l = c.getWidth() + e.margin.left + e.margin.right, t = c.getHeight() + e.margin.top + e.margin.bottom, f = o ? this.getFitWidthScale() : 1, s = this.svg.attr("width"), i = this.svg.attr("height"), y = l * f, g = t * f, p = s || i;
50
- et(this.svg, p ? n : 0).attr("width", y).attr("height", g).attr("viewBox", `0 0 ${l} ${o ? g : t}`).attr("preserveAspectRatio", "xMinYMin");
51
- } else
52
- this.svg.attr("width", this.config.width || this.containerWidth).attr("height", this.config.height || this.containerHeight);
53
- this._resizeObserver || this._setUpResizeObserver(), cancelAnimationFrame(this._renderAnimationFrameId), this._renderAnimationFrameId = requestAnimationFrame(() => {
54
- this._preRender(), this._render(n);
55
- });
56
- }
57
- _onResize() {
58
- var n;
59
- const { config: e } = this;
60
- super._onResize(), (n = e.tooltip) === null || n === void 0 || n.hide();
61
- }
62
- destroy() {
63
- var n, e;
64
- const { component: a, config: o } = this;
65
- super.destroy(), a?.destroy(), (n = o.tooltip) === null || n === void 0 || n.destroy(), (e = o.annotations) === null || e === void 0 || e.destroy();
66
- }
67
- }
68
- function ae(u) {
69
- return u.innerRadius;
70
- }
71
- function ie(u) {
72
- return u.outerRadius;
73
- }
74
- function oe(u) {
75
- return u.startAngle;
76
- }
77
- function le(u) {
78
- return u.endAngle;
79
- }
80
- function se(u) {
81
- return u && u.padAngle;
82
- }
83
- function re(u, n, e, a, o, c, l, t) {
84
- var f = e - u, s = a - n, i = l - o, y = t - c, g = y * f - i * s;
85
- if (!(g * g < E))
86
- return g = (i * (n - c) - y * (u - o)) / g, [u + g * f, n + g * s];
87
- }
88
- function Q(u, n, e, a, o, c, l) {
89
- var t = u - e, f = n - a, s = (l ? c : -c) / Z(t * t + f * f), i = s * f, y = -s * t, g = u + i, p = n + y, b = e + i, A = a + y, d = (g + b) / 2, v = (p + A) / 2, R = b - g, _ = A - p, x = R * R + _ * _, S = o - c, w = g * A - b * p, T = (_ < 0 ? -1 : 1) * Z(Kt(0, S * S * x - w * w)), z = (w * _ - R * T) / x, F = (-w * R - _ * T) / x, N = (w * _ + R * T) / x, k = (-w * R + _ * T) / x, D = z - d, r = F - v, m = N - d, H = k - v;
90
- return D * D + r * r > m * m + H * H && (z = N, F = k), {
91
- cx: z,
92
- cy: F,
93
- x01: -i,
94
- y01: -y,
95
- x11: z * (o / S - 1),
96
- y11: F * (o / S - 1)
97
- };
98
- }
99
- function ue() {
100
- var u = ae, n = ie, e = C(0), a = null, o = oe, c = le, l = se, t = null, f = Jt(s);
101
- function s() {
102
- var i, y, g = +u.apply(this, arguments), p = +n.apply(this, arguments), b = o.apply(this, arguments) - gt, A = c.apply(this, arguments) - gt, d = ht(A - b), v = A > b;
103
- if (t || (t = i = f()), p < g && (y = p, p = g, g = y), !(p > E)) t.moveTo(0, 0);
104
- else if (d > tt - E)
105
- t.moveTo(p * U(b), p * M(b)), t.arc(0, 0, p, b, A, !v), g > E && (t.moveTo(g * U(A), g * M(A)), t.arc(0, 0, g, A, b, v));
106
- else {
107
- var R = b, _ = A, x = b, S = A, w = d, T = d, z = l.apply(this, arguments) / 2, F = z > E && (a ? +a.apply(this, arguments) : Z(g * g + p * p)), N = ot(ht(p - g) / 2, +e.apply(this, arguments)), k = N, D = N, r, m;
108
- if (F > E) {
109
- var H = ft(F / g * M(z)), $ = ft(F / p * M(z));
110
- (w -= H * 2) > E ? (H *= v ? 1 : -1, x += H, S -= H) : (w = 0, x = S = (b + A) / 2), (T -= $ * 2) > E ? ($ *= v ? 1 : -1, R += $, _ -= $) : (T = 0, R = _ = (b + A) / 2);
111
- }
112
- var G = p * U(R), P = p * M(R), Y = g * U(S), B = g * M(S);
113
- if (N > E) {
114
- var X = p * U(_), j = p * M(_), V = g * U(x), K = g * M(x), W;
115
- if (d < ct)
116
- if (W = re(G, P, V, K, X, j, Y, B)) {
117
- var q = G - W[0], h = P - W[1], O = X - W[0], I = j - W[1], rt = 1 / M(Qt((q * O + h * I) / (Z(q * q + h * h) * Z(O * O + I * I))) / 2), ut = Z(W[0] * W[0] + W[1] * W[1]);
118
- k = ot(N, (g - ut) / (rt - 1)), D = ot(N, (p - ut) / (rt + 1));
119
- } else
120
- k = D = 0;
121
- }
122
- T > E ? D > E ? (r = Q(V, K, G, P, p, D, v), m = Q(X, j, Y, B, p, D, v), t.moveTo(r.cx + r.x01, r.cy + r.y01), D < N ? t.arc(r.cx, r.cy, D, L(r.y01, r.x01), L(m.y01, m.x01), !v) : (t.arc(r.cx, r.cy, D, L(r.y01, r.x01), L(r.y11, r.x11), !v), t.arc(0, 0, p, L(r.cy + r.y11, r.cx + r.x11), L(m.cy + m.y11, m.cx + m.x11), !v), t.arc(m.cx, m.cy, D, L(m.y11, m.x11), L(m.y01, m.x01), !v))) : (t.moveTo(G, P), t.arc(0, 0, p, R, _, !v)) : t.moveTo(G, P), !(g > E) || !(w > E) ? t.lineTo(Y, B) : k > E ? (r = Q(Y, B, X, j, g, -k, v), m = Q(G, P, V, K, g, -k, v), t.lineTo(r.cx + r.x01, r.cy + r.y01), k < N ? t.arc(r.cx, r.cy, k, L(r.y01, r.x01), L(m.y01, m.x01), !v) : (t.arc(r.cx, r.cy, k, L(r.y01, r.x01), L(r.y11, r.x11), !v), t.arc(0, 0, g, L(r.cy + r.y11, r.cx + r.x11), L(m.cy + m.y11, m.cx + m.x11), v), t.arc(m.cx, m.cy, k, L(m.y11, m.x11), L(m.y01, m.x01), !v))) : t.arc(0, 0, g, S, x, v);
123
- }
124
- if (t.closePath(), i) return t = null, i + "" || null;
125
- }
126
- return s.centroid = function() {
127
- var i = (+u.apply(this, arguments) + +n.apply(this, arguments)) / 2, y = (+o.apply(this, arguments) + +c.apply(this, arguments)) / 2 - ct / 2;
128
- return [U(y) * i, M(y) * i];
129
- }, s.innerRadius = function(i) {
130
- return arguments.length ? (u = typeof i == "function" ? i : C(+i), s) : u;
131
- }, s.outerRadius = function(i) {
132
- return arguments.length ? (n = typeof i == "function" ? i : C(+i), s) : n;
133
- }, s.cornerRadius = function(i) {
134
- return arguments.length ? (e = typeof i == "function" ? i : C(+i), s) : e;
135
- }, s.padRadius = function(i) {
136
- return arguments.length ? (a = i == null ? null : typeof i == "function" ? i : C(+i), s) : a;
137
- }, s.startAngle = function(i) {
138
- return arguments.length ? (o = typeof i == "function" ? i : C(+i), s) : o;
139
- }, s.endAngle = function(i) {
140
- return arguments.length ? (c = typeof i == "function" ? i : C(+i), s) : c;
141
- }, s.padAngle = function(i) {
142
- return arguments.length ? (l = typeof i == "function" ? i : C(+i), s) : l;
143
- }, s.context = function(i) {
144
- return arguments.length ? (t = i ?? null, s) : t;
145
- }, s;
146
- }
147
- function de(u, n) {
148
- return n < u ? -1 : n > u ? 1 : n >= u ? 0 : NaN;
149
- }
150
- function ce(u) {
151
- return u;
152
- }
153
- function ge() {
154
- var u = ce, n = de, e = null, a = C(0), o = C(tt), c = C(0);
155
- function l(t) {
156
- var f, s = (t = te(t)).length, i, y, g = 0, p = new Array(s), b = new Array(s), A = +a.apply(this, arguments), d = Math.min(tt, Math.max(-tt, o.apply(this, arguments) - A)), v, R = Math.min(Math.abs(d) / s, c.apply(this, arguments)), _ = R * (d < 0 ? -1 : 1), x;
157
- for (f = 0; f < s; ++f)
158
- (x = b[p[f] = f] = +u(t[f], f, t)) > 0 && (g += x);
159
- for (n != null ? p.sort(function(S, w) {
160
- return n(b[S], b[w]);
161
- }) : e != null && p.sort(function(S, w) {
162
- return e(t[S], t[w]);
163
- }), f = 0, y = g ? (d - s * _) / g : 0; f < s; ++f, A = v)
164
- i = p[f], x = b[i], v = A + (x > 0 ? x * y : 0) + _, b[i] = {
165
- data: t[i],
166
- index: f,
167
- value: x,
168
- startAngle: A,
169
- endAngle: v,
170
- padAngle: R
171
- };
172
- return b;
173
- }
174
- return l.value = function(t) {
175
- return arguments.length ? (u = typeof t == "function" ? t : C(+t), l) : u;
176
- }, l.sortValues = function(t) {
177
- return arguments.length ? (n = t, e = null, l) : n;
178
- }, l.sort = function(t) {
179
- return arguments.length ? (e = t, n = null, l) : e;
180
- }, l.startAngle = function(t) {
181
- return arguments.length ? (a = typeof t == "function" ? t : C(+t), l) : a;
182
- }, l.endAngle = function(t) {
183
- return arguments.length ? (o = typeof t == "function" ? t : C(+t), l) : o;
184
- }, l.padAngle = function(t) {
185
- return arguments.length ? (c = typeof t == "function" ? t : C(+t), l) : c;
186
- }, l;
187
- }
188
- const he = Object.assign(Object.assign({}, Bt), { id: (u, n) => {
189
- var e;
190
- return (e = u.id) !== null && e !== void 0 ? e : n;
191
- }, value: void 0, angleRange: [0, 2 * Math.PI], padAngle: 0, sortFunction: void 0, cornerRadius: 0, color: void 0, radius: void 0, arcWidth: 20, centralLabel: void 0, centralSubLabel: void 0, centralSubLabelWrap: !0, showEmptySegments: !1, emptySegmentAngle: 0.5 * Math.PI / 180, showBackground: !0, backgroundAngleRange: void 0, centralLabelOffsetX: void 0, centralLabelOffsetY: void 0 });
192
- function fe(u, n) {
193
- u.style("fill", (e) => At(e.data, n.color, e.index)).style("opacity", 0).each((e, a, o) => {
194
- const c = o[a], l = (e.startAngle + e.endAngle) / 2, t = (e.endAngle - e.startAngle) / 2;
195
- c._animState = {
196
- startAngle: l - t,
197
- endAngle: l + t,
198
- innerRadius: e.innerRadius,
199
- outerRadius: e.outerRadius,
200
- padAngle: e.padAngle
201
- };
202
- });
203
- }
204
- function pe(u, n, e, a) {
205
- u.style("transition", `fill ${a}ms`).style("fill", (c) => At(c.data, n.color, c.index));
206
- const o = (c) => n.showEmptySegments || c.value ? 1 : 0;
207
- a ? et(u, a).style("opacity", o).attrTween("d", (l, t, f) => {
208
- const s = f[t], i = {
209
- startAngle: l.startAngle,
210
- endAngle: l.endAngle,
211
- innerRadius: l.innerRadius,
212
- outerRadius: l.outerRadius,
213
- padAngle: l.padAngle
214
- }, y = $t(s._animState, i);
215
- return (g) => (s._animState = y(g), e(s._animState));
216
- }) : u.attr("d", e).style("opacity", o);
217
- }
218
- function me(u, n) {
219
- et(u, n).style("opacity", 0).remove();
220
- }
221
- const _t = Array.from({ length: 4 }, (u, n) => {
222
- const e = -Math.PI / 2 + n * Math.PI / 2;
223
- return [e, e + Math.PI];
224
- }), [_e, Se, we, Le] = _t, St = J`
225
- label: donut-component;
226
- `, ve = Pt`
227
- :root {
228
- --vis-donut-central-label-font-size: 16px;
229
- --vis-donut-central-label-text-color: #5b5f6d;
230
- // Undefined by default to allow proper fallback to var(--vis-font-family)
231
- /* --vis-donut-central-label-font-family: */
232
- --vis-donut-central-label-font-weight: 600;
233
-
234
- --vis-donut-central-sub-label-font-size: 12px;
235
- --vis-donut-central-sub-label-text-color: #5b5f6d;
236
- // Undefined by default to allow proper fallback to var(--vis-font-family)
237
- /* --vis-donut-central-sub-label-font-family: */
238
- --vis-donut-central-sub-label-font-weight: 500;
239
-
240
- --vis-donut-background-color: #E7E9F3;
241
- --vis-donut-segment-stroke-width: 0;
242
- // The line segment color variable is not defined by default
243
- // to allow it to fallback to the donut background color
244
- /* --vis-donut-segment-stroke-color: none; */
245
-
246
- --vis-dark-donut-central-label-text-color: #C2BECE;
247
- --vis-dark-donut-central-sub-label-text-color: #C2BECE;
248
- --vis-dark-donut-background-color: #18160C;
249
- }
250
-
251
- body.theme-dark ${`.${St}`} {
252
- --vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
253
- --vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
254
- --vis-donut-background-color: var(--vis-dark-donut-background-color);
255
- }
256
- `, wt = J`
257
- label: background;
258
- fill: var(--vis-donut-background-color);
259
- `, st = J`
260
- label: segment;
261
- stroke-width: var(--vis-donut-segment-stroke-width);
262
- stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
263
- `, Lt = J`
264
- label: segment-exit;
265
- `, Ct = J`
266
- label: central-label;
267
- text-anchor: middle;
268
- dominant-baseline: middle;
269
- font-size: var(--vis-donut-central-label-font-size);
270
- font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
271
- font-weight: var(--vis-donut-central-label-font-weight);
272
- fill: var(--vis-donut-central-label-text-color);
273
- `, kt = J`
274
- label: central-label;
275
- text-anchor: middle;
276
- dominant-baseline: middle;
277
- font-size: var(--vis-donut-central-sub-label-font-size);
278
- font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
279
- font-weight: var(--vis-donut-central-sub-label-font-weight);
280
- fill: var(--vis-donut-central-sub-label-text-color);
281
- `, be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
282
- __proto__: null,
283
- background: wt,
284
- centralLabel: Ct,
285
- centralSubLabel: kt,
286
- root: St,
287
- segment: st,
288
- segmentExit: Lt,
289
- variables: ve
290
- }, Symbol.toStringTag, { value: "Module" }));
291
- class Dt extends jt {
292
- constructor(n) {
293
- super(), this._defaultConfig = he, this.config = this._defaultConfig, this.datamodel = new It(), this.arcGen = ue(), this.events = {}, n && this.setConfig(n), this.arcBackground = this.g.append("path"), this.arcGroup = this.g.append("g"), this.centralLabel = this.g.append("text").attr("class", Ct), this.centralSubLabel = this.g.append("text").attr("class", kt);
294
- }
295
- get bleed() {
296
- return { top: 0, bottom: 0, left: 0, right: 0 };
297
- }
298
- _render(n) {
299
- var e, a, o, c, l, t, f, s, i, y, g, p, b, A;
300
- const { config: d, datamodel: v, bleed: R } = this, _ = v.data.map((h, O) => ({
301
- index: O,
302
- datum: h
303
- })).filter((h) => d.showEmptySegments || dt(h.datum, d.value, h.index)), x = Ut(n) ? n : d.duration, [S, w, T, z] = _t.map((h) => d.angleRange && d.angleRange[0] === h[0] && d.angleRange[1] === h[1]), F = S || T, N = w || z, k = this._width * (N ? 2 : 1), D = this._height * (F ? 2 : 1), r = d.radius || Math.min(k - R.left - R.right, D - R.top - R.bottom) / 2, m = d.arcWidth === 0 ? 0 : Yt(r - d.arcWidth, 0, r - 1), H = this._height / 2 + (S ? r / 2 : T ? -r / 2 : 0), $ = this._width / 2 + (z ? r / 2 : w ? -r / 2 : 0), G = `translate(${$},${H})`;
304
- this.arcGroup.attr("transform", G), this.arcGen.startAngle((h) => h.startAngle).endAngle((h) => h.endAngle).innerRadius((h) => h.innerRadius).outerRadius((h) => h.outerRadius).padAngle((h) => h.padAngle).cornerRadius(d.cornerRadius);
305
- const Y = ge().startAngle((a = (e = d.angleRange) === null || e === void 0 ? void 0 : e[0]) !== null && a !== void 0 ? a : 0).endAngle((c = (o = d.angleRange) === null || o === void 0 ? void 0 : o[1]) !== null && c !== void 0 ? c : 2 * Math.PI).padAngle(d.padAngle).value((h) => dt(h.datum, d.value, h.index) || 0).sort((h, O) => {
306
- var I;
307
- return (I = d.sortFunction) === null || I === void 0 ? void 0 : I.call(d, h.datum, O.datum);
308
- })(_).map((h) => {
309
- const O = Object.assign(Object.assign({}, h), {
310
- data: h.data.datum,
311
- index: h.data.index,
312
- innerRadius: m,
313
- outerRadius: r
314
- });
315
- return d.showEmptySegments && h.endAngle - h.startAngle - h.padAngle <= Number.EPSILON && (O.endAngle = h.startAngle + Math.max(d.emptySegmentAngle, d.padAngle), O.padAngle = h.padAngle / 2), O;
316
- }), B = this.arcGroup.selectAll(`.${st}`).data(Y, (h) => d.id(h.data, h.index)), X = B.enter().append("path").attr("class", st).call(fe, d), j = B.merge(X);
317
- j.call(pe, d, this.arcGen, x), j.sort((h, O) => O.value - h.value), B.exit().attr("class", Lt).call(me, x);
318
- const V = w ? "start" : z ? "end" : "middle";
319
- this.centralLabel.attr("dy", d.centralSubLabel ? "-0.55em" : null).style("text-anchor", V).text((l = d.centralLabel) !== null && l !== void 0 ? l : null), this.centralSubLabel.attr("dy", d.centralLabel ? "0.55em" : null).style("text-anchor", V).text((t = d.centralSubLabel) !== null && t !== void 0 ? t : null), d.centralSubLabelWrap && Xt(this.centralSubLabel, m * 1.9);
320
- const K = (d.centralLabelOffsetX || 0) + $;
321
- let W = (d.centralLabelOffsetY || 0) + H;
322
- F && d.centralLabelOffsetX === void 0 && d.centralLabelOffsetY === void 0 && (W = (S ? -this.centralSubLabel.node().getBoundingClientRect().height : T ? this.centralLabel.node().getBoundingClientRect().height : 0) + H);
323
- const q = `translate(${K},${W})`;
324
- this.centralLabel.attr("transform", q), this.centralSubLabel.attr("transform", q), this.arcBackground.attr("class", wt).attr("visibility", d.showBackground ? null : "hidden").attr("transform", G), et(this.arcBackground, x).attr("d", this.arcGen({
325
- startAngle: (y = (s = (f = d.backgroundAngleRange) === null || f === void 0 ? void 0 : f[0]) !== null && s !== void 0 ? s : (i = d.angleRange) === null || i === void 0 ? void 0 : i[0]) !== null && y !== void 0 ? y : 0,
326
- endAngle: (A = (p = (g = d.backgroundAngleRange) === null || g === void 0 ? void 0 : g[1]) !== null && p !== void 0 ? p : (b = d.angleRange) === null || b === void 0 ? void 0 : b[1]) !== null && A !== void 0 ? A : 2 * Math.PI,
327
- innerRadius: m,
328
- outerRadius: r
329
- }));
330
- }
331
- }
332
- Dt.selectors = be;
333
- const ye = { "data-vis-component": "" }, Ce = /* @__PURE__ */ pt({
334
- __name: "index",
335
- props: {
336
- id: { type: Function },
337
- value: { type: [Function, Number, null] },
338
- angleRange: {},
339
- padAngle: {},
340
- sortFunction: { type: Function },
341
- cornerRadius: {},
342
- color: { type: [Function, String, Array, null] },
343
- radius: {},
344
- arcWidth: {},
345
- centralLabel: {},
346
- centralSubLabel: {},
347
- centralSubLabelWrap: { type: Boolean },
348
- showEmptySegments: { type: Boolean },
349
- emptySegmentAngle: {},
350
- showBackground: { type: Boolean },
351
- backgroundAngleRange: {},
352
- centralLabelOffsetX: {},
353
- centralLabelOffsetY: {},
354
- duration: {},
355
- events: {},
356
- attributes: {},
357
- data: {}
358
- },
359
- setup(u, { expose: n }) {
360
- const e = Et(xt), a = u, o = Ot(() => e.data.value ?? a.data), c = Rt(a), l = mt();
361
- return Tt(() => {
362
- zt(() => {
363
- var t;
364
- l.value = new Dt(c.value), (t = l.value) == null || t.setData(o.value), e.update(l.value);
365
- });
366
- }), vt(() => {
367
- var t;
368
- (t = l.value) == null || t.destroy(), e.destroy();
369
- }), lt(c, (t, f) => {
370
- var s;
371
- Vt(t, f) || (s = l.value) == null || s.setConfig(c.value);
372
- }), lt(o, () => {
373
- var t;
374
- (t = l.value) == null || t.setData(o.value);
375
- }), n({
376
- component: l
377
- }), (t, f) => (bt(), yt("div", ye));
378
- }
379
- }), ke = /* @__PURE__ */ pt({
380
- __name: "index",
381
- props: {
382
- component: {},
383
- tooltip: {},
384
- annotations: {},
385
- onRenderComplete: { type: Function },
386
- duration: {},
387
- margin: {},
388
- padding: {},
389
- sizing: {},
390
- width: {},
391
- height: {},
392
- svgDefs: {},
393
- ariaLabel: {},
394
- data: {}
395
- },
396
- setup(u, { expose: n }) {
397
- const e = u, { data: a } = Nt(e), o = Rt(e);
398
- let c;
399
- const l = Wt({
400
- component: void 0,
401
- tooltip: void 0,
402
- annotations: void 0
403
- }), t = mt(), f = () => {
404
- c || t.value && l.component && (c = new ne(t.value, { ...at(l) }, a.value));
405
- };
406
- return Ft(() => {
407
- var s;
408
- f(), (s = l.component) == null || s.config, c?.updateContainer({ ...at(o.value), ...at(l) });
409
- }), lt(a, () => {
410
- c ? c.setData(a.value, !0) : f();
411
- }), vt(() => c?.destroy()), nt(xt, {
412
- data: a,
413
- update: (s) => l.component = s,
414
- destroy: () => l.component = void 0
415
- }), nt(qt, {
416
- data: a,
417
- update: (s) => l.tooltip = s,
418
- destroy: () => {
419
- l.tooltip = void 0;
420
- }
421
- }), nt(Zt, {
422
- data: a,
423
- update: (s) => l.annotations = s,
424
- destroy: () => {
425
- l.annotations = void 0;
426
- }
427
- }), n({
428
- component: c
429
- }), (s, i) => (bt(), yt("div", {
430
- "data-vis-single-container": "",
431
- ref_key: "elRef",
432
- ref: t,
433
- class: "unovis-single-container"
434
- }, [
435
- Ht(s.$slots, "default")
436
- ], 512));
437
- }
438
- });
439
- export {
440
- Ce as E,
441
- ke as S
442
- };
@@ -1,35 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),G=require("@oneclick.dev/cms-kit"),le=require("./EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js"),C=require("./index-B5aBwdxY.js"),Q=require("@oneclick.dev/cms-kit/charts"),F=require("lucide-vue-next"),ie=require("./index-CxETuRsG.js"),M=require("./index-G7cIlnGN.js"),ce=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ee=require("./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js"),de=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js"),ue=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js");function me({x:p,y:f,w:o,h:g,tl:v=!1,tr:h=!1,bl:x=!1,br:i=!1,r=0}){let l;l=`M${p+r},${f}h${o-2*r}`;let n=h?r:0,c=h?0:r;return l+=`a${n},${n} 0 0 1 ${n},${n}`,l+=`h${c}v${c}`,l+=`v${g-2*r}`,n=i?r:0,c=i?0:r,l+=`a${n},${n} 0 0 1 ${-n},${n}`,l+=`v${c}h${-c}`,l+=`h${2*r-o}`,n=x?r:0,c=x?0:r,l+=`a${n},${n} 0 0 1 ${-n},${-n}`,l+=`h${-c}v${-c}`,l+=`v${2*r-g}`,n=v?r:0,c=v?0:r,l+=`a${n},${n} 0 0 1 ${n},${-n}`,l+=`v${-c}h${c}`,l+="z",l}const pe=Object.assign(Object.assign({},M.XYComponentDefaultConfig),{color:void 0,groupMaxWidth:void 0,groupWidth:void 0,dataStep:void 0,groupPadding:.05,barPadding:0,roundedCorners:2,barMinHeight:2,cursor:null,orientation:M.Orientation.Vertical}),ae=C.css`
2
- label: grouped-bar-component;
3
- `,fe=C.injectGlobal`
4
- :root {
5
- --vis-grouped-bar-cursor: default;
6
- --vis-grouped-bar-fill-color: var(--vis-color-main);
7
- --vis-grouped-bar-stroke-color: none;
8
- --vis-grouped-bar-stroke-width: 0px;
9
- --vis-grouped-bar-hover-stroke-width: 1px;
10
- --vis-grouped-bar-hover-stroke-color: none;
11
-
12
-
13
- /* Dark Theme */
14
- --vis-dark-grouped-bar-stroke-color: none;
15
- }
16
-
17
- body.theme-dark ${`.${ae}`} {
18
- --vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);
19
- }
20
- `,Z=C.css`
21
- label: bar;
22
- fill: var(--vis-grouped-bar-fill-color);
23
- stroke: var(--vis-grouped-bar-stroke-color);
24
- stroke-width: var(--vis-grouped-bar-stroke-width);
25
- cursor: var(--vis-grouped-bar-cursor);
26
-
27
- &:hover {
28
- stroke-width: var(--vis-grouped-bar-hover-stroke-width);
29
- stroke: var(--vis-grouped-bar-hover-stroke-color);
30
- }
31
- `,te=C.css`
32
- label: barGroup;
33
- `,re=C.css`
34
- label: barGroupExit;
35
- `,ge=Object.freeze(Object.defineProperty({__proto__:null,bar:Z,barGroup:te,barGroupExit:re,globalStyles:fe,root:ae},Symbol.toStringTag,{value:"Module"}));class se extends M.XYComponentCore{constructor(f){super(),this._defaultConfig=pe,this.config=this._defaultConfig,this.getAccessors=()=>C.isArray(this.config.y)?this.config.y:[this.config.y],this.events={},this._barData=[],f&&this.setConfig(f)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};const f=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],o=this.dataScale.domain(),g=this._getGroupWidth()/2,v=this._barData.map((k,S)=>C.getNumber(k,this.config.x,S)),h=C.min(v),x=C.max(v),i=this.dataScale(h),r=this.dataScale(x),l=this.dataScale.invert(i+(f?g:-g)),n=this.dataScale.invert(r+(f?-g:g)),c=l<=o[0]?this.dataScale(o[0])-this.dataScale(l):0,N=n>o[1]?this.dataScale(n)-this.dataScale(o[1]):0;return{top:this.isVertical()?0:f?-N:c,bottom:this.isVertical()?0:f?-c:N,left:this.isVertical()?c:0,right:this.isVertical()?N:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===M.Orientation.Vertical}_render(f){const{config:o}=this,g=C.isNumber(f)?f:o.duration,v=this._getGroupWidth(),h=this.getAccessors(),x=[-v/2,v/2],i=M.band().domain(M.range(h.length)).range(x).paddingInner(o.barPadding).paddingOuter(o.barPadding),r=this.g.selectAll(`.${te}`).data(this._barData,(B,$)=>{var _;return`${(_=C.getString(B,o.id,$))!==null&&_!==void 0?_:$}`}),l=(B,$)=>{const _=this.dataScale(C.getNumber(B,o.x,$)),A=this.isVertical()?_:0,I=this.isVertical()?0:_;return`translate(${A},${I})`},c=r.enter().append("g").attr("class",te).attr("transform",l).style("opacity",1).merge(r);C.smartTransition(c,g).attr("transform",l).style("opacity",1);const N=r.exit().attr("class",re);C.smartTransition(N,g).style("opacity",0).remove(),C.smartTransition(N.selectAll(`.${Z}`),g).attr("transform",(B,$,_)=>this.isVertical()?`translate(0,${this.yScale(0)}) scale(1,0)`:`translate(${this.xScale(0)},0) scale(0,1)`);const k=i.bandwidth(),S=c.selectAll(`.${Z}`).data(B=>h.map(()=>B)),w=this._getValueAxisDirection(),X=S.enter().append("path").attr("class",Z).attr("d",(B,$)=>{const _=i($),A=this.valueScale(0),I=k;return this._getBarPath(_,A,I,0,!1,w)}).style("fill",(B,$)=>C.getColor(B,o.color,$)).merge(S);C.smartTransition(X,g).attr("d",(B,$)=>{const _=i($),A=k,I=C.getNumber(B,h[$]),m=I<0;let P=m?this.valueScale(0):this.valueScale(I||0),Y=Math.abs(this.valueScale(0)-this.valueScale(I))||0;if(Y<o.barMinHeight){const L=w===M.Direction.North?-1:1;P=this.valueScale(0)+L*o.barMinHeight,Y=o.barMinHeight}return this._getBarPath(_,P,A,Y,m,w)}).style("fill",(B,$)=>C.getColor(B,o.color,$)).style("cursor",(B,$)=>C.getString(B,o.cursor,$)),C.smartTransition(S.exit(),g).remove()}_getValueAxisDirection(){return this.valueScale.range()[0]>this.valueScale.range()[1]?M.Direction.North:M.Direction.South}_getVisibleData(){const{config:f,datamodel:{data:o}}=this,g=this._getGroupWidth(),v=o.length<2?0:g/2,h=this.dataScale,x=Math.abs(h.invert(v)-h.invert(0));return o?.filter((r,l)=>{const n=C.getNumber(r,f.x,l),c=h.domain(),N=+c[0],k=+c[1];return n>=N-x&&n<=k+x})}_getBarPath(f,o,g,v,h,x){const{config:i}=this,r=i.roundedCorners?C.isNumber(i.roundedCorners)?+i.roundedCorners:g/2:0,l=C.clamp(r,0,Math.min(v,g)/2),n=x===M.Direction.North,c=this.isVertical()&&h!==n,N=this.isVertical()&&h===n,k=!this.isVertical()&&h,S=!this.isVertical()&&!h;return me({x:this.isVertical()?f:o+(n?0:-v),y:this.isVertical()?o+(n?0:-v):f,w:this.isVertical()?g:v,h:this.isVertical()?v:g,tl:c||k,tr:c||S,bl:N||k,br:N||S,r:l})}_getGroupWidth(){const{config:f,datamodel:{data:o}}=this;if(C.isEmpty(o))return 0;if(f.groupWidth)return C.min([f.groupWidth,f.groupMaxWidth]);const g=this.dataScale.bandwidth,v=this.dataScale.domain?this.dataScale.domain():[];let x=1+(g?v.length:v[1]-v[0])/f.dataStep||!g&&o.filter((l,n)=>{const c=C.getNumber(l,f.x,n);return c>=v[0]&&c<=v[1]}).length||o.length;!g&&x>=2&&(x+=1);const r=(x<2?1:1-f.groupPadding)*(this.isVertical()?this._width:this._height)/x;return C.min([r,f.groupMaxWidth])}getValueScaleExtent(f){const{datamodel:o}=this,g=this.getAccessors(),v=f?this._getVisibleData():o.data,h=C.getMin(v,...g),x=C.getMax(v,...g);return[h>0?0:h,x<0?0:x]}getDataScaleExtent(){const{config:f,datamodel:o}=this;return C.getExtent(o.data,f.x)}getYDataExtent(f){return this.isVertical()?this.getValueScaleExtent(f):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}}se.selectors=ge;const ve={"data-vis-component":""},oe=e.defineComponent({__name:"index",props:{color:{type:[Function,String,Array,null]},groupWidth:{},groupMaxWidth:{},dataStep:{},groupPadding:{},barPadding:{},roundedCorners:{type:[Number,Boolean]},barMinHeight:{},cursor:{type:[Function,String,null]},orientation:{},x:{type:[Function,Number,null]},y:{type:[Function,Number,null,Array]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(p,{expose:f}){const o=e.inject(C.o),g=p,v=e.computed(()=>o.data.value??g.data),h=C.m(g),x=e.ref();return e.onMounted(()=>{e.nextTick(()=>{var i;x.value=new se(h.value),(i=x.value)==null||i.setData(v.value),o.update(x.value)})}),e.onUnmounted(()=>{var i;(i=x.value)==null||i.destroy(),o.destroy()}),e.watch(h,(i,r)=>{var l;C.f(i,r)||(l=x.value)==null||l.setConfig(h.value)}),e.watch(v,()=>{var i;(i=x.value)==null||i.setData(v.value)}),f({component:x}),(i,r)=>(e.openBlock(),e.createElementBlock("div",ve))}}),he={class:"flex flex-col sm:flex-row"},xe=["data-active"],ye={class:"flex items-center gap-2"},ke={class:"block text-muted-foreground text-xs mr-2 max-w-[120px] truncate"},Ce={class:"block text-lg leading-none font-bold sm:text-3xl"},be={class:"mx-auto w-full max-w-sm mt-2 mb-8"},Ve={class:"text-muted-foreground"},we={class:"text-muted-foreground"},_e={class:"grid"},De={class:"flex gap-1 overflow-hidden max-w-80"},Ne={class:"truncate"},Se=e.defineComponent({__name:"ResourceSelector",props:{resources:{type:Array,required:!0},totals:{type:Object,required:!0},viewMode:{type:String,required:!0},activeChart:{type:String,required:!1}},emits:["update:viewMode","update:activeChart"],setup(p,{emit:f}){const o=p,g=f,v=e.computed({get:()=>o.viewMode,set:l=>{g("update:viewMode",l)}}),h=e.computed({get:()=>o.activeChart,set:l=>{g("update:activeChart",l)}}),{width:x}=ie.useWindowSize(),i=e.computed(()=>x.value<640),r=e.ref(!1);return(l,n)=>{const c=e.resolveComponent("DrawerTitle"),N=e.resolveComponent("DrawerDescription"),k=e.resolveComponent("DrawerHeader"),S=e.resolveComponent("Button"),w=e.resolveComponent("DrawerFooter"),j=e.resolveComponent("DrawerContent"),X=e.resolveComponent("Drawer"),B=e.resolveComponent("DropdownMenuTrigger"),$=e.resolveComponent("DropdownMenuLabel"),_=e.resolveComponent("DropdownMenuItem"),A=e.resolveComponent("DropdownMenuContent"),I=e.resolveComponent("DropdownMenu");return e.openBlock(),e.createElementBlock("div",he,[p.resources.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,"data-active":p.viewMode==="stacked",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",onClick:n[0]||(n[0]=m=>r.value=!0),onContextmenu:n[1]||(n[1]=e.withModifiers(m=>r.value=!0,["prevent"]))},[e.createElementVNode("div",ye,[p.viewMode==="stacked"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),n[6]||(n[6]=e.createElementVNode("span",{class:"block text-muted-foreground text-xs mr-2 max-w-[120px] truncate"},"All Resources",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"size-3 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:p.resources.find(m=>m.id===p.activeChart)?.color||"#6b7280"})},null,4),e.createElementVNode("span",ke,e.toDisplayString(p.resources.find(m=>m.id===p.activeChart)?.name||"Select Resource"),1)],64)),e.createVNode(e.unref(F.ChevronDown),{class:"ml-auto size-4"})]),e.createElementVNode("span",Ce,e.toDisplayString(p.viewMode==="stacked"?Object.values(p.totals).reduce((m,P)=>m+P,0).toLocaleString():(p.totals[p.activeChart]||0).toLocaleString()),1)],40,xe)):e.createCommentVNode("",!0),e.unref(i)?(e.openBlock(),e.createBlock(X,{key:1,open:e.unref(r),"onUpdate:open":n[3]||(n[3]=m=>e.isRef(r)?r.value=m:null)},{default:e.withCtx(()=>[e.createVNode(j,null,{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createVNode(k,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[...n[7]||(n[7]=[e.createTextVNode("Resources",-1)])]),_:1}),e.createVNode(N,null,{default:e.withCtx(()=>[...n[8]||(n[8]=[e.createTextVNode("Select the resources to display on the timeline.",-1)])]),_:1})]),_:1}),e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(S,{onClick:n[2]||(n[2]=m=>{v.value="stacked",h.value="",r.value=!1}),variant:p.viewMode==="stacked"?"secondary":"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),e.createElementVNode("span",Ve," All Resources ("+e.toDisplayString(Object.values(p.totals).reduce((m,P)=>m+P,0).toLocaleString())+") ",1)]),_:1},8,["variant"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.resources,m=>(e.openBlock(),e.createBlock(S,{key:m.id,onClick:P=>{v.value="single",h.value=m.id,r.value=!1},variant:p.viewMode==="single"&&p.activeChart===m.id?"secondary":"outline"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"size-3 rounded-full",style:e.normalizeStyle({backgroundColor:m.color||"#6b7280"})},null,4),e.createElementVNode("span",we,e.toDisplayString(m.name)+" ("+e.toDisplayString((p.totals[m.id]||0).toLocaleString())+") ",1)]),_:2},1032,["onClick","variant"]))),128))]),_:1})])]),_:1})]),_:1},8,["open"])):(e.openBlock(),e.createBlock(I,{key:2,open:e.unref(r),"onUpdate:open":n[5]||(n[5]=m=>e.isRef(r)?r.value=m:null)},{default:e.withCtx(()=>[e.createVNode(B,{"as-child":""},{default:e.withCtx(()=>[...n[9]||(n[9]=[e.createElementVNode("button",{tabindex:"-1",class:"size-0 opacity-0 self-end"},null,-1)])]),_:1}),e.createVNode(A,{align:"end"},{default:e.withCtx(()=>[e.createVNode($,null,{default:e.withCtx(()=>[...n[10]||(n[10]=[e.createTextVNode("Resources",-1)])]),_:1}),e.createElementVNode("div",_e,[e.createVNode(_,{onClick:n[4]||(n[4]=m=>{v.value="stacked",h.value="",r.value=!1}),class:e.normalizeClass(p.viewMode==="stacked"?"bg-input":"")},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),e.createElementVNode("span",null," All Resources ("+e.toDisplayString(Object.values(p.totals).reduce((m,P)=>m+P,0).toLocaleString())+") ",1)]),_:1},8,["class"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.resources,m=>(e.openBlock(),e.createBlock(_,{key:m.id,onClick:P=>{v.value="single",h.value=m.id,r.value=!1},class:e.normalizeClass(p.viewMode==="single"&&p.activeChart===m.id?"bg-input":"")},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"size-3 rounded-full",style:e.normalizeStyle({backgroundColor:m.color||"#6b7280"})},null,4),e.createElementVNode("span",De,[e.createElementVNode("span",Ne,e.toDisplayString(m.name),1),e.createElementVNode("span",null,"("+e.toDisplayString((p.totals[m.id]||0).toLocaleString())+")",1)])]),_:2},1032,["onClick","class"]))),128))])]),_:1})]),_:1},8,["open"]))])}}}),Ee={class:"flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6"},Be={class:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3"},$e={class:"flex items-center gap-1"},Me={class:"timeline-date-trigger"},Re={key:1,class:"flex items-center justify-center px-6 py-4 text-muted-foreground text-sm"},Te={key:0,class:"flex items-center justify-center h-[250px]"},Ie={key:1,class:"flex items-center justify-center h-[250px]"},ne="#61616180",ze=e.defineComponent({__name:"Timeline",props:{modelValue:{},selectedResource:{},viewMode:{},agendaData:{},resources:{}},emits:["update:modelValue","update:selectedResource","update:viewMode"],setup(p,{emit:f}){const o=p,g=f,{params:v}=G.useModuleRoute(),{config:h}=G.useModule(),x=G.useFirebaseIntegration(h.project),i=e.ref([]),r=e.ref([]),l=e.ref(!0),n=e.ref(o.viewMode||"stacked"),c=e.ref(o.selectedResource||"");e.watch(n,t=>{g("update:viewMode",t)},{immediate:!0}),e.watch(c,t=>{g("update:selectedResource",n.value==="single"?t:null)}),e.watch(n,t=>{g("update:selectedResource",t==="single"?c.value:null)}),e.watch(()=>o.selectedResource,t=>{n.value==="single"&&t!==c.value&&(c.value=t||"")});const N=new Date,k=e.ref(o.modelValue||new Date),S=e.ref(null);e.watch(()=>o.modelValue,t=>{t&&t.getTime()!==k.value.getTime()&&(k.value=t)}),e.watch(k,t=>{g("update:modelValue",t)},{immediate:!0});const w=e.computed({get:()=>J(k.value),set:t=>{if(!t){k.value=new Date;return}k.value=new Date(`${t}T00:00:00`)}}),j=()=>{const t=S.value;if(t){if(typeof t.showPicker=="function"){t.showPicker();return}t.focus(),t.click()}},X=e.computed(()=>{const t=new Date(N);t.setDate(N.getDate()-1);const u=new Date(N);return u.setDate(N.getDate()+1),k.value.toDateString()===N.toDateString()?"Today":k.value.toDateString()===t.toDateString()?"Yesterday":k.value.toDateString()===u.toDateString()?"Tomorrow":k.value.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}),B=()=>{const t=new Date(k.value);t.setDate(t.getDate()-1),k.value=t},$=()=>{const t=new Date(k.value);t.setDate(t.getDate()+1),k.value=t},_=()=>{k.value=new Date},A=e.computed(()=>o.resources?.length===0?10:Math.max(...(o.resources||[]).map(t=>t.capacity||10))),I=e.computed(()=>(o.resources?.length||0)===0?60:Math.min(...(o.resources||[]).map(t=>t.interval||60))),m=e.computed(()=>{const t={total:{label:"Total Reservations",color:void 0}};return(o.resources||[]).forEach((u,V)=>{t[u.id]={label:u.name,color:u.color||`var(--chart-${V%5+1})`}}),t});e.watch(()=>o.resources,t=>{(t?.length||0)>0&&!c.value&&(c.value=t[0].id)},{immediate:!0});const P=e.computed(()=>[...o.resources||[]].sort((t,u)=>{const V=L.value[t.id]||0;return(L.value[u.id]||0)-V})),Y=e.computed(()=>{const t=[];return I.value,i.value.forEach((u,V)=>{u.time.endsWith(":00")&&t.push(V)}),t}),L=e.computed(()=>{const t={};return o.resources?.forEach(u=>{t[u.id]=r.value.filter(V=>V.resourceId===u.id).reduce((V,D)=>V+(D.reserved||0),0)}),t}),J=t=>{const u=t.getFullYear(),V=String(t.getMonth()+1).padStart(2,"0"),D=String(t.getDate()).padStart(2,"0");return`${u}-${V}-${D}`},s=t=>{const[u,V]=t.split(":").map(Number);return u*60+V},a=(t,u)=>(o.agendaData?.exceptions||[]).find(D=>u>=D.startDate&&u<=D.endDate?D.resourceIds===null?!0:D.resourceIds?.includes(t):!1)||null,E=e.computed(()=>{const t=J(k.value),u=k.value.getDay();let V=1440,D=0;if((o.resources||[]).forEach(U=>{const T=a(U.id,t);if(T){if(T.isClosed)return;T.timeslots.forEach(W=>{const y=s(W.startTime),b=s(W.endTime);V=Math.min(V,y),D=Math.max(D,b)})}else(U.openingHours?.[u]||[]).forEach(y=>{const b=s(y.start),q=s(y.end);V=Math.min(V,b),D=Math.max(D,q)})}),V>=D)return{startMinutes:540,endMinutes:1020};const d=Math.floor(V/60)*60,H=Math.ceil(D/60)*60;return{startMinutes:d,endMinutes:H}}),z=()=>{const t=[],u=I.value,{startMinutes:V,endMinutes:D}=E.value;for(let d=V;d<D;d+=u){const H=Math.floor(d/60),U=d%60,T=`${String(H).padStart(2,"0")}:${String(U).padStart(2,"0")}`,W={time:T,label:T};o.resources?.forEach(y=>{W[y.id]=0}),t.push(W)}return t},O=async()=>{l.value=!0;try{const t=v.value.id,u=J(k.value),V=`${t}_${u}`,D=await x.get(h.reservedSpotsCollection,V);r.value=[];for(const T of o.resources||[]){const W=D?.[T.id]||{};Object.entries(W).forEach(([y,b])=>{const[q,K]=y.split("-");r.value.push({resourceId:T.id,startTime:q,endTime:K,reserved:b})})}const d=z(),H=I.value,{startMinutes:U}=E.value;r.value.forEach(T=>{const W=s(T.startTime),y=s(T.endTime);for(let b=W;b<y;b+=H){const q=Math.floor((b-U)/H);if(q>=0&&q<d.length){const K=d[q][T.resourceId];typeof K=="number"&&(d[q][T.resourceId]=K+(T.reserved||0))}}}),i.value=d}catch(t){console.error("Error loading reservation data:",t),i.value=z(),r.value=[]}finally{l.value=!1}};return(async()=>await O())(),e.watch(k,()=>{O()}),e.watch(()=>o.resources,()=>{(o.resources?.length||0)>0&&O()}),(t,u)=>{const V=e.resolveComponent("CardTitle"),D=e.resolveComponent("Button"),d=e.resolveComponent("CardDescription"),H=e.resolveComponent("CardHeader"),U=e.resolveComponent("ChartContainer"),T=e.resolveComponent("CardContent"),W=e.resolveComponent("Card");return e.openBlock(),e.createBlock(W,{class:"py-4 sm:py-0"},{default:e.withCtx(()=>[e.createVNode(H,{class:"flex flex-col items-stretch border-b !p-0 sm:flex-row"},{default:e.withCtx(()=>[e.createElementVNode("div",Ee,[e.createElementVNode("div",Be,[e.createVNode(V,null,{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode("Reservations",-1)])]),_:1}),e.createElementVNode("div",$e,[e.createVNode(D,{variant:"outline",size:"icon",class:"size-8",onClick:B},{default:e.withCtx(()=>[e.createVNode(e.unref(F.ChevronLeft),{size:16})]),_:1}),e.createVNode(D,{variant:"outline",size:"sm",class:"h-8 px-3 text-xs",onClick:_},{default:e.withCtx(()=>[...u[4]||(u[4]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(D,{variant:"outline",size:"icon",class:"size-8",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(F.ChevronRight),{size:16})]),_:1})])]),e.createVNode(d,null,{default:e.withCtx(()=>[e.createElementVNode("div",Me,[e.createVNode(D,{type:"button",variant:"outline",onClick:j},{default:e.withCtx(()=>[e.createVNode(e.unref(F.CalendarIcon),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(e.unref(X)),1)]),_:1}),e.withDirectives(e.createElementVNode("input",{ref_key:"dateInputRef",ref:S,"onUpdate:modelValue":u[0]||(u[0]=y=>e.isRef(w)?w.value=y:null),type:"date",class:"timeline-date-picker","aria-label":"Select reservation date"},null,512),[[e.vModelText,e.unref(w)]])])]),_:1})]),p.resources.length>0?(e.openBlock(),e.createBlock(Se,{key:0,resources:p.resources,totals:e.unref(L),viewMode:e.unref(n),"onUpdate:viewMode":u[1]||(u[1]=y=>e.isRef(n)?n.value=y:null),activeChart:e.unref(c),"onUpdate:activeChart":u[2]||(u[2]=y=>e.isRef(c)?c.value=y:null)},null,8,["resources","totals","viewMode","activeChart"])):(e.openBlock(),e.createElementBlock("div",Re," No resources configured "))]),_:1}),e.createVNode(T,{class:"px-2 sm:p-6"},{default:e.withCtx(()=>[e.unref(l)?(e.openBlock(),e.createElementBlock("div",Te,[...u[5]||(u[5]=[e.createElementVNode("div",{class:"text-muted-foreground"},"Loading...",-1)])])):p.resources.length===0?(e.openBlock(),e.createElementBlock("div",Ie,[...u[6]||(u[6]=[e.createElementVNode("div",{class:"text-muted-foreground"},"No resources to display",-1)])])):e.unref(n)==="stacked"?(e.openBlock(),e.createBlock(U,{key:2,config:e.unref(m),class:"aspect-auto h-[250px] w-full",cursor:""},{default:e.withCtx(()=>[e.createVNode(e.unref(M.S),{data:e.unref(i),margin:{left:-24},"y-domain":[0,e.unref(A)]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(P),y=>(e.openBlock(),e.createBlock(e.unref(oe),{key:y.id,x:(b,q)=>q,y:b=>b[y.id]||0,color:b=>b[y.id]>0?e.unref(m)[y.id]?.color:ne,"bar-padding":.1,"rounded-corners":2},null,8,["x","y","color"]))),128)),e.createVNode(e.unref(M.C),{type:"x",x:(y,b)=>b,"tick-line":!1,"domain-line":!1,"grid-line":!1,"tick-values":e.unref(Y),"tick-format":y=>e.unref(i)[y]?.time||""},null,8,["x","tick-values","tick-format"]),e.createVNode(e.unref(M.C),{type:"y","num-ticks":3,"tick-line":!1,"domain-line":!1}),e.createVNode(e.unref(M.z)),e.createVNode(e.unref(M.A),{template:e.unref(Q.componentToString)(e.unref(m),e.unref(Q.ChartTooltipContent),{labelFormatter(y){const b=Math.round(y);return b>=0&&b<e.unref(i).length&&e.unref(i)[b]?.time||""}}),color:"#0000"},null,8,["template"])]),_:1},8,["data","y-domain"])]),_:1},8,["config"])):(e.openBlock(),e.createBlock(U,{key:e.unref(c),config:e.unref(m),class:"aspect-auto h-[250px] w-full",cursor:""},{default:e.withCtx(()=>[e.createVNode(e.unref(M.S),{data:e.unref(i),margin:{left:-24},"y-domain":[0,e.unref(A)]},{default:e.withCtx(()=>[e.createVNode(e.unref(oe),{x:(y,b)=>b,y:y=>y[e.unref(c)]||0,color:y=>y[e.unref(c)]>0?e.unref(m)[e.unref(c)]?.color:ne,"bar-padding":.1,"rounded-corners":!1},null,8,["x","y","color"]),e.createVNode(e.unref(M.C),{type:"x",x:(y,b)=>b,"tick-line":!1,"domain-line":!1,"grid-line":!1,"tick-values":e.unref(Y),"tick-format":y=>e.unref(i)[y]?.time||""},null,8,["x","tick-values","tick-format"]),e.createVNode(e.unref(M.C),{type:"y","num-ticks":3,"tick-line":!1,"domain-line":!1}),e.createVNode(e.unref(M.z)),e.createVNode(e.unref(M.A),{template:e.unref(Q.componentToString)(e.unref(m),e.unref(Q.ChartTooltipContent),{labelFormatter(y){const b=Math.round(y);return b>=0&&b<e.unref(i).length&&e.unref(i)[b]?.time||""}}),color:"#0000"},null,8,["template"])]),_:1},8,["data","y-domain"])]),_:1},8,["config"]))]),_:1})]),_:1})}}}),Oe=ce._export_sfc(ze,[["__scopeId","data-v-62490f67"]]),Ae={class:"flex flex-row items-center justify-between gap-2"},Pe={class:"relative mb-4"},je={class:"flex gap-1 mb-4 flex-wrap"},Fe={key:0,class:"mb-3 text-sm text-muted-foreground"},Le={key:1,class:"flex items-center justify-center py-8"},We={key:2,class:"flex flex-col items-center gap-2 text-center py-8 text-muted-foreground"},qe={key:3,class:"text-center py-8 text-muted-foreground"},Ge={key:4,class:"space-y-2"},He=["onClick"],Ue={class:"flex items-start justify-between"},Ye={class:"flex-1"},Xe={class:"font-medium"},Je={class:"text-sm text-muted-foreground"},Ke={class:"text-sm text-muted-foreground"},Qe={class:"flex items-center gap-4 flex-wrap"},Ze={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},et={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},tt={key:0,class:"flex items-center gap-1 mt-1 text-xs text-muted-foreground"},ot={class:"text-right"},nt={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"},at={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"},rt={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"},st={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"},lt={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"},it={key:5,class:"text-sm font-medium mt-1"},ct=e.defineComponent({__name:"BookingsList",props:{agendaData:{},activeDate:{},selectedResource:{},resources:{}},emits:["resetSelectedResource"],setup(p,{emit:f}){const o=p,g=f,{params:v}=G.useModuleRoute(),{config:h}=G.useModule(),x=G.useFirebaseIntegration(h.project),i=e.ref([]),r=e.ref(!0),l=e.ref(""),n=e.ref(null),c=e.ref(null),N=e.computed(()=>o.agendaData?.metadataSchema||[]),k=e.computed(()=>({date:S(o.activeDate),resource:null}));e.provide("event",k);const S=s=>{const a=s.getFullYear(),E=String(s.getMonth()+1).padStart(2,"0"),z=String(s.getDate()).padStart(2,"0");return`${a}-${E}-${z}`},w=e.computed(()=>{let s=i.value;return o.selectedResource&&(s=s.filter(a=>a.resourceId===o.selectedResource)),l.value.trim()&&(s=new ee.Fuse(s,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone","resourceName"],threshold:.3,ignoreLocation:!0}).search(l.value).map(E=>E.item)),s}),j=e.computed(()=>w.value.filter(s=>_.value.includes(s.reservationStatus))),X=e.computed(()=>{let s=JSON.parse(JSON.stringify(i.value));return o.selectedResource&&(s=s.filter(a=>a.resourceId===o.selectedResource)),s.some(a=>a.reservationStatus==="approved"||a.reservationStatus==="needs_approval")}),B=e.computed(()=>({spots:i.value.reduce((s,a)=>s+(a.spots||0),0),bookings:i.value.length})),$=()=>{l.value=""},_=e.ref(["needs_approval","approved"]),A=s=>{_.value.includes(s)?_.value=_.value.filter(a=>a!==s):_.value.push(s)},I=(s,a,E=a.date)=>{const z=o.resources.find(R=>R.id===a.resourceId),O=s.id||s.orderId||a.orderId||"";return{customerInfo:s.customerInfo,amountDue:s.amountDue,amountPaid:s.amountPaid,status:s.status,reservationStatus:a.status,subtotal:s.subtotal,total:s.total,discount:s.discount,id:O,res_id:a.id,resourceId:a.resourceId,spots:a.spots,date:E,createdAt:s.createdAt,startTime:a.timeslot?.startTime,endTime:a.timeslot?.endTime,reservationPrice:a.totalPrice,reservationBasePrice:a.basePrice,reservationAddOnsPrice:a.addOnsPrice,pricingOptionId:a.pricingOptionId,pricingOption:a.pricingOption,resourceName:z?.name||"Unknown",resourceColor:z?.color,metadata:s.metadata||{},reservationMetadata:a.metadata||{},adjustments:s.adjustments||[],reservationAdjustments:a.adjustments||[]}},m=async()=>{await e.nextTick(),await new Promise(s=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>s());return}s()})},P=async s=>{const a=await x.get(h.reservationsCollection,s);if(!a)return;const E={...a,id:a.id||s},z=(E.reservations||[]).map(O=>I(E,O));z.length&&(await m(),c.value?.openDialog({id:E.id,customerInfo:E.customerInfo,status:E.status,createdAt:E.createdAt,metadata:E.metadata||{},reservations:z,adjustments:E.adjustments||[],totalPrice:typeof E.total=="number"?E.total:z.reduce((O,R)=>O+(R.reservationPrice||0),0),totalSpots:z.reduce((O,R)=>O+(R.spots||0),0)}))},Y=async s=>{await m(),n.value?.openDialog(s)},L=async()=>{r.value=!0,i.value=[];try{const s=v.value.id,a=S(o.activeDate),E=new Set;o.resources?.forEach(R=>{const t=`${R.id}_${a}`;E.add(t)});const z=await x.find(h.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:s},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(E)}]});let O=[];z.forEach(R=>{(R.reservations?.filter(u=>u.date===a)||[]).forEach(u=>{O.push(I(R,u,a))})}),i.value=O.sort((R,t)=>R.startTime?.localeCompare(t.startTime||"")||0)}catch(s){console.error("Error loading orders:",s),i.value=[]}finally{r.value=!1}};return(async()=>await L())(),e.watch(()=>o.activeDate,()=>{L()}),(s,a)=>{const E=e.resolveComponent("Badge"),z=e.resolveComponent("CardTitle"),O=e.resolveComponent("CardDescription"),R=e.resolveComponent("Button"),t=e.resolveComponent("CardHeader"),u=e.resolveComponent("Input"),V=e.resolveComponent("CardContent"),D=e.resolveComponent("Card");return e.openBlock(),e.createBlock(D,null,{default:e.withCtx(()=>[e.createVNode(t,null,{default:e.withCtx(()=>[e.createElementVNode("div",Ae,[e.createElementVNode("div",null,[e.createVNode(z,{class:"flex items-center gap-2"},{default:e.withCtx(()=>[a[9]||(a[9]=e.createTextVNode(" Bookings ",-1)),e.unref(B).bookings>0?(e.openBlock(),e.createBlock(E,{key:0,variant:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B).bookings),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(O,{class:"flex items-center gap-2 mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(e.unref(B).spots)+" total spots",1)]),_:1})]),e.createVNode(R,{variant:"ghost",size:"icon",onClick:L,disabled:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(e.unref(F.RefreshCw),{size:16,class:e.normalizeClass({"animate-spin":e.unref(r)})},null,8,["class"])]),_:1},8,["disabled"])])]),_:1}),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createVNode(e.unref(F.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(u,{modelValue:e.unref(l),"onUpdate:modelValue":a[0]||(a[0]=d=>e.isRef(l)?l.value=d:null),placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9"},null,8,["modelValue"]),e.unref(l)?(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(F.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",je,[p.agendaData.needsApproval?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[1]||(a[1]=d=>A("needs_approval")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("needs_approval")}])}," Needs Approval ",2)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:a[2]||(a[2]=d=>A("approved")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("approved")}])}," Approved ",2),e.createElementVNode("button",{onClick:a[3]||(a[3]=d=>A("rejected")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("rejected")}])}," Rejected ",2),e.createElementVNode("button",{onClick:a[4]||(a[4]=d=>A("cancelled")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("cancelled")}])}," Cancelled ",2)]),e.unref(l)?(e.openBlock(),e.createElementBlock("div",Fe," Showing "+e.toDisplayString(e.unref(w).length)+" of "+e.toDisplayString(e.unref(i).length)+" bookings ",1)):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createElementBlock("div",Le,[...a[10]||(a[10]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):e.unref(j).length===0?(e.openBlock(),e.createElementBlock("div",We,[a[13]||(a[13]=e.createTextVNode(" No bookings for this day ",-1)),e.unref(X)?(e.openBlock(),e.createBlock(R,{key:0,onClick:a[5]||(a[5]=d=>_.value=["needs_approval","approved"])},{default:e.withCtx(()=>[...a[11]||(a[11]=[e.createTextVNode("Reset filters",-1)])]),_:1})):e.createCommentVNode("",!0),p.selectedResource!==null?(e.openBlock(),e.createBlock(R,{key:1,onClick:a[6]||(a[6]=d=>g("resetSelectedResource"))},{default:e.withCtx(()=>[...a[12]||(a[12]=[e.createTextVNode("Reset resource filter",-1)])]),_:1})):e.createCommentVNode("",!0)])):e.unref(w).length===0?(e.openBlock(),e.createElementBlock("div",qe," No bookings match your search ")):(e.openBlock(),e.createElementBlock("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),d=>(e.openBlock(),e.createElementBlock("div",{key:d.res_id||d.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors cursor-pointer",onClick:H=>e.unref(n)?.openDialog(d)},[e.createElementVNode("div",Ue,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Xe,e.toDisplayString(d.customerInfo.firstName+" "+d.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Je,e.toDisplayString(d.customerInfo?.email),1),e.createElementVNode("div",Ke,e.toDisplayString(d.customerInfo?.phone),1),e.createElementVNode("div",Qe,[e.createElementVNode("div",Ze,[e.createVNode(e.unref(F.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(d.startTime)+" - "+e.toDisplayString(d.endTime),1)]),e.createElementVNode("div",et,[e.createVNode(e.unref(F.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(d.spots)+" spots",1)]),d.resourceName?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:d.resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(d.resourceName),1)])):e.createCommentVNode("",!0)]),e.createVNode(ee._sfc_main,{metadata:{...d.metadata,...d.reservationMetadata},schema:e.unref(N),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",ot,[d.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",nt,"Needs Approval")):d.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",at,"Approved")):d.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",rt,"Rejected")):d.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",st,"Cancelled")):(e.openBlock(),e.createElementBlock("span",lt,"Pending")),d.reservationPrice||d.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",it," €"+e.toDisplayString(d.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,He))),128))]))]),_:1}),e.createVNode(ee._sfc_main$1,{ref_key:"reservationDetailDialog",ref:n,agendaData:p.agendaData,"show-order-link":"",onCancelled:L,onConfirmed:L,onRejected:L,onOpenOrder:a[7]||(a[7]=d=>P(d))},null,8,["agendaData"]),e.createVNode(de._sfc_main,{ref_key:"orderDetailDialog",ref:c,agendaData:p.agendaData,onOpenReservation:a[8]||(a[8]=d=>Y(d))},null,8,["agendaData"])]),_:1})}}}),dt={class:"space-y-6"},ut={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},mt={class:"text-2xl font-semibold tracking-tight"},pt={class:"flex flex-col md:flex-row gap-2"},ft={class:"grid gap-6 md:grid-cols-2 lg:grid-cols-3"},gt={class:"md:col-span-2 lg:col-span-3"},vt=e.defineComponent({__name:"index",setup(p){const{hasPermission:f}=G.useModulePermissions(),{params:o,resolvePath:g}=G.useModuleRoute(),{config:v}=G.useModule(),h=G.useFirebaseIntegration(v.project),x=e.ref(""),i=e.ref(!0),r=e.ref(new Date),l=e.ref(null),n=e.ref("stacked"),c=e.ref(null),N=e.ref([]);return(async()=>{try{const S=await h.get(v.agendaCollection,o.value.id);x.value=S?.serviceName||"",c.value=S,N.value=S?.resources?.filter(w=>w.isActive)||[]}catch(S){console.error("Error loading data:",S)}finally{i.value=!1}})(),(S,w)=>(e.openBlock(),e.createBlock(le._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",dt,[e.createElementVNode("div",ut,[e.createElementVNode("div",null,[e.createElementVNode("h1",mt,e.toDisplayString(e.unref(x)||"Dashboard"),1),w[4]||(w[4]=e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"}," Overview and analytics for your booking service ",-1))]),e.createElementVNode("div",pt,[e.unref(f)("manage-reservations")?(e.openBlock(),e.createBlock(ue._sfc_main,{key:0,"agenda-data":e.unref(c)},null,8,["agenda-data"])):e.createCommentVNode("",!0)])]),e.createVNode(Oe,{modelValue:e.unref(r),"onUpdate:modelValue":w[0]||(w[0]=j=>e.isRef(r)?r.value=j:null),"view-mode":e.unref(n),"onUpdate:viewMode":w[1]||(w[1]=j=>e.isRef(n)?n.value=j:null),"selected-resource":e.unref(l),"onUpdate:selectedResource":w[2]||(w[2]=j=>e.isRef(l)?l.value=j:null),"agenda-data":e.unref(c),resources:e.unref(N)},null,8,["modelValue","view-mode","selected-resource","agenda-data","resources"]),e.createElementVNode("div",ft,[e.createElementVNode("div",gt,[e.unref(N).length>0?(e.openBlock(),e.createBlock(ct,{key:0,"agenda-data":e.unref(c),"active-date":e.unref(r),"selected-resource":e.unref(l),resources:e.unref(N),onResetSelectedResource:w[3]||(w[3]=j=>l.value=null)},null,8,["agenda-data","active-date","selected-resource","resources"])):e.createCommentVNode("",!0)])])])]),_:1}))}});exports.default=vt;