@dejwcake/craftable 0.1.9 → 2.0.0

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 (126) hide show
  1. package/README.md +117 -3
  2. package/dist/buildMatchPatternFn-BV4I8r8j.js +63 -0
  3. package/dist/buildMatchPatternFn-T5KjFTBQ.cjs +1 -0
  4. package/dist/craftable.css +2 -0
  5. package/dist/cs-B5QMxFrl.js +682 -0
  6. package/dist/cs-MAoetkhe.cjs +1 -0
  7. package/dist/de-BlQ2ZKmc.js +526 -0
  8. package/dist/de-BoVLAn6U.cjs +1 -0
  9. package/dist/en-US-BLvEnhs4.js +443 -0
  10. package/dist/en-US-Dz8vkDZ_.cjs +1 -0
  11. package/dist/en-US-X9gX759i.cjs +1 -0
  12. package/dist/es-DBHDeXHI.cjs +1 -0
  13. package/dist/es-YEqfkBY2.js +437 -0
  14. package/dist/fr-B7MHC2AN.js +407 -0
  15. package/dist/fr-DLs3QoNB.cjs +1 -0
  16. package/dist/hu-BKZPI9jH.cjs +1 -0
  17. package/dist/hu-reoJgNxD.js +425 -0
  18. package/dist/index.cjs +1 -0
  19. package/dist/index.mjs +3866 -0
  20. package/dist/isSameWeek-CC6GX_zp.js +40 -0
  21. package/dist/isSameWeek-Mctj6Tdj.cjs +1 -0
  22. package/dist/pl-B5A0Rjp7.js +628 -0
  23. package/dist/pl-BMyrOO-Q.cjs +1 -0
  24. package/dist/sk-B7JF2MoV.cjs +1 -0
  25. package/dist/sk-Btro3W4S.js +602 -0
  26. package/package.json +68 -40
  27. package/scripts/publish-components.js +118 -0
  28. package/scss/_images.scss +1 -1
  29. package/scss/_variables.scss +13 -6
  30. package/scss/app.scss +4 -4
  31. package/scss/overrides/_alerts.scss +0 -2
  32. package/scss/overrides/_badges.scss +1 -17
  33. package/scss/overrides/_buttons.scss +64 -7
  34. package/scss/overrides/_cards.scss +4 -51
  35. package/scss/overrides/_checkboxes.scss +54 -59
  36. package/scss/overrides/_forms.scss +270 -176
  37. package/scss/overrides/_index.scss +18 -18
  38. package/scss/overrides/_keyframes.scss +6 -4
  39. package/scss/overrides/_layout.scss +24 -30
  40. package/scss/overrides/_media-wysiwyg.scss +9 -111
  41. package/scss/overrides/_modal.scss +0 -18
  42. package/scss/overrides/_multiselect.scss +63 -7
  43. package/scss/overrides/_nav.scss +55 -33
  44. package/scss/overrides/_notifications.scss +6 -1
  45. package/scss/overrides/_pagination.scss +3 -3
  46. package/scss/overrides/_sidebar.scss +84 -0
  47. package/scss/overrides/_tables.scss +52 -37
  48. package/scss/overrides/_text.scss +1 -3
  49. package/scss/overrides/_wysiwyg.scss +151 -48
  50. package/scss/styles/_auth.scss +32 -37
  51. package/scss/styles/_custom.scss +44 -1
  52. package/scss/styles/_index.scss +4 -4
  53. package/scss/styles/_legacy.scss +5 -81
  54. package/scss/styles/_others.scss +232 -337
  55. package/scss/vendor/_index.scss +5 -4
  56. package/src/auth/ActivationError.vue +23 -0
  57. package/src/auth/ActivationForm.vue +69 -0
  58. package/src/auth/ForgotPasswordForm.vue +74 -0
  59. package/src/auth/LoginForm.vue +107 -0
  60. package/src/auth/ResetPasswordForm.vue +122 -0
  61. package/src/components/ConfirmModal.vue +65 -0
  62. package/src/components/UserDetailTooltip.vue +88 -0
  63. package/src/components/form/CkeditorEditor.vue +205 -0
  64. package/src/components/form/FormCheckbox.vue +29 -0
  65. package/src/components/form/FormDatePicker.vue +52 -0
  66. package/src/components/form/FormEmail.vue +17 -0
  67. package/src/components/form/FormInput.vue +31 -0
  68. package/src/components/form/FormLocalizedInput.vue +47 -0
  69. package/src/components/form/FormLocalizedWysiwyg.vue +55 -0
  70. package/src/components/form/FormLocalizedWysiwygSimple.vue +55 -0
  71. package/src/components/form/FormMultiSelect.vue +36 -0
  72. package/src/components/form/FormPasswordConfirm.vue +49 -0
  73. package/src/components/form/FormSelect.vue +35 -0
  74. package/src/components/form/FormSubmit.vue +13 -0
  75. package/src/components/form/FormTextarea.vue +31 -0
  76. package/src/components/form/FormWysiwyg.vue +31 -0
  77. package/src/components/form/FormWysiwygSimple.vue +31 -0
  78. package/src/components/form/LocalizationBar.vue +90 -0
  79. package/src/components/form/MediaUpload.vue +317 -0
  80. package/src/components/form/TiptapEditor.vue +238 -0
  81. package/src/components/listing/BulkCheckboxHeader.vue +18 -0
  82. package/src/components/listing/BulkCheckboxRow.vue +21 -0
  83. package/src/components/listing/BulkOperationsBar.vue +41 -0
  84. package/src/components/listing/DeleteButton.vue +46 -0
  85. package/src/components/listing/EditButton.vue +17 -0
  86. package/src/components/listing/EmptyState.vue +25 -0
  87. package/src/components/listing/ListingHeader.vue +24 -0
  88. package/src/components/listing/Pagination.vue +158 -0
  89. package/src/components/listing/PerPage.vue +15 -0
  90. package/src/components/listing/PublishedAtColumn.vue +226 -0
  91. package/src/components/listing/Search.vue +81 -0
  92. package/src/components/listing/Sortable.vue +28 -0
  93. package/src/components/listing/ToggleSwitch.vue +47 -0
  94. package/src/composables/useAdmin.js +39 -0
  95. package/src/composables/useBaseAuth.js +81 -0
  96. package/src/composables/useBaseForm.js +265 -0
  97. package/src/composables/useBaseListing.js +316 -0
  98. package/src/composables/useResponsiveColumns.js +62 -0
  99. package/src/index.js +62 -0
  100. package/src/translation/TranslationListing.vue +230 -0
  101. package/src/translation/modals/TranslationEditModal.vue +86 -0
  102. package/src/translation/modals/TranslationExportModal.vue +74 -0
  103. package/src/translation/modals/TranslationImportModal.vue +255 -0
  104. package/src/ui/index.js +99 -0
  105. package/src/utils/ckeditorHelpers.js +36 -0
  106. package/src/utils/dateFnsLocale.js +24 -0
  107. package/src/utils/dateFormatters.js +30 -0
  108. package/src/utils/mediaProps.js +14 -0
  109. package/src/utils/notify.js +22 -0
  110. package/dist/admin/Admin.js +0 -42
  111. package/dist/auth/Form.js +0 -15
  112. package/dist/base-components/Form/BaseForm.js +0 -392
  113. package/dist/base-components/Form/BaseUpload.js +0 -188
  114. package/dist/base-components/Form/bootstrap.js +0 -21
  115. package/dist/base-components/Listing/BaseListing.js +0 -454
  116. package/dist/base-components/Listing/components/Pagination.js +0 -105
  117. package/dist/base-components/Listing/components/Sortable.js +0 -48
  118. package/dist/base-components/Listing/components/UserDetailTooltip.js +0 -55
  119. package/dist/index.js +0 -70
  120. package/dist/overrides/trumbowyg.edit-embed-template.js +0 -72
  121. package/dist/overrides/trumbowyg.reupload.js +0 -146
  122. package/dist/overrides/trumbowyg.template.js +0 -67
  123. package/dist/translation/Form.js +0 -15
  124. package/dist/translation/Listing.js +0 -283
  125. package/dist/ui/index.js +0 -33
  126. package/scss/overrides/_switches.scss +0 -25
package/dist/index.mjs ADDED
@@ -0,0 +1,3866 @@
1
+ import { t as e } from "./en-US-BLvEnhs4.js";
2
+ import { Fragment as t, Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, getCurrentInstance as u, guardReactiveProps as d, isRef as f, mergeProps as p, normalizeClass as m, normalizeProps as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, reactive as b, ref as x, renderList as S, renderSlot as C, toDisplayString as w, toRaw as T, unref as E, vModelCheckbox as D, vModelRadio as O, vModelText as k, vShow as A, watch as j, withCtx as M, withDirectives as N, withKeys as P, withModifiers as F } from "vue";
3
+ import { useForm as I, validate as L } from "vee-validate";
4
+ import { notify as R } from "@kyvg/vue3-notification";
5
+ import z from "dayjs";
6
+ import B from "dayjs/plugin/customParseFormat.js";
7
+ import ee from "dayjs/plugin/utc.js";
8
+ import te from "dayjs/plugin/timezone.js";
9
+ import { useCookies as ne } from "vue3-cookies";
10
+ import { useDropzone as re } from "vue3-dropzone";
11
+ import { EditorContent as ie, useEditor as ae } from "@tiptap/vue-3";
12
+ import oe from "@tiptap/starter-kit";
13
+ import se from "@tiptap/extension-image";
14
+ import { Table as ce, TableCell as le, TableHeader as ue, TableRow as de } from "@tiptap/extension-table";
15
+ import { Alignment as fe, AutoLink as pe, BlockQuote as me, Bold as he, ClassicEditor as ge, Code as _e, CodeBlock as ve, Essentials as ye, FileRepository as be, GeneralHtmlSupport as xe, Heading as Se, HorizontalLine as Ce, Image as we, ImageCaption as Te, ImageInsert as Ee, ImageInsertViaUrl as De, ImageResize as Oe, ImageStyle as ke, ImageToolbar as Ae, ImageUpload as je, Indent as Me, Italic as Ne, Link as Pe, List as Fe, Paragraph as Ie, SourceEditing as Le, Strikethrough as Re, Table as ze, TableToolbar as Be, Underline as Ve, Undo as He } from "ckeditor5";
16
+ import { Ckeditor as Ue } from "@ckeditor/ckeditor5-vue";
17
+ import "ckeditor5/ckeditor5.css";
18
+ import We from "vue3-popper";
19
+ import { VueDatePicker as Ge } from "@vuepic/vue-datepicker";
20
+ import V from "vue-multiselect";
21
+ //#region src/utils/notify.js
22
+ var Ke = "Success!", qe = "Operation succeeded.", Je = "Error!", Ye = "An error has occurred.";
23
+ function H(e) {
24
+ R({
25
+ type: "success",
26
+ title: Ke,
27
+ text: e || qe
28
+ });
29
+ }
30
+ function U(e) {
31
+ R({
32
+ type: "error",
33
+ title: Je,
34
+ text: e || Ye
35
+ });
36
+ }
37
+ z.extend(B), z.extend(ee), z.extend(te);
38
+ function W(e, t = "DD.MM.YYYY") {
39
+ let n = z(e);
40
+ return n.isValid() ? n.format(t) : "";
41
+ }
42
+ function G(e, t = "DD.MM.YYYY HH:mm") {
43
+ let n = z(e);
44
+ return n.isValid() ? n.format(t) : "";
45
+ }
46
+ function K(e, t = "HH:mm") {
47
+ let n = z("2000-01-01 " + e);
48
+ return n.isValid() ? n.format(t) : "";
49
+ }
50
+ function q(e = "UTC", t = "YYYY-MM-DD HH:mm:ss") {
51
+ return z().tz(e).format(t);
52
+ }
53
+ //#endregion
54
+ //#region src/utils/dateFnsLocale.js
55
+ var Xe = e;
56
+ function J() {
57
+ return Xe;
58
+ }
59
+ async function Ze() {
60
+ let e = document.documentElement.lang || "en", t = {
61
+ sk: () => import("./sk-Btro3W4S.js"),
62
+ cs: () => import("./cs-B5QMxFrl.js"),
63
+ en: () => import("./en-US-BLvEnhs4.js").then((e) => e.n),
64
+ de: () => import("./de-BlQ2ZKmc.js"),
65
+ fr: () => import("./fr-B7MHC2AN.js"),
66
+ es: () => import("./es-YEqfkBY2.js"),
67
+ pl: () => import("./pl-B5A0Rjp7.js"),
68
+ hu: () => import("./hu-reoJgNxD.js")
69
+ }, n = await (t[e] || t.en)();
70
+ Xe = n.default || n[Object.keys(n)[0]];
71
+ }
72
+ //#endregion
73
+ //#region src/composables/useBaseForm.js
74
+ var Qe = window.axios;
75
+ function $e(e, t = {}) {
76
+ let n = u(), i = x(e.data && Object.keys(e.data).length > 0 ? { ...e.data } : {}), a = x([]), o = x([]), s = x(!1), c = x(""), l = x(!1), d = x(window.innerWidth < (e.responsiveBreakpoint || 850)), { setErrors: f, errors: p } = I(), m = x({
77
+ enableTimePicker: !1,
78
+ enableSeconds: !1,
79
+ modelType: "yyyy-MM-dd HH:mm:ss",
80
+ format: "dd.MM.yyyy",
81
+ locale: J()
82
+ }), h = x({
83
+ timePicker: !0,
84
+ enableTimePicker: !0,
85
+ enableSeconds: !1,
86
+ modelType: "HH:mm:ss",
87
+ format: "HH:mm",
88
+ locale: J()
89
+ }), g = x({
90
+ enableTimePicker: !0,
91
+ enableSeconds: !1,
92
+ modelType: "yyyy-MM-dd HH:mm:ss",
93
+ format: "dd.MM.yyyy HH:mm",
94
+ locale: J()
95
+ }), v = r(() => e.locales || []), y = r(() => e.defaultLocale || (v.value.length > 0 ? v.value[0] : "")), b = r(() => v.value.filter((e) => e !== y.value)), S = r(() => b.value.some((e) => Object.keys(p.value).some((t) => t.endsWith("_" + e) || t.startsWith(e + "_"))));
96
+ v.value.length > 0 && (c.value = y.value);
97
+ function C() {
98
+ d.value = window.innerWidth < (e.responsiveBreakpoint || 850);
99
+ }
100
+ window.addEventListener("resize", C), _(() => {
101
+ window.removeEventListener("resize", C);
102
+ });
103
+ function w() {
104
+ let e = n?.proxy?.$refs || {};
105
+ return o.value && o.value.forEach((t) => {
106
+ i.value[t] && console.warn("MediaUploader warning: Media input must have a unique name, '" + t + "' is already defined in regular inputs.");
107
+ let n = e[t + "_uploader"];
108
+ if (n) {
109
+ let e = Array.isArray(n) ? n[0] : n;
110
+ e && typeof e.getFiles == "function" && (i.value[t] = e.getFiles());
111
+ }
112
+ }), i.value.wysiwygMedia = a.value, typeof t.transformData == "function" ? t.transformData({ ...i.value }) : i.value;
113
+ }
114
+ async function T() {
115
+ if (t.validationSchema) {
116
+ let e = {};
117
+ for (let [n, r] of Object.entries(t.validationSchema)) {
118
+ let t = await L(i.value[n], r, {
119
+ name: n,
120
+ values: i.value
121
+ });
122
+ t.valid || (e[n] = t.errors[0]);
123
+ }
124
+ let n = {};
125
+ for (let r of Object.keys(t.validationSchema)) n[r] = e[r] || void 0;
126
+ if (f(n), Object.keys(e).length > 0) return U("The form contains invalid fields."), !1;
127
+ }
128
+ l.value = !0;
129
+ let n = w();
130
+ if (!e.sendEmptyLocales && e.sendEmptyLocales !== void 0) {
131
+ let e = {};
132
+ for (let [t, r] of Object.entries(n)) (!v.value.includes(t) || r && Object.keys(r).length > 0) && (e[t] = r);
133
+ n = e;
134
+ }
135
+ Qe.post(e.action, n).then((e) => {
136
+ E(e.data);
137
+ }).catch((e) => {
138
+ D(e.response?.data || {});
139
+ });
140
+ }
141
+ function E(e) {
142
+ l.value = !1, e.message && H(e.message), e.redirect && (e.message ? setTimeout(() => window.location.replace(e.redirect), 2e3) : window.location.replace(e.redirect));
143
+ }
144
+ function D(e) {
145
+ if (l.value = !1, e.errors !== void 0) {
146
+ let t = {};
147
+ Object.keys(e.errors).forEach((n) => {
148
+ let r = n.split(".", 2);
149
+ r.length > 1 ? t[r[0] + "_" + r[1]] = e.errors[n][0] : t[n] = e.errors[n][0];
150
+ }), f(t), e.message === void 0 && U("The form contains invalid fields.");
151
+ }
152
+ e.message !== void 0 && U(e.message);
153
+ }
154
+ function O() {
155
+ let e = {};
156
+ return v.value.forEach((t) => {
157
+ e[t] = null;
158
+ }), e;
159
+ }
160
+ function k() {
161
+ s.value = !0, c.value = b.value[0];
162
+ let e = document.querySelector(".container-xl");
163
+ e && e.classList.add("width-auto");
164
+ }
165
+ function A() {
166
+ s.value = !1;
167
+ let e = document.querySelector(".container-xl");
168
+ e && e.classList.remove("width-auto");
169
+ }
170
+ function j(e) {
171
+ return d.value ? c.value === e : y.value === e ? !0 : s.value && c.value === e;
172
+ }
173
+ return {
174
+ form: i,
175
+ wysiwygMedia: a,
176
+ mediaCollections: o,
177
+ isFormLocalized: s,
178
+ currentLocale: c,
179
+ submitting: l,
180
+ onSmallScreen: d,
181
+ errors: p,
182
+ datePickerConfig: m,
183
+ timePickerConfig: h,
184
+ datetimePickerConfig: g,
185
+ locales: v,
186
+ defaultLocale: y,
187
+ otherLocales: b,
188
+ showLocalizedValidationError: S,
189
+ getPostData: w,
190
+ onSubmit: T,
191
+ onSuccess: E,
192
+ onFail: D,
193
+ getLocalizedFormDefaults: O,
194
+ showLocalization: k,
195
+ hideLocalization: A,
196
+ shouldShowLangGroup: j,
197
+ setErrors: f,
198
+ formatDate: W,
199
+ formatDatetime: G,
200
+ formatTime: K
201
+ };
202
+ }
203
+ //#endregion
204
+ //#region src/composables/useBaseAuth.js
205
+ var et = window.axios;
206
+ function Y(e, t = {}) {
207
+ let n = x(t.formDefaults ? { ...t.formDefaults } : {}), r = x(!1), i = x(""), { setErrors: a, errors: o } = I();
208
+ async function s() {
209
+ if (t.validationSchema) {
210
+ let e = {};
211
+ for (let [r, i] of Object.entries(t.validationSchema)) {
212
+ let t = await L(n.value[r], i, {
213
+ name: r,
214
+ values: n.value
215
+ });
216
+ t.valid || (e[r] = t.errors[0]);
217
+ }
218
+ let r = {};
219
+ for (let n of Object.keys(t.validationSchema)) r[n] = e[n] || void 0;
220
+ if (a(r), Object.keys(e).length > 0) return !1;
221
+ }
222
+ r.value = !0, i.value = "", et.post(e.action, n.value).then((e) => {
223
+ c(e.data);
224
+ }).catch((e) => {
225
+ l(e.response?.data || {});
226
+ });
227
+ }
228
+ function c(e) {
229
+ if (r.value = !1, t.onSuccess) {
230
+ t.onSuccess(e);
231
+ return;
232
+ }
233
+ e.message && (i.value = e.message), e.redirect && window.location.replace(e.redirect);
234
+ }
235
+ function l(e) {
236
+ if (r.value = !1, e.errors !== void 0) {
237
+ let t = {};
238
+ Object.keys(e.errors).forEach((n) => {
239
+ t[n] = e.errors[n][0];
240
+ }), a(t);
241
+ }
242
+ }
243
+ return {
244
+ form: n,
245
+ errors: o,
246
+ submitting: r,
247
+ successMessage: i,
248
+ onSubmit: s
249
+ };
250
+ }
251
+ //#endregion
252
+ //#region src/composables/useBaseListing.js
253
+ var X = window.axios;
254
+ function tt(e) {
255
+ let { cookies: t } = ne(), n = b({
256
+ state: {
257
+ per_page: t.get("per_page") || 10,
258
+ current_page: 1,
259
+ last_page: 1,
260
+ from: 1,
261
+ to: 10
262
+ },
263
+ options: { alwaysShowPrevNext: !0 }
264
+ }), i = b({
265
+ column: "id",
266
+ direction: "asc"
267
+ }), a = b({}), o = x(""), s = x(null), c = x(q(e.timezone || "UTC")), l = b({}), u = x(!1), d = b({
268
+ show: !1,
269
+ onConfirm: null,
270
+ translations: {
271
+ confirm_title: "Warning!",
272
+ confirm_text: "Are you sure?",
273
+ confirm_btn: "Yes, confirm",
274
+ cancel_btn: "Cancel"
275
+ }
276
+ }), f = setInterval(() => {
277
+ c.value = q(e.timezone || "UTC");
278
+ }, 1e3);
279
+ _(() => {
280
+ clearInterval(f);
281
+ });
282
+ let p = r(() => Object.values(l).filter((e) => e === !0).length), m = r({
283
+ get() {
284
+ return p.value >= n.state.to - n.state.from + 1 && p.value > 0 && h();
285
+ },
286
+ set() {}
287
+ });
288
+ e.data == null ? T() : D(e.data);
289
+ function h() {
290
+ if (!s.value) return !1;
291
+ let e = Object.values(s.value).map(({ id: e }) => e);
292
+ for (let t = 0; t < e.length; t++) {
293
+ let n = e[t];
294
+ if (l[n] === void 0 || l[n] === !1) return !1;
295
+ }
296
+ return !0;
297
+ }
298
+ function g(e) {
299
+ l[e] === void 0 ? l[e] = !0 : l[e] = !l[e];
300
+ }
301
+ function v(e) {
302
+ let t = { params: { bulk: !0 } };
303
+ u.value = !0, Object.assign(t.params, a), X.get(e, t).then((e) => {
304
+ S(e.data.bulkItems);
305
+ }).catch((e) => {
306
+ U(e.response?.data?.message);
307
+ }).finally(() => {
308
+ u.value = !1;
309
+ });
310
+ }
311
+ function y() {
312
+ if (!s.value) return;
313
+ let e = Object.values(s.value).map(({ id: e }) => e);
314
+ m.value ? C(e) : (u.value = !0, S(e), u.value = !1);
315
+ }
316
+ function S(e) {
317
+ e.forEach((e) => {
318
+ l[e] = !0;
319
+ });
320
+ }
321
+ function C(e = null) {
322
+ if (e === null) Object.keys(l).forEach((e) => delete l[e]);
323
+ else {
324
+ if (!s.value) return;
325
+ Object.values(s.value).map(({ id: e }) => e).forEach((e) => {
326
+ l[e] = !1;
327
+ });
328
+ }
329
+ }
330
+ function w(e, t = {}) {
331
+ let n = Object.keys(l).filter((e) => l[e]);
332
+ d.translations = {
333
+ ...d.translations,
334
+ ...t,
335
+ confirm_text: (t.confirm_text || "Do you really want to delete :number selected items?").replace(":number", p.value)
336
+ }, d.onConfirm = () => {
337
+ d.show = !1, X.post(e, { ids: n }).then((e) => {
338
+ Object.keys(l).forEach((e) => delete l[e]), T(), H(e.data.message);
339
+ }).catch((e) => {
340
+ U(e.response?.data?.message);
341
+ });
342
+ }, d.show = !0;
343
+ }
344
+ function T(t) {
345
+ let r = { params: {
346
+ per_page: n.state.per_page,
347
+ page: n.state.current_page,
348
+ orderBy: i.column,
349
+ orderDirection: i.direction
350
+ } };
351
+ t === !0 && (r.params.page = 1), Object.assign(r.params, a), X.get(e.url, r).then((e) => {
352
+ D(e.data.data);
353
+ }).catch((e) => {
354
+ U(e.response?.data?.message);
355
+ });
356
+ }
357
+ function E(e, t) {
358
+ t === "" ? delete a[e] : a[e] = t, T(!0);
359
+ }
360
+ function D(e) {
361
+ if (e.current_page > e.last_page && e.total > 0) {
362
+ n.state.current_page = e.last_page, T();
363
+ return;
364
+ }
365
+ s.value = e.data, n.state.current_page = e.current_page, n.state.last_page = e.last_page, n.state.total = e.total, n.state.per_page = e.per_page, n.state.to = e.to, n.state.from = e.from;
366
+ }
367
+ function O(e) {
368
+ return X.get(e).then((e) => {
369
+ e.data.message ? H(e.data.message) : e.data.redirect ? window.location.replace(e.data.redirect) : e.data.data?.path && window.location.replace(e.data.data.path);
370
+ }).catch((e) => {
371
+ U(e.response?.data?.message);
372
+ });
373
+ }
374
+ function k(e, t) {
375
+ return e.replace(":id", t.id);
376
+ }
377
+ function A({ column: e, direction: t }) {
378
+ i.column = e, i.direction = t, T();
379
+ }
380
+ function j(e) {
381
+ n.state.current_page = e, T();
382
+ }
383
+ function M() {
384
+ n.state.current_page = 1, T(!0);
385
+ }
386
+ function N(e) {
387
+ if (!s.value) return;
388
+ let t = s.value.findIndex((t) => t.id === e.id);
389
+ t !== -1 && (s.value[t] = e);
390
+ }
391
+ return {
392
+ pagination: n,
393
+ orderBy: i,
394
+ filters: a,
395
+ search: o,
396
+ collection: s,
397
+ now: c,
398
+ bulkItems: l,
399
+ bulkCheckingAllLoader: u,
400
+ confirmModal: d,
401
+ isClickedAll: m,
402
+ clickedBulkItemsCount: p,
403
+ onBulkItemClicked: g,
404
+ onBulkItemsClickedAll: v,
405
+ onBulkItemsClickedAllWithPagination: y,
406
+ onBulkItemsClickedAllUncheck: C,
407
+ bulkDelete: w,
408
+ loadData: T,
409
+ filter: E,
410
+ resolveUrl: k,
411
+ getAction: O,
412
+ onSort: A,
413
+ onPageChange: j,
414
+ onPerPageChange: M,
415
+ onUpdateItem: N,
416
+ formatDate: W,
417
+ formatDatetime: G,
418
+ formatTime: K
419
+ };
420
+ }
421
+ //#endregion
422
+ //#region src/composables/useAdmin.js
423
+ var nt = window.axios;
424
+ function rt() {
425
+ let e = x(!1);
426
+ function t(t) {
427
+ e.value = !!t;
428
+ }
429
+ return v(() => {
430
+ nt.interceptors.request.use((e) => (t(!0), e), (e) => (t(!1), Promise.reject(e))), nt.interceptors.response.use((e) => (t(!1), e), (e) => (t(!1), Promise.reject(e)));
431
+ }), {
432
+ loading: e,
433
+ setLoading: t
434
+ };
435
+ }
436
+ //#endregion
437
+ //#region src/composables/useResponsiveColumns.js
438
+ var it = [
439
+ {
440
+ minWidth: 1800,
441
+ maxPriority: 10
442
+ },
443
+ {
444
+ minWidth: 1600,
445
+ maxPriority: 8
446
+ },
447
+ {
448
+ minWidth: 1400,
449
+ maxPriority: 6
450
+ },
451
+ {
452
+ minWidth: 1200,
453
+ maxPriority: 4
454
+ },
455
+ {
456
+ minWidth: 1e3,
457
+ maxPriority: 3
458
+ },
459
+ {
460
+ minWidth: 800,
461
+ maxPriority: 2
462
+ },
463
+ {
464
+ minWidth: 0,
465
+ maxPriority: 0
466
+ }
467
+ ];
468
+ function at(e, t = {}) {
469
+ let n = t.breakpoints || it, r = x(10), i = null;
470
+ function a(e) {
471
+ for (let t of n) if (e >= t.minWidth) {
472
+ r.value = t.maxPriority;
473
+ return;
474
+ }
475
+ r.value = 0;
476
+ }
477
+ function o(e) {
478
+ i && i.disconnect(), e && (i = new ResizeObserver((e) => {
479
+ for (let t of e) a(t.contentRect.width);
480
+ }), i.observe(e));
481
+ }
482
+ j(e, (e) => {
483
+ o(e);
484
+ }, { immediate: !0 }), _(() => {
485
+ i &&= (i.disconnect(), null);
486
+ });
487
+ function s(e) {
488
+ return e <= r.value;
489
+ }
490
+ return { isColumnVisible: s };
491
+ }
492
+ //#endregion
493
+ //#region src/components/form/MediaUpload.vue
494
+ var ot = { class: "base-upload" }, st = {
495
+ key: 0,
496
+ class: "form-label d-flex align-items-center"
497
+ }, ct = { class: "fw-semibold upload-label-title" }, lt = {
498
+ key: 0,
499
+ class: "fa fa-lock ms-auto text-body-secondary"
500
+ }, ut = ["value"], dt = {
501
+ key: 0,
502
+ class: "dz-message"
503
+ }, ft = { class: "dz-image" }, pt = ["src", "alt"], mt = {
504
+ key: 1,
505
+ class: "dz-file-icon"
506
+ }, ht = { class: "dz-file-size" }, gt = { class: "dz-file-name" }, _t = ["onClick"], vt = { class: "dz-image" }, yt = ["src", "alt"], bt = {
507
+ key: 1,
508
+ class: "dz-file-icon"
509
+ }, xt = {
510
+ key: 0,
511
+ class: "dz-progress"
512
+ }, St = {
513
+ key: 1,
514
+ class: "dz-success-mark"
515
+ }, Ct = {
516
+ key: 2,
517
+ class: "dz-error-mark"
518
+ }, wt = { class: "dz-file-size" }, Tt = { class: "dz-file-name" }, Et = ["onClick"], Dt = {
519
+ __name: "MediaUpload",
520
+ props: {
521
+ url: {
522
+ type: String,
523
+ required: !0
524
+ },
525
+ collection: {
526
+ type: String,
527
+ required: !0
528
+ },
529
+ label: {
530
+ type: String,
531
+ default: ""
532
+ },
533
+ maxNumberOfFiles: {
534
+ type: Number,
535
+ default: 1
536
+ },
537
+ maxFileSizeInMb: {
538
+ type: Number,
539
+ default: 2
540
+ },
541
+ acceptedFileTypes: {
542
+ type: String,
543
+ default: void 0
544
+ },
545
+ isPrivate: {
546
+ type: Boolean,
547
+ default: !1
548
+ },
549
+ thumbnailWidth: {
550
+ type: Number,
551
+ default: 200
552
+ },
553
+ uploadedMedia: {
554
+ type: Array,
555
+ default: () => []
556
+ }
557
+ },
558
+ setup(e, { expose: n }) {
559
+ let i = window.axios, c = e, l = r(() => c.acceptedFileTypes && c.acceptedFileTypes.includes("image") ? "fa fa-file-image" : "fa fa-file"), u = r(() => {
560
+ let e = [];
561
+ return c.maxNumberOfFiles > 0 && e.push(`max. ${c.maxNumberOfFiles} file${c.maxNumberOfFiles > 1 ? "s" : ""}`), c.maxFileSizeInMb > 0 && e.push(`max. ${c.maxFileSizeInMb.toFixed(2)} MB`), e;
562
+ }), f = x([]), _ = x([]);
563
+ function C(e) {
564
+ return {
565
+ id: e.id,
566
+ collection_name: c.collection,
567
+ name: e.custom_properties?.name ?? e.file_name ?? e.name,
568
+ type: e.mime_type ?? e.type,
569
+ size: e.size,
570
+ url: e.original_url ?? e.url,
571
+ thumb_url: e.thumb_url ?? e.original_url ?? e.url
572
+ };
573
+ }
574
+ function T() {
575
+ let e = [];
576
+ return c.uploadedMedia.forEach((t) => {
577
+ e.push(C(t));
578
+ }), e;
579
+ }
580
+ let D = r(() => _.value.filter((e) => !e.deleted));
581
+ v(() => {
582
+ _.value = T();
583
+ });
584
+ function O(e) {
585
+ let t = b({
586
+ file: e,
587
+ response: null,
588
+ previewUrl: e.type && e.type.startsWith("image/") ? URL.createObjectURL(e) : null,
589
+ uploading: !0,
590
+ progress: 0,
591
+ showSuccess: !1,
592
+ showError: !1
593
+ });
594
+ f.value.push(t);
595
+ let n = new FormData();
596
+ n.append("file", e);
597
+ let r = document.head.querySelector("meta[name=\"csrf-token\"]");
598
+ i.post(c.url, n, {
599
+ headers: {
600
+ "Content-Type": "multipart/form-data",
601
+ ...r ? { "X-CSRF-TOKEN": r.getAttribute("content") } : {}
602
+ },
603
+ onUploadProgress(e) {
604
+ e.total && (t.progress = Math.round(e.loaded * 100 / e.total));
605
+ }
606
+ }).then((e) => {
607
+ t.response = e.data, t.uploading = !1, t.showSuccess = !0, setTimeout(() => {
608
+ t.showSuccess = !1;
609
+ }, 1500);
610
+ }).catch((e) => {
611
+ U(e.response?.data?.message || e.message || "Upload failed"), t.uploading = !1, t.showError = !0, setTimeout(() => {
612
+ let e = f.value.indexOf(t);
613
+ e !== -1 && f.value.splice(e, 1);
614
+ }, 2e3);
615
+ });
616
+ }
617
+ function k(e, t) {
618
+ if (t.forEach((e) => {
619
+ let t = e.errors.map((e) => e?.message || "Invalid file").join(", ");
620
+ U(`${e.file.name}: ${t}`);
621
+ }), c.maxNumberOfFiles > 0) {
622
+ let t = D.value.length + f.value.length, n = c.maxNumberOfFiles - t;
623
+ if (n <= 0) {
624
+ U(`Maximum ${c.maxNumberOfFiles} file${c.maxNumberOfFiles > 1 ? "s" : ""} allowed`);
625
+ return;
626
+ }
627
+ e.length > n && (U(`Only ${n} more file${n > 1 ? "s" : ""} can be added`), e = e.slice(0, n));
628
+ }
629
+ e.forEach((e) => {
630
+ O(e);
631
+ });
632
+ }
633
+ let { getRootProps: A, getInputProps: j, isDragActive: M } = re({
634
+ onDrop: k,
635
+ accept: c.acceptedFileTypes ? c.acceptedFileTypes.split(",").map((e) => e.trim()) : void 0,
636
+ maxSize: c.maxFileSizeInMb > 0 ? c.maxFileSizeInMb * 1024 * 1024 : Infinity,
637
+ multiple: c.maxNumberOfFiles !== 1
638
+ });
639
+ function N(e) {
640
+ _.value[e] && (_.value[e].deleted = !0);
641
+ }
642
+ function P(e) {
643
+ f.value.splice(e, 1);
644
+ }
645
+ function I(e) {
646
+ return e ? e < 1024 ? e + " B" : e < 1024 * 1024 ? (e / 1024).toFixed(1) + " KB" : (e / (1024 * 1024)).toFixed(1) + " MB" : "";
647
+ }
648
+ function L(e) {
649
+ return e.type && e.type.includes("image");
650
+ }
651
+ function R(e) {
652
+ return z(e.type || "");
653
+ }
654
+ function z(e) {
655
+ return e.includes("pdf") ? "fa-solid fa-file-pdf" : e.includes("word") ? "fa-solid fa-file-word" : e.includes("spreadsheet") || e.includes("csv") ? "fa-solid fa-file-excel" : e.includes("presentation") ? "fa-solid fa-file-powerpoint" : e.includes("video") ? "fa-solid fa-file-video" : e.includes("text") ? "fa-solid fa-file-lines" : e.includes("zip") || e.includes("rar") ? "fa-solid fa-file-zipper" : "fa-solid fa-file";
656
+ }
657
+ function B() {
658
+ let e = [];
659
+ return _.value.forEach((t) => {
660
+ t.deleted && e.push({
661
+ id: t.id,
662
+ collection_name: c.collection,
663
+ action: "delete"
664
+ });
665
+ }), f.value.forEach((t) => {
666
+ t.response?.path && e.push({
667
+ id: t.file.id,
668
+ collection_name: c.collection,
669
+ path: t.response.path,
670
+ action: "add",
671
+ meta_data: {
672
+ name: t.file.name,
673
+ file_name: t.file.name,
674
+ width: t.file.width,
675
+ height: t.file.height
676
+ }
677
+ });
678
+ }), e;
679
+ }
680
+ return n({ getFiles: B }), (n, r) => (y(), o("div", ot, [e.label ? (y(), o("label", st, [
681
+ s("i", { class: m([l.value, "me-1 text-body-secondary"]) }, null, 2),
682
+ s("span", ct, w(e.label), 1),
683
+ (y(!0), o(t, null, S(u.value, (e, t) => (y(), o("small", {
684
+ key: t,
685
+ class: "text-body-secondary fw-light ms-1"
686
+ }, "(" + w(e) + ")", 1))), 128)),
687
+ e.isPrivate ? (y(), o("i", lt)) : a("", !0)
688
+ ])) : a("", !0), s("div", p(E(A)(), { class: ["vue3-dropzone dropzone", { "dz-drag-hover": E(M) }] }), [
689
+ s("input", h(d(E(j)())), null, 16),
690
+ s("input", {
691
+ type: "hidden",
692
+ name: "collection",
693
+ value: e.collection
694
+ }, null, 8, ut),
695
+ D.value.length === 0 && f.value.length === 0 ? (y(), o("div", dt, [...r[2] ||= [s("i", { class: "fa-solid fa-cloud-arrow-up" }, null, -1), s("p", null, "Drop files here or click to upload", -1)]])) : a("", !0),
696
+ (y(!0), o(t, null, S(_.value, (e, t) => (y(), o("div", {
697
+ key: "existing-" + (e.id || t),
698
+ class: m(["dz-preview dz-file-preview dz-existing", { "dz-deleted": e.deleted }])
699
+ }, [s("div", ft, [L(e) ? (y(), o("img", {
700
+ key: 0,
701
+ src: e.thumb_url,
702
+ alt: e.name
703
+ }, null, 8, pt)) : (y(), o("div", mt, [s("i", { class: m(R(e)) }, null, 2), s("p", null, w(e.name), 1)]))]), s("div", {
704
+ class: "dz-hover-overlay",
705
+ onClick: r[0] ||= F(() => {}, ["stop"])
706
+ }, [
707
+ s("span", ht, w(I(e.size)), 1),
708
+ s("span", gt, w(e.name), 1),
709
+ s("button", {
710
+ type: "button",
711
+ class: "dz-remove-btn",
712
+ onClick: F((e) => N(t), ["stop"])
713
+ }, "REMOVE", 8, _t)
714
+ ])], 2))), 128)),
715
+ (y(!0), o(t, null, S(f.value, (e, t) => (y(), o("div", {
716
+ key: "new-" + t,
717
+ class: m(["dz-preview dz-file-preview", {
718
+ "dz-success": e.showSuccess,
719
+ "dz-error": e.showError
720
+ }])
721
+ }, [
722
+ s("div", vt, [e.previewUrl ? (y(), o("img", {
723
+ key: 0,
724
+ src: e.previewUrl,
725
+ alt: e.file.name
726
+ }, null, 8, yt)) : (y(), o("div", bt, [s("i", { class: m(z(e.file.type)) }, null, 2), s("p", null, w(e.file.name), 1)]))]),
727
+ e.uploading ? (y(), o("div", xt, [s("span", {
728
+ class: "dz-upload",
729
+ style: g({ width: e.progress + "%" })
730
+ }, null, 4)])) : a("", !0),
731
+ e.showSuccess ? (y(), o("div", St, [...r[3] ||= [s("i", { class: "fa-solid fa-check" }, null, -1)]])) : a("", !0),
732
+ e.showError ? (y(), o("div", Ct, [...r[4] ||= [s("i", { class: "fa-solid fa-xmark" }, null, -1)]])) : a("", !0),
733
+ !e.uploading && !e.showSuccess ? (y(), o("div", {
734
+ key: 3,
735
+ class: "dz-hover-overlay",
736
+ onClick: r[1] ||= F(() => {}, ["stop"])
737
+ }, [
738
+ s("span", wt, w(I(e.file.size)), 1),
739
+ s("span", Tt, w(e.file.name), 1),
740
+ s("button", {
741
+ type: "button",
742
+ class: "dz-remove-btn",
743
+ onClick: F((e) => P(t), ["stop"])
744
+ }, "REMOVE", 8, Et)
745
+ ])) : a("", !0)
746
+ ], 2))), 128))
747
+ ], 16)]));
748
+ }
749
+ }, Ot = { class: "tiptap-editor" }, kt = {
750
+ key: 0,
751
+ class: "tiptap-toolbar"
752
+ }, At = ["selected"], jt = ["value", "selected"], Mt = {
753
+ key: 0,
754
+ class: "tiptap-toolbar-divider"
755
+ }, Nt = ["disabled"], Pt = ["disabled"], Z = {
756
+ __name: "TiptapEditor",
757
+ props: {
758
+ modelValue: {
759
+ type: String,
760
+ default: ""
761
+ },
762
+ config: {
763
+ type: Object,
764
+ default: () => ({})
765
+ },
766
+ showTableControls: {
767
+ type: Boolean,
768
+ default: !0
769
+ },
770
+ uploadUrl: {
771
+ type: String,
772
+ default: "/admin/wysiwyg-media"
773
+ }
774
+ },
775
+ emits: ["update:modelValue", "media-uploaded"],
776
+ setup(e, { emit: n }) {
777
+ let r = window.axios, i = e, c = n, u = [
778
+ oe.configure({ link: { openOnClick: !1 } }),
779
+ se.configure({ HTMLAttributes: { class: "tiptap-image" } }),
780
+ ce.configure({ resizable: !0 }),
781
+ de,
782
+ le,
783
+ ue,
784
+ ...i.config.extensions || []
785
+ ], d = ae({
786
+ content: i.modelValue,
787
+ extensions: u,
788
+ onUpdate: ({ editor: e }) => {
789
+ c("update:modelValue", e.getHTML());
790
+ }
791
+ });
792
+ j(() => i.modelValue, (e) => {
793
+ d.value && d.value.getHTML() !== e && d.value.commands.setContent(e, { emitUpdate: !1 });
794
+ }), _(() => {
795
+ d.value && d.value.destroy();
796
+ });
797
+ function f(e) {
798
+ let t = parseInt(e.target.value);
799
+ t === 0 ? d.value.chain().focus().setParagraph().run() : d.value.chain().focus().toggleHeading({ level: t }).run();
800
+ }
801
+ function p() {
802
+ let e = d.value.getAttributes("link").href, t = window.prompt("URL", e);
803
+ if (t !== null) {
804
+ if (t === "") {
805
+ d.value.chain().focus().extendMarkRange("link").unsetLink().run();
806
+ return;
807
+ }
808
+ d.value.chain().focus().extendMarkRange("link").setLink({ href: t }).run();
809
+ }
810
+ }
811
+ let h = x(null);
812
+ function g() {
813
+ let e = window.prompt("Image URL");
814
+ e && d.value.chain().focus().setImage({ src: e }).run();
815
+ }
816
+ function v() {
817
+ h.value.click();
818
+ }
819
+ function b(e) {
820
+ let t = e.target.files[0];
821
+ if (!t) return;
822
+ let n = new FormData();
823
+ n.append("fileToUpload", t);
824
+ let a = document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content");
825
+ r.post(i.uploadUrl, n, { headers: {
826
+ "Content-Type": "multipart/form-data",
827
+ ...a ? { "X-CSRF-TOKEN": a } : {}
828
+ } }).then((e) => {
829
+ d.value.chain().focus().setImage({ src: e.data.file }).run(), c("media-uploaded", e.data);
830
+ }, (e) => {
831
+ U(e.response?.data?.error);
832
+ }).finally(() => {
833
+ h.value.value = "";
834
+ });
835
+ }
836
+ return (n, r) => (y(), o("div", Ot, [E(d) ? (y(), o("div", kt, [
837
+ s("select", {
838
+ class: "tiptap-heading-select",
839
+ onChange: r[0] ||= (e) => f(e)
840
+ }, [s("option", {
841
+ value: "0",
842
+ selected: !E(d).isActive("heading")
843
+ }, "Paragraph", 8, At), (y(), o(t, null, S([
844
+ 1,
845
+ 2,
846
+ 3,
847
+ 4,
848
+ 5,
849
+ 6
850
+ ], (e) => s("option", {
851
+ key: e,
852
+ value: e,
853
+ selected: E(d).isActive("heading", { level: e })
854
+ }, " H" + w(e), 9, jt)), 64))], 32),
855
+ s("button", {
856
+ type: "button",
857
+ class: m({ "is-active": E(d).isActive("bold") }),
858
+ title: "Bold",
859
+ onClick: r[1] ||= (e) => E(d).chain().focus().toggleBold().run()
860
+ }, [...r[9] ||= [s("strong", null, "B", -1)]], 2),
861
+ s("button", {
862
+ type: "button",
863
+ class: m({ "is-active": E(d).isActive("italic") }),
864
+ title: "Italic",
865
+ onClick: r[2] ||= (e) => E(d).chain().focus().toggleItalic().run()
866
+ }, [...r[10] ||= [s("em", null, "I", -1)]], 2),
867
+ s("button", {
868
+ type: "button",
869
+ class: m({ "is-active": E(d).isActive("strike") }),
870
+ title: "Strikethrough",
871
+ onClick: r[3] ||= (e) => E(d).chain().focus().toggleStrike().run()
872
+ }, [...r[11] ||= [s("s", null, "S", -1)]], 2),
873
+ r[12] ||= s("span", { class: "tiptap-toolbar-divider" }, null, -1),
874
+ s("button", {
875
+ type: "button",
876
+ class: m({ "is-active": E(d).isActive("bulletList") }),
877
+ title: "Bullet List",
878
+ onClick: r[4] ||= (e) => E(d).chain().focus().toggleBulletList().run()
879
+ }, " • ", 2),
880
+ s("button", {
881
+ type: "button",
882
+ class: m({ "is-active": E(d).isActive("orderedList") }),
883
+ title: "Ordered List",
884
+ onClick: r[5] ||= (e) => E(d).chain().focus().toggleOrderedList().run()
885
+ }, " 1. ", 2),
886
+ r[13] ||= s("span", { class: "tiptap-toolbar-divider" }, null, -1),
887
+ s("button", {
888
+ type: "button",
889
+ title: "Link",
890
+ onClick: p
891
+ }, "🔗"),
892
+ s("button", {
893
+ type: "button",
894
+ title: "Upload Image",
895
+ onClick: v
896
+ }, "📤"),
897
+ s("button", {
898
+ type: "button",
899
+ title: "Image URL",
900
+ onClick: g
901
+ }, "📷"),
902
+ s("input", {
903
+ ref_key: "fileInput",
904
+ ref: h,
905
+ type: "file",
906
+ accept: "image/*",
907
+ style: { display: "none" },
908
+ onChange: b
909
+ }, null, 544),
910
+ e.showTableControls ? (y(), o("span", Mt)) : a("", !0),
911
+ e.showTableControls ? (y(), o("button", {
912
+ key: 1,
913
+ type: "button",
914
+ title: "Insert Table",
915
+ onClick: r[6] ||= (e) => E(d).chain().focus().insertTable({
916
+ rows: 3,
917
+ cols: 3,
918
+ withHeaderRow: !0
919
+ }).run()
920
+ }, " ▦ ")) : a("", !0),
921
+ r[14] ||= s("span", { class: "tiptap-toolbar-divider" }, null, -1),
922
+ s("button", {
923
+ type: "button",
924
+ disabled: !E(d).can().undo(),
925
+ title: "Undo",
926
+ onClick: r[7] ||= (e) => E(d).chain().focus().undo().run()
927
+ }, " ↩ ", 8, Nt),
928
+ s("button", {
929
+ type: "button",
930
+ disabled: !E(d).can().redo(),
931
+ title: "Redo",
932
+ onClick: r[8] ||= (e) => E(d).chain().focus().redo().run()
933
+ }, " ↪ ", 8, Pt)
934
+ ])) : a("", !0), l(E(ie), {
935
+ editor: E(d),
936
+ class: "tiptap-content"
937
+ }, null, 8, ["editor"])]));
938
+ }
939
+ };
940
+ //#endregion
941
+ //#region src/utils/ckeditorHelpers.js
942
+ function Ft(e) {
943
+ if (!e) return e;
944
+ let t = new DOMParser().parseFromString(e, "text/html"), n = !1;
945
+ return t.querySelectorAll("figure").forEach((e) => {
946
+ let t = e.style.width;
947
+ if (!t) return;
948
+ let r = e.querySelector("img");
949
+ r && (r.style.width = t, r.style.height = "auto", n = !0);
950
+ }), n ? t.body.innerHTML : e;
951
+ }
952
+ function It(e, t) {
953
+ let n = { ...e };
954
+ for (let r of Object.keys(t)) t[r] && typeof t[r] == "object" && !Array.isArray(t[r]) && e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? n[r] = It(e[r], t[r]) : n[r] = t[r];
955
+ return n;
956
+ }
957
+ //#endregion
958
+ //#region src/components/form/CkeditorEditor.vue
959
+ var Lt = { class: "ck-editor-wrapper" }, Rt = {
960
+ __name: "CkeditorEditor",
961
+ props: {
962
+ modelValue: {
963
+ type: String,
964
+ default: ""
965
+ },
966
+ config: {
967
+ type: Object,
968
+ default: null
969
+ },
970
+ uploadUrl: {
971
+ type: String,
972
+ default: "/admin/wysiwyg-media"
973
+ }
974
+ },
975
+ emits: ["update:modelValue", "media-uploaded"],
976
+ setup(e, { emit: t }) {
977
+ let n = window.axios, i = e, a = t, s = r({
978
+ get: () => i.modelValue ?? "",
979
+ set: (e) => a("update:modelValue", Ft(e))
980
+ });
981
+ function c(e) {
982
+ e.plugins.get("FileRepository").createUploadAdapter = (e) => new u(e, i.uploadUrl);
983
+ }
984
+ class u {
985
+ constructor(e, t) {
986
+ this.loader = e, this.url = t;
987
+ }
988
+ upload() {
989
+ return this.loader.file.then((e) => {
990
+ let t = new FormData();
991
+ return t.append("fileToUpload", e), n.post(this.url, t, {
992
+ headers: { "Content-Type": "multipart/form-data" },
993
+ onUploadProgress: (e) => {
994
+ e.total && (this.loader.uploadTotal = e.total, this.loader.uploaded = e.loaded);
995
+ }
996
+ }).then((e) => {
997
+ let t = e.data.file || e.data.url || e.data;
998
+ return a("media-uploaded", e.data), { default: t };
999
+ });
1000
+ });
1001
+ }
1002
+ abort() {}
1003
+ }
1004
+ let d = {
1005
+ licenseKey: "GPL",
1006
+ plugins: [
1007
+ ye,
1008
+ he,
1009
+ Ne,
1010
+ Ve,
1011
+ Re,
1012
+ Se,
1013
+ Ie,
1014
+ fe,
1015
+ Fe,
1016
+ Pe,
1017
+ pe,
1018
+ we,
1019
+ Ae,
1020
+ Te,
1021
+ ke,
1022
+ Oe,
1023
+ Ee,
1024
+ De,
1025
+ je,
1026
+ ze,
1027
+ Be,
1028
+ ve,
1029
+ _e,
1030
+ Le,
1031
+ me,
1032
+ Ce,
1033
+ Me,
1034
+ xe,
1035
+ He,
1036
+ be
1037
+ ],
1038
+ extraPlugins: [c],
1039
+ toolbar: {
1040
+ items: /* @__PURE__ */ "heading.|.bold.italic.underline.strikethrough.|.alignment.|.bulletedList.numberedList.|.blockQuote.horizontalLine.|.link.insertImage.insertTable.|.code.codeBlock.|.undo.redo.|.sourceEditing".split("."),
1041
+ shouldNotGroupWhenFull: !0
1042
+ },
1043
+ image: {
1044
+ toolbar: [
1045
+ "imageStyle:inline",
1046
+ "imageStyle:block",
1047
+ "imageStyle:side",
1048
+ "|",
1049
+ "toggleImageCaption",
1050
+ "imageTextAlternative",
1051
+ "|",
1052
+ "resizeImage"
1053
+ ],
1054
+ resizeUnit: "px",
1055
+ resizeOptions: [
1056
+ {
1057
+ name: "resizeImage:original",
1058
+ value: null,
1059
+ label: "Original"
1060
+ },
1061
+ {
1062
+ name: "resizeImage:200",
1063
+ value: "200",
1064
+ label: "200px"
1065
+ },
1066
+ {
1067
+ name: "resizeImage:400",
1068
+ value: "400",
1069
+ label: "400px"
1070
+ },
1071
+ {
1072
+ name: "resizeImage:600",
1073
+ value: "600",
1074
+ label: "600px"
1075
+ }
1076
+ ]
1077
+ },
1078
+ table: { contentToolbar: [
1079
+ "tableColumn",
1080
+ "tableRow",
1081
+ "mergeTableCells"
1082
+ ] },
1083
+ htmlSupport: { allow: [{
1084
+ name: /.*/,
1085
+ attributes: !0,
1086
+ classes: !0,
1087
+ styles: !0
1088
+ }] },
1089
+ heading: { options: [
1090
+ {
1091
+ model: "paragraph",
1092
+ title: "Paragraph",
1093
+ class: "ck-heading_paragraph"
1094
+ },
1095
+ {
1096
+ model: "heading1",
1097
+ view: "h1",
1098
+ title: "Heading 1",
1099
+ class: "ck-heading_heading1"
1100
+ },
1101
+ {
1102
+ model: "heading2",
1103
+ view: "h2",
1104
+ title: "Heading 2",
1105
+ class: "ck-heading_heading2"
1106
+ },
1107
+ {
1108
+ model: "heading3",
1109
+ view: "h3",
1110
+ title: "Heading 3",
1111
+ class: "ck-heading_heading3"
1112
+ },
1113
+ {
1114
+ model: "heading4",
1115
+ view: "h4",
1116
+ title: "Heading 4",
1117
+ class: "ck-heading_heading4"
1118
+ }
1119
+ ] }
1120
+ }, f = r(() => i.config ? It(d, T(i.config)) : d);
1121
+ return (e, t) => (y(), o("div", Lt, [l(E(Ue), {
1122
+ modelValue: s.value,
1123
+ "onUpdate:modelValue": t[0] ||= (e) => s.value = e,
1124
+ editor: E(ge),
1125
+ config: f.value
1126
+ }, null, 8, [
1127
+ "modelValue",
1128
+ "editor",
1129
+ "config"
1130
+ ])]));
1131
+ }
1132
+ }, zt = { class: "user-detail-tooltip d-inline-flex align-items-center" }, Bt = {
1133
+ key: 0,
1134
+ class: "col-form-label text-body-secondary me-2 mb-0"
1135
+ }, Vt = { class: "d-inline-flex align-items-center cursor-pointer" }, Ht = ["src", "alt"], Ut = {
1136
+ key: 1,
1137
+ class: "avatar-initials"
1138
+ }, Wt = {
1139
+ key: 2,
1140
+ class: "avatar-trigger-text"
1141
+ }, Gt = { class: "avatar-full-name" }, Kt = {
1142
+ key: 0,
1143
+ class: "d-block user-info-span"
1144
+ }, qt = { class: "user-detail-popper d-flex align-items-center" }, Jt = { class: "user-avatar flex-shrink-0" }, Yt = ["src", "alt"], Xt = {
1145
+ key: 1,
1146
+ class: "avatar-initials"
1147
+ }, Zt = { class: "user-info ms-3" }, Qt = { key: 0 }, $t = { class: "text-uppercase" }, en = ["href"], tn = { key: 1 }, nn = {
1148
+ __name: "UserDetailTooltip",
1149
+ props: {
1150
+ user: {
1151
+ type: Object,
1152
+ required: !0
1153
+ },
1154
+ userText: {
1155
+ type: String,
1156
+ default: ""
1157
+ },
1158
+ label: {
1159
+ type: String,
1160
+ default: ""
1161
+ },
1162
+ datetimeText: {
1163
+ type: String,
1164
+ default: ""
1165
+ },
1166
+ options: {
1167
+ type: Object,
1168
+ default: () => ({ showFullNameLabel: !0 })
1169
+ },
1170
+ datetime: {
1171
+ type: String,
1172
+ default: ""
1173
+ }
1174
+ },
1175
+ setup(e) {
1176
+ let t = e, n = r(() => `${t.user.first_name.slice(0, 1)}${t.user.last_name.slice(0, 1)}`);
1177
+ return (t, r) => (y(), o("div", zt, [e.label ? (y(), o("label", Bt, w(e.label) + " :", 1)) : a("", !0), l(E(We), {
1178
+ arrow: "",
1179
+ click: ""
1180
+ }, {
1181
+ content: M(() => [s("div", qt, [s("div", Jt, [e.user.avatar_thumb_url ? (y(), o("img", {
1182
+ key: 0,
1183
+ src: e.user.avatar_thumb_url,
1184
+ class: "avatar-photo",
1185
+ alt: e.user.full_name
1186
+ }, null, 8, Yt)) : (y(), o("div", Xt, w(n.value), 1))]), s("div", Zt, [
1187
+ s("h3", null, [c(w(e.user.full_name) + " ", 1), e.userText ? (y(), o("small", Qt, [r[0] ||= c(" | ", -1), s("strong", $t, w(e.userText), 1)])) : a("", !0)]),
1188
+ e.user.email ? (y(), o("a", {
1189
+ key: 0,
1190
+ href: "mailto:" + e.user.email
1191
+ }, w(e.user.email), 9, en)) : a("", !0),
1192
+ e.datetimeText ? (y(), o("p", tn, w(e.datetimeText), 1)) : a("", !0)
1193
+ ])])]),
1194
+ default: M(() => [s("div", Vt, [e.user.avatar_thumb_url ? (y(), o("img", {
1195
+ key: 0,
1196
+ src: e.user.avatar_thumb_url,
1197
+ class: "avatar-photo",
1198
+ alt: e.user.full_name
1199
+ }, null, 8, Ht)) : (y(), o("div", Ut, w(n.value), 1)), e.options.showFullNameLabel ? (y(), o("div", Wt, [s("span", Gt, w(e.user.full_name), 1), e.datetime ? (y(), o("span", Kt, w(e.datetime), 1)) : a("", !0)])) : a("", !0)])]),
1200
+ _: 1
1201
+ })]));
1202
+ }
1203
+ }, rn = {
1204
+ key: 0,
1205
+ class: "row"
1206
+ }, an = { class: "col-sm" }, on = { class: "pagination-caption" }, sn = { class: "col-sm-auto" }, cn = {
1207
+ key: 0,
1208
+ class: "page-link"
1209
+ }, ln = { "aria-hidden": "true" }, un = ["aria-label"], dn = { "aria-hidden": "true" }, fn = ["onClick"], pn = {
1210
+ key: 0,
1211
+ class: "page-link"
1212
+ }, mn = { "aria-hidden": "true" }, hn = ["aria-label"], gn = { "aria-hidden": "true" }, _n = {
1213
+ __name: "Pagination",
1214
+ props: {
1215
+ pagination: {
1216
+ type: Object,
1217
+ required: !0
1218
+ },
1219
+ options: {
1220
+ type: Object,
1221
+ default: () => ({})
1222
+ },
1223
+ size: {
1224
+ type: String,
1225
+ default: ""
1226
+ },
1227
+ translations: {
1228
+ type: Object,
1229
+ default: () => ({
1230
+ previous: "Previous",
1231
+ next: "Next",
1232
+ overview: "Displaying items from :from to :to of total :total items."
1233
+ })
1234
+ }
1235
+ },
1236
+ emits: ["page-change", "per-page-change"],
1237
+ setup(e, { emit: n }) {
1238
+ let i = e, c = n, { cookies: l } = ne(), u = r(() => (i.translations.overview || "").replace(":from", i.pagination.from).replace(":to", i.pagination.to).replace(":total", i.pagination.total)), d = r(() => Object.assign({
1239
+ offset: 3,
1240
+ alwaysShowPrevNext: !1
1241
+ }, i.options)), f = r(() => {
1242
+ if (i.pagination.last_page <= 0) return [];
1243
+ let e = i.pagination.current_page - d.value.offset;
1244
+ e < 1 && (e = 1);
1245
+ let t = e + d.value.offset * 2;
1246
+ t >= i.pagination.last_page && (t = i.pagination.last_page);
1247
+ let n = [];
1248
+ for (; e <= t;) n.push(e), e++;
1249
+ return n;
1250
+ }), p = r(() => i.size === "large" ? "pagination-lg" : i.size === "small" ? "pagination-sm" : "");
1251
+ j(() => i.pagination.per_page, (e, t) => {
1252
+ +e != +t && (l.set("per_page", e), c("per-page-change"));
1253
+ });
1254
+ function h() {
1255
+ return d.value.alwaysShowPrevNext || i.pagination.current_page > 1;
1256
+ }
1257
+ function g() {
1258
+ return d.value.alwaysShowPrevNext || i.pagination.current_page < i.pagination.last_page;
1259
+ }
1260
+ function _(e) {
1261
+ i.pagination.current_page !== e && c("page-change", e);
1262
+ }
1263
+ return (n, r) => e.pagination.total > 0 ? (y(), o("div", rn, [s("div", an, [s("span", on, w(u.value), 1)]), s("div", sn, [s("nav", null, [e.pagination.last_page > 1 ? (y(), o("ul", {
1264
+ key: 0,
1265
+ class: m(["pagination", p.value])
1266
+ }, [
1267
+ h() ? (y(), o("li", {
1268
+ key: 0,
1269
+ class: m({
1270
+ disabled: e.pagination.current_page <= 1,
1271
+ "page-item": !0
1272
+ })
1273
+ }, [e.pagination.current_page <= 1 ? (y(), o("span", cn, [s("span", ln, w(e.translations.previous), 1)])) : a("", !0), e.pagination.current_page > 1 ? (y(), o("a", {
1274
+ key: 1,
1275
+ href: "#",
1276
+ "aria-label": e.translations.previous,
1277
+ class: "page-link",
1278
+ onClick: r[0] ||= F((t) => _(e.pagination.current_page - 1), ["prevent"])
1279
+ }, [s("span", dn, w(e.translations.previous), 1)], 8, un)) : a("", !0)], 2)) : a("", !0),
1280
+ (y(!0), o(t, null, S(f.value, (t) => (y(), o("li", {
1281
+ key: t,
1282
+ class: m({
1283
+ active: t === e.pagination.current_page,
1284
+ "page-item": !0
1285
+ })
1286
+ }, [s("a", {
1287
+ href: "#",
1288
+ class: "page-link",
1289
+ onClick: F((e) => _(t), ["prevent"])
1290
+ }, w(t), 9, fn)], 2))), 128)),
1291
+ g() ? (y(), o("li", {
1292
+ key: 1,
1293
+ class: m({
1294
+ disabled: e.pagination.current_page === e.pagination.last_page || e.pagination.last_page === 0,
1295
+ "page-item": !0
1296
+ })
1297
+ }, [e.pagination.current_page === e.pagination.last_page || e.pagination.last_page === 0 ? (y(), o("span", pn, [s("span", mn, w(e.translations.next), 1)])) : a("", !0), e.pagination.current_page < e.pagination.last_page ? (y(), o("a", {
1298
+ key: 1,
1299
+ href: "#",
1300
+ "aria-label": e.translations.next,
1301
+ class: "page-link",
1302
+ onClick: r[1] ||= F((t) => _(e.pagination.current_page + 1), ["prevent"])
1303
+ }, [s("span", gn, w(e.translations.next), 1)], 8, hn)) : a("", !0)], 2)) : a("", !0)
1304
+ ], 2)) : a("", !0)])])])) : a("", !0);
1305
+ }
1306
+ }, Q = {
1307
+ __name: "Sortable",
1308
+ props: {
1309
+ column: {
1310
+ type: String,
1311
+ required: !0
1312
+ },
1313
+ orderBy: {
1314
+ type: Object,
1315
+ required: !0
1316
+ }
1317
+ },
1318
+ emits: ["sort"],
1319
+ setup(e, { emit: t }) {
1320
+ let n = e, r = t;
1321
+ function i(e) {
1322
+ r("sort", {
1323
+ column: e,
1324
+ direction: n.orderBy.column === e && n.orderBy.direction === "asc" ? "desc" : "asc"
1325
+ });
1326
+ }
1327
+ return (t, n) => (y(), o("th", null, [s("a", { onClick: n[0] ||= F((t) => i(e.column), ["stop"]) }, [s("span", { class: m(["fa", {
1328
+ "fa-arrow-down-wide-short": e.orderBy.column === e.column && e.orderBy.direction === "asc",
1329
+ "fa-arrow-down-short-wide": e.orderBy.column === e.column && e.orderBy.direction === "desc"
1330
+ }]) }, null, 2), C(t.$slots, "default")])]));
1331
+ }
1332
+ }, vn = { class: "input-group" }, yn = { class: "form-control d-flex align-items-center p-0" }, bn = ["placeholder", "value"], xn = {
1333
+ __name: "Search",
1334
+ props: {
1335
+ search: {
1336
+ type: String,
1337
+ default: ""
1338
+ },
1339
+ debounce: {
1340
+ type: Number,
1341
+ default: 400
1342
+ },
1343
+ filterFn: {
1344
+ type: Function,
1345
+ required: !0
1346
+ },
1347
+ translations: {
1348
+ type: Object,
1349
+ default: () => ({
1350
+ search_placeholder: "Search...",
1351
+ search_btn: "Search"
1352
+ })
1353
+ }
1354
+ },
1355
+ emits: ["update:search"],
1356
+ setup(e, { emit: t }) {
1357
+ let n = e, r = t, i = x(null), l = null;
1358
+ function u() {
1359
+ l &&= (clearTimeout(l), null);
1360
+ }
1361
+ function d(e) {
1362
+ let t = e.target.value;
1363
+ r("update:search", t), u(), l = setTimeout(() => {
1364
+ n.filterFn("search", t);
1365
+ }, n.debounce);
1366
+ }
1367
+ function f() {
1368
+ u(), n.filterFn("search", n.search);
1369
+ }
1370
+ function p() {
1371
+ u();
1372
+ let e = i.value?.value ?? n.search;
1373
+ r("update:search", e), n.filterFn("search", e);
1374
+ }
1375
+ function m() {
1376
+ u(), r("update:search", ""), n.filterFn("search", "");
1377
+ }
1378
+ return _(u), (t, n) => (y(), o("div", vn, [
1379
+ C(t.$slots, "prepend"),
1380
+ s("div", yn, [s("input", {
1381
+ ref_key: "inputRef",
1382
+ ref: i,
1383
+ class: "border-0 shadow-none ps-3 flex-grow-1",
1384
+ style: {
1385
+ outline: "none",
1386
+ "min-width": "0"
1387
+ },
1388
+ placeholder: e.translations.search_placeholder,
1389
+ value: e.search,
1390
+ onInput: d,
1391
+ onKeyup: P(p, ["enter"])
1392
+ }, null, 40, bn), e.search ? (y(), o("button", {
1393
+ key: 0,
1394
+ type: "button",
1395
+ class: "border-0 bg-transparent pe-1 ps-0 flex-shrink-0 text-danger",
1396
+ onClick: m
1397
+ }, [...n[0] ||= [s("i", { class: "fa fa-times" }, null, -1)]])) : a("", !0)]),
1398
+ s("button", {
1399
+ type: "button",
1400
+ class: "btn btn-primary",
1401
+ onClick: f
1402
+ }, [n[1] ||= s("i", { class: "fa fa-search" }, null, -1), c("\xA0 " + w(e.translations.search_btn), 1)])
1403
+ ]));
1404
+ }
1405
+ }, Sn = ["value"], Cn = {
1406
+ __name: "PerPage",
1407
+ props: { modelValue: {
1408
+ type: [Number, String],
1409
+ default: 10
1410
+ } },
1411
+ emits: ["update:modelValue"],
1412
+ setup(e) {
1413
+ return (t, n) => (y(), o("select", {
1414
+ class: "form-select",
1415
+ value: e.modelValue,
1416
+ onChange: n[0] ||= (e) => t.$emit("update:modelValue", +e.target.value)
1417
+ }, [...n[1] ||= [
1418
+ s("option", { value: "10" }, "10", -1),
1419
+ s("option", { value: "25" }, "25", -1),
1420
+ s("option", { value: "100" }, "100", -1)
1421
+ ]], 40, Sn));
1422
+ }
1423
+ }, wn = {
1424
+ key: 0,
1425
+ class: "no-items-found"
1426
+ }, Tn = ["href"], En = {
1427
+ __name: "EmptyState",
1428
+ props: {
1429
+ show: {
1430
+ type: Boolean,
1431
+ default: !0
1432
+ },
1433
+ createUrl: {
1434
+ type: String,
1435
+ default: ""
1436
+ },
1437
+ translations: {
1438
+ type: Object,
1439
+ default: () => ({
1440
+ no_items: "Could not find any items",
1441
+ try_changing_items: "Try changing the filters or add a new one",
1442
+ create_btn: "New"
1443
+ })
1444
+ }
1445
+ },
1446
+ setup(e) {
1447
+ return (t, n) => e.show ? (y(), o("div", wn, [
1448
+ n[1] ||= s("i", { class: "fa fa-magnifying-glass" }, null, -1),
1449
+ s("h3", null, w(e.translations.no_items), 1),
1450
+ s("p", null, w(e.translations.try_changing_items), 1),
1451
+ e.createUrl ? (y(), o("a", {
1452
+ key: 0,
1453
+ class: "btn btn-primary btn-spinner",
1454
+ href: e.createUrl,
1455
+ role: "button"
1456
+ }, [n[0] ||= s("i", { class: "fa fa-plus" }, null, -1), c("\xA0 " + w(e.translations.create_btn), 1)], 8, Tn)) : a("", !0)
1457
+ ])) : a("", !0);
1458
+ }
1459
+ }, Dn = ["checked"], On = {
1460
+ __name: "BulkCheckboxHeader",
1461
+ props: {
1462
+ isClickedAll: {
1463
+ type: Boolean,
1464
+ required: !0
1465
+ },
1466
+ onToggleAll: {
1467
+ type: Function,
1468
+ required: !0
1469
+ }
1470
+ },
1471
+ setup(e) {
1472
+ return (n, r) => (y(), o(t, null, [s("input", {
1473
+ id: "enabled",
1474
+ class: "form-check-input",
1475
+ type: "checkbox",
1476
+ checked: e.isClickedAll,
1477
+ name: "enabled_fake_element",
1478
+ onClick: r[0] ||= (t) => e.onToggleAll()
1479
+ }, null, 8, Dn), r[1] ||= s("label", {
1480
+ class: "form-check-label",
1481
+ for: "enabled"
1482
+ }, " # ", -1)], 64));
1483
+ }
1484
+ }, kn = [
1485
+ "id",
1486
+ "checked",
1487
+ "name",
1488
+ "disabled"
1489
+ ], An = ["for"], jn = {
1490
+ __name: "BulkCheckboxRow",
1491
+ props: {
1492
+ itemId: {
1493
+ type: [Number, String],
1494
+ required: !0
1495
+ },
1496
+ checked: {
1497
+ type: Boolean,
1498
+ default: !1
1499
+ },
1500
+ disabled: {
1501
+ type: Boolean,
1502
+ default: !1
1503
+ },
1504
+ onToggle: {
1505
+ type: Function,
1506
+ required: !0
1507
+ }
1508
+ },
1509
+ setup(e) {
1510
+ return (n, r) => (y(), o(t, null, [s("input", {
1511
+ id: "enabled" + e.itemId,
1512
+ class: "form-check-input",
1513
+ type: "checkbox",
1514
+ checked: e.checked,
1515
+ name: "enabled" + e.itemId + "_fake_element",
1516
+ disabled: e.disabled,
1517
+ onClick: r[0] ||= (t) => e.onToggle(e.itemId)
1518
+ }, null, 8, kn), s("label", {
1519
+ class: "form-check-label",
1520
+ for: "enabled" + e.itemId
1521
+ }, null, 8, An)], 64));
1522
+ }
1523
+ }, Mn = { class: "align-middle fw-light text-dark" }, Nn = {
1524
+ key: 0,
1525
+ class: "fa fa-spinner"
1526
+ }, Pn = {
1527
+ key: 1,
1528
+ class: "text-primary"
1529
+ }, Fn = { class: "float-end pe-2" }, In = {
1530
+ __name: "BulkOperationsBar",
1531
+ props: {
1532
+ selectedCount: {
1533
+ type: Number,
1534
+ required: !0
1535
+ },
1536
+ totalCount: {
1537
+ type: Number,
1538
+ required: !0
1539
+ },
1540
+ loading: {
1541
+ type: Boolean,
1542
+ default: !1
1543
+ },
1544
+ onCheckAll: {
1545
+ type: Function,
1546
+ required: !0
1547
+ },
1548
+ onUncheckAll: {
1549
+ type: Function,
1550
+ required: !0
1551
+ },
1552
+ onBulkDelete: {
1553
+ type: Function,
1554
+ required: !0
1555
+ },
1556
+ translations: {
1557
+ type: Object,
1558
+ default: () => ({
1559
+ selected_items: "Selected items",
1560
+ check_all_items: "Check all items",
1561
+ uncheck_all_items: "Uncheck all items",
1562
+ delete_btn: "Delete"
1563
+ })
1564
+ }
1565
+ },
1566
+ setup(e) {
1567
+ return (n, r) => (y(), o(t, null, [s("span", Mn, [
1568
+ c(w(e.translations.selected_items) + " " + w(e.selectedCount) + ". ", 1),
1569
+ e.selectedCount < e.totalCount ? (y(), o("a", {
1570
+ key: 0,
1571
+ href: "javascript:void(0)",
1572
+ class: "text-primary",
1573
+ onClick: r[0] ||= (t) => e.onCheckAll()
1574
+ }, [e.loading ? (y(), o("i", Nn)) : a("", !0), c(" " + w(e.translations.check_all_items) + " " + w(e.totalCount), 1)])) : a("", !0),
1575
+ e.selectedCount < e.totalCount ? (y(), o("span", Pn, " | ")) : a("", !0),
1576
+ s("a", {
1577
+ href: "javascript:void(0)",
1578
+ class: "text-primary",
1579
+ onClick: r[1] ||= (t) => e.onUncheckAll()
1580
+ }, w(e.translations.uncheck_all_items), 1)
1581
+ ]), s("span", Fn, [C(n.$slots, "default", {}, () => [s("button", {
1582
+ class: "btn btn-sm btn-danger px-4",
1583
+ onClick: r[2] ||= (t) => e.onBulkDelete()
1584
+ }, w(e.translations.delete_btn), 1)])])], 64));
1585
+ }
1586
+ }, Ln = {
1587
+ class: "modal-dialog modal-dialog-centered",
1588
+ role: "document"
1589
+ }, Rn = { class: "modal-content" }, zn = { class: "modal-header" }, Bn = { class: "modal-title" }, Vn = { class: "modal-body" }, Hn = { class: "modal-footer" }, Un = {
1590
+ __name: "ConfirmModal",
1591
+ props: {
1592
+ show: {
1593
+ type: Boolean,
1594
+ default: !1
1595
+ },
1596
+ variant: {
1597
+ type: String,
1598
+ default: "danger",
1599
+ validator: (e) => [
1600
+ "danger",
1601
+ "success",
1602
+ "primary",
1603
+ "warning"
1604
+ ].includes(e)
1605
+ },
1606
+ translations: {
1607
+ type: Object,
1608
+ default: () => ({
1609
+ confirm_title: "Warning!",
1610
+ confirm_text: "Are you sure?",
1611
+ confirm_btn: "Yes, confirm",
1612
+ cancel_btn: "Cancel"
1613
+ })
1614
+ }
1615
+ },
1616
+ emits: ["confirm", "cancel"],
1617
+ setup(e) {
1618
+ let t = e, l = r(() => {
1619
+ let e = `btn btn-${t.variant}`;
1620
+ return ["success", "primary"].includes(t.variant) ? `${e} text-white` : e;
1621
+ }), u = r(() => t.variant === "danger" ? "fa fa-triangle-exclamation text-danger" : t.variant === "warning" ? "fa fa-triangle-exclamation text-warning" : t.variant === "success" ? "fa fa-circle-check text-success" : "fa fa-circle-question text-primary");
1622
+ return (t, r) => (y(), i(n, { to: "body" }, [e.show ? (y(), o("div", {
1623
+ key: 0,
1624
+ class: "modal-backdrop fade show",
1625
+ onClick: r[0] ||= (e) => t.$emit("cancel")
1626
+ })) : a("", !0), e.show ? (y(), o("div", {
1627
+ key: 1,
1628
+ class: "modal fade show d-block",
1629
+ tabindex: "-1",
1630
+ role: "dialog",
1631
+ onClick: r[4] ||= F((e) => t.$emit("cancel"), ["self"])
1632
+ }, [s("div", Ln, [s("div", Rn, [
1633
+ s("div", zn, [s("h5", Bn, [s("i", { class: m([u.value, "me-2"]) }, null, 2), c(" " + w(e.translations.confirm_title), 1)]), s("button", {
1634
+ type: "button",
1635
+ class: "btn-close",
1636
+ onClick: r[1] ||= (e) => t.$emit("cancel")
1637
+ })]),
1638
+ s("div", Vn, [s("p", null, w(e.translations.confirm_text), 1)]),
1639
+ s("div", Hn, [s("button", {
1640
+ type: "button",
1641
+ class: "btn btn-secondary",
1642
+ onClick: r[2] ||= (e) => t.$emit("cancel")
1643
+ }, w(e.translations.cancel_btn), 1), s("button", {
1644
+ type: "button",
1645
+ class: m(l.value),
1646
+ onClick: r[3] ||= (e) => t.$emit("confirm")
1647
+ }, w(e.translations.confirm_btn), 3)])
1648
+ ])])])) : a("", !0)]));
1649
+ }
1650
+ }, Wn = { key: 0 }, Gn = { key: 1 }, Kn = ["title"], qn = { key: 2 }, Jn = ["title"], Yn = { key: 3 }, Xn = ["title", "disabled"], Zn = { key: 4 }, Qn = ["title", "disabled"], $n = {
1651
+ key: 6,
1652
+ class: "publish-later-modal"
1653
+ }, er = { class: "d-flex justify-content-between align-items-center mb-2" }, tr = { class: "mt-2 text-end" }, nr = ["disabled"], rr = {
1654
+ __name: "PublishedAtColumn",
1655
+ props: {
1656
+ item: {
1657
+ type: Object,
1658
+ required: !0
1659
+ },
1660
+ url: {
1661
+ type: String,
1662
+ required: !0
1663
+ },
1664
+ now: {
1665
+ type: String,
1666
+ required: !0
1667
+ },
1668
+ datetimeFormat: {
1669
+ type: String,
1670
+ default: "DD.MM.YYYY HH:mm"
1671
+ },
1672
+ translations: {
1673
+ type: Object,
1674
+ default: () => ({
1675
+ publish_now: "Publish now",
1676
+ unpublish_now: "Unpublish now",
1677
+ publish_later: "Publish later",
1678
+ will_be_published: "This item will be published at",
1679
+ confirm_publish_now: "Do you really want to publish this item now?",
1680
+ confirm_unpublish_now: "Do you really want to unpublish this item?"
1681
+ })
1682
+ }
1683
+ },
1684
+ emits: ["update:item"],
1685
+ setup(e, { emit: n }) {
1686
+ let r = window.axios, i = J(), u = e, d = n, f = x(!1), p = x(null), m = x(!1), h = x(!1), g = x(null), _ = x({}), v = x("danger");
1687
+ function b() {
1688
+ p.value = u.item.published_at || null, f.value = !0;
1689
+ }
1690
+ function S() {
1691
+ p.value && (m.value = !0, r.post(u.url, { published_at: p.value }).then((e) => {
1692
+ d("update:item", {
1693
+ ...u.item,
1694
+ published_at: e.data.object.published_at
1695
+ }), f.value = !1, H(e.data.message);
1696
+ }, (e) => {
1697
+ U(e.response?.data?.message);
1698
+ }).finally(() => {
1699
+ m.value = !1;
1700
+ }));
1701
+ }
1702
+ function C() {
1703
+ g.value = "publish", v.value = "success", _.value = {
1704
+ confirm_title: u.translations.publish_now,
1705
+ confirm_text: u.translations.confirm_publish_now,
1706
+ confirm_btn: u.translations.publish_now,
1707
+ cancel_btn: "Cancel"
1708
+ }, h.value = !0;
1709
+ }
1710
+ function T() {
1711
+ g.value = "unpublish", v.value = "danger", _.value = {
1712
+ confirm_title: u.translations.unpublish_now,
1713
+ confirm_text: u.translations.confirm_unpublish_now,
1714
+ confirm_btn: u.translations.unpublish_now,
1715
+ cancel_btn: "Cancel"
1716
+ }, h.value = !0;
1717
+ }
1718
+ function D() {
1719
+ h.value = !1, g.value === "publish" ? k() : g.value === "unpublish" && A(), g.value = null;
1720
+ }
1721
+ function O() {
1722
+ h.value = !1, g.value = null;
1723
+ }
1724
+ function k() {
1725
+ m.value = !0, r.post(u.url, { publish_now: !0 }).then((e) => {
1726
+ d("update:item", {
1727
+ ...u.item,
1728
+ published_at: e.data.object.published_at
1729
+ }), H(e.data.message);
1730
+ }, (e) => {
1731
+ U(e.response?.data?.message);
1732
+ }).finally(() => {
1733
+ m.value = !1;
1734
+ });
1735
+ }
1736
+ function A() {
1737
+ m.value = !0, r.post(u.url, { unpublish_now: !0 }).then((e) => {
1738
+ d("update:item", {
1739
+ ...u.item,
1740
+ published_at: e.data.object.published_at,
1741
+ published_to: e.data.object.published_to
1742
+ }), H(e.data.message);
1743
+ }, (e) => {
1744
+ U(e.response?.data?.message);
1745
+ }).finally(() => {
1746
+ m.value = !1;
1747
+ });
1748
+ }
1749
+ return (n, r) => (y(), o(t, null, [
1750
+ e.item.published_at <= e.now ? (y(), o("span", Wn, w(E(G)(e.item.published_at, e.datetimeFormat)), 1)) : a("", !0),
1751
+ e.item.published_at > e.now ? (y(), o("span", Gn, [
1752
+ s("small", null, w(e.translations.will_be_published), 1),
1753
+ r[9] ||= s("br", null, null, -1),
1754
+ c(" " + w(E(G)(e.item.published_at, e.datetimeFormat)) + " ", 1),
1755
+ s("span", {
1756
+ class: "cursor-pointer",
1757
+ title: e.translations.publish_later,
1758
+ role: "button",
1759
+ onClick: r[0] ||= (e) => b()
1760
+ }, [...r[8] ||= [s("i", { class: "fa fa-calendar" }, null, -1)]], 8, Kn)
1761
+ ])) : a("", !0),
1762
+ e.item.published_at ? a("", !0) : (y(), o("div", qn, [s("span", {
1763
+ class: "btn btn-sm btn-info text-white mb-1",
1764
+ title: e.translations.publish_later,
1765
+ role: "button",
1766
+ onClick: r[1] ||= (e) => b()
1767
+ }, [r[10] ||= s("i", { class: "fa fa-calendar" }, null, -1), c("\xA0\xA0" + w(e.translations.publish_later), 1)], 8, Jn)])),
1768
+ !e.item.published_at || e.item.published_at > e.now ? (y(), o("div", Yn, [s("form", {
1769
+ class: "d-inline",
1770
+ onSubmit: r[2] ||= F((e) => C(), ["prevent"])
1771
+ }, [s("button", {
1772
+ type: "submit",
1773
+ class: "btn btn-sm btn-success text-white",
1774
+ title: e.translations.publish_now,
1775
+ disabled: m.value
1776
+ }, [r[11] ||= s("i", { class: "fa fa-paper-plane" }, null, -1), c("\xA0\xA0" + w(e.translations.publish_now), 1)], 8, Xn)], 32)])) : a("", !0),
1777
+ e.item.published_at && e.item.published_at < e.now ? (y(), o("div", Zn, [s("form", {
1778
+ class: "d-inline",
1779
+ onSubmit: r[3] ||= F((e) => T(), ["prevent"])
1780
+ }, [s("button", {
1781
+ type: "submit",
1782
+ class: "btn btn-sm btn-danger",
1783
+ title: e.translations.unpublish_now,
1784
+ disabled: m.value
1785
+ }, [r[12] ||= s("i", { class: "fa fa-paper-plane" }, null, -1), c("\xA0\xA0" + w(e.translations.unpublish_now), 1)], 8, Qn)], 32)])) : a("", !0),
1786
+ f.value ? (y(), o("div", {
1787
+ key: 5,
1788
+ class: "publish-later-backdrop",
1789
+ onClick: r[4] ||= F((e) => f.value = !1, ["self"])
1790
+ })) : a("", !0),
1791
+ f.value ? (y(), o("div", $n, [
1792
+ s("div", er, [s("strong", null, w(e.translations.publish_later), 1), s("button", {
1793
+ type: "button",
1794
+ class: "btn-close btn-close-sm",
1795
+ "aria-label": "Close",
1796
+ onClick: r[5] ||= (e) => f.value = !1
1797
+ })]),
1798
+ l(E(Ge), {
1799
+ modelValue: p.value,
1800
+ "onUpdate:modelValue": r[6] ||= (e) => p.value = e,
1801
+ "model-type": "yyyy-MM-dd HH:mm:ss",
1802
+ format: "dd.MM.yyyy HH:mm",
1803
+ "format-locale": E(i),
1804
+ "enable-time-picker": !0,
1805
+ "enable-seconds": !1,
1806
+ inline: !0,
1807
+ "auto-apply": ""
1808
+ }, null, 8, ["modelValue", "format-locale"]),
1809
+ s("div", tr, [s("button", {
1810
+ class: "btn btn-sm btn-primary text-white",
1811
+ disabled: m.value || !p.value,
1812
+ onClick: r[7] ||= (e) => S()
1813
+ }, " Save ", 8, nr)])
1814
+ ])) : a("", !0),
1815
+ l(Un, {
1816
+ show: h.value,
1817
+ translations: _.value,
1818
+ variant: v.value,
1819
+ onConfirm: D,
1820
+ onCancel: O
1821
+ }, null, 8, [
1822
+ "show",
1823
+ "translations",
1824
+ "variant"
1825
+ ])
1826
+ ], 64));
1827
+ }
1828
+ }, ir = ["href"], ar = ["href"], or = {
1829
+ __name: "ListingHeader",
1830
+ props: {
1831
+ createUrl: {
1832
+ type: String,
1833
+ default: ""
1834
+ },
1835
+ exportUrl: {
1836
+ type: String,
1837
+ default: ""
1838
+ },
1839
+ translations: {
1840
+ type: Object,
1841
+ default: () => ({
1842
+ listing_title: "Listing",
1843
+ create_btn: "New",
1844
+ export_btn: "Export"
1845
+ })
1846
+ }
1847
+ },
1848
+ setup(e) {
1849
+ return (n, r) => (y(), o(t, null, [
1850
+ r[2] ||= s("i", { class: "fa fa-align-justify" }, null, -1),
1851
+ c(" " + w(e.translations.listing_title) + " ", 1),
1852
+ e.exportUrl ? (y(), o("a", {
1853
+ key: 0,
1854
+ class: "btn btn-primary btn-sm float-end mb-0 ms-2",
1855
+ href: e.exportUrl,
1856
+ role: "button"
1857
+ }, [r[0] ||= s("i", { class: "fa fa-file-excel" }, null, -1), c("\xA0 " + w(e.translations.export_btn), 1)], 8, ir)) : a("", !0),
1858
+ e.createUrl ? (y(), o("a", {
1859
+ key: 1,
1860
+ class: "btn btn-primary btn-spinner btn-sm float-end mb-0",
1861
+ href: e.createUrl,
1862
+ role: "button"
1863
+ }, [r[1] ||= s("i", { class: "fa fa-plus" }, null, -1), c("\xA0 " + w(e.translations.create_btn), 1)], 8, ar)) : a("", !0)
1864
+ ], 64));
1865
+ }
1866
+ }, sr = ["href", "title"], cr = {
1867
+ __name: "EditButton",
1868
+ props: {
1869
+ url: {
1870
+ type: String,
1871
+ required: !0
1872
+ },
1873
+ translations: {
1874
+ type: Object,
1875
+ default: () => ({ edit_btn: "Edit" })
1876
+ }
1877
+ },
1878
+ setup(e) {
1879
+ return (t, n) => (y(), o("a", {
1880
+ class: "btn btn-sm btn-spinner btn-info",
1881
+ href: e.url,
1882
+ title: e.translations.edit_btn,
1883
+ role: "button"
1884
+ }, [...n[0] ||= [s("i", { class: "fa fa-edit" }, null, -1)]], 8, sr));
1885
+ }
1886
+ }, lr = ["title"], ur = {
1887
+ __name: "DeleteButton",
1888
+ props: {
1889
+ url: {
1890
+ type: String,
1891
+ required: !0
1892
+ },
1893
+ translations: {
1894
+ type: Object,
1895
+ default: () => ({
1896
+ delete_btn: "Delete",
1897
+ confirm_title: "Warning!",
1898
+ confirm_text: "Do you really want to delete this item?",
1899
+ confirm_btn: "Delete",
1900
+ cancel_btn: "Cancel"
1901
+ })
1902
+ }
1903
+ },
1904
+ emits: ["deleted"],
1905
+ setup(e, { emit: n }) {
1906
+ let r = window.axios, i = e, a = n, c = x(!1);
1907
+ function u() {
1908
+ c.value = !1, r.delete(i.url).then((e) => {
1909
+ H(e.data.message), a("deleted");
1910
+ }, (e) => {
1911
+ U(e.response?.data?.message);
1912
+ });
1913
+ }
1914
+ return (n, r) => (y(), o(t, null, [s("button", {
1915
+ type: "button",
1916
+ class: "btn btn-sm btn-danger",
1917
+ title: e.translations.delete_btn,
1918
+ onClick: r[0] ||= (e) => c.value = !0
1919
+ }, [...r[2] ||= [s("i", { class: "fa fa-trash" }, null, -1)]], 8, lr), l(Un, {
1920
+ show: c.value,
1921
+ translations: e.translations,
1922
+ onConfirm: u,
1923
+ onCancel: r[1] ||= (e) => c.value = !1
1924
+ }, null, 8, ["show", "translations"])], 64));
1925
+ }
1926
+ }, dr = { class: "form-check form-switch form-switch-inline" }, fr = ["checked"], pr = {
1927
+ __name: "ToggleSwitch",
1928
+ props: {
1929
+ modelValue: {
1930
+ type: [
1931
+ Boolean,
1932
+ Number,
1933
+ String
1934
+ ],
1935
+ required: !0
1936
+ },
1937
+ url: {
1938
+ type: String,
1939
+ required: !0
1940
+ },
1941
+ column: {
1942
+ type: String,
1943
+ required: !0
1944
+ },
1945
+ row: {
1946
+ type: Object,
1947
+ required: !0
1948
+ },
1949
+ variant: {
1950
+ type: String,
1951
+ default: "success"
1952
+ }
1953
+ },
1954
+ emits: ["update:modelValue"],
1955
+ setup(e, { emit: t }) {
1956
+ let n = window.axios, i = e, a = t, c = r(() => `form-switch-${i.variant}`);
1957
+ function l() {
1958
+ let e = !i.modelValue;
1959
+ a("update:modelValue", e);
1960
+ let t = {
1961
+ ...i.row,
1962
+ [i.column]: e
1963
+ };
1964
+ n.post(i.url, t).then((e) => {
1965
+ H(e.data.message);
1966
+ }, (e) => {
1967
+ a("update:modelValue", i.modelValue), U(e.response?.data?.message);
1968
+ });
1969
+ }
1970
+ return (t, n) => (y(), o("div", dr, [s("input", {
1971
+ class: m(["form-check-input", c.value]),
1972
+ type: "checkbox",
1973
+ role: "switch",
1974
+ checked: !!e.modelValue,
1975
+ onChange: l
1976
+ }, null, 42, fr)]));
1977
+ }
1978
+ }, mr = { class: "mb-3 row align-items-center" }, hr = ["for"], gr = { class: "col-md-9 col-xl-8" }, _r = [
1979
+ "id",
1980
+ "type",
1981
+ "value",
1982
+ "name",
1983
+ "placeholder"
1984
+ ], vr = {
1985
+ key: 0,
1986
+ class: "invalid-feedback form-text"
1987
+ }, yr = {
1988
+ __name: "FormInput",
1989
+ props: {
1990
+ modelValue: {
1991
+ type: [String, Number],
1992
+ default: ""
1993
+ },
1994
+ name: {
1995
+ type: String,
1996
+ required: !0
1997
+ },
1998
+ label: {
1999
+ type: String,
2000
+ required: !0
2001
+ },
2002
+ error: {
2003
+ type: String,
2004
+ default: ""
2005
+ },
2006
+ type: {
2007
+ type: String,
2008
+ default: "text"
2009
+ },
2010
+ placeholder: {
2011
+ type: String,
2012
+ default: ""
2013
+ }
2014
+ },
2015
+ emits: ["update:modelValue"],
2016
+ setup(e) {
2017
+ return (t, n) => (y(), o("div", mr, [s("label", {
2018
+ for: e.name,
2019
+ class: "col-md-3 col-form-label text-md-end"
2020
+ }, w(e.label), 9, hr), s("div", gr, [s("input", {
2021
+ id: e.name,
2022
+ type: e.type,
2023
+ value: e.modelValue,
2024
+ class: m(["form-control", { "is-invalid": e.error }]),
2025
+ name: e.name,
2026
+ placeholder: e.placeholder || e.label,
2027
+ onInput: n[0] ||= (e) => t.$emit("update:modelValue", e.target.value)
2028
+ }, null, 42, _r), e.error ? (y(), o("div", vr, w(e.error), 1)) : a("", !0)])]));
2029
+ }
2030
+ }, br = {
2031
+ __name: "FormEmail",
2032
+ props: {
2033
+ modelValue: {
2034
+ type: [String, Number],
2035
+ default: ""
2036
+ },
2037
+ name: {
2038
+ type: String,
2039
+ required: !0
2040
+ },
2041
+ label: {
2042
+ type: String,
2043
+ required: !0
2044
+ },
2045
+ error: {
2046
+ type: String,
2047
+ default: ""
2048
+ },
2049
+ placeholder: {
2050
+ type: String,
2051
+ default: ""
2052
+ }
2053
+ },
2054
+ emits: ["update:modelValue"],
2055
+ setup(e) {
2056
+ return (e, t) => (y(), i(yr, p(e.$props, {
2057
+ type: "email",
2058
+ "onUpdate:modelValue": t[0] ||= (t) => e.$emit("update:modelValue", t)
2059
+ }), null, 16));
2060
+ }
2061
+ }, xr = { class: "mb-3 row align-items-center" }, Sr = ["for"], Cr = { class: "col-md-9 col-xl-8" }, wr = [
2062
+ "id",
2063
+ "value",
2064
+ "name",
2065
+ "placeholder",
2066
+ "rows"
2067
+ ], Tr = {
2068
+ key: 0,
2069
+ class: "invalid-feedback form-text"
2070
+ }, Er = {
2071
+ __name: "FormTextarea",
2072
+ props: {
2073
+ modelValue: {
2074
+ type: String,
2075
+ default: ""
2076
+ },
2077
+ name: {
2078
+ type: String,
2079
+ required: !0
2080
+ },
2081
+ label: {
2082
+ type: String,
2083
+ required: !0
2084
+ },
2085
+ error: {
2086
+ type: String,
2087
+ default: ""
2088
+ },
2089
+ placeholder: {
2090
+ type: String,
2091
+ default: ""
2092
+ },
2093
+ rows: {
2094
+ type: [Number, String],
2095
+ default: 3
2096
+ }
2097
+ },
2098
+ emits: ["update:modelValue"],
2099
+ setup(e) {
2100
+ return (t, n) => (y(), o("div", xr, [s("label", {
2101
+ for: e.name,
2102
+ class: "col-md-3 col-form-label text-md-end"
2103
+ }, w(e.label), 9, Sr), s("div", Cr, [s("textarea", {
2104
+ id: e.name,
2105
+ value: e.modelValue,
2106
+ class: m(["form-control", { "is-invalid": e.error }]),
2107
+ name: e.name,
2108
+ placeholder: e.placeholder || e.label,
2109
+ rows: e.rows,
2110
+ onInput: n[0] ||= (e) => t.$emit("update:modelValue", e.target.value)
2111
+ }, null, 42, wr), e.error ? (y(), o("div", Tr, w(e.error), 1)) : a("", !0)])]));
2112
+ }
2113
+ }, Dr = { class: "mb-3 row align-items-center" }, Or = { class: "col-md-9 col-xl-8 offset-md-3" }, kr = { class: "form-check" }, Ar = [
2114
+ "id",
2115
+ "checked",
2116
+ "name"
2117
+ ], jr = ["for"], Mr = {
2118
+ key: 0,
2119
+ class: "invalid-feedback d-block form-text"
2120
+ }, Nr = {
2121
+ __name: "FormCheckbox",
2122
+ props: {
2123
+ modelValue: {
2124
+ type: Boolean,
2125
+ default: !1
2126
+ },
2127
+ name: {
2128
+ type: String,
2129
+ required: !0
2130
+ },
2131
+ label: {
2132
+ type: String,
2133
+ required: !0
2134
+ },
2135
+ error: {
2136
+ type: String,
2137
+ default: ""
2138
+ }
2139
+ },
2140
+ emits: ["update:modelValue"],
2141
+ setup(e) {
2142
+ return (t, n) => (y(), o("div", Dr, [s("div", Or, [s("div", kr, [s("input", {
2143
+ id: e.name,
2144
+ class: "form-check-input",
2145
+ type: "checkbox",
2146
+ checked: e.modelValue,
2147
+ name: e.name,
2148
+ onChange: n[0] ||= (e) => t.$emit("update:modelValue", e.target.checked)
2149
+ }, null, 40, Ar), s("label", {
2150
+ class: "form-check-label",
2151
+ for: e.name
2152
+ }, w(e.label), 9, jr)]), e.error ? (y(), o("div", Mr, w(e.error), 1)) : a("", !0)])]));
2153
+ }
2154
+ }, $ = (e, t) => {
2155
+ let n = e.__vccOpts || e;
2156
+ for (let [e, r] of t) n[e] = r;
2157
+ return n;
2158
+ }, Pr = { class: "mb-3 row align-items-center" }, Fr = ["for"], Ir = { class: "col-md-9 col-xl-8" }, Lr = { class: "input-group flex-nowrap" }, Rr = { class: "input-group-text" }, zr = {
2159
+ key: 0,
2160
+ class: "invalid-feedback d-block form-text"
2161
+ }, Br = /* @__PURE__ */ $({
2162
+ __name: "FormDatePicker",
2163
+ props: {
2164
+ modelValue: {
2165
+ type: [
2166
+ String,
2167
+ Date,
2168
+ Object
2169
+ ],
2170
+ default: ""
2171
+ },
2172
+ name: {
2173
+ type: String,
2174
+ required: !0
2175
+ },
2176
+ label: {
2177
+ type: String,
2178
+ required: !0
2179
+ },
2180
+ error: {
2181
+ type: String,
2182
+ default: ""
2183
+ },
2184
+ config: {
2185
+ type: Object,
2186
+ required: !0
2187
+ },
2188
+ icon: {
2189
+ type: String,
2190
+ default: "fa-calendar"
2191
+ },
2192
+ placeholder: {
2193
+ type: String,
2194
+ default: ""
2195
+ }
2196
+ },
2197
+ emits: ["update:modelValue"],
2198
+ setup(e) {
2199
+ return (t, n) => (y(), o("div", Pr, [s("label", {
2200
+ for: e.name,
2201
+ class: "col-md-3 col-form-label text-md-end"
2202
+ }, w(e.label), 9, Fr), s("div", Ir, [s("div", Lr, [s("span", Rr, [s("i", { class: m(["fa", e.icon]) }, null, 2)]), l(E(Ge), p(e.config, {
2203
+ id: e.name,
2204
+ "model-value": e.modelValue,
2205
+ class: ["datepicker-input", { "is-invalid": e.error }],
2206
+ name: e.name,
2207
+ placeholder: e.placeholder || e.label,
2208
+ "time-config": {
2209
+ enableTimePicker: e.config.enableTimePicker ?? !0,
2210
+ enableSeconds: e.config.enableSeconds ?? !1
2211
+ },
2212
+ formats: { input: e.config.format },
2213
+ "auto-apply": "",
2214
+ locale: e.config.locale,
2215
+ "input-attrs": {
2216
+ hideInputIcon: !0,
2217
+ clearable: !1
2218
+ },
2219
+ "onUpdate:modelValue": n[0] ||= (e) => t.$emit("update:modelValue", e)
2220
+ }), null, 16, [
2221
+ "id",
2222
+ "model-value",
2223
+ "class",
2224
+ "name",
2225
+ "placeholder",
2226
+ "time-config",
2227
+ "formats",
2228
+ "locale"
2229
+ ])]), e.error ? (y(), o("div", zr, w(e.error), 1)) : a("", !0)])]));
2230
+ }
2231
+ }, [["__scopeId", "data-v-2e6d6ada"]]), Vr = { class: "mb-3 row align-items-center" }, Hr = ["for"], Ur = { class: "col-md-9 col-xl-8" }, Wr = {
2232
+ key: 0,
2233
+ class: "invalid-feedback d-block form-text"
2234
+ }, Gr = {
2235
+ __name: "FormWysiwyg",
2236
+ props: {
2237
+ modelValue: {
2238
+ type: String,
2239
+ default: ""
2240
+ },
2241
+ name: {
2242
+ type: String,
2243
+ required: !0
2244
+ },
2245
+ label: {
2246
+ type: String,
2247
+ required: !0
2248
+ },
2249
+ error: {
2250
+ type: String,
2251
+ default: ""
2252
+ },
2253
+ config: {
2254
+ type: Object,
2255
+ default: null
2256
+ },
2257
+ uploadUrl: {
2258
+ type: String,
2259
+ default: "/admin/wysiwyg-media"
2260
+ }
2261
+ },
2262
+ emits: ["update:modelValue"],
2263
+ setup(e) {
2264
+ return (t, n) => (y(), o("div", Vr, [s("label", {
2265
+ for: e.name,
2266
+ class: "col-md-3 col-form-label text-md-end"
2267
+ }, w(e.label), 9, Hr), s("div", Ur, [l(Rt, p({
2268
+ id: e.name,
2269
+ "model-value": e.modelValue,
2270
+ name: e.name,
2271
+ "upload-url": e.uploadUrl
2272
+ }, e.config ? { config: e.config } : {}, { "onUpdate:modelValue": n[0] ||= (e) => t.$emit("update:modelValue", e) }), null, 16, [
2273
+ "id",
2274
+ "model-value",
2275
+ "name",
2276
+ "upload-url"
2277
+ ]), e.error ? (y(), o("div", Wr, w(e.error), 1)) : a("", !0)])]));
2278
+ }
2279
+ }, Kr = { class: "mb-3 row align-items-center" }, qr = ["for"], Jr = { class: "col-md-9 col-xl-8" }, Yr = {
2280
+ key: 0,
2281
+ class: "invalid-feedback d-block form-text"
2282
+ }, Xr = {
2283
+ __name: "FormMultiSelect",
2284
+ props: {
2285
+ modelValue: {
2286
+ type: Array,
2287
+ default: () => []
2288
+ },
2289
+ name: {
2290
+ type: String,
2291
+ required: !0
2292
+ },
2293
+ label: {
2294
+ type: String,
2295
+ required: !0
2296
+ },
2297
+ error: {
2298
+ type: String,
2299
+ default: ""
2300
+ },
2301
+ options: {
2302
+ type: Array,
2303
+ required: !0
2304
+ },
2305
+ placeholder: {
2306
+ type: String,
2307
+ default: ""
2308
+ },
2309
+ trackBy: {
2310
+ type: String,
2311
+ default: "id"
2312
+ },
2313
+ optionLabel: {
2314
+ type: String,
2315
+ default: "name"
2316
+ }
2317
+ },
2318
+ emits: ["update:modelValue"],
2319
+ setup(e) {
2320
+ return (t, n) => (y(), o("div", Kr, [s("label", {
2321
+ for: e.name,
2322
+ class: "col-md-3 col-form-label text-md-end"
2323
+ }, w(e.label), 9, qr), s("div", Jr, [l(E(V), {
2324
+ "model-value": e.modelValue,
2325
+ class: m({ "is-invalid": e.error }),
2326
+ placeholder: e.placeholder,
2327
+ options: e.options,
2328
+ multiple: !0,
2329
+ label: e.optionLabel,
2330
+ "track-by": e.trackBy,
2331
+ "open-direction": "bottom",
2332
+ "onUpdate:modelValue": n[0] ||= (e) => t.$emit("update:modelValue", e)
2333
+ }, null, 8, [
2334
+ "model-value",
2335
+ "class",
2336
+ "placeholder",
2337
+ "options",
2338
+ "label",
2339
+ "track-by"
2340
+ ]), e.error ? (y(), o("div", Yr, w(e.error), 1)) : a("", !0)])]));
2341
+ }
2342
+ }, Zr = { class: "mb-3 row align-items-center" }, Qr = ["for"], $r = { class: "col-md-9 col-xl-8" }, ei = [
2343
+ "id",
2344
+ "value",
2345
+ "name",
2346
+ "placeholder",
2347
+ "onInput"
2348
+ ], ti = {
2349
+ key: 0,
2350
+ class: "invalid-feedback d-block form-text"
2351
+ }, ni = {
2352
+ __name: "FormLocalizedInput",
2353
+ props: {
2354
+ modelValue: {
2355
+ type: Object,
2356
+ required: !0
2357
+ },
2358
+ name: {
2359
+ type: String,
2360
+ required: !0
2361
+ },
2362
+ label: {
2363
+ type: String,
2364
+ required: !0
2365
+ },
2366
+ errors: {
2367
+ type: Object,
2368
+ default: () => ({})
2369
+ },
2370
+ locales: {
2371
+ type: Array,
2372
+ required: !0
2373
+ },
2374
+ shouldShowLangGroup: {
2375
+ type: Function,
2376
+ required: !0
2377
+ },
2378
+ isFormLocalized: {
2379
+ type: Boolean,
2380
+ default: !1
2381
+ }
2382
+ },
2383
+ emits: ["update:modelValue"],
2384
+ setup(e, { emit: n }) {
2385
+ let r = e, i = n;
2386
+ function c(e, t) {
2387
+ i("update:modelValue", {
2388
+ ...r.modelValue,
2389
+ [e]: t
2390
+ });
2391
+ }
2392
+ return (n, r) => (y(), o("div", Zr, [s("label", {
2393
+ for: e.name + "_" + e.locales[0],
2394
+ class: "col-md-3 col-form-label text-md-end"
2395
+ }, w(e.label), 9, Qr), s("div", $r, [s("div", { class: m({ "d-flex gap-2": e.isFormLocalized }) }, [(y(!0), o(t, null, S(e.locales, (t) => N((y(), o("div", {
2396
+ key: t,
2397
+ class: m({ "flex-fill": e.isFormLocalized })
2398
+ }, [s("input", {
2399
+ id: e.name + "_" + t,
2400
+ type: "text",
2401
+ value: e.modelValue[t],
2402
+ class: m(["form-control", { "is-invalid": e.errors[e.name + "_" + t] }]),
2403
+ name: e.name + "_" + t,
2404
+ placeholder: e.isFormLocalized ? t.toUpperCase() : e.label,
2405
+ onInput: (e) => c(t, e.target.value)
2406
+ }, null, 42, ei), e.errors[e.name + "_" + t] ? (y(), o("div", ti, w(e.errors[e.name + "_" + t]), 1)) : a("", !0)], 2)), [[A, e.shouldShowLangGroup(t)]])), 128))], 2)])]));
2407
+ }
2408
+ }, ri = { class: "mb-3 row align-items-center" }, ii = ["for"], ai = { class: "col-md-9 col-xl-8" }, oi = {
2409
+ key: 0,
2410
+ class: "invalid-feedback d-block form-text"
2411
+ }, si = /* @__PURE__ */ $({
2412
+ __name: "FormLocalizedWysiwyg",
2413
+ props: {
2414
+ modelValue: {
2415
+ type: Object,
2416
+ required: !0
2417
+ },
2418
+ name: {
2419
+ type: String,
2420
+ required: !0
2421
+ },
2422
+ label: {
2423
+ type: String,
2424
+ required: !0
2425
+ },
2426
+ errors: {
2427
+ type: Object,
2428
+ default: () => ({})
2429
+ },
2430
+ locales: {
2431
+ type: Array,
2432
+ required: !0
2433
+ },
2434
+ shouldShowLangGroup: {
2435
+ type: Function,
2436
+ required: !0
2437
+ },
2438
+ isFormLocalized: {
2439
+ type: Boolean,
2440
+ default: !1
2441
+ },
2442
+ config: {
2443
+ type: Object,
2444
+ default: null
2445
+ },
2446
+ uploadUrl: {
2447
+ type: String,
2448
+ default: "/admin/wysiwyg-media"
2449
+ }
2450
+ },
2451
+ emits: ["update:modelValue"],
2452
+ setup(e, { emit: n }) {
2453
+ let r = e, i = n;
2454
+ function c(e, t) {
2455
+ i("update:modelValue", {
2456
+ ...r.modelValue,
2457
+ [e]: t
2458
+ });
2459
+ }
2460
+ return (n, r) => (y(), o("div", ri, [s("label", {
2461
+ for: e.name + "_" + e.locales[0],
2462
+ class: "col-md-3 col-form-label text-md-end"
2463
+ }, w(e.label), 9, ii), s("div", ai, [s("div", { class: m({ "d-flex gap-2": e.isFormLocalized }) }, [(y(!0), o(t, null, S(e.locales, (t) => N((y(), o("div", {
2464
+ key: t,
2465
+ class: m({ "flex-fill localized-editor": e.isFormLocalized })
2466
+ }, [l(Rt, p({
2467
+ id: e.name + "_" + t,
2468
+ "model-value": e.modelValue[t],
2469
+ name: e.name + "_" + t,
2470
+ "upload-url": e.uploadUrl
2471
+ }, { ref_for: !0 }, e.config ? { config: e.config } : {}, { "onUpdate:modelValue": (e) => c(t, e) }), null, 16, [
2472
+ "id",
2473
+ "model-value",
2474
+ "name",
2475
+ "upload-url",
2476
+ "onUpdate:modelValue"
2477
+ ]), e.errors[e.name + "_" + t] ? (y(), o("div", oi, w(e.errors[e.name + "_" + t]), 1)) : a("", !0)], 2)), [[A, e.shouldShowLangGroup(t)]])), 128))], 2)])]));
2478
+ }
2479
+ }, [["__scopeId", "data-v-608701dd"]]), ci = { class: "mb-3 row align-items-center" }, li = ["for"], ui = { class: "col-md-9 col-xl-8" }, di = {
2480
+ key: 0,
2481
+ class: "invalid-feedback d-block form-text"
2482
+ }, fi = {
2483
+ __name: "FormWysiwygSimple",
2484
+ props: {
2485
+ modelValue: {
2486
+ type: String,
2487
+ default: ""
2488
+ },
2489
+ name: {
2490
+ type: String,
2491
+ required: !0
2492
+ },
2493
+ label: {
2494
+ type: String,
2495
+ required: !0
2496
+ },
2497
+ error: {
2498
+ type: String,
2499
+ default: ""
2500
+ },
2501
+ config: {
2502
+ type: Object,
2503
+ default: null
2504
+ },
2505
+ uploadUrl: {
2506
+ type: String,
2507
+ default: "/admin/wysiwyg-media"
2508
+ }
2509
+ },
2510
+ emits: ["update:modelValue"],
2511
+ setup(e) {
2512
+ return (t, n) => (y(), o("div", ci, [s("label", {
2513
+ for: e.name,
2514
+ class: "col-md-3 col-form-label text-md-end"
2515
+ }, w(e.label), 9, li), s("div", ui, [l(Z, p({
2516
+ id: e.name,
2517
+ "model-value": e.modelValue,
2518
+ name: e.name,
2519
+ "upload-url": e.uploadUrl
2520
+ }, e.config ? { config: e.config } : {}, { "onUpdate:modelValue": n[0] ||= (e) => t.$emit("update:modelValue", e) }), null, 16, [
2521
+ "id",
2522
+ "model-value",
2523
+ "name",
2524
+ "upload-url"
2525
+ ]), e.error ? (y(), o("div", di, w(e.error), 1)) : a("", !0)])]));
2526
+ }
2527
+ }, pi = { class: "mb-3 row align-items-center" }, mi = ["for"], hi = { class: "col-md-9 col-xl-8" }, gi = {
2528
+ key: 0,
2529
+ class: "invalid-feedback d-block form-text"
2530
+ }, _i = /* @__PURE__ */ $({
2531
+ __name: "FormLocalizedWysiwygSimple",
2532
+ props: {
2533
+ modelValue: {
2534
+ type: Object,
2535
+ required: !0
2536
+ },
2537
+ name: {
2538
+ type: String,
2539
+ required: !0
2540
+ },
2541
+ label: {
2542
+ type: String,
2543
+ required: !0
2544
+ },
2545
+ errors: {
2546
+ type: Object,
2547
+ default: () => ({})
2548
+ },
2549
+ locales: {
2550
+ type: Array,
2551
+ required: !0
2552
+ },
2553
+ shouldShowLangGroup: {
2554
+ type: Function,
2555
+ required: !0
2556
+ },
2557
+ isFormLocalized: {
2558
+ type: Boolean,
2559
+ default: !1
2560
+ },
2561
+ config: {
2562
+ type: Object,
2563
+ default: null
2564
+ },
2565
+ uploadUrl: {
2566
+ type: String,
2567
+ default: "/admin/wysiwyg-media"
2568
+ }
2569
+ },
2570
+ emits: ["update:modelValue"],
2571
+ setup(e, { emit: n }) {
2572
+ let r = e, i = n;
2573
+ function c(e, t) {
2574
+ i("update:modelValue", {
2575
+ ...r.modelValue,
2576
+ [e]: t
2577
+ });
2578
+ }
2579
+ return (n, r) => (y(), o("div", pi, [s("label", {
2580
+ for: e.name + "_" + e.locales[0],
2581
+ class: "col-md-3 col-form-label text-md-end"
2582
+ }, w(e.label), 9, mi), s("div", hi, [s("div", { class: m({ "d-flex gap-2": e.isFormLocalized }) }, [(y(!0), o(t, null, S(e.locales, (t) => N((y(), o("div", {
2583
+ key: t,
2584
+ class: m({ "flex-fill localized-editor": e.isFormLocalized })
2585
+ }, [l(Z, p({
2586
+ id: e.name + "_" + t,
2587
+ "model-value": e.modelValue[t],
2588
+ name: e.name + "_" + t,
2589
+ "upload-url": e.uploadUrl
2590
+ }, { ref_for: !0 }, e.config ? { config: e.config } : {}, { "onUpdate:modelValue": (e) => c(t, e) }), null, 16, [
2591
+ "id",
2592
+ "model-value",
2593
+ "name",
2594
+ "upload-url",
2595
+ "onUpdate:modelValue"
2596
+ ]), e.errors[e.name + "_" + t] ? (y(), o("div", gi, w(e.errors[e.name + "_" + t]), 1)) : a("", !0)], 2)), [[A, e.shouldShowLangGroup(t)]])), 128))], 2)])]));
2597
+ }
2598
+ }, [["__scopeId", "data-v-bf19587d"]]), vi = { class: "mb-3 row align-items-center" }, yi = ["for"], bi = { class: "col-md-9 col-xl-8" }, xi = {
2599
+ key: 0,
2600
+ class: "invalid-feedback d-block form-text"
2601
+ }, Si = {
2602
+ __name: "FormSelect",
2603
+ props: {
2604
+ modelValue: {
2605
+ type: [
2606
+ String,
2607
+ Number,
2608
+ Array,
2609
+ Object
2610
+ ],
2611
+ default: ""
2612
+ },
2613
+ name: {
2614
+ type: String,
2615
+ required: !0
2616
+ },
2617
+ label: {
2618
+ type: String,
2619
+ required: !0
2620
+ },
2621
+ error: {
2622
+ type: String,
2623
+ default: ""
2624
+ },
2625
+ options: {
2626
+ type: Array,
2627
+ required: !0
2628
+ },
2629
+ placeholder: {
2630
+ type: String,
2631
+ default: ""
2632
+ },
2633
+ trackBy: {
2634
+ type: String,
2635
+ default: ""
2636
+ },
2637
+ optionLabel: {
2638
+ type: String,
2639
+ default: ""
2640
+ }
2641
+ },
2642
+ emits: ["update:modelValue"],
2643
+ setup(e) {
2644
+ return (t, n) => (y(), o("div", vi, [s("label", {
2645
+ for: e.name,
2646
+ class: "col-md-3 col-form-label text-md-end"
2647
+ }, w(e.label), 9, yi), s("div", bi, [l(E(V), {
2648
+ "model-value": e.modelValue,
2649
+ class: m({ "is-invalid": e.error }),
2650
+ placeholder: e.placeholder,
2651
+ options: e.options,
2652
+ label: e.optionLabel || void 0,
2653
+ "track-by": e.trackBy || void 0,
2654
+ "open-direction": "bottom",
2655
+ "onUpdate:modelValue": n[0] ||= (e) => t.$emit("update:modelValue", e)
2656
+ }, null, 8, [
2657
+ "model-value",
2658
+ "class",
2659
+ "placeholder",
2660
+ "options",
2661
+ "label",
2662
+ "track-by"
2663
+ ]), e.error ? (y(), o("div", xi, w(e.error), 1)) : a("", !0)])]));
2664
+ }
2665
+ }, Ci = { class: "mb-3 row align-items-center" }, wi = {
2666
+ for: "password",
2667
+ class: "col-md-3 col-form-label text-md-end"
2668
+ }, Ti = { class: "col-md-9 col-xl-8" }, Ei = ["value", "placeholder"], Di = {
2669
+ key: 0,
2670
+ class: "invalid-feedback form-text"
2671
+ }, Oi = { class: "mb-3 row align-items-center" }, ki = {
2672
+ for: "password_confirmation",
2673
+ class: "col-md-3 col-form-label text-md-end"
2674
+ }, Ai = { class: "col-md-9 col-xl-8" }, ji = ["value", "placeholder"], Mi = {
2675
+ key: 0,
2676
+ class: "invalid-feedback form-text"
2677
+ }, Ni = {
2678
+ __name: "FormPasswordConfirm",
2679
+ props: {
2680
+ password: {
2681
+ type: String,
2682
+ default: ""
2683
+ },
2684
+ passwordConfirmation: {
2685
+ type: String,
2686
+ default: ""
2687
+ },
2688
+ passwordError: {
2689
+ type: String,
2690
+ default: ""
2691
+ },
2692
+ confirmationError: {
2693
+ type: String,
2694
+ default: ""
2695
+ },
2696
+ translations: {
2697
+ type: Object,
2698
+ required: !0
2699
+ }
2700
+ },
2701
+ emits: ["update:password", "update:passwordConfirmation"],
2702
+ setup(e) {
2703
+ return (n, r) => (y(), o(t, null, [s("div", Ci, [s("label", wi, w(e.translations.password), 1), s("div", Ti, [s("input", {
2704
+ id: "password",
2705
+ type: "password",
2706
+ value: e.password,
2707
+ class: m(["form-control", { "is-invalid": e.passwordError }]),
2708
+ name: "password",
2709
+ placeholder: e.translations.password,
2710
+ onInput: r[0] ||= (e) => n.$emit("update:password", e.target.value)
2711
+ }, null, 42, Ei), e.passwordError ? (y(), o("div", Di, w(e.passwordError), 1)) : a("", !0)])]), s("div", Oi, [s("label", ki, w(e.translations.password_repeat), 1), s("div", Ai, [s("input", {
2712
+ id: "password_confirmation",
2713
+ type: "password",
2714
+ value: e.passwordConfirmation,
2715
+ class: m(["form-control", { "is-invalid": e.confirmationError }]),
2716
+ name: "password_confirmation",
2717
+ placeholder: e.translations.password,
2718
+ onInput: r[1] ||= (e) => n.$emit("update:passwordConfirmation", e.target.value)
2719
+ }, null, 42, ji), e.confirmationError ? (y(), o("div", Mi, w(e.confirmationError), 1)) : a("", !0)])])], 64));
2720
+ }
2721
+ }, Pi = ["disabled"], Fi = {
2722
+ __name: "FormSubmit",
2723
+ props: {
2724
+ submitting: {
2725
+ type: Boolean,
2726
+ default: !1
2727
+ },
2728
+ label: {
2729
+ type: String,
2730
+ default: "Save"
2731
+ }
2732
+ },
2733
+ setup(e) {
2734
+ return (t, n) => (y(), o("button", {
2735
+ type: "submit",
2736
+ class: "btn btn-primary submit-btn",
2737
+ disabled: e.submitting
2738
+ }, [s("i", { class: m(["fa", e.submitting ? "fa-spinner" : "fa-download"]) }, null, 2), c(" " + w(e.label), 1)], 8, Pi));
2739
+ }
2740
+ }, Ii = {
2741
+ key: 0,
2742
+ class: "row mb-2 localization-bar"
2743
+ }, Li = { key: 0 }, Ri = { key: 0 }, zi = {
2744
+ key: 1,
2745
+ class: "localization-error"
2746
+ }, Bi = {
2747
+ key: 2,
2748
+ class: "d-flex align-items-center gap-2"
2749
+ }, Vi = { class: "text-nowrap" }, Hi = {
2750
+ key: 0,
2751
+ class: "localization-error"
2752
+ }, Ui = {
2753
+ key: 0,
2754
+ class: "localization-error"
2755
+ }, Wi = /* @__PURE__ */ $({
2756
+ __name: "LocalizationBar",
2757
+ props: {
2758
+ translations: {
2759
+ type: Object,
2760
+ required: !0
2761
+ },
2762
+ locales: {
2763
+ type: Array,
2764
+ required: !0
2765
+ },
2766
+ defaultLocale: {
2767
+ type: String,
2768
+ required: !0
2769
+ },
2770
+ otherLocales: {
2771
+ type: Array,
2772
+ required: !0
2773
+ },
2774
+ isFormLocalized: {
2775
+ type: Boolean,
2776
+ required: !0
2777
+ },
2778
+ currentLocale: {
2779
+ type: String,
2780
+ required: !0
2781
+ },
2782
+ onSmallScreen: {
2783
+ type: Boolean,
2784
+ default: !1
2785
+ },
2786
+ showLocalizedValidationError: {
2787
+ type: Boolean,
2788
+ default: !1
2789
+ }
2790
+ },
2791
+ emits: [
2792
+ "show-localization",
2793
+ "hide-localization",
2794
+ "update:currentLocale"
2795
+ ],
2796
+ setup(e) {
2797
+ let t = e, n = r(() => t.translations.currently_editing_translation ? t.translations.currently_editing_translation.replace(":locale", t.defaultLocale.toUpperCase()) : ""), i = r(() => t.translations.more_can_be_managed ? t.translations.more_can_be_managed.replace(":count", String(t.otherLocales.length)) : ""), u = r(() => t.onSmallScreen ? [t.defaultLocale, ...t.otherLocales] : [...t.otherLocales]);
2798
+ return (t, r) => e.locales.length > 0 ? (y(), o("div", Ii, [s("div", { class: m(["offset-md-3 col-md-9 col-xl-8 text-start", { "d-none": e.onSmallScreen }]) }, [
2799
+ e.isFormLocalized ? a("", !0) : (y(), o("small", Li, [
2800
+ c(w(n.value), 1),
2801
+ e.otherLocales.length > 1 ? (y(), o("span", Ri, w(i.value), 1)) : a("", !0),
2802
+ r[4] ||= c(" | ", -1),
2803
+ s("a", {
2804
+ href: "#",
2805
+ onClick: r[0] ||= F((e) => t.$emit("show-localization"), ["prevent"])
2806
+ }, w(e.translations.manage_translations), 1)
2807
+ ])),
2808
+ !e.isFormLocalized && e.showLocalizedValidationError ? (y(), o("i", zi)) : a("", !0),
2809
+ e.isFormLocalized ? (y(), o("div", Bi, [
2810
+ s("small", Vi, w(e.translations.choose_translation_to_edit), 1),
2811
+ l(E(V), {
2812
+ "model-value": e.currentLocale,
2813
+ options: u.value,
2814
+ "custom-label": (e) => e.toUpperCase(),
2815
+ searchable: !1,
2816
+ "allow-empty": !1,
2817
+ class: "locale-selector",
2818
+ "onUpdate:modelValue": r[1] ||= (e) => t.$emit("update:currentLocale", e)
2819
+ }, null, 8, [
2820
+ "model-value",
2821
+ "options",
2822
+ "custom-label"
2823
+ ]),
2824
+ e.showLocalizedValidationError ? (y(), o("i", Hi)) : a("", !0),
2825
+ s("small", null, [s("a", {
2826
+ href: "#",
2827
+ onClick: r[2] ||= F((e) => t.$emit("hide-localization"), ["prevent"])
2828
+ }, w(e.translations.hide), 1)])
2829
+ ])) : a("", !0)
2830
+ ], 2), e.onSmallScreen ? (y(), o("div", {
2831
+ key: 0,
2832
+ class: m(["col", {
2833
+ "language-mobile": !0,
2834
+ "text-danger": !e.isFormLocalized && e.showLocalizedValidationError
2835
+ }])
2836
+ }, [s("small", null, [
2837
+ c(w(e.translations.choose_translation_to_edit) + " ", 1),
2838
+ l(E(V), {
2839
+ "model-value": e.currentLocale,
2840
+ options: [e.defaultLocale, ...e.otherLocales],
2841
+ "custom-label": (e) => e.toUpperCase(),
2842
+ searchable: !1,
2843
+ "allow-empty": !1,
2844
+ class: "locale-selector",
2845
+ "onUpdate:modelValue": r[3] ||= (e) => t.$emit("update:currentLocale", e)
2846
+ }, null, 8, [
2847
+ "model-value",
2848
+ "options",
2849
+ "custom-label"
2850
+ ]),
2851
+ e.showLocalizedValidationError ? (y(), o("i", Ui)) : a("", !0)
2852
+ ])], 2)) : a("", !0)])) : a("", !0);
2853
+ }
2854
+ }, [["__scopeId", "data-v-1c9f060d"]]), Gi = { class: "card" }, Ki = { class: "card-body" }, qi = ["action"], Ji = { class: "auth-header" }, Yi = { class: "auth-title" }, Xi = { class: "auth-subtitle" }, Zi = { class: "auth-body" }, Qi = {
2855
+ key: 0,
2856
+ class: "alert alert-success"
2857
+ }, $i = {
2858
+ key: 1,
2859
+ class: "alert alert-danger"
2860
+ }, ea = { class: "mb-3" }, ta = { for: "email" }, na = { class: "input-group input-group--custom" }, ra = ["placeholder"], ia = {
2861
+ key: 0,
2862
+ class: "invalid-feedback d-block form-text"
2863
+ }, aa = { class: "mb-3" }, oa = { for: "password" }, sa = { class: "input-group input-group--custom" }, ca = ["placeholder"], la = {
2864
+ key: 0,
2865
+ class: "invalid-feedback d-block form-text"
2866
+ }, ua = { class: "mb-3" }, da = ["disabled"], fa = {
2867
+ key: 0,
2868
+ class: "fa fa-spinner fa-spin"
2869
+ }, pa = { class: "mb-3 text-center" }, ma = ["href"], ha = /* @__PURE__ */ $({
2870
+ __name: "LoginForm",
2871
+ props: {
2872
+ action: {
2873
+ type: String,
2874
+ required: !0
2875
+ },
2876
+ redirectUrl: {
2877
+ type: String,
2878
+ default: "/admin"
2879
+ },
2880
+ translations: {
2881
+ type: Object,
2882
+ default: () => ({})
2883
+ },
2884
+ passwordResetUrl: {
2885
+ type: String,
2886
+ default: "/admin/password-reset"
2887
+ },
2888
+ statusMessage: {
2889
+ type: String,
2890
+ default: ""
2891
+ },
2892
+ serverErrors: {
2893
+ type: Array,
2894
+ default: () => []
2895
+ }
2896
+ },
2897
+ setup(e) {
2898
+ let n = e, { form: r, errors: i, submitting: l, onSubmit: u } = Y(n, {
2899
+ formDefaults: {
2900
+ email: "",
2901
+ password: ""
2902
+ },
2903
+ validationSchema: {
2904
+ email: "required|email",
2905
+ password: "required"
2906
+ },
2907
+ onSuccess() {
2908
+ window.location.replace(n.redirectUrl);
2909
+ }
2910
+ });
2911
+ return (n, d) => (y(), o("div", Gi, [s("div", Ki, [s("form", {
2912
+ role: "form",
2913
+ method: "POST",
2914
+ action: e.action,
2915
+ novalidate: "",
2916
+ onSubmit: d[2] ||= F((...e) => E(u) && E(u)(...e), ["prevent"])
2917
+ }, [s("div", Ji, [s("h1", Yi, w(e.translations.title), 1), s("p", Xi, w(e.translations.signInText), 1)]), s("div", Zi, [
2918
+ e.statusMessage ? (y(), o("div", Qi, w(e.statusMessage), 1)) : a("", !0),
2919
+ e.serverErrors.length ? (y(), o("div", $i, [s("ul", null, [(y(!0), o(t, null, S(e.serverErrors, (e, t) => (y(), o("li", { key: t }, w(e), 1))), 128))])])) : a("", !0),
2920
+ s("div", ea, [
2921
+ s("label", ta, w(e.translations.email), 1),
2922
+ s("div", na, [d[3] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-envelope" })], -1), N(s("input", {
2923
+ id: "email",
2924
+ "onUpdate:modelValue": d[0] ||= (e) => E(r).email = e,
2925
+ type: "text",
2926
+ class: m(["form-control", { "is-invalid": E(i).email }]),
2927
+ name: "email",
2928
+ placeholder: e.translations.email
2929
+ }, null, 10, ra), [[k, E(r).email]])]),
2930
+ E(i).email ? (y(), o("div", ia, w(E(i).email), 1)) : a("", !0)
2931
+ ]),
2932
+ s("div", aa, [
2933
+ s("label", oa, w(e.translations.password), 1),
2934
+ s("div", sa, [d[4] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-lock" })], -1), N(s("input", {
2935
+ id: "password",
2936
+ "onUpdate:modelValue": d[1] ||= (e) => E(r).password = e,
2937
+ type: "password",
2938
+ class: m(["form-control", { "is-invalid": E(i).password }]),
2939
+ name: "password",
2940
+ placeholder: e.translations.password
2941
+ }, null, 10, ca), [[k, E(r).password]])]),
2942
+ E(i).password ? (y(), o("div", la, w(E(i).password), 1)) : a("", !0)
2943
+ ]),
2944
+ s("div", ua, [d[5] ||= s("input", {
2945
+ type: "hidden",
2946
+ name: "remember",
2947
+ value: "1"
2948
+ }, null, -1), s("button", {
2949
+ type: "submit",
2950
+ class: "btn btn-primary submit-btn",
2951
+ disabled: E(l)
2952
+ }, [E(l) ? (y(), o("i", fa)) : a("", !0), c(" " + w(e.translations.button), 1)], 8, da)]),
2953
+ s("div", pa, [s("a", {
2954
+ href: e.passwordResetUrl,
2955
+ class: "auth-ghost-link forgot-link"
2956
+ }, w(e.translations.forgotPassword), 9, ma)])
2957
+ ])], 40, qi)])]));
2958
+ }
2959
+ }, [["__scopeId", "data-v-8d4257dc"]]), ga = { class: "card" }, _a = { class: "card-body" }, va = ["action"], ya = { class: "auth-header" }, ba = { class: "auth-title" }, xa = { class: "auth-subtitle" }, Sa = { class: "auth-body" }, Ca = {
2960
+ key: 0,
2961
+ class: "alert alert-success"
2962
+ }, wa = {
2963
+ key: 1,
2964
+ class: "alert alert-success"
2965
+ }, Ta = {
2966
+ key: 2,
2967
+ class: "alert alert-danger"
2968
+ }, Ea = { class: "mb-3" }, Da = { for: "email" }, Oa = { class: "input-group input-group--custom" }, ka = ["placeholder"], Aa = {
2969
+ key: 0,
2970
+ class: "invalid-feedback d-block form-text"
2971
+ }, ja = { class: "mb-3" }, Ma = ["disabled"], Na = {
2972
+ key: 0,
2973
+ class: "fa fa-spinner fa-spin"
2974
+ }, Pa = {
2975
+ key: 3,
2976
+ class: "text-center"
2977
+ }, Fa = ["href"], Ia = {
2978
+ __name: "ForgotPasswordForm",
2979
+ props: {
2980
+ action: {
2981
+ type: String,
2982
+ required: !0
2983
+ },
2984
+ loginUrl: {
2985
+ type: String,
2986
+ default: ""
2987
+ },
2988
+ translations: {
2989
+ type: Object,
2990
+ default: () => ({})
2991
+ },
2992
+ statusMessage: {
2993
+ type: String,
2994
+ default: ""
2995
+ },
2996
+ serverErrors: {
2997
+ type: Array,
2998
+ default: () => []
2999
+ }
3000
+ },
3001
+ setup(e) {
3002
+ let { form: n, errors: r, submitting: i, successMessage: l, onSubmit: u } = Y(e, {
3003
+ formDefaults: { email: "" },
3004
+ validationSchema: { email: "required|email" }
3005
+ });
3006
+ return (d, f) => (y(), o("div", ga, [s("div", _a, [s("form", {
3007
+ role: "form",
3008
+ method: "POST",
3009
+ action: e.action,
3010
+ novalidate: "",
3011
+ onSubmit: f[1] ||= F((...e) => E(u) && E(u)(...e), ["prevent"])
3012
+ }, [s("div", ya, [s("h1", ba, w(e.translations.title), 1), s("p", xa, w(e.translations.note), 1)]), s("div", Sa, [
3013
+ E(l) ? (y(), o("div", Ca, w(E(l)), 1)) : a("", !0),
3014
+ e.statusMessage && !E(l) ? (y(), o("div", wa, w(e.statusMessage), 1)) : a("", !0),
3015
+ e.serverErrors.length ? (y(), o("div", Ta, [s("ul", null, [(y(!0), o(t, null, S(e.serverErrors, (e, t) => (y(), o("li", { key: t }, w(e), 1))), 128))])])) : a("", !0),
3016
+ s("div", Ea, [
3017
+ s("label", Da, w(e.translations.email), 1),
3018
+ s("div", Oa, [f[2] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-envelope" })], -1), N(s("input", {
3019
+ id: "email",
3020
+ "onUpdate:modelValue": f[0] ||= (e) => E(n).email = e,
3021
+ type: "text",
3022
+ class: m(["form-control", { "is-invalid": E(r).email }]),
3023
+ name: "email",
3024
+ placeholder: e.translations.email
3025
+ }, null, 10, ka), [[k, E(n).email]])]),
3026
+ E(r).email ? (y(), o("div", Aa, w(E(r).email), 1)) : a("", !0)
3027
+ ]),
3028
+ s("div", ja, [s("button", {
3029
+ type: "submit",
3030
+ class: "btn btn-primary submit-btn",
3031
+ disabled: E(i)
3032
+ }, [E(i) ? (y(), o("i", Na)) : a("", !0), c(" " + w(e.translations.button), 1)], 8, Ma)]),
3033
+ e.loginUrl ? (y(), o("div", Pa, [s("a", {
3034
+ href: e.loginUrl,
3035
+ class: "auth-ghost-link"
3036
+ }, w(e.translations.backToLogin), 9, Fa)])) : a("", !0)
3037
+ ])], 40, va)])]));
3038
+ }
3039
+ }, La = { class: "card" }, Ra = { class: "card-body" }, za = ["action"], Ba = { class: "auth-header" }, Va = { class: "auth-title" }, Ha = { class: "auth-subtitle" }, Ua = { class: "auth-body" }, Wa = {
3040
+ key: 0,
3041
+ class: "alert alert-success"
3042
+ }, Ga = {
3043
+ key: 1,
3044
+ class: "alert alert-danger"
3045
+ }, Ka = { class: "mb-3" }, qa = { for: "email" }, Ja = { class: "input-group input-group--custom" }, Ya = ["placeholder"], Xa = {
3046
+ key: 0,
3047
+ class: "invalid-feedback d-block form-text"
3048
+ }, Za = { class: "mb-3" }, Qa = { for: "password" }, $a = { class: "input-group input-group--custom" }, eo = ["placeholder"], to = {
3049
+ key: 0,
3050
+ class: "invalid-feedback d-block form-text"
3051
+ }, no = { class: "mb-3" }, ro = { for: "password_confirmation" }, io = { class: "input-group input-group--custom" }, ao = ["placeholder"], oo = {
3052
+ key: 0,
3053
+ class: "invalid-feedback d-block form-text"
3054
+ }, so = { class: "mb-3" }, co = ["disabled"], lo = {
3055
+ key: 0,
3056
+ class: "fa fa-spinner fa-spin"
3057
+ }, uo = {
3058
+ key: 2,
3059
+ class: "text-center"
3060
+ }, fo = ["href"], po = {
3061
+ __name: "ResetPasswordForm",
3062
+ props: {
3063
+ action: {
3064
+ type: String,
3065
+ required: !0
3066
+ },
3067
+ loginUrl: {
3068
+ type: String,
3069
+ default: ""
3070
+ },
3071
+ translations: {
3072
+ type: Object,
3073
+ default: () => ({})
3074
+ },
3075
+ statusMessage: {
3076
+ type: String,
3077
+ default: ""
3078
+ },
3079
+ serverErrors: {
3080
+ type: Array,
3081
+ default: () => []
3082
+ },
3083
+ email: {
3084
+ type: String,
3085
+ default: ""
3086
+ },
3087
+ token: {
3088
+ type: String,
3089
+ required: !0
3090
+ },
3091
+ redirectUrl: {
3092
+ type: String,
3093
+ default: "/admin"
3094
+ }
3095
+ },
3096
+ setup(e) {
3097
+ let n = e, { form: r, errors: i, submitting: l, onSubmit: u } = Y(n, {
3098
+ formDefaults: {
3099
+ email: n.email,
3100
+ password: "",
3101
+ password_confirmation: "",
3102
+ token: n.token
3103
+ },
3104
+ validationSchema: {
3105
+ email: "required|email",
3106
+ password: "required|min:7",
3107
+ password_confirmation: "required|confirmed:@password"
3108
+ },
3109
+ onSuccess(e) {
3110
+ window.location.replace(e.redirect || n.redirectUrl);
3111
+ }
3112
+ });
3113
+ return (n, d) => (y(), o("div", La, [s("div", Ra, [s("form", {
3114
+ role: "form",
3115
+ method: "POST",
3116
+ action: e.action,
3117
+ novalidate: "",
3118
+ onSubmit: d[3] ||= F((...e) => E(u) && E(u)(...e), ["prevent"])
3119
+ }, [s("div", Ba, [s("h1", Va, w(e.translations.title), 1), s("p", Ha, w(e.translations.note), 1)]), s("div", Ua, [
3120
+ e.statusMessage ? (y(), o("div", Wa, w(e.statusMessage), 1)) : a("", !0),
3121
+ e.serverErrors.length ? (y(), o("div", Ga, [s("ul", null, [(y(!0), o(t, null, S(e.serverErrors, (e, t) => (y(), o("li", { key: t }, w(e), 1))), 128))])])) : a("", !0),
3122
+ s("div", Ka, [
3123
+ s("label", qa, w(e.translations.email), 1),
3124
+ s("div", Ja, [d[4] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-envelope" })], -1), N(s("input", {
3125
+ id: "email",
3126
+ "onUpdate:modelValue": d[0] ||= (e) => E(r).email = e,
3127
+ type: "text",
3128
+ class: m(["form-control", { "is-invalid": E(i).email }]),
3129
+ name: "email",
3130
+ placeholder: e.translations.email
3131
+ }, null, 10, Ya), [[k, E(r).email]])]),
3132
+ E(i).email ? (y(), o("div", Xa, w(E(i).email), 1)) : a("", !0)
3133
+ ]),
3134
+ s("div", Za, [
3135
+ s("label", Qa, w(e.translations.password), 1),
3136
+ s("div", $a, [d[5] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-lock" })], -1), N(s("input", {
3137
+ id: "password",
3138
+ "onUpdate:modelValue": d[1] ||= (e) => E(r).password = e,
3139
+ type: "password",
3140
+ class: m(["form-control", { "is-invalid": E(i).password }]),
3141
+ name: "password",
3142
+ placeholder: e.translations.password
3143
+ }, null, 10, eo), [[k, E(r).password]])]),
3144
+ E(i).password ? (y(), o("div", to, w(E(i).password), 1)) : a("", !0)
3145
+ ]),
3146
+ s("div", no, [
3147
+ s("label", ro, w(e.translations.passwordConfirm), 1),
3148
+ s("div", io, [d[6] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-lock" })], -1), N(s("input", {
3149
+ id: "password_confirmation",
3150
+ "onUpdate:modelValue": d[2] ||= (e) => E(r).password_confirmation = e,
3151
+ type: "password",
3152
+ class: m(["form-control", { "is-invalid": E(i).password_confirmation }]),
3153
+ name: "password_confirmation",
3154
+ placeholder: e.translations.passwordConfirm
3155
+ }, null, 10, ao), [[k, E(r).password_confirmation]])]),
3156
+ E(i).password_confirmation ? (y(), o("div", oo, w(E(i).password_confirmation), 1)) : a("", !0)
3157
+ ]),
3158
+ s("div", so, [s("button", {
3159
+ type: "submit",
3160
+ class: "btn btn-primary submit-btn",
3161
+ disabled: E(l)
3162
+ }, [E(l) ? (y(), o("i", lo)) : a("", !0), c(" " + w(e.translations.button), 1)], 8, co)]),
3163
+ e.loginUrl ? (y(), o("div", uo, [s("a", {
3164
+ href: e.loginUrl,
3165
+ class: "auth-ghost-link"
3166
+ }, w(e.translations.backToLogin), 9, fo)])) : a("", !0)
3167
+ ])], 40, za)])]));
3168
+ }
3169
+ }, mo = { class: "card" }, ho = { class: "card-body" }, go = ["action"], _o = { class: "auth-header" }, vo = { class: "auth-title" }, yo = { class: "auth-subtitle" }, bo = { class: "auth-body" }, xo = {
3170
+ key: 0,
3171
+ class: "alert alert-success"
3172
+ }, So = {
3173
+ key: 1,
3174
+ class: "alert alert-success"
3175
+ }, Co = {
3176
+ key: 2,
3177
+ class: "alert alert-danger"
3178
+ }, wo = { class: "mb-3" }, To = { for: "email" }, Eo = { class: "input-group input-group--custom" }, Do = ["placeholder"], Oo = {
3179
+ key: 0,
3180
+ class: "invalid-feedback d-block form-text"
3181
+ }, ko = { class: "mb-3" }, Ao = ["disabled"], jo = {
3182
+ key: 0,
3183
+ class: "fa fa-spinner fa-spin"
3184
+ }, Mo = {
3185
+ __name: "ActivationForm",
3186
+ props: {
3187
+ action: {
3188
+ type: String,
3189
+ required: !0
3190
+ },
3191
+ translations: {
3192
+ type: Object,
3193
+ default: () => ({})
3194
+ },
3195
+ statusMessage: {
3196
+ type: String,
3197
+ default: ""
3198
+ },
3199
+ serverErrors: {
3200
+ type: Array,
3201
+ default: () => []
3202
+ }
3203
+ },
3204
+ setup(e) {
3205
+ let { form: n, errors: r, submitting: i, successMessage: l, onSubmit: u } = Y(e, {
3206
+ formDefaults: { email: "" },
3207
+ validationSchema: { email: "required|email" }
3208
+ });
3209
+ return (d, f) => (y(), o("div", mo, [s("div", ho, [s("form", {
3210
+ role: "form",
3211
+ method: "POST",
3212
+ action: e.action,
3213
+ novalidate: "",
3214
+ onSubmit: f[1] ||= F((...e) => E(u) && E(u)(...e), ["prevent"])
3215
+ }, [s("div", _o, [s("h1", vo, w(e.translations.title), 1), s("p", yo, w(e.translations.note), 1)]), s("div", bo, [
3216
+ E(l) ? (y(), o("div", xo, w(E(l)), 1)) : a("", !0),
3217
+ e.statusMessage && !E(l) ? (y(), o("div", So, w(e.statusMessage), 1)) : a("", !0),
3218
+ e.serverErrors.length ? (y(), o("div", Co, [s("ul", null, [(y(!0), o(t, null, S(e.serverErrors, (e, t) => (y(), o("li", { key: t }, w(e), 1))), 128))])])) : a("", !0),
3219
+ s("div", wo, [
3220
+ s("label", To, w(e.translations.email), 1),
3221
+ s("div", Eo, [f[2] ||= s("span", { class: "input-group-text" }, [s("i", { class: "fa fa-envelope" })], -1), N(s("input", {
3222
+ id: "email",
3223
+ "onUpdate:modelValue": f[0] ||= (e) => E(n).email = e,
3224
+ type: "text",
3225
+ class: m(["form-control", { "is-invalid": E(r).email }]),
3226
+ name: "email",
3227
+ placeholder: e.translations.email
3228
+ }, null, 10, Do), [[k, E(n).email]])]),
3229
+ E(r).email ? (y(), o("div", Oo, w(E(r).email), 1)) : a("", !0)
3230
+ ]),
3231
+ s("div", ko, [s("button", {
3232
+ type: "submit",
3233
+ class: "btn btn-primary submit-btn",
3234
+ disabled: E(i)
3235
+ }, [E(i) ? (y(), o("i", jo)) : a("", !0), c(" " + w(e.translations.button), 1)], 8, Ao)])
3236
+ ])], 40, go)])]));
3237
+ }
3238
+ }, No = { class: "card" }, Po = { class: "card-body" }, Fo = { class: "auth-header" }, Io = { class: "auth-title" }, Lo = { class: "auth-body" }, Ro = {
3239
+ key: 0,
3240
+ class: "alert alert-danger"
3241
+ }, zo = {
3242
+ __name: "ActivationError",
3243
+ props: {
3244
+ translations: {
3245
+ type: Object,
3246
+ default: () => ({})
3247
+ },
3248
+ serverErrors: {
3249
+ type: Array,
3250
+ default: () => []
3251
+ }
3252
+ },
3253
+ setup(e) {
3254
+ return (n, r) => (y(), o("div", No, [s("div", Po, [s("div", Fo, [s("h1", Io, w(e.translations.title), 1)]), s("div", Lo, [e.serverErrors.length ? (y(), o("div", Ro, [s("ul", null, [(y(!0), o(t, null, S(e.serverErrors, (e, t) => (y(), o("li", { key: t }, w(e), 1))), 128))])])) : a("", !0)])])]));
3255
+ }
3256
+ }, Bo = { class: "modal-dialog" }, Vo = { class: "modal-content" }, Ho = { class: "modal-header" }, Uo = { class: "modal-title" }, Wo = { class: "modal-body" }, Go = {
3257
+ class: "text-center",
3258
+ style: { "word-wrap": "break-word" }
3259
+ }, Ko = { class: "form-label" }, qo = ["onUpdate:modelValue", "placeholder"], Jo = ["onUpdate:modelValue", "placeholder"], Yo = { class: "text-center" }, Xo = {
3260
+ class: "btn btn-primary w-100",
3261
+ type: "submit"
3262
+ }, Zo = {
3263
+ __name: "TranslationEditModal",
3264
+ props: {
3265
+ show: {
3266
+ type: Boolean,
3267
+ default: !1
3268
+ },
3269
+ item: {
3270
+ type: Object,
3271
+ default: null
3272
+ },
3273
+ locales: {
3274
+ type: [Object, Array],
3275
+ default: () => []
3276
+ },
3277
+ url: {
3278
+ type: String,
3279
+ required: !0
3280
+ },
3281
+ translations: {
3282
+ type: Object,
3283
+ default: () => ({})
3284
+ }
3285
+ },
3286
+ emits: ["close", "saved"],
3287
+ setup(e, { emit: n }) {
3288
+ let i = window.axios, l = e, u = n, d = r(() => Array.isArray(l.locales) ? l.locales : Object.values(l.locales)), f = b({});
3289
+ j(() => l.item, (e) => {
3290
+ Object.keys(f).forEach((e) => delete f[e]);
3291
+ for (let t of Object.keys(e?.text || {})) f[t] = e.text[t];
3292
+ }, { immediate: !0 });
3293
+ async function p() {
3294
+ try {
3295
+ await i.post(l.url + "/" + l.item.id, { text: { ...f } }), H("Item successfully changed."), u("saved"), u("close");
3296
+ } catch {
3297
+ U();
3298
+ }
3299
+ }
3300
+ return (n, r) => (y(), o(t, null, [s("div", {
3301
+ class: m(["modal fade", { show: e.show }]),
3302
+ style: g({ display: e.show ? "block" : "none" })
3303
+ }, [s("div", Bo, [s("div", Vo, [s("div", Ho, [s("h4", Uo, w(e.translations.edit), 1), s("button", {
3304
+ type: "button",
3305
+ class: "btn-close",
3306
+ onClick: r[0] ||= (e) => n.$emit("close")
3307
+ })]), s("div", Wo, [s("p", Go, [s("strong", null, w(e.translations.default_text) + ":", 1), c(" " + w(e.item?.key), 1)]), s("form", { onSubmit: F(p, ["prevent"]) }, [(y(!0), o(t, null, S(d.value, (t) => (y(), o("div", {
3308
+ key: t,
3309
+ class: "mb-3"
3310
+ }, [s("label", Ko, w(t.toUpperCase()) + " " + w(e.translations.translation), 1), !f[t] || f[t].length < 70 ? N((y(), o("input", {
3311
+ key: 0,
3312
+ "onUpdate:modelValue": (e) => f[t] = e,
3313
+ type: "text",
3314
+ class: "form-control",
3315
+ placeholder: (e.translations.translation_for || "").replace(":locale", t)
3316
+ }, null, 8, qo)), [[k, f[t]]]) : N((y(), o("textarea", {
3317
+ key: 1,
3318
+ "onUpdate:modelValue": (e) => f[t] = e,
3319
+ class: "form-control",
3320
+ placeholder: (e.translations.translation_for || "").replace(":locale", t),
3321
+ cols: "30",
3322
+ rows: "4"
3323
+ }, null, 8, Jo)), [[k, f[t]]])]))), 128)), s("div", Yo, [s("button", Xo, w(e.translations.save) + " " + w(e.translations.translation), 1)])], 32)])])])], 6), e.show ? (y(), o("div", {
3324
+ key: 0,
3325
+ class: "modal-backdrop fade show",
3326
+ onClick: r[1] ||= (e) => n.$emit("close")
3327
+ })) : a("", !0)], 64));
3328
+ }
3329
+ }, Qo = { class: "modal-dialog modal-lg" }, $o = { class: "modal-content" }, es = { class: "modal-header" }, ts = { class: "modal-title" }, ns = { class: "modal-body" }, rs = { class: "row mb-3" }, is = { class: "col-md-4 text-md-end" }, as = { class: "col-form-label" }, os = { class: "col-md-6" }, ss = { class: "btn btn-primary btn-sm w-100 mb-0" }, cs = { key: 0 }, ls = { key: 1 }, us = { class: "row mb-3" }, ds = { class: "col-md-4 text-md-end" }, fs = {
3330
+ for: "importLanguage",
3331
+ class: "col-form-label"
3332
+ }, ps = { class: "col-md-6" }, ms = { class: "offset-md-4" }, hs = { class: "form-check" }, gs = {
3333
+ class: "form-check-label",
3334
+ for: "onlyMissingTranslations"
3335
+ }, _s = { class: "text-center mb-3" }, vs = { class: "table table-hover" }, ys = { key: 0 }, bs = { style: { "word-break": "break-all" } }, xs = { style: { "word-break": "break-all" } }, Ss = { style: { "word-break": "break-all" } }, Cs = [
3336
+ "id",
3337
+ "onUpdate:modelValue",
3338
+ "name"
3339
+ ], ws = ["for"], Ts = { style: { "word-break": "break-all" } }, Es = [
3340
+ "id",
3341
+ "onUpdate:modelValue",
3342
+ "name"
3343
+ ], Ds = ["for"], Os = { class: "text-center" }, ks = { class: "modal-footer" }, As = {
3344
+ __name: "TranslationImportModal",
3345
+ props: {
3346
+ show: {
3347
+ type: Boolean,
3348
+ default: !1
3349
+ },
3350
+ locales: {
3351
+ type: [Object, Array],
3352
+ default: () => []
3353
+ },
3354
+ url: {
3355
+ type: String,
3356
+ required: !0
3357
+ },
3358
+ stepCount: {
3359
+ type: Number,
3360
+ default: 3
3361
+ },
3362
+ translations: {
3363
+ type: Object,
3364
+ default: () => ({})
3365
+ }
3366
+ },
3367
+ emits: ["close", "imported"],
3368
+ setup(e, { emit: n }) {
3369
+ let i = window.axios, c = e, u = n, d = r(() => Array.isArray(c.locales) ? c.locales : Object.values(c.locales)), f = r(() => d.value.map((e) => ({
3370
+ id: e,
3371
+ name: e.toUpperCase()
3372
+ }))), p = x(null), h = x(null), _ = x(null), v = r(() => _.value?.id ?? ""), b = x(!1), C = x(1), T = x(0), k = x(0), M = x(0), P = x(0), I = x(null), L = r(() => C.value === c.stepCount);
3373
+ j(() => c.show, (e) => {
3374
+ e || R();
3375
+ });
3376
+ function R() {
3377
+ C.value = 1, h.value = null, _.value = null, b.value = !1, I.value = null, p.value && (p.value.value = "");
3378
+ }
3379
+ function z(e) {
3380
+ h.value = e.target.files[0];
3381
+ }
3382
+ function B() {
3383
+ u("close");
3384
+ }
3385
+ async function ee() {
3386
+ if (C.value === 1) {
3387
+ if (!h.value || !v.value) {
3388
+ U("The form contains invalid fields.");
3389
+ return;
3390
+ }
3391
+ let e = new FormData();
3392
+ e.append("fileImport", h.value), e.append("importLanguage", v.value), e.append("onlyMissing", b.value);
3393
+ try {
3394
+ let t = await i.post(c.url + "/import", e, { headers: { "Content-Type": "multipart/form-data" } });
3395
+ "numberOfImportedTranslations" in t.data && "numberOfUpdatedTranslations" in t.data ? (C.value = 3, T.value = t.data.numberOfImportedTranslations, k.value = t.data.numberOfUpdatedTranslations, u("imported")) : (C.value = 2, I.value = t.data, M.value = Object.keys(t.data).length, P.value = I.value.filter((e) => e.has_conflict).length);
3396
+ } catch (e) {
3397
+ let t = e.response?.data;
3398
+ t === "Wrong syntax in your import" ? U("Wrong syntax in your import.") : t === "Unsupported file type" ? U("Unsupported file type.") : U();
3399
+ }
3400
+ } else if (C.value === 2) {
3401
+ for (let e = 0; e < I.value.length; e++) I.value[e].checkedCurrent && (I.value[e][v.value.toLowerCase()] = I.value[e].current_value);
3402
+ try {
3403
+ let e = await i.post(c.url + "/import/conflicts", {
3404
+ importLanguage: v.value,
3405
+ resolvedTranslations: I.value
3406
+ });
3407
+ C.value = 3, T.value = e.data.numberOfImportedTranslations, k.value = e.data.numberOfUpdatedTranslations, u("imported");
3408
+ } catch {
3409
+ U();
3410
+ }
3411
+ }
3412
+ }
3413
+ return (n, r) => (y(), o(t, null, [s("div", {
3414
+ class: m(["modal fade", { show: e.show }]),
3415
+ style: g({ display: e.show ? "block" : "none" })
3416
+ }, [s("div", Qo, [s("div", $o, [
3417
+ s("div", es, [s("h4", ts, w(e.translations.import_title), 1), s("button", {
3418
+ type: "button",
3419
+ class: "btn-close",
3420
+ onClick: B
3421
+ })]),
3422
+ s("div", ns, [
3423
+ N(s("div", null, [
3424
+ s("p", null, w(e.translations.import_notice), 1),
3425
+ s("div", rs, [s("div", is, [s("label", as, w(e.translations.upload_file), 1)]), s("div", os, [s("label", ss, [h.value ? (y(), o("span", cs, w(h.value.name), 1)) : (y(), o("span", ls, w(e.translations.choose_file), 1)), s("input", {
3426
+ ref_key: "fileInput",
3427
+ ref: p,
3428
+ type: "file",
3429
+ class: "d-none",
3430
+ accept: ".xlsx",
3431
+ onChange: z
3432
+ }, null, 544)])])]),
3433
+ s("div", us, [s("div", ds, [s("label", fs, w(e.translations.language_to_import), 1)]), s("div", ps, [l(E(V), {
3434
+ modelValue: _.value,
3435
+ "onUpdate:modelValue": r[0] ||= (e) => _.value = e,
3436
+ options: f.value,
3437
+ "track-by": "id",
3438
+ label: "name",
3439
+ placeholder: e.translations.select_language,
3440
+ "allow-empty": !1,
3441
+ "show-labels": !1,
3442
+ "open-direction": "bottom"
3443
+ }, null, 8, [
3444
+ "modelValue",
3445
+ "options",
3446
+ "placeholder"
3447
+ ])])]),
3448
+ s("div", ms, [s("div", hs, [N(s("input", {
3449
+ id: "onlyMissingTranslations",
3450
+ "onUpdate:modelValue": r[1] ||= (e) => b.value = e,
3451
+ class: "form-check-input",
3452
+ type: "checkbox"
3453
+ }, null, 512), [[D, b.value]]), s("label", gs, w(e.translations.do_not_override), 1)])])
3454
+ ], 512), [[A, C.value === 1]]),
3455
+ N(s("div", null, [s("div", _s, [s("p", null, w(e.translations.conflict_found) + " " + w(M.value) + " " + w(e.translations.conflict_to_import) + " " + w(P.value) + " " + w(e.translations.conflict_differ), 1)]), s("table", vs, [s("thead", null, [s("tr", null, [
3456
+ s("th", null, w(e.translations.group), 1),
3457
+ s("th", null, w(e.translations.default), 1),
3458
+ s("th", null, w(e.translations.current_value), 1),
3459
+ s("th", null, w(e.translations.imported_value), 1)
3460
+ ])]), s("tbody", null, [(y(!0), o(t, null, S(I.value, (e, n) => (y(), o(t, { key: n }, [e.has_conflict ? (y(), o("tr", ys, [
3461
+ s("td", bs, w(e.group), 1),
3462
+ s("td", xs, w(e.default), 1),
3463
+ s("td", Ss, [N(s("input", {
3464
+ id: "current-" + n + "0",
3465
+ "onUpdate:modelValue": (e) => I.value[n].checkedCurrent = e,
3466
+ type: "radio",
3467
+ class: "form-check-input me-1",
3468
+ value: !0,
3469
+ name: "current-" + n
3470
+ }, null, 8, Cs), [[O, I.value[n].checkedCurrent]]), s("label", {
3471
+ class: "form-check-label",
3472
+ for: "current-" + n + "0"
3473
+ }, w(e.current_value), 9, ws)]),
3474
+ s("td", Ts, [N(s("input", {
3475
+ id: "current-" + n + "1",
3476
+ "onUpdate:modelValue": (e) => I.value[n].checkedCurrent = e,
3477
+ type: "radio",
3478
+ class: "form-check-input me-1",
3479
+ value: !1,
3480
+ name: "current-" + n
3481
+ }, null, 8, Es), [[O, I.value[n].checkedCurrent]]), s("label", {
3482
+ class: "form-check-label",
3483
+ for: "current-" + n + "1"
3484
+ }, w(e[v.value.toLowerCase()]), 9, Ds)])
3485
+ ])) : a("", !0)], 64))), 128))])])], 512), [[A, C.value === 2]]),
3486
+ N(s("div", null, [s("div", Os, [s("p", null, w(T.value) + " " + w(e.translations.successfully_imported) + " " + w(k.value) + " " + w(e.translations.successfully_updated), 1)])], 512), [[A, C.value === 3]])
3487
+ ]),
3488
+ s("div", ks, [L.value ? a("", !0) : (y(), o("button", {
3489
+ key: 0,
3490
+ type: "button",
3491
+ class: "btn btn-primary",
3492
+ onClick: F(ee, ["prevent"])
3493
+ }, w(e.translations.next), 1))])
3494
+ ])])], 6), e.show ? (y(), o("div", {
3495
+ key: 0,
3496
+ class: "modal-backdrop fade show",
3497
+ onClick: B
3498
+ })) : a("", !0)], 64));
3499
+ }
3500
+ }, js = { class: "modal-dialog" }, Ms = { class: "modal-content" }, Ns = { class: "modal-header" }, Ps = { class: "modal-title" }, Fs = { class: "modal-body" }, Is = { class: "text-start" }, Ls = { class: "text-end" }, Rs = {
3501
+ class: "btn btn-primary",
3502
+ type: "submit"
3503
+ }, zs = {
3504
+ __name: "TranslationExportModal",
3505
+ props: {
3506
+ show: {
3507
+ type: Boolean,
3508
+ default: !1
3509
+ },
3510
+ locales: {
3511
+ type: [Object, Array],
3512
+ default: () => []
3513
+ },
3514
+ url: {
3515
+ type: String,
3516
+ required: !0
3517
+ },
3518
+ translations: {
3519
+ type: Object,
3520
+ default: () => ({})
3521
+ }
3522
+ },
3523
+ emits: ["close"],
3524
+ setup(e, { emit: n }) {
3525
+ let i = e, u = n, d = r(() => Array.isArray(i.locales) ? i.locales : Object.values(i.locales)), f = r(() => d.value.map((e) => ({
3526
+ id: e,
3527
+ name: e.toUpperCase()
3528
+ }))), p = x([]);
3529
+ j(f, (e) => {
3530
+ p.value = [...e];
3531
+ }, { immediate: !0 });
3532
+ function h() {
3533
+ if (p.value.length === 0) {
3534
+ U("Please select at least one language to export.");
3535
+ return;
3536
+ }
3537
+ let e = new URLSearchParams();
3538
+ p.value.forEach((t) => e.append("exportLanguages[]", t.id)), window.location = i.url + "/export?" + e.toString(), u("close");
3539
+ }
3540
+ return (n, r) => (y(), o(t, null, [s("div", {
3541
+ class: m(["modal fade", { show: e.show }]),
3542
+ style: g({ display: e.show ? "block" : "none" })
3543
+ }, [s("div", js, [s("div", Ms, [s("div", Ns, [s("h4", Ps, w(e.translations.export), 1), s("button", {
3544
+ type: "button",
3545
+ class: "btn-close",
3546
+ onClick: r[0] ||= (e) => n.$emit("close")
3547
+ })]), s("div", Fs, [s("form", { onSubmit: F(h, ["prevent"]) }, [
3548
+ s("p", Is, w(e.translations.export_notice), 1),
3549
+ l(Xr, {
3550
+ modelValue: p.value,
3551
+ "onUpdate:modelValue": r[1] ||= (e) => p.value = e,
3552
+ name: "languagesToExport",
3553
+ label: e.translations.language_to_export,
3554
+ options: f.value,
3555
+ "track-by": "id",
3556
+ "option-label": "name",
3557
+ placeholder: e.translations.select_language
3558
+ }, null, 8, [
3559
+ "modelValue",
3560
+ "label",
3561
+ "options",
3562
+ "placeholder"
3563
+ ]),
3564
+ s("div", Ls, [s("button", Rs, [r[3] ||= s("i", { class: "fa fa-file-excel" }, null, -1), c("\xA0" + w(e.translations.export_btn), 1)])])
3565
+ ], 32)])])])], 6), e.show ? (y(), o("div", {
3566
+ key: 0,
3567
+ class: "modal-backdrop fade show",
3568
+ onClick: r[2] ||= (e) => n.$emit("close")
3569
+ })) : a("", !0)], 64));
3570
+ }
3571
+ }, Bs = { class: "row" }, Vs = { class: "col" }, Hs = { class: "card" }, Us = { class: "card-header" }, Ws = { class: "row justify-content-md-between mb-3" }, Gs = { class: "col col-lg-7 col-xl-5 mb-3" }, Ks = { class: "col-sm-auto mb-3" }, qs = { class: "table-responsive" }, Js = { class: "table table-hover table-listing" }, Ys = { key: 0 }, Xs = ["title", "onClick"], Zs = {
3572
+ key: 0,
3573
+ class: "no-items-found"
3574
+ }, Qs = {
3575
+ __name: "TranslationListing",
3576
+ props: {
3577
+ url: {
3578
+ type: String,
3579
+ required: !0
3580
+ },
3581
+ data: {
3582
+ type: Object,
3583
+ default: null
3584
+ },
3585
+ timezone: {
3586
+ type: String,
3587
+ default: "UTC"
3588
+ },
3589
+ locales: {
3590
+ type: [Object, Array],
3591
+ default: () => []
3592
+ },
3593
+ userLocale: {
3594
+ type: String,
3595
+ default: "en"
3596
+ },
3597
+ groups: {
3598
+ type: Array,
3599
+ default: () => []
3600
+ },
3601
+ translations: {
3602
+ type: Object,
3603
+ default: () => ({})
3604
+ },
3605
+ stepCount: {
3606
+ type: Number,
3607
+ default: 3
3608
+ }
3609
+ },
3610
+ setup(e) {
3611
+ let n = window.axios, u = e, d = x(null), { isColumnVisible: p } = at(d), { pagination: h, orderBy: g, filters: _, search: v, collection: b, loadData: C, filter: T, onSort: D, onPageChange: O, onPerPageChange: k } = tt(u), A = r(() => Array.isArray(u.locales) ? u.locales : Object.values(u.locales)), j = x(!1), N = x(!1), P = x(!1), I = x(null);
3612
+ _.group = null;
3613
+ function L(e) {
3614
+ _.group = e ?? null, C(!0);
3615
+ }
3616
+ function R(e) {
3617
+ I.value = e, j.value = !0;
3618
+ }
3619
+ let z = x(!1);
3620
+ function B() {
3621
+ z.value = !0, n.post(u.url + "/rescan").then(() => {
3622
+ z.value = !1, C(!0);
3623
+ }, () => {
3624
+ z.value = !1, U();
3625
+ });
3626
+ }
3627
+ return (n, r) => (y(), o("div", Bs, [s("div", Vs, [
3628
+ l(Zo, {
3629
+ show: j.value,
3630
+ item: I.value,
3631
+ locales: A.value,
3632
+ url: e.url,
3633
+ translations: e.translations,
3634
+ onClose: r[0] ||= (e) => j.value = !1,
3635
+ onSaved: E(C)
3636
+ }, null, 8, [
3637
+ "show",
3638
+ "item",
3639
+ "locales",
3640
+ "url",
3641
+ "translations",
3642
+ "onSaved"
3643
+ ]),
3644
+ l(As, {
3645
+ show: N.value,
3646
+ locales: A.value,
3647
+ url: e.url,
3648
+ "step-count": e.stepCount,
3649
+ translations: e.translations,
3650
+ onClose: r[1] ||= (e) => N.value = !1,
3651
+ onImported: E(C)
3652
+ }, null, 8, [
3653
+ "show",
3654
+ "locales",
3655
+ "url",
3656
+ "step-count",
3657
+ "translations",
3658
+ "onImported"
3659
+ ]),
3660
+ l(zs, {
3661
+ show: P.value,
3662
+ locales: A.value,
3663
+ url: e.url,
3664
+ translations: e.translations,
3665
+ onClose: r[2] ||= (e) => P.value = !1
3666
+ }, null, 8, [
3667
+ "show",
3668
+ "locales",
3669
+ "url",
3670
+ "translations"
3671
+ ]),
3672
+ s("div", Hs, [s("div", Us, [
3673
+ r[9] ||= s("i", { class: "fa fa-align-justify" }, null, -1),
3674
+ c(" " + w(e.translations.listing_title) + " ", 1),
3675
+ s("a", {
3676
+ class: "btn btn-primary btn-sm float-end ms-2",
3677
+ href: "#",
3678
+ role: "button",
3679
+ onClick: r[3] ||= F((e) => N.value = !0, ["prevent"])
3680
+ }, [r[7] ||= s("i", { class: "fa fa-upload" }, null, -1), c("\xA0 " + w(e.translations.import_btn), 1)]),
3681
+ s("a", {
3682
+ class: "btn btn-primary btn-sm float-end ms-2",
3683
+ href: "#",
3684
+ role: "button",
3685
+ onClick: r[4] ||= F((e) => P.value = !0, ["prevent"])
3686
+ }, [r[8] ||= s("i", { class: "fa fa-file-excel" }, null, -1), c("\xA0 " + w(e.translations.export_btn), 1)]),
3687
+ s("a", {
3688
+ class: "btn btn-primary btn-sm float-end",
3689
+ href: "#",
3690
+ role: "button",
3691
+ onClick: F(B, ["prevent"])
3692
+ }, [s("i", { class: m(["fa", z.value ? "fa-spinner fa-spin" : "fa-eye"]) }, null, 2), c("\xA0 " + w(e.translations.rescan_btn), 1)])
3693
+ ]), s("div", {
3694
+ ref_key: "cardBody",
3695
+ ref: d,
3696
+ class: "card-body"
3697
+ }, [
3698
+ s("div", Ws, [s("div", Gs, [l(xn, {
3699
+ search: E(v),
3700
+ "onUpdate:search": r[5] ||= (e) => f(v) ? v.value = e : null,
3701
+ "filter-fn": E(T),
3702
+ translations: {
3703
+ search_placeholder: e.translations.search_placeholder,
3704
+ search_btn: e.translations.search_btn
3705
+ }
3706
+ }, {
3707
+ prepend: M(() => [l(E(V), {
3708
+ "model-value": E(_).group,
3709
+ options: e.groups,
3710
+ placeholder: e.translations.all_groups,
3711
+ "allow-empty": !0,
3712
+ "show-labels": !1,
3713
+ "open-direction": "bottom",
3714
+ class: "multiselect--input-group-prepend",
3715
+ "onUpdate:modelValue": L
3716
+ }, null, 8, [
3717
+ "model-value",
3718
+ "options",
3719
+ "placeholder"
3720
+ ])]),
3721
+ _: 1
3722
+ }, 8, [
3723
+ "search",
3724
+ "filter-fn",
3725
+ "translations"
3726
+ ])]), s("div", Ks, [l(Cn, {
3727
+ modelValue: E(h).state.per_page,
3728
+ "onUpdate:modelValue": r[6] ||= (e) => E(h).state.per_page = e
3729
+ }, null, 8, ["modelValue"])])]),
3730
+ s("div", qs, [s("table", Js, [s("thead", null, [s("tr", null, [
3731
+ l(Q, {
3732
+ column: "group",
3733
+ "order-by": E(g),
3734
+ onSort: E(D)
3735
+ }, {
3736
+ default: M(() => [c(w(e.translations.group), 1)]),
3737
+ _: 1
3738
+ }, 8, ["order-by", "onSort"]),
3739
+ l(Q, {
3740
+ column: "key",
3741
+ "order-by": E(g),
3742
+ onSort: E(D)
3743
+ }, {
3744
+ default: M(() => [c(w(e.translations.default), 1)]),
3745
+ _: 1
3746
+ }, 8, ["order-by", "onSort"]),
3747
+ l(Q, {
3748
+ column: "text",
3749
+ "order-by": E(g),
3750
+ onSort: E(D)
3751
+ }, {
3752
+ default: M(() => [c(w(e.userLocale.toUpperCase()), 1)]),
3753
+ _: 1
3754
+ }, 8, ["order-by", "onSort"]),
3755
+ E(p)(4) ? (y(), i(Q, {
3756
+ key: 0,
3757
+ column: "created_at",
3758
+ "order-by": E(g),
3759
+ onSort: E(D)
3760
+ }, {
3761
+ default: M(() => [c(w(e.translations.created_at_label), 1)]),
3762
+ _: 1
3763
+ }, 8, ["order-by", "onSort"])) : a("", !0),
3764
+ r[10] ||= s("th", null, null, -1)
3765
+ ])]), s("tbody", null, [(y(!0), o(t, null, S(E(b), (t) => (y(), o("tr", { key: t.id }, [
3766
+ s("td", null, w(t.group), 1),
3767
+ s("td", null, w(t.key), 1),
3768
+ s("td", null, w(t.text?.[e.userLocale]), 1),
3769
+ E(p)(4) ? (y(), o("td", Ys, w(E(W)(t.created_at)), 1)) : a("", !0),
3770
+ s("td", null, [s("a", {
3771
+ class: "btn btn-sm btn-info",
3772
+ href: "#",
3773
+ title: e.translations.edit_btn,
3774
+ role: "button",
3775
+ onClick: F((e) => R(t), ["prevent"])
3776
+ }, [...r[11] ||= [s("i", { class: "fa fa-edit" }, null, -1)]], 8, Xs)])
3777
+ ]))), 128))])])]),
3778
+ l(_n, {
3779
+ pagination: E(h).state,
3780
+ options: E(h).options,
3781
+ translations: {
3782
+ previous: e.translations.pagination_previous,
3783
+ next: e.translations.pagination_next,
3784
+ overview: e.translations.pagination_overview
3785
+ },
3786
+ onPageChange: E(O),
3787
+ onPerPageChange: E(k)
3788
+ }, null, 8, [
3789
+ "pagination",
3790
+ "options",
3791
+ "translations",
3792
+ "onPageChange",
3793
+ "onPerPageChange"
3794
+ ]),
3795
+ E(b)?.length ? a("", !0) : (y(), o("div", Zs, [
3796
+ r[12] ||= s("i", { class: "fa fa-magnifying-glass" }, null, -1),
3797
+ s("h3", null, w(e.translations.no_items), 1),
3798
+ s("p", null, w(e.translations.try_changing_items), 1),
3799
+ s("a", {
3800
+ class: "btn btn-primary",
3801
+ href: "#",
3802
+ role: "button",
3803
+ onClick: F(B, ["prevent"])
3804
+ }, [s("i", { class: m(["fa", z.value ? "fa-spinner fa-spin" : "fa-eye"]) }, null, 2), c("\xA0 " + w(e.translations.rescan_btn), 1)])
3805
+ ]))
3806
+ ], 512)])
3807
+ ])]));
3808
+ }
3809
+ }, $s = {
3810
+ url: "",
3811
+ collection: "",
3812
+ maxNumberOfFiles: 1,
3813
+ maxFileSizeInMb: 2,
3814
+ acceptedFileTypes: void 0,
3815
+ thumbnailWidth: 200,
3816
+ uploadedMedia: []
3817
+ }, ec = {
3818
+ type: Object,
3819
+ default: () => ({ ...$s })
3820
+ };
3821
+ //#endregion
3822
+ //#region src/ui/index.js
3823
+ function tc() {
3824
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", nc) : nc();
3825
+ }
3826
+ function nc() {
3827
+ let e = document.getElementById("sidebar"), t = null;
3828
+ document.querySelectorAll(".btn-spinner").forEach((e) => {
3829
+ e.addEventListener("click", (t) => {
3830
+ if (!(t.shiftKey || t.ctrlKey || t.metaKey)) {
3831
+ e.style.pointerEvents = "none";
3832
+ let t = e.querySelector("i");
3833
+ t && (t.className = "fa-solid fa-spinner fa-spin");
3834
+ }
3835
+ });
3836
+ }), document.querySelectorAll(".nav-title").forEach((e) => {
3837
+ let t = e.nextElementSibling;
3838
+ (!t || !t.classList.contains("nav-item")) && (e.style.display = "none");
3839
+ });
3840
+ function n() {
3841
+ e && (e.classList.add("hide"), t &&= (t.remove(), null));
3842
+ }
3843
+ document.querySelectorAll("[data-coreui-toggle=\"sidebar\"]").forEach((r) => {
3844
+ r.addEventListener("click", () => {
3845
+ e && (e.classList.contains("hide") ? (e.classList.remove("hide"), t = document.createElement("div"), t.className = "sidebar-backdrop fade show", t.addEventListener("click", n), document.body.appendChild(t)) : n());
3846
+ });
3847
+ }), document.querySelectorAll("[data-coreui-toggle=\"unfoldable\"]").forEach((t) => {
3848
+ t.addEventListener("click", () => {
3849
+ e && e.classList.toggle("sidebar-narrow-unfoldable");
3850
+ });
3851
+ }), document.querySelectorAll("[data-coreui-toggle=\"dropdown\"]").forEach((e) => {
3852
+ e.addEventListener("click", (t) => {
3853
+ t.preventDefault();
3854
+ let n = e.closest(".dropdown");
3855
+ if (!n) return;
3856
+ let r = n.querySelector(".dropdown-menu");
3857
+ if (!r) return;
3858
+ let i = r.classList.contains("show");
3859
+ document.querySelectorAll(".dropdown-menu.show").forEach((e) => e.classList.remove("show")), i || r.classList.add("show");
3860
+ });
3861
+ }), document.addEventListener("click", (e) => {
3862
+ e.target.closest(".dropdown") || document.querySelectorAll(".dropdown-menu.show").forEach((e) => e.classList.remove("show"));
3863
+ }), e && window.innerWidth < 992 && e.classList.add("hide");
3864
+ }
3865
+ //#endregion
3866
+ export { zo as ActivationError, Mo as ActivationForm, On as BulkCheckboxHeader, jn as BulkCheckboxRow, In as BulkOperationsBar, Rt as CkeditorEditor, Un as ConfirmModal, ur as DeleteButton, cr as EditButton, En as EmptyState, Ia as ForgotPasswordForm, Nr as FormCheckbox, Br as FormDatePicker, br as FormEmail, yr as FormInput, ni as FormLocalizedInput, si as FormLocalizedWysiwyg, _i as FormLocalizedWysiwygSimple, Xr as FormMultiSelect, Ni as FormPasswordConfirm, Si as FormSelect, Fi as FormSubmit, Er as FormTextarea, Gr as FormWysiwyg, fi as FormWysiwygSimple, or as ListingHeader, Wi as LocalizationBar, ha as LoginForm, Dt as MediaUpload, _n as Pagination, Cn as PerPage, rr as PublishedAtColumn, po as ResetPasswordForm, xn as Search, Q as Sortable, Z as TiptapEditor, pr as ToggleSwitch, Qs as TranslationListing, nn as UserDetailTooltip, z as dayjs, W as formatDate, G as formatDatetime, K as formatTime, J as getDateFnsLocale, Ze as initDateFnsLocale, tc as initUI, $s as mediaCollectionDefaults, ec as mediaCollectionProp, U as notifyError, H as notifySuccess, q as nowInTimezone, rt as useAdmin, Y as useBaseAuth, $e as useBaseForm, tt as useBaseListing, at as useResponsiveColumns };