@oneclick.dev/cms-core-modules 0.0.52 → 0.0.54

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 (128) hide show
  1. package/dist/CalendarDate-CRT2Viyt.mjs +830 -0
  2. package/dist/CalendarDate-CWtpXgpD.js +1 -0
  3. package/dist/Components-D9yIIosM.mjs +623 -0
  4. package/dist/Components-DXbx0RLV.js +1 -0
  5. package/dist/ContentEditor-DRJFQKCv.mjs +34915 -0
  6. package/dist/ContentEditor-DzTi8fSZ.js +290 -0
  7. package/dist/Create-BP8TX6rj.js +1 -0
  8. package/dist/Create-Bwf1RXdG.mjs +1248 -0
  9. package/dist/DateFormatter-BbcSwTs4.js +1 -0
  10. package/dist/DateFormatter-CbO0PVUK.mjs +99 -0
  11. package/dist/Detail-B-PnkcXD.mjs +3473 -0
  12. package/dist/Detail-BVlGSjOq.mjs +380 -0
  13. package/dist/Detail-C4E1T87K.mjs +26 -0
  14. package/dist/Detail-CNfTDUE5.js +1 -0
  15. package/dist/Detail-Cd5CBVN0.js +1 -0
  16. package/dist/Detail-CpfOQChd.mjs +585 -0
  17. package/dist/Detail-CwagT6gQ.mjs +650 -0
  18. package/dist/Detail-DUo6qKqO.js +1 -0
  19. package/dist/Detail-Dd_OkpcN.js +1 -0
  20. package/dist/Detail-mvSGbnFU.js +1 -0
  21. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +1 -0
  22. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +55 -0
  23. package/dist/Entries-DcpPvlYj.js +1 -0
  24. package/dist/Entries-QLMtTYLX.mjs +713 -0
  25. package/dist/Find-BPR0uU-Z.mjs +229 -0
  26. package/dist/Find-BidEQJxT.js +1 -0
  27. package/dist/GlobalStyling-CMzPRd18.js +17 -0
  28. package/dist/GlobalStyling-DoLHUJeV.mjs +988 -0
  29. package/dist/Overview-BDlBCUI_.js +1 -0
  30. package/dist/Overview-BH3NwvNX.mjs +26 -0
  31. package/dist/Overview-BLsZMHNW.mjs +178 -0
  32. package/dist/Overview-BNMZ9MUK.js +1 -0
  33. package/dist/Overview-BbvfH1u-.js +1 -0
  34. package/dist/Overview-CDN88OSM.mjs +190 -0
  35. package/dist/Overview-CEPodGCn.mjs +311 -0
  36. package/dist/Overview-CvquDPhB.js +1 -0
  37. package/dist/Overview-D54pjmI6.mjs +633 -0
  38. package/dist/Overview-D67UjG6n.mjs +947 -0
  39. package/dist/Overview-KT2Mgfh5.js +1 -0
  40. package/dist/Overview-T-lsy3UZ.js +1 -0
  41. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +1 -0
  42. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +392 -0
  43. package/dist/TableView-CpO53xcX.js +111 -0
  44. package/dist/TableView-D9J5rUls.mjs +72921 -0
  45. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
  46. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs +40 -0
  47. package/dist/View-DlHBZbFu.js +1 -0
  48. package/dist/View-Dv5QMrSn.mjs +25 -0
  49. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  50. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  51. package/dist/agenda-B49oKGeh.mjs +706 -0
  52. package/dist/agenda-DipQ5IWP.js +1 -0
  53. package/dist/availability-C7q9tq6l.js +1 -0
  54. package/dist/availability-DeCkqiu8.mjs +613 -0
  55. package/dist/cms-core-modules.css +1 -1
  56. package/dist/countries-BTPvmrsb.mjs +4 -0
  57. package/dist/countries-CgZ081No.js +1 -0
  58. package/dist/exceptions-D3b18TiY.mjs +647 -0
  59. package/dist/exceptions-DJ9zWX3k.js +1 -0
  60. package/dist/floating-ui.dom-C82nbomj.js +1 -0
  61. package/dist/floating-ui.dom-ouSgPqty.mjs +1133 -0
  62. package/dist/google-CvtuJwgk.mjs +4 -0
  63. package/dist/google-D4N3gb01.js +1 -0
  64. package/dist/index--jjEzba7.mjs +24 -0
  65. package/dist/index-9HVlmvK3.js +1 -0
  66. package/dist/index-BEGU8Kme.mjs +12 -0
  67. package/dist/index-Bwi1mtkq.mjs +24 -0
  68. package/dist/index-BzuHN-r8.mjs +24 -0
  69. package/dist/index-CImCyE3L.mjs +24 -0
  70. package/dist/index-CKPshlZ8-BQiiP6r_.mjs +1264 -0
  71. package/dist/index-CKPshlZ8-CIz1tDwX.js +1 -0
  72. package/dist/index-CQiY-oTN.mjs +24 -0
  73. package/dist/index-CSxYBeVA.js +1 -0
  74. package/dist/index-CkiNvRzs.js +1 -0
  75. package/dist/index-Co4ON2Di.js +1 -0
  76. package/dist/index-CwqrAU-H.js +1 -0
  77. package/dist/index-Cz-baGax.js +1 -0
  78. package/dist/index-D2a6wEPh.js +1 -0
  79. package/dist/index-DFQGVHTs.js +1 -0
  80. package/dist/index-DI6mydpm.mjs +138 -0
  81. package/dist/index-DMoyoaks.mjs +22 -0
  82. package/dist/index-DT1wWnUk.mjs +24 -0
  83. package/dist/index-DUeFrD-B.js +1 -0
  84. package/dist/index-DsnoK4ia.mjs +579 -0
  85. package/dist/index-R2oUDsjx.js +1 -0
  86. package/dist/index-RLz1QPrf.mjs +203 -0
  87. package/dist/index-UtjLbLw-.js +1 -0
  88. package/dist/index-_mG-aU3Z.mjs +87 -0
  89. package/dist/index-_sQDF1pH.js +1 -0
  90. package/dist/index-ijdf0d9-.js +1 -0
  91. package/dist/index-klI238nT.mjs +24 -0
  92. package/dist/index.cjs.js +1 -357
  93. package/dist/index.mjs +287 -69281
  94. package/dist/interpolation-BNUjI7LH.js +1 -0
  95. package/dist/interpolation-BpGXqOz8.mjs +59 -0
  96. package/dist/payment-kTjsV0Jj.js +1 -0
  97. package/dist/payment-zpCM0LD-.mjs +981 -0
  98. package/dist/regular-C4_3YXqx.mjs +602 -0
  99. package/dist/regular-DFwPEbZO.js +1 -0
  100. package/dist/regular-slots-4ooEpICB.mjs +67 -0
  101. package/dist/regular-slots-BAVGbomI.js +1 -0
  102. package/dist/resources-MpQkSstv.mjs +563 -0
  103. package/dist/resources-iM28T3dD.js +1 -0
  104. package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +12 -2
  105. package/dist/src/appointments/index.d.ts +4 -28
  106. package/dist/src/appointments/routes.d.ts +3 -9
  107. package/dist/src/content-manager/index.d.ts +5 -147
  108. package/dist/src/content-manager/routes.d.ts +4 -128
  109. package/dist/src/custom/index.d.ts +2 -2
  110. package/dist/src/custom/routes.d.ts +1 -1
  111. package/dist/src/lib/interpolation.d.ts +2 -2
  112. package/dist/src/mail-templates/index.d.ts +2 -30
  113. package/dist/src/mail-templates/routes.d.ts +1 -11
  114. package/dist/src/product-collections/index.d.ts +2 -30
  115. package/dist/src/product-collections/routes.d.ts +1 -11
  116. package/dist/src/products/index.d.ts +2 -30
  117. package/dist/src/products/routes.d.ts +1 -11
  118. package/dist/src/promo-codes/index.d.ts +2 -30
  119. package/dist/src/promo-codes/routes.d.ts +1 -11
  120. package/dist/src/shipping-options/index.d.ts +2 -30
  121. package/dist/src/shipping-options/routes.d.ts +1 -11
  122. package/dist/src/table/index.d.ts +2 -70
  123. package/dist/src/table/routes.d.ts +1 -51
  124. package/dist/utils-BVKy9S2J.mjs +29 -0
  125. package/dist/utils-D6CaKJbp.js +2 -0
  126. package/dist/vee-validate-zod-BPQyEfpF.js +1 -0
  127. package/dist/vee-validate-zod-IXkfh-6Q.mjs +4402 -0
  128. package/package.json +28 -29
@@ -0,0 +1,633 @@
1
+ import { defineComponent as G, resolveComponent as n, createElementBlock as k, openBlock as c, Fragment as te, renderList as le, createBlock as w, unref as b, withCtx as l, createElementVNode as o, normalizeClass as oe, resolveDynamicComponent as ne, createCommentVNode as U, toDisplayString as P, createVNode as t, withModifiers as Ee, createTextVNode as d, ref as v, computed as q, useTemplateRef as Se, onMounted as De } from "vue";
2
+ import { icons as ae, EllipsisVertical as Te, Paintbrush as Pe, ToyBrick as Me, Plus as Ue } from "lucide-vue-next";
3
+ import { useModuleRoute as se, useConfirmation as ie, useModuleStorage as $e, useModulePermissions as Ne, useModuleBreadcrumbs as Ae, useFirebaseIntegration as Re } from "@oneclick.dev/cms-kit";
4
+ import { i as Le } from "./interpolation-BpGXqOz8.mjs";
5
+ import { t as z } from "./index-RLz1QPrf.mjs";
6
+ const Be = { class: "grid @lg:grid-cols-2 @2xl:grid-cols-3 @4xl:grid-cols-4 @7xl:grid-cols-5 gap-4" }, Ie = { class: "relative flex pl-3 @5xl:pl-6 pr-1.5 @5xl:pr-3 gap-3" }, Fe = { class: "self-center overflow-hidden w-full group-hover:w-[calc(100%-6.5rem)]" }, ze = ["title"], Oe = ["title"], je = { class: "absolute -top-1 right-2 self-start opacity-0 group-hover:opacity-100" }, qe = /* @__PURE__ */ G({
7
+ __name: "CollectionsGridView",
8
+ props: {
9
+ collections: {
10
+ type: Array,
11
+ required: !0
12
+ }
13
+ },
14
+ emits: ["edit", "delete"],
15
+ setup(M, { emit: V }) {
16
+ const { navigateTo: $ } = se(), N = V;
17
+ return (I, g) => {
18
+ const R = n("Button"), y = n("DropdownMenuTrigger"), m = n("DropdownMenuItem"), E = n("DropdownMenuContent"), C = n("DropdownMenu"), _ = n("Card");
19
+ return c(), k("div", Be, [
20
+ (c(!0), k(te, null, le(M.collections, (u) => (c(), w(_, {
21
+ key: u.id,
22
+ class: "group hover:bg-input/50 cursor-pointer transition-colors duration-200",
23
+ onClick: (x) => b($)("collections/" + u.id)
24
+ }, {
25
+ default: l(() => [
26
+ o("div", Ie, [
27
+ o("div", {
28
+ class: oe(`p-2 bg-${u.tint} rounded-md self-center mr-3`)
29
+ }, [
30
+ (c(), w(ne(b(ae)[u.icon]), { class: "size-6 text-white" }))
31
+ ], 2),
32
+ o("div", Fe, [
33
+ o("p", {
34
+ class: "truncate",
35
+ title: u.name || "Unnamed Entry Collection"
36
+ }, P(u.name || "Unnamed Entry Collection"), 9, ze),
37
+ u.contentEntryName || u.contentEntryNamePlural ? (c(), k("p", {
38
+ key: 0,
39
+ class: "text-xs text-muted-foreground truncate",
40
+ title: `Manage ${u.contentEntryNamePlural || u.contentEntryName} here`
41
+ }, " Manage " + P(u.contentEntryNamePlural || u.contentEntryName) + " here ", 9, Oe)) : U("", !0)
42
+ ]),
43
+ o("div", je, [
44
+ t(C, null, {
45
+ default: l(() => [
46
+ t(y, { "as-child": "" }, {
47
+ default: l(() => [
48
+ t(R, {
49
+ variant: "ghost",
50
+ size: "icon",
51
+ onClick: g[0] || (g[0] = Ee(() => {
52
+ }, ["stop"]))
53
+ }, {
54
+ default: l(() => [
55
+ t(b(Te), { class: "size-5" })
56
+ ]),
57
+ _: 1
58
+ })
59
+ ]),
60
+ _: 1
61
+ }),
62
+ t(E, null, {
63
+ default: l(() => [
64
+ t(m, {
65
+ onClick: (x) => b($)("collections/" + u.id)
66
+ }, {
67
+ default: l(() => [...g[1] || (g[1] = [
68
+ d("Open Collection...", -1)
69
+ ])]),
70
+ _: 1
71
+ }, 8, ["onClick"]),
72
+ t(m, {
73
+ onClick: (x) => N("edit", u)
74
+ }, {
75
+ default: l(() => [...g[2] || (g[2] = [
76
+ d("Edit Collection...", -1)
77
+ ])]),
78
+ _: 1
79
+ }, 8, ["onClick"]),
80
+ t(m, {
81
+ onClick: (x) => N("delete", u.id),
82
+ variant: "destructive"
83
+ }, {
84
+ default: l(() => [...g[3] || (g[3] = [
85
+ d("Delete Collection...", -1)
86
+ ])]),
87
+ _: 1
88
+ }, 8, ["onClick"])
89
+ ]),
90
+ _: 2
91
+ }, 1024)
92
+ ]),
93
+ _: 2
94
+ }, 1024)
95
+ ])
96
+ ])
97
+ ]),
98
+ _: 2
99
+ }, 1032, ["onClick"]))), 128))
100
+ ]);
101
+ };
102
+ }
103
+ }), Ge = { class: "grid py-4" }, We = { class: "flex gap-6 mb-6" }, He = { class: "w-1/3" }, Je = { class: "w-1/3" }, Ke = { class: "w-1/3" }, Qe = { class: "grid" }, Xe = { class: "flex gap-6 mb-6" }, Ye = { class: "w-1/2" }, Ze = { class: "w-1/2" }, he = { class: "flex items-center gap-2" }, et = { class: "flex items-center gap-4" }, tt = { class: "grid grid-cols-2 gap-4" }, lt = { class: "grid" }, ot = { class: "mb-6" }, nt = { class: "flex items-center justify-between gap-4 flex-wrap" }, at = {
104
+ key: 0,
105
+ class: "text-xs italic text-muted-foreground mt-1"
106
+ }, st = { class: "flex items-center justify-between gap-4 flex-wrap" }, it = {
107
+ key: 0,
108
+ class: "text-xs italic text-muted-foreground mt-1"
109
+ }, ut = /* @__PURE__ */ G({
110
+ __name: "CollectionDialog",
111
+ props: {
112
+ config: {
113
+ type: Object,
114
+ required: !0
115
+ },
116
+ components: {
117
+ type: Array,
118
+ required: !0
119
+ }
120
+ },
121
+ emits: ["add", "edit", "delete"],
122
+ setup(M, { expose: V, emit: $ }) {
123
+ const N = [
124
+ { name: "id", type: "string" },
125
+ { name: "slug", type: "string" },
126
+ { name: "lang", type: "string" }
127
+ ], { confirm: I } = ie(), g = $, R = M, y = v(!1), m = v("create"), E = v(""), C = v(""), _ = v(""), u = v(""), x = v(""), T = v(""), S = v(!0), i = v(!1), a = v(null), p = v("{{ slug }}"), f = v("/{{ lang }}/{{ slug }}"), D = v("all"), A = v([]), W = q(() => J(p.value)), H = q(() => J(f.value));
128
+ function J(r) {
129
+ if (!r) return "";
130
+ let e = R.config.domain || "https://domain.com";
131
+ return e.endsWith("/") && (e = e.slice(0, -1)), r.startsWith("/") || (r = "/" + r), Le(e + r, [{ name: "slug", value: "example-slug" }, { name: "id", value: "12345" }, { name: "lang", value: "en" }]);
132
+ }
133
+ const ue = (r) => {
134
+ r ? (m.value = "edit", E.value = r.id, C.value = r.name || "", _.value = r.tint || "", u.value = r.icon || "", x.value = r.contentEntryName || "", T.value = r.contentEntryNamePlural || "", S.value = r.allowUserEntryManagement ?? !0, i.value = !!r.customSettings, a.value = r.customSettings || null, p.value = r.defaultLanguageRoutePattern || "{{ slug }}", f.value = r.multilingualRoutePattern || "/{{ lang }}/{{ slug }}", D.value = r.componentAvailability || "all", A.value = r.selectedComponents || []) : (m.value = "create", E.value = "", C.value = "", _.value = "", u.value = "", x.value = "", T.value = "", S.value = !0, i.value = !1, a.value = null, p.value = "{{ slug }}", f.value = "/{{ lang }}/{{ slug }}", D.value = "all", A.value = []), y.value = !0;
135
+ }, de = () => {
136
+ g("add", {
137
+ name: C.value,
138
+ tint: _.value,
139
+ icon: u.value,
140
+ contentEntryName: x.value,
141
+ contentEntryNamePlural: T.value,
142
+ allowUserEntryManagement: S.value,
143
+ showCustomSettings: i.value,
144
+ customSettings: i.value ? a.value : null,
145
+ defaultLanguageRoutePattern: p.value,
146
+ multilingualRoutePattern: f.value,
147
+ componentAvailability: D.value,
148
+ selectedComponents: D.value === "all" ? [] : A.value
149
+ }), y.value = !1;
150
+ }, re = () => {
151
+ g("edit", {
152
+ id: E.value,
153
+ name: C.value,
154
+ tint: _.value,
155
+ icon: u.value,
156
+ contentEntryName: x.value,
157
+ contentEntryNamePlural: T.value,
158
+ allowUserEntryManagement: S.value,
159
+ showCustomSettings: i.value,
160
+ customSettings: i.value ? a.value : null,
161
+ defaultLanguageRoutePattern: p.value,
162
+ multilingualRoutePattern: f.value,
163
+ componentAvailability: D.value,
164
+ selectedComponents: D.value === "all" ? [] : A.value
165
+ }), y.value = !1;
166
+ }, me = async () => {
167
+ await I("Are you sure you want to delete this collection? This action cannot be undone.", "Delete Collection", "Delete") && (g("delete", E.value), y.value = !1);
168
+ };
169
+ return V({
170
+ openDialog: ue
171
+ }), (r, e) => {
172
+ const ce = n("DialogTitle"), ve = n("DialogDescription"), pe = n("DialogHeader"), L = n("TabsTrigger"), ge = n("TabsList"), O = n("Input"), fe = n("TailwindColorPicker"), ye = n("LucideIconPicker"), B = n("TabsContent"), _e = n("Checkbox"), K = n("Label"), xe = n("Switch"), Ce = n("FormBuilderSelect"), Q = n("SelectValue"), X = n("SelectTrigger"), F = n("SelectItem"), Y = n("SelectGroup"), Z = n("SelectContent"), h = n("Select"), ee = n("Sandbox"), be = n("Tabs"), j = n("Button"), we = n("DialogFooter"), ke = n("DialogScrollContent"), Ve = n("Dialog");
173
+ return c(), w(Ve, {
174
+ open: y.value,
175
+ "onUpdate:open": e[12] || (e[12] = (s) => y.value = s)
176
+ }, {
177
+ default: l(() => [
178
+ t(ke, { class: "sm:max-w-2xl" }, {
179
+ default: l(() => [
180
+ t(pe, null, {
181
+ default: l(() => [
182
+ t(ce, null, {
183
+ default: l(() => [
184
+ d(P(m.value === "create" ? "Add New Collection" : "Update Collection"), 1)
185
+ ]),
186
+ _: 1
187
+ }),
188
+ t(ve, null, {
189
+ default: l(() => [...e[13] || (e[13] = [
190
+ d(" Each collection has it's own set of entries, settings, ... ", -1)
191
+ ])]),
192
+ _: 1
193
+ })
194
+ ]),
195
+ _: 1
196
+ }),
197
+ o("div", Ge, [
198
+ t(be, {
199
+ "default-value": "account",
200
+ class: "w-full"
201
+ }, {
202
+ default: l(() => [
203
+ t(ge, { class: "mb-6" }, {
204
+ default: l(() => [
205
+ t(L, { value: "collection" }, {
206
+ default: l(() => [...e[14] || (e[14] = [
207
+ d(" Collection ", -1)
208
+ ])]),
209
+ _: 1
210
+ }),
211
+ t(L, { value: "entries" }, {
212
+ default: l(() => [...e[15] || (e[15] = [
213
+ d(" Entries ", -1)
214
+ ])]),
215
+ _: 1
216
+ }),
217
+ t(L, { value: "components" }, {
218
+ default: l(() => [...e[16] || (e[16] = [
219
+ d(" Components ", -1)
220
+ ])]),
221
+ _: 1
222
+ }),
223
+ t(L, { value: "styling" }, {
224
+ default: l(() => [...e[17] || (e[17] = [
225
+ d(" Styling ", -1)
226
+ ])]),
227
+ _: 1
228
+ }),
229
+ t(L, { value: "preview" }, {
230
+ default: l(() => [...e[18] || (e[18] = [
231
+ d(" Preview URL ", -1)
232
+ ])]),
233
+ _: 1
234
+ })
235
+ ]),
236
+ _: 1
237
+ }),
238
+ t(B, { value: "collection" }, {
239
+ default: l(() => [
240
+ o("div", We, [
241
+ o("div", He, [
242
+ e[19] || (e[19] = o("label", {
243
+ for: "collection-dialog-display-name",
244
+ class: "text-sm mb-1 block font-medium"
245
+ }, "Collection Name", -1)),
246
+ t(O, {
247
+ modelValue: C.value,
248
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => C.value = s),
249
+ id: "collection-dialog-display-name"
250
+ }, null, 8, ["modelValue"])
251
+ ]),
252
+ o("div", Je, [
253
+ e[20] || (e[20] = o("label", { class: "text-sm mb-1 block font-medium" }, "Tint", -1)),
254
+ t(fe, {
255
+ modelValue: _.value,
256
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => _.value = s),
257
+ "default-value": "white"
258
+ }, null, 8, ["modelValue"])
259
+ ]),
260
+ o("div", Ke, [
261
+ e[21] || (e[21] = o("label", { class: "text-sm mb-1 block font-medium" }, "Icon", -1)),
262
+ t(ye, {
263
+ modelValue: u.value,
264
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => u.value = s)
265
+ }, null, 8, ["modelValue"])
266
+ ])
267
+ ])
268
+ ]),
269
+ _: 1
270
+ }),
271
+ t(B, { value: "entries" }, {
272
+ default: l(() => [
273
+ o("div", Qe, [
274
+ e[26] || (e[26] = o("p", { class: "text-sm mb-1 block font-medium" }, " Entries ", -1)),
275
+ o("div", Xe, [
276
+ o("div", Ye, [
277
+ e[22] || (e[22] = o("label", {
278
+ for: "collection-dialog-entry-name",
279
+ class: "text-sm mb-1 block font-medium"
280
+ }, "Entry name (singular)", -1)),
281
+ t(O, {
282
+ modelValue: x.value,
283
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => x.value = s),
284
+ id: "collection-dialog-entry-name",
285
+ placeholder: "Entry"
286
+ }, null, 8, ["modelValue"])
287
+ ]),
288
+ o("div", Ze, [
289
+ e[23] || (e[23] = o("label", {
290
+ for: "collection-dialog-entry-name-plural",
291
+ class: "text-sm mb-1 block font-medium"
292
+ }, "Entry name (plural)", -1)),
293
+ t(O, {
294
+ modelValue: T.value,
295
+ "onUpdate:modelValue": e[4] || (e[4] = (s) => T.value = s),
296
+ id: "collection-dialog-entry-name-plural",
297
+ placeholder: "Entries"
298
+ }, null, 8, ["modelValue"])
299
+ ])
300
+ ]),
301
+ o("div", he, [
302
+ t(_e, {
303
+ modelValue: S.value,
304
+ "onUpdate:modelValue": e[5] || (e[5] = (s) => S.value = s),
305
+ id: "collection-dialog-allow-user-entry-management"
306
+ }, null, 8, ["modelValue"]),
307
+ t(K, { for: "collection-dialog-allow-user-entry-management" }, {
308
+ default: l(() => [...e[24] || (e[24] = [
309
+ d("Allow users to create, edit and delete entries in this collection", -1)
310
+ ])]),
311
+ _: 1
312
+ })
313
+ ]),
314
+ e[27] || (e[27] = o("hr", { class: "my-6" }, null, -1)),
315
+ e[28] || (e[28] = o("p", { class: "text-sm mb-1 block font-medium" }, " Entry Custom Settings ", -1)),
316
+ e[29] || (e[29] = o("p", { class: "text-xs mb-2 text-muted-foreground" }, " Specific settings all entries in this collection can edit. ", -1)),
317
+ o("div", et, [
318
+ t(xe, {
319
+ modelValue: i.value,
320
+ "onUpdate:modelValue": e[6] || (e[6] = (s) => i.value = s),
321
+ id: "collection-dialog-component-settings-toggle",
322
+ class: "mb-4"
323
+ }, null, 8, ["modelValue"]),
324
+ t(K, {
325
+ class: "-mt-3.5",
326
+ for: "collection-dialog-component-settings-toggle"
327
+ }, {
328
+ default: l(() => [...e[25] || (e[25] = [
329
+ d(" Show settings form for this collection's entries. ", -1)
330
+ ])]),
331
+ _: 1
332
+ })
333
+ ]),
334
+ i.value ? (c(), w(Ce, {
335
+ key: 0,
336
+ modelValue: a.value,
337
+ "onUpdate:modelValue": e[7] || (e[7] = (s) => a.value = s),
338
+ class: "w-1/2"
339
+ }, null, 8, ["modelValue"])) : U("", !0)
340
+ ])
341
+ ]),
342
+ _: 1
343
+ }),
344
+ t(B, { value: "components" }, {
345
+ default: l(() => [
346
+ e[33] || (e[33] = o("p", { class: "text-sm mb-1 block font-medium" }, " Available Components ", -1)),
347
+ o("div", tt, [
348
+ t(h, {
349
+ modelValue: D.value,
350
+ "onUpdate:modelValue": e[8] || (e[8] = (s) => D.value = s)
351
+ }, {
352
+ default: l(() => [
353
+ t(X, { class: "w-full" }, {
354
+ default: l(() => [
355
+ t(Q)
356
+ ]),
357
+ _: 1
358
+ }),
359
+ t(Z, null, {
360
+ default: l(() => [
361
+ t(Y, null, {
362
+ default: l(() => [
363
+ t(F, { value: "all" }, {
364
+ default: l(() => [...e[30] || (e[30] = [
365
+ d(" All ", -1)
366
+ ])]),
367
+ _: 1
368
+ }),
369
+ t(F, { value: "all-except" }, {
370
+ default: l(() => [...e[31] || (e[31] = [
371
+ d(" All, except... ", -1)
372
+ ])]),
373
+ _: 1
374
+ }),
375
+ t(F, { value: "only" }, {
376
+ default: l(() => [...e[32] || (e[32] = [
377
+ d(" Only... ", -1)
378
+ ])]),
379
+ _: 1
380
+ })
381
+ ]),
382
+ _: 1
383
+ })
384
+ ]),
385
+ _: 1
386
+ })
387
+ ]),
388
+ _: 1
389
+ }, 8, ["modelValue"]),
390
+ D.value !== "all" ? (c(), w(h, {
391
+ key: 0,
392
+ multiple: !0,
393
+ modelValue: A.value,
394
+ "onUpdate:modelValue": e[9] || (e[9] = (s) => A.value = s)
395
+ }, {
396
+ default: l(() => [
397
+ t(X, { class: "w-full" }, {
398
+ default: l(() => [
399
+ t(Q, { placeholder: "Select components..." })
400
+ ]),
401
+ _: 1
402
+ }),
403
+ t(Z, null, {
404
+ default: l(() => [
405
+ t(Y, null, {
406
+ default: l(() => [
407
+ (c(!0), k(te, null, le(M.components, (s) => (c(), w(F, {
408
+ key: s.id,
409
+ value: s.id
410
+ }, {
411
+ default: l(() => [
412
+ o("div", {
413
+ class: oe(`p-1 bg-${s.tint} rounded-md flex items-center justify-center`)
414
+ }, [
415
+ (c(), w(ne(b(ae)[s.icon]), { class: "size-4 text-white" }))
416
+ ], 2),
417
+ d(" " + P(s.name), 1)
418
+ ]),
419
+ _: 2
420
+ }, 1032, ["value"]))), 128))
421
+ ]),
422
+ _: 1
423
+ })
424
+ ]),
425
+ _: 1
426
+ })
427
+ ]),
428
+ _: 1
429
+ }, 8, ["modelValue"])) : U("", !0)
430
+ ])
431
+ ]),
432
+ _: 1
433
+ }),
434
+ t(B, { value: "styling" }, {
435
+ default: l(() => [...e[34] || (e[34] = [
436
+ d(" Styling ", -1)
437
+ ])]),
438
+ _: 1
439
+ }),
440
+ t(B, { value: "preview" }, {
441
+ default: l(() => [
442
+ o("div", lt, [
443
+ e[37] || (e[37] = o("p", { class: "text-sm mb-1 block font-medium" }, " Preview URL ", -1)),
444
+ o("div", ot, [
445
+ o("div", nt, [
446
+ e[35] || (e[35] = o("label", { class: "text-sm basis-[200px] block font-medium" }, "Default Language Route", -1)),
447
+ t(ee, {
448
+ modelValue: p.value,
449
+ "onUpdate:modelValue": e[10] || (e[10] = (s) => p.value = s),
450
+ variables: N,
451
+ class: "flex-1"
452
+ }, null, 8, ["modelValue"])
453
+ ]),
454
+ W.value ? (c(), k("p", at, "Example: " + P(W.value), 1)) : U("", !0)
455
+ ]),
456
+ o("div", null, [
457
+ o("div", st, [
458
+ e[36] || (e[36] = o("label", { class: "text-sm basis-[200px] block font-medium" }, "Multilingual Route", -1)),
459
+ t(ee, {
460
+ modelValue: f.value,
461
+ "onUpdate:modelValue": e[11] || (e[11] = (s) => f.value = s),
462
+ variables: N,
463
+ class: "flex-1"
464
+ }, null, 8, ["modelValue"])
465
+ ]),
466
+ H.value ? (c(), k("p", it, "Example: " + P(H.value), 1)) : U("", !0)
467
+ ])
468
+ ])
469
+ ]),
470
+ _: 1
471
+ })
472
+ ]),
473
+ _: 1
474
+ })
475
+ ]),
476
+ t(we, null, {
477
+ default: l(() => [
478
+ m.value === "edit" ? (c(), w(j, {
479
+ key: 0,
480
+ variant: "destructive",
481
+ class: "mr-auto",
482
+ onClick: me
483
+ }, {
484
+ default: l(() => [...e[38] || (e[38] = [
485
+ d(" Delete Collection ", -1)
486
+ ])]),
487
+ _: 1
488
+ })) : U("", !0),
489
+ m.value === "create" ? (c(), w(j, {
490
+ key: 1,
491
+ type: "submit",
492
+ onClick: de
493
+ }, {
494
+ default: l(() => [...e[39] || (e[39] = [
495
+ d(" Add Collection ", -1)
496
+ ])]),
497
+ _: 1
498
+ })) : (c(), w(j, {
499
+ key: 2,
500
+ type: "submit",
501
+ onClick: re
502
+ }, {
503
+ default: l(() => [...e[40] || (e[40] = [
504
+ d(" Edit Collection ", -1)
505
+ ])]),
506
+ _: 1
507
+ }))
508
+ ]),
509
+ _: 1
510
+ })
511
+ ]),
512
+ _: 1
513
+ })
514
+ ]),
515
+ _: 1
516
+ }, 8, ["open"]);
517
+ };
518
+ }
519
+ }), dt = { class: "relative flex flex-col flex-1" }, rt = { class: "flex items-center justify-between gap-4 w-full my-4" }, mt = { class: "flex items-center gap-4" }, ct = {
520
+ key: 0,
521
+ class: "text-lg whitespace-nowrap"
522
+ }, vt = {
523
+ key: 1,
524
+ class: "text-lg whitespace-nowrap"
525
+ }, pt = {
526
+ key: 0,
527
+ class: "flex items-center gap-4"
528
+ }, Ct = /* @__PURE__ */ G({
529
+ __name: "Overview",
530
+ props: {
531
+ config: {
532
+ type: Object,
533
+ required: !0
534
+ }
535
+ },
536
+ setup(M) {
537
+ const V = M, { getModuleData: $ } = $e(), { hasPermission: N, isAdmin: I } = Ne(), { navigateTo: g } = se(), { confirm: R } = ie();
538
+ Ae(() => []);
539
+ const y = Re(V.config.project), m = v(null), E = v([]), C = v(null);
540
+ q(() => m.value?.find((i) => i.id === C.value) || null);
541
+ const _ = Se("collectionModal"), u = async () => {
542
+ const i = await y.find(V.config.collectionsCollection);
543
+ m.value = i || [];
544
+ }, x = async (i) => {
545
+ const a = await y.add(V.config.collectionsCollection, i);
546
+ console.log("Added collection", a);
547
+ }, T = async (i) => {
548
+ try {
549
+ await y.update(V.config.collectionsCollection, i.id, i);
550
+ const a = m.value.findIndex((p) => p.id === i.id);
551
+ a !== -1 && (m.value[a] = i), z.success("Collection updated");
552
+ } catch {
553
+ z.error("Failed to update collection");
554
+ }
555
+ }, S = (i) => {
556
+ R("Are you sure you want to delete this collection? This action cannot be undone.").then(async (a) => {
557
+ if (a)
558
+ try {
559
+ await y.remove(V.config.collectionsCollection, i), m.value = m.value.filter((p) => p.id !== i), z.success("Collection deleted");
560
+ } catch {
561
+ z.error("Failed to delete collection");
562
+ }
563
+ });
564
+ };
565
+ return De(() => {
566
+ u(), $("components").then((i) => {
567
+ E.value = i;
568
+ });
569
+ }), (i, a) => {
570
+ const p = n("Button");
571
+ return c(), k("div", dt, [
572
+ o("div", rt, [
573
+ o("div", mt, [
574
+ m.value !== null ? (c(), k("p", ct, P(m.value.length) + " " + P(m.value.length === 1 ? "Collection" : "Collections"), 1)) : (c(), k("p", vt, "Loading Collections..."))
575
+ ]),
576
+ b(I)() ? (c(), k("div", pt, [
577
+ t(p, {
578
+ variant: "outline",
579
+ class: "text-primary hover:text-primary",
580
+ onClick: a[0] || (a[0] = (f) => b(g)("global-styling"))
581
+ }, {
582
+ default: l(() => [
583
+ t(b(Pe), { class: "size-4" }),
584
+ a[5] || (a[5] = d(" Global Styling ", -1))
585
+ ]),
586
+ _: 1
587
+ }),
588
+ t(p, {
589
+ variant: "outline",
590
+ class: "text-primary hover:text-primary",
591
+ onClick: a[1] || (a[1] = (f) => b(g)("components"))
592
+ }, {
593
+ default: l(() => [
594
+ t(b(Me), { class: "size-4" }),
595
+ a[6] || (a[6] = d(" Components ", -1))
596
+ ]),
597
+ _: 1
598
+ }),
599
+ t(p, {
600
+ variant: "outline",
601
+ class: "text-primary hover:text-primary",
602
+ onClick: a[2] || (a[2] = (f) => _.value.openDialog())
603
+ }, {
604
+ default: l(() => [
605
+ t(b(Ue), { class: "size-4" }),
606
+ a[7] || (a[7] = d(" New Collection ", -1))
607
+ ]),
608
+ _: 1
609
+ })
610
+ ])) : U("", !0)
611
+ ]),
612
+ t(qe, {
613
+ collections: m.value,
614
+ onOpen: a[3] || (a[3] = (f) => C.value = f),
615
+ onEdit: a[4] || (a[4] = (f) => _.value.openDialog(f)),
616
+ onDelete: S
617
+ }, null, 8, ["collections"]),
618
+ t(ut, {
619
+ config: M.config,
620
+ components: E.value,
621
+ ref_key: "collectionModal",
622
+ ref: _,
623
+ onAdd: x,
624
+ onEdit: T,
625
+ onDelete: S
626
+ }, null, 8, ["config", "components"])
627
+ ]);
628
+ };
629
+ }
630
+ });
631
+ export {
632
+ Ct as default
633
+ };