@aeria-ui/ui 0.0.74 → 0.0.75

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