@oneclick.dev/cms-core-modules 0.0.58 → 0.0.60

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 (147) hide show
  1. package/dist/{Components-D9yIIosM.mjs → Components-C83O-xlF.mjs} +1 -1
  2. package/dist/{ContentEditor-DCmt_y_R.js → ContentEditor-BAepN3Yd.js} +51 -34
  3. package/dist/{ContentEditor-CtGeIzC4.mjs → ContentEditor-BPjWW3d1.mjs} +12341 -10099
  4. package/dist/Create-Bh4g6QW4.js +1 -0
  5. package/dist/{Create-Bwf1RXdG.mjs → Create-Cf7pvh5G.mjs} +38 -39
  6. package/dist/DateFormatter-BPPBZp1j.js +1 -0
  7. package/dist/{CalendarDate-CRT2Viyt.mjs → DateFormatter-DsmlAuYV.mjs} +353 -256
  8. package/dist/{Detail-CpfOQChd.mjs → Detail-B4b_FLDa.mjs} +2 -2
  9. package/dist/{Detail-B-PnkcXD.mjs → Detail-BGD75ul4.mjs} +2 -2
  10. package/dist/{Detail-Dd_OkpcN.js → Detail-BayNaAg9.js} +1 -1
  11. package/dist/{Detail-C4E1T87K.mjs → Detail-Byk781b4.mjs} +3 -3
  12. package/dist/{Detail-Cd5CBVN0.js → Detail-CnK-qbhE.js} +1 -1
  13. package/dist/Detail-CtbWzq-R.js +1 -0
  14. package/dist/{Detail-CNfTDUE5.js → Detail-Cxd2VMOl.js} +1 -1
  15. package/dist/{Detail-BVlGSjOq.mjs → Detail-D10shmpK.mjs} +6 -7
  16. package/dist/{Detail-CwagT6gQ.mjs → Detail-U0mgLKt6.mjs} +2 -2
  17. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs +75 -0
  18. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js +1 -0
  19. package/dist/{Entries-zyhycw1M.mjs → Entries-C6Di46My.mjs} +1 -1
  20. package/dist/{Find-BPR0uU-Z.mjs → Find-B4sAEx0B.mjs} +2 -2
  21. package/dist/{Find-BidEQJxT.js → Find-Ds6OvuH6.js} +1 -1
  22. package/dist/{GlobalStyling-BLQ_1W2y.mjs → GlobalStyling-C9VthHWK.mjs} +1 -1
  23. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs +396 -0
  24. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +1 -0
  25. package/dist/Overview-B-8TLLjh.js +1 -0
  26. package/dist/{Overview-CDN88OSM.mjs → Overview-BCpJNiEB.mjs} +1 -1
  27. package/dist/Overview-B_99j5eA.js +1 -0
  28. package/dist/{Overview-BLsZMHNW.mjs → Overview-CIa1E-HH.mjs} +1 -1
  29. package/dist/{Overview-D1nJLBe1.mjs → Overview-CgViRnNc.mjs} +1 -1
  30. package/dist/Overview-DtWvKB3W.mjs +327 -0
  31. package/dist/Overview-HvlDEgqi.mjs +862 -0
  32. package/dist/{Overview-BH3NwvNX.mjs → Overview-Su8ZUbMs.mjs} +3 -3
  33. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +345 -0
  34. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +2093 -0
  35. package/dist/{TableView-CS13LLxk.mjs → TableView-B8iLWWcP.mjs} +48394 -36321
  36. package/dist/TableView-BxK6R8v3.js +312 -0
  37. package/dist/{TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs → TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs} +5 -5
  38. package/dist/{View-C7axVP9t.mjs → View-DDXN0tKD.mjs} +7 -7
  39. package/dist/View-DfzaVOzS.js +1 -0
  40. package/dist/agenda-D81m29_4.mjs +1135 -0
  41. package/dist/agenda-uzPPxgsW.js +1 -0
  42. package/dist/availability-B-tRp8hB.mjs +629 -0
  43. package/dist/availability-BiBbzEIM.js +1 -0
  44. package/dist/{exceptions-D3b18TiY.mjs → exceptions-BFchkR06.mjs} +70 -71
  45. package/dist/exceptions-C-DPRNQa.js +1 -0
  46. package/dist/index-4tjmIans.js +1 -0
  47. package/dist/index-AmUV8LZQ.mjs +176 -0
  48. package/dist/index-BDaVYdkD.mjs +7763 -0
  49. package/dist/{index-DT1wWnUk.mjs → index-BWDwEd8D.mjs} +1 -1
  50. package/dist/{index-CImCyE3L.mjs → index-BfBBm9uY.mjs} +1 -1
  51. package/dist/{index-DMoyoaks.mjs → index-Bkq58CeQ.mjs} +2 -2
  52. package/dist/{index-DI6mydpm.mjs → index-CABh6Qn6.mjs} +2 -2
  53. package/dist/{index-CQiY-oTN.mjs → index-CQkOH2_3.mjs} +1 -1
  54. package/dist/{index-Bwi1mtkq.mjs → index-CU-tbS5W.mjs} +1 -1
  55. package/dist/{index-BzuHN-r8.mjs → index-Cpnn_Pxd.mjs} +1 -1
  56. package/dist/index-CxETuRsG.js +1 -0
  57. package/dist/{index-DyCHxFp3.mjs → index-DRqJOqUR.mjs} +502 -449
  58. package/dist/index-DTago6vW-Bhr8E1Y6.js +88 -0
  59. package/dist/index-DTago6vW-CnomHQ_S.mjs +4123 -0
  60. package/dist/index-DfV8-6ON.js +245 -0
  61. package/dist/index-Dnn2SCSl.js +1 -0
  62. package/dist/{index-BEGU8Kme.mjs → index-Dpl9sU6a.mjs} +2 -2
  63. package/dist/index-Uf7TwBuW.mjs +110 -0
  64. package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
  65. package/dist/{index-CKPshlZ8-BQiiP6r_.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +399 -363
  66. package/dist/{index--jjEzba7.mjs → index-cOnxXTbF.mjs} +1 -1
  67. package/dist/index-hlylYYgy.mjs +24 -0
  68. package/dist/index.cjs.js +1 -1
  69. package/dist/index.mjs +98 -81
  70. package/dist/orders-Bh8w0ueq.mjs +346 -0
  71. package/dist/orders-Dt0zMz97.js +1 -0
  72. package/dist/payment-BQaAqQ5q.js +1 -0
  73. package/dist/payment-BbWByERf.mjs +1080 -0
  74. package/dist/regular-1LXNPviB.js +1 -0
  75. package/dist/regular-_05oq5Tx.mjs +1101 -0
  76. package/dist/regular-slots-Bs3WJB3U.js +1 -0
  77. package/dist/regular-slots-C2NYxLPn.mjs +222 -0
  78. package/dist/resources-DgPnEv76.mjs +811 -0
  79. package/dist/resources-eb0pivDL.js +1 -0
  80. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +2 -2
  81. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +92 -0
  82. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
  83. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +10 -0
  84. package/dist/src/appointments/components/edit/{EventDialog.vue.d.ts → EventDialog/ResendConfirmationDialog.vue.d.ts} +1 -1
  85. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +51 -0
  86. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
  87. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
  88. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +15 -7
  89. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +2 -0
  90. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +68 -0
  91. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +15 -0
  92. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
  93. package/dist/src/appointments/config.d.ts +30 -0
  94. package/dist/src/appointments/index.d.ts +32 -5
  95. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +1 -1
  96. package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -1
  97. package/dist/src/appointments/pages/edit/index.vue.d.ts +1 -1
  98. package/dist/src/appointments/pages/edit/orders.vue.d.ts +64 -0
  99. package/dist/src/appointments/pages/edit/payment.vue.d.ts +1 -1
  100. package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +1 -1
  101. package/dist/src/appointments/pages/edit/resources.vue.d.ts +1 -1
  102. package/dist/src/appointments/routes.d.ts +2 -5
  103. package/dist/src/appointments/types.d.ts +16 -0
  104. package/dist/src/appointments/utils/printReservation.d.ts +45 -0
  105. package/dist/src/content-manager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
  106. package/dist/src/content-manager/components/content-editor/PageSettings.vue.d.ts +2 -0
  107. package/dist/src/content-manager/components/content-editor/SidebarSectionWrapper.vue.d.ts +11 -1
  108. package/dist/src/content-manager/types.d.ts +5 -0
  109. package/dist/{vee-validate-zod-BPQyEfpF.js → vee-validate-zod-ByykgYKJ.js} +1 -1
  110. package/dist/{vee-validate-zod-IXkfh-6Q.mjs → vee-validate-zod-CcOwoF6y.mjs} +4 -4
  111. package/package.json +4 -2
  112. package/dist/CalendarDate-CWtpXgpD.js +0 -1
  113. package/dist/Create-BP8TX6rj.js +0 -1
  114. package/dist/DateFormatter-BbcSwTs4.js +0 -1
  115. package/dist/DateFormatter-CbO0PVUK.mjs +0 -99
  116. package/dist/Detail-DUo6qKqO.js +0 -1
  117. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +0 -1
  118. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +0 -55
  119. package/dist/Overview-BNMZ9MUK.js +0 -1
  120. package/dist/Overview-CEPodGCn.mjs +0 -311
  121. package/dist/Overview-CvquDPhB.js +0 -1
  122. package/dist/Overview-D67UjG6n.mjs +0 -947
  123. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +0 -1
  124. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +0 -392
  125. package/dist/TableView-Dv4YXBD1.js +0 -111
  126. package/dist/View-7qb_ohVo.js +0 -1
  127. package/dist/agenda-B49oKGeh.mjs +0 -706
  128. package/dist/agenda-DipQ5IWP.js +0 -1
  129. package/dist/availability-C7q9tq6l.js +0 -1
  130. package/dist/availability-DeCkqiu8.mjs +0 -613
  131. package/dist/exceptions-DJ9zWX3k.js +0 -1
  132. package/dist/index-CKPshlZ8-CIz1tDwX.js +0 -1
  133. package/dist/index-DUeFrD-B.js +0 -1
  134. package/dist/index-DsnoK4ia.mjs +0 -579
  135. package/dist/index-WL1P6d3j.js +0 -1
  136. package/dist/index-_mG-aU3Z.mjs +0 -87
  137. package/dist/index-_sQDF1pH.js +0 -1
  138. package/dist/index-klI238nT.mjs +0 -24
  139. package/dist/payment-kTjsV0Jj.js +0 -1
  140. package/dist/payment-zpCM0LD-.mjs +0 -981
  141. package/dist/regular-C4_3YXqx.mjs +0 -602
  142. package/dist/regular-DFwPEbZO.js +0 -1
  143. package/dist/regular-slots-4ooEpICB.mjs +0 -67
  144. package/dist/regular-slots-BAVGbomI.js +0 -1
  145. package/dist/resources-MpQkSstv.mjs +0 -563
  146. package/dist/resources-iM28T3dD.js +0 -1
  147. package/dist/src/appointments/components/edit/RegularSlotEditor.vue.d.ts +0 -16
@@ -1,981 +0,0 @@
1
- import { defineComponent as D, inject as H, resolveComponent as m, createElementBlock as r, openBlock as a, createElementVNode as o, createVNode as e, withCtx as s, createTextVNode as d, createCommentVNode as w, ref as T, Fragment as A, renderList as R, unref as y, toDisplayString as k, withModifiers as Z, normalizeClass as $, useTemplateRef as ee, nextTick as te, reactive as ne, provide as oe, createBlock as Y, normalizeStyle as se } from "vue";
2
- import { _ as le } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
3
- import { DollarSign as de, Pencil as ie, Trash2 as F, PlusCircle as G, Users as K, ChevronDown as ae } from "lucide-vue-next";
4
- import { useConfirmation as re, useModuleRoute as ue, useModule as me, useFirebaseIntegration as ce } from "@oneclick.dev/cms-kit";
5
- import { t as pe } from "./index-RLz1QPrf.mjs";
6
- const fe = { class: "flex gap-3 items-start p-4 border rounded-lg" }, ge = { class: "flex-1 space-y-3" }, ve = { class: "grid grid-cols-2 gap-3" }, xe = { class: "flex items-center space-x-2 my-4" }, ye = { class: "grid grid-cols-2 gap-2" }, be = { key: 0 }, _e = { key: 1 }, ke = { key: 2 }, Ve = { key: 3 }, Oe = { key: 4 }, Ce = { key: 0 }, Se = /* @__PURE__ */ D({
7
- __name: "Addon",
8
- props: {
9
- addOn: {
10
- type: Object,
11
- required: !0
12
- }
13
- },
14
- setup(c) {
15
- const V = H("form"), O = (b) => {
16
- V.addOns = V.addOns.filter((n) => n.id !== b);
17
- };
18
- return (b, n) => {
19
- const p = m("Label"), x = m("Input"), C = m("Checkbox"), S = m("SelectTrigger"), g = m("SelectItem"), h = m("SelectGroup"), M = m("SelectContent"), L = m("Select"), B = m("Trash2"), z = m("Button");
20
- return a(), r("div", fe, [
21
- o("div", ge, [
22
- o("div", ve, [
23
- o("div", null, [
24
- e(p, { class: "text-xs mb-1 block" }, {
25
- default: s(() => [...n[7] || (n[7] = [
26
- d("Add-on Name", -1)
27
- ])]),
28
- _: 1
29
- }),
30
- e(x, {
31
- modelValue: c.addOn.name,
32
- "onUpdate:modelValue": n[0] || (n[0] = (v) => c.addOn.name = v),
33
- placeholder: "e.g., Swimsuit Rental, Towel Service"
34
- }, null, 8, ["modelValue"])
35
- ]),
36
- o("div", null, [
37
- e(p, { class: "text-xs mb-1 block" }, {
38
- default: s(() => [...n[8] || (n[8] = [
39
- d("Price", -1)
40
- ])]),
41
- _: 1
42
- }),
43
- e(x, {
44
- modelValue: c.addOn.price,
45
- "onUpdate:modelValue": n[1] || (n[1] = (v) => c.addOn.price = v),
46
- modelModifiers: { number: !0 },
47
- type: "number",
48
- min: "0",
49
- step: "0.01",
50
- placeholder: "0.00",
51
- class: "no-spinner"
52
- }, null, 8, ["modelValue"])
53
- ])
54
- ]),
55
- o("div", null, [
56
- e(p, { class: "text-xs mb-1 block" }, {
57
- default: s(() => [...n[9] || (n[9] = [
58
- d("Description (Optional)", -1)
59
- ])]),
60
- _: 1
61
- }),
62
- e(x, {
63
- modelValue: c.addOn.description,
64
- "onUpdate:modelValue": n[2] || (n[2] = (v) => c.addOn.description = v),
65
- placeholder: "Brief description of this add-on"
66
- }, null, 8, ["modelValue"])
67
- ]),
68
- o("div", xe, [
69
- e(C, {
70
- id: `required-${c.addOn.id}`,
71
- modelValue: c.addOn.required,
72
- "onUpdate:modelValue": n[3] || (n[3] = (v) => c.addOn.required = v)
73
- }, null, 8, ["id", "modelValue"]),
74
- e(p, {
75
- for: `required-${c.addOn.id}`,
76
- class: "text-xs font-normal cursor-pointer"
77
- }, {
78
- default: s(() => [...n[10] || (n[10] = [
79
- d(" Required (customer must select this add-on) ", -1)
80
- ])]),
81
- _: 1
82
- }, 8, ["for"])
83
- ]),
84
- o("div", ye, [
85
- o("div", null, [
86
- e(p, { class: "text-xs mb-1 block" }, {
87
- default: s(() => [...n[11] || (n[11] = [
88
- d("Quantity limit", -1)
89
- ])]),
90
- _: 1
91
- }),
92
- e(L, {
93
- modelValue: c.addOn.scope,
94
- "onUpdate:modelValue": n[4] || (n[4] = (v) => c.addOn.scope = v)
95
- }, {
96
- default: s(() => [
97
- e(S, { class: "w-full" }, {
98
- default: s(() => [
99
- c.addOn.scope === "RESERVATION" ? (a(), r("span", be, "Once per reservation")) : c.addOn.scope === "TICKET" ? (a(), r("span", _e, "Once per ticket / person")) : c.addOn.scope === "UNLIMITED" ? (a(), r("span", ke, "Unlimited")) : c.addOn.scope === "CUSTOM_LIMIT" ? (a(), r("span", Ve, "Custom limit...")) : (a(), r("span", Oe, "Select a limit…"))
100
- ]),
101
- _: 1
102
- }),
103
- e(M, null, {
104
- default: s(() => [
105
- e(h, { class: "max-w-96" }, {
106
- default: s(() => [
107
- e(g, { value: "RESERVATION" }, {
108
- default: s(() => [...n[12] || (n[12] = [
109
- o("div", { class: "flex flex-col" }, [
110
- o("p", { class: "text-sm font-bold mb-1" }, "Once per reservation"),
111
- o("p", { class: "text-xs" }, "Max 1 per reservation line (charged per reservation).")
112
- ], -1)
113
- ])]),
114
- _: 1
115
- }),
116
- e(g, { value: "TICKET" }, {
117
- default: s(() => [...n[13] || (n[13] = [
118
- o("div", { class: "flex flex-col" }, [
119
- o("p", { class: "text-sm font-bold mb-1" }, "Once per ticket / person"),
120
- o("p", { class: "text-xs" }, "Max 1 per ticket/person (charged per quantity).")
121
- ], -1)
122
- ])]),
123
- _: 1
124
- }),
125
- e(g, { value: "UNLIMITED" }, {
126
- default: s(() => [...n[14] || (n[14] = [
127
- o("div", { class: "flex flex-col" }, [
128
- o("p", { class: "text-sm font-bold mb-1" }, "Unlimited"),
129
- o("p", { class: "text-xs" }, "No limit (can be added multiple times).")
130
- ], -1)
131
- ])]),
132
- _: 1
133
- }),
134
- e(g, { value: "CUSTOM_LIMIT" }, {
135
- default: s(() => [...n[15] || (n[15] = [
136
- o("div", { class: "flex flex-col" }, [
137
- o("p", { class: "text-sm font-bold mb-1" }, "Custom limit..."),
138
- o("p", { class: "text-xs" }, "Set a fixed max amount (e.g. 2, 5, 10).")
139
- ], -1)
140
- ])]),
141
- _: 1
142
- })
143
- ]),
144
- _: 1
145
- })
146
- ]),
147
- _: 1
148
- })
149
- ]),
150
- _: 1
151
- }, 8, ["modelValue"])
152
- ]),
153
- c.addOn.scope === "CUSTOM_LIMIT" ? (a(), r("div", Ce, [
154
- e(p, { class: "text-xs mb-1 block" }, {
155
- default: s(() => [...n[16] || (n[16] = [
156
- d("Fixed limit", -1)
157
- ])]),
158
- _: 1
159
- }),
160
- e(x, {
161
- modelValue: c.addOn.limit,
162
- "onUpdate:modelValue": n[5] || (n[5] = (v) => c.addOn.limit = v),
163
- modelModifiers: { number: !0 },
164
- type: "number",
165
- min: "1",
166
- step: "1",
167
- placeholder: "1",
168
- class: "no-spinner"
169
- }, null, 8, ["modelValue"])
170
- ])) : w("", !0)
171
- ])
172
- ]),
173
- e(z, {
174
- onClick: n[6] || (n[6] = (v) => O(c.addOn.id)),
175
- variant: "ghost",
176
- size: "icon",
177
- class: "mt-6"
178
- }, {
179
- default: s(() => [
180
- e(B, { class: "w-4 h-4 text-destructive" })
181
- ]),
182
- _: 1
183
- })
184
- ]);
185
- };
186
- }
187
- }), we = { class: "grid gap-2" }, Ie = ["id"], Pe = ["onClick"], Ae = { class: "flex items-center gap-2" }, he = { class: "flex items-center gap-1" }, Ue = { class: "overflow-hidden" }, Te = /* @__PURE__ */ D({
188
- __name: "AddonList",
189
- setup(c, { expose: V }) {
190
- const { confirm: O } = re(), b = H("form"), n = T([]), p = async (x) => {
191
- if (!await O("Are you sure you want to remove this add-on?")) return;
192
- b.addOns = b.addOns.filter((g) => g.id !== x);
193
- const S = n.value.indexOf(x);
194
- S !== -1 && n.value.splice(S, 1), pe("Success!", {
195
- description: "Add-on removed successfully."
196
- });
197
- };
198
- return V({
199
- openAddons: n
200
- }), (x, C) => {
201
- const S = m("Button");
202
- return a(), r("div", we, [
203
- (a(!0), r(A, null, R(y(b).addOns, (g) => (a(), r("div", {
204
- key: g.id,
205
- class: "border p-2 rounded",
206
- id: `addon-${g.id}`
207
- }, [
208
- o("div", {
209
- onClick: (h) => n.value.includes(g.id) ? n.value.splice(n.value.indexOf(g.id), 1) : n.value.push(g.id),
210
- class: "cursor-pointer font-bold text-muted-foreground flex items-center justify-between gap-2 select-none"
211
- }, [
212
- o("span", Ae, [
213
- e(y(de), { class: "size-4" }),
214
- d(" " + k(g.name || "Untitled Add-on"), 1)
215
- ]),
216
- o("div", he, [
217
- e(S, {
218
- variant: "ghost",
219
- size: "icon"
220
- }, {
221
- default: s(() => [
222
- e(y(ie), { class: "size-4" })
223
- ]),
224
- _: 1
225
- }),
226
- e(S, {
227
- variant: "ghost",
228
- size: "icon",
229
- onClick: Z((h) => p(g.id), ["stop"])
230
- }, {
231
- default: s(() => [
232
- e(y(F), { class: "size-4 text-red-500" })
233
- ]),
234
- _: 1
235
- }, 8, ["onClick"])
236
- ])
237
- ], 8, Pe),
238
- o("div", {
239
- class: $(["grid", `${n.value.includes(g.id) ? "grid-rows-[1fr]" : "grid-rows-[0fr]"} transition-all duration-300 ease-in-out overflow-hidden`])
240
- }, [
241
- o("div", Ue, [
242
- e(Se, { addOn: g }, null, 8, ["addOn"])
243
- ])
244
- ], 2)
245
- ], 8, Ie))), 128))
246
- ]);
247
- };
248
- }
249
- }), Re = { class: "flex items-center justify-between mb-4" }, $e = { class: "space-y-3" }, De = {
250
- key: 0,
251
- class: "text-center py-8 text-muted-foreground text-sm border rounded-lg"
252
- }, Me = /* @__PURE__ */ D({
253
- __name: "index",
254
- setup(c) {
255
- const V = H("form"), O = ee("addonList"), b = async () => {
256
- const n = Math.random().toString(36).substr(2, 9);
257
- V.addOns.push({
258
- id: n,
259
- name: "",
260
- description: "",
261
- price: 0,
262
- required: !1
263
- }), O.value?.openAddons.push(n), await te(), document.getElementById(`addon-${n}`)?.scrollIntoView({ behavior: "smooth", block: "start" });
264
- };
265
- return (n, p) => {
266
- const x = m("Label"), C = m("Button");
267
- return a(), r("div", null, [
268
- o("div", Re, [
269
- o("div", null, [
270
- e(x, { class: "text-base font-medium" }, {
271
- default: s(() => [...p[0] || (p[0] = [
272
- d(" Optional Add-ons & Upcharges ", -1)
273
- ])]),
274
- _: 1
275
- }),
276
- p[1] || (p[1] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Offer optional extras that customers can add to their booking (e.g., swimsuit rental). ", -1))
277
- ]),
278
- e(C, {
279
- onClick: b,
280
- variant: "outline",
281
- size: "sm"
282
- }, {
283
- default: s(() => [
284
- e(y(G), { class: "w-4 h-4 mr-2" }),
285
- p[2] || (p[2] = d(" Add Add-on ", -1))
286
- ]),
287
- _: 1
288
- })
289
- ]),
290
- o("div", $e, [
291
- e(Te, {
292
- ref_key: "addonList",
293
- ref: O
294
- }, null, 512),
295
- y(V).addOns.length === 0 ? (a(), r("div", De, ' No add-ons configured. Click "Add Add-on" to create optional extras. ')) : w("", !0)
296
- ])
297
- ]);
298
- };
299
- }
300
- }), Le = {
301
- key: 0,
302
- class: "max-w-2xl space-y-12"
303
- }, Be = { class: "flex gap-4 items-end" }, ze = { class: "w-32" }, Ee = { class: "flex items-center justify-between mb-4 gap-4" }, Ne = { class: "space-y-3" }, je = { class: "flex-1 space-y-3" }, qe = { class: "flex gap-3" }, Fe = { class: "flex-1" }, Ge = { class: "flex items-end" }, He = { class: "flex items-center justify-between mb-4" }, We = { class: "space-y-3" }, Ye = { class: "flex-1 space-y-3" }, Ke = { class: "grid grid-cols-2 gap-3" }, Qe = { class: "grid grid-cols-2 gap-3" }, Je = { key: 0 }, Xe = { class: "flex items-center gap-2" }, Ze = { key: 0 }, et = { key: 1 }, tt = { key: 2 }, nt = { class: "space-y-1" }, ot = ["onClick"], st = { class: "size-5 rounded-full bg-muted flex items-center justify-center" }, lt = {
304
- key: 0,
305
- class: "w-full h-full rounded-full bg-white scale-50"
306
- }, dt = ["onClick"], it = { class: "text-sm flex-1 truncate" }, at = {
307
- key: 0,
308
- class: "w-3 h-3 text-white",
309
- fill: "none",
310
- viewBox: "0 0 24 24",
311
- stroke: "currentColor"
312
- }, rt = {
313
- key: 0,
314
- class: "text-center py-8 text-muted-foreground text-sm border rounded-lg"
315
- }, ut = {
316
- key: 0,
317
- class: "mt-6 p-4 border rounded-lg bg-muted/30"
318
- }, mt = { class: "space-y-4" }, ct = { class: "flex items-center gap-3" }, pt = { class: "flex-1" }, ft = { class: "text-sm text-muted-foreground" }, gt = { class: "text-xs text-muted-foreground" }, vt = { class: "flex justify-start pt-4 border-t" }, Ct = /* @__PURE__ */ D({
319
- __name: "payment",
320
- setup(c) {
321
- const { params: V } = ue(), { config: O } = me(), b = ce(O.project), n = ne({
322
- paymentType: "full",
323
- currency: "USD",
324
- partialPayment: {
325
- type: "percentage",
326
- amount: 50
327
- },
328
- pricingOptions: [
329
- {
330
- id: "1",
331
- name: "Standard Service",
332
- price: 0,
333
- isDefault: !0
334
- }
335
- ],
336
- pricingRules: [],
337
- addOns: []
338
- }), p = T(!1), x = T(!0), C = T([]), S = (i, t) => {
339
- if (!i.resourceIds)
340
- i.resourceIds = [t];
341
- else {
342
- const f = i.resourceIds.indexOf(t);
343
- f === -1 ? i.resourceIds.push(t) : i.resourceIds.splice(f, 1);
344
- }
345
- }, g = (i, t) => {
346
- i.resourceIds = t ? null : [];
347
- }, h = async () => {
348
- p.value = !0;
349
- try {
350
- const i = V.value.id;
351
- if (!i) throw new Error("Missing agenda ID");
352
- await b.update(O.agendaCollection, i, {
353
- paymentType: n.paymentType || "full",
354
- currency: n.currency || "USD",
355
- partialPayment: {
356
- type: n.partialPayment.type || "percentage",
357
- amount: Math.max(Number(n.partialPayment.amount) || 0, 0)
358
- },
359
- pricingOptions: n.pricingOptions ?? [],
360
- pricingRules: n.pricingRules ?? [],
361
- addOns: n.addOns ?? []
362
- });
363
- } catch (i) {
364
- console.error("Error saving changes:", i);
365
- } finally {
366
- p.value = !1;
367
- }
368
- }, M = () => {
369
- const i = Math.random().toString(36).substr(2, 9);
370
- n.pricingOptions.push({
371
- id: i,
372
- name: "",
373
- price: 0,
374
- isDefault: !1
375
- });
376
- }, L = (i) => {
377
- n.pricingOptions = n.pricingOptions.filter((t) => t.id !== i);
378
- }, B = (i) => {
379
- n.pricingOptions.forEach((t) => {
380
- t.isDefault = t.id === i;
381
- });
382
- }, z = () => {
383
- const i = Math.random().toString(36).substr(2, 9);
384
- n.pricingRules.push({
385
- id: i,
386
- name: "",
387
- condition: "time_after",
388
- // time_after, time_before, day_of_week, etc.
389
- conditionValue: "17:00",
390
- modifier: "fixed",
391
- // 'fixed' or 'percentage'
392
- amount: 10,
393
- resourceIds: null
394
- // null = all resources
395
- });
396
- }, v = (i) => {
397
- n.pricingRules = n.pricingRules.filter((t) => t.id !== i);
398
- };
399
- return (async () => {
400
- try {
401
- const i = await b.get(O.agendaCollection, V.value.id);
402
- i && (n.paymentType = i.paymentType || "full", n.currency = i.currency || "USD", n.partialPayment = {
403
- type: i.partialPayment?.type || "percentage",
404
- amount: Number(i.partialPayment?.amount) && i.partialPayment.amount > 0 ? parseFloat(i.partialPayment.amount) : 50
405
- }, n.pricingOptions = i.pricingOptions || [{
406
- id: "1",
407
- name: "Standard Service",
408
- price: 0,
409
- isDefault: !0
410
- }], n.pricingRules = i.pricingRules || [], n.addOns = i.addOns || [], C.value = (i.resources || []).filter((t) => t.isActive));
411
- } catch (i) {
412
- console.error("Error loading agenda data:", i);
413
- } finally {
414
- x.value = !1;
415
- }
416
- })(), oe("form", n), (i, t) => {
417
- const f = m("Label"), E = m("SelectValue"), N = m("SelectTrigger"), _ = m("SelectItem"), j = m("SelectContent"), q = m("Select"), I = m("Button"), P = m("Input"), Q = m("PopoverTrigger"), J = m("PopoverContent"), X = m("Popover"), U = m("RadioGroupItem"), W = m("RadioGroup");
418
- return a(), Y(le, null, {
419
- default: s(() => [
420
- t[41] || (t[41] = o("h1", { class: "text-lg font-medium mb-8" }, "Payment Settings", -1)),
421
- x.value ? w("", !0) : (a(), r("div", Le, [
422
- o("div", null, [
423
- o("div", Be, [
424
- o("div", ze, [
425
- e(f, { class: "text-base font-medium mb-2" }, {
426
- default: s(() => [...t[4] || (t[4] = [
427
- d(" Currency ", -1)
428
- ])]),
429
- _: 1
430
- }),
431
- e(q, {
432
- modelValue: n.currency,
433
- "onUpdate:modelValue": t[0] || (t[0] = (l) => n.currency = l)
434
- }, {
435
- default: s(() => [
436
- e(N, { id: "currency" }, {
437
- default: s(() => [
438
- e(E, { placeholder: "Currency" })
439
- ]),
440
- _: 1
441
- }),
442
- e(j, null, {
443
- default: s(() => [
444
- e(_, { value: "USD" }, {
445
- default: s(() => [...t[5] || (t[5] = [
446
- d("USD ($)", -1)
447
- ])]),
448
- _: 1
449
- }),
450
- e(_, { value: "EUR" }, {
451
- default: s(() => [...t[6] || (t[6] = [
452
- d("EUR (€)", -1)
453
- ])]),
454
- _: 1
455
- }),
456
- e(_, { value: "GBP" }, {
457
- default: s(() => [...t[7] || (t[7] = [
458
- d("GBP (£)", -1)
459
- ])]),
460
- _: 1
461
- }),
462
- e(_, { value: "CAD" }, {
463
- default: s(() => [...t[8] || (t[8] = [
464
- d("CAD ($)", -1)
465
- ])]),
466
- _: 1
467
- })
468
- ]),
469
- _: 1
470
- })
471
- ]),
472
- _: 1
473
- }, 8, ["modelValue"])
474
- ])
475
- ])
476
- ]),
477
- o("div", null, [
478
- o("div", Ee, [
479
- o("div", null, [
480
- e(f, { class: "text-base font-medium" }, {
481
- default: s(() => [...t[9] || (t[9] = [
482
- d(" Service Pricing Options ", -1)
483
- ])]),
484
- _: 1
485
- }),
486
- t[10] || (t[10] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Offer multiple service variations with different prices (e.g., haircut styles, massage types). ", -1))
487
- ]),
488
- e(I, {
489
- onClick: M,
490
- variant: "outline",
491
- size: "sm"
492
- }, {
493
- default: s(() => [
494
- e(y(G), { class: "w-4 h-4 mr-2" }),
495
- t[11] || (t[11] = d(" Add Option ", -1))
496
- ]),
497
- _: 1
498
- })
499
- ]),
500
- o("div", Ne, [
501
- (a(!0), r(A, null, R(n.pricingOptions, (l) => (a(), r("div", {
502
- key: l.id,
503
- class: "flex gap-3 items-start p-4 border rounded-lg"
504
- }, [
505
- o("div", je, [
506
- o("div", null, [
507
- e(f, { class: "text-xs mb-1 block" }, {
508
- default: s(() => [...t[12] || (t[12] = [
509
- d("Service Name", -1)
510
- ])]),
511
- _: 1
512
- }),
513
- e(P, {
514
- modelValue: l.name,
515
- "onUpdate:modelValue": (u) => l.name = u,
516
- placeholder: "e.g., Men's Haircut, Women's Haircut"
517
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
518
- ]),
519
- o("div", qe, [
520
- o("div", Fe, [
521
- e(f, { class: "text-xs mb-1 block" }, {
522
- default: s(() => [...t[13] || (t[13] = [
523
- d("Price", -1)
524
- ])]),
525
- _: 1
526
- }),
527
- e(P, {
528
- modelValue: l.price,
529
- "onUpdate:modelValue": (u) => l.price = u,
530
- modelModifiers: { number: !0 },
531
- type: "number",
532
- min: "0",
533
- step: "0.01",
534
- placeholder: "0.00",
535
- class: "no-spinner"
536
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
537
- ]),
538
- o("div", Ge, [
539
- e(I, {
540
- onClick: (u) => B(l.id),
541
- variant: l.isDefault ? "default" : "outline",
542
- size: "sm"
543
- }, {
544
- default: s(() => [
545
- d(k(l.isDefault ? "Default" : "Set Default"), 1)
546
- ]),
547
- _: 2
548
- }, 1032, ["onClick", "variant"])
549
- ])
550
- ])
551
- ]),
552
- n.pricingOptions.length > 1 ? (a(), Y(I, {
553
- key: 0,
554
- onClick: (u) => L(l.id),
555
- variant: "ghost",
556
- size: "icon",
557
- class: "mt-6"
558
- }, {
559
- default: s(() => [
560
- e(y(F), { class: "w-4 h-4 text-destructive" })
561
- ]),
562
- _: 1
563
- }, 8, ["onClick"])) : w("", !0)
564
- ]))), 128))
565
- ])
566
- ]),
567
- o("div", null, [
568
- o("div", He, [
569
- o("div", null, [
570
- e(f, { class: "text-base font-medium" }, {
571
- default: s(() => [...t[14] || (t[14] = [
572
- d(" Conditional Pricing Rules ", -1)
573
- ])]),
574
- _: 1
575
- }),
576
- t[15] || (t[15] = o("p", { class: "text-sm text-muted-foreground mt-1" }, " Add extra fees based on time, day, or other conditions (e.g., +€10 after 5pm). ", -1))
577
- ]),
578
- e(I, {
579
- onClick: z,
580
- variant: "outline",
581
- size: "sm"
582
- }, {
583
- default: s(() => [
584
- e(y(G), { class: "w-4 h-4 mr-2" }),
585
- t[16] || (t[16] = d(" Add Rule ", -1))
586
- ]),
587
- _: 1
588
- })
589
- ]),
590
- o("div", We, [
591
- (a(!0), r(A, null, R(n.pricingRules, (l) => (a(), r("div", {
592
- key: l.id,
593
- class: "flex gap-3 items-start p-4 border rounded-lg"
594
- }, [
595
- o("div", Ye, [
596
- o("div", null, [
597
- e(f, { class: "text-xs mb-1 block" }, {
598
- default: s(() => [...t[17] || (t[17] = [
599
- d("Rule Name", -1)
600
- ])]),
601
- _: 1
602
- }),
603
- e(P, {
604
- modelValue: l.name,
605
- "onUpdate:modelValue": (u) => l.name = u,
606
- placeholder: "e.g., After Hours Fee, Weekend Surcharge"
607
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
608
- ]),
609
- o("div", Ke, [
610
- o("div", null, [
611
- e(f, { class: "text-xs mb-1 block" }, {
612
- default: s(() => [...t[18] || (t[18] = [
613
- d("Condition", -1)
614
- ])]),
615
- _: 1
616
- }),
617
- e(q, {
618
- modelValue: l.condition,
619
- "onUpdate:modelValue": (u) => l.condition = u
620
- }, {
621
- default: s(() => [
622
- e(N, null, {
623
- default: s(() => [
624
- e(E, { placeholder: "Select condition" })
625
- ]),
626
- _: 1
627
- }),
628
- e(j, null, {
629
- default: s(() => [
630
- e(_, { value: "time_after" }, {
631
- default: s(() => [...t[19] || (t[19] = [
632
- d("Time After", -1)
633
- ])]),
634
- _: 1
635
- }),
636
- e(_, { value: "time_before" }, {
637
- default: s(() => [...t[20] || (t[20] = [
638
- d("Time Before", -1)
639
- ])]),
640
- _: 1
641
- }),
642
- e(_, { value: "time_between" }, {
643
- default: s(() => [...t[21] || (t[21] = [
644
- d("Time Between", -1)
645
- ])]),
646
- _: 1
647
- }),
648
- e(_, { value: "day_of_week" }, {
649
- default: s(() => [...t[22] || (t[22] = [
650
- d("Day of Week", -1)
651
- ])]),
652
- _: 1
653
- }),
654
- e(_, { value: "date_range" }, {
655
- default: s(() => [...t[23] || (t[23] = [
656
- d("Date Range", -1)
657
- ])]),
658
- _: 1
659
- })
660
- ]),
661
- _: 1
662
- })
663
- ]),
664
- _: 1
665
- }, 8, ["modelValue", "onUpdate:modelValue"])
666
- ]),
667
- o("div", null, [
668
- e(f, { class: "text-xs mb-1 block" }, {
669
- default: s(() => [...t[24] || (t[24] = [
670
- d("Value", -1)
671
- ])]),
672
- _: 1
673
- }),
674
- e(P, {
675
- modelValue: l.conditionValue,
676
- "onUpdate:modelValue": (u) => l.conditionValue = u,
677
- type: l.condition.includes("time") ? "time" : "text",
678
- placeholder: "e.g., 17:00"
679
- }, null, 8, ["modelValue", "onUpdate:modelValue", "type"])
680
- ])
681
- ]),
682
- o("div", Qe, [
683
- o("div", null, [
684
- e(f, { class: "text-xs mb-1 block" }, {
685
- default: s(() => [...t[25] || (t[25] = [
686
- d("Fee Type", -1)
687
- ])]),
688
- _: 1
689
- }),
690
- e(q, {
691
- modelValue: l.modifier,
692
- "onUpdate:modelValue": (u) => l.modifier = u
693
- }, {
694
- default: s(() => [
695
- e(N, null, {
696
- default: s(() => [
697
- e(E, { placeholder: "Select type" })
698
- ]),
699
- _: 1
700
- }),
701
- e(j, null, {
702
- default: s(() => [
703
- e(_, { value: "fixed" }, {
704
- default: s(() => [...t[26] || (t[26] = [
705
- d("Fixed Amount", -1)
706
- ])]),
707
- _: 1
708
- }),
709
- e(_, { value: "percentage" }, {
710
- default: s(() => [...t[27] || (t[27] = [
711
- d("Percentage", -1)
712
- ])]),
713
- _: 1
714
- })
715
- ]),
716
- _: 1
717
- })
718
- ]),
719
- _: 1
720
- }, 8, ["modelValue", "onUpdate:modelValue"])
721
- ]),
722
- o("div", null, [
723
- e(f, { class: "text-xs mb-1 block" }, {
724
- default: s(() => [...t[28] || (t[28] = [
725
- d("Amount", -1)
726
- ])]),
727
- _: 1
728
- }),
729
- e(P, {
730
- modelValue: l.amount,
731
- "onUpdate:modelValue": (u) => l.amount = u,
732
- modelModifiers: { number: !0 },
733
- type: "number",
734
- min: "0",
735
- step: "0.01",
736
- class: "no-spinner",
737
- placeholder: l.modifier === "percentage" ? "10 (%)" : "10.00"
738
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
739
- ])
740
- ]),
741
- C.value.length > 0 ? (a(), r("div", Je, [
742
- e(f, { class: "text-xs mb-1 block" }, {
743
- default: s(() => [...t[29] || (t[29] = [
744
- d("Apply To Resources", -1)
745
- ])]),
746
- _: 1
747
- }),
748
- e(X, null, {
749
- default: s(() => [
750
- e(Q, { "as-child": "" }, {
751
- default: s(() => [
752
- e(I, {
753
- variant: "outline",
754
- class: "w-full justify-between font-normal"
755
- }, {
756
- default: s(() => [
757
- o("div", Xe, [
758
- e(y(K), { class: "w-4 h-4 text-muted-foreground" }),
759
- !l.resourceIds || l.resourceIds.length === 0 ? (a(), r("span", Ze, "All Resources")) : l.resourceIds.length === 1 ? (a(), r("span", et, k(C.value.find((u) => u.id === l.resourceIds[0])?.name || "1 resource"), 1)) : (a(), r("span", tt, k(l.resourceIds.length) + " resources", 1))
760
- ]),
761
- e(y(ae), { class: "w-4 h-4 opacity-50" })
762
- ]),
763
- _: 2
764
- }, 1024)
765
- ]),
766
- _: 2
767
- }, 1024),
768
- e(J, {
769
- class: "w-64 p-2",
770
- align: "start"
771
- }, {
772
- default: s(() => [
773
- o("div", nt, [
774
- o("div", {
775
- class: $(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors", { "bg-muted": !l.resourceIds || l.resourceIds.length === 0 }]),
776
- onClick: (u) => g(l, !0)
777
- }, [
778
- o("div", st, [
779
- e(y(K), { class: "w-3 h-3 text-muted-foreground" })
780
- ]),
781
- t[30] || (t[30] = o("span", { class: "text-sm flex-1" }, "All Resources", -1)),
782
- o("div", {
783
- class: $(["size-4 rounded-full border-2", !l.resourceIds || l.resourceIds.length === 0 ? "border-primary bg-primary" : "border-muted-foreground"])
784
- }, [
785
- !l.resourceIds || l.resourceIds.length === 0 ? (a(), r("div", lt)) : w("", !0)
786
- ], 2)
787
- ], 10, ot),
788
- t[32] || (t[32] = o("div", { class: "border-t my-2" }, null, -1)),
789
- (a(!0), r(A, null, R(C.value, (u) => (a(), r("div", {
790
- key: u.id,
791
- class: "flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",
792
- onClick: (yt) => {
793
- g(l, !1), S(l, u.id);
794
- }
795
- }, [
796
- o("div", {
797
- class: "size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",
798
- style: se({ backgroundColor: u.color || "#6b7280" })
799
- }, k(u.avatarLabel || u.name.charAt(0).toUpperCase()), 5),
800
- o("span", it, k(u.name), 1),
801
- o("div", {
802
- class: $(["size-4 rounded border-2 flex items-center justify-center", l.resourceIds?.includes(u.id) ? "border-primary bg-primary" : "border-muted-foreground"])
803
- }, [
804
- l.resourceIds?.includes(u.id) ? (a(), r("svg", at, [...t[31] || (t[31] = [
805
- o("path", {
806
- "stroke-linecap": "round",
807
- "stroke-linejoin": "round",
808
- "stroke-width": "3",
809
- d: "M5 13l4 4L19 7"
810
- }, null, -1)
811
- ])])) : w("", !0)
812
- ], 2)
813
- ], 8, dt))), 128))
814
- ])
815
- ]),
816
- _: 2
817
- }, 1024)
818
- ]),
819
- _: 2
820
- }, 1024)
821
- ])) : w("", !0)
822
- ]),
823
- e(I, {
824
- onClick: (u) => v(l.id),
825
- variant: "ghost",
826
- size: "icon",
827
- class: "mt-6"
828
- }, {
829
- default: s(() => [
830
- e(y(F), { class: "w-4 h-4 text-destructive" })
831
- ]),
832
- _: 1
833
- }, 8, ["onClick"])
834
- ]))), 128)),
835
- n.pricingRules.length === 0 ? (a(), r("div", rt, ' No pricing rules configured. Click "Add Rule" to create conditional fees. ')) : w("", !0)
836
- ])
837
- ]),
838
- e(Me),
839
- o("div", null, [
840
- e(f, { class: "text-base font-medium" }, {
841
- default: s(() => [...t[33] || (t[33] = [
842
- d(" Payment Preferences ", -1)
843
- ])]),
844
- _: 1
845
- }),
846
- t[40] || (t[40] = o("p", { class: "text-sm text-muted-foreground mb-6" }, " Let customers pay full or in part when booking a slot, or pay later. ", -1)),
847
- e(W, {
848
- modelValue: n.paymentType,
849
- "onUpdate:modelValue": t[1] || (t[1] = (l) => n.paymentType = l),
850
- class: "flex flex-col gap-4"
851
- }, {
852
- default: s(() => [
853
- e(f, {
854
- for: "r1",
855
- class: "flex items-start space-x-2 cursor-pointer"
856
- }, {
857
- default: s(() => [
858
- e(U, {
859
- id: "r1",
860
- value: "full"
861
- }),
862
- t[34] || (t[34] = o("div", null, [
863
- o("p", null, "Pay Full Amount when Booking"),
864
- o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers are required to complete the payment to confirm their booking. ")
865
- ], -1))
866
- ]),
867
- _: 1
868
- }),
869
- e(f, {
870
- for: "r2",
871
- class: "flex items-start space-x-2 cursor-pointer"
872
- }, {
873
- default: s(() => [
874
- e(U, {
875
- id: "r2",
876
- value: "partial"
877
- }),
878
- t[35] || (t[35] = o("div", null, [
879
- o("p", null, "Pay Part Amount when Booking"),
880
- o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers are required to pay a deposit to confirm their booking. ")
881
- ], -1))
882
- ]),
883
- _: 1
884
- }),
885
- e(f, {
886
- for: "r3",
887
- class: "flex items-start space-x-2 cursor-pointer"
888
- }, {
889
- default: s(() => [
890
- e(U, {
891
- id: "r3",
892
- value: "later"
893
- }),
894
- t[36] || (t[36] = o("div", null, [
895
- o("p", null, "Pay Later at Appointment"),
896
- o("p", { class: "text-sm text-muted-foreground mt-1" }, " Your customers can book now and pay in person at the time of their appointment. ")
897
- ], -1))
898
- ]),
899
- _: 1
900
- })
901
- ]),
902
- _: 1
903
- }, 8, ["modelValue"]),
904
- n.paymentType === "partial" ? (a(), r("div", ut, [
905
- e(f, { class: "text-sm font-medium mb-4 block" }, {
906
- default: s(() => [...t[37] || (t[37] = [
907
- d(" Deposit Amount Configuration ", -1)
908
- ])]),
909
- _: 1
910
- }),
911
- o("div", mt, [
912
- e(W, {
913
- modelValue: n.partialPayment.type,
914
- "onUpdate:modelValue": t[2] || (t[2] = (l) => n.partialPayment.type = l),
915
- class: "flex gap-4"
916
- }, {
917
- default: s(() => [
918
- e(f, { class: "flex items-center space-x-2 cursor-pointer" }, {
919
- default: s(() => [
920
- e(U, { value: "percentage" }),
921
- t[38] || (t[38] = o("span", null, "Percentage", -1))
922
- ]),
923
- _: 1
924
- }),
925
- e(f, { class: "flex items-center space-x-2 cursor-pointer" }, {
926
- default: s(() => [
927
- e(U, { value: "fixed" }),
928
- t[39] || (t[39] = o("span", null, "Fixed Amount", -1))
929
- ]),
930
- _: 1
931
- })
932
- ]),
933
- _: 1
934
- }, 8, ["modelValue"]),
935
- o("div", ct, [
936
- o("div", pt, [
937
- e(P, {
938
- modelValue: n.partialPayment.amount,
939
- "onUpdate:modelValue": t[3] || (t[3] = (l) => n.partialPayment.amount = l),
940
- modelModifiers: { number: !0 },
941
- type: "number",
942
- min: "0",
943
- max: n.partialPayment.type === "percentage" ? 100 : void 0,
944
- step: "0.01",
945
- placeholder: n.partialPayment.type === "percentage" ? "50" : "10.00",
946
- class: "no-spinner"
947
- }, null, 8, ["modelValue", "max", "placeholder"])
948
- ]),
949
- o("span", ft, k(n.partialPayment.type === "percentage" ? "%" : n.currency), 1)
950
- ]),
951
- o("p", gt, [
952
- n.partialPayment.type === "percentage" ? (a(), r(A, { key: 0 }, [
953
- d(" Customers will pay " + k(n.partialPayment.amount) + "% of the total price upfront. ", 1)
954
- ], 64)) : (a(), r(A, { key: 1 }, [
955
- d(" Customers will pay " + k(n.currency) + " " + k(n.partialPayment.amount) + " upfront. ", 1)
956
- ], 64))
957
- ])
958
- ])
959
- ])) : w("", !0)
960
- ]),
961
- o("div", vt, [
962
- e(I, {
963
- onClick: h,
964
- disabled: p.value
965
- }, {
966
- default: s(() => [
967
- d(k(p.value ? "Saving..." : "Save Changes"), 1)
968
- ]),
969
- _: 1
970
- }, 8, ["disabled"])
971
- ])
972
- ]))
973
- ]),
974
- _: 1
975
- });
976
- };
977
- }
978
- });
979
- export {
980
- Ct as default
981
- };