bt-core-app 1.4.63 → 1.4.65
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/bt-core-app.js +806 -776
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as z, shallowRef as Re, computed as te, toValue as K, watch as _e, toRef as Zt, onMounted as Or } from "vue";
|
|
2
2
|
import { watchArray as pr, useStorage as Jt, useEventListener as he, toValue as Ae, useParentElement as jt, useResizeObserver as Kt, useArrayUnique as Qt, useArrayDifference as Wr, watchDebounced as Xt, tryOnMounted as Ot } from "@vueuse/core";
|
|
3
3
|
import { defineStore as et } from "pinia";
|
|
4
4
|
import { DateTime as de } from "luxon";
|
|
@@ -11,7 +11,7 @@ function en(e) {
|
|
|
11
11
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
12
12
|
}
|
|
13
13
|
function rn(e) {
|
|
14
|
-
const t =
|
|
14
|
+
const t = z([]), l = Re(), S = Re(), s = Re(), g = te(() => l.value != null);
|
|
15
15
|
function x(d) {
|
|
16
16
|
t.value = t.value.filter((h) => h.id != d);
|
|
17
17
|
}
|
|
@@ -23,10 +23,10 @@ function rn(e) {
|
|
|
23
23
|
return t.value.push(h), h.id;
|
|
24
24
|
}
|
|
25
25
|
function T(d) {
|
|
26
|
-
d != null && (
|
|
26
|
+
d != null && (S.value = d.toString());
|
|
27
27
|
}
|
|
28
28
|
function N() {
|
|
29
|
-
|
|
29
|
+
S.value = void 0;
|
|
30
30
|
}
|
|
31
31
|
async function $(d, h) {
|
|
32
32
|
const u = { ...h };
|
|
@@ -36,9 +36,13 @@ function rn(e) {
|
|
|
36
36
|
try {
|
|
37
37
|
return u.requireConfirmation || u.confirmationMsg, y = await d(), u.completionMsg != null && (s.value = u.completionMsg), y;
|
|
38
38
|
} catch (I) {
|
|
39
|
-
if (u.
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
if (u.onError != null)
|
|
40
|
+
u.onError(I);
|
|
41
|
+
else {
|
|
42
|
+
if (u.throwError == !0)
|
|
43
|
+
return I;
|
|
44
|
+
T(u.errorMsg ?? I ?? "error");
|
|
45
|
+
}
|
|
42
46
|
} finally {
|
|
43
47
|
x(r);
|
|
44
48
|
}
|
|
@@ -46,7 +50,7 @@ function rn(e) {
|
|
|
46
50
|
return pr(t, (d) => {
|
|
47
51
|
l.value = d.length > 0 ? d[0].msg : void 0;
|
|
48
52
|
}, { deep: !0 }), {
|
|
49
|
-
actionErrorMsg:
|
|
53
|
+
actionErrorMsg: S,
|
|
50
54
|
actionLoadingMsg: l,
|
|
51
55
|
actionCompleteMsg: s,
|
|
52
56
|
clearErrors: N,
|
|
@@ -59,7 +63,7 @@ var Qe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
59
63
|
function tn(e) {
|
|
60
64
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
61
65
|
}
|
|
62
|
-
var
|
|
66
|
+
var Ue = function() {
|
|
63
67
|
function e(s) {
|
|
64
68
|
return s;
|
|
65
69
|
}
|
|
@@ -86,25 +90,25 @@ var Be = function() {
|
|
|
86
90
|
return -s(d, h);
|
|
87
91
|
} : s;
|
|
88
92
|
}
|
|
89
|
-
function
|
|
93
|
+
function S(s, g) {
|
|
90
94
|
var x = typeof this == "function" && !this.firstBy ? this : !1, P = l(s, g), T = x ? function(N, $) {
|
|
91
95
|
return x(N, $) || P(N, $);
|
|
92
96
|
} : P;
|
|
93
|
-
return T.thenBy =
|
|
97
|
+
return T.thenBy = S, T;
|
|
94
98
|
}
|
|
95
|
-
return
|
|
99
|
+
return S.firstBy = S, S;
|
|
96
100
|
}();
|
|
97
|
-
function
|
|
98
|
-
let l = e ?? "",
|
|
101
|
+
function Be(e, t) {
|
|
102
|
+
let l = e ?? "", S = t ?? "";
|
|
99
103
|
if (l.endsWith("/"))
|
|
100
104
|
do
|
|
101
105
|
l = l.slice(0, l.length - 1);
|
|
102
106
|
while (l.endsWith("/"));
|
|
103
|
-
if (
|
|
107
|
+
if (S.startsWith("/"))
|
|
104
108
|
do
|
|
105
|
-
|
|
106
|
-
while (
|
|
107
|
-
return `${l}/${
|
|
109
|
+
S = S.slice(1, S.length);
|
|
110
|
+
while (S.startsWith("/"));
|
|
111
|
+
return `${l}/${S}`;
|
|
108
112
|
}
|
|
109
113
|
function Jn(e) {
|
|
110
114
|
return e == null || !Array.isArray(e) ? e : [...new Set(e.map((t) => t))];
|
|
@@ -155,13 +159,13 @@ function tt(e, t = !1) {
|
|
|
155
159
|
}
|
|
156
160
|
function pn(e, t, l) {
|
|
157
161
|
if (e) {
|
|
158
|
-
var
|
|
159
|
-
|
|
162
|
+
var S = new Image();
|
|
163
|
+
S.onload = t, S.onerror = l, S.src = e;
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
async function ea(e, t = !0) {
|
|
163
|
-
return new Promise((l,
|
|
164
|
-
e == null &&
|
|
167
|
+
return new Promise((l, S) => {
|
|
168
|
+
e == null && S("no url given");
|
|
165
169
|
var s = new Image();
|
|
166
170
|
s.setAttribute("crossOrigin", "anonymous"), s.onload = function() {
|
|
167
171
|
var g = document.createElement("canvas");
|
|
@@ -169,7 +173,7 @@ async function ea(e, t = !0) {
|
|
|
169
173
|
var x = g.getContext("2d");
|
|
170
174
|
x == null || x.drawImage(this, 0, 0), l(g.toDataURL("image/png"));
|
|
171
175
|
}, s.onerror = function() {
|
|
172
|
-
console.log("errr"), t ?
|
|
176
|
+
console.log("errr"), t ? S("image could not be loaded for some reason") : l(null);
|
|
173
177
|
}, e != null && (s.src = e);
|
|
174
178
|
});
|
|
175
179
|
}
|
|
@@ -185,7 +189,7 @@ function ra(e) {
|
|
|
185
189
|
function an(e) {
|
|
186
190
|
return e == null ? e : e.replace(/\w\S*/g, (t) => t.replace(/^\w/, (l) => l.toUpperCase()));
|
|
187
191
|
}
|
|
188
|
-
const
|
|
192
|
+
const Ye = [
|
|
189
193
|
{ value: 1, short: "sun", values: ["sun", "sunday"] },
|
|
190
194
|
{ value: 2, short: "mon", values: ["mon", "monday"] },
|
|
191
195
|
{ value: 3, short: "tue", values: ["tue", "tues", "tuesday"] },
|
|
@@ -198,19 +202,19 @@ const Ze = [
|
|
|
198
202
|
function ta(e) {
|
|
199
203
|
if (e == null)
|
|
200
204
|
return 0;
|
|
201
|
-
const t = e.replaceAll(" ", "").split(",").map((
|
|
205
|
+
const t = e.replaceAll(" ", "").split(",").map((S) => S.toLowerCase()), l = Ye.filter((S) => S.values.some((s) => t.some((g) => s == g))).map((S) => S.value);
|
|
202
206
|
return l.length == 0 ? 8 : Math.min(...l);
|
|
203
207
|
}
|
|
204
208
|
function na(e) {
|
|
205
209
|
return e == null ? e : e.toLowerCase().replaceAll(" ", "").split(",").map((t) => {
|
|
206
|
-
let l =
|
|
210
|
+
let l = Ye.find((S) => S.values.some((s) => s == t));
|
|
207
211
|
return l != null ? l.short : "";
|
|
208
212
|
}).filter((t) => t != null && t.length > 0).toString();
|
|
209
213
|
}
|
|
210
214
|
function aa(e, t) {
|
|
211
215
|
if (e == null || t == null)
|
|
212
216
|
return !0;
|
|
213
|
-
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()),
|
|
217
|
+
const l = e.replaceAll(" ", "").split(",").map((g) => g.toLowerCase()), S = t.replaceAll(" ", "").toLowerCase(), s = Ye.find((g) => g.values.some((x) => x == S));
|
|
214
218
|
return s != null && l.some((g) => g == s.short || s.values.some((x) => x == g));
|
|
215
219
|
}
|
|
216
220
|
function la(e, t) {
|
|
@@ -218,13 +222,13 @@ function la(e, t) {
|
|
|
218
222
|
return e;
|
|
219
223
|
let l = e ?? "";
|
|
220
224
|
l = `${l},${t}`;
|
|
221
|
-
let
|
|
222
|
-
return
|
|
225
|
+
let S = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((s) => Ye.find((g) => g.values.some((x) => x == s))).filter((s) => s != null).sort(Ue.firstBy((s) => (s == null ? void 0 : s.value) ?? 0)).map((s) => s == null ? void 0 : s.short))].toString();
|
|
226
|
+
return S.length > 0 ? S : void 0;
|
|
223
227
|
}
|
|
224
228
|
function ua(e, t) {
|
|
225
229
|
if (t == null || e == null)
|
|
226
230
|
return e;
|
|
227
|
-
let l = e ?? "",
|
|
231
|
+
let l = e ?? "", S = t.replaceAll(" ", "").toLowerCase(), s = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((g) => Ye.find((x) => x.values.some((P) => P == g && P != S))).filter((g) => g != null).sort(Ue.firstBy((g) => (g == null ? void 0 : g.value) ?? 0)).map((g) => g == null ? void 0 : g.short))].toString();
|
|
228
232
|
return s.length > 0 ? s : void 0;
|
|
229
233
|
}
|
|
230
234
|
function ia(e, t) {
|
|
@@ -243,38 +247,38 @@ function un() {
|
|
|
243
247
|
return "0001-01-01T00:00:00Z";
|
|
244
248
|
}
|
|
245
249
|
function fa(e, t) {
|
|
246
|
-
let l = "1",
|
|
247
|
-
if (
|
|
250
|
+
let l = "1", S = 0;
|
|
251
|
+
if (S < t)
|
|
248
252
|
do
|
|
249
|
-
l = l + "0",
|
|
250
|
-
while (
|
|
253
|
+
l = l + "0", S += 1;
|
|
254
|
+
while (S < t);
|
|
251
255
|
let s = Number.parseInt(l);
|
|
252
256
|
return Math.round(e * s) / s;
|
|
253
257
|
}
|
|
254
258
|
function sa(e, t) {
|
|
255
259
|
let l = e ?? "";
|
|
256
|
-
return t != null && (cn(l, t) ? l = l.split(",").filter((
|
|
260
|
+
return t != null && (cn(l, t) ? l = l.split(",").filter((S) => S != t).toString() : l != null ? l = `${l},${t}` : l = t), l != null && l.length > 0 ? l : null;
|
|
257
261
|
}
|
|
258
262
|
function cn(e, t) {
|
|
259
263
|
if (e == null || e.length == 0)
|
|
260
264
|
return !1;
|
|
261
265
|
if (!t)
|
|
262
266
|
return !0;
|
|
263
|
-
var l = e.split(","),
|
|
264
|
-
return l.some((s) =>
|
|
267
|
+
var l = e.split(","), S = t.split(",");
|
|
268
|
+
return l.some((s) => S.some((g) => g == s));
|
|
265
269
|
}
|
|
266
270
|
function Lr(e) {
|
|
267
271
|
if (!e)
|
|
268
272
|
return e;
|
|
269
273
|
let t, l = Array.isArray(e) ? [] : {};
|
|
270
|
-
for (const
|
|
271
|
-
t = e[
|
|
274
|
+
for (const S in e)
|
|
275
|
+
t = e[S], l[S] = typeof t == "object" ? Lr(t) : t;
|
|
272
276
|
return l;
|
|
273
277
|
}
|
|
274
278
|
function fn(e) {
|
|
275
279
|
return e && Object.keys(e).sort().reduce(function(t, l) {
|
|
276
|
-
let
|
|
277
|
-
return t[l] = typeof
|
|
280
|
+
let S = e[l];
|
|
281
|
+
return t[l] = typeof S == "object" && S !== null ? fn(S) : S, t;
|
|
278
282
|
}, Array.isArray(e) ? [] : {});
|
|
279
283
|
}
|
|
280
284
|
function sn(e, t) {
|
|
@@ -284,17 +288,17 @@ function nt(e, t = (l) => l) {
|
|
|
284
288
|
if (e == null)
|
|
285
289
|
return [];
|
|
286
290
|
const l = Array.isArray(e) ? e : t(e);
|
|
287
|
-
return Te(l) ? [...l.reduce((
|
|
288
|
-
|
|
291
|
+
return Te(l) ? [...l.reduce((S, s) => {
|
|
292
|
+
S.push(s);
|
|
289
293
|
const g = nt(s, t);
|
|
290
|
-
return Te(g) &&
|
|
294
|
+
return Te(g) && S.push(...g), S;
|
|
291
295
|
}, [])] : [];
|
|
292
296
|
}
|
|
293
297
|
function oa(e) {
|
|
294
|
-
const t = e.split(","), l = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]),
|
|
298
|
+
const t = e.split(","), l = t[0].indexOf("base64") >= 0 ? atob(t[1]) : decodeURI(t[1]), S = t[0].split(":")[1].split(";")[0], s = new Uint8Array(l.length);
|
|
295
299
|
for (let g = 0; g < l.length; g++)
|
|
296
300
|
s[g] = l.charCodeAt(g);
|
|
297
|
-
return new Blob([s], { type:
|
|
301
|
+
return new Blob([s], { type: S });
|
|
298
302
|
}
|
|
299
303
|
function on(e) {
|
|
300
304
|
var t = "";
|
|
@@ -320,8 +324,8 @@ function hn(e, t, l) {
|
|
|
320
324
|
return !1;
|
|
321
325
|
for (let s = 0; s < l.length; s++) {
|
|
322
326
|
const g = l[s];
|
|
323
|
-
var
|
|
324
|
-
if (
|
|
327
|
+
var S = Sr(e, g);
|
|
328
|
+
if (S != null && typeof S == "string" && sn(S, t))
|
|
325
329
|
return !0;
|
|
326
330
|
}
|
|
327
331
|
return !1;
|
|
@@ -338,8 +342,8 @@ function Sr(e, t) {
|
|
|
338
342
|
if (e == null || e == null || !t)
|
|
339
343
|
return null;
|
|
340
344
|
var l = t.split(".");
|
|
341
|
-
let
|
|
342
|
-
for (var s = e, g = 0; g <
|
|
345
|
+
let S = l.length;
|
|
346
|
+
for (var s = e, g = 0; g < S; g++)
|
|
343
347
|
if (s = s[l[g]], s == null)
|
|
344
348
|
return null;
|
|
345
349
|
return s;
|
|
@@ -364,10 +368,10 @@ var at = { exports: {} };
|
|
|
364
368
|
(function(l) {
|
|
365
369
|
e.exports = l();
|
|
366
370
|
})(function() {
|
|
367
|
-
return function l(
|
|
371
|
+
return function l(S, s, g) {
|
|
368
372
|
function x(N, $) {
|
|
369
373
|
if (!s[N]) {
|
|
370
|
-
if (!
|
|
374
|
+
if (!S[N]) {
|
|
371
375
|
var d = typeof Xe == "function" && Xe;
|
|
372
376
|
if (!$ && d)
|
|
373
377
|
return d(N, !0);
|
|
@@ -377,17 +381,17 @@ var at = { exports: {} };
|
|
|
377
381
|
throw h.code = "MODULE_NOT_FOUND", h;
|
|
378
382
|
}
|
|
379
383
|
var u = s[N] = { exports: {} };
|
|
380
|
-
|
|
381
|
-
var y =
|
|
384
|
+
S[N][0].call(u.exports, function(r) {
|
|
385
|
+
var y = S[N][1][r];
|
|
382
386
|
return x(y || r);
|
|
383
|
-
}, u, u.exports, l,
|
|
387
|
+
}, u, u.exports, l, S, s, g);
|
|
384
388
|
}
|
|
385
389
|
return s[N].exports;
|
|
386
390
|
}
|
|
387
391
|
for (var P = typeof Xe == "function" && Xe, T = 0; T < g.length; T++)
|
|
388
392
|
x(g[T]);
|
|
389
393
|
return x;
|
|
390
|
-
}({ 1: [function(l,
|
|
394
|
+
}({ 1: [function(l, S, s) {
|
|
391
395
|
(function(g) {
|
|
392
396
|
var x = g.MutationObserver || g.WebKitMutationObserver, P;
|
|
393
397
|
if (x) {
|
|
@@ -414,167 +418,167 @@ var at = { exports: {} };
|
|
|
414
418
|
var h, u = [];
|
|
415
419
|
function r() {
|
|
416
420
|
h = !0;
|
|
417
|
-
for (var I, c,
|
|
418
|
-
for (c = u, u = [], I = -1; ++I <
|
|
421
|
+
for (var I, c, E = u.length; E; ) {
|
|
422
|
+
for (c = u, u = [], I = -1; ++I < E; )
|
|
419
423
|
c[I]();
|
|
420
|
-
|
|
424
|
+
E = u.length;
|
|
421
425
|
}
|
|
422
426
|
h = !1;
|
|
423
427
|
}
|
|
424
|
-
|
|
428
|
+
S.exports = y;
|
|
425
429
|
function y(I) {
|
|
426
430
|
u.push(I) === 1 && !h && P();
|
|
427
431
|
}
|
|
428
432
|
}).call(this, typeof Qe < "u" ? Qe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
429
|
-
}, {}], 2: [function(l,
|
|
433
|
+
}, {}], 2: [function(l, S, s) {
|
|
430
434
|
var g = l(1);
|
|
431
435
|
function x() {
|
|
432
436
|
}
|
|
433
437
|
var P = {}, T = ["REJECTED"], N = ["FULFILLED"], $ = ["PENDING"];
|
|
434
|
-
|
|
435
|
-
function d(
|
|
436
|
-
if (typeof
|
|
438
|
+
S.exports = d;
|
|
439
|
+
function d(b) {
|
|
440
|
+
if (typeof b != "function")
|
|
437
441
|
throw new TypeError("resolver must be a function");
|
|
438
|
-
this.state = $, this.queue = [], this.outcome = void 0,
|
|
442
|
+
this.state = $, this.queue = [], this.outcome = void 0, b !== x && y(this, b);
|
|
439
443
|
}
|
|
440
|
-
d.prototype.catch = function(
|
|
441
|
-
return this.then(null,
|
|
442
|
-
}, d.prototype.then = function(
|
|
443
|
-
if (typeof
|
|
444
|
+
d.prototype.catch = function(b) {
|
|
445
|
+
return this.then(null, b);
|
|
446
|
+
}, d.prototype.then = function(b, _) {
|
|
447
|
+
if (typeof b != "function" && this.state === N || typeof _ != "function" && this.state === T)
|
|
444
448
|
return this;
|
|
445
449
|
var D = new this.constructor(x);
|
|
446
450
|
if (this.state !== $) {
|
|
447
|
-
var
|
|
448
|
-
u(D,
|
|
451
|
+
var L = this.state === N ? b : _;
|
|
452
|
+
u(D, L, this.outcome);
|
|
449
453
|
} else
|
|
450
|
-
this.queue.push(new h(D,
|
|
454
|
+
this.queue.push(new h(D, b, _));
|
|
451
455
|
return D;
|
|
452
456
|
};
|
|
453
|
-
function h(
|
|
454
|
-
this.promise =
|
|
457
|
+
function h(b, _, D) {
|
|
458
|
+
this.promise = b, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof D == "function" && (this.onRejected = D, this.callRejected = this.otherCallRejected);
|
|
455
459
|
}
|
|
456
|
-
h.prototype.callFulfilled = function(
|
|
457
|
-
P.resolve(this.promise,
|
|
458
|
-
}, h.prototype.otherCallFulfilled = function(
|
|
459
|
-
u(this.promise, this.onFulfilled,
|
|
460
|
-
}, h.prototype.callRejected = function(
|
|
461
|
-
P.reject(this.promise,
|
|
462
|
-
}, h.prototype.otherCallRejected = function(
|
|
463
|
-
u(this.promise, this.onRejected,
|
|
460
|
+
h.prototype.callFulfilled = function(b) {
|
|
461
|
+
P.resolve(this.promise, b);
|
|
462
|
+
}, h.prototype.otherCallFulfilled = function(b) {
|
|
463
|
+
u(this.promise, this.onFulfilled, b);
|
|
464
|
+
}, h.prototype.callRejected = function(b) {
|
|
465
|
+
P.reject(this.promise, b);
|
|
466
|
+
}, h.prototype.otherCallRejected = function(b) {
|
|
467
|
+
u(this.promise, this.onRejected, b);
|
|
464
468
|
};
|
|
465
|
-
function u(
|
|
469
|
+
function u(b, _, D) {
|
|
466
470
|
g(function() {
|
|
467
|
-
var
|
|
471
|
+
var L;
|
|
468
472
|
try {
|
|
469
|
-
|
|
473
|
+
L = _(D);
|
|
470
474
|
} catch (f) {
|
|
471
|
-
return P.reject(
|
|
475
|
+
return P.reject(b, f);
|
|
472
476
|
}
|
|
473
|
-
|
|
477
|
+
L === b ? P.reject(b, new TypeError("Cannot resolve promise with itself")) : P.resolve(b, L);
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
|
-
P.resolve = function(
|
|
480
|
+
P.resolve = function(b, _) {
|
|
477
481
|
var D = I(r, _);
|
|
478
482
|
if (D.status === "error")
|
|
479
|
-
return P.reject(
|
|
480
|
-
var
|
|
481
|
-
if (
|
|
482
|
-
y(
|
|
483
|
+
return P.reject(b, D.value);
|
|
484
|
+
var L = D.value;
|
|
485
|
+
if (L)
|
|
486
|
+
y(b, L);
|
|
483
487
|
else {
|
|
484
|
-
|
|
485
|
-
for (var f = -1, A =
|
|
486
|
-
|
|
488
|
+
b.state = N, b.outcome = _;
|
|
489
|
+
for (var f = -1, A = b.queue.length; ++f < A; )
|
|
490
|
+
b.queue[f].callFulfilled(_);
|
|
487
491
|
}
|
|
488
|
-
return
|
|
489
|
-
}, P.reject = function(
|
|
490
|
-
|
|
491
|
-
for (var D = -1,
|
|
492
|
-
|
|
493
|
-
return
|
|
492
|
+
return b;
|
|
493
|
+
}, P.reject = function(b, _) {
|
|
494
|
+
b.state = T, b.outcome = _;
|
|
495
|
+
for (var D = -1, L = b.queue.length; ++D < L; )
|
|
496
|
+
b.queue[D].callRejected(_);
|
|
497
|
+
return b;
|
|
494
498
|
};
|
|
495
|
-
function r(
|
|
496
|
-
var _ =
|
|
497
|
-
if (
|
|
499
|
+
function r(b) {
|
|
500
|
+
var _ = b && b.then;
|
|
501
|
+
if (b && (typeof b == "object" || typeof b == "function") && typeof _ == "function")
|
|
498
502
|
return function() {
|
|
499
|
-
_.apply(
|
|
503
|
+
_.apply(b, arguments);
|
|
500
504
|
};
|
|
501
505
|
}
|
|
502
|
-
function y(
|
|
506
|
+
function y(b, _) {
|
|
503
507
|
var D = !1;
|
|
504
|
-
function
|
|
505
|
-
D || (D = !0, P.reject(
|
|
508
|
+
function L(Q) {
|
|
509
|
+
D || (D = !0, P.reject(b, Q));
|
|
506
510
|
}
|
|
507
511
|
function f(Q) {
|
|
508
|
-
D || (D = !0, P.resolve(
|
|
512
|
+
D || (D = !0, P.resolve(b, Q));
|
|
509
513
|
}
|
|
510
514
|
function A() {
|
|
511
|
-
_(f,
|
|
515
|
+
_(f, L);
|
|
512
516
|
}
|
|
513
517
|
var J = I(A);
|
|
514
|
-
J.status === "error" &&
|
|
518
|
+
J.status === "error" && L(J.value);
|
|
515
519
|
}
|
|
516
|
-
function I(
|
|
520
|
+
function I(b, _) {
|
|
517
521
|
var D = {};
|
|
518
522
|
try {
|
|
519
|
-
D.value =
|
|
520
|
-
} catch (
|
|
521
|
-
D.status = "error", D.value =
|
|
523
|
+
D.value = b(_), D.status = "success";
|
|
524
|
+
} catch (L) {
|
|
525
|
+
D.status = "error", D.value = L;
|
|
522
526
|
}
|
|
523
527
|
return D;
|
|
524
528
|
}
|
|
525
529
|
d.resolve = c;
|
|
526
|
-
function c(
|
|
527
|
-
return
|
|
530
|
+
function c(b) {
|
|
531
|
+
return b instanceof this ? b : P.resolve(new this(x), b);
|
|
528
532
|
}
|
|
529
|
-
d.reject =
|
|
530
|
-
function
|
|
533
|
+
d.reject = E;
|
|
534
|
+
function E(b) {
|
|
531
535
|
var _ = new this(x);
|
|
532
|
-
return P.reject(_,
|
|
536
|
+
return P.reject(_, b);
|
|
533
537
|
}
|
|
534
|
-
d.all =
|
|
535
|
-
function
|
|
538
|
+
d.all = w;
|
|
539
|
+
function w(b) {
|
|
536
540
|
var _ = this;
|
|
537
|
-
if (Object.prototype.toString.call(
|
|
541
|
+
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
538
542
|
return this.reject(new TypeError("must be an array"));
|
|
539
|
-
var D =
|
|
543
|
+
var D = b.length, L = !1;
|
|
540
544
|
if (!D)
|
|
541
545
|
return this.resolve([]);
|
|
542
546
|
for (var f = new Array(D), A = 0, J = -1, Q = new this(x); ++J < D; )
|
|
543
|
-
ee(
|
|
547
|
+
ee(b[J], J);
|
|
544
548
|
return Q;
|
|
545
549
|
function ee(ie, we) {
|
|
546
|
-
_.resolve(ie).then(W, function(
|
|
547
|
-
|
|
550
|
+
_.resolve(ie).then(W, function(Y) {
|
|
551
|
+
L || (L = !0, P.reject(Q, Y));
|
|
548
552
|
});
|
|
549
|
-
function W(
|
|
550
|
-
f[we] =
|
|
553
|
+
function W(Y) {
|
|
554
|
+
f[we] = Y, ++A === D && !L && (L = !0, P.resolve(Q, f));
|
|
551
555
|
}
|
|
552
556
|
}
|
|
553
557
|
}
|
|
554
|
-
d.race =
|
|
555
|
-
function
|
|
558
|
+
d.race = M;
|
|
559
|
+
function M(b) {
|
|
556
560
|
var _ = this;
|
|
557
|
-
if (Object.prototype.toString.call(
|
|
561
|
+
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
558
562
|
return this.reject(new TypeError("must be an array"));
|
|
559
|
-
var D =
|
|
563
|
+
var D = b.length, L = !1;
|
|
560
564
|
if (!D)
|
|
561
565
|
return this.resolve([]);
|
|
562
566
|
for (var f = -1, A = new this(x); ++f < D; )
|
|
563
|
-
J(
|
|
567
|
+
J(b[f]);
|
|
564
568
|
return A;
|
|
565
569
|
function J(Q) {
|
|
566
570
|
_.resolve(Q).then(function(ee) {
|
|
567
|
-
|
|
571
|
+
L || (L = !0, P.resolve(A, ee));
|
|
568
572
|
}, function(ee) {
|
|
569
|
-
|
|
573
|
+
L || (L = !0, P.reject(A, ee));
|
|
570
574
|
});
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
|
-
}, { 1: 1 }], 3: [function(l,
|
|
577
|
+
}, { 1: 1 }], 3: [function(l, S, s) {
|
|
574
578
|
(function(g) {
|
|
575
579
|
typeof g.Promise != "function" && (g.Promise = l(2));
|
|
576
580
|
}).call(this, typeof Qe < "u" ? Qe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
577
|
-
}, { 2: 2 }], 4: [function(l,
|
|
581
|
+
}, { 2: 2 }], 4: [function(l, S, s) {
|
|
578
582
|
var g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
579
583
|
return typeof n;
|
|
580
584
|
} : function(n) {
|
|
@@ -646,7 +650,7 @@ var at = { exports: {} };
|
|
|
646
650
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
647
651
|
return arguments[arguments.length - 1];
|
|
648
652
|
}
|
|
649
|
-
var I = "local-forage-detect-blob-support", c = void 0,
|
|
653
|
+
var I = "local-forage-detect-blob-support", c = void 0, E = {}, w = Object.prototype.toString, M = "readonly", b = "readwrite";
|
|
650
654
|
function _(n) {
|
|
651
655
|
for (var i = n.length, a = new ArrayBuffer(i), m = new Uint8Array(a), v = 0; v < i; v++)
|
|
652
656
|
m[v] = n.charCodeAt(v);
|
|
@@ -654,7 +658,7 @@ var at = { exports: {} };
|
|
|
654
658
|
}
|
|
655
659
|
function D(n) {
|
|
656
660
|
return new d(function(i) {
|
|
657
|
-
var a = n.transaction(I,
|
|
661
|
+
var a = n.transaction(I, b), m = $([""]);
|
|
658
662
|
a.objectStore(I).put(m, "key"), a.onabort = function(v) {
|
|
659
663
|
v.preventDefault(), v.stopPropagation(), i(!1);
|
|
660
664
|
}, a.oncomplete = function() {
|
|
@@ -665,13 +669,13 @@ var at = { exports: {} };
|
|
|
665
669
|
return !1;
|
|
666
670
|
});
|
|
667
671
|
}
|
|
668
|
-
function
|
|
672
|
+
function L(n) {
|
|
669
673
|
return typeof c == "boolean" ? d.resolve(c) : D(n).then(function(i) {
|
|
670
674
|
return c = i, c;
|
|
671
675
|
});
|
|
672
676
|
}
|
|
673
677
|
function f(n) {
|
|
674
|
-
var i =
|
|
678
|
+
var i = E[n.name], a = {};
|
|
675
679
|
a.promise = new d(function(m, v) {
|
|
676
680
|
a.resolve = m, a.reject = v;
|
|
677
681
|
}), i.deferredOperations.push(a), i.dbReady ? i.dbReady = i.dbReady.then(function() {
|
|
@@ -679,18 +683,18 @@ var at = { exports: {} };
|
|
|
679
683
|
}) : i.dbReady = a.promise;
|
|
680
684
|
}
|
|
681
685
|
function A(n) {
|
|
682
|
-
var i =
|
|
686
|
+
var i = E[n.name], a = i.deferredOperations.pop();
|
|
683
687
|
if (a)
|
|
684
688
|
return a.resolve(), a.promise;
|
|
685
689
|
}
|
|
686
690
|
function J(n, i) {
|
|
687
|
-
var a =
|
|
691
|
+
var a = E[n.name], m = a.deferredOperations.pop();
|
|
688
692
|
if (m)
|
|
689
693
|
return m.reject(i), m.promise;
|
|
690
694
|
}
|
|
691
695
|
function Q(n, i) {
|
|
692
696
|
return new d(function(a, m) {
|
|
693
|
-
if (
|
|
697
|
+
if (E[n.name] = E[n.name] || ne(), n.db)
|
|
694
698
|
if (i)
|
|
695
699
|
f(n), n.db.close();
|
|
696
700
|
else
|
|
@@ -702,11 +706,11 @@ var at = { exports: {} };
|
|
|
702
706
|
var R = o.result;
|
|
703
707
|
try {
|
|
704
708
|
R.createObjectStore(n.storeName), C.oldVersion <= 1 && R.createObjectStore(I);
|
|
705
|
-
} catch (
|
|
706
|
-
if (
|
|
709
|
+
} catch (B) {
|
|
710
|
+
if (B.name === "ConstraintError")
|
|
707
711
|
console.warn('The database "' + n.name + '" has been upgraded from version ' + C.oldVersion + " to version " + C.newVersion + ', but the storage "' + n.storeName + '" already exists.');
|
|
708
712
|
else
|
|
709
|
-
throw
|
|
713
|
+
throw B;
|
|
710
714
|
}
|
|
711
715
|
}), o.onerror = function(C) {
|
|
712
716
|
C.preventDefault(), m(o.error);
|
|
@@ -750,7 +754,7 @@ var at = { exports: {} };
|
|
|
750
754
|
}, m.readAsBinaryString(n);
|
|
751
755
|
});
|
|
752
756
|
}
|
|
753
|
-
function
|
|
757
|
+
function Y(n) {
|
|
754
758
|
var i = _(atob(n.data));
|
|
755
759
|
return $([i], { type: n.type });
|
|
756
760
|
}
|
|
@@ -759,7 +763,7 @@ var at = { exports: {} };
|
|
|
759
763
|
}
|
|
760
764
|
function ae(n) {
|
|
761
765
|
var i = this, a = i._initReady().then(function() {
|
|
762
|
-
var m =
|
|
766
|
+
var m = E[i._dbInfo.name];
|
|
763
767
|
if (m && m.dbReady)
|
|
764
768
|
return m.dbReady;
|
|
765
769
|
});
|
|
@@ -767,7 +771,7 @@ var at = { exports: {} };
|
|
|
767
771
|
}
|
|
768
772
|
function G(n) {
|
|
769
773
|
f(n);
|
|
770
|
-
for (var i =
|
|
774
|
+
for (var i = E[n.name], a = i.forages, m = 0; m < a.length; m++) {
|
|
771
775
|
var v = a[m];
|
|
772
776
|
v._dbInfo.db && (v._dbInfo.db.close(), v._dbInfo.db = null);
|
|
773
777
|
}
|
|
@@ -818,15 +822,15 @@ var at = { exports: {} };
|
|
|
818
822
|
if (n)
|
|
819
823
|
for (var m in n)
|
|
820
824
|
a[m] = n[m];
|
|
821
|
-
var v =
|
|
822
|
-
v || (v = ne(),
|
|
825
|
+
var v = E[a.name];
|
|
826
|
+
v || (v = ne(), E[a.name] = v), v.forages.push(i), i._initReady || (i._initReady = i.ready, i.ready = ae);
|
|
823
827
|
var o = [];
|
|
824
828
|
function C() {
|
|
825
829
|
return d.resolve();
|
|
826
830
|
}
|
|
827
831
|
for (var R = 0; R < v.forages.length; R++) {
|
|
828
|
-
var
|
|
829
|
-
|
|
832
|
+
var B = v.forages[R];
|
|
833
|
+
B !== i && o.push(B._initReady().catch(C));
|
|
830
834
|
}
|
|
831
835
|
var F = v.forages.slice(0);
|
|
832
836
|
return d.all(o).then(function() {
|
|
@@ -836,8 +840,8 @@ var at = { exports: {} };
|
|
|
836
840
|
}).then(function(k) {
|
|
837
841
|
a.db = v.db = k, i._dbInfo = a;
|
|
838
842
|
for (var q = 0; q < F.length; q++) {
|
|
839
|
-
var
|
|
840
|
-
|
|
843
|
+
var Z = F[q];
|
|
844
|
+
Z !== i && (Z._dbInfo.db = a.db, Z._dbInfo.version = a.version);
|
|
841
845
|
}
|
|
842
846
|
});
|
|
843
847
|
}
|
|
@@ -846,14 +850,14 @@ var at = { exports: {} };
|
|
|
846
850
|
n = r(n);
|
|
847
851
|
var m = new d(function(v, o) {
|
|
848
852
|
a.ready().then(function() {
|
|
849
|
-
X(a._dbInfo,
|
|
853
|
+
X(a._dbInfo, M, function(C, R) {
|
|
850
854
|
if (C)
|
|
851
855
|
return o(C);
|
|
852
856
|
try {
|
|
853
|
-
var
|
|
857
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.get(n);
|
|
854
858
|
F.onsuccess = function() {
|
|
855
859
|
var k = F.result;
|
|
856
|
-
k === void 0 && (k = null), V(k) && (k =
|
|
860
|
+
k === void 0 && (k = null), V(k) && (k = Y(k)), v(k);
|
|
857
861
|
}, F.onerror = function() {
|
|
858
862
|
o(F.error);
|
|
859
863
|
};
|
|
@@ -868,17 +872,17 @@ var at = { exports: {} };
|
|
|
868
872
|
function Ee(n, i) {
|
|
869
873
|
var a = this, m = new d(function(v, o) {
|
|
870
874
|
a.ready().then(function() {
|
|
871
|
-
X(a._dbInfo,
|
|
875
|
+
X(a._dbInfo, M, function(C, R) {
|
|
872
876
|
if (C)
|
|
873
877
|
return o(C);
|
|
874
878
|
try {
|
|
875
|
-
var
|
|
879
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.openCursor(), k = 1;
|
|
876
880
|
F.onsuccess = function() {
|
|
877
881
|
var q = F.result;
|
|
878
882
|
if (q) {
|
|
879
|
-
var
|
|
880
|
-
V(
|
|
881
|
-
var p = n(
|
|
883
|
+
var Z = q.value;
|
|
884
|
+
V(Z) && (Z = Y(Z));
|
|
885
|
+
var p = n(Z, q.key, k++);
|
|
882
886
|
p !== void 0 ? v(p) : q.continue();
|
|
883
887
|
} else
|
|
884
888
|
v();
|
|
@@ -899,21 +903,21 @@ var at = { exports: {} };
|
|
|
899
903
|
var v = new d(function(o, C) {
|
|
900
904
|
var R;
|
|
901
905
|
m.ready().then(function() {
|
|
902
|
-
return R = m._dbInfo,
|
|
903
|
-
return
|
|
906
|
+
return R = m._dbInfo, w.call(i) === "[object Blob]" ? L(R.db).then(function(B) {
|
|
907
|
+
return B ? i : W(i);
|
|
904
908
|
}) : i;
|
|
905
|
-
}).then(function(
|
|
906
|
-
X(m._dbInfo,
|
|
909
|
+
}).then(function(B) {
|
|
910
|
+
X(m._dbInfo, b, function(F, k) {
|
|
907
911
|
if (F)
|
|
908
912
|
return C(F);
|
|
909
913
|
try {
|
|
910
914
|
var q = k.objectStore(m._dbInfo.storeName);
|
|
911
|
-
|
|
912
|
-
var
|
|
915
|
+
B === null && (B = void 0);
|
|
916
|
+
var Z = q.put(B, n);
|
|
913
917
|
k.oncomplete = function() {
|
|
914
|
-
|
|
918
|
+
B === void 0 && (B = null), o(B);
|
|
915
919
|
}, k.onabort = k.onerror = function() {
|
|
916
|
-
var p =
|
|
920
|
+
var p = Z.error ? Z.error : Z.transaction.error;
|
|
917
921
|
C(p);
|
|
918
922
|
};
|
|
919
923
|
} catch (p) {
|
|
@@ -929,11 +933,11 @@ var at = { exports: {} };
|
|
|
929
933
|
n = r(n);
|
|
930
934
|
var m = new d(function(v, o) {
|
|
931
935
|
a.ready().then(function() {
|
|
932
|
-
X(a._dbInfo,
|
|
936
|
+
X(a._dbInfo, b, function(C, R) {
|
|
933
937
|
if (C)
|
|
934
938
|
return o(C);
|
|
935
939
|
try {
|
|
936
|
-
var
|
|
940
|
+
var B = R.objectStore(a._dbInfo.storeName), F = B.delete(n);
|
|
937
941
|
R.oncomplete = function() {
|
|
938
942
|
v();
|
|
939
943
|
}, R.onerror = function() {
|
|
@@ -953,15 +957,15 @@ var at = { exports: {} };
|
|
|
953
957
|
function rr(n) {
|
|
954
958
|
var i = this, a = new d(function(m, v) {
|
|
955
959
|
i.ready().then(function() {
|
|
956
|
-
X(i._dbInfo,
|
|
960
|
+
X(i._dbInfo, b, function(o, C) {
|
|
957
961
|
if (o)
|
|
958
962
|
return v(o);
|
|
959
963
|
try {
|
|
960
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
964
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.clear();
|
|
961
965
|
C.oncomplete = function() {
|
|
962
966
|
m();
|
|
963
967
|
}, C.onabort = C.onerror = function() {
|
|
964
|
-
var F =
|
|
968
|
+
var F = B.error ? B.error : B.transaction.error;
|
|
965
969
|
v(F);
|
|
966
970
|
};
|
|
967
971
|
} catch (F) {
|
|
@@ -975,15 +979,15 @@ var at = { exports: {} };
|
|
|
975
979
|
function tr(n) {
|
|
976
980
|
var i = this, a = new d(function(m, v) {
|
|
977
981
|
i.ready().then(function() {
|
|
978
|
-
X(i._dbInfo,
|
|
982
|
+
X(i._dbInfo, M, function(o, C) {
|
|
979
983
|
if (o)
|
|
980
984
|
return v(o);
|
|
981
985
|
try {
|
|
982
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
983
|
-
|
|
984
|
-
m(
|
|
985
|
-
},
|
|
986
|
-
v(
|
|
986
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.count();
|
|
987
|
+
B.onsuccess = function() {
|
|
988
|
+
m(B.result);
|
|
989
|
+
}, B.onerror = function() {
|
|
990
|
+
v(B.error);
|
|
987
991
|
};
|
|
988
992
|
} catch (F) {
|
|
989
993
|
v(F);
|
|
@@ -1000,11 +1004,11 @@ var at = { exports: {} };
|
|
|
1000
1004
|
return;
|
|
1001
1005
|
}
|
|
1002
1006
|
a.ready().then(function() {
|
|
1003
|
-
X(a._dbInfo,
|
|
1007
|
+
X(a._dbInfo, M, function(C, R) {
|
|
1004
1008
|
if (C)
|
|
1005
1009
|
return o(C);
|
|
1006
1010
|
try {
|
|
1007
|
-
var
|
|
1011
|
+
var B = R.objectStore(a._dbInfo.storeName), F = !1, k = B.openKeyCursor();
|
|
1008
1012
|
k.onsuccess = function() {
|
|
1009
1013
|
var q = k.result;
|
|
1010
1014
|
if (!q) {
|
|
@@ -1026,20 +1030,20 @@ var at = { exports: {} };
|
|
|
1026
1030
|
function Pe(n) {
|
|
1027
1031
|
var i = this, a = new d(function(m, v) {
|
|
1028
1032
|
i.ready().then(function() {
|
|
1029
|
-
X(i._dbInfo,
|
|
1033
|
+
X(i._dbInfo, M, function(o, C) {
|
|
1030
1034
|
if (o)
|
|
1031
1035
|
return v(o);
|
|
1032
1036
|
try {
|
|
1033
|
-
var R = C.objectStore(i._dbInfo.storeName),
|
|
1034
|
-
|
|
1035
|
-
var k =
|
|
1037
|
+
var R = C.objectStore(i._dbInfo.storeName), B = R.openKeyCursor(), F = [];
|
|
1038
|
+
B.onsuccess = function() {
|
|
1039
|
+
var k = B.result;
|
|
1036
1040
|
if (!k) {
|
|
1037
1041
|
m(F);
|
|
1038
1042
|
return;
|
|
1039
1043
|
}
|
|
1040
1044
|
F.push(k.key), k.continue();
|
|
1041
|
-
},
|
|
1042
|
-
v(
|
|
1045
|
+
}, B.onerror = function() {
|
|
1046
|
+
v(B.error);
|
|
1043
1047
|
};
|
|
1044
1048
|
} catch (k) {
|
|
1045
1049
|
v(k);
|
|
@@ -1058,27 +1062,27 @@ var at = { exports: {} };
|
|
|
1058
1062
|
v = d.reject("Invalid arguments");
|
|
1059
1063
|
else {
|
|
1060
1064
|
var o = n.name === a.name && m._dbInfo.db, C = o ? d.resolve(m._dbInfo.db) : ee(n).then(function(R) {
|
|
1061
|
-
var
|
|
1062
|
-
|
|
1065
|
+
var B = E[n.name], F = B.forages;
|
|
1066
|
+
B.db = R;
|
|
1063
1067
|
for (var k = 0; k < F.length; k++)
|
|
1064
1068
|
F[k]._dbInfo.db = R;
|
|
1065
1069
|
return R;
|
|
1066
1070
|
});
|
|
1067
1071
|
n.storeName ? v = C.then(function(R) {
|
|
1068
1072
|
if (R.objectStoreNames.contains(n.storeName)) {
|
|
1069
|
-
var
|
|
1073
|
+
var B = R.version + 1;
|
|
1070
1074
|
f(n);
|
|
1071
|
-
var F =
|
|
1075
|
+
var F = E[n.name], k = F.forages;
|
|
1072
1076
|
R.close();
|
|
1073
1077
|
for (var q = 0; q < k.length; q++) {
|
|
1074
|
-
var
|
|
1075
|
-
|
|
1078
|
+
var Z = k[q];
|
|
1079
|
+
Z._dbInfo.db = null, Z._dbInfo.version = B;
|
|
1076
1080
|
}
|
|
1077
1081
|
var p = new d(function(re, ue) {
|
|
1078
|
-
var le = T.open(n.name,
|
|
1082
|
+
var le = T.open(n.name, B);
|
|
1079
1083
|
le.onerror = function(ge) {
|
|
1080
|
-
var
|
|
1081
|
-
|
|
1084
|
+
var ze = le.result;
|
|
1085
|
+
ze.close(), ue(ge);
|
|
1082
1086
|
}, le.onupgradeneeded = function() {
|
|
1083
1087
|
var ge = le.result;
|
|
1084
1088
|
ge.deleteObjectStore(n.storeName);
|
|
@@ -1100,13 +1104,13 @@ var at = { exports: {} };
|
|
|
1100
1104
|
}
|
|
1101
1105
|
}) : v = C.then(function(R) {
|
|
1102
1106
|
f(n);
|
|
1103
|
-
var
|
|
1107
|
+
var B = E[n.name], F = B.forages;
|
|
1104
1108
|
R.close();
|
|
1105
1109
|
for (var k = 0; k < F.length; k++) {
|
|
1106
1110
|
var q = F[k];
|
|
1107
1111
|
q._dbInfo.db = null;
|
|
1108
1112
|
}
|
|
1109
|
-
var
|
|
1113
|
+
var Z = new d(function(p, re) {
|
|
1110
1114
|
var ue = T.deleteDatabase(n.name);
|
|
1111
1115
|
ue.onerror = function() {
|
|
1112
1116
|
var le = ue.result;
|
|
@@ -1118,8 +1122,8 @@ var at = { exports: {} };
|
|
|
1118
1122
|
le && le.close(), p(le);
|
|
1119
1123
|
};
|
|
1120
1124
|
});
|
|
1121
|
-
return
|
|
1122
|
-
|
|
1125
|
+
return Z.then(function(p) {
|
|
1126
|
+
B.db = p;
|
|
1123
1127
|
for (var re = 0; re < F.length; re++) {
|
|
1124
1128
|
var ue = F[re];
|
|
1125
1129
|
A(ue._dbInfo);
|
|
@@ -1149,13 +1153,13 @@ var at = { exports: {} };
|
|
|
1149
1153
|
function ur() {
|
|
1150
1154
|
return typeof openDatabase == "function";
|
|
1151
1155
|
}
|
|
1152
|
-
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~",
|
|
1156
|
+
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Ze = /^~~local_forage_type~([^~]+)~/, Fe = "__lfsc__:", Ne = Fe.length, We = "arbf", Ie = "blob", Je = "si08", je = "ui08", qe = "uic8", Ve = "si16", U = "si32", j = "ur16", H = "ui32", O = "fl32", oe = "fl64", ve = Ne + We.length, De = Object.prototype.toString;
|
|
1153
1157
|
function Se(n) {
|
|
1154
|
-
var i = n.length * 0.75, a = n.length, m, v = 0, o, C, R,
|
|
1158
|
+
var i = n.length * 0.75, a = n.length, m, v = 0, o, C, R, B;
|
|
1155
1159
|
n[n.length - 1] === "=" && (i--, n[n.length - 2] === "=" && i--);
|
|
1156
1160
|
var F = new ArrayBuffer(i), k = new Uint8Array(F);
|
|
1157
1161
|
for (m = 0; m < a; m += 4)
|
|
1158
|
-
o = be.indexOf(n[m]), C = be.indexOf(n[m + 1]), R = be.indexOf(n[m + 2]),
|
|
1162
|
+
o = be.indexOf(n[m]), C = be.indexOf(n[m + 1]), R = be.indexOf(n[m + 2]), B = be.indexOf(n[m + 3]), k[v++] = o << 2 | C >> 4, k[v++] = (C & 15) << 4 | R >> 2, k[v++] = (R & 3) << 6 | B & 63;
|
|
1159
1163
|
return F;
|
|
1160
1164
|
}
|
|
1161
1165
|
function se(n) {
|
|
@@ -1168,7 +1172,7 @@ var at = { exports: {} };
|
|
|
1168
1172
|
var a = "";
|
|
1169
1173
|
if (n && (a = De.call(n)), n && (a === "[object ArrayBuffer]" || n.buffer && De.call(n.buffer) === "[object ArrayBuffer]")) {
|
|
1170
1174
|
var m, v = Fe;
|
|
1171
|
-
n instanceof ArrayBuffer ? (m = n, v += We) : (m = n.buffer, a === "[object Int8Array]" ? v += Je : a === "[object Uint8Array]" ? v += je : a === "[object Uint8ClampedArray]" ? v += qe : a === "[object Int16Array]" ? v += Ve : a === "[object Uint16Array]" ? v += j : a === "[object Int32Array]" ? v +=
|
|
1175
|
+
n instanceof ArrayBuffer ? (m = n, v += We) : (m = n.buffer, a === "[object Int8Array]" ? v += Je : a === "[object Uint8Array]" ? v += je : a === "[object Uint8ClampedArray]" ? v += qe : a === "[object Int16Array]" ? v += Ve : a === "[object Uint16Array]" ? v += j : a === "[object Int32Array]" ? v += U : a === "[object Uint32Array]" ? v += H : a === "[object Float32Array]" ? v += O : a === "[object Float64Array]" ? v += oe : i(new Error("Failed to get type for BinaryArray"))), i(v + se(m));
|
|
1172
1176
|
} else if (a === "[object Blob]") {
|
|
1173
1177
|
var o = new FileReader();
|
|
1174
1178
|
o.onload = function() {
|
|
@@ -1186,8 +1190,8 @@ var at = { exports: {} };
|
|
|
1186
1190
|
if (n.substring(0, Ne) !== Fe)
|
|
1187
1191
|
return JSON.parse(n);
|
|
1188
1192
|
var i = n.substring(ve), a = n.substring(Ne, ve), m;
|
|
1189
|
-
if (a === Ie &&
|
|
1190
|
-
var v = i.match(
|
|
1193
|
+
if (a === Ie && Ze.test(i)) {
|
|
1194
|
+
var v = i.match(Ze);
|
|
1191
1195
|
m = v[1], i = i.substring(v[0].length);
|
|
1192
1196
|
}
|
|
1193
1197
|
var o = Se(i);
|
|
@@ -1206,7 +1210,7 @@ var at = { exports: {} };
|
|
|
1206
1210
|
return new Int16Array(o);
|
|
1207
1211
|
case j:
|
|
1208
1212
|
return new Uint16Array(o);
|
|
1209
|
-
case
|
|
1213
|
+
case U:
|
|
1210
1214
|
return new Int32Array(o);
|
|
1211
1215
|
case H:
|
|
1212
1216
|
return new Uint32Array(o);
|
|
@@ -1224,7 +1228,7 @@ var at = { exports: {} };
|
|
|
1224
1228
|
stringToBuffer: Se,
|
|
1225
1229
|
bufferToString: se
|
|
1226
1230
|
};
|
|
1227
|
-
function
|
|
1231
|
+
function Ur(n, i, a, m) {
|
|
1228
1232
|
n.executeSql("CREATE TABLE IF NOT EXISTS " + i.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], a, m);
|
|
1229
1233
|
}
|
|
1230
1234
|
function st(n) {
|
|
@@ -1241,9 +1245,9 @@ var at = { exports: {} };
|
|
|
1241
1245
|
return C(R);
|
|
1242
1246
|
}
|
|
1243
1247
|
a.db.transaction(function(R) {
|
|
1244
|
-
|
|
1248
|
+
Ur(R, a, function() {
|
|
1245
1249
|
i._dbInfo = a, o();
|
|
1246
|
-
}, function(
|
|
1250
|
+
}, function(B, F) {
|
|
1247
1251
|
C(F);
|
|
1248
1252
|
});
|
|
1249
1253
|
}, C);
|
|
@@ -1252,9 +1256,9 @@ var at = { exports: {} };
|
|
|
1252
1256
|
}
|
|
1253
1257
|
function xe(n, i, a, m, v, o) {
|
|
1254
1258
|
n.executeSql(a, m, v, function(C, R) {
|
|
1255
|
-
R.code === R.SYNTAX_ERR ? C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(
|
|
1256
|
-
F.rows.length ? o(
|
|
1257
|
-
|
|
1259
|
+
R.code === R.SYNTAX_ERR ? C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(B, F) {
|
|
1260
|
+
F.rows.length ? o(B, R) : Ur(B, i, function() {
|
|
1261
|
+
B.executeSql(a, m, v, o);
|
|
1258
1262
|
}, o);
|
|
1259
1263
|
}, o) : o(C, R);
|
|
1260
1264
|
}, o);
|
|
@@ -1266,10 +1270,10 @@ var at = { exports: {} };
|
|
|
1266
1270
|
a.ready().then(function() {
|
|
1267
1271
|
var C = a._dbInfo;
|
|
1268
1272
|
C.db.transaction(function(R) {
|
|
1269
|
-
xe(R, C, "SELECT * FROM " + C.storeName + " WHERE key = ? LIMIT 1", [n], function(
|
|
1273
|
+
xe(R, C, "SELECT * FROM " + C.storeName + " WHERE key = ? LIMIT 1", [n], function(B, F) {
|
|
1270
1274
|
var k = F.rows.length ? F.rows.item(0).value : null;
|
|
1271
1275
|
k && (k = C.serializer.deserialize(k)), v(k);
|
|
1272
|
-
}, function(
|
|
1276
|
+
}, function(B, F) {
|
|
1273
1277
|
o(F);
|
|
1274
1278
|
});
|
|
1275
1279
|
});
|
|
@@ -1282,16 +1286,16 @@ var at = { exports: {} };
|
|
|
1282
1286
|
a.ready().then(function() {
|
|
1283
1287
|
var C = a._dbInfo;
|
|
1284
1288
|
C.db.transaction(function(R) {
|
|
1285
|
-
xe(R, C, "SELECT * FROM " + C.storeName, [], function(
|
|
1286
|
-
for (var k = F.rows, q = k.length,
|
|
1287
|
-
var p = k.item(
|
|
1288
|
-
if (re && (re = C.serializer.deserialize(re)), re = n(re, p.key,
|
|
1289
|
+
xe(R, C, "SELECT * FROM " + C.storeName, [], function(B, F) {
|
|
1290
|
+
for (var k = F.rows, q = k.length, Z = 0; Z < q; Z++) {
|
|
1291
|
+
var p = k.item(Z), re = p.value;
|
|
1292
|
+
if (re && (re = C.serializer.deserialize(re)), re = n(re, p.key, Z + 1), re !== void 0) {
|
|
1289
1293
|
v(re);
|
|
1290
1294
|
return;
|
|
1291
1295
|
}
|
|
1292
1296
|
}
|
|
1293
1297
|
v();
|
|
1294
|
-
}, function(
|
|
1298
|
+
}, function(B, F) {
|
|
1295
1299
|
o(F);
|
|
1296
1300
|
});
|
|
1297
1301
|
});
|
|
@@ -1299,27 +1303,27 @@ var at = { exports: {} };
|
|
|
1299
1303
|
});
|
|
1300
1304
|
return h(m, i), m;
|
|
1301
1305
|
}
|
|
1302
|
-
function
|
|
1306
|
+
function Br(n, i, a, m) {
|
|
1303
1307
|
var v = this;
|
|
1304
1308
|
n = r(n);
|
|
1305
1309
|
var o = new d(function(C, R) {
|
|
1306
1310
|
v.ready().then(function() {
|
|
1307
1311
|
i === void 0 && (i = null);
|
|
1308
|
-
var
|
|
1312
|
+
var B = i, F = v._dbInfo;
|
|
1309
1313
|
F.serializer.serialize(i, function(k, q) {
|
|
1310
|
-
q ? R(q) : F.db.transaction(function(
|
|
1311
|
-
xe(
|
|
1312
|
-
C(
|
|
1314
|
+
q ? R(q) : F.db.transaction(function(Z) {
|
|
1315
|
+
xe(Z, F, "INSERT OR REPLACE INTO " + F.storeName + " (key, value) VALUES (?, ?)", [n, k], function() {
|
|
1316
|
+
C(B);
|
|
1313
1317
|
}, function(p, re) {
|
|
1314
1318
|
R(re);
|
|
1315
1319
|
});
|
|
1316
|
-
}, function(
|
|
1317
|
-
if (
|
|
1320
|
+
}, function(Z) {
|
|
1321
|
+
if (Z.code === Z.QUOTA_ERR) {
|
|
1318
1322
|
if (m > 0) {
|
|
1319
|
-
C(
|
|
1323
|
+
C(Br.apply(v, [n, B, a, m - 1]));
|
|
1320
1324
|
return;
|
|
1321
1325
|
}
|
|
1322
|
-
R(
|
|
1326
|
+
R(Z);
|
|
1323
1327
|
}
|
|
1324
1328
|
});
|
|
1325
1329
|
});
|
|
@@ -1328,7 +1332,7 @@ var at = { exports: {} };
|
|
|
1328
1332
|
return h(o, a), o;
|
|
1329
1333
|
}
|
|
1330
1334
|
function ht(n, i, a) {
|
|
1331
|
-
return
|
|
1335
|
+
return Br.apply(this, [n, i, a, 1]);
|
|
1332
1336
|
}
|
|
1333
1337
|
function mt(n, i) {
|
|
1334
1338
|
var a = this;
|
|
@@ -1339,7 +1343,7 @@ var at = { exports: {} };
|
|
|
1339
1343
|
C.db.transaction(function(R) {
|
|
1340
1344
|
xe(R, C, "DELETE FROM " + C.storeName + " WHERE key = ?", [n], function() {
|
|
1341
1345
|
v();
|
|
1342
|
-
}, function(
|
|
1346
|
+
}, function(B, F) {
|
|
1343
1347
|
o(F);
|
|
1344
1348
|
});
|
|
1345
1349
|
});
|
|
@@ -1354,8 +1358,8 @@ var at = { exports: {} };
|
|
|
1354
1358
|
o.db.transaction(function(C) {
|
|
1355
1359
|
xe(C, o, "DELETE FROM " + o.storeName, [], function() {
|
|
1356
1360
|
m();
|
|
1357
|
-
}, function(R,
|
|
1358
|
-
v(
|
|
1361
|
+
}, function(R, B) {
|
|
1362
|
+
v(B);
|
|
1359
1363
|
});
|
|
1360
1364
|
});
|
|
1361
1365
|
}).catch(v);
|
|
@@ -1367,11 +1371,11 @@ var at = { exports: {} };
|
|
|
1367
1371
|
i.ready().then(function() {
|
|
1368
1372
|
var o = i._dbInfo;
|
|
1369
1373
|
o.db.transaction(function(C) {
|
|
1370
|
-
xe(C, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R,
|
|
1371
|
-
var F =
|
|
1374
|
+
xe(C, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R, B) {
|
|
1375
|
+
var F = B.rows.item(0).c;
|
|
1372
1376
|
m(F);
|
|
1373
|
-
}, function(R,
|
|
1374
|
-
v(
|
|
1377
|
+
}, function(R, B) {
|
|
1378
|
+
v(B);
|
|
1375
1379
|
});
|
|
1376
1380
|
});
|
|
1377
1381
|
}).catch(v);
|
|
@@ -1383,10 +1387,10 @@ var at = { exports: {} };
|
|
|
1383
1387
|
a.ready().then(function() {
|
|
1384
1388
|
var C = a._dbInfo;
|
|
1385
1389
|
C.db.transaction(function(R) {
|
|
1386
|
-
xe(R, C, "SELECT key FROM " + C.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(
|
|
1390
|
+
xe(R, C, "SELECT key FROM " + C.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(B, F) {
|
|
1387
1391
|
var k = F.rows.length ? F.rows.item(0).key : null;
|
|
1388
1392
|
v(k);
|
|
1389
|
-
}, function(
|
|
1393
|
+
}, function(B, F) {
|
|
1390
1394
|
o(F);
|
|
1391
1395
|
});
|
|
1392
1396
|
});
|
|
@@ -1399,12 +1403,12 @@ var at = { exports: {} };
|
|
|
1399
1403
|
i.ready().then(function() {
|
|
1400
1404
|
var o = i._dbInfo;
|
|
1401
1405
|
o.db.transaction(function(C) {
|
|
1402
|
-
xe(C, o, "SELECT key FROM " + o.storeName, [], function(R,
|
|
1403
|
-
for (var F = [], k = 0; k <
|
|
1404
|
-
F.push(
|
|
1406
|
+
xe(C, o, "SELECT key FROM " + o.storeName, [], function(R, B) {
|
|
1407
|
+
for (var F = [], k = 0; k < B.rows.length; k++)
|
|
1408
|
+
F.push(B.rows.item(k).key);
|
|
1405
1409
|
m(F);
|
|
1406
|
-
}, function(R,
|
|
1407
|
-
v(
|
|
1410
|
+
}, function(R, B) {
|
|
1411
|
+
v(B);
|
|
1408
1412
|
});
|
|
1409
1413
|
});
|
|
1410
1414
|
}).catch(v);
|
|
@@ -1442,25 +1446,25 @@ var at = { exports: {} };
|
|
|
1442
1446
|
}) : o(bt(C));
|
|
1443
1447
|
}).then(function(o) {
|
|
1444
1448
|
return new d(function(C, R) {
|
|
1445
|
-
o.db.transaction(function(
|
|
1449
|
+
o.db.transaction(function(B) {
|
|
1446
1450
|
function F(p) {
|
|
1447
1451
|
return new d(function(re, ue) {
|
|
1448
|
-
|
|
1452
|
+
B.executeSql("DROP TABLE IF EXISTS " + p, [], function() {
|
|
1449
1453
|
re();
|
|
1450
1454
|
}, function(le, ge) {
|
|
1451
1455
|
ue(ge);
|
|
1452
1456
|
});
|
|
1453
1457
|
});
|
|
1454
1458
|
}
|
|
1455
|
-
for (var k = [], q = 0,
|
|
1459
|
+
for (var k = [], q = 0, Z = o.storeNames.length; q < Z; q++)
|
|
1456
1460
|
k.push(F(o.storeNames[q]));
|
|
1457
1461
|
d.all(k).then(function() {
|
|
1458
1462
|
C();
|
|
1459
1463
|
}).catch(function(p) {
|
|
1460
1464
|
R(p);
|
|
1461
1465
|
});
|
|
1462
|
-
}, function(
|
|
1463
|
-
R(
|
|
1466
|
+
}, function(B) {
|
|
1467
|
+
R(B);
|
|
1464
1468
|
});
|
|
1465
1469
|
});
|
|
1466
1470
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
@@ -1529,11 +1533,11 @@ var at = { exports: {} };
|
|
|
1529
1533
|
}
|
|
1530
1534
|
function Ct(n, i) {
|
|
1531
1535
|
var a = this, m = a.ready().then(function() {
|
|
1532
|
-
for (var v = a._dbInfo, o = v.keyPrefix, C = o.length, R = localStorage.length,
|
|
1536
|
+
for (var v = a._dbInfo, o = v.keyPrefix, C = o.length, R = localStorage.length, B = 1, F = 0; F < R; F++) {
|
|
1533
1537
|
var k = localStorage.key(F);
|
|
1534
1538
|
if (k.indexOf(o) === 0) {
|
|
1535
1539
|
var q = localStorage.getItem(k);
|
|
1536
|
-
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(C),
|
|
1540
|
+
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(C), B++), q !== void 0)
|
|
1537
1541
|
return q;
|
|
1538
1542
|
}
|
|
1539
1543
|
}
|
|
@@ -1584,13 +1588,13 @@ var at = { exports: {} };
|
|
|
1584
1588
|
i === void 0 && (i = null);
|
|
1585
1589
|
var o = i;
|
|
1586
1590
|
return new d(function(C, R) {
|
|
1587
|
-
var
|
|
1588
|
-
|
|
1591
|
+
var B = m._dbInfo;
|
|
1592
|
+
B.serializer.serialize(i, function(F, k) {
|
|
1589
1593
|
if (k)
|
|
1590
1594
|
R(k);
|
|
1591
1595
|
else
|
|
1592
1596
|
try {
|
|
1593
|
-
localStorage.setItem(
|
|
1597
|
+
localStorage.setItem(B.keyPrefix + n, F), C(o);
|
|
1594
1598
|
} catch (q) {
|
|
1595
1599
|
(q.name === "QuotaExceededError" || q.name === "NS_ERROR_DOM_QUOTA_REACHED") && R(q), R(q);
|
|
1596
1600
|
}
|
|
@@ -1599,7 +1603,7 @@ var at = { exports: {} };
|
|
|
1599
1603
|
});
|
|
1600
1604
|
return h(v, a), v;
|
|
1601
1605
|
}
|
|
1602
|
-
function
|
|
1606
|
+
function Ut(n, i) {
|
|
1603
1607
|
if (i = y.apply(this, arguments), n = typeof n != "function" && n || {}, !n.name) {
|
|
1604
1608
|
var a = this.config();
|
|
1605
1609
|
n.name = n.name || a.name, n.storeName = n.storeName || a.storeName;
|
|
@@ -1614,7 +1618,7 @@ var at = { exports: {} };
|
|
|
1614
1618
|
}
|
|
1615
1619
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
1616
1620
|
}
|
|
1617
|
-
var
|
|
1621
|
+
var Bt = {
|
|
1618
1622
|
_driver: "localStorageWrapper",
|
|
1619
1623
|
_initStorage: xt,
|
|
1620
1624
|
_support: Et(),
|
|
@@ -1626,7 +1630,7 @@ var at = { exports: {} };
|
|
|
1626
1630
|
length: Mt,
|
|
1627
1631
|
key: Pt,
|
|
1628
1632
|
keys: Nt,
|
|
1629
|
-
dropInstance:
|
|
1633
|
+
dropInstance: Ut
|
|
1630
1634
|
}, $t = function(i, a) {
|
|
1631
1635
|
return i === a || typeof i == "number" && typeof a == "number" && isNaN(i) && isNaN(a);
|
|
1632
1636
|
}, Ft = function(i, a) {
|
|
@@ -1641,7 +1645,7 @@ var at = { exports: {} };
|
|
|
1641
1645
|
}, He = {}, kr = {}, ke = {
|
|
1642
1646
|
INDEXEDDB: lr,
|
|
1643
1647
|
WEBSQL: At,
|
|
1644
|
-
LOCALSTORAGE:
|
|
1648
|
+
LOCALSTORAGE: Bt
|
|
1645
1649
|
}, kt = [ke.INDEXEDDB._driver, ke.WEBSQL._driver, ke.LOCALSTORAGE._driver], Ke = ["dropInstance"], fr = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(Ke), Gt = {
|
|
1646
1650
|
description: "",
|
|
1647
1651
|
driver: kt.slice(),
|
|
@@ -1695,12 +1699,12 @@ var at = { exports: {} };
|
|
|
1695
1699
|
}, n.prototype.defineDriver = function(a, m, v) {
|
|
1696
1700
|
var o = new d(function(C, R) {
|
|
1697
1701
|
try {
|
|
1698
|
-
var
|
|
1702
|
+
var B = a._driver, F = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
1699
1703
|
if (!a._driver) {
|
|
1700
1704
|
R(F);
|
|
1701
1705
|
return;
|
|
1702
1706
|
}
|
|
1703
|
-
for (var k = fr.concat("_initStorage"), q = 0,
|
|
1707
|
+
for (var k = fr.concat("_initStorage"), q = 0, Z = k.length; q < Z; q++) {
|
|
1704
1708
|
var p = k[q], re = !Ft(Ke, p);
|
|
1705
1709
|
if ((re || a[p]) && typeof a[p] != "function") {
|
|
1706
1710
|
R(F);
|
|
@@ -1708,19 +1712,19 @@ var at = { exports: {} };
|
|
|
1708
1712
|
}
|
|
1709
1713
|
}
|
|
1710
1714
|
var ue = function() {
|
|
1711
|
-
for (var
|
|
1715
|
+
for (var ze = function(zt) {
|
|
1712
1716
|
return function() {
|
|
1713
|
-
var
|
|
1717
|
+
var Yt = new Error("Method " + zt + " is not implemented by the current driver"), Gr = d.reject(Yt);
|
|
1714
1718
|
return h(Gr, arguments[arguments.length - 1]), Gr;
|
|
1715
1719
|
};
|
|
1716
1720
|
}, or = 0, Ht = Ke.length; or < Ht; or++) {
|
|
1717
1721
|
var dr = Ke[or];
|
|
1718
|
-
a[dr] || (a[dr] =
|
|
1722
|
+
a[dr] || (a[dr] = ze(dr));
|
|
1719
1723
|
}
|
|
1720
1724
|
};
|
|
1721
1725
|
ue();
|
|
1722
|
-
var le = function(
|
|
1723
|
-
He[
|
|
1726
|
+
var le = function(ze) {
|
|
1727
|
+
He[B] && console.info("Redefining LocalForage driver: " + B), He[B] = a, kr[B] = ze, C();
|
|
1724
1728
|
};
|
|
1725
1729
|
"_support" in a ? a._support && typeof a._support == "function" ? a._support().then(le, R) : le(!!a._support) : le(!0);
|
|
1726
1730
|
} catch (ge) {
|
|
@@ -1748,16 +1752,16 @@ var at = { exports: {} };
|
|
|
1748
1752
|
function R() {
|
|
1749
1753
|
o._config.driver = o.driver();
|
|
1750
1754
|
}
|
|
1751
|
-
function
|
|
1755
|
+
function B(q) {
|
|
1752
1756
|
return o._extend(q), R(), o._ready = o._initStorage(o._config), o._ready;
|
|
1753
1757
|
}
|
|
1754
1758
|
function F(q) {
|
|
1755
1759
|
return function() {
|
|
1756
|
-
var
|
|
1760
|
+
var Z = 0;
|
|
1757
1761
|
function p() {
|
|
1758
|
-
for (;
|
|
1759
|
-
var re = q[
|
|
1760
|
-
return
|
|
1762
|
+
for (; Z < q.length; ) {
|
|
1763
|
+
var re = q[Z];
|
|
1764
|
+
return Z++, o._dbInfo = null, o._ready = null, o.getDriver(re).then(B).catch(p);
|
|
1761
1765
|
}
|
|
1762
1766
|
R();
|
|
1763
1767
|
var ue = new Error("No available storage method found.");
|
|
@@ -1771,8 +1775,8 @@ var at = { exports: {} };
|
|
|
1771
1775
|
}) : d.resolve();
|
|
1772
1776
|
return this._driverSet = k.then(function() {
|
|
1773
1777
|
var q = C[0];
|
|
1774
|
-
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(
|
|
1775
|
-
o._driver =
|
|
1778
|
+
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(Z) {
|
|
1779
|
+
o._driver = Z._driver, R(), o._wrapLibraryMethodsWithReady(), o._initDriver = F(C);
|
|
1776
1780
|
});
|
|
1777
1781
|
}).catch(function() {
|
|
1778
1782
|
R();
|
|
@@ -1796,7 +1800,7 @@ var at = { exports: {} };
|
|
|
1796
1800
|
return new n(a);
|
|
1797
1801
|
}, n;
|
|
1798
1802
|
}(), Vt = new qt();
|
|
1799
|
-
|
|
1803
|
+
S.exports = Vt;
|
|
1800
1804
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
1801
1805
|
});
|
|
1802
1806
|
})(at);
|
|
@@ -1846,14 +1850,14 @@ function va() {
|
|
|
1846
1850
|
async function l(s) {
|
|
1847
1851
|
return await me().removeItem(s);
|
|
1848
1852
|
}
|
|
1849
|
-
async function
|
|
1853
|
+
async function S(s, g) {
|
|
1850
1854
|
await me().setItem(g, s);
|
|
1851
1855
|
}
|
|
1852
1856
|
return {
|
|
1853
1857
|
clearAsync: e,
|
|
1854
1858
|
getAsync: t,
|
|
1855
1859
|
removeAsync: l,
|
|
1856
|
-
saveAsync:
|
|
1860
|
+
saveAsync: S
|
|
1857
1861
|
};
|
|
1858
1862
|
}
|
|
1859
1863
|
let er;
|
|
@@ -1870,8 +1874,8 @@ function bn(e) {
|
|
|
1870
1874
|
}), er;
|
|
1871
1875
|
}
|
|
1872
1876
|
function Sn(e) {
|
|
1873
|
-
var t, l,
|
|
1874
|
-
if (e.storeMode ?? (e.storeMode = ((l = (t = e.navigation) == null ? void 0 : t.findItem(e.nav)) == null ? void 0 : l.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((s = (
|
|
1877
|
+
var t, l, S, s, g;
|
|
1878
|
+
if (e.storeMode ?? (e.storeMode = ((l = (t = e.navigation) == null ? void 0 : t.findItem(e.nav)) == null ? void 0 : l.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((s = (S = e.navigation) == null ? void 0 : S.findItem(e.nav)) == null ? void 0 : s.storageMode) ?? "local-cache"), e.storeName ?? (e.storeName = ((g = e.navigation) == null ? void 0 : g.findStoreName(e.nav)) ?? e.nav), e.storeName == null)
|
|
1875
1879
|
throw new Error("no store name provided");
|
|
1876
1880
|
if (e.storeMode == "whole-last-updated") {
|
|
1877
1881
|
if (e.api == null)
|
|
@@ -1886,10 +1890,10 @@ function Sn(e) {
|
|
|
1886
1890
|
}
|
|
1887
1891
|
const An = (e) => {
|
|
1888
1892
|
let t = K(e.url) ?? void 0;
|
|
1889
|
-
if (e.additionalUrl != null && (t == null ? t = e.additionalUrl : t =
|
|
1893
|
+
if (e.additionalUrl != null && (t == null ? t = e.additionalUrl : t = Be(t, e.additionalUrl)), e.id != null && (t != null && t.includes("{id}") ? t = t.replaceAll("{id}", e.id) : t = Be(t, e.id)), e.params != null) {
|
|
1890
1894
|
t ?? (t = "");
|
|
1891
1895
|
let l = new URLSearchParams();
|
|
1892
|
-
Object.entries(e.params).sort(
|
|
1896
|
+
Object.entries(e.params).sort(Ue.firstBy((s) => s[0])).forEach((s) => {
|
|
1893
1897
|
s[1] != null && l.append(s[0], s[1].toString());
|
|
1894
1898
|
}), t = `${t}?${l.toString()}`;
|
|
1895
1899
|
}
|
|
@@ -1898,12 +1902,12 @@ const An = (e) => {
|
|
|
1898
1902
|
function En(e) {
|
|
1899
1903
|
return et(e.storeName, () => {
|
|
1900
1904
|
var u;
|
|
1901
|
-
const t = de.utc().toSeconds() / 86400, l =
|
|
1905
|
+
const t = de.utc().toSeconds() / 86400, l = z({}), S = z({}), s = e.storageMode == "local-cache", g = e.buildUrl ?? ((u = e.api) == null ? void 0 : u.buildUrl) ?? An;
|
|
1902
1906
|
function x(r) {
|
|
1903
|
-
var c,
|
|
1907
|
+
var c, E;
|
|
1904
1908
|
let y = "";
|
|
1905
1909
|
const I = r.params ?? {};
|
|
1906
|
-
return I != null && (y = Object.entries(I).sort(
|
|
1910
|
+
return I != null && (y = Object.entries(I).sort(Ue.firstBy((w) => w[0])).map((w) => `${w[0]}=${JSON.stringify(w[1])}`).join("&")), `${e.storeName ?? "base"}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}_${r.id ?? ((E = r.data) == null ? void 0 : E.id) ?? "no-item-id"}_${y ?? "no-params"}`;
|
|
1907
1911
|
}
|
|
1908
1912
|
async function P(r) {
|
|
1909
1913
|
r.additionalUrl ?? (r.additionalUrl = "/getAll"), g(r);
|
|
@@ -1918,32 +1922,31 @@ function En(e) {
|
|
|
1918
1922
|
if (e.api == null)
|
|
1919
1923
|
return l.value[y];
|
|
1920
1924
|
try {
|
|
1921
|
-
let c =
|
|
1922
|
-
c == null && (c = new Promise(async (
|
|
1923
|
-
var
|
|
1925
|
+
let c = S.value[y];
|
|
1926
|
+
c == null && (c = new Promise(async (w, M) => {
|
|
1927
|
+
var b;
|
|
1924
1928
|
try {
|
|
1925
|
-
const _ = await ((
|
|
1929
|
+
const _ = await ((b = e.api) == null ? void 0 : b.getAll(r)), D = {
|
|
1926
1930
|
meta: { storedOn: t.toString() },
|
|
1927
1931
|
data: _ == null ? void 0 : _.data,
|
|
1928
1932
|
count: _ == null ? void 0 : _.count,
|
|
1929
1933
|
filters: (_ == null ? void 0 : _.filters) ?? []
|
|
1930
1934
|
};
|
|
1931
|
-
s == !0 && await me().setItem(y, D),
|
|
1935
|
+
s == !0 && await me().setItem(y, D), w(D);
|
|
1932
1936
|
} catch (_) {
|
|
1933
|
-
|
|
1937
|
+
M(_);
|
|
1934
1938
|
} finally {
|
|
1935
|
-
delete
|
|
1939
|
+
delete S.value[y];
|
|
1936
1940
|
}
|
|
1937
|
-
}),
|
|
1938
|
-
const
|
|
1939
|
-
return l.value[y] =
|
|
1940
|
-
data:
|
|
1941
|
-
filters:
|
|
1942
|
-
count:
|
|
1941
|
+
}), S.value[y] = c);
|
|
1942
|
+
const E = await c;
|
|
1943
|
+
return l.value[y] = E, {
|
|
1944
|
+
data: E == null ? void 0 : E.data,
|
|
1945
|
+
filters: E == null ? void 0 : E.filters,
|
|
1946
|
+
count: E == null ? void 0 : E.count
|
|
1943
1947
|
};
|
|
1944
1948
|
} catch (c) {
|
|
1945
|
-
|
|
1946
|
-
throw new Error(S.message ?? "Problem");
|
|
1949
|
+
throw c;
|
|
1947
1950
|
}
|
|
1948
1951
|
}
|
|
1949
1952
|
async function T(r) {
|
|
@@ -1959,27 +1962,26 @@ function En(e) {
|
|
|
1959
1962
|
if (e.api == null)
|
|
1960
1963
|
return l.value[y];
|
|
1961
1964
|
try {
|
|
1962
|
-
let c =
|
|
1963
|
-
c == null && (c = new Promise(async (
|
|
1964
|
-
var
|
|
1965
|
+
let c = S.value[y];
|
|
1966
|
+
c == null && (c = new Promise(async (w, M) => {
|
|
1967
|
+
var b;
|
|
1965
1968
|
try {
|
|
1966
|
-
let _ = await ((
|
|
1969
|
+
let _ = await ((b = e.api) == null ? void 0 : b.get(r));
|
|
1967
1970
|
const D = {
|
|
1968
1971
|
meta: { storedOn: t.toString() },
|
|
1969
1972
|
data: _ == null ? void 0 : _.data
|
|
1970
1973
|
};
|
|
1971
|
-
s == !0 && await me().setItem(y, D),
|
|
1974
|
+
s == !0 && await me().setItem(y, D), w(D);
|
|
1972
1975
|
} catch (_) {
|
|
1973
|
-
|
|
1976
|
+
M(_);
|
|
1974
1977
|
} finally {
|
|
1975
|
-
delete
|
|
1978
|
+
delete S.value[y];
|
|
1976
1979
|
}
|
|
1977
|
-
}),
|
|
1978
|
-
const
|
|
1979
|
-
return l.value[y] =
|
|
1980
|
+
}), S.value[y] = c);
|
|
1981
|
+
const E = await c;
|
|
1982
|
+
return l.value[y] = E, { data: E.data };
|
|
1980
1983
|
} catch (c) {
|
|
1981
|
-
|
|
1982
|
-
throw new Error(S.message ?? "Problem");
|
|
1984
|
+
throw c;
|
|
1983
1985
|
}
|
|
1984
1986
|
}
|
|
1985
1987
|
async function N(r) {
|
|
@@ -1989,28 +1991,27 @@ function En(e) {
|
|
|
1989
1991
|
let I;
|
|
1990
1992
|
if (e.api != null)
|
|
1991
1993
|
try {
|
|
1992
|
-
let
|
|
1993
|
-
I =
|
|
1994
|
-
} catch (
|
|
1995
|
-
|
|
1996
|
-
throw new Error(E.message ?? "Patch Problem");
|
|
1994
|
+
let E = await e.api.patch(r);
|
|
1995
|
+
I = E == null ? void 0 : E.data;
|
|
1996
|
+
} catch (E) {
|
|
1997
|
+
throw E;
|
|
1997
1998
|
}
|
|
1998
1999
|
else
|
|
1999
2000
|
I = r.data;
|
|
2000
2001
|
if (I != null) {
|
|
2001
|
-
let
|
|
2002
|
+
let E = {
|
|
2002
2003
|
meta: { storedOn: t.toString() },
|
|
2003
2004
|
data: { ...(c = l.value[y]) == null ? void 0 : c.data, ...I }
|
|
2004
2005
|
};
|
|
2005
|
-
return l.value[y] =
|
|
2006
|
-
const
|
|
2007
|
-
if (
|
|
2008
|
-
if (Array.isArray(
|
|
2009
|
-
for (let _ = 0; _ <
|
|
2010
|
-
|
|
2006
|
+
return l.value[y] = E, s == !0 && await me().setItem(y, E), I.id != null && I.rowVersion != null && Object.entries(l.value).forEach((M) => {
|
|
2007
|
+
const b = M[1].data;
|
|
2008
|
+
if (b != null)
|
|
2009
|
+
if (Array.isArray(b))
|
|
2010
|
+
for (let _ = 0; _ < b.length; _++)
|
|
2011
|
+
b[_].id == I.id && b.splice(_, 1, E.data);
|
|
2011
2012
|
else
|
|
2012
|
-
|
|
2013
|
-
}),
|
|
2013
|
+
b.id == I.id && (l.value[M[0]] = E);
|
|
2014
|
+
}), E.data;
|
|
2014
2015
|
}
|
|
2015
2016
|
return I;
|
|
2016
2017
|
}
|
|
@@ -2023,8 +2024,7 @@ function En(e) {
|
|
|
2023
2024
|
let c = await e.api.post(r);
|
|
2024
2025
|
I = c == null ? void 0 : c.data;
|
|
2025
2026
|
} catch (c) {
|
|
2026
|
-
|
|
2027
|
-
throw new Error(S.message ?? "Patch Problem");
|
|
2027
|
+
throw c;
|
|
2028
2028
|
}
|
|
2029
2029
|
else
|
|
2030
2030
|
I = r.data;
|
|
@@ -2043,23 +2043,22 @@ function En(e) {
|
|
|
2043
2043
|
const y = x(r);
|
|
2044
2044
|
if (e.api != null)
|
|
2045
2045
|
try {
|
|
2046
|
-
let
|
|
2047
|
-
if (
|
|
2048
|
-
return
|
|
2049
|
-
} catch (
|
|
2050
|
-
|
|
2051
|
-
throw new Error(E.message ?? "Patch Problem");
|
|
2046
|
+
let E = await e.api.deleteItem(r);
|
|
2047
|
+
if (E != null)
|
|
2048
|
+
return E;
|
|
2049
|
+
} catch (E) {
|
|
2050
|
+
throw E;
|
|
2052
2051
|
}
|
|
2053
2052
|
delete l.value[y];
|
|
2054
2053
|
const I = ((c = r.data) == null ? void 0 : c.id) ?? r.id;
|
|
2055
|
-
I != null && Object.entries(l.value).forEach((
|
|
2056
|
-
const
|
|
2057
|
-
if (
|
|
2058
|
-
if (Array.isArray(
|
|
2059
|
-
for (let
|
|
2060
|
-
|
|
2054
|
+
I != null && Object.entries(l.value).forEach((w) => {
|
|
2055
|
+
const M = w[1].data;
|
|
2056
|
+
if (M != null)
|
|
2057
|
+
if (Array.isArray(M))
|
|
2058
|
+
for (let b = 0; b < M.length; b++)
|
|
2059
|
+
M[b].id == I && M.splice(b, 1);
|
|
2061
2060
|
else
|
|
2062
|
-
delete l.value[
|
|
2061
|
+
delete l.value[w[0]];
|
|
2063
2062
|
}), s == !0 && await me().removeItem(y);
|
|
2064
2063
|
}
|
|
2065
2064
|
async function h(r) {
|
|
@@ -2068,8 +2067,7 @@ function En(e) {
|
|
|
2068
2067
|
let y = await e.api.patch(r);
|
|
2069
2068
|
return y == null ? void 0 : y.data;
|
|
2070
2069
|
} catch (y) {
|
|
2071
|
-
|
|
2072
|
-
throw new Error(I.message ?? "Patch Problem");
|
|
2070
|
+
throw y;
|
|
2073
2071
|
}
|
|
2074
2072
|
}
|
|
2075
2073
|
return {
|
|
@@ -2086,7 +2084,7 @@ function En(e) {
|
|
|
2086
2084
|
}
|
|
2087
2085
|
function Vr(e) {
|
|
2088
2086
|
return et(e.storeName, () => {
|
|
2089
|
-
const t =
|
|
2087
|
+
const t = z(), l = z(0), S = de.utc().toSeconds() / 3600, s = z(), g = z(), x = z({}), P = e.storageMode == "local-cache";
|
|
2090
2088
|
function T() {
|
|
2091
2089
|
var c;
|
|
2092
2090
|
return `${e.storeName}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}`;
|
|
@@ -2100,46 +2098,46 @@ function Vr(e) {
|
|
|
2100
2098
|
});
|
|
2101
2099
|
}
|
|
2102
2100
|
function $(c) {
|
|
2103
|
-
const
|
|
2104
|
-
return x.value[
|
|
2105
|
-
var
|
|
2101
|
+
const E = T();
|
|
2102
|
+
return x.value[E] || (x.value[E] = new Promise(async (w, M) => {
|
|
2103
|
+
var b, _;
|
|
2106
2104
|
try {
|
|
2107
2105
|
let D = await ((_ = e.api) == null ? void 0 : _.getAll({
|
|
2108
2106
|
additionalUrl: "/getAll",
|
|
2109
2107
|
nav: c.nav,
|
|
2110
2108
|
params: {
|
|
2111
|
-
lastUpdate: ((
|
|
2109
|
+
lastUpdate: ((b = g.value) == null ? void 0 : b.lastUpdate) ?? un()
|
|
2112
2110
|
}
|
|
2113
2111
|
}));
|
|
2114
|
-
D == null ?
|
|
2112
|
+
D == null ? M(D) : (t.value ?? (t.value = []), D.data.forEach((L) => {
|
|
2115
2113
|
var A, J;
|
|
2116
|
-
const f = t.value.findIndex((Q) => Q.id ==
|
|
2117
|
-
f >= 0 ? (A = t.value) == null || A.splice(f, 1,
|
|
2114
|
+
const f = t.value.findIndex((Q) => Q.id == L.id);
|
|
2115
|
+
f >= 0 ? (A = t.value) == null || A.splice(f, 1, L) : (J = t.value) == null || J.push(L);
|
|
2118
2116
|
}), l.value = t.value.length, g.value = {
|
|
2119
2117
|
lastUpdate: de.utc().toString(),
|
|
2120
|
-
storedOn:
|
|
2121
|
-
}, await N(),
|
|
2118
|
+
storedOn: S.toString()
|
|
2119
|
+
}, await N(), w(D));
|
|
2122
2120
|
} catch (D) {
|
|
2123
|
-
|
|
2121
|
+
M(D);
|
|
2124
2122
|
} finally {
|
|
2125
|
-
delete x.value[
|
|
2123
|
+
delete x.value[E];
|
|
2126
2124
|
}
|
|
2127
|
-
})), x.value[
|
|
2125
|
+
})), x.value[E];
|
|
2128
2126
|
}
|
|
2129
2127
|
async function d(c) {
|
|
2130
|
-
var
|
|
2131
|
-
const
|
|
2132
|
-
if (!
|
|
2128
|
+
var M, b, _;
|
|
2129
|
+
const E = T(), w = c.refresh;
|
|
2130
|
+
if (!w && t.value != null)
|
|
2133
2131
|
return {
|
|
2134
|
-
count: (
|
|
2132
|
+
count: (M = t.value) == null ? void 0 : M.length,
|
|
2135
2133
|
data: t.value,
|
|
2136
2134
|
filters: []
|
|
2137
2135
|
};
|
|
2138
|
-
if (!
|
|
2139
|
-
const D = await me().getItem(
|
|
2140
|
-
if (D != null && parseFloat(D.meta.storedOn) >
|
|
2136
|
+
if (!w && P == !0) {
|
|
2137
|
+
const D = await me().getItem(E);
|
|
2138
|
+
if (D != null && parseFloat(D.meta.storedOn) > S - 7)
|
|
2141
2139
|
return t.value = D.data, l.value = D.data.length, s.value = D.filters ?? [], g.value = D.meta, {
|
|
2142
|
-
count: (
|
|
2140
|
+
count: (b = t.value) == null ? void 0 : b.length,
|
|
2143
2141
|
data: t.value ?? [],
|
|
2144
2142
|
filters: []
|
|
2145
2143
|
};
|
|
@@ -2154,24 +2152,24 @@ function Vr(e) {
|
|
|
2154
2152
|
try {
|
|
2155
2153
|
return await $(c);
|
|
2156
2154
|
} catch (D) {
|
|
2157
|
-
let
|
|
2158
|
-
throw new Error(
|
|
2155
|
+
let L = D;
|
|
2156
|
+
throw new Error(L.message ?? "Problem");
|
|
2159
2157
|
}
|
|
2160
2158
|
}
|
|
2161
2159
|
async function h(c) {
|
|
2162
|
-
var
|
|
2163
|
-
const
|
|
2164
|
-
if (
|
|
2160
|
+
var b, _, D, L;
|
|
2161
|
+
const E = T(), w = c.id ?? ((b = c.data) == null ? void 0 : b.id);
|
|
2162
|
+
if (w == null)
|
|
2165
2163
|
throw new Error("no id provided");
|
|
2166
|
-
let
|
|
2167
|
-
if (!
|
|
2168
|
-
const f = t.value.find((A) => A.id ==
|
|
2164
|
+
let M = c.refresh;
|
|
2165
|
+
if (!M && t.value != null) {
|
|
2166
|
+
const f = t.value.find((A) => A.id == w);
|
|
2169
2167
|
if (f != null)
|
|
2170
2168
|
return { data: f };
|
|
2171
2169
|
}
|
|
2172
|
-
if (!
|
|
2173
|
-
const f = await me().getItem(
|
|
2174
|
-
if (f != null && parseFloat(f.meta.storedOn) >
|
|
2170
|
+
if (!M && P == !0) {
|
|
2171
|
+
const f = await me().getItem(E);
|
|
2172
|
+
if (f != null && parseFloat(f.meta.storedOn) > S - 12) {
|
|
2175
2173
|
t.value = f.data, l.value = f.data.length, s.value = f.filters ?? [], g.value = f.meta;
|
|
2176
2174
|
let A = (_ = t.value) == null ? void 0 : _.find((J) => J.id == c.id);
|
|
2177
2175
|
if (A != null)
|
|
@@ -2184,81 +2182,81 @@ function Vr(e) {
|
|
|
2184
2182
|
};
|
|
2185
2183
|
t.value ?? (t.value = []);
|
|
2186
2184
|
try {
|
|
2187
|
-
return await $(c), { data: (
|
|
2185
|
+
return await $(c), { data: (L = t.value) == null ? void 0 : L.find((f) => f.id == c.id) };
|
|
2188
2186
|
} catch (f) {
|
|
2189
2187
|
let A = f;
|
|
2190
2188
|
throw new Error(A.message ?? "Problem");
|
|
2191
2189
|
}
|
|
2192
2190
|
}
|
|
2193
2191
|
async function u(c) {
|
|
2194
|
-
var
|
|
2192
|
+
var w, M, b;
|
|
2195
2193
|
c.additionalUrl ?? (c.additionalUrl = "/patch");
|
|
2196
|
-
let
|
|
2194
|
+
let E;
|
|
2197
2195
|
if (e.api != null)
|
|
2198
2196
|
try {
|
|
2199
2197
|
let _ = await e.api.patch(c);
|
|
2200
|
-
|
|
2198
|
+
E = { ...c.data, ..._ == null ? void 0 : _.data };
|
|
2201
2199
|
} catch (_) {
|
|
2202
2200
|
let D = _;
|
|
2203
2201
|
throw new Error(D.message ?? "Patch Problem");
|
|
2204
2202
|
}
|
|
2205
2203
|
else
|
|
2206
|
-
|
|
2207
|
-
if (
|
|
2208
|
-
let _ = (
|
|
2209
|
-
_ != null && _ >= 0 && (t.value ?? (t.value = []), (
|
|
2204
|
+
E = c.data;
|
|
2205
|
+
if (E != null) {
|
|
2206
|
+
let _ = (w = t.value) == null ? void 0 : w.findIndex((D) => D.id == E.id);
|
|
2207
|
+
_ != null && _ >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(_, 1, E), await N());
|
|
2210
2208
|
}
|
|
2211
|
-
return (
|
|
2209
|
+
return (b = t.value) == null ? void 0 : b.find((_) => _.id == (c.id ?? c.data.id));
|
|
2212
2210
|
}
|
|
2213
2211
|
async function r(c) {
|
|
2214
|
-
var
|
|
2212
|
+
var w, M;
|
|
2215
2213
|
c.additionalUrl ?? (c.additionalUrl = "/post");
|
|
2216
|
-
let
|
|
2214
|
+
let E;
|
|
2217
2215
|
if (e.api != null)
|
|
2218
2216
|
try {
|
|
2219
|
-
let
|
|
2220
|
-
|
|
2221
|
-
} catch (
|
|
2222
|
-
let _ =
|
|
2217
|
+
let b = await e.api.post(c);
|
|
2218
|
+
E = b == null ? void 0 : b.data;
|
|
2219
|
+
} catch (b) {
|
|
2220
|
+
let _ = b;
|
|
2223
2221
|
throw new Error(_.message ?? "Patch Problem");
|
|
2224
2222
|
}
|
|
2225
2223
|
else
|
|
2226
|
-
|
|
2227
|
-
return
|
|
2224
|
+
E = c.data;
|
|
2225
|
+
return E != null && (t.value ?? (t.value = []), (w = t.value) == null || w.unshift(E), l.value += 1, await N()), (M = t.value) == null ? void 0 : M.find((b) => b.id == (c.id ?? c.data.id));
|
|
2228
2226
|
}
|
|
2229
2227
|
async function y(c) {
|
|
2230
|
-
var
|
|
2228
|
+
var w, M;
|
|
2231
2229
|
if (c.additionalUrl ?? (c.additionalUrl = "/delete"), e.api != null)
|
|
2232
2230
|
try {
|
|
2233
|
-
let
|
|
2234
|
-
if (
|
|
2235
|
-
return
|
|
2236
|
-
} catch (
|
|
2237
|
-
let _ =
|
|
2231
|
+
let b = await e.api.deleteItem(c);
|
|
2232
|
+
if (b != null)
|
|
2233
|
+
return b;
|
|
2234
|
+
} catch (b) {
|
|
2235
|
+
let _ = b;
|
|
2238
2236
|
throw new Error(_.message ?? "Patch Problem");
|
|
2239
2237
|
}
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2242
|
-
let
|
|
2243
|
-
|
|
2238
|
+
const E = c.id ?? c.data.id;
|
|
2239
|
+
if (E != null) {
|
|
2240
|
+
let b = (w = t.value) == null ? void 0 : w.findIndex((_) => _.id == E);
|
|
2241
|
+
b != null && b >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(b, 1), await N());
|
|
2244
2242
|
}
|
|
2245
2243
|
}
|
|
2246
2244
|
async function I(c) {
|
|
2247
|
-
var
|
|
2245
|
+
var E;
|
|
2248
2246
|
if (c.additionalUrl ?? (c.additionalUrl = `/patch/restore?id=${c.data.id}`), e.api != null)
|
|
2249
2247
|
try {
|
|
2250
2248
|
await e.api.patch(c);
|
|
2251
|
-
} catch (
|
|
2252
|
-
let
|
|
2253
|
-
throw new Error(
|
|
2249
|
+
} catch (w) {
|
|
2250
|
+
let M = w;
|
|
2251
|
+
throw new Error(M.message ?? "Patch Problem");
|
|
2254
2252
|
}
|
|
2255
2253
|
try {
|
|
2256
2254
|
c.additionalUrl = "/getAll", await $(c);
|
|
2257
|
-
} catch (
|
|
2258
|
-
let
|
|
2259
|
-
throw new Error(
|
|
2255
|
+
} catch (w) {
|
|
2256
|
+
let M = w;
|
|
2257
|
+
throw new Error(M.message ?? "Problem");
|
|
2260
2258
|
}
|
|
2261
|
-
return (
|
|
2259
|
+
return (E = t.value) == null ? void 0 : E.find((w) => w.id == (c.id ?? c.data.id));
|
|
2262
2260
|
}
|
|
2263
2261
|
return {
|
|
2264
2262
|
deleteItem: y,
|
|
@@ -2275,7 +2273,7 @@ function Er() {
|
|
|
2275
2273
|
return Ar;
|
|
2276
2274
|
}
|
|
2277
2275
|
function In(e) {
|
|
2278
|
-
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g,
|
|
2276
|
+
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g, S = (e == null ? void 0 : e.buildUrl) ?? x, s = e == null ? void 0 : e.demo;
|
|
2279
2277
|
function g(u) {
|
|
2280
2278
|
let r = new URLSearchParams();
|
|
2281
2279
|
return Object.entries(u).forEach((y) => {
|
|
@@ -2286,7 +2284,7 @@ function In(e) {
|
|
|
2286
2284
|
}
|
|
2287
2285
|
function x(u) {
|
|
2288
2286
|
let r = K(u.url) ?? void 0, y = K(u.id);
|
|
2289
|
-
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r =
|
|
2287
|
+
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Be(r, u.additionalUrl)), y != null && (r != null && r.includes("{id}") ? r = r.replaceAll("{id}", y) : r = Be(r, y)), u.params != null && (r = `${r}?${l(u.params)}`), u.finalUrl = r, u.finalUrl ?? "";
|
|
2290
2288
|
}
|
|
2291
2289
|
function P(u) {
|
|
2292
2290
|
var y, I;
|
|
@@ -2295,148 +2293,178 @@ function In(e) {
|
|
|
2295
2293
|
}
|
|
2296
2294
|
async function T(u) {
|
|
2297
2295
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2298
|
-
let c = u.finalUrl,
|
|
2299
|
-
if (c == null && (c =
|
|
2296
|
+
let c = u.finalUrl, E = u.headers;
|
|
2297
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2300
2298
|
return console.log(`DEMO: Get from ${c}`), s.get(u);
|
|
2301
2299
|
console.log(`Get from ${c}`);
|
|
2302
|
-
let
|
|
2300
|
+
let w;
|
|
2303
2301
|
try {
|
|
2304
|
-
if (
|
|
2302
|
+
if (w = await fetch(c, {
|
|
2305
2303
|
method: "GET",
|
|
2306
2304
|
mode: "cors",
|
|
2307
2305
|
cache: "no-cache",
|
|
2308
|
-
headers:
|
|
2309
|
-
}), !
|
|
2310
|
-
|
|
2311
|
-
|
|
2306
|
+
headers: E
|
|
2307
|
+
}), !w.ok) {
|
|
2308
|
+
if (w.status == 401)
|
|
2309
|
+
throw {
|
|
2310
|
+
code: w.status,
|
|
2311
|
+
name: "Unauthorized",
|
|
2312
|
+
message: w.statusText
|
|
2313
|
+
};
|
|
2314
|
+
let M = await w.text();
|
|
2315
|
+
throw new Error(M ?? w.statusText ?? "Get error");
|
|
2312
2316
|
}
|
|
2313
2317
|
if (I)
|
|
2314
|
-
return await
|
|
2318
|
+
return await w.text();
|
|
2315
2319
|
if (y)
|
|
2316
|
-
return await
|
|
2320
|
+
return await w.json();
|
|
2317
2321
|
throw new Error();
|
|
2318
|
-
} catch (
|
|
2319
|
-
const
|
|
2322
|
+
} catch (M) {
|
|
2323
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2320
2324
|
if (!r)
|
|
2321
2325
|
return;
|
|
2322
|
-
throw new Error(
|
|
2326
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2323
2327
|
}
|
|
2324
2328
|
}
|
|
2325
2329
|
async function N(u) {
|
|
2326
2330
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2327
|
-
let c = u.finalUrl,
|
|
2328
|
-
if (c == null && (c =
|
|
2331
|
+
let c = u.finalUrl, E = u.headers;
|
|
2332
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2329
2333
|
return console.log(`DEMO: Get all from ${c}`), s.getAll(u);
|
|
2330
2334
|
console.log(`Get all from ${c}`);
|
|
2331
|
-
let
|
|
2335
|
+
let w;
|
|
2332
2336
|
try {
|
|
2333
|
-
if (
|
|
2337
|
+
if (w = await fetch(c, {
|
|
2334
2338
|
method: "GET",
|
|
2335
2339
|
mode: "cors",
|
|
2336
2340
|
cache: "no-cache",
|
|
2337
|
-
headers:
|
|
2338
|
-
}), !
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
+
headers: E
|
|
2342
|
+
}), !w.ok) {
|
|
2343
|
+
if (w.status == 401)
|
|
2344
|
+
throw {
|
|
2345
|
+
code: w.status,
|
|
2346
|
+
name: "Unauthorized",
|
|
2347
|
+
message: w.statusText
|
|
2348
|
+
};
|
|
2349
|
+
let M = await w.text();
|
|
2350
|
+
throw new Error(M ?? w.statusText ?? "Get all error");
|
|
2341
2351
|
}
|
|
2342
2352
|
if (I)
|
|
2343
|
-
return await
|
|
2353
|
+
return await w.text();
|
|
2344
2354
|
if (y)
|
|
2345
|
-
return await
|
|
2355
|
+
return await w.json();
|
|
2346
2356
|
throw new Error();
|
|
2347
|
-
} catch (
|
|
2348
|
-
const
|
|
2357
|
+
} catch (M) {
|
|
2358
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2349
2359
|
if (!r)
|
|
2350
2360
|
return;
|
|
2351
|
-
throw new Error(
|
|
2361
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2352
2362
|
}
|
|
2353
2363
|
}
|
|
2354
2364
|
async function $(u) {
|
|
2355
2365
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2356
|
-
let c = u.finalUrl,
|
|
2357
|
-
if (c == null && (c =
|
|
2366
|
+
let c = u.finalUrl, E = u.headers;
|
|
2367
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2358
2368
|
return console.log(`DEMO: Post to ${c}`), s.post(u);
|
|
2359
2369
|
console.log(`Post to ${c}`);
|
|
2360
|
-
let
|
|
2370
|
+
let w;
|
|
2361
2371
|
try {
|
|
2362
|
-
if (
|
|
2372
|
+
if (w = await fetch(c, {
|
|
2363
2373
|
method: "POST",
|
|
2364
2374
|
mode: "cors",
|
|
2365
2375
|
cache: "no-cache",
|
|
2366
|
-
headers:
|
|
2376
|
+
headers: E,
|
|
2367
2377
|
body: JSON.stringify(u.data)
|
|
2368
|
-
}), !
|
|
2369
|
-
|
|
2370
|
-
|
|
2378
|
+
}), !w.ok) {
|
|
2379
|
+
if (w.status == 401)
|
|
2380
|
+
throw {
|
|
2381
|
+
code: w.status,
|
|
2382
|
+
name: "Unauthorized",
|
|
2383
|
+
message: w.statusText
|
|
2384
|
+
};
|
|
2385
|
+
let M = await w.text();
|
|
2386
|
+
throw new Error(M ?? w.statusText ?? "Post error!");
|
|
2371
2387
|
}
|
|
2372
2388
|
if (I)
|
|
2373
|
-
return await
|
|
2389
|
+
return await w.text();
|
|
2374
2390
|
if (y)
|
|
2375
|
-
return await
|
|
2391
|
+
return await w.json();
|
|
2376
2392
|
throw new Error();
|
|
2377
|
-
} catch (
|
|
2378
|
-
if (
|
|
2393
|
+
} catch (M) {
|
|
2394
|
+
if (w.status == 200 || !r)
|
|
2379
2395
|
return;
|
|
2380
|
-
const
|
|
2381
|
-
throw new Error(
|
|
2396
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2397
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2382
2398
|
}
|
|
2383
2399
|
}
|
|
2384
2400
|
async function d(u) {
|
|
2385
2401
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2386
|
-
let c = u.finalUrl,
|
|
2387
|
-
if (c == null && (c =
|
|
2402
|
+
let c = u.finalUrl, E = u.headers;
|
|
2403
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2388
2404
|
return console.log(`DEMO: Patch to ${c}`), s.patch(u);
|
|
2389
2405
|
console.log(`Patch to ${c}`);
|
|
2390
|
-
let
|
|
2406
|
+
let w;
|
|
2391
2407
|
try {
|
|
2392
|
-
if (
|
|
2408
|
+
if (w = await fetch(c, {
|
|
2393
2409
|
method: "PATCH",
|
|
2394
2410
|
mode: "cors",
|
|
2395
2411
|
cache: "no-cache",
|
|
2396
|
-
headers:
|
|
2412
|
+
headers: E,
|
|
2397
2413
|
body: JSON.stringify(u.data)
|
|
2398
|
-
}), !
|
|
2399
|
-
|
|
2400
|
-
|
|
2414
|
+
}), !w.ok) {
|
|
2415
|
+
if (w.status == 401)
|
|
2416
|
+
throw {
|
|
2417
|
+
code: w.status,
|
|
2418
|
+
name: "Unauthorized",
|
|
2419
|
+
message: w.statusText
|
|
2420
|
+
};
|
|
2421
|
+
let M = await w.text();
|
|
2422
|
+
throw new Error(M ?? w.statusText ?? "Patch error!");
|
|
2401
2423
|
}
|
|
2402
2424
|
if (I)
|
|
2403
|
-
return await
|
|
2425
|
+
return await w.text();
|
|
2404
2426
|
if (y)
|
|
2405
|
-
return await
|
|
2427
|
+
return await w.json();
|
|
2406
2428
|
throw new Error();
|
|
2407
|
-
} catch (
|
|
2408
|
-
if (
|
|
2429
|
+
} catch (M) {
|
|
2430
|
+
if (w.status == 200 || !r)
|
|
2409
2431
|
return;
|
|
2410
|
-
const
|
|
2411
|
-
throw new Error(
|
|
2432
|
+
const b = `${(w == null ? void 0 : w.status) ?? ""} ${(w == null ? void 0 : w.statusText) ?? ""} ${M.message}`;
|
|
2433
|
+
throw M.code == 401 ? M : new Error(b);
|
|
2412
2434
|
}
|
|
2413
2435
|
}
|
|
2414
2436
|
async function h(u) {
|
|
2415
2437
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0;
|
|
2416
2438
|
let y = u.finalUrl, I = u.headers;
|
|
2417
|
-
if (y == null && (y =
|
|
2439
|
+
if (y == null && (y = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2418
2440
|
return console.log(`DEMO: Delete ${y}`), s.deleteItem(u);
|
|
2419
2441
|
console.log(`Delete ${y}`);
|
|
2420
2442
|
let c;
|
|
2421
2443
|
try {
|
|
2422
|
-
|
|
2444
|
+
if (c = await fetch(y, {
|
|
2423
2445
|
method: "DELETE",
|
|
2424
2446
|
mode: "cors",
|
|
2425
2447
|
cache: "no-cache",
|
|
2426
2448
|
headers: I,
|
|
2427
2449
|
body: JSON.stringify(u.data)
|
|
2428
|
-
}), c.status ==
|
|
2429
|
-
|
|
2430
|
-
|
|
2450
|
+
}), c.status == 401)
|
|
2451
|
+
throw {
|
|
2452
|
+
code: c.status,
|
|
2453
|
+
name: "Unauthorized",
|
|
2454
|
+
message: c.statusText
|
|
2455
|
+
};
|
|
2456
|
+
return c.status == 200 ? void 0 : c.statusText;
|
|
2457
|
+
} catch (E) {
|
|
2458
|
+
const w = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${E.message}`;
|
|
2431
2459
|
if (!r)
|
|
2432
|
-
return
|
|
2433
|
-
throw new Error(`${c.status} ${c.statusText} ${
|
|
2460
|
+
return w;
|
|
2461
|
+
throw E.code == 401 ? E : new Error(`${c.status} ${c.statusText} ${E.message}`);
|
|
2434
2462
|
}
|
|
2435
2463
|
}
|
|
2436
2464
|
return Ar = {
|
|
2437
2465
|
buildHeaders: t,
|
|
2438
2466
|
buildQuery: l,
|
|
2439
|
-
buildUrl:
|
|
2467
|
+
buildUrl: S,
|
|
2440
2468
|
deleteItem: h,
|
|
2441
2469
|
get: T,
|
|
2442
2470
|
getAll: N,
|
|
@@ -2445,18 +2473,18 @@ function In(e) {
|
|
|
2445
2473
|
}, Ar;
|
|
2446
2474
|
}
|
|
2447
2475
|
function it(e) {
|
|
2448
|
-
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors:
|
|
2476
|
+
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors: S, isLoading: s, doAction: g, logError: x } = rn(e);
|
|
2449
2477
|
function P(r) {
|
|
2450
2478
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to delete this item?" : void 0);
|
|
2451
2479
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2452
2480
|
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2453
2481
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onDeleteAsync ?? (r.onDeleteAsync = () => y().deleteItem(r)) : r.onDeleteAsync ?? (r.onDeleteAsync = () => {
|
|
2454
|
-
var
|
|
2455
|
-
const c = r.id ?? ((
|
|
2482
|
+
var w;
|
|
2483
|
+
const c = r.id ?? ((w = r.data) == null ? void 0 : w.id);
|
|
2456
2484
|
if (c == null)
|
|
2457
2485
|
return Promise.resolve("No id found in delete action");
|
|
2458
|
-
const
|
|
2459
|
-
return
|
|
2486
|
+
const E = I.findIndex((M) => M.id == c);
|
|
2487
|
+
return E >= 0 && I.splice(E, 1), Promise.resolve(void 0);
|
|
2460
2488
|
}), g(async () => {
|
|
2461
2489
|
let c;
|
|
2462
2490
|
r.onCanDeleteAsync != null && (c = await r.onCanDeleteAsync(r.data)), c == null && r.onDeleteAsync != null && (c = await r.onDeleteAsync(r.data)), c == null && r.onDeleteSuccessAsync != null && await r.onDeleteSuccessAsync(r.data), x(c);
|
|
@@ -2474,9 +2502,9 @@ function it(e) {
|
|
|
2474
2502
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2475
2503
|
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2476
2504
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = async () => (await y().get(r)).data) : r.onGetAsync ?? (r.onGetAsync = () => {
|
|
2477
|
-
var
|
|
2478
|
-
const c = r.id ?? ((
|
|
2479
|
-
return c == null ? Promise.resolve(void 0) : Promise.resolve(I.find((
|
|
2505
|
+
var E;
|
|
2506
|
+
const c = r.id ?? ((E = r.data) == null ? void 0 : E.id);
|
|
2507
|
+
return c == null ? Promise.resolve(void 0) : Promise.resolve(I.find((w) => w.id == c));
|
|
2480
2508
|
}), g(async () => {
|
|
2481
2509
|
let c;
|
|
2482
2510
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
@@ -2528,19 +2556,19 @@ function it(e) {
|
|
|
2528
2556
|
var c;
|
|
2529
2557
|
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await y().post(r) : await y().patch(r);
|
|
2530
2558
|
}) : r.onSaveAsync ?? (r.onSaveAsync = (c) => {
|
|
2531
|
-
const
|
|
2532
|
-
return
|
|
2559
|
+
const E = I.findIndex((w) => w.id == c.id);
|
|
2560
|
+
return E >= 0 ? I.splice(E, 1, c) : I.push(c), Promise.resolve(c);
|
|
2533
2561
|
}), g(async () => {
|
|
2534
2562
|
let c;
|
|
2535
2563
|
if (r.onGetSaveAsync != null && (c = await r.onGetSaveAsync(r.data)), c == null)
|
|
2536
2564
|
return;
|
|
2537
2565
|
if (r.onCanSaveAsync != null) {
|
|
2538
|
-
let
|
|
2539
|
-
if (x(
|
|
2566
|
+
let w = await r.onCanSaveAsync(c);
|
|
2567
|
+
if (x(w), w != null)
|
|
2540
2568
|
return;
|
|
2541
2569
|
}
|
|
2542
|
-
let
|
|
2543
|
-
return r.onSaveAsync != null && (
|
|
2570
|
+
let E;
|
|
2571
|
+
return r.onSaveAsync != null && (E = await r.onSaveAsync(c), E = E.data != null ? E.data : E), r.onSaveSuccessAsync != null && (E = await r.onSaveSuccessAsync(E)), E;
|
|
2544
2572
|
}, {
|
|
2545
2573
|
completionMsg: r.completionMsg ?? (e == null ? void 0 : e.completionMsg),
|
|
2546
2574
|
confirmationMsg: r.confirmationMsg ?? (e == null ? void 0 : e.confirmationMsg),
|
|
@@ -2561,7 +2589,7 @@ function it(e) {
|
|
|
2561
2589
|
actionErrorMsg: t,
|
|
2562
2590
|
apiGet: h,
|
|
2563
2591
|
apiPost: u,
|
|
2564
|
-
clearErrors:
|
|
2592
|
+
clearErrors: S,
|
|
2565
2593
|
deleteItem: P,
|
|
2566
2594
|
doAction: g,
|
|
2567
2595
|
getAllItems: N,
|
|
@@ -2579,38 +2607,38 @@ function Dn() {
|
|
|
2579
2607
|
}
|
|
2580
2608
|
function xn(e) {
|
|
2581
2609
|
const t = e.expiryTokenFormat ?? "d/MM/yyyy h:mm:ss a";
|
|
2582
|
-
let l =
|
|
2583
|
-
l.value.length == 0 &&
|
|
2584
|
-
function
|
|
2610
|
+
let l = z(localStorage.getItem(Hr) ?? "");
|
|
2611
|
+
l.value.length == 0 && S();
|
|
2612
|
+
function S() {
|
|
2585
2613
|
l.value = Math.random().toString(36).substring(4, 19) + Math.random().toString(12).substring(1, 11), localStorage.setItem(Hr, l.value);
|
|
2586
2614
|
}
|
|
2587
2615
|
const s = Jt("auth-credentials", {});
|
|
2588
2616
|
function g(D) {
|
|
2589
2617
|
if (D == null)
|
|
2590
2618
|
return !0;
|
|
2591
|
-
var
|
|
2592
|
-
if (
|
|
2619
|
+
var L = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2620
|
+
if (L == null)
|
|
2593
2621
|
return !1;
|
|
2594
|
-
if (
|
|
2622
|
+
if (L.requiresAuth === !1)
|
|
2595
2623
|
return !0;
|
|
2596
2624
|
const f = K(s);
|
|
2597
|
-
if (f.isSuspended &&
|
|
2625
|
+
if (f.isSuspended && L.ignoreSuspension !== !0)
|
|
2598
2626
|
return !1;
|
|
2599
2627
|
if (f.isGlobalAdmin)
|
|
2600
2628
|
return !0;
|
|
2601
|
-
if (
|
|
2602
|
-
for (var A = 0; A <
|
|
2603
|
-
if (!x(
|
|
2629
|
+
if (L.permissions != null) {
|
|
2630
|
+
for (var A = 0; A < L.permissions.length; A++)
|
|
2631
|
+
if (!x(L.permissions[A]))
|
|
2604
2632
|
return !1;
|
|
2605
2633
|
}
|
|
2606
2634
|
return !0;
|
|
2607
2635
|
}
|
|
2608
2636
|
function x(D) {
|
|
2609
|
-
const
|
|
2610
|
-
if (
|
|
2611
|
-
for (var f = 0; f <
|
|
2612
|
-
var A =
|
|
2613
|
-
if (
|
|
2637
|
+
const L = K(s);
|
|
2638
|
+
if (L.userPermissions != null)
|
|
2639
|
+
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2640
|
+
var A = L.userPermissions[f].split(".");
|
|
2641
|
+
if (L.userPermissions[f] == "everything.edit" || D == A[0] && A.length > 1 && A[1] == "edit")
|
|
2614
2642
|
return !0;
|
|
2615
2643
|
}
|
|
2616
2644
|
return !1;
|
|
@@ -2618,53 +2646,53 @@ function xn(e) {
|
|
|
2618
2646
|
function P(D) {
|
|
2619
2647
|
if (D == null)
|
|
2620
2648
|
return !0;
|
|
2621
|
-
var
|
|
2622
|
-
if (
|
|
2649
|
+
var L = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2650
|
+
if (L == null)
|
|
2623
2651
|
return !1;
|
|
2624
|
-
if (
|
|
2652
|
+
if (L.requiresAuth === !1)
|
|
2625
2653
|
return !0;
|
|
2626
2654
|
const f = K(s);
|
|
2627
|
-
if (f.isSuspended &&
|
|
2655
|
+
if (f.isSuspended && L.ignoreSuspension !== !0)
|
|
2628
2656
|
return !1;
|
|
2629
2657
|
if (f.isGlobalAdmin)
|
|
2630
2658
|
return !0;
|
|
2631
|
-
if (
|
|
2632
|
-
for (var A = 0; A <
|
|
2633
|
-
if (!T(
|
|
2659
|
+
if (L.permissions != null) {
|
|
2660
|
+
for (var A = 0; A < L.permissions.length; A++)
|
|
2661
|
+
if (!T(L.permissions[A]))
|
|
2634
2662
|
return !1;
|
|
2635
2663
|
}
|
|
2636
2664
|
return !0;
|
|
2637
2665
|
}
|
|
2638
2666
|
function T(D) {
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2641
|
-
for (var f = 0; f <
|
|
2642
|
-
var A =
|
|
2643
|
-
if (D == A[0] || D == "everything" ||
|
|
2667
|
+
const L = K(s);
|
|
2668
|
+
if (L.userPermissions != null)
|
|
2669
|
+
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2670
|
+
var A = L.userPermissions[f].split(".");
|
|
2671
|
+
if (D == A[0] || D == "everything" || L.userPermissions[f] == "everything.view" || L.userPermissions[f] == "everything.edit")
|
|
2644
2672
|
return !0;
|
|
2645
2673
|
}
|
|
2646
2674
|
return !1;
|
|
2647
2675
|
}
|
|
2648
|
-
function N(D,
|
|
2676
|
+
function N(D, L, f) {
|
|
2649
2677
|
let A = !0;
|
|
2650
|
-
return K(s).isGlobalAdmin ? !0 : (
|
|
2678
|
+
return K(s).isGlobalAdmin ? !0 : (L != null && L.length > 0 && L.forEach((Q) => {
|
|
2651
2679
|
f == "edit" ? x(Q) || (A = !1) : T(Q) || (A = !1);
|
|
2652
2680
|
}), D != null && D.length > 0 && (D.some((Q) => u(Q)) || (A = !1)), A);
|
|
2653
2681
|
}
|
|
2654
|
-
function $(D,
|
|
2682
|
+
function $(D, L = !1) {
|
|
2655
2683
|
var f = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2656
2684
|
let A = !1;
|
|
2657
2685
|
if (f == null)
|
|
2658
2686
|
return !1;
|
|
2659
2687
|
let J = f.subscriptions ?? [], Q = f.permissions ?? [], ee = N(J, Q, "view");
|
|
2660
|
-
return ee || !
|
|
2688
|
+
return ee || !L || !Te(f.children) ? ee : ((f == null ? void 0 : f.children) != null && f.children.forEach((ie) => {
|
|
2661
2689
|
$(ie, !0) && (A = !0);
|
|
2662
2690
|
}), A);
|
|
2663
2691
|
}
|
|
2664
2692
|
function d(D) {
|
|
2665
|
-
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (
|
|
2666
|
-
const A =
|
|
2667
|
-
return
|
|
2693
|
+
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (L, f) => {
|
|
2694
|
+
const A = Be(qr(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${f}`);
|
|
2695
|
+
return L ? `${A}&redirect_path=${L}` : A;
|
|
2668
2696
|
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(D, l.value) ?? "" : "";
|
|
2669
2697
|
}
|
|
2670
2698
|
function h(D) {
|
|
@@ -2672,12 +2700,12 @@ function xn(e) {
|
|
|
2672
2700
|
return D == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((A) => A.code == D)) == null ? void 0 : f.value) ?? 0;
|
|
2673
2701
|
}
|
|
2674
2702
|
function u(D) {
|
|
2675
|
-
const
|
|
2676
|
-
if (
|
|
2703
|
+
const L = K(s);
|
|
2704
|
+
if (L.subscriptionCode == null)
|
|
2677
2705
|
return !1;
|
|
2678
|
-
if (
|
|
2706
|
+
if (L.subscriptionCode == D)
|
|
2679
2707
|
return !0;
|
|
2680
|
-
const f = h(D), A = h(
|
|
2708
|
+
const f = h(D), A = h(L.subscriptionCode);
|
|
2681
2709
|
return f <= A;
|
|
2682
2710
|
}
|
|
2683
2711
|
function r(D) {
|
|
@@ -2688,47 +2716,47 @@ function xn(e) {
|
|
|
2688
2716
|
);
|
|
2689
2717
|
return JSON.parse(A);
|
|
2690
2718
|
}
|
|
2691
|
-
function y(D,
|
|
2692
|
-
s.value = void 0,
|
|
2719
|
+
function y(D, L) {
|
|
2720
|
+
s.value = void 0, M(), D != null && L != null && L.currentRoute.value.path != D && L.push({ path: D });
|
|
2693
2721
|
}
|
|
2694
2722
|
function I(D) {
|
|
2695
2723
|
var f;
|
|
2696
2724
|
K(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), _() && (y(), window.location.href = d(D)));
|
|
2697
2725
|
}
|
|
2698
|
-
async function c(D,
|
|
2726
|
+
async function c(D, L) {
|
|
2699
2727
|
return e.getToken ?? (e.getToken = async () => {
|
|
2700
|
-
let f = D, A =
|
|
2728
|
+
let f = D, A = L, J = e.oauthGrantType ?? "authorization_token", Q = e.oauthClientID ?? "";
|
|
2701
2729
|
if (f == null || A == null)
|
|
2702
2730
|
throw new Error("Code and State required in OAuth token process");
|
|
2703
2731
|
if (A != l.value)
|
|
2704
2732
|
throw new Error("state does not match");
|
|
2705
2733
|
let ee = "";
|
|
2706
|
-
e.getTokenUrl ?? (e.getTokenUrl = () =>
|
|
2734
|
+
e.getTokenUrl ?? (e.getTokenUrl = () => Be(qr(), "token")), ee = e.getTokenUrl(f, `${window.location.origin}/authentication`, J, Q);
|
|
2707
2735
|
const ie = {};
|
|
2708
2736
|
ie.grant_type = J, ie.code = f, ie.redirect_uri = `${window.location.origin}/authentication`, ie.client_id = Q;
|
|
2709
2737
|
const W = await Er().post({
|
|
2710
2738
|
additionalUrl: ee,
|
|
2711
2739
|
data: ie
|
|
2712
2740
|
});
|
|
2713
|
-
|
|
2714
|
-
}), await e.getToken(D,
|
|
2741
|
+
E(W.access_token);
|
|
2742
|
+
}), await e.getToken(D, L);
|
|
2715
2743
|
}
|
|
2716
|
-
function
|
|
2744
|
+
function E(D) {
|
|
2717
2745
|
if (D != null && (e.demo == null || !e.demo.isDemoing.value)) {
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2746
|
+
const L = r(D);
|
|
2747
|
+
w(L, D), e.processTokenPayload != null && e.processTokenPayload(s, L);
|
|
2720
2748
|
}
|
|
2721
2749
|
}
|
|
2722
|
-
function
|
|
2750
|
+
function w(D, L) {
|
|
2723
2751
|
var A;
|
|
2724
2752
|
const f = s.value;
|
|
2725
|
-
f.expiresOn = D.ExpiresOn, f.isGlobalAdmin = D.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = D.Permissions, f.subscriptionCode = D.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token =
|
|
2753
|
+
f.expiresOn = D.ExpiresOn, f.isGlobalAdmin = D.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = D.Permissions, f.subscriptionCode = D.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token = L, f.userID = D.UserLoginID, f.userPermissions = ((A = D.Permissions) == null ? void 0 : A.split(",")) ?? [];
|
|
2726
2754
|
}
|
|
2727
|
-
function
|
|
2755
|
+
function M() {
|
|
2728
2756
|
var D;
|
|
2729
2757
|
s.value ?? (s.value = {}), (D = s.value).timeZone ?? (D.timeZone = e.defaultTimeZone ?? hr);
|
|
2730
2758
|
}
|
|
2731
|
-
function
|
|
2759
|
+
function b() {
|
|
2732
2760
|
const D = K(s);
|
|
2733
2761
|
return D.isLoggedIn && _() && (y(), window.location.href = d()), D.isLoggedIn;
|
|
2734
2762
|
}
|
|
@@ -2736,10 +2764,10 @@ function xn(e) {
|
|
|
2736
2764
|
const D = K(s);
|
|
2737
2765
|
if (D == null || D.expiresOn == null)
|
|
2738
2766
|
return !0;
|
|
2739
|
-
const
|
|
2740
|
-
return
|
|
2767
|
+
const L = de.fromFormat(D.expiresOn, t), f = de.utc();
|
|
2768
|
+
return L <= f;
|
|
2741
2769
|
}
|
|
2742
|
-
return
|
|
2770
|
+
return M(), Ir = {
|
|
2743
2771
|
authState: l,
|
|
2744
2772
|
canEdit: g,
|
|
2745
2773
|
canEditPermit: x,
|
|
@@ -2753,145 +2781,145 @@ function xn(e) {
|
|
|
2753
2781
|
isLoggedIn: te(() => s.value.isLoggedIn === !0),
|
|
2754
2782
|
login: I,
|
|
2755
2783
|
logout: y,
|
|
2756
|
-
resetAuthState:
|
|
2757
|
-
setAuth:
|
|
2784
|
+
resetAuthState: S,
|
|
2785
|
+
setAuth: E,
|
|
2758
2786
|
timeZone: te(() => s.value.timeZone ?? e.defaultTimeZone ?? hr),
|
|
2759
|
-
tryLogin:
|
|
2787
|
+
tryLogin: b
|
|
2760
2788
|
}, Ir;
|
|
2761
2789
|
}
|
|
2762
2790
|
function _n(e, t, l = {}) {
|
|
2763
2791
|
const {
|
|
2764
|
-
preventDefault:
|
|
2792
|
+
preventDefault: S = !1,
|
|
2765
2793
|
stopPropagation: s = !1,
|
|
2766
2794
|
axis: g = "both"
|
|
2767
2795
|
} = l, x = { capture: l.capture ?? !0 };
|
|
2768
|
-
let P = { x: 0, y: 0 }, T = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h =
|
|
2769
|
-
function u(
|
|
2770
|
-
K(
|
|
2796
|
+
let P = { x: 0, y: 0 }, T = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h = z(!1);
|
|
2797
|
+
function u(M) {
|
|
2798
|
+
K(S) && M.preventDefault(), K(s) && M.stopPropagation();
|
|
2771
2799
|
}
|
|
2772
|
-
function r(
|
|
2800
|
+
function r(M) {
|
|
2773
2801
|
var f;
|
|
2774
|
-
const
|
|
2775
|
-
if (!
|
|
2802
|
+
const b = K(e);
|
|
2803
|
+
if (!b)
|
|
2776
2804
|
return;
|
|
2777
|
-
const _ =
|
|
2778
|
-
N = { x:
|
|
2805
|
+
const _ = b.$el, L = M.type === "touchstart" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2806
|
+
N = { x: L.clientX, y: L.clientY }, T = {
|
|
2779
2807
|
x: _.offsetLeft,
|
|
2780
2808
|
y: _.offsetTop
|
|
2781
2809
|
}, P = {
|
|
2782
2810
|
x: _.offsetLeft,
|
|
2783
2811
|
y: _.offsetTop
|
|
2784
|
-
}, ((f = l.onStart) == null ? void 0 : f.call(l, N,
|
|
2812
|
+
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(he("mousemove", y)), d.push(he("touchmove", y)), d.push(he("mouseup", I)), d.push(he("touchend", I)), u(M));
|
|
2785
2813
|
}
|
|
2786
|
-
function y(
|
|
2814
|
+
function y(M) {
|
|
2787
2815
|
var A;
|
|
2788
2816
|
if (!N || !K(e))
|
|
2789
2817
|
return;
|
|
2790
|
-
const D =
|
|
2791
|
-
let
|
|
2792
|
-
(g === "x" || g === "both") && (P.x = T.x +
|
|
2818
|
+
const D = M.type === "touchmove" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2819
|
+
let L = D.clientX - N.x, f = D.clientY - N.y;
|
|
2820
|
+
(g === "x" || g === "both") && (P.x = T.x + L), (g === "y" || g === "both") && (P.y = T.y + f), (A = l.onMove) == null || A.call(l, P, M), u(M), c(P);
|
|
2793
2821
|
}
|
|
2794
|
-
function I(
|
|
2795
|
-
var
|
|
2822
|
+
function I(M) {
|
|
2823
|
+
var b;
|
|
2796
2824
|
document.documentElement.style.cursor = "", d.forEach((_) => {
|
|
2797
2825
|
_();
|
|
2798
|
-
}), d.length = 0, (
|
|
2826
|
+
}), d.length = 0, (b = l.onEnd) == null || b.call(l, P, M), u(M);
|
|
2799
2827
|
}
|
|
2800
|
-
function c(
|
|
2801
|
-
const
|
|
2802
|
-
if (!
|
|
2828
|
+
function c(M) {
|
|
2829
|
+
const b = K(e);
|
|
2830
|
+
if (!b)
|
|
2803
2831
|
return;
|
|
2804
|
-
const _ =
|
|
2805
|
-
_.style.left = `${
|
|
2832
|
+
const _ = b.$el;
|
|
2833
|
+
_.style.left = `${M.x}px`, _.style.top = `${M.y}px`;
|
|
2806
2834
|
}
|
|
2807
|
-
function
|
|
2835
|
+
function E() {
|
|
2808
2836
|
if (K(h))
|
|
2809
2837
|
return;
|
|
2810
|
-
const
|
|
2811
|
-
if (!
|
|
2838
|
+
const M = K(t);
|
|
2839
|
+
if (!M)
|
|
2812
2840
|
return;
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2841
|
+
const b = M.$el;
|
|
2842
|
+
b.style.cursor = "move", $.push(he(b, "mousedown", r, x)), $.push(he(b, "touchstart", r, x)), h.value = !0;
|
|
2815
2843
|
}
|
|
2816
|
-
function
|
|
2844
|
+
function w() {
|
|
2817
2845
|
if (!K(h))
|
|
2818
2846
|
return;
|
|
2819
|
-
const
|
|
2820
|
-
if (!
|
|
2847
|
+
const M = K(t);
|
|
2848
|
+
if (!M)
|
|
2821
2849
|
return;
|
|
2822
|
-
const
|
|
2823
|
-
|
|
2850
|
+
const b = M.$el;
|
|
2851
|
+
b.style.cursor = "", $.forEach((_) => {
|
|
2824
2852
|
_();
|
|
2825
2853
|
}), $.length = 0, h.value = !1;
|
|
2826
2854
|
}
|
|
2827
2855
|
return {
|
|
2828
2856
|
draggingIsOn: h,
|
|
2829
|
-
turnDraggableOff:
|
|
2830
|
-
turnDraggableOn:
|
|
2857
|
+
turnDraggableOff: w,
|
|
2858
|
+
turnDraggableOn: E
|
|
2831
2859
|
};
|
|
2832
2860
|
}
|
|
2833
2861
|
const Tn = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
|
|
2834
2862
|
function Cn(e, t = {}) {
|
|
2835
|
-
let l,
|
|
2836
|
-
const u =
|
|
2863
|
+
let l, S = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, g = t.minWidth ?? 0, x = t.maxWidth ?? Number.MAX_SAFE_INTEGER, P = t.minHeight ?? 0, T = t.maxHeight ?? Number.MAX_SAFE_INTEGER, N = t.preventDefault ?? !1, $ = t.stopPropagation ?? !1, d, h = [];
|
|
2864
|
+
const u = z(!1);
|
|
2837
2865
|
let r = [], y = [];
|
|
2838
|
-
const I =
|
|
2839
|
-
let
|
|
2840
|
-
function
|
|
2866
|
+
const I = z(!1), c = z({ x: 0, y: 0 });
|
|
2867
|
+
let E = { left: 0, top: 0, height: 0, width: 0, position: "absolute" }, w = {};
|
|
2868
|
+
function M(W) {
|
|
2841
2869
|
Ae(N) && W.preventDefault(), Ae($) && W.stopPropagation();
|
|
2842
2870
|
}
|
|
2843
|
-
function
|
|
2844
|
-
h =
|
|
2871
|
+
function b(W, Y) {
|
|
2872
|
+
h = Y.map(D), h.forEach((V) => W.$el.appendChild(V));
|
|
2845
2873
|
}
|
|
2846
2874
|
function _(W) {
|
|
2847
|
-
h.forEach((
|
|
2875
|
+
h.forEach((Y) => W.$el.removeChild(Y));
|
|
2848
2876
|
}
|
|
2849
2877
|
function D(W) {
|
|
2850
|
-
const
|
|
2851
|
-
return G.dataset.handle = W, G.style.position = "absolute", G.style.touchAction = "none", G.style.userSelect = "none", G.style.zIndex = (W.length === 1 ? s : ae).toString(), G.style.cursor = J(W), W.includes("t") && (G.style.top = V, G.style.height =
|
|
2878
|
+
const Y = S + "px", V = -S / 2 + "px", ae = s + 1, G = document.createElement("div");
|
|
2879
|
+
return G.dataset.handle = W, G.style.position = "absolute", G.style.touchAction = "none", G.style.userSelect = "none", G.style.zIndex = (W.length === 1 ? s : ae).toString(), G.style.cursor = J(W), W.includes("t") && (G.style.top = V, G.style.height = Y, W === "t" && (G.style.left = "0", G.style.width = "100%")), W.includes("b") && (G.style.bottom = V, G.style.height = Y, W === "b" && (G.style.left = "0", G.style.width = "100%")), W.includes("r") && (G.style.right = V, G.style.width = Y, W === "r" && (G.style.top = "0", G.style.height = "100%")), W.includes("l") && (G.style.left = V, G.style.width = Y, W === "l" && (G.style.top = "0", G.style.height = "100%")), G;
|
|
2852
2880
|
}
|
|
2853
|
-
function
|
|
2881
|
+
function L(W) {
|
|
2854
2882
|
var ne;
|
|
2855
2883
|
if (!h.some((fe) => fe == W.target))
|
|
2856
2884
|
return;
|
|
2857
|
-
const
|
|
2858
|
-
if (!
|
|
2885
|
+
const Y = Ae(e);
|
|
2886
|
+
if (!Y)
|
|
2859
2887
|
return;
|
|
2860
|
-
const V =
|
|
2861
|
-
if (c.value.x = G.clientX, c.value.y = G.clientY,
|
|
2888
|
+
const V = Y.$el, G = W.type === "touchstart" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2889
|
+
if (c.value.x = G.clientX, c.value.y = G.clientY, E = {
|
|
2862
2890
|
left: V.offsetLeft,
|
|
2863
2891
|
top: V.offsetTop,
|
|
2864
2892
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2865
2893
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width"))
|
|
2866
|
-
},
|
|
2894
|
+
}, w = Lr(E), ((ne = t.onStart) == null ? void 0 : ne.call(t, c.value, W)) === !1)
|
|
2867
2895
|
return;
|
|
2868
2896
|
let X = W.target;
|
|
2869
|
-
document.documentElement.style.cursor = J(X.dataset.handle), d = X.dataset.handle, y.push(he("mousemove", f)), y.push(he("mouseup", A)), y.push(he("touchmove", f)), y.push(he("touchend", A)),
|
|
2897
|
+
document.documentElement.style.cursor = J(X.dataset.handle), d = X.dataset.handle, y.push(he("mousemove", f)), y.push(he("mouseup", A)), y.push(he("touchmove", f)), y.push(he("touchend", A)), M(W);
|
|
2870
2898
|
}
|
|
2871
2899
|
function f(W) {
|
|
2872
|
-
const
|
|
2873
|
-
if (!
|
|
2900
|
+
const Y = Ae(e);
|
|
2901
|
+
if (!Y)
|
|
2874
2902
|
return;
|
|
2875
|
-
const V =
|
|
2903
|
+
const V = Y.$el, G = W.type === "touchmove" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2876
2904
|
let X = G.clientX - c.value.x, ne = G.clientY - c.value.y;
|
|
2877
|
-
const fe = Ae(
|
|
2905
|
+
const fe = Ae(E);
|
|
2878
2906
|
if (d.includes("t")) {
|
|
2879
2907
|
const ce = Math.min(T, Math.max(P, (fe.height ?? 0) - ne));
|
|
2880
|
-
|
|
2908
|
+
w.height = ce, w.top = (fe.top ?? 0) + ne;
|
|
2881
2909
|
}
|
|
2882
2910
|
if (d.includes("b")) {
|
|
2883
2911
|
const ce = Math.min(T, Math.max(P, (fe.height ?? 0) + ne));
|
|
2884
|
-
|
|
2912
|
+
w.height = ce;
|
|
2885
2913
|
}
|
|
2886
2914
|
if (d.includes("l")) {
|
|
2887
2915
|
const ce = Math.min(x, Math.max(g, (fe.width ?? 0) - X));
|
|
2888
|
-
|
|
2916
|
+
w.width = ce, w.left = (fe.left ?? 0) + X;
|
|
2889
2917
|
}
|
|
2890
2918
|
if (d.includes("r")) {
|
|
2891
2919
|
const ce = Math.min(x, Math.max(g, (fe.width ?? 0) + X));
|
|
2892
|
-
|
|
2920
|
+
w.width = ce;
|
|
2893
2921
|
}
|
|
2894
|
-
V.dispatchEvent(new CustomEvent("resize")),
|
|
2922
|
+
V.dispatchEvent(new CustomEvent("resize")), M(W), ee(w);
|
|
2895
2923
|
}
|
|
2896
2924
|
function A() {
|
|
2897
2925
|
document.documentElement.style.cursor = "", d = null, y.forEach((W) => {
|
|
@@ -2899,19 +2927,19 @@ function Cn(e, t = {}) {
|
|
|
2899
2927
|
}), y.length = 0;
|
|
2900
2928
|
}
|
|
2901
2929
|
function J(W) {
|
|
2902
|
-
const
|
|
2930
|
+
const Y = {
|
|
2903
2931
|
t: "n",
|
|
2904
2932
|
r: "e",
|
|
2905
2933
|
b: "s",
|
|
2906
2934
|
l: "w"
|
|
2907
2935
|
};
|
|
2908
|
-
return W.split("").map((V) =>
|
|
2936
|
+
return W.split("").map((V) => Y[V]).join("") + "-resize";
|
|
2909
2937
|
}
|
|
2910
2938
|
function Q(W) {
|
|
2911
|
-
const
|
|
2912
|
-
if (!
|
|
2939
|
+
const Y = Ae(e);
|
|
2940
|
+
if (!Y)
|
|
2913
2941
|
return;
|
|
2914
|
-
const V =
|
|
2942
|
+
const V = Y.$el;
|
|
2915
2943
|
if (console.log(l), l !== "page" && W == "page") {
|
|
2916
2944
|
const ae = jt(V), G = Ae(ae) ?? null;
|
|
2917
2945
|
let X = 0;
|
|
@@ -2928,50 +2956,50 @@ function Cn(e, t = {}) {
|
|
|
2928
2956
|
}), he(V, "transitionend", () => {
|
|
2929
2957
|
V.style.width = "auto", V.style.top = "", V.style.left = "", V.style.position = "", V.style.transition = "", u.value = !1;
|
|
2930
2958
|
}, { once: !0 });
|
|
2931
|
-
} else if ((l == "page" ||
|
|
2932
|
-
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0,
|
|
2959
|
+
} else if ((l == "page" || Y.$el.style.position !== "absolute") && W !== "page") {
|
|
2960
|
+
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0, E = {
|
|
2933
2961
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2934
2962
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width")),
|
|
2935
2963
|
top: V.offsetTop,
|
|
2936
2964
|
left: V.offsetLeft,
|
|
2937
2965
|
position: "absolute"
|
|
2938
|
-
}, ee(
|
|
2939
|
-
const ae =
|
|
2940
|
-
W == "freestyle" ?
|
|
2966
|
+
}, ee(E), V.offsetHeight;
|
|
2967
|
+
const ae = E;
|
|
2968
|
+
W == "freestyle" ? w = {
|
|
2941
2969
|
height: ae.height,
|
|
2942
2970
|
width: (ae.width ?? 100) / 2,
|
|
2943
2971
|
top: (ae.top ?? 0) + 2,
|
|
2944
2972
|
left: (ae.left ?? 0) + 2,
|
|
2945
2973
|
position: "absolute"
|
|
2946
|
-
} : W == "blade" && (
|
|
2974
|
+
} : W == "blade" && (w = {
|
|
2947
2975
|
height: ae.height,
|
|
2948
2976
|
width: (ae.width ?? 100) / 2,
|
|
2949
2977
|
top: (ae.top ?? 0) + 2,
|
|
2950
2978
|
left: (ae.left ?? 0) + 2,
|
|
2951
2979
|
position: "absolute"
|
|
2952
|
-
}), ee(
|
|
2980
|
+
}), ee(w), he(V, "transitionend", () => {
|
|
2953
2981
|
V.style.transition = "", u.value = !1;
|
|
2954
2982
|
}, { once: !0 });
|
|
2955
2983
|
}
|
|
2956
2984
|
}
|
|
2957
2985
|
function ee(W) {
|
|
2958
|
-
const
|
|
2959
|
-
if (!
|
|
2986
|
+
const Y = Ae(e);
|
|
2987
|
+
if (!Y)
|
|
2960
2988
|
return;
|
|
2961
|
-
const V =
|
|
2989
|
+
const V = Y.$el;
|
|
2962
2990
|
W.top ? V.style.top = `${W.top}px` : V.style.top = void 0, W.left ? V.style.left = `${W.left}px` : V.style.left = void 0, W.height ? V.style.height = `${W.height}px` : V.style.height = void 0, W.width ? V.style.width = `${W.width}px` : V.style.width = void 0, W.position ? V.style.position = `${W.position}` : V.style.position = void 0, console.log(V.style.position);
|
|
2963
2991
|
}
|
|
2964
|
-
function ie(W,
|
|
2992
|
+
function ie(W, Y) {
|
|
2965
2993
|
if (I.value)
|
|
2966
2994
|
return;
|
|
2967
2995
|
const V = Ae(e);
|
|
2968
|
-
V && (
|
|
2996
|
+
V && (b(V, W ?? Tn), Q(Y), r.push(he(V.$el, "mousedown", L)), r.push(he(V.$el, "touchstart", L)), I.value = !0, l = Y);
|
|
2969
2997
|
}
|
|
2970
2998
|
function we(W) {
|
|
2971
2999
|
if (!I.value)
|
|
2972
3000
|
return;
|
|
2973
|
-
const
|
|
2974
|
-
|
|
3001
|
+
const Y = Ae(e);
|
|
3002
|
+
Y && (_(Y), Q(W), r.forEach((V) => {
|
|
2975
3003
|
V();
|
|
2976
3004
|
}), r.length = 0, I.value = !1);
|
|
2977
3005
|
}
|
|
@@ -2982,16 +3010,16 @@ function Cn(e, t = {}) {
|
|
|
2982
3010
|
};
|
|
2983
3011
|
}
|
|
2984
3012
|
function Pn(e) {
|
|
2985
|
-
const t = (e == null ? void 0 : e.blade) ??
|
|
3013
|
+
const t = (e == null ? void 0 : e.blade) ?? z(null), l = (e == null ? void 0 : e.handle) ?? z(null), S = z(!1), s = (e == null ? void 0 : e.mobileBreakpoint) ?? 500, g = z((e == null ? void 0 : e.defaultVariant) ?? "page"), x = z({}), { turnResizingOff: P, turnResizingOn: T } = Cn(t), { turnDraggableOff: N, turnDraggableOn: $ } = _n(t, l);
|
|
2986
3014
|
Kt(t, (h) => {
|
|
2987
3015
|
const u = h[0], { width: r } = u.contentRect;
|
|
2988
|
-
|
|
3016
|
+
S.value = r < s;
|
|
2989
3017
|
});
|
|
2990
3018
|
function d(h) {
|
|
2991
3019
|
N(), h == "page" ? P(h) : h == "blade" ? T(["l", "r"], h) : h == "freestyle" ? (P(), T(void 0, h), $()) : h == "inline" && P();
|
|
2992
3020
|
}
|
|
2993
3021
|
return d(g.value), _e(g, (h) => d(h)), {
|
|
2994
|
-
isMobile:
|
|
3022
|
+
isMobile: S,
|
|
2995
3023
|
variant: g,
|
|
2996
3024
|
bladeData: x
|
|
2997
3025
|
};
|
|
@@ -3033,9 +3061,9 @@ function wa(e) {
|
|
|
3033
3061
|
};
|
|
3034
3062
|
}
|
|
3035
3063
|
function Nn(e) {
|
|
3036
|
-
const t =
|
|
3064
|
+
const t = z({});
|
|
3037
3065
|
let l = e.vuetifyInstance;
|
|
3038
|
-
function
|
|
3066
|
+
function S() {
|
|
3039
3067
|
const d = localStorage.getItem("cosmetics");
|
|
3040
3068
|
d != null && d.length > 0 ? t.value = JSON.parse(d) : t.value = {
|
|
3041
3069
|
theme: e.defaultTheme ?? "light",
|
|
@@ -3086,7 +3114,7 @@ function Nn(e) {
|
|
|
3086
3114
|
h.colors.primary = (t.value.dark ?? { ...vr, ...e.defaultDarkTheme }).primary, u.colors.primary = (t.value.light ?? { ...mr, ...e.defaultLightTheme }).primary, (d = document.querySelector('meta[name="theme-color"]')) == null || d.setAttribute("content", "");
|
|
3087
3115
|
}
|
|
3088
3116
|
}
|
|
3089
|
-
return
|
|
3117
|
+
return S(), _e(t, () => {
|
|
3090
3118
|
s();
|
|
3091
3119
|
}), Dr = {
|
|
3092
3120
|
state: t,
|
|
@@ -3105,14 +3133,14 @@ function Mn() {
|
|
|
3105
3133
|
function e(t) {
|
|
3106
3134
|
const {
|
|
3107
3135
|
items: l,
|
|
3108
|
-
headers:
|
|
3136
|
+
headers: S,
|
|
3109
3137
|
fileName: s = "data.csv",
|
|
3110
3138
|
format: g = "file"
|
|
3111
3139
|
} = t;
|
|
3112
3140
|
if (!Te(l))
|
|
3113
3141
|
return;
|
|
3114
3142
|
let x = [];
|
|
3115
|
-
|
|
3143
|
+
S != null ? x = S == null ? void 0 : S.filter((I) => (I.csv ?? I.csvText ?? I.csvFilter ?? I.csvArray) != null).map((I) => ({
|
|
3116
3144
|
header: I.title ?? I.value ?? "",
|
|
3117
3145
|
itemText: I.itemText,
|
|
3118
3146
|
value: I.value
|
|
@@ -3121,21 +3149,21 @@ function Mn() {
|
|
|
3121
3149
|
for (let I = 0; I < l.length; I++) {
|
|
3122
3150
|
const c = l[I];
|
|
3123
3151
|
var T = {}, N = [];
|
|
3124
|
-
for (let
|
|
3125
|
-
const
|
|
3152
|
+
for (let E = 0; E < x.length; E++) {
|
|
3153
|
+
const w = x[E];
|
|
3126
3154
|
var $ = null;
|
|
3127
|
-
typeof
|
|
3155
|
+
typeof w.value == "function" ? $ = w.value(c) : typeof w.value == "string" && ($ = Sr(c, w.value)), w.itemText != null ? T[w.header] = Sr($, w.itemText) : T[w.header] = $;
|
|
3128
3156
|
}
|
|
3129
|
-
P.push(T), Te(N) && N.forEach((
|
|
3130
|
-
P.push(
|
|
3157
|
+
P.push(T), Te(N) && N.forEach((E) => {
|
|
3158
|
+
P.push(E);
|
|
3131
3159
|
}), N = [];
|
|
3132
3160
|
}
|
|
3133
3161
|
var d = [];
|
|
3134
3162
|
if (d.push(x.map((I) => I.header).toString()), P.forEach((I) => {
|
|
3135
3163
|
let c = [];
|
|
3136
|
-
x.forEach(function(
|
|
3137
|
-
var
|
|
3138
|
-
c.push(
|
|
3164
|
+
x.forEach(function(E) {
|
|
3165
|
+
var w = I[E.header];
|
|
3166
|
+
c.push(w ?? "");
|
|
3139
3167
|
}), d.push(c.join(","));
|
|
3140
3168
|
}), g == "array")
|
|
3141
3169
|
return d;
|
|
@@ -3163,7 +3191,7 @@ function Ln(e) {
|
|
|
3163
3191
|
function l() {
|
|
3164
3192
|
return s().startOf("day").toUTC().toString() ?? "";
|
|
3165
3193
|
}
|
|
3166
|
-
function
|
|
3194
|
+
function S() {
|
|
3167
3195
|
return s().startOf("day").plus({ day: 1 }).toUTC().toString() ?? "";
|
|
3168
3196
|
}
|
|
3169
3197
|
function s(T, N) {
|
|
@@ -3192,7 +3220,7 @@ function Ln(e) {
|
|
|
3192
3220
|
}
|
|
3193
3221
|
return xr = {
|
|
3194
3222
|
getToday: l,
|
|
3195
|
-
getTomorrow:
|
|
3223
|
+
getTomorrow: S,
|
|
3196
3224
|
tzDate: s,
|
|
3197
3225
|
tzString: g,
|
|
3198
3226
|
utcDate: x,
|
|
@@ -3204,8 +3232,8 @@ function Aa() {
|
|
|
3204
3232
|
return _r;
|
|
3205
3233
|
}
|
|
3206
3234
|
function Rn(e) {
|
|
3207
|
-
const t =
|
|
3208
|
-
function
|
|
3235
|
+
const t = z(!1), l = (e == null ? void 0 : e.apis) ?? [];
|
|
3236
|
+
function S() {
|
|
3209
3237
|
t.value = !0;
|
|
3210
3238
|
}
|
|
3211
3239
|
function s() {
|
|
@@ -3240,9 +3268,9 @@ function Rn(e) {
|
|
|
3240
3268
|
throw new Error("no demo data available for this api");
|
|
3241
3269
|
const h = d.id ?? ((y = d.data) == null ? void 0 : y.id), u = g(d);
|
|
3242
3270
|
let r;
|
|
3243
|
-
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (I = u.data) == null ? void 0 : I.find((
|
|
3271
|
+
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (I = u.data) == null ? void 0 : I.find((E) => E.id == h) : u.path != null && ((c = u.data) == null ? void 0 : c.length) == 1 && (r = u.data[0])), r == null ? Promise.resolve(void 0) : new Promise((E) => {
|
|
3244
3272
|
setTimeout(() => {
|
|
3245
|
-
|
|
3273
|
+
E({
|
|
3246
3274
|
data: r
|
|
3247
3275
|
});
|
|
3248
3276
|
});
|
|
@@ -3302,7 +3330,7 @@ function Rn(e) {
|
|
|
3302
3330
|
return _r = {
|
|
3303
3331
|
endDemo: s,
|
|
3304
3332
|
isDemoing: t,
|
|
3305
|
-
startDemo:
|
|
3333
|
+
startDemo: S,
|
|
3306
3334
|
data: l,
|
|
3307
3335
|
deleteItem: x,
|
|
3308
3336
|
get: P,
|
|
@@ -3311,15 +3339,15 @@ function Rn(e) {
|
|
|
3311
3339
|
patch: $
|
|
3312
3340
|
}, _r;
|
|
3313
3341
|
}
|
|
3314
|
-
var
|
|
3342
|
+
var Un = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
3315
3343
|
function Ea(e) {
|
|
3316
3344
|
function t(l) {
|
|
3317
3345
|
var s;
|
|
3318
|
-
const
|
|
3319
|
-
if (
|
|
3320
|
-
document.title =
|
|
3346
|
+
const S = l.matched.slice().reverse().find((g) => g.meta && g.meta.title);
|
|
3347
|
+
if (S)
|
|
3348
|
+
document.title = S.meta.title;
|
|
3321
3349
|
else {
|
|
3322
|
-
const g =
|
|
3350
|
+
const g = Un.NODE_ENV;
|
|
3323
3351
|
let x = "";
|
|
3324
3352
|
g == "development" ? x = "BWeb Dev" : g == "staging" ? x = "BlitzIt Sandpit" : x = "BlitzIt Web | Cloud-Based Wholesale Logistics Platform", ((s = e == null ? void 0 : e.demo) == null ? void 0 : s.isDemoing.value) == !0 && (x = `Training: ${x}`), document.title = x;
|
|
3325
3353
|
}
|
|
@@ -3332,7 +3360,7 @@ let Tr;
|
|
|
3332
3360
|
function Ia() {
|
|
3333
3361
|
return Tr;
|
|
3334
3362
|
}
|
|
3335
|
-
function
|
|
3363
|
+
function Bn(e) {
|
|
3336
3364
|
function t(f, A, J) {
|
|
3337
3365
|
return f ? ln(f) ? J ?? "" : e.dates.tzString(f, A) : J ?? f ?? "";
|
|
3338
3366
|
}
|
|
@@ -3344,7 +3372,7 @@ function Un(e) {
|
|
|
3344
3372
|
var A = "";
|
|
3345
3373
|
return f.companyAccount != null && (A = f.companyAccount.companyName + " | "), f.addressLineOne != null && (A = A + f.addressLineOne + " "), f.streetNumber != null && (A = A + f.streetNumber + " "), f.streetName != null && (A = A + f.streetName + ", "), f.suburb != null && (A = A + f.suburb + " "), f.state != null && (A = A + f.state + " "), f.postcode != null && (A = A + f.postcode), A;
|
|
3346
3374
|
}
|
|
3347
|
-
function
|
|
3375
|
+
function S(f) {
|
|
3348
3376
|
if (typeof f != "number")
|
|
3349
3377
|
return f;
|
|
3350
3378
|
var A = new Intl.NumberFormat("en-US", {
|
|
@@ -3408,16 +3436,16 @@ function Un(e) {
|
|
|
3408
3436
|
});
|
|
3409
3437
|
return A.format(f);
|
|
3410
3438
|
}
|
|
3411
|
-
function
|
|
3439
|
+
function E(f) {
|
|
3412
3440
|
return f.replaceAll(",", " ");
|
|
3413
3441
|
}
|
|
3414
|
-
function
|
|
3442
|
+
function w(f, A) {
|
|
3415
3443
|
return t(f, "dd LLL yyyy", A);
|
|
3416
3444
|
}
|
|
3417
|
-
function
|
|
3445
|
+
function M(f, A) {
|
|
3418
3446
|
return t(f, "dd LLL yyyy hh:mm a", A);
|
|
3419
3447
|
}
|
|
3420
|
-
function
|
|
3448
|
+
function b(f, A) {
|
|
3421
3449
|
return t(f, "hh:mm a", A);
|
|
3422
3450
|
}
|
|
3423
3451
|
function _(f) {
|
|
@@ -3425,7 +3453,7 @@ function Un(e) {
|
|
|
3425
3453
|
}
|
|
3426
3454
|
const D = {
|
|
3427
3455
|
toCompanyNameAndLocationLine: l,
|
|
3428
|
-
toCurrency:
|
|
3456
|
+
toCurrency: S,
|
|
3429
3457
|
toDayDate: s,
|
|
3430
3458
|
toDayMonth: g,
|
|
3431
3459
|
toDayOfWeek: x,
|
|
@@ -3440,13 +3468,13 @@ function Un(e) {
|
|
|
3440
3468
|
toLongDate: y,
|
|
3441
3469
|
toLongDateAndTime: I,
|
|
3442
3470
|
toPercent: c,
|
|
3443
|
-
toPrettyCSV:
|
|
3444
|
-
toShortDate:
|
|
3445
|
-
toShortDateAndTime:
|
|
3446
|
-
toTime:
|
|
3471
|
+
toPrettyCSV: E,
|
|
3472
|
+
toShortDate: w,
|
|
3473
|
+
toShortDateAndTime: M,
|
|
3474
|
+
toTime: b,
|
|
3447
3475
|
toTimeOfDay: _
|
|
3448
3476
|
};
|
|
3449
|
-
function
|
|
3477
|
+
function L(f) {
|
|
3450
3478
|
if (f != null) {
|
|
3451
3479
|
let A = f;
|
|
3452
3480
|
if (A != null && D[A] != null)
|
|
@@ -3455,14 +3483,14 @@ function Un(e) {
|
|
|
3455
3483
|
return (A) => A;
|
|
3456
3484
|
}
|
|
3457
3485
|
return Tr = {
|
|
3458
|
-
findFilter:
|
|
3486
|
+
findFilter: L,
|
|
3459
3487
|
...D
|
|
3460
3488
|
}, Tr;
|
|
3461
3489
|
}
|
|
3462
3490
|
function $n(e, t) {
|
|
3463
|
-
const l =
|
|
3491
|
+
const l = z(!1), S = Zt(e);
|
|
3464
3492
|
let s = g(K(e));
|
|
3465
|
-
(t == null ? void 0 : t.useTracker) !== !1 && _e(
|
|
3493
|
+
(t == null ? void 0 : t.useTracker) !== !1 && _e(S, (P) => {
|
|
3466
3494
|
l.value = g(P) != s;
|
|
3467
3495
|
}, { deep: !0 });
|
|
3468
3496
|
function g(P) {
|
|
@@ -3474,10 +3502,10 @@ function $n(e, t) {
|
|
|
3474
3502
|
})), JSON.stringify(T);
|
|
3475
3503
|
}
|
|
3476
3504
|
function x() {
|
|
3477
|
-
s = g(K(
|
|
3505
|
+
s = g(K(S)), l.value = !1;
|
|
3478
3506
|
}
|
|
3479
3507
|
return {
|
|
3480
|
-
asyncItem:
|
|
3508
|
+
asyncItem: S,
|
|
3481
3509
|
isChanged: l,
|
|
3482
3510
|
restartTracker: x
|
|
3483
3511
|
};
|
|
@@ -3487,18 +3515,19 @@ function Da(e, t) {
|
|
|
3487
3515
|
const {
|
|
3488
3516
|
// useBladeSrc = true,
|
|
3489
3517
|
useRouteSrc: l = !0
|
|
3490
|
-
} = t ?? {},
|
|
3518
|
+
} = t ?? {}, S = e.storeMode ?? (t == null ? void 0 : t.storeMode), s = e.storageMode ?? (t == null ? void 0 : t.storageMode), g = e.nav ?? e.bladeName ?? "basic", x = Mr(), P = rt(), T = K(e.proxyQueryKey), N = te(() => {
|
|
3491
3519
|
var G;
|
|
3492
3520
|
return K(e.proxyID) ?? (T != null ? (G = P == null ? void 0 : P.query) == null ? void 0 : G[T] : void 0);
|
|
3493
|
-
}), $ =
|
|
3521
|
+
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: y, restoreItem: I, saveItem: c } = it({
|
|
3494
3522
|
nav: g,
|
|
3523
|
+
onError: e.onError ?? (t == null ? void 0 : t.onError),
|
|
3495
3524
|
proxyID: N.value,
|
|
3496
3525
|
store: Le({
|
|
3497
|
-
storeMode:
|
|
3526
|
+
storeMode: S,
|
|
3498
3527
|
storageMode: s,
|
|
3499
3528
|
nav: g
|
|
3500
3529
|
})
|
|
3501
|
-
}),
|
|
3530
|
+
}), E = te(() => e.errorMsg ?? d.value), w = te(() => e.loadingMsg ?? h.value), M = te(() => w.value != null), b = z(e.itemID ?? (l ? (ae = P == null ? void 0 : P.params) == null ? void 0 : ae.id : void 0)), _ = z(b.value == "new" ? "new" : e.startEditing ? "edit" : "view"), D = Re(!1), L = te(() => {
|
|
3502
3531
|
if (_.value == "new")
|
|
3503
3532
|
return !1;
|
|
3504
3533
|
const G = K($);
|
|
@@ -3564,7 +3593,7 @@ function Da(e, t) {
|
|
|
3564
3593
|
else {
|
|
3565
3594
|
const X = {
|
|
3566
3595
|
additionalUrl: e.additionalUrl,
|
|
3567
|
-
id:
|
|
3596
|
+
id: b.value,
|
|
3568
3597
|
nav: g,
|
|
3569
3598
|
proxyID: N.value,
|
|
3570
3599
|
params: e.params,
|
|
@@ -3582,7 +3611,7 @@ function Da(e, t) {
|
|
|
3582
3611
|
}
|
|
3583
3612
|
ee();
|
|
3584
3613
|
}
|
|
3585
|
-
function
|
|
3614
|
+
function Y(G, X) {
|
|
3586
3615
|
const {
|
|
3587
3616
|
additionalUrl: ne,
|
|
3588
3617
|
onCanSaveAsync: fe,
|
|
@@ -3608,7 +3637,7 @@ function Da(e, t) {
|
|
|
3608
3637
|
const G = K(_);
|
|
3609
3638
|
!G || G == "view" ? _.value = "edit" : G == "edit" && (_.value = "view");
|
|
3610
3639
|
}
|
|
3611
|
-
return _e(
|
|
3640
|
+
return _e(E, (G) => {
|
|
3612
3641
|
D.value = G != null;
|
|
3613
3642
|
}), _e(() => e.refreshToggle, () => {
|
|
3614
3643
|
W({ deepRefresh: !0 });
|
|
@@ -3618,25 +3647,25 @@ function Da(e, t) {
|
|
|
3618
3647
|
}), {
|
|
3619
3648
|
asyncItem: $,
|
|
3620
3649
|
deleteItem: ie,
|
|
3621
|
-
errorMsg:
|
|
3650
|
+
errorMsg: E,
|
|
3622
3651
|
isChanged: Q,
|
|
3623
|
-
isDeletable:
|
|
3652
|
+
isDeletable: L,
|
|
3624
3653
|
isEditing: te(() => _.value == "new" || _.value == "edit"),
|
|
3625
3654
|
isEditable: f,
|
|
3626
|
-
isLoading:
|
|
3655
|
+
isLoading: M,
|
|
3627
3656
|
isNew: te(() => _.value == "new"),
|
|
3628
3657
|
isRestorable: A,
|
|
3629
3658
|
isSaveable: J,
|
|
3630
|
-
loadingMsg:
|
|
3659
|
+
loadingMsg: w,
|
|
3631
3660
|
mode: _,
|
|
3632
3661
|
refresh: W,
|
|
3633
3662
|
restoreItem: we,
|
|
3634
|
-
saveItem:
|
|
3663
|
+
saveItem: Y,
|
|
3635
3664
|
showError: D,
|
|
3636
3665
|
toggleMode: V
|
|
3637
3666
|
};
|
|
3638
3667
|
}
|
|
3639
|
-
const
|
|
3668
|
+
const zr = z(!0), Yr = z(!1), Zr = z(), gr = z(!1);
|
|
3640
3669
|
let yr = null, Cr;
|
|
3641
3670
|
function ct() {
|
|
3642
3671
|
return Cr;
|
|
@@ -3653,7 +3682,7 @@ function Fn(e) {
|
|
|
3653
3682
|
displayName: h.displayName ?? e.getDisplayName(h),
|
|
3654
3683
|
...h
|
|
3655
3684
|
}));
|
|
3656
|
-
function
|
|
3685
|
+
function S(h) {
|
|
3657
3686
|
var u;
|
|
3658
3687
|
return (u = P(h)) == null ? void 0 : u.archiveName;
|
|
3659
3688
|
}
|
|
@@ -3680,7 +3709,7 @@ function Fn(e) {
|
|
|
3680
3709
|
if (u == null)
|
|
3681
3710
|
return;
|
|
3682
3711
|
let r = yn(u.microservice ?? "default") ?? "";
|
|
3683
|
-
return u.path != null && (r =
|
|
3712
|
+
return u.path != null && (r = Be(r, u.path)), r != null && r.endsWith("/") && (r = r.slice(0, r.length - 1)), r;
|
|
3684
3713
|
}
|
|
3685
3714
|
function N(h) {
|
|
3686
3715
|
const u = P(h);
|
|
@@ -3698,17 +3727,17 @@ function Fn(e) {
|
|
|
3698
3727
|
if (h == null)
|
|
3699
3728
|
return;
|
|
3700
3729
|
const u = typeof h == "string" ? P(h) : h;
|
|
3701
|
-
|
|
3730
|
+
Zr.value = u == null ? void 0 : u.background, Yr.value = (u == null ? void 0 : u.hideNavigation) !== !0, zr.value = (u == null ? void 0 : u.hideAppBar) !== !0, yr != null && yr(), gr.value = (u == null ? void 0 : u.hesitate) === !0, gr.value && (yr = window.addEventListener("beforeunload", (r) => {
|
|
3702
3731
|
r.preventDefault();
|
|
3703
3732
|
}));
|
|
3704
3733
|
}
|
|
3705
3734
|
return Cr = {
|
|
3706
|
-
showAppBar:
|
|
3707
|
-
showAppNavigation:
|
|
3708
|
-
backgroundName:
|
|
3735
|
+
showAppBar: zr,
|
|
3736
|
+
showAppNavigation: Yr,
|
|
3737
|
+
backgroundName: Zr,
|
|
3709
3738
|
hesitate: gr,
|
|
3710
3739
|
navigationItems: l,
|
|
3711
|
-
findArchiveName:
|
|
3740
|
+
findArchiveName: S,
|
|
3712
3741
|
findCacheHours: s,
|
|
3713
3742
|
findDisplay: g,
|
|
3714
3743
|
findIcon: x,
|
|
@@ -3721,17 +3750,17 @@ function Fn(e) {
|
|
|
3721
3750
|
}
|
|
3722
3751
|
function xa(e, t, l) {
|
|
3723
3752
|
var qe, Ve;
|
|
3724
|
-
const
|
|
3725
|
-
...u.filter((
|
|
3753
|
+
const S = Mn(), s = ct(), g = Mr(), x = rt(), { bladeData: P } = Pn({}), T = e.useBladeSrc ?? !0, N = e.useRouteSrc ?? !0, $ = e.nav ?? e.bladeName ?? e.itemBladeName ?? "basic", d = e.storeMode ?? ((qe = s.findItem($)) == null ? void 0 : qe.storeMode), h = e.storageMode ?? ((Ve = s.findItem($)) == null ? void 0 : Ve.storageMode), u = K(e.customFilters) ?? [], r = z([]), y = te(() => Qt([
|
|
3754
|
+
...u.filter((U) => U.name != null).map((U) => U.name),
|
|
3726
3755
|
...e.defaultFilters ?? [],
|
|
3727
3756
|
...r.value
|
|
3728
|
-
]).value), I =
|
|
3729
|
-
let c =
|
|
3730
|
-
const
|
|
3731
|
-
function
|
|
3732
|
-
var
|
|
3757
|
+
]).value), I = z((e.defaultFilters ?? []).map((U) => y.value.indexOf(U)));
|
|
3758
|
+
let c = z([...I.value]);
|
|
3759
|
+
const E = te(() => Wr(c, I).value.length > 0 || Wr(I, c).value.length > 0), w = z(M());
|
|
3760
|
+
function M() {
|
|
3761
|
+
var U, j;
|
|
3733
3762
|
if (T) {
|
|
3734
|
-
const H = (
|
|
3763
|
+
const H = (U = P.value) == null ? void 0 : U.page;
|
|
3735
3764
|
if (H != null)
|
|
3736
3765
|
return Number.parseInt(H);
|
|
3737
3766
|
}
|
|
@@ -3742,10 +3771,10 @@ function xa(e, t, l) {
|
|
|
3742
3771
|
}
|
|
3743
3772
|
return 1;
|
|
3744
3773
|
}
|
|
3745
|
-
const
|
|
3746
|
-
var
|
|
3774
|
+
const b = te(() => {
|
|
3775
|
+
var U, j;
|
|
3747
3776
|
if (T) {
|
|
3748
|
-
const H = (
|
|
3777
|
+
const H = (U = P.value) == null ? void 0 : U.proxyID;
|
|
3749
3778
|
if (H != null)
|
|
3750
3779
|
return H;
|
|
3751
3780
|
}
|
|
@@ -3755,11 +3784,11 @@ function xa(e, t, l) {
|
|
|
3755
3784
|
return H;
|
|
3756
3785
|
}
|
|
3757
3786
|
return e.proxyID;
|
|
3758
|
-
}), _ =
|
|
3787
|
+
}), _ = z(D());
|
|
3759
3788
|
function D() {
|
|
3760
|
-
var
|
|
3789
|
+
var U, j;
|
|
3761
3790
|
if (T) {
|
|
3762
|
-
const H = (
|
|
3791
|
+
const H = (U = P.value) == null ? void 0 : U.search;
|
|
3763
3792
|
if (H != null)
|
|
3764
3793
|
return H;
|
|
3765
3794
|
}
|
|
@@ -3769,62 +3798,63 @@ function xa(e, t, l) {
|
|
|
3769
3798
|
return H;
|
|
3770
3799
|
}
|
|
3771
3800
|
}
|
|
3772
|
-
const
|
|
3801
|
+
const L = z(K(e.startShowingInactive) ?? !1), f = te(() => [
|
|
3773
3802
|
...e.searchProps ?? [],
|
|
3774
|
-
...(e.headers ?? []).filter((
|
|
3775
|
-
]), A =
|
|
3803
|
+
...(e.headers ?? []).filter((U) => U.searchable != null && U.value != null).map((U) => U.value ?? "")
|
|
3804
|
+
]), A = z([]), J = Re([]), Q = z([]);
|
|
3776
3805
|
let ee;
|
|
3777
|
-
const { actionErrorMsg: ie, actionLoadingMsg: we, deleteItem: W, doAction:
|
|
3806
|
+
const { actionErrorMsg: ie, actionLoadingMsg: we, deleteItem: W, doAction: Y, getItem: V, getAllItems: ae, restoreItem: G } = it({
|
|
3778
3807
|
nav: $,
|
|
3779
|
-
|
|
3808
|
+
onError: e.onError ?? (l == null ? void 0 : l.onError),
|
|
3809
|
+
proxyID: b.value,
|
|
3780
3810
|
store: Le({
|
|
3781
3811
|
storeMode: d,
|
|
3782
3812
|
storageMode: h,
|
|
3783
3813
|
nav: $
|
|
3784
3814
|
})
|
|
3785
|
-
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1), Ee = Re(e.showSearch ?? !0), $e =
|
|
3786
|
-
let
|
|
3815
|
+
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1), Ee = Re(e.showSearch ?? !0), $e = z(0), Ce = te(() => {
|
|
3816
|
+
let U, j = [];
|
|
3787
3817
|
I.value.forEach((O) => {
|
|
3788
3818
|
const oe = y.value[O], ve = u.find((De) => De.name == oe);
|
|
3789
|
-
ve != null ?
|
|
3819
|
+
ve != null ? U = U != null ? `${U}ANDALSO${ve.filterFunction()}` : ve.filterFunction() : j.push(oe);
|
|
3790
3820
|
});
|
|
3791
3821
|
const H = {};
|
|
3792
|
-
return Te(j) && (H.filterBy = j.toString()),
|
|
3822
|
+
return Te(j) && (H.filterBy = j.toString()), U != null && (H.query = U), H;
|
|
3793
3823
|
}), rr = te(() => {
|
|
3794
3824
|
var j;
|
|
3795
|
-
let
|
|
3796
|
-
return e.useServerPagination && e.itemsPerPage != null && (
|
|
3797
|
-
}), tr = te(() => (
|
|
3798
|
-
let
|
|
3825
|
+
let U = e.params != null ? { ...e.params } : {};
|
|
3826
|
+
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (w.value - 1) * e.itemsPerPage), Ce.value != null && (U = { ...U, ...Ce.value }), L.value && (U.includeInactive = !0), Te(e.selectProps) && (U.properties = (j = e.selectProps) == null ? void 0 : j.toString()), _.value != null && (U.searchString = _.value), U;
|
|
3827
|
+
}), tr = te(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = te(() => (U) => L.value ? e.onCanRestore != null ? e.onCanRestore(U) : (U == null ? void 0 : U.isInactive) === !0 : !1), Pe = te(() => Q.value.filter((U) => !U.hide)), ar = te(() => {
|
|
3828
|
+
let U = new Array();
|
|
3799
3829
|
return Pe.value.filter((H) => H.sublevel != null).forEach((H) => {
|
|
3800
|
-
let O =
|
|
3801
|
-
O == null ?
|
|
3802
|
-
}),
|
|
3830
|
+
let O = U.find((oe) => oe.position == H.sublevel);
|
|
3831
|
+
O == null ? U.push({ position: H.sublevel ?? 0, values: [H] }) : O.values.push(H);
|
|
3832
|
+
}), U.sort(Ue.firstBy((H) => H.position));
|
|
3803
3833
|
}), lr = te(() => {
|
|
3804
|
-
let
|
|
3834
|
+
let U = new Array();
|
|
3805
3835
|
return Pe.value.filter((H) => H.level != null).forEach((H) => {
|
|
3806
|
-
let O =
|
|
3807
|
-
O == null ?
|
|
3808
|
-
}),
|
|
3809
|
-
}), ur = te(() => Pe.value.filter((
|
|
3810
|
-
function be(
|
|
3836
|
+
let O = U.find((oe) => oe.position == H.level);
|
|
3837
|
+
O == null ? U.push({ position: H.level ?? 0, values: [H] }) : O.values.push(H);
|
|
3838
|
+
}), U.sort(Ue.firstBy((H) => H.position));
|
|
3839
|
+
}), ur = te(() => Pe.value.filter((U) => U.nav != null && U.itemText != null || U.textFilter != null || U.display != null || U.bool != null));
|
|
3840
|
+
function be(U) {
|
|
3811
3841
|
if (e.itemBladeName != null) {
|
|
3812
3842
|
let j = {
|
|
3813
3843
|
bladeName: e.itemBladeName,
|
|
3814
3844
|
id: "new",
|
|
3815
3845
|
nav: $
|
|
3816
3846
|
};
|
|
3817
|
-
|
|
3847
|
+
U == "page" && g.push({
|
|
3818
3848
|
name: j.bladeName,
|
|
3819
3849
|
params: { id: "new" }
|
|
3820
3850
|
});
|
|
3821
3851
|
}
|
|
3822
3852
|
}
|
|
3823
|
-
function ir(
|
|
3853
|
+
function ir(U) {
|
|
3824
3854
|
const {
|
|
3825
3855
|
additionalUrl: j,
|
|
3826
3856
|
onDeleteAsync: H
|
|
3827
|
-
} = { ...e }, O = K(
|
|
3857
|
+
} = { ...e }, O = K(U), oe = O.id, ve = (De) => {
|
|
3828
3858
|
if (De != null) {
|
|
3829
3859
|
let Se = A.value.findIndex((se) => se.id == De);
|
|
3830
3860
|
if (Se > -1 && A.value.splice(Se, 1), e.items != null) {
|
|
@@ -3846,42 +3876,42 @@ function xa(e, t, l) {
|
|
|
3846
3876
|
onCanDeleteAsync: e.onCanDeleteAsync,
|
|
3847
3877
|
onDeleteAsync: H,
|
|
3848
3878
|
onDeleteSuccessAsync: async () => (ve(oe), e.onDeleteSuccessAsync != null ? e.onDeleteSuccessAsync(O) : Promise.resolve(void 0)),
|
|
3849
|
-
proxyID:
|
|
3879
|
+
proxyID: b.value,
|
|
3850
3880
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3851
3881
|
requireConfirmation: !0
|
|
3852
|
-
}), t && t("deleted",
|
|
3882
|
+
}), t && t("deleted", U);
|
|
3853
3883
|
}
|
|
3854
|
-
function
|
|
3884
|
+
function Ze(U) {
|
|
3855
3885
|
G({
|
|
3856
|
-
data: K(
|
|
3886
|
+
data: K(U),
|
|
3857
3887
|
additionalUrl: e.additionalUrl,
|
|
3858
3888
|
nav: $,
|
|
3859
3889
|
onCanRestoreAsync: e.onCanRestoreAsync,
|
|
3860
3890
|
onRestoreAsync: e.onRestoreAsync,
|
|
3861
3891
|
onRestoreSuccessAsync: e.onRestoreSuccessAsync,
|
|
3862
|
-
proxyID:
|
|
3892
|
+
proxyID: b.value
|
|
3863
3893
|
// ...(useBladeSrc ? bladeData.value : {})
|
|
3864
3894
|
});
|
|
3865
3895
|
}
|
|
3866
3896
|
function Fe() {
|
|
3867
|
-
|
|
3868
|
-
|
|
3897
|
+
Y(() => {
|
|
3898
|
+
S.exportToCSV(Pe.value, J.value);
|
|
3869
3899
|
}, { loadingMsg: "Exporting to CSV" });
|
|
3870
3900
|
}
|
|
3871
3901
|
function Ne() {
|
|
3872
|
-
let
|
|
3873
|
-
if (
|
|
3902
|
+
let U = K(A);
|
|
3903
|
+
if (U = e.onFilter ? e.onFilter(U) : U, _.value != null && _.value.length > 0) {
|
|
3874
3904
|
let j = [...f.value];
|
|
3875
|
-
e.itemText && j.push(e.itemText), Te(j) && (
|
|
3905
|
+
e.itemText && j.push(e.itemText), Te(j) && (U = U.filter((H) => hn(H, _.value, j)));
|
|
3876
3906
|
}
|
|
3877
|
-
J.value =
|
|
3907
|
+
J.value = U;
|
|
3878
3908
|
}
|
|
3879
3909
|
function We() {
|
|
3880
|
-
const
|
|
3881
|
-
e.headers != null && (Q.value = [...e.headers],
|
|
3910
|
+
const U = (l == null ? void 0 : l.hideActions) ?? e.hideActions;
|
|
3911
|
+
e.headers != null && (Q.value = [...e.headers], U || Q.value.push({ title: "Actions", value: "itemActions", align: "end" }));
|
|
3882
3912
|
}
|
|
3883
|
-
async function Ie(
|
|
3884
|
-
if (ce.value = !1, (
|
|
3913
|
+
async function Ie(U) {
|
|
3914
|
+
if (ce.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (Ee.value = e.showSearch ?? !1, _.value = void 0), e.items != null) {
|
|
3885
3915
|
A.value = e.onGetSuccessAsync != null ? await e.onGetSuccessAsync(e.items) : e.items;
|
|
3886
3916
|
return;
|
|
3887
3917
|
}
|
|
@@ -3892,10 +3922,10 @@ function xa(e, t, l) {
|
|
|
3892
3922
|
params: rr.value,
|
|
3893
3923
|
//params,
|
|
3894
3924
|
// params: params.getParamOptions(),
|
|
3895
|
-
proxyID:
|
|
3925
|
+
proxyID: b.value,
|
|
3896
3926
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3897
3927
|
// ...(props.useInterEvents ? eventData : {}),
|
|
3898
|
-
refresh: (
|
|
3928
|
+
refresh: (U == null ? void 0 : U.deepRefresh) ?? !1,
|
|
3899
3929
|
onGetAsync: e.onGetAsync,
|
|
3900
3930
|
onGetSuccessAsync: e.onGetSuccessAsync
|
|
3901
3931
|
};
|
|
@@ -3913,8 +3943,8 @@ function xa(e, t, l) {
|
|
|
3913
3943
|
}
|
|
3914
3944
|
Ne();
|
|
3915
3945
|
}
|
|
3916
|
-
function Je(
|
|
3917
|
-
const H = K(
|
|
3946
|
+
function Je(U, j) {
|
|
3947
|
+
const H = K(U);
|
|
3918
3948
|
if (H != null && H === ee && e.canUnselect ? ee = null : ee = H, t != null && t("select", ee), !(!e.canSelect || e.onCanSelectItem != null && !e.onCanSelectItem(H)))
|
|
3919
3949
|
if (e.onSelectItem != null)
|
|
3920
3950
|
e.onSelectItem(ee);
|
|
@@ -3935,41 +3965,41 @@ function xa(e, t, l) {
|
|
|
3935
3965
|
}
|
|
3936
3966
|
return We(), Xt([_], () => {
|
|
3937
3967
|
Ne();
|
|
3938
|
-
}, { debounce: 500, maxWait: 500 }), _e([
|
|
3968
|
+
}, { debounce: 500, maxWait: 500 }), _e([L, w], async () => {
|
|
3939
3969
|
await Ie();
|
|
3940
|
-
}), _e([X, () => e.errorMsg], ([
|
|
3941
|
-
ce.value =
|
|
3970
|
+
}), _e([X, () => e.errorMsg], ([U, j]) => {
|
|
3971
|
+
ce.value = U != null || j != null;
|
|
3942
3972
|
}), _e(() => e.refreshToggle, () => {
|
|
3943
3973
|
Ie({ deepRefresh: !0 });
|
|
3944
3974
|
}), pr([A, () => e.items], () => {
|
|
3945
3975
|
Ne();
|
|
3946
3976
|
}), Or(async () => {
|
|
3947
|
-
var
|
|
3948
|
-
e.eager == !0 && await Ie({ deepRefresh: ((
|
|
3977
|
+
var U;
|
|
3978
|
+
e.eager == !0 && await Ie({ deepRefresh: ((U = x == null ? void 0 : x.params) == null ? void 0 : U.refresh) == "true" });
|
|
3949
3979
|
}), {
|
|
3950
3980
|
add: be,
|
|
3951
3981
|
asyncItems: A,
|
|
3952
|
-
currentPage:
|
|
3982
|
+
currentPage: w,
|
|
3953
3983
|
deleteItem: ir,
|
|
3954
3984
|
displayHeaders: ur,
|
|
3955
3985
|
errorMsg: X,
|
|
3956
3986
|
exportToCSV: Fe,
|
|
3957
3987
|
filteredItems: J,
|
|
3958
3988
|
filters: y,
|
|
3959
|
-
filtersChanged:
|
|
3989
|
+
filtersChanged: E,
|
|
3960
3990
|
headerOptions: Q,
|
|
3961
3991
|
isDeletable: tr,
|
|
3962
3992
|
isLoading: fe,
|
|
3963
3993
|
isRestorable: nr,
|
|
3964
3994
|
loadingMsg: ne,
|
|
3965
3995
|
refresh: Ie,
|
|
3966
|
-
restoreItem:
|
|
3996
|
+
restoreItem: Ze,
|
|
3967
3997
|
searchString: _,
|
|
3968
3998
|
selectedFilters: I,
|
|
3969
3999
|
selectItem: Je,
|
|
3970
4000
|
// serverFilters,
|
|
3971
4001
|
showError: ce,
|
|
3972
|
-
showInactive:
|
|
4002
|
+
showInactive: L,
|
|
3973
4003
|
showSearch: Ee,
|
|
3974
4004
|
subtitleOptions: ar,
|
|
3975
4005
|
tableHeaders: Pe,
|
|
@@ -3980,7 +4010,7 @@ function xa(e, t, l) {
|
|
|
3980
4010
|
}
|
|
3981
4011
|
let Ge;
|
|
3982
4012
|
function kn(e) {
|
|
3983
|
-
const t =
|
|
4013
|
+
const t = z((e == null ? void 0 : e.default) ?? "Admin"), l = z((e == null ? void 0 : e.groups) ?? []);
|
|
3984
4014
|
return Ge = {
|
|
3985
4015
|
currentGroup: t,
|
|
3986
4016
|
groupOptions: l,
|
|
@@ -3989,14 +4019,14 @@ function kn(e) {
|
|
|
3989
4019
|
}
|
|
3990
4020
|
function _a() {
|
|
3991
4021
|
const e = Mr(), t = ct(), l = Dn();
|
|
3992
|
-
let
|
|
4022
|
+
let S = e.getRoutes();
|
|
3993
4023
|
return {
|
|
3994
4024
|
...Ge,
|
|
3995
4025
|
sidebarNavItems: te(() => {
|
|
3996
4026
|
var g;
|
|
3997
|
-
|
|
4027
|
+
S = S.filter((x) => x.meta != null && x.meta.menuGroup != null);
|
|
3998
4028
|
const s = [];
|
|
3999
|
-
return
|
|
4029
|
+
return S.forEach((x) => {
|
|
4000
4030
|
var d;
|
|
4001
4031
|
const P = Ge.groupOptions.value.find((h) => h.displayName == x.meta.menuGroup), T = t.findItem(x.meta.nav), N = x.meta;
|
|
4002
4032
|
let $ = s.find((h) => h.displayName == N.menuGroup);
|
|
@@ -4016,7 +4046,7 @@ function _a() {
|
|
|
4016
4046
|
});
|
|
4017
4047
|
}), s.forEach((x) => {
|
|
4018
4048
|
var P;
|
|
4019
|
-
x.items = (P = x.items) == null ? void 0 : P.filter((T) => !T.requiresAuth || l.doShow(T.subscriptions, T.permissions, "view")).sort(
|
|
4049
|
+
x.items = (P = x.items) == null ? void 0 : P.filter((T) => !T.requiresAuth || l.doShow(T.subscriptions, T.permissions, "view")).sort(Ue.firstBy((T) => T.displayName));
|
|
4020
4050
|
}), Ge.currentGroup.value != null ? ((g = s.find((x) => x.displayName == Ge.currentGroup.value)) == null ? void 0 : g.items) ?? [] : s.filter((x) => !x.requiresAuth || l.doShow(x.subscriptions, x.permissions, "view"));
|
|
4021
4051
|
})
|
|
4022
4052
|
};
|
|
@@ -4029,15 +4059,15 @@ function Gn(e) {
|
|
|
4029
4059
|
function t(l) {
|
|
4030
4060
|
if (!l)
|
|
4031
4061
|
return {};
|
|
4032
|
-
let
|
|
4033
|
-
return e.presets[
|
|
4062
|
+
let S = l;
|
|
4063
|
+
return e.presets[S] ?? {};
|
|
4034
4064
|
}
|
|
4035
4065
|
return Pr = {
|
|
4036
4066
|
usePresets: t
|
|
4037
4067
|
}, Pr;
|
|
4038
4068
|
}
|
|
4039
4069
|
let Jr, jr, Kr, Qr = !1;
|
|
4040
|
-
const wr =
|
|
4070
|
+
const wr = z(!1), br = z(!1), Xr = z(), pe = z();
|
|
4041
4071
|
let Nr;
|
|
4042
4072
|
function Ca() {
|
|
4043
4073
|
return Nr;
|
|
@@ -4053,7 +4083,7 @@ function Wn() {
|
|
|
4053
4083
|
var x;
|
|
4054
4084
|
(x = Xr.value) == null || x.prompt(), wr.value = !1;
|
|
4055
4085
|
}
|
|
4056
|
-
function
|
|
4086
|
+
function S() {
|
|
4057
4087
|
return !!window.matchMedia("(display-mode: standalone)").matches;
|
|
4058
4088
|
}
|
|
4059
4089
|
function s(x) {
|
|
@@ -4068,7 +4098,7 @@ function Wn() {
|
|
|
4068
4098
|
canInstallApp: wr,
|
|
4069
4099
|
canUpdateApp: br,
|
|
4070
4100
|
installApp: l,
|
|
4071
|
-
isInstalled:
|
|
4101
|
+
isInstalled: S,
|
|
4072
4102
|
updateApp: g
|
|
4073
4103
|
}, Nr;
|
|
4074
4104
|
}
|
|
@@ -4081,8 +4111,8 @@ function Na(e) {
|
|
|
4081
4111
|
install(t, l) {
|
|
4082
4112
|
var T;
|
|
4083
4113
|
console.log(t), e.vuetifyInstance ?? (e.vuetifyInstance = l.vuetifyInstance), Nn(e);
|
|
4084
|
-
const
|
|
4085
|
-
Gn(e), (T = e.auth).demo ?? (T.demo =
|
|
4114
|
+
const S = Rn(), s = Fn(e);
|
|
4115
|
+
Gn(e), (T = e.auth).demo ?? (T.demo = S), e.auth.getAuthItem = s.findItem;
|
|
4086
4116
|
const g = xn(e.auth);
|
|
4087
4117
|
kn(e.menu);
|
|
4088
4118
|
const x = In({
|
|
@@ -4092,7 +4122,7 @@ function Na(e) {
|
|
|
4092
4122
|
}), P = Ln({
|
|
4093
4123
|
getTimeZone: () => g.timeZone.value
|
|
4094
4124
|
});
|
|
4095
|
-
|
|
4125
|
+
Bn({
|
|
4096
4126
|
dates: P
|
|
4097
4127
|
}), Wn(), bn({
|
|
4098
4128
|
api: x,
|
|
@@ -4105,7 +4135,7 @@ function Na(e) {
|
|
|
4105
4135
|
export {
|
|
4106
4136
|
oa as DataURIToBlob,
|
|
4107
4137
|
la as addWeekday,
|
|
4108
|
-
|
|
4138
|
+
Be as appendUrl,
|
|
4109
4139
|
an as capitalizeWords,
|
|
4110
4140
|
pn as checkImage,
|
|
4111
4141
|
sn as containsSearch,
|
|
@@ -4118,7 +4148,7 @@ export {
|
|
|
4118
4148
|
Nn as createCosmetics,
|
|
4119
4149
|
Ln as createDates,
|
|
4120
4150
|
Rn as createDemo,
|
|
4121
|
-
|
|
4151
|
+
Bn as createFilters,
|
|
4122
4152
|
kn as createMenu,
|
|
4123
4153
|
Fn as createNavigation,
|
|
4124
4154
|
Wn as createPWA,
|
|
@@ -4187,7 +4217,7 @@ export {
|
|
|
4187
4217
|
$n as useTracker,
|
|
4188
4218
|
ma as useUrls,
|
|
4189
4219
|
mn as validEmail,
|
|
4190
|
-
|
|
4220
|
+
Ye as weekdayPairs,
|
|
4191
4221
|
na as weekdayShortName,
|
|
4192
4222
|
ta as weekdayValue
|
|
4193
4223
|
};
|