buzzcasting-storage 2.8.0 → 2.9.1

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.
@@ -208,6 +208,15 @@ export declare interface IMetrics {
208
208
  change?: number;
209
209
  }
210
210
 
211
+ /**
212
+ * IModal
213
+ */
214
+ export declare interface IModal {
215
+ showComponent: string;
216
+ dataset?: any;
217
+ attributes?: any;
218
+ }
219
+
211
220
  /**
212
221
  * Query
213
222
  */
@@ -335,6 +344,9 @@ export declare enum STORAGE {
335
344
  WINDOW = "window"
336
345
  }
337
346
 
347
+ /**
348
+ * Main class for managing widgets and data updates
349
+ */
338
350
  export declare class Widget {
339
351
  private storageReader;
340
352
  private broadcastChannel;
@@ -342,9 +354,11 @@ export declare class Widget {
342
354
  private attributes;
343
355
  private listeners;
344
356
  /**
357
+ * Main container for managing widgets and data updates
345
358
  *
359
+ * @param element widget web component
346
360
  * @param callbacks functions in the widget that will receive the update
347
- * @param query
361
+ * @param selector container for the element - by default buzzcasting-slide (optional)
348
362
  */
349
363
  constructor(element: HTMLElement, callbacks: Array<(arg: IResponse) => void>, selector?: string);
350
364
  addListener(cb: (arg: IResponse) => void): void;
@@ -352,15 +366,42 @@ export declare class Widget {
352
366
  * Data received from BroadcastChannel
353
367
  */
354
368
  startListener(): void;
369
+ /**
370
+ * This is used to register the component on the container's broadcast channel
371
+ * This takes place when the container indicates it has finished loading (ready)
372
+ */
355
373
  subscribe(): void;
374
+ /**
375
+ * Generic call to any query type
376
+ *
377
+ * @returns IResponse
378
+ */
379
+ getData: () => Promise<IResponse>;
380
+ /**
381
+ * Get Widget Coud Data
382
+ *
383
+ * @returns IResponse
384
+ */
356
385
  getCloud: () => Promise<IResponse>;
386
+ /**
387
+ * Get Widget Messages Data
388
+ *
389
+ * @returns IResponse
390
+ */
357
391
  getMessages: () => Promise<IResponse>;
392
+ /**
393
+ * Get Widget Series Data
394
+ *
395
+ * @returns IResponse
396
+ */
358
397
  getSeries: () => Promise<IResponse>;
359
- showModal: (modal: {
360
- showComponent: string;
361
- dataset?: any;
362
- attributes?: any;
363
- }) => void;
398
+ /**
399
+ * Emit a show modal event using the element's attributes
400
+ * the component is the web component name to show
401
+ *
402
+ * @param modal IModal
403
+ */
404
+ showModal: (modal: IModal) => void;
364
405
  destroy(): void;
365
406
  }
366
407
 
@@ -1,7 +1,7 @@
1
1
  var Ei = Object.defineProperty;
2
2
  var Oi = (w, o, d) => o in w ? Ei(w, o, { enumerable: !0, configurable: !0, writable: !0, value: d }) : w[o] = d;
3
3
  var I = (w, o, d) => (Oi(w, typeof o != "symbol" ? o + "" : o, d), d);
4
- const xi = "2.7.2";
4
+ const xi = "2.9.0";
5
5
  class ki {
6
6
  constructor(o) {
7
7
  I(this, "options");
@@ -348,12 +348,12 @@ var Rr = { exports: {} };
348
348
  return [t, te(t), e];
349
349
  }(), st = ge[0], de = ge[1], ge = ge[2], de = de && de.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
350
350
  lt.push([e, t]), Et && (queueMicrotask(qr), Et = !1);
351
- }, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H }, M = De, lt = [], Ne = 0, xt = [];
351
+ }, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H }, B = De, lt = [], Ne = 0, xt = [];
352
352
  function T(e) {
353
353
  if (typeof this != "object")
354
354
  throw new TypeError("Promises must be constructed via new");
355
355
  this._listeners = [], this._lib = !1;
356
- var t = this._PSD = M;
356
+ var t = this._PSD = B;
357
357
  if (typeof e != "function") {
358
358
  if (e !== at)
359
359
  throw new TypeError("Not a function");
@@ -377,9 +377,9 @@ var Rr = { exports: {} };
377
377
  }(this, e);
378
378
  }
379
379
  var an = { get: function() {
380
- var e = M, t = Pt;
380
+ var e = B, t = Pt;
381
381
  function n(r, i) {
382
- var a = this, s = !e.global && (e !== M || t !== Pt), u = s && !Ie(), h = new T(function(l, b) {
382
+ var a = this, s = !e.global && (e !== B || t !== Pt), u = s && !Ie(), h = new T(function(l, b) {
383
383
  un(a, new tr(ir(r, e, s, u), ir(i, e, s, u), l, b, e));
384
384
  });
385
385
  return this._consoleTask && (h._consoleTask = this._consoleTask), h;
@@ -466,9 +466,9 @@ var Rr = { exports: {} };
466
466
  return new T(at, !1, e);
467
467
  }
468
468
  function J(e, t) {
469
- var n = M;
469
+ var n = B;
470
470
  return function() {
471
- var r = Qe(), i = M;
471
+ var r = Qe(), i = B;
472
472
  try {
473
473
  return Ce(n, !0), e.apply(this, arguments);
474
474
  } catch (a) {
@@ -479,7 +479,7 @@ var Rr = { exports: {} };
479
479
  };
480
480
  }
481
481
  xe(T.prototype, { then: an, _then: function(e, t) {
482
- un(this, new tr(null, null, e, t, M));
482
+ un(this, new tr(null, null, e, t, B));
483
483
  }, catch: function(e) {
484
484
  if (arguments.length === 1)
485
485
  return this.then(null, e);
@@ -530,9 +530,9 @@ var Rr = { exports: {} };
530
530
  });
531
531
  });
532
532
  }, PSD: { get: function() {
533
- return M;
533
+ return B;
534
534
  }, set: function(e) {
535
- return M = e;
535
+ return B = e;
536
536
  } }, totalEchoes: { get: function() {
537
537
  return Pt;
538
538
  } }, newPSD: Pe, usePSD: Ge, scheduler: { get: function() {
@@ -546,7 +546,7 @@ var Rr = { exports: {} };
546
546
  } }, follow: function(e, t) {
547
547
  return new T(function(n, r) {
548
548
  return Pe(function(i, a) {
549
- var s = M;
549
+ var s = B;
550
550
  s.unhandleds = [], s.onunhandled = a, s.finalize = Me(function() {
551
551
  var u, h = this;
552
552
  u = function() {
@@ -590,7 +590,7 @@ var Rr = { exports: {} };
590
590
  }));
591
591
  var ne = { awaits: 0, echoes: 0, id: 0 }, ei = 0, At = [], Dt = 0, Pt = 0, ti = 0;
592
592
  function Pe(e, t, n, r) {
593
- var i = M, a = Object.create(i);
593
+ var i = B, a = Object.create(i);
594
594
  return a.parent = i, a.ref = 0, a.global = !1, a.id = ++ti, De.env, a.env = nn ? { Promise: T, PromiseProp: { value: T, configurable: !0, writable: !0 }, all: T.all, race: T.race, allSettled: T.allSettled, any: T.any, resolve: T.resolve, reject: T.reject } : {}, t && Z(a, t), ++i.ref, a.finalize = function() {
595
595
  --this.parent.ref || this.parent.finalize();
596
596
  }, r = Ge(a, e, n, r), a.ref === 0 && a.finalize(), r;
@@ -613,17 +613,17 @@ var Rr = { exports: {} };
613
613
  At.pop(), Ce(e, !1);
614
614
  }
615
615
  function Ce(e, t) {
616
- var n, r = M;
617
- (t ? !ne.echoes || Dt++ && e === M : !Dt || --Dt && e === M) || queueMicrotask(t ? (function(i) {
618
- ++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(M), Ce(i, !0);
619
- }).bind(null, e) : ni), e !== M && (M = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(K, "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))));
616
+ var n, r = B;
617
+ (t ? !ne.echoes || Dt++ && e === B : !Dt || --Dt && e === B) || queueMicrotask(t ? (function(i) {
618
+ ++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(B), Ce(i, !0);
619
+ }).bind(null, e) : ni), e !== B && (B = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(K, "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))));
620
620
  }
621
621
  function rr() {
622
622
  var e = K.Promise;
623
623
  return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
624
624
  }
625
625
  function Ge(e, t, n, r, i) {
626
- var a = M;
626
+ var a = B;
627
627
  try {
628
628
  return Ce(e, !0), t(n, r, i);
629
629
  } finally {
@@ -632,7 +632,7 @@ var Rr = { exports: {} };
632
632
  }
633
633
  function ir(e, t, n, r) {
634
634
  return typeof e != "function" ? e : function() {
635
- var i = M;
635
+ var i = B;
636
636
  n && Je(), Ce(t, !0);
637
637
  try {
638
638
  return e.apply(this, arguments);
@@ -701,7 +701,7 @@ var Rr = { exports: {} };
701
701
  return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
702
702
  }
703
703
  var lr = (Q.prototype._trans = function(e, t, n) {
704
- var r = this._tx || M.trans, i = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
704
+ var r = this._tx || B.trans, i = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
705
705
  function s(l, b, c) {
706
706
  if (!c.schema[i])
707
707
  throw new F.NotFound("Table " + i + " not part of transaction");
@@ -709,10 +709,10 @@ var Rr = { exports: {} };
709
709
  }
710
710
  var u = Qe();
711
711
  try {
712
- var h = r && r.db._novip === this.db._novip ? r === M.trans ? r._promise(e, s, n) : Pe(function() {
712
+ var h = r && r.db._novip === this.db._novip ? r === B.trans ? r._promise(e, s, n) : Pe(function() {
713
713
  return r._promise(e, s, n);
714
- }, { trans: r, transless: M.transless || M }) : function l(b, c, f, p) {
715
- if (b.idbdb && (b._state.openComplete || M.letThrough || b._vip)) {
714
+ }, { trans: r, transless: B.transless || B }) : function l(b, c, f, p) {
715
+ if (b.idbdb && (b._state.openComplete || B.letThrough || b._vip)) {
716
716
  var y = b._createTransaction(c, f, b._dbSchema);
717
717
  try {
718
718
  y.create(), b._state.PR1398_maxLoop = 3;
@@ -723,7 +723,7 @@ var Rr = { exports: {} };
723
723
  }
724
724
  return y._promise(c, function(v, g) {
725
725
  return Pe(function() {
726
- return M.trans = y, p(v, g, y);
726
+ return B.trans = y, p(v, g, y);
727
727
  });
728
728
  }).then(function(v) {
729
729
  if (c === "readwrite")
@@ -1578,10 +1578,10 @@ var Rr = { exports: {} };
1578
1578
  e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
1579
1579
  }
1580
1580
  var pt = "storagemutated", yn = "x-storagemutated-1", Te = ft(null, pt), ai = (me.prototype._lock = function() {
1581
- return rt(!M.global), ++this._reculock, this._reculock !== 1 || M.global || (M.lockOwnerFor = this), this;
1581
+ return rt(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
1582
1582
  }, me.prototype._unlock = function() {
1583
- if (rt(!M.global), --this._reculock == 0)
1584
- for (M.global || (M.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
1583
+ if (rt(!B.global), --this._reculock == 0)
1584
+ for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
1585
1585
  var e = this._blockedFuncs.shift();
1586
1586
  try {
1587
1587
  Ge(e[1], e[0]);
@@ -1590,7 +1590,7 @@ var Rr = { exports: {} };
1590
1590
  }
1591
1591
  return this;
1592
1592
  }, me.prototype._locked = function() {
1593
- return this._reculock && M.lockOwnerFor !== this;
1593
+ return this._reculock && B.lockOwnerFor !== this;
1594
1594
  }, me.prototype.create = function(e) {
1595
1595
  var t = this;
1596
1596
  if (!this.mode)
@@ -1624,7 +1624,7 @@ var Rr = { exports: {} };
1624
1624
  return new T(function(a, s) {
1625
1625
  r._blockedFuncs.push([function() {
1626
1626
  r._promise(e, t, n).then(a, s);
1627
- }, M]);
1627
+ }, B]);
1628
1628
  });
1629
1629
  if (n)
1630
1630
  return Pe(function() {
@@ -1919,9 +1919,9 @@ var Rr = { exports: {} };
1919
1919
  n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
1920
1920
  var a = e._createTransaction("readwrite", e._storeNames, i);
1921
1921
  a.create(n), a._completion.catch(r);
1922
- var s = a._reject.bind(a), u = M.transless || M;
1922
+ var s = a._reject.bind(a), u = B.transless || B;
1923
1923
  Pe(function() {
1924
- return M.trans = a, M.transless = u, t !== 0 ? (Mt(e, n), l = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
1924
+ return B.trans = a, B.transless = u, t !== 0 ? (Mt(e, n), l = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
1925
1925
  return b ?? l;
1926
1926
  }) : T.resolve(l)).then(function(b) {
1927
1927
  return f = b, p = a, y = n, v = [], b = (c = e)._versions, g = c._dbSchema = Gt(0, c.idbdb, y), (b = b.filter(function(_) {
@@ -2102,7 +2102,7 @@ var Rr = { exports: {} };
2102
2102
  }
2103
2103
  function xn(e) {
2104
2104
  return Pe(function() {
2105
- return M.letThrough = !0, e();
2105
+ return B.letThrough = !0, e();
2106
2106
  });
2107
2107
  }
2108
2108
  function kn(e) {
@@ -2423,7 +2423,7 @@ var Rr = { exports: {} };
2423
2423
  return m(m({}, e), { table: function(t) {
2424
2424
  var n = e.table(t), r = n.schema.primaryKey;
2425
2425
  return m(m({}, n), { mutate: function(i) {
2426
- var a = M.trans, s = a.table(t).hook, u = s.deleting, h = s.creating, l = s.updating;
2426
+ var a = B.trans, s = a.table(t).hook, u = s.deleting, h = s.creating, l = s.updating;
2427
2427
  switch (i.type) {
2428
2428
  case "add":
2429
2429
  if (h.fire === H)
@@ -2459,7 +2459,7 @@ var Rr = { exports: {} };
2459
2459
  }
2460
2460
  return n.mutate(i);
2461
2461
  function b(c) {
2462
- var f, p, y, v = M.trans, g = c.keys || jn(r, c);
2462
+ var f, p, y, v = B.trans, g = c.keys || jn(r, c);
2463
2463
  if (!g)
2464
2464
  throw new Error("Keys missing");
2465
2465
  return (c = c.type === "add" || c.type === "put" ? m(m({}, c), { keys: g }) : m({}, c)).type !== "delete" && (c.values = A([], c.values, !0)), c.keys && (c.keys = A([], c.keys, !0)), f = n, y = g, ((p = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: p.trans, keys: y, cache: "immutable" })).then(function(_) {
@@ -2528,8 +2528,8 @@ var Rr = { exports: {} };
2528
2528
  var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
2529
2529
  var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
2530
2530
  return m(m({}, e), { transaction: function(r, i, a) {
2531
- if (M.subscr && i !== "readonly")
2532
- throw new F.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(M.querier));
2531
+ if (B.subscr && i !== "readonly")
2532
+ throw new F.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
2533
2533
  return e.transaction(r, i, a);
2534
2534
  }, table: function(r) {
2535
2535
  function i(p) {
@@ -2569,7 +2569,7 @@ var Rr = { exports: {} };
2569
2569
  }, count: i, query: i, openCursor: i };
2570
2570
  return j(c).forEach(function(f) {
2571
2571
  b[f] = function(p) {
2572
- var y = M.subscr, v = !!y, g = Er(M, a) && Or(f, p) ? p.obsSet = {} : y;
2572
+ var y = B.subscr, v = !!y, g = Er(B, a) && Or(f, p) ? p.obsSet = {} : y;
2573
2573
  if (v) {
2574
2574
  var _ = function(D) {
2575
2575
  return D = "idb://".concat(t, "/").concat(r, "/").concat(D), g[D] || (g[D] = new oe());
@@ -2751,7 +2751,7 @@ var Rr = { exports: {} };
2751
2751
  }, table: function(n) {
2752
2752
  var r = e.table(n), i = r.schema.primaryKey;
2753
2753
  return m(m({}, r), { mutate: function(a) {
2754
- var s = M.trans;
2754
+ var s = B.trans;
2755
2755
  if (i.outbound || s.db._options.cache === "disabled" || s.explicit)
2756
2756
  return r.mutate(a);
2757
2757
  var u = Ue["idb://".concat(t, "/").concat(n)];
@@ -2771,9 +2771,9 @@ var Rr = { exports: {} };
2771
2771
  });
2772
2772
  }), s) : r.mutate(a);
2773
2773
  }, query: function(a) {
2774
- if (!Er(M, r) || !Or("query", a))
2774
+ if (!Er(B, r) || !Or("query", a))
2775
2775
  return r.query(a);
2776
- var s = ((l = M.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = M, u = c.requery, h = c.signal, l = function(y, v, g, _) {
2776
+ var s = ((l = B.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = B, u = c.requery, h = c.signal, l = function(y, v, g, _) {
2777
2777
  var S = Ue["idb://".concat(y, "/").concat(v)];
2778
2778
  if (!S)
2779
2779
  return [];
@@ -2830,7 +2830,7 @@ var Rr = { exports: {} };
2830
2830
  return n || (n = new this.Version(e), t.push(n), t.sort(li), n.stores({}), this._state.autoSchema = !1, n);
2831
2831
  }, ee.prototype._whenReady = function(e) {
2832
2832
  var t = this;
2833
- return this.idbdb && (this._state.openComplete || M.letThrough || this._vip) ? e() : new T(function(n, r) {
2833
+ return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new T(function(n, r) {
2834
2834
  if (t._state.openComplete)
2835
2835
  return r(new F.DatabaseClosed(t._state.dbOpenError));
2836
2836
  if (!t._state.isBeingOpened) {
@@ -2916,7 +2916,7 @@ var Rr = { exports: {} };
2916
2916
  }).apply(this, arguments);
2917
2917
  return this._transaction.apply(this, e);
2918
2918
  }, ee.prototype._transaction = function(e, t, n) {
2919
- var r = this, i = M.trans;
2919
+ var r = this, i = B.trans;
2920
2920
  i && i.db === this && e.indexOf("!") === -1 || (i = null);
2921
2921
  var a, s, u = e.indexOf("?") !== -1;
2922
2922
  e = e.replace("!", "").replace("?", "");
@@ -2953,7 +2953,7 @@ var Rr = { exports: {} };
2953
2953
  }
2954
2954
  var h = (function l(b, c, f, p, y) {
2955
2955
  return T.resolve().then(function() {
2956
- var v = M.transless || M, g = b._createTransaction(c, f, b._dbSchema, p);
2956
+ var v = B.transless || B, g = b._createTransaction(c, f, b._dbSchema, p);
2957
2957
  if (g.explicit = !0, v = { trans: g, transless: v }, p)
2958
2958
  g.idbtrans = p.idbtrans;
2959
2959
  else
@@ -2981,7 +2981,7 @@ var Rr = { exports: {} };
2981
2981
  });
2982
2982
  });
2983
2983
  }).bind(null, this, a, s, i, n);
2984
- return i ? i._promise(a, h, "lock") : M.trans ? Ge(M.transless, function() {
2984
+ return i ? i._promise(a, h, "lock") : B.trans ? Ge(B.transless, function() {
2985
2985
  return r._whenReady(h);
2986
2986
  }) : this._whenReady(h);
2987
2987
  }, ee.prototype.table = function(e) {
@@ -3167,7 +3167,7 @@ var Rr = { exports: {} };
3167
3167
  Z(this, e);
3168
3168
  };
3169
3169
  }, ignoreTransaction: function(e) {
3170
- return M.trans ? Ge(M.transless, e) : e();
3170
+ return B.trans ? Ge(B.transless, e) : e();
3171
3171
  }, vip: xn, async: function(e) {
3172
3172
  return function() {
3173
3173
  try {
@@ -3185,9 +3185,9 @@ var Rr = { exports: {} };
3185
3185
  return q(i);
3186
3186
  }
3187
3187
  }, currentTransaction: { get: function() {
3188
- return M.trans || null;
3188
+ return B.trans || null;
3189
3189
  } }, waitFor: function(e, t) {
3190
- return t = T.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), M.trans ? M.trans.waitFor(t) : t;
3190
+ return t = T.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), B.trans ? B.trans.waitFor(t) : t;
3191
3191
  }, Promise: T, debug: { get: function() {
3192
3192
  return pe;
3193
3193
  }, set: function(e) {
@@ -3273,7 +3273,7 @@ class Tr {
3273
3273
  * @returns IResponse
3274
3274
  */
3275
3275
  I(this, "getCloud", async (o) => {
3276
- const d = await this.db.table(B.CLOUD).where({ id: o.widget }).last().catch(() => (console.warn(
3276
+ const d = await this.db.table(M.CLOUD).where({ id: o.widget }).last().catch(() => (console.warn(
3277
3277
  "%capi%C %ccloud",
3278
3278
  x.API,
3279
3279
  x.NONE,
@@ -3289,7 +3289,7 @@ class Tr {
3289
3289
  * @returns IResponse
3290
3290
  */
3291
3291
  I(this, "getSeries", async (o) => {
3292
- const d = await this.db.table(B.SERIES).where({ id: o.widget }).last().catch(() => (console.warn(
3292
+ const d = await this.db.table(M.SERIES).where({ id: o.widget }).last().catch(() => (console.warn(
3293
3293
  "%capi%c %cseries",
3294
3294
  x.API,
3295
3295
  x.NONE,
@@ -3307,7 +3307,7 @@ class Tr {
3307
3307
  I(this, "getMessages", async (o) => {
3308
3308
  const d = (K) => K.widget_id === o.widget, m = (K) => K.utc > ((o == null ? void 0 : o.since) || 0), A = (K) => (K == null ? void 0 : K.visible) !== 0;
3309
3309
  try {
3310
- const K = await this.db.table(B.TOPICS).orderBy("utc").reverse().filter(d).filter(m).filter(A).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => (console.warn(
3310
+ const K = await this.db.table(M.TOPICS).orderBy("utc").reverse().filter(d).filter(m).filter(A).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => (console.warn(
3311
3311
  "%capi%c %cmessages",
3312
3312
  x.API,
3313
3313
  x.NONE,
@@ -3316,7 +3316,7 @@ class Tr {
3316
3316
  o.widget
3317
3317
  ), { data: null, message: "Messages Data error", success: !1 })), j = K[0] ? K[0].title : "No title", N = K.map(
3318
3318
  (be) => be.message_id
3319
- ), te = (await this.db.table(B.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
3319
+ ), te = (await this.db.table(M.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
3320
3320
  (be) => be.data
3321
3321
  );
3322
3322
  return {
@@ -3341,7 +3341,7 @@ class Tr {
3341
3341
  * @param data
3342
3342
  * @returns number
3343
3343
  */
3344
- I(this, "setCloud", async (o, d) => o.type === B.CLOUD && d !== "" ? await this.db.table(B.CLOUD).put({
3344
+ I(this, "setCloud", async (o, d) => o.type === M.CLOUD && d !== "" ? await this.db.table(M.CLOUD).put({
3345
3345
  id: o.widget,
3346
3346
  dashboard_id: o.dashboard,
3347
3347
  data: d.data
@@ -3352,7 +3352,7 @@ class Tr {
3352
3352
  * @param data
3353
3353
  * @returns number
3354
3354
  */
3355
- I(this, "setSeries", async (o, d) => o.type === B.SERIES && d !== "" ? await this.db.table(B.SERIES).put({
3355
+ I(this, "setSeries", async (o, d) => o.type === M.SERIES && d !== "" ? await this.db.table(M.SERIES).put({
3356
3356
  id: o.widget,
3357
3357
  dashboard_id: o.dashboard,
3358
3358
  data: d.data
@@ -3367,13 +3367,13 @@ class Tr {
3367
3367
  * @returns number
3368
3368
  */
3369
3369
  I(this, "setMessages", async (o, d) => {
3370
- if (o.type !== B.MESSAGES)
3370
+ if (o.type !== M.MESSAGES)
3371
3371
  return 400;
3372
3372
  const m = d.title;
3373
3373
  try {
3374
3374
  return d.data.messages.forEach(async (A) => {
3375
3375
  var K, j, N;
3376
- await this.db.table(B.MESSAGES).put({ id: A.id, utc: A.utc, data: A }), await this.db.table(B.TOPICS).put({
3376
+ await this.db.table(M.MESSAGES).put({ id: A.id, utc: A.utc, data: A }), await this.db.table(M.TOPICS).put({
3377
3377
  widget_id: o.widget,
3378
3378
  message_id: A.id,
3379
3379
  dashboard_id: o.dashboard,
@@ -3404,11 +3404,11 @@ class Tr {
3404
3404
  * @param query IQuery
3405
3405
  * @returns number
3406
3406
  */
3407
- I(this, "setWidget", async (o) => await this.db.table(B.WIDGETS).put({
3407
+ I(this, "setWidget", async (o) => await this.db.table(M.WIDGETS).put({
3408
3408
  id: o.widget,
3409
3409
  dashboard_id: o.dashboard,
3410
3410
  type: o.type
3411
- }).then(() => 201).catch((d) => (console.error("%cstorage", x.STORAGE, B.WIDGET, o, d), 400)));
3411
+ }).then(() => 201).catch((d) => (console.error("%cstorage", x.STORAGE, M.WIDGET, o, d), 400)));
3412
3412
  /**
3413
3413
  * Add component subscriber
3414
3414
  * @param query IQuery
@@ -3416,7 +3416,7 @@ class Tr {
3416
3416
  */
3417
3417
  I(this, "subscribe", (o) => (o = nt(o), this.subscribers.filter(
3418
3418
  (m) => m.widget === o.widget
3419
- ).length > 0 || (o.type === B.MESSAGES && (o = vt(this.options, o)), console.debug(
3419
+ ).length > 0 || (o.type === M.MESSAGES && (o = vt(this.options, o)), console.debug(
3420
3420
  "%cstorage%c %csubscribe",
3421
3421
  x.STORAGE,
3422
3422
  x.NONE,
@@ -3470,15 +3470,15 @@ class Kr {
3470
3470
  I(this, "options");
3471
3471
  I(this, "getCloud", async (o) => {
3472
3472
  const d = X(o);
3473
- return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 }));
3473
+ return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, M.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 }));
3474
3474
  });
3475
3475
  I(this, "getSeries", async (o) => {
3476
3476
  const d = X(o);
3477
- return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 }));
3477
+ return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, M.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 }));
3478
3478
  });
3479
3479
  I(this, "getMessages", async (o) => {
3480
3480
  const d = X(o);
3481
- return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 }));
3481
+ return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, M.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 }));
3482
3482
  });
3483
3483
  /**
3484
3484
  * Update Cloud
@@ -3490,7 +3490,7 @@ class Kr {
3490
3490
  if (!d.success)
3491
3491
  return 400;
3492
3492
  const m = X(o);
3493
- return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400));
3493
+ return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, M.CLOUD, o, A), 400));
3494
3494
  });
3495
3495
  /**
3496
3496
  * Update Series
@@ -3502,7 +3502,7 @@ class Kr {
3502
3502
  if (!d.success)
3503
3503
  return 400;
3504
3504
  const m = X(o);
3505
- return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400));
3505
+ return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, M.SERIES, o, A), 400));
3506
3506
  });
3507
3507
  /**
3508
3508
  * Update Messages
@@ -3514,7 +3514,7 @@ class Kr {
3514
3514
  if (!d.success)
3515
3515
  return 400;
3516
3516
  const m = X(o);
3517
- return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400));
3517
+ return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, M.MESSAGES, o, A), 400));
3518
3518
  });
3519
3519
  I(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((d) => d())));
3520
3520
  /**
@@ -3528,14 +3528,14 @@ class Kr {
3528
3528
  dashboard_id: o.dashboard,
3529
3529
  type: o.type
3530
3530
  };
3531
- return await Qt(d, m).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.WIDGET, o, A), 400));
3531
+ return await Qt(d, m).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, M.WIDGET, o, A), 400));
3532
3532
  });
3533
3533
  /**
3534
3534
  * Add component subscriber
3535
3535
  * @param query IQuery
3536
3536
  * @returns null
3537
3537
  */
3538
- I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3538
+ I(this, "subscribe", (o) => (o = nt(o), o.type === M.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3539
3539
  (m) => m.widget === o.widget
3540
3540
  ).length > 0 || (console.debug(
3541
3541
  "%cstorage%c %csubscribe",
@@ -3562,7 +3562,7 @@ class Mr {
3562
3562
  try {
3563
3563
  return localStorage.getObject(d);
3564
3564
  } catch {
3565
- return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3565
+ return console.warn("%capi", x.API, M.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3566
3566
  }
3567
3567
  });
3568
3568
  I(this, "getSeries", async (o) => {
@@ -3570,7 +3570,7 @@ class Mr {
3570
3570
  try {
3571
3571
  return localStorage.getObject(d);
3572
3572
  } catch {
3573
- return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3573
+ return console.warn("%capi", x.API, M.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3574
3574
  }
3575
3575
  });
3576
3576
  I(this, "getMessages", async (o) => {
@@ -3578,7 +3578,7 @@ class Mr {
3578
3578
  try {
3579
3579
  return localStorage.getObject(d);
3580
3580
  } catch {
3581
- return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3581
+ return console.warn("%capi", x.API, M.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3582
3582
  }
3583
3583
  });
3584
3584
  /**
@@ -3592,7 +3592,7 @@ class Mr {
3592
3592
  try {
3593
3593
  return localStorage.setObject(m, d), 201;
3594
3594
  } catch (A) {
3595
- return console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400;
3595
+ return console.error("%cstorage", x.STORAGE, M.CLOUD, o, A), 400;
3596
3596
  }
3597
3597
  });
3598
3598
  /**
@@ -3606,7 +3606,7 @@ class Mr {
3606
3606
  try {
3607
3607
  return localStorage.setObject(m, d), 201;
3608
3608
  } catch (A) {
3609
- return console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400;
3609
+ return console.error("%cstorage", x.STORAGE, M.SERIES, o, A), 400;
3610
3610
  }
3611
3611
  });
3612
3612
  /**
@@ -3620,7 +3620,7 @@ class Mr {
3620
3620
  try {
3621
3621
  return localStorage.setObject(m, d), 200;
3622
3622
  } catch (A) {
3623
- return console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400;
3623
+ return console.error("%cstorage", x.STORAGE, M.MESSAGES, o, A), 400;
3624
3624
  }
3625
3625
  });
3626
3626
  I(this, "cleanMessages", async (o) => {
@@ -3631,7 +3631,7 @@ class Mr {
3631
3631
  try {
3632
3632
  return localStorage.setObject(d, o), 201;
3633
3633
  } catch (m) {
3634
- return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
3634
+ return console.error("%cstorage", x.STORAGE, M.WIDGET, o, m), 400;
3635
3635
  }
3636
3636
  });
3637
3637
  /**
@@ -3639,7 +3639,7 @@ class Mr {
3639
3639
  * @param query IQuery
3640
3640
  * @returns null
3641
3641
  */
3642
- I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3642
+ I(this, "subscribe", (o) => (o = nt(o), o.type === M.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3643
3643
  (m) => m.widget === o.widget
3644
3644
  ).length || (console.debug(
3645
3645
  "%cstorage%c %csubscribe",
@@ -3671,7 +3671,7 @@ class Br {
3671
3671
  try {
3672
3672
  return sessionStorage.getObject(d);
3673
3673
  } catch {
3674
- return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3674
+ return console.warn("%capi", x.API, M.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3675
3675
  }
3676
3676
  });
3677
3677
  I(this, "getSeries", async (o) => {
@@ -3679,7 +3679,7 @@ class Br {
3679
3679
  try {
3680
3680
  return sessionStorage.getObject(d);
3681
3681
  } catch {
3682
- return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3682
+ return console.warn("%capi", x.API, M.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3683
3683
  }
3684
3684
  });
3685
3685
  I(this, "getMessages", async (o) => {
@@ -3687,7 +3687,7 @@ class Br {
3687
3687
  try {
3688
3688
  return sessionStorage.getObject(d);
3689
3689
  } catch {
3690
- return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3690
+ return console.warn("%capi", x.API, M.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3691
3691
  }
3692
3692
  });
3693
3693
  /**
@@ -3701,7 +3701,7 @@ class Br {
3701
3701
  try {
3702
3702
  return sessionStorage.setObject(m, d), 201;
3703
3703
  } catch (A) {
3704
- return console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400;
3704
+ return console.error("%cstorage", x.STORAGE, M.CLOUD, o, A), 400;
3705
3705
  }
3706
3706
  });
3707
3707
  /**
@@ -3715,7 +3715,7 @@ class Br {
3715
3715
  try {
3716
3716
  return sessionStorage.setObject(m, d), 201;
3717
3717
  } catch (A) {
3718
- return console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400;
3718
+ return console.error("%cstorage", x.STORAGE, M.SERIES, o, A), 400;
3719
3719
  }
3720
3720
  });
3721
3721
  /**
@@ -3729,7 +3729,7 @@ class Br {
3729
3729
  try {
3730
3730
  return sessionStorage.setObject(m, d), 200;
3731
3731
  } catch (A) {
3732
- return console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400;
3732
+ return console.error("%cstorage", x.STORAGE, M.MESSAGES, o, A), 400;
3733
3733
  }
3734
3734
  });
3735
3735
  I(this, "cleanMessages", async (o) => {
@@ -3740,7 +3740,7 @@ class Br {
3740
3740
  try {
3741
3741
  return sessionStorage.setObject(d, o), 201;
3742
3742
  } catch (m) {
3743
- return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
3743
+ return console.error("%cstorage", x.STORAGE, M.WIDGET, o, m), 400;
3744
3744
  }
3745
3745
  });
3746
3746
  /**
@@ -3748,7 +3748,7 @@ class Br {
3748
3748
  * @param query IQuery
3749
3749
  * @returns null
3750
3750
  */
3751
- I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3751
+ I(this, "subscribe", (o) => (o = nt(o), o.type === M.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3752
3752
  (m) => m.widget === o.widget
3753
3753
  ).length || (console.debug(
3754
3754
  "%cstorage%c %csubscribe",
@@ -3780,7 +3780,7 @@ class Nr {
3780
3780
  try {
3781
3781
  return window.BuzzCasting.WidgetData[d];
3782
3782
  } catch {
3783
- return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 };
3783
+ return console.warn("%capi", x.API, M.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 };
3784
3784
  }
3785
3785
  });
3786
3786
  I(this, "getSeries", async (o) => {
@@ -3788,7 +3788,7 @@ class Nr {
3788
3788
  try {
3789
3789
  return window.BuzzCasting.WidgetData[d];
3790
3790
  } catch {
3791
- return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 };
3791
+ return console.warn("%capi", x.API, M.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 };
3792
3792
  }
3793
3793
  });
3794
3794
  I(this, "getMessages", async (o) => {
@@ -3796,7 +3796,7 @@ class Nr {
3796
3796
  try {
3797
3797
  return window.BuzzCasting.WidgetData[d];
3798
3798
  } catch {
3799
- return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3799
+ return console.warn("%capi", x.API, M.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3800
3800
  }
3801
3801
  });
3802
3802
  /**
@@ -3849,7 +3849,7 @@ class Nr {
3849
3849
  try {
3850
3850
  return window.BuzzCasting.WidgetData[d] = o, 201;
3851
3851
  } catch (m) {
3852
- return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
3852
+ return console.error("%cstorage", x.STORAGE, M.WIDGET, o, m), 400;
3853
3853
  }
3854
3854
  });
3855
3855
  /**
@@ -3857,7 +3857,7 @@ class Nr {
3857
3857
  * @param query IQuery
3858
3858
  * @returns null
3859
3859
  */
3860
- I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3860
+ I(this, "subscribe", (o) => (o = nt(o), o.type === M.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
3861
3861
  (m) => m.widget === o.widget
3862
3862
  ).length || (console.debug(
3863
3863
  "%cstorage%c %csubscribe",
@@ -3949,37 +3949,37 @@ class Mi {
3949
3949
  )[0];
3950
3950
  let te = "";
3951
3951
  switch (N.query.type) {
3952
- case B.MESSAGES:
3952
+ case M.MESSAGES:
3953
3953
  if (te = Ln(N.data.messages), Z.hash === te)
3954
3954
  return console.debug(
3955
3955
  "%capi%c %cno updates",
3956
3956
  x.API,
3957
3957
  x.NONE,
3958
3958
  x.NO_UPDATES,
3959
- B.MESSAGES,
3959
+ M.MESSAGES,
3960
3960
  N.query.slide,
3961
3961
  N.query.widget
3962
3962
  ), 204;
3963
3963
  Z.hash = te, j = await this.sm.setMessages(N.query, N);
3964
3964
  break;
3965
- case B.CLOUD:
3965
+ case M.CLOUD:
3966
3966
  te = Ln(N.data), Z.hash === te ? (console.debug(
3967
3967
  "%capi%c %cno updates",
3968
3968
  x.API,
3969
3969
  x.NONE,
3970
3970
  x.NO_UPDATES,
3971
- B.CLOUD,
3971
+ M.CLOUD,
3972
3972
  N.query.slide,
3973
3973
  N.query.widget
3974
3974
  ), j = 204) : (Z.hash = te, j = await this.sm.setCloud(N.query, N));
3975
3975
  break;
3976
- case B.SERIES:
3976
+ case M.SERIES:
3977
3977
  te = Ln(N.data), Z.hash === te ? (console.debug(
3978
3978
  "%capi%c %cno updates",
3979
3979
  x.API,
3980
3980
  x.NONE,
3981
3981
  x.NO_UPDATES,
3982
- B.SERIES,
3982
+ M.SERIES,
3983
3983
  N.query.slide,
3984
3984
  N.query.widget
3985
3985
  ), j = 204) : (Z.hash = te, j = await this.sm.setSeries(N.query, N));
@@ -4111,7 +4111,7 @@ class Ti {
4111
4111
  */
4112
4112
  I(this, "getCloud", async (o) => {
4113
4113
  var d;
4114
- return o.type !== B.CLOUD ? (console.warn(
4114
+ return o.type !== M.CLOUD ? (console.warn(
4115
4115
  "%capp%c %get",
4116
4116
  x.APP,
4117
4117
  x.NONE,
@@ -4132,7 +4132,7 @@ class Ti {
4132
4132
  */
4133
4133
  I(this, "getMessages", async (o) => {
4134
4134
  var d;
4135
- return o.type !== B.MESSAGES ? (console.warn(
4135
+ return o.type !== M.MESSAGES ? (console.warn(
4136
4136
  "%capp%c %get",
4137
4137
  x.APP,
4138
4138
  x.NONE,
@@ -4153,7 +4153,7 @@ class Ti {
4153
4153
  */
4154
4154
  I(this, "getSeries", async (o) => {
4155
4155
  var d;
4156
- return o.type !== B.SERIES ? (console.warn(
4156
+ return o.type !== M.SERIES ? (console.warn(
4157
4157
  "%capp%c %get",
4158
4158
  x.APP,
4159
4159
  x.NONE,
@@ -4186,12 +4186,14 @@ class Ti {
4186
4186
  }
4187
4187
  }
4188
4188
  }
4189
- var B = /* @__PURE__ */ ((w) => (w.MESSAGES = "messages", w.CLOUD = "cloud", w.SERIES = "series", w.TOPICS = "topics", w.WIDGET = "widget", w.WIDGETS = "widgets", w))(B || {}), x = /* @__PURE__ */ ((w) => (w.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", w.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", w.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", w.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", w.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", w.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", w.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", w.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", w.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", w.NONE = "color:transparent;background-color:transparent;", w.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", w.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", w.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", w.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", w.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", w.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", w.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", w))(x || {}), ue = /* @__PURE__ */ ((w) => (w.ADD_SLIDE = "addSlide", w.APP_READY = "appReady", w.API_UPDATE = "apiUpdate", w.CHANNEL = "channel", w.ERROR = "error", w.GOTO_SLIDE = "gotoSlide", w.HIDE_MESSAGE = "hideMessage", w.NEXT_SLIDE = "nextSlide", w.PAUSE_PRESENTATION = "pausePresentation", w.PRESENTATION_READY = "presentationReady", w.PREV_SLIDE = "prevSlide", w.RELOAD_PRESENTATION = "reloadPresentation", w.SHOW_MODAL = "showModal", w.SLIDE_DID_LOAD = "slideDidLoad", w.SLIDE_GOTO = "slideGoto", w.SLIDE_READY = "slideReady", w.SLIDE_TRANSITIONER = "slideTransitioner", w.START_TRANSITIONER = "startTransitioner", w.STORAGE_INIT = "stroageInit", w.SUBSCRIBE = "subscribe", w.UPDATE = "update", w.VERSION = "version", w.WIDGET_UPDATE = "widgetUpdate", w))(ue || {}), Xt = /* @__PURE__ */ ((w) => (w.APPROVED = "approved", w.BEFORE = "before", w.DELAYED = "delayed", w.NONE = "none", w.REALTIME = "realtime", w))(Xt || {}), he = /* @__PURE__ */ ((w) => (w.KEYVAL = "keyval", w.LOCAL = "local", w.SESSION = "session", w.DEXIE = "dexie", w.WINDOW = "window", w))(he || {});
4189
+ var M = /* @__PURE__ */ ((w) => (w.MESSAGES = "messages", w.CLOUD = "cloud", w.SERIES = "series", w.TOPICS = "topics", w.WIDGET = "widget", w.WIDGETS = "widgets", w))(M || {}), x = /* @__PURE__ */ ((w) => (w.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", w.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", w.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", w.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", w.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", w.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", w.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", w.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", w.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", w.NONE = "color:transparent;background-color:transparent;", w.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", w.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", w.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", w.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", w.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", w.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", w.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", w))(x || {}), ue = /* @__PURE__ */ ((w) => (w.ADD_SLIDE = "addSlide", w.APP_READY = "appReady", w.API_UPDATE = "apiUpdate", w.CHANNEL = "channel", w.ERROR = "error", w.GOTO_SLIDE = "gotoSlide", w.HIDE_MESSAGE = "hideMessage", w.NEXT_SLIDE = "nextSlide", w.PAUSE_PRESENTATION = "pausePresentation", w.PRESENTATION_READY = "presentationReady", w.PREV_SLIDE = "prevSlide", w.RELOAD_PRESENTATION = "reloadPresentation", w.SHOW_MODAL = "showModal", w.SLIDE_DID_LOAD = "slideDidLoad", w.SLIDE_GOTO = "slideGoto", w.SLIDE_READY = "slideReady", w.SLIDE_TRANSITIONER = "slideTransitioner", w.START_TRANSITIONER = "startTransitioner", w.STORAGE_INIT = "stroageInit", w.SUBSCRIBE = "subscribe", w.UPDATE = "update", w.VERSION = "version", w.WIDGET_UPDATE = "widgetUpdate", w))(ue || {}), Xt = /* @__PURE__ */ ((w) => (w.APPROVED = "approved", w.BEFORE = "before", w.DELAYED = "delayed", w.NONE = "none", w.REALTIME = "realtime", w))(Xt || {}), he = /* @__PURE__ */ ((w) => (w.KEYVAL = "keyval", w.LOCAL = "local", w.SESSION = "session", w.DEXIE = "dexie", w.WINDOW = "window", w))(he || {});
4190
4190
  class Bi {
4191
4191
  /**
4192
+ * Main container for managing widgets and data updates
4192
4193
  *
4194
+ * @param element widget web component
4193
4195
  * @param callbacks functions in the widget that will receive the update
4194
- * @param query
4196
+ * @param selector container for the element - by default buzzcasting-slide (optional)
4195
4197
  */
4196
4198
  constructor(o, d, m) {
4197
4199
  I(this, "storageReader");
@@ -4199,7 +4201,32 @@ class Bi {
4199
4201
  I(this, "query");
4200
4202
  I(this, "attributes");
4201
4203
  I(this, "listeners");
4202
- I(this, "getCloud", async () => this.query.type !== B.CLOUD ? (console.warn(
4204
+ /**
4205
+ * Generic call to any query type
4206
+ *
4207
+ * @returns IResponse
4208
+ */
4209
+ I(this, "getData", async () => {
4210
+ switch (this.query.type) {
4211
+ case M.CLOUD:
4212
+ return await this.getCloud();
4213
+ case M.MESSAGES:
4214
+ return await this.getMessages();
4215
+ case M.SERIES:
4216
+ return await this.getSeries();
4217
+ }
4218
+ return {
4219
+ data: null,
4220
+ message: `wrong method call, '${this.query.type}' is unknown`,
4221
+ success: !1
4222
+ };
4223
+ });
4224
+ /**
4225
+ * Get Widget Coud Data
4226
+ *
4227
+ * @returns IResponse
4228
+ */
4229
+ I(this, "getCloud", async () => this.query.type !== M.CLOUD ? (console.warn(
4203
4230
  "%cstorage%c %cwidget",
4204
4231
  x.STORAGE,
4205
4232
  x.NONE,
@@ -4209,10 +4236,15 @@ class Bi {
4209
4236
  this.query.type
4210
4237
  ), {
4211
4238
  data: null,
4212
- message: `wrong method call for getCloud, expected type is ${this.query.type}`,
4239
+ message: `wrong method call for getCloud, expected type is '${this.query.type}'`,
4213
4240
  success: !1
4214
4241
  }) : await this.storageReader.getCloud(this.query));
4215
- I(this, "getMessages", async () => this.query.type !== B.MESSAGES ? (console.warn(
4242
+ /**
4243
+ * Get Widget Messages Data
4244
+ *
4245
+ * @returns IResponse
4246
+ */
4247
+ I(this, "getMessages", async () => this.query.type !== M.MESSAGES ? (console.warn(
4216
4248
  "%cstorage%c %cwidget",
4217
4249
  x.STORAGE,
4218
4250
  x.NONE,
@@ -4222,10 +4254,15 @@ class Bi {
4222
4254
  this.query.type
4223
4255
  ), {
4224
4256
  data: null,
4225
- message: `wrong method call for getMessages, expected type is ${this.query.type}`,
4257
+ message: `wrong method call for getMessages, expected type is '${this.query.type}'`,
4226
4258
  success: !1
4227
4259
  }) : await this.storageReader.getMessages(this.query));
4228
- I(this, "getSeries", async () => this.query.type !== B.SERIES ? (console.warn(
4260
+ /**
4261
+ * Get Widget Series Data
4262
+ *
4263
+ * @returns IResponse
4264
+ */
4265
+ I(this, "getSeries", async () => this.query.type !== M.SERIES ? (console.warn(
4229
4266
  "%cstorage%c %cwidget",
4230
4267
  x.STORAGE,
4231
4268
  x.NONE,
@@ -4235,9 +4272,15 @@ class Bi {
4235
4272
  this.query.type
4236
4273
  ), {
4237
4274
  data: null,
4238
- message: `wrong method call for getSeries, expected type is ${this.query.type}`,
4275
+ message: `wrong method call for getSeries, expected type is '${this.query.type}'`,
4239
4276
  success: !1
4240
4277
  }) : await this.storageReader.getSeries(this.query));
4278
+ /**
4279
+ * Emit a show modal event using the element's attributes
4280
+ * the component is the web component name to show
4281
+ *
4282
+ * @param modal IModal
4283
+ */
4241
4284
  I(this, "showModal", (o) => {
4242
4285
  const d = new CustomEvent(ue.SHOW_MODAL, {
4243
4286
  detail: {
@@ -4280,6 +4323,10 @@ class Bi {
4280
4323
  }
4281
4324
  };
4282
4325
  }
4326
+ /**
4327
+ * This is used to register the component on the container's broadcast channel
4328
+ * This takes place when the container indicates it has finished loading (ready)
4329
+ */
4283
4330
  subscribe() {
4284
4331
  console.debug(
4285
4332
  "%cwidget%c %csubscribe",
@@ -4318,7 +4365,7 @@ function Ni(w, o) {
4318
4365
  return K;
4319
4366
  }
4320
4367
  export {
4321
- B as API,
4368
+ M as API,
4322
4369
  Mi as BuzzcastingStorageManager,
4323
4370
  Ti as BuzzcastingStorageReader,
4324
4371
  x as CSS,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzcasting-storage",
3
3
  "type": "module",
4
- "version": "2.8.0",
4
+ "version": "2.9.1",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Mark Tamis, TouchFlows SAS",