@tixyel/streamelements 6.4.6 → 6.4.8

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/index.es.js CHANGED
@@ -459,8 +459,8 @@ async function vt(l, e, t) {
459
459
  const c = m.getContext("2d");
460
460
  if (!c) continue;
461
461
  c.fillStyle = n, c.fillRect(0, 0, 1, 1);
462
- const [b, p, o] = c.getImageData(0, 0, 1, 1).data, d = Math.sqrt(Math.pow(l - b, 2) + Math.pow(e - p, 2) + Math.pow(t - o, 2));
463
- if (d < s && (s = d, i = n), d === 0) break;
462
+ const [b, p, o] = c.getImageData(0, 0, 1, 1).data, h = Math.sqrt(Math.pow(l - b, 2) + Math.pow(e - p, 2) + Math.pow(t - o, 2));
463
+ if (h < s && (s = h, i = n), h === 0) break;
464
464
  }
465
465
  return i;
466
466
  }
@@ -5241,7 +5241,7 @@ var y;
5241
5241
  ((l) => {
5242
5242
  let e;
5243
5243
  ((n) => {
5244
- function m(o, d = "cardinal") {
5244
+ function m(o, h = "cardinal") {
5245
5245
  const f = {
5246
5246
  single: ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
5247
5247
  tens: [
@@ -5257,7 +5257,7 @@ var y;
5257
5257
  "nineteen"
5258
5258
  ],
5259
5259
  decades: ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
5260
- }, h = {
5260
+ }, d = {
5261
5261
  single: [
5262
5262
  "zeroth",
5263
5263
  "first",
@@ -5301,27 +5301,27 @@ var y;
5301
5301
  "quadrillion",
5302
5302
  "quintillion"
5303
5303
  ], C = w.map((j) => j ? `${j}th` : "");
5304
- if (o = Math.abs(Math.floor(o)), d === "suffix") {
5304
+ if (o = Math.abs(Math.floor(o)), h === "suffix") {
5305
5305
  const j = o % 100;
5306
5306
  if (j >= 11 && j <= 13) return `${o}th`;
5307
5307
  const M = o % 10;
5308
5308
  return `${o}${g[M]}`;
5309
5309
  }
5310
5310
  function v(j, M) {
5311
- if (j < 10) return M === "ordinal" ? h.single[j] : f.single[j];
5312
- if (j < 20) return M === "ordinal" ? h.tens[j - 10] : f.tens[j - 10];
5311
+ if (j < 10) return M === "ordinal" ? d.single[j] : f.single[j];
5312
+ if (j < 20) return M === "ordinal" ? d.tens[j - 10] : f.tens[j - 10];
5313
5313
  const H = Math.floor(j / 10), O = j % 10;
5314
5314
  if (O === 0)
5315
- return M === "ordinal" ? h.decades[H - 2] : f.decades[H - 2];
5316
- const W = f.decades[H - 2], S = M === "ordinal" ? h.single[O] : f.single[O];
5315
+ return M === "ordinal" ? d.decades[H - 2] : f.decades[H - 2];
5316
+ const W = f.decades[H - 2], S = M === "ordinal" ? d.single[O] : f.single[O];
5317
5317
  return `${W}-${S}`;
5318
5318
  }
5319
5319
  function T(j, M) {
5320
- if (j === 0) return M === "ordinal" ? h.single[0] : f.single[0];
5320
+ if (j === 0) return M === "ordinal" ? d.single[0] : f.single[0];
5321
5321
  const H = Math.floor(j / 100), O = j % 100, W = [];
5322
5322
  return H > 0 && (M === "ordinal" && O === 0 ? W.push(`${f.single[H]} hundredth`) : W.push(`${f.single[H]} hundred`)), O > 0 && W.push(v(O, M)), W.join(" ");
5323
5323
  }
5324
- if (o < 1e3) return T(o, d);
5324
+ if (o < 1e3) return T(o, h);
5325
5325
  const U = [];
5326
5326
  let D = o;
5327
5327
  for (; D > 0; )
@@ -5333,7 +5333,7 @@ var y;
5333
5333
  const M = U[j];
5334
5334
  if (M === 0) continue;
5335
5335
  const H = w[j];
5336
- if (d === "cardinal") {
5336
+ if (h === "cardinal") {
5337
5337
  let O = T(M, "cardinal");
5338
5338
  H && (O += ` ${H}`), _.push(O);
5339
5339
  } else if (j === P)
@@ -5352,43 +5352,43 @@ var y;
5352
5352
  return _.join(", ");
5353
5353
  }
5354
5354
  n.translate = m;
5355
- function c(o, d = 0, f = 100, h = 0) {
5356
- const g = Math.min(Math.max(o, d), f);
5357
- return b(g, h);
5355
+ function c(o, h = 0, f = 100, d = 0) {
5356
+ const g = Math.min(Math.max(o, h), f);
5357
+ return b(g, d);
5358
5358
  }
5359
5359
  n.balance = c;
5360
- function b(o, d = 2) {
5361
- const f = Math.pow(10, d);
5360
+ function b(o, h = 2) {
5361
+ const f = Math.pow(10, h);
5362
5362
  return Math.round(o * f) / f;
5363
5363
  }
5364
5364
  n.round = b;
5365
- function p(o, d, f = 0) {
5366
- o > d && ([o, d] = [d, o]);
5367
- const h = Math.random() * (d - o) + o;
5368
- return f ? Number(h.toFixed(f)) : Math.round(h);
5365
+ function p(o, h, f = 0) {
5366
+ o > h && ([o, h] = [h, o]);
5367
+ const d = Math.random() * (h - o) + o;
5368
+ return f ? Number(d.toFixed(f)) : Math.round(d);
5369
5369
  }
5370
5370
  n.number = p;
5371
5371
  })(e = l.number || (l.number = {}));
5372
5372
  let t;
5373
5373
  ((n) => {
5374
- function m(d, f, h) {
5374
+ function m(h, f, d) {
5375
5375
  const g = f.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
5376
5376
  if (g) {
5377
5377
  const w = g[1], C = g[2], v = g[0].match(/class="([^"]*)"/)?.[1] || "";
5378
- let T = [w, d].filter((U) => U.length).map((U) => U.endsWith(";") ? U.slice(0, -1) : U).join("; ").replace(/\s*;\s*/g, "; ").trim();
5379
- return T.endsWith(";") || (T += ";"), `<span${v ? ` class="${v} ${h ?? ""}"` : ""}${T ? ` style="${T}"` : ""}>${C}</span>`;
5378
+ let T = [w, h].filter((U) => U.length).map((U) => U.endsWith(";") ? U.slice(0, -1) : U).join("; ").replace(/\s*;\s*/g, "; ").trim();
5379
+ return T.endsWith(";") || (T += ";"), `<span${v ? ` class="${v} ${d ?? ""}"` : ""}${T ? ` style="${T}"` : ""}>${C}</span>`;
5380
5380
  } else
5381
- return d && d.length && !d.endsWith(";") && (d += ";"), `<span${h ? ` class="${h}"` : ""}${d ? ` style="${d}"` : ""}>${f}</span>`;
5381
+ return h && h.length && !h.endsWith(";") && (h += ";"), `<span${d ? ` class="${d}"` : ""}${h ? ` style="${h}"` : ""}>${f}</span>`;
5382
5382
  }
5383
5383
  n.mergeSpanStyles = m;
5384
- function c(d, f = 0, h = 1, g) {
5385
- const { return: w = !1, parent: C, base: v } = g || {}, T = C || d.parentElement || document.body;
5384
+ function c(h, f = 0, d = 1, g) {
5385
+ const { return: w = !1, parent: C, base: v } = g || {}, T = C || h.parentElement || document.body;
5386
5386
  if (!T)
5387
5387
  throw new Error("No parent element found for scaling");
5388
- const U = T.getBoundingClientRect(), D = d.offsetWidth, P = d.offsetHeight;
5388
+ const U = T.getBoundingClientRect(), D = h.offsetWidth, P = h.offsetHeight;
5389
5389
  if (D === 0 || P === 0)
5390
5390
  throw new Error("Element has zero width or height, cannot scale");
5391
- const _ = U.width * h / D, j = U.height * h / P;
5391
+ const _ = U.width * d / D, j = U.height * d / P;
5392
5392
  let M = v === "width" ? _ : v === "height" ? j : Math.min(_, j);
5393
5393
  if (f > 0) {
5394
5394
  const O = U.width * f / D, W = U.height * f / P, S = Math.max(O, W);
@@ -5399,48 +5399,48 @@ var y;
5399
5399
  height: P * M,
5400
5400
  scale: M
5401
5401
  };
5402
- return w || (d.style.transform = `scale(${M})`, d.style.transformOrigin = "center center"), H;
5402
+ return w || (h.style.transform = `scale(${M})`, h.style.transformOrigin = "center center"), H;
5403
5403
  }
5404
5404
  n.scale = c;
5405
- function b(d, f = {}) {
5405
+ function b(h, f = {}) {
5406
5406
  const {
5407
- parent: h = d.parentElement,
5407
+ parent: d = h.parentElement,
5408
5408
  prefer: g = "auto",
5409
5409
  min: w = 0,
5410
5410
  max: C = 1,
5411
5411
  apply: v = () => {
5412
5412
  }
5413
5413
  } = f;
5414
- if (!h)
5414
+ if (!d)
5415
5415
  throw new Error("No parent element found for scaling");
5416
- const T = h.getBoundingClientRect(), U = d.getBoundingClientRect(), D = T.width, P = T.height, _ = U.width, j = U.height;
5416
+ const T = d.getBoundingClientRect(), U = h.getBoundingClientRect(), D = T.width, P = T.height, _ = U.width, j = U.height;
5417
5417
  let M = D * w / _, H = P * w / j, O = D * C / _, W = P * C / j, S = Math.min(O, W);
5418
5418
  const tt = Math.max(M, H);
5419
5419
  S = Math.max(S, tt);
5420
5420
  const q = _ * S, F = j * S;
5421
- return g === "width" ? S = Math.max(M, Math.min(O, D / _)) : g === "height" ? S = Math.max(H, Math.min(W, P / j)) : q > D ? S = Math.max(M, Math.min(O, D / _)) : F > P && (S = Math.max(H, Math.min(W, P / j))), v.apply(d, [S, d]), S;
5421
+ return g === "width" ? S = Math.max(M, Math.min(O, D / _)) : g === "height" ? S = Math.max(H, Math.min(W, P / j)) : q > D ? S = Math.max(M, Math.min(O, D / _)) : F > P && (S = Math.max(H, Math.min(W, P / j))), v.apply(h, [S, h]), S;
5422
5422
  }
5423
5423
  n.scalev2 = b;
5424
- function p(d, f = 1, h = {}) {
5425
- const g = parseFloat(getComputedStyle(d).getPropertyValue("font-size")), w = {
5426
- minFontSize: h?.minFontSize ?? 0,
5427
- maxFontSize: h?.maxFontSize ?? g
5428
- }, C = h?.parent || d.parentElement;
5424
+ function p(h, f = 1, d = {}) {
5425
+ const g = parseFloat(getComputedStyle(h).getPropertyValue("font-size")), w = {
5426
+ minFontSize: d?.minFontSize ?? 0,
5427
+ maxFontSize: d?.maxFontSize ?? g
5428
+ }, C = d?.parent || h.parentElement;
5429
5429
  if (!C)
5430
5430
  throw new Error("No parent element found for fitting text");
5431
- const v = C.clientWidth * f, T = d.offsetWidth, U = v / T, D = g * U, P = e.balance(D, w.minFontSize, w.maxFontSize);
5432
- return d.style.fontSize = P + "px", d;
5431
+ const v = C.clientWidth * f, T = h.offsetWidth, U = v / T, D = g * U, P = e.balance(D, w.minFontSize, w.maxFontSize);
5432
+ return h.style.fontSize = P + "px", h;
5433
5433
  }
5434
5434
  n.fitText = p;
5435
- function o(d, f = 0, h = !1) {
5435
+ function o(h, f = 0, d = !1) {
5436
5436
  const g = new DOMParser(), w = document.createElement("div");
5437
5437
  let C = f;
5438
5438
  function v(U) {
5439
5439
  if (U.nodeType === Node.TEXT_NODE) {
5440
5440
  const P = (U.textContent || "").split("").map((j, M) => {
5441
5441
  const H = document.createElement("span");
5442
- return H.classList.add("char"), H.dataset.index = String(C), H.dataset.exclusivityIndex = String(M), H.style.setProperty("--char-index", String(C)), H.style.setProperty("--exclusivity-index", String(M)), (j === " " || j === `
5443
- ` || j === " ") && (H.style.whiteSpace = "pre-wrap"), H.textContent = j, C++, H;
5442
+ return H.classList.add("char"), H.dataset.index = String(C), H.dataset.exclusivityIndex = String(M), H.style.setProperty("--char-index", String(C)), H.style.setProperty("--exclusivity-index", String(M)), j === " " || j === `
5443
+ ` || j === " " ? H.style.whiteSpace = "pre-wrap" : C++, H.textContent = j, H;
5444
5444
  }), _ = document.createDocumentFragment();
5445
5445
  return P.forEach((j) => _.appendChild(j)), _;
5446
5446
  } else if (U.nodeType === Node.ELEMENT_NODE) {
@@ -5452,8 +5452,8 @@ var y;
5452
5452
  }
5453
5453
  return U.cloneNode(!0);
5454
5454
  }
5455
- g.parseFromString(d, "text/html").body.childNodes.forEach((U) => {
5456
- if (!h && U.nodeType === Node.TEXT_NODE && !U.textContent?.trim())
5455
+ g.parseFromString(h, "text/html").body.childNodes.forEach((U) => {
5456
+ if (!d && U.nodeType === Node.TEXT_NODE && !U.textContent?.trim())
5457
5457
  return;
5458
5458
  const D = v(U);
5459
5459
  w.appendChild(D);
@@ -5467,47 +5467,47 @@ var y;
5467
5467
  })(t = l.element || (l.element = {}));
5468
5468
  let a;
5469
5469
  ((n) => {
5470
- function m(o, d = !0, f = "") {
5471
- const h = {};
5470
+ function m(o, h = !0, f = "") {
5471
+ const d = {};
5472
5472
  for (const g in o) {
5473
5473
  if (!Object.prototype.hasOwnProperty.call(o, g)) continue;
5474
5474
  const w = o[g], C = f ? `${f}.${g}` : g;
5475
5475
  if (w == null) {
5476
- h[C] = String(w);
5476
+ d[C] = String(w);
5477
5477
  continue;
5478
5478
  }
5479
5479
  if (typeof w == "number" && isNaN(w)) {
5480
- h[C] = "NaN";
5480
+ d[C] = "NaN";
5481
5481
  continue;
5482
5482
  }
5483
5483
  if (typeof w == "number" && !isNaN(w)) {
5484
- h[C] = d ? String(w) : w;
5484
+ d[C] = h ? String(w) : w;
5485
5485
  continue;
5486
5486
  }
5487
5487
  if (w instanceof Date) {
5488
- h[C] = w.toISOString();
5488
+ d[C] = w.toISOString();
5489
5489
  continue;
5490
5490
  }
5491
5491
  if (w instanceof Map) {
5492
5492
  w.forEach((v, T) => {
5493
- h[`${C}.${T}`] = JSON.stringify(v);
5493
+ d[`${C}.${T}`] = JSON.stringify(v);
5494
5494
  });
5495
5495
  continue;
5496
5496
  }
5497
5497
  if (Array.isArray(w)) {
5498
5498
  w.forEach((v, T) => {
5499
5499
  const U = `${C}:${T}`;
5500
- typeof v == "object" ? Object.assign(h, m(v, d, U)) : h[U] = d ? String(v) : v;
5500
+ typeof v == "object" ? Object.assign(d, m(v, h, U)) : d[U] = h ? String(v) : v;
5501
5501
  });
5502
5502
  continue;
5503
5503
  }
5504
5504
  if (typeof w == "object") {
5505
- Object.assign(h, m(w, d, C));
5505
+ Object.assign(d, m(w, h, C));
5506
5506
  continue;
5507
5507
  }
5508
- h[C] = String(w);
5508
+ d[C] = String(w);
5509
5509
  }
5510
- return h;
5510
+ return d;
5511
5511
  }
5512
5512
  n.flatten = m;
5513
5513
  function c(o) {
@@ -5523,57 +5523,57 @@ var y;
5523
5523
  }
5524
5524
  n.keys = p;
5525
5525
  })(a = l.object || (l.object = {})), ((n) => {
5526
- function m(o, d = J.emotes) {
5526
+ function m(o, h = J.emotes) {
5527
5527
  const f = [];
5528
- return d.forEach((h) => {
5529
- const g = h.name;
5528
+ return h.forEach((d) => {
5529
+ const g = d.name;
5530
5530
  let w = 0, C = 0;
5531
5531
  for (; w < o.length; ) {
5532
5532
  const v = o.indexOf(g, C);
5533
5533
  if (v === -1) break;
5534
5534
  const T = v > 0 ? o[v - 1] : " ", U = v + g.length < o.length ? o[v + g.length] : " ";
5535
- /\s/.test(T) && /\s/.test(U) && f.push({ ...h, start: v, end: v + g.length }), C = v + 1;
5535
+ /\s/.test(T) && /\s/.test(U) && f.push({ ...d, start: v, end: v + g.length }), C = v + 1;
5536
5536
  }
5537
- }), f.sort((h, g) => h.start - g.start);
5537
+ }), f.sort((d, g) => d.start - g.start);
5538
5538
  }
5539
5539
  n.findEmotesInText = m;
5540
- function c(o, d) {
5541
- if (!d.length) return o;
5542
- let f = "", h = 0;
5543
- return d.forEach((g) => {
5544
- f += o.substring(h, g.start);
5540
+ function c(o, h) {
5541
+ if (!h.length) return o;
5542
+ let f = "", d = 0;
5543
+ return h.forEach((g) => {
5544
+ f += o.substring(d, g.start);
5545
5545
  const C = Array.from({ ...g.urls, length: 5 }).slice(1).reverse().filter(Boolean)[0] || g.urls[1];
5546
- f += `<img src="${C}" alt="${g.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, h = g.end;
5547
- }), f += o.substring(h), f;
5546
+ f += `<img src="${C}" alt="${g.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`, d = g.end;
5547
+ }), f += o.substring(d), f;
5548
5548
  }
5549
5549
  n.replaceEmotesWithHTML = c;
5550
- function b(o, d = J.youtube_emotes) {
5551
- return Array.from(o.matchAll(/:(.*?):/gim), (h) => h[0]).forEach((h) => {
5552
- const g = d.find(
5553
- (w) => w.shortcuts.includes(h) || w.searchTerms.includes(h.slice(1, -1))
5550
+ function b(o, h = J.youtube_emotes) {
5551
+ return Array.from(o.matchAll(/:(.*?):/gim), (d) => d[0]).forEach((d) => {
5552
+ const g = h.find(
5553
+ (w) => w.shortcuts.includes(d) || w.searchTerms.includes(d.slice(1, -1))
5554
5554
  );
5555
5555
  if (g) {
5556
5556
  const w = g.image.thumbnails.at(-1)?.url, C = g.image.accessibility.accessibilityData.label;
5557
5557
  w && (o = o.replace(
5558
- h,
5558
+ d,
5559
5559
  `<img src="${w}" alt="${C}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`
5560
5560
  ));
5561
5561
  }
5562
5562
  }), o;
5563
5563
  }
5564
5564
  n.replaceYoutubeEmotesWithHTML = b;
5565
- async function p(o = [], d) {
5565
+ async function p(o = [], h) {
5566
5566
  !Array.isArray(o) && typeof o == "string" && (o = o.split(",").map((v) => v.trim()));
5567
5567
  var f = o.map((v) => v.split("/")[0]);
5568
5568
  if (!f || !f.length) {
5569
- var h = s.number(1, 3);
5570
- for await (const v of Array.from({ length: h }, () => "")) {
5569
+ var d = s.number(1, 3);
5570
+ for await (const v of Array.from({ length: d }, () => "")) {
5571
5571
  var g = s.array(Object.keys(J.badges))[0];
5572
5572
  !f.includes(g) && Array.isArray(f) ? f.push(g) : f = [g];
5573
5573
  }
5574
5574
  }
5575
5575
  var w;
5576
- switch (d) {
5576
+ switch (h) {
5577
5577
  case "twitch": {
5578
5578
  w = {
5579
5579
  keys: Array.from(f).filter((v) => v in J.badges),
@@ -5613,13 +5613,14 @@ var y;
5613
5613
  }
5614
5614
  n.generateBadges = p;
5615
5615
  })(l.message || (l.message = {})), ((n) => {
5616
- function m(c) {
5617
- var b = (
5616
+ function m(c, b) {
5617
+ var p = (
5618
5618
  // @ts-ignore
5619
+ b || // @ts-ignore
5619
5620
  c.event?.provider || // @ts-ignore
5620
5621
  c.event?.service || // @ts-ignore
5621
5622
  c.event?.data?.provider || // @ts-ignore
5622
- window.client.details.provider
5623
+ window?.client?.details?.provider || "twitch"
5623
5624
  );
5624
5625
  return [
5625
5626
  "kvstore:update",
@@ -5628,33 +5629,33 @@ var y;
5628
5629
  "tip-latest",
5629
5630
  "event:test",
5630
5631
  "event:skip"
5631
- ].some((d) => d === c.listener) && (b = "streamelements"), { provider: b, data: c };
5632
+ ].some((f) => f === c.listener) && (p = "streamelements"), { provider: p, data: c };
5632
5633
  }
5633
5634
  n.parseProvider = m;
5634
5635
  })(l.event || (l.event = {})), ((n) => {
5635
5636
  n.PRESETS = {};
5636
- async function m(p, o, d) {
5637
+ async function m(p, o, h) {
5637
5638
  const f = [];
5638
5639
  p.replace(o, (g, ...w) => {
5639
- const C = typeof d == "function" ? d(g, ...w) : g;
5640
+ const C = typeof h == "function" ? h(g, ...w) : g;
5640
5641
  return f.push(Promise.resolve(C)), g;
5641
5642
  });
5642
- const h = await Promise.all(f);
5643
- return p.replace(o, () => h.shift() ?? "");
5643
+ const d = await Promise.all(f);
5644
+ return p.replace(o, () => d.shift() ?? "");
5644
5645
  }
5645
5646
  n.replace = m;
5646
5647
  function c(p) {
5647
5648
  return p.charAt(0).toUpperCase() + p.slice(1);
5648
5649
  }
5649
5650
  n.capitalize = c;
5650
- function b(p, o = {}, d = {
5651
+ function b(p, o = {}, h = {
5651
5652
  method: "index",
5652
5653
  html: !1,
5653
5654
  debug: !1,
5654
5655
  modifiers: {},
5655
5656
  aliases: {}
5656
5657
  }) {
5657
- const { mergeSpanStyles: f } = t, h = (r, u, k) => d.html ? f(r, u, k) : u, g = {
5658
+ const { mergeSpanStyles: f } = t, d = (r, u, k) => h.html ? f(r, u, k) : u, g = {
5658
5659
  skip: "<br/>",
5659
5660
  newline: "<br/>",
5660
5661
  ...o
@@ -5850,22 +5851,22 @@ var y;
5850
5851
  return x ? !I : I;
5851
5852
  }
5852
5853
  const F = {
5853
- COLOR: (r, u) => h(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
5854
- WEIGHT: (r, u) => h(u && !isNaN(parseInt(u)) ? `font-weight: ${u}` : "", r, "weight"),
5855
- SEMIBOLD: (r) => h("font-weight: 600", r, "semibold"),
5856
- BOLD: (r) => h("font-weight: bold", r, "bold"),
5857
- BLACK: (r) => h("font-weight: 900", r, "black"),
5858
- LIGHT: (r) => h("font-weight: lighter", r, "light"),
5859
- STRONG: (r) => h("font-weight: bolder", r, "strong"),
5860
- ITALIC: (r) => h("font-style: italic", r, "italic"),
5861
- UNDERLINE: (r) => h("text-decoration: underline", r, "underline"),
5862
- STRIKETHROUGH: (r) => h("text-decoration: line-through", r, "strikethrough"),
5863
- SUB: (r) => h("vertical-align: sub", r, "sub"),
5864
- SUP: (r) => h("vertical-align: super", r, "sup"),
5865
- LARGER: (r) => h("font-size: larger", r, "larger"),
5866
- SMALL: (r) => h("font-size: smaller", r, "small"),
5867
- SHADOW: (r, u) => h(`text-shadow: ${u}`, r, "shadow"),
5868
- SIZE: (r, u) => h(u ? `font-size: ${u}` : "", r, "size")
5854
+ COLOR: (r, u) => d(u && i.validate(u) ? `color: ${u}` : "", r, "color"),
5855
+ WEIGHT: (r, u) => d(u && !isNaN(parseInt(u)) ? `font-weight: ${u}` : "", r, "weight"),
5856
+ SEMIBOLD: (r) => d("font-weight: 600", r, "semibold"),
5857
+ BOLD: (r) => d("font-weight: bold", r, "bold"),
5858
+ BLACK: (r) => d("font-weight: 900", r, "black"),
5859
+ LIGHT: (r) => d("font-weight: lighter", r, "light"),
5860
+ STRONG: (r) => d("font-weight: bolder", r, "strong"),
5861
+ ITALIC: (r) => d("font-style: italic", r, "italic"),
5862
+ UNDERLINE: (r) => d("text-decoration: underline", r, "underline"),
5863
+ STRIKETHROUGH: (r) => d("text-decoration: line-through", r, "strikethrough"),
5864
+ SUB: (r) => d("vertical-align: sub", r, "sub"),
5865
+ SUP: (r) => d("vertical-align: super", r, "sup"),
5866
+ LARGER: (r) => d("font-size: larger", r, "larger"),
5867
+ SMALL: (r) => d("font-size: smaller", r, "small"),
5868
+ SHADOW: (r, u) => d(`text-shadow: ${u}`, r, "shadow"),
5869
+ SIZE: (r, u) => d(u ? `font-size: ${u}` : "", r, "size")
5869
5870
  }, Y = {
5870
5871
  ...{
5871
5872
  BT1: (r) => U > 1 ? r : "",
@@ -5906,8 +5907,8 @@ var y;
5906
5907
  },
5907
5908
  FALLBACK: (r, u) => r.length ? r : u ?? r
5908
5909
  },
5909
- ...d?.html ? F : {},
5910
- ...d.modifiers ?? {}
5910
+ ...h?.html ? F : {},
5911
+ ...h.modifiers ?? {}
5911
5912
  }, ft = {
5912
5913
  UPC: ["UPPERCASE", "UPPER", "UPP"],
5913
5914
  LOW: ["LOWERCASE", "LOWER", "LWC"],
@@ -5936,14 +5937,14 @@ var y;
5936
5937
  SHADOW: ["SHADOW", "SHD"],
5937
5938
  FALLBACK: ["FALLBACK", "FB"],
5938
5939
  IF: ["IF", "COND", "CONDITION"],
5939
- ...d.aliases ?? {}
5940
+ ...h.aliases ?? {}
5940
5941
  };
5941
5942
  function nt(r, u, k) {
5942
5943
  const x = Object.entries(ft).find(([I, A]) => A.some((z) => z.toUpperCase() === u.toUpperCase()) ? !0 : I.toUpperCase() === u.toUpperCase()), N = x ? x[0] : u.toUpperCase();
5943
5944
  try {
5944
- return Y[N] ? Y[N](r, typeof k == "string" ? k.trim() : null, v) : d?.html ? h("", r, N.toLowerCase()) : r;
5945
+ return Y[N] ? Y[N](r, typeof k == "string" ? k.trim() : null, v) : h?.html ? d("", r, N.toLowerCase()) : r;
5945
5946
  } catch (I) {
5946
- return d?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: k, error: I }), r;
5947
+ return h?.debug && typeof console < "u" && typeof console.error == "function" && console.error("[Helper.string.compose] Modifier error", { name: u, param: k, error: I }), r;
5947
5948
  }
5948
5949
  }
5949
5950
  function dt(r) {
@@ -6006,7 +6007,7 @@ var y;
6006
6007
  T.PLACEHOLDERS,
6007
6008
  (r, u) => typeof v[u] == "string" || typeof v[u] == "number" ? String(v[u]) : u ?? u
6008
6009
  );
6009
- return K = d.method === "loop" ? dt(K) : ht(K), K;
6010
+ return K = h.method === "loop" ? dt(K) : ht(K), K;
6010
6011
  }
6011
6012
  n.compose = b;
6012
6013
  })(l.string || (l.string = {})), ((n) => {
@@ -6016,11 +6017,11 @@ var y;
6016
6017
  throw new Error("No sound URL provided");
6017
6018
  try {
6018
6019
  p && n.playing && n.audio && n.audio.state !== "closed" && n.audio.close();
6019
- let o = new AudioContext(), d = o.createGain();
6020
- d.connect(o.destination), p && (n.audio = o, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => o.decodeAudioData(f)).then((f) => {
6020
+ let o = new AudioContext(), h = o.createGain();
6021
+ h.connect(o.destination), p && (n.audio = o, n.playing = !0), fetch(c).then((f) => f.arrayBuffer()).then((f) => o.decodeAudioData(f)).then((f) => {
6021
6022
  if (o.state !== "closed") {
6022
- const h = o.createBufferSource();
6023
- h.buffer = f, h.connect(d), d.gain.value = b / 100, h.start(o.currentTime);
6023
+ const d = o.createBufferSource();
6024
+ d.buffer = f, d.connect(h), h.gain.value = b / 100, d.start(o.currentTime);
6024
6025
  }
6025
6026
  });
6026
6027
  } catch (o) {
@@ -6031,10 +6032,10 @@ var y;
6031
6032
  })(l.sound || (l.sound = {}));
6032
6033
  let i;
6033
6034
  ((n) => {
6034
- function m(o = 100, d = "") {
6035
- d = d.length > 7 ? d?.substring(0, 6) : d, o = o > 1 ? o / 100 : o;
6035
+ function m(o = 100, h = "") {
6036
+ h = h.length > 7 ? h?.substring(0, 6) : h, o = o > 1 ? o / 100 : o;
6036
6037
  let f = Math.round(Math.min(Math.max(o, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
6037
- return d + f;
6038
+ return h + f;
6038
6039
  }
6039
6040
  n.opacity = m;
6040
6041
  function c(o) {
@@ -6043,42 +6044,42 @@ var y;
6043
6044
  color: o,
6044
6045
  opacity: 100
6045
6046
  };
6046
- var h = o.slice(-2), d = parseInt(h, 16) / 255, f = Math.round(d * 100), h = o.length > 7 ? o.slice(0, 7) : o;
6047
+ var d = o.slice(-2), h = parseInt(d, 16) / 255, f = Math.round(h * 100), d = o.length > 7 ? o.slice(0, 7) : o;
6047
6048
  return {
6048
- color: h,
6049
+ color: d,
6049
6050
  opacity: f
6050
6051
  };
6051
6052
  }
6052
6053
  n.extract = c;
6053
6054
  function b(o) {
6054
6055
  if (typeof o != "string" || !String(o).trim().length) return !1;
6055
- const d = o.trim();
6056
- return /^#([A-Fa-f0-9]{3}){1,2}$/.test(d) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(d) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(d) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(d) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(d) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(d) ? "hsla" : J.css_color_names.includes(d.toLowerCase()) ? "css-color-name" : !1;
6056
+ const h = o.trim();
6057
+ return /^#([A-Fa-f0-9]{3}){1,2}$/.test(h) || /^#([A-Fa-f0-9]{4}|[A-Fa-f0-9]{8})$/.test(h) ? "hex" : /^rgb\(\s*(?:\d{1,3}\s*,\s*){2}\d{1,3}\s*\)$/.test(h) ? "rgb" : /^rgba\(\s*(?:\d{1,3}\s*,\s*){3}(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "rgba" : /^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(h) ? "hsl" : /^hsla\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*,\s*(?:0|1|0?\.\d+)\s*\)$/.test(h) ? "hsla" : J.css_color_names.includes(h.toLowerCase()) ? "css-color-name" : !1;
6057
6058
  }
6058
6059
  n.validate = b;
6059
- async function p(o, d) {
6060
+ async function p(o, h) {
6060
6061
  const f = b(o);
6061
6062
  if (!f) throw new Error(`Invalid color format: ${o}`);
6062
- if (f === d) throw new Error(`Color is already in the desired format: ${d}`);
6063
- const h = bt(o.trim(), f);
6064
- if (!h) throw new Error(`Failed to parse color: ${o}`);
6065
- switch (d) {
6063
+ if (f === h) throw new Error(`Color is already in the desired format: ${h}`);
6064
+ const d = bt(o.trim(), f);
6065
+ if (!d) throw new Error(`Failed to parse color: ${o}`);
6066
+ switch (h) {
6066
6067
  case "hex":
6067
- return yt(h, !1);
6068
+ return yt(d, !1);
6068
6069
  case "rgb":
6069
- return `rgb(${h.r}, ${h.g}, ${h.b})`;
6070
+ return `rgb(${d.r}, ${d.g}, ${d.b})`;
6070
6071
  case "rgba":
6071
- return `rgba(${h.r}, ${h.g}, ${h.b}, ${h.a})`;
6072
+ return `rgba(${d.r}, ${d.g}, ${d.b}, ${d.a})`;
6072
6073
  case "hsl": {
6073
- const g = lt(h.r, h.g, h.b);
6074
+ const g = lt(d.r, d.g, d.b);
6074
6075
  return `hsl(${g.h}, ${g.s}%, ${g.l}%)`;
6075
6076
  }
6076
6077
  case "hsla": {
6077
- const g = lt(h.r, h.g, h.b);
6078
- return `hsla(${g.h}, ${g.s}%, ${g.l}%, ${h.a})`;
6078
+ const g = lt(d.r, d.g, d.b);
6079
+ return `hsla(${g.h}, ${g.s}%, ${g.l}%, ${d.a})`;
6079
6080
  }
6080
6081
  case "css-color-name":
6081
- return await vt(h.r, h.g, h.b);
6082
+ return await vt(d.r, d.g, d.b);
6082
6083
  default:
6083
6084
  return null;
6084
6085
  }
@@ -6141,19 +6142,19 @@ var y;
6141
6142
  return [g[w], w];
6142
6143
  }
6143
6144
  n.array = o;
6144
- function d(g = new Date(2e3, 0, 1), w = /* @__PURE__ */ new Date()) {
6145
+ function h(g = new Date(2e3, 0, 1), w = /* @__PURE__ */ new Date()) {
6145
6146
  return new Date(c(g.getTime(), w.getTime()));
6146
6147
  }
6147
- n.date = d;
6148
+ n.date = h;
6148
6149
  function f(g) {
6149
6150
  const C = Date.now() - c(0, g * 24 * 60 * 60 * 1e3);
6150
6151
  return new Date(C).toISOString();
6151
6152
  }
6152
6153
  n.daysOffset = f;
6153
- function h() {
6154
+ function d() {
6154
6155
  return crypto.randomUUID();
6155
6156
  }
6156
- n.uuid = h;
6157
+ n.uuid = d;
6157
6158
  })(s = l.random || (l.random = {})), ((n) => {
6158
6159
  function m(b, p, o) {
6159
6160
  return b.apply(p, o);
@@ -6164,33 +6165,33 @@ var y;
6164
6165
  }
6165
6166
  n.call = c;
6166
6167
  })(l.fn || (l.fn = {})), ((n) => {
6167
- function m(d, f) {
6168
+ function m(h, f) {
6168
6169
  return new Promise(
6169
- (h) => setTimeout(() => {
6170
+ (d) => setTimeout(() => {
6170
6171
  if (f) {
6171
6172
  const g = f();
6172
- h(g ?? null);
6173
- } else h(null);
6174
- }, d)
6173
+ d(g ?? null);
6174
+ } else d(null);
6175
+ }, h)
6175
6176
  );
6176
6177
  }
6177
6178
  n.delay = m;
6178
- function c(d) {
6179
- return Object.entries(d);
6179
+ function c(h) {
6180
+ return Object.entries(h);
6180
6181
  }
6181
6182
  n.typedEntries = c;
6182
- function b(d) {
6183
- return Object.values(d);
6183
+ function b(h) {
6184
+ return Object.values(h);
6184
6185
  }
6185
6186
  n.typedValues = b;
6186
- function p(d) {
6187
- return Object.keys(d);
6187
+ function p(h) {
6188
+ return Object.keys(h);
6188
6189
  }
6189
6190
  n.typedKeys = p;
6190
- function o(d) {
6191
- const f = Object.values(d).reduce((C, v) => C + v, 0), h = c(d).sort((C, v) => v[1] - C[1]), g = Math.random() * f;
6191
+ function o(h) {
6192
+ const f = Object.values(h).reduce((C, v) => C + v, 0), d = c(h).sort((C, v) => v[1] - C[1]), g = Math.random() * f;
6192
6193
  let w = 0;
6193
- for (const [C, v] of h)
6194
+ for (const [C, v] of d)
6194
6195
  if (w += v, g < w)
6195
6196
  return C;
6196
6197
  }
@@ -6335,10 +6336,10 @@ typeof window !== void 0 && (window.addEventListener("onWidgetLoad", async (l) =
6335
6336
  ), a) {
6336
6337
  const i = (b) => {
6337
6338
  const p = Date.now(), o = {};
6338
- for (const d in b)
6339
- if (b.hasOwnProperty(d)) {
6340
- const f = b[d];
6341
- f.expire && f.expire > p && (o[d] = f);
6339
+ for (const h in b)
6340
+ if (b.hasOwnProperty(h)) {
6341
+ const f = b[h];
6342
+ f.expire && f.expire > p && (o[h] = f);
6342
6343
  }
6343
6344
  return o;
6344
6345
  }, s = i(a.user || {}), n = i(a.avatar || {}), m = i(a.pronoun || {}), c = i(a.emote || {});
@@ -6997,16 +6998,16 @@ var B;
6997
6998
  const m = (p) => {
6998
6999
  if (!p || !("amount" in p)) return [];
6999
7000
  const o = [];
7000
- for (let d = 0; d < p.amount; d++)
7001
+ for (let h = 0; h < p.amount; h++)
7001
7002
  o.push(i(p.value));
7002
7003
  return o.sort(
7003
- (d, f) => new Date(f.createdAt).getTime() - new Date(d.createdAt).getTime()
7004
+ (h, f) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
7004
7005
  );
7005
7006
  }, c = (p) => {
7006
7007
  const o = {};
7007
- for (const d in p) {
7008
- const f = d.replace("_type", "type");
7009
- o[f] = i(p[d]);
7008
+ for (const h in p) {
7009
+ const f = h.replace("_type", "type");
7010
+ o[f] = i(p[h]);
7010
7011
  }
7011
7012
  return o;
7012
7013
  }, b = (p) => {
@@ -7102,8 +7103,8 @@ var B;
7102
7103
  }
7103
7104
  const o = t[`cheer-${p}-top-donation`];
7104
7105
  o && n > o.amount && (o.amount = n, o.name = m);
7105
- const d = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === d.name.toLowerCase()).reduce((g, w) => g + w.amount, 0), h = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, w) => g + w.amount, 0);
7106
- h > f && (d.amount = h, d.name = m);
7106
+ const h = t[`cheer-${p}-top-donator`], f = t["cheer-recent"].filter((g) => g.name.toLowerCase() === h.name.toLowerCase()).reduce((g, w) => g + w.amount, 0), d = t["cheer-recent"].filter((g) => g.name.toLowerCase() === m.toLowerCase()).reduce((g, w) => g + w.amount, 0);
7107
+ d > f && (h.amount = d, h.name = m);
7107
7108
  };
7108
7109
  b("all"), t["cheer-session"].amount += n, t["cheer-week"].amount += n, t["cheer-month"].amount += n, t["cheer-total"].amount += n, t["cheer-count"].count += 1, t["cheer-goal"].amount += n, t["cheer-recent"].unshift({
7109
7110
  name: m,
@@ -7180,8 +7181,8 @@ var B;
7180
7181
  }
7181
7182
  const p = t[`superchat-${b}-top-donation`];
7182
7183
  p && m > p.amount && (p.amount = m, p.name = n);
7183
- const o = t[`superchat-${b}-top-donator`], d = t["superchat-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, g) => h + g.amount, 0), f = t["superchat-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, g) => h + g.amount, 0);
7184
- f > d && (o.amount = f, o.name = n);
7184
+ const o = t[`superchat-${b}-top-donator`], h = t["superchat-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["superchat-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
7185
+ f > h && (o.amount = f, o.name = n);
7185
7186
  };
7186
7187
  c("all"), t["superchat-session"].amount += m, t["superchat-week"].amount += m, t["superchat-month"].amount += m, t["superchat-total"].amount += m, t["superchat-count"].count += 1, t["superchat-goal"].amount += m, t["superchat-recent"].unshift({
7187
7188
  name: n.toLowerCase(),
@@ -7209,8 +7210,8 @@ var B;
7209
7210
  }
7210
7211
  const p = t[`tip-${b}-top-donation`];
7211
7212
  p && m > p.amount && (p.amount = m, p.name = n);
7212
- const o = t[`tip-${b}-top-donator`], d = t["tip-recent"].filter((h) => h.name.toLowerCase() === o.name.toLowerCase()).reduce((h, g) => h + g.amount, 0), f = t["tip-recent"].filter((h) => h.name.toLowerCase() === n.toLowerCase()).reduce((h, g) => h + g.amount, 0);
7213
- f > d && (o.amount = f, o.name = n);
7213
+ const o = t[`tip-${b}-top-donator`], h = t["tip-recent"].filter((d) => d.name.toLowerCase() === o.name.toLowerCase()).reduce((d, g) => d + g.amount, 0), f = t["tip-recent"].filter((d) => d.name.toLowerCase() === n.toLowerCase()).reduce((d, g) => d + g.amount, 0);
7214
+ f > h && (o.amount = f, o.name = n);
7214
7215
  };
7215
7216
  c("all"), t["tip-session"].amount += m, t["tip-week"].amount += m, t["tip-month"].amount += m, t["tip-total"].amount += m, t["tip-count"].count += 1, t["tip-goal"].amount += m, t["tip-recent"].unshift({
7216
7217
  name: n,
@@ -7274,7 +7275,7 @@ var B;
7274
7275
  }
7275
7276
  case "message": {
7276
7277
  const S = i;
7277
- var c = S?.name ?? y.random.array(J.names.filter((q) => q.length))[0], b = S?.message ?? y.random.array(J.messages.filter((q) => q.length))[0], p = await y.message.generateBadges(S?.badges ?? [], t), o = y.message.findEmotesInText(b), d = y.message.replaceEmotesWithHTML(b, o), f = S?.color ?? y.random.color("hex"), h = S?.userId ?? y.random.string(16), g = S?.msgId ?? y.random.string(16), w = S?.time ?? Date.now(), C = S?.channel ?? window?.client?.details?.user?.username ?? "local", v = S?.reply ? {
7278
+ var c = S?.name ?? y.random.array(J.names.filter((q) => q.length))[0], b = S?.message ?? y.random.array(J.messages.filter((q) => q.length))[0], p = await y.message.generateBadges(S?.badges ?? [], t), o = y.message.findEmotesInText(b), h = y.message.replaceEmotesWithHTML(b, o), f = S?.color ?? y.random.color("hex"), d = S?.userId ?? y.random.string(16), g = S?.msgId ?? y.random.string(16), w = S?.time ?? Date.now(), C = S?.channel ?? window?.client?.details?.user?.username ?? "local", v = S?.reply ? {
7278
7279
  "reply-parent-display-name": S.reply.name,
7279
7280
  "reply-parent-msg-body": S.reply.text,
7280
7281
  "reply-parent-msg-id": S.reply.msgId,
@@ -7300,7 +7301,7 @@ var B;
7300
7301
  badges: p.keys.map((q) => `${q}/1`).join(","),
7301
7302
  ...U,
7302
7303
  "tmi-sent-ts": w.toString(),
7303
- "user-id": h,
7304
+ "user-id": d,
7304
7305
  "user-type": "",
7305
7306
  color: f,
7306
7307
  "display-name": c,
@@ -7319,12 +7320,12 @@ var B;
7319
7320
  channel: C,
7320
7321
  text: b,
7321
7322
  isAction: !1,
7322
- userId: h,
7323
+ userId: d,
7323
7324
  msgId: g,
7324
7325
  badges: p.badges,
7325
7326
  emotes: o
7326
7327
  },
7327
- renderedText: d
7328
+ renderedText: h
7328
7329
  },
7329
7330
  // @ts-ignore
7330
7331
  emulated: !0
@@ -7550,7 +7551,7 @@ var B;
7550
7551
  i?.badges ?? [],
7551
7552
  t
7552
7553
  );
7553
- var o = y.message.findEmotesInText(b), d = y.message.replaceEmotesWithHTML(b, o), f = i?.color ?? y.random.color("hex"), h = i?.userId ?? y.random.number(1e7, 99999999).toString(), g = i?.msgId ?? y.random.uuid(), w = i?.time ?? Date.now(), P = i?.avatar ?? y.random.array(J.avatars)[0], C = i?.channel ?? window?.client?.details?.user?.username ?? "local";
7554
+ var o = y.message.findEmotesInText(b), h = y.message.replaceEmotesWithHTML(b, o), f = i?.color ?? y.random.color("hex"), d = i?.userId ?? y.random.number(1e7, 99999999).toString(), g = i?.msgId ?? y.random.uuid(), w = i?.time ?? Date.now(), P = i?.avatar ?? y.random.array(J.avatars)[0], C = i?.channel ?? window?.client?.details?.user?.username ?? "local";
7554
7555
  return {
7555
7556
  listener: "message",
7556
7557
  event: {
@@ -7578,7 +7579,7 @@ var B;
7578
7579
  ...q
7579
7580
  },
7580
7581
  msgId: g,
7581
- userId: h,
7582
+ userId: d,
7582
7583
  nick: c.toLowerCase(),
7583
7584
  badges: [],
7584
7585
  displayName: c,
@@ -7855,7 +7856,7 @@ var B;
7855
7856
  cache: "no-store"
7856
7857
  }).then((m) => m.json()).then(async (m) => {
7857
7858
  const c = Object.entries(m).filter(([p, { value: o }]) => o != null).reduce(
7858
- (p, [o, { value: d }]) => (n && n[o] !== void 0 && (d = n[o]), p[o] = d, p),
7859
+ (p, [o, { value: h }]) => (n && n[o] !== void 0 && (h = n[o]), p[o] = h, p),
7859
7860
  {
7860
7861
  ...n
7861
7862
  }