@aeria-ui/ui 0.0.41 → 0.0.42

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