bt-core-app 1.4.110 → 1.4.112
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 +938 -948
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as z, shallowRef as
|
|
2
|
-
import { watchArray as Or, useStorage as
|
|
1
|
+
import { ref as z, shallowRef as Me, computed as ee, toValue as J, watch as Te, toRef as Zt, onMounted as Xr } from "vue";
|
|
2
|
+
import { watchArray as Or, useStorage as Yt, useEventListener as me, toValue as Ee, useParentElement as Jt, useResizeObserver as jt, useArrayUnique as Kt, useArrayDifference as Gr, watchDebounced as Qt, tryOnMounted as Xt } from "@vueuse/core";
|
|
3
3
|
import { defineStore as pr } from "pinia";
|
|
4
4
|
import { DateTime as he } from "luxon";
|
|
5
|
-
import { useRouter as
|
|
5
|
+
import { useRouter as Nr, useRoute as et } from "vue-router";
|
|
6
6
|
function Ot(e) {
|
|
7
7
|
return (e || "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").replace(/[xy]/g, pt);
|
|
8
8
|
}
|
|
@@ -11,11 +11,11 @@ function pt(e) {
|
|
|
11
11
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
12
12
|
}
|
|
13
13
|
function en(e) {
|
|
14
|
-
const t = z([]), l =
|
|
14
|
+
const t = z([]), l = Me(), S = Me(), s = Me(), g = ee(() => l.value != null);
|
|
15
15
|
function I(d) {
|
|
16
16
|
t.value = t.value.filter((h) => h.id != d);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function P(d) {
|
|
19
19
|
const h = {
|
|
20
20
|
id: Ot(),
|
|
21
21
|
msg: d ?? "Loading"
|
|
@@ -23,18 +23,18 @@ function en(e) {
|
|
|
23
23
|
return t.value.push(h), h.id;
|
|
24
24
|
}
|
|
25
25
|
function _(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 };
|
|
33
33
|
u.completionMsg ?? (u.completionMsg = e == null ? void 0 : e.completionMsg), u.confirmationMsg ?? (u.confirmationMsg = e == null ? void 0 : e.confirmationMsg), u.errorMsg ?? (u.errorMsg = e == null ? void 0 : e.errorMsg), u.loadingMsg ?? (u.loadingMsg = (e == null ? void 0 : e.loadingMsg) ?? "Loading"), u.requireConfirmation ?? (u.requireConfirmation = e == null ? void 0 : e.requireConfirmation);
|
|
34
|
-
const r =
|
|
35
|
-
let
|
|
34
|
+
const r = P(u.loadingMsg);
|
|
35
|
+
let w = null;
|
|
36
36
|
try {
|
|
37
|
-
return u.requireConfirmation || u.confirmationMsg,
|
|
37
|
+
return u.requireConfirmation || u.confirmationMsg, w = await d(), u.completionMsg != null && (s.value = u.completionMsg), w;
|
|
38
38
|
} catch (D) {
|
|
39
39
|
if ((e == null ? void 0 : e.onError) != null)
|
|
40
40
|
e.onError(D);
|
|
@@ -50,7 +50,7 @@ function en(e) {
|
|
|
50
50
|
return Or(t, (d) => {
|
|
51
51
|
l.value = d.length > 0 ? d[0].msg : void 0;
|
|
52
52
|
}, { deep: !0 }), {
|
|
53
|
-
actionErrorMsg:
|
|
53
|
+
actionErrorMsg: S,
|
|
54
54
|
actionLoadingMsg: l,
|
|
55
55
|
actionCompleteMsg: s,
|
|
56
56
|
clearErrors: N,
|
|
@@ -78,11 +78,11 @@ var Re = function() {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
if (s.length === 1) {
|
|
81
|
-
var
|
|
81
|
+
var P = s, _ = g.ignoreCase ? t : e, N = g.cmp || function(d, h) {
|
|
82
82
|
return d < h ? -1 : d > h ? 1 : 0;
|
|
83
83
|
};
|
|
84
84
|
s = function(d, h) {
|
|
85
|
-
return N(_(
|
|
85
|
+
return N(_(P(d)), _(P(h)));
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
const $ = { "-1": "", desc: "" };
|
|
@@ -90,27 +90,27 @@ var Re = function() {
|
|
|
90
90
|
return -s(d, h);
|
|
91
91
|
} : s;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
var I = typeof this == "function" && !this.firstBy ? this : !1,
|
|
95
|
-
return I(N, $) ||
|
|
96
|
-
} :
|
|
97
|
-
return _.thenBy =
|
|
93
|
+
function S(s, g) {
|
|
94
|
+
var I = typeof this == "function" && !this.firstBy ? this : !1, P = l(s, g), _ = I ? function(N, $) {
|
|
95
|
+
return I(N, $) || P(N, $);
|
|
96
|
+
} : P;
|
|
97
|
+
return _.thenBy = S, _;
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return S.firstBy = S, S;
|
|
100
100
|
}();
|
|
101
101
|
function Ue(e, t) {
|
|
102
|
-
let l = e ?? "",
|
|
102
|
+
let l = e ?? "", S = t ?? "";
|
|
103
103
|
if (l.endsWith("/"))
|
|
104
104
|
do
|
|
105
105
|
l = l.slice(0, l.length - 1);
|
|
106
106
|
while (l.endsWith("/"));
|
|
107
|
-
if (
|
|
107
|
+
if (S.startsWith("/"))
|
|
108
108
|
do
|
|
109
|
-
|
|
110
|
-
while (
|
|
111
|
-
return `${l}/${
|
|
109
|
+
S = S.slice(1, S.length);
|
|
110
|
+
while (S.startsWith("/"));
|
|
111
|
+
return `${l}/${S}`;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function Yn(e) {
|
|
114
114
|
return e == null || !Array.isArray(e) ? e : [...new Set(e.map((t) => t))];
|
|
115
115
|
}
|
|
116
116
|
function Jn(e = "blitzItExtensionExists") {
|
|
@@ -159,13 +159,13 @@ function rt(e, t = !1) {
|
|
|
159
159
|
}
|
|
160
160
|
function On(e, t, l) {
|
|
161
161
|
if (e) {
|
|
162
|
-
var
|
|
163
|
-
|
|
162
|
+
var S = new Image();
|
|
163
|
+
S.onload = t, S.onerror = l, S.src = e;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
async function pn(e, t = !0) {
|
|
167
|
-
return new Promise((l,
|
|
168
|
-
e == null &&
|
|
167
|
+
return new Promise((l, S) => {
|
|
168
|
+
e == null && S("no url given");
|
|
169
169
|
var s = new Image();
|
|
170
170
|
s.setAttribute("crossOrigin", "anonymous"), s.onload = function() {
|
|
171
171
|
var g = document.createElement("canvas");
|
|
@@ -173,7 +173,7 @@ async function pn(e, t = !0) {
|
|
|
173
173
|
var I = g.getContext("2d");
|
|
174
174
|
I == null || I.drawImage(this, 0, 0), l(g.toDataURL("image/png"));
|
|
175
175
|
}, s.onerror = function() {
|
|
176
|
-
console.log("errr"), t ?
|
|
176
|
+
console.log("errr"), t ? S("image could not be loaded for some reason") : l(null);
|
|
177
177
|
}, e != null && (s.src = e);
|
|
178
178
|
});
|
|
179
179
|
}
|
|
@@ -189,7 +189,7 @@ function ea(e) {
|
|
|
189
189
|
function nn(e) {
|
|
190
190
|
return e == null ? e : e.replace(/\w\S*/g, (t) => t.replace(/^\w/, (l) => l.toUpperCase()));
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const Ye = [
|
|
193
193
|
{ value: 1, short: "sun", values: ["sun", "sunday"] },
|
|
194
194
|
{ value: 2, short: "mon", values: ["mon", "monday"] },
|
|
195
195
|
{ value: 3, short: "tue", values: ["tue", "tues", "tuesday"] },
|
|
@@ -202,19 +202,19 @@ const Ze = [
|
|
|
202
202
|
function ra(e) {
|
|
203
203
|
if (e == null)
|
|
204
204
|
return 0;
|
|
205
|
-
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);
|
|
206
206
|
return l.length == 0 ? 8 : Math.min(...l);
|
|
207
207
|
}
|
|
208
208
|
function ta(e) {
|
|
209
209
|
return e == null ? e : e.toLowerCase().replaceAll(" ", "").split(",").map((t) => {
|
|
210
|
-
let l =
|
|
210
|
+
let l = Ye.find((S) => S.values.some((s) => s == t));
|
|
211
211
|
return l != null ? l.short : "";
|
|
212
212
|
}).filter((t) => t != null && t.length > 0).toString();
|
|
213
213
|
}
|
|
214
214
|
function na(e, t) {
|
|
215
215
|
if (e == null || t == null)
|
|
216
216
|
return !0;
|
|
217
|
-
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((I) => I == S));
|
|
218
218
|
return s != null && l.some((g) => g == s.short || s.values.some((I) => I == g));
|
|
219
219
|
}
|
|
220
220
|
function aa(e, t) {
|
|
@@ -222,13 +222,13 @@ function aa(e, t) {
|
|
|
222
222
|
return e;
|
|
223
223
|
let l = e ?? "";
|
|
224
224
|
l = `${l},${t}`;
|
|
225
|
-
let
|
|
226
|
-
return
|
|
225
|
+
let S = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((s) => Ye.find((g) => g.values.some((I) => I == s))).filter((s) => s != null).sort(Re.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;
|
|
227
227
|
}
|
|
228
228
|
function la(e, t) {
|
|
229
229
|
if (t == null || e == null)
|
|
230
230
|
return e;
|
|
231
|
-
let l = e ?? "",
|
|
231
|
+
let l = e ?? "", S = t.replaceAll(" ", "").toLowerCase(), s = [...new Set(l.replaceAll(" ", "").toLowerCase().split(",").map((g) => Ye.find((I) => I.values.some((P) => P == g && P != S))).filter((g) => g != null).sort(Re.firstBy((g) => (g == null ? void 0 : g.value) ?? 0)).map((g) => g == null ? void 0 : g.short))].toString();
|
|
232
232
|
return s.length > 0 ? s : void 0;
|
|
233
233
|
}
|
|
234
234
|
function ua(e, t) {
|
|
@@ -247,38 +247,38 @@ function ln() {
|
|
|
247
247
|
return "0001-01-01T00:00:00Z";
|
|
248
248
|
}
|
|
249
249
|
function ca(e, t) {
|
|
250
|
-
let l = "1",
|
|
251
|
-
if (
|
|
250
|
+
let l = "1", S = 0;
|
|
251
|
+
if (S < t)
|
|
252
252
|
do
|
|
253
|
-
l = l + "0",
|
|
254
|
-
while (
|
|
253
|
+
l = l + "0", S += 1;
|
|
254
|
+
while (S < t);
|
|
255
255
|
let s = Number.parseInt(l);
|
|
256
256
|
return Math.round(e * s) / s;
|
|
257
257
|
}
|
|
258
258
|
function fa(e, t) {
|
|
259
259
|
let l = e ?? "";
|
|
260
|
-
return t != null && (un(l, t) ? l = l.split(",").filter((
|
|
260
|
+
return t != null && (un(l, t) ? l = l.split(",").filter((S) => S != t).toString() : l != null ? l = `${l},${t}` : l = t), l != null && l.length > 0 ? l : null;
|
|
261
261
|
}
|
|
262
262
|
function un(e, t) {
|
|
263
263
|
if (e == null || e.length == 0)
|
|
264
264
|
return !1;
|
|
265
265
|
if (!t)
|
|
266
266
|
return !0;
|
|
267
|
-
var l = e.split(","),
|
|
268
|
-
return l.some((s) =>
|
|
267
|
+
var l = e.split(","), S = t.split(",");
|
|
268
|
+
return l.some((s) => S.some((g) => g == s));
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Mr(e) {
|
|
271
271
|
if (!e)
|
|
272
272
|
return e;
|
|
273
273
|
let t, l = Array.isArray(e) ? [] : {};
|
|
274
|
-
for (const
|
|
275
|
-
t = e[
|
|
274
|
+
for (const S in e)
|
|
275
|
+
t = e[S], l[S] = typeof t == "object" ? Mr(t) : t;
|
|
276
276
|
return l;
|
|
277
277
|
}
|
|
278
278
|
function cn(e) {
|
|
279
279
|
return e && Object.keys(e).sort().reduce(function(t, l) {
|
|
280
|
-
let
|
|
281
|
-
return t[l] = typeof
|
|
280
|
+
let S = e[l];
|
|
281
|
+
return t[l] = typeof S == "object" && S !== null ? cn(S) : S, t;
|
|
282
282
|
}, Array.isArray(e) ? [] : {});
|
|
283
283
|
}
|
|
284
284
|
function fn(e, t) {
|
|
@@ -288,17 +288,17 @@ function tt(e, t = (l) => l) {
|
|
|
288
288
|
if (e == null)
|
|
289
289
|
return [];
|
|
290
290
|
const l = Array.isArray(e) ? e : t(e);
|
|
291
|
-
return _e(l) ? [...l.reduce((
|
|
292
|
-
|
|
291
|
+
return _e(l) ? [...l.reduce((S, s) => {
|
|
292
|
+
S.push(s);
|
|
293
293
|
const g = tt(s, t);
|
|
294
|
-
return _e(g) &&
|
|
294
|
+
return _e(g) && S.push(...g), S;
|
|
295
295
|
}, [])] : [];
|
|
296
296
|
}
|
|
297
297
|
function sa(e) {
|
|
298
|
-
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);
|
|
299
299
|
for (let g = 0; g < l.length; g++)
|
|
300
300
|
s[g] = l.charCodeAt(g);
|
|
301
|
-
return new Blob([s], { type:
|
|
301
|
+
return new Blob([s], { type: S });
|
|
302
302
|
}
|
|
303
303
|
function sn(e) {
|
|
304
304
|
var t = "";
|
|
@@ -324,8 +324,8 @@ function dn(e, t, l) {
|
|
|
324
324
|
return !1;
|
|
325
325
|
for (let s = 0; s < l.length; s++) {
|
|
326
326
|
const g = l[s];
|
|
327
|
-
var
|
|
328
|
-
if (
|
|
327
|
+
var S = Sr(e, g);
|
|
328
|
+
if (S != null && typeof S == "string" && fn(S, t))
|
|
329
329
|
return !0;
|
|
330
330
|
}
|
|
331
331
|
return !1;
|
|
@@ -342,8 +342,8 @@ function Sr(e, t) {
|
|
|
342
342
|
if (e == null || e == null || !t)
|
|
343
343
|
return null;
|
|
344
344
|
var l = t.split(".");
|
|
345
|
-
let
|
|
346
|
-
for (var s = e, g = 0; g <
|
|
345
|
+
let S = l.length;
|
|
346
|
+
for (var s = e, g = 0; g < S; g++)
|
|
347
347
|
if (s = s[l[g]], s == null)
|
|
348
348
|
return null;
|
|
349
349
|
return s;
|
|
@@ -368,51 +368,51 @@ var nt = { exports: {} };
|
|
|
368
368
|
(function(l) {
|
|
369
369
|
e.exports = l();
|
|
370
370
|
})(function() {
|
|
371
|
-
return function l(
|
|
371
|
+
return function l(S, s, g) {
|
|
372
372
|
function I(N, $) {
|
|
373
373
|
if (!s[N]) {
|
|
374
|
-
if (!
|
|
374
|
+
if (!S[N]) {
|
|
375
375
|
var d = typeof Oe == "function" && Oe;
|
|
376
376
|
if (!$ && d)
|
|
377
377
|
return d(N, !0);
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
378
|
+
if (P)
|
|
379
|
+
return P(N, !0);
|
|
380
380
|
var h = new Error("Cannot find module '" + N + "'");
|
|
381
381
|
throw h.code = "MODULE_NOT_FOUND", h;
|
|
382
382
|
}
|
|
383
383
|
var u = s[N] = { exports: {} };
|
|
384
|
-
|
|
385
|
-
var
|
|
386
|
-
return I(
|
|
387
|
-
}, u, u.exports, l,
|
|
384
|
+
S[N][0].call(u.exports, function(r) {
|
|
385
|
+
var w = S[N][1][r];
|
|
386
|
+
return I(w || r);
|
|
387
|
+
}, u, u.exports, l, S, s, g);
|
|
388
388
|
}
|
|
389
389
|
return s[N].exports;
|
|
390
390
|
}
|
|
391
|
-
for (var
|
|
391
|
+
for (var P = typeof Oe == "function" && Oe, _ = 0; _ < g.length; _++)
|
|
392
392
|
I(g[_]);
|
|
393
393
|
return I;
|
|
394
|
-
}({ 1: [function(l,
|
|
394
|
+
}({ 1: [function(l, S, s) {
|
|
395
395
|
(function(g) {
|
|
396
|
-
var I = g.MutationObserver || g.WebKitMutationObserver,
|
|
396
|
+
var I = g.MutationObserver || g.WebKitMutationObserver, P;
|
|
397
397
|
if (I) {
|
|
398
398
|
var _ = 0, N = new I(r), $ = g.document.createTextNode("");
|
|
399
399
|
N.observe($, {
|
|
400
400
|
characterData: !0
|
|
401
|
-
}),
|
|
401
|
+
}), P = function() {
|
|
402
402
|
$.data = _ = ++_ % 2;
|
|
403
403
|
};
|
|
404
404
|
} else if (!g.setImmediate && typeof g.MessageChannel < "u") {
|
|
405
405
|
var d = new g.MessageChannel();
|
|
406
|
-
d.port1.onmessage = r,
|
|
406
|
+
d.port1.onmessage = r, P = function() {
|
|
407
407
|
d.port2.postMessage(0);
|
|
408
408
|
};
|
|
409
409
|
} else
|
|
410
|
-
"document" in g && "onreadystatechange" in g.document.createElement("script") ?
|
|
410
|
+
"document" in g && "onreadystatechange" in g.document.createElement("script") ? P = function() {
|
|
411
411
|
var D = g.document.createElement("script");
|
|
412
412
|
D.onreadystatechange = function() {
|
|
413
413
|
r(), D.onreadystatechange = null, D.parentNode.removeChild(D), D = null;
|
|
414
414
|
}, g.document.documentElement.appendChild(D);
|
|
415
|
-
} :
|
|
415
|
+
} : P = function() {
|
|
416
416
|
setTimeout(r, 0);
|
|
417
417
|
};
|
|
418
418
|
var h, u = [];
|
|
@@ -425,160 +425,160 @@ var nt = { exports: {} };
|
|
|
425
425
|
}
|
|
426
426
|
h = !1;
|
|
427
427
|
}
|
|
428
|
-
|
|
429
|
-
function
|
|
430
|
-
u.push(D) === 1 && !h &&
|
|
428
|
+
S.exports = w;
|
|
429
|
+
function w(D) {
|
|
430
|
+
u.push(D) === 1 && !h && P();
|
|
431
431
|
}
|
|
432
432
|
}).call(this, typeof Xe < "u" ? Xe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
433
|
-
}, {}], 2: [function(l,
|
|
433
|
+
}, {}], 2: [function(l, S, s) {
|
|
434
434
|
var g = l(1);
|
|
435
435
|
function I() {
|
|
436
436
|
}
|
|
437
|
-
var
|
|
438
|
-
|
|
439
|
-
function d(
|
|
440
|
-
if (typeof
|
|
437
|
+
var P = {}, _ = ["REJECTED"], N = ["FULFILLED"], $ = ["PENDING"];
|
|
438
|
+
S.exports = d;
|
|
439
|
+
function d(A) {
|
|
440
|
+
if (typeof A != "function")
|
|
441
441
|
throw new TypeError("resolver must be a function");
|
|
442
|
-
this.state = $, this.queue = [], this.outcome = void 0,
|
|
442
|
+
this.state = $, this.queue = [], this.outcome = void 0, A !== I && w(this, A);
|
|
443
443
|
}
|
|
444
|
-
d.prototype.catch = function(
|
|
445
|
-
return this.then(null,
|
|
446
|
-
}, d.prototype.then = function(
|
|
447
|
-
if (typeof
|
|
444
|
+
d.prototype.catch = function(A) {
|
|
445
|
+
return this.then(null, A);
|
|
446
|
+
}, d.prototype.then = function(A, T) {
|
|
447
|
+
if (typeof A != "function" && this.state === N || typeof T != "function" && this.state === _)
|
|
448
448
|
return this;
|
|
449
449
|
var x = new this.constructor(I);
|
|
450
450
|
if (this.state !== $) {
|
|
451
|
-
var
|
|
452
|
-
u(x,
|
|
451
|
+
var C = this.state === N ? A : T;
|
|
452
|
+
u(x, C, this.outcome);
|
|
453
453
|
} else
|
|
454
|
-
this.queue.push(new h(x,
|
|
454
|
+
this.queue.push(new h(x, A, T));
|
|
455
455
|
return x;
|
|
456
456
|
};
|
|
457
|
-
function h(
|
|
458
|
-
this.promise =
|
|
457
|
+
function h(A, T, x) {
|
|
458
|
+
this.promise = A, typeof T == "function" && (this.onFulfilled = T, this.callFulfilled = this.otherCallFulfilled), typeof x == "function" && (this.onRejected = x, this.callRejected = this.otherCallRejected);
|
|
459
459
|
}
|
|
460
|
-
h.prototype.callFulfilled = function(
|
|
461
|
-
|
|
462
|
-
}, h.prototype.otherCallFulfilled = function(
|
|
463
|
-
u(this.promise, this.onFulfilled,
|
|
464
|
-
}, h.prototype.callRejected = function(
|
|
465
|
-
|
|
466
|
-
}, h.prototype.otherCallRejected = function(
|
|
467
|
-
u(this.promise, this.onRejected,
|
|
460
|
+
h.prototype.callFulfilled = function(A) {
|
|
461
|
+
P.resolve(this.promise, A);
|
|
462
|
+
}, h.prototype.otherCallFulfilled = function(A) {
|
|
463
|
+
u(this.promise, this.onFulfilled, A);
|
|
464
|
+
}, h.prototype.callRejected = function(A) {
|
|
465
|
+
P.reject(this.promise, A);
|
|
466
|
+
}, h.prototype.otherCallRejected = function(A) {
|
|
467
|
+
u(this.promise, this.onRejected, A);
|
|
468
468
|
};
|
|
469
|
-
function u(
|
|
469
|
+
function u(A, T, x) {
|
|
470
470
|
g(function() {
|
|
471
|
-
var
|
|
471
|
+
var C;
|
|
472
472
|
try {
|
|
473
|
-
|
|
473
|
+
C = T(x);
|
|
474
474
|
} catch (f) {
|
|
475
|
-
return
|
|
475
|
+
return P.reject(A, f);
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
C === A ? P.reject(A, new TypeError("Cannot resolve promise with itself")) : P.resolve(A, C);
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
P.resolve = function(A, T) {
|
|
481
481
|
var x = D(r, T);
|
|
482
482
|
if (x.status === "error")
|
|
483
|
-
return
|
|
484
|
-
var
|
|
485
|
-
if (
|
|
486
|
-
|
|
483
|
+
return P.reject(A, x.value);
|
|
484
|
+
var C = x.value;
|
|
485
|
+
if (C)
|
|
486
|
+
w(A, C);
|
|
487
487
|
else {
|
|
488
|
-
|
|
489
|
-
for (var f = -1,
|
|
490
|
-
|
|
488
|
+
A.state = N, A.outcome = T;
|
|
489
|
+
for (var f = -1, E = A.queue.length; ++f < E; )
|
|
490
|
+
A.queue[f].callFulfilled(T);
|
|
491
491
|
}
|
|
492
|
-
return
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
for (var x = -1,
|
|
496
|
-
|
|
497
|
-
return
|
|
492
|
+
return A;
|
|
493
|
+
}, P.reject = function(A, T) {
|
|
494
|
+
A.state = _, A.outcome = T;
|
|
495
|
+
for (var x = -1, C = A.queue.length; ++x < C; )
|
|
496
|
+
A.queue[x].callRejected(T);
|
|
497
|
+
return A;
|
|
498
498
|
};
|
|
499
|
-
function r(
|
|
500
|
-
var T =
|
|
501
|
-
if (
|
|
499
|
+
function r(A) {
|
|
500
|
+
var T = A && A.then;
|
|
501
|
+
if (A && (typeof A == "object" || typeof A == "function") && typeof T == "function")
|
|
502
502
|
return function() {
|
|
503
|
-
T.apply(
|
|
503
|
+
T.apply(A, arguments);
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function w(A, T) {
|
|
507
507
|
var x = !1;
|
|
508
|
-
function
|
|
509
|
-
x || (x = !0,
|
|
508
|
+
function C(X) {
|
|
509
|
+
x || (x = !0, P.reject(A, X));
|
|
510
510
|
}
|
|
511
511
|
function f(X) {
|
|
512
|
-
x || (x = !0,
|
|
512
|
+
x || (x = !0, P.resolve(A, X));
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
T(f,
|
|
514
|
+
function E() {
|
|
515
|
+
T(f, C);
|
|
516
516
|
}
|
|
517
|
-
var
|
|
518
|
-
|
|
517
|
+
var K = D(E);
|
|
518
|
+
K.status === "error" && C(K.value);
|
|
519
519
|
}
|
|
520
|
-
function D(
|
|
520
|
+
function D(A, T) {
|
|
521
521
|
var x = {};
|
|
522
522
|
try {
|
|
523
|
-
x.value =
|
|
524
|
-
} catch (
|
|
525
|
-
x.status = "error", x.value =
|
|
523
|
+
x.value = A(T), x.status = "success";
|
|
524
|
+
} catch (C) {
|
|
525
|
+
x.status = "error", x.value = C;
|
|
526
526
|
}
|
|
527
527
|
return x;
|
|
528
528
|
}
|
|
529
529
|
d.resolve = c;
|
|
530
|
-
function c(
|
|
531
|
-
return
|
|
530
|
+
function c(A) {
|
|
531
|
+
return A instanceof this ? A : P.resolve(new this(I), A);
|
|
532
532
|
}
|
|
533
533
|
d.reject = y;
|
|
534
|
-
function y(
|
|
534
|
+
function y(A) {
|
|
535
535
|
var T = new this(I);
|
|
536
|
-
return
|
|
536
|
+
return P.reject(T, A);
|
|
537
537
|
}
|
|
538
|
-
d.all =
|
|
539
|
-
function
|
|
538
|
+
d.all = b;
|
|
539
|
+
function b(A) {
|
|
540
540
|
var T = this;
|
|
541
|
-
if (Object.prototype.toString.call(
|
|
541
|
+
if (Object.prototype.toString.call(A) !== "[object Array]")
|
|
542
542
|
return this.reject(new TypeError("must be an array"));
|
|
543
|
-
var x =
|
|
543
|
+
var x = A.length, C = !1;
|
|
544
544
|
if (!x)
|
|
545
545
|
return this.resolve([]);
|
|
546
|
-
for (var f = new Array(x),
|
|
547
|
-
re(
|
|
546
|
+
for (var f = new Array(x), E = 0, K = -1, X = new this(I); ++K < x; )
|
|
547
|
+
re(A[K], K);
|
|
548
548
|
return X;
|
|
549
549
|
function re(ue, be) {
|
|
550
|
-
T.resolve(ue).then(G, function(
|
|
551
|
-
|
|
550
|
+
T.resolve(ue).then(G, function(Z) {
|
|
551
|
+
C || (C = !0, P.reject(X, Z));
|
|
552
552
|
});
|
|
553
|
-
function G(
|
|
554
|
-
f[be] =
|
|
553
|
+
function G(Z) {
|
|
554
|
+
f[be] = Z, ++E === x && !C && (C = !0, P.resolve(X, f));
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
d.race =
|
|
559
|
-
function
|
|
558
|
+
d.race = M;
|
|
559
|
+
function M(A) {
|
|
560
560
|
var T = this;
|
|
561
|
-
if (Object.prototype.toString.call(
|
|
561
|
+
if (Object.prototype.toString.call(A) !== "[object Array]")
|
|
562
562
|
return this.reject(new TypeError("must be an array"));
|
|
563
|
-
var x =
|
|
563
|
+
var x = A.length, C = !1;
|
|
564
564
|
if (!x)
|
|
565
565
|
return this.resolve([]);
|
|
566
|
-
for (var f = -1,
|
|
567
|
-
|
|
568
|
-
return
|
|
569
|
-
function
|
|
566
|
+
for (var f = -1, E = new this(I); ++f < x; )
|
|
567
|
+
K(A[f]);
|
|
568
|
+
return E;
|
|
569
|
+
function K(X) {
|
|
570
570
|
T.resolve(X).then(function(re) {
|
|
571
|
-
|
|
571
|
+
C || (C = !0, P.resolve(E, re));
|
|
572
572
|
}, function(re) {
|
|
573
|
-
|
|
573
|
+
C || (C = !0, P.reject(E, re));
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
}, { 1: 1 }], 3: [function(l,
|
|
577
|
+
}, { 1: 1 }], 3: [function(l, S, s) {
|
|
578
578
|
(function(g) {
|
|
579
579
|
typeof g.Promise != "function" && (g.Promise = l(2));
|
|
580
580
|
}).call(this, typeof Xe < "u" ? Xe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
581
|
-
}, { 2: 2 }], 4: [function(l,
|
|
581
|
+
}, { 2: 2 }], 4: [function(l, S, s) {
|
|
582
582
|
var g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
583
583
|
return typeof n;
|
|
584
584
|
} : function(n) {
|
|
@@ -588,7 +588,7 @@ var nt = { exports: {} };
|
|
|
588
588
|
if (!(n instanceof i))
|
|
589
589
|
throw new TypeError("Cannot call a class as a function");
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function P() {
|
|
592
592
|
try {
|
|
593
593
|
if (typeof indexedDB < "u")
|
|
594
594
|
return indexedDB;
|
|
@@ -604,7 +604,7 @@ var nt = { exports: {} };
|
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
var _ =
|
|
607
|
+
var _ = P();
|
|
608
608
|
function N() {
|
|
609
609
|
try {
|
|
610
610
|
if (!_ || !_.open)
|
|
@@ -646,11 +646,11 @@ var nt = { exports: {} };
|
|
|
646
646
|
function r(n) {
|
|
647
647
|
return typeof n != "string" && (console.warn(n + " used as a key, but it is not a string."), n = String(n)), n;
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function w() {
|
|
650
650
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
651
651
|
return arguments[arguments.length - 1];
|
|
652
652
|
}
|
|
653
|
-
var D = "local-forage-detect-blob-support", c = void 0, y = {},
|
|
653
|
+
var D = "local-forage-detect-blob-support", c = void 0, y = {}, b = Object.prototype.toString, M = "readonly", A = "readwrite";
|
|
654
654
|
function T(n) {
|
|
655
655
|
for (var i = n.length, a = new ArrayBuffer(i), m = new Uint8Array(a), v = 0; v < i; v++)
|
|
656
656
|
m[v] = n.charCodeAt(v);
|
|
@@ -658,7 +658,7 @@ var nt = { exports: {} };
|
|
|
658
658
|
}
|
|
659
659
|
function x(n) {
|
|
660
660
|
return new d(function(i) {
|
|
661
|
-
var a = n.transaction(D,
|
|
661
|
+
var a = n.transaction(D, A), m = $([""]);
|
|
662
662
|
a.objectStore(D).put(m, "key"), a.onabort = function(v) {
|
|
663
663
|
v.preventDefault(), v.stopPropagation(), i(!1);
|
|
664
664
|
}, a.oncomplete = function() {
|
|
@@ -669,7 +669,7 @@ var nt = { exports: {} };
|
|
|
669
669
|
return !1;
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function C(n) {
|
|
673
673
|
return typeof c == "boolean" ? d.resolve(c) : x(n).then(function(i) {
|
|
674
674
|
return c = i, c;
|
|
675
675
|
});
|
|
@@ -682,12 +682,12 @@ var nt = { exports: {} };
|
|
|
682
682
|
return a.promise;
|
|
683
683
|
}) : i.dbReady = a.promise;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function E(n) {
|
|
686
686
|
var i = y[n.name], a = i.deferredOperations.pop();
|
|
687
687
|
if (a)
|
|
688
688
|
return a.resolve(), a.promise;
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function K(n, i) {
|
|
691
691
|
var a = y[n.name], m = a.deferredOperations.pop();
|
|
692
692
|
if (m)
|
|
693
693
|
return m.reject(i), m.promise;
|
|
@@ -702,23 +702,23 @@ var nt = { exports: {} };
|
|
|
702
702
|
var v = [n.name];
|
|
703
703
|
i && v.push(n.version);
|
|
704
704
|
var o = _.open.apply(_, v);
|
|
705
|
-
i && (o.onupgradeneeded = function(
|
|
705
|
+
i && (o.onupgradeneeded = function(L) {
|
|
706
706
|
var R = o.result;
|
|
707
707
|
try {
|
|
708
|
-
R.createObjectStore(n.storeName),
|
|
708
|
+
R.createObjectStore(n.storeName), L.oldVersion <= 1 && R.createObjectStore(D);
|
|
709
709
|
} catch (B) {
|
|
710
710
|
if (B.name === "ConstraintError")
|
|
711
|
-
console.warn('The database "' + n.name + '" has been upgraded from version ' +
|
|
711
|
+
console.warn('The database "' + n.name + '" has been upgraded from version ' + L.oldVersion + " to version " + L.newVersion + ', but the storage "' + n.storeName + '" already exists.');
|
|
712
712
|
else
|
|
713
713
|
throw B;
|
|
714
714
|
}
|
|
715
|
-
}), o.onerror = function(
|
|
716
|
-
|
|
715
|
+
}), o.onerror = function(L) {
|
|
716
|
+
L.preventDefault(), m(o.error);
|
|
717
717
|
}, o.onsuccess = function() {
|
|
718
|
-
var
|
|
719
|
-
|
|
718
|
+
var L = o.result;
|
|
719
|
+
L.onversionchange = function(R) {
|
|
720
720
|
R.target.close();
|
|
721
|
-
}, a(
|
|
721
|
+
}, a(L), E(n);
|
|
722
722
|
};
|
|
723
723
|
});
|
|
724
724
|
}
|
|
@@ -754,7 +754,7 @@ var nt = { exports: {} };
|
|
|
754
754
|
}, m.readAsBinaryString(n);
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Z(n) {
|
|
758
758
|
var i = T(atob(n.data));
|
|
759
759
|
return $([i], { type: n.type });
|
|
760
760
|
}
|
|
@@ -769,7 +769,7 @@ var nt = { exports: {} };
|
|
|
769
769
|
});
|
|
770
770
|
return u(a, n, n), a;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Y(n) {
|
|
773
773
|
f(n);
|
|
774
774
|
for (var i = y[n.name], a = i.forages, m = 0; m < a.length; m++) {
|
|
775
775
|
var v = a[m];
|
|
@@ -779,10 +779,10 @@ var nt = { exports: {} };
|
|
|
779
779
|
return n.db = o, be(n) ? ue(n) : o;
|
|
780
780
|
}).then(function(o) {
|
|
781
781
|
n.db = i.db = o;
|
|
782
|
-
for (var
|
|
783
|
-
a[
|
|
782
|
+
for (var L = 0; L < a.length; L++)
|
|
783
|
+
a[L]._dbInfo.db = o;
|
|
784
784
|
}).catch(function(o) {
|
|
785
|
-
throw
|
|
785
|
+
throw K(n, o), o;
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
function W(n, i, a, m) {
|
|
@@ -796,7 +796,7 @@ var nt = { exports: {} };
|
|
|
796
796
|
if (!n.db || o.name === "NotFoundError" && !n.db.objectStoreNames.contains(n.storeName) && n.version <= n.db.version)
|
|
797
797
|
return n.db && (n.version = n.db.version + 1), ue(n);
|
|
798
798
|
}).then(function() {
|
|
799
|
-
return
|
|
799
|
+
return Y(n).then(function() {
|
|
800
800
|
W(n, i, a, m - 1);
|
|
801
801
|
});
|
|
802
802
|
}).catch(a);
|
|
@@ -825,12 +825,12 @@ var nt = { exports: {} };
|
|
|
825
825
|
var v = y[a.name];
|
|
826
826
|
v || (v = ne(), y[a.name] = v), v.forages.push(i), i._initReady || (i._initReady = i.ready, i.ready = ie);
|
|
827
827
|
var o = [];
|
|
828
|
-
function
|
|
828
|
+
function L() {
|
|
829
829
|
return d.resolve();
|
|
830
830
|
}
|
|
831
831
|
for (var R = 0; R < v.forages.length; R++) {
|
|
832
832
|
var B = v.forages[R];
|
|
833
|
-
B !== i && o.push(B._initReady().catch(
|
|
833
|
+
B !== i && o.push(B._initReady().catch(L));
|
|
834
834
|
}
|
|
835
835
|
var F = v.forages.slice(0);
|
|
836
836
|
return d.all(o).then(function() {
|
|
@@ -840,8 +840,8 @@ var nt = { exports: {} };
|
|
|
840
840
|
}).then(function(k) {
|
|
841
841
|
a.db = v.db = k, i._dbInfo = a;
|
|
842
842
|
for (var q = 0; q < F.length; q++) {
|
|
843
|
-
var
|
|
844
|
-
|
|
843
|
+
var j = F[q];
|
|
844
|
+
j !== i && (j._dbInfo.db = a.db, j._dbInfo.version = a.version);
|
|
845
845
|
}
|
|
846
846
|
});
|
|
847
847
|
}
|
|
@@ -850,14 +850,14 @@ var nt = { exports: {} };
|
|
|
850
850
|
n = r(n);
|
|
851
851
|
var m = new d(function(v, o) {
|
|
852
852
|
a.ready().then(function() {
|
|
853
|
-
W(a._dbInfo,
|
|
854
|
-
if (
|
|
855
|
-
return o(
|
|
853
|
+
W(a._dbInfo, M, function(L, R) {
|
|
854
|
+
if (L)
|
|
855
|
+
return o(L);
|
|
856
856
|
try {
|
|
857
857
|
var B = R.objectStore(a._dbInfo.storeName), F = B.get(n);
|
|
858
858
|
F.onsuccess = function() {
|
|
859
859
|
var k = F.result;
|
|
860
|
-
k === void 0 && (k = null), H(k) && (k =
|
|
860
|
+
k === void 0 && (k = null), H(k) && (k = Z(k)), v(k);
|
|
861
861
|
}, F.onerror = function() {
|
|
862
862
|
o(F.error);
|
|
863
863
|
};
|
|
@@ -872,17 +872,17 @@ var nt = { exports: {} };
|
|
|
872
872
|
function ge(n, i) {
|
|
873
873
|
var a = this, m = new d(function(v, o) {
|
|
874
874
|
a.ready().then(function() {
|
|
875
|
-
W(a._dbInfo,
|
|
876
|
-
if (
|
|
877
|
-
return o(
|
|
875
|
+
W(a._dbInfo, M, function(L, R) {
|
|
876
|
+
if (L)
|
|
877
|
+
return o(L);
|
|
878
878
|
try {
|
|
879
879
|
var B = R.objectStore(a._dbInfo.storeName), F = B.openCursor(), k = 1;
|
|
880
880
|
F.onsuccess = function() {
|
|
881
881
|
var q = F.result;
|
|
882
882
|
if (q) {
|
|
883
|
-
var
|
|
884
|
-
H(
|
|
885
|
-
var p = n(
|
|
883
|
+
var j = q.value;
|
|
884
|
+
H(j) && (j = Z(j));
|
|
885
|
+
var p = n(j, q.key, k++);
|
|
886
886
|
p !== void 0 ? v(p) : q.continue();
|
|
887
887
|
} else
|
|
888
888
|
v();
|
|
@@ -900,31 +900,31 @@ var nt = { exports: {} };
|
|
|
900
900
|
function Be(n, i, a) {
|
|
901
901
|
var m = this;
|
|
902
902
|
n = r(n);
|
|
903
|
-
var v = new d(function(o,
|
|
903
|
+
var v = new d(function(o, L) {
|
|
904
904
|
var R;
|
|
905
905
|
m.ready().then(function() {
|
|
906
|
-
return R = m._dbInfo,
|
|
906
|
+
return R = m._dbInfo, b.call(i) === "[object Blob]" ? C(R.db).then(function(B) {
|
|
907
907
|
return B ? i : G(i);
|
|
908
908
|
}) : i;
|
|
909
909
|
}).then(function(B) {
|
|
910
|
-
W(m._dbInfo,
|
|
910
|
+
W(m._dbInfo, A, function(F, k) {
|
|
911
911
|
if (F)
|
|
912
|
-
return
|
|
912
|
+
return L(F);
|
|
913
913
|
try {
|
|
914
914
|
var q = k.objectStore(m._dbInfo.storeName);
|
|
915
915
|
B === null && (B = void 0);
|
|
916
|
-
var
|
|
916
|
+
var j = q.put(B, n);
|
|
917
917
|
k.oncomplete = function() {
|
|
918
918
|
B === void 0 && (B = null), o(B);
|
|
919
919
|
}, k.onabort = k.onerror = function() {
|
|
920
|
-
var p =
|
|
921
|
-
|
|
920
|
+
var p = j.error ? j.error : j.transaction.error;
|
|
921
|
+
L(p);
|
|
922
922
|
};
|
|
923
923
|
} catch (p) {
|
|
924
|
-
|
|
924
|
+
L(p);
|
|
925
925
|
}
|
|
926
926
|
});
|
|
927
|
-
}).catch(
|
|
927
|
+
}).catch(L);
|
|
928
928
|
});
|
|
929
929
|
return h(v, a), v;
|
|
930
930
|
}
|
|
@@ -933,9 +933,9 @@ var nt = { exports: {} };
|
|
|
933
933
|
n = r(n);
|
|
934
934
|
var m = new d(function(v, o) {
|
|
935
935
|
a.ready().then(function() {
|
|
936
|
-
W(a._dbInfo,
|
|
937
|
-
if (
|
|
938
|
-
return o(
|
|
936
|
+
W(a._dbInfo, A, function(L, R) {
|
|
937
|
+
if (L)
|
|
938
|
+
return o(L);
|
|
939
939
|
try {
|
|
940
940
|
var B = R.objectStore(a._dbInfo.storeName), F = B.delete(n);
|
|
941
941
|
R.oncomplete = function() {
|
|
@@ -957,14 +957,14 @@ var nt = { exports: {} };
|
|
|
957
957
|
function Fe(n) {
|
|
958
958
|
var i = this, a = new d(function(m, v) {
|
|
959
959
|
i.ready().then(function() {
|
|
960
|
-
W(i._dbInfo,
|
|
960
|
+
W(i._dbInfo, A, function(o, L) {
|
|
961
961
|
if (o)
|
|
962
962
|
return v(o);
|
|
963
963
|
try {
|
|
964
|
-
var R =
|
|
965
|
-
|
|
964
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.clear();
|
|
965
|
+
L.oncomplete = function() {
|
|
966
966
|
m();
|
|
967
|
-
},
|
|
967
|
+
}, L.onabort = L.onerror = function() {
|
|
968
968
|
var F = B.error ? B.error : B.transaction.error;
|
|
969
969
|
v(F);
|
|
970
970
|
};
|
|
@@ -979,11 +979,11 @@ var nt = { exports: {} };
|
|
|
979
979
|
function tr(n) {
|
|
980
980
|
var i = this, a = new d(function(m, v) {
|
|
981
981
|
i.ready().then(function() {
|
|
982
|
-
W(i._dbInfo,
|
|
982
|
+
W(i._dbInfo, M, function(o, L) {
|
|
983
983
|
if (o)
|
|
984
984
|
return v(o);
|
|
985
985
|
try {
|
|
986
|
-
var R =
|
|
986
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.count();
|
|
987
987
|
B.onsuccess = function() {
|
|
988
988
|
m(B.result);
|
|
989
989
|
}, B.onerror = function() {
|
|
@@ -1004,9 +1004,9 @@ var nt = { exports: {} };
|
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
1006
|
a.ready().then(function() {
|
|
1007
|
-
W(a._dbInfo,
|
|
1008
|
-
if (
|
|
1009
|
-
return o(
|
|
1007
|
+
W(a._dbInfo, M, function(L, R) {
|
|
1008
|
+
if (L)
|
|
1009
|
+
return o(L);
|
|
1010
1010
|
try {
|
|
1011
1011
|
var B = R.objectStore(a._dbInfo.storeName), F = !1, k = B.openKeyCursor();
|
|
1012
1012
|
k.onsuccess = function() {
|
|
@@ -1030,11 +1030,11 @@ var nt = { exports: {} };
|
|
|
1030
1030
|
function Ce(n) {
|
|
1031
1031
|
var i = this, a = new d(function(m, v) {
|
|
1032
1032
|
i.ready().then(function() {
|
|
1033
|
-
W(i._dbInfo,
|
|
1033
|
+
W(i._dbInfo, M, function(o, L) {
|
|
1034
1034
|
if (o)
|
|
1035
1035
|
return v(o);
|
|
1036
1036
|
try {
|
|
1037
|
-
var R =
|
|
1037
|
+
var R = L.objectStore(i._dbInfo.storeName), B = R.openKeyCursor(), F = [];
|
|
1038
1038
|
B.onsuccess = function() {
|
|
1039
1039
|
var k = B.result;
|
|
1040
1040
|
if (!k) {
|
|
@@ -1054,35 +1054,35 @@ var nt = { exports: {} };
|
|
|
1054
1054
|
return h(a, n), a;
|
|
1055
1055
|
}
|
|
1056
1056
|
function ar(n, i) {
|
|
1057
|
-
i =
|
|
1057
|
+
i = w.apply(this, arguments);
|
|
1058
1058
|
var a = this.config();
|
|
1059
1059
|
n = typeof n != "function" && n || {}, n.name || (n.name = n.name || a.name, n.storeName = n.storeName || a.storeName);
|
|
1060
1060
|
var m = this, v;
|
|
1061
1061
|
if (!n.name)
|
|
1062
1062
|
v = d.reject("Invalid arguments");
|
|
1063
1063
|
else {
|
|
1064
|
-
var o = n.name === a.name && m._dbInfo.db,
|
|
1064
|
+
var o = n.name === a.name && m._dbInfo.db, L = o ? d.resolve(m._dbInfo.db) : re(n).then(function(R) {
|
|
1065
1065
|
var B = y[n.name], F = B.forages;
|
|
1066
1066
|
B.db = R;
|
|
1067
1067
|
for (var k = 0; k < F.length; k++)
|
|
1068
1068
|
F[k]._dbInfo.db = R;
|
|
1069
1069
|
return R;
|
|
1070
1070
|
});
|
|
1071
|
-
n.storeName ? v =
|
|
1071
|
+
n.storeName ? v = L.then(function(R) {
|
|
1072
1072
|
if (R.objectStoreNames.contains(n.storeName)) {
|
|
1073
1073
|
var B = R.version + 1;
|
|
1074
1074
|
f(n);
|
|
1075
1075
|
var F = y[n.name], k = F.forages;
|
|
1076
1076
|
R.close();
|
|
1077
1077
|
for (var q = 0; q < k.length; q++) {
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1078
|
+
var j = k[q];
|
|
1079
|
+
j._dbInfo.db = null, j._dbInfo.version = B;
|
|
1080
1080
|
}
|
|
1081
1081
|
var p = new d(function(te, fe) {
|
|
1082
1082
|
var ae = _.open(n.name, B);
|
|
1083
1083
|
ae.onerror = function(we) {
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1084
|
+
var Ze = ae.result;
|
|
1085
|
+
Ze.close(), fe(we);
|
|
1086
1086
|
}, ae.onupgradeneeded = function() {
|
|
1087
1087
|
var we = ae.result;
|
|
1088
1088
|
we.deleteObjectStore(n.storeName);
|
|
@@ -1095,14 +1095,14 @@ var nt = { exports: {} };
|
|
|
1095
1095
|
F.db = te;
|
|
1096
1096
|
for (var fe = 0; fe < k.length; fe++) {
|
|
1097
1097
|
var ae = k[fe];
|
|
1098
|
-
ae._dbInfo.db = te,
|
|
1098
|
+
ae._dbInfo.db = te, E(ae._dbInfo);
|
|
1099
1099
|
}
|
|
1100
1100
|
}).catch(function(te) {
|
|
1101
|
-
throw (
|
|
1101
|
+
throw (K(n, te) || d.resolve()).catch(function() {
|
|
1102
1102
|
}), te;
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
1105
|
-
}) : v =
|
|
1105
|
+
}) : v = L.then(function(R) {
|
|
1106
1106
|
f(n);
|
|
1107
1107
|
var B = y[n.name], F = B.forages;
|
|
1108
1108
|
R.close();
|
|
@@ -1110,7 +1110,7 @@ var nt = { exports: {} };
|
|
|
1110
1110
|
var q = F[k];
|
|
1111
1111
|
q._dbInfo.db = null;
|
|
1112
1112
|
}
|
|
1113
|
-
var
|
|
1113
|
+
var j = new d(function(p, te) {
|
|
1114
1114
|
var fe = _.deleteDatabase(n.name);
|
|
1115
1115
|
fe.onerror = function() {
|
|
1116
1116
|
var ae = fe.result;
|
|
@@ -1122,14 +1122,14 @@ var nt = { exports: {} };
|
|
|
1122
1122
|
ae && ae.close(), p(ae);
|
|
1123
1123
|
};
|
|
1124
1124
|
});
|
|
1125
|
-
return
|
|
1125
|
+
return j.then(function(p) {
|
|
1126
1126
|
B.db = p;
|
|
1127
1127
|
for (var te = 0; te < F.length; te++) {
|
|
1128
1128
|
var fe = F[te];
|
|
1129
|
-
|
|
1129
|
+
E(fe._dbInfo);
|
|
1130
1130
|
}
|
|
1131
1131
|
}).catch(function(p) {
|
|
1132
|
-
throw (
|
|
1132
|
+
throw (K(n, p) || d.resolve()).catch(function() {
|
|
1133
1133
|
}), p;
|
|
1134
1134
|
});
|
|
1135
1135
|
});
|
|
@@ -1155,11 +1155,11 @@ var nt = { exports: {} };
|
|
|
1155
1155
|
}
|
|
1156
1156
|
var Se = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Je = /^~~local_forage_type~([^~]+)~/, ke = "__lfsc__:", Pe = ke.length, qe = "arbf", Ie = "blob", je = "si08", Ke = "ui08", He = "uic8", Ve = "si16", U = "si32", Q = "ur16", V = "ui32", O = "fl32", de = "fl64", ye = Pe + qe.length, De = Object.prototype.toString;
|
|
1157
1157
|
function Ae(n) {
|
|
1158
|
-
var i = n.length * 0.75, a = n.length, m, v = 0, o,
|
|
1158
|
+
var i = n.length * 0.75, a = n.length, m, v = 0, o, L, R, B;
|
|
1159
1159
|
n[n.length - 1] === "=" && (i--, n[n.length - 2] === "=" && i--);
|
|
1160
1160
|
var F = new ArrayBuffer(i), k = new Uint8Array(F);
|
|
1161
1161
|
for (m = 0; m < a; m += 4)
|
|
1162
|
-
o = Se.indexOf(n[m]),
|
|
1162
|
+
o = Se.indexOf(n[m]), L = Se.indexOf(n[m + 1]), R = Se.indexOf(n[m + 2]), B = Se.indexOf(n[m + 3]), k[v++] = o << 2 | L >> 4, k[v++] = (L & 15) << 4 | R >> 2, k[v++] = (R & 3) << 6 | B & 63;
|
|
1163
1163
|
return F;
|
|
1164
1164
|
}
|
|
1165
1165
|
function oe(n) {
|
|
@@ -1168,7 +1168,7 @@ var nt = { exports: {} };
|
|
|
1168
1168
|
a += Se[i[m] >> 2], a += Se[(i[m] & 3) << 4 | i[m + 1] >> 4], a += Se[(i[m + 1] & 15) << 2 | i[m + 2] >> 6], a += Se[i[m + 2] & 63];
|
|
1169
1169
|
return i.length % 3 === 2 ? a = a.substring(0, a.length - 1) + "=" : i.length % 3 === 1 && (a = a.substring(0, a.length - 2) + "=="), a;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Le(n, i) {
|
|
1172
1172
|
var a = "";
|
|
1173
1173
|
if (n && (a = De.call(n)), n && (a === "[object ArrayBuffer]" || n.buffer && De.call(n.buffer) === "[object ArrayBuffer]")) {
|
|
1174
1174
|
var m, v = ke;
|
|
@@ -1176,14 +1176,14 @@ var nt = { exports: {} };
|
|
|
1176
1176
|
} else if (a === "[object Blob]") {
|
|
1177
1177
|
var o = new FileReader();
|
|
1178
1178
|
o.onload = function() {
|
|
1179
|
-
var
|
|
1180
|
-
i(ke + Ie +
|
|
1179
|
+
var L = ir + n.type + "~" + oe(this.result);
|
|
1180
|
+
i(ke + Ie + L);
|
|
1181
1181
|
}, o.readAsArrayBuffer(n);
|
|
1182
1182
|
} else
|
|
1183
1183
|
try {
|
|
1184
1184
|
i(JSON.stringify(n));
|
|
1185
|
-
} catch (
|
|
1186
|
-
console.error("Couldn't convert value into a JSON string: ", n), i(null,
|
|
1185
|
+
} catch (L) {
|
|
1186
|
+
console.error("Couldn't convert value into a JSON string: ", n), i(null, L);
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
function ct(n) {
|
|
@@ -1223,7 +1223,7 @@ var nt = { exports: {} };
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
var cr = {
|
|
1226
|
-
serialize:
|
|
1226
|
+
serialize: Le,
|
|
1227
1227
|
deserialize: ct,
|
|
1228
1228
|
stringToBuffer: Ae,
|
|
1229
1229
|
bufferToString: oe
|
|
@@ -1238,29 +1238,29 @@ var nt = { exports: {} };
|
|
|
1238
1238
|
if (n)
|
|
1239
1239
|
for (var m in n)
|
|
1240
1240
|
a[m] = typeof n[m] != "string" ? n[m].toString() : n[m];
|
|
1241
|
-
var v = new d(function(o,
|
|
1241
|
+
var v = new d(function(o, L) {
|
|
1242
1242
|
try {
|
|
1243
1243
|
a.db = openDatabase(a.name, String(a.version), a.description, a.size);
|
|
1244
1244
|
} catch (R) {
|
|
1245
|
-
return
|
|
1245
|
+
return L(R);
|
|
1246
1246
|
}
|
|
1247
1247
|
a.db.transaction(function(R) {
|
|
1248
1248
|
Rr(R, a, function() {
|
|
1249
1249
|
i._dbInfo = a, o();
|
|
1250
1250
|
}, function(B, F) {
|
|
1251
|
-
|
|
1251
|
+
L(F);
|
|
1252
1252
|
});
|
|
1253
|
-
},
|
|
1253
|
+
}, L);
|
|
1254
1254
|
});
|
|
1255
1255
|
return a.serializer = cr, v;
|
|
1256
1256
|
}
|
|
1257
1257
|
function xe(n, i, a, m, v, o) {
|
|
1258
|
-
n.executeSql(a, m, v, function(
|
|
1259
|
-
R.code === R.SYNTAX_ERR ?
|
|
1258
|
+
n.executeSql(a, m, v, function(L, R) {
|
|
1259
|
+
R.code === R.SYNTAX_ERR ? L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [i.storeName], function(B, F) {
|
|
1260
1260
|
F.rows.length ? o(B, R) : Rr(B, i, function() {
|
|
1261
1261
|
B.executeSql(a, m, v, o);
|
|
1262
1262
|
}, o);
|
|
1263
|
-
}, o) : o(
|
|
1263
|
+
}, o) : o(L, R);
|
|
1264
1264
|
}, o);
|
|
1265
1265
|
}
|
|
1266
1266
|
function st(n, i) {
|
|
@@ -1268,11 +1268,11 @@ var nt = { exports: {} };
|
|
|
1268
1268
|
n = r(n);
|
|
1269
1269
|
var m = new d(function(v, o) {
|
|
1270
1270
|
a.ready().then(function() {
|
|
1271
|
-
var
|
|
1272
|
-
|
|
1273
|
-
xe(R,
|
|
1271
|
+
var L = a._dbInfo;
|
|
1272
|
+
L.db.transaction(function(R) {
|
|
1273
|
+
xe(R, L, "SELECT * FROM " + L.storeName + " WHERE key = ? LIMIT 1", [n], function(B, F) {
|
|
1274
1274
|
var k = F.rows.length ? F.rows.item(0).value : null;
|
|
1275
|
-
k && (k =
|
|
1275
|
+
k && (k = L.serializer.deserialize(k)), v(k);
|
|
1276
1276
|
}, function(B, F) {
|
|
1277
1277
|
o(F);
|
|
1278
1278
|
});
|
|
@@ -1284,12 +1284,12 @@ var nt = { exports: {} };
|
|
|
1284
1284
|
function ot(n, i) {
|
|
1285
1285
|
var a = this, m = new d(function(v, o) {
|
|
1286
1286
|
a.ready().then(function() {
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
xe(R,
|
|
1290
|
-
for (var k = F.rows, q = k.length,
|
|
1291
|
-
var p = k.item(
|
|
1292
|
-
if (te && (te =
|
|
1287
|
+
var L = a._dbInfo;
|
|
1288
|
+
L.db.transaction(function(R) {
|
|
1289
|
+
xe(R, L, "SELECT * FROM " + L.storeName, [], function(B, F) {
|
|
1290
|
+
for (var k = F.rows, q = k.length, j = 0; j < q; j++) {
|
|
1291
|
+
var p = k.item(j), te = p.value;
|
|
1292
|
+
if (te && (te = L.serializer.deserialize(te)), te = n(te, p.key, j + 1), te !== void 0) {
|
|
1293
1293
|
v(te);
|
|
1294
1294
|
return;
|
|
1295
1295
|
}
|
|
@@ -1306,24 +1306,24 @@ var nt = { exports: {} };
|
|
|
1306
1306
|
function Ur(n, i, a, m) {
|
|
1307
1307
|
var v = this;
|
|
1308
1308
|
n = r(n);
|
|
1309
|
-
var o = new d(function(
|
|
1309
|
+
var o = new d(function(L, R) {
|
|
1310
1310
|
v.ready().then(function() {
|
|
1311
1311
|
i === void 0 && (i = null);
|
|
1312
1312
|
var B = i, F = v._dbInfo;
|
|
1313
1313
|
F.serializer.serialize(i, function(k, q) {
|
|
1314
|
-
q ? R(q) : F.db.transaction(function(
|
|
1315
|
-
xe(
|
|
1316
|
-
|
|
1314
|
+
q ? R(q) : F.db.transaction(function(j) {
|
|
1315
|
+
xe(j, F, "INSERT OR REPLACE INTO " + F.storeName + " (key, value) VALUES (?, ?)", [n, k], function() {
|
|
1316
|
+
L(B);
|
|
1317
1317
|
}, function(p, te) {
|
|
1318
1318
|
R(te);
|
|
1319
1319
|
});
|
|
1320
|
-
}, function(
|
|
1321
|
-
if (
|
|
1320
|
+
}, function(j) {
|
|
1321
|
+
if (j.code === j.QUOTA_ERR) {
|
|
1322
1322
|
if (m > 0) {
|
|
1323
|
-
|
|
1323
|
+
L(Ur.apply(v, [n, B, a, m - 1]));
|
|
1324
1324
|
return;
|
|
1325
1325
|
}
|
|
1326
|
-
R(
|
|
1326
|
+
R(j);
|
|
1327
1327
|
}
|
|
1328
1328
|
});
|
|
1329
1329
|
});
|
|
@@ -1339,9 +1339,9 @@ var nt = { exports: {} };
|
|
|
1339
1339
|
n = r(n);
|
|
1340
1340
|
var m = new d(function(v, o) {
|
|
1341
1341
|
a.ready().then(function() {
|
|
1342
|
-
var
|
|
1343
|
-
|
|
1344
|
-
xe(R,
|
|
1342
|
+
var L = a._dbInfo;
|
|
1343
|
+
L.db.transaction(function(R) {
|
|
1344
|
+
xe(R, L, "DELETE FROM " + L.storeName + " WHERE key = ?", [n], function() {
|
|
1345
1345
|
v();
|
|
1346
1346
|
}, function(B, F) {
|
|
1347
1347
|
o(F);
|
|
@@ -1355,8 +1355,8 @@ var nt = { exports: {} };
|
|
|
1355
1355
|
var i = this, a = new d(function(m, v) {
|
|
1356
1356
|
i.ready().then(function() {
|
|
1357
1357
|
var o = i._dbInfo;
|
|
1358
|
-
o.db.transaction(function(
|
|
1359
|
-
xe(
|
|
1358
|
+
o.db.transaction(function(L) {
|
|
1359
|
+
xe(L, o, "DELETE FROM " + o.storeName, [], function() {
|
|
1360
1360
|
m();
|
|
1361
1361
|
}, function(R, B) {
|
|
1362
1362
|
v(B);
|
|
@@ -1370,8 +1370,8 @@ var nt = { exports: {} };
|
|
|
1370
1370
|
var i = this, a = new d(function(m, v) {
|
|
1371
1371
|
i.ready().then(function() {
|
|
1372
1372
|
var o = i._dbInfo;
|
|
1373
|
-
o.db.transaction(function(
|
|
1374
|
-
xe(
|
|
1373
|
+
o.db.transaction(function(L) {
|
|
1374
|
+
xe(L, o, "SELECT COUNT(key) as c FROM " + o.storeName, [], function(R, B) {
|
|
1375
1375
|
var F = B.rows.item(0).c;
|
|
1376
1376
|
m(F);
|
|
1377
1377
|
}, function(R, B) {
|
|
@@ -1385,9 +1385,9 @@ var nt = { exports: {} };
|
|
|
1385
1385
|
function gt(n, i) {
|
|
1386
1386
|
var a = this, m = new d(function(v, o) {
|
|
1387
1387
|
a.ready().then(function() {
|
|
1388
|
-
var
|
|
1389
|
-
|
|
1390
|
-
xe(R,
|
|
1388
|
+
var L = a._dbInfo;
|
|
1389
|
+
L.db.transaction(function(R) {
|
|
1390
|
+
xe(R, L, "SELECT key FROM " + L.storeName + " WHERE id = ? LIMIT 1", [n + 1], function(B, F) {
|
|
1391
1391
|
var k = F.rows.length ? F.rows.item(0).key : null;
|
|
1392
1392
|
v(k);
|
|
1393
1393
|
}, function(B, F) {
|
|
@@ -1402,8 +1402,8 @@ var nt = { exports: {} };
|
|
|
1402
1402
|
var i = this, a = new d(function(m, v) {
|
|
1403
1403
|
i.ready().then(function() {
|
|
1404
1404
|
var o = i._dbInfo;
|
|
1405
|
-
o.db.transaction(function(
|
|
1406
|
-
xe(
|
|
1405
|
+
o.db.transaction(function(L) {
|
|
1406
|
+
xe(L, o, "SELECT key FROM " + o.storeName, [], function(R, B) {
|
|
1407
1407
|
for (var F = [], k = 0; k < B.rows.length; k++)
|
|
1408
1408
|
F.push(B.rows.item(k).key);
|
|
1409
1409
|
m(F);
|
|
@@ -1419,11 +1419,11 @@ var nt = { exports: {} };
|
|
|
1419
1419
|
return new d(function(i, a) {
|
|
1420
1420
|
n.transaction(function(m) {
|
|
1421
1421
|
m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(v, o) {
|
|
1422
|
-
for (var
|
|
1423
|
-
|
|
1422
|
+
for (var L = [], R = 0; R < o.rows.length; R++)
|
|
1423
|
+
L.push(o.rows.item(R).name);
|
|
1424
1424
|
i({
|
|
1425
1425
|
db: n,
|
|
1426
|
-
storeNames:
|
|
1426
|
+
storeNames: L
|
|
1427
1427
|
});
|
|
1428
1428
|
}, function(v, o) {
|
|
1429
1429
|
a(o);
|
|
@@ -1434,18 +1434,18 @@ var nt = { exports: {} };
|
|
|
1434
1434
|
});
|
|
1435
1435
|
}
|
|
1436
1436
|
function bt(n, i) {
|
|
1437
|
-
i =
|
|
1437
|
+
i = w.apply(this, arguments);
|
|
1438
1438
|
var a = this.config();
|
|
1439
1439
|
n = typeof n != "function" && n || {}, n.name || (n.name = n.name || a.name, n.storeName = n.storeName || a.storeName);
|
|
1440
1440
|
var m = this, v;
|
|
1441
1441
|
return n.name ? v = new d(function(o) {
|
|
1442
|
-
var
|
|
1443
|
-
n.name === a.name ?
|
|
1444
|
-
db:
|
|
1442
|
+
var L;
|
|
1443
|
+
n.name === a.name ? L = m._dbInfo.db : L = openDatabase(n.name, "", "", 0), n.storeName ? o({
|
|
1444
|
+
db: L,
|
|
1445
1445
|
storeNames: [n.storeName]
|
|
1446
|
-
}) : o(wt(
|
|
1446
|
+
}) : o(wt(L));
|
|
1447
1447
|
}).then(function(o) {
|
|
1448
|
-
return new d(function(
|
|
1448
|
+
return new d(function(L, R) {
|
|
1449
1449
|
o.db.transaction(function(B) {
|
|
1450
1450
|
function F(p) {
|
|
1451
1451
|
return new d(function(te, fe) {
|
|
@@ -1456,10 +1456,10 @@ var nt = { exports: {} };
|
|
|
1456
1456
|
});
|
|
1457
1457
|
});
|
|
1458
1458
|
}
|
|
1459
|
-
for (var k = [], q = 0,
|
|
1459
|
+
for (var k = [], q = 0, j = o.storeNames.length; q < j; q++)
|
|
1460
1460
|
k.push(F(o.storeNames[q]));
|
|
1461
1461
|
d.all(k).then(function() {
|
|
1462
|
-
|
|
1462
|
+
L();
|
|
1463
1463
|
}).catch(function(p) {
|
|
1464
1464
|
R(p);
|
|
1465
1465
|
});
|
|
@@ -1533,11 +1533,11 @@ var nt = { exports: {} };
|
|
|
1533
1533
|
}
|
|
1534
1534
|
function _t(n, i) {
|
|
1535
1535
|
var a = this, m = a.ready().then(function() {
|
|
1536
|
-
for (var v = a._dbInfo, o = v.keyPrefix,
|
|
1536
|
+
for (var v = a._dbInfo, o = v.keyPrefix, L = o.length, R = localStorage.length, B = 1, F = 0; F < R; F++) {
|
|
1537
1537
|
var k = localStorage.key(F);
|
|
1538
1538
|
if (k.indexOf(o) === 0) {
|
|
1539
1539
|
var q = localStorage.getItem(k);
|
|
1540
|
-
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(
|
|
1540
|
+
if (q && (q = v.serializer.deserialize(q)), q = n(q, k.substring(L), B++), q !== void 0)
|
|
1541
1541
|
return q;
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
@@ -1558,21 +1558,21 @@ var nt = { exports: {} };
|
|
|
1558
1558
|
}
|
|
1559
1559
|
function Pt(n) {
|
|
1560
1560
|
var i = this, a = i.ready().then(function() {
|
|
1561
|
-
for (var m = i._dbInfo, v = localStorage.length, o = [],
|
|
1562
|
-
var R = localStorage.key(
|
|
1561
|
+
for (var m = i._dbInfo, v = localStorage.length, o = [], L = 0; L < v; L++) {
|
|
1562
|
+
var R = localStorage.key(L);
|
|
1563
1563
|
R.indexOf(m.keyPrefix) === 0 && o.push(R.substring(m.keyPrefix.length));
|
|
1564
1564
|
}
|
|
1565
1565
|
return o;
|
|
1566
1566
|
});
|
|
1567
1567
|
return h(a, n), a;
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1569
|
+
function Lt(n) {
|
|
1570
1570
|
var i = this, a = i.keys().then(function(m) {
|
|
1571
1571
|
return m.length;
|
|
1572
1572
|
});
|
|
1573
1573
|
return h(a, n), a;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Nt(n, i) {
|
|
1576
1576
|
var a = this;
|
|
1577
1577
|
n = r(n);
|
|
1578
1578
|
var m = a.ready().then(function() {
|
|
@@ -1581,20 +1581,20 @@ var nt = { exports: {} };
|
|
|
1581
1581
|
});
|
|
1582
1582
|
return h(m, i), m;
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function Mt(n, i, a) {
|
|
1585
1585
|
var m = this;
|
|
1586
1586
|
n = r(n);
|
|
1587
1587
|
var v = m.ready().then(function() {
|
|
1588
1588
|
i === void 0 && (i = null);
|
|
1589
1589
|
var o = i;
|
|
1590
|
-
return new d(function(
|
|
1590
|
+
return new d(function(L, R) {
|
|
1591
1591
|
var B = m._dbInfo;
|
|
1592
1592
|
B.serializer.serialize(i, function(F, k) {
|
|
1593
1593
|
if (k)
|
|
1594
1594
|
R(k);
|
|
1595
1595
|
else
|
|
1596
1596
|
try {
|
|
1597
|
-
localStorage.setItem(B.keyPrefix + n, F),
|
|
1597
|
+
localStorage.setItem(B.keyPrefix + n, F), L(o);
|
|
1598
1598
|
} catch (q) {
|
|
1599
1599
|
(q.name === "QuotaExceededError" || q.name === "NS_ERROR_DOM_QUOTA_REACHED") && R(q), R(q);
|
|
1600
1600
|
}
|
|
@@ -1604,7 +1604,7 @@ var nt = { exports: {} };
|
|
|
1604
1604
|
return h(v, a), v;
|
|
1605
1605
|
}
|
|
1606
1606
|
function Rt(n, i) {
|
|
1607
|
-
if (i =
|
|
1607
|
+
if (i = w.apply(this, arguments), n = typeof n != "function" && n || {}, !n.name) {
|
|
1608
1608
|
var a = this.config();
|
|
1609
1609
|
n.name = n.name || a.name, n.storeName = n.storeName || a.storeName;
|
|
1610
1610
|
}
|
|
@@ -1612,8 +1612,8 @@ var nt = { exports: {} };
|
|
|
1612
1612
|
return n.name ? v = new d(function(o) {
|
|
1613
1613
|
n.storeName ? o(Br(n, m._defaultConfig)) : o(n.name + "/");
|
|
1614
1614
|
}).then(function(o) {
|
|
1615
|
-
for (var
|
|
1616
|
-
var R = localStorage.key(
|
|
1615
|
+
for (var L = localStorage.length - 1; L >= 0; L--) {
|
|
1616
|
+
var R = localStorage.key(L);
|
|
1617
1617
|
R.indexOf(o) === 0 && localStorage.removeItem(R);
|
|
1618
1618
|
}
|
|
1619
1619
|
}) : v = d.reject("Invalid arguments"), h(v, i), v;
|
|
@@ -1624,10 +1624,10 @@ var nt = { exports: {} };
|
|
|
1624
1624
|
_support: At(),
|
|
1625
1625
|
iterate: _t,
|
|
1626
1626
|
getItem: Tt,
|
|
1627
|
-
setItem:
|
|
1628
|
-
removeItem:
|
|
1627
|
+
setItem: Mt,
|
|
1628
|
+
removeItem: Nt,
|
|
1629
1629
|
clear: xt,
|
|
1630
|
-
length:
|
|
1630
|
+
length: Lt,
|
|
1631
1631
|
key: Ct,
|
|
1632
1632
|
keys: Pt,
|
|
1633
1633
|
dropInstance: Rt
|
|
@@ -1697,14 +1697,14 @@ var nt = { exports: {} };
|
|
|
1697
1697
|
} else
|
|
1698
1698
|
return typeof a == "string" ? this._config[a] : this._config;
|
|
1699
1699
|
}, n.prototype.defineDriver = function(a, m, v) {
|
|
1700
|
-
var o = new d(function(
|
|
1700
|
+
var o = new d(function(L, R) {
|
|
1701
1701
|
try {
|
|
1702
1702
|
var B = a._driver, F = new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
|
|
1703
1703
|
if (!a._driver) {
|
|
1704
1704
|
R(F);
|
|
1705
1705
|
return;
|
|
1706
1706
|
}
|
|
1707
|
-
for (var k = fr.concat("_initStorage"), q = 0,
|
|
1707
|
+
for (var k = fr.concat("_initStorage"), q = 0, j = k.length; q < j; q++) {
|
|
1708
1708
|
var p = k[q], te = !$t(Qe, p);
|
|
1709
1709
|
if ((te || a[p]) && typeof a[p] != "function") {
|
|
1710
1710
|
R(F);
|
|
@@ -1712,19 +1712,19 @@ var nt = { exports: {} };
|
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
var fe = function() {
|
|
1715
|
-
for (var
|
|
1715
|
+
for (var Ze = function(Vt) {
|
|
1716
1716
|
return function() {
|
|
1717
1717
|
var zt = new Error("Method " + Vt + " is not implemented by the current driver"), kr = d.reject(zt);
|
|
1718
1718
|
return h(kr, arguments[arguments.length - 1]), kr;
|
|
1719
1719
|
};
|
|
1720
1720
|
}, or = 0, Ht = Qe.length; or < Ht; or++) {
|
|
1721
1721
|
var dr = Qe[or];
|
|
1722
|
-
a[dr] || (a[dr] =
|
|
1722
|
+
a[dr] || (a[dr] = Ze(dr));
|
|
1723
1723
|
}
|
|
1724
1724
|
};
|
|
1725
1725
|
fe();
|
|
1726
|
-
var ae = function(
|
|
1727
|
-
ze[B] && console.info("Redefining LocalForage driver: " + B), ze[B] = a, Fr[B] =
|
|
1726
|
+
var ae = function(Ze) {
|
|
1727
|
+
ze[B] && console.info("Redefining LocalForage driver: " + B), ze[B] = a, Fr[B] = Ze, L();
|
|
1728
1728
|
};
|
|
1729
1729
|
"_support" in a ? a._support && typeof a._support == "function" ? a._support().then(ae, R) : ae(!!a._support) : ae(!0);
|
|
1730
1730
|
} catch (we) {
|
|
@@ -1748,7 +1748,7 @@ var nt = { exports: {} };
|
|
|
1748
1748
|
}, n.prototype.setDriver = function(a, m, v) {
|
|
1749
1749
|
var o = this;
|
|
1750
1750
|
$r(a) || (a = [a]);
|
|
1751
|
-
var
|
|
1751
|
+
var L = this._getSupportedDrivers(a);
|
|
1752
1752
|
function R() {
|
|
1753
1753
|
o._config.driver = o.driver();
|
|
1754
1754
|
}
|
|
@@ -1757,11 +1757,11 @@ var nt = { exports: {} };
|
|
|
1757
1757
|
}
|
|
1758
1758
|
function F(q) {
|
|
1759
1759
|
return function() {
|
|
1760
|
-
var
|
|
1760
|
+
var j = 0;
|
|
1761
1761
|
function p() {
|
|
1762
|
-
for (;
|
|
1763
|
-
var te = q[
|
|
1764
|
-
return
|
|
1762
|
+
for (; j < q.length; ) {
|
|
1763
|
+
var te = q[j];
|
|
1764
|
+
return j++, o._dbInfo = null, o._ready = null, o.getDriver(te).then(B).catch(p);
|
|
1765
1765
|
}
|
|
1766
1766
|
R();
|
|
1767
1767
|
var fe = new Error("No available storage method found.");
|
|
@@ -1774,9 +1774,9 @@ var nt = { exports: {} };
|
|
|
1774
1774
|
return d.resolve();
|
|
1775
1775
|
}) : d.resolve();
|
|
1776
1776
|
return this._driverSet = k.then(function() {
|
|
1777
|
-
var q =
|
|
1778
|
-
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(
|
|
1779
|
-
o._driver =
|
|
1777
|
+
var q = L[0];
|
|
1778
|
+
return o._dbInfo = null, o._ready = null, o.getDriver(q).then(function(j) {
|
|
1779
|
+
o._driver = j._driver, R(), o._wrapLibraryMethodsWithReady(), o._initDriver = F(L);
|
|
1780
1780
|
});
|
|
1781
1781
|
}).catch(function() {
|
|
1782
1782
|
R();
|
|
@@ -1789,8 +1789,8 @@ var nt = { exports: {} };
|
|
|
1789
1789
|
sr(this, a);
|
|
1790
1790
|
}, n.prototype._getSupportedDrivers = function(a) {
|
|
1791
1791
|
for (var m = [], v = 0, o = a.length; v < o; v++) {
|
|
1792
|
-
var
|
|
1793
|
-
this.supports(
|
|
1792
|
+
var L = a[v];
|
|
1793
|
+
this.supports(L) && m.push(L);
|
|
1794
1794
|
}
|
|
1795
1795
|
return m;
|
|
1796
1796
|
}, n.prototype._wrapLibraryMethodsWithReady = function() {
|
|
@@ -1800,7 +1800,7 @@ var nt = { exports: {} };
|
|
|
1800
1800
|
return new n(a);
|
|
1801
1801
|
}, n;
|
|
1802
1802
|
}(), qt = new Wt();
|
|
1803
|
-
|
|
1803
|
+
S.exports = qt;
|
|
1804
1804
|
}, { 3: 3 }] }, {}, [4])(4);
|
|
1805
1805
|
});
|
|
1806
1806
|
})(nt);
|
|
@@ -1813,7 +1813,7 @@ function lt() {
|
|
|
1813
1813
|
}
|
|
1814
1814
|
function Wr() {
|
|
1815
1815
|
const e = le == null ? void 0 : le.getEnv();
|
|
1816
|
-
return
|
|
1816
|
+
return le == null ? "" : (le[e] ?? le.development).auth ?? "";
|
|
1817
1817
|
}
|
|
1818
1818
|
function gn(e) {
|
|
1819
1819
|
const t = le == null ? void 0 : le.getEnv();
|
|
@@ -1849,21 +1849,21 @@ function ma() {
|
|
|
1849
1849
|
async function l(s) {
|
|
1850
1850
|
return await ve().removeItem(s);
|
|
1851
1851
|
}
|
|
1852
|
-
async function
|
|
1852
|
+
async function S(s, g) {
|
|
1853
1853
|
await ve().setItem(g, s);
|
|
1854
1854
|
}
|
|
1855
1855
|
return {
|
|
1856
1856
|
clearAsync: e,
|
|
1857
1857
|
getAsync: t,
|
|
1858
1858
|
removeAsync: l,
|
|
1859
|
-
saveAsync:
|
|
1859
|
+
saveAsync: S
|
|
1860
1860
|
};
|
|
1861
1861
|
}
|
|
1862
1862
|
let rr;
|
|
1863
1863
|
function va(e) {
|
|
1864
1864
|
return rr(e)();
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1866
|
+
function Ne(e) {
|
|
1867
1867
|
return rr(e);
|
|
1868
1868
|
}
|
|
1869
1869
|
function wn(e) {
|
|
@@ -1873,10 +1873,10 @@ function wn(e) {
|
|
|
1873
1873
|
}), rr;
|
|
1874
1874
|
}
|
|
1875
1875
|
function bn(e) {
|
|
1876
|
-
var l,
|
|
1877
|
-
e.storeMode ?? (e.storeMode = ((
|
|
1876
|
+
var l, S, s, g, I;
|
|
1877
|
+
e.storeMode ?? (e.storeMode = ((S = (l = e.navigation) == null ? void 0 : l.findItem(e.nav)) == null ? void 0 : S.storeMode) ?? "session"), e.storageMode ?? (e.storageMode = ((g = (s = e.navigation) == null ? void 0 : s.findItem(e.nav)) == null ? void 0 : g.storageMode) ?? "local-cache"), e.storeName ?? (e.storeName = ((I = e.navigation) == null ? void 0 : I.findStoreName(e.nav)) ?? e.nav);
|
|
1878
1878
|
const t = { ...e, storeName: e.storeName ?? "" };
|
|
1879
|
-
if (
|
|
1879
|
+
if (e.storeName == null)
|
|
1880
1880
|
throw new Error("no store name provided");
|
|
1881
1881
|
if (e.storeMode == "whole-last-updated") {
|
|
1882
1882
|
if (e.api == null)
|
|
@@ -1903,45 +1903,45 @@ const Sn = (e) => {
|
|
|
1903
1903
|
function An(e) {
|
|
1904
1904
|
return pr(e.storeName, () => {
|
|
1905
1905
|
var u;
|
|
1906
|
-
const t = he.utc().toSeconds() / 86400, l = z({}),
|
|
1906
|
+
const t = he.utc().toSeconds() / 86400, l = z({}), S = z({}), s = e.storageMode == "local-cache", g = e.buildUrl ?? ((u = e.api) == null ? void 0 : u.buildUrl) ?? Sn;
|
|
1907
1907
|
function I(r) {
|
|
1908
1908
|
var c, y;
|
|
1909
|
-
let
|
|
1909
|
+
let w = "";
|
|
1910
1910
|
const D = r.params ?? {};
|
|
1911
|
-
return D != null && (
|
|
1911
|
+
return D != null && (w = Object.entries(D).sort(Re.firstBy((b) => b[0])).map((b) => `${b[0]}=${JSON.stringify(b[1])}`).join("&")), `${e.storeName ?? "base"}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}_${r.id ?? ((y = r.data) == null ? void 0 : y.id) ?? "no-item-id"}_${w ?? "no-params"}`;
|
|
1912
1912
|
}
|
|
1913
|
-
async function
|
|
1913
|
+
async function P(r) {
|
|
1914
1914
|
r.additionalUrl ?? (r.additionalUrl = "/getAll"), g(r);
|
|
1915
|
-
const
|
|
1916
|
-
if (!D && l.value[
|
|
1917
|
-
return l.value[
|
|
1915
|
+
const w = I(r), D = r.refresh;
|
|
1916
|
+
if (!D && l.value[w] !== void 0)
|
|
1917
|
+
return l.value[w];
|
|
1918
1918
|
if (!D && s == !0) {
|
|
1919
|
-
const c = await ve().getItem(
|
|
1919
|
+
const c = await ve().getItem(w);
|
|
1920
1920
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1921
|
-
return l.value[
|
|
1921
|
+
return l.value[w] = c, c;
|
|
1922
1922
|
}
|
|
1923
1923
|
if (e.api == null)
|
|
1924
|
-
return l.value[
|
|
1924
|
+
return l.value[w];
|
|
1925
1925
|
try {
|
|
1926
|
-
let c =
|
|
1927
|
-
c == null && (c = new Promise(async (
|
|
1928
|
-
var
|
|
1926
|
+
let c = S.value[w];
|
|
1927
|
+
c == null && (c = new Promise(async (b, M) => {
|
|
1928
|
+
var A;
|
|
1929
1929
|
try {
|
|
1930
|
-
const T = await ((
|
|
1930
|
+
const T = await ((A = e.api) == null ? void 0 : A.getAll(r)), x = {
|
|
1931
1931
|
meta: { storedOn: t.toString() },
|
|
1932
1932
|
data: T == null ? void 0 : T.data,
|
|
1933
1933
|
count: T == null ? void 0 : T.count,
|
|
1934
1934
|
filters: (T == null ? void 0 : T.filters) ?? []
|
|
1935
1935
|
};
|
|
1936
|
-
s == !0 && await ve().setItem(
|
|
1936
|
+
s == !0 && await ve().setItem(w, x), b(x);
|
|
1937
1937
|
} catch (T) {
|
|
1938
|
-
|
|
1938
|
+
M(T);
|
|
1939
1939
|
} finally {
|
|
1940
|
-
delete
|
|
1940
|
+
delete S.value[w];
|
|
1941
1941
|
}
|
|
1942
|
-
}),
|
|
1942
|
+
}), S.value[w] = c);
|
|
1943
1943
|
const y = await c;
|
|
1944
|
-
return l.value[
|
|
1944
|
+
return l.value[w] = y, {
|
|
1945
1945
|
data: y == null ? void 0 : y.data,
|
|
1946
1946
|
filters: y == null ? void 0 : y.filters,
|
|
1947
1947
|
count: y == null ? void 0 : y.count
|
|
@@ -1953,35 +1953,35 @@ function An(e) {
|
|
|
1953
1953
|
async function _(r) {
|
|
1954
1954
|
var c;
|
|
1955
1955
|
r.additionalUrl ?? (r.additionalUrl = "/get"), g(r);
|
|
1956
|
-
const
|
|
1957
|
-
if (!D && l.value[
|
|
1958
|
-
return l.value[
|
|
1956
|
+
const w = I(r), D = r.refresh;
|
|
1957
|
+
if (!D && l.value[w] !== void 0)
|
|
1958
|
+
return l.value[w];
|
|
1959
1959
|
if (!D && s == !0) {
|
|
1960
|
-
const y = await ve().getItem(
|
|
1960
|
+
const y = await ve().getItem(w);
|
|
1961
1961
|
if (y != null && (e.api == null || parseFloat(((c = y.meta) == null ? void 0 : c.storedOn) ?? "0") > t - 7))
|
|
1962
|
-
return l.value[
|
|
1962
|
+
return l.value[w] = y, { data: y.data };
|
|
1963
1963
|
}
|
|
1964
1964
|
if (e.api == null)
|
|
1965
|
-
return l.value[
|
|
1965
|
+
return l.value[w];
|
|
1966
1966
|
try {
|
|
1967
|
-
let y =
|
|
1968
|
-
y == null && (y = new Promise(async (
|
|
1967
|
+
let y = S.value[w];
|
|
1968
|
+
y == null && (y = new Promise(async (M, A) => {
|
|
1969
1969
|
var T;
|
|
1970
1970
|
try {
|
|
1971
1971
|
let x = await ((T = e.api) == null ? void 0 : T.get(r));
|
|
1972
|
-
const
|
|
1972
|
+
const C = {
|
|
1973
1973
|
meta: { storedOn: t.toString() },
|
|
1974
1974
|
data: x == null ? void 0 : x.data
|
|
1975
1975
|
};
|
|
1976
|
-
s == !0 && await ve().setItem(
|
|
1976
|
+
s == !0 && await ve().setItem(w, C), M(C);
|
|
1977
1977
|
} catch (x) {
|
|
1978
|
-
|
|
1978
|
+
A(x);
|
|
1979
1979
|
} finally {
|
|
1980
|
-
delete
|
|
1980
|
+
delete S.value[w];
|
|
1981
1981
|
}
|
|
1982
|
-
}),
|
|
1983
|
-
const
|
|
1984
|
-
return l.value[
|
|
1982
|
+
}), S.value[w] = y);
|
|
1983
|
+
const b = await y;
|
|
1984
|
+
return l.value[w] = b, { data: b.data };
|
|
1985
1985
|
} catch (y) {
|
|
1986
1986
|
throw y;
|
|
1987
1987
|
}
|
|
@@ -1989,7 +1989,7 @@ function An(e) {
|
|
|
1989
1989
|
async function N(r) {
|
|
1990
1990
|
var c;
|
|
1991
1991
|
r.additionalUrl ?? (r.additionalUrl = "/patch"), g(r);
|
|
1992
|
-
const
|
|
1992
|
+
const w = I(r);
|
|
1993
1993
|
let D;
|
|
1994
1994
|
if (e.api != null)
|
|
1995
1995
|
try {
|
|
@@ -2003,23 +2003,23 @@ function An(e) {
|
|
|
2003
2003
|
if (D != null) {
|
|
2004
2004
|
let y = {
|
|
2005
2005
|
meta: { storedOn: t.toString() },
|
|
2006
|
-
data: { ...(c = l.value[
|
|
2006
|
+
data: { ...(c = l.value[w]) == null ? void 0 : c.data, ...D }
|
|
2007
2007
|
};
|
|
2008
|
-
return l.value[
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
if (Array.isArray(
|
|
2012
|
-
for (let T = 0; T <
|
|
2013
|
-
|
|
2008
|
+
return l.value[w] = y, s == !0 && await ve().setItem(w, y), D.id != null && D.rowVersion != null && Object.entries(l.value).forEach((M) => {
|
|
2009
|
+
const A = M[1].data;
|
|
2010
|
+
if (A != null)
|
|
2011
|
+
if (Array.isArray(A))
|
|
2012
|
+
for (let T = 0; T < A.length; T++)
|
|
2013
|
+
A[T].id == D.id && A.splice(T, 1, y.data);
|
|
2014
2014
|
else
|
|
2015
|
-
|
|
2015
|
+
A.id == D.id && (l.value[M[0]] = y);
|
|
2016
2016
|
}), y.data;
|
|
2017
2017
|
}
|
|
2018
2018
|
return D;
|
|
2019
2019
|
}
|
|
2020
2020
|
async function $(r) {
|
|
2021
2021
|
r.additionalUrl ?? (r.additionalUrl = "/post"), g(r);
|
|
2022
|
-
const
|
|
2022
|
+
const w = I(r);
|
|
2023
2023
|
let D;
|
|
2024
2024
|
if (e.api != null)
|
|
2025
2025
|
try {
|
|
@@ -2035,14 +2035,14 @@ function An(e) {
|
|
|
2035
2035
|
meta: { storedOn: t.toString() },
|
|
2036
2036
|
data: D
|
|
2037
2037
|
};
|
|
2038
|
-
return s == !0 && await ve().setItem(
|
|
2038
|
+
return s == !0 && await ve().setItem(w, c), l.value[w] = c, c.data;
|
|
2039
2039
|
}
|
|
2040
2040
|
return D;
|
|
2041
2041
|
}
|
|
2042
2042
|
async function d(r) {
|
|
2043
2043
|
var c;
|
|
2044
2044
|
r.additionalUrl ?? (r.additionalUrl = "/delete"), g(r);
|
|
2045
|
-
const
|
|
2045
|
+
const w = I(r);
|
|
2046
2046
|
if (e.api != null)
|
|
2047
2047
|
try {
|
|
2048
2048
|
let y = await e.api.deleteItem(r);
|
|
@@ -2051,154 +2051,145 @@ function An(e) {
|
|
|
2051
2051
|
} catch (y) {
|
|
2052
2052
|
throw y;
|
|
2053
2053
|
}
|
|
2054
|
-
delete l.value[
|
|
2054
|
+
delete l.value[w];
|
|
2055
2055
|
const D = ((c = r.data) == null ? void 0 : c.id) ?? r.id;
|
|
2056
|
-
D != null && Object.entries(l.value).forEach((
|
|
2057
|
-
const
|
|
2058
|
-
if (
|
|
2059
|
-
if (Array.isArray(
|
|
2060
|
-
for (let
|
|
2061
|
-
|
|
2056
|
+
D != null && Object.entries(l.value).forEach((b) => {
|
|
2057
|
+
const M = b[1].data;
|
|
2058
|
+
if (M != null)
|
|
2059
|
+
if (Array.isArray(M))
|
|
2060
|
+
for (let A = 0; A < M.length; A++)
|
|
2061
|
+
M[A].id == D && M.splice(A, 1);
|
|
2062
2062
|
else
|
|
2063
|
-
delete l.value[
|
|
2064
|
-
}), s == !0 && await ve().removeItem(
|
|
2063
|
+
delete l.value[b[0]];
|
|
2064
|
+
}), s == !0 && await ve().removeItem(w);
|
|
2065
2065
|
}
|
|
2066
2066
|
async function h(r) {
|
|
2067
2067
|
if (r.additionalUrl ?? (r.additionalUrl = `/patch/restore?id=${r.data.id}`), g(r), e.api != null)
|
|
2068
2068
|
try {
|
|
2069
|
-
let
|
|
2070
|
-
return
|
|
2071
|
-
} catch (
|
|
2072
|
-
throw
|
|
2069
|
+
let w = await e.api.patch(r);
|
|
2070
|
+
return w == null ? void 0 : w.data;
|
|
2071
|
+
} catch (w) {
|
|
2072
|
+
throw w;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
2075
|
return {
|
|
2076
2076
|
deleteItem: d,
|
|
2077
2077
|
get: _,
|
|
2078
|
-
getAll:
|
|
2078
|
+
getAll: P,
|
|
2079
2079
|
patch: N,
|
|
2080
2080
|
post: $,
|
|
2081
2081
|
restore: h,
|
|
2082
2082
|
searchMemory: l,
|
|
2083
2083
|
//mainly for testing
|
|
2084
2084
|
currentTimeStampDays: t,
|
|
2085
|
-
promiseMemory:
|
|
2085
|
+
promiseMemory: S,
|
|
2086
2086
|
cacheLocally: s
|
|
2087
2087
|
};
|
|
2088
2088
|
});
|
|
2089
2089
|
}
|
|
2090
2090
|
function qr(e) {
|
|
2091
2091
|
return pr(e.storeName, () => {
|
|
2092
|
-
const t = z(), l = z(0),
|
|
2092
|
+
const t = z(), l = z(0), S = he.utc().toSeconds() / 3600, s = z(), g = z({ storedOn: S.toString() }), I = z({}), P = e.storageMode == "local-cache";
|
|
2093
2093
|
function _() {
|
|
2094
2094
|
var c;
|
|
2095
2095
|
return `${e.storeName}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}`;
|
|
2096
2096
|
}
|
|
2097
2097
|
async function N() {
|
|
2098
|
-
if (
|
|
2099
|
-
console.log("saving");
|
|
2098
|
+
if (P == !0) {
|
|
2100
2099
|
const c = {
|
|
2101
2100
|
meta: J(g),
|
|
2102
2101
|
data: J(t) ?? [],
|
|
2103
2102
|
count: J(l) ?? 0,
|
|
2104
2103
|
filters: []
|
|
2105
2104
|
};
|
|
2106
|
-
console.log(c);
|
|
2107
2105
|
try {
|
|
2108
2106
|
await ve().setItem(_(), JSON.parse(JSON.stringify(c)));
|
|
2109
2107
|
} catch (y) {
|
|
2110
2108
|
console.log("sav err"), console.log(y);
|
|
2111
|
-
} finally {
|
|
2112
|
-
console.log("done");
|
|
2113
2109
|
}
|
|
2114
2110
|
}
|
|
2115
2111
|
}
|
|
2116
2112
|
function $(c) {
|
|
2117
2113
|
const y = _();
|
|
2118
|
-
return I.value[y] || (I.value[y] = new Promise(async (
|
|
2119
|
-
var
|
|
2114
|
+
return I.value[y] || (I.value[y] = new Promise(async (b, M) => {
|
|
2115
|
+
var A;
|
|
2120
2116
|
try {
|
|
2121
|
-
let T = await ((
|
|
2117
|
+
let T = await ((A = e.api) == null ? void 0 : A.getAll({
|
|
2122
2118
|
additionalUrl: "/getAll",
|
|
2123
2119
|
nav: c.nav,
|
|
2124
2120
|
params: {
|
|
2125
2121
|
lastUpdate: g.value.lastUpdate ?? ln()
|
|
2126
2122
|
}
|
|
2127
2123
|
}));
|
|
2128
|
-
|
|
2129
|
-
var f,
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2124
|
+
T == null ? M(T) : (t.value ?? (t.value = []), T.data.forEach((x) => {
|
|
2125
|
+
var f, E;
|
|
2126
|
+
const C = t.value.findIndex((K) => K.id == x.id);
|
|
2127
|
+
C >= 0 ? (f = t.value) == null || f.splice(C, 1, x) : (E = t.value) == null || E.push(x);
|
|
2132
2128
|
}), l.value = t.value.length, g.value = {
|
|
2133
2129
|
lastUpdate: he.utc().toString(),
|
|
2134
|
-
storedOn:
|
|
2135
|
-
}, await N(),
|
|
2130
|
+
storedOn: S.toString()
|
|
2131
|
+
}, await N(), b(T));
|
|
2136
2132
|
} catch (T) {
|
|
2137
|
-
|
|
2133
|
+
M(T);
|
|
2138
2134
|
} finally {
|
|
2139
2135
|
delete I.value[y];
|
|
2140
2136
|
}
|
|
2141
2137
|
})), I.value[y];
|
|
2142
2138
|
}
|
|
2143
2139
|
async function d(c) {
|
|
2144
|
-
var
|
|
2145
|
-
const y = _(),
|
|
2146
|
-
if (
|
|
2147
|
-
return
|
|
2148
|
-
count: (
|
|
2140
|
+
var M, A, T, x;
|
|
2141
|
+
const y = _(), b = c.refresh;
|
|
2142
|
+
if (!b && t.value != null)
|
|
2143
|
+
return {
|
|
2144
|
+
count: (M = t.value) == null ? void 0 : M.length,
|
|
2149
2145
|
data: t.value,
|
|
2150
2146
|
filters: []
|
|
2151
2147
|
};
|
|
2152
|
-
if (!
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
count: (x = t.value) == null ? void 0 : x.length,
|
|
2148
|
+
if (!b && P == !0) {
|
|
2149
|
+
const C = await ve().getItem(y);
|
|
2150
|
+
if (C != null && parseFloat(C.meta.storedOn) > S - 7)
|
|
2151
|
+
return t.value = C.data, l.value = C.data.length, s.value = C.filters ?? [], g.value = C.meta, {
|
|
2152
|
+
count: (A = t.value) == null ? void 0 : A.length,
|
|
2158
2153
|
data: t.value ?? [],
|
|
2159
2154
|
filters: []
|
|
2160
2155
|
};
|
|
2161
2156
|
}
|
|
2162
2157
|
if (e.api == null)
|
|
2163
|
-
return
|
|
2164
|
-
count: (
|
|
2158
|
+
return {
|
|
2159
|
+
count: (T = t.value) == null ? void 0 : T.length,
|
|
2165
2160
|
data: t.value ?? [],
|
|
2166
2161
|
filters: s.value
|
|
2167
2162
|
};
|
|
2168
|
-
|
|
2163
|
+
t.value ?? (t.value = []);
|
|
2169
2164
|
try {
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
console.log(L);
|
|
2173
|
-
var E = {
|
|
2174
|
-
count: (f = t.value) == null ? void 0 : f.length,
|
|
2165
|
+
return await $(c), {
|
|
2166
|
+
count: (x = t.value) == null ? void 0 : x.length,
|
|
2175
2167
|
data: t.value ?? [],
|
|
2176
2168
|
filters: s.value
|
|
2177
2169
|
};
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
throw new Error(j.message ?? "Problem");
|
|
2170
|
+
} catch (C) {
|
|
2171
|
+
let f = C;
|
|
2172
|
+
throw new Error(f.message ?? "Problem");
|
|
2182
2173
|
}
|
|
2183
2174
|
}
|
|
2184
2175
|
async function h(c) {
|
|
2185
|
-
var
|
|
2186
|
-
const y = _(),
|
|
2187
|
-
if (
|
|
2176
|
+
var A, T, x, C;
|
|
2177
|
+
const y = _(), b = c.id ?? ((A = c.data) == null ? void 0 : A.id);
|
|
2178
|
+
if (b == null)
|
|
2188
2179
|
throw new Error("no id provided");
|
|
2189
|
-
let
|
|
2190
|
-
if (!
|
|
2191
|
-
const f = t.value.find((
|
|
2180
|
+
let M = c.refresh;
|
|
2181
|
+
if (!M && t.value != null) {
|
|
2182
|
+
const f = t.value.find((E) => E.id == b);
|
|
2192
2183
|
if (f != null)
|
|
2193
2184
|
return { data: f };
|
|
2194
2185
|
}
|
|
2195
|
-
if (!
|
|
2186
|
+
if (!M && P == !0) {
|
|
2196
2187
|
const f = await ve().getItem(y);
|
|
2197
|
-
if (f != null && parseFloat(f.meta.storedOn) >
|
|
2188
|
+
if (f != null && parseFloat(f.meta.storedOn) > S - 12) {
|
|
2198
2189
|
t.value = f.data, l.value = f.data.length, s.value = f.filters ?? [], g.value = f.meta;
|
|
2199
|
-
let
|
|
2200
|
-
if (
|
|
2201
|
-
return { data:
|
|
2190
|
+
let E = (T = t.value) == null ? void 0 : T.find((K) => K.id == c.id);
|
|
2191
|
+
if (E != null)
|
|
2192
|
+
return { data: E };
|
|
2202
2193
|
}
|
|
2203
2194
|
}
|
|
2204
2195
|
if (e.api == null)
|
|
@@ -2207,14 +2198,14 @@ function qr(e) {
|
|
|
2207
2198
|
};
|
|
2208
2199
|
t.value ?? (t.value = []);
|
|
2209
2200
|
try {
|
|
2210
|
-
return await $(c), { data: (
|
|
2201
|
+
return await $(c), { data: (C = t.value) == null ? void 0 : C.find((f) => f.id == c.id) };
|
|
2211
2202
|
} catch (f) {
|
|
2212
|
-
let
|
|
2213
|
-
throw new Error(
|
|
2203
|
+
let E = f;
|
|
2204
|
+
throw new Error(E.message ?? "Problem");
|
|
2214
2205
|
}
|
|
2215
2206
|
}
|
|
2216
2207
|
async function u(c) {
|
|
2217
|
-
var
|
|
2208
|
+
var b, M, A;
|
|
2218
2209
|
c.additionalUrl ?? (c.additionalUrl = "/patch");
|
|
2219
2210
|
let y;
|
|
2220
2211
|
if (e.api != null)
|
|
@@ -2228,42 +2219,42 @@ function qr(e) {
|
|
|
2228
2219
|
else
|
|
2229
2220
|
y = c.data;
|
|
2230
2221
|
if (y != null) {
|
|
2231
|
-
let T = (
|
|
2232
|
-
T != null && T >= 0 && (t.value ?? (t.value = []), (
|
|
2222
|
+
let T = (b = t.value) == null ? void 0 : b.findIndex((x) => x.id == y.id);
|
|
2223
|
+
T != null && T >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(T, 1, y), await N());
|
|
2233
2224
|
}
|
|
2234
|
-
return (
|
|
2225
|
+
return (A = t.value) == null ? void 0 : A.find((T) => T.id == (c.id ?? c.data.id));
|
|
2235
2226
|
}
|
|
2236
2227
|
async function r(c) {
|
|
2237
|
-
var
|
|
2228
|
+
var b, M;
|
|
2238
2229
|
c.additionalUrl ?? (c.additionalUrl = "/post");
|
|
2239
2230
|
let y;
|
|
2240
2231
|
if (e.api != null)
|
|
2241
2232
|
try {
|
|
2242
|
-
let
|
|
2243
|
-
y =
|
|
2244
|
-
} catch (
|
|
2245
|
-
let T =
|
|
2233
|
+
let A = await e.api.post(c);
|
|
2234
|
+
y = A == null ? void 0 : A.data;
|
|
2235
|
+
} catch (A) {
|
|
2236
|
+
let T = A;
|
|
2246
2237
|
throw new Error(T.message ?? "Patch Problem");
|
|
2247
2238
|
}
|
|
2248
2239
|
else
|
|
2249
2240
|
y = c.data;
|
|
2250
|
-
return y != null && (t.value ?? (t.value = []), (
|
|
2241
|
+
return y != null && (t.value ?? (t.value = []), (b = t.value) == null || b.unshift(y), l.value += 1, await N()), (M = t.value) == null ? void 0 : M.find((A) => A.id == (c.id ?? c.data.id));
|
|
2251
2242
|
}
|
|
2252
|
-
async function
|
|
2253
|
-
var
|
|
2243
|
+
async function w(c) {
|
|
2244
|
+
var b, M;
|
|
2254
2245
|
if (c.additionalUrl ?? (c.additionalUrl = "/delete"), e.api != null)
|
|
2255
2246
|
try {
|
|
2256
|
-
let
|
|
2257
|
-
if (
|
|
2258
|
-
return
|
|
2259
|
-
} catch (
|
|
2260
|
-
let T =
|
|
2247
|
+
let A = await e.api.deleteItem(c);
|
|
2248
|
+
if (A != null)
|
|
2249
|
+
return A;
|
|
2250
|
+
} catch (A) {
|
|
2251
|
+
let T = A;
|
|
2261
2252
|
throw new Error(T.message ?? "Patch Problem");
|
|
2262
2253
|
}
|
|
2263
2254
|
const y = c.id ?? c.data.id;
|
|
2264
2255
|
if (y != null) {
|
|
2265
|
-
let
|
|
2266
|
-
|
|
2256
|
+
let A = (b = t.value) == null ? void 0 : b.findIndex((T) => T.id == y);
|
|
2257
|
+
A != null && A >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(A, 1), await N());
|
|
2267
2258
|
}
|
|
2268
2259
|
}
|
|
2269
2260
|
async function D(c) {
|
|
@@ -2271,20 +2262,20 @@ function qr(e) {
|
|
|
2271
2262
|
if (c.additionalUrl ?? (c.additionalUrl = `/patch/restore?id=${c.data.id}`), e.api != null)
|
|
2272
2263
|
try {
|
|
2273
2264
|
await e.api.patch(c);
|
|
2274
|
-
} catch (
|
|
2275
|
-
let
|
|
2276
|
-
throw new Error(
|
|
2265
|
+
} catch (b) {
|
|
2266
|
+
let M = b;
|
|
2267
|
+
throw new Error(M.message ?? "Patch Problem");
|
|
2277
2268
|
}
|
|
2278
2269
|
try {
|
|
2279
2270
|
c.additionalUrl = "/getAll", await $(c);
|
|
2280
|
-
} catch (
|
|
2281
|
-
let
|
|
2282
|
-
throw new Error(
|
|
2271
|
+
} catch (b) {
|
|
2272
|
+
let M = b;
|
|
2273
|
+
throw new Error(M.message ?? "Problem");
|
|
2283
2274
|
}
|
|
2284
|
-
return (y = t.value) == null ? void 0 : y.find((
|
|
2275
|
+
return (y = t.value) == null ? void 0 : y.find((b) => b.id == (c.id ?? c.data.id));
|
|
2285
2276
|
}
|
|
2286
2277
|
return {
|
|
2287
|
-
deleteItem:
|
|
2278
|
+
deleteItem: w,
|
|
2288
2279
|
get: h,
|
|
2289
2280
|
getAll: d,
|
|
2290
2281
|
patch: u,
|
|
@@ -2293,11 +2284,11 @@ function qr(e) {
|
|
|
2293
2284
|
//other stuff
|
|
2294
2285
|
dataItems: t,
|
|
2295
2286
|
count: l,
|
|
2296
|
-
currentTimeStampHours:
|
|
2287
|
+
currentTimeStampHours: S,
|
|
2297
2288
|
filters: s,
|
|
2298
2289
|
meta: g,
|
|
2299
2290
|
promiseMemory: I,
|
|
2300
|
-
cacheLocally:
|
|
2291
|
+
cacheLocally: P
|
|
2301
2292
|
};
|
|
2302
2293
|
});
|
|
2303
2294
|
}
|
|
@@ -2306,175 +2297,175 @@ function Er() {
|
|
|
2306
2297
|
return Ar;
|
|
2307
2298
|
}
|
|
2308
2299
|
function En(e) {
|
|
2309
|
-
const t = (e == null ? void 0 : e.buildHeaders) ??
|
|
2300
|
+
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g, S = (e == null ? void 0 : e.buildUrl) ?? I, s = e == null ? void 0 : e.demo;
|
|
2310
2301
|
function g(u) {
|
|
2311
2302
|
let r = new URLSearchParams();
|
|
2312
|
-
return Object.entries(u).forEach((
|
|
2313
|
-
|
|
2314
|
-
}), u.filterBy && r.set("filterBy", u.filterBy), u.includeCount && r.set("includeCount", u.includeCount.toString()), u.includeDetails != null && r.set("includeDetails", u.includeDetails.toString()), u.includeInactive && r.set("includeInactive", u.includeInactive.toString()), u.properties && r.set("properties", u.properties.toString()), u.query && r.set("query", u.query.toString()), u.searchString && r.set("searchString", u.searchString), u.sortOrder && r.set("sortOrder", u.sortOrder), u.sortBy && r.set("sortBy", u.sortBy), u.takeFrom && r.set("takeFrom", u.takeFrom.toString()), u.takeAmount && r.set("takeAmount", u.takeAmount.toString()), u.other && Object.entries(u.other).forEach((
|
|
2315
|
-
|
|
2303
|
+
return Object.entries(u).forEach((w) => {
|
|
2304
|
+
w[1] != null && r.append(w[0], w[1]);
|
|
2305
|
+
}), u.filterBy && r.set("filterBy", u.filterBy), u.includeCount && r.set("includeCount", u.includeCount.toString()), u.includeDetails != null && r.set("includeDetails", u.includeDetails.toString()), u.includeInactive && r.set("includeInactive", u.includeInactive.toString()), u.properties && r.set("properties", u.properties.toString()), u.query && r.set("query", u.query.toString()), u.searchString && r.set("searchString", u.searchString), u.sortOrder && r.set("sortOrder", u.sortOrder), u.sortBy && r.set("sortBy", u.sortBy), u.takeFrom && r.set("takeFrom", u.takeFrom.toString()), u.takeAmount && r.set("takeAmount", u.takeAmount.toString()), u.other && Object.entries(u.other).forEach((w) => {
|
|
2306
|
+
w[1] != null && r.append(w[0], w[1].toString());
|
|
2316
2307
|
}), r.toString();
|
|
2317
2308
|
}
|
|
2318
2309
|
function I(u) {
|
|
2319
|
-
let r = J(u.url) ?? void 0,
|
|
2320
|
-
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Ue(r, u.additionalUrl)),
|
|
2310
|
+
let r = J(u.url) ?? void 0, w = J(u.id);
|
|
2311
|
+
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Ue(r, u.additionalUrl)), w != null && (r != null && r.includes("{id}") ? r = r.replaceAll("{id}", w) : r = Ue(r, w)), u.params != null && (r = `${r}?${l(u.params)}`), u.finalUrl = r, u.finalUrl ?? "";
|
|
2321
2312
|
}
|
|
2322
|
-
function
|
|
2323
|
-
var
|
|
2313
|
+
function P(u) {
|
|
2314
|
+
var w, D;
|
|
2324
2315
|
let r = { ...u.headers };
|
|
2325
|
-
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((
|
|
2316
|
+
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((w = e == null ? void 0 : e.auth) == null ? void 0 : w.isLoggedIn.value) == !0 && (r.authorization ?? (r.authorization = `bearer ${(D = e == null ? void 0 : e.auth) == null ? void 0 : D.credentials.value.token}`)), r["Content-Type"] ?? (r["Content-Type"] = u.contentType ?? (e == null ? void 0 : e.defaultContentType) ?? "application/json"), r;
|
|
2326
2317
|
}
|
|
2327
2318
|
async function _(u) {
|
|
2328
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2319
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2329
2320
|
let c = u.finalUrl, y = u.headers;
|
|
2330
|
-
if (c == null && (c =
|
|
2321
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2331
2322
|
return console.log(`DEMO: Get from ${c}`), s.get(u);
|
|
2332
2323
|
console.log(`Get from ${c}`);
|
|
2333
|
-
let
|
|
2324
|
+
let b;
|
|
2334
2325
|
try {
|
|
2335
|
-
if (
|
|
2326
|
+
if (b = await fetch(c, {
|
|
2336
2327
|
method: "GET",
|
|
2337
2328
|
mode: "cors",
|
|
2338
2329
|
cache: "no-cache",
|
|
2339
2330
|
headers: y
|
|
2340
|
-
}), !
|
|
2341
|
-
if (
|
|
2331
|
+
}), !b.ok) {
|
|
2332
|
+
if (b.status == 401)
|
|
2342
2333
|
throw {
|
|
2343
|
-
code:
|
|
2334
|
+
code: b.status,
|
|
2344
2335
|
name: "Unauthorized",
|
|
2345
|
-
message:
|
|
2336
|
+
message: b.statusText
|
|
2346
2337
|
};
|
|
2347
|
-
let
|
|
2348
|
-
throw new Error(
|
|
2338
|
+
let M = await b.text();
|
|
2339
|
+
throw new Error(M ?? b.statusText ?? "Get error");
|
|
2349
2340
|
}
|
|
2350
2341
|
if (D)
|
|
2351
|
-
return await
|
|
2352
|
-
if (
|
|
2353
|
-
return await
|
|
2342
|
+
return await b.text();
|
|
2343
|
+
if (w)
|
|
2344
|
+
return await b.json();
|
|
2354
2345
|
throw new Error();
|
|
2355
|
-
} catch (
|
|
2356
|
-
const
|
|
2346
|
+
} catch (M) {
|
|
2347
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2357
2348
|
if (!r)
|
|
2358
2349
|
return;
|
|
2359
|
-
throw
|
|
2350
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2360
2351
|
}
|
|
2361
2352
|
}
|
|
2362
2353
|
async function N(u) {
|
|
2363
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2354
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2364
2355
|
let c = u.finalUrl, y = u.headers;
|
|
2365
|
-
if (c == null && (c =
|
|
2356
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2366
2357
|
return console.log(`DEMO: Get all from ${c}`), s.getAll(u);
|
|
2367
2358
|
console.log(`Get all from ${c}`);
|
|
2368
|
-
let
|
|
2359
|
+
let b;
|
|
2369
2360
|
try {
|
|
2370
|
-
if (
|
|
2361
|
+
if (b = await fetch(c, {
|
|
2371
2362
|
method: "GET",
|
|
2372
2363
|
mode: "cors",
|
|
2373
2364
|
cache: "no-cache",
|
|
2374
2365
|
headers: y
|
|
2375
|
-
}), !
|
|
2376
|
-
if (
|
|
2366
|
+
}), !b.ok) {
|
|
2367
|
+
if (b.status == 401)
|
|
2377
2368
|
throw {
|
|
2378
|
-
code:
|
|
2369
|
+
code: b.status,
|
|
2379
2370
|
name: "Unauthorized",
|
|
2380
|
-
message:
|
|
2371
|
+
message: b.statusText
|
|
2381
2372
|
};
|
|
2382
|
-
let
|
|
2383
|
-
throw new Error(
|
|
2373
|
+
let M = await b.text();
|
|
2374
|
+
throw new Error(M ?? b.statusText ?? "Get all error");
|
|
2384
2375
|
}
|
|
2385
2376
|
if (D)
|
|
2386
|
-
return await
|
|
2387
|
-
if (
|
|
2388
|
-
return await
|
|
2377
|
+
return await b.text();
|
|
2378
|
+
if (w)
|
|
2379
|
+
return await b.json();
|
|
2389
2380
|
throw new Error();
|
|
2390
|
-
} catch (
|
|
2391
|
-
const
|
|
2381
|
+
} catch (M) {
|
|
2382
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2392
2383
|
if (!r)
|
|
2393
2384
|
return;
|
|
2394
|
-
throw
|
|
2385
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2395
2386
|
}
|
|
2396
2387
|
}
|
|
2397
2388
|
async function $(u) {
|
|
2398
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2389
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2399
2390
|
let c = u.finalUrl, y = u.headers;
|
|
2400
|
-
if (c == null && (c =
|
|
2391
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2401
2392
|
return console.log(`DEMO: Post to ${c}`), s.post(u);
|
|
2402
2393
|
console.log(`Post to ${c}`);
|
|
2403
|
-
let
|
|
2394
|
+
let b;
|
|
2404
2395
|
try {
|
|
2405
|
-
if (
|
|
2396
|
+
if (b = await fetch(c, {
|
|
2406
2397
|
method: "POST",
|
|
2407
2398
|
mode: "cors",
|
|
2408
2399
|
cache: "no-cache",
|
|
2409
2400
|
headers: y,
|
|
2410
2401
|
body: JSON.stringify(u.data)
|
|
2411
|
-
}), !
|
|
2412
|
-
if (
|
|
2402
|
+
}), !b.ok) {
|
|
2403
|
+
if (b.status == 401)
|
|
2413
2404
|
throw {
|
|
2414
|
-
code:
|
|
2405
|
+
code: b.status,
|
|
2415
2406
|
name: "Unauthorized",
|
|
2416
|
-
message:
|
|
2407
|
+
message: b.statusText
|
|
2417
2408
|
};
|
|
2418
|
-
let
|
|
2419
|
-
throw new Error(
|
|
2409
|
+
let M = await b.text();
|
|
2410
|
+
throw new Error(M ?? b.statusText ?? "Post error!");
|
|
2420
2411
|
}
|
|
2421
2412
|
if (D)
|
|
2422
|
-
return await
|
|
2423
|
-
if (
|
|
2424
|
-
return await
|
|
2413
|
+
return await b.text();
|
|
2414
|
+
if (w)
|
|
2415
|
+
return await b.json();
|
|
2425
2416
|
throw new Error();
|
|
2426
|
-
} catch (
|
|
2427
|
-
if (
|
|
2417
|
+
} catch (M) {
|
|
2418
|
+
if (b.status == 200 || !r)
|
|
2428
2419
|
return;
|
|
2429
|
-
const
|
|
2430
|
-
throw
|
|
2420
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2421
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2431
2422
|
}
|
|
2432
2423
|
}
|
|
2433
2424
|
async function d(u) {
|
|
2434
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0,
|
|
2425
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, w = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, D = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2435
2426
|
let c = u.finalUrl, y = u.headers;
|
|
2436
|
-
if (c == null && (c =
|
|
2427
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (y = t(u)), s != null && s.isDemoing.value)
|
|
2437
2428
|
return console.log(`DEMO: Patch to ${c}`), s.patch(u);
|
|
2438
2429
|
console.log(`Patch to ${c}`);
|
|
2439
|
-
let
|
|
2430
|
+
let b;
|
|
2440
2431
|
try {
|
|
2441
|
-
if (
|
|
2432
|
+
if (b = await fetch(c, {
|
|
2442
2433
|
method: "PATCH",
|
|
2443
2434
|
mode: "cors",
|
|
2444
2435
|
cache: "no-cache",
|
|
2445
2436
|
headers: y,
|
|
2446
2437
|
body: JSON.stringify(u.data)
|
|
2447
|
-
}), !
|
|
2448
|
-
if (
|
|
2438
|
+
}), !b.ok) {
|
|
2439
|
+
if (b.status == 401)
|
|
2449
2440
|
throw {
|
|
2450
|
-
code:
|
|
2441
|
+
code: b.status,
|
|
2451
2442
|
name: "Unauthorized",
|
|
2452
|
-
message:
|
|
2443
|
+
message: b.statusText
|
|
2453
2444
|
};
|
|
2454
|
-
let
|
|
2455
|
-
throw new Error(
|
|
2445
|
+
let M = await b.text();
|
|
2446
|
+
throw new Error(M ?? b.statusText ?? "Patch error!");
|
|
2456
2447
|
}
|
|
2457
2448
|
if (D)
|
|
2458
|
-
return await
|
|
2459
|
-
if (
|
|
2460
|
-
return await
|
|
2449
|
+
return await b.text();
|
|
2450
|
+
if (w)
|
|
2451
|
+
return await b.json();
|
|
2461
2452
|
throw new Error();
|
|
2462
|
-
} catch (
|
|
2463
|
-
if (
|
|
2453
|
+
} catch (M) {
|
|
2454
|
+
if (b.status == 200 || !r)
|
|
2464
2455
|
return;
|
|
2465
|
-
const
|
|
2466
|
-
throw
|
|
2456
|
+
const A = `${(b == null ? void 0 : b.status) ?? ""} ${(b == null ? void 0 : b.statusText) ?? ""} ${M.message}`;
|
|
2457
|
+
throw M.code == 401 ? M : new Error(A);
|
|
2467
2458
|
}
|
|
2468
2459
|
}
|
|
2469
2460
|
async function h(u) {
|
|
2470
2461
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0;
|
|
2471
|
-
let
|
|
2472
|
-
if (
|
|
2473
|
-
return console.log(`DEMO: Delete ${
|
|
2474
|
-
console.log(`Delete ${
|
|
2462
|
+
let w = u.finalUrl, D = u.headers;
|
|
2463
|
+
if (w == null && (w = S(u)), u.overrideHeaders !== !0 && (D = t(u)), s != null && s.isDemoing.value)
|
|
2464
|
+
return console.log(`DEMO: Delete ${w}`), s.deleteItem(u);
|
|
2465
|
+
console.log(`Delete ${w}`);
|
|
2475
2466
|
let c;
|
|
2476
2467
|
try {
|
|
2477
|
-
if (c = await fetch(
|
|
2468
|
+
if (c = await fetch(w, {
|
|
2478
2469
|
method: "DELETE",
|
|
2479
2470
|
mode: "cors",
|
|
2480
2471
|
cache: "no-cache",
|
|
@@ -2488,16 +2479,16 @@ function En(e) {
|
|
|
2488
2479
|
};
|
|
2489
2480
|
return c.status == 200 ? void 0 : c.statusText;
|
|
2490
2481
|
} catch (y) {
|
|
2491
|
-
const
|
|
2482
|
+
const b = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${y.message}`;
|
|
2492
2483
|
if (!r)
|
|
2493
|
-
return
|
|
2484
|
+
return b;
|
|
2494
2485
|
throw y.code == 401 ? y : new Error(`${c.status} ${c.statusText} ${y.message}`);
|
|
2495
2486
|
}
|
|
2496
2487
|
}
|
|
2497
2488
|
return Ar = {
|
|
2498
2489
|
buildHeaders: t,
|
|
2499
2490
|
buildQuery: l,
|
|
2500
|
-
buildUrl:
|
|
2491
|
+
buildUrl: S,
|
|
2501
2492
|
deleteItem: h,
|
|
2502
2493
|
get: _,
|
|
2503
2494
|
getAll: N,
|
|
@@ -2506,17 +2497,17 @@ function En(e) {
|
|
|
2506
2497
|
}, Ar;
|
|
2507
2498
|
}
|
|
2508
2499
|
function ut(e) {
|
|
2509
|
-
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors:
|
|
2510
|
-
function
|
|
2500
|
+
const { actionErrorMsg: t, actionLoadingMsg: l, clearErrors: S, isLoading: s, doAction: g, logError: I } = en(e);
|
|
2501
|
+
function P(r) {
|
|
2511
2502
|
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);
|
|
2512
|
-
let
|
|
2503
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2513
2504
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2514
|
-
return
|
|
2515
|
-
var
|
|
2516
|
-
const c = r.id ?? ((
|
|
2505
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onDeleteAsync ?? (r.onDeleteAsync = () => w().deleteItem(r)) : r.onDeleteAsync ?? (r.onDeleteAsync = () => {
|
|
2506
|
+
var b;
|
|
2507
|
+
const c = r.id ?? ((b = r.data) == null ? void 0 : b.id);
|
|
2517
2508
|
if (c == null)
|
|
2518
2509
|
return Promise.resolve("No id found in delete action");
|
|
2519
|
-
const y = D.findIndex((
|
|
2510
|
+
const y = D.findIndex((M) => M.id == c);
|
|
2520
2511
|
return y >= 0 && D.splice(y, 1), Promise.resolve(void 0);
|
|
2521
2512
|
}), g(async () => {
|
|
2522
2513
|
let c;
|
|
@@ -2532,12 +2523,12 @@ function ut(e) {
|
|
|
2532
2523
|
}
|
|
2533
2524
|
function _(r) {
|
|
2534
2525
|
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 get this item?" : void 0);
|
|
2535
|
-
let
|
|
2526
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2536
2527
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2537
|
-
return
|
|
2528
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onGetAsync ?? (r.onGetAsync = async () => (await w().get(r)).data) : r.onGetAsync ?? (r.onGetAsync = () => {
|
|
2538
2529
|
var y;
|
|
2539
2530
|
const c = r.id ?? ((y = r.data) == null ? void 0 : y.id);
|
|
2540
|
-
return c == null ? Promise.resolve(void 0) : Promise.resolve(D.find((
|
|
2531
|
+
return c == null ? Promise.resolve(void 0) : Promise.resolve(D.find((b) => b.id == c));
|
|
2541
2532
|
}), g(async () => {
|
|
2542
2533
|
let c;
|
|
2543
2534
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
@@ -2552,9 +2543,9 @@ function ut(e) {
|
|
|
2552
2543
|
}
|
|
2553
2544
|
function N(r) {
|
|
2554
2545
|
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 get these items?" : void 0);
|
|
2555
|
-
let
|
|
2546
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2556
2547
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2557
|
-
return
|
|
2548
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onGetAsync ?? (r.onGetAsync = () => w().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(D)), g(async () => {
|
|
2558
2549
|
let c;
|
|
2559
2550
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
2560
2551
|
}, {
|
|
@@ -2568,8 +2559,8 @@ function ut(e) {
|
|
|
2568
2559
|
}
|
|
2569
2560
|
function $(r) {
|
|
2570
2561
|
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 restore this item?" : void 0);
|
|
2571
|
-
let
|
|
2572
|
-
return
|
|
2562
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2563
|
+
return w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null && (r.onRestoreAsync ?? (r.onRestoreAsync = () => w().restore(r))), g(async () => {
|
|
2573
2564
|
let D, c;
|
|
2574
2565
|
return r.onCanRestoreAsync != null && (D = await r.onCanRestoreAsync(r.data)), D == null && r.onRestoreAsync != null && (c = await r.onRestoreAsync(r.data)), c != null && r.onRestoreSuccessAsync != null && await r.onRestoreSuccessAsync(c), I(D), c;
|
|
2575
2566
|
}, {
|
|
@@ -2583,21 +2574,21 @@ function ut(e) {
|
|
|
2583
2574
|
}
|
|
2584
2575
|
function d(r) {
|
|
2585
2576
|
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 save this item?" : void 0);
|
|
2586
|
-
let
|
|
2577
|
+
let w = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2587
2578
|
const D = (e == null ? void 0 : e.items) ?? [];
|
|
2588
|
-
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)),
|
|
2579
|
+
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)), w == null && r.nav != null && (w = Ne({ nav: r.nav })), w != null ? r.onSaveAsync ?? (r.onSaveAsync = async () => {
|
|
2589
2580
|
var c;
|
|
2590
|
-
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await
|
|
2581
|
+
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await w().post(r) : await w().patch(r);
|
|
2591
2582
|
}) : r.onSaveAsync ?? (r.onSaveAsync = (c) => {
|
|
2592
|
-
const y = D.findIndex((
|
|
2583
|
+
const y = D.findIndex((b) => b.id == c.id);
|
|
2593
2584
|
return y >= 0 ? D.splice(y, 1, c) : D.push(c), Promise.resolve(c);
|
|
2594
2585
|
}), g(async () => {
|
|
2595
2586
|
let c;
|
|
2596
2587
|
if (r.onGetSaveAsync != null && (c = await r.onGetSaveAsync(r.data)), c == null)
|
|
2597
2588
|
return;
|
|
2598
2589
|
if (r.onCanSaveAsync != null) {
|
|
2599
|
-
let
|
|
2600
|
-
if (I(
|
|
2590
|
+
let b = await r.onCanSaveAsync(c);
|
|
2591
|
+
if (I(b), b != null)
|
|
2601
2592
|
return;
|
|
2602
2593
|
}
|
|
2603
2594
|
let y;
|
|
@@ -2622,8 +2613,8 @@ function ut(e) {
|
|
|
2622
2613
|
actionErrorMsg: t,
|
|
2623
2614
|
apiGet: h,
|
|
2624
2615
|
apiPost: u,
|
|
2625
|
-
clearErrors:
|
|
2626
|
-
deleteItem:
|
|
2616
|
+
clearErrors: S,
|
|
2617
|
+
deleteItem: P,
|
|
2627
2618
|
doAction: g,
|
|
2628
2619
|
getAllItems: N,
|
|
2629
2620
|
getItem: _,
|
|
@@ -2641,170 +2632,170 @@ function In() {
|
|
|
2641
2632
|
function Dn(e) {
|
|
2642
2633
|
const t = e.expiryTokenFormat ?? "d/MM/yyyy h:mm:ss a";
|
|
2643
2634
|
let l = z(localStorage.getItem(Hr) ?? "");
|
|
2644
|
-
l.value.length == 0 &&
|
|
2645
|
-
function
|
|
2635
|
+
l.value.length == 0 && S();
|
|
2636
|
+
function S() {
|
|
2646
2637
|
l.value = Math.random().toString(36).substring(4, 19) + Math.random().toString(12).substring(1, 11), localStorage.setItem(Hr, l.value);
|
|
2647
2638
|
}
|
|
2648
|
-
const s =
|
|
2639
|
+
const s = Yt("auth-credentials", {});
|
|
2649
2640
|
function g(x) {
|
|
2650
2641
|
if (x == null)
|
|
2651
2642
|
return !0;
|
|
2652
|
-
var
|
|
2653
|
-
if (
|
|
2643
|
+
var C = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2644
|
+
if (C == null)
|
|
2654
2645
|
return !1;
|
|
2655
|
-
if (
|
|
2646
|
+
if (C.requiresAuth === !1)
|
|
2656
2647
|
return !0;
|
|
2657
2648
|
const f = J(s);
|
|
2658
|
-
if (f.isSuspended &&
|
|
2649
|
+
if (f.isSuspended && C.ignoreSuspension !== !0)
|
|
2659
2650
|
return !1;
|
|
2660
2651
|
if (f.isGlobalAdmin)
|
|
2661
2652
|
return !0;
|
|
2662
|
-
if (
|
|
2663
|
-
for (var
|
|
2664
|
-
if (!I(
|
|
2653
|
+
if (C.permissions != null) {
|
|
2654
|
+
for (var E = 0; E < C.permissions.length; E++)
|
|
2655
|
+
if (!I(C.permissions[E]))
|
|
2665
2656
|
return !1;
|
|
2666
2657
|
}
|
|
2667
2658
|
return !0;
|
|
2668
2659
|
}
|
|
2669
2660
|
function I(x) {
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2672
|
-
for (var f = 0; f <
|
|
2673
|
-
var
|
|
2674
|
-
if (
|
|
2661
|
+
const C = J(s);
|
|
2662
|
+
if (C.userPermissions != null)
|
|
2663
|
+
for (var f = 0; f < C.userPermissions.length; f++) {
|
|
2664
|
+
var E = C.userPermissions[f].split(".");
|
|
2665
|
+
if (C.userPermissions[f] == "everything.edit" || x == E[0] && E.length > 1 && E[1] == "edit")
|
|
2675
2666
|
return !0;
|
|
2676
2667
|
}
|
|
2677
2668
|
return !1;
|
|
2678
2669
|
}
|
|
2679
|
-
function
|
|
2670
|
+
function P(x) {
|
|
2680
2671
|
if (x == null)
|
|
2681
2672
|
return !0;
|
|
2682
|
-
var
|
|
2683
|
-
if (
|
|
2673
|
+
var C = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2674
|
+
if (C == null)
|
|
2684
2675
|
return !1;
|
|
2685
|
-
if (
|
|
2676
|
+
if (C.requiresAuth === !1)
|
|
2686
2677
|
return !0;
|
|
2687
2678
|
const f = J(s);
|
|
2688
|
-
if (f.isSuspended &&
|
|
2679
|
+
if (f.isSuspended && C.ignoreSuspension !== !0)
|
|
2689
2680
|
return !1;
|
|
2690
2681
|
if (f.isGlobalAdmin)
|
|
2691
2682
|
return !0;
|
|
2692
|
-
if (
|
|
2693
|
-
for (var
|
|
2694
|
-
if (!_(
|
|
2683
|
+
if (C.permissions != null) {
|
|
2684
|
+
for (var E = 0; E < C.permissions.length; E++)
|
|
2685
|
+
if (!_(C.permissions[E]))
|
|
2695
2686
|
return !1;
|
|
2696
2687
|
}
|
|
2697
2688
|
return !0;
|
|
2698
2689
|
}
|
|
2699
2690
|
function _(x) {
|
|
2700
|
-
const
|
|
2701
|
-
if (
|
|
2702
|
-
for (var f = 0; f <
|
|
2703
|
-
var
|
|
2704
|
-
if (x ==
|
|
2691
|
+
const C = J(s);
|
|
2692
|
+
if (C.userPermissions != null)
|
|
2693
|
+
for (var f = 0; f < C.userPermissions.length; f++) {
|
|
2694
|
+
var E = C.userPermissions[f].split(".");
|
|
2695
|
+
if (x == E[0] || x == "everything" || C.userPermissions[f] == "everything.view" || C.userPermissions[f] == "everything.edit")
|
|
2705
2696
|
return !0;
|
|
2706
2697
|
}
|
|
2707
2698
|
return !1;
|
|
2708
2699
|
}
|
|
2709
|
-
function N(x,
|
|
2710
|
-
let
|
|
2711
|
-
return J(s).isGlobalAdmin ? !0 : (
|
|
2712
|
-
f == "edit" ? I(X) || (
|
|
2713
|
-
}), x != null && x.length > 0 && (x.some((X) => u(X)) || (
|
|
2700
|
+
function N(x, C, f) {
|
|
2701
|
+
let E = !0;
|
|
2702
|
+
return J(s).isGlobalAdmin ? !0 : (C != null && C.length > 0 && C.forEach((X) => {
|
|
2703
|
+
f == "edit" ? I(X) || (E = !1) : _(X) || (E = !1);
|
|
2704
|
+
}), x != null && x.length > 0 && (x.some((X) => u(X)) || (E = !1)), E);
|
|
2714
2705
|
}
|
|
2715
|
-
function $(x,
|
|
2706
|
+
function $(x, C = !1) {
|
|
2716
2707
|
var f = e.getAuthItem != null ? e.getAuthItem(x) : null;
|
|
2717
|
-
let
|
|
2708
|
+
let E = !1;
|
|
2718
2709
|
if (f == null)
|
|
2719
2710
|
return !1;
|
|
2720
|
-
let
|
|
2721
|
-
return re || !
|
|
2722
|
-
$(ue, !0) && (
|
|
2723
|
-
}),
|
|
2711
|
+
let K = f.subscriptions ?? [], X = f.permissions ?? [], re = N(K, X, "view");
|
|
2712
|
+
return re || !C || !_e(f.children) ? re : ((f == null ? void 0 : f.children) != null && f.children.forEach((ue) => {
|
|
2713
|
+
$(ue, !0) && (E = !0);
|
|
2714
|
+
}), E);
|
|
2724
2715
|
}
|
|
2725
2716
|
function d(x) {
|
|
2726
|
-
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (
|
|
2727
|
-
const
|
|
2728
|
-
return
|
|
2717
|
+
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (C, f) => {
|
|
2718
|
+
const E = Ue(Wr(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${f}`);
|
|
2719
|
+
return C ? `${E}&redirect_path=${C}` : E;
|
|
2729
2720
|
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(x, l.value) ?? "" : "";
|
|
2730
2721
|
}
|
|
2731
2722
|
function h(x) {
|
|
2732
2723
|
var f;
|
|
2733
|
-
return x == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((
|
|
2724
|
+
return x == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((E) => E.code == x)) == null ? void 0 : f.value) ?? 0;
|
|
2734
2725
|
}
|
|
2735
2726
|
function u(x) {
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2727
|
+
const C = J(s);
|
|
2728
|
+
if (C.subscriptionCode == null)
|
|
2738
2729
|
return !1;
|
|
2739
|
-
if (
|
|
2730
|
+
if (C.subscriptionCode == x)
|
|
2740
2731
|
return !0;
|
|
2741
|
-
const f = h(x),
|
|
2742
|
-
return f <=
|
|
2732
|
+
const f = h(x), E = h(C.subscriptionCode);
|
|
2733
|
+
return f <= E;
|
|
2743
2734
|
}
|
|
2744
2735
|
function r(x) {
|
|
2745
|
-
const f = x.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"),
|
|
2746
|
-
atob(f).split("").map(function(
|
|
2747
|
-
return "%" + ("00" +
|
|
2736
|
+
const f = x.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), E = decodeURIComponent(
|
|
2737
|
+
atob(f).split("").map(function(K) {
|
|
2738
|
+
return "%" + ("00" + K.charCodeAt(0).toString(16)).slice(-2);
|
|
2748
2739
|
}).join("")
|
|
2749
2740
|
);
|
|
2750
|
-
return JSON.parse(
|
|
2741
|
+
return JSON.parse(E);
|
|
2751
2742
|
}
|
|
2752
|
-
function
|
|
2753
|
-
s.value = void 0,
|
|
2743
|
+
function w(x, C) {
|
|
2744
|
+
s.value = void 0, M(), x != null && C != null && C.currentRoute.value.path != x && C.push({ path: x });
|
|
2754
2745
|
}
|
|
2755
2746
|
function D(x) {
|
|
2756
2747
|
var f;
|
|
2757
|
-
J(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), T() && (
|
|
2748
|
+
J(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), T() && (w(), window.location.href = d(x)));
|
|
2758
2749
|
}
|
|
2759
|
-
async function c(x,
|
|
2750
|
+
async function c(x, C) {
|
|
2760
2751
|
return e.getToken ?? (e.getToken = async () => {
|
|
2761
|
-
let f = x,
|
|
2762
|
-
if (f == null ||
|
|
2752
|
+
let f = x, E = C, K = e.oauthGrantType ?? "authorization_token", X = e.oauthClientID ?? "";
|
|
2753
|
+
if (f == null || E == null)
|
|
2763
2754
|
throw new Error("Code and State required in OAuth token process");
|
|
2764
|
-
if (
|
|
2755
|
+
if (E != l.value)
|
|
2765
2756
|
throw new Error("state does not match");
|
|
2766
2757
|
let re = "";
|
|
2767
|
-
e.getTokenUrl ?? (e.getTokenUrl = () => Ue(Wr(), "token")), re = e.getTokenUrl(f, `${window.location.origin}/authentication`,
|
|
2758
|
+
e.getTokenUrl ?? (e.getTokenUrl = () => Ue(Wr(), "token")), re = e.getTokenUrl(f, `${window.location.origin}/authentication`, K, X);
|
|
2768
2759
|
const ue = {};
|
|
2769
|
-
ue.grant_type =
|
|
2760
|
+
ue.grant_type = K, ue.code = f, ue.redirect_uri = `${window.location.origin}/authentication`, ue.client_id = X;
|
|
2770
2761
|
const G = await Er().post({
|
|
2771
2762
|
additionalUrl: re,
|
|
2772
2763
|
data: ue
|
|
2773
2764
|
});
|
|
2774
2765
|
y(G.access_token);
|
|
2775
|
-
}), await e.getToken(x,
|
|
2766
|
+
}), await e.getToken(x, C);
|
|
2776
2767
|
}
|
|
2777
2768
|
function y(x) {
|
|
2778
2769
|
if (x != null && (e.demo == null || !e.demo.isDemoing.value)) {
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2770
|
+
const C = r(x);
|
|
2771
|
+
b(C, x), e.processTokenPayload != null && e.processTokenPayload(s, C);
|
|
2781
2772
|
}
|
|
2782
2773
|
}
|
|
2783
|
-
function
|
|
2784
|
-
var
|
|
2774
|
+
function b(x, C) {
|
|
2775
|
+
var E;
|
|
2785
2776
|
const f = s.value;
|
|
2786
|
-
f.expiresOn = x.ExpiresOn, f.isGlobalAdmin = x.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = x.Permissions, f.subscriptionCode = x.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token =
|
|
2777
|
+
f.expiresOn = x.ExpiresOn, f.isGlobalAdmin = x.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = x.Permissions, f.subscriptionCode = x.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token = C, f.userID = x.UserLoginID, f.userPermissions = ((E = x.Permissions) == null ? void 0 : E.split(",")) ?? [];
|
|
2787
2778
|
}
|
|
2788
|
-
function
|
|
2779
|
+
function M() {
|
|
2789
2780
|
var x;
|
|
2790
2781
|
s.value ?? (s.value = {}), (x = s.value).timeZone ?? (x.timeZone = e.defaultTimeZone ?? hr);
|
|
2791
2782
|
}
|
|
2792
|
-
function
|
|
2783
|
+
function A() {
|
|
2793
2784
|
const x = J(s);
|
|
2794
|
-
return x.isLoggedIn && T() && (
|
|
2785
|
+
return x.isLoggedIn && T() && (w(), window.location.href = d()), x.isLoggedIn;
|
|
2795
2786
|
}
|
|
2796
2787
|
function T() {
|
|
2797
2788
|
const x = J(s);
|
|
2798
2789
|
if (x == null || x.expiresOn == null)
|
|
2799
2790
|
return !0;
|
|
2800
|
-
const
|
|
2801
|
-
return
|
|
2791
|
+
const C = he.fromFormat(x.expiresOn, t), f = he.utc();
|
|
2792
|
+
return C <= f;
|
|
2802
2793
|
}
|
|
2803
|
-
return
|
|
2794
|
+
return M(), Ir = {
|
|
2804
2795
|
authState: l,
|
|
2805
2796
|
canEdit: g,
|
|
2806
2797
|
canEditPermit: I,
|
|
2807
|
-
canView:
|
|
2798
|
+
canView: P,
|
|
2808
2799
|
canViewPermit: _,
|
|
2809
2800
|
credentials: s,
|
|
2810
2801
|
doShow: N,
|
|
@@ -2813,172 +2804,172 @@ function Dn(e) {
|
|
|
2813
2804
|
getToken: c,
|
|
2814
2805
|
isLoggedIn: ee(() => s.value.isLoggedIn === !0),
|
|
2815
2806
|
login: D,
|
|
2816
|
-
logout:
|
|
2817
|
-
resetAuthState:
|
|
2807
|
+
logout: w,
|
|
2808
|
+
resetAuthState: S,
|
|
2818
2809
|
setAuth: y,
|
|
2819
2810
|
timeZone: ee(() => s.value.timeZone ?? e.defaultTimeZone ?? hr),
|
|
2820
|
-
tryLogin:
|
|
2811
|
+
tryLogin: A
|
|
2821
2812
|
}, Ir;
|
|
2822
2813
|
}
|
|
2823
2814
|
function xn(e, t, l = {}) {
|
|
2824
2815
|
const {
|
|
2825
|
-
preventDefault:
|
|
2816
|
+
preventDefault: S = !1,
|
|
2826
2817
|
stopPropagation: s = !1,
|
|
2827
2818
|
axis: g = "both"
|
|
2828
2819
|
} = l, I = { capture: l.capture ?? !0 };
|
|
2829
|
-
let
|
|
2830
|
-
function u(
|
|
2831
|
-
J(
|
|
2820
|
+
let P = { x: 0, y: 0 }, _ = { x: 0, y: 0 }, N = { x: 0, y: 0 }, $ = [], d = [], h = z(!1);
|
|
2821
|
+
function u(M) {
|
|
2822
|
+
J(S) && M.preventDefault(), J(s) && M.stopPropagation();
|
|
2832
2823
|
}
|
|
2833
|
-
function r(
|
|
2824
|
+
function r(M) {
|
|
2834
2825
|
var f;
|
|
2835
|
-
const
|
|
2836
|
-
if (!
|
|
2826
|
+
const A = J(e);
|
|
2827
|
+
if (!A)
|
|
2837
2828
|
return;
|
|
2838
|
-
const T =
|
|
2839
|
-
N = { x:
|
|
2829
|
+
const T = A.$el, C = M.type === "touchstart" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2830
|
+
N = { x: C.clientX, y: C.clientY }, _ = {
|
|
2840
2831
|
x: T.offsetLeft,
|
|
2841
2832
|
y: T.offsetTop
|
|
2842
|
-
},
|
|
2833
|
+
}, P = {
|
|
2843
2834
|
x: T.offsetLeft,
|
|
2844
2835
|
y: T.offsetTop
|
|
2845
|
-
}, ((f = l.onStart) == null ? void 0 : f.call(l, N,
|
|
2836
|
+
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(me("mousemove", w)), d.push(me("touchmove", w)), d.push(me("mouseup", D)), d.push(me("touchend", D)), u(M));
|
|
2846
2837
|
}
|
|
2847
|
-
function
|
|
2848
|
-
var
|
|
2838
|
+
function w(M) {
|
|
2839
|
+
var E;
|
|
2849
2840
|
if (!N || !J(e))
|
|
2850
2841
|
return;
|
|
2851
|
-
const x =
|
|
2852
|
-
let
|
|
2853
|
-
(g === "x" || g === "both") && (
|
|
2842
|
+
const x = M.type === "touchmove" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2843
|
+
let C = x.clientX - N.x, f = x.clientY - N.y;
|
|
2844
|
+
(g === "x" || g === "both") && (P.x = _.x + C), (g === "y" || g === "both") && (P.y = _.y + f), (E = l.onMove) == null || E.call(l, P, M), u(M), c(P);
|
|
2854
2845
|
}
|
|
2855
|
-
function D(
|
|
2856
|
-
var
|
|
2846
|
+
function D(M) {
|
|
2847
|
+
var A;
|
|
2857
2848
|
document.documentElement.style.cursor = "", d.forEach((T) => {
|
|
2858
2849
|
T();
|
|
2859
|
-
}), d.length = 0, (
|
|
2850
|
+
}), d.length = 0, (A = l.onEnd) == null || A.call(l, P, M), u(M);
|
|
2860
2851
|
}
|
|
2861
|
-
function c(
|
|
2862
|
-
const
|
|
2863
|
-
if (!
|
|
2852
|
+
function c(M) {
|
|
2853
|
+
const A = J(e);
|
|
2854
|
+
if (!A)
|
|
2864
2855
|
return;
|
|
2865
|
-
const T =
|
|
2866
|
-
T.style.left = `${
|
|
2856
|
+
const T = A.$el;
|
|
2857
|
+
T.style.left = `${M.x}px`, T.style.top = `${M.y}px`;
|
|
2867
2858
|
}
|
|
2868
2859
|
function y() {
|
|
2869
2860
|
if (J(h))
|
|
2870
2861
|
return;
|
|
2871
|
-
const
|
|
2872
|
-
if (!
|
|
2862
|
+
const M = J(t);
|
|
2863
|
+
if (!M)
|
|
2873
2864
|
return;
|
|
2874
|
-
const
|
|
2875
|
-
|
|
2865
|
+
const A = M.$el;
|
|
2866
|
+
A.style.cursor = "move", $.push(me(A, "mousedown", r, I)), $.push(me(A, "touchstart", r, I)), h.value = !0;
|
|
2876
2867
|
}
|
|
2877
|
-
function
|
|
2868
|
+
function b() {
|
|
2878
2869
|
if (!J(h))
|
|
2879
2870
|
return;
|
|
2880
|
-
const
|
|
2881
|
-
if (!
|
|
2871
|
+
const M = J(t);
|
|
2872
|
+
if (!M)
|
|
2882
2873
|
return;
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2874
|
+
const A = M.$el;
|
|
2875
|
+
A.style.cursor = "", $.forEach((T) => {
|
|
2885
2876
|
T();
|
|
2886
2877
|
}), $.length = 0, h.value = !1;
|
|
2887
2878
|
}
|
|
2888
2879
|
return {
|
|
2889
2880
|
draggingIsOn: h,
|
|
2890
|
-
turnDraggableOff:
|
|
2881
|
+
turnDraggableOff: b,
|
|
2891
2882
|
turnDraggableOn: y
|
|
2892
2883
|
};
|
|
2893
2884
|
}
|
|
2894
2885
|
const Tn = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
|
|
2895
2886
|
function _n(e, t = {}) {
|
|
2896
|
-
let l,
|
|
2887
|
+
let l, S = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, g = t.minWidth ?? 0, I = t.maxWidth ?? Number.MAX_SAFE_INTEGER, P = t.minHeight ?? 0, _ = t.maxHeight ?? Number.MAX_SAFE_INTEGER, N = t.preventDefault ?? !1, $ = t.stopPropagation ?? !1, d, h = [];
|
|
2897
2888
|
const u = z(!1);
|
|
2898
|
-
let r = [],
|
|
2889
|
+
let r = [], w = [];
|
|
2899
2890
|
const D = z(!1), c = z({ x: 0, y: 0 });
|
|
2900
|
-
let y = { left: 0, top: 0, height: 0, width: 0, position: "absolute" },
|
|
2901
|
-
function
|
|
2891
|
+
let y = { left: 0, top: 0, height: 0, width: 0, position: "absolute" }, b = {};
|
|
2892
|
+
function M(G) {
|
|
2902
2893
|
Ee(N) && G.preventDefault(), Ee($) && G.stopPropagation();
|
|
2903
2894
|
}
|
|
2904
|
-
function
|
|
2905
|
-
h =
|
|
2895
|
+
function A(G, Z) {
|
|
2896
|
+
h = Z.map(x), h.forEach((H) => G.$el.appendChild(H));
|
|
2906
2897
|
}
|
|
2907
2898
|
function T(G) {
|
|
2908
|
-
h.forEach((
|
|
2899
|
+
h.forEach((Z) => G.$el.removeChild(Z));
|
|
2909
2900
|
}
|
|
2910
2901
|
function x(G) {
|
|
2911
|
-
const
|
|
2912
|
-
return
|
|
2902
|
+
const Z = S + "px", H = -S / 2 + "px", ie = s + 1, Y = document.createElement("div");
|
|
2903
|
+
return Y.dataset.handle = G, Y.style.position = "absolute", Y.style.touchAction = "none", Y.style.userSelect = "none", Y.style.zIndex = (G.length === 1 ? s : ie).toString(), Y.style.cursor = K(G), G.includes("t") && (Y.style.top = H, Y.style.height = Z, G === "t" && (Y.style.left = "0", Y.style.width = "100%")), G.includes("b") && (Y.style.bottom = H, Y.style.height = Z, G === "b" && (Y.style.left = "0", Y.style.width = "100%")), G.includes("r") && (Y.style.right = H, Y.style.width = Z, G === "r" && (Y.style.top = "0", Y.style.height = "100%")), G.includes("l") && (Y.style.left = H, Y.style.width = Z, G === "l" && (Y.style.top = "0", Y.style.height = "100%")), Y;
|
|
2913
2904
|
}
|
|
2914
|
-
function
|
|
2905
|
+
function C(G) {
|
|
2915
2906
|
var ne;
|
|
2916
2907
|
if (!h.some((ce) => ce == G.target))
|
|
2917
2908
|
return;
|
|
2918
|
-
const
|
|
2919
|
-
if (!
|
|
2909
|
+
const Z = Ee(e);
|
|
2910
|
+
if (!Z)
|
|
2920
2911
|
return;
|
|
2921
|
-
const H =
|
|
2922
|
-
if (c.value.x =
|
|
2912
|
+
const H = Z.$el, Y = G.type === "touchstart" && G.touches.length > 0 ? G.touches[0] : G;
|
|
2913
|
+
if (c.value.x = Y.clientX, c.value.y = Y.clientY, y = {
|
|
2923
2914
|
left: H.offsetLeft,
|
|
2924
2915
|
top: H.offsetTop,
|
|
2925
2916
|
height: parseInt(window.getComputedStyle(H).getPropertyValue("height")),
|
|
2926
2917
|
width: parseInt(window.getComputedStyle(H).getPropertyValue("width"))
|
|
2927
|
-
},
|
|
2918
|
+
}, b = Mr(y), ((ne = t.onStart) == null ? void 0 : ne.call(t, c.value, G)) === !1)
|
|
2928
2919
|
return;
|
|
2929
2920
|
let W = G.target;
|
|
2930
|
-
document.documentElement.style.cursor =
|
|
2921
|
+
document.documentElement.style.cursor = K(W.dataset.handle), d = W.dataset.handle, w.push(me("mousemove", f)), w.push(me("mouseup", E)), w.push(me("touchmove", f)), w.push(me("touchend", E)), M(G);
|
|
2931
2922
|
}
|
|
2932
2923
|
function f(G) {
|
|
2933
|
-
const
|
|
2934
|
-
if (!
|
|
2924
|
+
const Z = Ee(e);
|
|
2925
|
+
if (!Z)
|
|
2935
2926
|
return;
|
|
2936
|
-
const H =
|
|
2937
|
-
let W =
|
|
2927
|
+
const H = Z.$el, Y = G.type === "touchmove" && G.touches.length > 0 ? G.touches[0] : G;
|
|
2928
|
+
let W = Y.clientX - c.value.x, ne = Y.clientY - c.value.y;
|
|
2938
2929
|
const ce = Ee(y);
|
|
2939
2930
|
if (d.includes("t")) {
|
|
2940
|
-
const se = Math.min(_, Math.max(
|
|
2941
|
-
|
|
2931
|
+
const se = Math.min(_, Math.max(P, (ce.height ?? 0) - ne));
|
|
2932
|
+
b.height = se, b.top = (ce.top ?? 0) + ne;
|
|
2942
2933
|
}
|
|
2943
2934
|
if (d.includes("b")) {
|
|
2944
|
-
const se = Math.min(_, Math.max(
|
|
2945
|
-
|
|
2935
|
+
const se = Math.min(_, Math.max(P, (ce.height ?? 0) + ne));
|
|
2936
|
+
b.height = se;
|
|
2946
2937
|
}
|
|
2947
2938
|
if (d.includes("l")) {
|
|
2948
2939
|
const se = Math.min(I, Math.max(g, (ce.width ?? 0) - W));
|
|
2949
|
-
|
|
2940
|
+
b.width = se, b.left = (ce.left ?? 0) + W;
|
|
2950
2941
|
}
|
|
2951
2942
|
if (d.includes("r")) {
|
|
2952
2943
|
const se = Math.min(I, Math.max(g, (ce.width ?? 0) + W));
|
|
2953
|
-
|
|
2944
|
+
b.width = se;
|
|
2954
2945
|
}
|
|
2955
|
-
H.dispatchEvent(new CustomEvent("resize")),
|
|
2946
|
+
H.dispatchEvent(new CustomEvent("resize")), M(G), re(b);
|
|
2956
2947
|
}
|
|
2957
|
-
function
|
|
2958
|
-
document.documentElement.style.cursor = "", d = null,
|
|
2948
|
+
function E() {
|
|
2949
|
+
document.documentElement.style.cursor = "", d = null, w.forEach((G) => {
|
|
2959
2950
|
G();
|
|
2960
|
-
}),
|
|
2951
|
+
}), w.length = 0;
|
|
2961
2952
|
}
|
|
2962
|
-
function
|
|
2963
|
-
const
|
|
2953
|
+
function K(G) {
|
|
2954
|
+
const Z = {
|
|
2964
2955
|
t: "n",
|
|
2965
2956
|
r: "e",
|
|
2966
2957
|
b: "s",
|
|
2967
2958
|
l: "w"
|
|
2968
2959
|
};
|
|
2969
|
-
return G.split("").map((H) =>
|
|
2960
|
+
return G.split("").map((H) => Z[H]).join("") + "-resize";
|
|
2970
2961
|
}
|
|
2971
2962
|
function X(G) {
|
|
2972
|
-
const
|
|
2973
|
-
if (!
|
|
2963
|
+
const Z = Ee(e);
|
|
2964
|
+
if (!Z)
|
|
2974
2965
|
return;
|
|
2975
|
-
const H =
|
|
2966
|
+
const H = Z.$el;
|
|
2976
2967
|
if (console.log(l), l !== "page" && G == "page") {
|
|
2977
|
-
const ie = Jt(H),
|
|
2968
|
+
const ie = Jt(H), Y = Ee(ie) ?? null;
|
|
2978
2969
|
let W = 0;
|
|
2979
|
-
if (
|
|
2980
|
-
const ne = window.getComputedStyle(
|
|
2981
|
-
W = parseInt(ne.getPropertyValue("width")) -
|
|
2970
|
+
if (Y != null) {
|
|
2971
|
+
const ne = window.getComputedStyle(Y);
|
|
2972
|
+
W = parseInt(ne.getPropertyValue("width")) - Y.offsetLeft;
|
|
2982
2973
|
}
|
|
2983
2974
|
H.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", H.offsetHeight, u.value = !0, re({
|
|
2984
2975
|
height: void 0,
|
|
@@ -2989,7 +2980,7 @@ function _n(e, t = {}) {
|
|
|
2989
2980
|
}), me(H, "transitionend", () => {
|
|
2990
2981
|
H.style.width = "auto", H.style.top = "", H.style.left = "", H.style.position = "", H.style.transition = "", u.value = !1;
|
|
2991
2982
|
}, { once: !0 });
|
|
2992
|
-
} else if ((l == "page" ||
|
|
2983
|
+
} else if ((l == "page" || Z.$el.style.position !== "absolute") && G !== "page") {
|
|
2993
2984
|
H.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0, y = {
|
|
2994
2985
|
height: parseInt(window.getComputedStyle(H).getPropertyValue("height")),
|
|
2995
2986
|
width: parseInt(window.getComputedStyle(H).getPropertyValue("width")),
|
|
@@ -2998,41 +2989,41 @@ function _n(e, t = {}) {
|
|
|
2998
2989
|
position: "absolute"
|
|
2999
2990
|
}, re(y), H.offsetHeight;
|
|
3000
2991
|
const ie = y;
|
|
3001
|
-
G == "freestyle" ?
|
|
2992
|
+
G == "freestyle" ? b = {
|
|
3002
2993
|
height: ie.height,
|
|
3003
2994
|
width: (ie.width ?? 100) / 2,
|
|
3004
2995
|
top: (ie.top ?? 0) + 2,
|
|
3005
2996
|
left: (ie.left ?? 0) + 2,
|
|
3006
2997
|
position: "absolute"
|
|
3007
|
-
} : G == "blade" && (
|
|
2998
|
+
} : G == "blade" && (b = {
|
|
3008
2999
|
height: ie.height,
|
|
3009
3000
|
width: (ie.width ?? 100) / 2,
|
|
3010
3001
|
top: (ie.top ?? 0) + 2,
|
|
3011
3002
|
left: (ie.left ?? 0) + 2,
|
|
3012
3003
|
position: "absolute"
|
|
3013
|
-
}), re(
|
|
3004
|
+
}), re(b), me(H, "transitionend", () => {
|
|
3014
3005
|
H.style.transition = "", u.value = !1;
|
|
3015
3006
|
}, { once: !0 });
|
|
3016
3007
|
}
|
|
3017
3008
|
}
|
|
3018
3009
|
function re(G) {
|
|
3019
|
-
const
|
|
3020
|
-
if (!
|
|
3010
|
+
const Z = Ee(e);
|
|
3011
|
+
if (!Z)
|
|
3021
3012
|
return;
|
|
3022
|
-
const H =
|
|
3013
|
+
const H = Z.$el;
|
|
3023
3014
|
G.top ? H.style.top = `${G.top}px` : H.style.top = void 0, G.left ? H.style.left = `${G.left}px` : H.style.left = void 0, G.height ? H.style.height = `${G.height}px` : H.style.height = void 0, G.width ? H.style.width = `${G.width}px` : H.style.width = void 0, G.position ? H.style.position = `${G.position}` : H.style.position = void 0, console.log(H.style.position);
|
|
3024
3015
|
}
|
|
3025
|
-
function ue(G,
|
|
3016
|
+
function ue(G, Z) {
|
|
3026
3017
|
if (D.value)
|
|
3027
3018
|
return;
|
|
3028
3019
|
const H = Ee(e);
|
|
3029
|
-
H && (
|
|
3020
|
+
H && (A(H, G ?? Tn), X(Z), r.push(me(H.$el, "mousedown", C)), r.push(me(H.$el, "touchstart", C)), D.value = !0, l = Z);
|
|
3030
3021
|
}
|
|
3031
3022
|
function be(G) {
|
|
3032
3023
|
if (!D.value)
|
|
3033
3024
|
return;
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3025
|
+
const Z = Ee(e);
|
|
3026
|
+
Z && (T(Z), X(G), r.forEach((H) => {
|
|
3036
3027
|
H();
|
|
3037
3028
|
}), r.length = 0, D.value = !1);
|
|
3038
3029
|
}
|
|
@@ -3043,16 +3034,16 @@ function _n(e, t = {}) {
|
|
|
3043
3034
|
};
|
|
3044
3035
|
}
|
|
3045
3036
|
function Cn(e) {
|
|
3046
|
-
const t = (e == null ? void 0 : e.blade) ?? z(null), l = (e == null ? void 0 : e.handle) ?? z(null),
|
|
3037
|
+
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"), I = z({}), { turnResizingOff: P, turnResizingOn: _ } = _n(t), { turnDraggableOff: N, turnDraggableOn: $ } = xn(t, l);
|
|
3047
3038
|
jt(t, (h) => {
|
|
3048
3039
|
const u = h[0], { width: r } = u.contentRect;
|
|
3049
|
-
|
|
3040
|
+
S.value = r < s;
|
|
3050
3041
|
});
|
|
3051
3042
|
function d(h) {
|
|
3052
|
-
N(), h == "page" ?
|
|
3043
|
+
N(), h == "page" ? P(h) : h == "blade" ? _(["l", "r"], h) : h == "freestyle" ? (P(), _(void 0, h), $()) : h == "inline" && P();
|
|
3053
3044
|
}
|
|
3054
3045
|
return d(g.value), Te(g, (h) => d(h)), {
|
|
3055
|
-
isMobile:
|
|
3046
|
+
isMobile: S,
|
|
3056
3047
|
variant: g,
|
|
3057
3048
|
bladeData: I
|
|
3058
3049
|
};
|
|
@@ -3096,7 +3087,7 @@ function ya(e) {
|
|
|
3096
3087
|
function Pn(e) {
|
|
3097
3088
|
const t = z({});
|
|
3098
3089
|
let l = e.vuetifyInstance;
|
|
3099
|
-
function
|
|
3090
|
+
function S() {
|
|
3100
3091
|
const d = localStorage.getItem("cosmetics");
|
|
3101
3092
|
d != null && d.length > 0 ? t.value = JSON.parse(d) : t.value = {
|
|
3102
3093
|
theme: e.defaultTheme ?? "light",
|
|
@@ -3131,7 +3122,7 @@ function Pn(e) {
|
|
|
3131
3122
|
u.colors.primary = d, r.colors.primary = d, (h = document.querySelector('meta[name="theme-color"]')) == null || h.setAttribute("content", d);
|
|
3132
3123
|
}
|
|
3133
3124
|
}
|
|
3134
|
-
function
|
|
3125
|
+
function P() {
|
|
3135
3126
|
t.value.drawer = !t.value.drawer;
|
|
3136
3127
|
}
|
|
3137
3128
|
function _() {
|
|
@@ -3147,13 +3138,13 @@ function Pn(e) {
|
|
|
3147
3138
|
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", "");
|
|
3148
3139
|
}
|
|
3149
3140
|
}
|
|
3150
|
-
return
|
|
3141
|
+
return S(), Te(t, () => {
|
|
3151
3142
|
s();
|
|
3152
3143
|
}), Dr = {
|
|
3153
3144
|
state: t,
|
|
3154
3145
|
resetCosmetics: g,
|
|
3155
3146
|
setTemporaryColor: I,
|
|
3156
|
-
toggleDrawer:
|
|
3147
|
+
toggleDrawer: P,
|
|
3157
3148
|
toggleDrawerStick: _,
|
|
3158
3149
|
toggleLightDark: N,
|
|
3159
3150
|
undoTemporaryColor: $
|
|
@@ -3162,41 +3153,41 @@ function Pn(e) {
|
|
|
3162
3153
|
const wa = {
|
|
3163
3154
|
canExportCSV: !1
|
|
3164
3155
|
};
|
|
3165
|
-
function
|
|
3156
|
+
function Ln() {
|
|
3166
3157
|
function e(t) {
|
|
3167
3158
|
const {
|
|
3168
3159
|
items: l,
|
|
3169
|
-
headers:
|
|
3160
|
+
headers: S,
|
|
3170
3161
|
fileName: s = "data.csv",
|
|
3171
3162
|
format: g = "file"
|
|
3172
3163
|
} = t;
|
|
3173
3164
|
if (!_e(l))
|
|
3174
3165
|
return;
|
|
3175
3166
|
let I = [];
|
|
3176
|
-
|
|
3167
|
+
S != null ? I = S == null ? void 0 : S.filter((D) => (D.csv ?? D.csvText ?? D.csvFilter ?? D.csvArray) != null).map((D) => ({
|
|
3177
3168
|
header: D.title ?? D.value ?? "",
|
|
3178
3169
|
itemText: D.itemText,
|
|
3179
3170
|
value: D.value
|
|
3180
3171
|
})) : I = Object.keys(l[0]).map((D) => ({ header: tn(D) ?? "", value: D })), I = I.filter((D) => D.header.length > 0);
|
|
3181
|
-
var
|
|
3172
|
+
var P = [];
|
|
3182
3173
|
for (let D = 0; D < l.length; D++) {
|
|
3183
3174
|
const c = l[D];
|
|
3184
3175
|
var _ = {}, N = [];
|
|
3185
3176
|
for (let y = 0; y < I.length; y++) {
|
|
3186
|
-
const
|
|
3177
|
+
const b = I[y];
|
|
3187
3178
|
var $ = null;
|
|
3188
|
-
typeof
|
|
3179
|
+
typeof b.value == "function" ? $ = b.value(c) : typeof b.value == "string" && ($ = Sr(c, b.value)), b.itemText != null ? _[b.header] = Sr($, b.itemText) : _[b.header] = $;
|
|
3189
3180
|
}
|
|
3190
|
-
|
|
3191
|
-
|
|
3181
|
+
P.push(_), _e(N) && N.forEach((y) => {
|
|
3182
|
+
P.push(y);
|
|
3192
3183
|
}), N = [];
|
|
3193
3184
|
}
|
|
3194
3185
|
var d = [];
|
|
3195
|
-
if (d.push(I.map((D) => D.header).toString()),
|
|
3186
|
+
if (d.push(I.map((D) => D.header).toString()), P.forEach((D) => {
|
|
3196
3187
|
let c = [];
|
|
3197
3188
|
I.forEach(function(y) {
|
|
3198
|
-
var
|
|
3199
|
-
c.push(
|
|
3189
|
+
var b = D[y.header];
|
|
3190
|
+
c.push(b ?? "");
|
|
3200
3191
|
}), d.push(c.join(","));
|
|
3201
3192
|
}), g == "array")
|
|
3202
3193
|
return d;
|
|
@@ -3205,9 +3196,9 @@ function Nn() {
|
|
|
3205
3196
|
if (window.navigator.msSaveOrOpenBlob)
|
|
3206
3197
|
window.navigator.msSaveOrOpenBlob(u, s);
|
|
3207
3198
|
else {
|
|
3208
|
-
var r = document.createElement("a"),
|
|
3209
|
-
r.href =
|
|
3210
|
-
document.body.removeChild(r), window.URL.revokeObjectURL(
|
|
3199
|
+
var r = document.createElement("a"), w = URL.createObjectURL(u);
|
|
3200
|
+
r.href = w, r.download = s, document.body.appendChild(r), r.click(), setTimeout(function() {
|
|
3201
|
+
document.body.removeChild(r), window.URL.revokeObjectURL(w);
|
|
3211
3202
|
}, 0);
|
|
3212
3203
|
}
|
|
3213
3204
|
}
|
|
@@ -3219,12 +3210,12 @@ let xr;
|
|
|
3219
3210
|
function ba() {
|
|
3220
3211
|
return xr;
|
|
3221
3212
|
}
|
|
3222
|
-
function
|
|
3213
|
+
function Nn(e) {
|
|
3223
3214
|
const t = e.getUTC ?? he.utc;
|
|
3224
3215
|
function l() {
|
|
3225
3216
|
return s().startOf("day").toUTC().toString() ?? "";
|
|
3226
3217
|
}
|
|
3227
|
-
function
|
|
3218
|
+
function S() {
|
|
3228
3219
|
return s().startOf("day").plus({ day: 1 }).toUTC().toString() ?? "";
|
|
3229
3220
|
}
|
|
3230
3221
|
function s(_, N) {
|
|
@@ -3243,7 +3234,7 @@ function Mn(e) {
|
|
|
3243
3234
|
function I(_, N) {
|
|
3244
3235
|
return _ == null ? t() : N ? he.fromFormat(_, N) : he.fromISO(_);
|
|
3245
3236
|
}
|
|
3246
|
-
function
|
|
3237
|
+
function P(_, N, $) {
|
|
3247
3238
|
if (_ == null)
|
|
3248
3239
|
return N ? t().toFormat(N) : t().toString();
|
|
3249
3240
|
{
|
|
@@ -3253,20 +3244,20 @@ function Mn(e) {
|
|
|
3253
3244
|
}
|
|
3254
3245
|
return xr = {
|
|
3255
3246
|
getToday: l,
|
|
3256
|
-
getTomorrow:
|
|
3247
|
+
getTomorrow: S,
|
|
3257
3248
|
tzDate: s,
|
|
3258
3249
|
tzString: g,
|
|
3259
3250
|
utcDate: I,
|
|
3260
|
-
utcString:
|
|
3251
|
+
utcString: P
|
|
3261
3252
|
}, xr;
|
|
3262
3253
|
}
|
|
3263
3254
|
let Tr;
|
|
3264
3255
|
function Sa() {
|
|
3265
3256
|
return Tr;
|
|
3266
3257
|
}
|
|
3267
|
-
function
|
|
3258
|
+
function Mn(e) {
|
|
3268
3259
|
const t = z(!1), l = (e == null ? void 0 : e.apis) ?? [];
|
|
3269
|
-
function
|
|
3260
|
+
function S() {
|
|
3270
3261
|
t.value = !0;
|
|
3271
3262
|
}
|
|
3272
3263
|
function s() {
|
|
@@ -3286,20 +3277,20 @@ function Ln(e) {
|
|
|
3286
3277
|
return Promise.resolve("no demo data available for this api");
|
|
3287
3278
|
const h = d.id ?? ((r = d.data) == null ? void 0 : r.id), u = g(d);
|
|
3288
3279
|
if (h != null && (u == null ? void 0 : u.data) != null) {
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3280
|
+
const w = u.data.findIndex((D) => D.id == h);
|
|
3281
|
+
w >= 0 && u.data.splice(w, 1);
|
|
3291
3282
|
}
|
|
3292
|
-
return new Promise(function(
|
|
3283
|
+
return new Promise(function(w) {
|
|
3293
3284
|
setTimeout(function() {
|
|
3294
|
-
|
|
3285
|
+
w(void 0);
|
|
3295
3286
|
}, 200);
|
|
3296
3287
|
});
|
|
3297
3288
|
}
|
|
3298
|
-
function
|
|
3299
|
-
var
|
|
3289
|
+
function P(d) {
|
|
3290
|
+
var w, D, c;
|
|
3300
3291
|
if (l == null)
|
|
3301
3292
|
throw new Error("no demo data available for this api");
|
|
3302
|
-
const h = d.id ?? ((
|
|
3293
|
+
const h = d.id ?? ((w = d.data) == null ? void 0 : w.id), u = g(d);
|
|
3303
3294
|
let r;
|
|
3304
3295
|
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (D = u.data) == null ? void 0 : D.find((y) => y.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((y) => {
|
|
3305
3296
|
setTimeout(() => {
|
|
@@ -3325,12 +3316,12 @@ function Ln(e) {
|
|
|
3325
3316
|
});
|
|
3326
3317
|
}
|
|
3327
3318
|
function N(d) {
|
|
3328
|
-
var r,
|
|
3319
|
+
var r, w;
|
|
3329
3320
|
if (l == null)
|
|
3330
3321
|
throw new Error("no demo data available for this api");
|
|
3331
3322
|
const h = g(d);
|
|
3332
3323
|
let u;
|
|
3333
|
-
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (
|
|
3324
|
+
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (w = h.data) == null || w.push(u))), u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
3334
3325
|
setTimeout(() => {
|
|
3335
3326
|
D({
|
|
3336
3327
|
data: u
|
|
@@ -3339,7 +3330,7 @@ function Ln(e) {
|
|
|
3339
3330
|
});
|
|
3340
3331
|
}
|
|
3341
3332
|
function $(d) {
|
|
3342
|
-
var r,
|
|
3333
|
+
var r, w;
|
|
3343
3334
|
if (l == null)
|
|
3344
3335
|
throw new Error("no demo data available for this api");
|
|
3345
3336
|
const h = g(d);
|
|
@@ -3349,7 +3340,7 @@ function Ln(e) {
|
|
|
3349
3340
|
u = h.patchAction(h.data, d.data);
|
|
3350
3341
|
else if (d.data.id != null) {
|
|
3351
3342
|
const D = (r = h.data) == null ? void 0 : r.findIndex((c) => c.id == d.data.id);
|
|
3352
|
-
D != null && D > -1 && ((
|
|
3343
|
+
D != null && D > -1 && ((w = h.data) == null || w.splice(D, 1, d.data)), u = d.data;
|
|
3353
3344
|
}
|
|
3354
3345
|
}
|
|
3355
3346
|
return u == null ? Promise.resolve(void 0) : new Promise((D) => {
|
|
@@ -3363,10 +3354,10 @@ function Ln(e) {
|
|
|
3363
3354
|
return Tr = {
|
|
3364
3355
|
endDemo: s,
|
|
3365
3356
|
isDemoing: t,
|
|
3366
|
-
startDemo:
|
|
3357
|
+
startDemo: S,
|
|
3367
3358
|
data: l,
|
|
3368
3359
|
deleteItem: I,
|
|
3369
|
-
get:
|
|
3360
|
+
get: P,
|
|
3370
3361
|
getAll: _,
|
|
3371
3362
|
post: N,
|
|
3372
3363
|
patch: $
|
|
@@ -3376,9 +3367,9 @@ var Rn = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
|
3376
3367
|
function Aa(e) {
|
|
3377
3368
|
function t(l) {
|
|
3378
3369
|
var s;
|
|
3379
|
-
const
|
|
3380
|
-
if (
|
|
3381
|
-
document.title =
|
|
3370
|
+
const S = l.matched.slice().reverse().find((g) => g.meta && g.meta.title);
|
|
3371
|
+
if (S)
|
|
3372
|
+
document.title = S.meta.title;
|
|
3382
3373
|
else {
|
|
3383
3374
|
const g = Rn.VITE_NODE_ENV;
|
|
3384
3375
|
let I = "";
|
|
@@ -3394,41 +3385,41 @@ function Ea() {
|
|
|
3394
3385
|
return _r;
|
|
3395
3386
|
}
|
|
3396
3387
|
function Un(e) {
|
|
3397
|
-
function t(f,
|
|
3398
|
-
return f ? an(f) ?
|
|
3388
|
+
function t(f, E, K) {
|
|
3389
|
+
return f ? an(f) ? K ?? "" : e.dates.tzString(f, E) : K ?? f ?? "";
|
|
3399
3390
|
}
|
|
3400
3391
|
function l(f) {
|
|
3401
3392
|
if (!f)
|
|
3402
3393
|
return "";
|
|
3403
3394
|
if (typeof f != "object")
|
|
3404
3395
|
return f;
|
|
3405
|
-
var
|
|
3406
|
-
return f.companyAccount != null && (
|
|
3396
|
+
var E = "";
|
|
3397
|
+
return f.companyAccount != null && (E = f.companyAccount.companyName + " | "), f.addressLineOne != null && (E = E + f.addressLineOne + " "), f.streetNumber != null && (E = E + f.streetNumber + " "), f.streetName != null && (E = E + f.streetName + ", "), f.suburb != null && (E = E + f.suburb + " "), f.state != null && (E = E + f.state + " "), f.postcode != null && (E = E + f.postcode), E;
|
|
3407
3398
|
}
|
|
3408
|
-
function
|
|
3399
|
+
function S(f) {
|
|
3409
3400
|
if (typeof f != "number")
|
|
3410
3401
|
return f;
|
|
3411
|
-
var
|
|
3402
|
+
var E = new Intl.NumberFormat("en-US", {
|
|
3412
3403
|
style: "currency",
|
|
3413
3404
|
currency: "AUD",
|
|
3414
3405
|
minimumFractionDigits: 2
|
|
3415
3406
|
});
|
|
3416
|
-
return
|
|
3407
|
+
return E.format(f);
|
|
3417
3408
|
}
|
|
3418
|
-
function s(f,
|
|
3419
|
-
return t(f, "ccc | d LLL",
|
|
3409
|
+
function s(f, E) {
|
|
3410
|
+
return t(f, "ccc | d LLL", E);
|
|
3420
3411
|
}
|
|
3421
|
-
function g(f,
|
|
3422
|
-
return t(f, "d LLL",
|
|
3412
|
+
function g(f, E) {
|
|
3413
|
+
return t(f, "d LLL", E);
|
|
3423
3414
|
}
|
|
3424
|
-
function I(f,
|
|
3425
|
-
return t(f, "ccc",
|
|
3415
|
+
function I(f, E) {
|
|
3416
|
+
return t(f, "ccc", E);
|
|
3426
3417
|
}
|
|
3427
|
-
function
|
|
3428
|
-
return t(f, "ccc dd LLL yyyy",
|
|
3418
|
+
function P(f, E) {
|
|
3419
|
+
return t(f, "ccc dd LLL yyyy", E);
|
|
3429
3420
|
}
|
|
3430
|
-
function _(f,
|
|
3431
|
-
return t(f, "ccc dd LLL @ hh:mm a",
|
|
3421
|
+
function _(f, E) {
|
|
3422
|
+
return t(f, "ccc dd LLL @ hh:mm a", E);
|
|
3432
3423
|
}
|
|
3433
3424
|
function N(f) {
|
|
3434
3425
|
return new Intl.NumberFormat().format(f);
|
|
@@ -3439,11 +3430,11 @@ function Un(e) {
|
|
|
3439
3430
|
function d(f) {
|
|
3440
3431
|
if (f == 0)
|
|
3441
3432
|
return "";
|
|
3442
|
-
var
|
|
3443
|
-
return f > 0 ? "+" +
|
|
3433
|
+
var E = new Intl.NumberFormat().format(f);
|
|
3434
|
+
return f > 0 ? "+" + E : E;
|
|
3444
3435
|
}
|
|
3445
|
-
function h(f,
|
|
3446
|
-
return e.dates.utcString(f,
|
|
3436
|
+
function h(f, E) {
|
|
3437
|
+
return e.dates.utcString(f, E);
|
|
3447
3438
|
}
|
|
3448
3439
|
function u(f) {
|
|
3449
3440
|
return rt(f, !1);
|
|
@@ -3453,44 +3444,44 @@ function Un(e) {
|
|
|
3453
3444
|
return "";
|
|
3454
3445
|
if (typeof f != "object")
|
|
3455
3446
|
return f;
|
|
3456
|
-
var
|
|
3457
|
-
return f.addressLineOne != null && (
|
|
3447
|
+
var E = "";
|
|
3448
|
+
return f.addressLineOne != null && (E = f.addressLineOne + " "), f.streetNumber != null && (E = E + f.streetNumber + " "), f.streetName != null && (E = E + f.streetName + " "), f.suburb != null && (E = E + f.suburb + " "), f.state != null && (E = E + f.state + " "), f.postcode != null && (E = E + f.postcode), E = E.replaceAll(",", " "), E;
|
|
3458
3449
|
}
|
|
3459
|
-
function
|
|
3460
|
-
return t(f, "
|
|
3450
|
+
function w(f, E) {
|
|
3451
|
+
return t(f, "ccc dd LLL yyyy", E);
|
|
3461
3452
|
}
|
|
3462
|
-
function D(f,
|
|
3463
|
-
return t(f, "ccc dd LLL yyyy hh:mm a",
|
|
3453
|
+
function D(f, E) {
|
|
3454
|
+
return t(f, "ccc dd LLL yyyy hh:mm a", E);
|
|
3464
3455
|
}
|
|
3465
3456
|
function c(f) {
|
|
3466
|
-
var
|
|
3457
|
+
var E = new Intl.NumberFormat("en-US", {
|
|
3467
3458
|
style: "percent",
|
|
3468
3459
|
minimumFractionDigits: 2
|
|
3469
3460
|
});
|
|
3470
|
-
return
|
|
3461
|
+
return E.format(f);
|
|
3471
3462
|
}
|
|
3472
3463
|
function y(f) {
|
|
3473
3464
|
return f.replaceAll(",", " ");
|
|
3474
3465
|
}
|
|
3475
|
-
function
|
|
3476
|
-
return t(f, "dd LLL yyyy",
|
|
3466
|
+
function b(f, E) {
|
|
3467
|
+
return t(f, "dd LLL yyyy", E);
|
|
3477
3468
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return t(f, "dd LLL yyyy hh:mm a",
|
|
3469
|
+
function M(f, E) {
|
|
3470
|
+
return t(f, "dd LLL yyyy hh:mm a", E);
|
|
3480
3471
|
}
|
|
3481
|
-
function
|
|
3482
|
-
return t(f, "hh:mm a",
|
|
3472
|
+
function A(f, E) {
|
|
3473
|
+
return t(f, "hh:mm a", E);
|
|
3483
3474
|
}
|
|
3484
3475
|
function T(f) {
|
|
3485
3476
|
return f == null ? "" : typeof f == "number" ? e.dates.tzDate().startOf("day").plus({ minutes: f }).toFormat("T") : typeof f == "string" ? e.dates.tzString(f, "t") : "unknown";
|
|
3486
3477
|
}
|
|
3487
3478
|
const x = {
|
|
3488
3479
|
toCompanyNameAndLocationLine: l,
|
|
3489
|
-
toCurrency:
|
|
3480
|
+
toCurrency: S,
|
|
3490
3481
|
toDayDate: s,
|
|
3491
3482
|
toDayMonth: g,
|
|
3492
3483
|
toDayOfWeek: I,
|
|
3493
|
-
toDayShortDate:
|
|
3484
|
+
toDayShortDate: P,
|
|
3494
3485
|
toDayShortDateAndTime: _,
|
|
3495
3486
|
toDisplayNumber: N,
|
|
3496
3487
|
toDisplayNumberOver: $,
|
|
@@ -3498,69 +3489,69 @@ function Un(e) {
|
|
|
3498
3489
|
toFormat: h,
|
|
3499
3490
|
toLocationLine: u,
|
|
3500
3491
|
toLocationLineNoCommas: r,
|
|
3501
|
-
toLongDate:
|
|
3492
|
+
toLongDate: w,
|
|
3502
3493
|
toLongDateAndTime: D,
|
|
3503
3494
|
toPercent: c,
|
|
3504
3495
|
toPrettyCSV: y,
|
|
3505
|
-
toShortDate:
|
|
3506
|
-
toShortDateAndTime:
|
|
3507
|
-
toTime:
|
|
3496
|
+
toShortDate: b,
|
|
3497
|
+
toShortDateAndTime: M,
|
|
3498
|
+
toTime: A,
|
|
3508
3499
|
toTimeOfDay: T
|
|
3509
3500
|
};
|
|
3510
|
-
function
|
|
3501
|
+
function C(f) {
|
|
3511
3502
|
if (f != null) {
|
|
3512
|
-
let
|
|
3513
|
-
if (
|
|
3514
|
-
return x[
|
|
3503
|
+
let E = f;
|
|
3504
|
+
if (E != null && x[E] != null)
|
|
3505
|
+
return x[E];
|
|
3515
3506
|
}
|
|
3516
|
-
return (
|
|
3507
|
+
return (E) => E;
|
|
3517
3508
|
}
|
|
3518
3509
|
return _r = {
|
|
3519
|
-
findFilter:
|
|
3510
|
+
findFilter: C,
|
|
3520
3511
|
...x
|
|
3521
3512
|
}, _r;
|
|
3522
3513
|
}
|
|
3523
3514
|
function Bn(e, t) {
|
|
3524
|
-
const l = z(!1),
|
|
3515
|
+
const l = z(!1), S = Zt(e);
|
|
3525
3516
|
let s = g(J(e));
|
|
3526
|
-
(t == null ? void 0 : t.useTracker) !== !1 && Te(
|
|
3527
|
-
l.value = g(
|
|
3517
|
+
(t == null ? void 0 : t.useTracker) !== !1 && Te(S, (P) => {
|
|
3518
|
+
l.value = g(P) != s;
|
|
3528
3519
|
}, { deep: !0 });
|
|
3529
|
-
function g(
|
|
3530
|
-
const _ =
|
|
3520
|
+
function g(P) {
|
|
3521
|
+
const _ = Mr(P);
|
|
3531
3522
|
return t != null && (t.propsToIgnore != null ? t.propsToIgnore.forEach((N) => {
|
|
3532
3523
|
delete _[N];
|
|
3533
|
-
}) : t.propsToTrack != null && Object.keys(
|
|
3524
|
+
}) : t.propsToTrack != null && Object.keys(P).forEach(($) => {
|
|
3534
3525
|
t.propsToTrack.some((d) => d == $) || delete _[$];
|
|
3535
3526
|
})), JSON.stringify(_);
|
|
3536
3527
|
}
|
|
3537
3528
|
function I() {
|
|
3538
|
-
s = g(J(
|
|
3529
|
+
s = g(J(S)), l.value = !1;
|
|
3539
3530
|
}
|
|
3540
3531
|
return {
|
|
3541
|
-
asyncItem:
|
|
3532
|
+
asyncItem: S,
|
|
3542
3533
|
isChanged: l,
|
|
3543
3534
|
restartTracker: I
|
|
3544
3535
|
};
|
|
3545
3536
|
}
|
|
3546
3537
|
function Ia(e, t) {
|
|
3547
|
-
var
|
|
3538
|
+
var Y;
|
|
3548
3539
|
const {
|
|
3549
3540
|
// useBladeSrc = true,
|
|
3550
3541
|
useRouteSrc: l = !0
|
|
3551
|
-
} = t ?? {},
|
|
3542
|
+
} = 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", I = Nr(), P = et(), _ = J(e.proxyQueryKey), N = ee(() => {
|
|
3552
3543
|
var W;
|
|
3553
|
-
return J(e.proxyID) ?? (_ != null ? (W =
|
|
3554
|
-
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems:
|
|
3544
|
+
return J(e.proxyID) ?? (_ != null ? (W = P == null ? void 0 : P.query) == null ? void 0 : W[_] : void 0);
|
|
3545
|
+
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: w, restoreItem: D, saveItem: c } = ut({
|
|
3555
3546
|
nav: g,
|
|
3556
3547
|
onError: e.onError ?? (t == null ? void 0 : t.onError),
|
|
3557
3548
|
proxyID: N.value,
|
|
3558
|
-
store:
|
|
3559
|
-
storeMode:
|
|
3549
|
+
store: Ne({
|
|
3550
|
+
storeMode: S,
|
|
3560
3551
|
storageMode: s,
|
|
3561
3552
|
nav: g
|
|
3562
3553
|
})
|
|
3563
|
-
}), y = ee(() => e.errorMsg ?? d.value),
|
|
3554
|
+
}), y = ee(() => e.errorMsg ?? d.value), b = ee(() => e.loadingMsg ?? h.value), M = ee(() => b.value != null), A = z(e.itemID ?? (l ? (Y = P == null ? void 0 : P.params) == null ? void 0 : Y.id : void 0)), T = z(A.value == "new" ? "new" : e.startEditing ? "edit" : "view"), x = Me(!1), C = ee(() => {
|
|
3564
3555
|
let W = e.params != null ? { ...e.params } : {};
|
|
3565
3556
|
return e.includeDetails != null && (W.includeDetails = e.includeDetails), W;
|
|
3566
3557
|
}), f = ee(() => {
|
|
@@ -3568,12 +3559,12 @@ function Ia(e, t) {
|
|
|
3568
3559
|
return !1;
|
|
3569
3560
|
const W = J($);
|
|
3570
3561
|
return e.onCanDelete != null ? e.onCanDelete(W) : (W == null ? void 0 : W.isInactive) !== !0;
|
|
3571
|
-
}),
|
|
3562
|
+
}), E = ee(() => {
|
|
3572
3563
|
if (T.value == "new")
|
|
3573
3564
|
return !1;
|
|
3574
3565
|
const W = J($);
|
|
3575
3566
|
return e.onCanEdit != null ? e.onCanEdit(W) : !0;
|
|
3576
|
-
}),
|
|
3567
|
+
}), K = ee(() => {
|
|
3577
3568
|
if (T.value == "new")
|
|
3578
3569
|
return !1;
|
|
3579
3570
|
const W = J($);
|
|
@@ -3623,16 +3614,16 @@ function Ia(e, t) {
|
|
|
3623
3614
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3624
3615
|
});
|
|
3625
3616
|
}
|
|
3626
|
-
async function
|
|
3617
|
+
async function Z(W) {
|
|
3627
3618
|
if (x.value = !1, e.item != null)
|
|
3628
3619
|
$.value = e.item;
|
|
3629
3620
|
else {
|
|
3630
3621
|
const ne = {
|
|
3631
3622
|
additionalUrl: e.additionalUrl,
|
|
3632
|
-
id:
|
|
3623
|
+
id: A.value,
|
|
3633
3624
|
nav: g,
|
|
3634
3625
|
proxyID: N.value,
|
|
3635
|
-
params:
|
|
3626
|
+
params: C.value,
|
|
3636
3627
|
//props.params,
|
|
3637
3628
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3638
3629
|
refresh: (W == null ? void 0 : W.deepRefresh) ?? !1,
|
|
@@ -3642,7 +3633,7 @@ function Ia(e, t) {
|
|
|
3642
3633
|
if (e.isSingle === !0)
|
|
3643
3634
|
ne.id === "new" ? $.value = e.onGetNew ? e.onGetNew() : {} : $.value = await r(ne);
|
|
3644
3635
|
else {
|
|
3645
|
-
const ce = await
|
|
3636
|
+
const ce = await w(ne);
|
|
3646
3637
|
$.value = ce.data;
|
|
3647
3638
|
}
|
|
3648
3639
|
}
|
|
@@ -3677,10 +3668,10 @@ function Ia(e, t) {
|
|
|
3677
3668
|
return Te(y, (W) => {
|
|
3678
3669
|
x.value = W != null;
|
|
3679
3670
|
}), Te(() => e.refreshToggle, () => {
|
|
3680
|
-
|
|
3671
|
+
Z({ deepRefresh: !0 });
|
|
3681
3672
|
}), Xr(async () => {
|
|
3682
3673
|
var W;
|
|
3683
|
-
e.eager == !0 && await
|
|
3674
|
+
e.eager == !0 && await Z({ deepRefresh: ((W = P == null ? void 0 : P.params) == null ? void 0 : W.refresh) == "true" });
|
|
3684
3675
|
}), {
|
|
3685
3676
|
asyncItem: $,
|
|
3686
3677
|
deleteItem: be,
|
|
@@ -3688,21 +3679,21 @@ function Ia(e, t) {
|
|
|
3688
3679
|
isChanged: re,
|
|
3689
3680
|
isDeletable: f,
|
|
3690
3681
|
isEditing: ee(() => T.value == "new" || T.value == "edit"),
|
|
3691
|
-
isEditable:
|
|
3692
|
-
isLoading:
|
|
3682
|
+
isEditable: E,
|
|
3683
|
+
isLoading: M,
|
|
3693
3684
|
isNew: ee(() => T.value == "new"),
|
|
3694
|
-
isRestorable:
|
|
3685
|
+
isRestorable: K,
|
|
3695
3686
|
isSaveable: X,
|
|
3696
|
-
loadingMsg:
|
|
3687
|
+
loadingMsg: b,
|
|
3697
3688
|
mode: T,
|
|
3698
|
-
refresh:
|
|
3689
|
+
refresh: Z,
|
|
3699
3690
|
restoreItem: G,
|
|
3700
3691
|
saveItem: H,
|
|
3701
3692
|
showError: x,
|
|
3702
3693
|
toggleMode: ie
|
|
3703
3694
|
};
|
|
3704
3695
|
}
|
|
3705
|
-
const Vr = z(!0), zr = z(!1),
|
|
3696
|
+
const Vr = z(!0), zr = z(!1), Zr = z(), gr = z(!1);
|
|
3706
3697
|
let yr = null, Cr;
|
|
3707
3698
|
function it() {
|
|
3708
3699
|
return Cr;
|
|
@@ -3719,37 +3710,37 @@ function $n(e) {
|
|
|
3719
3710
|
displayName: h.displayName ?? e.getDisplayName(h),
|
|
3720
3711
|
...h
|
|
3721
3712
|
}));
|
|
3722
|
-
function
|
|
3713
|
+
function S(h) {
|
|
3723
3714
|
var u;
|
|
3724
|
-
return (u =
|
|
3715
|
+
return (u = P(h)) == null ? void 0 : u.archiveName;
|
|
3725
3716
|
}
|
|
3726
3717
|
function s(h) {
|
|
3727
3718
|
var u;
|
|
3728
|
-
return ((u =
|
|
3719
|
+
return ((u = P(h)) == null ? void 0 : u.cacheExpiryHours) ?? t;
|
|
3729
3720
|
}
|
|
3730
3721
|
function g(h) {
|
|
3731
3722
|
var u;
|
|
3732
|
-
return (u =
|
|
3723
|
+
return (u = P(h)) == null ? void 0 : u.displayName;
|
|
3733
3724
|
}
|
|
3734
3725
|
function I(h) {
|
|
3735
3726
|
var u;
|
|
3736
|
-
return (u =
|
|
3727
|
+
return (u = P(h)) == null ? void 0 : u.icon;
|
|
3737
3728
|
}
|
|
3738
|
-
function
|
|
3729
|
+
function P(h) {
|
|
3739
3730
|
return h == null ? null : typeof h != "string" ? h : tt(l, (r) => r.children).find((r) => {
|
|
3740
|
-
var
|
|
3741
|
-
return r.name == h || r.singleName == h || ((
|
|
3731
|
+
var w;
|
|
3732
|
+
return r.name == h || r.singleName == h || ((w = r.aliases) == null ? void 0 : w.some((D) => D == h));
|
|
3742
3733
|
}) ?? null;
|
|
3743
3734
|
}
|
|
3744
3735
|
function _(h) {
|
|
3745
|
-
const u =
|
|
3736
|
+
const u = P(h);
|
|
3746
3737
|
if (u == null)
|
|
3747
3738
|
return;
|
|
3748
3739
|
let r = gn(u.microservice ?? "default") ?? "";
|
|
3749
3740
|
return u.path != null && (r = Ue(r, u.path)), r != null && r.endsWith("/") && (r = r.slice(0, r.length - 1)), r;
|
|
3750
3741
|
}
|
|
3751
3742
|
function N(h) {
|
|
3752
|
-
const u =
|
|
3743
|
+
const u = P(h);
|
|
3753
3744
|
if ((u == null ? void 0 : u.singleName) != null)
|
|
3754
3745
|
return u.singleName;
|
|
3755
3746
|
const r = u == null ? void 0 : u.displayName;
|
|
@@ -3757,28 +3748,28 @@ function $n(e) {
|
|
|
3757
3748
|
return mn(r);
|
|
3758
3749
|
}
|
|
3759
3750
|
function $(h) {
|
|
3760
|
-
const u =
|
|
3751
|
+
const u = P(h);
|
|
3761
3752
|
return (u == null ? void 0 : u.name) ?? (u == null ? void 0 : u.singleName);
|
|
3762
3753
|
}
|
|
3763
3754
|
function d(h) {
|
|
3764
3755
|
if (h == null)
|
|
3765
3756
|
return;
|
|
3766
|
-
const u = typeof h == "string" ?
|
|
3767
|
-
|
|
3757
|
+
const u = typeof h == "string" ? P(h) : h;
|
|
3758
|
+
Zr.value = u == null ? void 0 : u.background, zr.value = (u == null ? void 0 : u.hideNavigation) !== !0, Vr.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) => {
|
|
3768
3759
|
r.preventDefault();
|
|
3769
3760
|
}));
|
|
3770
3761
|
}
|
|
3771
3762
|
return Cr = {
|
|
3772
3763
|
showAppBar: Vr,
|
|
3773
3764
|
showAppNavigation: zr,
|
|
3774
|
-
backgroundName:
|
|
3765
|
+
backgroundName: Zr,
|
|
3775
3766
|
hesitate: gr,
|
|
3776
3767
|
navigationItems: l,
|
|
3777
|
-
findArchiveName:
|
|
3768
|
+
findArchiveName: S,
|
|
3778
3769
|
findCacheHours: s,
|
|
3779
3770
|
findDisplay: g,
|
|
3780
3771
|
findIcon: I,
|
|
3781
|
-
findItem:
|
|
3772
|
+
findItem: P,
|
|
3782
3773
|
findStoreName: $,
|
|
3783
3774
|
findPath: _,
|
|
3784
3775
|
findSingleDisplay: N,
|
|
@@ -3787,17 +3778,17 @@ function $n(e) {
|
|
|
3787
3778
|
}
|
|
3788
3779
|
function Da(e, t, l) {
|
|
3789
3780
|
var He, Ve;
|
|
3790
|
-
const
|
|
3781
|
+
const S = Ln(), s = it(), g = Nr(), I = et(), { bladeData: P } = Cn({}), _ = e.useBladeSrc ?? !0, N = e.useRouteSrc ?? !0, $ = e.nav ?? e.bladeName ?? e.itemBladeName ?? "basic", d = e.storeMode ?? ((He = s.findItem($)) == null ? void 0 : He.storeMode), h = e.storageMode ?? ((Ve = s.findItem($)) == null ? void 0 : Ve.storageMode), u = J(e.customFilters) ?? [], r = z([]), w = ee(() => Kt([
|
|
3791
3782
|
...u.filter((U) => U.name != null).map((U) => U.name),
|
|
3792
3783
|
...e.defaultFilters ?? [],
|
|
3793
3784
|
...r.value
|
|
3794
|
-
]).value), D = z((e.defaultFilters ?? []).map((U) =>
|
|
3785
|
+
]).value), D = z((e.defaultFilters ?? []).map((U) => w.value.indexOf(U)));
|
|
3795
3786
|
let c = z([...D.value]);
|
|
3796
|
-
const y = ee(() => Gr(c, D).value.length > 0 || Gr(D, c).value.length > 0),
|
|
3797
|
-
function
|
|
3787
|
+
const y = ee(() => Gr(c, D).value.length > 0 || Gr(D, c).value.length > 0), b = z(M());
|
|
3788
|
+
function M() {
|
|
3798
3789
|
var U, Q;
|
|
3799
3790
|
if (_) {
|
|
3800
|
-
const V = (U =
|
|
3791
|
+
const V = (U = P.value) == null ? void 0 : U.page;
|
|
3801
3792
|
if (V != null)
|
|
3802
3793
|
return Number.parseInt(V);
|
|
3803
3794
|
}
|
|
@@ -3808,10 +3799,10 @@ function Da(e, t, l) {
|
|
|
3808
3799
|
}
|
|
3809
3800
|
return 1;
|
|
3810
3801
|
}
|
|
3811
|
-
const
|
|
3802
|
+
const A = ee(() => {
|
|
3812
3803
|
var U, Q;
|
|
3813
3804
|
if (_) {
|
|
3814
|
-
const V = (U =
|
|
3805
|
+
const V = (U = P.value) == null ? void 0 : U.proxyID;
|
|
3815
3806
|
if (V != null)
|
|
3816
3807
|
return V;
|
|
3817
3808
|
}
|
|
@@ -3825,7 +3816,7 @@ function Da(e, t, l) {
|
|
|
3825
3816
|
function x() {
|
|
3826
3817
|
var U, Q;
|
|
3827
3818
|
if (_) {
|
|
3828
|
-
const V = (U =
|
|
3819
|
+
const V = (U = P.value) == null ? void 0 : U.search;
|
|
3829
3820
|
if (V != null)
|
|
3830
3821
|
return V;
|
|
3831
3822
|
}
|
|
@@ -3835,24 +3826,24 @@ function Da(e, t, l) {
|
|
|
3835
3826
|
return V;
|
|
3836
3827
|
}
|
|
3837
3828
|
}
|
|
3838
|
-
const
|
|
3829
|
+
const C = z(J(e.startShowingInactive) ?? !1), f = ee(() => [
|
|
3839
3830
|
...e.searchProps ?? [],
|
|
3840
3831
|
...(e.headers ?? []).filter((U) => U.searchable != null && U.value != null).map((U) => U.value ?? "")
|
|
3841
|
-
]),
|
|
3832
|
+
]), E = z([]), K = Me([]), X = z([]);
|
|
3842
3833
|
let re;
|
|
3843
|
-
const { actionErrorMsg: ue, actionLoadingMsg: be, deleteItem: G, doAction:
|
|
3834
|
+
const { actionErrorMsg: ue, actionLoadingMsg: be, deleteItem: G, doAction: Z, getItem: H, getAllItems: ie, restoreItem: Y } = ut({
|
|
3844
3835
|
nav: $,
|
|
3845
3836
|
onError: e.onError ?? (l == null ? void 0 : l.onError),
|
|
3846
|
-
proxyID:
|
|
3847
|
-
store:
|
|
3837
|
+
proxyID: A.value,
|
|
3838
|
+
store: Ne({
|
|
3848
3839
|
storeMode: d,
|
|
3849
3840
|
storageMode: h,
|
|
3850
3841
|
nav: $
|
|
3851
3842
|
})
|
|
3852
|
-
}), W = ee(() => e.errorMsg ?? ue.value), ne = ee(() => e.loadingMsg ?? be.value), ce = ee(() => ne.value != null), se =
|
|
3843
|
+
}), W = ee(() => e.errorMsg ?? ue.value), ne = ee(() => e.loadingMsg ?? be.value), ce = ee(() => ne.value != null), se = Me(!1), ge = Me(e.showSearch ?? !0), Be = z(0), $e = ee(() => {
|
|
3853
3844
|
let U, Q = [];
|
|
3854
3845
|
D.value.forEach((O) => {
|
|
3855
|
-
const de =
|
|
3846
|
+
const de = w.value[O], ye = u.find((De) => De.name == de);
|
|
3856
3847
|
ye != null ? U = U != null ? `${U}ANDALSO${ye.filterFunction()}` : ye.filterFunction() : Q.push(de);
|
|
3857
3848
|
});
|
|
3858
3849
|
const V = {};
|
|
@@ -3860,8 +3851,8 @@ function Da(e, t, l) {
|
|
|
3860
3851
|
}), Fe = ee(() => {
|
|
3861
3852
|
var Q;
|
|
3862
3853
|
let U = e.params != null ? { ...e.params } : {};
|
|
3863
|
-
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (
|
|
3864
|
-
}), tr = ee(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = ee(() => (U) =>
|
|
3854
|
+
return e.useServerPagination && e.itemsPerPage != null && (U.includeCount = !0, U.takeAmount = e.itemsPerPage, U.takeFrom = (b.value - 1) * e.itemsPerPage), $e.value != null && (U = { ...U, ...$e.value }), C.value && (U.includeInactive = !0), _e(e.selectProps) && (U.properties = (Q = e.selectProps) == null ? void 0 : Q.toString()), T.value != null && (U.searchString = T.value), U;
|
|
3855
|
+
}), tr = ee(() => (U) => e.onCanDelete != null ? e.onCanDelete(U) : !(U != null && U.isInactive === !0)), nr = ee(() => (U) => C.value ? e.onCanRestore != null ? e.onCanRestore(U) : (U == null ? void 0 : U.isInactive) === !0 : !1), Ce = ee(() => X.value.filter((U) => !U.hide)), ar = ee(() => {
|
|
3865
3856
|
let U = new Array();
|
|
3866
3857
|
return Ce.value.filter((V) => V.sublevel != null).forEach((V) => {
|
|
3867
3858
|
let O = U.find((de) => de.position == V.sublevel);
|
|
@@ -3893,16 +3884,16 @@ function Da(e, t, l) {
|
|
|
3893
3884
|
onDeleteAsync: V
|
|
3894
3885
|
} = { ...e }, O = J(U), de = O.id, ye = (De) => {
|
|
3895
3886
|
if (De != null) {
|
|
3896
|
-
let Ae =
|
|
3897
|
-
if (Ae > -1 &&
|
|
3898
|
-
let oe = e.items.findIndex((
|
|
3887
|
+
let Ae = E.value.findIndex((oe) => oe.id == De);
|
|
3888
|
+
if (Ae > -1 && E.value.splice(Ae, 1), e.items != null) {
|
|
3889
|
+
let oe = e.items.findIndex((Le) => Le.id == De);
|
|
3899
3890
|
oe > -1 && e.items.splice(oe, 1);
|
|
3900
3891
|
}
|
|
3901
3892
|
} else {
|
|
3902
|
-
let Ae =
|
|
3903
|
-
if (Ae == -1 && (Ae =
|
|
3904
|
-
let oe = e.items.findIndex((
|
|
3905
|
-
oe == -1 && (oe = e.items.findIndex((
|
|
3893
|
+
let Ae = E.value.findIndex((oe) => oe === O);
|
|
3894
|
+
if (Ae == -1 && (Ae = E.value.findIndex((oe) => oe == O)), Ae > -1 && E.value.splice(Ae, 1), e.items != null) {
|
|
3895
|
+
let oe = e.items.findIndex((Le) => Le === O);
|
|
3896
|
+
oe == -1 && (oe = e.items.findIndex((Le) => Le == O)), oe > -1 && e.items.splice(oe, 1);
|
|
3906
3897
|
}
|
|
3907
3898
|
}
|
|
3908
3899
|
};
|
|
@@ -3913,35 +3904,35 @@ function Da(e, t, l) {
|
|
|
3913
3904
|
onCanDeleteAsync: e.onCanDeleteAsync,
|
|
3914
3905
|
onDeleteAsync: V,
|
|
3915
3906
|
onDeleteSuccessAsync: async () => (ye(de), e.onDeleteSuccessAsync != null ? e.onDeleteSuccessAsync(O) : Promise.resolve(void 0)),
|
|
3916
|
-
proxyID:
|
|
3907
|
+
proxyID: A.value,
|
|
3917
3908
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3918
3909
|
requireConfirmation: !0
|
|
3919
3910
|
}), t && t("deleted", U);
|
|
3920
3911
|
}
|
|
3921
3912
|
function Je(U) {
|
|
3922
|
-
|
|
3913
|
+
Y({
|
|
3923
3914
|
data: J(U),
|
|
3924
3915
|
additionalUrl: e.additionalUrl,
|
|
3925
3916
|
nav: $,
|
|
3926
3917
|
onCanRestoreAsync: e.onCanRestoreAsync,
|
|
3927
3918
|
onRestoreAsync: e.onRestoreAsync,
|
|
3928
3919
|
onRestoreSuccessAsync: e.onRestoreSuccessAsync,
|
|
3929
|
-
proxyID:
|
|
3920
|
+
proxyID: A.value
|
|
3930
3921
|
// ...(useBladeSrc ? bladeData.value : {})
|
|
3931
3922
|
});
|
|
3932
3923
|
}
|
|
3933
3924
|
function ke() {
|
|
3934
|
-
|
|
3935
|
-
|
|
3925
|
+
Z(() => {
|
|
3926
|
+
S.exportToCSV(Ce.value, K.value);
|
|
3936
3927
|
}, { loadingMsg: "Exporting to CSV" });
|
|
3937
3928
|
}
|
|
3938
3929
|
function Pe() {
|
|
3939
|
-
let U = J(
|
|
3930
|
+
let U = J(E);
|
|
3940
3931
|
if (U = e.onFilter ? e.onFilter(U) : U, T.value != null && T.value.length > 0) {
|
|
3941
3932
|
let Q = [...f.value];
|
|
3942
3933
|
e.itemText && Q.push(e.itemText), _e(Q) && (U = U.filter((V) => dn(V, T.value, Q)));
|
|
3943
3934
|
}
|
|
3944
|
-
|
|
3935
|
+
K.value = U;
|
|
3945
3936
|
}
|
|
3946
3937
|
function qe() {
|
|
3947
3938
|
const U = (l == null ? void 0 : l.hideActions) ?? e.hideActions;
|
|
@@ -3949,7 +3940,7 @@ function Da(e, t, l) {
|
|
|
3949
3940
|
}
|
|
3950
3941
|
async function Ie(U) {
|
|
3951
3942
|
if (se.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (ge.value = e.showSearch ?? !1, T.value = void 0), e.items != null) {
|
|
3952
|
-
|
|
3943
|
+
E.value = e.onGetSuccessAsync != null ? await e.onGetSuccessAsync(e.items) : e.items;
|
|
3953
3944
|
return;
|
|
3954
3945
|
}
|
|
3955
3946
|
const Q = {
|
|
@@ -3959,7 +3950,7 @@ function Da(e, t, l) {
|
|
|
3959
3950
|
params: Fe.value,
|
|
3960
3951
|
//params,
|
|
3961
3952
|
// params: params.getParamOptions(),
|
|
3962
|
-
proxyID:
|
|
3953
|
+
proxyID: A.value,
|
|
3963
3954
|
// ...(useBladeSrc ? bladeData.value : {}),
|
|
3964
3955
|
// ...(props.useInterEvents ? eventData : {}),
|
|
3965
3956
|
refresh: (U == null ? void 0 : U.deepRefresh) ?? !1,
|
|
@@ -3967,17 +3958,16 @@ function Da(e, t, l) {
|
|
|
3967
3958
|
onGetSuccessAsync: e.onGetSuccessAsync
|
|
3968
3959
|
};
|
|
3969
3960
|
if (e.isSingle === !0)
|
|
3970
|
-
Q.id === "new" ?
|
|
3961
|
+
Q.id === "new" ? E.value = [] : E.value = await H(Q);
|
|
3971
3962
|
else {
|
|
3972
3963
|
let V = await ie({
|
|
3973
3964
|
...Q,
|
|
3974
3965
|
onGetSuccessAsync: async (O, de) => {
|
|
3975
|
-
console.log("get suc"), console.log(O);
|
|
3976
3966
|
let ye = O == null ? void 0 : O.data;
|
|
3977
3967
|
return r.value = (O == null ? void 0 : O.filters) ?? [], e.useServerPagination === !0 && e.itemsPerPage && O.count && (Be.value = Math.ceil(O.count / e.itemsPerPage)), e.onGetSuccessAsync != null && (ye = await e.onGetSuccessAsync(ye, de)), ye;
|
|
3978
3968
|
}
|
|
3979
3969
|
});
|
|
3980
|
-
|
|
3970
|
+
E.value = V, c.value = [...D.value];
|
|
3981
3971
|
}
|
|
3982
3972
|
Pe();
|
|
3983
3973
|
}
|
|
@@ -4004,27 +3994,27 @@ function Da(e, t, l) {
|
|
|
4004
3994
|
}
|
|
4005
3995
|
return qe(), Qt([T], () => {
|
|
4006
3996
|
Pe();
|
|
4007
|
-
}, { debounce: 500, maxWait: 500 }), Te([
|
|
3997
|
+
}, { debounce: 500, maxWait: 500 }), Te([C, b], async () => {
|
|
4008
3998
|
await Ie();
|
|
4009
3999
|
}), Te([W, () => e.errorMsg], ([U, Q]) => {
|
|
4010
4000
|
se.value = U != null || Q != null;
|
|
4011
4001
|
}), Te(() => e.refreshToggle, () => {
|
|
4012
4002
|
Ie({ deepRefresh: !0 });
|
|
4013
|
-
}), Or([
|
|
4003
|
+
}), Or([E, () => e.items], () => {
|
|
4014
4004
|
Pe();
|
|
4015
4005
|
}), Xr(async () => {
|
|
4016
4006
|
var U;
|
|
4017
4007
|
e.eager == !0 && await Ie({ deepRefresh: ((U = I == null ? void 0 : I.params) == null ? void 0 : U.refresh) == "true" });
|
|
4018
4008
|
}), {
|
|
4019
4009
|
add: Se,
|
|
4020
|
-
asyncItems:
|
|
4021
|
-
currentPage:
|
|
4010
|
+
asyncItems: E,
|
|
4011
|
+
currentPage: b,
|
|
4022
4012
|
deleteItem: ir,
|
|
4023
4013
|
displayHeaders: ur,
|
|
4024
4014
|
errorMsg: W,
|
|
4025
4015
|
exportToCSV: ke,
|
|
4026
|
-
filteredItems:
|
|
4027
|
-
filters:
|
|
4016
|
+
filteredItems: K,
|
|
4017
|
+
filters: w,
|
|
4028
4018
|
filtersChanged: y,
|
|
4029
4019
|
headerOptions: X,
|
|
4030
4020
|
isDeletable: tr,
|
|
@@ -4038,7 +4028,7 @@ function Da(e, t, l) {
|
|
|
4038
4028
|
selectItem: je,
|
|
4039
4029
|
// serverFilters,
|
|
4040
4030
|
showError: se,
|
|
4041
|
-
showInactive:
|
|
4031
|
+
showInactive: C,
|
|
4042
4032
|
showSearch: ge,
|
|
4043
4033
|
subtitleOptions: ar,
|
|
4044
4034
|
tableHeaders: Ce,
|
|
@@ -4057,21 +4047,21 @@ function Fn(e) {
|
|
|
4057
4047
|
}, We;
|
|
4058
4048
|
}
|
|
4059
4049
|
function xa() {
|
|
4060
|
-
const e =
|
|
4061
|
-
let
|
|
4050
|
+
const e = Nr(), t = it(), l = In();
|
|
4051
|
+
let S = e.getRoutes();
|
|
4062
4052
|
return {
|
|
4063
4053
|
...We,
|
|
4064
4054
|
sidebarNavItems: ee(() => {
|
|
4065
4055
|
var g;
|
|
4066
|
-
|
|
4056
|
+
S = S.filter((I) => I.meta != null && I.meta.menuGroup != null);
|
|
4067
4057
|
const s = [];
|
|
4068
|
-
return
|
|
4058
|
+
return S.forEach((I) => {
|
|
4069
4059
|
var d;
|
|
4070
|
-
const
|
|
4060
|
+
const P = We.groupOptions.value.find((h) => h.displayName == I.meta.menuGroup), _ = t.findItem(I.meta.nav), N = I.meta;
|
|
4071
4061
|
let $ = s.find((h) => h.displayName == N.menuGroup);
|
|
4072
4062
|
$ == null && ($ = {
|
|
4073
4063
|
displayName: N.menuGroup,
|
|
4074
|
-
icon: (
|
|
4064
|
+
icon: (P == null ? void 0 : P.icon) ?? (N == null ? void 0 : N.icon) ?? (_ == null ? void 0 : _.icon),
|
|
4075
4065
|
isGroup: !0,
|
|
4076
4066
|
items: []
|
|
4077
4067
|
}, s.push($)), (d = $.items) == null || d.push({
|
|
@@ -4084,8 +4074,8 @@ function xa() {
|
|
|
4084
4074
|
routeName: I.name
|
|
4085
4075
|
});
|
|
4086
4076
|
}), s.forEach((I) => {
|
|
4087
|
-
var
|
|
4088
|
-
I.items = (
|
|
4077
|
+
var P;
|
|
4078
|
+
I.items = (P = I.items) == null ? void 0 : P.filter((_) => !_.requiresAuth || l.doShow(_.subscriptions, _.permissions, "view")).sort(Re.firstBy((_) => _.displayName));
|
|
4089
4079
|
}), We.currentGroup.value != null ? ((g = s.find((I) => I.displayName == We.currentGroup.value)) == null ? void 0 : g.items) ?? [] : s.filter((I) => !I.requiresAuth || l.doShow(I.subscriptions, I.permissions, "view"));
|
|
4090
4080
|
})
|
|
4091
4081
|
};
|
|
@@ -4098,18 +4088,18 @@ function kn(e) {
|
|
|
4098
4088
|
function t(l) {
|
|
4099
4089
|
if (!l)
|
|
4100
4090
|
return {};
|
|
4101
|
-
let
|
|
4102
|
-
return e.presets[
|
|
4091
|
+
let S = l;
|
|
4092
|
+
return e.presets[S] ?? {};
|
|
4103
4093
|
}
|
|
4104
4094
|
return Pr = {
|
|
4105
4095
|
usePresets: t
|
|
4106
4096
|
}, Pr;
|
|
4107
4097
|
}
|
|
4108
|
-
let
|
|
4098
|
+
let Yr, Jr, jr, Kr = !1;
|
|
4109
4099
|
const wr = z(!1), br = z(!1), Qr = z(), er = z();
|
|
4110
|
-
let
|
|
4100
|
+
let Lr;
|
|
4111
4101
|
function _a() {
|
|
4112
|
-
return
|
|
4102
|
+
return Lr;
|
|
4113
4103
|
}
|
|
4114
4104
|
function Gn() {
|
|
4115
4105
|
function e(I) {
|
|
@@ -4122,7 +4112,7 @@ function Gn() {
|
|
|
4122
4112
|
var I;
|
|
4123
4113
|
(I = Qr.value) == null || I.prompt(), wr.value = !1;
|
|
4124
4114
|
}
|
|
4125
|
-
function
|
|
4115
|
+
function S() {
|
|
4126
4116
|
return !!window.matchMedia("(display-mode: standalone)").matches;
|
|
4127
4117
|
}
|
|
4128
4118
|
function s(I) {
|
|
@@ -4132,14 +4122,14 @@ function Gn() {
|
|
|
4132
4122
|
br.value = !1, !(!er.value || !er.value.waiting) && er.value.waiting.postMessage({ type: "SKIP_WAITING" });
|
|
4133
4123
|
}
|
|
4134
4124
|
return Xt(() => {
|
|
4135
|
-
|
|
4136
|
-
}),
|
|
4125
|
+
Yr == null && (Yr = document.addEventListener("swUpdated", e, { once: !0 })), Jr == null && (Jr = navigator.serviceWorker.addEventListener("controllerchange", t)), jr == null && (jr = window.addEventListener("beforeinstallprompt", s));
|
|
4126
|
+
}), Lr = {
|
|
4137
4127
|
canInstallApp: wr,
|
|
4138
4128
|
canUpdateApp: br,
|
|
4139
4129
|
installApp: l,
|
|
4140
|
-
isInstalled:
|
|
4130
|
+
isInstalled: S,
|
|
4141
4131
|
updateApp: g
|
|
4142
|
-
},
|
|
4132
|
+
}, Lr;
|
|
4143
4133
|
}
|
|
4144
4134
|
function Ca(e) {
|
|
4145
4135
|
const t = [];
|
|
@@ -4150,19 +4140,19 @@ function Pa(e) {
|
|
|
4150
4140
|
install(t, l) {
|
|
4151
4141
|
var _;
|
|
4152
4142
|
console.log(t), e.vuetifyInstance ?? (e.vuetifyInstance = l.vuetifyInstance), yn(e.urls), Pn(e);
|
|
4153
|
-
const
|
|
4154
|
-
kn(e), (_ = e.auth).demo ?? (_.demo =
|
|
4143
|
+
const S = Mn(), s = $n(e);
|
|
4144
|
+
kn(e), (_ = e.auth).demo ?? (_.demo = S), e.auth.getAuthItem = s.findItem;
|
|
4155
4145
|
const g = Dn(e.auth);
|
|
4156
4146
|
Fn(e.menu);
|
|
4157
4147
|
const I = En({
|
|
4158
4148
|
auth: g,
|
|
4159
4149
|
findPath: s.findPath,
|
|
4160
4150
|
useBearerToken: !0
|
|
4161
|
-
}),
|
|
4151
|
+
}), P = Nn({
|
|
4162
4152
|
getTimeZone: () => g.timeZone.value
|
|
4163
4153
|
});
|
|
4164
4154
|
Un({
|
|
4165
|
-
dates:
|
|
4155
|
+
dates: P
|
|
4166
4156
|
}), Gn(), wn({
|
|
4167
4157
|
api: I,
|
|
4168
4158
|
auth: g,
|
|
@@ -4179,14 +4169,14 @@ export {
|
|
|
4179
4169
|
On as checkImage,
|
|
4180
4170
|
fn as containsSearch,
|
|
4181
4171
|
na as containsWeekday,
|
|
4182
|
-
|
|
4172
|
+
Mr as copyDeep,
|
|
4183
4173
|
cn as copyItemByAlphabet,
|
|
4184
4174
|
En as createApi,
|
|
4185
4175
|
Dn as createAuth,
|
|
4186
4176
|
Pa as createCore,
|
|
4187
4177
|
Pn as createCosmetics,
|
|
4188
|
-
|
|
4189
|
-
|
|
4178
|
+
Nn as createDates,
|
|
4179
|
+
Mn as createDemo,
|
|
4190
4180
|
Un as createFilters,
|
|
4191
4181
|
Fn as createMenu,
|
|
4192
4182
|
$n as createNavigation,
|
|
@@ -4199,7 +4189,7 @@ export {
|
|
|
4199
4189
|
un as csvContains,
|
|
4200
4190
|
wa as csvDefaults,
|
|
4201
4191
|
tt as deepSelect,
|
|
4202
|
-
|
|
4192
|
+
Yn as distinct,
|
|
4203
4193
|
Jn as extensionExists,
|
|
4204
4194
|
sn as extractErrorDescription,
|
|
4205
4195
|
tn as fromCamelCase,
|
|
@@ -4230,7 +4220,7 @@ export {
|
|
|
4230
4220
|
In as useAuth,
|
|
4231
4221
|
Wr as useAuthUrl,
|
|
4232
4222
|
Cn as useBlade,
|
|
4233
|
-
|
|
4223
|
+
Ln as useCSV,
|
|
4234
4224
|
ga as useCosmetics,
|
|
4235
4225
|
gn as useDataUrl,
|
|
4236
4226
|
ba as useDates,
|
|
@@ -4252,11 +4242,11 @@ export {
|
|
|
4252
4242
|
_n as useResizable,
|
|
4253
4243
|
Ca as useRules,
|
|
4254
4244
|
va as useStore,
|
|
4255
|
-
|
|
4245
|
+
Ne as useStoreDefinition,
|
|
4256
4246
|
Bn as useTracker,
|
|
4257
4247
|
ha as useUrls,
|
|
4258
4248
|
hn as validEmail,
|
|
4259
|
-
|
|
4249
|
+
Ye as weekdayPairs,
|
|
4260
4250
|
ta as weekdayShortName,
|
|
4261
4251
|
ra as weekdayValue
|
|
4262
4252
|
};
|