@stonecrop/desktop 0.2.11 → 0.2.13

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/desktop.js DELETED
@@ -1,4965 +0,0 @@
1
- import { defineComponent as q, ref as V, onMounted as Lt, openBlock as C, createElementBlock as A, normalizeClass as co, createElementVNode as T, Fragment as Ie, renderList as Pe, toDisplayString as ce, createCommentVNode as ke, withDirectives as lt, vShow as jt, pushScopeId as lo, popScopeId as uo, inject as Z, computed as B, createBlock as Se, resolveDynamicComponent as Bt, mergeProps as Ut, effectScope as fo, markRaw as Ee, onBeforeMount as wr, shallowRef as br, toRaw as ut, hasInjectionContext as _r, getCurrentInstance as Ht, unref as k, shallowReactive as Er, watch as ue, reactive as _e, isRef as We, isReactive as Wt, toRef as yt, nextTick as Fe, getCurrentScope as po, onScopeDispose as ho, h as mo, provide as nt, toRefs as dn, watchEffect as kr, normalizeStyle as ie, renderSlot as me, createVNode as at, withCtx as it, useCssVars as vo, createTextVNode as go, onBeforeUnmount as Sr, resolveComponent as Or, withKeys as Ye, vModelText as Ir } from "vue";
2
- const Ft = (e) => (lo("data-v-b7fdfbec"), e = e(), uo(), e), Pr = { class: "action-menu-icon" }, Cr = /* @__PURE__ */ Ft(() => /* @__PURE__ */ T("svg", {
3
- class: "leftBar",
4
- version: "1.1",
5
- id: "Layer_1",
6
- xmlns: "http://www.w3.org/2000/svg",
7
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
8
- x: "0px",
9
- y: "0px",
10
- viewBox: "0 0 100 100",
11
- "xml:space": "preserve",
12
- width: "50",
13
- height: "50"
14
- }, [
15
- /* @__PURE__ */ T("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
16
- ], -1)), xr = /* @__PURE__ */ Ft(() => /* @__PURE__ */ T("svg", {
17
- class: "rightBar",
18
- version: "1.1",
19
- id: "Layer_1",
20
- xmlns: "http://www.w3.org/2000/svg",
21
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
22
- x: "0px",
23
- y: "0px",
24
- viewBox: "0 0 100 100",
25
- "xml:space": "preserve",
26
- width: "50",
27
- height: "50"
28
- }, [
29
- /* @__PURE__ */ T("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
30
- ], -1)), $r = [
31
- Cr,
32
- xr
33
- ], Nr = /* @__PURE__ */ Ft(() => /* @__PURE__ */ T("div", { style: { "margin-right": "30px" } }, null, -1)), Rr = ["onclick"], Ar = { key: 1 }, Tr = ["onClick"], Dr = { class: "dropdown-container" }, Vr = { class: "dropdown" }, Mr = ["onclick"], Lr = ["href"], jr = { class: "dropdown-item" }, Br = /* @__PURE__ */ q({
34
- __name: "ActionSet",
35
- props: {
36
- elements: {}
37
- },
38
- setup(e) {
39
- const t = e, n = V([]), o = V(!1), r = V(null), s = V(!1), i = V(!1);
40
- Lt(() => {
41
- n.value = t.elements, a();
42
- });
43
- const a = () => {
44
- for (let d of n.value)
45
- d.elementType === "dropdown" && (d.show = !1);
46
- }, l = () => {
47
- s.value = !0, r.value = setTimeout(() => {
48
- s.value && (o.value = !0);
49
- }, 500);
50
- }, u = () => {
51
- s.value = !1, i.value = !1, clearTimeout(r.value), o.value = !1;
52
- }, c = (d) => {
53
- const f = !n.value[d].show;
54
- a(), n.value[d].show = f;
55
- };
56
- return (d, f) => (C(), A("div", {
57
- class: co([{ "open-set": o.value, "hovered-and-closed": i.value }, "action-set collapse"]),
58
- onMouseover: l,
59
- onMouseleave: u
60
- }, [
61
- T("div", Pr, [
62
- T("div", {
63
- id: "chevron",
64
- onClick: f[0] || (f[0] = (p) => i.value = !i.value)
65
- }, $r)
66
- ]),
67
- Nr,
68
- (C(!0), A(Ie, null, Pe(n.value, (p, v) => (C(), A("div", {
69
- class: "action-element",
70
- key: v
71
- }, [
72
- p.elementType == "button" ? (C(), A("button", {
73
- key: 0,
74
- onclick: p.action,
75
- class: "button-default"
76
- }, ce(p.label), 9, Rr)) : ke("", !0),
77
- p.elementType == "dropdown" ? (C(), A("div", Ar, [
78
- T("button", {
79
- class: "button-default",
80
- onClick: (m) => c(v)
81
- }, ce(p.label), 9, Tr),
82
- lt(T("div", Dr, [
83
- T("div", Vr, [
84
- (C(!0), A(Ie, null, Pe(p.actions, (m) => (C(), A("div", {
85
- key: m.label
86
- }, [
87
- m.action != null ? (C(), A("button", {
88
- key: 0,
89
- onclick: m.action,
90
- class: "dropdown-item"
91
- }, ce(m.label), 9, Mr)) : m.link != null ? (C(), A("a", {
92
- key: 1,
93
- href: m.link
94
- }, [
95
- T("button", jr, ce(m.label), 1)
96
- ], 8, Lr)) : ke("", !0)
97
- ]))), 128))
98
- ])
99
- ], 512), [
100
- [jt, p.show]
101
- ])
102
- ])) : ke("", !0)
103
- ]))), 128))
104
- ], 34));
105
- }
106
- }), Gt = (e, t) => {
107
- const n = e.__vccOpts || e;
108
- for (const [o, r] of t)
109
- n[o] = r;
110
- return n;
111
- }, Ur = /* @__PURE__ */ Gt(Br, [["__scopeId", "data-v-b7fdfbec"]]), Hr = {};
112
- function Wr(e, t) {
113
- return C(), A("dialog");
114
- }
115
- const Fr = /* @__PURE__ */ Gt(Hr, [["render", Wr]]), Gr = (e, t) => {
116
- const n = e.__vccOpts || e;
117
- for (const [o, r] of t)
118
- n[o] = r;
119
- return n;
120
- };
121
- var fn;
122
- const zr = typeof window < "u";
123
- zr && (fn = window == null ? void 0 : window.navigator) != null && fn.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent);
124
- function Qr(e) {
125
- return e;
126
- }
127
- const pn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, hn = "__vueuse_ssr_handlers__";
128
- pn[hn] = pn[hn] || {};
129
- var mn;
130
- (function(e) {
131
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
132
- })(mn || (mn = {}));
133
- var qr = Object.defineProperty, vn = Object.getOwnPropertySymbols, Kr = Object.prototype.hasOwnProperty, Jr = Object.prototype.propertyIsEnumerable, gn = (e, t, n) => t in e ? qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Yr = (e, t) => {
134
- for (var n in t || (t = {}))
135
- Kr.call(t, n) && gn(e, n, t[n]);
136
- if (vn)
137
- for (var n of vn(t))
138
- Jr.call(t, n) && gn(e, n, t[n]);
139
- return e;
140
- };
141
- const Xr = {
142
- easeInSine: [0.12, 0, 0.39, 0],
143
- easeOutSine: [0.61, 1, 0.88, 1],
144
- easeInOutSine: [0.37, 0, 0.63, 1],
145
- easeInQuad: [0.11, 0, 0.5, 0],
146
- easeOutQuad: [0.5, 1, 0.89, 1],
147
- easeInOutQuad: [0.45, 0, 0.55, 1],
148
- easeInCubic: [0.32, 0, 0.67, 0],
149
- easeOutCubic: [0.33, 1, 0.68, 1],
150
- easeInOutCubic: [0.65, 0, 0.35, 1],
151
- easeInQuart: [0.5, 0, 0.75, 0],
152
- easeOutQuart: [0.25, 1, 0.5, 1],
153
- easeInOutQuart: [0.76, 0, 0.24, 1],
154
- easeInQuint: [0.64, 0, 0.78, 0],
155
- easeOutQuint: [0.22, 1, 0.36, 1],
156
- easeInOutQuint: [0.83, 0, 0.17, 1],
157
- easeInExpo: [0.7, 0, 0.84, 0],
158
- easeOutExpo: [0.16, 1, 0.3, 1],
159
- easeInOutExpo: [0.87, 0, 0.13, 1],
160
- easeInCirc: [0.55, 0, 1, 0.45],
161
- easeOutCirc: [0, 0.55, 0.45, 1],
162
- easeInOutCirc: [0.85, 0, 0.15, 1],
163
- easeInBack: [0.36, 0, 0.66, -0.56],
164
- easeOutBack: [0.34, 1.56, 0.64, 1],
165
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
166
- };
167
- Yr({
168
- linear: Qr
169
- }, Xr);
170
- q({
171
- name: "ADropdown",
172
- props: {
173
- modelValue: {
174
- type: String,
175
- required: !1,
176
- default: ""
177
- },
178
- label: {
179
- type: String,
180
- required: !0
181
- },
182
- value: String,
183
- items: {
184
- type: Array,
185
- required: !1,
186
- default: () => []
187
- },
188
- isAsync: {
189
- type: Boolean,
190
- required: !1,
191
- default: !1
192
- }
193
- },
194
- emits: ["update:modelValue", "filterChanged"],
195
- data() {
196
- return {
197
- results: [],
198
- search: this.modelValue,
199
- isLoading: !1,
200
- arrowCounter: 0,
201
- isOpen: !1
202
- };
203
- },
204
- watch: {
205
- items: function(e, t) {
206
- this.isLoading = !1, this.results = e;
207
- }
208
- },
209
- mounted() {
210
- document.addEventListener("click", this.handleClickOutside), this.filterResults();
211
- },
212
- destroyed() {
213
- document.removeEventListener("click", this.handleClickOutside);
214
- },
215
- methods: {
216
- setResult(e) {
217
- this.search = e, this.closeResults();
218
- },
219
- filterResults() {
220
- this.results = this.items.filter((e) => e.toLowerCase().indexOf(this.search.toLowerCase()) > -1);
221
- },
222
- onChange() {
223
- this.isOpen = !0, this.isAsync ? (this.isLoading = !0, this.$emit("filterChanged", this.search)) : this.filterResults();
224
- },
225
- handleClickOutside(e) {
226
- this.$el.contains(e.target) || (this.closeResults(), this.arrowCounter = 0);
227
- },
228
- closeResults() {
229
- this.isOpen = !1, this.items.includes(this.search) || (this.search = ""), this.$emit("update:modelValue", this.search);
230
- },
231
- onArrowDown() {
232
- this.arrowCounter < this.results.length && (this.arrowCounter = this.arrowCounter + 1);
233
- },
234
- onArrowUp() {
235
- this.arrowCounter > 0 && (this.arrowCounter = this.arrowCounter - 1);
236
- },
237
- onEnter() {
238
- this.search = this.results[this.arrowCounter], this.closeResults(), this.arrowCounter = 0;
239
- },
240
- openWithSearch() {
241
- this.search = "", this.onChange(), this.$refs.mopInput.focus();
242
- }
243
- }
244
- });
245
- const Zr = /* @__PURE__ */ q({
246
- __name: "AForm",
247
- props: {
248
- modelValue: {},
249
- data: {},
250
- readonly: { type: Boolean }
251
- },
252
- emits: ["update:modelValue"],
253
- setup(e, { emit: t }) {
254
- const n = e, o = t, r = V(n.data || {}), s = (a) => {
255
- let l = {};
256
- for (const [u, c] of Object.entries(a))
257
- ["component", "fieldtype"].includes(u) || (l[u] = c), u === "rows" && c && c.length === 0 && (l.rows = r.value[a.fieldname]);
258
- return l;
259
- }, i = B({
260
- get: () => n.modelValue.map((a, l) => B({
261
- get() {
262
- return a.value;
263
- },
264
- set: (u) => {
265
- n.modelValue[l].value = u, o("update:modelValue", n.modelValue);
266
- }
267
- })),
268
- set: () => {
269
- }
270
- });
271
- return (a, l) => (C(), A("form", null, [
272
- (C(!0), A(Ie, null, Pe(a.modelValue, (u, c) => (C(), Se(Bt(u.component), Ut({
273
- key: c,
274
- schema: u,
275
- modelValue: i.value[c].value,
276
- "onUpdate:modelValue": (d) => i.value[c].value = d,
277
- data: r.value[u.fieldname],
278
- readonly: a.readonly
279
- }, s(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
280
- ]));
281
- }
282
- }), es = /* @__PURE__ */ Gr(Zr, [["__scopeId", "data-v-74d66cf2"]]), yn = {
283
- date: "##/##/####",
284
- datetime: "####/##/## ##:##",
285
- time: "##:##",
286
- fulltime: "##:##:##",
287
- phone: "(###) ### - ####",
288
- card: "#### #### #### ####"
289
- };
290
- function ts(e) {
291
- try {
292
- return Function(`"use strict";return (${e})`)();
293
- } catch {
294
- }
295
- }
296
- function ns(e) {
297
- var t;
298
- let n = e.value;
299
- if (n) {
300
- const o = ts(n);
301
- if (o) {
302
- const r = e.instance.locale;
303
- n = o(r);
304
- }
305
- } else {
306
- const o = (t = e.instance.schema.fieldtype) == null ? void 0 : t.toLowerCase();
307
- o && yn[o] && (n = yn[o]);
308
- }
309
- return n;
310
- }
311
- function os(e, t) {
312
- t || (t = "#");
313
- let n = e;
314
- const o = [t, "/", "-", "(", ")", " "];
315
- for (const r of o)
316
- n = n.replaceAll(r, "");
317
- return n;
318
- }
319
- function rs(e, t, n) {
320
- n || (n = "#");
321
- let o = t;
322
- for (const r of e) {
323
- const s = o.indexOf(n);
324
- if (s !== -1) {
325
- const i = o.substring(0, s), a = o.substring(s + 1);
326
- o = i + r + a;
327
- }
328
- }
329
- return o.slice(0, t.length);
330
- }
331
- function ss(e, t) {
332
- const n = ns(t);
333
- if (!n)
334
- return;
335
- const o = "#", r = e.value, s = os(r, o);
336
- if (s) {
337
- const i = rs(s, n, o);
338
- t.instance.maskFilled && (t.instance.maskFilled = !i.includes(o)), e.value = i;
339
- } else
340
- e.value = n;
341
- }
342
- q({
343
- name: "ATextInput",
344
- props: {
345
- schema: {
346
- type: Object,
347
- required: !0
348
- },
349
- label: {
350
- type: String,
351
- required: !0
352
- },
353
- modelValue: {
354
- type: null
355
- },
356
- mask: {
357
- type: String
358
- },
359
- required: {
360
- type: Boolean
361
- },
362
- readonly: {
363
- type: Boolean
364
- },
365
- uuid: {
366
- type: String
367
- },
368
- validation: {
369
- type: Object,
370
- default: () => ({ errorMessage: "&nbsp;" })
371
- }
372
- },
373
- setup(e, t) {
374
- const n = V(!1), o = Z("locale", "");
375
- return { inputText: B({
376
- get() {
377
- return e.modelValue;
378
- },
379
- set(r) {
380
- t.emit("update:modelValue", r);
381
- }
382
- }), locale: o, maskFilled: n };
383
- },
384
- directives: {
385
- mask: ss
386
- }
387
- });
388
- function It(e) {
389
- this.message = e || "";
390
- }
391
- It.prototype = Object.create(Error.prototype, {
392
- constructor: { value: It },
393
- name: { value: "NotImplemented" },
394
- stack: {
395
- get: function() {
396
- return new Error().stack;
397
- }
398
- }
399
- });
400
- class je {
401
- /**
402
- * @constructor
403
- * @param {Registry} registry - The immutable registry
404
- * @param {ReturnType<typeof useDataStore>} store - The mutable Pinia store
405
- * @param {Schema} [schema] - (optional) The Stonecrop schema
406
- * @param {ImmutableDoctype['workflow']} [workflow] - (optional) The Stonecrop workflow
407
- * @param {ImmutableDoctype['actions']} [actions] - (optional) The Stonecrop actions
408
- * @returns {Stonecrop} The Stonecrop instance
409
- * @description The Stonecrop constructor initializes a new Stonecrop instance with the given registry, store, schema, workflow, and actions. If a Stonecrop instance has already been created, it returns the existing instance instead of creating a new one.
410
- * @example
411
- * const registry = new Registry()
412
- * const store = useDataStore()
413
- * const stonecrop = new Stonecrop(registry, store, schema, workflow, actions)
414
- */
415
- constructor(t, n, o, r, s) {
416
- if (this.name = "Stonecrop", je._root)
417
- return je._root;
418
- je._root = this, this.registry = t, this.store = n, this.schema = o, this.workflow = r, this.actions = s;
419
- }
420
- /**
421
- * @method setup
422
- * @param {DoctypeMeta} doctype - The doctype to setup
423
- * @returns {void}
424
- * @description Sets up the Stonecrop instance with the given doctype
425
- * @example
426
- * const doctype = await registry.getMeta('Task')
427
- * stonecrop.setup(doctype)
428
- */
429
- setup(t) {
430
- this.getMeta(t), this.getWorkflow(t), this.getActions(t);
431
- }
432
- /**
433
- * @method getMeta
434
- * @param {DoctypeMeta} doctype - The doctype to get meta for
435
- * @returns {DoctypeMeta}
436
- * @see {@link DoctypeMeta}
437
- * @throws NotImplementedError
438
- * @description Gets the meta for the given doctype
439
- * @example
440
- * const doctype = await registry.getMeta('Task')
441
- * const meta = stonecrop.getMeta(doctype)
442
- */
443
- getMeta(t) {
444
- return this.registry.getMeta ? this.registry.getMeta(t.doctype) : new It(t.doctype);
445
- }
446
- /**
447
- * @method getWorkflow
448
- * @param {DoctypeMeta} doctype - The doctype to get workflow for
449
- * @returns {void}
450
- * @description Gets the workflow for the given doctype
451
- * @example
452
- * const doctype = await registry.getMeta('Task')
453
- * stonecrop.getWorkflow(doctype)
454
- */
455
- getWorkflow(t) {
456
- const n = this.registry.registry[t.slug];
457
- this.workflow = n.workflow;
458
- }
459
- /**
460
- * @method getActions
461
- * @param {DoctypeMeta} doctype - The doctype to get actions for
462
- * @returns {void}
463
- * @description Gets the actions for the given doctype
464
- * @example
465
- * const doctype = await registry.getMeta('Task')
466
- * stonecrop.getActions(doctype)
467
- */
468
- getActions(t) {
469
- const n = this.registry.registry[t.slug];
470
- this.actions = n.actions;
471
- }
472
- /**
473
- * @method getRecords
474
- * @param {DoctypeMeta} doctype - The doctype to get records for
475
- * @param {RequestInit} [filters] - The filters to apply to the records
476
- * @returns {Promise<void>}
477
- * @description Gets the records for the given doctype
478
- * @example
479
- * const doctype = await registry.getMeta('Task')
480
- * await stonecrop.getRecords(doctype)
481
- * @example
482
- * const doctype = await registry.getMeta('Task')
483
- * const filters = JSON.stringify({ status: 'Open' })
484
- * await stonecrop.getRecords(doctype, { body: filters })
485
- */
486
- async getRecords(t, n) {
487
- this.store.$patch({ records: [] });
488
- const r = await (await fetch(`/${t.slug}`, n)).json();
489
- this.store.$patch({ records: r });
490
- }
491
- /**
492
- * @method getRecord
493
- * @param {DoctypeMeta} doctype - The doctype to get record for
494
- * @param {string} id - The id of the record to get
495
- * @returns {Promise<void>}
496
- * @description Gets the record for the given doctype and id
497
- * @example
498
- * const doctype = await registry.getMeta('Task')
499
- * await stonecrop.getRecord(doctype, 'TASK-00001')
500
- */
501
- async getRecord(t, n) {
502
- this.store.$patch({ record: {} });
503
- const r = await (await fetch(`/${t.slug}/${n}`)).json();
504
- this.store.$patch({ record: r });
505
- }
506
- /**
507
- * @method runAction
508
- * @param {DoctypeMeta} doctype - The doctype to run action for
509
- * @param {string} action - The action to run
510
- * @param {string[]} [id] - The id(s) of the record(s) to run action on
511
- * @returns {void}
512
- * @description Runs the action for the given doctype and id
513
- * @example
514
- * const doctype = await registry.getMeta('Task')
515
- * stonecrop.runAction(doctype, 'CREATE')
516
- * @example
517
- * const doctype = await registry.getMeta('Task')
518
- * stonecrop.runAction(doctype, 'UPDATE', ['TASK-00001'])
519
- * @example
520
- * const doctype = await registry.getMeta('Task')
521
- * stonecrop.runAction(doctype, 'DELETE', ['TASK-00001'])
522
- * @example
523
- * const doctype = await registry.getMeta('Task')
524
- * stonecrop.runAction(doctype, 'TRANSITION', ['TASK-00001', 'TASK-00002'])
525
- */
526
- runAction(t, n, o) {
527
- const s = this.registry.registry[t.slug].actions.get(n), { initialState: i } = this.workflow;
528
- this.workflow.transition(i, { type: n }), s.length > 0 && s.forEach((a) => {
529
- new Function(a)(o);
530
- });
531
- }
532
- }
533
- var yo = !1;
534
- function Xe(e, t, n) {
535
- return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
536
- }
537
- function wt(e, t) {
538
- if (Array.isArray(e)) {
539
- e.splice(t, 1);
540
- return;
541
- }
542
- delete e[t];
543
- }
544
- function as() {
545
- return wo().__VUE_DEVTOOLS_GLOBAL_HOOK__;
546
- }
547
- function wo() {
548
- return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
549
- }
550
- const is = typeof Proxy == "function", cs = "devtools-plugin:setup", ls = "plugin:settings:set";
551
- let $e, Pt;
552
- function us() {
553
- var e;
554
- return $e !== void 0 || (typeof window < "u" && window.performance ? ($e = !0, Pt = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? ($e = !0, Pt = global.perf_hooks.performance) : $e = !1), $e;
555
- }
556
- function ds() {
557
- return us() ? Pt.now() : Date.now();
558
- }
559
- class fs {
560
- constructor(t, n) {
561
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
562
- const o = {};
563
- if (t.settings)
564
- for (const i in t.settings) {
565
- const a = t.settings[i];
566
- o[i] = a.defaultValue;
567
- }
568
- const r = `__vue-devtools-plugin-settings__${t.id}`;
569
- let s = Object.assign({}, o);
570
- try {
571
- const i = localStorage.getItem(r), a = JSON.parse(i);
572
- Object.assign(s, a);
573
- } catch {
574
- }
575
- this.fallbacks = {
576
- getSettings() {
577
- return s;
578
- },
579
- setSettings(i) {
580
- try {
581
- localStorage.setItem(r, JSON.stringify(i));
582
- } catch {
583
- }
584
- s = i;
585
- },
586
- now() {
587
- return ds();
588
- }
589
- }, n && n.on(ls, (i, a) => {
590
- i === this.plugin.id && this.fallbacks.setSettings(a);
591
- }), this.proxiedOn = new Proxy({}, {
592
- get: (i, a) => this.target ? this.target.on[a] : (...l) => {
593
- this.onQueue.push({
594
- method: a,
595
- args: l
596
- });
597
- }
598
- }), this.proxiedTarget = new Proxy({}, {
599
- get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...l) => (this.targetQueue.push({
600
- method: a,
601
- args: l,
602
- resolve: () => {
603
- }
604
- }), this.fallbacks[a](...l)) : (...l) => new Promise((u) => {
605
- this.targetQueue.push({
606
- method: a,
607
- args: l,
608
- resolve: u
609
- });
610
- })
611
- });
612
- }
613
- async setRealTarget(t) {
614
- this.target = t;
615
- for (const n of this.onQueue)
616
- this.target.on[n.method](...n.args);
617
- for (const n of this.targetQueue)
618
- n.resolve(await this.target[n.method](...n.args));
619
- }
620
- }
621
- function zt(e, t) {
622
- const n = e, o = wo(), r = as(), s = is && n.enableEarlyProxy;
623
- if (r && (o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
624
- r.emit(cs, e, t);
625
- else {
626
- const i = s ? new fs(n, r) : null;
627
- (o.__VUE_DEVTOOLS_PLUGINS__ = o.__VUE_DEVTOOLS_PLUGINS__ || []).push({
628
- pluginDescriptor: n,
629
- setupFn: t,
630
- proxy: i
631
- }), i && t(i.proxiedTarget);
632
- }
633
- }
634
- /*!
635
- * pinia v2.1.7
636
- * (c) 2023 Eduardo San Martin Morote
637
- * @license MIT
638
- */
639
- let Le;
640
- const Ge = (e) => Le = e, bo = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
641
- /* istanbul ignore next */
642
- Symbol()
643
- );
644
- function Ce(e) {
645
- return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
646
- }
647
- var oe;
648
- (function(e) {
649
- e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
650
- })(oe || (oe = {}));
651
- const dt = typeof window < "u", Be = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && dt, wn = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
652
- function ps(e, { autoBom: t = !1 } = {}) {
653
- return t && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
654
- }
655
- function Qt(e, t, n) {
656
- const o = new XMLHttpRequest();
657
- o.open("GET", e), o.responseType = "blob", o.onload = function() {
658
- ko(o.response, t, n);
659
- }, o.onerror = function() {
660
- console.error("could not download file");
661
- }, o.send();
662
- }
663
- function _o(e) {
664
- const t = new XMLHttpRequest();
665
- t.open("HEAD", e, !1);
666
- try {
667
- t.send();
668
- } catch {
669
- }
670
- return t.status >= 200 && t.status <= 299;
671
- }
672
- function ot(e) {
673
- try {
674
- e.dispatchEvent(new MouseEvent("click"));
675
- } catch {
676
- const n = document.createEvent("MouseEvents");
677
- n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(n);
678
- }
679
- }
680
- const rt = typeof navigator == "object" ? navigator : { userAgent: "" }, Eo = /Macintosh/.test(rt.userAgent) && /AppleWebKit/.test(rt.userAgent) && !/Safari/.test(rt.userAgent), ko = dt ? (
681
- // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
682
- typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !Eo ? hs : (
683
- // Use msSaveOrOpenBlob as a second approach
684
- "msSaveOrOpenBlob" in rt ? ms : (
685
- // Fallback to using FileReader and a popup
686
- vs
687
- )
688
- )
689
- ) : () => {
690
- };
691
- function hs(e, t = "download", n) {
692
- const o = document.createElement("a");
693
- o.download = t, o.rel = "noopener", typeof e == "string" ? (o.href = e, o.origin !== location.origin ? _o(o.href) ? Qt(e, t, n) : (o.target = "_blank", ot(o)) : ot(o)) : (o.href = URL.createObjectURL(e), setTimeout(function() {
694
- URL.revokeObjectURL(o.href);
695
- }, 4e4), setTimeout(function() {
696
- ot(o);
697
- }, 0));
698
- }
699
- function ms(e, t = "download", n) {
700
- if (typeof e == "string")
701
- if (_o(e))
702
- Qt(e, t, n);
703
- else {
704
- const o = document.createElement("a");
705
- o.href = e, o.target = "_blank", setTimeout(function() {
706
- ot(o);
707
- });
708
- }
709
- else
710
- navigator.msSaveOrOpenBlob(ps(e, n), t);
711
- }
712
- function vs(e, t, n, o) {
713
- if (o = o || open("", "_blank"), o && (o.document.title = o.document.body.innerText = "downloading..."), typeof e == "string")
714
- return Qt(e, t, n);
715
- const r = e.type === "application/octet-stream", s = /constructor/i.test(String(wn.HTMLElement)) || "safari" in wn, i = /CriOS\/[\d]+/.test(navigator.userAgent);
716
- if ((i || r && s || Eo) && typeof FileReader < "u") {
717
- const a = new FileReader();
718
- a.onloadend = function() {
719
- let l = a.result;
720
- if (typeof l != "string")
721
- throw o = null, new Error("Wrong reader.result type");
722
- l = i ? l : l.replace(/^data:[^;]*;/, "data:attachment/file;"), o ? o.location.href = l : location.assign(l), o = null;
723
- }, a.readAsDataURL(e);
724
- } else {
725
- const a = URL.createObjectURL(e);
726
- o ? o.location.assign(a) : location.href = a, o = null, setTimeout(function() {
727
- URL.revokeObjectURL(a);
728
- }, 4e4);
729
- }
730
- }
731
- function H(e, t) {
732
- const n = "🍍 " + e;
733
- typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(n, t) : t === "error" ? console.error(n) : t === "warn" ? console.warn(n) : console.log(n);
734
- }
735
- function qt(e) {
736
- return "_a" in e && "install" in e;
737
- }
738
- function So() {
739
- if (!("clipboard" in navigator))
740
- return H("Your browser doesn't support the Clipboard API", "error"), !0;
741
- }
742
- function Oo(e) {
743
- return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (H('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
744
- }
745
- async function gs(e) {
746
- if (!So())
747
- try {
748
- await navigator.clipboard.writeText(JSON.stringify(e.state.value)), H("Global state copied to clipboard.");
749
- } catch (t) {
750
- if (Oo(t))
751
- return;
752
- H("Failed to serialize the state. Check the console for more details.", "error"), console.error(t);
753
- }
754
- }
755
- async function ys(e) {
756
- if (!So())
757
- try {
758
- Io(e, JSON.parse(await navigator.clipboard.readText())), H("Global state pasted from clipboard.");
759
- } catch (t) {
760
- if (Oo(t))
761
- return;
762
- H("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(t);
763
- }
764
- }
765
- async function ws(e) {
766
- try {
767
- ko(new Blob([JSON.stringify(e.state.value)], {
768
- type: "text/plain;charset=utf-8"
769
- }), "pinia-state.json");
770
- } catch (t) {
771
- H("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(t);
772
- }
773
- }
774
- let re;
775
- function bs() {
776
- re || (re = document.createElement("input"), re.type = "file", re.accept = ".json");
777
- function e() {
778
- return new Promise((t, n) => {
779
- re.onchange = async () => {
780
- const o = re.files;
781
- if (!o)
782
- return t(null);
783
- const r = o.item(0);
784
- return t(r ? { text: await r.text(), file: r } : null);
785
- }, re.oncancel = () => t(null), re.onerror = n, re.click();
786
- });
787
- }
788
- return e;
789
- }
790
- async function _s(e) {
791
- try {
792
- const n = await bs()();
793
- if (!n)
794
- return;
795
- const { text: o, file: r } = n;
796
- Io(e, JSON.parse(o)), H(`Global state imported from "${r.name}".`);
797
- } catch (t) {
798
- H("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(t);
799
- }
800
- }
801
- function Io(e, t) {
802
- for (const n in t) {
803
- const o = e.state.value[n];
804
- o ? Object.assign(o, t[n]) : e.state.value[n] = t[n];
805
- }
806
- }
807
- function te(e) {
808
- return {
809
- _custom: {
810
- display: e
811
- }
812
- };
813
- }
814
- const Po = "🍍 Pinia (root)", Ct = "_root";
815
- function Es(e) {
816
- return qt(e) ? {
817
- id: Ct,
818
- label: Po
819
- } : {
820
- id: e.$id,
821
- label: e.$id
822
- };
823
- }
824
- function ks(e) {
825
- if (qt(e)) {
826
- const n = Array.from(e._s.keys()), o = e._s;
827
- return {
828
- state: n.map((s) => ({
829
- editable: !0,
830
- key: s,
831
- value: e.state.value[s]
832
- })),
833
- getters: n.filter((s) => o.get(s)._getters).map((s) => {
834
- const i = o.get(s);
835
- return {
836
- editable: !1,
837
- key: s,
838
- value: i._getters.reduce((a, l) => (a[l] = i[l], a), {})
839
- };
840
- })
841
- };
842
- }
843
- const t = {
844
- state: Object.keys(e.$state).map((n) => ({
845
- editable: !0,
846
- key: n,
847
- value: e.$state[n]
848
- }))
849
- };
850
- return e._getters && e._getters.length && (t.getters = e._getters.map((n) => ({
851
- editable: !1,
852
- key: n,
853
- value: e[n]
854
- }))), e._customProperties.size && (t.customProperties = Array.from(e._customProperties).map((n) => ({
855
- editable: !0,
856
- key: n,
857
- value: e[n]
858
- }))), t;
859
- }
860
- function Ss(e) {
861
- return e ? Array.isArray(e) ? e.reduce((t, n) => (t.keys.push(n.key), t.operations.push(n.type), t.oldValue[n.key] = n.oldValue, t.newValue[n.key] = n.newValue, t), {
862
- oldValue: {},
863
- keys: [],
864
- operations: [],
865
- newValue: {}
866
- }) : {
867
- operation: te(e.type),
868
- key: te(e.key),
869
- oldValue: e.oldValue,
870
- newValue: e.newValue
871
- } : {};
872
- }
873
- function Os(e) {
874
- switch (e) {
875
- case oe.direct:
876
- return "mutation";
877
- case oe.patchFunction:
878
- return "$patch";
879
- case oe.patchObject:
880
- return "$patch";
881
- default:
882
- return "unknown";
883
- }
884
- }
885
- let Re = !0;
886
- const st = [], be = "pinia:mutations", z = "pinia", { assign: Is } = Object, ct = (e) => "🍍 " + e;
887
- function Ps(e, t) {
888
- zt({
889
- id: "dev.esm.pinia",
890
- label: "Pinia 🍍",
891
- logo: "https://pinia.vuejs.org/logo.svg",
892
- packageName: "pinia",
893
- homepage: "https://pinia.vuejs.org",
894
- componentStateTypes: st,
895
- app: e
896
- }, (n) => {
897
- typeof n.now != "function" && H("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), n.addTimelineLayer({
898
- id: be,
899
- label: "Pinia 🍍",
900
- color: 15064968
901
- }), n.addInspector({
902
- id: z,
903
- label: "Pinia 🍍",
904
- icon: "storage",
905
- treeFilterPlaceholder: "Search stores",
906
- actions: [
907
- {
908
- icon: "content_copy",
909
- action: () => {
910
- gs(t);
911
- },
912
- tooltip: "Serialize and copy the state"
913
- },
914
- {
915
- icon: "content_paste",
916
- action: async () => {
917
- await ys(t), n.sendInspectorTree(z), n.sendInspectorState(z);
918
- },
919
- tooltip: "Replace the state with the content of your clipboard"
920
- },
921
- {
922
- icon: "save",
923
- action: () => {
924
- ws(t);
925
- },
926
- tooltip: "Save the state as a JSON file"
927
- },
928
- {
929
- icon: "folder_open",
930
- action: async () => {
931
- await _s(t), n.sendInspectorTree(z), n.sendInspectorState(z);
932
- },
933
- tooltip: "Import the state from a JSON file"
934
- }
935
- ],
936
- nodeActions: [
937
- {
938
- icon: "restore",
939
- tooltip: 'Reset the state (with "$reset")',
940
- action: (o) => {
941
- const r = t._s.get(o);
942
- r ? typeof r.$reset != "function" ? H(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`, "warn") : (r.$reset(), H(`Store "${o}" reset.`)) : H(`Cannot reset "${o}" store because it wasn't found.`, "warn");
943
- }
944
- }
945
- ]
946
- }), n.on.inspectComponent((o, r) => {
947
- const s = o.componentInstance && o.componentInstance.proxy;
948
- if (s && s._pStores) {
949
- const i = o.componentInstance.proxy._pStores;
950
- Object.values(i).forEach((a) => {
951
- o.instanceData.state.push({
952
- type: ct(a.$id),
953
- key: "state",
954
- editable: !0,
955
- value: a._isOptionsAPI ? {
956
- _custom: {
957
- value: ut(a.$state),
958
- actions: [
959
- {
960
- icon: "restore",
961
- tooltip: "Reset the state of this store",
962
- action: () => a.$reset()
963
- }
964
- ]
965
- }
966
- } : (
967
- // NOTE: workaround to unwrap transferred refs
968
- Object.keys(a.$state).reduce((l, u) => (l[u] = a.$state[u], l), {})
969
- )
970
- }), a._getters && a._getters.length && o.instanceData.state.push({
971
- type: ct(a.$id),
972
- key: "getters",
973
- editable: !1,
974
- value: a._getters.reduce((l, u) => {
975
- try {
976
- l[u] = a[u];
977
- } catch (c) {
978
- l[u] = c;
979
- }
980
- return l;
981
- }, {})
982
- });
983
- });
984
- }
985
- }), n.on.getInspectorTree((o) => {
986
- if (o.app === e && o.inspectorId === z) {
987
- let r = [t];
988
- r = r.concat(Array.from(t._s.values())), o.rootNodes = (o.filter ? r.filter((s) => "$id" in s ? s.$id.toLowerCase().includes(o.filter.toLowerCase()) : Po.toLowerCase().includes(o.filter.toLowerCase())) : r).map(Es);
989
- }
990
- }), n.on.getInspectorState((o) => {
991
- if (o.app === e && o.inspectorId === z) {
992
- const r = o.nodeId === Ct ? t : t._s.get(o.nodeId);
993
- if (!r)
994
- return;
995
- r && (o.state = ks(r));
996
- }
997
- }), n.on.editInspectorState((o, r) => {
998
- if (o.app === e && o.inspectorId === z) {
999
- const s = o.nodeId === Ct ? t : t._s.get(o.nodeId);
1000
- if (!s)
1001
- return H(`store "${o.nodeId}" not found`, "error");
1002
- const { path: i } = o;
1003
- qt(s) ? i.unshift("state") : (i.length !== 1 || !s._customProperties.has(i[0]) || i[0] in s.$state) && i.unshift("$state"), Re = !1, o.set(s, i, o.state.value), Re = !0;
1004
- }
1005
- }), n.on.editComponentState((o) => {
1006
- if (o.type.startsWith("🍍")) {
1007
- const r = o.type.replace(/^🍍\s*/, ""), s = t._s.get(r);
1008
- if (!s)
1009
- return H(`store "${r}" not found`, "error");
1010
- const { path: i } = o;
1011
- if (i[0] !== "state")
1012
- return H(`Invalid path for store "${r}":
1013
- ${i}
1014
- Only state can be modified.`);
1015
- i[0] = "$state", Re = !1, o.set(s, i, o.state.value), Re = !0;
1016
- }
1017
- });
1018
- });
1019
- }
1020
- function Cs(e, t) {
1021
- st.includes(ct(t.$id)) || st.push(ct(t.$id)), zt({
1022
- id: "dev.esm.pinia",
1023
- label: "Pinia 🍍",
1024
- logo: "https://pinia.vuejs.org/logo.svg",
1025
- packageName: "pinia",
1026
- homepage: "https://pinia.vuejs.org",
1027
- componentStateTypes: st,
1028
- app: e,
1029
- settings: {
1030
- logStoreChanges: {
1031
- label: "Notify about new/deleted stores",
1032
- type: "boolean",
1033
- defaultValue: !0
1034
- }
1035
- // useEmojis: {
1036
- // label: 'Use emojis in messages ⚡️',
1037
- // type: 'boolean',
1038
- // defaultValue: true,
1039
- // },
1040
- }
1041
- }, (n) => {
1042
- const o = typeof n.now == "function" ? n.now.bind(n) : Date.now;
1043
- t.$onAction(({ after: i, onError: a, name: l, args: u }) => {
1044
- const c = Co++;
1045
- n.addTimelineEvent({
1046
- layerId: be,
1047
- event: {
1048
- time: o(),
1049
- title: "🛫 " + l,
1050
- subtitle: "start",
1051
- data: {
1052
- store: te(t.$id),
1053
- action: te(l),
1054
- args: u
1055
- },
1056
- groupId: c
1057
- }
1058
- }), i((d) => {
1059
- ve = void 0, n.addTimelineEvent({
1060
- layerId: be,
1061
- event: {
1062
- time: o(),
1063
- title: "🛬 " + l,
1064
- subtitle: "end",
1065
- data: {
1066
- store: te(t.$id),
1067
- action: te(l),
1068
- args: u,
1069
- result: d
1070
- },
1071
- groupId: c
1072
- }
1073
- });
1074
- }), a((d) => {
1075
- ve = void 0, n.addTimelineEvent({
1076
- layerId: be,
1077
- event: {
1078
- time: o(),
1079
- logType: "error",
1080
- title: "💥 " + l,
1081
- subtitle: "end",
1082
- data: {
1083
- store: te(t.$id),
1084
- action: te(l),
1085
- args: u,
1086
- error: d
1087
- },
1088
- groupId: c
1089
- }
1090
- });
1091
- });
1092
- }, !0), t._customProperties.forEach((i) => {
1093
- ue(() => k(t[i]), (a, l) => {
1094
- n.notifyComponentUpdate(), n.sendInspectorState(z), Re && n.addTimelineEvent({
1095
- layerId: be,
1096
- event: {
1097
- time: o(),
1098
- title: "Change",
1099
- subtitle: i,
1100
- data: {
1101
- newValue: a,
1102
- oldValue: l
1103
- },
1104
- groupId: ve
1105
- }
1106
- });
1107
- }, { deep: !0 });
1108
- }), t.$subscribe(({ events: i, type: a }, l) => {
1109
- if (n.notifyComponentUpdate(), n.sendInspectorState(z), !Re)
1110
- return;
1111
- const u = {
1112
- time: o(),
1113
- title: Os(a),
1114
- data: Is({ store: te(t.$id) }, Ss(i)),
1115
- groupId: ve
1116
- };
1117
- a === oe.patchFunction ? u.subtitle = "⤵️" : a === oe.patchObject ? u.subtitle = "🧩" : i && !Array.isArray(i) && (u.subtitle = i.type), i && (u.data["rawEvent(s)"] = {
1118
- _custom: {
1119
- display: "DebuggerEvent",
1120
- type: "object",
1121
- tooltip: "raw DebuggerEvent[]",
1122
- value: i
1123
- }
1124
- }), n.addTimelineEvent({
1125
- layerId: be,
1126
- event: u
1127
- });
1128
- }, { detached: !0, flush: "sync" });
1129
- const r = t._hotUpdate;
1130
- t._hotUpdate = Ee((i) => {
1131
- r(i), n.addTimelineEvent({
1132
- layerId: be,
1133
- event: {
1134
- time: o(),
1135
- title: "🔥 " + t.$id,
1136
- subtitle: "HMR update",
1137
- data: {
1138
- store: te(t.$id),
1139
- info: te("HMR update")
1140
- }
1141
- }
1142
- }), n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z);
1143
- });
1144
- const { $dispose: s } = t;
1145
- t.$dispose = () => {
1146
- s(), n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z), n.getSettings().logStoreChanges && H(`Disposed "${t.$id}" store 🗑`);
1147
- }, n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z), n.getSettings().logStoreChanges && H(`"${t.$id}" store installed 🆕`);
1148
- });
1149
- }
1150
- let Co = 0, ve;
1151
- function bn(e, t, n) {
1152
- const o = t.reduce((r, s) => (r[s] = ut(e)[s], r), {});
1153
- for (const r in o)
1154
- e[r] = function() {
1155
- const s = Co, i = n ? new Proxy(e, {
1156
- get(...l) {
1157
- return ve = s, Reflect.get(...l);
1158
- },
1159
- set(...l) {
1160
- return ve = s, Reflect.set(...l);
1161
- }
1162
- }) : e;
1163
- ve = s;
1164
- const a = o[r].apply(i, arguments);
1165
- return ve = void 0, a;
1166
- };
1167
- }
1168
- function xs({ app: e, store: t, options: n }) {
1169
- if (t.$id.startsWith("__hot:"))
1170
- return;
1171
- t._isOptionsAPI = !!n.state, bn(t, Object.keys(n.actions), t._isOptionsAPI);
1172
- const o = t._hotUpdate;
1173
- ut(t)._hotUpdate = function(r) {
1174
- o.apply(this, arguments), bn(t, Object.keys(r._hmrPayload.actions), !!t._isOptionsAPI);
1175
- }, Cs(
1176
- e,
1177
- // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
1178
- t
1179
- );
1180
- }
1181
- function $s() {
1182
- const e = fo(!0), t = e.run(() => V({}));
1183
- let n = [], o = [];
1184
- const r = Ee({
1185
- install(s) {
1186
- Ge(r), r._a = s, s.provide(bo, r), s.config.globalProperties.$pinia = r, Be && Ps(s, r), o.forEach((i) => n.push(i)), o = [];
1187
- },
1188
- use(s) {
1189
- return !this._a && !yo ? o.push(s) : n.push(s), this;
1190
- },
1191
- _p: n,
1192
- // it's actually undefined here
1193
- // @ts-expect-error
1194
- _a: null,
1195
- _e: e,
1196
- _s: /* @__PURE__ */ new Map(),
1197
- state: t
1198
- });
1199
- return Be && typeof Proxy < "u" && r.use(xs), r;
1200
- }
1201
- function xo(e, t) {
1202
- for (const n in t) {
1203
- const o = t[n];
1204
- if (!(n in e))
1205
- continue;
1206
- const r = e[n];
1207
- Ce(r) && Ce(o) && !We(o) && !Wt(o) ? e[n] = xo(r, o) : e[n] = o;
1208
- }
1209
- return e;
1210
- }
1211
- const $o = () => {
1212
- };
1213
- function _n(e, t, n, o = $o) {
1214
- e.push(t);
1215
- const r = () => {
1216
- const s = e.indexOf(t);
1217
- s > -1 && (e.splice(s, 1), o());
1218
- };
1219
- return !n && po() && ho(r), r;
1220
- }
1221
- function Ne(e, ...t) {
1222
- e.slice().forEach((n) => {
1223
- n(...t);
1224
- });
1225
- }
1226
- const Ns = (e) => e();
1227
- function xt(e, t) {
1228
- e instanceof Map && t instanceof Map && t.forEach((n, o) => e.set(o, n)), e instanceof Set && t instanceof Set && t.forEach(e.add, e);
1229
- for (const n in t) {
1230
- if (!t.hasOwnProperty(n))
1231
- continue;
1232
- const o = t[n], r = e[n];
1233
- Ce(r) && Ce(o) && e.hasOwnProperty(n) && !We(o) && !Wt(o) ? e[n] = xt(r, o) : e[n] = o;
1234
- }
1235
- return e;
1236
- }
1237
- const Rs = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
1238
- /* istanbul ignore next */
1239
- Symbol()
1240
- );
1241
- function As(e) {
1242
- return !Ce(e) || !e.hasOwnProperty(Rs);
1243
- }
1244
- const { assign: X } = Object;
1245
- function En(e) {
1246
- return !!(We(e) && e.effect);
1247
- }
1248
- function kn(e, t, n, o) {
1249
- const { state: r, actions: s, getters: i } = t, a = n.state.value[e];
1250
- let l;
1251
- function u() {
1252
- !a && (process.env.NODE_ENV === "production" || !o) && (n.state.value[e] = r ? r() : {});
1253
- const c = process.env.NODE_ENV !== "production" && o ? (
1254
- // use ref() to unwrap refs inside state TODO: check if this is still necessary
1255
- dn(V(r ? r() : {}).value)
1256
- ) : dn(n.state.value[e]);
1257
- return X(c, s, Object.keys(i || {}).reduce((d, f) => (process.env.NODE_ENV !== "production" && f in c && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${f}" in store "${e}".`), d[f] = Ee(B(() => {
1258
- Ge(n);
1259
- const p = n._s.get(e);
1260
- return i[f].call(p, p);
1261
- })), d), {}));
1262
- }
1263
- return l = $t(e, u, t, n, o, !0), l;
1264
- }
1265
- function $t(e, t, n = {}, o, r, s) {
1266
- let i;
1267
- const a = X({ actions: {} }, n);
1268
- if (process.env.NODE_ENV !== "production" && !o._e.active)
1269
- throw new Error("Pinia destroyed");
1270
- const l = {
1271
- deep: !0
1272
- // flush: 'post',
1273
- };
1274
- process.env.NODE_ENV !== "production" && !yo && (l.onTrigger = (E) => {
1275
- u ? p = E : u == !1 && !S._hotUpdating && (Array.isArray(p) ? p.push(E) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
1276
- });
1277
- let u, c, d = [], f = [], p;
1278
- const v = o.state.value[e];
1279
- !s && !v && (process.env.NODE_ENV === "production" || !r) && (o.state.value[e] = {});
1280
- const m = V({});
1281
- let w;
1282
- function O(E) {
1283
- let b;
1284
- u = c = !1, process.env.NODE_ENV !== "production" && (p = []), typeof E == "function" ? (E(o.state.value[e]), b = {
1285
- type: oe.patchFunction,
1286
- storeId: e,
1287
- events: p
1288
- }) : (xt(o.state.value[e], E), b = {
1289
- type: oe.patchObject,
1290
- payload: E,
1291
- storeId: e,
1292
- events: p
1293
- });
1294
- const D = w = Symbol();
1295
- Fe().then(() => {
1296
- w === D && (u = !0);
1297
- }), c = !0, Ne(d, b, o.state.value[e]);
1298
- }
1299
- const I = s ? function() {
1300
- const { state: b } = n, D = b ? b() : {};
1301
- this.$patch((U) => {
1302
- X(U, D);
1303
- });
1304
- } : (
1305
- /* istanbul ignore next */
1306
- process.env.NODE_ENV !== "production" ? () => {
1307
- throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
1308
- } : $o
1309
- );
1310
- function M() {
1311
- i.stop(), d = [], f = [], o._s.delete(e);
1312
- }
1313
- function W(E, b) {
1314
- return function() {
1315
- Ge(o);
1316
- const D = Array.from(arguments), U = [], ye = [];
1317
- function De(G) {
1318
- U.push(G);
1319
- }
1320
- function Ke(G) {
1321
- ye.push(G);
1322
- }
1323
- Ne(f, {
1324
- args: D,
1325
- name: E,
1326
- store: S,
1327
- after: De,
1328
- onError: Ke
1329
- });
1330
- let ne;
1331
- try {
1332
- ne = b.apply(this && this.$id === e ? this : S, D);
1333
- } catch (G) {
1334
- throw Ne(ye, G), G;
1335
- }
1336
- return ne instanceof Promise ? ne.then((G) => (Ne(U, G), G)).catch((G) => (Ne(ye, G), Promise.reject(G))) : (Ne(U, ne), ne);
1337
- };
1338
- }
1339
- const J = /* @__PURE__ */ Ee({
1340
- actions: {},
1341
- getters: {},
1342
- state: [],
1343
- hotState: m
1344
- }), Y = {
1345
- _p: o,
1346
- // _s: scope,
1347
- $id: e,
1348
- $onAction: _n.bind(null, f),
1349
- $patch: O,
1350
- $reset: I,
1351
- $subscribe(E, b = {}) {
1352
- const D = _n(d, E, b.detached, () => U()), U = i.run(() => ue(() => o.state.value[e], (ye) => {
1353
- (b.flush === "sync" ? c : u) && E({
1354
- storeId: e,
1355
- type: oe.direct,
1356
- events: p
1357
- }, ye);
1358
- }, X({}, l, b)));
1359
- return D;
1360
- },
1361
- $dispose: M
1362
- }, S = _e(process.env.NODE_ENV !== "production" || Be ? X(
1363
- {
1364
- _hmrPayload: J,
1365
- _customProperties: Ee(/* @__PURE__ */ new Set())
1366
- // devtools custom properties
1367
- },
1368
- Y
1369
- // must be added later
1370
- // setupStore
1371
- ) : Y);
1372
- o._s.set(e, S);
1373
- const ee = (o._a && o._a.runWithContext || Ns)(() => o._e.run(() => (i = fo()).run(t)));
1374
- for (const E in ee) {
1375
- const b = ee[E];
1376
- if (We(b) && !En(b) || Wt(b))
1377
- process.env.NODE_ENV !== "production" && r ? Xe(m.value, E, yt(ee, E)) : s || (v && As(b) && (We(b) ? b.value = v[E] : xt(b, v[E])), o.state.value[e][E] = b), process.env.NODE_ENV !== "production" && J.state.push(E);
1378
- else if (typeof b == "function") {
1379
- const D = process.env.NODE_ENV !== "production" && r ? b : W(E, b);
1380
- ee[E] = D, process.env.NODE_ENV !== "production" && (J.actions[E] = b), a.actions[E] = b;
1381
- } else
1382
- process.env.NODE_ENV !== "production" && En(b) && (J.getters[E] = s ? (
1383
- // @ts-expect-error
1384
- n.getters[E]
1385
- ) : b, dt && (ee._getters || // @ts-expect-error: same
1386
- (ee._getters = Ee([]))).push(E));
1387
- }
1388
- if (X(S, ee), X(ut(S), ee), Object.defineProperty(S, "$state", {
1389
- get: () => process.env.NODE_ENV !== "production" && r ? m.value : o.state.value[e],
1390
- set: (E) => {
1391
- if (process.env.NODE_ENV !== "production" && r)
1392
- throw new Error("cannot set hotState");
1393
- O((b) => {
1394
- X(b, E);
1395
- });
1396
- }
1397
- }), process.env.NODE_ENV !== "production" && (S._hotUpdate = Ee((E) => {
1398
- S._hotUpdating = !0, E._hmrPayload.state.forEach((b) => {
1399
- if (b in S.$state) {
1400
- const D = E.$state[b], U = S.$state[b];
1401
- typeof D == "object" && Ce(D) && Ce(U) ? xo(D, U) : E.$state[b] = U;
1402
- }
1403
- Xe(S, b, yt(E.$state, b));
1404
- }), Object.keys(S.$state).forEach((b) => {
1405
- b in E.$state || wt(S, b);
1406
- }), u = !1, c = !1, o.state.value[e] = yt(E._hmrPayload, "hotState"), c = !0, Fe().then(() => {
1407
- u = !0;
1408
- });
1409
- for (const b in E._hmrPayload.actions) {
1410
- const D = E[b];
1411
- Xe(S, b, W(b, D));
1412
- }
1413
- for (const b in E._hmrPayload.getters) {
1414
- const D = E._hmrPayload.getters[b], U = s ? (
1415
- // special handling of options api
1416
- B(() => (Ge(o), D.call(S, S)))
1417
- ) : D;
1418
- Xe(S, b, U);
1419
- }
1420
- Object.keys(S._hmrPayload.getters).forEach((b) => {
1421
- b in E._hmrPayload.getters || wt(S, b);
1422
- }), Object.keys(S._hmrPayload.actions).forEach((b) => {
1423
- b in E._hmrPayload.actions || wt(S, b);
1424
- }), S._hmrPayload = E._hmrPayload, S._getters = E._getters, S._hotUpdating = !1;
1425
- })), Be) {
1426
- const E = {
1427
- writable: !0,
1428
- configurable: !0,
1429
- // avoid warning on devtools trying to display this property
1430
- enumerable: !1
1431
- };
1432
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((b) => {
1433
- Object.defineProperty(S, b, X({ value: S[b] }, E));
1434
- });
1435
- }
1436
- return o._p.forEach((E) => {
1437
- if (Be) {
1438
- const b = i.run(() => E({
1439
- store: S,
1440
- app: o._a,
1441
- pinia: o,
1442
- options: a
1443
- }));
1444
- Object.keys(b || {}).forEach((D) => S._customProperties.add(D)), X(S, b);
1445
- } else
1446
- X(S, i.run(() => E({
1447
- store: S,
1448
- app: o._a,
1449
- pinia: o,
1450
- options: a
1451
- })));
1452
- }), process.env.NODE_ENV !== "production" && S.$state && typeof S.$state == "object" && typeof S.$state.constructor == "function" && !S.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
1453
- state: () => new MyClass()
1454
- Found in store "${S.$id}".`), v && s && n.hydrate && n.hydrate(S.$state, v), u = !0, c = !0, S;
1455
- }
1456
- function Ts(e, t, n) {
1457
- let o, r;
1458
- const s = typeof t == "function";
1459
- if (typeof e == "string")
1460
- o = e, r = s ? n : t;
1461
- else if (r = e, o = e.id, process.env.NODE_ENV !== "production" && typeof o != "string")
1462
- throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
1463
- function i(a, l) {
1464
- const u = _r();
1465
- if (a = // in test mode, ignore the argument provided as we can always retrieve a
1466
- // pinia instance with getActivePinia()
1467
- (process.env.NODE_ENV === "test" && Le && Le._testing ? null : a) || (u ? Z(bo, null) : null), a && Ge(a), process.env.NODE_ENV !== "production" && !Le)
1468
- throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1469
- See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1470
- This will fail in production.`);
1471
- a = Le, a._s.has(o) || (s ? $t(o, t, r, a) : kn(o, r, a), process.env.NODE_ENV !== "production" && (i._pinia = a));
1472
- const c = a._s.get(o);
1473
- if (process.env.NODE_ENV !== "production" && l) {
1474
- const d = "__hot:" + o, f = s ? $t(d, t, r, a, !0) : kn(d, X({}, r), a, !0);
1475
- l._hotUpdate(f), delete a.state.value[d], a._s.delete(d);
1476
- }
1477
- if (process.env.NODE_ENV !== "production" && dt) {
1478
- const d = Ht();
1479
- if (d && d.proxy && // avoid adding stores that are just built for hot module replacement
1480
- !l) {
1481
- const f = d.proxy, p = "_pStores" in f ? f._pStores : f._pStores = {};
1482
- p[o] = c;
1483
- }
1484
- }
1485
- return c;
1486
- }
1487
- return i.$id = o, i;
1488
- }
1489
- const Ds = Ts("data", () => {
1490
- const e = V([]), t = V({});
1491
- return { records: e, record: t };
1492
- });
1493
- function No(e) {
1494
- e || (e = Z("$registry"));
1495
- const t = Ds(), n = V(new je(e, t)), o = V(!1);
1496
- return wr(async () => {
1497
- var r, s;
1498
- const i = e.router.currentRoute.value, a = (r = i.params.records) == null ? void 0 : r.toString().toLowerCase(), l = (s = i.params.record) == null ? void 0 : s.toString().toLowerCase();
1499
- if (!a && !l)
1500
- return;
1501
- const u = await e.getMeta(a);
1502
- e.addDoctype(u), n.value.setup(u), a && (l ? await n.value.getRecord(u, l) : await n.value.getRecords(u)), n.value.runAction(u, "LOAD", l ? [l] : void 0), o.value = !0;
1503
- }), { stonecrop: n, isReady: o };
1504
- }
1505
- /*!
1506
- * vue-router v4.2.5
1507
- * (c) 2023 Eduardo San Martin Morote
1508
- * @license MIT
1509
- */
1510
- const ae = typeof window < "u";
1511
- function Vs(e) {
1512
- return e.__esModule || e[Symbol.toStringTag] === "Module";
1513
- }
1514
- const R = Object.assign;
1515
- function bt(e, t) {
1516
- const n = {};
1517
- for (const o in t) {
1518
- const r = t[o];
1519
- n[o] = K(r) ? r.map(e) : e(r);
1520
- }
1521
- return n;
1522
- }
1523
- const Ue = () => {
1524
- }, K = Array.isArray;
1525
- function $(e) {
1526
- const t = Array.from(arguments).slice(1);
1527
- console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
1528
- }
1529
- const Ms = /\/$/, Ls = (e) => e.replace(Ms, "");
1530
- function _t(e, t, n = "/") {
1531
- let o, r = {}, s = "", i = "";
1532
- const a = t.indexOf("#");
1533
- let l = t.indexOf("?");
1534
- return a < l && a >= 0 && (l = -1), l > -1 && (o = t.slice(0, l), s = t.slice(l + 1, a > -1 ? a : t.length), r = e(s)), a > -1 && (o = o || t.slice(0, a), i = t.slice(a, t.length)), o = Us(o ?? t, n), {
1535
- fullPath: o + (s && "?") + s + i,
1536
- path: o,
1537
- query: r,
1538
- hash: i
1539
- };
1540
- }
1541
- function js(e, t) {
1542
- const n = t.query ? e(t.query) : "";
1543
- return t.path + (n && "?") + n + (t.hash || "");
1544
- }
1545
- function Sn(e, t) {
1546
- return !t || !e.toLowerCase().startsWith(t.toLowerCase()) ? e : e.slice(t.length) || "/";
1547
- }
1548
- function On(e, t, n) {
1549
- const o = t.matched.length - 1, r = n.matched.length - 1;
1550
- return o > -1 && o === r && ge(t.matched[o], n.matched[r]) && Ro(t.params, n.params) && e(t.query) === e(n.query) && t.hash === n.hash;
1551
- }
1552
- function ge(e, t) {
1553
- return (e.aliasOf || e) === (t.aliasOf || t);
1554
- }
1555
- function Ro(e, t) {
1556
- if (Object.keys(e).length !== Object.keys(t).length)
1557
- return !1;
1558
- for (const n in e)
1559
- if (!Bs(e[n], t[n]))
1560
- return !1;
1561
- return !0;
1562
- }
1563
- function Bs(e, t) {
1564
- return K(e) ? In(e, t) : K(t) ? In(t, e) : e === t;
1565
- }
1566
- function In(e, t) {
1567
- return K(t) ? e.length === t.length && e.every((n, o) => n === t[o]) : e.length === 1 && e[0] === t;
1568
- }
1569
- function Us(e, t) {
1570
- if (e.startsWith("/"))
1571
- return e;
1572
- if (process.env.NODE_ENV !== "production" && !t.startsWith("/"))
1573
- return $(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`), e;
1574
- if (!e)
1575
- return t;
1576
- const n = t.split("/"), o = e.split("/"), r = o[o.length - 1];
1577
- (r === ".." || r === ".") && o.push("");
1578
- let s = n.length - 1, i, a;
1579
- for (i = 0; i < o.length; i++)
1580
- if (a = o[i], a !== ".")
1581
- if (a === "..")
1582
- s > 1 && s--;
1583
- else
1584
- break;
1585
- return n.slice(0, s).join("/") + "/" + o.slice(i - (i === o.length ? 1 : 0)).join("/");
1586
- }
1587
- var ze;
1588
- (function(e) {
1589
- e.pop = "pop", e.push = "push";
1590
- })(ze || (ze = {}));
1591
- var He;
1592
- (function(e) {
1593
- e.back = "back", e.forward = "forward", e.unknown = "";
1594
- })(He || (He = {}));
1595
- function Hs(e) {
1596
- if (!e)
1597
- if (ae) {
1598
- const t = document.querySelector("base");
1599
- e = t && t.getAttribute("href") || "/", e = e.replace(/^\w+:\/\/[^\/]+/, "");
1600
- } else
1601
- e = "/";
1602
- return e[0] !== "/" && e[0] !== "#" && (e = "/" + e), Ls(e);
1603
- }
1604
- const Ws = /^[^#]+#/;
1605
- function Fs(e, t) {
1606
- return e.replace(Ws, "#") + t;
1607
- }
1608
- function Gs(e, t) {
1609
- const n = document.documentElement.getBoundingClientRect(), o = e.getBoundingClientRect();
1610
- return {
1611
- behavior: t.behavior,
1612
- left: o.left - n.left - (t.left || 0),
1613
- top: o.top - n.top - (t.top || 0)
1614
- };
1615
- }
1616
- const ft = () => ({
1617
- left: window.pageXOffset,
1618
- top: window.pageYOffset
1619
- });
1620
- function zs(e) {
1621
- let t;
1622
- if ("el" in e) {
1623
- const n = e.el, o = typeof n == "string" && n.startsWith("#");
1624
- if (process.env.NODE_ENV !== "production" && typeof e.el == "string" && (!o || !document.getElementById(e.el.slice(1))))
1625
- try {
1626
- const s = document.querySelector(e.el);
1627
- if (o && s) {
1628
- $(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);
1629
- return;
1630
- }
1631
- } catch {
1632
- $(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
1633
- return;
1634
- }
1635
- const r = typeof n == "string" ? o ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
1636
- if (!r) {
1637
- process.env.NODE_ENV !== "production" && $(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);
1638
- return;
1639
- }
1640
- t = Gs(r, e);
1641
- } else
1642
- t = e;
1643
- "scrollBehavior" in document.documentElement.style ? window.scrollTo(t) : window.scrollTo(t.left != null ? t.left : window.pageXOffset, t.top != null ? t.top : window.pageYOffset);
1644
- }
1645
- function Pn(e, t) {
1646
- return (history.state ? history.state.position - t : -1) + e;
1647
- }
1648
- const Nt = /* @__PURE__ */ new Map();
1649
- function Qs(e, t) {
1650
- Nt.set(e, t);
1651
- }
1652
- function qs(e) {
1653
- const t = Nt.get(e);
1654
- return Nt.delete(e), t;
1655
- }
1656
- let Ks = () => location.protocol + "//" + location.host;
1657
- function Ao(e, t) {
1658
- const { pathname: n, search: o, hash: r } = t, s = e.indexOf("#");
1659
- if (s > -1) {
1660
- let a = r.includes(e.slice(s)) ? e.slice(s).length : 1, l = r.slice(a);
1661
- return l[0] !== "/" && (l = "/" + l), Sn(l, "");
1662
- }
1663
- return Sn(n, e) + o + r;
1664
- }
1665
- function Js(e, t, n, o) {
1666
- let r = [], s = [], i = null;
1667
- const a = ({ state: f }) => {
1668
- const p = Ao(e, location), v = n.value, m = t.value;
1669
- let w = 0;
1670
- if (f) {
1671
- if (n.value = p, t.value = f, i && i === v) {
1672
- i = null;
1673
- return;
1674
- }
1675
- w = m ? f.position - m.position : 0;
1676
- } else
1677
- o(p);
1678
- r.forEach((O) => {
1679
- O(n.value, v, {
1680
- delta: w,
1681
- type: ze.pop,
1682
- direction: w ? w > 0 ? He.forward : He.back : He.unknown
1683
- });
1684
- });
1685
- };
1686
- function l() {
1687
- i = n.value;
1688
- }
1689
- function u(f) {
1690
- r.push(f);
1691
- const p = () => {
1692
- const v = r.indexOf(f);
1693
- v > -1 && r.splice(v, 1);
1694
- };
1695
- return s.push(p), p;
1696
- }
1697
- function c() {
1698
- const { history: f } = window;
1699
- f.state && f.replaceState(R({}, f.state, { scroll: ft() }), "");
1700
- }
1701
- function d() {
1702
- for (const f of s)
1703
- f();
1704
- s = [], window.removeEventListener("popstate", a), window.removeEventListener("beforeunload", c);
1705
- }
1706
- return window.addEventListener("popstate", a), window.addEventListener("beforeunload", c, {
1707
- passive: !0
1708
- }), {
1709
- pauseListeners: l,
1710
- listen: u,
1711
- destroy: d
1712
- };
1713
- }
1714
- function Cn(e, t, n, o = !1, r = !1) {
1715
- return {
1716
- back: e,
1717
- current: t,
1718
- forward: n,
1719
- replaced: o,
1720
- position: window.history.length,
1721
- scroll: r ? ft() : null
1722
- };
1723
- }
1724
- function Ys(e) {
1725
- const { history: t, location: n } = window, o = {
1726
- value: Ao(e, n)
1727
- }, r = { value: t.state };
1728
- r.value || s(o.value, {
1729
- back: null,
1730
- current: o.value,
1731
- forward: null,
1732
- // the length is off by one, we need to decrease it
1733
- position: t.length - 1,
1734
- replaced: !0,
1735
- // don't add a scroll as the user may have an anchor, and we want
1736
- // scrollBehavior to be triggered without a saved position
1737
- scroll: null
1738
- }, !0);
1739
- function s(l, u, c) {
1740
- const d = e.indexOf("#"), f = d > -1 ? (n.host && document.querySelector("base") ? e : e.slice(d)) + l : Ks() + e + l;
1741
- try {
1742
- t[c ? "replaceState" : "pushState"](u, "", f), r.value = u;
1743
- } catch (p) {
1744
- process.env.NODE_ENV !== "production" ? $("Error with push/replace State", p) : console.error(p), n[c ? "replace" : "assign"](f);
1745
- }
1746
- }
1747
- function i(l, u) {
1748
- const c = R({}, t.state, Cn(
1749
- r.value.back,
1750
- // keep back and forward entries but override current position
1751
- l,
1752
- r.value.forward,
1753
- !0
1754
- ), u, { position: r.value.position });
1755
- s(l, c, !0), o.value = l;
1756
- }
1757
- function a(l, u) {
1758
- const c = R(
1759
- {},
1760
- // use current history state to gracefully handle a wrong call to
1761
- // history.replaceState
1762
- // https://github.com/vuejs/router/issues/366
1763
- r.value,
1764
- t.state,
1765
- {
1766
- forward: l,
1767
- scroll: ft()
1768
- }
1769
- );
1770
- process.env.NODE_ENV !== "production" && !t.state && $(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
1771
-
1772
- history.replaceState(history.state, '', url)
1773
-
1774
- You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`), s(c.current, c, !0);
1775
- const d = R({}, Cn(o.value, l, null), { position: c.position + 1 }, u);
1776
- s(l, d, !1), o.value = l;
1777
- }
1778
- return {
1779
- location: o,
1780
- state: r,
1781
- push: a,
1782
- replace: i
1783
- };
1784
- }
1785
- function Xs(e) {
1786
- e = Hs(e);
1787
- const t = Ys(e), n = Js(e, t.state, t.location, t.replace);
1788
- function o(s, i = !0) {
1789
- i || n.pauseListeners(), history.go(s);
1790
- }
1791
- const r = R({
1792
- // it's overridden right after
1793
- location: "",
1794
- base: e,
1795
- go: o,
1796
- createHref: Fs.bind(null, e)
1797
- }, t, n);
1798
- return Object.defineProperty(r, "location", {
1799
- enumerable: !0,
1800
- get: () => t.location.value
1801
- }), Object.defineProperty(r, "state", {
1802
- enumerable: !0,
1803
- get: () => t.state.value
1804
- }), r;
1805
- }
1806
- function Zs(e) {
1807
- return typeof e == "string" || e && typeof e == "object";
1808
- }
1809
- function To(e) {
1810
- return typeof e == "string" || typeof e == "symbol";
1811
- }
1812
- const pe = {
1813
- path: "/",
1814
- name: void 0,
1815
- params: {},
1816
- query: {},
1817
- hash: "",
1818
- fullPath: "/",
1819
- matched: [],
1820
- meta: {},
1821
- redirectedFrom: void 0
1822
- }, Rt = Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
1823
- var xn;
1824
- (function(e) {
1825
- e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
1826
- })(xn || (xn = {}));
1827
- const ea = {
1828
- 1({ location: e, currentLocation: t }) {
1829
- return `No match for
1830
- ${JSON.stringify(e)}${t ? `
1831
- while being at
1832
- ` + JSON.stringify(t) : ""}`;
1833
- },
1834
- 2({ from: e, to: t }) {
1835
- return `Redirected from "${e.fullPath}" to "${na(t)}" via a navigation guard.`;
1836
- },
1837
- 4({ from: e, to: t }) {
1838
- return `Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`;
1839
- },
1840
- 8({ from: e, to: t }) {
1841
- return `Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`;
1842
- },
1843
- 16({ from: e, to: t }) {
1844
- return `Avoided redundant navigation to current location: "${e.fullPath}".`;
1845
- }
1846
- };
1847
- function Te(e, t) {
1848
- return process.env.NODE_ENV !== "production" ? R(new Error(ea[e](t)), {
1849
- type: e,
1850
- [Rt]: !0
1851
- }, t) : R(new Error(), {
1852
- type: e,
1853
- [Rt]: !0
1854
- }, t);
1855
- }
1856
- function se(e, t) {
1857
- return e instanceof Error && Rt in e && (t == null || !!(e.type & t));
1858
- }
1859
- const ta = ["params", "query", "hash"];
1860
- function na(e) {
1861
- if (typeof e == "string")
1862
- return e;
1863
- if ("path" in e)
1864
- return e.path;
1865
- const t = {};
1866
- for (const n of ta)
1867
- n in e && (t[n] = e[n]);
1868
- return JSON.stringify(t, null, 2);
1869
- }
1870
- const $n = "[^/]+?", oa = {
1871
- sensitive: !1,
1872
- strict: !1,
1873
- start: !0,
1874
- end: !0
1875
- }, ra = /[.+*?^${}()[\]/\\]/g;
1876
- function sa(e, t) {
1877
- const n = R({}, oa, t), o = [];
1878
- let r = n.start ? "^" : "";
1879
- const s = [];
1880
- for (const u of e) {
1881
- const c = u.length ? [] : [
1882
- 90
1883
- /* PathScore.Root */
1884
- ];
1885
- n.strict && !u.length && (r += "/");
1886
- for (let d = 0; d < u.length; d++) {
1887
- const f = u[d];
1888
- let p = 40 + (n.sensitive ? 0.25 : 0);
1889
- if (f.type === 0)
1890
- d || (r += "/"), r += f.value.replace(ra, "\\$&"), p += 40;
1891
- else if (f.type === 1) {
1892
- const { value: v, repeatable: m, optional: w, regexp: O } = f;
1893
- s.push({
1894
- name: v,
1895
- repeatable: m,
1896
- optional: w
1897
- });
1898
- const I = O || $n;
1899
- if (I !== $n) {
1900
- p += 10;
1901
- try {
1902
- new RegExp(`(${I})`);
1903
- } catch (W) {
1904
- throw new Error(`Invalid custom RegExp for param "${v}" (${I}): ` + W.message);
1905
- }
1906
- }
1907
- let M = m ? `((?:${I})(?:/(?:${I}))*)` : `(${I})`;
1908
- d || (M = // avoid an optional / if there are more segments e.g. /:p?-static
1909
- // or /:p?-:p2
1910
- w && u.length < 2 ? `(?:/${M})` : "/" + M), w && (M += "?"), r += M, p += 20, w && (p += -8), m && (p += -20), I === ".*" && (p += -50);
1911
- }
1912
- c.push(p);
1913
- }
1914
- o.push(c);
1915
- }
1916
- if (n.strict && n.end) {
1917
- const u = o.length - 1;
1918
- o[u][o[u].length - 1] += 0.7000000000000001;
1919
- }
1920
- n.strict || (r += "/?"), n.end ? r += "$" : n.strict && (r += "(?:/|$)");
1921
- const i = new RegExp(r, n.sensitive ? "" : "i");
1922
- function a(u) {
1923
- const c = u.match(i), d = {};
1924
- if (!c)
1925
- return null;
1926
- for (let f = 1; f < c.length; f++) {
1927
- const p = c[f] || "", v = s[f - 1];
1928
- d[v.name] = p && v.repeatable ? p.split("/") : p;
1929
- }
1930
- return d;
1931
- }
1932
- function l(u) {
1933
- let c = "", d = !1;
1934
- for (const f of e) {
1935
- (!d || !c.endsWith("/")) && (c += "/"), d = !1;
1936
- for (const p of f)
1937
- if (p.type === 0)
1938
- c += p.value;
1939
- else if (p.type === 1) {
1940
- const { value: v, repeatable: m, optional: w } = p, O = v in u ? u[v] : "";
1941
- if (K(O) && !m)
1942
- throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);
1943
- const I = K(O) ? O.join("/") : O;
1944
- if (!I)
1945
- if (w)
1946
- f.length < 2 && (c.endsWith("/") ? c = c.slice(0, -1) : d = !0);
1947
- else
1948
- throw new Error(`Missing required param "${v}"`);
1949
- c += I;
1950
- }
1951
- }
1952
- return c || "/";
1953
- }
1954
- return {
1955
- re: i,
1956
- score: o,
1957
- keys: s,
1958
- parse: a,
1959
- stringify: l
1960
- };
1961
- }
1962
- function aa(e, t) {
1963
- let n = 0;
1964
- for (; n < e.length && n < t.length; ) {
1965
- const o = t[n] - e[n];
1966
- if (o)
1967
- return o;
1968
- n++;
1969
- }
1970
- return e.length < t.length ? e.length === 1 && e[0] === 80 ? -1 : 1 : e.length > t.length ? t.length === 1 && t[0] === 80 ? 1 : -1 : 0;
1971
- }
1972
- function ia(e, t) {
1973
- let n = 0;
1974
- const o = e.score, r = t.score;
1975
- for (; n < o.length && n < r.length; ) {
1976
- const s = aa(o[n], r[n]);
1977
- if (s)
1978
- return s;
1979
- n++;
1980
- }
1981
- if (Math.abs(r.length - o.length) === 1) {
1982
- if (Nn(o))
1983
- return 1;
1984
- if (Nn(r))
1985
- return -1;
1986
- }
1987
- return r.length - o.length;
1988
- }
1989
- function Nn(e) {
1990
- const t = e[e.length - 1];
1991
- return e.length > 0 && t[t.length - 1] < 0;
1992
- }
1993
- const ca = {
1994
- type: 0,
1995
- value: ""
1996
- }, la = /[a-zA-Z0-9_]/;
1997
- function ua(e) {
1998
- if (!e)
1999
- return [[]];
2000
- if (e === "/")
2001
- return [[ca]];
2002
- if (!e.startsWith("/"))
2003
- throw new Error(process.env.NODE_ENV !== "production" ? `Route paths should start with a "/": "${e}" should be "/${e}".` : `Invalid path "${e}"`);
2004
- function t(p) {
2005
- throw new Error(`ERR (${n})/"${u}": ${p}`);
2006
- }
2007
- let n = 0, o = n;
2008
- const r = [];
2009
- let s;
2010
- function i() {
2011
- s && r.push(s), s = [];
2012
- }
2013
- let a = 0, l, u = "", c = "";
2014
- function d() {
2015
- u && (n === 0 ? s.push({
2016
- type: 0,
2017
- value: u
2018
- }) : n === 1 || n === 2 || n === 3 ? (s.length > 1 && (l === "*" || l === "+") && t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`), s.push({
2019
- type: 1,
2020
- value: u,
2021
- regexp: c,
2022
- repeatable: l === "*" || l === "+",
2023
- optional: l === "*" || l === "?"
2024
- })) : t("Invalid state to consume buffer"), u = "");
2025
- }
2026
- function f() {
2027
- u += l;
2028
- }
2029
- for (; a < e.length; ) {
2030
- if (l = e[a++], l === "\\" && n !== 2) {
2031
- o = n, n = 4;
2032
- continue;
2033
- }
2034
- switch (n) {
2035
- case 0:
2036
- l === "/" ? (u && d(), i()) : l === ":" ? (d(), n = 1) : f();
2037
- break;
2038
- case 4:
2039
- f(), n = o;
2040
- break;
2041
- case 1:
2042
- l === "(" ? n = 2 : la.test(l) ? f() : (d(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--);
2043
- break;
2044
- case 2:
2045
- l === ")" ? c[c.length - 1] == "\\" ? c = c.slice(0, -1) + l : n = 3 : c += l;
2046
- break;
2047
- case 3:
2048
- d(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--, c = "";
2049
- break;
2050
- default:
2051
- t("Unknown state");
2052
- break;
2053
- }
2054
- }
2055
- return n === 2 && t(`Unfinished custom RegExp for param "${u}"`), d(), i(), r;
2056
- }
2057
- function da(e, t, n) {
2058
- const o = sa(ua(e.path), n);
2059
- if (process.env.NODE_ENV !== "production") {
2060
- const s = /* @__PURE__ */ new Set();
2061
- for (const i of o.keys)
2062
- s.has(i.name) && $(`Found duplicated params with name "${i.name}" for path "${e.path}". Only the last one will be available on "$route.params".`), s.add(i.name);
2063
- }
2064
- const r = R(o, {
2065
- record: e,
2066
- parent: t,
2067
- // these needs to be populated by the parent
2068
- children: [],
2069
- alias: []
2070
- });
2071
- return t && !r.record.aliasOf == !t.record.aliasOf && t.children.push(r), r;
2072
- }
2073
- function fa(e, t) {
2074
- const n = [], o = /* @__PURE__ */ new Map();
2075
- t = Tn({ strict: !1, end: !0, sensitive: !1 }, t);
2076
- function r(c) {
2077
- return o.get(c);
2078
- }
2079
- function s(c, d, f) {
2080
- const p = !f, v = pa(c);
2081
- process.env.NODE_ENV !== "production" && ga(v, d), v.aliasOf = f && f.record;
2082
- const m = Tn(t, c), w = [
2083
- v
2084
- ];
2085
- if ("alias" in c) {
2086
- const M = typeof c.alias == "string" ? [c.alias] : c.alias;
2087
- for (const W of M)
2088
- w.push(R({}, v, {
2089
- // this allows us to hold a copy of the `components` option
2090
- // so that async components cache is hold on the original record
2091
- components: f ? f.record.components : v.components,
2092
- path: W,
2093
- // we might be the child of an alias
2094
- aliasOf: f ? f.record : v
2095
- // the aliases are always of the same kind as the original since they
2096
- // are defined on the same record
2097
- }));
2098
- }
2099
- let O, I;
2100
- for (const M of w) {
2101
- const { path: W } = M;
2102
- if (d && W[0] !== "/") {
2103
- const J = d.record.path, Y = J[J.length - 1] === "/" ? "" : "/";
2104
- M.path = d.record.path + (W && Y + W);
2105
- }
2106
- if (process.env.NODE_ENV !== "production" && M.path === "*")
2107
- throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
2108
- See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);
2109
- if (O = da(M, d, m), process.env.NODE_ENV !== "production" && d && W[0] === "/" && ya(O, d), f ? (f.alias.push(O), process.env.NODE_ENV !== "production" && va(f, O)) : (I = I || O, I !== O && I.alias.push(O), p && c.name && !An(O) && i(c.name)), v.children) {
2110
- const J = v.children;
2111
- for (let Y = 0; Y < J.length; Y++)
2112
- s(J[Y], O, f && f.children[Y]);
2113
- }
2114
- f = f || O, (O.record.components && Object.keys(O.record.components).length || O.record.name || O.record.redirect) && l(O);
2115
- }
2116
- return I ? () => {
2117
- i(I);
2118
- } : Ue;
2119
- }
2120
- function i(c) {
2121
- if (To(c)) {
2122
- const d = o.get(c);
2123
- d && (o.delete(c), n.splice(n.indexOf(d), 1), d.children.forEach(i), d.alias.forEach(i));
2124
- } else {
2125
- const d = n.indexOf(c);
2126
- d > -1 && (n.splice(d, 1), c.record.name && o.delete(c.record.name), c.children.forEach(i), c.alias.forEach(i));
2127
- }
2128
- }
2129
- function a() {
2130
- return n;
2131
- }
2132
- function l(c) {
2133
- let d = 0;
2134
- for (; d < n.length && ia(c, n[d]) >= 0 && // Adding children with empty path should still appear before the parent
2135
- // https://github.com/vuejs/router/issues/1124
2136
- (c.record.path !== n[d].record.path || !Do(c, n[d])); )
2137
- d++;
2138
- n.splice(d, 0, c), c.record.name && !An(c) && o.set(c.record.name, c);
2139
- }
2140
- function u(c, d) {
2141
- let f, p = {}, v, m;
2142
- if ("name" in c && c.name) {
2143
- if (f = o.get(c.name), !f)
2144
- throw Te(1, {
2145
- location: c
2146
- });
2147
- if (process.env.NODE_ENV !== "production") {
2148
- const I = Object.keys(c.params || {}).filter((M) => !f.keys.find((W) => W.name === M));
2149
- I.length && $(`Discarded invalid param(s) "${I.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
2150
- }
2151
- m = f.record.name, p = R(
2152
- // paramsFromLocation is a new object
2153
- Rn(
2154
- d.params,
2155
- // only keep params that exist in the resolved location
2156
- // TODO: only keep optional params coming from a parent record
2157
- f.keys.filter((I) => !I.optional).map((I) => I.name)
2158
- ),
2159
- // discard any existing params in the current location that do not exist here
2160
- // #1497 this ensures better active/exact matching
2161
- c.params && Rn(c.params, f.keys.map((I) => I.name))
2162
- ), v = f.stringify(p);
2163
- } else if ("path" in c)
2164
- v = c.path, process.env.NODE_ENV !== "production" && !v.startsWith("/") && $(`The Matcher cannot resolve relative paths but received "${v}". Unless you directly called \`matcher.resolve("${v}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), f = n.find((I) => I.re.test(v)), f && (p = f.parse(v), m = f.record.name);
2165
- else {
2166
- if (f = d.name ? o.get(d.name) : n.find((I) => I.re.test(d.path)), !f)
2167
- throw Te(1, {
2168
- location: c,
2169
- currentLocation: d
2170
- });
2171
- m = f.record.name, p = R({}, d.params, c.params), v = f.stringify(p);
2172
- }
2173
- const w = [];
2174
- let O = f;
2175
- for (; O; )
2176
- w.unshift(O.record), O = O.parent;
2177
- return {
2178
- name: m,
2179
- path: v,
2180
- params: p,
2181
- matched: w,
2182
- meta: ma(w)
2183
- };
2184
- }
2185
- return e.forEach((c) => s(c)), { addRoute: s, resolve: u, removeRoute: i, getRoutes: a, getRecordMatcher: r };
2186
- }
2187
- function Rn(e, t) {
2188
- const n = {};
2189
- for (const o of t)
2190
- o in e && (n[o] = e[o]);
2191
- return n;
2192
- }
2193
- function pa(e) {
2194
- return {
2195
- path: e.path,
2196
- redirect: e.redirect,
2197
- name: e.name,
2198
- meta: e.meta || {},
2199
- aliasOf: void 0,
2200
- beforeEnter: e.beforeEnter,
2201
- props: ha(e),
2202
- children: e.children || [],
2203
- instances: {},
2204
- leaveGuards: /* @__PURE__ */ new Set(),
2205
- updateGuards: /* @__PURE__ */ new Set(),
2206
- enterCallbacks: {},
2207
- components: "components" in e ? e.components || null : e.component && { default: e.component }
2208
- };
2209
- }
2210
- function ha(e) {
2211
- const t = {}, n = e.props || !1;
2212
- if ("component" in e)
2213
- t.default = n;
2214
- else
2215
- for (const o in e.components)
2216
- t[o] = typeof n == "object" ? n[o] : n;
2217
- return t;
2218
- }
2219
- function An(e) {
2220
- for (; e; ) {
2221
- if (e.record.aliasOf)
2222
- return !0;
2223
- e = e.parent;
2224
- }
2225
- return !1;
2226
- }
2227
- function ma(e) {
2228
- return e.reduce((t, n) => R(t, n.meta), {});
2229
- }
2230
- function Tn(e, t) {
2231
- const n = {};
2232
- for (const o in e)
2233
- n[o] = o in t ? t[o] : e[o];
2234
- return n;
2235
- }
2236
- function At(e, t) {
2237
- return e.name === t.name && e.optional === t.optional && e.repeatable === t.repeatable;
2238
- }
2239
- function va(e, t) {
2240
- for (const n of e.keys)
2241
- if (!n.optional && !t.keys.find(At.bind(null, n)))
2242
- return $(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
2243
- for (const n of t.keys)
2244
- if (!n.optional && !e.keys.find(At.bind(null, n)))
2245
- return $(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
2246
- }
2247
- function ga(e, t) {
2248
- t && t.record.name && !e.name && !e.path && $(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
2249
- }
2250
- function ya(e, t) {
2251
- for (const n of t.keys)
2252
- if (!e.keys.find(At.bind(null, n)))
2253
- return $(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`);
2254
- }
2255
- function Do(e, t) {
2256
- return t.children.some((n) => n === e || Do(e, n));
2257
- }
2258
- const Vo = /#/g, wa = /&/g, ba = /\//g, _a = /=/g, Ea = /\?/g, Mo = /\+/g, ka = /%5B/g, Sa = /%5D/g, Lo = /%5E/g, Oa = /%60/g, jo = /%7B/g, Ia = /%7C/g, Bo = /%7D/g, Pa = /%20/g;
2259
- function Kt(e) {
2260
- return encodeURI("" + e).replace(Ia, "|").replace(ka, "[").replace(Sa, "]");
2261
- }
2262
- function Ca(e) {
2263
- return Kt(e).replace(jo, "{").replace(Bo, "}").replace(Lo, "^");
2264
- }
2265
- function Tt(e) {
2266
- return Kt(e).replace(Mo, "%2B").replace(Pa, "+").replace(Vo, "%23").replace(wa, "%26").replace(Oa, "`").replace(jo, "{").replace(Bo, "}").replace(Lo, "^");
2267
- }
2268
- function xa(e) {
2269
- return Tt(e).replace(_a, "%3D");
2270
- }
2271
- function $a(e) {
2272
- return Kt(e).replace(Vo, "%23").replace(Ea, "%3F");
2273
- }
2274
- function Na(e) {
2275
- return e == null ? "" : $a(e).replace(ba, "%2F");
2276
- }
2277
- function Qe(e) {
2278
- try {
2279
- return decodeURIComponent("" + e);
2280
- } catch {
2281
- process.env.NODE_ENV !== "production" && $(`Error decoding "${e}". Using original value`);
2282
- }
2283
- return "" + e;
2284
- }
2285
- function Ra(e) {
2286
- const t = {};
2287
- if (e === "" || e === "?")
2288
- return t;
2289
- const o = (e[0] === "?" ? e.slice(1) : e).split("&");
2290
- for (let r = 0; r < o.length; ++r) {
2291
- const s = o[r].replace(Mo, " "), i = s.indexOf("="), a = Qe(i < 0 ? s : s.slice(0, i)), l = i < 0 ? null : Qe(s.slice(i + 1));
2292
- if (a in t) {
2293
- let u = t[a];
2294
- K(u) || (u = t[a] = [u]), u.push(l);
2295
- } else
2296
- t[a] = l;
2297
- }
2298
- return t;
2299
- }
2300
- function Dn(e) {
2301
- let t = "";
2302
- for (let n in e) {
2303
- const o = e[n];
2304
- if (n = xa(n), o == null) {
2305
- o !== void 0 && (t += (t.length ? "&" : "") + n);
2306
- continue;
2307
- }
2308
- (K(o) ? o.map((s) => s && Tt(s)) : [o && Tt(o)]).forEach((s) => {
2309
- s !== void 0 && (t += (t.length ? "&" : "") + n, s != null && (t += "=" + s));
2310
- });
2311
- }
2312
- return t;
2313
- }
2314
- function Aa(e) {
2315
- const t = {};
2316
- for (const n in e) {
2317
- const o = e[n];
2318
- o !== void 0 && (t[n] = K(o) ? o.map((r) => r == null ? null : "" + r) : o == null ? o : "" + o);
2319
- }
2320
- return t;
2321
- }
2322
- const Ta = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : ""), Vn = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : ""), Jt = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), Uo = Symbol(process.env.NODE_ENV !== "production" ? "route location" : ""), Dt = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
2323
- function Ve() {
2324
- let e = [];
2325
- function t(o) {
2326
- return e.push(o), () => {
2327
- const r = e.indexOf(o);
2328
- r > -1 && e.splice(r, 1);
2329
- };
2330
- }
2331
- function n() {
2332
- e = [];
2333
- }
2334
- return {
2335
- add: t,
2336
- list: () => e.slice(),
2337
- reset: n
2338
- };
2339
- }
2340
- function he(e, t, n, o, r) {
2341
- const s = o && // name is defined if record is because of the function overload
2342
- (o.enterCallbacks[r] = o.enterCallbacks[r] || []);
2343
- return () => new Promise((i, a) => {
2344
- const l = (d) => {
2345
- d === !1 ? a(Te(4, {
2346
- from: n,
2347
- to: t
2348
- })) : d instanceof Error ? a(d) : Zs(d) ? a(Te(2, {
2349
- from: t,
2350
- to: d
2351
- })) : (s && // since enterCallbackArray is truthy, both record and name also are
2352
- o.enterCallbacks[r] === s && typeof d == "function" && s.push(d), i());
2353
- }, u = e.call(o && o.instances[r], t, n, process.env.NODE_ENV !== "production" ? Da(l, t, n) : l);
2354
- let c = Promise.resolve(u);
2355
- if (e.length < 3 && (c = c.then(l)), process.env.NODE_ENV !== "production" && e.length > 2) {
2356
- const d = `The "next" callback was never called inside of ${e.name ? '"' + e.name + '"' : ""}:
2357
- ${e.toString()}
2358
- . If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
2359
- if (typeof u == "object" && "then" in u)
2360
- c = c.then((f) => l._called ? f : ($(d), Promise.reject(new Error("Invalid navigation guard"))));
2361
- else if (u !== void 0 && !l._called) {
2362
- $(d), a(new Error("Invalid navigation guard"));
2363
- return;
2364
- }
2365
- }
2366
- c.catch((d) => a(d));
2367
- });
2368
- }
2369
- function Da(e, t, n) {
2370
- let o = 0;
2371
- return function() {
2372
- o++ === 1 && $(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), e._called = !0, o === 1 && e.apply(null, arguments);
2373
- };
2374
- }
2375
- function Et(e, t, n, o) {
2376
- const r = [];
2377
- for (const s of e) {
2378
- process.env.NODE_ENV !== "production" && !s.components && !s.children.length && $(`Record with path "${s.path}" is either missing a "component(s)" or "children" property.`);
2379
- for (const i in s.components) {
2380
- let a = s.components[i];
2381
- if (process.env.NODE_ENV !== "production") {
2382
- if (!a || typeof a != "object" && typeof a != "function")
2383
- throw $(`Component "${i}" in record with path "${s.path}" is not a valid component. Received "${String(a)}".`), new Error("Invalid route component");
2384
- if ("then" in a) {
2385
- $(`Component "${i}" in record with path "${s.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
2386
- const l = a;
2387
- a = () => l;
2388
- } else
2389
- a.__asyncLoader && // warn only once per component
2390
- !a.__warnedDefineAsync && (a.__warnedDefineAsync = !0, $(`Component "${i}" in record with path "${s.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
2391
- }
2392
- if (!(t !== "beforeRouteEnter" && !s.instances[i]))
2393
- if (Va(a)) {
2394
- const u = (a.__vccOpts || a)[t];
2395
- u && r.push(he(u, n, o, s, i));
2396
- } else {
2397
- let l = a();
2398
- process.env.NODE_ENV !== "production" && !("catch" in l) && ($(`Component "${i}" in record with path "${s.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`), l = Promise.resolve(l)), r.push(() => l.then((u) => {
2399
- if (!u)
2400
- return Promise.reject(new Error(`Couldn't resolve component "${i}" at "${s.path}"`));
2401
- const c = Vs(u) ? u.default : u;
2402
- s.components[i] = c;
2403
- const f = (c.__vccOpts || c)[t];
2404
- return f && he(f, n, o, s, i)();
2405
- }));
2406
- }
2407
- }
2408
- }
2409
- return r;
2410
- }
2411
- function Va(e) {
2412
- return typeof e == "object" || "displayName" in e || "props" in e || "__vccOpts" in e;
2413
- }
2414
- function Mn(e) {
2415
- const t = Z(Jt), n = Z(Uo), o = B(() => t.resolve(k(e.to))), r = B(() => {
2416
- const { matched: l } = o.value, { length: u } = l, c = l[u - 1], d = n.matched;
2417
- if (!c || !d.length)
2418
- return -1;
2419
- const f = d.findIndex(ge.bind(null, c));
2420
- if (f > -1)
2421
- return f;
2422
- const p = Ln(l[u - 2]);
2423
- return (
2424
- // we are dealing with nested routes
2425
- u > 1 && // if the parent and matched route have the same path, this link is
2426
- // referring to the empty child. Or we currently are on a different
2427
- // child of the same parent
2428
- Ln(c) === p && // avoid comparing the child with its parent
2429
- d[d.length - 1].path !== p ? d.findIndex(ge.bind(null, l[u - 2])) : f
2430
- );
2431
- }), s = B(() => r.value > -1 && Ba(n.params, o.value.params)), i = B(() => r.value > -1 && r.value === n.matched.length - 1 && Ro(n.params, o.value.params));
2432
- function a(l = {}) {
2433
- return ja(l) ? t[k(e.replace) ? "replace" : "push"](
2434
- k(e.to)
2435
- // avoid uncaught errors are they are logged anyway
2436
- ).catch(Ue) : Promise.resolve();
2437
- }
2438
- if (process.env.NODE_ENV !== "production" && ae) {
2439
- const l = Ht();
2440
- if (l) {
2441
- const u = {
2442
- route: o.value,
2443
- isActive: s.value,
2444
- isExactActive: i.value
2445
- };
2446
- l.__vrl_devtools = l.__vrl_devtools || [], l.__vrl_devtools.push(u), kr(() => {
2447
- u.route = o.value, u.isActive = s.value, u.isExactActive = i.value;
2448
- }, { flush: "post" });
2449
- }
2450
- }
2451
- return {
2452
- route: o,
2453
- href: B(() => o.value.href),
2454
- isActive: s,
2455
- isExactActive: i,
2456
- navigate: a
2457
- };
2458
- }
2459
- const Ma = /* @__PURE__ */ q({
2460
- name: "RouterLink",
2461
- compatConfig: { MODE: 3 },
2462
- props: {
2463
- to: {
2464
- type: [String, Object],
2465
- required: !0
2466
- },
2467
- replace: Boolean,
2468
- activeClass: String,
2469
- // inactiveClass: String,
2470
- exactActiveClass: String,
2471
- custom: Boolean,
2472
- ariaCurrentValue: {
2473
- type: String,
2474
- default: "page"
2475
- }
2476
- },
2477
- useLink: Mn,
2478
- setup(e, { slots: t }) {
2479
- const n = _e(Mn(e)), { options: o } = Z(Jt), r = B(() => ({
2480
- [jn(e.activeClass, o.linkActiveClass, "router-link-active")]: n.isActive,
2481
- // [getLinkClass(
2482
- // props.inactiveClass,
2483
- // options.linkInactiveClass,
2484
- // 'router-link-inactive'
2485
- // )]: !link.isExactActive,
2486
- [jn(e.exactActiveClass, o.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
2487
- }));
2488
- return () => {
2489
- const s = t.default && t.default(n);
2490
- return e.custom ? s : mo("a", {
2491
- "aria-current": n.isExactActive ? e.ariaCurrentValue : null,
2492
- href: n.href,
2493
- // this would override user added attrs but Vue will still add
2494
- // the listener, so we end up triggering both
2495
- onClick: n.navigate,
2496
- class: r.value
2497
- }, s);
2498
- };
2499
- }
2500
- }), La = Ma;
2501
- function ja(e) {
2502
- if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button !== void 0 && e.button !== 0)) {
2503
- if (e.currentTarget && e.currentTarget.getAttribute) {
2504
- const t = e.currentTarget.getAttribute("target");
2505
- if (/\b_blank\b/i.test(t))
2506
- return;
2507
- }
2508
- return e.preventDefault && e.preventDefault(), !0;
2509
- }
2510
- }
2511
- function Ba(e, t) {
2512
- for (const n in t) {
2513
- const o = t[n], r = e[n];
2514
- if (typeof o == "string") {
2515
- if (o !== r)
2516
- return !1;
2517
- } else if (!K(r) || r.length !== o.length || o.some((s, i) => s !== r[i]))
2518
- return !1;
2519
- }
2520
- return !0;
2521
- }
2522
- function Ln(e) {
2523
- return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
2524
- }
2525
- const jn = (e, t, n) => e ?? t ?? n, Ua = /* @__PURE__ */ q({
2526
- name: "RouterView",
2527
- // #674 we manually inherit them
2528
- inheritAttrs: !1,
2529
- props: {
2530
- name: {
2531
- type: String,
2532
- default: "default"
2533
- },
2534
- route: Object
2535
- },
2536
- // Better compat for @vue/compat users
2537
- // https://github.com/vuejs/router/issues/1315
2538
- compatConfig: { MODE: 3 },
2539
- setup(e, { attrs: t, slots: n }) {
2540
- process.env.NODE_ENV !== "production" && Wa();
2541
- const o = Z(Dt), r = B(() => e.route || o.value), s = Z(Vn, 0), i = B(() => {
2542
- let u = k(s);
2543
- const { matched: c } = r.value;
2544
- let d;
2545
- for (; (d = c[u]) && !d.components; )
2546
- u++;
2547
- return u;
2548
- }), a = B(() => r.value.matched[i.value]);
2549
- nt(Vn, B(() => i.value + 1)), nt(Ta, a), nt(Dt, r);
2550
- const l = V();
2551
- return ue(() => [l.value, a.value, e.name], ([u, c, d], [f, p, v]) => {
2552
- c && (c.instances[d] = u, p && p !== c && u && u === f && (c.leaveGuards.size || (c.leaveGuards = p.leaveGuards), c.updateGuards.size || (c.updateGuards = p.updateGuards))), u && c && // if there is no instance but to and from are the same this might be
2553
- // the first visit
2554
- (!p || !ge(c, p) || !f) && (c.enterCallbacks[d] || []).forEach((m) => m(u));
2555
- }, { flush: "post" }), () => {
2556
- const u = r.value, c = e.name, d = a.value, f = d && d.components[c];
2557
- if (!f)
2558
- return Bn(n.default, { Component: f, route: u });
2559
- const p = d.props[c], v = p ? p === !0 ? u.params : typeof p == "function" ? p(u) : p : null, w = mo(f, R({}, v, t, {
2560
- onVnodeUnmounted: (O) => {
2561
- O.component.isUnmounted && (d.instances[c] = null);
2562
- },
2563
- ref: l
2564
- }));
2565
- if (process.env.NODE_ENV !== "production" && ae && w.ref) {
2566
- const O = {
2567
- depth: i.value,
2568
- name: d.name,
2569
- path: d.path,
2570
- meta: d.meta
2571
- };
2572
- (K(w.ref) ? w.ref.map((M) => M.i) : [w.ref.i]).forEach((M) => {
2573
- M.__vrv_devtools = O;
2574
- });
2575
- }
2576
- return (
2577
- // pass the vnode to the slot as a prop.
2578
- // h and <component :is="..."> both accept vnodes
2579
- Bn(n.default, { Component: w, route: u }) || w
2580
- );
2581
- };
2582
- }
2583
- });
2584
- function Bn(e, t) {
2585
- if (!e)
2586
- return null;
2587
- const n = e(t);
2588
- return n.length === 1 ? n[0] : n;
2589
- }
2590
- const Ha = Ua;
2591
- function Wa() {
2592
- const e = Ht(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
2593
- if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
2594
- const o = t === "KeepAlive" ? "keep-alive" : "transition";
2595
- $(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
2596
- Use slot props instead:
2597
-
2598
- <router-view v-slot="{ Component }">
2599
- <${o}>
2600
- <component :is="Component" />
2601
- </${o}>
2602
- </router-view>`);
2603
- }
2604
- }
2605
- function Me(e, t) {
2606
- const n = R({}, e, {
2607
- // remove variables that can contain vue instances
2608
- matched: e.matched.map((o) => Xa(o, ["instances", "children", "aliasOf"]))
2609
- });
2610
- return {
2611
- _custom: {
2612
- type: null,
2613
- readOnly: !0,
2614
- display: e.fullPath,
2615
- tooltip: t,
2616
- value: n
2617
- }
2618
- };
2619
- }
2620
- function Ze(e) {
2621
- return {
2622
- _custom: {
2623
- display: e
2624
- }
2625
- };
2626
- }
2627
- let Fa = 0;
2628
- function Ga(e, t, n) {
2629
- if (t.__hasDevtools)
2630
- return;
2631
- t.__hasDevtools = !0;
2632
- const o = Fa++;
2633
- zt({
2634
- id: "org.vuejs.router" + (o ? "." + o : ""),
2635
- label: "Vue Router",
2636
- packageName: "vue-router",
2637
- homepage: "https://router.vuejs.org",
2638
- logo: "https://router.vuejs.org/logo.png",
2639
- componentStateTypes: ["Routing"],
2640
- app: e
2641
- }, (r) => {
2642
- typeof r.now != "function" && console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), r.on.inspectComponent((c, d) => {
2643
- c.instanceData && c.instanceData.state.push({
2644
- type: "Routing",
2645
- key: "$route",
2646
- editable: !1,
2647
- value: Me(t.currentRoute.value, "Current Route")
2648
- });
2649
- }), r.on.visitComponentTree(({ treeNode: c, componentInstance: d }) => {
2650
- if (d.__vrv_devtools) {
2651
- const f = d.__vrv_devtools;
2652
- c.tags.push({
2653
- label: (f.name ? `${f.name.toString()}: ` : "") + f.path,
2654
- textColor: 0,
2655
- tooltip: "This component is rendered by &lt;router-view&gt;",
2656
- backgroundColor: Ho
2657
- });
2658
- }
2659
- K(d.__vrl_devtools) && (d.__devtoolsApi = r, d.__vrl_devtools.forEach((f) => {
2660
- let p = Go, v = "";
2661
- f.isExactActive ? (p = Fo, v = "This is exactly active") : f.isActive && (p = Wo, v = "This link is active"), c.tags.push({
2662
- label: f.route.path,
2663
- textColor: 0,
2664
- tooltip: v,
2665
- backgroundColor: p
2666
- });
2667
- }));
2668
- }), ue(t.currentRoute, () => {
2669
- l(), r.notifyComponentUpdate(), r.sendInspectorTree(a), r.sendInspectorState(a);
2670
- });
2671
- const s = "router:navigations:" + o;
2672
- r.addTimelineLayer({
2673
- id: s,
2674
- label: `Router${o ? " " + o : ""} Navigations`,
2675
- color: 4237508
2676
- }), t.onError((c, d) => {
2677
- r.addTimelineEvent({
2678
- layerId: s,
2679
- event: {
2680
- title: "Error during Navigation",
2681
- subtitle: d.fullPath,
2682
- logType: "error",
2683
- time: r.now(),
2684
- data: { error: c },
2685
- groupId: d.meta.__navigationId
2686
- }
2687
- });
2688
- });
2689
- let i = 0;
2690
- t.beforeEach((c, d) => {
2691
- const f = {
2692
- guard: Ze("beforeEach"),
2693
- from: Me(d, "Current Location during this navigation"),
2694
- to: Me(c, "Target location")
2695
- };
2696
- Object.defineProperty(c.meta, "__navigationId", {
2697
- value: i++
2698
- }), r.addTimelineEvent({
2699
- layerId: s,
2700
- event: {
2701
- time: r.now(),
2702
- title: "Start of navigation",
2703
- subtitle: c.fullPath,
2704
- data: f,
2705
- groupId: c.meta.__navigationId
2706
- }
2707
- });
2708
- }), t.afterEach((c, d, f) => {
2709
- const p = {
2710
- guard: Ze("afterEach")
2711
- };
2712
- f ? (p.failure = {
2713
- _custom: {
2714
- type: Error,
2715
- readOnly: !0,
2716
- display: f ? f.message : "",
2717
- tooltip: "Navigation Failure",
2718
- value: f
2719
- }
2720
- }, p.status = Ze("❌")) : p.status = Ze("✅"), p.from = Me(d, "Current Location during this navigation"), p.to = Me(c, "Target location"), r.addTimelineEvent({
2721
- layerId: s,
2722
- event: {
2723
- title: "End of navigation",
2724
- subtitle: c.fullPath,
2725
- time: r.now(),
2726
- data: p,
2727
- logType: f ? "warning" : "default",
2728
- groupId: c.meta.__navigationId
2729
- }
2730
- });
2731
- });
2732
- const a = "router-inspector:" + o;
2733
- r.addInspector({
2734
- id: a,
2735
- label: "Routes" + (o ? " " + o : ""),
2736
- icon: "book",
2737
- treeFilterPlaceholder: "Search routes"
2738
- });
2739
- function l() {
2740
- if (!u)
2741
- return;
2742
- const c = u;
2743
- let d = n.getRoutes().filter((f) => !f.parent || // these routes have a parent with no component which will not appear in the view
2744
- // therefore we still need to include them
2745
- !f.parent.record.components);
2746
- d.forEach(qo), c.filter && (d = d.filter((f) => (
2747
- // save matches state based on the payload
2748
- Vt(f, c.filter.toLowerCase())
2749
- ))), d.forEach((f) => Qo(f, t.currentRoute.value)), c.rootNodes = d.map(zo);
2750
- }
2751
- let u;
2752
- r.on.getInspectorTree((c) => {
2753
- u = c, c.app === e && c.inspectorId === a && l();
2754
- }), r.on.getInspectorState((c) => {
2755
- if (c.app === e && c.inspectorId === a) {
2756
- const f = n.getRoutes().find((p) => p.record.__vd_id === c.nodeId);
2757
- f && (c.state = {
2758
- options: Qa(f)
2759
- });
2760
- }
2761
- }), r.sendInspectorTree(a), r.sendInspectorState(a);
2762
- });
2763
- }
2764
- function za(e) {
2765
- return e.optional ? e.repeatable ? "*" : "?" : e.repeatable ? "+" : "";
2766
- }
2767
- function Qa(e) {
2768
- const { record: t } = e, n = [
2769
- { editable: !1, key: "path", value: t.path }
2770
- ];
2771
- return t.name != null && n.push({
2772
- editable: !1,
2773
- key: "name",
2774
- value: t.name
2775
- }), n.push({ editable: !1, key: "regexp", value: e.re }), e.keys.length && n.push({
2776
- editable: !1,
2777
- key: "keys",
2778
- value: {
2779
- _custom: {
2780
- type: null,
2781
- readOnly: !0,
2782
- display: e.keys.map((o) => `${o.name}${za(o)}`).join(" "),
2783
- tooltip: "Param keys",
2784
- value: e.keys
2785
- }
2786
- }
2787
- }), t.redirect != null && n.push({
2788
- editable: !1,
2789
- key: "redirect",
2790
- value: t.redirect
2791
- }), e.alias.length && n.push({
2792
- editable: !1,
2793
- key: "aliases",
2794
- value: e.alias.map((o) => o.record.path)
2795
- }), Object.keys(e.record.meta).length && n.push({
2796
- editable: !1,
2797
- key: "meta",
2798
- value: e.record.meta
2799
- }), n.push({
2800
- key: "score",
2801
- editable: !1,
2802
- value: {
2803
- _custom: {
2804
- type: null,
2805
- readOnly: !0,
2806
- display: e.score.map((o) => o.join(", ")).join(" | "),
2807
- tooltip: "Score used to sort routes",
2808
- value: e.score
2809
- }
2810
- }
2811
- }), n;
2812
- }
2813
- const Ho = 15485081, Wo = 2450411, Fo = 8702998, qa = 2282478, Go = 16486972, Ka = 6710886;
2814
- function zo(e) {
2815
- const t = [], { record: n } = e;
2816
- n.name != null && t.push({
2817
- label: String(n.name),
2818
- textColor: 0,
2819
- backgroundColor: qa
2820
- }), n.aliasOf && t.push({
2821
- label: "alias",
2822
- textColor: 0,
2823
- backgroundColor: Go
2824
- }), e.__vd_match && t.push({
2825
- label: "matches",
2826
- textColor: 0,
2827
- backgroundColor: Ho
2828
- }), e.__vd_exactActive && t.push({
2829
- label: "exact",
2830
- textColor: 0,
2831
- backgroundColor: Fo
2832
- }), e.__vd_active && t.push({
2833
- label: "active",
2834
- textColor: 0,
2835
- backgroundColor: Wo
2836
- }), n.redirect && t.push({
2837
- label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
2838
- textColor: 16777215,
2839
- backgroundColor: Ka
2840
- });
2841
- let o = n.__vd_id;
2842
- return o == null && (o = String(Ja++), n.__vd_id = o), {
2843
- id: o,
2844
- label: n.path,
2845
- tags: t,
2846
- children: e.children.map(zo)
2847
- };
2848
- }
2849
- let Ja = 0;
2850
- const Ya = /^\/(.*)\/([a-z]*)$/;
2851
- function Qo(e, t) {
2852
- const n = t.matched.length && ge(t.matched[t.matched.length - 1], e.record);
2853
- e.__vd_exactActive = e.__vd_active = n, n || (e.__vd_active = t.matched.some((o) => ge(o, e.record))), e.children.forEach((o) => Qo(o, t));
2854
- }
2855
- function qo(e) {
2856
- e.__vd_match = !1, e.children.forEach(qo);
2857
- }
2858
- function Vt(e, t) {
2859
- const n = String(e.re).match(Ya);
2860
- if (e.__vd_match = !1, !n || n.length < 3)
2861
- return !1;
2862
- if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(t))
2863
- return e.children.forEach((i) => Vt(i, t)), e.record.path !== "/" || t === "/" ? (e.__vd_match = e.re.test(t), !0) : !1;
2864
- const r = e.record.path.toLowerCase(), s = Qe(r);
2865
- return !t.startsWith("/") && (s.includes(t) || r.includes(t)) || s.startsWith(t) || r.startsWith(t) || e.record.name && String(e.record.name).includes(t) ? !0 : e.children.some((i) => Vt(i, t));
2866
- }
2867
- function Xa(e, t) {
2868
- const n = {};
2869
- for (const o in e)
2870
- t.includes(o) || (n[o] = e[o]);
2871
- return n;
2872
- }
2873
- function Za(e) {
2874
- const t = fa(e.routes, e), n = e.parseQuery || Ra, o = e.stringifyQuery || Dn, r = e.history;
2875
- if (process.env.NODE_ENV !== "production" && !r)
2876
- throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');
2877
- const s = Ve(), i = Ve(), a = Ve(), l = br(pe);
2878
- let u = pe;
2879
- ae && e.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual");
2880
- const c = bt.bind(null, (h) => "" + h), d = bt.bind(null, Na), f = (
2881
- // @ts-expect-error: intentionally avoid the type check
2882
- bt.bind(null, Qe)
2883
- );
2884
- function p(h, y) {
2885
- let g, _;
2886
- return To(h) ? (g = t.getRecordMatcher(h), _ = y) : _ = h, t.addRoute(_, g);
2887
- }
2888
- function v(h) {
2889
- const y = t.getRecordMatcher(h);
2890
- y ? t.removeRoute(y) : process.env.NODE_ENV !== "production" && $(`Cannot remove non-existent route "${String(h)}"`);
2891
- }
2892
- function m() {
2893
- return t.getRoutes().map((h) => h.record);
2894
- }
2895
- function w(h) {
2896
- return !!t.getRecordMatcher(h);
2897
- }
2898
- function O(h, y) {
2899
- if (y = R({}, y || l.value), typeof h == "string") {
2900
- const P = _t(n, h, y.path), L = t.resolve({ path: P.path }, y), we = r.createHref(P.fullPath);
2901
- return process.env.NODE_ENV !== "production" && (we.startsWith("//") ? $(`Location "${h}" resolved to "${we}". A resolved location cannot start with multiple slashes.`) : L.matched.length || $(`No match found for location with path "${h}"`)), R(P, L, {
2902
- params: f(L.params),
2903
- hash: Qe(P.hash),
2904
- redirectedFrom: void 0,
2905
- href: we
2906
- });
2907
- }
2908
- let g;
2909
- if ("path" in h)
2910
- process.env.NODE_ENV !== "production" && "params" in h && !("name" in h) && // @ts-expect-error: the type is never
2911
- Object.keys(h.params).length && $(`Path "${h.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`), g = R({}, h, {
2912
- path: _t(n, h.path, y.path).path
2913
- });
2914
- else {
2915
- const P = R({}, h.params);
2916
- for (const L in P)
2917
- P[L] == null && delete P[L];
2918
- g = R({}, h, {
2919
- params: d(P)
2920
- }), y.params = d(y.params);
2921
- }
2922
- const _ = t.resolve(g, y), N = h.hash || "";
2923
- process.env.NODE_ENV !== "production" && N && !N.startsWith("#") && $(`A \`hash\` should always start with the character "#". Replace "${N}" with "#${N}".`), _.params = c(f(_.params));
2924
- const j = js(o, R({}, h, {
2925
- hash: Ca(N),
2926
- path: _.path
2927
- })), x = r.createHref(j);
2928
- return process.env.NODE_ENV !== "production" && (x.startsWith("//") ? $(`Location "${h}" resolved to "${x}". A resolved location cannot start with multiple slashes.`) : _.matched.length || $(`No match found for location with path "${"path" in h ? h.path : h}"`)), R({
2929
- fullPath: j,
2930
- // keep the hash encoded so fullPath is effectively path + encodedQuery +
2931
- // hash
2932
- hash: N,
2933
- query: (
2934
- // if the user is using a custom query lib like qs, we might have
2935
- // nested objects, so we keep the query as is, meaning it can contain
2936
- // numbers at `$route.query`, but at the point, the user will have to
2937
- // use their own type anyway.
2938
- // https://github.com/vuejs/router/issues/328#issuecomment-649481567
2939
- o === Dn ? Aa(h.query) : h.query || {}
2940
- )
2941
- }, _, {
2942
- redirectedFrom: void 0,
2943
- href: x
2944
- });
2945
- }
2946
- function I(h) {
2947
- return typeof h == "string" ? _t(n, h, l.value.path) : R({}, h);
2948
- }
2949
- function M(h, y) {
2950
- if (u !== h)
2951
- return Te(8, {
2952
- from: y,
2953
- to: h
2954
- });
2955
- }
2956
- function W(h) {
2957
- return S(h);
2958
- }
2959
- function J(h) {
2960
- return W(R(I(h), { replace: !0 }));
2961
- }
2962
- function Y(h) {
2963
- const y = h.matched[h.matched.length - 1];
2964
- if (y && y.redirect) {
2965
- const { redirect: g } = y;
2966
- let _ = typeof g == "function" ? g(h) : g;
2967
- if (typeof _ == "string" && (_ = _.includes("?") || _.includes("#") ? _ = I(_) : (
2968
- // force empty params
2969
- { path: _ }
2970
- ), _.params = {}), process.env.NODE_ENV !== "production" && !("path" in _) && !("name" in _))
2971
- throw $(`Invalid redirect found:
2972
- ${JSON.stringify(_, null, 2)}
2973
- when navigating to "${h.fullPath}". A redirect must contain a name or path. This will break in production.`), new Error("Invalid redirect");
2974
- return R({
2975
- query: h.query,
2976
- hash: h.hash,
2977
- // avoid transferring params if the redirect has a path
2978
- params: "path" in _ ? {} : h.params
2979
- }, _);
2980
- }
2981
- }
2982
- function S(h, y) {
2983
- const g = u = O(h), _ = l.value, N = h.state, j = h.force, x = h.replace === !0, P = Y(g);
2984
- if (P)
2985
- return S(
2986
- R(I(P), {
2987
- state: typeof P == "object" ? R({}, N, P.state) : N,
2988
- force: j,
2989
- replace: x
2990
- }),
2991
- // keep original redirectedFrom if it exists
2992
- y || g
2993
- );
2994
- const L = g;
2995
- L.redirectedFrom = y;
2996
- let we;
2997
- return !j && On(o, _, g) && (we = Te(16, { to: L, from: _ }), un(
2998
- _,
2999
- _,
3000
- // this is a push, the only way for it to be triggered from a
3001
- // history.listen is with a redirect, which makes it become a push
3002
- !0,
3003
- // This cannot be the first navigation because the initial location
3004
- // cannot be manually navigated to
3005
- !1
3006
- )), (we ? Promise.resolve(we) : E(L, _)).catch((Q) => se(Q) ? (
3007
- // navigation redirects still mark the router as ready
3008
- se(
3009
- Q,
3010
- 2
3011
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
3012
- ) ? Q : mt(Q)
3013
- ) : (
3014
- // reject any unknown error
3015
- G(Q, L, _)
3016
- )).then((Q) => {
3017
- if (Q) {
3018
- if (se(
3019
- Q,
3020
- 2
3021
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
3022
- ))
3023
- return process.env.NODE_ENV !== "production" && // we are redirecting to the same location we were already at
3024
- On(o, O(Q.to), L) && // and we have done it a couple of times
3025
- y && // @ts-expect-error: added only in dev
3026
- (y._count = y._count ? (
3027
- // @ts-expect-error
3028
- y._count + 1
3029
- ) : 1) > 30 ? ($(`Detected a possibly infinite redirection in a navigation guard when going from "${_.fullPath}" to "${L.fullPath}". Aborting to avoid a Stack Overflow.
3030
- Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : S(
3031
- // keep options
3032
- R({
3033
- // preserve an existing replacement but allow the redirect to override it
3034
- replace: x
3035
- }, I(Q.to), {
3036
- state: typeof Q.to == "object" ? R({}, N, Q.to.state) : N,
3037
- force: j
3038
- }),
3039
- // preserve the original redirectedFrom if any
3040
- y || L
3041
- );
3042
- } else
3043
- Q = D(L, _, !0, x, N);
3044
- return b(L, _, Q), Q;
3045
- });
3046
- }
3047
- function ln(h, y) {
3048
- const g = M(h, y);
3049
- return g ? Promise.reject(g) : Promise.resolve();
3050
- }
3051
- function ee(h) {
3052
- const y = Je.values().next().value;
3053
- return y && typeof y.runWithContext == "function" ? y.runWithContext(h) : h();
3054
- }
3055
- function E(h, y) {
3056
- let g;
3057
- const [_, N, j] = ei(h, y);
3058
- g = Et(_.reverse(), "beforeRouteLeave", h, y);
3059
- for (const P of _)
3060
- P.leaveGuards.forEach((L) => {
3061
- g.push(he(L, h, y));
3062
- });
3063
- const x = ln.bind(null, h, y);
3064
- return g.push(x), xe(g).then(() => {
3065
- g = [];
3066
- for (const P of s.list())
3067
- g.push(he(P, h, y));
3068
- return g.push(x), xe(g);
3069
- }).then(() => {
3070
- g = Et(N, "beforeRouteUpdate", h, y);
3071
- for (const P of N)
3072
- P.updateGuards.forEach((L) => {
3073
- g.push(he(L, h, y));
3074
- });
3075
- return g.push(x), xe(g);
3076
- }).then(() => {
3077
- g = [];
3078
- for (const P of j)
3079
- if (P.beforeEnter)
3080
- if (K(P.beforeEnter))
3081
- for (const L of P.beforeEnter)
3082
- g.push(he(L, h, y));
3083
- else
3084
- g.push(he(P.beforeEnter, h, y));
3085
- return g.push(x), xe(g);
3086
- }).then(() => (h.matched.forEach((P) => P.enterCallbacks = {}), g = Et(j, "beforeRouteEnter", h, y), g.push(x), xe(g))).then(() => {
3087
- g = [];
3088
- for (const P of i.list())
3089
- g.push(he(P, h, y));
3090
- return g.push(x), xe(g);
3091
- }).catch((P) => se(
3092
- P,
3093
- 8
3094
- /* ErrorTypes.NAVIGATION_CANCELLED */
3095
- ) ? P : Promise.reject(P));
3096
- }
3097
- function b(h, y, g) {
3098
- a.list().forEach((_) => ee(() => _(h, y, g)));
3099
- }
3100
- function D(h, y, g, _, N) {
3101
- const j = M(h, y);
3102
- if (j)
3103
- return j;
3104
- const x = y === pe, P = ae ? history.state : {};
3105
- g && (_ || x ? r.replace(h.fullPath, R({
3106
- scroll: x && P && P.scroll
3107
- }, N)) : r.push(h.fullPath, N)), l.value = h, un(h, y, g, x), mt();
3108
- }
3109
- let U;
3110
- function ye() {
3111
- U || (U = r.listen((h, y, g) => {
3112
- const _ = O(h), N = Y(_);
3113
- if (N) {
3114
- S(R(N, { replace: !0 }), _).catch(Ue);
3115
- return;
3116
- }
3117
- u = _;
3118
- const j = l.value;
3119
- ae && Qs(Pn(j.fullPath, g.delta), ft()), E(_, j).catch((x) => se(
3120
- x,
3121
- 12
3122
- /* ErrorTypes.NAVIGATION_CANCELLED */
3123
- ) ? x : se(
3124
- x,
3125
- 2
3126
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
3127
- ) ? (S(
3128
- x.to,
3129
- _
3130
- // avoid an uncaught rejection, let push call triggerError
3131
- ).then((P) => {
3132
- se(
3133
- P,
3134
- 20
3135
- /* ErrorTypes.NAVIGATION_DUPLICATED */
3136
- ) && !g.delta && g.type === ze.pop && r.go(-1, !1);
3137
- }).catch(Ue), Promise.reject()) : (g.delta && r.go(-g.delta, !1), G(x, _, j))).then((x) => {
3138
- x = x || D(
3139
- // after navigation, all matched components are resolved
3140
- _,
3141
- j,
3142
- !1
3143
- ), x && (g.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
3144
- // entry while a different route is displayed
3145
- !se(
3146
- x,
3147
- 8
3148
- /* ErrorTypes.NAVIGATION_CANCELLED */
3149
- ) ? r.go(-g.delta, !1) : g.type === ze.pop && se(
3150
- x,
3151
- 20
3152
- /* ErrorTypes.NAVIGATION_DUPLICATED */
3153
- ) && r.go(-1, !1)), b(_, j, x);
3154
- }).catch(Ue);
3155
- }));
3156
- }
3157
- let De = Ve(), Ke = Ve(), ne;
3158
- function G(h, y, g) {
3159
- mt(h);
3160
- const _ = Ke.list();
3161
- return _.length ? _.forEach((N) => N(h, y, g)) : (process.env.NODE_ENV !== "production" && $("uncaught error during route navigation:"), console.error(h)), Promise.reject(h);
3162
- }
3163
- function gr() {
3164
- return ne && l.value !== pe ? Promise.resolve() : new Promise((h, y) => {
3165
- De.add([h, y]);
3166
- });
3167
- }
3168
- function mt(h) {
3169
- return ne || (ne = !h, ye(), De.list().forEach(([y, g]) => h ? g(h) : y()), De.reset()), h;
3170
- }
3171
- function un(h, y, g, _) {
3172
- const { scrollBehavior: N } = e;
3173
- if (!ae || !N)
3174
- return Promise.resolve();
3175
- const j = !g && qs(Pn(h.fullPath, 0)) || (_ || !g) && history.state && history.state.scroll || null;
3176
- return Fe().then(() => N(h, y, j)).then((x) => x && zs(x)).catch((x) => G(x, h, y));
3177
- }
3178
- const vt = (h) => r.go(h);
3179
- let gt;
3180
- const Je = /* @__PURE__ */ new Set(), yr = {
3181
- currentRoute: l,
3182
- listening: !0,
3183
- addRoute: p,
3184
- removeRoute: v,
3185
- hasRoute: w,
3186
- getRoutes: m,
3187
- resolve: O,
3188
- options: e,
3189
- push: W,
3190
- replace: J,
3191
- go: vt,
3192
- back: () => vt(-1),
3193
- forward: () => vt(1),
3194
- beforeEach: s.add,
3195
- beforeResolve: i.add,
3196
- afterEach: a.add,
3197
- onError: Ke.add,
3198
- isReady: gr,
3199
- install(h) {
3200
- const y = this;
3201
- h.component("RouterLink", La), h.component("RouterView", Ha), h.config.globalProperties.$router = y, Object.defineProperty(h.config.globalProperties, "$route", {
3202
- enumerable: !0,
3203
- get: () => k(l)
3204
- }), ae && // used for the initial navigation client side to avoid pushing
3205
- // multiple times when the router is used in multiple apps
3206
- !gt && l.value === pe && (gt = !0, W(r.location).catch((N) => {
3207
- process.env.NODE_ENV !== "production" && $("Unexpected error when starting the router:", N);
3208
- }));
3209
- const g = {};
3210
- for (const N in pe)
3211
- Object.defineProperty(g, N, {
3212
- get: () => l.value[N],
3213
- enumerable: !0
3214
- });
3215
- h.provide(Jt, y), h.provide(Uo, Er(g)), h.provide(Dt, l);
3216
- const _ = h.unmount;
3217
- Je.add(h), h.unmount = function() {
3218
- Je.delete(h), Je.size < 1 && (u = pe, U && U(), U = null, l.value = pe, gt = !1, ne = !1), _();
3219
- }, process.env.NODE_ENV !== "production" && ae && Ga(h, y, t);
3220
- }
3221
- };
3222
- function xe(h) {
3223
- return h.reduce((y, g) => y.then(() => ee(g)), Promise.resolve());
3224
- }
3225
- return yr;
3226
- }
3227
- function ei(e, t) {
3228
- const n = [], o = [], r = [], s = Math.max(t.matched.length, e.matched.length);
3229
- for (let i = 0; i < s; i++) {
3230
- const a = t.matched[i];
3231
- a && (e.matched.find((u) => ge(u, a)) ? o.push(a) : n.push(a));
3232
- const l = e.matched[i];
3233
- l && (t.matched.find((u) => ge(u, l)) || r.push(l));
3234
- }
3235
- return [n, o, r];
3236
- }
3237
- Za({
3238
- history: Xs(),
3239
- routes: []
3240
- });
3241
- function ti(e) {
3242
- return e && typeof e.then == "function";
3243
- }
3244
- Promise.resolve(!1);
3245
- Promise.resolve(!0);
3246
- var Oe = Promise.resolve();
3247
- function Ko(e, t) {
3248
- return e || (e = 0), new Promise(function(n) {
3249
- return setTimeout(function() {
3250
- return n(t);
3251
- }, e);
3252
- });
3253
- }
3254
- function ni(e, t) {
3255
- return Math.floor(Math.random() * (t - e + 1) + e);
3256
- }
3257
- function Yt() {
3258
- return Math.random().toString(36).substring(2);
3259
- }
3260
- var Un = 0, kt = 0;
3261
- function pt() {
3262
- var e = (/* @__PURE__ */ new Date()).getTime();
3263
- return e === Un ? (kt++, e * 1e3 + kt) : (Un = e, kt = 0, e * 1e3);
3264
- }
3265
- var oi = pt, ri = "native";
3266
- function si(e) {
3267
- var t = {
3268
- messagesCallback: null,
3269
- bc: new BroadcastChannel(e),
3270
- subFns: []
3271
- // subscriberFunctions
3272
- };
3273
- return t.bc.onmessage = function(n) {
3274
- t.messagesCallback && t.messagesCallback(n.data);
3275
- }, t;
3276
- }
3277
- function ai(e) {
3278
- e.bc.close(), e.subFns = [];
3279
- }
3280
- function ii(e, t) {
3281
- try {
3282
- return e.bc.postMessage(t, !1), Oe;
3283
- } catch (n) {
3284
- return Promise.reject(n);
3285
- }
3286
- }
3287
- function ci(e, t) {
3288
- e.messagesCallback = t;
3289
- }
3290
- function li() {
3291
- if (typeof window > "u")
3292
- return !1;
3293
- if (typeof BroadcastChannel == "function") {
3294
- if (BroadcastChannel._pubkey)
3295
- throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");
3296
- return !0;
3297
- } else
3298
- return !1;
3299
- }
3300
- function ui() {
3301
- return 150;
3302
- }
3303
- var di = {
3304
- create: si,
3305
- close: ai,
3306
- onMessage: ci,
3307
- postMessage: ii,
3308
- canBeUsed: li,
3309
- type: ri,
3310
- averageResponseTime: ui,
3311
- microSeconds: oi
3312
- }, Jo = (
3313
- /** @class */
3314
- function() {
3315
- function e(t) {
3316
- this.ttl = t, this.map = /* @__PURE__ */ new Map(), this._to = !1;
3317
- }
3318
- return e.prototype.has = function(t) {
3319
- return this.map.has(t);
3320
- }, e.prototype.add = function(t) {
3321
- var n = this;
3322
- this.map.set(t, Yo()), this._to || (this._to = !0, setTimeout(function() {
3323
- n._to = !1, fi(n);
3324
- }, 0));
3325
- }, e.prototype.clear = function() {
3326
- this.map.clear();
3327
- }, e;
3328
- }()
3329
- );
3330
- function fi(e) {
3331
- for (var t = Yo() - e.ttl, n = e.map[Symbol.iterator](); ; ) {
3332
- var o = n.next().value;
3333
- if (!o)
3334
- return;
3335
- var r = o[0], s = o[1];
3336
- if (s < t)
3337
- e.map.delete(r);
3338
- else
3339
- return;
3340
- }
3341
- }
3342
- function Yo() {
3343
- return (/* @__PURE__ */ new Date()).getTime();
3344
- }
3345
- function Xt() {
3346
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = JSON.parse(JSON.stringify(e));
3347
- return typeof t.webWorkerSupport > "u" && (t.webWorkerSupport = !0), t.idb || (t.idb = {}), t.idb.ttl || (t.idb.ttl = 1e3 * 45), t.idb.fallbackInterval || (t.idb.fallbackInterval = 150), e.idb && typeof e.idb.onclose == "function" && (t.idb.onclose = e.idb.onclose), t.localstorage || (t.localstorage = {}), t.localstorage.removeTimeout || (t.localstorage.removeTimeout = 1e3 * 60), e.methods && (t.methods = e.methods), t.node || (t.node = {}), t.node.ttl || (t.node.ttl = 1e3 * 60 * 2), t.node.maxParallelWrites || (t.node.maxParallelWrites = 2048), typeof t.node.useFastPath > "u" && (t.node.useFastPath = !0), t;
3348
- }
3349
- var pi = pt, hi = "pubkey.broadcast-channel-0-", le = "messages", ht = {
3350
- durability: "relaxed"
3351
- }, mi = "idb";
3352
- function Xo() {
3353
- if (typeof indexedDB < "u")
3354
- return indexedDB;
3355
- if (typeof window < "u") {
3356
- if (typeof window.mozIndexedDB < "u")
3357
- return window.mozIndexedDB;
3358
- if (typeof window.webkitIndexedDB < "u")
3359
- return window.webkitIndexedDB;
3360
- if (typeof window.msIndexedDB < "u")
3361
- return window.msIndexedDB;
3362
- }
3363
- return !1;
3364
- }
3365
- function Zt(e) {
3366
- e.commit && e.commit();
3367
- }
3368
- function vi(e) {
3369
- var t = Xo(), n = hi + e, o = t.open(n);
3370
- return o.onupgradeneeded = function(r) {
3371
- var s = r.target.result;
3372
- s.createObjectStore(le, {
3373
- keyPath: "id",
3374
- autoIncrement: !0
3375
- });
3376
- }, new Promise(function(r, s) {
3377
- o.onerror = function(i) {
3378
- return s(i);
3379
- }, o.onsuccess = function() {
3380
- r(o.result);
3381
- };
3382
- });
3383
- }
3384
- function gi(e, t, n) {
3385
- var o = (/* @__PURE__ */ new Date()).getTime(), r = {
3386
- uuid: t,
3387
- time: o,
3388
- data: n
3389
- }, s = e.transaction([le], "readwrite", ht);
3390
- return new Promise(function(i, a) {
3391
- s.oncomplete = function() {
3392
- return i();
3393
- }, s.onerror = function(u) {
3394
- return a(u);
3395
- };
3396
- var l = s.objectStore(le);
3397
- l.add(r), Zt(s);
3398
- });
3399
- }
3400
- function yi(e, t) {
3401
- var n = e.transaction(le, "readonly", ht), o = n.objectStore(le), r = [], s = IDBKeyRange.bound(t + 1, 1 / 0);
3402
- if (o.getAll) {
3403
- var i = o.getAll(s);
3404
- return new Promise(function(l, u) {
3405
- i.onerror = function(c) {
3406
- return u(c);
3407
- }, i.onsuccess = function(c) {
3408
- l(c.target.result);
3409
- };
3410
- });
3411
- }
3412
- function a() {
3413
- try {
3414
- return s = IDBKeyRange.bound(t + 1, 1 / 0), o.openCursor(s);
3415
- } catch {
3416
- return o.openCursor();
3417
- }
3418
- }
3419
- return new Promise(function(l, u) {
3420
- var c = a();
3421
- c.onerror = function(d) {
3422
- return u(d);
3423
- }, c.onsuccess = function(d) {
3424
- var f = d.target.result;
3425
- f ? f.value.id < t + 1 ? f.continue(t + 1) : (r.push(f.value), f.continue()) : (Zt(n), l(r));
3426
- };
3427
- });
3428
- }
3429
- function wi(e, t) {
3430
- if (e.closed)
3431
- return Promise.resolve([]);
3432
- var n = e.db.transaction(le, "readwrite", ht), o = n.objectStore(le);
3433
- return Promise.all(t.map(function(r) {
3434
- var s = o.delete(r);
3435
- return new Promise(function(i) {
3436
- s.onsuccess = function() {
3437
- return i();
3438
- };
3439
- });
3440
- }));
3441
- }
3442
- function bi(e, t) {
3443
- var n = (/* @__PURE__ */ new Date()).getTime() - t, o = e.transaction(le, "readonly", ht), r = o.objectStore(le), s = [];
3444
- return new Promise(function(i) {
3445
- r.openCursor().onsuccess = function(a) {
3446
- var l = a.target.result;
3447
- if (l) {
3448
- var u = l.value;
3449
- u.time < n ? (s.push(u), l.continue()) : (Zt(o), i(s));
3450
- } else
3451
- i(s);
3452
- };
3453
- });
3454
- }
3455
- function _i(e) {
3456
- return bi(e.db, e.options.idb.ttl).then(function(t) {
3457
- return wi(e, t.map(function(n) {
3458
- return n.id;
3459
- }));
3460
- });
3461
- }
3462
- function Ei(e, t) {
3463
- return t = Xt(t), vi(e).then(function(n) {
3464
- var o = {
3465
- closed: !1,
3466
- lastCursorId: 0,
3467
- channelName: e,
3468
- options: t,
3469
- uuid: Yt(),
3470
- /**
3471
- * emittedMessagesIds
3472
- * contains all messages that have been emitted before
3473
- * @type {ObliviousSet}
3474
- */
3475
- eMIs: new Jo(t.idb.ttl * 2),
3476
- // ensures we do not read messages in parallel
3477
- writeBlockPromise: Oe,
3478
- messagesCallback: null,
3479
- readQueuePromises: [],
3480
- db: n
3481
- };
3482
- return n.onclose = function() {
3483
- o.closed = !0, t.idb.onclose && t.idb.onclose();
3484
- }, Zo(o), o;
3485
- });
3486
- }
3487
- function Zo(e) {
3488
- e.closed || er(e).then(function() {
3489
- return Ko(e.options.idb.fallbackInterval);
3490
- }).then(function() {
3491
- return Zo(e);
3492
- });
3493
- }
3494
- function ki(e, t) {
3495
- return !(e.uuid === t.uuid || t.eMIs.has(e.id) || e.data.time < t.messagesCallbackTime);
3496
- }
3497
- function er(e) {
3498
- return e.closed || !e.messagesCallback ? Oe : yi(e.db, e.lastCursorId).then(function(t) {
3499
- var n = t.filter(function(o) {
3500
- return !!o;
3501
- }).map(function(o) {
3502
- return o.id > e.lastCursorId && (e.lastCursorId = o.id), o;
3503
- }).filter(function(o) {
3504
- return ki(o, e);
3505
- }).sort(function(o, r) {
3506
- return o.time - r.time;
3507
- });
3508
- return n.forEach(function(o) {
3509
- e.messagesCallback && (e.eMIs.add(o.id), e.messagesCallback(o.data));
3510
- }), Oe;
3511
- });
3512
- }
3513
- function Si(e) {
3514
- e.closed = !0, e.db.close();
3515
- }
3516
- function Oi(e, t) {
3517
- return e.writeBlockPromise = e.writeBlockPromise.then(function() {
3518
- return gi(e.db, e.uuid, t);
3519
- }).then(function() {
3520
- ni(0, 10) === 0 && _i(e);
3521
- }), e.writeBlockPromise;
3522
- }
3523
- function Ii(e, t, n) {
3524
- e.messagesCallbackTime = n, e.messagesCallback = t, er(e);
3525
- }
3526
- function Pi() {
3527
- return !!Xo();
3528
- }
3529
- function Ci(e) {
3530
- return e.idb.fallbackInterval * 2;
3531
- }
3532
- var xi = {
3533
- create: Ei,
3534
- close: Si,
3535
- onMessage: Ii,
3536
- postMessage: Oi,
3537
- canBeUsed: Pi,
3538
- type: mi,
3539
- averageResponseTime: Ci,
3540
- microSeconds: pi
3541
- }, $i = pt, Ni = "pubkey.broadcastChannel-", Ri = "localstorage";
3542
- function tr() {
3543
- var e;
3544
- if (typeof window > "u")
3545
- return null;
3546
- try {
3547
- e = window.localStorage, e = window["ie8-eventlistener/storage"] || window.localStorage;
3548
- } catch {
3549
- }
3550
- return e;
3551
- }
3552
- function nr(e) {
3553
- return Ni + e;
3554
- }
3555
- function Ai(e, t) {
3556
- return new Promise(function(n) {
3557
- Ko().then(function() {
3558
- var o = nr(e.channelName), r = {
3559
- token: Yt(),
3560
- time: (/* @__PURE__ */ new Date()).getTime(),
3561
- data: t,
3562
- uuid: e.uuid
3563
- }, s = JSON.stringify(r);
3564
- tr().setItem(o, s);
3565
- var i = document.createEvent("Event");
3566
- i.initEvent("storage", !0, !0), i.key = o, i.newValue = s, window.dispatchEvent(i), n();
3567
- });
3568
- });
3569
- }
3570
- function Ti(e, t) {
3571
- var n = nr(e), o = function(s) {
3572
- s.key === n && t(JSON.parse(s.newValue));
3573
- };
3574
- return window.addEventListener("storage", o), o;
3575
- }
3576
- function Di(e) {
3577
- window.removeEventListener("storage", e);
3578
- }
3579
- function Vi(e, t) {
3580
- if (t = Xt(t), !or())
3581
- throw new Error("BroadcastChannel: localstorage cannot be used");
3582
- var n = Yt(), o = new Jo(t.localstorage.removeTimeout), r = {
3583
- channelName: e,
3584
- uuid: n,
3585
- eMIs: o
3586
- // emittedMessagesIds
3587
- };
3588
- return r.listener = Ti(e, function(s) {
3589
- r.messagesCallback && s.uuid !== n && (!s.token || o.has(s.token) || s.data.time && s.data.time < r.messagesCallbackTime || (o.add(s.token), r.messagesCallback(s.data)));
3590
- }), r;
3591
- }
3592
- function Mi(e) {
3593
- Di(e.listener);
3594
- }
3595
- function Li(e, t, n) {
3596
- e.messagesCallbackTime = n, e.messagesCallback = t;
3597
- }
3598
- function or() {
3599
- var e = tr();
3600
- if (!e)
3601
- return !1;
3602
- try {
3603
- var t = "__broadcastchannel_check";
3604
- e.setItem(t, "works"), e.removeItem(t);
3605
- } catch {
3606
- return !1;
3607
- }
3608
- return !0;
3609
- }
3610
- function ji() {
3611
- var e = 120, t = navigator.userAgent.toLowerCase();
3612
- return t.includes("safari") && !t.includes("chrome") ? e * 2 : e;
3613
- }
3614
- var Bi = {
3615
- create: Vi,
3616
- close: Mi,
3617
- onMessage: Li,
3618
- postMessage: Ai,
3619
- canBeUsed: or,
3620
- type: Ri,
3621
- averageResponseTime: ji,
3622
- microSeconds: $i
3623
- }, Ui = pt, Hi = "simulate", en = /* @__PURE__ */ new Set();
3624
- function Wi(e) {
3625
- var t = {
3626
- name: e,
3627
- messagesCallback: null
3628
- };
3629
- return en.add(t), t;
3630
- }
3631
- function Fi(e) {
3632
- en.delete(e);
3633
- }
3634
- function Gi(e, t) {
3635
- return new Promise(function(n) {
3636
- return setTimeout(function() {
3637
- var o = Array.from(en);
3638
- o.filter(function(r) {
3639
- return r.name === e.name;
3640
- }).filter(function(r) {
3641
- return r !== e;
3642
- }).filter(function(r) {
3643
- return !!r.messagesCallback;
3644
- }).forEach(function(r) {
3645
- return r.messagesCallback(t);
3646
- }), n();
3647
- }, 5);
3648
- });
3649
- }
3650
- function zi(e, t) {
3651
- e.messagesCallback = t;
3652
- }
3653
- function Qi() {
3654
- return !0;
3655
- }
3656
- function qi() {
3657
- return 5;
3658
- }
3659
- var Ki = {
3660
- create: Wi,
3661
- close: Fi,
3662
- onMessage: zi,
3663
- postMessage: Gi,
3664
- canBeUsed: Qi,
3665
- type: Hi,
3666
- averageResponseTime: qi,
3667
- microSeconds: Ui
3668
- }, Hn = [
3669
- di,
3670
- // fastest
3671
- xi,
3672
- Bi
3673
- ];
3674
- function Ji(e) {
3675
- var t = [].concat(e.methods, Hn).filter(Boolean);
3676
- if (e.type) {
3677
- if (e.type === "simulate")
3678
- return Ki;
3679
- var n = t.find(function(r) {
3680
- return r.type === e.type;
3681
- });
3682
- if (n)
3683
- return n;
3684
- throw new Error("method-type " + e.type + " not found");
3685
- }
3686
- e.webWorkerSupport || (t = t.filter(function(r) {
3687
- return r.type !== "idb";
3688
- }));
3689
- var o = t.find(function(r) {
3690
- return r.canBeUsed();
3691
- });
3692
- if (o)
3693
- return o;
3694
- throw new Error("No usable method found in " + JSON.stringify(Hn.map(function(r) {
3695
- return r.type;
3696
- })));
3697
- }
3698
- var rr = /* @__PURE__ */ new Set(), Yi = 0, tn = function(t, n) {
3699
- this.id = Yi++, rr.add(this), this.name = t, this.options = Xt(n), this.method = Ji(this.options), this._iL = !1, this._onML = null, this._addEL = {
3700
- message: [],
3701
- internal: []
3702
- }, this._uMP = /* @__PURE__ */ new Set(), this._befC = [], this._prepP = null, Xi(this);
3703
- };
3704
- tn._pubkey = !0;
3705
- tn.prototype = {
3706
- postMessage: function(t) {
3707
- if (this.closed)
3708
- throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed " + /**
3709
- * In the past when this error appeared, it was really hard to debug.
3710
- * So now we log the msg together with the error so it at least
3711
- * gives some clue about where in your application this happens.
3712
- */
3713
- JSON.stringify(t));
3714
- return Wn(this, "message", t);
3715
- },
3716
- postInternal: function(t) {
3717
- return Wn(this, "internal", t);
3718
- },
3719
- set onmessage(e) {
3720
- var t = this.method.microSeconds(), n = {
3721
- time: t,
3722
- fn: e
3723
- };
3724
- Gn(this, "message", this._onML), e && typeof e == "function" ? (this._onML = n, Fn(this, "message", n)) : this._onML = null;
3725
- },
3726
- addEventListener: function(t, n) {
3727
- var o = this.method.microSeconds(), r = {
3728
- time: o,
3729
- fn: n
3730
- };
3731
- Fn(this, t, r);
3732
- },
3733
- removeEventListener: function(t, n) {
3734
- var o = this._addEL[t].find(function(r) {
3735
- return r.fn === n;
3736
- });
3737
- Gn(this, t, o);
3738
- },
3739
- close: function() {
3740
- var t = this;
3741
- if (!this.closed) {
3742
- rr.delete(this), this.closed = !0;
3743
- var n = this._prepP ? this._prepP : Oe;
3744
- return this._onML = null, this._addEL.message = [], n.then(function() {
3745
- return Promise.all(Array.from(t._uMP));
3746
- }).then(function() {
3747
- return Promise.all(t._befC.map(function(o) {
3748
- return o();
3749
- }));
3750
- }).then(function() {
3751
- return t.method.close(t._state);
3752
- });
3753
- }
3754
- },
3755
- get type() {
3756
- return this.method.type;
3757
- },
3758
- get isClosed() {
3759
- return this.closed;
3760
- }
3761
- };
3762
- function Wn(e, t, n) {
3763
- var o = e.method.microSeconds(), r = {
3764
- time: o,
3765
- type: t,
3766
- data: n
3767
- }, s = e._prepP ? e._prepP : Oe;
3768
- return s.then(function() {
3769
- var i = e.method.postMessage(e._state, r);
3770
- return e._uMP.add(i), i.catch().then(function() {
3771
- return e._uMP.delete(i);
3772
- }), i;
3773
- });
3774
- }
3775
- function Xi(e) {
3776
- var t = e.method.create(e.name, e.options);
3777
- ti(t) ? (e._prepP = t, t.then(function(n) {
3778
- e._state = n;
3779
- })) : e._state = t;
3780
- }
3781
- function sr(e) {
3782
- return e._addEL.message.length > 0 || e._addEL.internal.length > 0;
3783
- }
3784
- function Fn(e, t, n) {
3785
- e._addEL[t].push(n), Zi(e);
3786
- }
3787
- function Gn(e, t, n) {
3788
- e._addEL[t] = e._addEL[t].filter(function(o) {
3789
- return o !== n;
3790
- }), ec(e);
3791
- }
3792
- function Zi(e) {
3793
- if (!e._iL && sr(e)) {
3794
- var t = function(r) {
3795
- e._addEL[r.type].forEach(function(s) {
3796
- var i = 1e5, a = s.time - i;
3797
- r.time >= a && s.fn(r.data);
3798
- });
3799
- }, n = e.method.microSeconds();
3800
- e._prepP ? e._prepP.then(function() {
3801
- e._iL = !0, e.method.onMessage(e._state, t, n);
3802
- }) : (e._iL = !0, e.method.onMessage(e._state, t, n));
3803
- }
3804
- }
3805
- function ec(e) {
3806
- if (e._iL && !sr(e)) {
3807
- e._iL = !1;
3808
- var t = e.method.microSeconds();
3809
- e.method.onMessage(e._state, null, t);
3810
- }
3811
- }
3812
- class St extends Error {
3813
- /**
3814
- * @param {string} message
3815
- * @param {string[]} keys
3816
- */
3817
- constructor(t, n) {
3818
- super(t), this.name = "DevalueError", this.path = n.join("");
3819
- }
3820
- }
3821
- function zn(e) {
3822
- return Object(e) !== e;
3823
- }
3824
- const tc = /* @__PURE__ */ Object.getOwnPropertyNames(
3825
- Object.prototype
3826
- ).sort().join("\0");
3827
- function nc(e) {
3828
- const t = Object.getPrototypeOf(e);
3829
- return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") === tc;
3830
- }
3831
- function oc(e) {
3832
- return Object.prototype.toString.call(e).slice(8, -1);
3833
- }
3834
- function rc(e) {
3835
- switch (e) {
3836
- case '"':
3837
- return '\\"';
3838
- case "<":
3839
- return "\\u003C";
3840
- case "\\":
3841
- return "\\\\";
3842
- case `
3843
- `:
3844
- return "\\n";
3845
- case "\r":
3846
- return "\\r";
3847
- case " ":
3848
- return "\\t";
3849
- case "\b":
3850
- return "\\b";
3851
- case "\f":
3852
- return "\\f";
3853
- case "\u2028":
3854
- return "\\u2028";
3855
- case "\u2029":
3856
- return "\\u2029";
3857
- default:
3858
- return e < " " ? `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
3859
- }
3860
- }
3861
- function Ae(e) {
3862
- let t = "", n = 0;
3863
- const o = e.length;
3864
- for (let r = 0; r < o; r += 1) {
3865
- const s = e[r], i = rc(s);
3866
- i && (t += e.slice(n, r) + i, n = r + 1);
3867
- }
3868
- return `"${n === 0 ? e : t + e.slice(n)}"`;
3869
- }
3870
- const nn = -1, ar = -2, ir = -3, cr = -4, lr = -5, on = -6;
3871
- function Qn(e, t) {
3872
- return sc(JSON.parse(e), t);
3873
- }
3874
- function sc(e, t) {
3875
- if (typeof e == "number")
3876
- return r(e, !0);
3877
- if (!Array.isArray(e) || e.length === 0)
3878
- throw new Error("Invalid input");
3879
- const n = (
3880
- /** @type {any[]} */
3881
- e
3882
- ), o = Array(n.length);
3883
- function r(s, i = !1) {
3884
- if (s === nn)
3885
- return;
3886
- if (s === ir)
3887
- return NaN;
3888
- if (s === cr)
3889
- return 1 / 0;
3890
- if (s === lr)
3891
- return -1 / 0;
3892
- if (s === on)
3893
- return -0;
3894
- if (i)
3895
- throw new Error("Invalid input");
3896
- if (s in o)
3897
- return o[s];
3898
- const a = n[s];
3899
- if (!a || typeof a != "object")
3900
- o[s] = a;
3901
- else if (Array.isArray(a))
3902
- if (typeof a[0] == "string") {
3903
- const l = a[0], u = t == null ? void 0 : t[l];
3904
- if (u)
3905
- return o[s] = u(r(a[1]));
3906
- switch (l) {
3907
- case "Date":
3908
- o[s] = new Date(a[1]);
3909
- break;
3910
- case "Set":
3911
- const c = /* @__PURE__ */ new Set();
3912
- o[s] = c;
3913
- for (let p = 1; p < a.length; p += 1)
3914
- c.add(r(a[p]));
3915
- break;
3916
- case "Map":
3917
- const d = /* @__PURE__ */ new Map();
3918
- o[s] = d;
3919
- for (let p = 1; p < a.length; p += 2)
3920
- d.set(r(a[p]), r(a[p + 1]));
3921
- break;
3922
- case "RegExp":
3923
- o[s] = new RegExp(a[1], a[2]);
3924
- break;
3925
- case "Object":
3926
- o[s] = Object(a[1]);
3927
- break;
3928
- case "BigInt":
3929
- o[s] = BigInt(a[1]);
3930
- break;
3931
- case "null":
3932
- const f = /* @__PURE__ */ Object.create(null);
3933
- o[s] = f;
3934
- for (let p = 1; p < a.length; p += 2)
3935
- f[a[p]] = r(a[p + 1]);
3936
- break;
3937
- default:
3938
- throw new Error(`Unknown type ${l}`);
3939
- }
3940
- } else {
3941
- const l = new Array(a.length);
3942
- o[s] = l;
3943
- for (let u = 0; u < a.length; u += 1) {
3944
- const c = a[u];
3945
- c !== ar && (l[u] = r(c));
3946
- }
3947
- }
3948
- else {
3949
- const l = {};
3950
- o[s] = l;
3951
- for (const u in a) {
3952
- const c = a[u];
3953
- l[u] = r(c);
3954
- }
3955
- }
3956
- return o[s];
3957
- }
3958
- return r(0);
3959
- }
3960
- function qn(e, t) {
3961
- const n = [], o = /* @__PURE__ */ new Map(), r = [];
3962
- for (const u in t)
3963
- r.push({ key: u, fn: t[u] });
3964
- const s = [];
3965
- let i = 0;
3966
- function a(u) {
3967
- if (typeof u == "function")
3968
- throw new St("Cannot stringify a function", s);
3969
- if (o.has(u))
3970
- return o.get(u);
3971
- if (u === void 0)
3972
- return nn;
3973
- if (Number.isNaN(u))
3974
- return ir;
3975
- if (u === 1 / 0)
3976
- return cr;
3977
- if (u === -1 / 0)
3978
- return lr;
3979
- if (u === 0 && 1 / u < 0)
3980
- return on;
3981
- const c = i++;
3982
- o.set(u, c);
3983
- for (const { key: f, fn: p } of r) {
3984
- const v = p(u);
3985
- if (v)
3986
- return n[c] = `["${f}",${a(v)}]`, c;
3987
- }
3988
- let d = "";
3989
- if (zn(u))
3990
- d = Ot(u);
3991
- else
3992
- switch (oc(u)) {
3993
- case "Number":
3994
- case "String":
3995
- case "Boolean":
3996
- d = `["Object",${Ot(u)}]`;
3997
- break;
3998
- case "BigInt":
3999
- d = `["BigInt",${u}]`;
4000
- break;
4001
- case "Date":
4002
- d = `["Date","${u.toISOString()}"]`;
4003
- break;
4004
- case "RegExp":
4005
- const { source: p, flags: v } = u;
4006
- d = v ? `["RegExp",${Ae(p)},"${v}"]` : `["RegExp",${Ae(p)}]`;
4007
- break;
4008
- case "Array":
4009
- d = "[";
4010
- for (let m = 0; m < u.length; m += 1)
4011
- m > 0 && (d += ","), m in u ? (s.push(`[${m}]`), d += a(u[m]), s.pop()) : d += ar;
4012
- d += "]";
4013
- break;
4014
- case "Set":
4015
- d = '["Set"';
4016
- for (const m of u)
4017
- d += `,${a(m)}`;
4018
- d += "]";
4019
- break;
4020
- case "Map":
4021
- d = '["Map"';
4022
- for (const [m, w] of u)
4023
- s.push(
4024
- `.get(${zn(m) ? Ot(m) : "..."})`
4025
- ), d += `,${a(m)},${a(w)}`;
4026
- d += "]";
4027
- break;
4028
- default:
4029
- if (!nc(u))
4030
- throw new St(
4031
- "Cannot stringify arbitrary non-POJOs",
4032
- s
4033
- );
4034
- if (Object.getOwnPropertySymbols(u).length > 0)
4035
- throw new St(
4036
- "Cannot stringify POJOs with symbolic keys",
4037
- s
4038
- );
4039
- if (Object.getPrototypeOf(u) === null) {
4040
- d = '["null"';
4041
- for (const m in u)
4042
- s.push(`.${m}`), d += `,${Ae(m)},${a(u[m])}`, s.pop();
4043
- d += "]";
4044
- } else {
4045
- d = "{";
4046
- let m = !1;
4047
- for (const w in u)
4048
- m && (d += ","), m = !0, s.push(`.${w}`), d += `${Ae(w)}:${a(u[w])}`, s.pop();
4049
- d += "}";
4050
- }
4051
- }
4052
- return n[c] = d, c;
4053
- }
4054
- const l = a(e);
4055
- return l < 0 ? `${l}` : `[${n.join(",")}]`;
4056
- }
4057
- function Ot(e) {
4058
- const t = typeof e;
4059
- return t === "string" ? Ae(e) : e instanceof String ? Ae(e.toString()) : e === void 0 ? nn.toString() : e === 0 && 1 / e < 0 ? on.toString() : t === "bigint" ? `["BigInt","${e}"]` : String(e);
4060
- }
4061
- function ac(e, t, { initialize: n, type: o }) {
4062
- let r = `${t.$id}-${e.toString()}`, s = new tn(r, { type: o }), i = !1, a = 0;
4063
- ue(() => t[e], (c) => {
4064
- i || (a = Date.now(), s.postMessage({ timestamp: a, state: Qn(qn(c)) })), i = !1;
4065
- }, { deep: !0 }), s.onmessage = (c) => {
4066
- if (c === void 0) {
4067
- s.postMessage({ timestamp: a, state: Qn(qn(t[e])) });
4068
- return;
4069
- }
4070
- c.timestamp <= a || (i = !0, a = c.timestamp, t[e] = c.state);
4071
- };
4072
- let l = () => s.postMessage(void 0), u = () => s.close();
4073
- return n && l(), { sync: l, unshare: u };
4074
- }
4075
- var ic = (e, t) => Object.keys(t).includes(e), cc = ({ initialize: e = !0, enable: t = !0, type: n }) => ({ store: o, options: r }) => {
4076
- var s, i;
4077
- let a = ((s = r == null ? void 0 : r.share) == null ? void 0 : s.enable) ?? t, l = ((i = r == null ? void 0 : r.share) == null ? void 0 : i.omit) ?? [];
4078
- !a || Object.keys(o.$state).forEach((u) => {
4079
- var c;
4080
- l.includes(u) || !ic(u, o.$state) || ac(u, o, { initialize: ((c = r == null ? void 0 : r.share) == null ? void 0 : c.initialize) ?? e, type: n });
4081
- });
4082
- };
4083
- const lc = $s();
4084
- lc.use(
4085
- cc({
4086
- enable: !0,
4087
- initialize: !0
4088
- })
4089
- );
4090
- const uc = /* @__PURE__ */ q({
4091
- __name: "Doctype",
4092
- setup(e) {
4093
- const { stonecrop: t, isReady: n } = No(), o = V([]);
4094
- return ue(n, () => {
4095
- if (n.value) {
4096
- let r = t.value.schema.schema.toArray();
4097
- r.forEach((s, i) => {
4098
- const l = t.value.store.record[s.fieldname];
4099
- r[i].value = l;
4100
- }), o.value = r;
4101
- }
4102
- }), (r, s) => k(n) ? (C(), Se(k(es), {
4103
- key: 0,
4104
- class: "aform-main",
4105
- modelValue: o.value,
4106
- "onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i)
4107
- }, null, 8, ["modelValue"])) : ke("", !0);
4108
- }
4109
- });
4110
- var Kn;
4111
- const ur = typeof window < "u", dc = (e) => typeof e == "string", fc = () => {
4112
- };
4113
- ur && (Kn = window == null ? void 0 : window.navigator) != null && Kn.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent);
4114
- function dr(e) {
4115
- return typeof e == "function" ? e() : k(e);
4116
- }
4117
- function pc(e) {
4118
- return e;
4119
- }
4120
- function hc(e) {
4121
- return po() ? (ho(e), !0) : !1;
4122
- }
4123
- function Mt(e) {
4124
- var t;
4125
- const n = dr(e);
4126
- return (t = n == null ? void 0 : n.$el) != null ? t : n;
4127
- }
4128
- const fr = ur ? window : void 0;
4129
- function mc(...e) {
4130
- let t, n, o, r;
4131
- if (dc(e[0]) || Array.isArray(e[0]) ? ([n, o, r] = e, t = fr) : [t, n, o, r] = e, !t)
4132
- return fc;
4133
- Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
4134
- const s = [], i = () => {
4135
- s.forEach((c) => c()), s.length = 0;
4136
- }, a = (c, d, f, p) => (c.addEventListener(d, f, p), () => c.removeEventListener(d, f, p)), l = ue(() => [Mt(t), dr(r)], ([c, d]) => {
4137
- i(), c && s.push(...n.flatMap((f) => o.map((p) => a(c, f, p, d))));
4138
- }, { immediate: !0, flush: "post" }), u = () => {
4139
- l(), i();
4140
- };
4141
- return hc(u), u;
4142
- }
4143
- const Jn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Yn = "__vueuse_ssr_handlers__";
4144
- Jn[Yn] = Jn[Yn] || {};
4145
- function vc(e, { window: t = fr, scrollTarget: n } = {}) {
4146
- const o = V(!1), r = () => {
4147
- if (!t)
4148
- return;
4149
- const s = t.document, i = Mt(e);
4150
- if (!i)
4151
- o.value = !1;
4152
- else {
4153
- const a = i.getBoundingClientRect();
4154
- o.value = a.top <= (t.innerHeight || s.documentElement.clientHeight) && a.left <= (t.innerWidth || s.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
4155
- }
4156
- };
4157
- return ue(() => Mt(e), () => r(), { immediate: !0, flush: "post" }), t && mc(n || t, "scroll", r, {
4158
- capture: !1,
4159
- passive: !0
4160
- }), o;
4161
- }
4162
- var Xn;
4163
- (function(e) {
4164
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
4165
- })(Xn || (Xn = {}));
4166
- var gc = Object.defineProperty, Zn = Object.getOwnPropertySymbols, yc = Object.prototype.hasOwnProperty, wc = Object.prototype.propertyIsEnumerable, eo = (e, t, n) => t in e ? gc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, bc = (e, t) => {
4167
- for (var n in t || (t = {}))
4168
- yc.call(t, n) && eo(e, n, t[n]);
4169
- if (Zn)
4170
- for (var n of Zn(t))
4171
- wc.call(t, n) && eo(e, n, t[n]);
4172
- return e;
4173
- };
4174
- const _c = {
4175
- easeInSine: [0.12, 0, 0.39, 0],
4176
- easeOutSine: [0.61, 1, 0.88, 1],
4177
- easeInOutSine: [0.37, 0, 0.63, 1],
4178
- easeInQuad: [0.11, 0, 0.5, 0],
4179
- easeOutQuad: [0.5, 1, 0.89, 1],
4180
- easeInOutQuad: [0.45, 0, 0.55, 1],
4181
- easeInCubic: [0.32, 0, 0.67, 0],
4182
- easeOutCubic: [0.33, 1, 0.68, 1],
4183
- easeInOutCubic: [0.65, 0, 0.35, 1],
4184
- easeInQuart: [0.5, 0, 0.75, 0],
4185
- easeOutQuart: [0.25, 1, 0.5, 1],
4186
- easeInOutQuart: [0.76, 0, 0.24, 1],
4187
- easeInQuint: [0.64, 0, 0.78, 0],
4188
- easeOutQuint: [0.22, 1, 0.36, 1],
4189
- easeInOutQuint: [0.83, 0, 0.17, 1],
4190
- easeInExpo: [0.7, 0, 0.84, 0],
4191
- easeOutExpo: [0.16, 1, 0.3, 1],
4192
- easeInOutExpo: [0.87, 0, 0.13, 1],
4193
- easeInCirc: [0.55, 0, 1, 0.45],
4194
- easeOutCirc: [0, 0.55, 0.45, 1],
4195
- easeInOutCirc: [0.85, 0, 0.15, 1],
4196
- easeInBack: [0.36, 0, 0.66, -0.56],
4197
- easeOutBack: [0.34, 1.56, 0.64, 1],
4198
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
4199
- };
4200
- bc({
4201
- linear: pc
4202
- }, _c);
4203
- const de = (e) => {
4204
- let t = vc(e).value;
4205
- return t = t && e.offsetHeight > 0, t;
4206
- }, fe = (e) => e.tabIndex >= 0, to = (e) => {
4207
- const t = e.target;
4208
- return rn(t);
4209
- }, rn = (e) => {
4210
- var t;
4211
- let n;
4212
- if (e instanceof HTMLTableCellElement) {
4213
- const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
4214
- if (o) {
4215
- const r = Array.from(o.children)[e.cellIndex];
4216
- r && (n = r);
4217
- }
4218
- } else if (e instanceof HTMLTableRowElement) {
4219
- const o = e.previousElementSibling;
4220
- o && (n = o);
4221
- }
4222
- return n && (!fe(n) || !de(n)) ? rn(n) : n;
4223
- }, Ec = (e) => {
4224
- var t;
4225
- const n = e.target;
4226
- let o;
4227
- if (n instanceof HTMLTableCellElement) {
4228
- const r = (t = n.parentElement) == null ? void 0 : t.parentElement;
4229
- if (r) {
4230
- const s = r.firstElementChild.children[n.cellIndex];
4231
- s && (o = s);
4232
- }
4233
- } else if (n instanceof HTMLTableRowElement) {
4234
- const r = n.parentElement;
4235
- if (r) {
4236
- const s = r.firstElementChild;
4237
- s && (o = s);
4238
- }
4239
- }
4240
- return o && (!fe(o) || !de(o)) ? sn(o) : o;
4241
- }, no = (e) => {
4242
- const t = e.target;
4243
- return sn(t);
4244
- }, sn = (e) => {
4245
- var t;
4246
- let n;
4247
- if (e instanceof HTMLTableCellElement) {
4248
- const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
4249
- if (o) {
4250
- const r = Array.from(o.children)[e.cellIndex];
4251
- r && (n = r);
4252
- }
4253
- } else if (e instanceof HTMLTableRowElement) {
4254
- const o = e.nextElementSibling;
4255
- o && (n = o);
4256
- }
4257
- return n && (!fe(n) || !de(n)) ? sn(n) : n;
4258
- }, kc = (e) => {
4259
- var t;
4260
- const n = e.target;
4261
- let o;
4262
- if (n instanceof HTMLTableCellElement) {
4263
- const r = (t = n.parentElement) == null ? void 0 : t.parentElement;
4264
- if (r) {
4265
- const s = r.lastElementChild.children[n.cellIndex];
4266
- s && (o = s);
4267
- }
4268
- } else if (n instanceof HTMLTableRowElement) {
4269
- const r = n.parentElement;
4270
- if (r) {
4271
- const s = r.lastElementChild;
4272
- s && (o = s);
4273
- }
4274
- }
4275
- return o && (!fe(o) || !de(o)) ? rn(o) : o;
4276
- }, oo = (e) => {
4277
- const t = e.target;
4278
- return an(t);
4279
- }, an = (e) => {
4280
- var t;
4281
- let n;
4282
- if (e.previousElementSibling)
4283
- n = e.previousElementSibling;
4284
- else {
4285
- const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
4286
- n = o == null ? void 0 : o.lastElementChild;
4287
- }
4288
- return n && (!fe(n) || !de(n)) ? an(n) : n;
4289
- }, ro = (e) => {
4290
- const t = e.target;
4291
- return cn(t);
4292
- }, cn = (e) => {
4293
- var t;
4294
- let n;
4295
- if (e.nextElementSibling)
4296
- n = e.nextElementSibling;
4297
- else {
4298
- const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
4299
- n = o == null ? void 0 : o.firstElementChild;
4300
- }
4301
- return n && (!fe(n) || !de(n)) ? cn(n) : n;
4302
- }, so = (e) => {
4303
- const t = e.target.parentElement.firstElementChild;
4304
- return t && (!fe(t) || !de(t)) ? cn(t) : t;
4305
- }, ao = (e) => {
4306
- const t = e.target.parentElement.lastElementChild;
4307
- return t && (!fe(t) || !de(t)) ? an(t) : t;
4308
- }, et = ["alt", "control", "shift", "meta"], Sc = {
4309
- ArrowUp: "up",
4310
- ArrowDown: "down",
4311
- ArrowLeft: "left",
4312
- ArrowRight: "right"
4313
- }, pr = {
4314
- "keydown.up": (e) => {
4315
- const t = to(e);
4316
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4317
- },
4318
- "keydown.down": (e) => {
4319
- const t = no(e);
4320
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4321
- },
4322
- "keydown.left": (e) => {
4323
- const t = oo(e);
4324
- e.preventDefault(), e.stopPropagation(), t && t.focus();
4325
- },
4326
- "keydown.right": (e) => {
4327
- const t = ro(e);
4328
- e.preventDefault(), e.stopPropagation(), t && t.focus();
4329
- },
4330
- "keydown.control.up": (e) => {
4331
- const t = Ec(e);
4332
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4333
- },
4334
- "keydown.control.down": (e) => {
4335
- const t = kc(e);
4336
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4337
- },
4338
- "keydown.control.left": (e) => {
4339
- const t = so(e);
4340
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4341
- },
4342
- "keydown.control.right": (e) => {
4343
- const t = ao(e);
4344
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4345
- },
4346
- "keydown.end": (e) => {
4347
- const t = ao(e);
4348
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4349
- },
4350
- "keydown.enter": (e) => {
4351
- if (e.target instanceof HTMLTableCellElement) {
4352
- e.preventDefault(), e.stopPropagation();
4353
- const t = no(e);
4354
- t && t.focus();
4355
- }
4356
- },
4357
- "keydown.shift.enter": (e) => {
4358
- if (e.target instanceof HTMLTableCellElement) {
4359
- e.preventDefault(), e.stopPropagation();
4360
- const t = to(e);
4361
- t && t.focus();
4362
- }
4363
- },
4364
- "keydown.home": (e) => {
4365
- const t = so(e);
4366
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4367
- },
4368
- "keydown.tab": (e) => {
4369
- const t = ro(e);
4370
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4371
- },
4372
- "keydown.shift.tab": (e) => {
4373
- const t = oo(e);
4374
- t && (e.preventDefault(), e.stopPropagation(), t.focus());
4375
- }
4376
- };
4377
- function hr(e) {
4378
- const t = (o) => {
4379
- let r = null;
4380
- o.parent && (typeof o.parent == "string" ? r = document.querySelector(o.parent) : o.parent instanceof Element ? r = o.parent : r = o.parent.value);
4381
- let s = [];
4382
- if (o.selectors)
4383
- if (typeof o.selectors == "string")
4384
- s = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));
4385
- else if (o.selectors instanceof Element)
4386
- s.push(o.selectors);
4387
- else if (Array.isArray(o.selectors.value))
4388
- for (const i of o.selectors.value)
4389
- i instanceof Element ? s.push(i) : s.push(i.$el);
4390
- else
4391
- s.push(o.selectors.value);
4392
- else
4393
- s = Array.from(r.children).filter((i) => fe(i) && de(i));
4394
- return s;
4395
- }, n = (o) => (r) => {
4396
- const s = Sc[r.key] || r.key.toLowerCase();
4397
- if (et.includes(s))
4398
- return;
4399
- const i = o.handlers || pr;
4400
- for (const a of Object.keys(i)) {
4401
- const [l, ...u] = a.split(".");
4402
- if (l === "keydown" && u.includes(s)) {
4403
- const c = i[a], d = u.filter((p) => et.includes(p)), f = et.some((p) => {
4404
- const v = p.charAt(0).toUpperCase() + p.slice(1);
4405
- return r.getModifierState(v);
4406
- });
4407
- if (d.length > 0) {
4408
- if (f) {
4409
- for (const p of et)
4410
- if (u.includes(p)) {
4411
- const v = p.charAt(0).toUpperCase() + p.slice(1);
4412
- r.getModifierState(v) && c(r);
4413
- }
4414
- }
4415
- } else
4416
- f || c(r);
4417
- }
4418
- }
4419
- };
4420
- Lt(() => {
4421
- for (const o of e) {
4422
- const r = t(o);
4423
- for (const s of r)
4424
- s.addEventListener("keydown", n(o));
4425
- }
4426
- }), Sr(() => {
4427
- for (const o of e) {
4428
- const r = t(o);
4429
- for (const s of r)
4430
- s.removeEventListener("keydown", n(o));
4431
- }
4432
- });
4433
- }
4434
- const Oc = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ic = { key: 1 }, Pc = /* @__PURE__ */ q({
4435
- __name: "ACell",
4436
- props: {
4437
- colIndex: {},
4438
- rowIndex: {},
4439
- tableid: {},
4440
- addNavigation: { type: [Boolean, Object], default: !0 },
4441
- tabIndex: { default: 0 },
4442
- clickHandler: {}
4443
- },
4444
- setup(e) {
4445
- var t;
4446
- const n = e, o = Z(n.tableid), r = V(null);
4447
- let s = V(!1);
4448
- const i = B(() => {
4449
- const m = o.cellData(n.colIndex, n.rowIndex);
4450
- if (o.columns[n.colIndex].format) {
4451
- const w = o.columns[n.colIndex].format;
4452
- return typeof w == "function" ? w(m) : typeof w == "string" ? Function(`"use strict";return (${w})`)()(m) : m;
4453
- } else
4454
- return m;
4455
- }), a = (m) => {
4456
- if (n.clickHandler) {
4457
- n.clickHandler(m);
4458
- return;
4459
- }
4460
- if (o.columns[n.colIndex].mask, o.columns[n.colIndex].modalComponent) {
4461
- const w = r.value.getBoundingClientRect();
4462
- o.modal.visible = !0, o.modal.colIndex = n.colIndex, o.modal.rowIndex = n.rowIndex, o.modal.parent = r.value, o.modal.top = w.top + w.height, o.modal.left = w.left, o.modal.width = u.value, o.modal.component = o.columns[n.colIndex].modalComponent, o.modal.componentProps = o.columns[n.colIndex].modalComponentProps;
4463
- }
4464
- };
4465
- if (n.addNavigation) {
4466
- let m = {
4467
- ...pr,
4468
- "keydown.f2": a,
4469
- "keydown.alt.up": a,
4470
- "keydown.alt.down": a,
4471
- "keydown.alt.left": a,
4472
- "keydown.alt.right": a
4473
- };
4474
- typeof n.addNavigation == "object" && (m = {
4475
- ...m,
4476
- ...n.addNavigation
4477
- }), hr([
4478
- {
4479
- selectors: r,
4480
- handlers: m
4481
- }
4482
- ]);
4483
- }
4484
- const l = B(() => o.columns[n.colIndex].align || "center"), u = B(() => o.columns[n.colIndex].width || "40ch");
4485
- let c = "";
4486
- const d = () => {
4487
- r.value && (c = r.value.innerText);
4488
- }, f = () => {
4489
- r.value && r.value.innerHTML !== c && (c = r.value.innerText, r.value.dispatchEvent(new Event("change")), s.value = !0, o.columns[n.colIndex].format || o.setCellData(n.rowIndex, n.colIndex, c));
4490
- }, p = (m, w) => w && m === 0 && w > 0 ? `${w}ch` : "inherit", v = {
4491
- textAlign: l.value,
4492
- width: u.value,
4493
- backgroundColor: s.value ? "var(--cell-modified-color)" : "inherit",
4494
- fontWeight: s.value ? "bold" : "inherit",
4495
- paddingLeft: p(n.colIndex, (t = o.display[n.rowIndex]) == null ? void 0 : t.indent)
4496
- };
4497
- return (m, w) => (C(), A("td", {
4498
- ref_key: "cell",
4499
- ref: r,
4500
- "data-colindex": m.colIndex,
4501
- "data-rowindex": m.rowIndex,
4502
- "data-editable": k(o).columns[m.colIndex].edit,
4503
- contenteditable: k(o).columns[m.colIndex].edit,
4504
- tabindex: m.tabIndex,
4505
- spellcheck: !1,
4506
- style: v,
4507
- onFocus: d,
4508
- onPaste: f,
4509
- onBlur: f,
4510
- onInput: f,
4511
- onClick: a,
4512
- onMousedown: a
4513
- }, [
4514
- k(o).columns[m.colIndex].cellComponent ? (C(), Se(Bt(k(o).columns[m.colIndex].cellComponent), Ut({
4515
- key: 0,
4516
- value: i.value
4517
- }, k(o).columns[m.colIndex].cellComponentProps), null, 16, ["value"])) : (C(), A("span", Ic, ce(i.value), 1))
4518
- ], 40, Oc));
4519
- }
4520
- }), qe = (e, t) => {
4521
- const n = e.__vccOpts || e;
4522
- for (const [o, r] of t)
4523
- n[o] = r;
4524
- return n;
4525
- }, Cc = /* @__PURE__ */ qe(Pc, [["__scopeId", "data-v-07dfe445"]]), xc = ["tabindex"], $c = {
4526
- key: 0,
4527
- tabIndex: -1,
4528
- class: "list-index"
4529
- }, Nc = /* @__PURE__ */ q({
4530
- __name: "ARow",
4531
- props: {
4532
- row: {},
4533
- rowIndex: {},
4534
- tableid: {},
4535
- tabIndex: { default: -1 },
4536
- addNavigation: {}
4537
- },
4538
- setup(e) {
4539
- vo((l) => ({
4540
- "5b18ee03": k(r)
4541
- }));
4542
- const t = e, n = Z(t.tableid), o = V(null), r = n.numberedRowWidth.value, s = () => n.config.view !== "tree" ? "" : n.display[t.rowIndex].isRoot || n.display[t.rowIndex].isParent ? n.display[t.rowIndex].childrenOpen ? "-" : "+" : "", i = () => n.config.view !== "tree" || n.display[t.rowIndex].isRoot || n.display[t.rowIndex].open, a = (l) => {
4543
- n.toggleRowExpand(l);
4544
- };
4545
- return t.addNavigation && hr([
4546
- {
4547
- selectors: o,
4548
- handlers: t.addNavigation
4549
- }
4550
- ]), (l, u) => lt((C(), A("tr", {
4551
- ref_key: "rowEl",
4552
- ref: o,
4553
- tabindex: l.tabIndex,
4554
- class: "table-row"
4555
- }, [
4556
- k(n).config.view === "list" ? (C(), A("td", $c, ce(l.rowIndex + 1), 1)) : k(n).config.view === "tree" ? (C(), A("td", {
4557
- key: 1,
4558
- tabIndex: -1,
4559
- class: "tree-index",
4560
- onClick: u[0] || (u[0] = (c) => a(l.rowIndex))
4561
- }, ce(s()), 1)) : me(l.$slots, "indexCell", { key: 2 }, void 0, !0),
4562
- me(l.$slots, "default", {}, void 0, !0)
4563
- ], 8, xc)), [
4564
- [jt, i()]
4565
- ]);
4566
- }
4567
- }), Rc = /* @__PURE__ */ qe(Nc, [["__scopeId", "data-v-4c71a067"]]);
4568
- let tt;
4569
- const Ac = new Uint8Array(16);
4570
- function Tc() {
4571
- if (!tt && (tt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !tt))
4572
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
4573
- return tt(Ac);
4574
- }
4575
- const F = [];
4576
- for (let e = 0; e < 256; ++e)
4577
- F.push((e + 256).toString(16).slice(1));
4578
- function Dc(e, t = 0) {
4579
- return F[e[t + 0]] + F[e[t + 1]] + F[e[t + 2]] + F[e[t + 3]] + "-" + F[e[t + 4]] + F[e[t + 5]] + "-" + F[e[t + 6]] + F[e[t + 7]] + "-" + F[e[t + 8]] + F[e[t + 9]] + "-" + F[e[t + 10]] + F[e[t + 11]] + F[e[t + 12]] + F[e[t + 13]] + F[e[t + 14]] + F[e[t + 15]];
4580
- }
4581
- const Vc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), io = {
4582
- randomUUID: Vc
4583
- };
4584
- function mr(e, t, n) {
4585
- if (io.randomUUID && !t && !e)
4586
- return io.randomUUID();
4587
- e = e || {};
4588
- const o = e.random || (e.rng || Tc)();
4589
- if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, t) {
4590
- n = n || 0;
4591
- for (let r = 0; r < 16; ++r)
4592
- t[n + r] = o[r];
4593
- return t;
4594
- }
4595
- return Dc(o);
4596
- }
4597
- class Mc {
4598
- constructor(t, n, o, r, s, i) {
4599
- this.id = t || mr(), this.rows = o, this.columns = _e(n), this.config = _e(r), this.table = s || _e(this.createTableObject()), this.display = this.createDisplayObject(i), this.modal = _e({ visible: !1 });
4600
- }
4601
- createTableObject() {
4602
- const t = {};
4603
- for (const [n, o] of this.columns.entries())
4604
- for (const [r, s] of this.rows.entries())
4605
- t[`${n}:${r}`] = s[o.name];
4606
- return t;
4607
- }
4608
- createDisplayObject(t) {
4609
- const n = [Object.assign({}, { modified: !1 })];
4610
- if (t && "0:0" in t)
4611
- return t;
4612
- const o = /* @__PURE__ */ new Set();
4613
- for (let r = this.rows.length - 1; r >= 0; r--) {
4614
- const s = this.rows[r];
4615
- s.parent && o.add(s.parent), n[r] = {
4616
- childrenOpen: !1,
4617
- expanded: !1,
4618
- indent: s.indent || null,
4619
- isParent: o.has(r),
4620
- isRoot: s.parent === null || s.parent === void 0,
4621
- modified: !1,
4622
- open: s.parent === null || s.parent === void 0,
4623
- parent: s.parent
4624
- };
4625
- }
4626
- return _e(n);
4627
- }
4628
- get zeroColumn() {
4629
- return ["list", "tree", "list-expansion"].includes(this.config.view);
4630
- }
4631
- get numberedRowWidth() {
4632
- return B(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
4633
- }
4634
- cellData(t, n) {
4635
- return this.table[`${t}:${n}`];
4636
- }
4637
- setCellData(t, n, o) {
4638
- this.table[`${n}:${t}`] !== o && (this.display[t].modified = !0), this.table[`${n}:${t}`] = o;
4639
- const r = this.columns[n];
4640
- return this.rows[t][r.name] = o, this.table[`${n}:${t}`];
4641
- }
4642
- toggleRowExpand(t) {
4643
- if (this.config.view === "tree") {
4644
- this.display[t].childrenOpen = !this.display[t].childrenOpen;
4645
- for (let n = this.rows.length - 1; n >= 0; n--)
4646
- this.display[n].parent === t && (this.display[n].open = !this.display[n].open, this.display[n].childrenOpen && this.toggleRowExpand(n));
4647
- } else
4648
- this.config.view === "list-expansion" && (this.display[t].expanded = !this.display[t].expanded);
4649
- }
4650
- }
4651
- const Lc = { key: 0 }, jc = {
4652
- class: "atable-header-row",
4653
- tabindex: "-1"
4654
- }, Bc = {
4655
- key: 0,
4656
- id: "header-index"
4657
- }, Uc = /* @__PURE__ */ q({
4658
- __name: "ATableHeader",
4659
- props: {
4660
- columns: {},
4661
- config: {},
4662
- tableid: {}
4663
- },
4664
- setup(e) {
4665
- vo((r) => ({
4666
- "12d06943": k(n)
4667
- }));
4668
- const t = Z(e.tableid), n = t.numberedRowWidth.value, o = (r) => ({
4669
- minWidth: r.width || "40ch",
4670
- textAlign: r.align || "center",
4671
- width: t.config.fullWidth ? "auto" : null
4672
- });
4673
- return (r, s) => r.columns.length ? (C(), A("thead", Lc, [
4674
- T("tr", jc, [
4675
- k(t).zeroColumn ? (C(), A("th", Bc)) : ke("", !0),
4676
- (C(!0), A(Ie, null, Pe(r.columns, (i, a) => (C(), A("th", {
4677
- key: a,
4678
- tabindex: "-1",
4679
- style: ie(o(i))
4680
- }, [
4681
- me(r.$slots, "default", {}, () => [
4682
- go(ce(i.label || String.fromCharCode(a + 97).toUpperCase()), 1)
4683
- ], !0)
4684
- ], 4))), 128))
4685
- ])
4686
- ])) : ke("", !0);
4687
- }
4688
- }), Hc = /* @__PURE__ */ qe(Uc, [["__scopeId", "data-v-16e66636"]]), Wc = /* @__PURE__ */ q({
4689
- __name: "ATableModal",
4690
- props: {
4691
- colIndex: {},
4692
- rowIndex: {},
4693
- tableid: {}
4694
- },
4695
- setup(e) {
4696
- Z(e.tableid);
4697
- const t = (n) => {
4698
- n.stopPropagation();
4699
- };
4700
- return (n, o) => (C(), A("div", {
4701
- ref: "amodal",
4702
- class: "amodal",
4703
- tabindex: "-1",
4704
- onClick: t,
4705
- onInput: t
4706
- }, [
4707
- me(n.$slots, "default", {}, void 0, !0)
4708
- ], 544));
4709
- }
4710
- }), Fc = /* @__PURE__ */ qe(Wc, [["__scopeId", "data-v-10a48b2a"]]), Gc = /* @__PURE__ */ q({
4711
- __name: "ATable",
4712
- props: {
4713
- id: {},
4714
- modelValue: {},
4715
- columns: {},
4716
- rows: { default: () => [] },
4717
- config: { default: () => new Object() },
4718
- tableid: {}
4719
- },
4720
- emits: ["update:modelValue"],
4721
- setup(e, { emit: t }) {
4722
- const n = e, o = t;
4723
- let r = n.modelValue ? n.modelValue : n.rows, s = new Mc(n.id, n.columns, r, n.config);
4724
- nt(s.id, s), ue(
4725
- () => s.rows,
4726
- (a) => {
4727
- o("update:modelValue", a);
4728
- },
4729
- { deep: !0 }
4730
- );
4731
- const i = (a) => {
4732
- var l;
4733
- (l = s.modal.parent) != null && l.contains(a.target) || s.modal.visible && (s.modal.visible = !1);
4734
- };
4735
- return window.addEventListener("click", i), window.addEventListener("keydown", (a) => {
4736
- if (a.key === "Escape" && s.modal.visible) {
4737
- s.modal.visible = !1;
4738
- const l = s.modal.parent;
4739
- l && Fe().then(() => {
4740
- const u = l.dataset.rowindex, c = l.dataset.colindex, d = document.querySelectorAll(`[data-rowindex='${u}'][data-colindex='${c}']`);
4741
- d && d[0].focus();
4742
- });
4743
- }
4744
- }), (a, l) => (C(), A("table", {
4745
- class: "atable",
4746
- style: ie({ width: k(s).config.fullWidth ? "100%" : "auto" })
4747
- }, [
4748
- me(a.$slots, "header", { data: k(s) }, () => [
4749
- at(Hc, {
4750
- columns: k(s).columns,
4751
- config: k(s).config,
4752
- tableid: k(s).id
4753
- }, null, 8, ["columns", "config", "tableid"])
4754
- ], !0),
4755
- T("tbody", null, [
4756
- me(a.$slots, "body", { data: k(s) }, () => [
4757
- (C(!0), A(Ie, null, Pe(k(s).rows, (u, c) => (C(), Se(Rc, {
4758
- key: u.id || k(mr)(),
4759
- row: u,
4760
- rowIndex: c,
4761
- tableid: k(s).id
4762
- }, {
4763
- default: it(() => [
4764
- (C(!0), A(Ie, null, Pe(k(s).columns, (d, f) => (C(), Se(Cc, {
4765
- key: `${f}:${c}`,
4766
- tableid: k(s).id,
4767
- col: d,
4768
- spellcheck: "false",
4769
- rowIndex: c,
4770
- colIndex: f + (k(s).zeroColumn ? 0 : -1),
4771
- component: d.cellComponent,
4772
- style: ie({
4773
- textAlign: (d == null ? void 0 : d.align) || "center",
4774
- minWidth: (d == null ? void 0 : d.width) || "40ch",
4775
- width: k(s).config.fullWidth ? "auto" : null
4776
- })
4777
- }, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
4778
- ]),
4779
- _: 2
4780
- }, 1032, ["row", "rowIndex", "tableid"]))), 128))
4781
- ], !0)
4782
- ]),
4783
- me(a.$slots, "footer", { data: k(s) }, void 0, !0),
4784
- me(a.$slots, "modal", { data: k(s) }, () => [
4785
- lt(at(Fc, {
4786
- colIndex: k(s).modal.colIndex,
4787
- rowIndex: k(s).modal.rowIndex,
4788
- tableid: k(s).id,
4789
- style: ie({
4790
- left: k(s).modal.left + "px",
4791
- top: k(s).modal.top + "px",
4792
- maxWidth: k(s).modal.width + "px"
4793
- })
4794
- }, {
4795
- default: it(() => [
4796
- (C(), Se(Bt(k(s).modal.component), Ut({
4797
- key: `${k(s).modal.rowIndex}:${k(s).modal.colIndex}`,
4798
- colIndex: k(s).modal.colIndex,
4799
- rowIndex: k(s).modal.rowIndex,
4800
- tableid: k(s).id
4801
- }, k(s).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
4802
- ]),
4803
- _: 1
4804
- }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
4805
- [jt, k(s).modal.visible]
4806
- ])
4807
- ], !0)
4808
- ], 4));
4809
- }
4810
- }), zc = /* @__PURE__ */ qe(Gc, [["__scopeId", "data-v-55d8ba05"]]), Qc = /* @__PURE__ */ q({
4811
- __name: "Records",
4812
- setup(e) {
4813
- const { stonecrop: t, isReady: n } = No(), o = { view: "list" };
4814
- return (r, s) => k(n) ? (C(), Se(k(zc), {
4815
- key: 0,
4816
- columns: k(t).schema.schema.toArray(),
4817
- rows: k(t).store.records,
4818
- config: o
4819
- }, null, 8, ["columns", "rows"])) : ke("", !0);
4820
- }
4821
- }), vr = (e) => (lo("data-v-18bfde6e"), e = e(), uo(), e), qc = { class: "tabs" }, Kc = { tabindex: "0" }, Jc = {
4822
- version: "1.1",
4823
- id: "Capa_1",
4824
- xmlns: "http://www.w3.org/2000/svg",
4825
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
4826
- x: "0px",
4827
- y: "0px",
4828
- viewBox: "0 0 424.098 424.098",
4829
- style: { "enable-background": "new 0 0 424.098 424.098" },
4830
- "xml:space": "preserve"
4831
- }, Yc = /* @__PURE__ */ vr(() => /* @__PURE__ */ T("g", null, [
4832
- /* @__PURE__ */ T("path", {
4833
- style: { fill: "#010002" },
4834
- d: `M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
4835
- c-3.284-0.008-6.243-1.992-7.495-5.023c-1.252-3.04-0.553-6.527,1.764-8.852L206.104,24.546c1.853-1.845,4.503-2.666,7.047-2.276
4836
- c2.414,0.39,4.511,1.845,5.731,3.942l47.43,47.43V58.499c0-4.487,3.633-8.129,8.129-8.129h47.755c4.495,0,8.129,3.642,8.129,8.129
4837
- v79.156l91.39,91.398c2.325,2.325,3.024,5.828,1.764,8.868c-1.26,3.032-4.227,5.007-7.511,5.007c-0.008,0-0.008,0-0.016,0
4838
- l-56.64-0.114v150.98C359.32,398.29,355.686,401.923,351.191,401.923z M81.03,385.666h262.033V234.67
4839
- c0-2.162,0.854-4.235,2.39-5.755c1.528-1.52,3.585-2.374,5.739-2.374c0.008,0,0.008,0,0.016,0l45.105,0.089l-79.855-79.863
4840
- c-1.528-1.528-2.382-3.593-2.382-5.747V66.628h-31.498v26.645c0,3.284-1.975,6.251-5.015,7.511
4841
- c-3.032,1.268-6.527,0.569-8.86-1.764l-57.038-57.038l-183.95,183.95l45.203,0.089c4.487,0.008,8.112,3.642,8.112,8.129
4842
- C81.03,234.149,81.03,385.666,81.03,385.666z`
4843
- })
4844
- ], -1)), Xc = [
4845
- Yc
4846
- ], Zc = { tabindex: "0" }, el = { style: { width: "11pt" } }, tl = /* @__PURE__ */ vr(() => /* @__PURE__ */ T("g", { transform: "matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)" }, [
4847
- /* @__PURE__ */ T("path", {
4848
- d: "M 93.148438,80.832031 C 109.5,57.742188 104.03125,25.769531 80.941406,9.421875 57.851562,-6.925781 25.878906,-1.460938 9.53125,21.632812 -6.816406,44.722656 -1.351562,76.691406 21.742188,93.039062 38.222656,104.70703 60.011719,105.60547 77.394531,95.339844 l 37.769529,37.542966 c 4.07813,4.29297 10.86328,4.46485 15.15625,0.38672 4.29297,-4.07422 4.46485,-10.85937 0.39063,-15.15234 -0.12891,-0.13672 -0.25391,-0.26172 -0.39063,-0.39063 z m -41.839844,3.5 C 33.0625,84.335938 18.269531,69.554688 18.257812,51.308594 18.253906,33.0625 33.035156,18.269531 51.285156,18.261719 c 18.222656,-0.0078 33.007813,14.75 33.042969,32.972656 0.03125,18.25 -14.742187,33.066406 -32.996094,33.097656 -0.0078,0 -0.01172,0 -0.02344,0 z m 0,0",
4849
- style: { fill: "#000000", "fill-opacity": "1", "fill-rule": "nonzero", stroke: "none" },
4850
- id: "path2"
4851
- })
4852
- ], -1)), nl = [
4853
- tl
4854
- ], ol = /* @__PURE__ */ q({
4855
- __name: "SheetNav",
4856
- props: {
4857
- breadcrumbs: {}
4858
- },
4859
- setup(e) {
4860
- const t = e, n = V([]), o = V(!0), r = V(!1), s = V(""), i = V(null), a = B(() => o.value ? "unrotated" : "rotated");
4861
- Lt(() => {
4862
- n.value = t.breadcrumbs || [];
4863
- });
4864
- const l = () => {
4865
- o.value = !o.value;
4866
- }, u = async () => {
4867
- r.value = !r.value, await Fe(() => {
4868
- i.value.focus();
4869
- });
4870
- }, c = (p) => {
4871
- p.preventDefault(), p.stopPropagation();
4872
- }, d = async (p) => {
4873
- p.preventDefault(), p.stopPropagation(), await u();
4874
- }, f = () => {
4875
- };
4876
- return (p, v) => {
4877
- const m = Or("router-link");
4878
- return C(), A("footer", null, [
4879
- T("ul", qc, [
4880
- T("li", {
4881
- class: "hidebreadcrumbs",
4882
- onClick: l,
4883
- onKeydown: Ye(l, ["enter"])
4884
- }, [
4885
- T("a", Kc, [
4886
- T("div", {
4887
- class: co(a.value)
4888
- }, "×", 2)
4889
- ])
4890
- ], 32),
4891
- T("li", {
4892
- class: "hometab",
4893
- onClick: f,
4894
- onKeydown: Ye(f, ["enter"]),
4895
- style: ie({ display: o.value ? "block" : "none" })
4896
- }, [
4897
- at(m, {
4898
- to: "/home",
4899
- tabindex: "0"
4900
- }, {
4901
- default: it(() => [
4902
- (C(), A("svg", Jc, Xc))
4903
- ]),
4904
- _: 1
4905
- })
4906
- ], 36),
4907
- T("li", {
4908
- class: "searchtab",
4909
- onClick: u,
4910
- onKeydown: Ye(u, ["enter"]),
4911
- style: ie({ display: o.value ? "block" : "none" })
4912
- }, [
4913
- T("a", Zc, [
4914
- T("span", {
4915
- style: ie({ display: r.value ? "none" : "block" })
4916
- }, [
4917
- (C(), A("svg", el, nl))
4918
- ], 4),
4919
- lt(T("input", {
4920
- "onUpdate:modelValue": v[0] || (v[0] = (w) => s.value = w),
4921
- ref_key: "searchinput",
4922
- ref: i,
4923
- style: ie({ display: r.value ? "block" : "none" }),
4924
- onClick: v[1] || (v[1] = (w) => c(w)),
4925
- onInput: v[2] || (v[2] = (w) => c(w)),
4926
- onBlur: v[3] || (v[3] = (w) => d(w)),
4927
- onKeydown: v[4] || (v[4] = Ye((w) => d(w), ["enter"])),
4928
- type: "text"
4929
- }, null, 36), [
4930
- [Ir, s.value]
4931
- ])
4932
- ])
4933
- ], 36),
4934
- (C(!0), A(Ie, null, Pe(n.value, (w, O) => (C(), A("li", {
4935
- key: O,
4936
- style: ie({ display: o.value ? "block" : "none" })
4937
- }, [
4938
- at(m, {
4939
- tabindex: "0",
4940
- to: w.to
4941
- }, {
4942
- default: it(() => [
4943
- go(ce(w.title), 1)
4944
- ]),
4945
- _: 2
4946
- }, 1032, ["to"])
4947
- ], 4))), 128))
4948
- ])
4949
- ]);
4950
- };
4951
- }
4952
- }), rl = /* @__PURE__ */ Gt(ol, [["__scopeId", "data-v-18bfde6e"]]), al = {
4953
- install: (e) => {
4954
- e.component("ActionSet", Ur), e.component("CommandPalette", Fr), e.component("Doctype", uc), e.component("Records", Qc), e.component("SheetNav", rl);
4955
- }
4956
- };
4957
- export {
4958
- Ur as ActionSet,
4959
- Fr as CommandPalette,
4960
- uc as Doctype,
4961
- Qc as Records,
4962
- rl as SheetNav,
4963
- al as StonecropDesktop
4964
- };
4965
- //# sourceMappingURL=desktop.js.map