@aeria-ui/ui 0.0.172 → 0.0.174

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.
@@ -0,0 +1,3477 @@
1
+ import { defineComponent as z, ref as J, resolveDirective as P, createElementBlock as l, openBlock as t, normalizeClass as Q, Fragment as Y, renderList as E, withDirectives as K, createCommentVNode as b, createTextVNode as D, toDisplayString as A, unref as e, renderSlot as I, withModifiers as Ie, inject as ue, computed as W, createElementVNode as S, mergeProps as M, createBlock as V, withCtx as h, resolveDynamicComponent as me, useCssVars as et, normalizeProps as le, guardReactiveProps as _e, Teleport as Ee, createVNode as L, onMounted as Ue, watch as ne, vModelDynamic as tt, onBeforeMount as Je, normalizeStyle as ve, provide as fe, createSlots as ie, vModelCheckbox as ot, onUnmounted as nt, resolveComponent as at, Suspense as lt, useSlots as st, h as it } from "vue";
2
+ import { t as j, useI18n as rt } from "@aeria-ui/i18n";
3
+ import { INSTANCE_VARS_SYMBOL as ut, useScrollObserver as He, useBreakpoints as Se, useMask as dt, PAGINATION_PER_PAGE_DEFAULTS as ct, API_URL as Ze, request as pt, useDebounce as Pe, convertToSearchQuery as mt, useParentCollectionStore as Ae, useCollectionStore as ft, useAction as vt, convertFromSearchQuery as yt, usePasswordPolicy as _t } from "@aeria-ui/core";
4
+ import { arraysIntersect as Fe, deepClone as ge, getReferenceProperty as re, convertConditionToQuery as ht, freshItem as bt, isRequired as Ge, evaluateCondition as Re, deepMerge as Be } from "@aeriajs/common";
5
+ import { useStore as te, getStoreId as we, useParentStore as qe, STORE_ID as Te, getGlobalStateManager as De } from "@aeria-ui/state-management";
6
+ import { useRouter as Ve } from "vue-router";
7
+ import { isDocumentComplete as $t, getObjectKey as gt } from "@aeria-ui/utils";
8
+ const kt = ["onClick"], Vt = { key: 0 }, Ct = {
9
+ key: 0,
10
+ class: "accordion__content"
11
+ }, Ot = /* @__PURE__ */ z({
12
+ __name: "aeria-accordion",
13
+ props: {
14
+ enumerate: { type: Boolean },
15
+ noPadding: { type: Boolean },
16
+ headers: {}
17
+ },
18
+ setup(p) {
19
+ const i = J(null), o = (n) => typeof n == "string" ? n : n.title;
20
+ return (n, a) => {
21
+ const d = P("clickable");
22
+ return t(), l("div", {
23
+ class: Q({
24
+ accordion: !0,
25
+ "accordion--padded": !n.noPadding
26
+ })
27
+ }, [
28
+ (t(!0), l(Y, null, E(Object.keys(n.$slots).filter((u) => u !== "default"), (u, m) => (t(), l("div", {
29
+ key: u,
30
+ class: "accordion__slot"
31
+ }, [
32
+ K((t(), l("div", {
33
+ class: "accordion__header",
34
+ onClick: (c) => i.value === u ? i.value = null : i.value = u
35
+ }, [
36
+ n.enumerate ? (t(), l("span", Vt, A(m + 1) + ". ", 1)) : b("", !0),
37
+ D(" " + A(n.headers[u] ? o(n.headers[u]) : e(j)(u)), 1)
38
+ ], 8, kt)), [
39
+ [d]
40
+ ]),
41
+ i.value === u ? (t(), l("div", Ct, [
42
+ I(n.$slots, u, {}, void 0, !0)
43
+ ])) : b("", !0)
44
+ ]))), 128))
45
+ ], 2);
46
+ };
47
+ }
48
+ }), U = (p, i) => {
49
+ const o = p.__vccOpts || p;
50
+ for (const [n, a] of i)
51
+ o[n] = a;
52
+ return o;
53
+ }, rl = /* @__PURE__ */ U(Ot, [["__scopeId", "data-v-3ea933d4"]]), At = /* @__PURE__ */ z({
54
+ __name: "aeria-badge",
55
+ props: {
56
+ large: { type: Boolean },
57
+ alt: { type: Boolean }
58
+ },
59
+ setup(p) {
60
+ return (i, o) => (t(), l("div", {
61
+ class: Q([
62
+ "badge",
63
+ { "badge--large": i.large },
64
+ { "badge--alt": i.alt }
65
+ ])
66
+ }, [
67
+ I(i.$slots, "default", {}, void 0, !0)
68
+ ], 2));
69
+ }
70
+ }), ye = /* @__PURE__ */ U(At, [["__scopeId", "data-v-4cbce7ef"]]), It = /* @__PURE__ */ z({
71
+ __name: "aeria-bare-button",
72
+ props: {
73
+ disabled: { type: Boolean }
74
+ },
75
+ emits: ["click"],
76
+ setup(p, { emit: i }) {
77
+ const o = p, n = i, a = (d) => {
78
+ o.disabled || n("click", d);
79
+ };
80
+ return (d, u) => (t(), l("button", {
81
+ class: Q([
82
+ "barebutton",
83
+ `barebutton--${d.disabled ? "disabled" : "enabled"}`
84
+ ]),
85
+ onClick: Ie(a, ["prevent"])
86
+ }, [
87
+ I(d.$slots, "default", {}, void 0, !0)
88
+ ], 2));
89
+ }
90
+ }), ce = /* @__PURE__ */ U(It, [["__scopeId", "data-v-1883f6a0"]]), Bt = ["href"], St = {
91
+ key: 0,
92
+ "data-component": "icon-label"
93
+ }, wt = /* @__PURE__ */ z({
94
+ __name: "aeria-icon",
95
+ props: {
96
+ icon: {},
97
+ fill: {},
98
+ medium: { type: Boolean },
99
+ reactive: { type: Boolean },
100
+ iconRight: { type: Boolean },
101
+ active: { type: Boolean }
102
+ },
103
+ setup(p) {
104
+ const i = p, o = ue(ut, {}), n = typeof i.reactive == "boolean" ? i.reactive : ue("iconReactive", !1), a = W(() => i.icon?.includes(":") ? i.icon : `regular:${i.icon}`);
105
+ return (d, u) => (t(), l("a", {
106
+ class: Q([
107
+ "icon",
108
+ { "icon--reactive": e(n) },
109
+ { "icon--active": d.active },
110
+ d.$slots.default ? "icon--centered" : "icon--standalone"
111
+ ])
112
+ }, [
113
+ S("div", {
114
+ class: Q([
115
+ "icon__icon",
116
+ { "icon__icon--right": d.iconRight }
117
+ ])
118
+ }, [
119
+ (t(), l("svg", M({
120
+ width: "24",
121
+ height: "24",
122
+ viewBox: "0 0 256 256",
123
+ "data-component": "icon"
124
+ }, {
125
+ ...d.fill ? { fill: d.fill } : {}
126
+ }), [
127
+ S("use", {
128
+ href: `${e(o).base || "/"}assets/icons.svg#${a.value}`
129
+ }, null, 8, Bt)
130
+ ], 16))
131
+ ], 2),
132
+ d.$slots.default ? (t(), l("div", St, [
133
+ I(d.$slots, "default", {}, void 0, !0)
134
+ ])) : b("", !0)
135
+ ], 2));
136
+ }
137
+ }), G = /* @__PURE__ */ U(wt, [["__scopeId", "data-v-263a2782"]]), Tt = { class: "button__content" }, jt = {
138
+ key: 1,
139
+ class: "button__content"
140
+ }, Rt = /* @__PURE__ */ z({
141
+ __name: "aeria-button",
142
+ props: {
143
+ size: {},
144
+ variant: {},
145
+ small: { type: Boolean },
146
+ large: { type: Boolean },
147
+ icon: {},
148
+ disabled: { type: Boolean },
149
+ loading: { type: Boolean }
150
+ },
151
+ setup(p) {
152
+ const i = p, o = ue("buttonVariant", i.variant) || "primary", n = (() => {
153
+ switch (!0) {
154
+ case i.small:
155
+ return "small";
156
+ case i.large:
157
+ return "large";
158
+ }
159
+ return ue("buttonSize", i.size) || "medium";
160
+ })();
161
+ return (a, d) => (t(), V(ce, {
162
+ class: Q([
163
+ "button",
164
+ `button--${e(o)}`,
165
+ `button--${e(n)}`,
166
+ { "button--loading": a.loading }
167
+ ]),
168
+ disabled: a.disabled || a.loading
169
+ }, {
170
+ default: h(() => [
171
+ a.icon ? (t(), V(G, {
172
+ key: 0,
173
+ icon: a.icon
174
+ }, {
175
+ default: h(() => [
176
+ S("div", Tt, [
177
+ I(a.$slots, "default", {}, void 0, !0)
178
+ ])
179
+ ]),
180
+ _: 3
181
+ }, 8, ["icon"])) : (t(), l("div", jt, [
182
+ I(a.$slots, "default", {}, void 0, !0)
183
+ ]))
184
+ ]),
185
+ _: 3
186
+ }, 8, ["class", "disabled"]));
187
+ }
188
+ }), se = /* @__PURE__ */ U(Rt, [["__scopeId", "data-v-e9f582db"]]), Lt = { class: "card__picture" }, qt = { class: "card__footer" }, Mt = { class: "card__footer-upper" }, zt = { class: "card__actions" }, Ft = { class: "card__badge" }, Et = /* @__PURE__ */ z({
189
+ __name: "aeria-card",
190
+ props: {
191
+ inactive: { type: Boolean },
192
+ horizontal: { type: Boolean }
193
+ },
194
+ setup(p) {
195
+ return (i, o) => (t(), l("div", {
196
+ class: Q([
197
+ "card",
198
+ { "card--inactive": i.inactive },
199
+ { "card--horizontal": i.horizontal }
200
+ ])
201
+ }, [
202
+ S("div", Lt, [
203
+ I(i.$slots, "default", {}, void 0, !0)
204
+ ]),
205
+ S("div", qt, [
206
+ S("div", Mt, [
207
+ S("div", null, [
208
+ I(i.$slots, "footer", {}, void 0, !0)
209
+ ]),
210
+ S("div", zt, [
211
+ i.$slots.actions ? I(i.$slots, "actions", { key: 0 }, void 0, !0) : b("", !0)
212
+ ])
213
+ ]),
214
+ S("div", Ft, [
215
+ I(i.$slots, "badge", {}, void 0, !0)
216
+ ])
217
+ ])
218
+ ], 2));
219
+ }
220
+ }), Ut = /* @__PURE__ */ U(Et, [["__scopeId", "data-v-e7d2c665"]]), Ht = { class: "panel__header-left" }, Dt = {
221
+ key: 1,
222
+ class: "panel__header-title"
223
+ }, Qt = {
224
+ key: 2,
225
+ style: { "margin-left": "auto" }
226
+ }, Gt = /* @__PURE__ */ z({
227
+ __name: "aeria-panel",
228
+ props: {
229
+ closeHint: { type: Boolean, default: !1 },
230
+ modelValue: { type: [Boolean, String, Object], default: !0 },
231
+ title: {},
232
+ float: { type: Boolean },
233
+ fixedRight: { type: Boolean },
234
+ loading: { type: Boolean },
235
+ bordered: { type: Boolean },
236
+ overlay: { type: Boolean },
237
+ invisibleOverlay: { type: Boolean },
238
+ collapsed: { type: Boolean },
239
+ collapsible: { type: Boolean, default: !1 },
240
+ fill: { type: Boolean },
241
+ fillFooter: { type: Boolean },
242
+ transparent: { type: Boolean },
243
+ transparentMobile: { type: Boolean },
244
+ outerHeader: { type: Boolean },
245
+ overlayLayer: {}
246
+ },
247
+ emits: ["update:modelValue", "update:collapsed", "update:closeHint", "overlayClick", "close"],
248
+ setup(p, { emit: i }) {
249
+ const o = p, n = i, a = J(o.collapsed), d = J(null), { reachedEnd: u } = He(d), m = () => {
250
+ n("update:modelValue", !1), n("close");
251
+ }, c = () => {
252
+ n("overlayClick");
253
+ }, v = (r) => {
254
+ n("update:collapsed", r), a.value = r;
255
+ };
256
+ return (r, $) => {
257
+ const k = P("clickable"), _ = P("loading"), T = P("overlay");
258
+ return r.modelValue ? K((t(), l("div", {
259
+ key: 0,
260
+ class: Q([
261
+ "panel",
262
+ { "panel--fixed": r.fixedRight }
263
+ ])
264
+ }, [
265
+ (t(), V(me(
266
+ r.float || r.fixedRight ? "dialog" : "div"
267
+ ), {
268
+ "data-component": "panel",
269
+ class: Q([
270
+ "aeria-surface",
271
+ "panel__content",
272
+ { "panel__content--float": r.float },
273
+ { "panel__content--bordered": r.bordered },
274
+ { "panel__content--fixed-right": r.fixedRight },
275
+ { "panel__content--transparent": r.transparent },
276
+ { "panel__content--transparent-mobile": r.transparentMobile },
277
+ { "panel__content--outer-header": r.outerHeader }
278
+ ]),
279
+ onClick: $[2] || ($[2] = (s) => s.stopPropagation())
280
+ }, {
281
+ default: h(() => [
282
+ r.$slots.header || r.title ? (t(), l("div", {
283
+ key: 0,
284
+ class: Q([
285
+ "panel__header",
286
+ { "panel__header--collapsed": a.value },
287
+ { "panel__header--outer": r.outerHeader }
288
+ ])
289
+ }, [
290
+ S("div", Ht, [
291
+ r.$slots.header ? I(r.$slots, "header", { key: 0 }, void 0, !0) : r.title ? (t(), l("div", Dt, A(r.title), 1)) : b("", !0),
292
+ r.$slots.extra ? (t(), l("div", Qt, [
293
+ I(r.$slots, "extra", {}, void 0, !0)
294
+ ])) : b("", !0)
295
+ ]),
296
+ r.collapsible && a.value ? K((t(), V(G, {
297
+ key: 0,
298
+ reactive: "",
299
+ icon: "plus",
300
+ onClick: $[0] || ($[0] = (s) => v(!a.value))
301
+ }, null, 512)), [
302
+ [k]
303
+ ]) : r.collapsible && !a.value ? K((t(), V(G, {
304
+ key: 1,
305
+ reactive: "",
306
+ icon: "minus",
307
+ onClick: $[1] || ($[1] = (s) => v(!a.value))
308
+ }, null, 512)), [
309
+ [k]
310
+ ]) : r.closeHint ? K((t(), V(G, {
311
+ key: 2,
312
+ reactive: "",
313
+ icon: "x",
314
+ onClick: m
315
+ }, null, 512)), [
316
+ [k]
317
+ ]) : b("", !0)
318
+ ], 2)) : b("", !0),
319
+ a.value ? b("", !0) : K((t(), l("div", {
320
+ key: 1,
321
+ ref_key: "body",
322
+ ref: d,
323
+ tabindex: "0",
324
+ class: Q([
325
+ "panel__body",
326
+ { "panel__body--padded": !r.fill }
327
+ ])
328
+ }, [
329
+ I(r.$slots, "default", {}, void 0, !0)
330
+ ], 2)), [
331
+ [_, r.loading]
332
+ ]),
333
+ r.$slots.footer ? (t(), l("div", {
334
+ key: 2,
335
+ class: Q([
336
+ "panel__footer",
337
+ { "panel__footer--padded": !r.fillFooter },
338
+ { "panel__footer--shadowed": !e(u) }
339
+ ])
340
+ }, [
341
+ I(r.$slots, "footer", {}, void 0, !0)
342
+ ], 2)) : b("", !0)
343
+ ]),
344
+ _: 3
345
+ }, 8, ["class"]))
346
+ ], 2)), [
347
+ [T, {
348
+ condition: r.overlay || r.fixedRight || r.float,
349
+ invisible: r.invisibleOverlay,
350
+ click: c,
351
+ layer: r.overlayLayer || (r.float ? 60 : r.fixedRight ? 50 : 0)
352
+ }]
353
+ ]) : b("", !0);
354
+ };
355
+ }
356
+ }), Ce = /* @__PURE__ */ U(Gt, [["__scopeId", "data-v-8463f8df"]]), Wt = { class: "content__body" }, Yt = {
357
+ key: 0,
358
+ class: "content__section"
359
+ }, Kt = { class: "content__item" }, Xt = /* @__PURE__ */ z({
360
+ __name: "aeria-context-menu",
361
+ props: {
362
+ actions: {},
363
+ subject: {},
364
+ overlayLayer: {}
365
+ },
366
+ emits: ["actionClick"],
367
+ setup(p, { emit: i }) {
368
+ et((c) => ({
369
+ "4078ef85": m.value.x,
370
+ "4078ef86": m.value.y
371
+ }));
372
+ const o = i, n = J(null), a = J(!1), d = (c) => c?.filter((v) => {
373
+ if (v.roles) {
374
+ const r = te("user");
375
+ return Fe(v.roles, r.currentUser.roles);
376
+ }
377
+ return !0;
378
+ }), u = (c, v) => {
379
+ const r = v && ge(v);
380
+ c.click && c.click(r), o("actionClick", {
381
+ action: c,
382
+ subject: r
383
+ }), a.value = !1;
384
+ }, m = W(() => {
385
+ if (!n.value)
386
+ return {
387
+ x: 0,
388
+ y: 0
389
+ };
390
+ const c = n.value.getBoundingClientRect().top, v = n.value.getBoundingClientRect().left, r = n.value.offsetHeight;
391
+ return {
392
+ _: a.value,
393
+ x: Math.floor(v) + "px",
394
+ y: Math.floor(c + r) + "px"
395
+ };
396
+ });
397
+ return (c, v) => {
398
+ const r = P("overlay");
399
+ return t(), l(Y, null, [
400
+ Object.keys(c.$slots).some(($) => $ !== "default") || c.actions !== void 0 && c.actions.length > 0 ? (t(), l("div", {
401
+ key: 0,
402
+ ref_key: "contextmenu",
403
+ ref: n,
404
+ class: "contextmenu"
405
+ }, [
406
+ S("a", {
407
+ class: "contextmenu__trigger",
408
+ onClick: v[0] || (v[0] = ($) => a.value = !0)
409
+ }, [
410
+ I(c.$slots, "default", le(_e({
411
+ visible: a.value
412
+ })), void 0, !0)
413
+ ])
414
+ ], 512)) : b("", !0),
415
+ a.value ? (t(), V(Ee, {
416
+ key: 1,
417
+ to: "main"
418
+ }, [
419
+ K((t(), V(Ce, {
420
+ modelValue: a.value,
421
+ "onUpdate:modelValue": v[4] || (v[4] = ($) => a.value = $),
422
+ fill: "",
423
+ bordered: "",
424
+ class: "content",
425
+ style: { "--panel-min-width": "0" }
426
+ }, {
427
+ default: h(() => [
428
+ S("div", Wt, [
429
+ c.$slots.header ? (t(), l("div", Yt, [
430
+ I(c.$slots, "header", {}, void 0, !0)
431
+ ])) : b("", !0),
432
+ Object.keys(c.$slots).filter(($) => !["default", "extra", "header"].includes($)).length > 0 ? (t(), l("div", {
433
+ key: 1,
434
+ class: "content__section",
435
+ onClick: v[1] || (v[1] = ($) => a.value = !1)
436
+ }, [
437
+ (t(!0), l(Y, null, E(Object.keys(c.$slots).filter(($) => !["default", "extra", "header"].includes($)), ($, k) => (t(), V(ce, {
438
+ key: `slot-${k}`,
439
+ class: "content__item content__item--reactive"
440
+ }, {
441
+ default: h(() => [
442
+ I(c.$slots, $, {}, void 0, !0)
443
+ ]),
444
+ _: 2
445
+ }, 1024))), 128))
446
+ ])) : b("", !0),
447
+ c.actions !== void 0 && c.actions.length > 0 ? (t(), l("div", {
448
+ key: 2,
449
+ class: "content__section",
450
+ onClick: v[2] || (v[2] = ($) => a.value = !1)
451
+ }, [
452
+ (t(!0), l(Y, null, E(d(c.actions), ($, k) => (t(), V(ce, {
453
+ key: `action-${k}`,
454
+ class: "content__item content__item--reactive",
455
+ onClick: (_) => u($, c.subject)
456
+ }, {
457
+ default: h(() => [
458
+ L(G, {
459
+ icon: $.icon || "gear"
460
+ }, {
461
+ default: h(() => [
462
+ D(A($.translate ? e(j)($.label, { capitalize: !0 }) : $.label), 1)
463
+ ]),
464
+ _: 2
465
+ }, 1032, ["icon"])
466
+ ]),
467
+ _: 2
468
+ }, 1032, ["onClick"]))), 128))
469
+ ])) : b("", !0),
470
+ c.$slots.extra ? (t(), l("div", {
471
+ key: 3,
472
+ class: "content__section",
473
+ onClick: v[3] || (v[3] = ($) => a.value = !1)
474
+ }, [
475
+ S("div", Kt, [
476
+ c.$slots.extra ? I(c.$slots, "extra", { key: 0 }, void 0, !0) : b("", !0)
477
+ ])
478
+ ])) : b("", !0)
479
+ ])
480
+ ]),
481
+ _: 3
482
+ }, 8, ["modelValue"])), [
483
+ [
484
+ r,
485
+ {
486
+ layer: c.overlayLayer,
487
+ click: () => {
488
+ a.value = !1;
489
+ }
490
+ },
491
+ void 0,
492
+ { invisibleOnLarge: !0 }
493
+ ]
494
+ ])
495
+ ])) : b("", !0)
496
+ ], 64);
497
+ };
498
+ }
499
+ }), ke = /* @__PURE__ */ U(Xt, [["__scopeId", "data-v-ee3ea72f"]]), Jt = { class: "info__content" }, Zt = /* @__PURE__ */ z({
500
+ __name: "aeria-info",
501
+ props: {
502
+ where: { default: "top" }
503
+ },
504
+ setup(p) {
505
+ const i = Se(), o = J(!1);
506
+ return (n, a) => e(i).md ? (t(), l("div", {
507
+ key: 0,
508
+ class: "info",
509
+ onMouseleave: a[1] || (a[1] = (d) => o.value = !1)
510
+ }, [
511
+ o.value ? (t(), l("div", {
512
+ key: 0,
513
+ class: Q([
514
+ "info__bubble",
515
+ `info__bubble--${n.where}`
516
+ ])
517
+ }, [
518
+ S("div", Jt, [
519
+ I(n.$slots, "text", {}, void 0, !0)
520
+ ])
521
+ ], 2)) : b("", !0),
522
+ S("div", {
523
+ onMouseover: a[0] || (a[0] = (d) => o.value = !0)
524
+ }, [
525
+ I(n.$slots, "default", {}, void 0, !0)
526
+ ], 32)
527
+ ], 32)) : I(n.$slots, "default", { key: 1 }, void 0, !0);
528
+ }
529
+ }), Pt = /* @__PURE__ */ U(Zt, [["__scopeId", "data-v-15a38847"]]), Nt = { class: "input" }, xt = {
530
+ key: 0,
531
+ class: "input__label"
532
+ }, eo = {
533
+ key: 1,
534
+ class: "input__hint"
535
+ }, to = ["placeholder", "readonly", "value"], oo = ["value"], no = {
536
+ key: 1,
537
+ class: "input__clipboard"
538
+ }, ao = /* @__PURE__ */ z({
539
+ __name: "aeria-input",
540
+ props: {
541
+ modelValue: {},
542
+ property: {},
543
+ propertyName: {},
544
+ parentPropertyName: {},
545
+ parentCollection: {},
546
+ readOnly: { type: Boolean },
547
+ required: { type: Boolean },
548
+ variant: {}
549
+ },
550
+ emits: ["update:modelValue", "input", "change", "clipboardCopy"],
551
+ setup(p, { emit: i }) {
552
+ const o = p, n = i, a = o.property || {}, d = "icon" in a || "inputType" in a && a.inputType === "search", u = ue("searchOnly", !1), m = ue("innerInputLabel", !1), c = !u && (o.readOnly || a.readOnly), v = (y) => (n("clipboardCopy", y), navigator.clipboard.writeText(y)), r = ue("inputVariant", o.variant) || "normal", $ = Object.assign(Object.assign({}, o), {
553
+ name: o.propertyName,
554
+ readonly: c,
555
+ type: (() => {
556
+ if ("type" in a)
557
+ switch (a.type) {
558
+ case "number":
559
+ case "integer":
560
+ return "number";
561
+ }
562
+ if (a.inputType)
563
+ return a.inputType;
564
+ switch (typeof o.modelValue) {
565
+ case "string":
566
+ return "text";
567
+ case "number":
568
+ return "number";
569
+ default:
570
+ return "text";
571
+ }
572
+ })(),
573
+ placeholder: m ? a.description || o.propertyName : a.placeholder
574
+ });
575
+ "type" in a && ((a.type === "number" || a.type === "integer") && (a.minimum && ($.min = a.minimum), a.exclusiveMinimum && ($.min = a.exclusiveMinimum + 1), a.maximum && ($.max = a.maximum), a.exclusiveMaximum && ($.max = a.exclusiveMaximum - 1)), a.type === "string" && ((a.format === "date" || a.format === "date-time") && ($.type = !u && a.format === "date-time" ? "datetime-local" : "date"), $.minlength = a.minLength, $.maxlength = a.maxLength)), $.type === "text" && u && ($.type = "search"), Ue(() => {
576
+ o.modelValue !== null && O(o.modelValue);
577
+ });
578
+ const k = (y) => {
579
+ let q;
580
+ if (typeof y == "string")
581
+ q = y;
582
+ else if (y instanceof Date)
583
+ q = y.toISOString();
584
+ else
585
+ return "";
586
+ switch ($.type) {
587
+ case "date":
588
+ return q.slice(0, 10);
589
+ case "datetime-local":
590
+ return q.slice(0, 19);
591
+ default:
592
+ throw new Error();
593
+ }
594
+ }, _ = J(""), T = o.property?.type === "string" && o.property.mask ? dt(o.property.mask) : null;
595
+ ne(() => o.modelValue, (y) => {
596
+ _.value = (() => {
597
+ if (T)
598
+ return y ? T.enmask(String(y), void 0, {
599
+ defaultValue: !0
600
+ }) : "";
601
+ switch ($.type) {
602
+ case "date":
603
+ case "datetime-local":
604
+ return k(y);
605
+ }
606
+ switch (y) {
607
+ case null:
608
+ case void 0:
609
+ return "";
610
+ default:
611
+ return y;
612
+ }
613
+ })();
614
+ }, {
615
+ immediate: !0
616
+ });
617
+ const s = (y) => typeof _.value == "string" && o.property?.type === "string" && T !== null ? (_.value = T.enmask(_.value, void 0, {
618
+ defaultValue: !0
619
+ }), o.property.maskedValue === !0 ? _.value : T.unmask(_.value)) : y, O = (y) => {
620
+ const q = (() => {
621
+ if (typeof y != "string")
622
+ return y;
623
+ switch ($.type) {
624
+ case "number":
625
+ case "integer":
626
+ return y === "" ? null : Number(y);
627
+ case "date":
628
+ case "date-time":
629
+ return y === "" ? null : typeof y == "string" ? new Date(y) : y;
630
+ default:
631
+ return s(y);
632
+ }
633
+ })();
634
+ n("input", q), n("update:modelValue", q);
635
+ }, X = (y) => {
636
+ const q = y.target.value;
637
+ _.value = q, O(q);
638
+ };
639
+ return (y, q) => {
640
+ const ee = P("focus"), N = P("clickable");
641
+ return t(), l("label", Nt, [
642
+ e(m) ? b("", !0) : (t(), l("div", xt, [
643
+ y.$slots.default ? I(y.$slots, "default", { key: 0 }, void 0, !0) : I(y.$slots, "description", { key: 1 }, void 0, !0)
644
+ ])),
645
+ y.$slots.hint ? (t(), l("div", eo, [
646
+ I(y.$slots, "hint", {}, void 0, !0)
647
+ ])) : b("", !0),
648
+ "element" in e(a) && e(a).element === "textarea" ? (t(), l("div", {
649
+ key: 2,
650
+ class: Q([
651
+ "input__container",
652
+ "input__container--textarea",
653
+ `input__container--${e(r)}`
654
+ ])
655
+ }, [
656
+ K(S("textarea", {
657
+ placeholder: e($).placeholder,
658
+ readonly: e($).readonly,
659
+ value: y.modelValue,
660
+ class: Q([
661
+ "input__textarea",
662
+ `input__input--${e(r)}`
663
+ ]),
664
+ onInput: X
665
+ }, null, 42, to), [
666
+ [ee, e(a).focus]
667
+ ])
668
+ ], 2)) : (t(), l("div", {
669
+ key: 3,
670
+ class: Q([
671
+ "input__container",
672
+ `input__container--${e(r)}`
673
+ ])
674
+ }, [
675
+ K(S("input", M(e($), {
676
+ value: _.value,
677
+ "data-component": "input",
678
+ class: [
679
+ "input__input",
680
+ `input__input--${e(r)}`,
681
+ { "input__input--icon": e(d) },
682
+ { "input__input--readOnly": e(c) }
683
+ ],
684
+ onInput: X,
685
+ onChange: q[0] || (q[0] = (oe) => n("change", oe))
686
+ }), null, 16, oo), [
687
+ [ee, e(a).focus]
688
+ ]),
689
+ e(d) ? (t(), V(G, {
690
+ key: 0,
691
+ icon: e(a).icon || "magnifying-glass",
692
+ class: Q([
693
+ "input__icon",
694
+ `input__icon--${e(r)}`
695
+ ])
696
+ }, null, 8, ["icon", "class"])) : b("", !0),
697
+ e(c) ? (t(), l("div", no, [
698
+ L(Pt, null, {
699
+ text: h(() => q[2] || (q[2] = [
700
+ D("Copiar")
701
+ ])),
702
+ default: h(() => [
703
+ K(L(G, {
704
+ reactive: "",
705
+ icon: "clipboard",
706
+ onClick: q[1] || (q[1] = Ie((oe) => v(String(y.modelValue || "")), ["prevent"]))
707
+ }, null, 512), [
708
+ [N]
709
+ ])
710
+ ]),
711
+ _: 1
712
+ })
713
+ ])) : b("", !0)
714
+ ], 2))
715
+ ]);
716
+ };
717
+ }
718
+ }), he = /* @__PURE__ */ U(ao, [["__scopeId", "data-v-36753c7c"]]), lo = {
719
+ key: 1,
720
+ value: ""
721
+ }, so = ["value", "data-selected"], io = /* @__PURE__ */ z({
722
+ __name: "aeria-select",
723
+ props: {
724
+ modelValue: {},
725
+ property: {},
726
+ propertyName: {},
727
+ parentPropertyName: {},
728
+ parentCollection: {},
729
+ readOnly: { type: Boolean },
730
+ required: { type: Boolean },
731
+ booleanRef: { type: Boolean },
732
+ multiple: { type: [Boolean, Number] },
733
+ noOutline: { type: Boolean }
734
+ },
735
+ emits: ["update:modelValue", "change"],
736
+ setup(p, { emit: i }) {
737
+ const o = p, n = i, a = J(null), d = o.property, u = (r) => {
738
+ n("update:modelValue", r), n("change", r);
739
+ }, m = (r) => {
740
+ r === "" || r === null ? u(null) : o.booleanRef ? u(r === "true") : u(r);
741
+ }, c = (r) => Array.isArray(o.modelValue) ? o.modelValue.includes(r) : o.modelValue === r, v = W(() => o.multiple ? typeof o.multiple == "number" ? o.multiple : 5 : 1);
742
+ return o.multiple && ne(() => o.modelValue, (r) => {
743
+ if (!a.value)
744
+ return;
745
+ const $ = a.value.querySelector('option[data-selected="true"]');
746
+ $ && $.removeAttribute("data-selected"), a.value.querySelector(`option[value="${r}"]`)?.setAttribute("data-selected", "true");
747
+ }), (r, $) => r.readOnly ? (t(), V(he, {
748
+ key: 1,
749
+ "read-only": "",
750
+ "model-value": r.modelValue
751
+ }, null, 8, ["model-value"])) : (t(), l("select", M({ key: 0 }, {
752
+ size: v.value,
753
+ value: r.modelValue
754
+ }, {
755
+ ref_key: "select",
756
+ ref: a,
757
+ class: {
758
+ select: !0,
759
+ "select--multiple": !!v.value,
760
+ "select--outline": !r.noOutline
761
+ },
762
+ onChange: $[0] || ($[0] = (k) => m(k.target.value))
763
+ }), [
764
+ e(d) && e(d).icon ? (t(), V(G, {
765
+ key: 0,
766
+ icon: e(d).icon
767
+ }, null, 8, ["icon"])) : b("", !0),
768
+ !o.multiple && !r.required ? (t(), l("option", lo, A(e(j)("none")), 1)) : b("", !0),
769
+ (t(!0), l(Y, null, E(e(d) && "enum" in e(d) ? e(d).enum : [], (k) => (t(), l("option", {
770
+ key: String(k),
771
+ value: k,
772
+ "data-selected": c(k)
773
+ }, A(e(d)?.translate ? e(j)(k) : k), 9, so))), 128)),
774
+ I(r.$slots, "default", {}, void 0, !0)
775
+ ], 16));
776
+ }
777
+ }), Qe = /* @__PURE__ */ U(io, [["__scopeId", "data-v-82e255a8"]]), ro = { class: "pagination" }, uo = { class: "pagination__arrows" }, co = ["value"], po = {
778
+ key: 0,
779
+ class: "pagination__summary"
780
+ }, mo = /* @__PURE__ */ z({
781
+ __name: "aeria-pagination",
782
+ props: {
783
+ pagination: {},
784
+ noSummary: { type: Boolean }
785
+ },
786
+ emits: ["paginate"],
787
+ setup(p, { emit: i }) {
788
+ const o = p, n = i, a = W({
789
+ get: () => Math.floor(o.pagination.offset / o.pagination.limit),
790
+ set: (c) => {
791
+ o.pagination.offset = c * o.pagination.limit;
792
+ }
793
+ }), d = W({
794
+ get: () => o.pagination.limit,
795
+ set: (c) => {
796
+ o.pagination.limit = Number(c);
797
+ }
798
+ }), u = J(a.value ? a.value + 1 : 1), m = W(() => Math.ceil(o.pagination.recordsTotal / o.pagination.limit));
799
+ return ne([
800
+ a,
801
+ d
802
+ ], ([c]) => {
803
+ u.value = c + 1, n("paginate", {
804
+ offset: a.value * d.value,
805
+ limit: d.value
806
+ });
807
+ }), (c, v) => (t(), l("div", ro, [
808
+ S("div", uo, [
809
+ L(ce, {
810
+ disabled: a.value === 0,
811
+ onClick: v[0] || (v[0] = (r) => a.value = 0)
812
+ }, {
813
+ default: h(() => [
814
+ L(G, { icon: "caret-double-left" })
815
+ ]),
816
+ _: 1
817
+ }, 8, ["disabled"]),
818
+ L(ce, {
819
+ disabled: a.value === 0,
820
+ onClick: v[1] || (v[1] = (r) => a.value -= 1)
821
+ }, {
822
+ default: h(() => [
823
+ L(G, { icon: "caret-left" })
824
+ ]),
825
+ _: 1
826
+ }, 8, ["disabled"]),
827
+ L(ce, {
828
+ disabled: a.value === m.value - 1,
829
+ onClick: v[2] || (v[2] = (r) => a.value += 1)
830
+ }, {
831
+ default: h(() => [
832
+ L(G, { icon: "caret-right" })
833
+ ]),
834
+ _: 1
835
+ }, 8, ["disabled"]),
836
+ L(ce, {
837
+ disabled: a.value === m.value - 1,
838
+ onClick: v[3] || (v[3] = (r) => a.value = m.value - 1)
839
+ }, {
840
+ default: h(() => [
841
+ L(G, { icon: "caret-double-right" })
842
+ ]),
843
+ _: 1
844
+ }, 8, ["disabled"]),
845
+ L(Qe, {
846
+ modelValue: d.value,
847
+ "onUpdate:modelValue": v[4] || (v[4] = (r) => d.value = r),
848
+ property: {
849
+ enum: [],
850
+ icon: "list"
851
+ },
852
+ class: "pagination__control"
853
+ }, {
854
+ default: h(() => [
855
+ (t(!0), l(Y, null, E(e(ct), (r) => (t(), l("option", {
856
+ key: `limit-${r}`,
857
+ value: r
858
+ }, A(r), 9, co))), 128))
859
+ ]),
860
+ _: 1
861
+ }, 8, ["modelValue"])
862
+ ]),
863
+ c.noSummary ? b("", !0) : (t(), l("div", po, [
864
+ D(A(e(j)("Page")) + " ", 1),
865
+ (t(), V(he, {
866
+ key: a.value,
867
+ modelValue: u.value,
868
+ "onUpdate:modelValue": v[5] || (v[5] = (r) => u.value = r),
869
+ property: {
870
+ type: "number",
871
+ minimum: 1
872
+ },
873
+ style: { height: "100%" },
874
+ onChange: v[6] || (v[6] = (r) => {
875
+ a.value = u.value === 0 ? 0 : u.value - 1;
876
+ })
877
+ }, null, 8, ["modelValue"])),
878
+ S("span", null, A(e(j)("of")) + " " + A(m.value), 1)
879
+ ]))
880
+ ]));
881
+ }
882
+ }), fo = /* @__PURE__ */ U(mo, [["__scopeId", "data-v-8cd299be"]]), vo = { class: "checkbox__text" }, yo = ["innerHTML"], _o = { class: "checkbox__hint" }, ho = ["innerHTML"], bo = {
883
+ inheritAttrs: !1
884
+ }, $o = /* @__PURE__ */ z({
885
+ ...bo,
886
+ __name: "aeria-checkbox",
887
+ props: {
888
+ modelValue: {},
889
+ property: {},
890
+ propertyName: {},
891
+ parentPropertyName: {},
892
+ parentCollection: {},
893
+ readOnly: { type: Boolean },
894
+ required: { type: Boolean },
895
+ value: {},
896
+ variant: {}
897
+ },
898
+ emits: ["update:modelValue", "change"],
899
+ setup(p, { emit: i }) {
900
+ const o = p, n = o.property, a = o.readOnly || n?.readOnly, d = (() => {
901
+ if (n && "type" in n)
902
+ switch (n.type) {
903
+ case "array":
904
+ case "boolean":
905
+ return "checkbox";
906
+ }
907
+ return "radio";
908
+ })(), u = i, m = o.value || !1, c = W({
909
+ get: () => {
910
+ if (n) {
911
+ if ("type" in n && n.type === "boolean")
912
+ return !!o.value;
913
+ if ("items" in n)
914
+ return o.modelValue?.includes(o.value);
915
+ }
916
+ return o.modelValue === o.value;
917
+ },
918
+ set: () => {
919
+ if (!a) {
920
+ if (n) {
921
+ if ("type" in n && n.type === "boolean") {
922
+ u("update:modelValue", !o.modelValue);
923
+ return;
924
+ }
925
+ if ("items" in n) {
926
+ if (o.modelValue?.includes(m)) {
927
+ u("update:modelValue", o.modelValue.filter((r) => r !== m));
928
+ return;
929
+ }
930
+ u("update:modelValue", [m].concat(o.modelValue || []));
931
+ return;
932
+ }
933
+ }
934
+ u("update:modelValue", o.value);
935
+ }
936
+ }
937
+ }), v = (r) => {
938
+ a && r.preventDefault();
939
+ };
940
+ return (r, $) => {
941
+ const k = P("clickable");
942
+ return K((t(), l("label", {
943
+ class: Q([
944
+ "checkbox",
945
+ { "checkbox--readOnly": e(a) }
946
+ ])
947
+ }, [
948
+ K(S("input", M({
949
+ "onUpdate:modelValue": $[0] || ($[0] = (_) => c.value = _)
950
+ }, {
951
+ type: e(d),
952
+ readOnly: e(a),
953
+ checked: c.value
954
+ }, {
955
+ class: "checkbox__input",
956
+ onClick: v
957
+ }), null, 16), [
958
+ [tt, c.value]
959
+ ]),
960
+ S("div", vo, [
961
+ S("div", null, [
962
+ r.$slots.description ? I(r.$slots, "description", { key: 0 }, void 0, !0) : e(m) ? (t(), l("div", {
963
+ key: 1,
964
+ innerHTML: e(n)?.translate ? e(j)(e(m)) : e(m)
965
+ }, null, 8, yo)) : I(r.$slots, "default", { key: 2 }, void 0, !0)
966
+ ]),
967
+ S("div", _o, [
968
+ r.$slots.hint ? I(r.$slots, "hint", { key: 0 }, void 0, !0) : e(n)?.hint ? (t(), l("div", {
969
+ key: 1,
970
+ innerHTML: e(n).hint
971
+ }, null, 8, ho)) : b("", !0)
972
+ ])
973
+ ])
974
+ ], 2)), [
975
+ [k]
976
+ ]);
977
+ };
978
+ }
979
+ }), go = /* @__PURE__ */ U($o, [["__scopeId", "data-v-7e6efc77"]]), ko = {
980
+ inheritAttrs: !1
981
+ }, Vo = /* @__PURE__ */ z({
982
+ ...ko,
983
+ __name: "aeria-options",
984
+ props: {
985
+ modelValue: {},
986
+ propertyName: {},
987
+ parentPropertyName: {},
988
+ parentCollection: {},
989
+ readOnly: { type: Boolean },
990
+ required: { type: Boolean },
991
+ property: {},
992
+ columns: { default: 1 }
993
+ },
994
+ emits: ["update:modelValue"],
995
+ setup(p, { emit: i }) {
996
+ const o = p, n = i, a = o.readOnly || o.property.readOnly, d = "items" in o.property ? o.property.items.enum : o.property.enum, u = (m) => {
997
+ n("update:modelValue", m);
998
+ };
999
+ return Je(() => {
1000
+ o.modelValue || n(
1001
+ "update:modelValue",
1002
+ "items" in o.property ? [] : ""
1003
+ );
1004
+ }), (m, c) => (t(), l("div", {
1005
+ class: "options",
1006
+ style: ve(`
1007
+ --columns: ${m.columns};
1008
+ grid-template-columns: repeat(var(--columns), 1fr);
1009
+ `)
1010
+ }, [
1011
+ (t(!0), l(Y, null, E(e(d), (v) => (t(), l("div", {
1012
+ key: `option-${v}`,
1013
+ class: "options__checkbox"
1014
+ }, [
1015
+ L(go, M({ ref_for: !0 }, {
1016
+ value: v,
1017
+ readOnly: e(a),
1018
+ property: m.property
1019
+ }, {
1020
+ "model-value": m.modelValue,
1021
+ "onUpdate:modelValue": u
1022
+ }), null, 16, ["model-value"])
1023
+ ]))), 128))
1024
+ ], 4));
1025
+ }
1026
+ }), Co = /* @__PURE__ */ U(Vo, [["__scopeId", "data-v-bcfc697e"]]), Oo = { class: "switch-wrapper" }, Ao = { key: 1 }, Io = {
1027
+ inheritAttrs: !1
1028
+ }, Bo = /* @__PURE__ */ z({
1029
+ ...Io,
1030
+ __name: "aeria-switch",
1031
+ props: {
1032
+ modelValue: {},
1033
+ property: {},
1034
+ propertyName: {},
1035
+ parentPropertyName: {},
1036
+ parentCollection: {},
1037
+ readOnly: { type: Boolean },
1038
+ required: { type: Boolean }
1039
+ },
1040
+ emits: ["update:modelValue", "change"],
1041
+ setup(p, { emit: i }) {
1042
+ const o = p, n = i, a = o.property, d = o.readOnly || a?.readOnly, u = () => {
1043
+ d || (n("change", !o.modelValue), n("update:modelValue", !o.modelValue));
1044
+ };
1045
+ return (m, c) => {
1046
+ const v = P("clickable");
1047
+ return t(), l("div", Oo, [
1048
+ K((t(), l("a", {
1049
+ class: Q([
1050
+ "switch",
1051
+ { "switch--active": m.modelValue },
1052
+ { "switch--readOnly": e(d) }
1053
+ ]),
1054
+ onClick: Ie(u, ["stop"])
1055
+ }, [
1056
+ c[0] || (c[0] = S("div", { class: "switch__slider" }, null, -1)),
1057
+ S("div", {
1058
+ class: Q([
1059
+ "switch__dummy",
1060
+ { "switch__dummy--flex": !m.modelValue }
1061
+ ])
1062
+ }, null, 2)
1063
+ ], 2)), [
1064
+ [v, {
1065
+ blocked: e(d)
1066
+ }]
1067
+ ]),
1068
+ m.$slots.default ? I(m.$slots, "default", { key: 0 }, void 0, !0) : (t(), l("div", Ao, A(e(a)?.description || m.propertyName), 1))
1069
+ ]);
1070
+ };
1071
+ }
1072
+ }), So = /* @__PURE__ */ U(Bo, [["__scopeId", "data-v-ae45597d"]]), wo = { class: "picture" }, To = { style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" } }, jo = ["src", "alt"], Ro = {
1073
+ key: 0,
1074
+ class: "picture__meta"
1075
+ }, Lo = ["src"], qo = { key: 5 }, Mo = /* @__PURE__ */ z({
1076
+ __name: "aeria-picture",
1077
+ props: {
1078
+ url: {},
1079
+ alt: {},
1080
+ fileId: {},
1081
+ modelValue: {},
1082
+ bordered: { type: Boolean },
1083
+ expandable: { type: Boolean },
1084
+ meta: {},
1085
+ objectFit: { default: "cover" },
1086
+ width: { default: "100%" },
1087
+ height: { default: "100%" }
1088
+ },
1089
+ setup(p) {
1090
+ const i = p, o = W(() => i.fileId ? `${Ze}/file/${i.fileId}/picture` : i.url || i.modelValue), n = J(!1);
1091
+ return (a, d) => {
1092
+ const u = P("overlay");
1093
+ return t(), l("figure", wo, [
1094
+ o.value && n.value ? (t(), V(Ee, {
1095
+ key: 0,
1096
+ to: "main"
1097
+ }, [
1098
+ K((t(), l("div", To, [
1099
+ S("img", {
1100
+ src: o.value,
1101
+ alt: a.alt,
1102
+ style: {
1103
+ maxHeight: "60vh",
1104
+ objectFit: "contain"
1105
+ },
1106
+ onClick: d[0] || (d[0] = (m) => n.value = !0)
1107
+ }, null, 8, jo),
1108
+ a.meta?.owner ? (t(), l("div", Ro, A(a.t("created_by")) + " " + A(a.meta.owner.name) + " em " + A(a.formatDateTime(a.meta.created_at, { hours: !0 })), 1)) : b("", !0)
1109
+ ])), [
1110
+ [u, {
1111
+ layer: 60,
1112
+ click: () => {
1113
+ n.value = !1;
1114
+ }
1115
+ }]
1116
+ ])
1117
+ ])) : b("", !0),
1118
+ o.value ? (t(), l("img", {
1119
+ key: 1,
1120
+ src: o.value,
1121
+ class: Q([
1122
+ "picture__image",
1123
+ { "picture__image--bordered": a.bordered },
1124
+ { "picture__image--expandable": a.expandable }
1125
+ ]),
1126
+ style: ve({
1127
+ objectFit: a.objectFit,
1128
+ width: a.width,
1129
+ height: a.height
1130
+ }),
1131
+ onClick: d[1] || (d[1] = () => {
1132
+ a.expandable && (n.value = !0);
1133
+ })
1134
+ }, null, 14, Lo)) : a.$slots.fallback ? I(a.$slots, "fallback", { key: 2 }, void 0, !0) : a.$slots.default ? I(a.$slots, "default", { key: 3 }, void 0, !0) : (t(), l("svg", {
1135
+ key: 4,
1136
+ class: Q(["picture__background", [
1137
+ { "picture__image--bordered": a.bordered }
1138
+ ]]),
1139
+ xmlns: "http://www.w3.org/2000/svg",
1140
+ viewBox: "0 0 200 200",
1141
+ preserveAspectRatio: "none",
1142
+ style: ve({
1143
+ objectFit: a.objectFit,
1144
+ width: a.width,
1145
+ height: a.height
1146
+ })
1147
+ }, d[2] || (d[2] = [
1148
+ S("line", {
1149
+ x1: "0",
1150
+ y1: "0",
1151
+ x2: "200",
1152
+ y2: "200",
1153
+ stroke: "#000",
1154
+ "vector-effect": "non-scaling-stroke"
1155
+ }, null, -1),
1156
+ S("line", {
1157
+ x1: "200",
1158
+ y1: "0",
1159
+ x2: "0",
1160
+ y2: "200",
1161
+ stroke: "#000",
1162
+ "vector-effect": "non-scaling-stroke"
1163
+ }, null, -1)
1164
+ ]), 6)),
1165
+ a.$slots.caption ? (t(), l("figcaption", qo, [
1166
+ I(a.$slots, "caption", {}, void 0, !0)
1167
+ ])) : b("", !0)
1168
+ ]);
1169
+ };
1170
+ }
1171
+ }), Le = /* @__PURE__ */ U(Mo, [["__scopeId", "data-v-6705b19f"]]), zo = { class: "item" }, Fo = { class: "item__presentation" }, Eo = {
1172
+ key: 1,
1173
+ class: "item__name"
1174
+ }, Uo = { class: "item__size" }, Ho = /* @__PURE__ */ z({
1175
+ __name: "aeria-file-item",
1176
+ props: {
1177
+ modelValue: {}
1178
+ },
1179
+ setup(p) {
1180
+ const i = p, o = "_id" in i.modelValue ? i.modelValue : i.modelValue.file, n = (a) => {
1181
+ const d = a === 0 ? 0 : Math.floor(Math.log(a) / Math.log(1024));
1182
+ return `${(a / Math.pow(1024, d)).toFixed(2)} ${[
1183
+ "B",
1184
+ "kB",
1185
+ "MB",
1186
+ "GB",
1187
+ "TB"
1188
+ ][d]}`;
1189
+ };
1190
+ return (a, d) => (t(), l("div", zo, [
1191
+ "_id" in e(o) && e(o).type.startsWith("image/") ? (t(), V(Le, {
1192
+ key: 0,
1193
+ bordered: "",
1194
+ expandable: "",
1195
+ alt: e(o).name,
1196
+ url: e(o).link,
1197
+ class: "item__picture"
1198
+ }, null, 8, ["alt", "url"])) : b("", !0),
1199
+ S("div", Fo, [
1200
+ "_id" in e(o) ? (t(), V(G, {
1201
+ key: 0,
1202
+ icon: "arrow-square-out",
1203
+ href: e(o).link,
1204
+ target: "_blank",
1205
+ class: "item__name item__name--link"
1206
+ }, {
1207
+ default: h(() => [
1208
+ D(A(e(o).name), 1)
1209
+ ]),
1210
+ _: 1
1211
+ }, 8, ["href"])) : (t(), l("div", Eo, A(e(o).name), 1)),
1212
+ S("div", Uo, A(n(e(o).size)), 1)
1213
+ ]),
1214
+ S("div", null, [
1215
+ I(a.$slots, "default", {}, void 0, !0)
1216
+ ])
1217
+ ]));
1218
+ }
1219
+ }), Do = /* @__PURE__ */ U(Ho, [["__scopeId", "data-v-85a82246"]]), Qo = { class: "file" }, Go = ["accept", "multiple"], Wo = {
1220
+ key: 1,
1221
+ class: "file__list"
1222
+ }, Yo = /* @__PURE__ */ z({
1223
+ __name: "aeria-file",
1224
+ props: {
1225
+ modelValue: {},
1226
+ property: {},
1227
+ propertyName: {},
1228
+ parentPropertyName: {},
1229
+ parentCollection: {},
1230
+ readOnly: { type: Boolean },
1231
+ required: { type: Boolean },
1232
+ meta: {},
1233
+ content: {},
1234
+ multiple: { type: Boolean }
1235
+ },
1236
+ emits: ["update:content", "change", "update:modelValue"],
1237
+ setup(p, { emit: i }) {
1238
+ const o = p, n = o.property && re(o.property), a = i, u = we() ? qe() : null, m = o.multiple || o.property && "type" in o.property && o.property.type === "array", c = W(() => {
1239
+ if (o.modelValue)
1240
+ return Array.isArray(o.modelValue) ? o.modelValue : [o.modelValue];
1241
+ }), v = (k) => new Promise((_) => {
1242
+ const T = new FileReader();
1243
+ T.onload = () => _(T.result), T.readAsArrayBuffer(k);
1244
+ }), r = async (k) => {
1245
+ const _ = k.target.files;
1246
+ if (!_)
1247
+ return;
1248
+ const T = [];
1249
+ for (const s of _) {
1250
+ const O = await v(s);
1251
+ if (u) {
1252
+ const { data: { error: X, result: y } } = await pt(`${Ze}/${u.$id}/upload?name=${s.name}`, O, {
1253
+ params: {
1254
+ method: "POST",
1255
+ headers: {
1256
+ "content-type": s.type || "application/octet-stream",
1257
+ "x-stream-request": "1"
1258
+ }
1259
+ }
1260
+ });
1261
+ if (X)
1262
+ return;
1263
+ T.unshift({
1264
+ tempId: y.tempId,
1265
+ file: s
1266
+ });
1267
+ } else
1268
+ T.unshift({
1269
+ file: s
1270
+ });
1271
+ }
1272
+ m ? a("update:modelValue", Array.isArray(o.modelValue) ? T.concat(o.modelValue) : T) : a("update:modelValue", T[0]), a("update:content", T), a("change", T);
1273
+ }, $ = async (k) => {
1274
+ if (!o.modelValue)
1275
+ throw new Error();
1276
+ const _ = Array.isArray(o.modelValue) ? o.modelValue.filter((T, s) => s !== k) : [];
1277
+ m ? a("update:modelValue", _) : a("update:modelValue", null), a("update:content", _), a("change", _);
1278
+ };
1279
+ return (k, _) => {
1280
+ const T = P("clickable");
1281
+ return t(), l("div", Qo, [
1282
+ k.readOnly ? b("", !0) : (t(), l("input", {
1283
+ key: 0,
1284
+ ref: "file",
1285
+ type: "file",
1286
+ accept: e(n)?.accept?.join(","),
1287
+ multiple: e(m),
1288
+ onChange: r
1289
+ }, null, 40, Go)),
1290
+ c.value && c.value.length > 0 ? (t(), l("div", Wo, [
1291
+ (t(!0), l(Y, null, E(c.value, (s, O) => (t(), V(Do, {
1292
+ key: "_id" in s ? String(s._id) : s.file.name,
1293
+ "model-value": s
1294
+ }, {
1295
+ default: h(() => [
1296
+ k.readOnly ? b("", !0) : K((t(), V(G, {
1297
+ key: 0,
1298
+ reactive: "",
1299
+ icon: "trash",
1300
+ onClick: (X) => $(O)
1301
+ }, null, 8, ["onClick"])), [
1302
+ [T]
1303
+ ])
1304
+ ]),
1305
+ _: 2
1306
+ }, 1032, ["model-value"]))), 128))
1307
+ ])) : b("", !0)
1308
+ ]);
1309
+ };
1310
+ }
1311
+ }), Ko = /* @__PURE__ */ U(Yo, [["__scopeId", "data-v-9950a715"]]), Xo = { class: "container" }, Jo = {
1312
+ key: 1,
1313
+ class: "container__footer"
1314
+ }, Zo = /* @__PURE__ */ z({
1315
+ __name: "aeria-search-container",
1316
+ props: {
1317
+ observeScroll: { type: Boolean }
1318
+ },
1319
+ emits: ["endReached"],
1320
+ setup(p, { emit: i }) {
1321
+ const o = p, n = i, a = J(null), d = o.observeScroll ? He(a, {
1322
+ antecipate: 100
1323
+ }).reachedEnd : null;
1324
+ return d !== null && ne(d, (u) => {
1325
+ u && n("endReached", u);
1326
+ }), (u, m) => (t(), l("div", Xo, [
1327
+ u.$slots.default ? (t(), l("div", {
1328
+ key: 0,
1329
+ ref_key: "containerEl",
1330
+ ref: a,
1331
+ class: "container__content"
1332
+ }, [
1333
+ I(u.$slots, "default", {}, void 0, !0)
1334
+ ], 512)) : b("", !0),
1335
+ u.$slots.footer ? (t(), l("div", Jo, [
1336
+ I(u.$slots, "footer", {}, void 0, !0)
1337
+ ])) : b("", !0)
1338
+ ]));
1339
+ }
1340
+ }), We = /* @__PURE__ */ U(Zo, [["__scopeId", "data-v-c86e2d2a"]]), Po = { class: "item__values" }, No = /* @__PURE__ */ z({
1341
+ __name: "aeria-search-item",
1342
+ props: {
1343
+ item: {},
1344
+ indexes: {},
1345
+ modelValue: {},
1346
+ property: {},
1347
+ readOnly: { type: Boolean }
1348
+ },
1349
+ emits: ["update:modelValue", "change"],
1350
+ setup(p, { emit: i }) {
1351
+ const o = Ve(), n = p, a = i, d = n.property, u = re(d);
1352
+ qe();
1353
+ const m = W(() => n.modelValue ? Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && Object.values(n.modelValue).some(({ _id: $ }) => n.item._id === $) : n.modelValue._id === n.item._id : !1), c = () => {
1354
+ if (m.value)
1355
+ return;
1356
+ const $ = (_) => _.filter((T) => !!T._id);
1357
+ let k;
1358
+ "items" in d ? n.modelValue ? k = $(Array.isArray(n.modelValue) ? n.modelValue : [n.modelValue]) : k = [] : k = n.modelValue, Array.isArray(k) ? a("update:modelValue", k.concat([n.item])) : a("update:modelValue", n.item), a("change", n.item);
1359
+ }, v = async ($) => {
1360
+ u.purge && $?.purge;
1361
+ const k = () => {
1362
+ const _ = Array.isArray(n.modelValue) ? Array.from(n.modelValue) : [], T = _.findIndex((s) => s._id === n.item._id);
1363
+ return _.splice(T, 1), _;
1364
+ };
1365
+ a("update:modelValue", "items" in d ? k() : null);
1366
+ }, r = () => {
1367
+ if (n.readOnly) {
1368
+ o.push({
1369
+ path: `/dashboard/c/${u.$ref}/${n.item._id}`
1370
+ });
1371
+ return;
1372
+ }
1373
+ return m.value ? v() : c();
1374
+ };
1375
+ return ($, k) => {
1376
+ const _ = P("clickable");
1377
+ return K((t(), l("div", {
1378
+ class: Q({
1379
+ item: !0,
1380
+ "item--selected": m.value
1381
+ }),
1382
+ onClick: r
1383
+ }, [
1384
+ I($.$slots, "default", {}, void 0, !0),
1385
+ S("div", Po, [
1386
+ (t(!0), l(Y, null, E($.indexes, (T, s) => (t(), l("div", {
1387
+ key: `index-${$.item._id}-${s}`,
1388
+ class: "item__value"
1389
+ }, A($.item[T]), 1))), 128))
1390
+ ]),
1391
+ $.readOnly ? (t(), V(G, {
1392
+ key: 0,
1393
+ icon: "arrow-square-out",
1394
+ style: { "--icon-color": "var(--theme-brand-color-contrast)" }
1395
+ })) : b("", !0)
1396
+ ], 2)), [
1397
+ [_]
1398
+ ]);
1399
+ };
1400
+ }
1401
+ }), ze = /* @__PURE__ */ U(No, [["__scopeId", "data-v-63761718"]]), xo = { class: "search__panel" }, en = { key: 1 }, tn = { key: 0 }, on = { key: 1 }, nn = { class: "search__summary" }, an = {
1402
+ key: 1,
1403
+ class: "search"
1404
+ }, ln = { key: 0 }, je = 10, sn = /* @__PURE__ */ z({
1405
+ __name: "aeria-search",
1406
+ props: {
1407
+ modelValue: {},
1408
+ parentPropertyName: {},
1409
+ parentCollection: {},
1410
+ readOnly: { type: Boolean },
1411
+ required: { type: Boolean },
1412
+ property: {},
1413
+ propertyName: {},
1414
+ selectOnly: { type: Boolean },
1415
+ panel: { default: void 0 }
1416
+ },
1417
+ emits: ["update:modelValue", "change", "update:panel"],
1418
+ setup(p, { emit: i }) {
1419
+ const o = p, n = te("meta"), a = re(o.property), d = o.panel !== void 0 ? W(() => o.panel) : J(!1), u = i, m = te(re(o.property).$ref), c = we(), v = c ? qe() : null, r = a.indexes;
1420
+ fe(Te, re(o.property).$ref), fe("innerInputLabel", !0), fe("omitInputLabels", !0);
1421
+ const $ = J(o.modelValue), k = J({
1422
+ data: [],
1423
+ pagination: {}
1424
+ }), _ = W(() => k.value.data), T = W(() => k.value.pagination), s = J(0), O = J(!1), X = J(""), y = () => {
1425
+ const C = {};
1426
+ if (c) {
1427
+ const Z = e(c);
1428
+ C[Z] = v;
1429
+ }
1430
+ return a.constraints ? ht(a.constraints, C) : {};
1431
+ }, q = () => {
1432
+ _.value.length < T.value.recordsTotal && (s.value += 1, N());
1433
+ }, ee = async () => X.value.length === 0 ? m.$actions.custom("getAll", {
1434
+ limit: je,
1435
+ offset: s.value * je,
1436
+ filters: y()
1437
+ }) : m.$actions.custom("getAll", {
1438
+ limit: je,
1439
+ offset: s.value * je,
1440
+ filters: {
1441
+ $text: {
1442
+ $search: `"${X.value}"`,
1443
+ $caseSensitive: !1
1444
+ },
1445
+ ...y()
1446
+ }
1447
+ }), N = async () => {
1448
+ if (m.loading.getAll)
1449
+ return;
1450
+ const { error: C, result: Z } = await ee();
1451
+ if (C) {
1452
+ n.$actions.spawnToast({
1453
+ text: "Request failed",
1454
+ icon: "warning"
1455
+ });
1456
+ return;
1457
+ }
1458
+ k.value.pagination = Z.pagination, s.value === 0 && k.value.data.splice(0), k.value.data.push(...Z.data);
1459
+ }, [oe] = Pe({
1460
+ delay: 800
1461
+ })(() => {
1462
+ s.value = 0, N(), O.value = !1;
1463
+ }), be = () => {
1464
+ O.value = !0, oe();
1465
+ }, Oe = () => {
1466
+ "effect" in d ? u("update:panel", !0) : d.value = !0, N();
1467
+ }, pe = () => {
1468
+ s.value = 0, k.value.data.splice(0), "effect" in d ? u("update:panel", !1) : d.value = !1;
1469
+ };
1470
+ ne(() => X.value.length, (C, Z) => {
1471
+ C && !Z && N();
1472
+ }), Ue(() => {
1473
+ o.selectOnly && N();
1474
+ });
1475
+ const ae = (C) => {
1476
+ $.value = C, o.selectOnly || u("update:modelValue", C);
1477
+ }, w = () => {
1478
+ pe(), u("update:modelValue", $.value);
1479
+ };
1480
+ return (C, Z) => {
1481
+ const f = P("clickable");
1482
+ return t(), l("div", null, [
1483
+ e(d) ? (t(), V(Ee, {
1484
+ key: 0,
1485
+ to: "main"
1486
+ }, [
1487
+ L(Ce, {
1488
+ float: "",
1489
+ "close-hint": "",
1490
+ title: `${e(j)("action.select", { capitalize: !0 })} ${e(j)(C.propertyName)}`,
1491
+ "overlay-layer": 65,
1492
+ "model-value": e(d),
1493
+ style: { "--panel-max-width": "36rem" },
1494
+ onClose: pe,
1495
+ onOverlayClick: pe
1496
+ }, {
1497
+ footer: h(() => [
1498
+ L(se, {
1499
+ large: "",
1500
+ onClick: w
1501
+ }, {
1502
+ default: h(() => [
1503
+ D(A(e(j)("action.save", { capitalize: !0 })), 1)
1504
+ ]),
1505
+ _: 1
1506
+ })
1507
+ ]),
1508
+ default: h(() => [
1509
+ S("div", xo, [
1510
+ L(he, M({
1511
+ modelValue: X.value,
1512
+ "onUpdate:modelValue": Z[0] || (Z[0] = (g) => X.value = g)
1513
+ }, {
1514
+ property: {
1515
+ type: "string",
1516
+ placeholder: "Pesquise aqui",
1517
+ inputType: "search"
1518
+ }
1519
+ }, { onInput: be }), null, 16, ["modelValue"]),
1520
+ _.value.length ? (t(), V(We, {
1521
+ key: 0,
1522
+ "observe-scroll": "",
1523
+ onEndReached: q
1524
+ }, {
1525
+ default: h(() => [
1526
+ (t(!0), l(Y, null, E(_.value, (g) => (t(), V(ze, M({ ref_for: !0 }, {
1527
+ item: g,
1528
+ indexes: e(r),
1529
+ property: C.property
1530
+ }, {
1531
+ key: `matching-${g._id}`,
1532
+ modelValue: $.value,
1533
+ "onUpdate:modelValue": Z[1] || (Z[1] = (F) => $.value = F)
1534
+ }), null, 16, ["modelValue"]))), 128))
1535
+ ]),
1536
+ _: 1
1537
+ })) : (t(), l("div", en, [
1538
+ O.value ? (t(), l("div", tn, A(e(j)("searching", { capitalize: !0 })) + "... ", 1)) : !e(m).loading.getAll && Object.values(X.value).filter((g) => !!g).length > 0 && !("items" in C.property && C.modelValue?.length || !Array.isArray(C.modelValue) && C.modelValue?._id) ? (t(), l("div", on, A(e(j)("no_results", { capitalize: !0 })), 1)) : b("", !0)
1539
+ ]))
1540
+ ]),
1541
+ S("div", nn, A(e(j)("showing", { capitalize: !0 })) + " " + A(_.value.length) + " " + A(e(j)("of")) + " " + A(T.value.recordsTotal), 1)
1542
+ ]),
1543
+ _: 1
1544
+ }, 8, ["title", "model-value"])
1545
+ ])) : b("", !0),
1546
+ C.selectOnly ? b("", !0) : (t(), l("div", an, [
1547
+ L(We, null, ie({
1548
+ default: h(() => [
1549
+ "items" in C.property ? (t(), l("div", ln, [
1550
+ (t(!0), l(Y, null, E(C.modelValue, (g) => (t(), V(ze, M({ ref_for: !0 }, {
1551
+ item: g,
1552
+ indexes: e(r),
1553
+ property: C.property,
1554
+ readOnly: C.readOnly,
1555
+ modelValue: C.modelValue
1556
+ }, {
1557
+ key: `selected-${g._id}`,
1558
+ "onUpdate:modelValue": ae
1559
+ }), null, 16))), 128))
1560
+ ])) : C.modelValue?._id ? (t(), V(ze, M({ key: 1 }, {
1561
+ item: C.modelValue,
1562
+ indexes: e(r),
1563
+ property: e(a),
1564
+ readOnly: C.readOnly,
1565
+ modelValue: C.modelValue
1566
+ }, { "onUpdate:modelValue": ae }), null, 16)) : b("", !0)
1567
+ ]),
1568
+ _: 2
1569
+ }, [
1570
+ C.readOnly ? void 0 : {
1571
+ name: "footer",
1572
+ fn: h(() => [
1573
+ K((t(), V(G, {
1574
+ icon: "plus",
1575
+ onClick: Oe
1576
+ }, {
1577
+ default: h(() => [
1578
+ D(A(e(j)("action.select", { capitalize: !0 })), 1)
1579
+ ]),
1580
+ _: 1
1581
+ })), [
1582
+ [f]
1583
+ ])
1584
+ ]),
1585
+ key: "0"
1586
+ }
1587
+ ]), 1024)
1588
+ ]))
1589
+ ]);
1590
+ };
1591
+ }
1592
+ }), rn = /* @__PURE__ */ U(sn, [["__scopeId", "data-v-7a35daa0"]]), Ye = (p, i) => {
1593
+ const o = "items" in p ? p.items : p, n = {
1594
+ options: Co,
1595
+ select: Qe,
1596
+ switch: So,
1597
+ file: Ko,
1598
+ search: rn,
1599
+ input: he,
1600
+ form: Me
1601
+ }, a = (() => {
1602
+ if ("type" in o) {
1603
+ if (o.type === "object")
1604
+ return "form";
1605
+ if (o.type === "boolean")
1606
+ return "switch";
1607
+ }
1608
+ if ("element" in p) {
1609
+ if (p.element === "checkbox" || p.element === "radio")
1610
+ return "options";
1611
+ if (p.element === "select")
1612
+ return "select";
1613
+ }
1614
+ const d = re(p);
1615
+ return d ? d.inline ? "form" : d.$ref === "file" ? "file" : "search" : "items" in p && p.uniqueItems ? "options" : "enum" in o ? "select" : "input";
1616
+ })();
1617
+ return i[a] ? i[a] : n[a];
1618
+ }, un = (p, i, o) => {
1619
+ p ??= [];
1620
+ const n = "items" in i ? i.items : i;
1621
+ if ("$ref" in n) {
1622
+ const a = te(n.$ref, o), d = ge(a.$freshItem);
1623
+ return p.push(d);
1624
+ }
1625
+ return "properties" in n ? p.push(bt(n)) : "type" in n && n.type === "boolean" ? p.push({}) : p.push(null);
1626
+ }, dn = (p, i) => {
1627
+ p.splice(i, 1);
1628
+ }, cn = {
1629
+ key: 0,
1630
+ class: "form__header"
1631
+ }, pn = { class: "form__fieldset" }, mn = { key: 0 }, fn = ["innerHTML"], vn = ["onInput"], yn = { key: 4 }, _n = { value: "true" }, hn = { value: "false" }, bn = {
1632
+ key: 5,
1633
+ style: { display: "grid", "row-gap": ".4rem" }
1634
+ }, $n = { key: 0 }, gn = {
1635
+ key: 1,
1636
+ class: "form__array"
1637
+ }, kn = {
1638
+ key: 7,
1639
+ class: "form__validation-error"
1640
+ }, Vn = { key: 0 }, Cn = { key: 1 }, On = {
1641
+ key: 2,
1642
+ class: "form__footer"
1643
+ }, An = /* @__PURE__ */ z({
1644
+ __name: "aeria-form",
1645
+ props: {
1646
+ modelValue: {},
1647
+ property: {},
1648
+ propertyName: {},
1649
+ parentPropertyName: {},
1650
+ parentCollection: {},
1651
+ readOnly: { type: Boolean },
1652
+ required: { type: [Boolean, Array] },
1653
+ form: {},
1654
+ collection: {},
1655
+ searchOnly: { type: Boolean },
1656
+ layout: {},
1657
+ formLayout: {},
1658
+ formComponents: {},
1659
+ propertyComponents: {},
1660
+ omitFormHeader: { type: Boolean },
1661
+ omitInputLabels: { type: Boolean },
1662
+ innerInputLabel: { type: Boolean },
1663
+ validationErrors: { default: null },
1664
+ highlightRequired: { type: Boolean, default: !0 },
1665
+ focus: { type: Boolean },
1666
+ includeId: { type: Boolean },
1667
+ includeTimestamps: { type: Boolean }
1668
+ },
1669
+ emits: ["update:modelValue", "input", "change", "clipboardCopy"],
1670
+ setup(p, { emit: i }) {
1671
+ const o = De(), n = p, a = i;
1672
+ Je(() => {
1673
+ n.modelValue || a("update:modelValue", n.property && "items" in n.property ? [] : {});
1674
+ });
1675
+ const d = n.property && re(n.property), u = d ? d.$ref : n.collection || we(), m = n.readOnly || n.property?.readOnly, c = u ? te(e(u)) : null;
1676
+ !u && process.env.NODE_ENV !== "production" && console.warn("aeria-form was used without providing storeId or specifying collection prop, some features may not work as intended");
1677
+ const v = J(!1), r = W(() => {
1678
+ const f = !n.form && n.property ? "type" in n.property && n.property.type === "object" ? "properties" in n.property ? n.property.properties : void 0 : c?.properties : n.form;
1679
+ if (!f)
1680
+ return;
1681
+ const g = {};
1682
+ if (n.includeId && (g._id = {
1683
+ type: "string",
1684
+ readOnly: !0
1685
+ }), n.includeTimestamps) {
1686
+ const F = {
1687
+ type: "string",
1688
+ format: "date-time",
1689
+ readOnly: !0,
1690
+ isTimestamp: !0
1691
+ };
1692
+ f.created_at || (g.created_at = F), f.created_at || (g.updated_at = F);
1693
+ }
1694
+ return Object.assign(g, f), g;
1695
+ }), $ = W(() => n.layout || c?.description.formLayout), k = (f) => {
1696
+ const g = ue(f, n[f]);
1697
+ return n[f] && fe(f, n[f]), g;
1698
+ }, _ = W(() => n.validationErrors !== null ? n.validationErrors : c?.validationErrors), T = k("formComponents") || {}, s = k("propertyComponents") || {}, O = k("omitFormHeader"), X = k("omitInputLabels"), y = k("innerInputLabel");
1699
+ u && fe(Te, u), fe("searchOnly", n.searchOnly);
1700
+ const q = (f) => r.value ? Object.entries(r.value).filter(([g, F]) => !F.noForm && f([
1701
+ g,
1702
+ F
1703
+ ])) : null, ee = (f, g) => {
1704
+ if (n.searchOnly || !u || n.includeId && f === "_id" || n.includeTimestamps && g.isTimestamp)
1705
+ return !0;
1706
+ const F = n.property && "properties" in n.property ? n.property.form : c?.description?.form;
1707
+ return !F || F.includes(f);
1708
+ }, N = q(([f, g]) => ee(f, g)), oe = Se(), be = {}, Oe = (f, g) => {
1709
+ const F = [], x = $.value?.fields?.[f] || $.value?.fields?.$default;
1710
+ if (!g)
1711
+ return;
1712
+ if (x?.if && !n.searchOnly) {
1713
+ const R = Re(
1714
+ n.modelValue,
1715
+ x.if
1716
+ );
1717
+ R.satisfied || (be[f] && (c ? n.modelValue[f] = typeof c.$freshItem[f] == "object" ? ge(c.$freshItem[f]) : c.$freshItem[f] : n.modelValue[f] = [
1718
+ void 0,
1719
+ null
1720
+ ].includes(n.modelValue[f]) ? null : n.modelValue[f].constructor()), F.push("display: none")), be[f] = R.satisfied;
1721
+ }
1722
+ const B = oe.value.md && x?.span || 6;
1723
+ return F.push(`--field-span: ${B}`, "grid-column: span var(--field-span) / span var(--field-span)"), x && (x.verticalSpacing && F.push([
1724
+ `--vertical-spacing: ${x.verticalSpacing}`,
1725
+ "padding: var(--vertical-spacing) 0"
1726
+ ]), x.separator && F.push([
1727
+ "border-top: 1px solid var(--theme-border-color)",
1728
+ "border-width: 1px 0 1px 0",
1729
+ "padding: 1rem 0",
1730
+ "margin: 1rem 0"
1731
+ ])), F.join(";");
1732
+ }, pe = (f) => f === null || f instanceof Object && !Object.keys(f).length, ae = W(() => n.required ? n.required : n.property && "required" in n.property ? n.property.required : c?.description.required), w = W(() => n.form ? $t(
1733
+ n.modelValue,
1734
+ n.form,
1735
+ ae.value,
1736
+ c?.description
1737
+ ) : !0), C = (f, g) => _.value?.[f] && (typeof _.value[f].index != "number" || _.value[f].index === g) ? _.value[f].errors : null, Z = (f) => {
1738
+ if (!(m || f.readOnly) && !n.parentPropertyName && !n.parentCollection && !v.value)
1739
+ return v.value = !0, !0;
1740
+ };
1741
+ return (f, g) => {
1742
+ const F = P("clickable"), x = P("focus");
1743
+ return t(), l("form", {
1744
+ class: "form",
1745
+ style: ve(`row-gap: ${e(O) ? ".8rem" : "var(--form-internal-gap, 1.6rem);"};`)
1746
+ }, [
1747
+ f.$slots.header && !e(O) ? (t(), l("header", cn, [
1748
+ I(f.$slots, "header", {}, void 0, !0)
1749
+ ])) : b("", !0),
1750
+ I(f.$slots, "default", {}, void 0, !0),
1751
+ S("fieldset", pn, [
1752
+ (t(!0), l(Y, null, E(e(N), ([B, R]) => (t(), l("div", {
1753
+ key: `field-${B}`,
1754
+ style: ve(Oe(B, R)),
1755
+ class: Q({
1756
+ form__field: !0,
1757
+ "form__field--form": "properties" in R
1758
+ })
1759
+ }, [
1760
+ (!("type" in R) || R.type !== "boolean" || f.searchOnly) && !R.noLabel && !e(X) && !e(y) ? (t(), l("label", mn, [
1761
+ S("div", {
1762
+ class: Q({
1763
+ "form__field-label": !0,
1764
+ "form__field-label--section": "items" in R ? "properties" in R.items : "properties" in R,
1765
+ "form__field-required-hint": f.highlightRequired && !e(m) && !f.searchOnly && (!ae.value || e(Ge)(B, ae.value, f.modelValue))
1766
+ })
1767
+ }, A(R.description || e(j)(B)), 3),
1768
+ R.hint ? (t(), l("div", {
1769
+ key: 0,
1770
+ innerHTML: R.hint
1771
+ }, null, 8, fn)) : b("", !0)
1772
+ ])) : b("", !0),
1773
+ f.$slots[`field-${B}`] ? I(f.$slots, `field-${B}`, M({
1774
+ key: 1,
1775
+ ref_for: !0
1776
+ }, {
1777
+ readOnly: e(m),
1778
+ property: R,
1779
+ propertyName: B,
1780
+ modelValue: f.modelValue
1781
+ }), void 0, !0) : f.layout?.fields?.[B]?.component && e(s)[f.layout.fields[B].component.name] ? (t(), V(me(e(s)[f.layout.fields[B].component.name]), M({
1782
+ key: 2,
1783
+ modelValue: f.modelValue[B],
1784
+ "onUpdate:modelValue": (H) => f.modelValue[B] = H
1785
+ }, { ref_for: !0 }, {
1786
+ readOnly: e(m),
1787
+ property: R,
1788
+ propertyName: B,
1789
+ required: !f.searchOnly && (!ae.value || e(Ge)(B, ae.value, f.modelValue)),
1790
+ ...f.layout.fields[B].component.props || {}
1791
+ }, {
1792
+ onInput: (H) => a("input", B),
1793
+ onChange: g[0] || (g[0] = (H) => a("change", H))
1794
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])) : "format" in R && ["date", "date-time"].includes(R.format) && f.searchOnly ? (t(), l("div", {
1795
+ key: 3,
1796
+ style: { display: "grid", "grid-template-columns": "repeat(2, 1fr)", "column-gap": "1rem" },
1797
+ onInput: (H) => a("input", B),
1798
+ onChange: g[1] || (g[1] = (H) => a("change", H))
1799
+ }, [
1800
+ L(he, M({
1801
+ modelValue: f.modelValue[B].$gte,
1802
+ "onUpdate:modelValue": (H) => f.modelValue[B].$gte = H
1803
+ }, { ref_for: !0 }, {
1804
+ property: R,
1805
+ propertyName: B
1806
+ }), null, 16, ["modelValue", "onUpdate:modelValue"]),
1807
+ L(he, M({
1808
+ modelValue: f.modelValue[B].$lte,
1809
+ "onUpdate:modelValue": (H) => f.modelValue[B].$lte = H
1810
+ }, { ref_for: !0 }, {
1811
+ property: R,
1812
+ propertyName: B
1813
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])
1814
+ ], 40, vn)) : "type" in R && R.type === "boolean" && f.searchOnly ? (t(), l("div", yn, [
1815
+ L(Qe, M({ ref_for: !0 }, {
1816
+ property: R,
1817
+ propertyName: B
1818
+ }, {
1819
+ "boolean-ref": "",
1820
+ "model-value": f.modelValue[B],
1821
+ onChange: g[2] || (g[2] = (H) => a("change", H)),
1822
+ "onUpdate:modelValue": (H) => {
1823
+ f.modelValue[B] = H;
1824
+ }
1825
+ }), {
1826
+ default: h(() => [
1827
+ S("option", _n, A(e(j)("yes")), 1),
1828
+ S("option", hn, A(e(j)("no")), 1)
1829
+ ]),
1830
+ _: 2
1831
+ }, 1040, ["model-value", "onUpdate:modelValue"])
1832
+ ])) : f.modelValue && "items" in R && !R.uniqueItems && (!("$ref" in R.items) || R.items.inline) ? (t(), l("div", bn, [
1833
+ e(m) ? b("", !0) : (t(), l("div", $n, [
1834
+ L(se, {
1835
+ small: "",
1836
+ variant: "alt",
1837
+ icon: "plus",
1838
+ disabled: !("inline" in R.items && R.items.inline) && (f.modelValue[B]?.length >= R.maxItems || pe(f.modelValue[B]?.[f.modelValue[B]?.length - 1])),
1839
+ onClick: Ie((H) => {
1840
+ f.modelValue[B] || (f.modelValue[B] = []), e(un)(f.modelValue[B], R, e(o));
1841
+ }, ["prevent"])
1842
+ }, {
1843
+ default: h(() => [
1844
+ D(A(e(j)("action.add", { capitalize: !0 })), 1)
1845
+ ]),
1846
+ _: 2
1847
+ }, 1032, ["disabled", "onClick"])
1848
+ ])),
1849
+ f.modelValue[B]?.length > 0 ? (t(), l("div", gn, [
1850
+ (t(!0), l(Y, null, E(f.modelValue[B], (H, de) => (t(), l("div", {
1851
+ key: `rep-${B}-${e(gt)(H, de)}`,
1852
+ class: "form__array-item"
1853
+ }, [
1854
+ e(m) ? b("", !0) : K((t(), V(G, {
1855
+ key: 0,
1856
+ icon: "trash",
1857
+ class: "form__array-remove",
1858
+ onClick: Ie(($e) => e(dn)(f.modelValue[B], de), ["prevent"])
1859
+ }, {
1860
+ default: h(() => [
1861
+ D(A(e(j)("action.remove", { capitalize: !0 })), 1)
1862
+ ]),
1863
+ _: 2
1864
+ }, 1032, ["onClick"])), [
1865
+ [F]
1866
+ ]),
1867
+ (t(), V(me(e(Ye)(R, e(T))), M({
1868
+ modelValue: f.modelValue[B][de],
1869
+ "onUpdate:modelValue": ($e) => f.modelValue[B][de] = $e
1870
+ }, { ref_for: !0 }, {
1871
+ readOnly: e(m),
1872
+ property: R.items,
1873
+ propertyName: B,
1874
+ parentCollection: e(u),
1875
+ parentPropertyName: f.parentPropertyName,
1876
+ columns: f.layout?.fields?.[B]?.optionsColumns || f.layout?.fields?.$default?.optionsColumns,
1877
+ validationErrors: C(B, de),
1878
+ ...R.componentProps || {}
1879
+ }, {
1880
+ onInput: ($e) => a("input", B),
1881
+ onChange: g[3] || (g[3] = ($e) => a("change", $e))
1882
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"]))
1883
+ ]))), 128))
1884
+ ])) : b("", !0)
1885
+ ])) : f.modelValue ? K((t(), V(me(e(Ye)(R, e(T))), M({
1886
+ key: 6,
1887
+ modelValue: f.modelValue[B],
1888
+ "onUpdate:modelValue": (H) => f.modelValue[B] = H
1889
+ }, { ref_for: !0 }, {
1890
+ readOnly: e(m),
1891
+ property: R,
1892
+ propertyName: B,
1893
+ parentPropertyName: f.parentPropertyName,
1894
+ parentCollection: e(u),
1895
+ columns: f.layout?.fields?.[B]?.optionsColumns || f.layout?.fields?.$default?.optionsColumns,
1896
+ ...R.componentProps || {},
1897
+ validationErrors: C(B)
1898
+ }, {
1899
+ onInput: (H) => a("input", B),
1900
+ onChange: g[4] || (g[4] = (H) => a("change", H)),
1901
+ onClipboardCopy: g[5] || (g[5] = (H) => a("clipboardCopy", H))
1902
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])), [
1903
+ [x, Z(R)]
1904
+ ]) : b("", !0),
1905
+ _.value?.[B] ? (t(), l("div", kn, [
1906
+ _.value[B].type ? (t(), l("span", Vn, A(e(j)(`validation_error.${_.value[B].type}`)), 1)) : b("", !0),
1907
+ _.value[B].detail ? (t(), l("span", Cn, A(e(j)(_.value[B].detail)), 1)) : b("", !0)
1908
+ ])) : b("", !0)
1909
+ ], 6))), 128))
1910
+ ]),
1911
+ f.$slots.after ? I(f.$slots, "after", { key: 1 }, void 0, !0) : b("", !0),
1912
+ f.$slots.footer ? (t(), l("div", On, [
1913
+ I(f.$slots, "footer", le(_e({
1914
+ isInsertReady: w.value
1915
+ })), void 0, !0)
1916
+ ])) : b("", !0)
1917
+ ], 4);
1918
+ };
1919
+ }
1920
+ }), Me = /* @__PURE__ */ U(An, [["__scopeId", "data-v-f9013657"]]), In = /* @__PURE__ */ z({
1921
+ __name: "aeria-filter-panel",
1922
+ emits: ["update:modelValue"],
1923
+ setup(p, { emit: i }) {
1924
+ const o = i, n = qe(), a = Ve(), d = e(ue(Te)), u = () => {
1925
+ if (n.pagination.offset = 0, n.$actions.filter(), o("update:modelValue", !1), "query" in a.currentRoute && a.currentRoute.query && typeof a.currentRoute.query == "object") {
1926
+ const v = a.currentRoute.query;
1927
+ for (const r of Object.keys(v))
1928
+ r.startsWith(`${d}.`) && delete v[r];
1929
+ }
1930
+ const { query: m, ...c } = a.currentRoute.value;
1931
+ a.push(Be(c, {
1932
+ query: mt(n)
1933
+ }));
1934
+ };
1935
+ return (m, c) => (t(), V(Ce, {
1936
+ "close-hint": "",
1937
+ "fixed-right": "",
1938
+ title: m.t("filter_by", { capitalize: !0 }),
1939
+ onClose: c[2] || (c[2] = (v) => o("update:modelValue", !1)),
1940
+ onOverlayClick: c[3] || (c[3] = (v) => o("update:modelValue", !1))
1941
+ }, {
1942
+ footer: h(() => [
1943
+ e(n).filtersCount > 0 ? (t(), V(se, {
1944
+ key: 0,
1945
+ variant: "transparent",
1946
+ onClick: c[1] || (c[1] = (v) => {
1947
+ e(n).$actions.clearFilters(), u(), o("update:modelValue", !1);
1948
+ })
1949
+ }, {
1950
+ default: h(() => [
1951
+ D(A(m.t("action.clear", { capitalize: !0 })) + " ", 1),
1952
+ L(ye, null, {
1953
+ default: h(() => [
1954
+ D(A(e(n).filtersCount), 1)
1955
+ ]),
1956
+ _: 1
1957
+ })
1958
+ ]),
1959
+ _: 1
1960
+ })) : b("", !0),
1961
+ L(se, {
1962
+ large: "",
1963
+ icon: "funnel",
1964
+ disabled: !e(n).hasActiveFilters,
1965
+ onClick: u
1966
+ }, {
1967
+ default: h(() => [
1968
+ D(A(m.t("action.filter", { capitalize: !0 })), 1)
1969
+ ]),
1970
+ _: 1
1971
+ }, 8, ["disabled"])
1972
+ ]),
1973
+ default: h(() => [
1974
+ L(Me, M({
1975
+ modelValue: e(n).filters,
1976
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => e(n).filters = v)
1977
+ }, {
1978
+ searchOnly: !0,
1979
+ form: e(n).availableFilters,
1980
+ layout: e(n).description.formLayout
1981
+ }, { focus: "" }), null, 16, ["modelValue"])
1982
+ ]),
1983
+ _: 1
1984
+ }, 8, ["title"]));
1985
+ }
1986
+ }), Bn = /* @__PURE__ */ z({
1987
+ __name: "aeria-insert-panel",
1988
+ props: {
1989
+ individualActions: {},
1990
+ collection: {},
1991
+ form: {},
1992
+ float: { type: Boolean },
1993
+ fixedRight: { type: Boolean },
1994
+ visible: { default: !0 },
1995
+ modelValue: {},
1996
+ readOnly: { type: Boolean },
1997
+ includeId: { type: Boolean },
1998
+ includeTimestamps: { type: Boolean }
1999
+ },
2000
+ emits: ["update:visible", "update:modelValue", "insert", "cancel"],
2001
+ setup(p, { emit: i }) {
2002
+ const o = p, n = i, a = te("meta"), d = o.collection, u = te(d);
2003
+ Ue(() => {
2004
+ o.modelValue && u.$actions.setItem(o.modelValue);
2005
+ });
2006
+ const m = W(() => o.form ? u.$actions.useProperties(o.form) : u.description.form ? u.$actions.useProperties(u.description.form) : u.properties), c = async () => {
2007
+ const { error: k, result: _ } = await u.$actions.deepInsert();
2008
+ if (k) {
2009
+ if ("code" in k)
2010
+ switch (k.code) {
2011
+ case "INVALID_PROPERTIES":
2012
+ case "MISSING_PROPERTIES":
2013
+ return;
2014
+ default: {
2015
+ let T = v("error", {
2016
+ capitalize: !0
2017
+ });
2018
+ k.message && (T += `: ${v(k.message)}`), T += ` (${v(k.code)})`, a.$actions.spawnToast({
2019
+ text: T,
2020
+ icon: "warning"
2021
+ });
2022
+ }
2023
+ }
2024
+ return;
2025
+ }
2026
+ n("update:visible", !1), n("update:modelValue", _), n("insert", _), u.$actions.clearItem();
2027
+ }, { t: v } = rt(), r = () => {
2028
+ a.$actions.ask({
2029
+ action: () => {
2030
+ u.$actions.clearItem(), u.validationErrors = {}, n("cancel");
2031
+ },
2032
+ body: v("prompt.close_panel")
2033
+ });
2034
+ }, $ = () => a.$actions.spawnToast({
2035
+ icon: "info",
2036
+ text: v("copied_to_clipboard")
2037
+ });
2038
+ return ne(() => u.item._id, (k) => {
2039
+ k === null && n("update:visible", !1);
2040
+ }), (k, _) => {
2041
+ const T = P("clickable");
2042
+ return t(), V(Ce, M({
2043
+ modelValue: k.visible,
2044
+ loading: e(u).loading.get,
2045
+ float: k.float,
2046
+ fixedRight: k.fixedRight
2047
+ }, { onOverlayClick: r }), ie({
2048
+ extra: h(() => [
2049
+ k.individualActions ? (t(), V(ke, M({ key: 0 }, {
2050
+ subject: e(u).item,
2051
+ actions: k.individualActions.filter(({ action: s }) => s !== "spawnEdit"),
2052
+ overlayLayer: 60
2053
+ }, {
2054
+ onActionClick: _[2] || (_[2] = (s) => n("update:visible", !1))
2055
+ }), {
2056
+ default: h(({
2057
+ visible: s
2058
+ }) => [
2059
+ e(u).item._id ? K((t(), V(G, {
2060
+ key: 0,
2061
+ reactive: "",
2062
+ active: s,
2063
+ icon: "dots-three"
2064
+ }, null, 8, ["active"])), [
2065
+ [T]
2066
+ ]) : b("", !0)
2067
+ ]),
2068
+ _: 1
2069
+ }, 16)) : b("", !0)
2070
+ ]),
2071
+ default: h(() => [
2072
+ L(Me, M({
2073
+ modelValue: e(u).item,
2074
+ "onUpdate:modelValue": _[0] || (_[0] = (s) => e(u).item = s)
2075
+ }, {
2076
+ collection: e(d),
2077
+ readOnly: k.readOnly,
2078
+ includeId: k.includeId,
2079
+ includeTimestamps: k.includeTimestamps,
2080
+ form: m.value,
2081
+ layout: e(u).description.formLayout || {}
2082
+ }, {
2083
+ focus: "",
2084
+ onClipboardCopy: $,
2085
+ onAdd: _[1] || (_[1] = (s) => s.preventDefault())
2086
+ }), ie({ _: 2 }, [
2087
+ E(Object.keys(k.$slots).filter((s) => s.startsWith("field-")), (s) => ({
2088
+ name: s,
2089
+ fn: h((O) => [
2090
+ I(k.$slots, s, le(_e(O)))
2091
+ ])
2092
+ }))
2093
+ ]), 1040, ["modelValue"])
2094
+ ]),
2095
+ _: 2
2096
+ }, [
2097
+ k.$slots.header ? {
2098
+ name: "header",
2099
+ fn: h(() => [
2100
+ I(k.$slots, "header")
2101
+ ]),
2102
+ key: "0"
2103
+ } : void 0,
2104
+ k.readOnly ? void 0 : {
2105
+ name: "footer",
2106
+ fn: h(() => [
2107
+ k.float || k.fixedRight ? (t(), V(se, {
2108
+ key: 0,
2109
+ variant: "transparent",
2110
+ onClick: r
2111
+ }, {
2112
+ default: h(() => [
2113
+ D(A(e(v)("action.cancel", { capitalize: !0 })), 1)
2114
+ ]),
2115
+ _: 1
2116
+ })) : b("", !0),
2117
+ L(se, {
2118
+ large: "",
2119
+ disabled: !e(u).isInsertReady || e(u).loading.get,
2120
+ loading: e(u).loading.insert,
2121
+ onClick: c
2122
+ }, {
2123
+ default: h(() => [
2124
+ D(A(e(v)("action.insert", { capitalize: !0 })), 1)
2125
+ ]),
2126
+ _: 1
2127
+ }, 8, ["disabled", "loading"])
2128
+ ]),
2129
+ key: "1"
2130
+ }
2131
+ ]), 1040);
2132
+ };
2133
+ }
2134
+ }), Ne = (p, i) => {
2135
+ if (i) {
2136
+ if (!p) {
2137
+ i.filtersPreset = {}, i.preferredTableProperties = [], i.pagination.offset = 0;
2138
+ return;
2139
+ }
2140
+ i.filtersPreset = p.filters || {}, i.preferredTableProperties = p.table ? Array.from(p.table) : [], i.pagination.offset = 0;
2141
+ }
2142
+ }, Sn = (p, i = {
2143
+ persistInQuery: !0
2144
+ }) => {
2145
+ const n = Ve().currentRoute;
2146
+ return ne(() => n.value.query.section, (a) => {
2147
+ if (p) {
2148
+ if (p.description.filtersPresets) {
2149
+ const d = a || Object.keys(p.description.filtersPresets)[0];
2150
+ Ne(p.description.filtersPresets[d], p);
2151
+ }
2152
+ if (i.persistInQuery) {
2153
+ const d = n.value.query;
2154
+ d.offset && (p.pagination.offset = +d.offset), d.limit && (p.pagination.limit = +d.limit), d.search && (p.textQuery = d.search, p.filters.$text = {
2155
+ $search: `"${d.search}"`,
2156
+ $caseSensitive: !1
2157
+ });
2158
+ }
2159
+ }
2160
+ }, {
2161
+ immediate: !0
2162
+ });
2163
+ }, wn = {
2164
+ key: 0,
2165
+ class: "table aeria-surface"
2166
+ }, Tn = { key: 0 }, jn = { key: 1 }, Rn = { key: 0 }, Ln = ["checked"], qn = {
2167
+ key: 1,
2168
+ style: { "text-align": "right" }
2169
+ }, Mn = { key: 2 }, zn = { key: 3 }, Fn = ["onClick"], En = { key: 0 }, Un = ["value"], Hn = { class: "table__cell-mobile-label" }, Dn = {
2170
+ key: 0,
2171
+ class: "table__cell-container"
2172
+ }, Qn = {
2173
+ key: 1,
2174
+ class: "table__cell-container"
2175
+ }, Gn = { class: "table__cell-grid" }, Wn = { key: 0 }, Yn = { key: 1 }, Kn = { key: 0 }, Xn = ["href"], Jn = { key: 3 }, Zn = { key: 1 }, Pn = { key: 2 }, Nn = { key: 0 }, xn = { key: 1 }, ea = { key: 2 }, ta = {
2176
+ key: 1,
2177
+ class: "no-print"
2178
+ }, oa = { class: "table__cell-actions" }, na = {
2179
+ key: 2,
2180
+ class: "no-print table__mobile-actions"
2181
+ }, aa = ["id"], la = { key: 1 }, sa = ["colspan"], ia = { class: "table__empty" }, ra = /* @__PURE__ */ z({
2182
+ __name: "aeria-table",
2183
+ props: {
2184
+ columns: {},
2185
+ rows: {},
2186
+ collection: {},
2187
+ checkbox: { type: Boolean },
2188
+ actions: {},
2189
+ layout: {}
2190
+ },
2191
+ emits: ["itemClick"],
2192
+ setup(p, { emit: i }) {
2193
+ const o = p, n = i, a = Se(), d = o.collection || we(), u = d ? te(typeof d == "string" ? d : d.value) : null, m = W({
2194
+ get: () => u?.selected,
2195
+ set: (_) => u?.$actions.selectManyItems(_, !0)
2196
+ }), c = W(() => o.columns ? Object.keys(o.columns).length + Number(o.checkbox) : 0), v = (_, T) => _.button ? typeof _.button == "object" ? Re(T, _.button).satisfied : _.button : !1, r = (_) => {
2197
+ const T = o.layout?.actions;
2198
+ return !a.value.xl || !T || !o.actions ? [] : o.actions.filter((s) => {
2199
+ if (s.roles) {
2200
+ const X = te("user");
2201
+ if (!Fe(s.roles, X.currentUser.roles))
2202
+ return !1;
2203
+ }
2204
+ const O = T[s.action];
2205
+ return O && v(O, _);
2206
+ });
2207
+ }, $ = (_) => {
2208
+ if (!o.actions)
2209
+ return [];
2210
+ const T = o.layout?.actions;
2211
+ return !a.value.xl || !T ? o.actions : o.actions.filter((s) => {
2212
+ const O = T[s.action];
2213
+ if (s.roles) {
2214
+ const X = te("user");
2215
+ if (!Fe(s.roles, X.currentUser.roles))
2216
+ return !1;
2217
+ }
2218
+ return O ? O.if ? Re(
2219
+ _,
2220
+ O.if
2221
+ ).satisfied : !v(O, _) : !0;
2222
+ });
2223
+ }, k = (_, T) => {
2224
+ const s = [], O = o.layout?.actions?.[T.action];
2225
+ return O?.if && (Re(
2226
+ _,
2227
+ O.if
2228
+ ).satisfied || s.push("display: none;")), s.join("");
2229
+ };
2230
+ return (_, T) => {
2231
+ const s = P("clickable");
2232
+ return c.value > 0 || _.$slots.thead ? (t(), l("table", wn, [
2233
+ _.$slots.thead ? (t(), l("thead", Tn, [
2234
+ I(_.$slots, "thead", {}, void 0, !0)
2235
+ ])) : (t(), l("thead", jn, [
2236
+ S("tr", null, [
2237
+ _.checkbox && e(u) && e(a).md ? (t(), l("th", Rn, [
2238
+ S("input", {
2239
+ type: "checkbox",
2240
+ checked: e(u).selected.length > 0 && e(u).selected.length === e(u).itemsCount,
2241
+ onChange: T[0] || (T[0] = (O) => e(u).$actions.selectAllItems(O.target.checked))
2242
+ }, null, 40, Ln)
2243
+ ])) : b("", !0),
2244
+ (t(!0), l(Y, null, E(Object.entries(_.columns), ([O, X], y) => (t(), l("th", {
2245
+ key: `header-${y}`,
2246
+ class: "table__header"
2247
+ }, A(X.description || e(j)(O)), 1))), 128)),
2248
+ _.actions?.length ? (t(), l("th", qn)) : b("", !0)
2249
+ ])
2250
+ ])),
2251
+ _.$slots.tbody ? (t(), l("tbody", Mn, [
2252
+ I(_.$slots, "tbody", {}, void 0, !0)
2253
+ ])) : (t(), l("tbody", zn, [
2254
+ (t(!0), l(Y, null, E(_.rows, (O, X) => (t(), l("tr", {
2255
+ key: O._id,
2256
+ onClick: (y) => n("itemClick", O)
2257
+ }, [
2258
+ e(u) && _.checkbox && e(a).md ? (t(), l("td", En, [
2259
+ K(S("input", {
2260
+ "onUpdate:modelValue": T[1] || (T[1] = (y) => m.value = y),
2261
+ type: "checkbox",
2262
+ value: O._id
2263
+ }, null, 8, Un), [
2264
+ [ot, m.value]
2265
+ ])
2266
+ ])) : b("", !0),
2267
+ (t(!0), l(Y, null, E(Object.entries(_.columns), ([y, q], ee) => (t(), l("td", {
2268
+ key: `column-${O._id}-${ee}`
2269
+ }, [
2270
+ S("div", Hn, A(q.description || e(j)(y)), 1),
2271
+ `row-${y}` in _.$slots ? (t(), l("div", Dn, [
2272
+ I(_.$slots, `row-${y}`, M({ ref_for: !0 }, {
2273
+ store: e(u),
2274
+ column: y,
2275
+ property: q,
2276
+ row: O,
2277
+ rowIndex: X
2278
+ }), void 0, !0)
2279
+ ])) : (t(), l("div", Qn, [
2280
+ S("div", Gn, [
2281
+ "type" in q && q.type === "boolean" ? (t(), l("div", Wn, [
2282
+ O[y] ? (t(), V(G, {
2283
+ key: 0,
2284
+ icon: "check",
2285
+ "icon-classes": "aeria-blueish"
2286
+ }, {
2287
+ default: h(() => [
2288
+ D(A(e(j)("yes")), 1)
2289
+ ]),
2290
+ _: 1
2291
+ })) : (t(), V(G, {
2292
+ key: 1,
2293
+ icon: "x",
2294
+ "icon-classes": "aeria-redish"
2295
+ }, {
2296
+ default: h(() => [
2297
+ D(A(e(j)("no")), 1)
2298
+ ]),
2299
+ _: 1
2300
+ }))
2301
+ ])) : e(re)(q)?.$ref === "file" ? (t(), l("div", Yn, [
2302
+ O[y] ? (t(), l("div", Kn, [
2303
+ "items" in q && O[y][0] && /^image/.test(O[y][0].type) ? (t(), V(Le, {
2304
+ key: 0,
2305
+ modelValue: O[y][0].link,
2306
+ "onUpdate:modelValue": (N) => O[y][0].link = N,
2307
+ expandable: "",
2308
+ meta: O[y][0],
2309
+ alt: "Row image",
2310
+ class: "table__picture"
2311
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : /^image/.test(O[y].type) ? (t(), V(Le, {
2312
+ key: 1,
2313
+ modelValue: O[y].link,
2314
+ "onUpdate:modelValue": (N) => O[y].link = N,
2315
+ expandable: "",
2316
+ meta: O[y],
2317
+ alt: "Row image",
2318
+ class: "table__picture"
2319
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : O[y].link ? (t(), l("a", {
2320
+ key: 2,
2321
+ href: O[y].link,
2322
+ style: { "font-size": "10pt" }
2323
+ }, A(O[y].filename), 9, Xn)) : (t(), l("div", Jn, " - "))
2324
+ ])) : (t(), l("div", Zn, " - "))
2325
+ ])) : (t(), l("div", Pn, [
2326
+ e(u) ? (t(), l("span", Nn, A(e(u).$actions.formatValue({
2327
+ value: O[y],
2328
+ key: y,
2329
+ property: q
2330
+ })), 1)) : (t(), l("span", xn, A(Array.isArray(O[y]) ? O[y].filter((N) => !!N).join(", ") : [void 0, null].includes(O[y]) ? "-" : O[y]), 1)),
2331
+ e(re)(q)?.indexes?.length > 1 ? (t(), l("div", ea, [
2332
+ (t(!0), l(Y, null, E(e(re)(q).indexes.slice(1, 2), (N, oe) => (t(), l("div", {
2333
+ key: `subvalue-${oe}`,
2334
+ class: "table__cell-subvalue"
2335
+ }, A(e(u).$actions.formatValue({
2336
+ value: O[y],
2337
+ key: y,
2338
+ property: q,
2339
+ index: N
2340
+ })), 1))), 128))
2341
+ ])) : b("", !0)
2342
+ ]))
2343
+ ])
2344
+ ]))
2345
+ ]))), 128)),
2346
+ _.actions?.length && e(a).md ? (t(), l("td", ta, [
2347
+ S("div", oa, [
2348
+ (t(!0), l(Y, null, E(r(O), (y) => (t(), V(se, {
2349
+ key: `action-${y.action}`,
2350
+ small: "",
2351
+ variant: "alt",
2352
+ icon: y.icon,
2353
+ style: ve(k(O, y)),
2354
+ onClick: (q) => y.click(O)
2355
+ }, {
2356
+ default: h(() => [
2357
+ D(A(e(j)(y.label)), 1)
2358
+ ]),
2359
+ _: 2
2360
+ }, 1032, ["icon", "style", "onClick"]))), 128)),
2361
+ $(O).length > 0 ? (t(), V(ke, M({
2362
+ key: 0,
2363
+ ref_for: !0
2364
+ }, {
2365
+ subject: O,
2366
+ actions: $(O)
2367
+ }), {
2368
+ default: h(({
2369
+ visible: y
2370
+ }) => [
2371
+ K(L(G, {
2372
+ reactive: "",
2373
+ active: y,
2374
+ icon: "dots-three"
2375
+ }, null, 8, ["active"]), [
2376
+ [s]
2377
+ ])
2378
+ ]),
2379
+ _: 2
2380
+ }, 1040)) : b("", !0)
2381
+ ])
2382
+ ])) : _.actions?.length ? (t(), l("td", na, [
2383
+ S("div", {
2384
+ class: "table__mobile-actions-grid",
2385
+ style: ve(`grid-template-columns: repeat(${r(O).length + ($(O).length ? 1 : 0)}, 1fr);`)
2386
+ }, [
2387
+ (t(!0), l(Y, null, E(r(O), (y) => (t(), V(ce, {
2388
+ key: `action-${y.action}`,
2389
+ class: "table__mobile-actions-button",
2390
+ onClick: (q) => y.click(O)
2391
+ }, {
2392
+ default: h(() => [
2393
+ L(G, {
2394
+ icon: y.icon || "gear"
2395
+ }, {
2396
+ default: h(() => [
2397
+ D(A(e(j)(y.label)), 1)
2398
+ ]),
2399
+ _: 2
2400
+ }, 1032, ["icon"])
2401
+ ]),
2402
+ _: 2
2403
+ }, 1032, ["onClick"]))), 128)),
2404
+ $(O).length > 0 ? (t(), V(ke, M({
2405
+ key: 0,
2406
+ ref_for: !0
2407
+ }, {
2408
+ subject: O,
2409
+ actions: $(O)
2410
+ }), {
2411
+ default: h(() => [
2412
+ L(G, {
2413
+ icon: "dots-three",
2414
+ class: "table__mobile-actions-button"
2415
+ })
2416
+ ]),
2417
+ _: 2
2418
+ }, 1040)) : b("", !0)
2419
+ ], 4),
2420
+ S("div", {
2421
+ id: `dropdown-${O._id}`
2422
+ }, null, 8, aa)
2423
+ ])) : b("", !0)
2424
+ ], 8, Fn))), 128))
2425
+ ])),
2426
+ S("tfoot", null, [
2427
+ _.$slots.tfoot ? I(_.$slots, "tfoot", { key: 0 }, void 0, !0) : _.columns && !_.rows?.length && !e(u)?.loading.getAll ? (t(), l("tr", la, [
2428
+ S("td", {
2429
+ colspan: c.value + 1
2430
+ }, [
2431
+ S("div", ia, A(e(j)("no_results", { capitalize: !0 })) + ". ", 1)
2432
+ ], 8, sa)
2433
+ ])) : b("", !0)
2434
+ ])
2435
+ ])) : b("", !0);
2436
+ };
2437
+ }
2438
+ }), ua = /* @__PURE__ */ U(ra, [["__scopeId", "data-v-e01a149a"]]), da = /* @__PURE__ */ z({
2439
+ __name: "aeria-tabular",
2440
+ props: {
2441
+ individualActions: {},
2442
+ layoutOptions: {},
2443
+ componentProps: {}
2444
+ },
2445
+ setup(p) {
2446
+ const i = p, o = Ae(), n = we(), a = W(() => {
2447
+ const d = {
2448
+ collection: n,
2449
+ checkbox: o.hasSelectionActions,
2450
+ columns: o.tableProperties,
2451
+ rows: o.items,
2452
+ actions: i.individualActions,
2453
+ layout: o.tableLayout
2454
+ };
2455
+ return Object.assign(d, i.componentProps);
2456
+ });
2457
+ return (d, u) => (t(), l("div", null, [
2458
+ d.$slots.inner ? I(d.$slots, "inner", { key: 0 }) : b("", !0),
2459
+ e(o).properties ? (t(), V(ua, M({ key: 1 }, a.value, {
2460
+ key: e(o).$id
2461
+ }), ie({ _: 2 }, [
2462
+ E(Object.keys(d.$slots).filter((m) => !["inner"].includes(m)), (m) => ({
2463
+ name: m,
2464
+ fn: h((c) => [
2465
+ I(d.$slots, m, le(_e(c)))
2466
+ ])
2467
+ }))
2468
+ ]), 1040)) : b("", !0)
2469
+ ]));
2470
+ }
2471
+ }), ca = /* @__PURE__ */ z({
2472
+ __name: "aeria-grid",
2473
+ props: {
2474
+ list: { type: Boolean }
2475
+ },
2476
+ setup(p) {
2477
+ return (i, o) => (t(), l("div", {
2478
+ class: Q([
2479
+ "grid",
2480
+ { "grid--list": i.list }
2481
+ ])
2482
+ }, [
2483
+ I(i.$slots, "default", {}, void 0, !0)
2484
+ ], 2));
2485
+ }
2486
+ }), pa = /* @__PURE__ */ U(ca, [["__scopeId", "data-v-4839c834"]]), ma = { key: 0 }, fa = {
2487
+ key: 1,
2488
+ class: "card__information"
2489
+ }, va = {
2490
+ key: 2,
2491
+ class: "card__information"
2492
+ }, ya = /* @__PURE__ */ z({
2493
+ __name: "aeria-grid",
2494
+ props: {
2495
+ individualActions: {},
2496
+ hasSelectionActions: { type: Boolean },
2497
+ layoutOptions: {},
2498
+ componentName: {}
2499
+ },
2500
+ setup(p) {
2501
+ const o = p.layoutOptions, n = Ae(), a = (d) => Array.isArray(d) ? d[0] : d;
2502
+ return (d, u) => {
2503
+ const m = P("clickable");
2504
+ return t(), V(pa, {
2505
+ list: d.componentName === "list"
2506
+ }, {
2507
+ default: h(() => [
2508
+ (t(!0), l(Y, null, E(e(n).items, (c) => (t(), V(Ut, {
2509
+ key: c._id,
2510
+ inactive: !!(e(o).active && !c[e(o).active]),
2511
+ horizontal: d.componentName === "list"
2512
+ }, ie({
2513
+ footer: h(() => [
2514
+ e(o).title ? (t(), l("div", ma, A(c[e(o).title]), 1)) : b("", !0),
2515
+ Array.isArray(e(o).information) ? (t(), l("div", fa, [
2516
+ (t(!0), l(Y, null, E(e(o).information, (v) => (t(), l("div", {
2517
+ key: `info-${v}`
2518
+ }, A(c[v]), 1))), 128))
2519
+ ])) : e(o).information ? (t(), l("div", va, A(c[e(o).information]), 1)) : b("", !0)
2520
+ ]),
2521
+ actions: h(() => [
2522
+ d.individualActions?.length ? (t(), V(ke, M({
2523
+ key: 0,
2524
+ ref_for: !0
2525
+ }, {
2526
+ subject: c,
2527
+ actions: d.individualActions
2528
+ }), {
2529
+ default: h(({
2530
+ visible: v
2531
+ }) => [
2532
+ K(L(G, {
2533
+ reactive: "",
2534
+ active: v,
2535
+ icon: "dots-three-vertical"
2536
+ }, null, 8, ["active"]), [
2537
+ [m]
2538
+ ])
2539
+ ]),
2540
+ _: 2
2541
+ }, 1040)) : b("", !0)
2542
+ ]),
2543
+ default: h(() => [
2544
+ L(Le, M({ expandable: "" }, { ref_for: !0 }, {
2545
+ url: a(c[e(o).picture])?.link,
2546
+ meta: a(c[e(o).picture]),
2547
+ height: "16rem",
2548
+ alt: e(o).title ? a(c[e(o).title])?.link : "Item picture"
2549
+ }), null, 16)
2550
+ ]),
2551
+ _: 2
2552
+ }, [
2553
+ e(o).badge && Array.isArray(c[e(o).badge]) ? {
2554
+ name: "badge",
2555
+ fn: h(() => [
2556
+ (t(!0), l(Y, null, E(c[e(o).badge], (v) => (t(), V(ye, {
2557
+ key: `${c._id}-${v}`,
2558
+ large: ""
2559
+ }, {
2560
+ default: h(() => [
2561
+ D(A(e(o).translateBadge ? e(j)(v) : v), 1)
2562
+ ]),
2563
+ _: 2
2564
+ }, 1024))), 128))
2565
+ ]),
2566
+ key: "0"
2567
+ } : e(o).badge ? {
2568
+ name: "badge",
2569
+ fn: h(() => [
2570
+ L(ye, null, {
2571
+ default: h(() => [
2572
+ D(A(e(o).translateBadge ? e(j)(c[e(o).badge]) : c[e(o).badge]), 1)
2573
+ ]),
2574
+ _: 2
2575
+ }, 1024)
2576
+ ]),
2577
+ key: "1"
2578
+ } : void 0
2579
+ ]), 1032, ["inactive", "horizontal"]))), 128))
2580
+ ]),
2581
+ _: 1
2582
+ }, 8, ["list"]);
2583
+ };
2584
+ }
2585
+ }), Ke = /* @__PURE__ */ U(ya, [["__scopeId", "data-v-b4b8f1e7"]]), _a = (p) => ({
2586
+ tabular: da,
2587
+ grid: Ke,
2588
+ list: Ke
2589
+ })[p], ha = {
2590
+ key: 2,
2591
+ class: "crud__controls"
2592
+ }, ba = {
2593
+ key: 0,
2594
+ class: "crud__search"
2595
+ }, $a = { class: "crud__actions" }, ga = { class: "crud__context-badge" }, ka = { class: "crud__data" }, Va = { key: 0 }, Ca = {
2596
+ key: 3,
2597
+ class: "crud__pagination"
2598
+ }, Xe = 30, Oa = /* @__PURE__ */ z({
2599
+ __name: "aeria-crud",
2600
+ props: {
2601
+ collection: {},
2602
+ noControls: { type: Boolean },
2603
+ noActions: { type: Boolean },
2604
+ noFetch: { type: Boolean },
2605
+ noLayoutToggle: { type: Boolean },
2606
+ layout: {},
2607
+ action: {},
2608
+ componentProps: {},
2609
+ scrollPagination: { type: Boolean },
2610
+ noQueryPersistence: { type: Boolean }
2611
+ },
2612
+ emits: ["uiEvent"],
2613
+ setup(p, { emit: i }) {
2614
+ const o = J(!1), n = J(!1), a = J((...w) => null), d = J(), u = p, m = i, c = Ve(), v = Pe({
2615
+ delay: 600
2616
+ }), r = te("meta"), $ = Se(), { reachedEnd: k, detach: _ } = He(null, {
2617
+ antecipate: 600
2618
+ }), T = !$.value.md || u.scrollPagination;
2619
+ T && ne(k, (w) => {
2620
+ w && s.pagination.recordsTotal > s.items.length && y.value < Xe && (y.value += 1, ee());
2621
+ });
2622
+ const s = ft(u.collection);
2623
+ Sn(s, {
2624
+ persistInQuery: !u.noQueryPersistence
2625
+ });
2626
+ const O = De(), X = u.action ? e(u.action) : vt(s, c, O);
2627
+ a.value = X[0], d.value = X[1];
2628
+ const y = J(0), q = J(!1), ee = async (w) => {
2629
+ s.activeFilters = Object.assign({}, w?.filters || s.$filters), Object.assign(s.activeFilters, s.filtersPreset);
2630
+ const C = {
2631
+ filters: s.activeFilters,
2632
+ limit: s.pagination.limit,
2633
+ offset: s.pagination.offset,
2634
+ project: s.preferredTableProperties.length > 0 ? s.preferredTableProperties : s.description.table || Object.keys(s.properties)
2635
+ };
2636
+ y.value > 0 && (C.limit = 15, C.offset = y.value * C.limit), s.description.tableMeta && (C.project = C.project.concat(s.description.tableMeta)), w && Object.assign(C, w), s.loading.getAll = !0;
2637
+ const { error: Z, result: f } = await s.$actions.retrieveItems(C);
2638
+ if (Z)
2639
+ return;
2640
+ const { data: g, pagination: F } = f;
2641
+ s.pagination.recordsCount = F.recordsCount, s.pagination.recordsTotal = F.recordsTotal, y.value === 0 && s.items.splice(0), s.items.push(...g), s.loading.getAll = !1, q.value = !0;
2642
+ }, N = async (w) => {
2643
+ c.push(Be(c.currentRoute.value, {
2644
+ query: {
2645
+ offset: w.offset,
2646
+ limit: w.limit
2647
+ }
2648
+ })), s.pagination.offset = w.offset, s.pagination.limit = w.limit, ee();
2649
+ }, oe = ue("noResultsComponent", null);
2650
+ ne(() => [
2651
+ c.currentRoute.value.path,
2652
+ c.currentRoute.value.query.section
2653
+ ], async (w, C) => {
2654
+ if (C && C[0] === w[0] && C[1] === w[1])
2655
+ return;
2656
+ const Z = c.currentRoute.value;
2657
+ if (r.view.title = u.collection, !u.noFetch && (!Z.query._popstate || s.itemsCount === 0)) {
2658
+ const f = yt(s, Z.query);
2659
+ Object.keys(f).length > 0 && Object.assign(s.filters, f), await ee();
2660
+ }
2661
+ }, {
2662
+ immediate: !0,
2663
+ flush: "post"
2664
+ });
2665
+ const [be] = v((w) => (c.push(Be(c.currentRoute.value, {
2666
+ query: {
2667
+ search: w || void 0
2668
+ }
2669
+ })), w ? (s.filters = Object.assign(ge(s.freshFilters), {
2670
+ $text: {
2671
+ $search: `"${w}"`,
2672
+ $caseSensitive: !1
2673
+ }
2674
+ }), ee({
2675
+ offset: 0
2676
+ })) : (s.filters = ge(s.freshFilters), y.value = 0, ee())));
2677
+ ne(() => s.textQuery, (w) => {
2678
+ be(w);
2679
+ });
2680
+ const Oe = (w) => {
2681
+ w.currentLayout = w.currentLayout === "tabular" ? w.description.layout.name : "tabular";
2682
+ };
2683
+ nt(() => {
2684
+ s.$actions.clearFilters(), s.textQuery = "", _();
2685
+ }), ne(() => d.value, async (w) => {
2686
+ const C = ge(w);
2687
+ let Z;
2688
+ if (C)
2689
+ if ((C.name === "spawnEdit" || C.name === "duplicate") && (Z = s.$actions.get({
2690
+ filters: {
2691
+ _id: C.params._id
2692
+ }
2693
+ })), C.name === "spawnAdd")
2694
+ s.$actions.clearItem(), C.params?.item && (s.$actions.setItem(C.params.item), Object.keys(C.params.item).forEach((f) => {
2695
+ delete s.referenceItem[f];
2696
+ })), o.value = "add";
2697
+ else if (C.name === "spawnEdit")
2698
+ s.$actions.setItem(C.params), o.value = "edit";
2699
+ else if (C.name === "duplicate") {
2700
+ await Z;
2701
+ const f = Object.entries(s.item).reduce((g, [F, x]) => {
2702
+ if (!(F in s.properties))
2703
+ return {
2704
+ ...g,
2705
+ [F]: x
2706
+ };
2707
+ const B = s.properties[F];
2708
+ if (B.readOnly)
2709
+ return g;
2710
+ const R = (H) => {
2711
+ const de = re(B);
2712
+ if (!de)
2713
+ return H;
2714
+ if (de.$ref === "file")
2715
+ return {};
2716
+ if (de.inline && H) {
2717
+ const { _id: $e, ...xe } = H;
2718
+ return xe;
2719
+ }
2720
+ return H;
2721
+ };
2722
+ return x = Array.isArray(x) ? x.map(R) : R(x), {
2723
+ ...g,
2724
+ [F]: x
2725
+ };
2726
+ }, {
2727
+ _id: void 0
2728
+ });
2729
+ s.$actions.setItem(f), delete s.item._id, s.referenceItem = {
2730
+ _id: void 0
2731
+ }, o.value = "duplicate";
2732
+ } else
2733
+ m("uiEvent", C);
2734
+ }, {
2735
+ deep: !0
2736
+ }), ne(() => o, ({ value: w }) => {
2737
+ w === !1 && s.$actions.clearItem();
2738
+ });
2739
+ const pe = W(() => {
2740
+ if (!u.noActions)
2741
+ return s.individualActions.map((w) => {
2742
+ const [C] = v(a.value(w));
2743
+ return {
2744
+ click: C,
2745
+ ...w
2746
+ };
2747
+ });
2748
+ }), ae = W(() => s.actions.filter((w) => !w.button));
2749
+ return fe(Te, W(() => u.collection)), (w, C) => {
2750
+ const Z = P("clickable"), f = P("loading");
2751
+ return t(), l(Y, null, [
2752
+ n.value ? (t(), V(In, {
2753
+ key: e(s).$id,
2754
+ modelValue: n.value,
2755
+ "onUpdate:modelValue": C[0] || (C[0] = (g) => n.value = g)
2756
+ }, null, 8, ["modelValue"])) : b("", !0),
2757
+ o.value ? (t(), V(Bn, M({
2758
+ key: 1,
2759
+ visible: o.value,
2760
+ "onUpdate:visible": C[1] || (C[1] = (g) => o.value = g),
2761
+ "fixed-right": ""
2762
+ }, {
2763
+ collection: w.collection,
2764
+ individualActions: pe.value
2765
+ }, {
2766
+ onCancel: C[2] || (C[2] = (g) => o.value = !1)
2767
+ }), ie({
2768
+ header: h(() => [
2769
+ S("span", null, A((() => {
2770
+ switch (o.value) {
2771
+ case "add":
2772
+ return e(j)("action.add", { capitalize: !0 });
2773
+ case "duplicate":
2774
+ return e(j)("action.duplicate", { capitalize: !0 });
2775
+ case "edit":
2776
+ default:
2777
+ return e(j)("action.edit", { capitalize: !0 });
2778
+ }
2779
+ })()), 1),
2780
+ S("span", null, " " + A(e(j)(w.collection)), 1)
2781
+ ]),
2782
+ _: 2
2783
+ }, [
2784
+ E(Object.keys(w.$slots).filter((g) => g.startsWith("field-")), (g) => ({
2785
+ name: g,
2786
+ fn: h((F) => [
2787
+ I(w.$slots, g, le(_e(F)), void 0, !0)
2788
+ ])
2789
+ }))
2790
+ ]), 1040, ["visible"])) : b("", !0),
2791
+ !w.noActions && (e(s).description.search || Object.keys(e(s).availableFilters).length > 0 || e(s)?.actions.length > 0 || w.$slots.actions || !w.noLayoutToggle && e(s).description.layout && e(s).description.layout?.name !== "tabular") ? (t(), l("div", ha, [
2792
+ e(s).description.search ? (t(), l("div", ba, [
2793
+ L(he, M({
2794
+ modelValue: e(s).textQuery,
2795
+ "onUpdate:modelValue": C[3] || (C[3] = (g) => e(s).textQuery = g)
2796
+ }, {
2797
+ property: {
2798
+ type: "string",
2799
+ placeholder: e(s).description.search.placeholder || "Pesquise aqui",
2800
+ inputType: "search"
2801
+ }
2802
+ }), null, 16, ["modelValue"])
2803
+ ])) : b("", !0),
2804
+ S("div", $a, [
2805
+ ae.value.length > 0 || !w.noLayoutToggle && e(s).description.layout && e(s).description.layout?.name !== "tabular" ? (t(), V(ke, { key: 0 }, ie({
2806
+ default: h(() => [
2807
+ L(se, {
2808
+ variant: "alt",
2809
+ icon: "sliders"
2810
+ }, {
2811
+ default: h(() => [
2812
+ e(s).filtersCount ? (t(), V(ye, { key: 0 }, {
2813
+ default: h(() => [
2814
+ D(A(e(s).filtersCount), 1)
2815
+ ]),
2816
+ _: 1
2817
+ })) : b("", !0)
2818
+ ]),
2819
+ _: 1
2820
+ })
2821
+ ]),
2822
+ _: 2
2823
+ }, [
2824
+ Object.keys(e(s).availableFilters).length > 0 ? {
2825
+ name: "filter",
2826
+ fn: h(() => [
2827
+ K((t(), V(G, {
2828
+ icon: "funnel",
2829
+ onClick: C[4] || (C[4] = (g) => n.value = !0)
2830
+ }, {
2831
+ default: h(() => [
2832
+ D(A(e(j)("filters", { capitalize: !0 })), 1)
2833
+ ]),
2834
+ _: 1
2835
+ })), [
2836
+ [Z]
2837
+ ]),
2838
+ S("div", ga, [
2839
+ e(s).filtersCount ? (t(), V(ye, { key: 0 }, {
2840
+ default: h(() => [
2841
+ D(A(e(s).filtersCount), 1)
2842
+ ]),
2843
+ _: 1
2844
+ })) : b("", !0)
2845
+ ])
2846
+ ]),
2847
+ key: "0"
2848
+ } : void 0,
2849
+ !w.noLayoutToggle && e(s).description.layout && e(s).description.layout?.name !== "tabular" ? {
2850
+ name: "layout-toggle",
2851
+ fn: h(() => [
2852
+ K((t(), V(G, {
2853
+ icon: "table",
2854
+ onClick: C[5] || (C[5] = (g) => Oe(e(s)))
2855
+ }, {
2856
+ default: h(() => [
2857
+ D(A(e(j)("change_layout", { capitalize: !0 })), 1)
2858
+ ]),
2859
+ _: 1
2860
+ })), [
2861
+ [Z]
2862
+ ])
2863
+ ]),
2864
+ key: "1"
2865
+ } : void 0,
2866
+ E(ae.value, (g, F) => ({
2867
+ name: `action-${F}`,
2868
+ fn: h(() => [
2869
+ g ? (t(), V(G, {
2870
+ key: 0,
2871
+ icon: g.icon || "gear",
2872
+ disabled: e(s).selected.length === 0 && "selection" in g && g.selection,
2873
+ onClick: (x) => a.value(g)({ _id: e(s).selected.map((B) => typeof B == "string" || B._id) })
2874
+ }, {
2875
+ default: h(() => [
2876
+ D(A(e(j)(g.label, { capitalize: !0 })), 1)
2877
+ ]),
2878
+ _: 2
2879
+ }, 1032, ["icon", "disabled", "onClick"])) : b("", !0)
2880
+ ])
2881
+ }))
2882
+ ]), 1024)) : Object.keys(e(s).availableFilters).length > 0 ? (t(), V(se, {
2883
+ key: 1,
2884
+ variant: "alt",
2885
+ icon: "funnel",
2886
+ onClick: C[6] || (C[6] = (g) => n.value = !0)
2887
+ }, {
2888
+ default: h(() => [
2889
+ S("div", null, A(e(j)("Filters")), 1),
2890
+ e(s).filtersCount ? (t(), V(ye, { key: 0 }, {
2891
+ default: h(() => [
2892
+ D(A(e(s).filtersCount), 1)
2893
+ ]),
2894
+ _: 1
2895
+ })) : b("", !0)
2896
+ ]),
2897
+ _: 1
2898
+ })) : b("", !0),
2899
+ (t(!0), l(Y, null, E(e(s).actions.filter((g) => g.button), (g, F) => (t(), V(se, {
2900
+ key: `action-${F}`,
2901
+ icon: g.icon,
2902
+ disabled: e(s).selected.length === 0 && "selection" in g && g.selection,
2903
+ onClick: (x) => a.value(g)({ _id: e(s).selected.map((B) => typeof B == "string" || B._id) })
2904
+ }, {
2905
+ default: h(() => [
2906
+ D(A(e(j)(g.label, { capitalize: !0 })), 1)
2907
+ ]),
2908
+ _: 2
2909
+ }, 1032, ["icon", "disabled", "onClick"]))), 128)),
2910
+ w.$slots.actions ? I(w.$slots, "actions", { key: 2 }, void 0, !0) : b("", !0)
2911
+ ])
2912
+ ])) : b("", !0),
2913
+ K((t(), l("div", ka, [
2914
+ e(s).itemsCount === 0 && !e(s).loading.getAll && q.value && (e(oe) || w.$slots.empty) ? (t(), l("div", Va, [
2915
+ e(oe) ? (t(), V(me(e(oe)), le(M({ key: 0 }, {
2916
+ collection: e(s).$id
2917
+ })), {
2918
+ default: h(() => [
2919
+ e(s).filtersCount === 0 && e(s).description.actions && "spawnAdd" in e(s).description.actions ? (t(), V(se, {
2920
+ key: 0,
2921
+ icon: "plus",
2922
+ onClick: C[7] || (C[7] = (g) => a.value({
2923
+ action: "spawnAdd",
2924
+ event: "spawnAdd"
2925
+ })())
2926
+ }, {
2927
+ default: h(() => [
2928
+ D(A(e(j)("add_first_item", { capitalize: !0 })), 1)
2929
+ ]),
2930
+ _: 1
2931
+ })) : b("", !0)
2932
+ ]),
2933
+ _: 1
2934
+ }, 16)) : I(w.$slots, "empty", le(M({ key: 1 }, {
2935
+ collection: e(s).$id
2936
+ })), void 0, !0)
2937
+ ])) : w.$slots.component ? I(w.$slots, "component", le(M({ key: 1 }, {
2938
+ store: e(s)
2939
+ })), void 0, !0) : (t(), V(me(e(_a)(w.layout?.name || e(s).$currentLayout)), M({ key: 2 }, {
2940
+ individualActions: pe.value,
2941
+ layoutOptions: w.layout?.options || e(s).layout.options,
2942
+ componentProps: w.componentProps
2943
+ }, {
2944
+ "component-name": w.layout?.name || e(s).$currentLayout
2945
+ }), ie({ _: 2 }, [
2946
+ E(Object.keys(w.$slots).filter((g) => g.startsWith("row-")), (g) => ({
2947
+ name: g,
2948
+ fn: h((F) => [
2949
+ I(w.$slots, g, le(_e(F)), void 0, !0)
2950
+ ])
2951
+ })),
2952
+ w.$slots.tfoot ? {
2953
+ name: "tfoot",
2954
+ fn: h(() => [
2955
+ I(w.$slots, "tfoot", {}, void 0, !0)
2956
+ ]),
2957
+ key: "0"
2958
+ } : void 0
2959
+ ]), 1040, ["component-name"]))
2960
+ ])), [
2961
+ [f, (!e(T) || y.value === Xe) && e(s).loading.getAll]
2962
+ ]),
2963
+ !e(T) && !w.noControls && !e(s).loading.getAll && e(s).itemsCount > 0 ? (t(), l("div", Ca, [
2964
+ L(fo, {
2965
+ pagination: e(s).pagination,
2966
+ onPaginate: N
2967
+ }, null, 8, ["pagination"])
2968
+ ])) : b("", !0)
2969
+ ], 64);
2970
+ };
2971
+ }
2972
+ }), ul = /* @__PURE__ */ U(Oa, [["__scopeId", "data-v-018dcf56"]]), Aa = { class: "prompt" }, Ia = /* @__PURE__ */ z({
2973
+ __name: "aeria-prompt",
2974
+ props: {
2975
+ title: {},
2976
+ options: {}
2977
+ },
2978
+ setup(p) {
2979
+ const i = te("meta"), o = (n, a) => {
2980
+ i.$actions.fulfillPrompt(n, a);
2981
+ };
2982
+ return (n, a) => (t(), V(Ce, {
2983
+ float: "",
2984
+ "fill-footer": "",
2985
+ "close-hint": !1,
2986
+ title: n.title,
2987
+ style: { "--panel-min-width": "32rem" }
2988
+ }, {
2989
+ footer: h(() => [
2990
+ S("div", {
2991
+ class: "prompt__options",
2992
+ style: ve(`grid-template-columns: repeat(${Object.keys(n.options).length}, 1fr)`)
2993
+ }, [
2994
+ (t(!0), l(Y, null, E(Object.entries(n.options), ([d, u], m) => (t(), V(ce, {
2995
+ key: `option-${m}`,
2996
+ class: Q([
2997
+ "prompt__option",
2998
+ `prompt__option--${u.variant || "primary"}`
2999
+ ]),
3000
+ onClick: (c) => u.click ? u.click(d, u) : o(d, u)
3001
+ }, {
3002
+ default: h(() => [
3003
+ D(A(u.title), 1)
3004
+ ]),
3005
+ _: 2
3006
+ }, 1032, ["class", "onClick"]))), 128))
3007
+ ], 4)
3008
+ ]),
3009
+ default: h(() => [
3010
+ S("div", Aa, [
3011
+ I(n.$slots, "default", {}, void 0, !0)
3012
+ ])
3013
+ ]),
3014
+ _: 3
3015
+ }, 8, ["title"]));
3016
+ }
3017
+ }), Ba = /* @__PURE__ */ U(Ia, [["__scopeId", "data-v-4cbfd28f"]]), Sa = { class: "toast__content" }, wa = { class: "toast__time" }, Ta = /* @__PURE__ */ z({
3018
+ __name: "aeria-toast",
3019
+ props: {
3020
+ idx: {},
3021
+ itr: {},
3022
+ date: {},
3023
+ icon: {}
3024
+ },
3025
+ setup(p) {
3026
+ const i = te("meta");
3027
+ return (o, n) => {
3028
+ const a = P("clickable");
3029
+ return K((t(), l("div", {
3030
+ class: Q({
3031
+ toast: !0,
3032
+ "toast--animate": e(i).toasts[0].itr === o.itr
3033
+ }),
3034
+ onAnimationend: n[0] || (n[0] = (d) => e(i).$actions.popToast()),
3035
+ onClick: n[1] || (n[1] = (d) => e(i).$actions.popToast(o.itr))
3036
+ }, [
3037
+ L(G, M(
3038
+ o.icon ? { icon: o.icon } : { icon: "warning-circle" },
3039
+ { style: { "--icon-size": "4rem", "--icon-color": "var(--theme-brand-color-shade-3)" } }
3040
+ ), null, 16),
3041
+ S("div", Sa, [
3042
+ I(o.$slots, "default", {}, void 0, !0),
3043
+ S("div", wa, A(o.formatDateTime(o.date, { hoursOnly: !0 })), 1)
3044
+ ])
3045
+ ], 34)), [
3046
+ [a]
3047
+ ]);
3048
+ };
3049
+ }
3050
+ }), ja = /* @__PURE__ */ U(Ta, [["__scopeId", "data-v-606d47bf"]]), Ra = ["innerHTML"], La = ["innerHTML"], qa = { class: "main__toasts" }, Ma = ["innerHTML"], za = /* @__PURE__ */ z({
3051
+ __name: "aeria-main",
3052
+ setup(p) {
3053
+ const i = te("meta"), o = W(() => i.themeOverride || i.theme);
3054
+ return (n, a) => {
3055
+ const d = at("router-view");
3056
+ return t(), l("main", {
3057
+ id: "main",
3058
+ class: Q([
3059
+ "main",
3060
+ `main--${o.value}`,
3061
+ { dark: o.value === "dark" }
3062
+ ])
3063
+ }, [
3064
+ (t(), V(lt, null, {
3065
+ default: h(() => [
3066
+ L(d, null, {
3067
+ default: h(({ Component: u }) => [
3068
+ (t(), V(me(u), null, ie({ _: 2 }, [
3069
+ E(Object.keys(n.$slots), (m) => ({
3070
+ name: m,
3071
+ fn: h(() => [
3072
+ I(n.$slots, m, {}, void 0, !0)
3073
+ ])
3074
+ }))
3075
+ ]), 1024))
3076
+ ]),
3077
+ _: 3
3078
+ })
3079
+ ]),
3080
+ _: 3
3081
+ })),
3082
+ I(n.$slots, "default", {}, void 0, !0),
3083
+ L(Ce, M({
3084
+ modelValue: e(i).modal.visible,
3085
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => e(i).modal.visible = u),
3086
+ float: "",
3087
+ "close-hint": ""
3088
+ }, e(i).modal, {
3089
+ "overlay-layer": 70,
3090
+ onOverlayClick: a[1] || (a[1] = (u) => e(i).modal.visible = !1)
3091
+ }), {
3092
+ default: h(() => [
3093
+ e(i).modal.body ? (t(), l("div", {
3094
+ key: 0,
3095
+ style: { "white-space": "pre-wrap" },
3096
+ innerHTML: e(i).modal.body
3097
+ }, null, 8, Ra)) : b("", !0),
3098
+ e(i).modal.component ? (t(), V(me(e(i).modal.component), { key: 1 })) : b("", !0)
3099
+ ]),
3100
+ _: 1
3101
+ }, 16, ["modelValue"]),
3102
+ e(i).prompt.visible ? (t(), V(Ba, le(M({ key: 0 }, e(i).prompt)), {
3103
+ default: h(() => [
3104
+ S("div", {
3105
+ innerHTML: e(i).prompt.body
3106
+ }, null, 8, La)
3107
+ ]),
3108
+ _: 1
3109
+ }, 16)) : b("", !0),
3110
+ S("div", qa, [
3111
+ (t(!0), l(Y, null, E(e(i).toasts, (u) => (t(), V(ja, M({ ref_for: !0 }, u, {
3112
+ key: `toast-${u.itr}`
3113
+ }), {
3114
+ default: h(() => [
3115
+ S("div", {
3116
+ innerHTML: e(j)(u.text)
3117
+ }, null, 8, Ma)
3118
+ ]),
3119
+ _: 2
3120
+ }, 1040))), 128))
3121
+ ])
3122
+ ], 2);
3123
+ };
3124
+ }
3125
+ }), dl = /* @__PURE__ */ U(za, [["__scopeId", "data-v-8de8a4eb"]]), Fa = {}, Ea = { class: "menu" };
3126
+ function Ua(p, i) {
3127
+ return t(), l("menu", Ea, [
3128
+ (t(!0), l(Y, null, E(Object.keys(p.$slots), (o) => (t(), l("div", {
3129
+ key: o,
3130
+ class: "menu__entry"
3131
+ }, [
3132
+ I(p.$slots, o, {}, void 0, !0)
3133
+ ]))), 128))
3134
+ ]);
3135
+ }
3136
+ const cl = /* @__PURE__ */ U(Fa, [["render", Ua], ["__scopeId", "data-v-3cfef7fb"]]), Ha = { class: "tabs" }, Da = {
3137
+ key: 0,
3138
+ class: "tabs__horizontal"
3139
+ }, Qa = {
3140
+ key: 0,
3141
+ class: "tabs__tab tabs__tab--info"
3142
+ }, Ga = ["onClick"], Wa = {
3143
+ key: 1,
3144
+ class: "tabs__context-menu"
3145
+ }, Ya = ["onClick"], Ka = /* @__PURE__ */ z({
3146
+ __name: "aeria-tabs",
3147
+ props: {
3148
+ query: {},
3149
+ param: {},
3150
+ dropdown: { type: Boolean }
3151
+ },
3152
+ setup(p) {
3153
+ const i = p, o = st(), n = Ve(), a = Se(), d = W(() => {
3154
+ if (i.query) {
3155
+ const m = n.currentRoute.value.query[i.query];
3156
+ if (m)
3157
+ return m;
3158
+ } else if (i.param) {
3159
+ const m = n.currentRoute.value.params[i.param];
3160
+ if (m)
3161
+ return m;
3162
+ }
3163
+ return Object.keys(o)[0];
3164
+ }), u = (m) => {
3165
+ i.query && n.push(Be(n.currentRoute.value, {
3166
+ query: {
3167
+ [i.query]: m
3168
+ }
3169
+ })), i.param && n.push(Be(n.currentRoute.value, {
3170
+ params: {
3171
+ [i.param]: m
3172
+ }
3173
+ }));
3174
+ };
3175
+ return (m, c) => {
3176
+ const v = P("clickable");
3177
+ return t(), l("div", Ha, [
3178
+ e(a).md && !m.dropdown ? (t(), l("div", Da, [
3179
+ m.$slots.default ? (t(), l("div", Qa, [
3180
+ I(m.$slots, "default", {}, void 0, !0)
3181
+ ])) : b("", !0),
3182
+ (t(!0), l(Y, null, E(Object.keys(m.$slots).filter((r) => r !== "default"), (r, $) => (t(), l("div", {
3183
+ key: r,
3184
+ class: Q({
3185
+ tabs__tab: !0,
3186
+ "tabs__tab--current": r === d.value || !d.value && $ === 0
3187
+ }),
3188
+ onClick: (k) => u(r)
3189
+ }, [
3190
+ I(m.$slots, r, {}, void 0, !0)
3191
+ ], 10, Ga))), 128))
3192
+ ])) : (t(), l("div", Wa, [
3193
+ L(ke, null, ie({
3194
+ default: h(({ visible: r }) => [
3195
+ K((t(), V(G, {
3196
+ "icon-right": "",
3197
+ active: r,
3198
+ icon: "caret-down",
3199
+ style: { "--icon-color": "var(--theme-brand-color-shade-1)" },
3200
+ class: "tabs__context-menu-icon"
3201
+ }, {
3202
+ default: h(() => [
3203
+ I(m.$slots, d.value, {}, void 0, !0)
3204
+ ]),
3205
+ _: 2
3206
+ }, 1032, ["active"])), [
3207
+ [v]
3208
+ ])
3209
+ ]),
3210
+ _: 2
3211
+ }, [
3212
+ E(Object.keys(m.$slots).filter((r) => r !== "default"), (r) => ({
3213
+ name: r,
3214
+ fn: h(() => [
3215
+ S("div", {
3216
+ onClick: ($) => u(r)
3217
+ }, [
3218
+ I(m.$slots, r, {}, void 0, !0)
3219
+ ], 8, Ya)
3220
+ ])
3221
+ }))
3222
+ ]), 1024)
3223
+ ]))
3224
+ ]);
3225
+ };
3226
+ }
3227
+ }), Xa = /* @__PURE__ */ U(Ka, [["__scopeId", "data-v-a20914ab"]]), Ja = z({
3228
+ props: {
3229
+ initialValue: String,
3230
+ promise: Promise
3231
+ },
3232
+ setup(p) {
3233
+ const i = J(p.initialValue);
3234
+ return p.promise instanceof Promise && p.promise.then((o) => {
3235
+ i.value = o;
3236
+ }), () => it("div", String(i.value));
3237
+ }
3238
+ }), Za = ["onClick"], Pa = { key: 1 }, Na = /* @__PURE__ */ z({
3239
+ __name: "aeria-crud-topbar",
3240
+ props: {
3241
+ collection: {}
3242
+ },
3243
+ setup(p) {
3244
+ const i = p, n = Ve().currentRoute, a = De(), d = W(() => i.collection ? Ae(i.collection, a) : typeof n.value.meta.collection == "string" ? Ae(n.value.meta.collection, a) : typeof n.value.params.collection == "string" ? Ae(n.value.params.collection, a) : null), u = async (m, c) => {
3245
+ const { error: v, result: r } = await c.$functions[m.badgeFunction]({
3246
+ filters: m.filters
3247
+ });
3248
+ return v ? 0 : r;
3249
+ };
3250
+ return (m, c) => d.value && d.value.description.filtersPresets ? (t(), V(Xa, {
3251
+ key: 0,
3252
+ dropdown: "",
3253
+ query: "section"
3254
+ }, ie({ _: 2 }, [
3255
+ E(Object.entries(d.value.description.filtersPresets), ([v, r]) => ({
3256
+ name: v,
3257
+ fn: h(() => [
3258
+ S("div", {
3259
+ class: "topbar__preset",
3260
+ onClick: ($) => e(Ne)(r, d.value)
3261
+ }, [
3262
+ r.icon ? (t(), V(G, {
3263
+ key: 0,
3264
+ icon: r.icon
3265
+ }, {
3266
+ default: h(() => [
3267
+ D(A(r.label || e(j)(v, { plural: !0 })), 1)
3268
+ ]),
3269
+ _: 2
3270
+ }, 1032, ["icon"])) : (t(), l("div", Pa, A(r.label || e(j)(v, { plural: !0 })), 1)),
3271
+ r.badgeFunction ? (t(), V(ye, { key: 2 }, {
3272
+ default: h(() => [
3273
+ L(e(Ja), {
3274
+ "initial-value": "0",
3275
+ promise: u(r, d.value)
3276
+ }, null, 8, ["promise"])
3277
+ ]),
3278
+ _: 2
3279
+ }, 1024)) : b("", !0)
3280
+ ], 8, Za)
3281
+ ])
3282
+ }))
3283
+ ]), 1024)) : b("", !0);
3284
+ }
3285
+ }), xa = /* @__PURE__ */ U(Na, [["__scopeId", "data-v-f0a45677"]]), el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3286
+ __proto__: null,
3287
+ default: xa
3288
+ }, Symbol.toStringTag, { value: "Module" })), pl = /* @__PURE__ */ z({
3289
+ __name: "aeria-password-form",
3290
+ props: {
3291
+ modelValue: {}
3292
+ },
3293
+ emits: ["update:modelValue"],
3294
+ setup(p) {
3295
+ const i = p;
3296
+ fe(Te, null);
3297
+ const o = _t(), n = W(() => o(
3298
+ i.modelValue.password,
3299
+ i.modelValue.confirmation
3300
+ ));
3301
+ return (a, d) => (t(), V(Me, {
3302
+ form: {
3303
+ password: {
3304
+ type: "string",
3305
+ icon: "key",
3306
+ inputType: "password"
3307
+ },
3308
+ confirmation: {
3309
+ type: "string",
3310
+ icon: "key",
3311
+ inputType: "password"
3312
+ }
3313
+ },
3314
+ "model-value": a.modelValue,
3315
+ "onUpdate:modelValue": d[0] || (d[0] = (u) => a.$emit("update:modelValue", u))
3316
+ }, {
3317
+ after: h(() => [
3318
+ S("div", null, A(n.value || "Senhas conferem"), 1),
3319
+ I(a.$slots, "default", le(_e({ passwordError: n.value })))
3320
+ ]),
3321
+ _: 3
3322
+ }, 8, ["model-value"]));
3323
+ }
3324
+ }), ml = (p, i = []) => ({
3325
+ path: "/user",
3326
+ name: "/builtin:user",
3327
+ component: p,
3328
+ children: i.concat([
3329
+ {
3330
+ path: "invite/:id",
3331
+ name: "/user/invite/:id",
3332
+ redirect: (o) => ({
3333
+ path: "/user/signup",
3334
+ params: {
3335
+ inviteId: o.params.id
3336
+ }
3337
+ })
3338
+ },
3339
+ {
3340
+ path: "signin",
3341
+ name: "/user/signin",
3342
+ component: () => import("./signin-cVrDDO_m.js"),
3343
+ meta: {
3344
+ title: "Sign in"
3345
+ }
3346
+ },
3347
+ {
3348
+ path: "signup",
3349
+ name: "/user/signup",
3350
+ component: () => import("./signup-DQuIkgfu.js"),
3351
+ meta: {
3352
+ title: "Sign up"
3353
+ }
3354
+ },
3355
+ {
3356
+ path: "redefine-password",
3357
+ name: "/user/redefine-password",
3358
+ component: () => import("./redefine-password-DlV5qOxs.js"),
3359
+ meta: {
3360
+ title: "Redefine password"
3361
+ }
3362
+ },
3363
+ {
3364
+ path: "activation",
3365
+ name: "/user/activation",
3366
+ component: () => import("./activation-B07anxba.js"),
3367
+ meta: {
3368
+ title: "Activate user"
3369
+ }
3370
+ }
3371
+ ])
3372
+ }), fl = (p, i = []) => ({
3373
+ path: "/dashboard",
3374
+ name: "/builtin:dashboard",
3375
+ component: p,
3376
+ redirect: {
3377
+ name: "/dashboard/"
3378
+ },
3379
+ meta: {
3380
+ title: "Dashboard"
3381
+ },
3382
+ children: i.concat([
3383
+ {
3384
+ path: "c/:collection",
3385
+ name: "/dashboard/:collection",
3386
+ props: !0,
3387
+ components: {
3388
+ default: () => import("./index-Db2uR1by.js"),
3389
+ topbar: () => Promise.resolve().then(() => el)
3390
+ },
3391
+ meta: {
3392
+ title: ({ collectionName: o, t: n }) => n(o, {
3393
+ plural: !0
3394
+ })
3395
+ }
3396
+ },
3397
+ {
3398
+ path: "c/:collection/:id/:section?",
3399
+ name: "/dashboard/:collection/:id",
3400
+ props: !0,
3401
+ components: {
3402
+ default: () => import("./_id_-CcKdtx34.js")
3403
+ },
3404
+ meta: {
3405
+ title: ({ collectionName: o, t: n }) => n(o, {
3406
+ plural: !0
3407
+ })
3408
+ }
3409
+ },
3410
+ {
3411
+ path: "user",
3412
+ name: "/dashboard/user",
3413
+ meta: {
3414
+ title: "user",
3415
+ icon: "users",
3416
+ collection: "user"
3417
+ },
3418
+ redirect: "/dashboard/c/user",
3419
+ children: [
3420
+ {
3421
+ path: "profile",
3422
+ component: () => import("./index-C5UDw5o-.js"),
3423
+ meta: {
3424
+ title: "User profile",
3425
+ icon: "user-square"
3426
+ }
3427
+ },
3428
+ {
3429
+ path: "changepass",
3430
+ name: "/dashboard/user/changepass",
3431
+ component: () => import("./index-Dz3vo8bz.js"),
3432
+ meta: {
3433
+ title: "Change password",
3434
+ icon: "lock"
3435
+ }
3436
+ }
3437
+ ]
3438
+ }
3439
+ ])
3440
+ });
3441
+ export {
3442
+ Me as A,
3443
+ So as B,
3444
+ Ja as C,
3445
+ Ba as D,
3446
+ ja as E,
3447
+ xa as F,
3448
+ ml as G,
3449
+ fl as H,
3450
+ U as _,
3451
+ se as a,
3452
+ G as b,
3453
+ pl as c,
3454
+ go as d,
3455
+ ul as e,
3456
+ Bn as f,
3457
+ Le as g,
3458
+ cl as h,
3459
+ Ce as i,
3460
+ rl as j,
3461
+ ye as k,
3462
+ ce as l,
3463
+ Ut as m,
3464
+ ke as n,
3465
+ pa as o,
3466
+ In as p,
3467
+ Pt as q,
3468
+ dl as r,
3469
+ fo as s,
3470
+ ua as t,
3471
+ Xa as u,
3472
+ Ko as v,
3473
+ he as w,
3474
+ Co as x,
3475
+ rn as y,
3476
+ Qe as z
3477
+ };