@tixyel/streamelements 7.1.0 → 7.2.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.
- package/dist/index.d.ts +211 -1
- package/dist/index.es.js +123 -25
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2999,7 +2999,7 @@ declare class UtilsHelper {
|
|
|
2999
2999
|
userId: string;
|
|
3000
3000
|
name: string;
|
|
3001
3001
|
broadcasterId?: string;
|
|
3002
|
-
}, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<
|
|
3002
|
+
}, session: StreamElements.Session.Data, checkWithAPI?: boolean): Promise<3 | 1 | 2>;
|
|
3003
3003
|
/**
|
|
3004
3004
|
* Identifies a user based on the received event and session data, returning their ID, name, role, badges, and top status.
|
|
3005
3005
|
* @param receivedEvent - The event received from the provider (Twitch or YouTube) containing user information.
|
|
@@ -3106,7 +3106,217 @@ type IdentifyYouTubeResult = {
|
|
|
3106
3106
|
top: TopType;
|
|
3107
3107
|
};
|
|
3108
3108
|
|
|
3109
|
+
type Point = {
|
|
3110
|
+
x: number;
|
|
3111
|
+
y: number;
|
|
3112
|
+
};
|
|
3113
|
+
type AnimOptions = {
|
|
3114
|
+
/** Duration in seconds. Default: `1` */
|
|
3115
|
+
duration?: number;
|
|
3116
|
+
fps?: number;
|
|
3117
|
+
easing?: (t: number) => number;
|
|
3118
|
+
};
|
|
3119
|
+
type AnimResult = {
|
|
3120
|
+
x: number[];
|
|
3121
|
+
y: number[];
|
|
3122
|
+
};
|
|
3123
|
+
type QuadraticParams = AnimOptions & {
|
|
3124
|
+
from: Point;
|
|
3125
|
+
to: Point;
|
|
3126
|
+
control: Point;
|
|
3127
|
+
};
|
|
3128
|
+
type CubicParams = AnimOptions & {
|
|
3129
|
+
from: Point & {
|
|
3130
|
+
control: Point;
|
|
3131
|
+
};
|
|
3132
|
+
to: Point & {
|
|
3133
|
+
control: Point;
|
|
3134
|
+
};
|
|
3135
|
+
};
|
|
3136
|
+
type MultiCubicPoint = Point & {
|
|
3137
|
+
control?: Point;
|
|
3138
|
+
controlIn?: Point;
|
|
3139
|
+
controlOut?: Point;
|
|
3140
|
+
};
|
|
3141
|
+
type MultiCubicParams = AnimOptions & {
|
|
3142
|
+
points: [MultiCubicPoint, MultiCubicPoint, MultiCubicPoint, ...MultiCubicPoint[]];
|
|
3143
|
+
};
|
|
3144
|
+
type CircleParams = AnimOptions & {
|
|
3145
|
+
center: Point;
|
|
3146
|
+
radius: number;
|
|
3147
|
+
from?: number;
|
|
3148
|
+
to?: number;
|
|
3149
|
+
};
|
|
3150
|
+
type SpiralParams = AnimOptions & {
|
|
3151
|
+
center: Point;
|
|
3152
|
+
radius: {
|
|
3153
|
+
from: number;
|
|
3154
|
+
to: number;
|
|
3155
|
+
};
|
|
3156
|
+
turns?: number;
|
|
3157
|
+
};
|
|
3158
|
+
declare class AnimateHelper {
|
|
3159
|
+
/**
|
|
3160
|
+
* Interpolate a number from start to end
|
|
3161
|
+
* @example
|
|
3162
|
+
* ```ts
|
|
3163
|
+
* const value = animate.lerp(0, 100, 0.5);
|
|
3164
|
+
* console.log(value); // 50
|
|
3165
|
+
* // Clamped between 0 and 1
|
|
3166
|
+
* const clamped = animate.lerp(0, 100, 1.5);
|
|
3167
|
+
* console.log(clamped); // 100
|
|
3168
|
+
* const clamped2 = animate.lerp(0, 100, -0.5);
|
|
3169
|
+
* console.log(clamped2); // 0
|
|
3170
|
+
* const easeIn = animate.lerp(0, 100, (t) => t * t);
|
|
3171
|
+
* console.log(easeIn); // 25 at t=0.5
|
|
3172
|
+
* const linear = animate.lerp(0, 100, 0.5);
|
|
3173
|
+
* console.log(linear); // 50 at t=0.5
|
|
3174
|
+
* // Ease-in should be less than linear at t=0.5
|
|
3175
|
+
* console.log(easeIn < linear); // true
|
|
3176
|
+
* ```
|
|
3177
|
+
*/
|
|
3178
|
+
lerp(start: number, end: number, t: number): number;
|
|
3179
|
+
/**
|
|
3180
|
+
* Create a quadratic Bezier path between two positions using a control point.
|
|
3181
|
+
* Returns sampled x/y coordinates for the animation timeline.
|
|
3182
|
+
* @example
|
|
3183
|
+
* ```ts
|
|
3184
|
+
* const { x, y } = animate.quadratic({
|
|
3185
|
+
* from: { x: 0, y: 0 },
|
|
3186
|
+
* to: { x: 100, y: 0 },
|
|
3187
|
+
* control: { x: 50, y: 50 },
|
|
3188
|
+
* duration: 1,
|
|
3189
|
+
* fps: 60,
|
|
3190
|
+
* easing: Motion.easeInOut,
|
|
3191
|
+
* });
|
|
3192
|
+
*
|
|
3193
|
+
* // Use with Motion.animate
|
|
3194
|
+
* Motion.animate(element, { x, y }, { duration: 1 });
|
|
3195
|
+
* ```
|
|
3196
|
+
*/
|
|
3197
|
+
quadratic({ from, to, control, duration, fps, easing, }: QuadraticParams): AnimResult;
|
|
3198
|
+
/**
|
|
3199
|
+
* Create a cubic Bezier path between two positions using two control points.
|
|
3200
|
+
* Returns sampled x/y coordinates for the animation timeline.
|
|
3201
|
+
* @example
|
|
3202
|
+
* ```ts
|
|
3203
|
+
* const { x, y } = animate.cubic({
|
|
3204
|
+
* from: { x: 0, y: 0, control: { x: 50, y: 100 } },
|
|
3205
|
+
* to: { x: 200, y: 0, control: { x: 150, y: 100 } },
|
|
3206
|
+
* duration: 2,
|
|
3207
|
+
* fps: 60,
|
|
3208
|
+
* easing: Motion.easeInOut,
|
|
3209
|
+
* });
|
|
3210
|
+
* ```
|
|
3211
|
+
*/
|
|
3212
|
+
cubic({ from, to, duration, fps, easing }: CubicParams): AnimResult;
|
|
3213
|
+
private getMultiCubicOutgoingControl;
|
|
3214
|
+
private getMultiCubicIncomingControl;
|
|
3215
|
+
/**
|
|
3216
|
+
* Create a chained cubic Bezier path using 3 or more points.
|
|
3217
|
+
* First and last points use a single control handle.
|
|
3218
|
+
* Middle points can use separate incoming and outgoing handles.
|
|
3219
|
+
*
|
|
3220
|
+
* Every consecutive pair creates one cubic segment:
|
|
3221
|
+
* `P0 = points[i]`, `P1 = points[i].controlOut`, `P2 = points[i + 1].controlIn`, `P3 = points[i + 1]`.
|
|
3222
|
+
*
|
|
3223
|
+
* For compatibility, `control` is treated as a shared handle when `controlIn` or `controlOut`
|
|
3224
|
+
* are not provided.
|
|
3225
|
+
* @example
|
|
3226
|
+
* ```ts
|
|
3227
|
+
* const { x, y } = animate.multiCubic({
|
|
3228
|
+
* points: [
|
|
3229
|
+
* { x: 0, y: 0, control: { x: 20, y: 40 } },
|
|
3230
|
+
* {
|
|
3231
|
+
* x: 100,
|
|
3232
|
+
* y: 0,
|
|
3233
|
+
* controlIn: { x: 80, y: 60 },
|
|
3234
|
+
* controlOut: { x: 120, y: -20 },
|
|
3235
|
+
* },
|
|
3236
|
+
* { x: 200, y: 50, control: { x: 160, y: 120 } },
|
|
3237
|
+
* ],
|
|
3238
|
+
* duration: 2,
|
|
3239
|
+
* fps: 60,
|
|
3240
|
+
* easing: Motion.easeInOut,
|
|
3241
|
+
* });
|
|
3242
|
+
* ```
|
|
3243
|
+
*/
|
|
3244
|
+
multiCubic({ points, duration, fps, easing }: MultiCubicParams): AnimResult;
|
|
3245
|
+
/**
|
|
3246
|
+
* Create a circular path around a center point.
|
|
3247
|
+
* Angles in degrees. Default: `from: 0`, `to: 360`.
|
|
3248
|
+
* @example
|
|
3249
|
+
* ```ts
|
|
3250
|
+
* const { x, y } = animate.circle({
|
|
3251
|
+
* center: { x: 100, y: 100 },
|
|
3252
|
+
* radius: 50,
|
|
3253
|
+
* from: 0,
|
|
3254
|
+
* to: 360,
|
|
3255
|
+
* duration: 3,
|
|
3256
|
+
* fps: 60,
|
|
3257
|
+
* });
|
|
3258
|
+
* ```
|
|
3259
|
+
*/
|
|
3260
|
+
circle({ center, radius, from, to, duration, fps, easing, }: CircleParams): AnimResult;
|
|
3261
|
+
/**
|
|
3262
|
+
* Create a spiral path around a center point.
|
|
3263
|
+
* @example
|
|
3264
|
+
* ```ts
|
|
3265
|
+
* const { x, y } = animate.spiral({
|
|
3266
|
+
* center: { x: 0, y: 0 },
|
|
3267
|
+
* radius: { from: 10, to: 100 },
|
|
3268
|
+
* turns: 3,
|
|
3269
|
+
* duration: 2,
|
|
3270
|
+
* fps: 60,
|
|
3271
|
+
* easing: (t) => 1 - (1 - t) * (1 - t),
|
|
3272
|
+
* });
|
|
3273
|
+
*
|
|
3274
|
+
* // This will create a spiral that starts at radius 10 and expands to radius 100 over 3 turns.
|
|
3275
|
+
* ```
|
|
3276
|
+
*/
|
|
3277
|
+
spiral({ center, radius, turns, duration, fps, easing, }: SpiralParams): AnimResult;
|
|
3278
|
+
/**
|
|
3279
|
+
* Chain multiple animation paths together sequentially.
|
|
3280
|
+
* @example
|
|
3281
|
+
* ```ts
|
|
3282
|
+
* const path1 = animate.quadratic({
|
|
3283
|
+
* from: { x: 0, y: 0 },
|
|
3284
|
+
* to: { x: 100, y: 0 },
|
|
3285
|
+
* control: { x: 50, y: 50 },
|
|
3286
|
+
* duration: 1,
|
|
3287
|
+
* fps: 60,
|
|
3288
|
+
* });
|
|
3289
|
+
*
|
|
3290
|
+
* const path2 = animate.circle({
|
|
3291
|
+
* center: { x: 100, y: 0 },
|
|
3292
|
+
* radius: 30,
|
|
3293
|
+
* from: 0,
|
|
3294
|
+
* to: 180,
|
|
3295
|
+
* duration: 1,
|
|
3296
|
+
* fps: 60,
|
|
3297
|
+
* });
|
|
3298
|
+
*
|
|
3299
|
+
* const combined = animate.chain(path1, path2);
|
|
3300
|
+
* ```
|
|
3301
|
+
*/
|
|
3302
|
+
chain(...animations: AnimResult[]): AnimResult;
|
|
3303
|
+
/**
|
|
3304
|
+
* Execute multiple animations in sequence with optional delays between them.
|
|
3305
|
+
* Each animation will be sampled and delays will add repeating the last coordinate.
|
|
3306
|
+
* @example
|
|
3307
|
+
* ```ts
|
|
3308
|
+
* const path1 = animate.quadratic({ from: { x: 0, y: 0 }, to: { x: 50, y: 0 }, control: { x: 25, y: 25 }, duration: 0.5, fps: 30 });
|
|
3309
|
+
* const path2 = animate.quadratic({ from: { x: 50, y: 0 }, to: { x: 100, y: 0 }, control: { x: 75, y: 25 }, duration: 0.5, fps: 30 });
|
|
3310
|
+
*
|
|
3311
|
+
* // 30 frames delay between animations
|
|
3312
|
+
* const sequenced = animate.sequence([path1, path2], 30);
|
|
3313
|
+
* ```
|
|
3314
|
+
*/
|
|
3315
|
+
sequence(animations: AnimResult[], delayFrames?: number | number[]): AnimResult;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3109
3318
|
declare namespace Helper {
|
|
3319
|
+
const animate: AnimateHelper;
|
|
3110
3320
|
const number: NumberHelper;
|
|
3111
3321
|
const element: ElementHelper;
|
|
3112
3322
|
const object: ObjectHelper;
|
package/dist/index.es.js
CHANGED
|
@@ -262,8 +262,8 @@ var e = class {
|
|
|
262
262
|
if (l === 0 || u === 0) throw Error("Element has zero width or height, cannot scale");
|
|
263
263
|
let d = c.width * n / l, f = c.height * n / u, p = o === "width" ? d : o === "height" ? f : Math.min(d, f);
|
|
264
264
|
if (t > 0) {
|
|
265
|
-
let e = c.width * t / l, n = c.height * t / u
|
|
266
|
-
p = Math.max(
|
|
265
|
+
let e = c.width * t / l, n = c.height * t / u;
|
|
266
|
+
p = Math.max(Math.max(e, n), p);
|
|
267
267
|
}
|
|
268
268
|
let m = {
|
|
269
269
|
width: l * p,
|
|
@@ -275,10 +275,10 @@ var e = class {
|
|
|
275
275
|
scalev2(e, t = {}) {
|
|
276
276
|
let { parent: n = e.parentElement, prefer: r = "auto", min: i = 0, max: a = 1, apply: o = () => {} } = t;
|
|
277
277
|
if (!n) throw Error("No parent element found for scaling");
|
|
278
|
-
let s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), l = s.width, u = s.height, d = c.width, f = c.height, p = l * i / d, m = u * i / f, h = l * a / d, g = u * a / f, _ = Math.min(h, g)
|
|
279
|
-
_ = Math.max(_,
|
|
280
|
-
let
|
|
281
|
-
return r === "width" ? _ = Math.max(p, Math.min(h, l / d)) : r === "height" ? _ = Math.max(m, Math.min(g, u / f)) :
|
|
278
|
+
let s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), l = s.width, u = s.height, d = c.width, f = c.height, p = l * i / d, m = u * i / f, h = l * a / d, g = u * a / f, _ = Math.min(h, g);
|
|
279
|
+
_ = Math.max(_, Math.max(p, m));
|
|
280
|
+
let v = d * _, y = f * _;
|
|
281
|
+
return r === "width" ? _ = Math.max(p, Math.min(h, l / d)) : r === "height" ? _ = Math.max(m, Math.min(g, u / f)) : v > l ? _ = Math.max(p, Math.min(h, l / d)) : y > u && (_ = Math.max(m, Math.min(g, u / f))), o.apply(e, [_, e]), _;
|
|
282
282
|
}
|
|
283
283
|
fitText(e, t = 1, n = {}) {
|
|
284
284
|
let r = parseFloat(getComputedStyle(e).getPropertyValue("font-size")), a = {
|
|
@@ -9280,14 +9280,16 @@ var T = class {
|
|
|
9280
9280
|
replaceEmotesWithHTML(e, t) {
|
|
9281
9281
|
if (!t.length) return e;
|
|
9282
9282
|
let n = "", r = 0;
|
|
9283
|
-
return t.filter((e) => e.type !== "emoji").forEach((t) => {
|
|
9283
|
+
return t.filter((e) => e.type !== "emoji").sort((e, t) => e.start - t.start).forEach((t) => {
|
|
9284
9284
|
if (t.start < r) return;
|
|
9285
9285
|
n += e.substring(r, t.start);
|
|
9286
9286
|
let i = Array.from({
|
|
9287
9287
|
...t.urls,
|
|
9288
9288
|
length: 5
|
|
9289
9289
|
}).slice(1).reverse().filter(Boolean)[0] || t.urls[1];
|
|
9290
|
-
n += `<img src="${i}" alt="${t.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;"
|
|
9290
|
+
n += `<img src="${i}" alt="${t.name}" class="emote" style="width: auto; height: 1em; vertical-align: middle;" />`;
|
|
9291
|
+
let a = t.start + t.name.length;
|
|
9292
|
+
r = t.end === a - 1 ? t.end + 1 : t.end;
|
|
9291
9293
|
}), n += e.substring(r), n;
|
|
9292
9294
|
}
|
|
9293
9295
|
hasOnlyEmotes(e, t) {
|
|
@@ -9704,8 +9706,8 @@ var M = class {
|
|
|
9704
9706
|
function m(e, t) {
|
|
9705
9707
|
let n = e?.trim?.() ?? "";
|
|
9706
9708
|
if (!n.length) return null;
|
|
9707
|
-
let r = t[n], i = r === void 0 ? n : r
|
|
9708
|
-
return isNaN(
|
|
9709
|
+
let r = t[n], i = parseFloat(String(r === void 0 ? n : r).replace(/\s/g, ""));
|
|
9710
|
+
return isNaN(i) ? null : i;
|
|
9709
9711
|
}
|
|
9710
9712
|
function h(e, t, n) {
|
|
9711
9713
|
let r = isNaN(Number(t)) ? 0 : Math.max(0, parseInt(String(t))), i = m(e, n);
|
|
@@ -9720,8 +9722,8 @@ var M = class {
|
|
|
9720
9722
|
}
|
|
9721
9723
|
}
|
|
9722
9724
|
function g(e, t = /* @__PURE__ */ new Date()) {
|
|
9723
|
-
let n = t.getTime() - e.getTime(), r = n >= 0, i = Math.abs(n), a = Math.floor(i /
|
|
9724
|
-
return
|
|
9725
|
+
let n = t.getTime() - e.getTime(), r = n >= 0, i = Math.floor(Math.abs(n) / 1e3), a = Math.floor(i / 60), o = Math.floor(a / 60), s = Math.floor(o / 24), c = Math.floor(s / 30), l = Math.floor(s / 365), u = r ? "ago" : "from now";
|
|
9726
|
+
return l > 0 ? `${l}y ${u}` : c > 0 ? `${c}mo ${u}` : s > 0 ? `${s}d ${u}` : o > 0 ? `${o}h ${u}` : a > 0 ? `${a}m ${u}` : `${Math.max(i, 0)}s ${u}`;
|
|
9725
9727
|
}
|
|
9726
9728
|
function _(e, t, n) {
|
|
9727
9729
|
let r = e?.trim?.() ?? "";
|
|
@@ -10311,7 +10313,7 @@ var M = class {
|
|
|
10311
10313
|
message: new T().array(e)[0]
|
|
10312
10314
|
};
|
|
10313
10315
|
}
|
|
10314
|
-
}, z = class {
|
|
10316
|
+
}, z = class e {
|
|
10315
10317
|
delay(e, t) {
|
|
10316
10318
|
return new Promise((n) => setTimeout(() => {
|
|
10317
10319
|
n(t ? t() ?? null : null);
|
|
@@ -10358,9 +10360,9 @@ var M = class {
|
|
|
10358
10360
|
isSameMoment: i === 0
|
|
10359
10361
|
};
|
|
10360
10362
|
}
|
|
10361
|
-
probability(
|
|
10362
|
-
let
|
|
10363
|
-
for (let [e, t] of
|
|
10363
|
+
probability(t) {
|
|
10364
|
+
let n = Object.values(t).reduce((e, t) => e + t, 0), r = new e().typedEntries(t).sort((e, t) => t[1] - e[1]), i = Math.random() * n, a = 0;
|
|
10365
|
+
for (let [e, t] of r) if (a += t, i < a) return e;
|
|
10364
10366
|
}
|
|
10365
10367
|
async findSubscriptionTier({ userId: e, name: t, broadcasterId: n }, r, i = !1) {
|
|
10366
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;
|
|
@@ -10474,9 +10476,105 @@ var M = class {
|
|
|
10474
10476
|
}
|
|
10475
10477
|
}
|
|
10476
10478
|
}
|
|
10479
|
+
}, ne = class {
|
|
10480
|
+
lerp(e, t, n) {
|
|
10481
|
+
let r = Math.max(0, Math.min(1, n));
|
|
10482
|
+
return e + (t - e) * r;
|
|
10483
|
+
}
|
|
10484
|
+
quadratic({ from: e, to: t, control: n, duration: r = 1, fps: i = 60, easing: a = (e) => e }) {
|
|
10485
|
+
let o = Math.max(2, Math.round(r * i)), s = [], c = [];
|
|
10486
|
+
for (let r = 0; r <= o; r++) {
|
|
10487
|
+
let i = a(r / o);
|
|
10488
|
+
s.push((1 - i) * (1 - i) * e.x + 2 * (1 - i) * i * n.x + i * i * t.x), c.push((1 - i) * (1 - i) * e.y + 2 * (1 - i) * i * n.y + i * i * t.y);
|
|
10489
|
+
}
|
|
10490
|
+
return {
|
|
10491
|
+
x: s,
|
|
10492
|
+
y: c
|
|
10493
|
+
};
|
|
10494
|
+
}
|
|
10495
|
+
cubic({ from: e, to: t, duration: n = 1, fps: r = 60, easing: i = (e) => e }) {
|
|
10496
|
+
let a = Math.max(2, Math.round(n * r)), o = [], s = [];
|
|
10497
|
+
for (let n = 0; n <= a; n++) {
|
|
10498
|
+
let r = i(n / a), c = 1 - r;
|
|
10499
|
+
o.push(c * c * c * e.x + 3 * c * c * r * e.control.x + 3 * c * r * r * t.control.x + r * r * r * t.x), s.push(c * c * c * e.y + 3 * c * c * r * e.control.y + 3 * c * r * r * t.control.y + r * r * r * t.y);
|
|
10500
|
+
}
|
|
10501
|
+
return {
|
|
10502
|
+
x: o,
|
|
10503
|
+
y: s
|
|
10504
|
+
};
|
|
10505
|
+
}
|
|
10506
|
+
getMultiCubicOutgoingControl(e, t) {
|
|
10507
|
+
let n = e.controlOut ?? e.control;
|
|
10508
|
+
if (n) return n;
|
|
10509
|
+
throw Error(t === 0 ? "The first multiCubic point requires `control` or `controlOut`." : `The multiCubic point at index ${t} requires \`controlOut\` or a shared \`control\`.`);
|
|
10510
|
+
}
|
|
10511
|
+
getMultiCubicIncomingControl(e, t, n) {
|
|
10512
|
+
let r = e.controlIn ?? e.control;
|
|
10513
|
+
if (r) return r;
|
|
10514
|
+
throw Error(t === n ? "The last multiCubic point requires `control` or `controlIn`." : `The multiCubic point at index ${t} requires \`controlIn\` or a shared \`control\`.`);
|
|
10515
|
+
}
|
|
10516
|
+
multiCubic({ points: e, duration: t = 1, fps: n = 60, easing: r = (e) => e }) {
|
|
10517
|
+
if (e.length < 3) throw Error("multiCubic requires at least 3 points.");
|
|
10518
|
+
let i = e.length - 1, a = e.length - 1, o = Math.max(2, Math.round(t * n)), s = Math.max(1, Math.floor(o / i)), c = o % i, l = [], u = [];
|
|
10519
|
+
for (let t = 0; t < i; t++) {
|
|
10520
|
+
let n = e[t], i = e[t + 1], o = this.getMultiCubicOutgoingControl(n, t), d = this.getMultiCubicIncomingControl(i, t + 1, a), f = s + (c > 0 ? 1 : 0);
|
|
10521
|
+
c > 0 && c--;
|
|
10522
|
+
let p = t === 0 ? 0 : 1;
|
|
10523
|
+
for (let e = p; e <= f; e++) {
|
|
10524
|
+
let t = r(e / f), a = 1 - t;
|
|
10525
|
+
l.push(a * a * a * n.x + 3 * a * a * t * o.x + 3 * a * t * t * d.x + t * t * t * i.x), u.push(a * a * a * n.y + 3 * a * a * t * o.y + 3 * a * t * t * d.y + t * t * t * i.y);
|
|
10526
|
+
}
|
|
10527
|
+
}
|
|
10528
|
+
return {
|
|
10529
|
+
x: l,
|
|
10530
|
+
y: u
|
|
10531
|
+
};
|
|
10532
|
+
}
|
|
10533
|
+
circle({ center: e, radius: t, from: n = 0, to: r = 360, duration: i = 1, fps: a = 60, easing: o = (e) => e }) {
|
|
10534
|
+
let s = Math.max(2, Math.round(i * a)), c = [], l = [];
|
|
10535
|
+
for (let i = 0; i <= s; i++) {
|
|
10536
|
+
let a = o(i / s), u = (n + (r - n) * a) * Math.PI / 180;
|
|
10537
|
+
c.push(e.x + t * Math.cos(u)), l.push(e.y + t * Math.sin(u));
|
|
10538
|
+
}
|
|
10539
|
+
return {
|
|
10540
|
+
x: c,
|
|
10541
|
+
y: l
|
|
10542
|
+
};
|
|
10543
|
+
}
|
|
10544
|
+
spiral({ center: e, radius: t, turns: n = 1, duration: r = 1, fps: i = 60, easing: a = (e) => e }) {
|
|
10545
|
+
let o = Math.max(2, Math.round(r * i)), s = [], c = [];
|
|
10546
|
+
for (let r = 0; r <= o; r++) {
|
|
10547
|
+
let i = a(r / o), l = this.lerp(t.from, t.to, i), u = i * n * 360 * Math.PI / 180;
|
|
10548
|
+
s.push(e.x + l * Math.cos(u)), c.push(e.y + l * Math.sin(u));
|
|
10549
|
+
}
|
|
10550
|
+
return {
|
|
10551
|
+
x: s,
|
|
10552
|
+
y: c
|
|
10553
|
+
};
|
|
10554
|
+
}
|
|
10555
|
+
chain(...e) {
|
|
10556
|
+
let t = [], n = [];
|
|
10557
|
+
for (let r of e) t.push(...r.x), n.push(...r.y);
|
|
10558
|
+
return {
|
|
10559
|
+
x: t,
|
|
10560
|
+
y: n
|
|
10561
|
+
};
|
|
10562
|
+
}
|
|
10563
|
+
sequence(e, t = 0) {
|
|
10564
|
+
let n = [], r = [], i = Array.isArray(t) ? t : e.map(() => t);
|
|
10565
|
+
for (let t = 0; t < e.length; t++) {
|
|
10566
|
+
let a = e[t], o = i[t] ?? 0;
|
|
10567
|
+
for (let e = 0; e < o; e++) n.push(a.x[0]), r.push(a.y[0]);
|
|
10568
|
+
n.push(...a.x), r.push(...a.y);
|
|
10569
|
+
}
|
|
10570
|
+
return {
|
|
10571
|
+
x: n,
|
|
10572
|
+
y: r
|
|
10573
|
+
};
|
|
10574
|
+
}
|
|
10477
10575
|
}, B;
|
|
10478
10576
|
(function(e) {
|
|
10479
|
-
e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new N(), e.sound = new P(), e.color = new M(), e.random = new T(), e.fn = new F(), e.utils = new z();
|
|
10577
|
+
e.animate = new ne(), e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new N(), e.sound = new P(), e.color = new M(), e.random = new T(), e.fn = new F(), e.utils = new z();
|
|
10480
10578
|
})(B ||= {});
|
|
10481
10579
|
//#endregion
|
|
10482
10580
|
//#region src/actions/button.ts
|
|
@@ -10597,7 +10695,7 @@ var V = [], H = class e {
|
|
|
10597
10695
|
return !1;
|
|
10598
10696
|
}
|
|
10599
10697
|
}
|
|
10600
|
-
}, G = [],
|
|
10698
|
+
}, G = [], re = class extends e {
|
|
10601
10699
|
constructor(e = {}) {
|
|
10602
10700
|
super(), this.SE_API = null, this.id = "widget communications", this.loaded = !1, this.history = [], this.detected = /* @__PURE__ */ new Set(), this.id = e.id || this.id, G.push(this), Z?.then(async (e) => {
|
|
10603
10701
|
this.loaded = !0, this.SE_API = e, Promise.all([async () => {
|
|
@@ -12666,7 +12764,7 @@ var J = class {
|
|
|
12666
12764
|
timeEnd(e) {
|
|
12667
12765
|
!this.enabled || !console.timeEnd || console.timeEnd(e);
|
|
12668
12766
|
}
|
|
12669
|
-
},
|
|
12767
|
+
}, ie = class extends e {
|
|
12670
12768
|
constructor(e, t) {
|
|
12671
12769
|
super(), this.isDebug = !1, this.init = !1, this.emulate = !1, this.username = e.username, this.password = e.password, this.channels = e.channels, this.isDebug = !!e.isDebug, this.init = !!e.init, this.emulate = t, this.load().then((e) => {
|
|
12672
12770
|
this.instance = e, this.emit("load", e), this.connect();
|
|
@@ -12838,7 +12936,7 @@ var J = class {
|
|
|
12838
12936
|
list: {}
|
|
12839
12937
|
}
|
|
12840
12938
|
};
|
|
12841
|
-
async function
|
|
12939
|
+
async function ae() {
|
|
12842
12940
|
let e = localStorage.getItem("SE_API-STORE") ?? "", t = e ? JSON.parse(e) : {};
|
|
12843
12941
|
return Y.store.list = t, Y;
|
|
12844
12942
|
}
|
|
@@ -12893,7 +12991,7 @@ var X;
|
|
|
12893
12991
|
})(X ||= {});
|
|
12894
12992
|
//#endregion
|
|
12895
12993
|
//#region src/main.ts
|
|
12896
|
-
var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(
|
|
12994
|
+
var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ae()), Q = new J(), $ = {
|
|
12897
12995
|
SeAPI: Z,
|
|
12898
12996
|
Client: r,
|
|
12899
12997
|
Helper: B,
|
|
@@ -12905,14 +13003,14 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ie()), Q
|
|
|
12905
13003
|
useStorage: n,
|
|
12906
13004
|
useQueue: K,
|
|
12907
13005
|
useLogger: J,
|
|
12908
|
-
useComms:
|
|
13006
|
+
useComms: re,
|
|
12909
13007
|
FakeUserPool: te
|
|
12910
13008
|
},
|
|
12911
13009
|
actions: {
|
|
12912
13010
|
Button: H,
|
|
12913
13011
|
Command: W
|
|
12914
13012
|
},
|
|
12915
|
-
multistream: { useComfyJs:
|
|
13013
|
+
multistream: { useComfyJs: ie },
|
|
12916
13014
|
internal: {
|
|
12917
13015
|
usedStorages: t,
|
|
12918
13016
|
usedComms: G,
|
|
@@ -12925,8 +13023,8 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ie()), Q
|
|
|
12925
13023
|
typeof window < "u" ? window.Tixyel = $ : globalThis.Tixyel = $;
|
|
12926
13024
|
//#endregion
|
|
12927
13025
|
//#region src/index.ts
|
|
12928
|
-
var
|
|
13026
|
+
var oe = $;
|
|
12929
13027
|
//#endregion
|
|
12930
|
-
export {
|
|
13028
|
+
export { oe as default };
|
|
12931
13029
|
|
|
12932
13030
|
//# sourceMappingURL=index.es.js.map
|