@aerogel/core 0.0.0-next.d7394c3aa6aac799b0971e63819a8713d05a5123 → 0.0.0-next.e4c0d5bd2801fbe93545477ea515af53df69b522

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