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