@aerogel/core 0.0.0-next.f8cdd39997c56dcd46e07c26af8a84d04d610fce → 0.0.0-next.fcfbfdc3428c34c4d1c0e781b61d244f13232fc9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/aerogel-core.d.ts +2645 -884
  2. package/dist/aerogel-core.js +3266 -0
  3. package/dist/aerogel-core.js.map +1 -0
  4. package/package.json +36 -34
  5. package/src/bootstrap/bootstrap.test.ts +7 -10
  6. package/src/bootstrap/index.ts +43 -14
  7. package/src/bootstrap/options.ts +4 -1
  8. package/src/components/AppLayout.vue +16 -0
  9. package/src/components/{AGAppModals.vue → AppModals.vue} +3 -4
  10. package/src/components/{AGAppOverlays.vue → AppOverlays.vue} +5 -6
  11. package/src/components/AppToasts.vue +16 -0
  12. package/src/components/contracts/AlertModal.ts +4 -0
  13. package/src/components/contracts/Button.ts +16 -0
  14. package/src/components/contracts/ConfirmModal.ts +41 -0
  15. package/src/components/contracts/DropdownMenu.ts +20 -0
  16. package/src/components/contracts/ErrorReportModal.ts +29 -0
  17. package/src/components/contracts/Input.ts +26 -0
  18. package/src/components/contracts/LoadingModal.ts +22 -0
  19. package/src/components/contracts/Modal.ts +21 -0
  20. package/src/components/contracts/PromptModal.ts +30 -0
  21. package/src/components/contracts/Select.ts +44 -0
  22. package/src/components/contracts/Toast.ts +13 -0
  23. package/src/components/contracts/index.ts +11 -0
  24. package/src/components/headless/HeadlessButton.vue +51 -0
  25. package/src/components/headless/HeadlessInput.vue +59 -0
  26. package/src/components/headless/HeadlessInputDescription.vue +27 -0
  27. package/src/components/headless/{forms/AGHeadlessInputError.vue → HeadlessInputError.vue} +4 -8
  28. package/src/components/headless/HeadlessInputInput.vue +75 -0
  29. package/src/components/headless/HeadlessInputLabel.vue +18 -0
  30. package/src/components/headless/HeadlessInputTextArea.vue +40 -0
  31. package/src/components/headless/HeadlessModal.vue +92 -0
  32. package/src/components/headless/HeadlessModalContent.vue +30 -0
  33. package/src/components/headless/HeadlessModalDescription.vue +12 -0
  34. package/src/components/headless/HeadlessModalOverlay.vue +12 -0
  35. package/src/components/headless/HeadlessModalTitle.vue +12 -0
  36. package/src/components/headless/HeadlessSelect.vue +118 -0
  37. package/src/components/headless/HeadlessSelectError.vue +25 -0
  38. package/src/components/headless/HeadlessSelectLabel.vue +25 -0
  39. package/src/components/headless/HeadlessSelectOption.vue +34 -0
  40. package/src/components/headless/HeadlessSelectOptions.vue +37 -0
  41. package/src/components/headless/HeadlessSelectTrigger.vue +22 -0
  42. package/src/components/headless/HeadlessSelectValue.vue +18 -0
  43. package/src/components/headless/HeadlessToast.vue +18 -0
  44. package/src/components/headless/HeadlessToastAction.vue +13 -0
  45. package/src/components/headless/index.ts +19 -3
  46. package/src/components/index.ts +6 -9
  47. package/src/components/ui/AdvancedOptions.vue +18 -0
  48. package/src/components/ui/AlertModal.vue +13 -0
  49. package/src/components/ui/Button.vue +98 -0
  50. package/src/components/ui/Checkbox.vue +56 -0
  51. package/src/components/ui/ConfirmModal.vue +42 -0
  52. package/src/components/ui/DropdownMenu.vue +32 -0
  53. package/src/components/ui/DropdownMenuOption.vue +14 -0
  54. package/src/components/ui/DropdownMenuOptions.vue +27 -0
  55. package/src/components/ui/EditableContent.vue +82 -0
  56. package/src/components/ui/ErrorMessage.vue +15 -0
  57. package/src/components/ui/ErrorReportModal.vue +62 -0
  58. package/src/components/{modals/AGErrorReportModalButtons.vue → ui/ErrorReportModalButtons.vue} +38 -29
  59. package/src/components/ui/ErrorReportModalTitle.vue +24 -0
  60. package/src/components/ui/Form.vue +24 -0
  61. package/src/components/ui/Input.vue +56 -0
  62. package/src/components/ui/Link.vue +12 -0
  63. package/src/components/ui/LoadingModal.vue +32 -0
  64. package/src/components/ui/Markdown.vue +69 -0
  65. package/src/components/ui/Modal.vue +91 -0
  66. package/src/components/ui/ModalContext.vue +30 -0
  67. package/src/components/ui/ProgressBar.vue +51 -0
  68. package/src/components/ui/PromptModal.vue +35 -0
  69. package/src/components/ui/Select.vue +25 -0
  70. package/src/components/ui/SelectLabel.vue +17 -0
  71. package/src/components/ui/SelectOption.vue +29 -0
  72. package/src/components/ui/SelectOptions.vue +30 -0
  73. package/src/components/ui/SelectTrigger.vue +29 -0
  74. package/src/components/ui/SettingsModal.vue +15 -0
  75. package/src/components/ui/StartupCrash.vue +31 -0
  76. package/src/components/ui/Toast.vue +42 -0
  77. package/src/components/ui/index.ts +30 -0
  78. package/src/directives/index.ts +13 -5
  79. package/src/directives/measure.ts +40 -0
  80. package/src/errors/Errors.state.ts +1 -1
  81. package/src/errors/Errors.ts +35 -34
  82. package/src/errors/JobCancelledError.ts +3 -0
  83. package/src/errors/index.ts +19 -29
  84. package/src/errors/utils.ts +35 -0
  85. package/src/forms/{Form.test.ts → FormController.test.ts} +33 -4
  86. package/src/forms/FormController.ts +245 -0
  87. package/src/forms/composition.ts +4 -4
  88. package/src/forms/index.ts +3 -1
  89. package/src/forms/utils.ts +36 -5
  90. package/src/forms/validation.ts +19 -0
  91. package/src/index.css +54 -0
  92. package/src/{main.ts → index.ts} +3 -0
  93. package/src/jobs/Job.ts +147 -0
  94. package/src/jobs/index.ts +10 -0
  95. package/src/jobs/listeners.ts +3 -0
  96. package/src/jobs/status.ts +4 -0
  97. package/src/lang/DefaultLangProvider.ts +46 -0
  98. package/src/lang/Lang.state.ts +11 -0
  99. package/src/lang/Lang.ts +44 -29
  100. package/src/lang/index.ts +12 -6
  101. package/src/lang/settings/Language.vue +48 -0
  102. package/src/lang/settings/index.ts +10 -0
  103. package/src/plugins/Plugin.ts +2 -1
  104. package/src/plugins/index.ts +22 -0
  105. package/src/services/App.state.ts +40 -6
  106. package/src/services/App.ts +53 -5
  107. package/src/services/Cache.ts +43 -0
  108. package/src/services/Events.test.ts +39 -0
  109. package/src/services/Events.ts +112 -32
  110. package/src/services/Service.ts +154 -49
  111. package/src/services/Storage.ts +20 -0
  112. package/src/services/index.ts +18 -6
  113. package/src/services/store.ts +8 -5
  114. package/src/services/utils.ts +18 -0
  115. package/src/testing/index.ts +26 -0
  116. package/src/testing/setup.ts +11 -0
  117. package/src/ui/UI.state.ts +19 -7
  118. package/src/ui/UI.ts +274 -58
  119. package/src/ui/index.ts +23 -17
  120. package/src/ui/utils.ts +16 -0
  121. package/src/utils/classes.ts +49 -0
  122. package/src/utils/composition/events.ts +3 -2
  123. package/src/utils/composition/forms.ts +14 -4
  124. package/src/utils/composition/persistent.test.ts +33 -0
  125. package/src/utils/composition/persistent.ts +11 -0
  126. package/src/utils/composition/state.test.ts +47 -0
  127. package/src/utils/composition/state.ts +33 -0
  128. package/src/utils/index.ts +5 -0
  129. package/src/utils/markdown.test.ts +50 -0
  130. package/src/utils/markdown.ts +19 -6
  131. package/src/utils/types.ts +3 -0
  132. package/src/utils/vue.ts +28 -118
  133. package/.eslintrc.js +0 -3
  134. package/dist/aerogel-core.cjs.js +0 -2
  135. package/dist/aerogel-core.cjs.js.map +0 -1
  136. package/dist/aerogel-core.esm.js +0 -2
  137. package/dist/aerogel-core.esm.js.map +0 -1
  138. package/dist/virtual.d.ts +0 -11
  139. package/noeldemartin.config.js +0 -5
  140. package/src/components/AGAppLayout.vue +0 -11
  141. package/src/components/AGAppSnackbars.vue +0 -13
  142. package/src/components/basic/AGErrorMessage.vue +0 -16
  143. package/src/components/basic/AGLink.vue +0 -9
  144. package/src/components/basic/AGMarkdown.vue +0 -36
  145. package/src/components/basic/index.ts +0 -5
  146. package/src/components/constants.ts +0 -8
  147. package/src/components/forms/AGButton.vue +0 -44
  148. package/src/components/forms/AGCheckbox.vue +0 -35
  149. package/src/components/forms/AGForm.vue +0 -26
  150. package/src/components/forms/AGInput.vue +0 -36
  151. package/src/components/forms/index.ts +0 -6
  152. package/src/components/headless/forms/AGHeadlessButton.vue +0 -51
  153. package/src/components/headless/forms/AGHeadlessInput.ts +0 -8
  154. package/src/components/headless/forms/AGHeadlessInput.vue +0 -54
  155. package/src/components/headless/forms/AGHeadlessInputInput.vue +0 -45
  156. package/src/components/headless/forms/AGHeadlessInputLabel.vue +0 -16
  157. package/src/components/headless/forms/index.ts +0 -6
  158. package/src/components/headless/modals/AGHeadlessModal.ts +0 -7
  159. package/src/components/headless/modals/AGHeadlessModal.vue +0 -88
  160. package/src/components/headless/modals/AGHeadlessModalPanel.vue +0 -28
  161. package/src/components/headless/modals/AGHeadlessModalTitle.vue +0 -13
  162. package/src/components/headless/modals/index.ts +0 -6
  163. package/src/components/headless/snackbars/AGHeadlessSnackbar.vue +0 -10
  164. package/src/components/headless/snackbars/index.ts +0 -25
  165. package/src/components/modals/AGAlertModal.vue +0 -25
  166. package/src/components/modals/AGConfirmModal.vue +0 -30
  167. package/src/components/modals/AGErrorReportModal.ts +0 -20
  168. package/src/components/modals/AGErrorReportModal.vue +0 -62
  169. package/src/components/modals/AGErrorReportModalTitle.vue +0 -25
  170. package/src/components/modals/AGLoadingModal.vue +0 -19
  171. package/src/components/modals/AGModal.ts +0 -10
  172. package/src/components/modals/AGModal.vue +0 -36
  173. package/src/components/modals/AGModalContext.ts +0 -8
  174. package/src/components/modals/AGModalContext.vue +0 -22
  175. package/src/components/modals/index.ts +0 -21
  176. package/src/components/snackbars/AGSnackbar.vue +0 -42
  177. package/src/components/snackbars/index.ts +0 -3
  178. package/src/directives/initial-focus.ts +0 -11
  179. package/src/forms/Form.ts +0 -176
  180. package/src/types/virtual.d.ts +0 -11
  181. package/tsconfig.json +0 -11
  182. package/vite.config.ts +0 -14
@@ -0,0 +1,3266 @@
1
+ var yt = Object.defineProperty;
2
+ var _t = (t, s, e) => s in t ? yt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
+ var $ = (t, s, e) => _t(t, typeof s != "symbol" ? s + "" : s, e);
4
+ import { markRaw as $e, Comment as wt, Text as $t, Static as Ct, inject as ie, reactive as pe, nextTick as qe, defineComponent as g, useAttrs as Fe, useSlots as Ee, computed as u, createBlock as f, openBlock as l, h as xt, unref as o, mergeProps as P, withCtx as m, renderSlot as _, createPropsRestProxy as Y, onUnmounted as fe, onMounted as St, watch as He, toRaw as kt, ref as D, watchEffect as ce, createVNode as h, normalizeProps as ee, guardReactiveProps as te, createTextVNode as V, toDisplayString as S, normalizeClass as k, createElementBlock as b, Fragment as q, renderList as U, readonly as Le, provide as se, resolveDynamicComponent as W, createCommentVNode as E, createElementVNode as y, toRef as Ie, useTemplateRef as re, withModifiers as Ue, withDirectives as Oe, vModelCheckbox as Mt, normalizeStyle as Et, createApp as Ht, vModelText as Lt } from "vue";
5
+ import { JSError as he, tap as Z, MagicObject as Ne, PromisedValue as K, Storage as O, objectOnly as ae, arrayFrom as We, isEmpty as ye, objectDeepClone as Rt, fail as Q, facade as G, arrayRemove as Ce, getEnv as Tt, updateLocationQueryParameters as Pt, forever as It, toString as j, isDevelopment as X, isTesting as Re, after as Ve, uuid as le, required as Vt, isObject as xe, objectWithoutEmpty as Ke, stringMatchAll as At, isInstanceOf as Bt, objectWithout as Dt, noop as zt, debounce as jt, value as qt, stringExcerpt as Ft, arraySorted as Ut, ListenersManager as Ot, toError as Nt, round as Wt } from "@noeldemartin/utils";
6
+ import N from "virtual:aerogel";
7
+ import { createPinia as Kt, setActivePinia as Qt, defineStore as Jt } from "pinia";
8
+ import Zt from "dompurify";
9
+ import { marked as Gt, Renderer as Ae } from "marked";
10
+ import { Primitive as Xt, SelectValue as Be, SelectTrigger as Yt, SelectIcon as es, SelectItem as ts, SelectItemText as ss, SelectPortal as rs, SelectContent as ns, SelectViewport as as, SelectRoot as os, Label as ls, useForwardExpose as Te, DialogRoot as is, DialogPortal as cs, DialogContent as us, DialogDescription as ds, DialogOverlay as ps, DialogTitle as ms, ToastClose as fs, ToastRoot as hs, ToastProvider as gs, ToastViewport as vs, DropdownMenuItem as bs, DropdownMenuContent as ys, DropdownMenuRoot as _s, DropdownMenuTrigger as ws, DropdownMenuPortal as $s } from "reka-ui";
11
+ import Cs from "clsx";
12
+ import { cva as xs } from "class-variance-authority";
13
+ import { twMerge as Ss } from "tailwind-merge";
14
+ class Se extends he {
15
+ constructor(s, e) {
16
+ super(`Service '${s}' failed booting`, { cause: e });
17
+ }
18
+ }
19
+ let Pe = null;
20
+ function Qe() {
21
+ return Pe ?? ks();
22
+ }
23
+ function ks() {
24
+ return Z(Kt(), (t) => {
25
+ Pe = t, Qt(t);
26
+ });
27
+ }
28
+ function Ms() {
29
+ return Pe ?? Qe();
30
+ }
31
+ function Es(t, s) {
32
+ return Qe(), Jt(t, s)();
33
+ }
34
+ function ge(t) {
35
+ var s;
36
+ return s = class extends ve {
37
+ usesStore() {
38
+ return !0;
39
+ }
40
+ getName() {
41
+ return t.name ?? null;
42
+ }
43
+ getInitialState() {
44
+ return typeof t.initialState == "function" ? t.initialState() : Object.entries(t.initialState).reduce((e, [r, n]) => {
45
+ try {
46
+ n = structuredClone(n);
47
+ } catch {
48
+ console.warn(
49
+ `Could not clone '${r}' state from ${this.getName()} service, this may cause problems if you're using multiple instances of the service (for example, in unit tests).
50
+ To fix this problem, declare your initialState as a function instead.`
51
+ );
52
+ }
53
+ return e[r] = n, e;
54
+ }, {});
55
+ }
56
+ getComputedStateDefinition() {
57
+ return t.computed ?? {};
58
+ }
59
+ getStateWatchers() {
60
+ return t.watch ?? {};
61
+ }
62
+ serializePersistedState(e) {
63
+ var r;
64
+ return ((r = t.serialize) == null ? void 0 : r.call(t, e)) ?? e;
65
+ }
66
+ deserializePersistedState(e) {
67
+ var r;
68
+ return ((r = t.restore) == null ? void 0 : r.call(t, e)) ?? e;
69
+ }
70
+ }, $(s, "persist", t.persist ?? []), s;
71
+ }
72
+ var we;
73
+ let ve = (we = class extends Ne {
74
+ constructor() {
75
+ super();
76
+ $(this, "_name");
77
+ $(this, "_booted");
78
+ $(this, "_computedStateKeys");
79
+ $(this, "_watchers");
80
+ $(this, "_store");
81
+ const e = this.getComputedStateDefinition();
82
+ this._name = this.getName() ?? new.target.name, this._booted = new K(), this._computedStateKeys = new Set(Object.keys(e)), this._watchers = this.getStateWatchers(), this._store = this.usesStore() && Es(this._name, {
83
+ state: () => this.getInitialState(),
84
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
+ getters: e
86
+ });
87
+ }
88
+ get booted() {
89
+ return this._booted;
90
+ }
91
+ static(e) {
92
+ return super.static(e);
93
+ }
94
+ launch() {
95
+ const e = (r) => this._booted.reject(new Se(this._name, r));
96
+ try {
97
+ this.frameworkBoot().then(() => this.boot()).then(() => this._booted.resolve()).catch(e);
98
+ } catch (r) {
99
+ e(r);
100
+ }
101
+ return this._booted;
102
+ }
103
+ hasPersistedState() {
104
+ return O.has(this._name);
105
+ }
106
+ hasState(e) {
107
+ return this._store ? e in this._store.$state || this._computedStateKeys.has(e) : !1;
108
+ }
109
+ getState(e) {
110
+ const r = this._store;
111
+ return e ? r ? r[e] : void 0 : r || {};
112
+ }
113
+ setState(e, r) {
114
+ if (!this._store)
115
+ return;
116
+ const n = typeof e == "string" ? { [e]: r } : e, a = ae(this._store.$state, Object.keys(n));
117
+ Object.assign(this._store.$state, n), this.onStateUpdated(n, a);
118
+ }
119
+ updatePersistedState(e) {
120
+ if (!this._store)
121
+ return;
122
+ const r = We(e), n = ae(this._store.$state, r);
123
+ ye(n) || this.onPersistentStateUpdated(n);
124
+ }
125
+ __get(e) {
126
+ return this.hasState(e) ? this.getState(e) : super.__get(e);
127
+ }
128
+ __set(e, r) {
129
+ this.setState({ [e]: r });
130
+ }
131
+ onStateUpdated(e, r) {
132
+ const n = ae(e, this.static("persist"));
133
+ ye(n) || this.onPersistentStateUpdated(n);
134
+ for (const a in e) {
135
+ const i = this._watchers[a];
136
+ !i || e[a] === r[a] || i.call(this, e[a], r[a]);
137
+ }
138
+ }
139
+ onPersistentStateUpdated(e) {
140
+ const r = O.get(this._name);
141
+ r && O.set(this._name, {
142
+ ...r,
143
+ ...this.serializePersistedState(Rt(e))
144
+ });
145
+ }
146
+ usesStore() {
147
+ return !1;
148
+ }
149
+ getName() {
150
+ return null;
151
+ }
152
+ getInitialState() {
153
+ return {};
154
+ }
155
+ getComputedStateDefinition() {
156
+ return {};
157
+ }
158
+ getStateWatchers() {
159
+ return {};
160
+ }
161
+ serializePersistedState(e) {
162
+ return e;
163
+ }
164
+ deserializePersistedState(e) {
165
+ return e;
166
+ }
167
+ async frameworkBoot() {
168
+ this.restorePersistedState();
169
+ }
170
+ async boot() {
171
+ }
172
+ restorePersistedState() {
173
+ if (!(!this.usesStore() || ye(this.static("persist")))) {
174
+ if (O.has(this._name)) {
175
+ const e = O.require(this._name);
176
+ this.setState(this.deserializePersistedState(e));
177
+ return;
178
+ }
179
+ O.set(this._name, ae(this.getState(), this.static("persist")));
180
+ }
181
+ }
182
+ requireStore() {
183
+ return this._store ? this._store : Q(`Failed getting '${this._name}' store`);
184
+ }
185
+ }, $(we, "persist", []), we);
186
+ const va = {
187
+ Low: -256,
188
+ Default: 0,
189
+ High: 256
190
+ };
191
+ class Hs extends ve {
192
+ constructor() {
193
+ super(...arguments);
194
+ $(this, "listeners", {});
195
+ }
196
+ async boot() {
197
+ Object.entries(globalThis.__aerogelEvents__ ?? {}).forEach(([e, r]) => this.on(e, r));
198
+ }
199
+ async emit(e, r) {
200
+ var a;
201
+ const n = this.listeners[e] ?? { priorities: [], handlers: {} };
202
+ for (const i of n.priorities)
203
+ await Promise.all(((a = n.handlers[i]) == null ? void 0 : a.map((c) => c(r))) ?? []);
204
+ }
205
+ // prettier-ignore
206
+ /* eslint-enable max-len */
207
+ on(e, r, n) {
208
+ const a = typeof r == "function" ? {} : typeof r == "number" ? { priority: r } : r, i = typeof r == "function" ? r : n;
209
+ return this.registerListener(e, a, i), () => this.off(e, i);
210
+ }
211
+ // prettier-ignore
212
+ /* eslint-enable max-len */
213
+ once(e, r, n) {
214
+ let a = null;
215
+ const i = typeof r == "function" ? {} : r, c = typeof r == "function" ? r : n;
216
+ return Z(
217
+ () => a && this.off(e, a),
218
+ (p) => {
219
+ a = (...d) => (p(), c(...d)), this.registerListener(e, i, c);
220
+ }
221
+ );
222
+ }
223
+ off(e, r) {
224
+ var i;
225
+ const n = this.listeners[e];
226
+ if (!n)
227
+ return;
228
+ const a = [...n.priorities];
229
+ for (const c of a)
230
+ Ce(n.handlers[c] ?? [], r), ((i = n.handlers[c]) == null ? void 0 : i.length) === 0 && (delete n.handlers[c], Ce(n.priorities, c));
231
+ n.priorities.length === 0 && delete this.listeners[e];
232
+ }
233
+ registerListener(e, r, n) {
234
+ var p, d, w;
235
+ const a = r.priority ?? 0;
236
+ e in this.listeners || (this.listeners[e] = { priorities: [], handlers: {} });
237
+ const i = ((p = this.listeners[e]) == null ? void 0 : p.priorities) ?? Q(`priorities missing for event '${e}'`), c = ((d = this.listeners[e]) == null ? void 0 : d.handlers) ?? Q(`handlers missing for event '${e}'`);
238
+ i.includes(a) || (i.push(a), i.sort((v, C) => C - v), c[a] = []), (w = c[a]) == null || w.push(n);
239
+ }
240
+ }
241
+ const M = G(Hs);
242
+ function ba(t) {
243
+ return t;
244
+ }
245
+ const Ls = ge({
246
+ name: "app",
247
+ initialState: {
248
+ plugins: {},
249
+ instance: null,
250
+ environment: Tt() ?? "development",
251
+ version: N.version,
252
+ sourceUrl: N.sourceUrl,
253
+ settings: []
254
+ },
255
+ computed: {
256
+ development: (t) => t.environment === "development",
257
+ staging: (t) => t.environment === "staging",
258
+ testing: (t) => t.environment === "test" || t.environment === "testing",
259
+ versionName(t) {
260
+ return this.development ? "dev." + N.sourceHash.toString().substring(0, 7) : this.staging ? "staging." + N.sourceHash.toString().substring(0, 7) : `v${t.version}`;
261
+ },
262
+ versionUrl(t) {
263
+ return t.sourceUrl + (this.development || this.staging ? `/tree/${N.sourceHash}` : `/releases/tag/${this.versionName}`);
264
+ }
265
+ }
266
+ });
267
+ class Rs extends Ls {
268
+ constructor() {
269
+ super(...arguments);
270
+ $(this, "name", N.name);
271
+ $(this, "ready", new K());
272
+ $(this, "mounted", new K());
273
+ }
274
+ isReady() {
275
+ return this.ready.isResolved();
276
+ }
277
+ isMounted() {
278
+ return this.mounted.isResolved();
279
+ }
280
+ addSetting(e) {
281
+ this.settings.push($e(e));
282
+ }
283
+ async whenReady(e) {
284
+ return await this.ready.then(e);
285
+ }
286
+ async reload(e) {
287
+ e && Pt(e), location.reload(), await It();
288
+ }
289
+ plugin(e) {
290
+ return this.plugins[e] ?? null;
291
+ }
292
+ service(e) {
293
+ var r;
294
+ return ((r = this.instance) == null ? void 0 : r.config.globalProperties[e]) ?? null;
295
+ }
296
+ async boot() {
297
+ M.once("application-ready", () => this.ready.resolve()), M.once("application-mounted", () => this.mounted.resolve());
298
+ }
299
+ }
300
+ const z = G(Rs);
301
+ function ya(t) {
302
+ return t;
303
+ }
304
+ async function Ts(t, ...s) {
305
+ z.setState(
306
+ "plugins",
307
+ t.reduce(
308
+ (e, r) => (r.name && (e[r.name] = r), e),
309
+ {}
310
+ )
311
+ ), await Promise.all(t.map((e) => e.install(...s)) ?? []);
312
+ }
313
+ function Ps(t) {
314
+ return Object.entries(t.props ?? {}).reduce((s, [e, r]) => s + `${e}="${j(r)}"`, "");
315
+ }
316
+ function _a(t) {
317
+ return t;
318
+ }
319
+ function Is(t) {
320
+ const s = ie(t);
321
+ return s ? pe(s) : void 0;
322
+ }
323
+ function R(t, s) {
324
+ return Is(t) ?? Q(s ?? `Could not resolve '${j(t)}' injection key`);
325
+ }
326
+ function Vs(t, s) {
327
+ return ie(t) ?? Q(s ?? `Could not resolve '${j(t)}' injection key`);
328
+ }
329
+ function Je(t) {
330
+ return typeof t == "string" ? t : t.type === wt ? "" : t.type === $t || t.type === Ct ? t.children : t.type === "br" ? `
331
+
332
+ ` : `<${t.type} ${Ps(t)}>${Array.from(t.children).map(Je).join("")}</${t.type}>`;
333
+ }
334
+ const _e = /* @__PURE__ */ new WeakMap(), As = {
335
+ mounted(t, { value: s }) {
336
+ const e = typeof s == "function" ? s : null, r = () => {
337
+ const n = t.getBoundingClientRect();
338
+ t.style.setProperty("--width", `${n.width}px`), t.style.setProperty("--height", `${n.height}px`), e == null || e({ width: n.width, height: n.height });
339
+ };
340
+ _e.set(t, Z(new ResizeObserver(r)).observe(t)), r();
341
+ },
342
+ unmounted(t) {
343
+ var s;
344
+ (s = _e.get(t)) == null || s.unobserve(t), _e.delete(t);
345
+ }
346
+ }, Bs = {
347
+ measure: As
348
+ }, Ds = {
349
+ install(t, s) {
350
+ const e = {
351
+ ...Bs,
352
+ ...s.directives
353
+ };
354
+ for (const [r, n] of Object.entries(e))
355
+ t.directive(r, n);
356
+ }
357
+ };
358
+ class zs extends ve {
359
+ constructor() {
360
+ super(...arguments);
361
+ $(this, "cache");
362
+ }
363
+ async get(e) {
364
+ return await (await this.open()).match(e) ?? null;
365
+ }
366
+ async store(e, r) {
367
+ await (await this.open()).put(e, r);
368
+ }
369
+ async replace(e, r) {
370
+ const n = await this.open();
371
+ (await n.keys(e)).length !== 0 && await n.put(e, r);
372
+ }
373
+ async open() {
374
+ return this.cache = this.cache ?? Z(new K(), (e) => {
375
+ caches.open("app").then((r) => e.resolve(r));
376
+ });
377
+ }
378
+ }
379
+ const wa = G(zs);
380
+ class js extends ve {
381
+ async purge() {
382
+ await M.emit("purge-storage");
383
+ }
384
+ }
385
+ const qs = G(js);
386
+ function $a(t, s) {
387
+ return {
388
+ ...t,
389
+ ...ae(s, Object.keys(t))
390
+ };
391
+ }
392
+ const Fs = {
393
+ $app: z,
394
+ $events: M,
395
+ $storage: qs
396
+ };
397
+ async function be(t, s) {
398
+ await Promise.all(
399
+ Object.entries(s).map(async ([e, r]) => {
400
+ await r.launch().catch((n) => {
401
+ var a, i;
402
+ return (i = (a = t.config).errorHandler) == null ? void 0 : i.call(a, n, null, `Failed launching ${e}.`);
403
+ });
404
+ })
405
+ ), Object.assign(t.config.globalProperties, s), (X() || Re()) && Object.assign(globalThis, s);
406
+ }
407
+ const Us = {
408
+ async install(t, s) {
409
+ var r;
410
+ const e = {
411
+ ...Fs,
412
+ ...s.services
413
+ };
414
+ t.use(Ms()), (r = s.settings) == null || r.forEach((n) => z.addSetting(n)), await be(t, e);
415
+ }
416
+ }, Ze = 768, me = {
417
+ Mobile: "mobile",
418
+ Desktop: "desktop"
419
+ };
420
+ function Ge() {
421
+ return globalThis.innerWidth > Ze ? me.Desktop : me.Mobile;
422
+ }
423
+ const Os = ge({
424
+ name: "ui",
425
+ initialState: {
426
+ modals: [],
427
+ toasts: [],
428
+ layout: Ge()
429
+ },
430
+ computed: {
431
+ mobile: ({ layout: t }) => t === me.Mobile,
432
+ desktop: ({ layout: t }) => t === me.Desktop
433
+ }
434
+ }), L = {
435
+ AlertModal: "alert-modal",
436
+ ConfirmModal: "confirm-modal",
437
+ ErrorReportModal: "error-report-modal",
438
+ LoadingModal: "loading-modal",
439
+ PromptModal: "prompt-modal",
440
+ Toast: "toast",
441
+ StartupCrash: "startup-crash",
442
+ RouterLink: "router-link"
443
+ };
444
+ class Ns extends Os {
445
+ constructor() {
446
+ super(...arguments);
447
+ $(this, "modalCallbacks", {});
448
+ $(this, "components", {});
449
+ }
450
+ resolveComponent(e) {
451
+ return this.components[e] ?? null;
452
+ }
453
+ requireComponent(e) {
454
+ return this.resolveComponent(e) ?? Q(`UI Component '${e}' is not defined!`);
455
+ }
456
+ alert(e, r) {
457
+ const n = () => typeof r != "string" ? { message: e } : {
458
+ title: e,
459
+ message: r
460
+ };
461
+ this.openModal(
462
+ this.requireComponent(L.AlertModal),
463
+ n()
464
+ );
465
+ }
466
+ // prettier-ignore
467
+ /* eslint-enable max-len */
468
+ async confirm(e, r, n) {
469
+ const i = typeof r != "string" ? {
470
+ ...r ?? {},
471
+ message: e,
472
+ required: !!(r != null && r.required)
473
+ } : {
474
+ ...n ?? {},
475
+ title: e,
476
+ message: r,
477
+ required: !!(n != null && n.required)
478
+ }, p = await (await this.openModal(
479
+ this.requireComponent(L.ConfirmModal),
480
+ i
481
+ )).beforeClose, d = typeof p == "object" ? p[0] : p ?? !1, w = typeof p == "object" ? p[1] : Object.entries(i.checkboxes ?? {}).reduce(
482
+ (v, [C, { default: T }]) => ({
483
+ [C]: T ?? !1,
484
+ ...v
485
+ }),
486
+ {}
487
+ );
488
+ for (const [v, C] of Object.entries(i.checkboxes ?? {}))
489
+ if (!(!C.required || w[v]))
490
+ return d && X() && console.warn(`Confirmed confirm modal was suppressed because required '${v}' checkbox was missing`), [!1, w];
491
+ return "checkboxes" in i ? [d, w] : d;
492
+ }
493
+ async prompt(e, r, n) {
494
+ const a = (n == null ? void 0 : n.trim) ?? !0, i = () => typeof r != "string" ? {
495
+ message: e,
496
+ ...r ?? {}
497
+ } : {
498
+ title: e,
499
+ message: r,
500
+ ...n ?? {}
501
+ }, p = await (await this.openModal(
502
+ this.requireComponent(L.PromptModal),
503
+ i()
504
+ )).beforeClose;
505
+ return (a && typeof p == "string" ? p == null ? void 0 : p.trim() : p) ?? null;
506
+ }
507
+ async loading(e, r) {
508
+ const n = (d) => typeof d == "function" ? Promise.resolve(d()) : d, a = () => typeof e == "string" ? {
509
+ props: { message: e },
510
+ operationPromise: n(r)
511
+ } : typeof e == "function" || e instanceof Promise ? { operationPromise: n(e) } : {
512
+ props: e,
513
+ operationPromise: n(r)
514
+ }, { operationPromise: i, props: c } = a(), p = await this.openModal(this.requireComponent(L.LoadingModal), c);
515
+ try {
516
+ const d = await i;
517
+ return await Ve({ ms: 500 }), d;
518
+ } finally {
519
+ await this.closeModal(p.id);
520
+ }
521
+ }
522
+ toast(e, r = {}) {
523
+ const { component: n, ...a } = r, i = {
524
+ id: le(),
525
+ properties: { message: e, ...a },
526
+ component: $e(n ?? this.requireComponent(L.Toast))
527
+ };
528
+ this.setState("toasts", this.toasts.concat(i));
529
+ }
530
+ registerComponent(e, r) {
531
+ this.components[e] = r;
532
+ }
533
+ async openModal(e, r) {
534
+ const n = le(), a = {}, i = {
535
+ id: n,
536
+ properties: r ?? {},
537
+ component: $e(e),
538
+ beforeClose: new Promise((d) => a.willClose = d),
539
+ afterClose: new Promise((d) => a.closed = d)
540
+ }, c = this.modals.at(-1), p = this.modals.concat(i);
541
+ return this.modalCallbacks[i.id] = a, this.setState({ modals: p }), await qe(), await (c && M.emit("hide-modal", { id: c.id })), await Promise.all([
542
+ c || M.emit("show-overlays-backdrop"),
543
+ M.emit("show-modal", { id: i.id })
544
+ ]), i;
545
+ }
546
+ async closeModal(e, r) {
547
+ if (!z.isMounted()) {
548
+ await this.removeModal(e, r);
549
+ return;
550
+ }
551
+ await M.emit("close-modal", { id: e, result: r });
552
+ }
553
+ async closeAllModals() {
554
+ for (; this.modals.length > 0; )
555
+ await this.closeModal(Vt(this.modals[this.modals.length - 1]).id);
556
+ }
557
+ async boot() {
558
+ this.watchModalEvents(), this.watchMountedEvent(), this.watchViewportBreakpoints();
559
+ }
560
+ async removeModal(e, r) {
561
+ var a, i;
562
+ this.setState(
563
+ "modals",
564
+ this.modals.filter((c) => c.id !== e)
565
+ ), (i = (a = this.modalCallbacks[e]) == null ? void 0 : a.closed) == null || i.call(a, r), delete this.modalCallbacks[e];
566
+ const n = this.modals.at(-1);
567
+ await (n && M.emit("show-modal", { id: n.id }));
568
+ }
569
+ watchModalEvents() {
570
+ M.on("modal-will-close", ({ modal: e, result: r }) => {
571
+ var n, a;
572
+ (a = (n = this.modalCallbacks[e.id]) == null ? void 0 : n.willClose) == null || a.call(n, r), this.modals.length === 1 && M.emit("hide-overlays-backdrop");
573
+ }), M.on("modal-closed", async ({ modal: { id: e }, result: r }) => {
574
+ await this.removeModal(e, r);
575
+ });
576
+ }
577
+ watchMountedEvent() {
578
+ M.once("application-mounted", async () => {
579
+ if (!globalThis.document || !globalThis.getComputedStyle)
580
+ return;
581
+ const e = globalThis.document.getElementById("splash");
582
+ e && (globalThis.getComputedStyle(e).opacity !== "0" && (e.style.opacity = "0", await Ve({ ms: 600 })), e.remove());
583
+ });
584
+ }
585
+ watchViewportBreakpoints() {
586
+ if (!globalThis.matchMedia)
587
+ return;
588
+ globalThis.matchMedia(`(min-width: ${Ze}px)`).addEventListener("change", () => this.setState({ layout: Ge() }));
589
+ }
590
+ }
591
+ const I = G(Ns);
592
+ class Ws {
593
+ constructor(s, e) {
594
+ this.locale = s, this.fallbackLocale = e;
595
+ }
596
+ getLocale() {
597
+ return this.locale;
598
+ }
599
+ async setLocale(s) {
600
+ this.locale = s;
601
+ }
602
+ getFallbackLocale() {
603
+ return this.fallbackLocale;
604
+ }
605
+ async setFallbackLocale(s) {
606
+ this.fallbackLocale = s;
607
+ }
608
+ getLocales() {
609
+ return ["en"];
610
+ }
611
+ translate(s) {
612
+ return X() && console.warn("Lang provider is missing"), s;
613
+ }
614
+ translateWithDefault(s, e) {
615
+ return X() && console.warn("Lang provider is missing"), e;
616
+ }
617
+ }
618
+ const Ks = ge({
619
+ name: "lang",
620
+ persist: ["locale", "fallbackLocale"],
621
+ initialState: {
622
+ locale: null,
623
+ locales: ["en"],
624
+ fallbackLocale: "en"
625
+ }
626
+ });
627
+ class Qs extends Ks {
628
+ constructor() {
629
+ super();
630
+ $(this, "provider");
631
+ this.provider = new Ws(
632
+ this.getState("locale") ?? this.getBrowserLocale(),
633
+ this.getState("fallbackLocale")
634
+ );
635
+ }
636
+ async setProvider(e) {
637
+ this.provider = e, this.locales = e.getLocales(), await e.setLocale(this.locale ?? this.getBrowserLocale()), await e.setFallbackLocale(this.fallbackLocale);
638
+ }
639
+ translate(e, r) {
640
+ return this.provider.translate(e, r) ?? e;
641
+ }
642
+ translateWithDefault(e, r, n = {}) {
643
+ return this.provider.translateWithDefault(e, r, n);
644
+ }
645
+ getBrowserLocale() {
646
+ const e = this.getState("locales");
647
+ return navigator.languages.find((r) => e.includes(r)) ?? "en";
648
+ }
649
+ async boot() {
650
+ globalThis.document && this.requireStore().$subscribe(
651
+ async () => {
652
+ var e, r;
653
+ await this.provider.setLocale(this.locale ?? this.getBrowserLocale()), await this.provider.setFallbackLocale(this.fallbackLocale), this.locale ? (e = document.querySelector("html")) == null || e.setAttribute("lang", this.locale) : (r = document.querySelector("html")) == null || r.removeAttribute("lang");
654
+ },
655
+ { immediate: !0 }
656
+ );
657
+ }
658
+ }
659
+ const J = G(Qs), Xe = J.translate.bind(J), x = J.translateWithDefault.bind(J), Js = ge({
660
+ name: "errors",
661
+ initialState: {
662
+ logs: [],
663
+ startupErrors: []
664
+ },
665
+ computed: {
666
+ hasErrors: ({ logs: t }) => t.length > 0,
667
+ hasNewErrors: ({ logs: t }) => t.some((s) => !s.seen),
668
+ hasStartupErrors: ({ startupErrors: t }) => t.length > 0
669
+ }
670
+ });
671
+ class Zs extends Js {
672
+ constructor() {
673
+ super(...arguments);
674
+ $(this, "forceReporting", !1);
675
+ $(this, "enabled", !0);
676
+ }
677
+ enable() {
678
+ this.enabled = !0;
679
+ }
680
+ disable() {
681
+ this.enabled = !1;
682
+ }
683
+ async inspect(e) {
684
+ const r = Array.isArray(e) ? e : [await this.createErrorReport(e)];
685
+ if (r.length === 0) {
686
+ I.alert(x("errors.inspectEmpty", "Nothing to inspect!"));
687
+ return;
688
+ }
689
+ I.openModal(I.requireComponent(L.ErrorReportModal), {
690
+ reports: r
691
+ });
692
+ }
693
+ async report(e, r) {
694
+ if (await M.emit("error", { error: e, message: r }), Re("unit") || (X() && this.logError(e), !this.enabled))
695
+ throw e;
696
+ if (!z.isMounted()) {
697
+ const i = await this.createStartupErrorReport(e);
698
+ i && this.setState({ startupErrors: this.startupErrors.concat(i) });
699
+ return;
700
+ }
701
+ const n = await this.createErrorReport(e), a = {
702
+ report: n,
703
+ seen: !1,
704
+ date: /* @__PURE__ */ new Date()
705
+ };
706
+ I.toast(
707
+ r ?? x("errors.notice", "Something went wrong, but it's not your fault. Try again!"),
708
+ {
709
+ variant: "danger",
710
+ actions: [
711
+ {
712
+ label: x("errors.viewDetails", "View details"),
713
+ dismiss: !0,
714
+ click: () => I.openModal(
715
+ I.requireComponent(L.ErrorReportModal),
716
+ { reports: [n] }
717
+ )
718
+ }
719
+ ]
720
+ }
721
+ ), this.setState({ logs: [a].concat(this.logs) });
722
+ }
723
+ see(e) {
724
+ this.setState({
725
+ logs: this.logs.map((r) => r.report !== e ? r : {
726
+ ...r,
727
+ seen: !0
728
+ })
729
+ });
730
+ }
731
+ seeAll() {
732
+ this.setState({
733
+ logs: this.logs.map((e) => ({
734
+ ...e,
735
+ seen: !0
736
+ }))
737
+ });
738
+ }
739
+ logError(e) {
740
+ console.error(e), xe(e) && e.cause && this.logError(e.cause);
741
+ }
742
+ async createErrorReport(e) {
743
+ return typeof e == "string" ? { title: e } : e instanceof Error || e instanceof he ? this.createErrorReportFromError(e) : xe(e) ? Ke({
744
+ title: j(
745
+ e.name ?? e.title ?? x("errors.unknown", "Unknown Error")
746
+ ),
747
+ description: j(
748
+ e.message ?? e.description ?? x("errors.unknownDescription", "Unknown error object")
749
+ ),
750
+ error: e
751
+ }) : {
752
+ title: x("errors.unknown", "Unknown Error"),
753
+ error: e
754
+ };
755
+ }
756
+ async createStartupErrorReport(e) {
757
+ return e instanceof Se ? e.cause instanceof Se ? null : this.createErrorReport(e.cause) : this.createErrorReport(e);
758
+ }
759
+ createErrorReportFromError(e, r = {}) {
760
+ return {
761
+ title: e.name,
762
+ description: e.message,
763
+ details: e.stack,
764
+ error: e,
765
+ ...r
766
+ };
767
+ }
768
+ }
769
+ const Ye = G(Zs), et = [];
770
+ function Ca(t) {
771
+ et.push(t);
772
+ }
773
+ function Gs(t) {
774
+ for (const s of et) {
775
+ const e = s(t);
776
+ if (e)
777
+ return e;
778
+ }
779
+ return typeof t == "string" ? t : t instanceof Error || t instanceof he ? t.message : xe(t) ? j(t.message ?? t.description ?? "Unknown error object") : x("errors.unknown", "Unknown Error");
780
+ }
781
+ class De extends he {
782
+ }
783
+ const Xs = { $errors: Ye }, Ys = (t) => (Ye.report(t), !0);
784
+ function er(t, s = () => !1) {
785
+ const e = (r) => s(r) || Ys(r);
786
+ t.config.errorHandler = e, globalThis.onerror = (r, n, a, i, c) => e(c ?? r), globalThis.onunhandledrejection = (r) => e(r.reason);
787
+ }
788
+ const tr = {
789
+ async install(t, s) {
790
+ er(t, s.handleError), await be(t, Xs);
791
+ }
792
+ };
793
+ function sr() {
794
+ return Z(new Ae(), (t) => {
795
+ t.link = function(s) {
796
+ return Ae.prototype.link.apply(this, [s]).replace("<a", '<a target="_blank"');
797
+ };
798
+ });
799
+ }
800
+ function rr(t) {
801
+ const s = At(t, /<a[^>]*href="#action:([^"]+)"[^>]*>([^<]+)<\/a>/g);
802
+ for (const [e, r, n] of s)
803
+ t = t.replace(e, `<button type="button" data-markdown-action="${r}">${n}</button>`);
804
+ return t;
805
+ }
806
+ function nr(t) {
807
+ let s = Gt(t, { renderer: sr(), async: !1 });
808
+ return s = ar(s), s = rr(s), s;
809
+ }
810
+ function ar(t) {
811
+ return Zt.sanitize(t, { ADD_ATTR: ["target"] });
812
+ }
813
+ const A = /* @__PURE__ */ g({
814
+ __name: "Markdown",
815
+ props: {
816
+ as: {},
817
+ inline: { type: Boolean },
818
+ langKey: {},
819
+ langParams: {},
820
+ langDefault: {},
821
+ text: {},
822
+ actions: {}
823
+ },
824
+ setup(t) {
825
+ const s = Fe(), e = Ee(), r = u(() => e.default ? e.default().map(Je).join("") : t.text ?? (t.langKey && (t.langDefault ? x(t.langKey, t.langDefault, t.langParams ?? {}) : Xe(t.langKey, t.langParams ?? {})))), n = u(() => {
826
+ if (!r.value)
827
+ return null;
828
+ let c = nr(r.value);
829
+ return t.inline && (c = c.replace("<p>", "<span>").replace("</p>", "</span>")), c;
830
+ }), a = () => xt(t.as ?? (t.inline ? "span" : "div"), {
831
+ innerHTML: n.value,
832
+ onClick: i,
833
+ ...s,
834
+ class: `${s.class ?? ""} ${t.inline ? "" : "prose"}`
835
+ });
836
+ async function i(c) {
837
+ var d, w;
838
+ const { target: p } = c;
839
+ if (Bt(p, HTMLElement) && p.dataset.markdownAction) {
840
+ (w = (d = t.actions) == null ? void 0 : d[p.dataset.markdownAction]) == null || w.call(d);
841
+ return;
842
+ }
843
+ }
844
+ return (c, p) => (l(), f(a));
845
+ }
846
+ }), or = /* @__PURE__ */ g({
847
+ __name: "HeadlessButton",
848
+ props: {
849
+ class: {},
850
+ disabled: { type: Boolean },
851
+ href: {},
852
+ route: {},
853
+ routeParams: {},
854
+ routeQuery: {},
855
+ size: {},
856
+ submit: { type: Boolean },
857
+ variant: {},
858
+ asChild: { type: Boolean },
859
+ as: {}
860
+ },
861
+ setup(t) {
862
+ const s = u(() => t.as ? { as: t.as } : t.route ? {
863
+ as: I.resolveComponent(L.RouterLink) ?? "a",
864
+ to: Ke({
865
+ name: t.route,
866
+ params: t.routeParams,
867
+ query: t.routeQuery
868
+ })
869
+ } : t.href ? {
870
+ as: "a",
871
+ target: "_blank",
872
+ href: t.href
873
+ } : {
874
+ as: "button",
875
+ type: t.submit ? "submit" : "button"
876
+ });
877
+ return (e, r) => (l(), f(o(Xt), P({
878
+ class: t.class,
879
+ "as-child": e.asChild,
880
+ disabled: e.disabled
881
+ }, s.value), {
882
+ default: m(() => [
883
+ _(e.$slots, "default")
884
+ ]),
885
+ _: 3
886
+ }, 16, ["class", "as-child", "disabled"]));
887
+ }
888
+ });
889
+ function tt(t, s) {
890
+ return u(() => {
891
+ const { baseClasses: e, ...r } = t, { baseClasses: n, ...a } = s, i = xs(n, a), c = Object.entries(r).reduce((p, [d, w]) => (p[d] = o(w), p), {});
892
+ return H(i(c), o(e));
893
+ });
894
+ }
895
+ function H(...t) {
896
+ return Ss(Cs(t));
897
+ }
898
+ const B = /* @__PURE__ */ g({
899
+ __name: "Button",
900
+ props: {
901
+ class: {},
902
+ disabled: { type: Boolean },
903
+ href: {},
904
+ route: {},
905
+ routeParams: {},
906
+ routeQuery: {},
907
+ size: {},
908
+ submit: { type: Boolean },
909
+ variant: {},
910
+ asChild: { type: Boolean },
911
+ as: {}
912
+ },
913
+ setup(t) {
914
+ const s = Y(t, ["class", "size", "variant", "disabled"]), e = tt(
915
+ { baseClasses: t.class, variant: t.variant, size: t.size, disabled: t.disabled },
916
+ {
917
+ baseClasses: "flex items-center justify-center gap-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",
918
+ variants: {
919
+ variant: {
920
+ default: "bg-primary-600 text-white focus-visible:outline-primary-600",
921
+ secondary: "bg-background text-gray-900 ring-gray-300",
922
+ danger: "bg-red-600 text-white focus-visible:outline-red-600",
923
+ ghost: "bg-transparent",
924
+ outline: "bg-transparent text-primary-600 ring-primary-600",
925
+ link: "text-primary-600"
926
+ },
927
+ size: {
928
+ small: "text-xs",
929
+ default: "text-sm",
930
+ large: "text-base",
931
+ icon: "rounded-full p-2.5"
932
+ },
933
+ disabled: {
934
+ false: null,
935
+ true: "opacity-50 cursor-not-allowed"
936
+ }
937
+ },
938
+ compoundVariants: [
939
+ {
940
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
941
+ class: "font-medium"
942
+ },
943
+ {
944
+ variant: ["default", "danger"],
945
+ class: "shadow-sm"
946
+ },
947
+ {
948
+ variant: ["secondary", "outline"],
949
+ class: "ring-1 ring-inset"
950
+ },
951
+ {
952
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
953
+ size: "small",
954
+ class: "rounded px-2 py-1"
955
+ },
956
+ {
957
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
958
+ size: "default",
959
+ class: "rounded-md px-2.5 py-1.5"
960
+ },
961
+ {
962
+ variant: ["default", "secondary", "danger", "ghost", "outline"],
963
+ size: "large",
964
+ class: "rounded-md px-3 py-2"
965
+ },
966
+ {
967
+ variant: "default",
968
+ disabled: !1,
969
+ class: "hover:bg-primary-500"
970
+ },
971
+ {
972
+ variant: ["secondary", "ghost", "outline"],
973
+ disabled: !1,
974
+ class: "hover:bg-gray-50"
975
+ },
976
+ {
977
+ variant: "danger",
978
+ disabled: !1,
979
+ class: "hover:bg-red-50"
980
+ },
981
+ {
982
+ variant: "link",
983
+ disabled: !1,
984
+ class: "hover:underline"
985
+ }
986
+ ],
987
+ defaultVariants: {
988
+ variant: "default",
989
+ size: "default",
990
+ disabled: !1
991
+ }
992
+ }
993
+ );
994
+ return (r, n) => (l(), f(or, P({
995
+ class: o(e),
996
+ disabled: r.disabled
997
+ }, s), {
998
+ default: m(() => [
999
+ _(r.$slots, "default")
1000
+ ]),
1001
+ _: 3
1002
+ }, 16, ["class", "disabled"]));
1003
+ }
1004
+ });
1005
+ function lr(t) {
1006
+ return typeof t == "object" && t !== null && "label" in t;
1007
+ }
1008
+ function oe(t, s) {
1009
+ const e = M.on(t, s);
1010
+ fe(() => e());
1011
+ }
1012
+ function st(t, s) {
1013
+ const e = ie("form", null), r = e == null ? void 0 : e.on("focus", (n) => t.name === n && s());
1014
+ fe(() => r == null ? void 0 : r());
1015
+ }
1016
+ function rt() {
1017
+ const t = Fe(), s = u(() => t.class);
1018
+ return [u(() => Dt(t, "class")), s];
1019
+ }
1020
+ function xa(t) {
1021
+ let s = zt;
1022
+ St(() => s = t()), fe(() => s());
1023
+ }
1024
+ function Sa(t, s) {
1025
+ const e = pe(O.get(t) ?? s);
1026
+ return He(e, () => O.set(t, kt(e))), e;
1027
+ }
1028
+ function ka(t) {
1029
+ const s = D(), e = u(t);
1030
+ return He(e, async () => s.value = await e.value, { immediate: !0 }), s;
1031
+ }
1032
+ function Ma(t, s) {
1033
+ const e = s ? t : {}, r = s ?? t, n = D(e.initial ?? null), a = jt((i) => n.value = i, e.delay ?? 300);
1034
+ return ce(() => a(r())), n;
1035
+ }
1036
+ const nt = /* @__PURE__ */ g({
1037
+ __name: "HeadlessSelectValue",
1038
+ setup(t) {
1039
+ const s = R(
1040
+ "select",
1041
+ "<HeadlessSelectValue> must be a child of a <HeadlessSelect>"
1042
+ );
1043
+ return (e, r) => e.$slots.default ? (l(), f(o(Be), {
1044
+ key: 0,
1045
+ placeholder: o(s).placeholder
1046
+ }, {
1047
+ default: m(() => [
1048
+ _(e.$slots, "default")
1049
+ ]),
1050
+ _: 3
1051
+ }, 8, ["placeholder"])) : (l(), f(o(Be), {
1052
+ key: 1,
1053
+ placeholder: o(s).placeholder
1054
+ }, null, 8, ["placeholder"]));
1055
+ }
1056
+ }), at = /* @__PURE__ */ g({
1057
+ __name: "HeadlessSelectTrigger",
1058
+ setup(t) {
1059
+ const s = R(
1060
+ "select",
1061
+ "<HeadlessSelectTrigger> must be a child of a <HeadlessSelect>"
1062
+ );
1063
+ return (e, r) => (l(), f(o(Yt), {
1064
+ id: o(s).id
1065
+ }, {
1066
+ default: m(() => [
1067
+ _(e.$slots, "default", {}, () => [
1068
+ h(nt, {
1069
+ placeholder: o(s).placeholder
1070
+ }, null, 8, ["placeholder"]),
1071
+ h(o(es))
1072
+ ])
1073
+ ]),
1074
+ _: 3
1075
+ }, 8, ["id"]));
1076
+ }
1077
+ }), ot = /* @__PURE__ */ g({
1078
+ __name: "HeadlessSelectOption",
1079
+ props: {
1080
+ value: {},
1081
+ disabled: { type: Boolean },
1082
+ textValue: {},
1083
+ asChild: { type: Boolean },
1084
+ as: {}
1085
+ },
1086
+ setup(t) {
1087
+ const s = R(
1088
+ "select",
1089
+ "<HeadlessSelectOption> must be a child of a <HeadlessSelect>"
1090
+ ), e = u(() => {
1091
+ var n;
1092
+ const r = (n = s.options) == null ? void 0 : n.find((a) => a.value === t.value);
1093
+ return r ? r.label : j(t.value);
1094
+ });
1095
+ return (r, n) => (l(), f(o(ts), ee(te(r.$props)), {
1096
+ default: m(() => [
1097
+ h(o(ss), null, {
1098
+ default: m(() => [
1099
+ _(r.$slots, "default", {}, () => [
1100
+ V(S(e.value), 1)
1101
+ ])
1102
+ ]),
1103
+ _: 3
1104
+ })
1105
+ ]),
1106
+ _: 3
1107
+ }, 16));
1108
+ }
1109
+ }), lt = /* @__PURE__ */ g({
1110
+ __name: "HeadlessSelectOptions",
1111
+ props: {
1112
+ class: {},
1113
+ innerClass: {}
1114
+ },
1115
+ setup(t) {
1116
+ const s = R(
1117
+ "select",
1118
+ "<HeadlessSelectOptions> must be a child of a <HeadlessSelect>"
1119
+ );
1120
+ return (e, r) => (l(), f(o(rs), null, {
1121
+ default: m(() => [
1122
+ h(o(ns), {
1123
+ position: "popper",
1124
+ class: k(e.$props.class),
1125
+ align: o(s).align,
1126
+ side: o(s).side
1127
+ }, {
1128
+ default: m(() => [
1129
+ h(o(as), {
1130
+ class: k(e.innerClass)
1131
+ }, {
1132
+ default: m(() => [
1133
+ _(e.$slots, "default", {}, () => [
1134
+ (l(!0), b(q, null, U(o(s).options ?? [], (n) => (l(), f(ot, {
1135
+ key: n.key,
1136
+ value: n.value
1137
+ }, null, 8, ["value"]))), 128))
1138
+ ])
1139
+ ]),
1140
+ _: 3
1141
+ }, 8, ["class"])
1142
+ ]),
1143
+ _: 3
1144
+ }, 8, ["class", "align", "side"])
1145
+ ]),
1146
+ _: 3
1147
+ }));
1148
+ }
1149
+ }), ir = /* @__PURE__ */ g({
1150
+ inheritAttrs: !1,
1151
+ __name: "HeadlessSelect",
1152
+ props: {
1153
+ as: { default: "div" },
1154
+ options: {},
1155
+ placeholder: {},
1156
+ renderOption: { type: Function },
1157
+ labelClass: {},
1158
+ optionsClass: {},
1159
+ align: {},
1160
+ side: {},
1161
+ name: {},
1162
+ label: {},
1163
+ description: {},
1164
+ modelValue: {}
1165
+ },
1166
+ emits: ["update:modelValue"],
1167
+ setup(t, { expose: s, emit: e }) {
1168
+ const r = e, n = ie("form", null), a = u(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue), i = u(() => a.value), c = u(() => !n || !t.name ? null : n.errors[t.name] ?? null), p = u(() => t.options ? t.options.map((v) => ({
1169
+ key: le(),
1170
+ label: t.renderOption ? t.renderOption(v) : lr(v) ? qt(v.label) : j(v),
1171
+ value: v
1172
+ })) : null), d = {
1173
+ labelClass: t.labelClass,
1174
+ optionsClass: t.optionsClass,
1175
+ align: t.align,
1176
+ side: t.side,
1177
+ value: a,
1178
+ id: `select-${le()}`,
1179
+ name: u(() => t.name),
1180
+ label: u(() => t.label),
1181
+ description: u(() => t.description),
1182
+ placeholder: u(() => t.placeholder ?? x("ui.select", "Select an option")),
1183
+ options: p,
1184
+ selectedOption: u(() => {
1185
+ var v;
1186
+ return (v = p.value) == null ? void 0 : v.find((C) => C.value === t.modelValue);
1187
+ }),
1188
+ errors: Le(c),
1189
+ required: u(() => {
1190
+ if (!(!t.name || !n))
1191
+ return n.getFieldRules(t.name).includes("required");
1192
+ }),
1193
+ update(v) {
1194
+ if (n && t.name) {
1195
+ n.setFieldValue(t.name, v);
1196
+ return;
1197
+ }
1198
+ r("update:modelValue", v);
1199
+ }
1200
+ };
1201
+ function w(v) {
1202
+ d.update(v);
1203
+ }
1204
+ return se("select", d), s(d), (v, C) => (l(), f(o(os), {
1205
+ "model-value": i.value,
1206
+ by: (T, ue) => T === ue,
1207
+ "onUpdate:modelValue": C[0] || (C[0] = (T) => w(T))
1208
+ }, {
1209
+ default: m(({ open: T }) => [
1210
+ (l(), f(W(v.as), ee(te(v.$attrs)), {
1211
+ default: m(() => [
1212
+ _(v.$slots, "default", {
1213
+ modelValue: v.modelValue,
1214
+ open: T
1215
+ }, () => [
1216
+ h(at),
1217
+ h(lt)
1218
+ ])
1219
+ ]),
1220
+ _: 2
1221
+ }, 1040))
1222
+ ]),
1223
+ _: 3
1224
+ }, 8, ["model-value", "by"]));
1225
+ }
1226
+ }), ze = /* @__PURE__ */ g({
1227
+ __name: "HeadlessSelectLabel",
1228
+ props: {
1229
+ asChild: { type: Boolean },
1230
+ as: {}
1231
+ },
1232
+ setup(t) {
1233
+ const s = R(
1234
+ "select",
1235
+ "<HeadlessSelectLabel> must be a child of a <HeadlessSelect>"
1236
+ ), e = Ee(), r = u(() => !!(s.label || e.default));
1237
+ return (n, a) => r.value ? (l(), f(o(ls), P({
1238
+ key: 0,
1239
+ for: o(s).id
1240
+ }, n.$props), {
1241
+ default: m(() => [
1242
+ _(n.$slots, "default", {}, () => [
1243
+ V(S(o(s).label), 1)
1244
+ ])
1245
+ ]),
1246
+ _: 3
1247
+ }, 16, ["for"])) : E("", !0);
1248
+ }
1249
+ }), it = /* @__PURE__ */ g({
1250
+ __name: "SelectLabel",
1251
+ setup(t) {
1252
+ const s = R("select", "<SelectLabel> must be a child of a <Select>"), e = u(() => H("block text-sm leading-6 font-medium text-gray-900", s.labelClass));
1253
+ return (r, n) => r.$slots.default ? (l(), f(ze, {
1254
+ key: 0,
1255
+ class: k(e.value)
1256
+ }, {
1257
+ default: m(() => [
1258
+ _(r.$slots, "default")
1259
+ ]),
1260
+ _: 3
1261
+ }, 8, ["class"])) : (l(), f(ze, {
1262
+ key: 1,
1263
+ class: k(e.value)
1264
+ }, null, 8, ["class"]));
1265
+ }
1266
+ }), cr = /* @__PURE__ */ g({
1267
+ __name: "SelectOption",
1268
+ props: {
1269
+ value: {},
1270
+ class: {},
1271
+ innerClass: {}
1272
+ },
1273
+ setup(t) {
1274
+ const s = u(() => H("group p-1 outline-none", t.class)), e = u(() => H(
1275
+ // eslint-disable-next-line vue/max-len
1276
+ "relative flex max-w-[calc(100vw-2rem)] cursor-pointer items-center truncate rounded-md gap-2 px-2 py-1 text-sm select-none *:truncate group-data-[highlighted]:bg-gray-100 group-data-[state=checked]:font-semibold group-data-[state=unchecked]:opacity-50",
1277
+ t.innerClass
1278
+ ));
1279
+ return (r, n) => (l(), f(ot, {
1280
+ class: k(s.value),
1281
+ value: r.value
1282
+ }, {
1283
+ default: m(() => [
1284
+ y("div", {
1285
+ class: k(e.value)
1286
+ }, [
1287
+ _(r.$slots, "default")
1288
+ ], 2)
1289
+ ]),
1290
+ _: 3
1291
+ }, 8, ["class", "value"]));
1292
+ }
1293
+ }), ct = /* @__PURE__ */ g({
1294
+ __name: "SelectOptions",
1295
+ props: {
1296
+ class: {}
1297
+ },
1298
+ setup(t) {
1299
+ const s = R("select", "<SelectOptions> must be a child of a <Select>"), e = u(() => H(
1300
+ "z-50 overflow-auto rounded-lg bg-white text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden",
1301
+ s.optionsClass,
1302
+ t.class
1303
+ ));
1304
+ return (r, n) => (l(), f(lt, {
1305
+ class: k(e.value)
1306
+ }, {
1307
+ default: m(() => [
1308
+ _(r.$slots, "default", {}, () => {
1309
+ var a;
1310
+ return [
1311
+ (l(!0), b(q, null, U(((a = o(s)) == null ? void 0 : a.options) ?? [], (i) => (l(), f(cr, {
1312
+ key: i.key,
1313
+ value: i.value
1314
+ }, {
1315
+ default: m(() => [
1316
+ V(S(i.label), 1)
1317
+ ]),
1318
+ _: 2
1319
+ }, 1032, ["value"]))), 128))
1320
+ ];
1321
+ })
1322
+ ]),
1323
+ _: 3
1324
+ }, 8, ["class"]));
1325
+ }
1326
+ }), ur = {
1327
+ viewBox: "0 0 20 20",
1328
+ width: "1.2em",
1329
+ height: "1.2em"
1330
+ };
1331
+ function dr(t, s) {
1332
+ return l(), b("svg", ur, s[0] || (s[0] = [
1333
+ y("path", {
1334
+ fill: "currentColor",
1335
+ d: "m9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828L5.757 6.586L4.343 8z"
1336
+ }, null, -1)
1337
+ ]));
1338
+ }
1339
+ const pr = { name: "zondicons-cheveron-down", render: dr }, ut = /* @__PURE__ */ g({
1340
+ __name: "SelectTrigger",
1341
+ props: {
1342
+ class: {}
1343
+ },
1344
+ setup(t) {
1345
+ const s = R("select", "<SelectTrigger> must be a child of a <Select>"), e = u(() => H(
1346
+ // eslint-disable-next-line vue/max-len
1347
+ "focus:outline-primary-600 grid w-full cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 sm:text-sm/6",
1348
+ { "mt-1": s.label },
1349
+ t.class
1350
+ ));
1351
+ return (r, n) => (l(), f(at, {
1352
+ class: k(e.value)
1353
+ }, {
1354
+ default: m(() => [
1355
+ h(nt, { class: "col-start-1 row-start-1 truncate pr-6" }),
1356
+ h(o(pr), { class: "col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4" })
1357
+ ]),
1358
+ _: 1
1359
+ }, 8, ["class"]));
1360
+ }
1361
+ }), mr = /* @__PURE__ */ g({
1362
+ __name: "Select",
1363
+ props: {
1364
+ as: {},
1365
+ options: {},
1366
+ placeholder: {},
1367
+ renderOption: { type: Function },
1368
+ labelClass: {},
1369
+ optionsClass: {},
1370
+ align: {},
1371
+ side: {},
1372
+ name: {},
1373
+ label: {},
1374
+ description: {},
1375
+ modelValue: {}
1376
+ },
1377
+ emits: ["update:modelValue"],
1378
+ setup(t) {
1379
+ const { forwardRef: s } = Te();
1380
+ return (e, r) => (l(), f(ir, P({ ref: o(s) }, e.$props, {
1381
+ "onUpdate:modelValue": r[0] || (r[0] = (n) => e.$emit("update:modelValue", n))
1382
+ }), {
1383
+ default: m(() => [
1384
+ h(it),
1385
+ _(e.$slots, "default", {}, () => [
1386
+ h(ut),
1387
+ h(ct)
1388
+ ])
1389
+ ]),
1390
+ _: 3
1391
+ }, 16));
1392
+ }
1393
+ }), fr = { class: "grow" }, hr = /* @__PURE__ */ g({
1394
+ __name: "Language",
1395
+ setup(t) {
1396
+ const s = J.getBrowserLocale(), e = u(() => [null, ...J.locales]);
1397
+ function r(n) {
1398
+ return (n && N.locales[n]) ?? x("settings.localeDefault", "{locale} (default)", {
1399
+ locale: N.locales[s] ?? s
1400
+ });
1401
+ }
1402
+ return (n, a) => (l(), f(mr, {
1403
+ modelValue: n.$lang.locale,
1404
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => n.$lang.locale = i),
1405
+ class: "flex flex-col items-start md:flex-row",
1406
+ as: "div",
1407
+ options: e.value,
1408
+ "render-option": r
1409
+ }, {
1410
+ default: m(() => [
1411
+ y("div", fr, [
1412
+ h(it, null, {
1413
+ default: m(() => [
1414
+ V(S(n.$td("settings.locale", "Language")), 1)
1415
+ ]),
1416
+ _: 1
1417
+ }),
1418
+ h(A, {
1419
+ "lang-key": "settings.localeDescription",
1420
+ "lang-default": "Choose the application's language.",
1421
+ class: "mt-1 text-sm text-gray-500"
1422
+ })
1423
+ ]),
1424
+ h(B, {
1425
+ variant: "ghost",
1426
+ as: ut,
1427
+ class: "grid w-auto outline-none"
1428
+ }),
1429
+ h(ct)
1430
+ ]),
1431
+ _: 1
1432
+ }, 8, ["modelValue", "options"]));
1433
+ }
1434
+ }), gr = [
1435
+ {
1436
+ priority: 100,
1437
+ component: hr
1438
+ }
1439
+ ], vr = { $lang: J }, br = {
1440
+ async install(t) {
1441
+ var s;
1442
+ (s = t.config.globalProperties).$t ?? (s.$t = Xe), t.config.globalProperties.$td = x, gr.forEach((e) => z.addSetting(e)), await be(t, vr);
1443
+ }
1444
+ }, yr = {
1445
+ async install() {
1446
+ Re() && (globalThis.testingRuntime = {
1447
+ on: (...t) => M.on(...t)
1448
+ });
1449
+ }
1450
+ }, _r = {
1451
+ viewBox: "0 0 20 20",
1452
+ width: "1.2em",
1453
+ height: "1.2em"
1454
+ };
1455
+ function wr(t, s) {
1456
+ return l(), b("svg", _r, s[0] || (s[0] = [
1457
+ y("path", {
1458
+ fill: "currentColor",
1459
+ d: "M10 8.586L2.929 1.515L1.515 2.929L8.586 10l-7.071 7.071l1.414 1.414L10 11.414l7.071 7.071l1.414-1.414L11.414 10l7.071-7.071l-1.414-1.414z"
1460
+ }, null, -1)
1461
+ ]));
1462
+ }
1463
+ const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1464
+ __name: "HeadlessModal",
1465
+ props: {
1466
+ persistent: { type: Boolean },
1467
+ title: {},
1468
+ titleHidden: { type: Boolean },
1469
+ description: {},
1470
+ descriptionHidden: { type: Boolean }
1471
+ },
1472
+ setup(t, { expose: s }) {
1473
+ const e = D(null), { modal: r } = R(
1474
+ "modal",
1475
+ "could not obtain modal reference from <HeadlessModal>, did you render this component manually? Show it using $ui.openModal() instead"
1476
+ );
1477
+ s({ close: w, $content: e });
1478
+ const { forwardRef: n, currentElement: a } = Te(), i = D(!0), c = D(!1);
1479
+ se("$modalContentRef", e), oe("close-modal", async ({ id: v, result: C }) => {
1480
+ v === r.id && await w(C);
1481
+ }), oe("hide-modal", async ({ id: v }) => {
1482
+ v === r.id && await p();
1483
+ }), oe("show-modal", async ({ id: v }) => {
1484
+ v === r.id && await d();
1485
+ });
1486
+ async function p() {
1487
+ a.value && (i.value = !0);
1488
+ }
1489
+ async function d() {
1490
+ a.value && (i.value = !1);
1491
+ }
1492
+ async function w(v) {
1493
+ c.value || (M.emit("modal-will-close", { modal: r, result: v }), await p(), c.value = !0, M.emit("modal-closed", { modal: r, result: v }));
1494
+ }
1495
+ return (v, C) => (l(), f(o(is), {
1496
+ ref: o(n),
1497
+ open: "",
1498
+ "onUpdate:open": C[0] || (C[0] = (T) => v.persistent || w())
1499
+ }, {
1500
+ default: m(() => [
1501
+ h(o(cs), null, {
1502
+ default: m(() => [
1503
+ _(v.$slots, "default", { close: w })
1504
+ ]),
1505
+ _: 3
1506
+ })
1507
+ ]),
1508
+ _: 3
1509
+ }, 512));
1510
+ }
1511
+ }), dt = /* @__PURE__ */ g({
1512
+ __name: "ModalContext",
1513
+ props: {
1514
+ modal: {},
1515
+ childIndex: {}
1516
+ },
1517
+ setup(t) {
1518
+ const s = t, e = u(() => {
1519
+ const r = {};
1520
+ for (const n in s.modal.properties)
1521
+ r[n] = o(s.modal.properties[n]);
1522
+ return r;
1523
+ });
1524
+ return se("modal", {
1525
+ modal: Ie(s, "modal"),
1526
+ childIndex: Ie(s, "childIndex")
1527
+ }), (r, n) => (l(), f(W(r.modal.component), ee(te(e.value)), null, 16));
1528
+ }
1529
+ }), xr = /* @__PURE__ */ g({
1530
+ __name: "HeadlessModalContent",
1531
+ setup(t) {
1532
+ const { childIndex: s = 0 } = R(
1533
+ "modal",
1534
+ "could not obtain modal reference from <HeadlessModalContent>, did you render this component manually? Show it using $ui.openModal() instead"
1535
+ ), e = Vs("$modalContentRef"), r = re("$contentRef"), n = u(() => I.modals[s] ?? null);
1536
+ return ce(() => e.value = r.value), (a, i) => (l(), f(o(us), { ref: "$contentRef" }, {
1537
+ default: m(() => [
1538
+ _(a.$slots, "default"),
1539
+ n.value ? (l(), f(dt, {
1540
+ key: 0,
1541
+ "child-index": o(s) + 1,
1542
+ modal: n.value
1543
+ }, null, 8, ["child-index", "modal"])) : E("", !0)
1544
+ ]),
1545
+ _: 3
1546
+ }, 512));
1547
+ }
1548
+ }), Sr = /* @__PURE__ */ g({
1549
+ __name: "HeadlessModalDescription",
1550
+ props: {
1551
+ asChild: { type: Boolean },
1552
+ as: {}
1553
+ },
1554
+ setup(t) {
1555
+ return (s, e) => (l(), f(o(ds), ee(te(s.$props)), {
1556
+ default: m(() => [
1557
+ _(s.$slots, "default")
1558
+ ]),
1559
+ _: 3
1560
+ }, 16));
1561
+ }
1562
+ }), kr = /* @__PURE__ */ g({
1563
+ __name: "HeadlessModalOverlay",
1564
+ props: {
1565
+ forceMount: { type: Boolean },
1566
+ asChild: { type: Boolean },
1567
+ as: {}
1568
+ },
1569
+ setup(t) {
1570
+ return (s, e) => (l(), f(o(ps), ee(te(s.$props)), {
1571
+ default: m(() => [
1572
+ _(s.$slots, "default")
1573
+ ]),
1574
+ _: 3
1575
+ }, 16));
1576
+ }
1577
+ }), Mr = /* @__PURE__ */ g({
1578
+ __name: "HeadlessModalTitle",
1579
+ props: {
1580
+ asChild: { type: Boolean },
1581
+ as: {}
1582
+ },
1583
+ setup(t) {
1584
+ return (s, e) => (l(), f(o(ms), ee(te(s.$props)), {
1585
+ default: m(() => [
1586
+ _(s.$slots, "default")
1587
+ ]),
1588
+ _: 3
1589
+ }, 16));
1590
+ }
1591
+ }), Er = {
1592
+ key: 0,
1593
+ class: "absolute top-0 right-0 hidden pt-1.5 pr-1.5 sm:block"
1594
+ }, Hr = { class: "sr-only" }, ne = /* @__PURE__ */ g({
1595
+ __name: "Modal",
1596
+ props: {
1597
+ persistent: { type: Boolean },
1598
+ title: {},
1599
+ titleHidden: { type: Boolean },
1600
+ description: {},
1601
+ descriptionHidden: { type: Boolean },
1602
+ dismissable: { type: Boolean, default: !0 },
1603
+ wrapperClass: { default: "" },
1604
+ class: { default: "" }
1605
+ },
1606
+ setup(t, { expose: s }) {
1607
+ const e = Y(t, ["class", "dismissable", "wrapperClass", "title", "titleHidden", "description", "persistent"]);
1608
+ s({
1609
+ close: async (d) => {
1610
+ var w;
1611
+ return (w = a.value) == null ? void 0 : w.close(d);
1612
+ },
1613
+ $content: u(() => {
1614
+ var d;
1615
+ return (d = a.value) == null ? void 0 : d.$content;
1616
+ })
1617
+ });
1618
+ const { forwardRef: r, currentRef: n } = Te(), a = n, i = u(() => t.description ? {} : { "aria-describedby": void 0 }), c = u(() => H({ "mt-2": t.title && !t.titleHidden }, t.class)), p = u(() => H(
1619
+ // eslint-disable-next-line vue/max-len
1620
+ "fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:max-w-lg",
1621
+ t.wrapperClass
1622
+ ));
1623
+ return (d, w) => (l(), f(Cr, P(e, {
1624
+ ref: (v) => o(r)(v),
1625
+ persistent: d.persistent
1626
+ }), {
1627
+ default: m(({ close: v }) => [
1628
+ h(kr, { class: "fixed inset-0 bg-black/30" }),
1629
+ h(xr, P(i.value, { class: p.value }), {
1630
+ default: m(() => [
1631
+ !d.persistent && d.dismissable ? (l(), b("div", Er, [
1632
+ h(B, {
1633
+ variant: "ghost",
1634
+ size: "icon",
1635
+ onClick: (C) => v()
1636
+ }, {
1637
+ default: m(() => [
1638
+ y("span", Hr, S(d.$td("ui.close", "Close")), 1),
1639
+ h(o($r), { class: "size-3 text-gray-400" })
1640
+ ]),
1641
+ _: 2
1642
+ }, 1032, ["onClick"])
1643
+ ])) : E("", !0),
1644
+ d.title ? (l(), f(Mr, {
1645
+ key: 1,
1646
+ class: k(["text-base font-semibold text-gray-900", { "sr-only": d.titleHidden }])
1647
+ }, {
1648
+ default: m(() => [
1649
+ h(A, {
1650
+ text: d.title,
1651
+ inline: ""
1652
+ }, null, 8, ["text"])
1653
+ ]),
1654
+ _: 1
1655
+ }, 8, ["class"])) : E("", !0),
1656
+ d.description ? (l(), f(Sr, {
1657
+ key: 2,
1658
+ class: k({ "sr-only": d.descriptionHidden })
1659
+ }, {
1660
+ default: m(() => [
1661
+ h(A, {
1662
+ text: d.description,
1663
+ class: "mt-1 text-sm leading-6 text-gray-500"
1664
+ }, null, 8, ["text"])
1665
+ ]),
1666
+ _: 1
1667
+ }, 8, ["class"])) : E("", !0),
1668
+ y("div", {
1669
+ class: k(c.value)
1670
+ }, [
1671
+ _(d.$slots, "default", { close: v })
1672
+ ], 2)
1673
+ ]),
1674
+ _: 2
1675
+ }, 1040, ["class"])
1676
+ ]),
1677
+ _: 3
1678
+ }, 16, ["persistent"]));
1679
+ }
1680
+ }), Lr = /* @__PURE__ */ g({
1681
+ __name: "AlertModal",
1682
+ props: {
1683
+ title: {},
1684
+ message: {}
1685
+ },
1686
+ setup(t) {
1687
+ return (s, e) => (l(), f(ne, { title: s.title }, {
1688
+ default: m(() => [
1689
+ h(A, { text: s.message }, null, 8, ["text"])
1690
+ ]),
1691
+ _: 1
1692
+ }, 8, ["title"]));
1693
+ }
1694
+ }), pt = /* @__PURE__ */ g({
1695
+ __name: "Form",
1696
+ props: {
1697
+ form: {}
1698
+ },
1699
+ emits: ["submit"],
1700
+ setup(t, { emit: s }) {
1701
+ let e;
1702
+ const r = s;
1703
+ return ce((n) => {
1704
+ var a;
1705
+ e == null || e(), e = (a = t.form) == null ? void 0 : a.on("submit", () => r("submit")), n(() => e == null ? void 0 : e());
1706
+ }), se("form", t.form), (n, a) => (l(), b("form", {
1707
+ onSubmit: a[0] || (a[0] = Ue((i) => {
1708
+ var c;
1709
+ return (c = n.form) == null ? void 0 : c.submit();
1710
+ }, ["prevent"]))
1711
+ }, [
1712
+ _(n.$slots, "default")
1713
+ ], 32));
1714
+ }
1715
+ }), Rr = {
1716
+ required: (t) => t ? void 0 : "required"
1717
+ }, de = { ...Rr };
1718
+ function Ea(t, s) {
1719
+ de[t] = s;
1720
+ }
1721
+ function Tr(t, s) {
1722
+ var r;
1723
+ const e = (r = de[s]) == null ? void 0 : r.call(de, t);
1724
+ return e ? We(e) : [];
1725
+ }
1726
+ const F = {
1727
+ String: "string",
1728
+ Number: "number",
1729
+ Boolean: "boolean",
1730
+ Object: "object",
1731
+ Date: "date"
1732
+ }, je = /* @__PURE__ */ new WeakMap();
1733
+ class Pr extends Ne {
1734
+ constructor(e) {
1735
+ super();
1736
+ $(this, "errors");
1737
+ $(this, "_fields");
1738
+ $(this, "_data");
1739
+ $(this, "_submitted");
1740
+ $(this, "_errors");
1741
+ $(this, "_listeners", {});
1742
+ this._fields = e, this._submitted = D(!1), this._data = this.getInitialData(e), this._errors = this.getInitialErrors(e), je.set(
1743
+ this,
1744
+ u(() => !Object.values(this._errors).some((r) => r !== null))
1745
+ ), this.errors = Le(this._errors);
1746
+ }
1747
+ get valid() {
1748
+ var e;
1749
+ return !!((e = je.get(this)) != null && e.value);
1750
+ }
1751
+ get submitted() {
1752
+ return this._submitted.value;
1753
+ }
1754
+ setFieldValue(e, r) {
1755
+ const n = this._fields[e] ?? Q(`Trying to set undefined '${j(e)}' field`);
1756
+ this._data[e] = n.type === F.String && (n.trim ?? !0) ? j(r).trim() : r, this._submitted.value && this.validate();
1757
+ }
1758
+ getFieldValue(e) {
1759
+ return this._data[e];
1760
+ }
1761
+ getFieldRules(e) {
1762
+ var r, n;
1763
+ return ((n = (r = this._fields[e]) == null ? void 0 : r.rules) == null ? void 0 : n.split("|")) ?? [];
1764
+ }
1765
+ data() {
1766
+ return { ...this._data };
1767
+ }
1768
+ validate() {
1769
+ const e = Object.entries(this._fields).reduce(
1770
+ (r, [n, a]) => (r[n] = this.getFieldErrors(n, a), r),
1771
+ {}
1772
+ );
1773
+ return this.resetErrors(e), this.valid;
1774
+ }
1775
+ reset(e = {}) {
1776
+ this._submitted.value = !1, e.keepData || this.resetData(), e.keepErrors || this.resetErrors();
1777
+ }
1778
+ submit() {
1779
+ var r;
1780
+ this._submitted.value = !0;
1781
+ const e = this.validate();
1782
+ return e && ((r = this._listeners.submit) == null || r.forEach((n) => n())), e;
1783
+ }
1784
+ on(e, r) {
1785
+ var n, a;
1786
+ return (n = this._listeners)[e] ?? (n[e] = []), (a = this._listeners[e]) == null || a.push(r), () => this.off(e, r);
1787
+ }
1788
+ off(e, r) {
1789
+ Ce(this._listeners[e] ?? [], r);
1790
+ }
1791
+ async focus(e) {
1792
+ var r;
1793
+ await qe(), (r = this._listeners.focus) == null || r.forEach((n) => n(e));
1794
+ }
1795
+ __get(e) {
1796
+ return e in this._fields ? this.getFieldValue(e) : super.__get(e);
1797
+ }
1798
+ __set(e, r) {
1799
+ if (!(e in this._fields)) {
1800
+ super.__set(e, r);
1801
+ return;
1802
+ }
1803
+ this.setFieldValue(e, r);
1804
+ }
1805
+ getFieldErrors(e, r) {
1806
+ var c;
1807
+ const n = [], a = this._data[e], i = ((c = r.rules) == null ? void 0 : c.split("|")) ?? [];
1808
+ for (const p of i)
1809
+ p !== "required" && a == null || n.push(...Tr(a, p));
1810
+ return n.length > 0 ? n : null;
1811
+ }
1812
+ getInitialData(e) {
1813
+ if (this.static().isConjuring())
1814
+ return {};
1815
+ const r = Object.entries(e).reduce((n, [a, i]) => (n[a] = i.default ?? null, n), {});
1816
+ return pe(r);
1817
+ }
1818
+ getInitialErrors(e) {
1819
+ if (this.static().isConjuring())
1820
+ return {};
1821
+ const r = Object.keys(e).reduce((n, a) => (n[a] = null, n), {});
1822
+ return pe(r);
1823
+ }
1824
+ resetData() {
1825
+ for (const [e, r] of Object.entries(this._fields))
1826
+ this._data[e] = r.default ?? null;
1827
+ }
1828
+ resetErrors(e) {
1829
+ Object.keys(this._errors).forEach((r) => delete this._errors[r]), e && Object.assign(this._errors, e);
1830
+ }
1831
+ }
1832
+ function mt(t) {
1833
+ return new Pr(t);
1834
+ }
1835
+ function Ha(t, s = {}) {
1836
+ return {
1837
+ default: t,
1838
+ type: F.Boolean,
1839
+ rules: s.rules
1840
+ };
1841
+ }
1842
+ function La(t, s = {}) {
1843
+ return {
1844
+ default: t,
1845
+ type: F.Date,
1846
+ rules: s.rules
1847
+ };
1848
+ }
1849
+ function Ra(t) {
1850
+ return {
1851
+ default: t,
1852
+ type: F.Boolean,
1853
+ rules: "required"
1854
+ };
1855
+ }
1856
+ function Ta(t) {
1857
+ return {
1858
+ default: t,
1859
+ type: F.Date,
1860
+ rules: "required"
1861
+ };
1862
+ }
1863
+ function Pa(t) {
1864
+ return {
1865
+ default: t,
1866
+ type: F.Number,
1867
+ rules: "required"
1868
+ };
1869
+ }
1870
+ function Ir(t) {
1871
+ return {
1872
+ default: t,
1873
+ type: F.String,
1874
+ rules: "required"
1875
+ };
1876
+ }
1877
+ function Ia(t, s = {}) {
1878
+ return {
1879
+ default: t,
1880
+ type: F.Number,
1881
+ rules: s.rules
1882
+ };
1883
+ }
1884
+ function Va(t, s = {}) {
1885
+ return {
1886
+ default: t,
1887
+ type: F.String,
1888
+ rules: s.rules
1889
+ };
1890
+ }
1891
+ function Vr(t) {
1892
+ const s = mt(
1893
+ Object.entries(t.checkboxes ?? {}).reduce(
1894
+ (n, [a, i]) => ({
1895
+ [a]: {
1896
+ type: F.Boolean,
1897
+ default: i.default,
1898
+ required: i.required ? "required" : void 0
1899
+ },
1900
+ ...n
1901
+ }),
1902
+ {}
1903
+ )
1904
+ ), e = u(() => t.acceptText ?? x("ui.accept", "Ok")), r = u(() => t.cancelText ?? x("ui.cancel", "Cancel"));
1905
+ return { form: s, renderedAcceptText: e, renderedCancelText: r };
1906
+ }
1907
+ const Ar = {
1908
+ key: 0,
1909
+ class: "mt-4 flex flex-col text-sm text-gray-600"
1910
+ }, Br = { class: "flex items-center" }, Dr = ["onUpdate:modelValue", "required"], zr = { class: "ml-1.5" }, jr = { class: "mt-4 flex flex-row-reverse gap-2" }, qr = /* @__PURE__ */ g({
1911
+ __name: "ConfirmModal",
1912
+ props: {
1913
+ title: {},
1914
+ message: {},
1915
+ acceptText: {},
1916
+ acceptVariant: {},
1917
+ cancelText: {},
1918
+ cancelVariant: { default: "secondary" },
1919
+ checkboxes: {},
1920
+ actions: {},
1921
+ required: { type: Boolean }
1922
+ },
1923
+ setup(t) {
1924
+ const s = Y(t, ["cancelVariant"]), { form: e, renderedAcceptText: r, renderedCancelText: n } = Vr(s);
1925
+ return (a, i) => (l(), f(ne, {
1926
+ title: a.title,
1927
+ persistent: ""
1928
+ }, {
1929
+ default: m(({ close: c }) => [
1930
+ h(pt, {
1931
+ form: o(e),
1932
+ onSubmit: (p) => c([!0, o(e).data()])
1933
+ }, {
1934
+ default: m(() => [
1935
+ h(A, {
1936
+ text: a.message,
1937
+ actions: a.actions
1938
+ }, null, 8, ["text", "actions"]),
1939
+ a.checkboxes ? (l(), b("ul", Ar, [
1940
+ (l(!0), b(q, null, U(a.checkboxes, (p, d) => (l(), b("li", { key: d }, [
1941
+ y("label", Br, [
1942
+ Oe(y("input", {
1943
+ "onUpdate:modelValue": (w) => o(e)[d] = w,
1944
+ type: "checkbox",
1945
+ required: p.required,
1946
+ class: "border-primary-600 text-primary-600 hover:bg-primary-50 hover:checked:bg-primary-500 focus:ring-primary-600 focus-visible:ring-primary-600 rounded border-2"
1947
+ }, null, 8, Dr), [
1948
+ [Mt, o(e)[d]]
1949
+ ]),
1950
+ y("span", zr, S(p.label), 1)
1951
+ ])
1952
+ ]))), 128))
1953
+ ])) : E("", !0),
1954
+ y("div", jr, [
1955
+ h(B, {
1956
+ variant: a.acceptVariant,
1957
+ submit: ""
1958
+ }, {
1959
+ default: m(() => [
1960
+ V(S(o(r)), 1)
1961
+ ]),
1962
+ _: 1
1963
+ }, 8, ["variant"]),
1964
+ a.required ? E("", !0) : (l(), f(B, {
1965
+ key: 0,
1966
+ variant: a.cancelVariant,
1967
+ onClick: (p) => c(!1)
1968
+ }, {
1969
+ default: m(() => [
1970
+ V(S(o(n)), 1)
1971
+ ]),
1972
+ _: 2
1973
+ }, 1032, ["variant", "onClick"]))
1974
+ ])
1975
+ ]),
1976
+ _: 2
1977
+ }, 1032, ["form", "onSubmit"])
1978
+ ]),
1979
+ _: 1
1980
+ }, 8, ["title"]));
1981
+ }
1982
+ }), Fr = {
1983
+ viewBox: "0 0 20 20",
1984
+ width: "1.2em",
1985
+ height: "1.2em"
1986
+ };
1987
+ function Ur(t, s) {
1988
+ return l(), b("svg", Fr, s[0] || (s[0] = [
1989
+ y("path", {
1990
+ fill: "currentColor",
1991
+ d: "M7.05 9.293L6.343 10L12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z"
1992
+ }, null, -1)
1993
+ ]));
1994
+ }
1995
+ const Or = { name: "zondicons-cheveron-left", render: Ur }, Nr = {
1996
+ viewBox: "0 0 20 20",
1997
+ width: "1.2em",
1998
+ height: "1.2em"
1999
+ };
2000
+ function Wr(t, s) {
2001
+ return l(), b("svg", Nr, s[0] || (s[0] = [
2002
+ y("path", {
2003
+ fill: "currentColor",
2004
+ d: "m12.95 10.707l.707-.707L8 4.343L6.586 5.757L10.828 10l-4.242 4.243L8 15.657z"
2005
+ }, null, -1)
2006
+ ]));
2007
+ }
2008
+ const ft = { name: "zondicons-cheveron-right", render: Wr }, Kr = {
2009
+ viewBox: "0 0 20 20",
2010
+ width: "1.2em",
2011
+ height: "1.2em"
2012
+ };
2013
+ function Qr(t, s) {
2014
+ return l(), b("svg", Kr, s[0] || (s[0] = [
2015
+ y("path", {
2016
+ fill: "currentColor",
2017
+ d: "M2.93 17.07A10 10 0 1 1 17.07 2.93A10 10 0 0 1 2.93 17.07M9 5v6h2V5zm0 8v2h2v-2z"
2018
+ }, null, -1)
2019
+ ]));
2020
+ }
2021
+ const ht = { name: "zondicons-exclamation-solid", render: Qr }, Jr = {
2022
+ viewBox: "0 0 24 24",
2023
+ width: "1.2em",
2024
+ height: "1.2em"
2025
+ };
2026
+ function Zr(t, s) {
2027
+ return l(), b("svg", Jr, s[0] || (s[0] = [
2028
+ y("path", {
2029
+ fill: "currentColor",
2030
+ d: "M20 19V7H4v12zm0-16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-7 14v-2h5v2zm-3.42-4L5.57 9H8.4l3.3 3.3c.39.39.39 1.03 0 1.42L8.42 17H5.59z"
2031
+ }, null, -1)
2032
+ ]));
2033
+ }
2034
+ const Gr = { name: "mdi-console", render: Zr }, Xr = {
2035
+ viewBox: "0 0 20 20",
2036
+ width: "1.2em",
2037
+ height: "1.2em"
2038
+ };
2039
+ function Yr(t, s) {
2040
+ return l(), b("svg", Xr, s[0] || (s[0] = [
2041
+ y("path", {
2042
+ fill: "currentColor",
2043
+ d: "M6 6V2c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-4v4a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2zm2 0h4a2 2 0 0 1 2 2v4h4V2H8zM2 8v10h10V8z"
2044
+ }, null, -1)
2045
+ ]));
2046
+ }
2047
+ const en = { name: "zondicons-copy", render: Yr }, tn = {
2048
+ viewBox: "0 0 24 24",
2049
+ width: "1.2em",
2050
+ height: "1.2em"
2051
+ };
2052
+ function sn(t, s) {
2053
+ return l(), b("svg", tn, s[0] || (s[0] = [
2054
+ y("path", {
2055
+ fill: "currentColor",
2056
+ d: "M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
2057
+ }, null, -1)
2058
+ ]));
2059
+ }
2060
+ const rn = { name: "mdi-github", render: sn }, nn = { class: "flex" }, an = { class: "sr-only" }, on = /* @__PURE__ */ g({
2061
+ __name: "ErrorReportModalButtons",
2062
+ props: {
2063
+ report: {}
2064
+ },
2065
+ setup(t) {
2066
+ const s = t, e = u(() => s.report.description ? `${s.report.title}: ${s.report.description}` : s.report.title), r = u(() => {
2067
+ if (!z.sourceUrl)
2068
+ return !1;
2069
+ const a = encodeURIComponent(e.value), i = encodeURIComponent(
2070
+ [
2071
+ "[Please, explain here what you were trying to do when this error appeared]",
2072
+ "",
2073
+ "Error details:",
2074
+ "```",
2075
+ Ft(
2076
+ s.report.details ?? "Details missing from report",
2077
+ 1800 - a.length - z.sourceUrl.length
2078
+ ).trim(),
2079
+ "```"
2080
+ ].join(`
2081
+ `)
2082
+ );
2083
+ return `${z.sourceUrl}/issues/new?title=${a}&body=${i}`;
2084
+ }), n = u(() => Z(
2085
+ [
2086
+ {
2087
+ id: "clipboard",
2088
+ description: "Copy to clipboard",
2089
+ iconComponent: en,
2090
+ async click() {
2091
+ await navigator.clipboard.writeText(`${e.value}
2092
+
2093
+ ${s.report.details}`), I.toast(x("errors.copiedToClipboard", "Debug information copied to clipboard"));
2094
+ }
2095
+ },
2096
+ {
2097
+ id: "console",
2098
+ description: "Log to console",
2099
+ iconComponent: Gr,
2100
+ click() {
2101
+ const a = s.report.error ?? s.report;
2102
+ window.error = a, console.error(a), I.toast(
2103
+ x(
2104
+ "errors.addedToConsole",
2105
+ "You can now use the **error** variable in the console"
2106
+ )
2107
+ );
2108
+ }
2109
+ }
2110
+ ],
2111
+ (a) => {
2112
+ r.value && a.push({
2113
+ id: "github",
2114
+ description: "Report in GitHub",
2115
+ iconComponent: rn,
2116
+ url: r.value
2117
+ });
2118
+ }
2119
+ ));
2120
+ return (a, i) => (l(), b("div", nn, [
2121
+ (l(!0), b(q, null, U(n.value, (c) => _(a.$slots, "default", P({ ref_for: !0 }, c), () => [
2122
+ h(B, {
2123
+ size: "icon",
2124
+ variant: "ghost",
2125
+ class: "group whitespace-nowrap",
2126
+ href: c.url,
2127
+ title: a.$td(`errors.report_${c.id}`, c.description),
2128
+ onClick: c.click
2129
+ }, {
2130
+ default: m(() => [
2131
+ y("span", an, S(a.$td(`errors.report_${c.id}`, c.description)), 1),
2132
+ (l(), f(W(c.iconComponent), {
2133
+ class: "size-4",
2134
+ "aria-hidden": "true"
2135
+ }))
2136
+ ]),
2137
+ _: 2
2138
+ }, 1032, ["href", "title", "onClick"])
2139
+ ])), 256))
2140
+ ]));
2141
+ }
2142
+ }), ln = /* @__PURE__ */ g({
2143
+ __name: "ErrorReportModalTitle",
2144
+ props: {
2145
+ report: {},
2146
+ currentReport: {},
2147
+ totalReports: {}
2148
+ },
2149
+ setup(t) {
2150
+ const s = u(() => !t.totalReports || t.totalReports <= 1 ? t.report.title : `${t.report.title} (${t.currentReport}/${t.totalReports})`);
2151
+ return (e, r) => (l(), f(A, {
2152
+ text: s.value,
2153
+ inline: ""
2154
+ }, null, 8, ["text"]));
2155
+ }
2156
+ });
2157
+ function cn(t) {
2158
+ const s = D(0), e = u(() => t.reports[s.value]), r = u(
2159
+ () => {
2160
+ var i;
2161
+ return ((i = e.value.details) == null ? void 0 : i.trim()) || x("errors.detailsEmpty", "This error is missing a stacktrace.");
2162
+ }
2163
+ ), n = x("errors.previousReport", "Show previous report"), a = x("errors.nextReport", "Show next report");
2164
+ return {
2165
+ activeReportIndex: s,
2166
+ details: r,
2167
+ nextReportText: a,
2168
+ previousReportText: n,
2169
+ report: e
2170
+ };
2171
+ }
2172
+ const un = { class: "px-4 pt-5 pb-4" }, dn = { class: "flex justify-between gap-4" }, pn = { class: "flex items-center gap-2" }, mn = {
2173
+ key: 0,
2174
+ class: "flex gap-0.5"
2175
+ }, fn = { class: "-mt-2 max-h-[80vh] overflow-auto bg-red-800/10" }, hn = ["textContent"], gn = /* @__PURE__ */ g({
2176
+ __name: "ErrorReportModal",
2177
+ props: {
2178
+ reports: {}
2179
+ },
2180
+ setup(t) {
2181
+ const s = t, { activeReportIndex: e, details: r, nextReportText: n, previousReportText: a, report: i } = cn(s);
2182
+ return (c, p) => (l(), f(ne, { "wrapper-class": "p-0 sm:w-auto sm:min-w-lg sm:max-w-[80vw]" }, {
2183
+ default: m(() => [
2184
+ y("div", un, [
2185
+ y("h2", dn, [
2186
+ y("div", pn, [
2187
+ h(o(ht), { class: "size-5 text-red-600" }),
2188
+ h(ln, {
2189
+ class: "text-lg leading-6 font-semibold text-gray-900",
2190
+ report: o(i),
2191
+ "current-report": o(e) + 1,
2192
+ "total-reports": c.reports.length
2193
+ }, null, 8, ["report", "current-report", "total-reports"]),
2194
+ c.reports.length > 1 ? (l(), b("span", mn, [
2195
+ h(B, {
2196
+ size: "icon",
2197
+ variant: "ghost",
2198
+ disabled: o(e) === 0,
2199
+ "aria-label": o(a),
2200
+ title: o(a),
2201
+ onClick: p[0] || (p[0] = (d) => e.value--)
2202
+ }, {
2203
+ default: m(() => [
2204
+ h(o(Or), { class: "size-4" })
2205
+ ]),
2206
+ _: 1
2207
+ }, 8, ["disabled", "aria-label", "title"]),
2208
+ h(B, {
2209
+ size: "icon",
2210
+ variant: "ghost",
2211
+ disabled: o(e) === c.reports.length - 1,
2212
+ "aria-label": o(n),
2213
+ title: o(n),
2214
+ onClick: p[1] || (p[1] = (d) => e.value++)
2215
+ }, {
2216
+ default: m(() => [
2217
+ h(o(ft), { class: "size-4" })
2218
+ ]),
2219
+ _: 1
2220
+ }, 8, ["disabled", "aria-label", "title"])
2221
+ ])) : E("", !0)
2222
+ ]),
2223
+ h(on, {
2224
+ report: o(i),
2225
+ class: "gap-0.5"
2226
+ }, null, 8, ["report"])
2227
+ ]),
2228
+ o(i).description ? (l(), f(A, {
2229
+ key: 0,
2230
+ text: o(i).description,
2231
+ class: "text-gray-600"
2232
+ }, null, 8, ["text"])) : E("", !0)
2233
+ ]),
2234
+ y("div", fn, [
2235
+ y("pre", {
2236
+ class: "p-4 text-xs text-red-800",
2237
+ textContent: S(o(r))
2238
+ }, null, 8, hn)
2239
+ ])
2240
+ ]),
2241
+ _: 1
2242
+ }));
2243
+ }
2244
+ }), vn = {
2245
+ viewBox: "0 0 24 24",
2246
+ width: "1.2em",
2247
+ height: "1.2em"
2248
+ };
2249
+ function bn(t, s) {
2250
+ return l(), b("svg", vn, s[0] || (s[0] = [
2251
+ y("path", {
2252
+ fill: "currentColor",
2253
+ d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
2254
+ opacity: ".25"
2255
+ }, null, -1),
2256
+ y("path", {
2257
+ fill: "currentColor",
2258
+ d: "M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
2259
+ }, [
2260
+ y("animateTransform", {
2261
+ attributeName: "transform",
2262
+ dur: "0.75s",
2263
+ repeatCount: "indefinite",
2264
+ type: "rotate",
2265
+ values: "0 12 12;360 12 12"
2266
+ })
2267
+ ], -1)
2268
+ ]));
2269
+ }
2270
+ const yn = { name: "svg-spinners-90-ring-with-bg", render: bn }, _n = { class: "mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200" }, wn = { class: "sr-only" }, $n = /* @__PURE__ */ g({
2271
+ __name: "ProgressBar",
2272
+ props: {
2273
+ filledClass: {},
2274
+ progress: {},
2275
+ job: {}
2276
+ },
2277
+ setup(t) {
2278
+ let s;
2279
+ const e = D(0), r = u(() => H("size-full transition-transform duration-500 rounded-r-full ease-linear bg-primary-600", t.filledClass)), n = u(() => typeof t.progress == "number" ? t.progress : e.value);
2280
+ return He(
2281
+ () => t.job,
2282
+ () => {
2283
+ s && s(), e.value = t.job ? t.job.progress : 0, s = t.job && t.job.listeners.add({ onUpdated: (a) => e.value = a });
2284
+ },
2285
+ { immediate: !0 }
2286
+ ), fe(() => s && s()), (a, i) => (l(), b("div", _n, [
2287
+ y("div", {
2288
+ class: k(r.value),
2289
+ style: Et(`transform:translateX(-${(1 - n.value) * 100}%)`)
2290
+ }, null, 6),
2291
+ y("span", wn, S(a.$td("ui.progress", "{progress}% complete", {
2292
+ progress: n.value * 100
2293
+ })), 1)
2294
+ ]));
2295
+ }
2296
+ });
2297
+ function Cn(t) {
2298
+ const s = u(() => t.title ?? x("ui.loading", "Loading")), e = u(
2299
+ () => t.message ?? x("ui.loadingInProgress", "Loading in progress...")
2300
+ ), r = u(() => typeof t.progress == "number" || !!t.job), n = u(() => !t.title);
2301
+ return { renderedTitle: s, renderedMessage: e, titleHidden: n, showProgress: r };
2302
+ }
2303
+ const xn = /* @__PURE__ */ g({
2304
+ __name: "LoadingModal",
2305
+ props: {
2306
+ title: {},
2307
+ message: {},
2308
+ progress: {},
2309
+ job: {}
2310
+ },
2311
+ setup(t) {
2312
+ const s = t, { renderedTitle: e, renderedMessage: r, titleHidden: n, showProgress: a } = Cn(s);
2313
+ return (i, c) => (l(), f(ne, {
2314
+ persistent: "",
2315
+ class: k(["flex", { "flex-col-reverse": o(a), "items-center justify-center gap-2": !o(a) }]),
2316
+ "wrapper-class": "w-auto",
2317
+ title: o(e),
2318
+ "title-hidden": o(n)
2319
+ }, {
2320
+ default: m(() => [
2321
+ o(a) ? (l(), f($n, {
2322
+ key: 0,
2323
+ progress: i.progress,
2324
+ job: i.job,
2325
+ class: "min-w-[min(400px,80vw)]"
2326
+ }, null, 8, ["progress", "job"])) : (l(), f(o(yn), {
2327
+ key: 1,
2328
+ class: "text-primary-600 mr-1 size-6"
2329
+ })),
2330
+ h(A, { text: o(r) }, null, 8, ["text"])
2331
+ ]),
2332
+ _: 1
2333
+ }, 8, ["title", "title-hidden", "class"]));
2334
+ }
2335
+ }), gt = /* @__PURE__ */ g({
2336
+ __name: "HeadlessInput",
2337
+ props: {
2338
+ name: {},
2339
+ label: {},
2340
+ description: {},
2341
+ modelValue: {},
2342
+ as: { default: "div" }
2343
+ },
2344
+ emits: ["update:modelValue"],
2345
+ setup(t, { expose: s, emit: e }) {
2346
+ const r = e, n = ie("form", null), a = u(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
2347
+ id: `input-${le()}`,
2348
+ name: u(() => t.name),
2349
+ label: u(() => t.label),
2350
+ description: u(() => t.description),
2351
+ value: u(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
2352
+ errors: Le(a),
2353
+ required: u(() => {
2354
+ if (!(!t.name || !n))
2355
+ return n.getFieldRules(t.name).includes("required");
2356
+ }),
2357
+ update(c) {
2358
+ if (n && t.name) {
2359
+ n.setFieldValue(t.name, c);
2360
+ return;
2361
+ }
2362
+ r("update:modelValue", c);
2363
+ }
2364
+ };
2365
+ return se("input", i), s(i), (c, p) => (l(), f(W(c.as), null, {
2366
+ default: m(() => [
2367
+ _(c.$slots, "default")
2368
+ ]),
2369
+ _: 3
2370
+ }));
2371
+ }
2372
+ }), Sn = ["for"], ke = /* @__PURE__ */ g({
2373
+ __name: "HeadlessInputLabel",
2374
+ setup(t) {
2375
+ const s = R("input", "<HeadlessInputLabel> must be a child of a <HeadlessInput>"), e = Ee(), r = u(() => !!(s.label || e.default));
2376
+ return (n, a) => r.value ? (l(), b("label", {
2377
+ key: 0,
2378
+ for: o(s).id
2379
+ }, [
2380
+ _(n.$slots, "default", {}, () => [
2381
+ V(S(o(s).label), 1)
2382
+ ])
2383
+ ], 8, Sn)) : E("", !0);
2384
+ }
2385
+ }), kn = ["id", "name", "type", "checked", "required", "aria-invalid", "aria-describedby"], vt = /* @__PURE__ */ g({
2386
+ __name: "HeadlessInputInput",
2387
+ props: {
2388
+ type: { default: "text" }
2389
+ },
2390
+ setup(t) {
2391
+ const s = re("$inputRef"), e = R("input", "<HeadlessInputInput> must be a child of a <HeadlessInput>"), r = u(() => e.name ?? void 0), n = u(() => e.value), a = u(() => {
2392
+ if (t.type === "checkbox")
2393
+ return !!n.value;
2394
+ });
2395
+ function i() {
2396
+ s.value && e.update(c());
2397
+ }
2398
+ function c() {
2399
+ if (!s.value)
2400
+ return null;
2401
+ switch (t.type) {
2402
+ case "checkbox":
2403
+ return s.value.checked;
2404
+ case "date":
2405
+ return s.value.valueAsDate;
2406
+ default:
2407
+ return s.value.value;
2408
+ }
2409
+ }
2410
+ return st(e, () => {
2411
+ var p;
2412
+ return (p = s.value) == null ? void 0 : p.focus();
2413
+ }), ce(() => {
2414
+ if (s.value) {
2415
+ if (t.type === "date") {
2416
+ s.value.valueAsDate = n.value;
2417
+ return;
2418
+ }
2419
+ s.value.value = n.value ?? null;
2420
+ }
2421
+ }), (p, d) => (l(), b("input", {
2422
+ id: o(e).id,
2423
+ ref: "$inputRef",
2424
+ name: r.value,
2425
+ type: p.type,
2426
+ checked: a.value,
2427
+ required: o(e).required ?? void 0,
2428
+ "aria-invalid": o(e).errors ? "true" : "false",
2429
+ "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
2430
+ onInput: i
2431
+ }, null, 40, kn));
2432
+ }
2433
+ }), Mn = /* @__PURE__ */ g({
2434
+ inheritAttrs: !1,
2435
+ __name: "HeadlessInputDescription",
2436
+ setup(t) {
2437
+ const s = R(
2438
+ "input",
2439
+ "<HeadlessInputDescription> must be a child of a <HeadlessInput>"
2440
+ ), e = u(() => typeof s.description == "string" ? s.description : ""), r = u(() => !!s.description);
2441
+ return (n, a) => _(n.$slots, "default", {
2442
+ id: `${o(s).id}-description`
2443
+ }, () => [
2444
+ r.value ? (l(), f(A, P({ key: 0 }, n.$attrs, {
2445
+ id: `${o(s).id}-description`,
2446
+ text: e.value
2447
+ }), null, 16, ["id", "text"])) : E("", !0)
2448
+ ]);
2449
+ }
2450
+ }), En = ["id"], Me = /* @__PURE__ */ g({
2451
+ __name: "HeadlessInputError",
2452
+ setup(t) {
2453
+ const s = R("input", "<HeadlessInputError> must be a child of a <HeadlessInput>"), e = u(() => s.errors ? x(`errors.${s.errors[0]}`, `Error: ${s.errors[0]}`) : null);
2454
+ return (r, n) => e.value ? (l(), b("p", {
2455
+ key: 0,
2456
+ id: `${o(s).id}-error`
2457
+ }, S(e.value), 9, En)) : E("", !0);
2458
+ }
2459
+ }), Hn = {
2460
+ key: 0,
2461
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
2462
+ }, Ln = /* @__PURE__ */ g({
2463
+ inheritAttrs: !1,
2464
+ __name: "Input",
2465
+ props: {
2466
+ name: {},
2467
+ label: {},
2468
+ description: {},
2469
+ modelValue: {},
2470
+ inputClass: {},
2471
+ wrapperClass: {}
2472
+ },
2473
+ emits: ["update:modelValue"],
2474
+ setup(t) {
2475
+ const s = Y(t, ["label", "inputClass", "wrapperClass"]), e = re("$inputRef"), [r, n] = rt(), a = u(() => H("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = u(() => {
2476
+ var c, p, d;
2477
+ return H(
2478
+ // eslint-disable-next-line vue/max-len
2479
+ "block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6",
2480
+ {
2481
+ "focus:ring-primary-600": !((c = e.value) != null && c.errors),
2482
+ "text-gray-900 shadow-2xs ring-gray-300 placeholder:text-gray-400": !((p = e.value) != null && p.errors),
2483
+ "pr-10 text-red-900 ring-red-300 placeholder:text-red-300 focus:ring-red-500": (d = e.value) == null ? void 0 : d.errors
2484
+ },
2485
+ t.inputClass
2486
+ );
2487
+ });
2488
+ return (c, p) => (l(), f(gt, P({
2489
+ ref: "$inputRef",
2490
+ label: c.label,
2491
+ class: o(n)
2492
+ }, s, {
2493
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => c.$emit("update:modelValue", d))
2494
+ }), {
2495
+ default: m(() => {
2496
+ var d;
2497
+ return [
2498
+ h(ke, { class: "block text-sm leading-6 font-medium text-gray-900" }),
2499
+ y("div", {
2500
+ class: k(a.value)
2501
+ }, [
2502
+ h(vt, P(o(r), { class: i.value }), null, 16, ["class"]),
2503
+ (d = o(e)) != null && d.errors ? (l(), b("div", Hn, [
2504
+ h(o(ht), { class: "size-5 text-red-500" })
2505
+ ])) : E("", !0)
2506
+ ], 2),
2507
+ h(Mn, { class: "mt-2 text-sm text-gray-600" }),
2508
+ h(Me, { class: "mt-2 text-sm text-red-600" })
2509
+ ];
2510
+ }),
2511
+ _: 1
2512
+ }, 16, ["label", "class"]));
2513
+ }
2514
+ });
2515
+ function Rn(t) {
2516
+ const s = mt({
2517
+ draft: Ir(t.defaultValue ?? "")
2518
+ }), e = u(() => t.title ?? t.message), r = u(() => t.title ? t.message : null), n = u(() => t.acceptText ?? x("ui.accept", "Ok")), a = u(() => t.cancelText ?? x("ui.cancel", "Cancel"));
2519
+ return { form: s, renderedTitle: e, renderedMessage: r, renderedAcceptText: n, renderedCancelText: a };
2520
+ }
2521
+ const Tn = { class: "mt-4 flex flex-row-reverse gap-2" }, Pn = /* @__PURE__ */ g({
2522
+ __name: "PromptModal",
2523
+ props: {
2524
+ title: {},
2525
+ message: {},
2526
+ label: {},
2527
+ defaultValue: {},
2528
+ placeholder: {},
2529
+ acceptText: {},
2530
+ acceptVariant: {},
2531
+ cancelText: {},
2532
+ cancelVariant: { default: "secondary" }
2533
+ },
2534
+ setup(t) {
2535
+ const s = Y(t, ["cancelVariant"]), { form: e, renderedTitle: r, renderedMessage: n, renderedAcceptText: a, renderedCancelText: i } = Rn(s);
2536
+ return (c, p) => (l(), f(ne, {
2537
+ title: o(r),
2538
+ persistent: ""
2539
+ }, {
2540
+ default: m(({ close: d }) => [
2541
+ h(pt, {
2542
+ form: o(e),
2543
+ onSubmit: (w) => d(o(e).draft)
2544
+ }, {
2545
+ default: m(() => [
2546
+ o(n) ? (l(), f(A, {
2547
+ key: 0,
2548
+ text: o(n)
2549
+ }, null, 8, ["text"])) : E("", !0),
2550
+ h(Ln, {
2551
+ name: "draft",
2552
+ class: "mt-2",
2553
+ placeholder: c.placeholder,
2554
+ label: c.label
2555
+ }, null, 8, ["placeholder", "label"]),
2556
+ y("div", Tn, [
2557
+ h(B, {
2558
+ variant: c.acceptVariant,
2559
+ submit: ""
2560
+ }, {
2561
+ default: m(() => [
2562
+ V(S(o(a)), 1)
2563
+ ]),
2564
+ _: 1
2565
+ }, 8, ["variant"]),
2566
+ h(B, {
2567
+ variant: c.cancelVariant,
2568
+ onClick: (w) => d(!1)
2569
+ }, {
2570
+ default: m(() => [
2571
+ V(S(o(i)), 1)
2572
+ ]),
2573
+ _: 2
2574
+ }, 1032, ["variant", "onClick"])
2575
+ ])
2576
+ ]),
2577
+ _: 2
2578
+ }, 1032, ["form", "onSubmit"])
2579
+ ]),
2580
+ _: 1
2581
+ }, 8, ["title"]));
2582
+ }
2583
+ }), In = { class: "grid grow place-items-center" }, Vn = { class: "flex flex-col items-center space-y-6 p-8" }, An = { class: "mt-2 text-center text-4xl font-medium text-red-600" }, Bn = { class: "mt-4 flex flex-col space-y-4" }, Dn = /* @__PURE__ */ g({
2584
+ __name: "StartupCrash",
2585
+ setup(t) {
2586
+ return (s, e) => (l(), b("div", In, [
2587
+ y("div", Vn, [
2588
+ y("h1", An, S(s.$td("startupCrash.title", "Something went wrong!")), 1),
2589
+ h(A, {
2590
+ text: s.$td(
2591
+ "startupCrash.message",
2592
+ `Something failed trying to start the application.
2593
+
2594
+ Here's some things you can do:`
2595
+ ),
2596
+ class: "mt-4 text-center"
2597
+ }, null, 8, ["text"]),
2598
+ y("div", Bn, [
2599
+ h(B, {
2600
+ variant: "danger",
2601
+ onClick: e[0] || (e[0] = (r) => s.$app.reload())
2602
+ }, {
2603
+ default: m(() => [
2604
+ V(S(s.$td("startupCrash.reload", "Try again")), 1)
2605
+ ]),
2606
+ _: 1
2607
+ }),
2608
+ h(B, {
2609
+ variant: "danger",
2610
+ onClick: e[1] || (e[1] = (r) => s.$errors.inspect(s.$errors.startupErrors))
2611
+ }, {
2612
+ default: m(() => [
2613
+ V(S(s.$td("startupCrash.inspect", "View error details")), 1)
2614
+ ]),
2615
+ _: 1
2616
+ })
2617
+ ])
2618
+ ])
2619
+ ]));
2620
+ }
2621
+ }), bt = /* @__PURE__ */ g({
2622
+ __name: "HeadlessToastAction",
2623
+ props: {
2624
+ action: {}
2625
+ },
2626
+ setup(t) {
2627
+ return (s, e) => (l(), f(W(s.action.dismiss ? o(fs) : "button"), {
2628
+ type: "button",
2629
+ onClick: s.action.click
2630
+ }, {
2631
+ default: m(() => [
2632
+ V(S(s.action.label), 1)
2633
+ ]),
2634
+ _: 1
2635
+ }, 8, ["onClick"]));
2636
+ }
2637
+ }), zn = { key: 0 }, jn = /* @__PURE__ */ g({
2638
+ __name: "HeadlessToast",
2639
+ props: {
2640
+ message: {},
2641
+ actions: {},
2642
+ variant: {}
2643
+ },
2644
+ setup(t) {
2645
+ return (s, e) => (l(), f(o(hs), null, {
2646
+ default: m(() => [
2647
+ _(s.$slots, "default", {}, () => [
2648
+ s.message ? (l(), b("span", zn, S(s.message), 1)) : E("", !0),
2649
+ (l(!0), b(q, null, U(s.actions, (r, n) => (l(), f(bt, {
2650
+ key: n,
2651
+ action: r
2652
+ }, null, 8, ["action"]))), 128))
2653
+ ])
2654
+ ]),
2655
+ _: 3
2656
+ }));
2657
+ }
2658
+ }), qn = /* @__PURE__ */ g({
2659
+ __name: "Toast",
2660
+ props: {
2661
+ message: {},
2662
+ actions: {},
2663
+ variant: { default: "secondary" },
2664
+ class: {}
2665
+ },
2666
+ setup(t) {
2667
+ const s = tt(
2668
+ { baseClasses: t.class, variant: t.variant },
2669
+ {
2670
+ baseClasses: "flex items-center gap-2 rounded-md p-2 ring-1 shadow-lg border-gray-200",
2671
+ variants: {
2672
+ variant: {
2673
+ secondary: "bg-gray-900 text-white ring-black",
2674
+ danger: "bg-red-50 text-red-900 ring-red-100"
2675
+ }
2676
+ },
2677
+ defaultVariants: {
2678
+ variant: "secondary"
2679
+ }
2680
+ }
2681
+ );
2682
+ return (e, r) => (l(), f(jn, {
2683
+ class: k(o(s))
2684
+ }, {
2685
+ default: m(() => [
2686
+ e.message ? (l(), f(A, {
2687
+ key: 0,
2688
+ text: e.message,
2689
+ inline: ""
2690
+ }, null, 8, ["text"])) : E("", !0),
2691
+ (l(!0), b(q, null, U(e.actions, (n, a) => (l(), f(B, {
2692
+ key: a,
2693
+ action: n,
2694
+ variant: e.variant,
2695
+ as: bt
2696
+ }, null, 8, ["action", "variant"]))), 128))
2697
+ ]),
2698
+ _: 1
2699
+ }, 8, ["class"]));
2700
+ }
2701
+ }), Fn = { $ui: I }, Un = {
2702
+ async install(t, s) {
2703
+ const e = {
2704
+ [L.AlertModal]: Lr,
2705
+ [L.ConfirmModal]: qr,
2706
+ [L.ErrorReportModal]: gn,
2707
+ [L.LoadingModal]: xn,
2708
+ [L.PromptModal]: Pn,
2709
+ [L.Toast]: qn,
2710
+ [L.StartupCrash]: Dn
2711
+ };
2712
+ Object.entries({
2713
+ ...e,
2714
+ ...s.components
2715
+ }).forEach(([r, n]) => I.registerComponent(r, n)), await be(t, Fn);
2716
+ }
2717
+ };
2718
+ async function On(t, s = {}) {
2719
+ var r;
2720
+ const e = [yr, Ds, tr, br, Us, Un, ...s.plugins ?? []];
2721
+ z.instance = t, await Ts(e, t, s), await ((r = s.install) == null ? void 0 : r.call(s, t)), await M.emit("application-ready");
2722
+ }
2723
+ async function Aa(t, s = {}) {
2724
+ var r;
2725
+ const e = Ht(t);
2726
+ X() && (window.$aerogel = e), await On(e, s), e.mount("#app"), (r = e._container) == null || r.classList.remove("loading"), await M.emit("application-mounted");
2727
+ }
2728
+ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2729
+ __name: "AppModals",
2730
+ setup(t) {
2731
+ const s = u(() => I.modals[0] ?? null);
2732
+ return (e, r) => s.value ? (l(), b("aside", Nn, [
2733
+ h(dt, {
2734
+ "child-index": 1,
2735
+ modal: s.value
2736
+ }, null, 8, ["modal"])
2737
+ ])) : E("", !0);
2738
+ }
2739
+ }), Kn = /* @__PURE__ */ g({
2740
+ __name: "AppToasts",
2741
+ setup(t) {
2742
+ return (s, e) => (l(), f(o(gs), null, {
2743
+ default: m(() => [
2744
+ (l(!0), b(q, null, U(s.$ui.toasts, (r) => (l(), f(W(r.component), P({
2745
+ id: r.id,
2746
+ key: r.id,
2747
+ ref_for: !0
2748
+ }, r.properties), null, 16, ["id"]))), 128)),
2749
+ h(o(vs), { class: "fixed right-0 bottom-0 z-50 flex flex-col items-end space-y-4 px-4 py-6 sm:p-6" })
2750
+ ]),
2751
+ _: 1
2752
+ }));
2753
+ }
2754
+ }), Qn = /* @__PURE__ */ g({
2755
+ __name: "AppOverlays",
2756
+ setup(t) {
2757
+ const s = D(null), e = D(!0);
2758
+ return oe("show-overlays-backdrop", async () => {
2759
+ !s.value || !e.value || (e.value = !1, s.value.classList.remove("opacity-0"));
2760
+ }), oe("hide-overlays-backdrop", async () => {
2761
+ !s.value || e.value || (e.value = !0, s.value.classList.add("opacity-0"));
2762
+ }), (r, n) => (l(), b(q, null, [
2763
+ h(Wn),
2764
+ h(Kn)
2765
+ ], 64));
2766
+ }
2767
+ }), Jn = { class: "flex min-h-full flex-col text-base leading-tight font-normal text-gray-900 antialiased" }, Ba = /* @__PURE__ */ g({
2768
+ __name: "AppLayout",
2769
+ setup(t) {
2770
+ return (s, e) => (l(), b("div", Jn, [
2771
+ s.$errors.hasStartupErrors ? _(s.$slots, "startup-crash", { key: 0 }, () => [
2772
+ (l(), f(W(s.$ui.requireComponent(o(L).StartupCrash))))
2773
+ ]) : _(s.$slots, "default", { key: 1 }),
2774
+ h(Qn)
2775
+ ]));
2776
+ }
2777
+ }), Zn = ["id", "name", "value", "required", "aria-invalid", "aria-describedby"], Da = /* @__PURE__ */ g({
2778
+ __name: "HeadlessInputTextArea",
2779
+ setup(t) {
2780
+ const s = re("$textAreaRef"), e = R(
2781
+ "input",
2782
+ "<HeadlessInputTextArea> must be a child of a <HeadlessInput>"
2783
+ ), r = u(() => e.name ?? void 0), n = u(() => e.value);
2784
+ function a() {
2785
+ s.value && e.update(s.value.value);
2786
+ }
2787
+ return st(e, () => {
2788
+ var i;
2789
+ return (i = s.value) == null ? void 0 : i.focus();
2790
+ }), (i, c) => (l(), b("textarea", {
2791
+ id: o(e).id,
2792
+ ref: "$textAreaRef",
2793
+ name: r.value,
2794
+ value: n.value,
2795
+ required: o(e).required ?? void 0,
2796
+ "aria-invalid": o(e).errors ? "true" : "false",
2797
+ "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
2798
+ onInput: a
2799
+ }, null, 40, Zn));
2800
+ }
2801
+ }), Gn = { class: "group" }, Xn = { class: "-ml-2 flex w-[max-content] cursor-pointer items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700" }, Yn = { class: "pt-2 pl-4" }, za = /* @__PURE__ */ g({
2802
+ __name: "AdvancedOptions",
2803
+ setup(t) {
2804
+ return (s, e) => (l(), b("details", Gn, [
2805
+ y("summary", Xn, [
2806
+ h(o(ft), { class: "size-6 transition-transform group-open:rotate-90" }),
2807
+ y("span", null, S(s.$td("ui.advancedOptions", "Advanced options")), 1)
2808
+ ]),
2809
+ y("div", Yn, [
2810
+ _(s.$slots, "default")
2811
+ ])
2812
+ ]));
2813
+ }
2814
+ }), ea = { class: "flex h-6 items-center" }, ja = /* @__PURE__ */ g({
2815
+ inheritAttrs: !1,
2816
+ __name: "Checkbox",
2817
+ props: {
2818
+ name: {},
2819
+ label: {},
2820
+ description: {},
2821
+ modelValue: {},
2822
+ inputClass: {},
2823
+ labelClass: {}
2824
+ },
2825
+ emits: ["update:modelValue"],
2826
+ setup(t) {
2827
+ const s = Y(t, ["inputClass", "labelClass"]), e = re("$inputRef"), [r, n] = rt(), a = u(() => H("relative flex items-start", n.value)), i = u(() => {
2828
+ var p, d;
2829
+ return H(
2830
+ "size-4 rounded text-primary-600 not-checked:hover:bg-gray-200 checked:hover:text-primary-500 checked:border-0",
2831
+ {
2832
+ "border-gray-300 focus:ring-primary-600": !((p = e.value) != null && p.errors),
2833
+ "border-red-400 border-2 focus:ring-red-600": (d = e.value) == null ? void 0 : d.errors
2834
+ },
2835
+ t.inputClass
2836
+ );
2837
+ }), c = u(() => H("ml-2 text-sm leading-6", t.labelClass));
2838
+ return (p, d) => (l(), f(gt, P({
2839
+ ref: "$inputRef",
2840
+ class: a.value
2841
+ }, s, {
2842
+ "onUpdate:modelValue": d[0] || (d[0] = (w) => p.$emit("update:modelValue", w))
2843
+ }), {
2844
+ default: m(() => [
2845
+ y("div", ea, [
2846
+ h(vt, P(o(r), {
2847
+ type: "checkbox",
2848
+ class: i.value
2849
+ }), null, 16, ["class"])
2850
+ ]),
2851
+ p.$slots.default ? (l(), b("div", {
2852
+ key: 0,
2853
+ class: k(c.value)
2854
+ }, [
2855
+ h(ke, { class: "text-gray-900" }, {
2856
+ default: m(() => [
2857
+ _(p.$slots, "default")
2858
+ ]),
2859
+ _: 3
2860
+ }),
2861
+ h(Me, { class: "text-red-600" })
2862
+ ], 2)) : p.label ? (l(), b("div", {
2863
+ key: 1,
2864
+ class: k(c.value)
2865
+ }, [
2866
+ h(ke, { class: "text-gray-900" }),
2867
+ h(Me, { class: "text-red-600" })
2868
+ ], 2)) : E("", !0)
2869
+ ]),
2870
+ _: 3
2871
+ }, 16, ["class"]));
2872
+ }
2873
+ }), ta = /* @__PURE__ */ g({
2874
+ __name: "DropdownMenuOption",
2875
+ emits: ["select"],
2876
+ setup(t) {
2877
+ return (s, e) => (l(), f(o(bs), {
2878
+ class: "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-gray-900 data-[highlighted]:bg-gray-100",
2879
+ onSelect: e[0] || (e[0] = (r) => s.$emit("select"))
2880
+ }, {
2881
+ default: m(() => [
2882
+ _(s.$slots, "default")
2883
+ ]),
2884
+ _: 3
2885
+ }));
2886
+ }
2887
+ }), sa = /* @__PURE__ */ g({
2888
+ __name: "DropdownMenuOptions",
2889
+ setup(t) {
2890
+ const s = R(
2891
+ "dropdown-menu",
2892
+ "<DropdownMenuOptions> must be a child of a <DropdownMenu>"
2893
+ );
2894
+ return (e, r) => (l(), f(o(ys), {
2895
+ class: "gap-y-0.5 rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-black/5",
2896
+ align: o(s).align,
2897
+ side: o(s).side
2898
+ }, {
2899
+ default: m(() => [
2900
+ _(e.$slots, "default", {}, () => [
2901
+ (l(!0), b(q, null, U(o(s).options, (n, a) => (l(), f(ta, {
2902
+ key: a,
2903
+ onSelect: n.click
2904
+ }, {
2905
+ default: m(() => [
2906
+ V(S(n.label), 1)
2907
+ ]),
2908
+ _: 2
2909
+ }, 1032, ["onSelect"]))), 128))
2910
+ ])
2911
+ ]),
2912
+ _: 3
2913
+ }, 8, ["align", "side"]));
2914
+ }
2915
+ }), qa = /* @__PURE__ */ g({
2916
+ __name: "DropdownMenu",
2917
+ props: {
2918
+ align: {},
2919
+ side: {},
2920
+ options: {}
2921
+ },
2922
+ setup(t, { expose: s }) {
2923
+ const e = {
2924
+ align: t.align,
2925
+ side: t.side,
2926
+ options: u(() => {
2927
+ var r;
2928
+ return (r = t.options) == null ? void 0 : r.filter(Boolean);
2929
+ })
2930
+ };
2931
+ return se("dropdown-menu", e), s(e), (r, n) => (l(), f(o(_s), null, {
2932
+ default: m(() => [
2933
+ h(o(ws), null, {
2934
+ default: m(() => [
2935
+ _(r.$slots, "default")
2936
+ ]),
2937
+ _: 3
2938
+ }),
2939
+ h(o($s), null, {
2940
+ default: m(() => [
2941
+ _(r.$slots, "options", {}, () => [
2942
+ h(sa)
2943
+ ])
2944
+ ]),
2945
+ _: 3
2946
+ })
2947
+ ]),
2948
+ _: 3
2949
+ }));
2950
+ }
2951
+ }), ra = ["aria-hidden"], na = ["tabindex", "aria-label", "type"], Fa = /* @__PURE__ */ g({
2952
+ __name: "EditableContent",
2953
+ props: {
2954
+ type: { default: "text" },
2955
+ contentClass: {},
2956
+ ariaLabel: {},
2957
+ formAriaHidden: { type: Boolean },
2958
+ tabindex: {},
2959
+ text: {},
2960
+ disabled: { type: Boolean }
2961
+ },
2962
+ emits: ["update", "save"],
2963
+ setup(t, { emit: s }) {
2964
+ const e = s, r = re("$inputRef"), n = D(null), a = D(t.text), i = u(() => H("inline whitespace-pre", t.contentClass)), c = u(() => H("invisible whitespace-pre", t.contentClass)), p = u(() => H("absolute inset-0 h-full w-full resize-none border-0 bg-transparent p-0 focus:ring-0", t.contentClass));
2965
+ function d() {
2966
+ n.value = t.text;
2967
+ }
2968
+ function w() {
2969
+ n.value && (t.type !== "number" && a.value.trim().length === 0 && (a.value = n.value, e("update", a.value)), n.value = null, e("save"));
2970
+ }
2971
+ return ce(() => a.value = t.text), (v, C) => (l(), b("div", {
2972
+ class: k(["relative", { "pointer-events-none!": v.disabled && !n.value }])
2973
+ }, [
2974
+ n.value ? (l(), b("span", {
2975
+ key: 1,
2976
+ class: k(c.value)
2977
+ }, S(a.value), 3)) : (l(), b("div", {
2978
+ key: 0,
2979
+ class: k(i.value)
2980
+ }, [
2981
+ _(v.$slots, "default")
2982
+ ], 2)),
2983
+ v.type === "number" ? (l(), b("span", {
2984
+ key: 2,
2985
+ class: k(["inline-block transition-[width]", n.value ? "w-5" : "w-0"])
2986
+ }, null, 2)) : E("", !0),
2987
+ y("form", {
2988
+ class: "w-full",
2989
+ "aria-hidden": v.formAriaHidden,
2990
+ onSubmit: C[4] || (C[4] = Ue((T) => {
2991
+ var ue;
2992
+ return (ue = o(r)) == null ? void 0 : ue.blur();
2993
+ }, ["prevent"]))
2994
+ }, [
2995
+ Oe(y("input", {
2996
+ ref: "$inputRef",
2997
+ "onUpdate:modelValue": C[0] || (C[0] = (T) => a.value = T),
2998
+ tabindex: v.tabindex ?? void 0,
2999
+ "aria-label": v.ariaLabel ?? void 0,
3000
+ type: v.type,
3001
+ class: k([
3002
+ p.value,
3003
+ { "opacity-0": !n.value, "appearance-textfield": !n.value && v.type === "number" }
3004
+ ]),
3005
+ onKeyup: C[1] || (C[1] = (T) => v.$emit("update", a.value)),
3006
+ onFocus: C[2] || (C[2] = (T) => d()),
3007
+ onBlur: C[3] || (C[3] = (T) => w())
3008
+ }, null, 42, na), [
3009
+ [Lt, a.value]
3010
+ ])
3011
+ ], 40, ra)
3012
+ ], 2));
3013
+ }
3014
+ }), Ua = /* @__PURE__ */ g({
3015
+ __name: "ErrorMessage",
3016
+ props: {
3017
+ error: {}
3018
+ },
3019
+ setup(t) {
3020
+ const s = u(() => Gs(t.error));
3021
+ return (e, r) => (l(), f(A, {
3022
+ text: s.value,
3023
+ inline: ""
3024
+ }, null, 8, ["text"]));
3025
+ }
3026
+ }), Oa = /* @__PURE__ */ g({
3027
+ __name: "Link",
3028
+ props: {
3029
+ class: {},
3030
+ disabled: { type: Boolean },
3031
+ href: {},
3032
+ route: {},
3033
+ routeParams: {},
3034
+ routeQuery: {},
3035
+ size: {},
3036
+ submit: { type: Boolean },
3037
+ asChild: { type: Boolean },
3038
+ as: {}
3039
+ },
3040
+ setup(t) {
3041
+ return (s, e) => (l(), f(B, P({ variant: "link" }, s.$props), {
3042
+ default: m(() => [
3043
+ _(s.$slots, "default")
3044
+ ]),
3045
+ _: 3
3046
+ }, 16));
3047
+ }
3048
+ }), Na = /* @__PURE__ */ g({
3049
+ __name: "SettingsModal",
3050
+ setup(t) {
3051
+ const s = u(() => Ut(z.settings, "priority", "desc"));
3052
+ return (e, r) => (l(), f(ne, {
3053
+ title: e.$td("settings.title", "Settings")
3054
+ }, {
3055
+ default: m(() => [
3056
+ (l(!0), b(q, null, U(s.value, (n, a) => (l(), f(W(n.component), { key: a }))), 128))
3057
+ ]),
3058
+ _: 1
3059
+ }, 8, ["title"]));
3060
+ }
3061
+ });
3062
+ class Wa {
3063
+ constructor() {
3064
+ $(this, "status");
3065
+ $(this, "_listeners");
3066
+ $(this, "_progress");
3067
+ $(this, "_cancelled");
3068
+ $(this, "_started");
3069
+ $(this, "_completed");
3070
+ this.status = this.getInitialStatus(), this._listeners = new Ot(), this._started = new K(), this._completed = new K();
3071
+ }
3072
+ async start() {
3073
+ this.beforeStart(), this._started.resolve();
3074
+ try {
3075
+ await this.updateProgress(), await this.run(), await this.updateProgress(), this._completed.resolve();
3076
+ } catch (s) {
3077
+ if (s instanceof De)
3078
+ return;
3079
+ throw Z(Nt(s), (e) => {
3080
+ this._completed.reject(e);
3081
+ });
3082
+ }
3083
+ }
3084
+ async cancel() {
3085
+ this._cancelled = new K(), await this._cancelled;
3086
+ }
3087
+ serialize() {
3088
+ return this.serializeStatus(this.status);
3089
+ }
3090
+ get listeners() {
3091
+ return this._listeners;
3092
+ }
3093
+ get progress() {
3094
+ return this._progress ?? 0;
3095
+ }
3096
+ get cancelled() {
3097
+ var s;
3098
+ return !!((s = this._cancelled) != null && s.isResolved());
3099
+ }
3100
+ get started() {
3101
+ return this._started;
3102
+ }
3103
+ get completed() {
3104
+ return this._completed;
3105
+ }
3106
+ getInitialStatus() {
3107
+ return { completed: !1 };
3108
+ }
3109
+ beforeStart() {
3110
+ if (this._started.isResolved()) {
3111
+ if (this._cancelled) {
3112
+ delete this._progress, delete this._cancelled;
3113
+ return;
3114
+ }
3115
+ throw new Error("Job already started!");
3116
+ }
3117
+ }
3118
+ assertNotCancelled() {
3119
+ if (this._cancelled)
3120
+ throw this._cancelled.resolve(), new De();
3121
+ }
3122
+ calculateCurrentProgress(s) {
3123
+ return s ?? (s = this.status), s.completed ? 1 : s.children ? Wt(
3124
+ s.children.reduce((e, r) => e + this.calculateCurrentProgress(r), 0) / s.children.length,
3125
+ 2
3126
+ ) : 0;
3127
+ }
3128
+ async updateProgress(s) {
3129
+ await (s == null ? void 0 : s(this.status));
3130
+ const e = this.calculateCurrentProgress();
3131
+ e !== this._progress && (this._progress = e, await this._listeners.emit("onUpdated", e));
3132
+ }
3133
+ serializeStatus(s) {
3134
+ return { ...s };
3135
+ }
3136
+ }
3137
+ async function Ka(t) {
3138
+ await t.start();
3139
+ }
3140
+ export {
3141
+ za as AdvancedOptions,
3142
+ Lr as AlertModal,
3143
+ z as App,
3144
+ Ba as AppLayout,
3145
+ Wn as AppModals,
3146
+ Qn as AppOverlays,
3147
+ Rs as AppService,
3148
+ Kn as AppToasts,
3149
+ B as Button,
3150
+ wa as Cache,
3151
+ zs as CacheService,
3152
+ ja as Checkbox,
3153
+ qr as ConfirmModal,
3154
+ qa as DropdownMenu,
3155
+ ta as DropdownMenuOption,
3156
+ sa as DropdownMenuOptions,
3157
+ Fa as EditableContent,
3158
+ Ua as ErrorMessage,
3159
+ gn as ErrorReportModal,
3160
+ on as ErrorReportModalButtons,
3161
+ ln as ErrorReportModalTitle,
3162
+ Ye as Errors,
3163
+ va as EventListenerPriorities,
3164
+ M as Events,
3165
+ Hs as EventsService,
3166
+ pt as Form,
3167
+ Pr as FormController,
3168
+ F as FormFieldTypes,
3169
+ or as HeadlessButton,
3170
+ gt as HeadlessInput,
3171
+ Mn as HeadlessInputDescription,
3172
+ Me as HeadlessInputError,
3173
+ vt as HeadlessInputInput,
3174
+ ke as HeadlessInputLabel,
3175
+ Da as HeadlessInputTextArea,
3176
+ Cr as HeadlessModal,
3177
+ xr as HeadlessModalContent,
3178
+ Sr as HeadlessModalDescription,
3179
+ kr as HeadlessModalOverlay,
3180
+ Mr as HeadlessModalTitle,
3181
+ ir as HeadlessSelect,
3182
+ ze as HeadlessSelectLabel,
3183
+ ot as HeadlessSelectOption,
3184
+ lt as HeadlessSelectOptions,
3185
+ at as HeadlessSelectTrigger,
3186
+ nt as HeadlessSelectValue,
3187
+ jn as HeadlessToast,
3188
+ Ln as Input,
3189
+ Wa as Job,
3190
+ De as JobCancelledError,
3191
+ J as Lang,
3192
+ me as Layouts,
3193
+ Oa as Link,
3194
+ xn as LoadingModal,
3195
+ Ze as MOBILE_BREAKPOINT,
3196
+ A as Markdown,
3197
+ ne as Modal,
3198
+ dt as ModalContext,
3199
+ $n as ProgressBar,
3200
+ Pn as PromptModal,
3201
+ mr as Select,
3202
+ it as SelectLabel,
3203
+ cr as SelectOption,
3204
+ ct as SelectOptions,
3205
+ ut as SelectTrigger,
3206
+ ve as Service,
3207
+ Se as ServiceBootError,
3208
+ Na as SettingsModal,
3209
+ Dn as StartupCrash,
3210
+ qs as Storage,
3211
+ qn as Toast,
3212
+ I as UI,
3213
+ L as UIComponents,
3214
+ Ns as UIService,
3215
+ Ha as booleanInput,
3216
+ be as bootServices,
3217
+ Aa as bootstrap,
3218
+ On as bootstrapApplication,
3219
+ H as classes,
3220
+ ka as computedAsync,
3221
+ Ma as computedDebounce,
3222
+ tt as computedVariantClasses,
3223
+ La as dateInput,
3224
+ _a as defineDirective,
3225
+ Ea as defineFormValidationRule,
3226
+ ya as definePlugin,
3227
+ ge as defineServiceState,
3228
+ Es as defineServiceStore,
3229
+ ba as defineSettings,
3230
+ Ka as dispatch,
3231
+ Ge as getCurrentLayout,
3232
+ Gs as getErrorMessage,
3233
+ Ms as getPiniaStore,
3234
+ lr as hasSelectOptionLabel,
3235
+ Vs as injectOrFail,
3236
+ Is as injectReactive,
3237
+ R as injectReactiveOrFail,
3238
+ Ts as installPlugins,
3239
+ Ia as numberInput,
3240
+ xa as onCleanMounted,
3241
+ st as onFormFocus,
3242
+ Sa as persistent,
3243
+ Ca as registerErrorHandler,
3244
+ nr as renderMarkdown,
3245
+ Je as renderVNode,
3246
+ $a as replaceExisting,
3247
+ Ra as requiredBooleanInput,
3248
+ Ta as requiredDateInput,
3249
+ Pa as requiredNumberInput,
3250
+ Ir as requiredStringInput,
3251
+ ks as resetPiniaStore,
3252
+ ar as safeHtml,
3253
+ Va as stringInput,
3254
+ Xe as translate,
3255
+ x as translateWithDefault,
3256
+ Vr as useConfirmModal,
3257
+ cn as useErrorReportModal,
3258
+ oe as useEvent,
3259
+ mt as useForm,
3260
+ rt as useInputAttrs,
3261
+ Cn as useLoadingModal,
3262
+ Rn as usePromptModal,
3263
+ Tr as validate,
3264
+ de as validators
3265
+ };
3266
+ //# sourceMappingURL=aerogel-core.js.map