buzzcasting-storage 3.12.6 → 3.12.7

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.
@@ -45,8 +45,8 @@ function jr(h, t, o, l) {
45
45
  return b;
46
46
  try {
47
47
  return Oe(b, String(t.valueOf()));
48
- } catch (x) {
49
- return Oe(b, `[valueOf exception]${x.stack || x.message}`);
48
+ } catch (T) {
49
+ return Oe(b, `[valueOf exception]${T.stack || T.message}`);
50
50
  }
51
51
  }
52
52
  return Oe(g, t.toString());
@@ -117,10 +117,10 @@ function Ta(h) {
117
117
  }
118
118
  function Ot(h, t) {
119
119
  var o;
120
- let l, g, b, x, $;
120
+ let l, g, b, T, $;
121
121
  switch (h.moderation) {
122
122
  case en.BEFORE:
123
- l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), b = Number.parseInt(g ? g[0] : "00"), x = Number.parseInt(g ? g[1] : "00"), $ = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(b, x, $, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
123
+ l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), b = Number.parseInt(g ? g[0] : "00"), T = Number.parseInt(g ? g[1] : "00"), $ = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(b, T, $, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
124
124
  break;
125
125
  case en.DELAYED:
126
126
  h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
@@ -133,7 +133,7 @@ function Ot(h, t) {
133
133
  }
134
134
  return t;
135
135
  }
136
- const xa = "3.12.5";
136
+ const xa = "3.12.6";
137
137
  class ka {
138
138
  options;
139
139
  url;
@@ -174,16 +174,16 @@ class ka {
174
174
  const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
175
175
  delete g.type, delete g.hash, delete g.order, g.topics = `${g.dashboard}-${g.widget}`, delete g.presentation;
176
176
  const b = Object.keys(g).length > 0 ? `?${new URLSearchParams(g).toString()}` : "";
177
- let x = "";
177
+ let T = "";
178
178
  switch (t.type) {
179
179
  case _.MESSAGES:
180
- x = c.MESSAGES;
180
+ T = c.MESSAGES;
181
181
  break;
182
182
  case _.SERIES:
183
- x = c.SERIES;
183
+ T = c.SERIES;
184
184
  break;
185
185
  case _.CLOUD:
186
- x = c.CLOUD;
186
+ T = c.CLOUD;
187
187
  break;
188
188
  }
189
189
  return K(3, [
@@ -192,7 +192,7 @@ class ka {
192
192
  c.NONE,
193
193
  c.API,
194
194
  c.NONE,
195
- x,
195
+ T,
196
196
  t.widget
197
197
  ]), K(4, [t.type, g]), await fetch(
198
198
  [this.url, "api", o, t.type].join("/") + b,
@@ -224,8 +224,8 @@ class ka {
224
224
  }
225
225
  async hideLabels(t) {
226
226
  const { version: o } = this.options, l = this.formHeaders(), g = new URLSearchParams(), b = t.labels || [];
227
- for (const [x, $] of b.entries())
228
- g.append(`custom_filters[${x}]`, $);
227
+ for (const [T, $] of b.entries())
228
+ g.append(`custom_filters[${T}]`, $);
229
229
  return console.info(
230
230
  "%capi%c %cput",
231
231
  c.API,
@@ -237,11 +237,11 @@ class ka {
237
237
  ), await fetch(
238
238
  [this.url, "api", o, t.type, t.widget].join("/"),
239
239
  { ...l, body: g, method: "put" }
240
- ).then((x) => {
241
- if (!x.ok)
242
- throw new Error(x.statusText);
243
- return x;
244
- }).then((x) => x.json()).catch((x) => ({ succes: !1, message: x, data: [] }));
240
+ ).then((T) => {
241
+ if (!T.ok)
242
+ throw new Error(T.statusText);
243
+ return T;
244
+ }).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
245
245
  }
246
246
  async loadSlide(t) {
247
247
  const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
@@ -253,10 +253,10 @@ class ka {
253
253
  throw new Error(`${b.status}`);
254
254
  return b;
255
255
  }).then((b) => b.json()).then((b) => {
256
- let x;
257
- return t.type = "slides", b.query = t, b?.data && (Array.isArray(b.data) ? (x = structuredClone(b.data), x.forEach(($) => {
256
+ let T;
257
+ return t.type = "slides", b.query = t, b?.data && (Array.isArray(b.data) ? (T = structuredClone(b.data), T.forEach(($) => {
258
258
  typeof $.json == "string" && ($.json = JSON.parse($.json));
259
- })) : (x = structuredClone(b.data), x.json = JSON.parse(x.json)), b.data = x), b;
259
+ })) : (T = structuredClone(b.data), T.json = JSON.parse(T.json)), b.data = T), b;
260
260
  }).catch((b) => ({ success: !1, message: `${b}`, data: null }));
261
261
  }
262
262
  /**
@@ -510,9 +510,9 @@ function Ma() {
510
510
  for (var a, s = 0, i = n.length; s < i; s++) !a && s in n || ((a = a || Array.prototype.slice.call(n, 0, s))[s] = n[s]);
511
511
  return e.concat(a || Array.prototype.slice.call(n));
512
512
  }
513
- var b = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, x = Object.keys, $ = Array.isArray;
513
+ var b = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, T = Object.keys, $ = Array.isArray;
514
514
  function te(e, n) {
515
- return typeof n != "object" || x(n).forEach(function(r) {
515
+ return typeof n != "object" || T(n).forEach(function(r) {
516
516
  e[r] = n[r];
517
517
  }), e;
518
518
  }
@@ -522,7 +522,7 @@ function Ma() {
522
522
  return Ce.call(e, n);
523
523
  }
524
524
  function be(e, n) {
525
- typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ? x : Reflect.ownKeys)(n).forEach(function(r) {
525
+ typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ? T : Reflect.ownKeys)(n).forEach(function(r) {
526
526
  Ae(e, r, n[r]);
527
527
  });
528
528
  }
@@ -1146,7 +1146,7 @@ function Ma() {
1146
1146
  }, J.prototype.where = function(e) {
1147
1147
  if (typeof e == "string") return new this.db.WhereClause(this, e);
1148
1148
  if ($(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
1149
- var n = x(e);
1149
+ var n = T(e);
1150
1150
  if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
1151
1151
  var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
1152
1152
  if (d.compound && n.every(function(y) {
@@ -1379,7 +1379,7 @@ function Ma() {
1379
1379
  } };
1380
1380
  return r[u] = n[u] = w;
1381
1381
  }
1382
- x(y = u).forEach(function(f) {
1382
+ T(y = u).forEach(function(f) {
1383
1383
  var O = y[f];
1384
1384
  if ($(O)) i(f, y[f][0], y[f][1]);
1385
1385
  else {
@@ -1653,7 +1653,7 @@ function Ma() {
1653
1653
  var n = this, r = this._ctx;
1654
1654
  return this._write(function(a) {
1655
1655
  var s, i, u;
1656
- u = typeof e == "function" ? e : (s = x(e), i = s.length, function(v) {
1656
+ u = typeof e == "function" ? e : (s = T(e), i = s.length, function(v) {
1657
1657
  for (var A = !1, P = 0; P < i; ++P) {
1658
1658
  var D = s[P], I = e[D], N = ve(v, D);
1659
1659
  I instanceof pt ? (ue(v, D, I.execute(N)), A = !0) : N !== I && (ue(v, D, I), A = !0);
@@ -1665,7 +1665,7 @@ function Ma() {
1665
1665
  function O(v, D) {
1666
1666
  var P = D.failures, D = D.numFailures;
1667
1667
  E += v - D;
1668
- for (var I = 0, N = x(P); I < N.length; I++) {
1668
+ for (var I = 0, N = T(P); I < N.length; I++) {
1669
1669
  var C = N[I];
1670
1670
  m.push(P[C]);
1671
1671
  }
@@ -1675,15 +1675,15 @@ function Ma() {
1675
1675
  function A(D) {
1676
1676
  var I = Math.min(w, v.length - D);
1677
1677
  return d.getMany({ trans: a, keys: v.slice(D, D + I), cache: "immutable" }).then(function(N) {
1678
- for (var C = [], R = [], T = p ? [] : null, j = [], k = 0; k < I; ++k) {
1678
+ for (var C = [], R = [], x = p ? [] : null, j = [], k = 0; k < I; ++k) {
1679
1679
  var G = N[k], F = { value: $e(G), primKey: v[D + k] };
1680
- u.call(F, F.value, F) !== !1 && (F.value == null ? j.push(v[D + k]) : p || H(y(G), y(F.value)) === 0 ? (R.push(F.value), p && T.push(v[D + k])) : (j.push(v[D + k]), C.push(F.value)));
1680
+ u.call(F, F.value, F) !== !1 && (F.value == null ? j.push(v[D + k]) : p || H(y(G), y(F.value)) === 0 ? (R.push(F.value), p && x.push(v[D + k])) : (j.push(v[D + k]), C.push(F.value)));
1681
1681
  }
1682
1682
  return Promise.resolve(0 < C.length && d.mutate({ trans: a, type: "add", values: C }).then(function(U) {
1683
1683
  for (var z in U.failures) j.splice(parseInt(z), 1);
1684
1684
  O(C.length, U);
1685
1685
  })).then(function() {
1686
- return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: T, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
1686
+ return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: x, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
1687
1687
  return O(R.length, U);
1688
1688
  });
1689
1689
  }).then(function() {
@@ -1774,13 +1774,13 @@ function Ma() {
1774
1774
  var P = i(A);
1775
1775
  if (n(P, p, m)) return !0;
1776
1776
  for (var D = null, I = m; I < f; ++I) {
1777
- var N = function(C, R, T, j, k, G) {
1777
+ var N = function(C, R, x, j, k, G) {
1778
1778
  for (var F = Math.min(C.length, j.length), U = -1, z = 0; z < F; ++z) {
1779
1779
  var de = R[z];
1780
- if (de !== j[z]) return k(C[z], T[z]) < 0 ? C.substr(0, z) + T[z] + T.substr(z + 1) : k(C[z], j[z]) < 0 ? C.substr(0, z) + j[z] + T.substr(z + 1) : 0 <= U ? C.substr(0, U) + R[U] + T.substr(U + 1) : null;
1780
+ if (de !== j[z]) return k(C[z], x[z]) < 0 ? C.substr(0, z) + x[z] + x.substr(z + 1) : k(C[z], j[z]) < 0 ? C.substr(0, z) + j[z] + x.substr(z + 1) : 0 <= U ? C.substr(0, U) + R[U] + x.substr(U + 1) : null;
1781
1781
  k(C[z], de) < 0 && (U = z);
1782
1782
  }
1783
- return F < j.length && G === "next" ? C + T.substr(C.length) : F < C.length && G === "prev" ? C.substr(0, T.length) : U < 0 ? null : C.substr(0, U) + j[U] + T.substr(U + 1);
1783
+ return F < j.length && G === "next" ? C + x.substr(C.length) : F < C.length && G === "prev" ? C.substr(0, x.length) : U < 0 ? null : C.substr(0, U) + j[U] + x.substr(U + 1);
1784
1784
  }(A, P, d[I], p[I], u, y);
1785
1785
  N === null && D === null ? m = I + 1 : (D === null || 0 < u(D, N)) && (D = N);
1786
1786
  }
@@ -2088,7 +2088,7 @@ function Ma() {
2088
2088
  var v = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
2089
2089
  return new Promise(function(N, C) {
2090
2090
  N = Z(N);
2091
- var R = v.objectStore(E), T = R.keyPath == null, j = A === "put" || A === "add";
2091
+ var R = v.objectStore(E), x = R.keyPath == null, j = A === "put" || A === "add";
2092
2092
  if (!j && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
2093
2093
  var k, G = (P || D || { length: 1 }).length;
2094
2094
  if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
@@ -2101,7 +2101,7 @@ function Ma() {
2101
2101
  if (I.type === 4) return N({ numFailures: de, failures: z, results: [], lastResult: void 0 });
2102
2102
  I.type === 3 ? U.push(k = R.clear()) : U.push(k = R.delete(a(I)));
2103
2103
  } else {
2104
- var T = j ? T ? [D, P] : [D, null] : [P, null], W = T[0], se = T[1];
2104
+ var x = j ? x ? [D, P] : [D, null] : [P, null], W = x[0], se = x[1];
2105
2105
  if (j) for (var oe = 0; oe < G; ++oe) U.push(k = se && se[oe] !== void 0 ? R[A](W[oe], se[oe]) : R[A](W[oe])), k.onerror = F;
2106
2106
  else for (oe = 0; oe < G; ++oe) U.push(k = R[A](W[oe])), k.onerror = F;
2107
2107
  }
@@ -2120,10 +2120,10 @@ function Ma() {
2120
2120
  var v = S.trans, A = S.keys;
2121
2121
  return new Promise(function(P, D) {
2122
2122
  P = Z(P);
2123
- for (var I, N = v.objectStore(E), C = A.length, R = new Array(C), T = 0, j = 0, k = function(U) {
2124
- U = U.target, R[U._pos] = U.result, ++j === T && P(R);
2125
- }, G = me(D), F = 0; F < C; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess = k, I.onerror = G, ++T);
2126
- T === 0 && P(R);
2123
+ for (var I, N = v.objectStore(E), C = A.length, R = new Array(C), x = 0, j = 0, k = function(U) {
2124
+ U = U.target, R[U._pos] = U.result, ++j === x && P(R);
2125
+ }, G = me(D), F = 0; F < C; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess = k, I.onerror = G, ++x);
2126
+ x === 0 && P(R);
2127
2127
  });
2128
2128
  }, get: function(S) {
2129
2129
  var v = S.trans, A = S.key;
@@ -2137,7 +2137,7 @@ function Ma() {
2137
2137
  }, query: (m = y, function(S) {
2138
2138
  return new Promise(function(v, A) {
2139
2139
  v = Z(v);
2140
- var P, D, I, T = S.trans, N = S.values, C = S.limit, k = S.query, R = C === 1 / 0 ? void 0 : C, j = k.index, k = k.range, T = T.objectStore(E), j = j.isPrimaryKey ? T : T.index(j.name), k = a(k);
2140
+ var P, D, I, x = S.trans, N = S.values, C = S.limit, k = S.query, R = C === 1 / 0 ? void 0 : C, j = k.index, k = k.range, x = x.objectStore(E), j = j.isPrimaryKey ? x : x.index(j.name), k = a(k);
2141
2141
  if (C === 0) return v({ result: [] });
2142
2142
  m ? ((R = N ? j.getAll(k, R) : j.getAllKeys(k, R)).onsuccess = function(G) {
2143
2143
  return v({ result: G.target.result });
@@ -2150,7 +2150,7 @@ function Ma() {
2150
2150
  var v = S.trans, A = S.values, P = S.query, D = S.reverse, I = S.unique;
2151
2151
  return new Promise(function(N, C) {
2152
2152
  N = Z(N);
2153
- var j = P.index, R = P.range, T = v.objectStore(E), T = j.isPrimaryKey ? T : T.index(j.name), j = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", k = !A && "openKeyCursor" in T ? T.openKeyCursor(a(R), j) : T.openCursor(a(R), j);
2153
+ var j = P.index, R = P.range, x = v.objectStore(E), x = j.isPrimaryKey ? x : x.index(j.name), j = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", k = !A && "openKeyCursor" in x ? x.openKeyCursor(a(R), j) : x.openCursor(a(R), j);
2154
2154
  k.onerror = me(C), k.onsuccess = Z(function(G) {
2155
2155
  var F, U, z, de, W = k.result;
2156
2156
  W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), de = function() {
@@ -2190,8 +2190,8 @@ function Ma() {
2190
2190
  var v = S.query, A = S.trans, P = v.index, D = v.range;
2191
2191
  return new Promise(function(I, N) {
2192
2192
  var C = A.objectStore(E), R = P.isPrimaryKey ? C : C.index(P.name), C = a(D), R = C ? R.count(C) : R.count();
2193
- R.onsuccess = Z(function(T) {
2194
- return I(T.target.result);
2193
+ R.onsuccess = Z(function(x) {
2194
+ return I(x.target.result);
2195
2195
  }), R.onerror = me(N);
2196
2196
  });
2197
2197
  } };
@@ -2290,11 +2290,11 @@ function Ma() {
2290
2290
  var C = Qn(D);
2291
2291
  I.del.forEach(function(j) {
2292
2292
  C[j] = P[j];
2293
- }), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], x(C), C), m.schema = C;
2294
- var R, T = an(N);
2295
- return T && et(), I = M.follow(function() {
2293
+ }), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], T(C), C), m.schema = C;
2294
+ var R, x = an(N);
2295
+ return x && et(), I = M.follow(function() {
2296
2296
  var j;
2297
- (R = N(m)) && T && (j = Ie.bind(null, null), R.then(j, j));
2297
+ (R = N(m)) && x && (j = Ie.bind(null, null), R.then(j, j));
2298
2298
  }), R && typeof R.then == "function" ? M.resolve(R) : I.then(function() {
2299
2299
  return R;
2300
2300
  });
@@ -2315,7 +2315,7 @@ function Ma() {
2315
2315
  vr(v, E);
2316
2316
  })) : M.resolve();
2317
2317
  var f, O, m, E, S, v;
2318
- }).catch(u)) : (x(s).forEach(function(w) {
2318
+ }).catch(u)) : (T(s).forEach(function(w) {
2319
2319
  Dn(r, w, s[w].primKey, s[w].indexes);
2320
2320
  }), Lt(e, r), void M.follow(function() {
2321
2321
  return e.on.populate.fire(i);
@@ -2366,7 +2366,7 @@ function Ma() {
2366
2366
  }), s;
2367
2367
  }
2368
2368
  function vr(e, n) {
2369
- x(e).forEach(function(r) {
2369
+ T(e).forEach(function(r) {
2370
2370
  n.db.objectStoreNames.contains(r) || (pe && console.debug("Dexie: Creating missing table", r), Dn(n, r, e[r].primKey, e[r].indexes));
2371
2371
  });
2372
2372
  }
@@ -2401,7 +2401,7 @@ function Ma() {
2401
2401
  });
2402
2402
  }
2403
2403
  var ma = (Ht.prototype._parseStoresSpec = function(e, n) {
2404
- x(e).forEach(function(r) {
2404
+ T(e).forEach(function(r) {
2405
2405
  if (e[r] !== null) {
2406
2406
  var a = Er(e[r]), s = a.shift();
2407
2407
  if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
@@ -2417,7 +2417,7 @@ function Ma() {
2417
2417
  var r = n._versions, a = {}, s = {};
2418
2418
  return r.forEach(function(i) {
2419
2419
  te(a, i._cfg.storesSource), s = i._cfg.dbschema = {}, i._parseStoresSpec(a, s);
2420
- }), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], x(s), s), n._storeNames = x(s), this;
2420
+ }), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], T(s), s), n._storeNames = T(s), this;
2421
2421
  }, Ht.prototype.upgrade = function(e) {
2422
2422
  return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || Q, e), this;
2423
2423
  }, Ht);
@@ -2500,7 +2500,7 @@ function Ma() {
2500
2500
  return (n ? r ? Math.max(n.d, r.d) : n.d : r ? r.d : 0) + 1;
2501
2501
  }
2502
2502
  function Yt(e, n) {
2503
- return x(n).forEach(function(r) {
2503
+ return T(n).forEach(function(r) {
2504
2504
  e[r] ? wt(e[r], n[r]) : e[r] = function a(s) {
2505
2505
  var i, u, d = {};
2506
2506
  for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" || Jn.has(u.constructor) ? u : a(u));
@@ -2586,17 +2586,17 @@ function Ma() {
2586
2586
  var v, A, P, D, I, N = e.idbdb = S.result, C = At(N.objectStoreNames);
2587
2587
  if (0 < C.length) try {
2588
2588
  var R = N.transaction((D = C).length === 1 ? D[0] : D, "readonly");
2589
- if (n.autoSchema) A = N, P = R, (v = e).verno = A.version / 10, P = v._dbSchema = Ut(0, A, P), v._storeNames = At(A.objectStoreNames, 0), Wt(v, [v._allTables], x(P), P);
2590
- else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(T) {
2591
- return T.add.length || T.change.length;
2589
+ if (n.autoSchema) A = N, P = R, (v = e).verno = A.version / 10, P = v._dbSchema = Ut(0, A, P), v._storeNames = At(A.objectStoreNames, 0), Wt(v, [v._allTables], T(P), P);
2590
+ else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(x) {
2591
+ return x.add.length || x.change.length;
2592
2592
  })) && !i) 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."), N.close(), s = N.version + 1, i = !0, O(d());
2593
2593
  Lt(e, R);
2594
2594
  } catch {
2595
2595
  }
2596
- tt.push(e), N.onversionchange = Z(function(T) {
2597
- n.vcFired = !0, e.on("versionchange").fire(T);
2598
- }), N.onclose = Z(function(T) {
2599
- e.on("close").fire(T);
2596
+ tt.push(e), N.onversionchange = Z(function(x) {
2597
+ n.vcFired = !0, e.on("versionchange").fire(x);
2598
+ }), N.onclose = Z(function(x) {
2599
+ e.on("close").fire(x);
2600
2600
  }), f && (I = e._deps, R = E, N = I.indexedDB, I = I.IDBKeyRange, Nn(N) || R === jt || In(N, I).put({ name: R }).catch(Q)), O();
2601
2601
  }, m);
2602
2602
  }).catch(function(O) {
@@ -2715,10 +2715,10 @@ function Ma() {
2715
2715
  } });
2716
2716
  } };
2717
2717
  function Mn(e, n, r, a) {
2718
- return r = r || {}, a = a || "", x(e).forEach(function(s) {
2718
+ return r = r || {}, a = a || "", T(e).forEach(function(s) {
2719
2719
  var i, u, d;
2720
2720
  ie(n, s) ? (i = e[s], u = n[s], typeof i == "object" && typeof u == "object" && i && u ? (d = nn(i)) !== nn(u) ? r[a + s] = n[s] : d === "Object" ? Mn(i, u, r, a + s + ".") : i !== u && (r[a + s] = n[s]) : i !== u && (r[a + s] = n[s])) : r[a + s] = void 0;
2721
- }), x(n).forEach(function(s) {
2721
+ }), T(n).forEach(function(s) {
2722
2722
  ie(e, s) || (r[a + s] = n[s]);
2723
2723
  }), r;
2724
2724
  }
@@ -2765,15 +2765,15 @@ function Ma() {
2765
2765
  if (!v) throw new Error("Keys missing");
2766
2766
  return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: v }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O = r, E = v, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
2767
2767
  var P = v.map(function(D, I) {
2768
- var N, C, R, T = A[I], j = { onerror: null, onsuccess: null };
2769
- return f.type === "delete" ? d.fire.call(j, D, T, S) : f.type === "add" || T === void 0 ? (N = p.fire.call(j, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(T, f.values[I]), (C = y.fire.call(j, N, D, T, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
2768
+ var N, C, R, x = A[I], j = { onerror: null, onsuccess: null };
2769
+ return f.type === "delete" ? d.fire.call(j, D, x, S) : f.type === "add" || x === void 0 ? (N = p.fire.call(j, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(x, f.values[I]), (C = y.fire.call(j, N, D, x, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
2770
2770
  ie(R, k) ? R[k] = C[k] : ue(R, k, C[k]);
2771
2771
  }))), j;
2772
2772
  });
2773
2773
  return r.mutate(f).then(function(D) {
2774
2774
  for (var I = D.failures, N = D.results, C = D.numFailures, D = D.lastResult, R = 0; R < v.length; ++R) {
2775
- var T = (N || v)[R], j = P[R];
2776
- T == null ? j.onerror && j.onerror(I[R]) : j.onsuccess && j.onsuccess(f.type === "put" && A[R] ? f.values[R] : T);
2775
+ var x = (N || v)[R], j = P[R];
2776
+ x == null ? j.onerror && j.onerror(I[R]) : j.onsuccess && j.onsuccess(f.type === "put" && A[R] ? f.values[R] : x);
2777
2777
  }
2778
2778
  return { failures: I, results: N, numFailures: C, lastResult: D };
2779
2779
  }).catch(function(D) {
@@ -2837,8 +2837,8 @@ function Ma() {
2837
2837
  }
2838
2838
  var S, v, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, j = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(k) {
2839
2839
  return k;
2840
- }), m.values] : [], R = j[0], T = j[1], j = m.trans._cache;
2841
- return $(R) ? (I.addKeys(R), (j = C === "delete" || R.length === T.length ? Ar(R, j) : null) || N.addKeys(R), (j || T) && (S = E, v = j, A = T, i.indexes.forEach(function(k) {
2840
+ }), m.values] : [], R = j[0], x = j[1], j = m.trans._cache;
2841
+ return $(R) ? (I.addKeys(R), (j = C === "delete" || R.length === x.length ? Ar(R, j) : null) || N.addKeys(R), (j || x) && (S = E, v = j, A = x, i.indexes.forEach(function(k) {
2842
2842
  var G = S(k.name || "");
2843
2843
  function F(z) {
2844
2844
  return z != null ? k.extractKey(z) : null;
@@ -2852,7 +2852,7 @@ function Ma() {
2852
2852
  var W = v && F(v[se]), se = A && F(A[se]);
2853
2853
  H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
2854
2854
  });
2855
- }))) : R ? (T = { from: (T = R.lower) !== null && T !== void 0 ? T : e.MIN_KEY, to: (T = R.upper) !== null && T !== void 0 ? T : e.MAX_KEY }, N.add(T), I.add(T)) : (I.add(r), N.add(r), i.indexes.forEach(function(k) {
2855
+ }))) : R ? (x = { from: (x = R.lower) !== null && x !== void 0 ? x : e.MIN_KEY, to: (x = R.upper) !== null && x !== void 0 ? x : e.MAX_KEY }, N.add(x), I.add(x)) : (I.add(r), N.add(r), i.indexes.forEach(function(k) {
2856
2856
  return E(k.name).add(r);
2857
2857
  })), s.mutate(m).then(function(k) {
2858
2858
  return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(k.results), y && y.forEach(function(G) {
@@ -2872,25 +2872,25 @@ function Ma() {
2872
2872
  }, getMany: function(m) {
2873
2873
  return [u, new ae().addKeys(m.keys)];
2874
2874
  }, count: f, query: f, openCursor: f };
2875
- return x(O).forEach(function(m) {
2875
+ return T(O).forEach(function(m) {
2876
2876
  w[m] = function(E) {
2877
2877
  var S = B.subscr, v = !!S, A = Pr(B, s) && Dr(m, E) ? E.obsSet = {} : S;
2878
2878
  if (v) {
2879
- var P = function(T) {
2880
- return T = "idb://".concat(n, "/").concat(a, "/").concat(T), A[T] || (A[T] = new ae());
2879
+ var P = function(x) {
2880
+ return x = "idb://".concat(n, "/").concat(a, "/").concat(x), A[x] || (A[x] = new ae());
2881
2881
  }, D = P(""), I = P(":dels"), S = O[m](E), v = S[0], S = S[1];
2882
2882
  if ((m === "query" && v.isPrimaryKey && !E.values ? I : P(v.name || "")).add(S), !v.isPrimaryKey) {
2883
2883
  if (m !== "count") {
2884
2884
  var N = m === "query" && p && E.values && s.query(l(l({}, E), { values: !1 }));
2885
- return s[m].apply(this, arguments).then(function(T) {
2885
+ return s[m].apply(this, arguments).then(function(x) {
2886
2886
  if (m === "query") {
2887
2887
  if (p && E.values) return N.then(function(F) {
2888
- return F = F.result, D.addKeys(F), T;
2888
+ return F = F.result, D.addKeys(F), x;
2889
2889
  });
2890
- var j = E.values ? T.result.map(d) : T.result;
2890
+ var j = E.values ? x.result.map(d) : x.result;
2891
2891
  (E.values ? D : I).addKeys(j);
2892
2892
  } else if (m === "openCursor") {
2893
- var k = T, G = E.values;
2893
+ var k = x, G = E.values;
2894
2894
  return k && Object.create(k, { key: { get: function() {
2895
2895
  return I.addKey(k.primaryKey), k.key;
2896
2896
  } }, primaryKey: { get: function() {
@@ -2900,7 +2900,7 @@ function Ma() {
2900
2900
  return G && D.addKey(k.primaryKey), k.value;
2901
2901
  } } });
2902
2902
  }
2903
- return T;
2903
+ return x;
2904
2904
  });
2905
2905
  }
2906
2906
  I.add(r);
@@ -2958,9 +2958,9 @@ function Ma() {
2958
2958
  }));
2959
2959
  break;
2960
2960
  case "delete":
2961
- var T = new ae().addKeys(E.keys);
2961
+ var x = new ae().addKeys(E.keys);
2962
2962
  S = m.filter(function(G) {
2963
- return !T.hasKey(n.values ? y(G) : G);
2963
+ return !x.hasKey(n.values ? y(G) : G);
2964
2964
  });
2965
2965
  break;
2966
2966
  case "deleteRange":
@@ -3027,9 +3027,9 @@ function Ma() {
3027
3027
  m.optimisticOps = m.optimisticOps.filter(function(G) {
3028
3028
  return G.trans !== d;
3029
3029
  });
3030
- for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, T, j = 0, k = (C = N[I]).slice(); j < k.length; j++) (R = k[j]).res != null && d.mutatedParts && (p && !R.dirty ? (T = Object.isFrozen(R.res), T = Nr(R.res, R.req, S, E, R, T), R.dirty ? (je(C, R), R.subscribers.forEach(function(G) {
3030
+ for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, x, j = 0, k = (C = N[I]).slice(); j < k.length; j++) (R = k[j]).res != null && d.mutatedParts && (p && !R.dirty ? (x = Object.isFrozen(R.res), x = Nr(R.res, R.req, S, E, R, x), R.dirty ? (je(C, R), R.subscribers.forEach(function(G) {
3031
3031
  return y.add(G);
3032
- })) : T !== R.res && (R.res = T, R.promise = M.resolve({ result: T }))) : (R.dirty && je(C, R), R.subscribers.forEach(function(G) {
3032
+ })) : x !== R.res && (R.res = x, R.promise = M.resolve({ result: x }))) : (R.dirty && je(C, R), R.subscribers.forEach(function(G) {
3033
3033
  return y.add(G);
3034
3034
  })));
3035
3035
  }
@@ -3183,7 +3183,7 @@ function Ma() {
3183
3183
  return this._state.autoSchema;
3184
3184
  }, Object.defineProperty(ee.prototype, "tables", { get: function() {
3185
3185
  var e = this;
3186
- return x(this._allTables).map(function(n) {
3186
+ return T(this._allTables).map(function(n) {
3187
3187
  return e._allTables[n];
3188
3188
  });
3189
3189
  }, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
@@ -3693,9 +3693,9 @@ class Mr {
3693
3693
  };
3694
3694
  const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
3695
3695
  o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
3696
- const g = ($) => $.utc > (t?.since || 0), b = ($) => $.utc < (t?.before || l), x = ($) => $?.visible !== 0;
3696
+ const g = ($) => $.utc > (t?.since || 0), b = ($) => $.utc < (t?.before || l), T = ($) => $?.visible !== 0;
3697
3697
  try {
3698
- const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(x).filter(g).filter(b).reverse().limit(t?.limit ?? 25).sortBy(o);
3698
+ const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(T).filter(g).filter(b).reverse().limit(t?.limit ?? 25).sortBy(o);
3699
3699
  if (te.length === 0)
3700
3700
  return {
3701
3701
  data: null,
@@ -3770,7 +3770,7 @@ class Mr {
3770
3770
  utc: b.utc,
3771
3771
  data: b,
3772
3772
  expires: b.expires
3773
- }).catch((x) => {
3773
+ }).catch((T) => {
3774
3774
  g++, K(4, [
3775
3775
  "%cset%c %cstorage",
3776
3776
  c.KO,
@@ -3779,7 +3779,7 @@ class Mr {
3779
3779
  "set message",
3780
3780
  `title: ${l}`,
3781
3781
  b,
3782
- x.message
3782
+ T.message
3783
3783
  ]);
3784
3784
  }), await this.db.table(_.TOPICS).put({
3785
3785
  title: l,
@@ -3792,7 +3792,7 @@ class Mr {
3792
3792
  sentiment: b.topics[0]?.sentiment || 0,
3793
3793
  utc: b.utc,
3794
3794
  expires: b.expires
3795
- }).catch((x) => {
3795
+ }).catch((T) => {
3796
3796
  g++, K(4, [
3797
3797
  "%cset%c %cstorage",
3798
3798
  c.KO,
@@ -3801,10 +3801,10 @@ class Mr {
3801
3801
  "set topic",
3802
3802
  `title: ${l}`,
3803
3803
  b,
3804
- x.message
3804
+ T.message
3805
3805
  ]);
3806
- }), await o.data.topics.forEach(async (x) => {
3807
- const $ = x.message_id, te = x.visible ? 1 : 0, ge = x.title;
3806
+ }), await o.data.topics.forEach(async (T) => {
3807
+ const $ = T.message_id, te = T.visible ? 1 : 0, ge = T.title;
3808
3808
  await this.db.table(_.TOPICS).where("message_id").equals($).modify({ visible: te }).catch((Ce) => {
3809
3809
  g++, K(4, [
3810
3810
  "%cset%c %cstorage",
@@ -3813,7 +3813,7 @@ class Mr {
3813
3813
  c.STORAGE,
3814
3814
  "update message visibility",
3815
3815
  `title: ${ge}`,
3816
- `widget: ${x.widget_id}`,
3816
+ `widget: ${T.widget_id}`,
3817
3817
  Ce.message
3818
3818
  ]);
3819
3819
  });
@@ -3924,7 +3924,7 @@ class Mr {
3924
3924
  * @returns IResponse
3925
3925
  */
3926
3926
  getWidgets = async (t) => {
3927
- const o = (x) => t?.dashboard === x.dashboard_id, l = (x) => t?.type === x.type, g = (x) => t?.name ? x.name.includes(t?.name) : !1, b = await this.db.table(_.WIDGET).toArray().then((x) => t?.dashboard ? x.filter(o) : x).then((x) => t?.type ? x.filter(l) : x).then((x) => t?.name ? x.filter(g) : x).catch(() => {
3927
+ const o = (T) => t?.dashboard === T.dashboard_id, l = (T) => t?.type === T.type, g = (T) => t?.name ? T.name.includes(t?.name) : !1, b = await this.db.table(_.WIDGET).toArray().then((T) => t?.dashboard ? T.filter(o) : T).then((T) => t?.type ? T.filter(l) : T).then((T) => t?.name ? T.filter(g) : T).catch(() => {
3928
3928
  K(2, ["%cstorage", c.STORAGE, X.WIDGET_LOAD, t]);
3929
3929
  });
3930
3930
  return b !== void 0 && K(3, [
@@ -4014,12 +4014,12 @@ class Mr {
4014
4014
  * @returns IResponse
4015
4015
  */
4016
4016
  getSlides = async (t) => {
4017
- const o = ($) => t?.id ? $.id = t.id : !1, l = ($) => t?.name ? $.name.includes(t?.name) : !1, g = ($) => t?.presentation_id ? $.presentation_id = t.presentation_id : !1, x = await this.db.table(_.SLIDE).toArray().then(($) => t?.presentation_id ? $.filter(g) : $).then(($) => t?.id ? $.filter(o) : $).then(($) => t?.name ? $.filter(l) : $);
4018
- return x !== void 0 && K(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
4017
+ const o = ($) => t?.id ? $.id = t.id : !1, l = ($) => t?.name ? $.name.includes(t?.name) : !1, g = ($) => t?.presentation_id ? $.presentation_id === t.presentation_id : !1, T = await this.db.table(_.SLIDE).toArray().then(($) => t?.presentation_id ? $.filter(g) : $).then(($) => t?.id ? $.filter(o) : $).then(($) => t?.name ? $.filter(l) : $);
4018
+ return T && T.sort(($, te) => $.order_index - te.order_index), T !== void 0 && K(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
4019
4019
  // @ts-ignore
4020
- data: x !== void 0 ? { slides: x, query: t } : null,
4021
- message: x !== void 0 ? "Slides loaded from storage" : "Slides load error",
4022
- success: x !== void 0
4020
+ data: T !== void 0 ? { slides: T, query: t } : null,
4021
+ message: T !== void 0 ? "Slides loaded from storage" : "Slides load error",
4022
+ success: T !== void 0
4023
4023
  };
4024
4024
  };
4025
4025
  /**
@@ -4246,7 +4246,7 @@ function Ka(h, t) {
4246
4246
  }, () => {
4247
4247
  }), o;
4248
4248
  };
4249
- return (g, b) => l().then((x) => b(x.transaction(t, g).objectStore(t)));
4249
+ return (g, b) => l().then((T) => b(T.transaction(t, g).objectStore(t)));
4250
4250
  }
4251
4251
  let Un;
4252
4252
  function Gr() {
@@ -5618,10 +5618,10 @@ class Ja {
5618
5618
  let b = "";
5619
5619
  switch (t.query.type) {
5620
5620
  case _.MESSAGES:
5621
- let x;
5622
- x = t.data.messages.filter(
5621
+ let T;
5622
+ T = t.data.messages.filter(
5623
5623
  ($) => $.id !== null
5624
- ), t.data.messages = x, b = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", g?.hash && g.hash === b ? (K(3, [
5624
+ ), t.data.messages = T, b = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", g?.hash && g.hash === b ? (K(3, [
5625
5625
  "%cload%c %cmessages%c %cno updates",
5626
5626
  c.OK,
5627
5627
  c.NONE,
@@ -5678,7 +5678,7 @@ class Ja {
5678
5678
  }
5679
5679
  } else
5680
5680
  switch (K(4, [
5681
- `%cload%c %c${t.query}%c %bad request`,
5681
+ `%cload%c %c${t.query.type}%c %bad request`,
5682
5682
  c.KO,
5683
5683
  c.NONE,
5684
5684
  c.STORAGE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzcasting-storage",
3
3
  "type": "module",
4
- "version": "3.12.6",
4
+ "version": "3.12.7",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Mark Tamis, TouchFlows SAS",