@tixyel/streamelements 7.5.1 → 7.5.2
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.d.ts +335 -324
- package/dist/index.es.js +34 -25
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -9595,7 +9595,7 @@ function j(e, t, n) {
|
|
|
9595
9595
|
b: Math.round(a * 255)
|
|
9596
9596
|
};
|
|
9597
9597
|
}
|
|
9598
|
-
async function
|
|
9598
|
+
async function ee(e, t, n) {
|
|
9599
9599
|
let r = l, i = r[0], a = Infinity;
|
|
9600
9600
|
for await (let o of r) {
|
|
9601
9601
|
let r = document.createElement("canvas");
|
|
@@ -9610,7 +9610,7 @@ async function M(e, t, n) {
|
|
|
9610
9610
|
}
|
|
9611
9611
|
//#endregion
|
|
9612
9612
|
//#region src/helper/classes/color.ts
|
|
9613
|
-
var
|
|
9613
|
+
var M = class {
|
|
9614
9614
|
opacity(e = 100, t = "") {
|
|
9615
9615
|
t = t.length > 7 ? t?.substring(0, 6) : t, e = e > 1 ? e / 100 : e;
|
|
9616
9616
|
let n = Math.round(Math.min(Math.max(e, 0), 1) * 255).toString(16).toLowerCase().padStart(2, "0");
|
|
@@ -9650,11 +9650,11 @@ var N = class {
|
|
|
9650
9650
|
let e = A(r.r, r.g, r.b);
|
|
9651
9651
|
return `hsla(${e.h}, ${e.s}%, ${e.l}%, ${r.a})`;
|
|
9652
9652
|
}
|
|
9653
|
-
case "css-color-name": return await
|
|
9653
|
+
case "css-color-name": return await ee(r.r, r.g, r.b);
|
|
9654
9654
|
default: return null;
|
|
9655
9655
|
}
|
|
9656
9656
|
}
|
|
9657
|
-
},
|
|
9657
|
+
}, te = class {
|
|
9658
9658
|
constructor() {
|
|
9659
9659
|
this.PRESETS = {};
|
|
9660
9660
|
}
|
|
@@ -9876,7 +9876,7 @@ var N = class {
|
|
|
9876
9876
|
}
|
|
9877
9877
|
return r ? !a : a;
|
|
9878
9878
|
}
|
|
9879
|
-
let T = new
|
|
9879
|
+
let T = new M(), E = {
|
|
9880
9880
|
BT1: (e) => p > 1 ? e : "",
|
|
9881
9881
|
BT0: (e) => p > 0 ? e : "",
|
|
9882
9882
|
ST1: (e) => p < 1 ? e : "",
|
|
@@ -10100,7 +10100,7 @@ var N = class {
|
|
|
10100
10100
|
let j = e.replace(f.PLACEHOLDERS, (e, t) => typeof d[t] == "string" || typeof d[t] == "number" ? String(d[t]) : t ?? t);
|
|
10101
10101
|
return j = n.method === "loop" ? k(j) : A(j), j;
|
|
10102
10102
|
}
|
|
10103
|
-
},
|
|
10103
|
+
}, ne = class {
|
|
10104
10104
|
constructor() {
|
|
10105
10105
|
this.playing = !1;
|
|
10106
10106
|
}
|
|
@@ -10119,18 +10119,18 @@ var N = class {
|
|
|
10119
10119
|
throw Error(`Error playing sound: ${e}`);
|
|
10120
10120
|
}
|
|
10121
10121
|
}
|
|
10122
|
-
},
|
|
10122
|
+
}, re = class {
|
|
10123
10123
|
apply(e, t, n) {
|
|
10124
10124
|
return e.apply(t, n);
|
|
10125
10125
|
}
|
|
10126
10126
|
call(e, t, ...n) {
|
|
10127
10127
|
return e.call(t, ...n);
|
|
10128
10128
|
}
|
|
10129
|
-
},
|
|
10129
|
+
}, ie = class {
|
|
10130
10130
|
constructor(e, t, n = [], r = !1, i) {
|
|
10131
10131
|
this.badges = [], this.isSubscriber = !1, this.id = e, this.name = t, this.login = t.toLocaleLowerCase(), this.badges = n, this.isSubscriber = r, this.tier = i;
|
|
10132
10132
|
}
|
|
10133
|
-
},
|
|
10133
|
+
}, ae = {
|
|
10134
10134
|
broadcaster: [
|
|
10135
10135
|
"moderator",
|
|
10136
10136
|
"vip",
|
|
@@ -10147,7 +10147,7 @@ var N = class {
|
|
|
10147
10147
|
"duelyst_6",
|
|
10148
10148
|
"duelyst_7"
|
|
10149
10149
|
]
|
|
10150
|
-
},
|
|
10150
|
+
}, N = [], P = class t extends e {
|
|
10151
10151
|
static fixUser(e) {
|
|
10152
10152
|
return typeof e == "string" ? e.trim().replace(/^@+/, "").toLocaleLowerCase() : t.fixUser(e.name);
|
|
10153
10153
|
}
|
|
@@ -10166,7 +10166,7 @@ var N = class {
|
|
|
10166
10166
|
e.set(n, [...r, t]);
|
|
10167
10167
|
}
|
|
10168
10168
|
return e;
|
|
10169
|
-
}, /* @__PURE__ */ new Map())),
|
|
10169
|
+
}, /* @__PURE__ */ new Map())), N.push(this);
|
|
10170
10170
|
}
|
|
10171
10171
|
start(e, n = w.badges.map((e) => e.set_id), r) {
|
|
10172
10172
|
let i = e.map((e) => e && t.fixUser(e)).filter((e) => e && e.length).filter((e, t, n) => n.indexOf(e) === t), a = n.filter((e, t, n) => n.indexOf(e) === t);
|
|
@@ -10212,7 +10212,7 @@ var N = class {
|
|
|
10212
10212
|
}
|
|
10213
10213
|
return null;
|
|
10214
10214
|
};
|
|
10215
|
-
for (let [e, t] of S(
|
|
10215
|
+
for (let [e, t] of S(ae, r?.incompatible)) if (d.has(e)) for (let n of x(t)) d.has(n) && C(e, n);
|
|
10216
10216
|
for (let e of a) {
|
|
10217
10217
|
let t = b(u[e]);
|
|
10218
10218
|
for (let n of t) {
|
|
@@ -10258,7 +10258,7 @@ var N = class {
|
|
|
10258
10258
|
continue;
|
|
10259
10259
|
}
|
|
10260
10260
|
n.length < c && this.emit("warn", /* @__PURE__ */ Error(`User "${e}" could only receive ${n.length} badge(s), below the configured minimum of ${c}`));
|
|
10261
|
-
let i = o.length + 1, a = n.some((e) => ["subscriber"].includes(String(e).toLocaleLowerCase())), s = new
|
|
10261
|
+
let i = o.length + 1, a = n.some((e) => ["subscriber"].includes(String(e).toLocaleLowerCase())), s = new ie(`fake_user_${i.toString().padStart(2, "0")}_${Math.random().toString(36).slice(2, 8)}+${this.id}`, e, n, a, a ? t.getRandomSubTier() : void 0);
|
|
10262
10262
|
o.push(s);
|
|
10263
10263
|
}
|
|
10264
10264
|
return o.length < i.length && this.emit("warn", /* @__PURE__ */ Error("Some users could not be assigned badges due to limits. Consider increasing limits or adding more badges.")), o;
|
|
@@ -10367,7 +10367,7 @@ var N = class {
|
|
|
10367
10367
|
async findSubscriptionTier({ userId: e, name: t, broadcasterId: n }, r, i = !1) {
|
|
10368
10368
|
let a = (e) => e === "prime" || e === "1000" || e === 1e3 || e === 1 || e === "1" ? 1 : e === "2000" || e === 2e3 || e === 2 || e === "2" ? 2 : e === "3000" || e === 3e3 || e === 3 || e === "3" ? 3 : 1;
|
|
10369
10369
|
if (e?.includes("fake_user_")) {
|
|
10370
|
-
let t =
|
|
10370
|
+
let t = N.find((t) => e.endsWith(`+${t.id}`));
|
|
10371
10371
|
if (t) {
|
|
10372
10372
|
let n = t.getById(e);
|
|
10373
10373
|
if (n) return a(n.tier);
|
|
@@ -10607,7 +10607,7 @@ var N = class {
|
|
|
10607
10607
|
}
|
|
10608
10608
|
}, I;
|
|
10609
10609
|
(function(e) {
|
|
10610
|
-
e.animate = new oe(), e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new
|
|
10610
|
+
e.animate = new oe(), e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new te(), e.sound = new ne(), e.color = new M(), e.random = new T(), e.fn = new re(), e.utils = new F();
|
|
10611
10611
|
})(I ||= {});
|
|
10612
10612
|
//#endregion
|
|
10613
10613
|
//#region src/actions/button.ts
|
|
@@ -13029,26 +13029,35 @@ var J = class {
|
|
|
13029
13029
|
}),
|
|
13030
13030
|
events: {
|
|
13031
13031
|
emit(e, t) {
|
|
13032
|
-
let n = {
|
|
13032
|
+
let n = new CustomEvent("onEventReceived", { detail: {
|
|
13033
13033
|
listener: e,
|
|
13034
13034
|
event: t,
|
|
13035
13035
|
result: void 0
|
|
13036
|
-
};
|
|
13037
|
-
return
|
|
13036
|
+
} });
|
|
13037
|
+
return this.history.push({
|
|
13038
|
+
...n,
|
|
13039
|
+
origin: client?.id
|
|
13040
|
+
}), window.dispatchEvent(n) ? { ok: !0 } : { ok: !1 };
|
|
13038
13041
|
},
|
|
13039
13042
|
broadcast(e, t) {
|
|
13040
|
-
let n = {
|
|
13043
|
+
let n = new CustomEvent("onEventReceived", { detail: {
|
|
13041
13044
|
listener: e,
|
|
13042
13045
|
event: t,
|
|
13043
13046
|
result: void 0
|
|
13044
|
-
};
|
|
13045
|
-
return
|
|
13046
|
-
|
|
13047
|
+
} });
|
|
13048
|
+
return this.history.push({
|
|
13049
|
+
...n,
|
|
13050
|
+
origin: client?.id
|
|
13051
|
+
}), window.dispatchEvent(n) ? { ok: !0 } : { ok: !1 };
|
|
13052
|
+
},
|
|
13053
|
+
history: []
|
|
13047
13054
|
}
|
|
13048
13055
|
};
|
|
13049
13056
|
async function de() {
|
|
13050
13057
|
let e = localStorage.getItem("SE_API-STORE") ?? "{}", t = e ? JSON.parse(e) : {};
|
|
13051
|
-
|
|
13058
|
+
Y.store.list = t;
|
|
13059
|
+
let n = localStorage.getItem("SE_API-EVENTS") ?? "[]", r = n ? JSON.parse(n) : [];
|
|
13060
|
+
return Y.events.history = r, Y;
|
|
13052
13061
|
}
|
|
13053
13062
|
//#endregion
|
|
13054
13063
|
//#region src/utils/alejo.ts
|
|
@@ -13114,7 +13123,7 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(de()), Q
|
|
|
13114
13123
|
useQueue: W,
|
|
13115
13124
|
useLogger: J,
|
|
13116
13125
|
useComms: se,
|
|
13117
|
-
FakeUserPool:
|
|
13126
|
+
FakeUserPool: P
|
|
13118
13127
|
},
|
|
13119
13128
|
actions: {
|
|
13120
13129
|
Button: R,
|
|
@@ -13126,7 +13135,7 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(de()), Q
|
|
|
13126
13135
|
usedComms: V,
|
|
13127
13136
|
usedCommands: z,
|
|
13128
13137
|
usedButtons: L,
|
|
13129
|
-
fakeUserPools:
|
|
13138
|
+
fakeUserPools: N
|
|
13130
13139
|
},
|
|
13131
13140
|
pronouns: { Alejo: X }
|
|
13132
13141
|
};
|