buzzcasting-storage 3.0.21 → 3.0.22
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/buzzcasting-storage.d.ts +3 -0
- package/dist/buzzcasting-storage.esm.js +403 -403
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (
|
|
4
|
-
var N = /* @__PURE__ */ ((
|
|
5
|
-
const ka = "3.0.
|
|
1
|
+
var Aa = Object.defineProperty;
|
|
2
|
+
var xa = (l, r, o) => r in l ? Aa(l, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[r] = o;
|
|
3
|
+
var k = (l, r, o) => xa(l, typeof r != "symbol" ? r + "" : r, o);
|
|
4
|
+
var N = /* @__PURE__ */ ((l) => (l.MESSAGES = "messages", l.CLOUD = "cloud", l.SERIES = "series", l.TOPICS = "topics", l.WIDGET = "widget", l.WIDGETS = "widgets", l.SLIDE = "slide", l))(N || {}), g = /* @__PURE__ */ ((l) => (l.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", l.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", l.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", l.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", l.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", l.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", l.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", l.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", l.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", l.NONE = "color:transparent;background-color:transparent;", l.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", l.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", l.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", l.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", l.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", l.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", l.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", l))(g || {}), re = /* @__PURE__ */ ((l) => (l.ADD_SLIDE = "addSlide", l.APP_READY = "appReady", l.API_UPDATE = "apiUpdate", l.WS_API_REQUEST = "wsApiRequest", l.WS_API_RESPONSE = "wsApiResponse", l.WS_API_UPDATE = "wsApiUpdate", l.APPROVE_MESSAGE = "approveMessage", l.CHANNEL = "channel", l.CLEAN_MESSAGES = "cleanMessages", l.CLOSE_MODAL = "closeModal", l.CLOSE_BUILDER_MODAL = "closeBuilderModal", l.ERROR = "error", l.HIDE_MESSAGE = "hideMessage", l.HIDE_LABELS = "hideLabels", l.MAUPPUT_UPDATE = "layoutUpdate", l.PAUSE_PRESENTATION = "pausePresentation", l.PRESENTATION_READY = "presentationReady", l.PREV_SLIDE = "prevSlide", l.RELOAD_PRESENTATION = "reloadPresentation", l.SHOW_MODAL = "showModal", l.STAR_MESSAGE = "starMessage", l.GOTO_SLIDE = "gotoSlide", l.NEXT_SLIDE = "nextSlide", l.SHOW_BUILDER_MODAL = "showBuilderModal", l.SLIDE_DID_LOAD = "slideDidLoad", l.SLIDE_GOTO = "slideGoto", l.SLIDE_READY = "slideReady", l.SLIDE_LOAD = "loadSlide", l.SLIDE_STORE = "storeSlide", l.SLIDE_TRANSITIONER = "slideTransitioner", l.START_TRANSITIONER = "startTransitioner", l.STORAGE_INIT = "storageInit", l.SUBSCRIBE = "subscribe", l.SUSPEND_ACCOUNT = "suspendAccount", l.REMOVE_CLOUD = "removeCloud", l.UPDATE = "update", l.VERSION = "version", l.WIDGET_UPDATE = "widgetUpdate", l))(re || {}), Zt = /* @__PURE__ */ ((l) => (l.APPROVED = "approved", l.BEFORE = "before", l.DELAYED = "delayed", l.NONE = "none", l.REALTIME = "realtime", l))(Zt || {}), ye = /* @__PURE__ */ ((l) => (l.KEYVAL = "keyval", l.LOCAL = "local", l.SESSION = "session", l.DEXIE = "dexie", l.WINDOW = "window", l))(ye || {});
|
|
5
|
+
const ka = "3.0.21";
|
|
6
6
|
class Da {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -32,18 +32,18 @@ class Da {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: o } = this.options,
|
|
36
|
-
delete
|
|
37
|
-
const D = Object.keys(
|
|
35
|
+
const { version: o } = this.options, d = this.headers(), A = Object.assign({}, r);
|
|
36
|
+
delete A.slide, delete A.type, delete A.hash, delete A.order, delete A.period;
|
|
37
|
+
const D = Object.keys(A).length > 0 ? `?${new URLSearchParams(A).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
40
|
g.API,
|
|
41
41
|
g.NONE,
|
|
42
42
|
g.GET_DATA,
|
|
43
43
|
r.widget
|
|
44
|
-
), console.debug("%capi%c %cfetch", g.API, g.NONE, g.GET_DATA,
|
|
44
|
+
), console.debug("%capi%c %cfetch", g.API, g.NONE, g.GET_DATA, A), await fetch(
|
|
45
45
|
[this.url, "api", o, r.type].join("/") + D,
|
|
46
|
-
{ ...
|
|
46
|
+
{ ...d, method: "get" }
|
|
47
47
|
).then(async (K) => {
|
|
48
48
|
if (!K.ok)
|
|
49
49
|
throw new Error(`${K.status}`);
|
|
@@ -51,7 +51,7 @@ class Da {
|
|
|
51
51
|
}).then((K) => K.json()).then((K) => (K.query = r, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
|
-
const { version: o } = this.options,
|
|
54
|
+
const { version: o } = this.options, d = this.headers(), A = "?action=visible";
|
|
55
55
|
return console.info(
|
|
56
56
|
"%capi%c %cput",
|
|
57
57
|
g.API,
|
|
@@ -68,8 +68,8 @@ class Da {
|
|
|
68
68
|
re.HIDE_MESSAGE,
|
|
69
69
|
r
|
|
70
70
|
), await fetch(
|
|
71
|
-
[this.url, "api", o, "messages", r.id].join("/") +
|
|
72
|
-
{ ...
|
|
71
|
+
[this.url, "api", o, "messages", r.id].join("/") + A,
|
|
72
|
+
{ ...d, method: "put" }
|
|
73
73
|
).then((D) => {
|
|
74
74
|
if (!D.ok)
|
|
75
75
|
throw new Error(D.statusText);
|
|
@@ -77,9 +77,9 @@ class Da {
|
|
|
77
77
|
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
78
78
|
}
|
|
79
79
|
async hideLabels(r) {
|
|
80
|
-
const { version: o } = this.options,
|
|
80
|
+
const { version: o } = this.options, d = this.formHeaders(), A = new URLSearchParams(), D = r.labels || [];
|
|
81
81
|
for (const [K, U] of D.entries())
|
|
82
|
-
|
|
82
|
+
A.append(`custom_filters[${K}]`, U);
|
|
83
83
|
return console.info(
|
|
84
84
|
"%capi%c %cput",
|
|
85
85
|
g.API,
|
|
@@ -90,7 +90,7 @@ class Da {
|
|
|
90
90
|
D
|
|
91
91
|
), await fetch(
|
|
92
92
|
[this.url, "api", o, r.type, r.widget].join("/"),
|
|
93
|
-
{ ...
|
|
93
|
+
{ ...d, body: A, method: "put" }
|
|
94
94
|
).then((K) => {
|
|
95
95
|
if (!K.ok)
|
|
96
96
|
throw new Error(K.statusText);
|
|
@@ -98,8 +98,8 @@ class Da {
|
|
|
98
98
|
}).then((K) => K.json()).catch((K) => ({ succes: !1, message: K, data: [] }));
|
|
99
99
|
}
|
|
100
100
|
async loadSlide(r) {
|
|
101
|
-
const { version: o } = this.options,
|
|
102
|
-
return delete
|
|
101
|
+
const { version: o } = this.options, d = this.headers(), A = Object.assign({}, r);
|
|
102
|
+
return delete A.slide, delete A.type, delete A.hash, console.info(
|
|
103
103
|
"%capi%c %cloadSlide",
|
|
104
104
|
g.API,
|
|
105
105
|
g.NONE,
|
|
@@ -108,7 +108,7 @@ class Da {
|
|
|
108
108
|
r.slide
|
|
109
109
|
), await fetch(
|
|
110
110
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
111
|
-
{ ...
|
|
111
|
+
{ ...d, method: "get" }
|
|
112
112
|
).then(async (D) => {
|
|
113
113
|
if (!D.ok)
|
|
114
114
|
throw new Error(`${D.status}`);
|
|
@@ -123,9 +123,9 @@ class Da {
|
|
|
123
123
|
* @returns
|
|
124
124
|
*/
|
|
125
125
|
async storeSlide(r) {
|
|
126
|
-
const { version: o } = this.options,
|
|
126
|
+
const { version: o } = this.options, d = this.formHeaders();
|
|
127
127
|
delete r.update, delete r.type;
|
|
128
|
-
const
|
|
128
|
+
const A = JSON.stringify(r);
|
|
129
129
|
return console.info(
|
|
130
130
|
"%capi%c %cput",
|
|
131
131
|
g.API,
|
|
@@ -142,7 +142,7 @@ class Da {
|
|
|
142
142
|
r
|
|
143
143
|
), await fetch(
|
|
144
144
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
145
|
-
{ ...
|
|
145
|
+
{ ...d, body: A, method: "put" }
|
|
146
146
|
).then((D) => {
|
|
147
147
|
if (!D.ok)
|
|
148
148
|
throw new Error(D.statusText);
|
|
@@ -151,14 +151,14 @@ class Da {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
var Pa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
154
|
-
function Ia(
|
|
155
|
-
return
|
|
154
|
+
function Ia(l) {
|
|
155
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
156
156
|
}
|
|
157
157
|
var qt = { exports: {} }, Ca = qt.exports, Rr;
|
|
158
158
|
function Ra() {
|
|
159
|
-
return Rr || (Rr = 1, function(
|
|
160
|
-
(function(o,
|
|
161
|
-
|
|
159
|
+
return Rr || (Rr = 1, function(l, r) {
|
|
160
|
+
(function(o, d) {
|
|
161
|
+
l.exports = d();
|
|
162
162
|
})(Ca, function() {
|
|
163
163
|
var o = function(e, t) {
|
|
164
164
|
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
@@ -166,13 +166,13 @@ function Ra() {
|
|
|
166
166
|
} || function(n, a) {
|
|
167
167
|
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (n[i] = a[i]);
|
|
168
168
|
})(e, t);
|
|
169
|
-
},
|
|
170
|
-
return (
|
|
169
|
+
}, d = function() {
|
|
170
|
+
return (d = Object.assign || function(e) {
|
|
171
171
|
for (var t, n = 1, a = arguments.length; n < a; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
172
172
|
return e;
|
|
173
173
|
}).apply(this, arguments);
|
|
174
174
|
};
|
|
175
|
-
function
|
|
175
|
+
function A(e, t, n) {
|
|
176
176
|
for (var a, i = 0, s = t.length; i < s; i++) !a && i in t || ((a = a || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
177
177
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
178
178
|
}
|
|
@@ -189,16 +189,16 @@ function Ra() {
|
|
|
189
189
|
}
|
|
190
190
|
function le(e, t) {
|
|
191
191
|
typeof t == "function" && (t = t(X(e))), (typeof Reflect > "u" ? K : Reflect.ownKeys)(t).forEach(function(n) {
|
|
192
|
-
|
|
192
|
+
Ae(e, n, t[n]);
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
var He = Object.defineProperty;
|
|
196
|
-
function
|
|
196
|
+
function Ae(e, t, n, a) {
|
|
197
197
|
He(e, t, M(n && ee(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, a));
|
|
198
198
|
}
|
|
199
199
|
function Ye(e) {
|
|
200
200
|
return { from: function(t) {
|
|
201
|
-
return e.prototype = Object.create(t.prototype),
|
|
201
|
+
return e.prototype = Object.create(t.prototype), Ae(e.prototype, "constructor", e), { extend: le.bind(null, e.prototype) };
|
|
202
202
|
} };
|
|
203
203
|
}
|
|
204
204
|
var Ur = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
@@ -415,8 +415,8 @@ function Ra() {
|
|
|
415
415
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
416
416
|
return [t, X(t), e];
|
|
417
417
|
}(), ut = Ne[0], ge = Ne[1], Ne = Ne[2], ge = ge && ge.then, Ke = ut && ut.constructor, on = !!Ne, ct = function(e, t) {
|
|
418
|
-
lt.push([e, t]),
|
|
419
|
-
}, un = !0,
|
|
418
|
+
lt.push([e, t]), At && (queueMicrotask(ta), At = !1);
|
|
419
|
+
}, un = !0, At = !0, Be = [], xt = [], cn = st, xe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, G = xe, lt = [], Le = 0, kt = [];
|
|
420
420
|
function B(e) {
|
|
421
421
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
422
422
|
this._listeners = [], this._lib = !1;
|
|
@@ -451,7 +451,7 @@ function Ra() {
|
|
|
451
451
|
}
|
|
452
452
|
return n.prototype = ot, n;
|
|
453
453
|
}, set: function(e) {
|
|
454
|
-
|
|
454
|
+
Ae(this, "then", e && e.prototype === ot ? ln : { get: function() {
|
|
455
455
|
return e;
|
|
456
456
|
}, set: ln.set });
|
|
457
457
|
} };
|
|
@@ -460,7 +460,7 @@ function Ra() {
|
|
|
460
460
|
}
|
|
461
461
|
function dn(e, t) {
|
|
462
462
|
var n, a;
|
|
463
|
-
|
|
463
|
+
xt.push(t), e._state === null && (n = e._lib && Ve(), t = cn(t), e._state = !1, e._value = t, a = e, Be.some(function(i) {
|
|
464
464
|
return i._value === a._value;
|
|
465
465
|
}) || Be.push(a), nr(e), n && Ze());
|
|
466
466
|
}
|
|
@@ -483,9 +483,9 @@ function Ra() {
|
|
|
483
483
|
function ea(e, t, n) {
|
|
484
484
|
try {
|
|
485
485
|
var a, i = t._value;
|
|
486
|
-
!t._state &&
|
|
486
|
+
!t._state && xt.length && (xt = []), a = me && t._consoleTask ? t._consoleTask.run(function() {
|
|
487
487
|
return e(i);
|
|
488
|
-
}) : e(i), t._state ||
|
|
488
|
+
}) : e(i), t._state || xt.indexOf(i) !== -1 || function(s) {
|
|
489
489
|
for (var u = Be.length; u; ) if (Be[--u]._value === s._value) return Be.splice(u, 1);
|
|
490
490
|
}(t), n.resolve(a);
|
|
491
491
|
} catch (s) {
|
|
@@ -495,13 +495,13 @@ function Ra() {
|
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
function ta() {
|
|
498
|
-
Ge(
|
|
498
|
+
Ge(xe, function() {
|
|
499
499
|
Ve() && Ze();
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
function Ve() {
|
|
503
503
|
var e = un;
|
|
504
|
-
return
|
|
504
|
+
return At = un = !1, e;
|
|
505
505
|
}
|
|
506
506
|
function Ze() {
|
|
507
507
|
var e, t, n;
|
|
@@ -511,7 +511,7 @@ function Ra() {
|
|
|
511
511
|
a[0].apply(null, a[1]);
|
|
512
512
|
}
|
|
513
513
|
while (0 < lt.length);
|
|
514
|
-
|
|
514
|
+
At = un = !0;
|
|
515
515
|
}
|
|
516
516
|
function hn() {
|
|
517
517
|
var e = Be;
|
|
@@ -564,7 +564,7 @@ function Ra() {
|
|
|
564
564
|
}, e);
|
|
565
565
|
n.then(a, i).finally(clearTimeout.bind(null, s));
|
|
566
566
|
}) : this;
|
|
567
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag &&
|
|
567
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(B.prototype, Symbol.toStringTag, "Dexie.Promise"), xe.env = rr(), le(B, { all: function() {
|
|
568
568
|
var e = Se.apply(null, arguments).map(Rt);
|
|
569
569
|
return new B(function(t, n) {
|
|
570
570
|
e.length === 0 && t([]);
|
|
@@ -616,7 +616,7 @@ function Ra() {
|
|
|
616
616
|
}, u.finalize), e();
|
|
617
617
|
}, t, n, a);
|
|
618
618
|
});
|
|
619
|
-
} }), Ke && (Ke.allSettled &&
|
|
619
|
+
} }), Ke && (Ke.allSettled && Ae(B, "allSettled", function() {
|
|
620
620
|
var e = Se.apply(null, arguments).map(Rt);
|
|
621
621
|
return new B(function(t) {
|
|
622
622
|
e.length === 0 && t([]);
|
|
@@ -631,7 +631,7 @@ function Ra() {
|
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
633
|
});
|
|
634
|
-
}), Ke.any && typeof AggregateError < "u" &&
|
|
634
|
+
}), Ke.any && typeof AggregateError < "u" && Ae(B, "any", function() {
|
|
635
635
|
var e = Se.apply(null, arguments).map(Rt);
|
|
636
636
|
return new B(function(t, n) {
|
|
637
637
|
e.length === 0 && n(new AggregateError([]));
|
|
@@ -648,7 +648,7 @@ function Ra() {
|
|
|
648
648
|
var ae = { awaits: 0, echoes: 0, id: 0 }, na = 0, Pt = [], It = 0, Ct = 0, ra = 0;
|
|
649
649
|
function ke(e, t, n, a) {
|
|
650
650
|
var i = G, s = Object.create(i);
|
|
651
|
-
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra,
|
|
651
|
+
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra, xe.env, s.env = on ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t && M(s, t), ++i.ref, s.finalize = function() {
|
|
652
652
|
--this.parent.ref || this.parent.finalize();
|
|
653
653
|
}, a = Ge(s, e, n, a), s.ref === 0 && s.finalize(), a;
|
|
654
654
|
}
|
|
@@ -673,7 +673,7 @@ function Ra() {
|
|
|
673
673
|
var n, a = G;
|
|
674
674
|
(t ? !ae.echoes || It++ && e === G : !It || --It && e === G) || queueMicrotask(t ? (function(i) {
|
|
675
675
|
++Ct, ae.echoes && --ae.echoes != 0 || (ae.echoes = ae.awaits = ae.id = 0), Pt.push(G), Pe(i, !0);
|
|
676
|
-
}).bind(null, e) : aa), e !== G && (G = e, a ===
|
|
676
|
+
}).bind(null, e) : aa), e !== G && (G = e, a === xe && (xe.env = rr()), on && (n = xe.env.Promise, t = e.env, (a.global || e.global) && (Object.defineProperty(D, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
677
677
|
}
|
|
678
678
|
function rr() {
|
|
679
679
|
var e = D.Promise;
|
|
@@ -1127,7 +1127,7 @@ function Ra() {
|
|
|
1127
1127
|
var t = this["@@propmod"];
|
|
1128
1128
|
if (t.add !== void 0) {
|
|
1129
1129
|
var n = t.add;
|
|
1130
|
-
if (U(n)) return
|
|
1130
|
+
if (U(n)) return A(A([], U(e) ? e : [], !0), n).sort();
|
|
1131
1131
|
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1132
1132
|
if (typeof n == "bigint") try {
|
|
1133
1133
|
return BigInt(e) + n;
|
|
@@ -1321,8 +1321,8 @@ function Ra() {
|
|
|
1321
1321
|
var i, s, u;
|
|
1322
1322
|
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(m) {
|
|
1323
1323
|
for (var _ = !1, E = 0; E < s; ++E) {
|
|
1324
|
-
var O = i[E],
|
|
1325
|
-
|
|
1324
|
+
var O = i[E], x = e[O], P = we(m, O);
|
|
1325
|
+
x instanceof ht ? (fe(m, O, x.execute(P)), _ = !0) : P !== x && (fe(m, O, x), _ = !0);
|
|
1326
1326
|
}
|
|
1327
1327
|
return _;
|
|
1328
1328
|
});
|
|
@@ -1331,17 +1331,17 @@ function Ra() {
|
|
|
1331
1331
|
function S(m, O) {
|
|
1332
1332
|
var E = O.failures, O = O.numFailures;
|
|
1333
1333
|
b += m - O;
|
|
1334
|
-
for (var
|
|
1335
|
-
var T = P[
|
|
1334
|
+
for (var x = 0, P = K(E); x < P.length; x++) {
|
|
1335
|
+
var T = P[x];
|
|
1336
1336
|
p.push(E[T]);
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
1339
|
var p = [], b = 0, w = [];
|
|
1340
1340
|
return t.clone().primaryKeys().then(function(m) {
|
|
1341
1341
|
function _(O) {
|
|
1342
|
-
var
|
|
1343
|
-
return c.getMany({ trans: a, keys: m.slice(O, O +
|
|
1344
|
-
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R <
|
|
1342
|
+
var x = Math.min(v, m.length - O);
|
|
1343
|
+
return c.getMany({ trans: a, keys: m.slice(O, O + x), cache: "immutable" }).then(function(P) {
|
|
1344
|
+
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R < x; ++R) {
|
|
1345
1345
|
var L = P[R], W = { value: Te(L), primKey: m[O + R] };
|
|
1346
1346
|
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(m[O + R]) : h || Y(y(L), y(W.value)) === 0 ? (I.push(W.value), h && C.push(m[O + R])) : (j.push(m[O + R]), T.push(W.value)));
|
|
1347
1347
|
}
|
|
@@ -1357,7 +1357,7 @@ function Ra() {
|
|
|
1357
1357
|
return S(j.length, z);
|
|
1358
1358
|
});
|
|
1359
1359
|
}).then(function() {
|
|
1360
|
-
return m.length > O +
|
|
1360
|
+
return m.length > O + x && _(O + v);
|
|
1361
1361
|
});
|
|
1362
1362
|
});
|
|
1363
1363
|
}
|
|
@@ -1439,7 +1439,7 @@ function Ra() {
|
|
|
1439
1439
|
if (typeof _ != "string") return !1;
|
|
1440
1440
|
var E = s(_);
|
|
1441
1441
|
if (t(E, h, p)) return !0;
|
|
1442
|
-
for (var O = null,
|
|
1442
|
+
for (var O = null, x = p; x < f; ++x) {
|
|
1443
1443
|
var P = function(T, I, C, j, R, L) {
|
|
1444
1444
|
for (var W = Math.min(T.length, j.length), z = -1, H = 0; H < W; ++H) {
|
|
1445
1445
|
var pe = I[H];
|
|
@@ -1447,8 +1447,8 @@ function Ra() {
|
|
|
1447
1447
|
R(T[H], pe) < 0 && (z = H);
|
|
1448
1448
|
}
|
|
1449
1449
|
return W < j.length && L === "next" ? T + C.substr(T.length) : W < T.length && L === "prev" ? T.substr(0, C.length) : z < 0 ? null : T.substr(0, z) + j[z] + C.substr(z + 1);
|
|
1450
|
-
}(_, E, c[
|
|
1451
|
-
P === null && O === null ? p =
|
|
1450
|
+
}(_, E, c[x], h[x], u, y);
|
|
1451
|
+
P === null && O === null ? p = x + 1 : (O === null || 0 < u(O, P)) && (O = P);
|
|
1452
1452
|
}
|
|
1453
1453
|
return w(O !== null ? function() {
|
|
1454
1454
|
b.continue(O + v);
|
|
@@ -1561,14 +1561,14 @@ function Ra() {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
try {
|
|
1563
1563
|
(v = _.reduce(function(E, O) {
|
|
1564
|
-
for (var
|
|
1565
|
-
var T = E[
|
|
1564
|
+
for (var x = 0, P = E.length; x < P; ++x) {
|
|
1565
|
+
var T = E[x];
|
|
1566
1566
|
if (a(O[0], T[1]) < 0 && 0 < a(O[1], T[0])) {
|
|
1567
1567
|
T[0] = u(T[0], O[0]), T[1] = c(T[1], O[1]);
|
|
1568
1568
|
break;
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
|
-
return
|
|
1571
|
+
return x === P && E.push(O), E;
|
|
1572
1572
|
}, [])).sort(S);
|
|
1573
1573
|
} catch {
|
|
1574
1574
|
return he(this, _e);
|
|
@@ -1586,8 +1586,8 @@ function Ra() {
|
|
|
1586
1586
|
});
|
|
1587
1587
|
return _._ondirectionchange = function(E) {
|
|
1588
1588
|
f = E === "next" ? (m = b, i) : (m = w, s), v.sort(S);
|
|
1589
|
-
}, _._addAlgorithm(function(E, O,
|
|
1590
|
-
for (var P, T = E.key; m(T); ) if (++p === v.length) return O(
|
|
1589
|
+
}, _._addAlgorithm(function(E, O, x) {
|
|
1590
|
+
for (var P, T = E.key; m(T); ) if (++p === v.length) return O(x), !1;
|
|
1591
1591
|
return !b(P = T) && !w(P) || (n._cmp(T, v[p][1]) === 0 || n._cmp(T, v[p][0]) === 0 || O(function() {
|
|
1592
1592
|
f === i ? E.continue(v[p][0]) : E.continue(v[p][1]);
|
|
1593
1593
|
}), !1);
|
|
@@ -1751,7 +1751,7 @@ function Ra() {
|
|
|
1751
1751
|
function i(S) {
|
|
1752
1752
|
var p, b = S.name;
|
|
1753
1753
|
return { name: b, schema: S, mutate: function(w) {
|
|
1754
|
-
var m = w.trans, _ = w.type, E = w.keys, O = w.values,
|
|
1754
|
+
var m = w.trans, _ = w.type, E = w.keys, O = w.values, x = w.range;
|
|
1755
1755
|
return new Promise(function(P, T) {
|
|
1756
1756
|
P = q(P);
|
|
1757
1757
|
var I = m.objectStore(b), C = I.keyPath == null, j = _ === "put" || _ === "add";
|
|
@@ -1764,8 +1764,8 @@ function Ra() {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
var z = [], H = [], pe = 0;
|
|
1766
1766
|
if (_ === "deleteRange") {
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1767
|
+
if (x.type === 4) return P({ numFailures: pe, failures: H, results: [], lastResult: void 0 });
|
|
1768
|
+
x.type === 3 ? z.push(R = I.clear()) : z.push(R = I.delete(a(x)));
|
|
1769
1769
|
} else {
|
|
1770
1770
|
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], ue = C[1];
|
|
1771
1771
|
if (j) for (var ce = 0; ce < L; ++ce) z.push(R = ue && ue[ce] !== void 0 ? I[_](F[ce], ue[ce]) : I[_](F[ce])), R.onerror = W;
|
|
@@ -1786,37 +1786,37 @@ function Ra() {
|
|
|
1786
1786
|
var m = w.trans, _ = w.keys;
|
|
1787
1787
|
return new Promise(function(E, O) {
|
|
1788
1788
|
E = q(E);
|
|
1789
|
-
for (var
|
|
1789
|
+
for (var x, P = m.objectStore(b), T = _.length, I = new Array(T), C = 0, j = 0, R = function(z) {
|
|
1790
1790
|
z = z.target, I[z._pos] = z.result, ++j === C && E(I);
|
|
1791
|
-
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((
|
|
1791
|
+
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((x = P.get(_[W]))._pos = W, x.onsuccess = R, x.onerror = L, ++C);
|
|
1792
1792
|
C === 0 && E(I);
|
|
1793
1793
|
});
|
|
1794
1794
|
}, get: function(w) {
|
|
1795
1795
|
var m = w.trans, _ = w.key;
|
|
1796
1796
|
return new Promise(function(E, O) {
|
|
1797
1797
|
E = q(E);
|
|
1798
|
-
var
|
|
1799
|
-
|
|
1798
|
+
var x = m.objectStore(b).get(_);
|
|
1799
|
+
x.onsuccess = function(P) {
|
|
1800
1800
|
return E(P.target.result);
|
|
1801
|
-
},
|
|
1801
|
+
}, x.onerror = be(O);
|
|
1802
1802
|
});
|
|
1803
1803
|
}, query: (p = y, function(w) {
|
|
1804
1804
|
return new Promise(function(m, _) {
|
|
1805
1805
|
m = q(m);
|
|
1806
|
-
var E, O,
|
|
1806
|
+
var E, O, x, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T, j = R.index, R = R.range, C = C.objectStore(b), j = j.isPrimaryKey ? C : C.index(j.name), R = a(R);
|
|
1807
1807
|
if (T === 0) return m({ result: [] });
|
|
1808
1808
|
p ? ((I = P ? j.getAll(R, I) : j.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1809
1809
|
return m({ result: L.target.result });
|
|
1810
|
-
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R),
|
|
1810
|
+
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R), x = [], O.onsuccess = function(L) {
|
|
1811
1811
|
var W = O.result;
|
|
1812
|
-
return W ? (
|
|
1812
|
+
return W ? (x.push(P ? W.value : W.primaryKey), ++E === T ? m({ result: x }) : void W.continue()) : m({ result: x });
|
|
1813
1813
|
}, O.onerror = be(_));
|
|
1814
1814
|
});
|
|
1815
1815
|
}), openCursor: function(w) {
|
|
1816
|
-
var m = w.trans, _ = w.values, E = w.query, O = w.reverse,
|
|
1816
|
+
var m = w.trans, _ = w.values, E = w.query, O = w.reverse, x = w.unique;
|
|
1817
1817
|
return new Promise(function(P, T) {
|
|
1818
1818
|
P = q(P);
|
|
1819
|
-
var j = E.index, I = E.range, C = m.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ?
|
|
1819
|
+
var j = E.index, I = E.range, C = m.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", R = !_ && "openKeyCursor" in C ? C.openKeyCursor(a(I), j) : C.openCursor(a(I), j);
|
|
1820
1820
|
R.onerror = be(T), R.onsuccess = q(function(L) {
|
|
1821
1821
|
var W, z, H, pe, F = R.result;
|
|
1822
1822
|
F ? (F.___id = ++ca, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), pe = function() {
|
|
@@ -1854,10 +1854,10 @@ function Ra() {
|
|
|
1854
1854
|
});
|
|
1855
1855
|
}, count: function(w) {
|
|
1856
1856
|
var m = w.query, _ = w.trans, E = m.index, O = m.range;
|
|
1857
|
-
return new Promise(function(
|
|
1857
|
+
return new Promise(function(x, P) {
|
|
1858
1858
|
var T = _.objectStore(b), I = E.isPrimaryKey ? T : T.index(E.name), T = a(O), I = T ? I.count(T) : I.count();
|
|
1859
1859
|
I.onsuccess = q(function(C) {
|
|
1860
|
-
return
|
|
1860
|
+
return x(C.target.result);
|
|
1861
1861
|
}), I.onerror = be(P);
|
|
1862
1862
|
});
|
|
1863
1863
|
} };
|
|
@@ -1867,9 +1867,9 @@ function Ra() {
|
|
|
1867
1867
|
}).map(function(S) {
|
|
1868
1868
|
var p = S.keyPath, m = S.autoIncrement, b = U(p), w = {}, m = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: b, keyPath: p, autoIncrement: m, unique: !0, extractKey: En(p) }, indexes: mr(S.indexNames).map(function(_) {
|
|
1869
1869
|
return S.index(_);
|
|
1870
|
-
}).map(function(
|
|
1871
|
-
var E =
|
|
1872
|
-
return w[mt(
|
|
1870
|
+
}).map(function(x) {
|
|
1871
|
+
var E = x.name, O = x.unique, P = x.multiEntry, x = x.keyPath, P = { name: E, compound: U(x), keyPath: x, unique: O, multiEntry: P, extractKey: En(x) };
|
|
1872
|
+
return w[mt(x)] = P;
|
|
1873
1873
|
}), getIndexByKeyPath: function(_) {
|
|
1874
1874
|
return w[mt(_)];
|
|
1875
1875
|
} };
|
|
@@ -1885,7 +1885,7 @@ function Ra() {
|
|
|
1885
1885
|
function da(e, t, n, a) {
|
|
1886
1886
|
var i = n.IDBKeyRange;
|
|
1887
1887
|
return n.indexedDB, { dbcore: (a = la(t, i, a), e.dbcore.reduce(function(s, u) {
|
|
1888
|
-
return u = u.create,
|
|
1888
|
+
return u = u.create, d(d({}, s), u(s));
|
|
1889
1889
|
}, a)) };
|
|
1890
1890
|
}
|
|
1891
1891
|
function Bt(e, a) {
|
|
@@ -1904,7 +1904,7 @@ function Ra() {
|
|
|
1904
1904
|
var c = function h(y, v) {
|
|
1905
1905
|
return Ur(y, v) || (y = X(y)) && h(y, v);
|
|
1906
1906
|
}(u, i);
|
|
1907
|
-
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ?
|
|
1907
|
+
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, i, { get: function() {
|
|
1908
1908
|
return this.table(i);
|
|
1909
1909
|
}, set: function(h) {
|
|
1910
1910
|
He(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
@@ -1936,10 +1936,10 @@ function Ra() {
|
|
|
1936
1936
|
w.push(function() {
|
|
1937
1937
|
var E = m, O = _._cfg.dbschema;
|
|
1938
1938
|
Ut(f, E, b), Ut(f, O, b), m = f._dbSchema = O;
|
|
1939
|
-
var
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
}),
|
|
1939
|
+
var x = An(E, O);
|
|
1940
|
+
x.add.forEach(function(j) {
|
|
1941
|
+
xn(b, j[0], j[1].primKey, j[1].indexes);
|
|
1942
|
+
}), x.change.forEach(function(j) {
|
|
1943
1943
|
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1944
1944
|
var R = b.objectStore(j.name);
|
|
1945
1945
|
j.add.forEach(function(L) {
|
|
@@ -1954,21 +1954,21 @@ function Ra() {
|
|
|
1954
1954
|
if (P && _._cfg.version > S) {
|
|
1955
1955
|
Bt(f, b), p._memoizedTables = {};
|
|
1956
1956
|
var T = Qn(O);
|
|
1957
|
-
|
|
1957
|
+
x.del.forEach(function(j) {
|
|
1958
1958
|
T[j] = E[j];
|
|
1959
1959
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], K(T), T), p.schema = T;
|
|
1960
1960
|
var I, C = rn(P);
|
|
1961
|
-
return C && qe(),
|
|
1961
|
+
return C && qe(), x = B.follow(function() {
|
|
1962
1962
|
var j;
|
|
1963
1963
|
(I = P(p)) && C && (j = De.bind(null, null), I.then(j, j));
|
|
1964
|
-
}), I && typeof I.then == "function" ? B.resolve(I) :
|
|
1964
|
+
}), I && typeof I.then == "function" ? B.resolve(I) : x.then(function() {
|
|
1965
1965
|
return I;
|
|
1966
1966
|
});
|
|
1967
1967
|
}
|
|
1968
1968
|
}), w.push(function(E) {
|
|
1969
|
-
var O,
|
|
1970
|
-
O = P,
|
|
1971
|
-
return O[T] == null &&
|
|
1969
|
+
var O, x, P = _._cfg.dbschema;
|
|
1970
|
+
O = P, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(T) {
|
|
1971
|
+
return O[T] == null && x.db.deleteObjectStore(T);
|
|
1972
1972
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1973
1973
|
}), w.push(function(E) {
|
|
1974
1974
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === _._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
@@ -1982,7 +1982,7 @@ function Ra() {
|
|
|
1982
1982
|
})) : B.resolve();
|
|
1983
1983
|
var f, S, p, b, w, m;
|
|
1984
1984
|
}).catch(u)) : (K(i).forEach(function(v) {
|
|
1985
|
-
|
|
1985
|
+
xn(n, v, i[v].primKey, i[v].indexes);
|
|
1986
1986
|
}), Bt(e, n), void B.follow(function() {
|
|
1987
1987
|
return e.on.populate.fire(s);
|
|
1988
1988
|
}).catch(u));
|
|
@@ -1993,7 +1993,7 @@ function Ra() {
|
|
|
1993
1993
|
br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
1994
1994
|
var n = $t(0, e.idbdb, t);
|
|
1995
1995
|
Ut(e, e._dbSchema, t);
|
|
1996
|
-
for (var a = 0, i =
|
|
1996
|
+
for (var a = 0, i = An(n, e._dbSchema).change; a < i.length; a++) {
|
|
1997
1997
|
var s = function(u) {
|
|
1998
1998
|
if (u.change.length || u.recreate) return console.warn("Unable to patch indexes of table ".concat(u.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1999
1999
|
var c = t.objectStore(u.name);
|
|
@@ -2004,7 +2004,7 @@ function Ra() {
|
|
|
2004
2004
|
if (typeof s == "object") return s.value;
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
|
-
function
|
|
2007
|
+
function An(e, t) {
|
|
2008
2008
|
var n, a = { del: [], add: [], change: [] };
|
|
2009
2009
|
for (n in e) t[n] || a.del.push(n);
|
|
2010
2010
|
for (n in t) {
|
|
@@ -2025,7 +2025,7 @@ function Ra() {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
return a;
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function xn(e, t, n, a) {
|
|
2029
2029
|
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2030
2030
|
return a.forEach(function(s) {
|
|
2031
2031
|
return Gt(i, s);
|
|
@@ -2033,7 +2033,7 @@ function Ra() {
|
|
|
2033
2033
|
}
|
|
2034
2034
|
function br(e, t) {
|
|
2035
2035
|
K(e).forEach(function(n) {
|
|
2036
|
-
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n),
|
|
2036
|
+
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n), xn(t, n, e[n].primKey, e[n].indexes));
|
|
2037
2037
|
});
|
|
2038
2038
|
}
|
|
2039
2039
|
function Gt(e, t) {
|
|
@@ -2159,7 +2159,7 @@ function Ra() {
|
|
|
2159
2159
|
}
|
|
2160
2160
|
function Sr(e) {
|
|
2161
2161
|
var t, n, a = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2162
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2162
|
+
i && (t = i == "r" ? "l" : "r", n = d({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], n[i] = a[t], (e[t] = n).d = _r(n)), e.d = _r(e);
|
|
2163
2163
|
}
|
|
2164
2164
|
function _r(n) {
|
|
2165
2165
|
var t = n.r, n = n.l;
|
|
@@ -2249,11 +2249,11 @@ function Ra() {
|
|
|
2249
2249
|
})) : (v.onerror = be(p), m = m.oldVersion > Math.pow(2, 62) ? 0 : m.oldVersion, f = m < 1, e.idbdb = w.result, s && pa(e, v), ha(e, m / 10, v, p));
|
|
2250
2250
|
}, p), w.onsuccess = q(function() {
|
|
2251
2251
|
v = null;
|
|
2252
|
-
var m, _, E, O,
|
|
2252
|
+
var m, _, E, O, x, P = e.idbdb = w.result, T = _t(P.objectStoreNames);
|
|
2253
2253
|
if (0 < T.length) try {
|
|
2254
2254
|
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2255
2255
|
if (t.autoSchema) _ = P, E = I, (m = e).verno = _.version / 10, E = m._dbSchema = $t(0, _, E), m._storeNames = _t(_.objectStoreNames, 0), Lt(m, [m._allTables], K(E), E);
|
|
2256
|
-
else if (Ut(e, e._dbSchema, I), ((
|
|
2256
|
+
else if (Ut(e, e._dbSchema, I), ((x = An($t(0, (x = e).idbdb, I), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2257
2257
|
return C.add.length || C.change.length;
|
|
2258
2258
|
})) && !s) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), i = P.version + 1, s = !0, S(c());
|
|
2259
2259
|
Bt(e, I);
|
|
@@ -2263,7 +2263,7 @@ function Ra() {
|
|
|
2263
2263
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2264
2264
|
}), P.onclose = q(function(C) {
|
|
2265
2265
|
e.on("close").fire(C);
|
|
2266
|
-
}), f && (
|
|
2266
|
+
}), f && (x = e._deps, I = b, P = x.indexedDB, x = x.IDBKeyRange, Dn(P) || I === Tt || kn(P, x).put({ name: I }).catch(J)), S();
|
|
2267
2267
|
}, p);
|
|
2268
2268
|
}).catch(function(S) {
|
|
2269
2269
|
switch (S == null ? void 0 : S.name) {
|
|
@@ -2335,10 +2335,10 @@ function Ra() {
|
|
|
2335
2335
|
return a;
|
|
2336
2336
|
}
|
|
2337
2337
|
var ma = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2338
|
-
return
|
|
2338
|
+
return d(d({}, e), { table: function(t) {
|
|
2339
2339
|
var n = e.table(t), a = n.schema, i = {}, s = [];
|
|
2340
2340
|
function u(f, S, p) {
|
|
2341
|
-
var b = mt(f), w = i[b] = i[b] || [], m = f == null ? 0 : typeof f == "string" ? 1 : f.length, _ = 0 < S, _ =
|
|
2341
|
+
var b = mt(f), w = i[b] = i[b] || [], m = f == null ? 0 : typeof f == "string" ? 1 : f.length, _ = 0 < S, _ = d(d({}, p), { name: _ ? "".concat(b, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: S, keyLength: m, extractKey: En(f), unique: !_ && p.unique });
|
|
2342
2342
|
return w.push(_), _.isPrimaryKey || s.push(_), 1 < m && u(m === 2 ? f[0] : f.slice(0, m - 1), S + 1, p), w.sort(function(E, O) {
|
|
2343
2343
|
return E.keyTail - O.keyTail;
|
|
2344
2344
|
}), _;
|
|
@@ -2350,9 +2350,9 @@ function Ra() {
|
|
|
2350
2350
|
}
|
|
2351
2351
|
function v(f) {
|
|
2352
2352
|
var S, p = f.query.index;
|
|
2353
|
-
return p.isVirtual ?
|
|
2353
|
+
return p.isVirtual ? d(d({}, f), { query: { index: p.lowLevelIndex, range: (S = f.query.range, p = p.keyTail, { type: S.type === 1 ? 2 : S.type, lower: Yt(S.lower, S.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(S.upper, S.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2354
2354
|
}
|
|
2355
|
-
return
|
|
2355
|
+
return d(d({}, n), { schema: d(d({}, a), { primaryKey: t, indexes: s, getIndexByKeyPath: function(f) {
|
|
2356
2356
|
return (f = i[mt(f)]) && f[0];
|
|
2357
2357
|
} }), count: function(f) {
|
|
2358
2358
|
return n.count(v(f));
|
|
@@ -2392,9 +2392,9 @@ function Ra() {
|
|
|
2392
2392
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2393
2393
|
}
|
|
2394
2394
|
var ba = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2395
|
-
return
|
|
2395
|
+
return d(d({}, e), { table: function(t) {
|
|
2396
2396
|
var n = e.table(t), a = n.schema.primaryKey;
|
|
2397
|
-
return
|
|
2397
|
+
return d(d({}, n), { mutate: function(i) {
|
|
2398
2398
|
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating, y = u.updating;
|
|
2399
2399
|
switch (i.type) {
|
|
2400
2400
|
case "add":
|
|
@@ -2419,7 +2419,7 @@ function Ra() {
|
|
|
2419
2419
|
return n.query({ trans: S, values: !1, query: { index: a, range: p }, limit: b }).then(function(w) {
|
|
2420
2420
|
var m = w.result;
|
|
2421
2421
|
return v({ type: "delete", keys: m, trans: S }).then(function(_) {
|
|
2422
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S,
|
|
2422
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, d(d({}, p), { lower: m[m.length - 1], lowerOpen: !0 }), b);
|
|
2423
2423
|
});
|
|
2424
2424
|
});
|
|
2425
2425
|
}(i.trans, i.range, 1e4);
|
|
@@ -2429,22 +2429,22 @@ function Ra() {
|
|
|
2429
2429
|
function v(f) {
|
|
2430
2430
|
var S, p, b, w = G.trans, m = f.keys || Kn(a, f);
|
|
2431
2431
|
if (!m) throw new Error("Keys missing");
|
|
2432
|
-
return (f = f.type === "add" || f.type === "put" ?
|
|
2433
|
-
var E = m.map(function(O,
|
|
2434
|
-
var P, T, I, C = _[
|
|
2435
|
-
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[
|
|
2432
|
+
return (f = f.type === "add" || f.type === "put" ? d(d({}, f), { keys: m }) : d({}, f)).type !== "delete" && (f.values = A([], f.values)), f.keys && (f.keys = A([], f.keys)), S = n, b = m, ((p = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: p.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2433
|
+
var E = m.map(function(O, x) {
|
|
2434
|
+
var P, T, I, C = _[x], j = { onerror: null, onsuccess: null };
|
|
2435
|
+
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[x], w), O == null && P != null && (f.keys[x] = O = P, a.outbound || fe(f.values[x], a.keyPath, O))) : (P = Nn(C, f.values[x]), (T = y.fire.call(j, P, O, C, w)) && (I = f.values[x], Object.keys(T).forEach(function(R) {
|
|
2436
2436
|
ee(I, R) ? I[R] = T[R] : fe(I, R, T[R]);
|
|
2437
2437
|
}))), j;
|
|
2438
2438
|
});
|
|
2439
2439
|
return n.mutate(f).then(function(O) {
|
|
2440
|
-
for (var
|
|
2440
|
+
for (var x = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < m.length; ++I) {
|
|
2441
2441
|
var C = (P || m)[I], j = E[I];
|
|
2442
|
-
C == null ? j.onerror && j.onerror(
|
|
2442
|
+
C == null ? j.onerror && j.onerror(x[I]) : j.onsuccess && j.onsuccess(f.type === "put" && _[I] ? f.values[I] : C);
|
|
2443
2443
|
}
|
|
2444
|
-
return { failures:
|
|
2444
|
+
return { failures: x, results: P, numFailures: T, lastResult: O };
|
|
2445
2445
|
}).catch(function(O) {
|
|
2446
|
-
return E.forEach(function(
|
|
2447
|
-
return
|
|
2446
|
+
return E.forEach(function(x) {
|
|
2447
|
+
return x.onerror && x.onerror(O);
|
|
2448
2448
|
}), Promise.reject(O);
|
|
2449
2449
|
});
|
|
2450
2450
|
});
|
|
@@ -2464,7 +2464,7 @@ function Ra() {
|
|
|
2464
2464
|
var va = { stack: "dbcore", level: -1, create: function(e) {
|
|
2465
2465
|
return { table: function(t) {
|
|
2466
2466
|
var n = e.table(t);
|
|
2467
|
-
return
|
|
2467
|
+
return d(d({}, n), { getMany: function(a) {
|
|
2468
2468
|
if (!a.cache) return n.getMany(a);
|
|
2469
2469
|
var i = Or(a.keys, a.trans._cache, a.cache === "clone");
|
|
2470
2470
|
return i ? B.resolve(i) : n.getMany(a).then(function(s) {
|
|
@@ -2475,10 +2475,10 @@ function Ra() {
|
|
|
2475
2475
|
} });
|
|
2476
2476
|
} };
|
|
2477
2477
|
} };
|
|
2478
|
-
function
|
|
2478
|
+
function Ar(e, t) {
|
|
2479
2479
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2480
2480
|
}
|
|
2481
|
-
function
|
|
2481
|
+
function xr(e, t) {
|
|
2482
2482
|
switch (e) {
|
|
2483
2483
|
case "query":
|
|
2484
2484
|
return t.values && !t.unique;
|
|
@@ -2491,20 +2491,20 @@ function Ra() {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2493
2493
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2494
|
-
return
|
|
2494
|
+
return d(d({}, e), { transaction: function(a, i, s) {
|
|
2495
2495
|
if (G.subscr && i !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2496
2496
|
return e.transaction(a, i, s);
|
|
2497
2497
|
}, table: function(a) {
|
|
2498
2498
|
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound, y = u.autoIncrement && f.filter(function(p) {
|
|
2499
2499
|
return p.compound && p.keyPath.includes(u.keyPath);
|
|
2500
|
-
}), v =
|
|
2500
|
+
}), v = d(d({}, i), { mutate: function(p) {
|
|
2501
2501
|
function b(R) {
|
|
2502
2502
|
return R = "idb://".concat(t, "/").concat(a, "/").concat(R), O[R] || (O[R] = new oe());
|
|
2503
2503
|
}
|
|
2504
|
-
var w, m, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}),
|
|
2504
|
+
var w, m, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = b(""), P = b(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(u, p).filter(function(R) {
|
|
2505
2505
|
return R;
|
|
2506
2506
|
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2507
|
-
return U(I) ? (
|
|
2507
|
+
return U(I) ? (x.addKeys(I), (j = T === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (w = b, m = j, _ = C, s.indexes.forEach(function(R) {
|
|
2508
2508
|
var L = w(R.name || "");
|
|
2509
2509
|
function W(H) {
|
|
2510
2510
|
return H != null ? R.extractKey(H) : null;
|
|
@@ -2518,10 +2518,10 @@ function Ra() {
|
|
|
2518
2518
|
var F = m && W(m[ue]), ue = _ && W(_[ue]);
|
|
2519
2519
|
Y(F, ue) !== 0 && (F != null && z(F), ue != null && z(ue));
|
|
2520
2520
|
});
|
|
2521
|
-
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C),
|
|
2521
|
+
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), x.add(C)) : (x.add(n), P.add(n), s.indexes.forEach(function(R) {
|
|
2522
2522
|
return b(R.name).add(n);
|
|
2523
2523
|
})), i.mutate(p).then(function(R) {
|
|
2524
|
-
return !I || p.type !== "add" && p.type !== "put" || (
|
|
2524
|
+
return !I || p.type !== "add" && p.type !== "put" || (x.addKeys(R.results), y && y.forEach(function(L) {
|
|
2525
2525
|
for (var W = p.values.map(function(F) {
|
|
2526
2526
|
return L.extractKey(F);
|
|
2527
2527
|
}), z = L.keyPath.findIndex(function(F) {
|
|
@@ -2540,28 +2540,28 @@ function Ra() {
|
|
|
2540
2540
|
}, count: f, query: f, openCursor: f };
|
|
2541
2541
|
return K(S).forEach(function(p) {
|
|
2542
2542
|
v[p] = function(b) {
|
|
2543
|
-
var w = G.subscr, m = !!w, _ =
|
|
2543
|
+
var w = G.subscr, m = !!w, _ = Ar(G, i) && xr(p, b) ? b.obsSet = {} : w;
|
|
2544
2544
|
if (m) {
|
|
2545
2545
|
var E = function(C) {
|
|
2546
2546
|
return C = "idb://".concat(t, "/").concat(a, "/").concat(C), _[C] || (_[C] = new oe());
|
|
2547
|
-
}, O = E(""),
|
|
2548
|
-
if ((p === "query" && m.isPrimaryKey && !b.values ?
|
|
2547
|
+
}, O = E(""), x = E(":dels"), w = S[p](b), m = w[0], w = w[1];
|
|
2548
|
+
if ((p === "query" && m.isPrimaryKey && !b.values ? x : E(m.name || "")).add(w), !m.isPrimaryKey) {
|
|
2549
2549
|
if (p !== "count") {
|
|
2550
|
-
var P = p === "query" && h && b.values && i.query(
|
|
2550
|
+
var P = p === "query" && h && b.values && i.query(d(d({}, b), { values: !1 }));
|
|
2551
2551
|
return i[p].apply(this, arguments).then(function(C) {
|
|
2552
2552
|
if (p === "query") {
|
|
2553
2553
|
if (h && b.values) return P.then(function(W) {
|
|
2554
2554
|
return W = W.result, O.addKeys(W), C;
|
|
2555
2555
|
});
|
|
2556
2556
|
var j = b.values ? C.result.map(c) : C.result;
|
|
2557
|
-
(b.values ? O :
|
|
2557
|
+
(b.values ? O : x).addKeys(j);
|
|
2558
2558
|
} else if (p === "openCursor") {
|
|
2559
2559
|
var R = C, L = b.values;
|
|
2560
2560
|
return R && Object.create(R, { key: { get: function() {
|
|
2561
|
-
return
|
|
2561
|
+
return x.addKey(R.primaryKey), R.key;
|
|
2562
2562
|
} }, primaryKey: { get: function() {
|
|
2563
2563
|
var W = R.primaryKey;
|
|
2564
|
-
return
|
|
2564
|
+
return x.addKey(W), W;
|
|
2565
2565
|
} }, value: { get: function() {
|
|
2566
2566
|
return L && O.addKey(R.primaryKey), R.value;
|
|
2567
2567
|
} } });
|
|
@@ -2569,7 +2569,7 @@ function Ra() {
|
|
|
2569
2569
|
return C;
|
|
2570
2570
|
});
|
|
2571
2571
|
}
|
|
2572
|
-
|
|
2572
|
+
x.add(n);
|
|
2573
2573
|
}
|
|
2574
2574
|
}
|
|
2575
2575
|
return i[p].apply(this, arguments);
|
|
@@ -2581,7 +2581,7 @@ function Ra() {
|
|
|
2581
2581
|
if (n.numFailures === 0) return t;
|
|
2582
2582
|
if (t.type === "deleteRange") return null;
|
|
2583
2583
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2584
|
-
return n.numFailures === a ? null : (t =
|
|
2584
|
+
return n.numFailures === a ? null : (t = d({}, t), U(t.keys) && (t.keys = t.keys.filter(function(i, s) {
|
|
2585
2585
|
return !(s in n.failures);
|
|
2586
2586
|
})), "values" in t && U(t.values) && (t.values = t.values.filter(function(i, s) {
|
|
2587
2587
|
return !(s in n.failures);
|
|
@@ -2596,10 +2596,10 @@ function Ra() {
|
|
|
2596
2596
|
var u = t.query.index, c = u.multiEntry, h = t.query.range, y = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, S = S.reduce(function(p, b) {
|
|
2597
2597
|
var w = p, m = [];
|
|
2598
2598
|
if (b.type === "add" || b.type === "put") for (var _ = new oe(), E = b.values.length - 1; 0 <= E; --E) {
|
|
2599
|
-
var O,
|
|
2600
|
-
_.hasKey(P) || (O = v(
|
|
2599
|
+
var O, x = b.values[E], P = y(x);
|
|
2600
|
+
_.hasKey(P) || (O = v(x), (c && U(O) ? O.some(function(R) {
|
|
2601
2601
|
return Bn(R, h);
|
|
2602
|
-
}) : Bn(O, h)) && (_.addKey(P), m.push(
|
|
2602
|
+
}) : Bn(O, h)) && (_.addKey(P), m.push(x)));
|
|
2603
2603
|
}
|
|
2604
2604
|
switch (b.type) {
|
|
2605
2605
|
case "add":
|
|
@@ -2675,7 +2675,7 @@ function Ra() {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
var Ea = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2677
2677
|
var t = e.schema.name;
|
|
2678
|
-
return
|
|
2678
|
+
return d(d({}, e), { transaction: function(n, a, i) {
|
|
2679
2679
|
var s, u, c = e.transaction(n, a, i);
|
|
2680
2680
|
return a === "readwrite" && (u = (s = new AbortController()).signal, i = function(h) {
|
|
2681
2681
|
return function() {
|
|
@@ -2693,7 +2693,7 @@ function Ra() {
|
|
|
2693
2693
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2694
2694
|
return L.trans !== c;
|
|
2695
2695
|
});
|
|
2696
|
-
for (var
|
|
2696
|
+
for (var x = 0, P = Object.values(p.queries.query); x < P.length; x++) for (var T, I, C, j = 0, R = (T = P[x]).slice(); j < R.length; j++) (I = R[j]).res != null && c.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = Dr(I.res, I.req, w, b, I, C), I.dirty ? (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2697
2697
|
return y.add(L);
|
|
2698
2698
|
})) : C !== I.res && (I.res = C, I.promise = B.resolve({ result: C }))) : (I.dirty && Me(T, I), I.subscribers.forEach(function(L) {
|
|
2699
2699
|
return y.add(L);
|
|
@@ -2709,7 +2709,7 @@ function Ra() {
|
|
|
2709
2709
|
}, c.addEventListener("abort", i(!1), { signal: u }), c.addEventListener("error", i(!1), { signal: u }), c.addEventListener("complete", i(!0), { signal: u })), c;
|
|
2710
2710
|
}, table: function(n) {
|
|
2711
2711
|
var a = e.table(n), i = a.schema.primaryKey;
|
|
2712
|
-
return
|
|
2712
|
+
return d(d({}, a), { mutate: function(s) {
|
|
2713
2713
|
var u = G.trans;
|
|
2714
2714
|
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(s);
|
|
2715
2715
|
var c = Fe["idb://".concat(t, "/").concat(n)];
|
|
@@ -2720,16 +2720,16 @@ function Ra() {
|
|
|
2720
2720
|
}), u.catch(function() {
|
|
2721
2721
|
Me(c.optimisticOps, s), s.mutatedParts && Ht(s.mutatedParts);
|
|
2722
2722
|
})) : u.then(function(h) {
|
|
2723
|
-
var y = kr(0,
|
|
2723
|
+
var y = kr(0, d(d({}, s), { values: s.values.map(function(v, f) {
|
|
2724
2724
|
var S;
|
|
2725
|
-
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) :
|
|
2725
|
+
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) : d({}, v), fe(v, i.keyPath, h.results[f]), v);
|
|
2726
2726
|
}) }), h);
|
|
2727
2727
|
c.optimisticOps.push(y), queueMicrotask(function() {
|
|
2728
2728
|
return s.mutatedParts && Ht(s.mutatedParts);
|
|
2729
2729
|
});
|
|
2730
2730
|
}), u) : a.mutate(s);
|
|
2731
2731
|
}, query: function(s) {
|
|
2732
|
-
if (!
|
|
2732
|
+
if (!Ar(G, a) || !xr("query", s)) return a.query(s);
|
|
2733
2733
|
var u = ((y = G.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = G, c = f.requery, h = f.signal, y = function(b, w, m, _) {
|
|
2734
2734
|
var E = Fe["idb://".concat(b, "/").concat(w)];
|
|
2735
2735
|
if (!E) return [];
|
|
@@ -2738,16 +2738,16 @@ function Ra() {
|
|
|
2738
2738
|
if (!O) return [null, !1, E, null];
|
|
2739
2739
|
switch (m) {
|
|
2740
2740
|
case "query":
|
|
2741
|
-
var
|
|
2741
|
+
var x = O.find(function(P) {
|
|
2742
2742
|
return P.req.limit === _.limit && P.req.values === _.values && Pr(P.req.query.range, _.query.range);
|
|
2743
2743
|
});
|
|
2744
|
-
return
|
|
2744
|
+
return x ? [x, !0, E, O] : [O.find(function(P) {
|
|
2745
2745
|
return ("limit" in P.req ? P.req.limit : 1 / 0) >= _.limit && (!_.values || P.req.values) && Sa(P.req.query.range, _.query.range);
|
|
2746
2746
|
}), !1, E, O];
|
|
2747
2747
|
case "count":
|
|
2748
|
-
return
|
|
2748
|
+
return x = O.find(function(P) {
|
|
2749
2749
|
return Pr(P.req.query.range, _.query.range);
|
|
2750
|
-
}), [
|
|
2750
|
+
}), [x, !!x, E, O];
|
|
2751
2751
|
}
|
|
2752
2752
|
}(t, n, "query", s), v = y[0], f = y[1], S = y[2], p = y[3];
|
|
2753
2753
|
return v && f ? v.obsSet = s.obsSet : (f = a.query(s).then(function(b) {
|
|
@@ -2800,7 +2800,7 @@ function Ra() {
|
|
|
2800
2800
|
})), this;
|
|
2801
2801
|
}, ne.prototype.open = function() {
|
|
2802
2802
|
var e = this;
|
|
2803
|
-
return Ge(
|
|
2803
|
+
return Ge(xe, function() {
|
|
2804
2804
|
return ya(e);
|
|
2805
2805
|
});
|
|
2806
2806
|
}, ne.prototype._close = function() {
|
|
@@ -2930,7 +2930,7 @@ function Ra() {
|
|
|
2930
2930
|
var n = this;
|
|
2931
2931
|
this._middlewares = {}, this.verno = 0;
|
|
2932
2932
|
var a = ne.dependencies;
|
|
2933
|
-
this._options = t =
|
|
2933
|
+
this._options = t = d({ addons: ne.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, a = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2934
2934
|
var i, s, u, c, h, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2935
2935
|
y.dbReadyPromise = new B(function(f) {
|
|
2936
2936
|
y.dbReadyResolve = f;
|
|
@@ -3037,14 +3037,14 @@ function Ra() {
|
|
|
3037
3037
|
var O = Ve();
|
|
3038
3038
|
try {
|
|
3039
3039
|
s && qe();
|
|
3040
|
-
var
|
|
3041
|
-
return
|
|
3040
|
+
var x = ke(e, E);
|
|
3041
|
+
return x = s ? x.finally(De) : x;
|
|
3042
3042
|
} finally {
|
|
3043
3043
|
O && Ze();
|
|
3044
3044
|
}
|
|
3045
3045
|
}(m = { subscr: w, signal: u.signal, requery: S, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3046
3046
|
n = !0, t = E, c || m.signal.aborted || (h = {}, function(O) {
|
|
3047
|
-
for (var
|
|
3047
|
+
for (var x in O) if (ee(O, x)) return;
|
|
3048
3048
|
return 1;
|
|
3049
3049
|
}(y = w) || f || (Ce(gt, p), f = !0), pn(function() {
|
|
3050
3050
|
return !c && i.next && i.next(E);
|
|
@@ -3072,7 +3072,7 @@ function Ra() {
|
|
|
3072
3072
|
Re = t;
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
3075
|
-
le(We,
|
|
3075
|
+
le(We, d(d({}, Ot), { delete: function(e) {
|
|
3076
3076
|
return new We(e, { addons: [] }).delete();
|
|
3077
3077
|
}, exists: function(e) {
|
|
3078
3078
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3152,10 +3152,10 @@ function Ra() {
|
|
|
3152
3152
|
}), addEventListener("pageshow", function(e) {
|
|
3153
3153
|
!Ee.disableBfCache && e.persisted && (me && console.debug("Dexie: handling persisted pageshow"), Cr(), Gn({ all: new oe(-1 / 0, [[]]) }));
|
|
3154
3154
|
})), B.rejectionMapper = function(e, t) {
|
|
3155
|
-
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e &&
|
|
3155
|
+
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && Ae(t, "stack", { get: function() {
|
|
3156
3156
|
return this.inner.stack;
|
|
3157
3157
|
} }), t);
|
|
3158
|
-
}, qn(me),
|
|
3158
|
+
}, qn(me), d(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: or, cmp: Y, PropModification: ht, replacePrefix: function(e, t) {
|
|
3159
3159
|
return new ht({ replacePrefix: [e, t] });
|
|
3160
3160
|
}, add: function(e) {
|
|
3161
3161
|
return new ht({ add: e });
|
|
@@ -3169,33 +3169,33 @@ var Ta = Ra();
|
|
|
3169
3169
|
const Wn = /* @__PURE__ */ Ia(Ta), Tr = Symbol.for("Dexie"), en = globalThis[Tr] || (globalThis[Tr] = Wn);
|
|
3170
3170
|
if (Wn.semVer !== en.semVer)
|
|
3171
3171
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Wn.semVer} and ${en.semVer}`);
|
|
3172
|
-
function V(
|
|
3173
|
-
let r = `${
|
|
3174
|
-
return
|
|
3172
|
+
function V(l) {
|
|
3173
|
+
let r = `${l.type}.${l.topics}`;
|
|
3174
|
+
return l.order && (r += `.${l.order}`), l.period && (r += `.${l.period}`), r;
|
|
3175
3175
|
}
|
|
3176
|
-
function Mr(
|
|
3176
|
+
function Mr(l) {
|
|
3177
3177
|
var r;
|
|
3178
|
-
if (
|
|
3179
|
-
const o = (r =
|
|
3180
|
-
o && o.length > 1 ? (
|
|
3178
|
+
if (l.widget === void 0) {
|
|
3179
|
+
const o = (r = l.topics) == null ? void 0 : r.split("-");
|
|
3180
|
+
o && o.length > 1 ? (l.dashboard = o ? o[0] : "", l.widget = o ? o[1] : "") : (l.widget = l.topics, l.dashboard = l.slide);
|
|
3181
3181
|
}
|
|
3182
|
-
return
|
|
3182
|
+
return l.topics === void 0 && (l.topics = `${l.dashboard}-${l.widget}`), l;
|
|
3183
3183
|
}
|
|
3184
|
-
function St(
|
|
3184
|
+
function St(l, r) {
|
|
3185
3185
|
var U;
|
|
3186
|
-
let o,
|
|
3187
|
-
switch (
|
|
3186
|
+
let o, d, A, D, K;
|
|
3187
|
+
switch (l.moderation) {
|
|
3188
3188
|
case Zt.BEFORE:
|
|
3189
|
-
o = /* @__PURE__ */ new Date(),
|
|
3189
|
+
o = /* @__PURE__ */ new Date(), d = (U = l.beforeTime) == null ? void 0 : U.split(":"), A = Number.parseInt(d ? d[0] : "00"), D = Number.parseInt(d ? d[1] : "00"), K = Number.parseInt(d ? d[2] : "00"), r.before = o.setHours(A, D, K, 0) / 1e3, r.period || (r.period = o.getDay() === 1 ? 72 : 24);
|
|
3190
3190
|
break;
|
|
3191
3191
|
case Zt.DELAYED:
|
|
3192
|
-
|
|
3192
|
+
l.delay && l.delay > 0 && (r.delay = `${l.delay}`);
|
|
3193
3193
|
break;
|
|
3194
3194
|
case Zt.APPROVED:
|
|
3195
3195
|
r.approved = "1";
|
|
3196
3196
|
break;
|
|
3197
3197
|
default:
|
|
3198
|
-
|
|
3198
|
+
l.period !== 0 && (r.period = l.period);
|
|
3199
3199
|
}
|
|
3200
3200
|
return r;
|
|
3201
3201
|
}
|
|
@@ -3248,9 +3248,9 @@ class jr {
|
|
|
3248
3248
|
k(this, "getMessages", async (r) => {
|
|
3249
3249
|
const o = (r == null ? void 0 : r.order) ?? "utc";
|
|
3250
3250
|
o !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3251
|
-
const
|
|
3251
|
+
const d = (K) => K.utc > ((r == null ? void 0 : r.since) || 0), A = (K) => K.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3252
3252
|
try {
|
|
3253
|
-
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(
|
|
3253
|
+
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(d).filter(A).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(o);
|
|
3254
3254
|
if (U.length === 0)
|
|
3255
3255
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3256
3256
|
let M = U.map((X) => this.db.table(N.MESSAGES).get({ id: X.message_id }));
|
|
@@ -3297,7 +3297,7 @@ class jr {
|
|
|
3297
3297
|
dashboard_id: r.dashboard,
|
|
3298
3298
|
//data: data.data,
|
|
3299
3299
|
data: o
|
|
3300
|
-
}).then(() => 201).catch((
|
|
3300
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", g.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3301
3301
|
/**
|
|
3302
3302
|
* Update Series
|
|
3303
3303
|
* @param query IQuery
|
|
@@ -3309,7 +3309,7 @@ class jr {
|
|
|
3309
3309
|
dashboard_id: r.dashboard,
|
|
3310
3310
|
//data: data.data,
|
|
3311
3311
|
data: o
|
|
3312
|
-
}).then(() => 201).catch((
|
|
3312
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", g.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3313
3313
|
/**
|
|
3314
3314
|
* Update Messages
|
|
3315
3315
|
* @param query IQuery
|
|
@@ -3319,8 +3319,8 @@ class jr {
|
|
|
3319
3319
|
k(this, "setMessages", async (r, o) => {
|
|
3320
3320
|
if (r.type !== N.MESSAGES)
|
|
3321
3321
|
return 400;
|
|
3322
|
-
const
|
|
3323
|
-
let
|
|
3322
|
+
const d = o.data.title;
|
|
3323
|
+
let A = 0;
|
|
3324
3324
|
return o.data.messages.forEach(async (D) => {
|
|
3325
3325
|
var K, U, M, X, se, ee, le;
|
|
3326
3326
|
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
@@ -3329,16 +3329,16 @@ class jr {
|
|
|
3329
3329
|
data: D,
|
|
3330
3330
|
expires: D.expires
|
|
3331
3331
|
}).catch((He) => {
|
|
3332
|
-
|
|
3332
|
+
A++, console.error(
|
|
3333
3333
|
"%cstorage",
|
|
3334
3334
|
g.STORAGE,
|
|
3335
3335
|
"set message",
|
|
3336
|
-
`title: ${
|
|
3336
|
+
`title: ${d}`,
|
|
3337
3337
|
D,
|
|
3338
3338
|
He.message
|
|
3339
3339
|
);
|
|
3340
3340
|
}), await this.db.table(N.TOPICS).put({
|
|
3341
|
-
title:
|
|
3341
|
+
title: d,
|
|
3342
3342
|
widget_id: r.widget,
|
|
3343
3343
|
message_id: D.id,
|
|
3344
3344
|
dashboard_id: r.dashboard,
|
|
@@ -3349,11 +3349,11 @@ class jr {
|
|
|
3349
3349
|
utc: D.utc,
|
|
3350
3350
|
expires: D.expires
|
|
3351
3351
|
}).catch((He) => {
|
|
3352
|
-
|
|
3352
|
+
A++, console.error(
|
|
3353
3353
|
"%cstorage",
|
|
3354
3354
|
g.STORAGE,
|
|
3355
3355
|
"set topic",
|
|
3356
|
-
`title: ${
|
|
3356
|
+
`title: ${d}`,
|
|
3357
3357
|
D,
|
|
3358
3358
|
He.message
|
|
3359
3359
|
);
|
|
@@ -3361,7 +3361,7 @@ class jr {
|
|
|
3361
3361
|
}), o.data.topics.forEach(async (D) => {
|
|
3362
3362
|
const K = D.message_id, U = D.visible ? 1 : 0, M = D.title;
|
|
3363
3363
|
await this.db.table(N.TOPICS).where("message_id").equals(K).modify({ visible: U }).catch((X) => {
|
|
3364
|
-
|
|
3364
|
+
A++, console.error(
|
|
3365
3365
|
"%cstorage",
|
|
3366
3366
|
g.STORAGE,
|
|
3367
3367
|
"update message visibility",
|
|
@@ -3370,20 +3370,20 @@ class jr {
|
|
|
3370
3370
|
X.message
|
|
3371
3371
|
);
|
|
3372
3372
|
});
|
|
3373
|
-
}),
|
|
3373
|
+
}), A === 0 ? 201 : 400;
|
|
3374
3374
|
});
|
|
3375
3375
|
/**
|
|
3376
3376
|
* Wipe Message data after expires timestamp
|
|
3377
3377
|
*/
|
|
3378
3378
|
k(this, "cleanMessages", async () => {
|
|
3379
|
-
const r = Date.now() / 1e3, o = (D) => D.expires < r,
|
|
3379
|
+
const r = Date.now() / 1e3, o = (D) => D.expires < r, d = (D) => D.expires < r;
|
|
3380
3380
|
return await this.db.table(N.TOPICS).orderBy("expires").filter(o).delete().catch((D) => (console.error(
|
|
3381
3381
|
"%cstorage%c %cclean",
|
|
3382
3382
|
g.STORAGE,
|
|
3383
3383
|
g.NONE,
|
|
3384
3384
|
g.MESSAGES,
|
|
3385
3385
|
D.message
|
|
3386
|
-
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(
|
|
3386
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(d).delete().catch((D) => (console.error(
|
|
3387
3387
|
"%cstorage%c %clean",
|
|
3388
3388
|
g.STORAGE,
|
|
3389
3389
|
g.NONE,
|
|
@@ -3392,12 +3392,12 @@ class jr {
|
|
|
3392
3392
|
), 0));
|
|
3393
3393
|
});
|
|
3394
3394
|
k(this, "hideMessage", async (r, o) => {
|
|
3395
|
-
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((
|
|
3395
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((d) => (console.error(
|
|
3396
3396
|
"%cstorage%c %chide",
|
|
3397
3397
|
g.STORAGE,
|
|
3398
3398
|
g.NONE,
|
|
3399
3399
|
g.HIDE,
|
|
3400
|
-
|
|
3400
|
+
d.message
|
|
3401
3401
|
), 0));
|
|
3402
3402
|
});
|
|
3403
3403
|
/**
|
|
@@ -3422,7 +3422,7 @@ class jr {
|
|
|
3422
3422
|
* @returns null
|
|
3423
3423
|
*/
|
|
3424
3424
|
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3425
|
-
(
|
|
3425
|
+
(d) => d.widget === r.widget
|
|
3426
3426
|
).length > 0 || (r.type === N.MESSAGES && (r = St(this.options, r)), console.info(
|
|
3427
3427
|
"%cstorage%c %csubscribe",
|
|
3428
3428
|
g.STORAGE,
|
|
@@ -3492,26 +3492,26 @@ class jr {
|
|
|
3492
3492
|
}), this.db.open();
|
|
3493
3493
|
}
|
|
3494
3494
|
}
|
|
3495
|
-
function zn(
|
|
3495
|
+
function zn(l) {
|
|
3496
3496
|
return new Promise((r, o) => {
|
|
3497
|
-
|
|
3497
|
+
l.oncomplete = l.onsuccess = () => r(l.result), l.onabort = l.onerror = () => o(l.error);
|
|
3498
3498
|
});
|
|
3499
3499
|
}
|
|
3500
|
-
function Ma(
|
|
3501
|
-
const o = indexedDB.open(
|
|
3500
|
+
function Ma(l, r) {
|
|
3501
|
+
const o = indexedDB.open(l);
|
|
3502
3502
|
o.onupgradeneeded = () => o.result.createObjectStore(r);
|
|
3503
|
-
const
|
|
3504
|
-
return (
|
|
3503
|
+
const d = zn(o);
|
|
3504
|
+
return (A, D) => d.then((K) => D(K.transaction(r, A).objectStore(r)));
|
|
3505
3505
|
}
|
|
3506
3506
|
let Un;
|
|
3507
3507
|
function Nr() {
|
|
3508
3508
|
return Un || (Un = Ma("keyval-store", "keyval")), Un;
|
|
3509
3509
|
}
|
|
3510
|
-
function Vt(
|
|
3511
|
-
return r("readonly", (o) => zn(o.get(
|
|
3510
|
+
function Vt(l, r = Nr()) {
|
|
3511
|
+
return r("readonly", (o) => zn(o.get(l)));
|
|
3512
3512
|
}
|
|
3513
|
-
function wt(
|
|
3514
|
-
return o("readwrite", (
|
|
3513
|
+
function wt(l, r, o = Nr()) {
|
|
3514
|
+
return o("readwrite", (d) => (d.put(r, l), zn(d.transaction)));
|
|
3515
3515
|
}
|
|
3516
3516
|
class Kr {
|
|
3517
3517
|
constructor(r) {
|
|
@@ -3519,15 +3519,15 @@ class Kr {
|
|
|
3519
3519
|
k(this, "options");
|
|
3520
3520
|
k(this, "getCloud", async (r) => {
|
|
3521
3521
|
const o = V(r);
|
|
3522
|
-
return await Vt(o).then((
|
|
3522
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3523
3523
|
});
|
|
3524
3524
|
k(this, "getSeries", async (r) => {
|
|
3525
3525
|
const o = V(r);
|
|
3526
|
-
return await Vt(o).then((
|
|
3526
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3527
3527
|
});
|
|
3528
3528
|
k(this, "getMessages", async (r) => {
|
|
3529
3529
|
const o = V(r);
|
|
3530
|
-
return await Vt(o).then((
|
|
3530
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3531
3531
|
});
|
|
3532
3532
|
/**
|
|
3533
3533
|
* Update Cloud
|
|
@@ -3538,8 +3538,8 @@ class Kr {
|
|
|
3538
3538
|
k(this, "setCloud", async (r, o) => {
|
|
3539
3539
|
if (!o.success)
|
|
3540
3540
|
return 400;
|
|
3541
|
-
const
|
|
3542
|
-
return delete o.success, delete o.message, await wt(
|
|
3541
|
+
const d = V(r);
|
|
3542
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.CLOUD, r, A.message), 400));
|
|
3543
3543
|
});
|
|
3544
3544
|
/**
|
|
3545
3545
|
* Update Series
|
|
@@ -3550,8 +3550,8 @@ class Kr {
|
|
|
3550
3550
|
k(this, "setSeries", async (r, o) => {
|
|
3551
3551
|
if (!o.success)
|
|
3552
3552
|
return 400;
|
|
3553
|
-
const
|
|
3554
|
-
return delete o.success, delete o.message, await wt(
|
|
3553
|
+
const d = V(r);
|
|
3554
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.SERIES, r, A.message), 400));
|
|
3555
3555
|
});
|
|
3556
3556
|
/**
|
|
3557
3557
|
* Update Messages
|
|
@@ -3562,8 +3562,8 @@ class Kr {
|
|
|
3562
3562
|
k(this, "setMessages", async (r, o) => {
|
|
3563
3563
|
if (!o.success)
|
|
3564
3564
|
return 400;
|
|
3565
|
-
const
|
|
3566
|
-
return delete o.success, delete o.message, await wt(
|
|
3565
|
+
const d = V(r);
|
|
3566
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A.message), 400));
|
|
3567
3567
|
});
|
|
3568
3568
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
3569
3569
|
k(this, "hideMessage", async (r, o) => {
|
|
@@ -3577,12 +3577,12 @@ class Kr {
|
|
|
3577
3577
|
* @returns number
|
|
3578
3578
|
*/
|
|
3579
3579
|
k(this, "setWidget", async (r) => {
|
|
3580
|
-
const o = V(r),
|
|
3580
|
+
const o = V(r), d = {
|
|
3581
3581
|
id: r.widget,
|
|
3582
3582
|
dashboard_id: r.dashboard,
|
|
3583
3583
|
type: r.type
|
|
3584
3584
|
};
|
|
3585
|
-
return await wt(o,
|
|
3585
|
+
return await wt(o, d).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.WIDGET, r, A.message), 400));
|
|
3586
3586
|
});
|
|
3587
3587
|
/**
|
|
3588
3588
|
* Add component subscriber
|
|
@@ -3590,7 +3590,7 @@ class Kr {
|
|
|
3590
3590
|
* @returns null
|
|
3591
3591
|
*/
|
|
3592
3592
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3593
|
-
(
|
|
3593
|
+
(d) => d.widget === r.widget
|
|
3594
3594
|
).length > 0 || (console.debug(
|
|
3595
3595
|
"%cstorage%c %csubscribe",
|
|
3596
3596
|
g.STORAGE,
|
|
@@ -3606,7 +3606,7 @@ class Kr {
|
|
|
3606
3606
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3607
3607
|
k(this, "loadSlide", async (r) => {
|
|
3608
3608
|
const o = V(r);
|
|
3609
|
-
return await Vt(o).then((
|
|
3609
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3610
3610
|
});
|
|
3611
3611
|
/**
|
|
3612
3612
|
* Update Slide
|
|
@@ -3614,14 +3614,14 @@ class Kr {
|
|
|
3614
3614
|
* @returns number
|
|
3615
3615
|
*/
|
|
3616
3616
|
k(this, "storeSlide", async (r) => {
|
|
3617
|
-
const o = V(r),
|
|
3617
|
+
const o = V(r), d = {
|
|
3618
3618
|
id: r.id,
|
|
3619
3619
|
title: r.data.title || "Not set",
|
|
3620
3620
|
json: r.data.json || {},
|
|
3621
3621
|
html: r.data.html || "",
|
|
3622
3622
|
css: r.data.css || ""
|
|
3623
3623
|
};
|
|
3624
|
-
return await wt(o,
|
|
3624
|
+
return await wt(o, d).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.SLIDE, r, A.message), 400));
|
|
3625
3625
|
});
|
|
3626
3626
|
this.options = r;
|
|
3627
3627
|
}
|
|
@@ -3634,24 +3634,24 @@ class Br {
|
|
|
3634
3634
|
const o = V(r);
|
|
3635
3635
|
try {
|
|
3636
3636
|
return localStorage.getObject(o);
|
|
3637
|
-
} catch (
|
|
3638
|
-
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget,
|
|
3637
|
+
} catch (d) {
|
|
3638
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3639
3639
|
}
|
|
3640
3640
|
});
|
|
3641
3641
|
k(this, "getSeries", async (r) => {
|
|
3642
3642
|
const o = V(r);
|
|
3643
3643
|
try {
|
|
3644
3644
|
return localStorage.getObject(o);
|
|
3645
|
-
} catch (
|
|
3646
|
-
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget,
|
|
3645
|
+
} catch (d) {
|
|
3646
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3647
3647
|
}
|
|
3648
3648
|
});
|
|
3649
3649
|
k(this, "getMessages", async (r) => {
|
|
3650
3650
|
const o = V(r);
|
|
3651
3651
|
try {
|
|
3652
3652
|
return localStorage.getObject(o);
|
|
3653
|
-
} catch (
|
|
3654
|
-
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget,
|
|
3653
|
+
} catch (d) {
|
|
3654
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3655
3655
|
}
|
|
3656
3656
|
});
|
|
3657
3657
|
/**
|
|
@@ -3661,11 +3661,11 @@ class Br {
|
|
|
3661
3661
|
* @returns number
|
|
3662
3662
|
*/
|
|
3663
3663
|
k(this, "setCloud", async (r, o) => {
|
|
3664
|
-
const
|
|
3664
|
+
const d = V(r);
|
|
3665
3665
|
try {
|
|
3666
|
-
return localStorage.setObject(
|
|
3667
|
-
} catch (
|
|
3668
|
-
return console.error("%cstorage", g.STORAGE, N.CLOUD, r,
|
|
3666
|
+
return localStorage.setObject(d, o), 201;
|
|
3667
|
+
} catch (A) {
|
|
3668
|
+
return console.error("%cstorage", g.STORAGE, N.CLOUD, r, A), 400;
|
|
3669
3669
|
}
|
|
3670
3670
|
});
|
|
3671
3671
|
/**
|
|
@@ -3675,11 +3675,11 @@ class Br {
|
|
|
3675
3675
|
* @returns number
|
|
3676
3676
|
*/
|
|
3677
3677
|
k(this, "setSeries", async (r, o) => {
|
|
3678
|
-
const
|
|
3678
|
+
const d = V(r);
|
|
3679
3679
|
try {
|
|
3680
|
-
return localStorage.setObject(
|
|
3681
|
-
} catch (
|
|
3682
|
-
return console.error("%cstorage", g.STORAGE, N.SERIES, r,
|
|
3680
|
+
return localStorage.setObject(d, o), 201;
|
|
3681
|
+
} catch (A) {
|
|
3682
|
+
return console.error("%cstorage", g.STORAGE, N.SERIES, r, A), 400;
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
3685
|
/**
|
|
@@ -3689,11 +3689,11 @@ class Br {
|
|
|
3689
3689
|
* @returns number
|
|
3690
3690
|
*/
|
|
3691
3691
|
k(this, "setMessages", async (r, o) => {
|
|
3692
|
-
const
|
|
3692
|
+
const d = V(r);
|
|
3693
3693
|
try {
|
|
3694
|
-
return localStorage.setObject(
|
|
3695
|
-
} catch (
|
|
3696
|
-
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r,
|
|
3694
|
+
return localStorage.setObject(d, o), 200;
|
|
3695
|
+
} catch (A) {
|
|
3696
|
+
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A), 400;
|
|
3697
3697
|
}
|
|
3698
3698
|
});
|
|
3699
3699
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3704,8 +3704,8 @@ class Br {
|
|
|
3704
3704
|
const o = `widget.${r.widget}`;
|
|
3705
3705
|
try {
|
|
3706
3706
|
return localStorage.setObject(o, r), 201;
|
|
3707
|
-
} catch (
|
|
3708
|
-
return console.error("%cstorage", g.STORAGE, N.WIDGET, r,
|
|
3707
|
+
} catch (d) {
|
|
3708
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3709
3709
|
}
|
|
3710
3710
|
});
|
|
3711
3711
|
/**
|
|
@@ -3714,7 +3714,7 @@ class Br {
|
|
|
3714
3714
|
* @returns null
|
|
3715
3715
|
*/
|
|
3716
3716
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3717
|
-
(
|
|
3717
|
+
(d) => d.widget === r.widget
|
|
3718
3718
|
).length || (console.debug(
|
|
3719
3719
|
"%cstorage%c %csubscribe",
|
|
3720
3720
|
g.STORAGE,
|
|
@@ -3748,11 +3748,11 @@ class Br {
|
|
|
3748
3748
|
return console.error("%cstorage", g.STORAGE, N.SLIDE, r, o), 400;
|
|
3749
3749
|
}
|
|
3750
3750
|
});
|
|
3751
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3752
|
-
this.setObject(o, JSON.stringify(
|
|
3751
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3752
|
+
this.setObject(o, JSON.stringify(d));
|
|
3753
3753
|
}, Storage.prototype.getObject = function(o) {
|
|
3754
|
-
const
|
|
3755
|
-
return
|
|
3754
|
+
const d = this.getObject(o);
|
|
3755
|
+
return d && JSON.parse(d);
|
|
3756
3756
|
};
|
|
3757
3757
|
}
|
|
3758
3758
|
}
|
|
@@ -3764,24 +3764,24 @@ class Lr {
|
|
|
3764
3764
|
const o = V(r);
|
|
3765
3765
|
try {
|
|
3766
3766
|
return sessionStorage.getObject(o);
|
|
3767
|
-
} catch (
|
|
3768
|
-
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget,
|
|
3767
|
+
} catch (d) {
|
|
3768
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3769
3769
|
}
|
|
3770
3770
|
});
|
|
3771
3771
|
k(this, "getSeries", async (r) => {
|
|
3772
3772
|
const o = V(r);
|
|
3773
3773
|
try {
|
|
3774
3774
|
return sessionStorage.getObject(o);
|
|
3775
|
-
} catch (
|
|
3776
|
-
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget,
|
|
3775
|
+
} catch (d) {
|
|
3776
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3777
3777
|
}
|
|
3778
3778
|
});
|
|
3779
3779
|
k(this, "getMessages", async (r) => {
|
|
3780
3780
|
const o = V(r);
|
|
3781
3781
|
try {
|
|
3782
3782
|
return sessionStorage.getObject(o);
|
|
3783
|
-
} catch (
|
|
3784
|
-
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget,
|
|
3783
|
+
} catch (d) {
|
|
3784
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3785
3785
|
}
|
|
3786
3786
|
});
|
|
3787
3787
|
/**
|
|
@@ -3791,11 +3791,11 @@ class Lr {
|
|
|
3791
3791
|
* @returns number
|
|
3792
3792
|
*/
|
|
3793
3793
|
k(this, "setCloud", async (r, o) => {
|
|
3794
|
-
const
|
|
3794
|
+
const d = V(r);
|
|
3795
3795
|
try {
|
|
3796
|
-
return sessionStorage.setObject(
|
|
3797
|
-
} catch (
|
|
3798
|
-
return console.error("%cstorage", g.STORAGE, N.CLOUD, r,
|
|
3796
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3797
|
+
} catch (A) {
|
|
3798
|
+
return console.error("%cstorage", g.STORAGE, N.CLOUD, r, A), 400;
|
|
3799
3799
|
}
|
|
3800
3800
|
});
|
|
3801
3801
|
/**
|
|
@@ -3805,11 +3805,11 @@ class Lr {
|
|
|
3805
3805
|
* @returns number
|
|
3806
3806
|
*/
|
|
3807
3807
|
k(this, "setSeries", async (r, o) => {
|
|
3808
|
-
const
|
|
3808
|
+
const d = V(r);
|
|
3809
3809
|
try {
|
|
3810
|
-
return sessionStorage.setObject(
|
|
3811
|
-
} catch (
|
|
3812
|
-
return console.error("%cstorage", g.STORAGE, N.SERIES, r,
|
|
3810
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3811
|
+
} catch (A) {
|
|
3812
|
+
return console.error("%cstorage", g.STORAGE, N.SERIES, r, A), 400;
|
|
3813
3813
|
}
|
|
3814
3814
|
});
|
|
3815
3815
|
/**
|
|
@@ -3819,11 +3819,11 @@ class Lr {
|
|
|
3819
3819
|
* @returns number
|
|
3820
3820
|
*/
|
|
3821
3821
|
k(this, "setMessages", async (r, o) => {
|
|
3822
|
-
const
|
|
3822
|
+
const d = V(r);
|
|
3823
3823
|
try {
|
|
3824
|
-
return sessionStorage.setObject(
|
|
3825
|
-
} catch (
|
|
3826
|
-
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r,
|
|
3824
|
+
return sessionStorage.setObject(d, o), 200;
|
|
3825
|
+
} catch (A) {
|
|
3826
|
+
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A), 400;
|
|
3827
3827
|
}
|
|
3828
3828
|
});
|
|
3829
3829
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3834,8 +3834,8 @@ class Lr {
|
|
|
3834
3834
|
const o = `widget.${r.widget}`;
|
|
3835
3835
|
try {
|
|
3836
3836
|
return sessionStorage.setObject(o, r), 201;
|
|
3837
|
-
} catch (
|
|
3838
|
-
return console.error("%cstorage", g.STORAGE, N.WIDGET, r,
|
|
3837
|
+
} catch (d) {
|
|
3838
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3839
3839
|
}
|
|
3840
3840
|
});
|
|
3841
3841
|
/**
|
|
@@ -3844,7 +3844,7 @@ class Lr {
|
|
|
3844
3844
|
* @returns null
|
|
3845
3845
|
*/
|
|
3846
3846
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3847
|
-
(
|
|
3847
|
+
(d) => d.widget === r.widget
|
|
3848
3848
|
).length || (console.debug(
|
|
3849
3849
|
"%cstorage%c %csubscribe",
|
|
3850
3850
|
g.STORAGE,
|
|
@@ -3883,11 +3883,11 @@ class Lr {
|
|
|
3883
3883
|
return console.error("%cstorage", g.STORAGE, N.SLIDE, r, o), 400;
|
|
3884
3884
|
}
|
|
3885
3885
|
});
|
|
3886
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3887
|
-
this.setItem(o, JSON.stringify(
|
|
3886
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3887
|
+
this.setItem(o, JSON.stringify(d));
|
|
3888
3888
|
}, Storage.prototype.getObject = function(o) {
|
|
3889
|
-
const
|
|
3890
|
-
return
|
|
3889
|
+
const d = this.getItem(o);
|
|
3890
|
+
return d && JSON.parse(d);
|
|
3891
3891
|
};
|
|
3892
3892
|
}
|
|
3893
3893
|
}
|
|
@@ -3899,24 +3899,24 @@ class Gr {
|
|
|
3899
3899
|
const o = V(r);
|
|
3900
3900
|
try {
|
|
3901
3901
|
return window.BuzzCasting.WidgetData[o];
|
|
3902
|
-
} catch (
|
|
3903
|
-
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget,
|
|
3902
|
+
} catch (d) {
|
|
3903
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Cloud Data error", success: !1 };
|
|
3904
3904
|
}
|
|
3905
3905
|
});
|
|
3906
3906
|
k(this, "getSeries", async (r) => {
|
|
3907
3907
|
const o = V(r);
|
|
3908
3908
|
try {
|
|
3909
3909
|
return window.BuzzCasting.WidgetData[o];
|
|
3910
|
-
} catch (
|
|
3911
|
-
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget,
|
|
3910
|
+
} catch (d) {
|
|
3911
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Series Data error", success: !1 };
|
|
3912
3912
|
}
|
|
3913
3913
|
});
|
|
3914
3914
|
k(this, "getMessages", async (r) => {
|
|
3915
3915
|
const o = V(r);
|
|
3916
3916
|
try {
|
|
3917
3917
|
return window.BuzzCasting.WidgetData[o];
|
|
3918
|
-
} catch (
|
|
3919
|
-
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget,
|
|
3918
|
+
} catch (d) {
|
|
3919
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3920
3920
|
}
|
|
3921
3921
|
});
|
|
3922
3922
|
/**
|
|
@@ -3926,11 +3926,11 @@ class Gr {
|
|
|
3926
3926
|
* @returns number
|
|
3927
3927
|
*/
|
|
3928
3928
|
k(this, "setCloud", async (r, o) => {
|
|
3929
|
-
const
|
|
3929
|
+
const d = V(r);
|
|
3930
3930
|
try {
|
|
3931
|
-
return window.BuzzCasting.WidgetData[
|
|
3932
|
-
} catch (
|
|
3933
|
-
return console.error("%cstorage", g.STORAGE, "set", r,
|
|
3931
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3932
|
+
} catch (A) {
|
|
3933
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3934
3934
|
}
|
|
3935
3935
|
});
|
|
3936
3936
|
/**
|
|
@@ -3940,11 +3940,11 @@ class Gr {
|
|
|
3940
3940
|
* @returns number
|
|
3941
3941
|
*/
|
|
3942
3942
|
k(this, "setSeries", async (r, o) => {
|
|
3943
|
-
const
|
|
3943
|
+
const d = V(r);
|
|
3944
3944
|
try {
|
|
3945
|
-
return window.BuzzCasting.WidgetData[
|
|
3946
|
-
} catch (
|
|
3947
|
-
return console.error("%cstorage", g.STORAGE, "set", r,
|
|
3945
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3946
|
+
} catch (A) {
|
|
3947
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3948
3948
|
}
|
|
3949
3949
|
});
|
|
3950
3950
|
/**
|
|
@@ -3954,11 +3954,11 @@ class Gr {
|
|
|
3954
3954
|
* @returns number
|
|
3955
3955
|
*/
|
|
3956
3956
|
k(this, "setMessages", async (r, o) => {
|
|
3957
|
-
const
|
|
3957
|
+
const d = V(r);
|
|
3958
3958
|
try {
|
|
3959
|
-
return window.BuzzCasting.WidgetData[
|
|
3960
|
-
} catch (
|
|
3961
|
-
return console.error("%cstorage", g.STORAGE, "set", r,
|
|
3959
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3960
|
+
} catch (A) {
|
|
3961
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3962
3962
|
}
|
|
3963
3963
|
});
|
|
3964
3964
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3969,8 +3969,8 @@ class Gr {
|
|
|
3969
3969
|
const o = `widget.${r.widget}`;
|
|
3970
3970
|
try {
|
|
3971
3971
|
return window.BuzzCasting.WidgetData[o] = r, 201;
|
|
3972
|
-
} catch (
|
|
3973
|
-
return console.error("%cstorage", g.STORAGE, N.WIDGET, r,
|
|
3972
|
+
} catch (d) {
|
|
3973
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3974
3974
|
}
|
|
3975
3975
|
});
|
|
3976
3976
|
/**
|
|
@@ -3979,7 +3979,7 @@ class Gr {
|
|
|
3979
3979
|
* @returns null
|
|
3980
3980
|
*/
|
|
3981
3981
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3982
|
-
(
|
|
3982
|
+
(d) => d.widget === r.widget
|
|
3983
3983
|
).length || (console.debug(
|
|
3984
3984
|
"%cstorage%c %csubscribe",
|
|
3985
3985
|
g.STORAGE,
|
|
@@ -4016,44 +4016,44 @@ class Gr {
|
|
|
4016
4016
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
4017
4017
|
}
|
|
4018
4018
|
}
|
|
4019
|
-
function Fa(
|
|
4020
|
-
const r =
|
|
4021
|
-
return r.length > 0 ? (r.forEach((o,
|
|
4022
|
-
r[
|
|
4019
|
+
function Fa(l) {
|
|
4020
|
+
const r = l.toUpperCase().split(/[\s_-]+/);
|
|
4021
|
+
return r.length > 0 ? (r.forEach((o, d) => {
|
|
4022
|
+
r[d] = `${o.charAt(0)}.`;
|
|
4023
4023
|
}), r.join(" ")) : "";
|
|
4024
4024
|
}
|
|
4025
|
-
function Wa(
|
|
4026
|
-
let r = "", o = "",
|
|
4025
|
+
function Wa(l) {
|
|
4026
|
+
let r = "", o = "", d = {
|
|
4027
4027
|
backgroundImage: ""
|
|
4028
4028
|
};
|
|
4029
|
-
return typeof
|
|
4030
|
-
(
|
|
4031
|
-
backgroundImage: `url(${
|
|
4032
|
-
}, o =
|
|
4029
|
+
return typeof l.media < "u" && l.media.forEach((A) => {
|
|
4030
|
+
(A.type === "photo" || A.type === "image") && (d = {
|
|
4031
|
+
backgroundImage: `url(${A.url})`
|
|
4032
|
+
}, o = A.url), A.type === "video" && (r = A.url);
|
|
4033
4033
|
}), {
|
|
4034
4034
|
image: o,
|
|
4035
|
-
background:
|
|
4035
|
+
background: d || null,
|
|
4036
4036
|
video: r
|
|
4037
4037
|
};
|
|
4038
4038
|
}
|
|
4039
|
-
function ja(
|
|
4039
|
+
function ja(l) {
|
|
4040
4040
|
const r = {};
|
|
4041
|
-
for (let o = 0; o <
|
|
4042
|
-
const
|
|
4043
|
-
|
|
4041
|
+
for (let o = 0; o < l.length; o++) {
|
|
4042
|
+
const d = l.item(o);
|
|
4043
|
+
d != null && d.name && (r[d.name] = d.value);
|
|
4044
4044
|
}
|
|
4045
4045
|
return r;
|
|
4046
4046
|
}
|
|
4047
|
-
function za(
|
|
4047
|
+
function za(l) {
|
|
4048
4048
|
const r = {};
|
|
4049
|
-
for (let o = 0; o <
|
|
4050
|
-
const
|
|
4051
|
-
|
|
4049
|
+
for (let o = 0; o < l.length; o++) {
|
|
4050
|
+
const d = l[o];
|
|
4051
|
+
d.name !== "class" && !d.name.includes("data") && (r[d.name] = d.value);
|
|
4052
4052
|
}
|
|
4053
4053
|
return r;
|
|
4054
4054
|
}
|
|
4055
|
-
function Ha(
|
|
4056
|
-
switch (
|
|
4055
|
+
function Ha(l, r) {
|
|
4056
|
+
switch (l) {
|
|
4057
4057
|
case "bl":
|
|
4058
4058
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4059
4059
|
case "co":
|
|
@@ -4094,63 +4094,63 @@ function Ha(d, r) {
|
|
|
4094
4094
|
return "";
|
|
4095
4095
|
}
|
|
4096
4096
|
}
|
|
4097
|
-
function Ya(
|
|
4098
|
-
return
|
|
4097
|
+
function Ya(l) {
|
|
4098
|
+
return l.replace(/^\w|[A-Z]|\b\w/g, (r, o) => o === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4099
4099
|
}
|
|
4100
|
-
function Qa(
|
|
4101
|
-
return
|
|
4100
|
+
function Qa(l) {
|
|
4101
|
+
return l.toLowerCase().split("-").reduce((r, o) => r + (o.charAt(0).toUpperCase() + o.slice(1)));
|
|
4102
4102
|
}
|
|
4103
|
-
const Xa = (
|
|
4104
|
-
function Na(
|
|
4103
|
+
const Xa = (l) => l.charAt(0).toUpperCase() + l.slice(1);
|
|
4104
|
+
function Na(l) {
|
|
4105
4105
|
const r = document.createRange();
|
|
4106
|
-
r.selectNodeContents(
|
|
4106
|
+
r.selectNodeContents(l), r.deleteContents();
|
|
4107
4107
|
}
|
|
4108
|
-
function Ka(
|
|
4109
|
-
|
|
4108
|
+
function Ka(l) {
|
|
4109
|
+
l.reduce(
|
|
4110
4110
|
(r, o) => Object.keys(o).reduce(
|
|
4111
|
-
(
|
|
4112
|
-
...
|
|
4113
|
-
[
|
|
4111
|
+
(d, A) => ({
|
|
4112
|
+
...d,
|
|
4113
|
+
[A]: A in r && typeof r[A] == "object" && r[A] !== null && typeof o[A] == "object" && o[A] !== null ? Ka([r[A], o[A]]) : o[A]
|
|
4114
4114
|
}),
|
|
4115
4115
|
r
|
|
4116
4116
|
),
|
|
4117
4117
|
{}
|
|
4118
4118
|
);
|
|
4119
4119
|
}
|
|
4120
|
-
function Ja(
|
|
4121
|
-
return `${(
|
|
4120
|
+
function Ja(l, r = "font-bold") {
|
|
4121
|
+
return `${(l == null ? void 0 : l.title.length) > 0 ? `<div class="${r}">${l.title}</div>` : ""}${l != null && l.content ? l.content.replace(/\n\n/g, `
|
|
4122
4122
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4123
4123
|
}
|
|
4124
|
-
function Ba(
|
|
4125
|
-
for (;
|
|
4126
|
-
|
|
4127
|
-
return
|
|
4124
|
+
function Ba(l, r) {
|
|
4125
|
+
for (; l.length < r; )
|
|
4126
|
+
l = `0${l}`;
|
|
4127
|
+
return l;
|
|
4128
4128
|
}
|
|
4129
|
-
function Oe(
|
|
4130
|
-
let o,
|
|
4129
|
+
function Oe(l, r) {
|
|
4130
|
+
let o, d, A;
|
|
4131
4131
|
if (r.length === 0)
|
|
4132
|
-
return
|
|
4133
|
-
for (o = 0,
|
|
4134
|
-
|
|
4135
|
-
return
|
|
4132
|
+
return l;
|
|
4133
|
+
for (o = 0, A = r.length; o < A; o++)
|
|
4134
|
+
d = r.charCodeAt(o), l = (l << 5) - l + d, l |= 0;
|
|
4135
|
+
return l < 0 ? l * -2 : l;
|
|
4136
4136
|
}
|
|
4137
|
-
function La(
|
|
4138
|
-
return Object.keys(r).sort().reduce(
|
|
4139
|
-
function
|
|
4140
|
-
return $r(
|
|
4137
|
+
function La(l, r, o) {
|
|
4138
|
+
return Object.keys(r).sort().reduce(d, l);
|
|
4139
|
+
function d(A, D) {
|
|
4140
|
+
return $r(A, r[D], D, o);
|
|
4141
4141
|
}
|
|
4142
4142
|
}
|
|
4143
|
-
function $r(
|
|
4144
|
-
const
|
|
4143
|
+
function $r(l, r, o, d) {
|
|
4144
|
+
const A = Oe(Oe(Oe(l, o), Ga(r)), typeof r);
|
|
4145
4145
|
if (r === null)
|
|
4146
|
-
return Oe(
|
|
4146
|
+
return Oe(A, "null");
|
|
4147
4147
|
if (r === void 0)
|
|
4148
|
-
return Oe(
|
|
4148
|
+
return Oe(A, "undefined");
|
|
4149
4149
|
if (typeof r == "object" || typeof r == "function") {
|
|
4150
|
-
if (
|
|
4151
|
-
return Oe(
|
|
4152
|
-
|
|
4153
|
-
const D = La(
|
|
4150
|
+
if (d.includes(r))
|
|
4151
|
+
return Oe(A, `[Circular]${o}`);
|
|
4152
|
+
d.push(r);
|
|
4153
|
+
const D = La(A, r, d);
|
|
4154
4154
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4155
4155
|
return D;
|
|
4156
4156
|
try {
|
|
@@ -4159,17 +4159,17 @@ function $r(d, r, o, l) {
|
|
|
4159
4159
|
return Oe(D, `[valueOf exception]${K.stack || K.message}`);
|
|
4160
4160
|
}
|
|
4161
4161
|
}
|
|
4162
|
-
return Oe(
|
|
4162
|
+
return Oe(A, r.toString());
|
|
4163
4163
|
}
|
|
4164
|
-
function Ga(
|
|
4165
|
-
return Object.prototype.toString.call(
|
|
4164
|
+
function Ga(l) {
|
|
4165
|
+
return Object.prototype.toString.call(l);
|
|
4166
4166
|
}
|
|
4167
|
-
function Fn(
|
|
4168
|
-
return Ba($r(0,
|
|
4167
|
+
function Fn(l) {
|
|
4168
|
+
return Ba($r(0, l, "", []).toString(16), 8);
|
|
4169
4169
|
}
|
|
4170
|
-
function Va(
|
|
4171
|
-
if (
|
|
4172
|
-
return
|
|
4170
|
+
function Va(l, r) {
|
|
4171
|
+
if (l = l.toString().replace(/[^0-9.]/g, ""), l < 1e3)
|
|
4172
|
+
return l;
|
|
4173
4173
|
const o = [
|
|
4174
4174
|
{ v: 1e3, s: "K" },
|
|
4175
4175
|
{ v: 1e6, s: "M" },
|
|
@@ -4178,12 +4178,12 @@ function Va(d, r) {
|
|
|
4178
4178
|
{ v: 1e15, s: "P" },
|
|
4179
4179
|
{ v: 1e18, s: "E" }
|
|
4180
4180
|
];
|
|
4181
|
-
let
|
|
4182
|
-
for (
|
|
4181
|
+
let d;
|
|
4182
|
+
for (d = o.length - 1; d > 0 && !(l >= o[d].v); d--)
|
|
4183
4183
|
;
|
|
4184
|
-
return (
|
|
4184
|
+
return (l / o[d].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + o[d].s;
|
|
4185
4185
|
}
|
|
4186
|
-
function Za(
|
|
4186
|
+
function Za(l, r) {
|
|
4187
4187
|
const o = [
|
|
4188
4188
|
{ value: 1, symbol: "" },
|
|
4189
4189
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4192,14 +4192,14 @@ function Za(d, r) {
|
|
|
4192
4192
|
{ value: 1e12, symbol: "T" },
|
|
4193
4193
|
{ value: 1e15, symbol: "P" },
|
|
4194
4194
|
{ value: 1e18, symbol: "E" }
|
|
4195
|
-
],
|
|
4196
|
-
let
|
|
4197
|
-
for (
|
|
4195
|
+
], d = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4196
|
+
let A;
|
|
4197
|
+
for (A = o.length - 1; A > 0 && !(l >= o[A].value); A--)
|
|
4198
4198
|
;
|
|
4199
|
-
return (
|
|
4199
|
+
return (l / o[A].value).toFixed(r).replace(d, "$1") + o[A].symbol;
|
|
4200
4200
|
}
|
|
4201
|
-
function qa(
|
|
4202
|
-
switch (
|
|
4201
|
+
function qa(l) {
|
|
4202
|
+
switch (l.language) {
|
|
4203
4203
|
case "ar":
|
|
4204
4204
|
return {
|
|
4205
4205
|
direction: "rtl",
|
|
@@ -4209,44 +4209,44 @@ function qa(d) {
|
|
|
4209
4209
|
return {};
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
4212
|
-
function ei(
|
|
4212
|
+
function ei(l) {
|
|
4213
4213
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4214
|
-
return
|
|
4215
|
-
var
|
|
4216
|
-
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((
|
|
4214
|
+
return l.forEach((o) => {
|
|
4215
|
+
var d, A, D, K, U;
|
|
4216
|
+
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((d = o.content) == null ? void 0 : d.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", o.sender !== null ? ((((A = o.sender) == null ? void 0 : A.title) === "Unknown author" || ((D = o.sender) == null ? void 0 : D.title) === null) && (o.sender.title = ""), ((K = o.sender) == null ? void 0 : K.name) !== "" && o.sender.title === "" && (o.sender.title = o.sender.name), ((U = o.sender) == null ? void 0 : U.name) !== "" && o.channel === "tw" && (o.sender.name = `@${o.sender.name}`)) : o.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, o.sender.title === "" && o.link !== "") {
|
|
4217
4217
|
const M = new URL(o.link);
|
|
4218
4218
|
o.sender.title = M.hostname.replace("www.", "");
|
|
4219
4219
|
}
|
|
4220
|
-
}),
|
|
4220
|
+
}), l;
|
|
4221
4221
|
}
|
|
4222
|
-
function ti(
|
|
4223
|
-
|
|
4222
|
+
function ti(l, r, o, d) {
|
|
4223
|
+
l.stopPropagation(), r.showModal({
|
|
4224
4224
|
showComponent: "card-modal",
|
|
4225
|
-
props: { data: o, options:
|
|
4225
|
+
props: { data: o, options: d }
|
|
4226
4226
|
});
|
|
4227
4227
|
}
|
|
4228
|
-
function ni(
|
|
4229
|
-
const r = [...
|
|
4228
|
+
function ni(l) {
|
|
4229
|
+
const r = [...l];
|
|
4230
4230
|
for (let o = r.length - 1; o > 0; o--) {
|
|
4231
|
-
const
|
|
4232
|
-
[r[o], r[
|
|
4231
|
+
const d = Math.floor(Math.random() * (o + 1));
|
|
4232
|
+
[r[o], r[d]] = [r[d], r[o]];
|
|
4233
4233
|
}
|
|
4234
4234
|
return r;
|
|
4235
4235
|
}
|
|
4236
4236
|
function ri() {
|
|
4237
|
-
let
|
|
4237
|
+
let l = "";
|
|
4238
4238
|
const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4239
|
-
for (let o = 0; o < 7; o++)
|
|
4240
|
-
return
|
|
4239
|
+
for (let o = 0; o < 7; o++) l += r.charAt(Math.floor(Math.random() * r.length));
|
|
4240
|
+
return l;
|
|
4241
4241
|
}
|
|
4242
|
-
function ai(
|
|
4243
|
-
return
|
|
4242
|
+
function ai(l) {
|
|
4243
|
+
return l[Math.floor(Math.random() * l.length)];
|
|
4244
4244
|
}
|
|
4245
|
-
const ii = (
|
|
4245
|
+
const ii = (l) => {
|
|
4246
4246
|
switch (!0) {
|
|
4247
|
-
case
|
|
4247
|
+
case l < 0:
|
|
4248
4248
|
return "text-down text-xs";
|
|
4249
|
-
case
|
|
4249
|
+
case l > 0:
|
|
4250
4250
|
return "text-up text-xs";
|
|
4251
4251
|
default:
|
|
4252
4252
|
return "text-white text-xs";
|
|
@@ -4264,11 +4264,11 @@ class si {
|
|
|
4264
4264
|
const o = await this.sm.getSubscribers();
|
|
4265
4265
|
if (o.length === 0)
|
|
4266
4266
|
return;
|
|
4267
|
-
const
|
|
4268
|
-
r ?
|
|
4269
|
-
|
|
4270
|
-
}), await Promise.allSettled(
|
|
4271
|
-
(
|
|
4267
|
+
const d = [];
|
|
4268
|
+
r ? d.push(this.api.get(r)) : o == null || o.forEach((A) => {
|
|
4269
|
+
d.push(this.api.get(A));
|
|
4270
|
+
}), await Promise.allSettled(d).then(
|
|
4271
|
+
(A) => A.forEach(async (D) => {
|
|
4272
4272
|
let K, U = 400;
|
|
4273
4273
|
if (D.status === "fulfilled") {
|
|
4274
4274
|
let M = D.value;
|
|
@@ -4467,8 +4467,8 @@ class si {
|
|
|
4467
4467
|
}
|
|
4468
4468
|
});
|
|
4469
4469
|
k(this, "cleanMessages", async () => {
|
|
4470
|
-
var
|
|
4471
|
-
if ((
|
|
4470
|
+
var d, A, D;
|
|
4471
|
+
if ((d = this.options) != null && d.suspended) {
|
|
4472
4472
|
console.info(
|
|
4473
4473
|
"%cstorage%c %cstorage",
|
|
4474
4474
|
g.STORAGE,
|
|
@@ -4478,7 +4478,7 @@ class si {
|
|
|
4478
4478
|
);
|
|
4479
4479
|
return;
|
|
4480
4480
|
}
|
|
4481
|
-
const r = ((
|
|
4481
|
+
const r = ((A = this.options) == null ? void 0 : A.retention) || 86400 * 4, o = await ((D = this.sm) == null ? void 0 : D.cleanMessages(
|
|
4482
4482
|
r
|
|
4483
4483
|
));
|
|
4484
4484
|
console.info(
|
|
@@ -4490,8 +4490,8 @@ class si {
|
|
|
4490
4490
|
);
|
|
4491
4491
|
});
|
|
4492
4492
|
k(this, "hideMessage", async (r) => {
|
|
4493
|
-
var
|
|
4494
|
-
const o = await ((
|
|
4493
|
+
var d;
|
|
4494
|
+
const o = await ((d = this.sm) == null ? void 0 : d.hideMessage(r.id, 0));
|
|
4495
4495
|
return console.info(
|
|
4496
4496
|
"%cstorage%c %cstorage",
|
|
4497
4497
|
g.STORAGE,
|
|
@@ -4508,8 +4508,8 @@ class si {
|
|
|
4508
4508
|
k(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4509
4509
|
k(this, "storeSlide", async (r) => {
|
|
4510
4510
|
var o;
|
|
4511
|
-
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((
|
|
4512
|
-
|
|
4511
|
+
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((d, A) => {
|
|
4512
|
+
d(201);
|
|
4513
4513
|
})));
|
|
4514
4514
|
});
|
|
4515
4515
|
console.info(
|
|
@@ -4529,8 +4529,8 @@ class si {
|
|
|
4529
4529
|
g.BROADCAST,
|
|
4530
4530
|
re.CHANNEL,
|
|
4531
4531
|
o
|
|
4532
|
-
), this.bc.onmessage = (
|
|
4533
|
-
this.actions(
|
|
4532
|
+
), this.bc.onmessage = (d) => {
|
|
4533
|
+
this.actions(d);
|
|
4534
4534
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Da(r), r.storage) {
|
|
4535
4535
|
case ye.DEXIE:
|
|
4536
4536
|
this.sm = new jr(r);
|
|
@@ -4643,7 +4643,7 @@ class oi {
|
|
|
4643
4643
|
* @param callbacks functions in the widget that will receive the update
|
|
4644
4644
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4645
4645
|
*/
|
|
4646
|
-
constructor(r, o,
|
|
4646
|
+
constructor(r, o, d) {
|
|
4647
4647
|
k(this, "storageReader");
|
|
4648
4648
|
k(this, "broadcastChannel");
|
|
4649
4649
|
k(this, "element");
|
|
@@ -4759,11 +4759,11 @@ class oi {
|
|
|
4759
4759
|
window.dispatchEvent(o);
|
|
4760
4760
|
});
|
|
4761
4761
|
var K;
|
|
4762
|
-
this.element = r, this.listeners = o,
|
|
4763
|
-
let
|
|
4764
|
-
|
|
4762
|
+
this.element = r, this.listeners = o, d = typeof d < "u" ? d : "buzzcasting-slide";
|
|
4763
|
+
let A;
|
|
4764
|
+
A = { ...r.dataset }, delete A.hmr, A.slide = ((K = r.closest(d.toUpperCase())) == null ? void 0 : K.id) ?? `${d} not found`, A = Mr(A), this.query = A, Na(r);
|
|
4765
4765
|
const D = window.BuzzCasting.getOptions();
|
|
4766
|
-
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(
|
|
4766
|
+
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(A.slide), this.startListener();
|
|
4767
4767
|
}
|
|
4768
4768
|
addListener(r) {
|
|
4769
4769
|
this.listeners.push(r);
|
|
@@ -4774,11 +4774,11 @@ class oi {
|
|
|
4774
4774
|
startListener() {
|
|
4775
4775
|
const r = this.query;
|
|
4776
4776
|
this.broadcastChannel.onmessage = async (o) => {
|
|
4777
|
-
const
|
|
4777
|
+
const d = o.data.data;
|
|
4778
4778
|
switch (o.data.event) {
|
|
4779
4779
|
case re.WIDGET_UPDATE:
|
|
4780
|
-
|
|
4781
|
-
|
|
4780
|
+
d.query.slide === r.slide && d.query.widget === r.widget && this.listeners.forEach((A) => {
|
|
4781
|
+
A(o.data);
|
|
4782
4782
|
});
|
|
4783
4783
|
break;
|
|
4784
4784
|
case re.SLIDE_READY:
|