@kubohiroya/turbowarp-bubble 0.1.1 → 0.3.0
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/README.md +355 -79
- package/dist/composition.js +972 -597
- package/dist/extension-manifest.json +240 -16
- package/dist/turbowarp-adapter.js +1728 -626
- package/dist/turbowarp-bubble.js +2811 -233
- package/dist/types/bubble-svg.d.ts +10 -0
- package/dist/types/composition.d.ts +96 -18
- package/dist/types/reveal.d.ts +26 -0
- package/dist/types/turbowarp-adapter.d.ts +12 -2
- package/docs/assets/animation-mode-guide.svg +5 -14
- package/docs/assets/block-quick-start.svg +8 -8
- package/docs/assets/bubble-lifecycle.gif +0 -0
- package/docs/block-manual.ja.md +88 -47
- package/docs/block-manual.md +95 -54
- package/docs/index.html +103 -39
- package/docs/ja/index.html +95 -31
- package/package.json +20 -7
|
@@ -185,7 +185,7 @@ function C(e) {
|
|
|
185
185
|
scalePercent: r
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function w(e) {
|
|
189
189
|
let t = (e.bounds.left + e.bounds.right) / 2, n = (e.bounds.top + e.bounds.bottom) / 2, r = v(e.direction), i = e.distance + e.tailLength, a = r.x < 0 ? t - e.bounds.left + i + e.bubbleWidth / 2 : e.bounds.right - t + i + e.bubbleWidth / 2, o = r.y < 0 ? n - e.bounds.bottom + i + e.bubbleHeight / 2 : e.bounds.top - n + i + e.bubbleHeight / 2, s = Math.min(r.x === 0 ? Infinity : a / Math.abs(r.x), r.y === 0 ? Infinity : o / Math.abs(r.y));
|
|
190
190
|
return Object.freeze({
|
|
191
191
|
x: t + r.x * s + e.offset.x,
|
|
@@ -194,7 +194,7 @@ function ee(e) {
|
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
196
|
//#region node_modules/.pnpm/jsclipper@https+++codeload.github.com+platener+jsclipper+tar.gz+56aed19845113e1939d8971c47233054659436b1/node_modules/jsclipper/jsclipper.js
|
|
197
|
-
var
|
|
197
|
+
var T = /* @__PURE__ */ o(((e, t) => {
|
|
198
198
|
(function() {
|
|
199
199
|
var e = {}, n = !1;
|
|
200
200
|
t !== void 0 && t.exports ? (t.exports = e, n = !0) : typeof document < "u" ? window.ClipperLib = e : self.ClipperLib = e;
|
|
@@ -283,10 +283,10 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
283
283
|
}
|
|
284
284
|
n == 8 && e[0] & 128 && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)), this.clamp(), i && c.ZERO.subTo(this, this);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function w() {
|
|
287
287
|
for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e;) --this.t;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function T(e) {
|
|
290
290
|
if (this.s < 0) return "-" + this.negate().toString(e);
|
|
291
291
|
var t;
|
|
292
292
|
if (e == 16) t = 4;
|
|
@@ -299,14 +299,14 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
299
299
|
if (o-- > 0) for (s < this.DB && (r = this[o] >> s) > 0 && (i = !0, a = v(r)); o >= 0;) s < t ? (r = (this[o] & (1 << s) - 1) << t - s, r |= this[--o] >> (s += this.DB - t)) : (r = this[o] >> (s -= t) & n, s <= 0 && (s += this.DB, --o)), r > 0 && (i = !0), i && (a += v(r));
|
|
300
300
|
return i ? a : "0";
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function E() {
|
|
303
303
|
var e = l();
|
|
304
304
|
return c.ZERO.subTo(this, e), e;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function D() {
|
|
307
307
|
return this.s < 0 ? this.negate() : this;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function O(e) {
|
|
310
310
|
var t = this.s - e.s;
|
|
311
311
|
if (t != 0) return t;
|
|
312
312
|
var n = this.t;
|
|
@@ -314,30 +314,30 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
314
314
|
for (; --n >= 0;) if ((t = this[n] - e[n]) != 0) return t;
|
|
315
315
|
return 0;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function k(e) {
|
|
318
318
|
var t = 1, n;
|
|
319
319
|
return (n = e >>> 16) != 0 && (e = n, t += 16), (n = e >> 8) != 0 && (e = n, t += 8), (n = e >> 4) != 0 && (e = n, t += 4), (n = e >> 2) != 0 && (e = n, t += 2), (n = e >> 1) != 0 && (e = n, t += 1), t;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
return this.t <= 0 ? 0 : this.DB * (this.t - 1) +
|
|
321
|
+
function A() {
|
|
322
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + k(this[this.t - 1] ^ this.s & this.DM);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function j(e, t) {
|
|
325
325
|
var n;
|
|
326
326
|
for (n = this.t - 1; n >= 0; --n) t[n + e] = this[n];
|
|
327
327
|
for (n = e - 1; n >= 0; --n) t[n] = 0;
|
|
328
328
|
t.t = this.t + e, t.s = this.s;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function M(e, t) {
|
|
331
331
|
for (var n = e; n < this.t; ++n) t[n - e] = this[n];
|
|
332
332
|
t.t = Math.max(this.t - e, 0), t.s = this.s;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function N(e, t) {
|
|
335
335
|
var n = e % this.DB, r = this.DB - n, i = (1 << r) - 1, a = Math.floor(e / this.DB), o = this.s << n & this.DM, s;
|
|
336
336
|
for (s = this.t - 1; s >= 0; --s) t[s + a + 1] = this[s] >> r | o, o = (this[s] & i) << n;
|
|
337
337
|
for (s = a - 1; s >= 0; --s) t[s] = 0;
|
|
338
338
|
t[a] = o, t.t = this.t + a + 1, t.s = this.s, t.clamp();
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ee(e, t) {
|
|
341
341
|
t.s = this.s;
|
|
342
342
|
var n = Math.floor(e / this.DB);
|
|
343
343
|
if (n >= this.t) {
|
|
@@ -349,7 +349,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
349
349
|
for (var o = n + 1; o < this.t; ++o) t[o - n - 1] |= (this[o] & a) << i, t[o - n] = this[o] >> r;
|
|
350
350
|
r > 0 && (t[this.t - n - 1] |= (this.s & a) << i), t.t = this.t - n, t.clamp();
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function P(e, t) {
|
|
353
353
|
for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] - e[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
354
354
|
if (e.t < this.t) {
|
|
355
355
|
for (r -= e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
@@ -360,13 +360,13 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
360
360
|
}
|
|
361
361
|
t.s = r < 0 ? -1 : 0, r < -1 ? t[n++] = this.DV + r : r > 0 && (t[n++] = r), t.t = n, t.clamp();
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function te(e, t) {
|
|
364
364
|
var n = this.abs(), r = e.abs(), i = n.t;
|
|
365
365
|
for (t.t = i + r.t; --i >= 0;) t[i] = 0;
|
|
366
366
|
for (i = 0; i < r.t; ++i) t[i + n.t] = n.am(0, r[i], t, i, 0, n.t);
|
|
367
367
|
t.s = 0, t.clamp(), this.s != e.s && c.ZERO.subTo(t, t);
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function ne(e) {
|
|
370
370
|
for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) e[n] = 0;
|
|
371
371
|
for (n = 0; n < t.t - 1; ++n) {
|
|
372
372
|
var r = t.am(n, t[n], e, 2 * n, 0, 1);
|
|
@@ -374,7 +374,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
374
374
|
}
|
|
375
375
|
e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1)), e.s = 0, e.clamp();
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function re(e, t, n) {
|
|
378
378
|
var r = e.abs();
|
|
379
379
|
if (!(r.t <= 0)) {
|
|
380
380
|
var i = this.abs();
|
|
@@ -383,7 +383,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
383
383
|
return;
|
|
384
384
|
}
|
|
385
385
|
n ??= l();
|
|
386
|
-
var a = l(), o = this.s, s = e.s, u = this.DB -
|
|
386
|
+
var a = l(), o = this.s, s = e.s, u = this.DB - k(r[r.t - 1]);
|
|
387
387
|
u > 0 ? (r.lShiftTo(u, a), i.lShiftTo(u, n)) : (r.copyTo(a), i.copyTo(n));
|
|
388
388
|
var d = a.t, f = a[d - 1];
|
|
389
389
|
if (f != 0) {
|
|
@@ -397,48 +397,48 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function ie(e) {
|
|
401
401
|
var t = l();
|
|
402
402
|
return this.abs().divRemTo(e, null, t), this.s < 0 && t.compareTo(c.ZERO) > 0 && e.subTo(t, t), t;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function F(e) {
|
|
405
405
|
this.m = e;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function I(e) {
|
|
408
408
|
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function L(e) {
|
|
411
411
|
return e;
|
|
412
412
|
}
|
|
413
413
|
function R(e) {
|
|
414
414
|
e.divRemTo(this.m, null, e);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function ae(e, t, n) {
|
|
417
417
|
e.multiplyTo(t, n), this.reduce(n);
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function oe(e, t) {
|
|
420
420
|
e.squareTo(t), this.reduce(t);
|
|
421
421
|
}
|
|
422
|
-
|
|
423
|
-
function
|
|
422
|
+
F.prototype.convert = I, F.prototype.revert = L, F.prototype.reduce = R, F.prototype.mulTo = ae, F.prototype.sqrTo = oe;
|
|
423
|
+
function se() {
|
|
424
424
|
if (this.t < 1) return 0;
|
|
425
425
|
var e = this[0];
|
|
426
426
|
if (!(e & 1)) return 0;
|
|
427
427
|
var t = e & 3;
|
|
428
428
|
return t = t * (2 - (e & 15) * t) & 15, t = t * (2 - (e & 255) * t) & 255, t = t * (2 - ((e & 65535) * t & 65535)) & 65535, t = t * (2 - e * t % this.DV) % this.DV, t > 0 ? this.DV - t : -t;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function ce(e) {
|
|
431
431
|
this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function le(e) {
|
|
434
434
|
var t = l();
|
|
435
435
|
return e.abs().dlShiftTo(this.m.t, t), t.divRemTo(this.m, null, t), e.s < 0 && t.compareTo(c.ZERO) > 0 && this.m.subTo(t, t), t;
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function ue(e) {
|
|
438
438
|
var t = l();
|
|
439
439
|
return e.copyTo(t), this.reduce(t), t;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function de(e) {
|
|
442
442
|
for (; e.t <= this.mt2;) e[e.t++] = 0;
|
|
443
443
|
for (var t = 0; t < this.m.t; ++t) {
|
|
444
444
|
var n = e[t] & 32767, r = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
|
|
@@ -446,19 +446,19 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
446
446
|
}
|
|
447
447
|
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function fe(e, t) {
|
|
450
450
|
e.squareTo(t), this.reduce(t);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function pe(e, t, n) {
|
|
453
453
|
e.multiplyTo(t, n), this.reduce(n);
|
|
454
454
|
}
|
|
455
|
-
|
|
456
|
-
function
|
|
455
|
+
ce.prototype.convert = le, ce.prototype.revert = ue, ce.prototype.reduce = de, ce.prototype.mulTo = pe, ce.prototype.sqrTo = fe;
|
|
456
|
+
function me() {
|
|
457
457
|
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function he(e, t) {
|
|
460
460
|
if (e > 4294967295 || e < 1) return c.ONE;
|
|
461
|
-
var n = l(), r = l(), i = t.convert(this), a =
|
|
461
|
+
var n = l(), r = l(), i = t.convert(this), a = k(e) - 1;
|
|
462
462
|
for (i.copyTo(n); --a >= 0;) if (t.sqrTo(n, r), (e & 1 << a) > 0) t.mulTo(r, i, n);
|
|
463
463
|
else {
|
|
464
464
|
var o = n;
|
|
@@ -466,16 +466,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
466
466
|
}
|
|
467
467
|
return t.revert(n);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
var n = e < 256 || t.isEven() ? new
|
|
469
|
+
function ge(e, t) {
|
|
470
|
+
var n = e < 256 || t.isEven() ? new F(t) : new ce(t);
|
|
471
471
|
return this.exp(e, n);
|
|
472
472
|
}
|
|
473
|
-
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp =
|
|
474
|
-
function
|
|
473
|
+
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = j, c.prototype.drShiftTo = M, c.prototype.lShiftTo = N, c.prototype.rShiftTo = ee, c.prototype.subTo = P, c.prototype.multiplyTo = te, c.prototype.squareTo = ne, c.prototype.divRemTo = re, c.prototype.invDigit = se, c.prototype.isEven = me, c.prototype.exp = he, c.prototype.toString = T, c.prototype.negate = E, c.prototype.abs = D, c.prototype.compareTo = O, c.prototype.bitLength = A, c.prototype.mod = ie, c.prototype.modPowInt = ge, c.ZERO = S(0), c.ONE = S(1);
|
|
474
|
+
function _e() {
|
|
475
475
|
var e = l();
|
|
476
476
|
return this.copyTo(e), e;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function ve() {
|
|
479
479
|
if (this.s < 0) {
|
|
480
480
|
if (this.t == 1) return this[0] - this.DV;
|
|
481
481
|
if (this.t == 0) return -1;
|
|
@@ -483,25 +483,25 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
483
483
|
else if (this.t == 0) return 0;
|
|
484
484
|
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function z() {
|
|
487
487
|
return this.t == 0 ? this.s : this[0] << 24 >> 24;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function ye() {
|
|
490
490
|
return this.t == 0 ? this.s : this[0] << 16 >> 16;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function be(e) {
|
|
493
493
|
return Math.floor(Math.LN2 * this.DB / Math.log(e));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function xe() {
|
|
496
496
|
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Se(e) {
|
|
499
499
|
if (e ??= 10, this.signum() == 0 || e < 2 || e > 36) return "0";
|
|
500
500
|
var t = this.chunkSize(e), n = e ** +t, r = S(n), i = l(), a = l(), o = "";
|
|
501
501
|
for (this.divRemTo(r, i, a); i.signum() > 0;) o = (n + a.intValue()).toString(e).substr(1) + o, i.divRemTo(r, i, a);
|
|
502
502
|
return a.intValue().toString(e) + o;
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function Ce(e, t) {
|
|
505
505
|
this.fromInt(0), t ??= 10;
|
|
506
506
|
for (var n = this.chunkSize(t), r = t ** +n, i = !1, a = 0, o = 0, s = 0; s < e.length; ++s) {
|
|
507
507
|
var l = y(e, s);
|
|
@@ -513,32 +513,32 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
513
513
|
}
|
|
514
514
|
a > 0 && (this.dMultiply(t ** +a), this.dAddOffset(o, 0)), i && c.ZERO.subTo(this, this);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function we(e, t, n) {
|
|
517
517
|
if (typeof t == "number") {
|
|
518
518
|
if (e < 2) this.fromInt(1);
|
|
519
|
-
else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1),
|
|
519
|
+
else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), V, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
|
|
520
520
|
} else {
|
|
521
521
|
var r = [], i = e & 7;
|
|
522
522
|
r.length = (e >> 3) + 1, t.nextBytes(r), i > 0 ? r[0] &= (1 << i) - 1 : r[0] = 0, this.fromString(r, 256);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Te() {
|
|
526
526
|
var e = this.t, t = [];
|
|
527
527
|
t[0] = this.s;
|
|
528
528
|
var n = this.DB - e * this.DB % 8, r, i = 0;
|
|
529
529
|
if (e-- > 0) for (n < this.DB && (r = this[e] >> n) != (this.s & this.DM) >> n && (t[i++] = r | this.s << this.DB - n); e >= 0;) n < 8 ? (r = (this[e] & (1 << n) - 1) << 8 - n, r |= this[--e] >> (n += this.DB - 8)) : (r = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --e)), r & 128 && (r |= -256), i == 0 && (this.s & 128) != (r & 128) && ++i, (i > 0 || r != this.s) && (t[i++] = r);
|
|
530
530
|
return t;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ee(e) {
|
|
533
533
|
return this.compareTo(e) == 0;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function De(e) {
|
|
536
536
|
return this.compareTo(e) < 0 ? this : e;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Oe(e) {
|
|
539
539
|
return this.compareTo(e) > 0 ? this : e;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function ke(e, t, n) {
|
|
542
542
|
var r, i, a = Math.min(e.t, this.t);
|
|
543
543
|
for (r = 0; r < a; ++r) n[r] = t(this[r], e[r]);
|
|
544
544
|
if (e.t < this.t) {
|
|
@@ -550,81 +550,81 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
550
550
|
}
|
|
551
551
|
n.s = t(this.s, e.s), n.clamp();
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function Ae(e, t) {
|
|
554
554
|
return e & t;
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function B(e) {
|
|
557
557
|
var t = l();
|
|
558
|
-
return this.bitwiseTo(e,
|
|
558
|
+
return this.bitwiseTo(e, Ae, t), t;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function V(e, t) {
|
|
561
561
|
return e | t;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function je(e) {
|
|
564
564
|
var t = l();
|
|
565
|
-
return this.bitwiseTo(e,
|
|
565
|
+
return this.bitwiseTo(e, V, t), t;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Me(e, t) {
|
|
568
568
|
return e ^ t;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Ne(e) {
|
|
571
571
|
var t = l();
|
|
572
|
-
return this.bitwiseTo(e,
|
|
572
|
+
return this.bitwiseTo(e, Me, t), t;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Pe(e, t) {
|
|
575
575
|
return e & ~t;
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function Fe(e) {
|
|
578
578
|
var t = l();
|
|
579
|
-
return this.bitwiseTo(e,
|
|
579
|
+
return this.bitwiseTo(e, Pe, t), t;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Ie() {
|
|
582
582
|
for (var e = l(), t = 0; t < this.t; ++t) e[t] = this.DM & ~this[t];
|
|
583
583
|
return e.t = this.t, e.s = ~this.s, e;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function H(e) {
|
|
586
586
|
var t = l();
|
|
587
587
|
return e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function Le(e) {
|
|
590
590
|
var t = l();
|
|
591
591
|
return e < 0 ? this.lShiftTo(-e, t) : this.rShiftTo(e, t), t;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Re(e) {
|
|
594
594
|
if (e == 0) return -1;
|
|
595
595
|
var t = 0;
|
|
596
596
|
return e & 65535 || (e >>= 16, t += 16), e & 255 || (e >>= 8, t += 8), e & 15 || (e >>= 4, t += 4), e & 3 || (e >>= 2, t += 2), e & 1 || ++t, t;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB +
|
|
598
|
+
function ze() {
|
|
599
|
+
for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Re(this[e]);
|
|
600
600
|
return this.s < 0 ? this.t * this.DB : -1;
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Be(e) {
|
|
603
603
|
for (var t = 0; e != 0;) e &= e - 1, ++t;
|
|
604
604
|
return t;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e +=
|
|
606
|
+
function U() {
|
|
607
|
+
for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += Be(this[n] ^ t);
|
|
608
608
|
return e;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Ve(e) {
|
|
611
611
|
var t = Math.floor(e / this.DB);
|
|
612
612
|
return t >= this.t ? this.s != 0 : !!(this[t] & 1 << e % this.DB);
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function He(e, t) {
|
|
615
615
|
var n = c.ONE.shiftLeft(e);
|
|
616
616
|
return this.bitwiseTo(n, t, n), n;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
return this.changeBit(e,
|
|
618
|
+
function Ue(e) {
|
|
619
|
+
return this.changeBit(e, V);
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
return this.changeBit(e,
|
|
621
|
+
function We(e) {
|
|
622
|
+
return this.changeBit(e, Pe);
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return this.changeBit(e,
|
|
624
|
+
function Ge(e) {
|
|
625
|
+
return this.changeBit(e, Me);
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function Ke(e, t) {
|
|
628
628
|
for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] + e[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
629
629
|
if (e.t < this.t) {
|
|
630
630
|
for (r += e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
@@ -635,58 +635,58 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
635
635
|
}
|
|
636
636
|
t.s = r < 0 ? -1 : 0, r > 0 ? t[n++] = r : r < -1 && (t[n++] = this.DV + r), t.t = n, t.clamp();
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function qe(e) {
|
|
639
639
|
var t = l();
|
|
640
640
|
return this.addTo(e, t), t;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Je(e) {
|
|
643
643
|
var t = l();
|
|
644
644
|
return this.subTo(e, t), t;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ye(e) {
|
|
647
647
|
var t = l();
|
|
648
648
|
return this.multiplyTo(e, t), t;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function Xe() {
|
|
651
651
|
var e = l();
|
|
652
652
|
return this.squareTo(e), e;
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function Ze(e) {
|
|
655
655
|
var t = l();
|
|
656
656
|
return this.divRemTo(e, t, null), t;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Qe(e) {
|
|
659
659
|
var t = l();
|
|
660
660
|
return this.divRemTo(e, null, t), t;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function $e(e) {
|
|
663
663
|
var t = l(), n = l();
|
|
664
664
|
return this.divRemTo(e, t, n), [t, n];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function et(e) {
|
|
667
667
|
this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function tt(e, t) {
|
|
670
670
|
if (e != 0) {
|
|
671
671
|
for (; this.t <= t;) this[this.t++] = 0;
|
|
672
672
|
for (this[t] += e; this[t] >= this.DV;) this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t];
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
function
|
|
675
|
+
function nt() {}
|
|
676
|
+
function rt(e) {
|
|
677
677
|
return e;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function it(e, t, n) {
|
|
680
680
|
e.multiplyTo(t, n);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function at(e, t) {
|
|
683
683
|
e.squareTo(t);
|
|
684
684
|
}
|
|
685
|
-
|
|
686
|
-
function
|
|
687
|
-
return this.exp(e, new
|
|
685
|
+
nt.prototype.convert = rt, nt.prototype.revert = rt, nt.prototype.mulTo = it, nt.prototype.sqrTo = at;
|
|
686
|
+
function ot(e) {
|
|
687
|
+
return this.exp(e, new nt());
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function st(e, t, n) {
|
|
690
690
|
var r = Math.min(this.t + e.t, t);
|
|
691
691
|
for (n.s = 0, n.t = r; r > 0;) n[--r] = 0;
|
|
692
692
|
var i;
|
|
@@ -694,47 +694,47 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
694
694
|
for (i = Math.min(e.t, t); r < i; ++r) this.am(0, e[r], n, r, 0, t - r);
|
|
695
695
|
n.clamp();
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function ct(e, t, n) {
|
|
698
698
|
--t;
|
|
699
699
|
var r = n.t = this.t + e.t - t;
|
|
700
700
|
for (n.s = 0; --r >= 0;) n[r] = 0;
|
|
701
701
|
for (r = Math.max(t - this.t, 0); r < e.t; ++r) n[this.t + r - t] = this.am(t - r, e[r], n, 0, 0, this.t + r - t);
|
|
702
702
|
n.clamp(), n.drShiftTo(1, n);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function lt(e) {
|
|
705
705
|
this.r2 = l(), this.q3 = l(), c.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function ut(e) {
|
|
708
708
|
if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
|
|
709
709
|
if (e.compareTo(this.m) < 0) return e;
|
|
710
710
|
var t = l();
|
|
711
711
|
return e.copyTo(t), this.reduce(t), t;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function dt(e) {
|
|
714
714
|
return e;
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function ft(e) {
|
|
717
717
|
for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) e.dAddOffset(1, this.m.t + 1);
|
|
718
718
|
for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) e.subTo(this.m, e);
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function pt(e, t) {
|
|
721
721
|
e.squareTo(t), this.reduce(t);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function mt(e, t, n) {
|
|
724
724
|
e.multiplyTo(t, n), this.reduce(n);
|
|
725
725
|
}
|
|
726
|
-
|
|
727
|
-
function
|
|
726
|
+
lt.prototype.convert = ut, lt.prototype.revert = dt, lt.prototype.reduce = ft, lt.prototype.mulTo = mt, lt.prototype.sqrTo = pt;
|
|
727
|
+
function ht(e, t) {
|
|
728
728
|
var n = e.bitLength(), r, i = S(1), a;
|
|
729
729
|
if (n <= 0) return i;
|
|
730
|
-
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new
|
|
730
|
+
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new F(t) : t.isEven() ? new lt(t) : new ce(t);
|
|
731
731
|
var o = [], s = 3, c = r - 1, u = (1 << r) - 1;
|
|
732
732
|
if (o[1] = a.convert(this), r > 1) {
|
|
733
733
|
var d = l();
|
|
734
734
|
for (a.sqrTo(o[1], d); s <= u;) o[s] = l(), a.mulTo(d, o[s - 2], o[s]), s += 2;
|
|
735
735
|
}
|
|
736
736
|
var f = e.t - 1, p, m = !0, h = l(), g;
|
|
737
|
-
for (n =
|
|
737
|
+
for (n = k(e[f]) - 1; f >= 0;) {
|
|
738
738
|
for (n >= c ? p = e[f] >> n - c & u : (p = (e[f] & (1 << n + 1) - 1) << c - n, f > 0 && (p |= e[f - 1] >> this.DB + n - c)), s = r; !(p & 1);) p >>= 1, --s;
|
|
739
739
|
if ((n -= s) < 0 && (n += this.DB, --f), m) o[p].copyTo(i), m = !1;
|
|
740
740
|
else {
|
|
@@ -745,7 +745,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
745
745
|
}
|
|
746
746
|
return a.revert(i);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function gt(e) {
|
|
749
749
|
var t = this.s < 0 ? this.negate() : this.clone(), n = e.s < 0 ? e.negate() : e.clone();
|
|
750
750
|
if (t.compareTo(n) < 0) {
|
|
751
751
|
var r = t;
|
|
@@ -756,7 +756,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
756
756
|
for (i < a && (a = i), a > 0 && (t.rShiftTo(a, t), n.rShiftTo(a, n)); t.signum() > 0;) (i = t.getLowestSetBit()) > 0 && t.rShiftTo(i, t), (i = n.getLowestSetBit()) > 0 && n.rShiftTo(i, n), t.compareTo(n) >= 0 ? (t.subTo(n, t), t.rShiftTo(1, t)) : (n.subTo(t, n), n.rShiftTo(1, n));
|
|
757
757
|
return a > 0 && n.lShiftTo(a, n), n;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function _t(e) {
|
|
760
760
|
if (e <= 0) return 0;
|
|
761
761
|
var t = this.DV % e, n = this.s < 0 ? e - 1 : 0;
|
|
762
762
|
if (this.t > 0) {
|
|
@@ -765,7 +765,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
765
765
|
}
|
|
766
766
|
return n;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function vt(e) {
|
|
769
769
|
var t = e.isEven();
|
|
770
770
|
if (this.isEven() && t || e.signum() == 0) return c.ZERO;
|
|
771
771
|
for (var n = e.clone(), r = this.clone(), i = S(1), a = S(0), o = S(0), s = S(1); n.signum() != 0;) {
|
|
@@ -779,7 +779,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
779
779
|
else return s;
|
|
780
780
|
return s.signum() < 0 ? s.add(e) : s;
|
|
781
781
|
}
|
|
782
|
-
var
|
|
782
|
+
var W = [
|
|
783
783
|
2,
|
|
784
784
|
3,
|
|
785
785
|
5,
|
|
@@ -948,27 +948,27 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
948
948
|
983,
|
|
949
949
|
991,
|
|
950
950
|
997
|
|
951
|
-
],
|
|
952
|
-
function
|
|
951
|
+
], yt = (1 << 26) / W[W.length - 1];
|
|
952
|
+
function bt(e) {
|
|
953
953
|
var t, n = this.abs();
|
|
954
|
-
if (n.t == 1 && n[0] <=
|
|
955
|
-
for (t = 0; t <
|
|
954
|
+
if (n.t == 1 && n[0] <= W[W.length - 1]) {
|
|
955
|
+
for (t = 0; t < W.length; ++t) if (n[0] == W[t]) return !0;
|
|
956
956
|
return !1;
|
|
957
957
|
}
|
|
958
958
|
if (n.isEven()) return !1;
|
|
959
|
-
for (t = 1; t <
|
|
960
|
-
for (var r =
|
|
961
|
-
for (r = n.modInt(r); t < i;) if (r %
|
|
959
|
+
for (t = 1; t < W.length;) {
|
|
960
|
+
for (var r = W[t], i = t + 1; i < W.length && r < yt;) r *= W[i++];
|
|
961
|
+
for (r = n.modInt(r); t < i;) if (r % W[t++] == 0) return !1;
|
|
962
962
|
}
|
|
963
963
|
return n.millerRabin(e);
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function xt(e) {
|
|
966
966
|
var t = this.subtract(c.ONE), n = t.getLowestSetBit();
|
|
967
967
|
if (n <= 0) return !1;
|
|
968
968
|
var r = t.shiftRight(n);
|
|
969
|
-
e = e + 1 >> 1, e >
|
|
969
|
+
e = e + 1 >> 1, e > W.length && (e = W.length);
|
|
970
970
|
for (var i = l(), a = 0; a < e; ++a) {
|
|
971
|
-
i.fromInt(
|
|
971
|
+
i.fromInt(W[Math.floor(Math.random() * W.length)]);
|
|
972
972
|
var o = i.modPow(r, this);
|
|
973
973
|
if (o.compareTo(c.ONE) != 0 && o.compareTo(t) != 0) {
|
|
974
974
|
for (var s = 1; s++ < n && o.compareTo(t) != 0;) if (o = o.modPowInt(2, this), o.compareTo(c.ONE) == 0) return !1;
|
|
@@ -977,29 +977,29 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
977
977
|
}
|
|
978
978
|
return !0;
|
|
979
979
|
}
|
|
980
|
-
c.prototype.chunkSize =
|
|
981
|
-
var
|
|
982
|
-
if (
|
|
983
|
-
return this.compareTo(
|
|
984
|
-
},
|
|
980
|
+
c.prototype.chunkSize = be, c.prototype.toRadix = Se, c.prototype.fromRadix = Ce, c.prototype.fromNumber = we, c.prototype.bitwiseTo = ke, c.prototype.changeBit = He, c.prototype.addTo = Ke, c.prototype.dMultiply = et, c.prototype.dAddOffset = tt, c.prototype.multiplyLowerTo = st, c.prototype.multiplyUpperTo = ct, c.prototype.modInt = _t, c.prototype.millerRabin = xt, c.prototype.clone = _e, c.prototype.intValue = ve, c.prototype.byteValue = z, c.prototype.shortValue = ye, c.prototype.signum = xe, c.prototype.toByteArray = Te, c.prototype.equals = Ee, c.prototype.min = De, c.prototype.max = Oe, c.prototype.and = B, c.prototype.or = je, c.prototype.xor = Ne, c.prototype.andNot = Fe, c.prototype.not = Ie, c.prototype.shiftLeft = H, c.prototype.shiftRight = Le, c.prototype.getLowestSetBit = ze, c.prototype.bitCount = U, c.prototype.testBit = Ve, c.prototype.setBit = Ue, c.prototype.clearBit = We, c.prototype.flipBit = Ge, c.prototype.add = qe, c.prototype.subtract = Je, c.prototype.multiply = Ye, c.prototype.divide = Ze, c.prototype.remainder = Qe, c.prototype.divideAndRemainder = $e, c.prototype.modPow = ht, c.prototype.modInverse = vt, c.prototype.pow = ot, c.prototype.gcd = gt, c.prototype.isProbablePrime = bt, c.prototype.square = Xe;
|
|
981
|
+
var G = c;
|
|
982
|
+
if (G.prototype.IsNegative = function() {
|
|
983
|
+
return this.compareTo(G.ZERO) == -1;
|
|
984
|
+
}, G.op_Equality = function(e, t) {
|
|
985
985
|
return e.compareTo(t) == 0;
|
|
986
|
-
},
|
|
986
|
+
}, G.op_Inequality = function(e, t) {
|
|
987
987
|
return e.compareTo(t) != 0;
|
|
988
|
-
},
|
|
988
|
+
}, G.op_GreaterThan = function(e, t) {
|
|
989
989
|
return e.compareTo(t) > 0;
|
|
990
|
-
},
|
|
990
|
+
}, G.op_LessThan = function(e, t) {
|
|
991
991
|
return e.compareTo(t) < 0;
|
|
992
|
-
},
|
|
993
|
-
return new
|
|
994
|
-
},
|
|
995
|
-
return new
|
|
996
|
-
},
|
|
997
|
-
return new
|
|
998
|
-
},
|
|
992
|
+
}, G.op_Addition = function(e, t) {
|
|
993
|
+
return new G(e).add(new G(t));
|
|
994
|
+
}, G.op_Subtraction = function(e, t) {
|
|
995
|
+
return new G(e).subtract(new G(t));
|
|
996
|
+
}, G.Int128Mul = function(e, t) {
|
|
997
|
+
return new G(e).multiply(new G(t));
|
|
998
|
+
}, G.op_Division = function(e, t) {
|
|
999
999
|
return e.divide(t);
|
|
1000
|
-
},
|
|
1000
|
+
}, G.prototype.ToDouble = function() {
|
|
1001
1001
|
return parseFloat(this.toString());
|
|
1002
|
-
},
|
|
1002
|
+
}, St === void 0) var St = function(e, t) {
|
|
1003
1003
|
var n;
|
|
1004
1004
|
if (Object.getOwnPropertyNames === void 0) {
|
|
1005
1005
|
for (n in t.prototype) (e.prototype[n] === void 0 || e.prototype[n] == Object.prototype[n]) && (e.prototype[n] = t.prototype[n]);
|
|
@@ -1055,7 +1055,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
1055
1055
|
return this.m_Childs.length > 0 ? this.m_Childs[0] : null;
|
|
1056
1056
|
}, e.PolyTree.prototype.Total = function() {
|
|
1057
1057
|
return this.m_AllPolys.length;
|
|
1058
|
-
},
|
|
1058
|
+
}, St(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
|
|
1059
1059
|
return Math.abs(e);
|
|
1060
1060
|
}, e.Math_Max_Int32_Int32 = function(e, t) {
|
|
1061
1061
|
return Math.max(e, t);
|
|
@@ -1168,7 +1168,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
1168
1168
|
} while (r != n);
|
|
1169
1169
|
return !1;
|
|
1170
1170
|
}, e.ClipperBase.prototype.PointOnLineSegment = function(e, t, n, r) {
|
|
1171
|
-
return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y &&
|
|
1171
|
+
return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && G.op_Equality(G.Int128Mul(e.X - t.X, n.Y - t.Y), G.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
|
|
1172
1172
|
}, e.ClipperBase.prototype.PointOnPolygon = function(e, t, n) {
|
|
1173
1173
|
for (var r = t;;) {
|
|
1174
1174
|
if (this.PointOnLineSegment(e, r.Pt, r.Next.Pt, n)) return !0;
|
|
@@ -1177,13 +1177,13 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
1177
1177
|
return !1;
|
|
1178
1178
|
}, e.ClipperBase.prototype.SlopesEqual = e.ClipperBase.SlopesEqual = function() {
|
|
1179
1179
|
var t = arguments, n = t.length, r, i, a, o, s, c, l;
|
|
1180
|
-
return n == 3 ? (r = t[0], i = t[1], l = t[2], l ?
|
|
1180
|
+
return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? G.op_Equality(G.Int128Mul(r.Delta.Y, i.Delta.X), G.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? G.op_Equality(G.Int128Mul(a.Y - o.Y, o.X - s.X), G.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? G.op_Equality(G.Int128Mul(a.Y - o.Y, s.X - c.X), G.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
|
|
1181
1181
|
}, e.ClipperBase.SlopesEqual3 = function(t, n, r) {
|
|
1182
|
-
return r ?
|
|
1182
|
+
return r ? G.op_Equality(G.Int128Mul(t.Delta.Y, n.Delta.X), G.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
|
|
1183
1183
|
}, e.ClipperBase.SlopesEqual4 = function(t, n, r, i) {
|
|
1184
|
-
return i ?
|
|
1184
|
+
return i ? G.op_Equality(G.Int128Mul(t.Y - n.Y, n.X - r.X), G.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
|
|
1185
1185
|
}, e.ClipperBase.SlopesEqual5 = function(t, n, r, i, a) {
|
|
1186
|
-
return a ?
|
|
1186
|
+
return a ? G.op_Equality(G.Int128Mul(t.Y - n.Y, r.X - i.X), G.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
|
|
1187
1187
|
}, e.ClipperBase.prototype.Clear = function() {
|
|
1188
1188
|
this.DisposeLocalMinimaList();
|
|
1189
1189
|
for (var t = 0, n = this.m_edges.length; t < n; ++t) {
|
|
@@ -1861,16 +1861,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
this.m_IntersectList.length = 0;
|
|
1863
1863
|
};
|
|
1864
|
-
var
|
|
1864
|
+
var Ct = function(e) {
|
|
1865
1865
|
return e < 0 ? Math.ceil(e - .5) : Math.round(e);
|
|
1866
|
-
},
|
|
1866
|
+
}, wt = function(e) {
|
|
1867
1867
|
return e < 0 ? Math.ceil(e - .5) : Math.floor(e + .5);
|
|
1868
|
-
},
|
|
1868
|
+
}, Tt = function(e) {
|
|
1869
1869
|
return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
|
|
1870
|
-
},
|
|
1870
|
+
}, Et = function(e) {
|
|
1871
1871
|
return e < 0 ? (e -= .5, e < -2147483648 ? Math.ceil(e) : e | 0) : (e += .5, e > 2147483647 ? Math.floor(e) : e | 0);
|
|
1872
1872
|
};
|
|
1873
|
-
a.msie ? e.Clipper.Round =
|
|
1873
|
+
a.msie ? e.Clipper.Round = Ct : a.chromium ? e.Clipper.Round = Tt : a.safari ? e.Clipper.Round = Et : e.Clipper.Round = wt, e.Clipper.TopX = function(t, n) {
|
|
1874
1874
|
return n == t.Top.Y ? t.Top.X : t.Bot.X + e.Clipper.Round(t.Dx * (n - t.Bot.Y));
|
|
1875
1875
|
}, e.Clipper.prototype.IntersectPoint = function(t, n, r) {
|
|
1876
1876
|
r.X = 0, r.Y = 0;
|
|
@@ -2248,7 +2248,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
2248
2248
|
}, e.Clipper.ClosedPathsFromPolyTree = function(t) {
|
|
2249
2249
|
var n = new e.Paths();
|
|
2250
2250
|
return e.Clipper.AddPolyNodeToPaths(t, e.Clipper.NodeType.ntClosed, n), n;
|
|
2251
|
-
},
|
|
2251
|
+
}, St(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
|
|
2252
2252
|
ntAny: 0,
|
|
2253
2253
|
ntOpen: 1,
|
|
2254
2254
|
ntClosed: 2
|
|
@@ -2511,8 +2511,8 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
2511
2511
|
return n;
|
|
2512
2512
|
};
|
|
2513
2513
|
})();
|
|
2514
|
-
})),
|
|
2515
|
-
var n =
|
|
2514
|
+
})), E = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
2515
|
+
var n = T(), r = 10 ** 5;
|
|
2516
2516
|
function i(e) {
|
|
2517
2517
|
return e.map(function(e) {
|
|
2518
2518
|
return {
|
|
@@ -2697,16 +2697,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
|
|
|
2697
2697
|
Polygon: _,
|
|
2698
2698
|
ClipperLib: n
|
|
2699
2699
|
};
|
|
2700
|
-
})))(), 1),
|
|
2700
|
+
})))(), 1), D = 18, O = Object.freeze({
|
|
2701
2701
|
x: 0,
|
|
2702
2702
|
y: 0,
|
|
2703
2703
|
scalePercent: 100
|
|
2704
2704
|
});
|
|
2705
|
-
function
|
|
2705
|
+
function k(e) {
|
|
2706
2706
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError("Bubble tail length must be greater than zero.");
|
|
2707
2707
|
return e;
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function A(e) {
|
|
2710
2710
|
if (e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
|
|
2711
2711
|
let [t, n, r = 100] = e;
|
|
2712
2712
|
if (![
|
|
@@ -2720,7 +2720,7 @@ function ne(e) {
|
|
|
2720
2720
|
scalePercent: r
|
|
2721
2721
|
});
|
|
2722
2722
|
}
|
|
2723
|
-
var
|
|
2723
|
+
var j = Object.freeze([
|
|
2724
2724
|
"NORMAL",
|
|
2725
2725
|
"THINKING",
|
|
2726
2726
|
"DREAMING",
|
|
@@ -2732,21 +2732,21 @@ var O = Object.freeze([
|
|
|
2732
2732
|
"NARRATION",
|
|
2733
2733
|
"NO_BUBBLE"
|
|
2734
2734
|
]);
|
|
2735
|
-
function
|
|
2735
|
+
function M(e) {
|
|
2736
2736
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
2737
2737
|
}
|
|
2738
|
-
function
|
|
2738
|
+
function N(e, t) {
|
|
2739
2739
|
let n = e ?? t;
|
|
2740
2740
|
if (!Number.isFinite(n) || n <= 0) throw TypeError("Bubble SVG dimensions must be positive and finite.");
|
|
2741
2741
|
return n;
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function ee(e) {
|
|
2744
2744
|
if (e === null) return null;
|
|
2745
2745
|
let t = e ?? 180;
|
|
2746
2746
|
if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
|
|
2747
2747
|
return (t % 360 + 360) % 360;
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2749
|
+
function P(e, t, n = 18) {
|
|
2750
2750
|
let r = e - 24, i = t - 24;
|
|
2751
2751
|
return [
|
|
2752
2752
|
{
|
|
@@ -2777,24 +2777,24 @@ function j(e, t, n = 18) {
|
|
|
2777
2777
|
};
|
|
2778
2778
|
}));
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2780
|
+
function te(e, t) {
|
|
2781
2781
|
return e.x * t.y - e.y * t.x;
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function ne(e, t) {
|
|
2784
2784
|
return {
|
|
2785
2785
|
x: e.x - t.x,
|
|
2786
2786
|
y: e.y - t.y
|
|
2787
2787
|
};
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function re(e, t) {
|
|
2790
2790
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function ie(e, t, n, r) {
|
|
2793
2793
|
let i = t, a = r;
|
|
2794
2794
|
for (; a > 0;) {
|
|
2795
2795
|
let t = (i + n + e.length) % e.length, r = e[i], o = e[t];
|
|
2796
2796
|
if (!r || !o) throw Error("Bubble border path is invalid.");
|
|
2797
|
-
let s =
|
|
2797
|
+
let s = re(r, o);
|
|
2798
2798
|
if (a <= s) {
|
|
2799
2799
|
let e = a / s;
|
|
2800
2800
|
return {
|
|
@@ -2808,14 +2808,14 @@ function F(e, t, n, r) {
|
|
|
2808
2808
|
if (!o) throw Error("Bubble border path is empty.");
|
|
2809
2809
|
return o;
|
|
2810
2810
|
}
|
|
2811
|
-
function
|
|
2811
|
+
function F(e, t, n, r, i) {
|
|
2812
2812
|
let a;
|
|
2813
2813
|
for (let r = 0; r < e.length; r += 1) {
|
|
2814
2814
|
let i = e[r], o = e[(r + 1) % e.length];
|
|
2815
2815
|
if (!i || !o) continue;
|
|
2816
|
-
let s =
|
|
2816
|
+
let s = ne(o, i), c = te(n, s);
|
|
2817
2817
|
if (Math.abs(c) < 1e-9) continue;
|
|
2818
|
-
let l =
|
|
2818
|
+
let l = ne(i, t), u = te(l, s) / c, d = te(l, n) / c;
|
|
2819
2819
|
u < 0 || d < -1e-9 || d > 1 + 1e-9 || a && u >= a.rayScale || (a = {
|
|
2820
2820
|
edgeIndex: r,
|
|
2821
2821
|
point: {
|
|
@@ -2833,21 +2833,21 @@ function I(e, t, n, r, i) {
|
|
|
2833
2833
|
], s = a.edgeIndex + 1;
|
|
2834
2834
|
return {
|
|
2835
2835
|
borderPoint: a.point,
|
|
2836
|
-
base: [
|
|
2836
|
+
base: [ie(o, s, -1, 9), ie(o, s, 1, 9)],
|
|
2837
2837
|
tip: {
|
|
2838
2838
|
x: i?.x ?? t.x + n.x * (a.rayScale + r),
|
|
2839
2839
|
y: i?.y ?? t.y + n.y * (a.rayScale + r)
|
|
2840
2840
|
}
|
|
2841
2841
|
};
|
|
2842
2842
|
}
|
|
2843
|
-
function
|
|
2843
|
+
function I(e) {
|
|
2844
2844
|
let t = e * Math.PI / 180;
|
|
2845
2845
|
return {
|
|
2846
2846
|
x: Math.sin(t),
|
|
2847
2847
|
y: -Math.cos(t)
|
|
2848
2848
|
};
|
|
2849
2849
|
}
|
|
2850
|
-
function
|
|
2850
|
+
function L(e, t, n, r) {
|
|
2851
2851
|
return {
|
|
2852
2852
|
x: n.x + (e.x - t.x) * r,
|
|
2853
2853
|
y: n.y + (e.y - t.y) * r
|
|
@@ -2857,37 +2857,37 @@ function R(e, t, n, r, i, a) {
|
|
|
2857
2857
|
let o = {
|
|
2858
2858
|
x: t / 2,
|
|
2859
2859
|
y: n / 2
|
|
2860
|
-
}, s =
|
|
2860
|
+
}, s = I(r), c = F(e, o, s, i), l = re(o, c.borderPoint), u = a.scalePercent / 100, d = {
|
|
2861
2861
|
x: o.x - s.x * l * (u - 1) + a.x,
|
|
2862
2862
|
y: o.y - s.y * l * (u - 1) - a.y
|
|
2863
2863
|
};
|
|
2864
2864
|
return {
|
|
2865
|
-
body: e.map((e) =>
|
|
2865
|
+
body: e.map((e) => L(e, o, d, u)),
|
|
2866
2866
|
bodyCenter: d,
|
|
2867
2867
|
tip: c.tip
|
|
2868
2868
|
};
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2870
|
+
function ae(e) {
|
|
2871
2871
|
let t = e[0];
|
|
2872
2872
|
if (!t) throw Error("Bubble polygon is empty.");
|
|
2873
2873
|
return `M ${t.x.toFixed(4)} ${t.y.toFixed(4)} ${e.slice(1).map(({ x: e, y: t }) => `L ${e.toFixed(4)} ${t.toFixed(4)}`).join(" ")} Z`;
|
|
2874
2874
|
}
|
|
2875
|
-
function
|
|
2875
|
+
function oe(e) {
|
|
2876
2876
|
return Math.abs(e.reduce((t, n, r) => {
|
|
2877
2877
|
let i = e[(r + 1) % e.length];
|
|
2878
2878
|
return i ? t + n.x * i.y - i.x * n.y : t;
|
|
2879
2879
|
}, 0) / 2);
|
|
2880
2880
|
}
|
|
2881
|
-
function
|
|
2882
|
-
return `<path d="${
|
|
2881
|
+
function se(e, t, n, r = "") {
|
|
2882
|
+
return `<path d="${ae(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
|
|
2883
2883
|
}
|
|
2884
|
-
function
|
|
2885
|
-
let o =
|
|
2884
|
+
function ce(e, t, n, r, i, a = "") {
|
|
2885
|
+
let o = ne(n, t), s = Math.hypot(o.x, o.y);
|
|
2886
2886
|
if (!(s > 0)) throw TypeError("Bubble body center and tail tip must differ.");
|
|
2887
|
-
let c =
|
|
2887
|
+
let c = F(e, t, {
|
|
2888
2888
|
x: o.x / s,
|
|
2889
2889
|
y: o.y / s
|
|
2890
|
-
}, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u =
|
|
2890
|
+
}, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = E.default.union([l(e)], [[l([
|
|
2891
2891
|
c.base[0],
|
|
2892
2892
|
c.tip,
|
|
2893
2893
|
c.base[1]
|
|
@@ -2896,11 +2896,11 @@ function B(e, t, n, r, i, a = "") {
|
|
|
2896
2896
|
let d = u.map((e) => e.map(([e, t]) => ({
|
|
2897
2897
|
x: e,
|
|
2898
2898
|
y: t
|
|
2899
|
-
}))).sort((e, t) =>
|
|
2899
|
+
}))).sort((e, t) => oe(t) - oe(e))[0];
|
|
2900
2900
|
if (!d) throw Error("JSClipper returned an empty Bubble outline.");
|
|
2901
|
-
return `<path d="${
|
|
2901
|
+
return `<path d="${ae(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
|
|
2902
2902
|
}
|
|
2903
|
-
function
|
|
2903
|
+
function le(e, t, n, r) {
|
|
2904
2904
|
let i = e - 24, a = t - 24, o = e / 2, s = t / 2;
|
|
2905
2905
|
return `<path d="M 42 ${s}
|
|
2906
2906
|
C 22 ${s - 20}, 32 42, 60 44
|
|
@@ -2913,8 +2913,8 @@ function se(e, t, n, r) {
|
|
|
2913
2913
|
C 31 ${a + 2}, 17 ${s + 20}, 42 ${s} Z"
|
|
2914
2914
|
fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
2915
2915
|
}
|
|
2916
|
-
function
|
|
2917
|
-
let o =
|
|
2916
|
+
function ue(e, t, n, r, i, a) {
|
|
2917
|
+
let o = ne(n, t), s = Math.hypot(o.x, o.y), c = F(e, t, {
|
|
2918
2918
|
x: o.x / s,
|
|
2919
2919
|
y: o.y / s
|
|
2920
2920
|
}, 0, n), l = {
|
|
@@ -2942,7 +2942,7 @@ function ce(e, t, n, r, i, a) {
|
|
|
2942
2942
|
radius: 3.5
|
|
2943
2943
|
}]).map(({ ratio: e, radius: t }) => `<circle cx="${l.x + (c.tip.x - l.x) * e}" cy="${l.y + (c.tip.y - l.y) * e}" r="${t}" fill="${r}" stroke="${i}" stroke-width="2"/>`).join("");
|
|
2944
2944
|
}
|
|
2945
|
-
function
|
|
2945
|
+
function de(e, t) {
|
|
2946
2946
|
let n = e / 2, r = t / 2;
|
|
2947
2947
|
return Array.from({ length: 28 }, (i, a) => {
|
|
2948
2948
|
let o = a * Math.PI * 2 / 28 - Math.PI / 2, s = a % 2 == 0, c = s ? e / 2 - 6 : e / 2 - 22, l = s ? t / 2 - 6 : t / 2 - 22;
|
|
@@ -2952,7 +2952,7 @@ function le(e, t) {
|
|
|
2952
2952
|
};
|
|
2953
2953
|
});
|
|
2954
2954
|
}
|
|
2955
|
-
function
|
|
2955
|
+
function fe(e, t) {
|
|
2956
2956
|
let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
|
|
2957
2957
|
let n = t / 20;
|
|
2958
2958
|
return {
|
|
@@ -2985,59 +2985,61 @@ function ue(e, t) {
|
|
|
2985
2985
|
}))
|
|
2986
2986
|
];
|
|
2987
2987
|
}
|
|
2988
|
-
function
|
|
2989
|
-
return e === "YELLING" ?
|
|
2988
|
+
function pe(e, t, n) {
|
|
2989
|
+
return e === "YELLING" ? de(t, n) : e === "WAVY" ? fe(t, n) : P(t, n);
|
|
2990
2990
|
}
|
|
2991
|
-
function
|
|
2992
|
-
let t =
|
|
2991
|
+
function me(e) {
|
|
2992
|
+
let t = N(e.width, 220), n = N(e.height, 112), r = ee(e.tailDirection);
|
|
2993
2993
|
if (r === null) throw TypeError("Bubble body center offset requires a tail direction.");
|
|
2994
|
-
let i =
|
|
2994
|
+
let i = k(e.tailLength ?? D), a = A(e.offset), o = {
|
|
2995
2995
|
x: t / 2,
|
|
2996
2996
|
y: n / 2
|
|
2997
|
-
}, s = R(
|
|
2997
|
+
}, s = R(pe(e.style, t, n), t, n, r, i, a);
|
|
2998
2998
|
return Object.freeze({
|
|
2999
2999
|
x: s.bodyCenter.x - o.x,
|
|
3000
3000
|
y: s.bodyCenter.y - o.y
|
|
3001
3001
|
});
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3004
|
-
let c =
|
|
3005
|
-
if (r === null) return
|
|
3003
|
+
function he(e, t, n, r, i, a, o, s) {
|
|
3004
|
+
let c = P(t, n), l = (e) => r === null ? e : R(e, t, n, r, o, s).body, u = (e, c = "") => {
|
|
3005
|
+
if (r === null) return se(e, i, a, c);
|
|
3006
3006
|
let l = R(e, t, n, r, o, s);
|
|
3007
|
-
return
|
|
3007
|
+
return ce(l.body, l.bodyCenter, l.tip, i, a, c);
|
|
3008
3008
|
};
|
|
3009
3009
|
switch (e) {
|
|
3010
3010
|
case "NO_BUBBLE": return "";
|
|
3011
3011
|
case "THINKING":
|
|
3012
3012
|
case "DREAMING": {
|
|
3013
|
-
if (r === null) return
|
|
3013
|
+
if (r === null) return le(t, n, i, a);
|
|
3014
3014
|
let l = R(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
|
|
3015
3015
|
x: t / 2,
|
|
3016
3016
|
y: n / 2
|
|
3017
3017
|
}, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
|
|
3018
|
-
return `${
|
|
3018
|
+
return `${ue(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${le(t, n, i, a)}</g>`;
|
|
3019
3019
|
}
|
|
3020
|
-
case "YELLING": return u(
|
|
3021
|
-
case "WAVY": return u(
|
|
3020
|
+
case "YELLING": return u(de(t, n));
|
|
3021
|
+
case "WAVY": return u(fe(t, n));
|
|
3022
3022
|
case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
|
|
3023
3023
|
case "ANNOUNCEMENT": return `${u(c)}<rect x="30" y="30" width="${t - 60}" height="${n - 60}" rx="13" fill="none" stroke="${a}" stroke-width="1.5"/>`;
|
|
3024
|
-
case "NARRATION": return
|
|
3024
|
+
case "NARRATION": return se(l(c), i, a);
|
|
3025
3025
|
case "OFF_PANEL": return u(c);
|
|
3026
3026
|
case "NORMAL": return u(c);
|
|
3027
3027
|
}
|
|
3028
3028
|
}
|
|
3029
|
-
function
|
|
3030
|
-
if (!
|
|
3029
|
+
function ge(e) {
|
|
3030
|
+
if (!j.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
|
|
3031
3031
|
if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
|
|
3032
|
-
let t =
|
|
3032
|
+
let t = N(e.width, 220), n = N(e.height, 112), r = N(e.fontSize, 15), i = ee(e.tailDirection), a = k(e.tailLength ?? D), o = e.offset === void 0 ? O : A(e.offset), s = e.shapeTransition;
|
|
3033
|
+
if (s !== void 0 && (!j.includes(s.from) || !j.includes(s.to) || !Number.isFinite(s.progress) || s.progress < 0 || s.progress > 1)) throw TypeError("Bubble shape transition is invalid.");
|
|
3034
|
+
let c = e.fillColor ?? "#fff4cc", l = e.borderColor ?? "#6f5b45", u = e.textColor ?? "#25283a", d = e.fontFamily ?? "Noto Sans JP, sans-serif", f = r * 1.35, p = n / 2 - (e.lines.length - 1) * f / 2 + r * .35, m = i === null ? 1 : o.scalePercent / 100, h = i === null ? {
|
|
3033
3035
|
x: t / 2,
|
|
3034
3036
|
y: n / 2
|
|
3035
|
-
} : R(
|
|
3036
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"><title>${
|
|
3037
|
+
} : R(P(t, n), t, n, i, a, o).bodyCenter, g = e.lines.map((e, t) => `<text x="${h.x}" y="${h.y + (p + t * f - n / 2) * m}" text-anchor="middle" fill="${M(u)}" font-family="${M(d)}" font-size="${r * m}">${M(e)}</text>`).join(""), _ = s === void 0 ? he(e.style, t, n, i, c, l, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${he(s.from, t, n, i, c, l, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${he(s.to, t, n, i, c, l, a, o)}</g>`, v = M(e.title ?? `${e.style} bubble`), y = s === void 0 ? "" : ` data-bubble-shape-transition-from="${s.from}" data-bubble-shape-transition-to="${s.to}" data-bubble-shape-transition-progress="${s.progress.toFixed(4)}"`;
|
|
3038
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"${y}><title>${v}</title>${_}${g}</svg>`;
|
|
3037
3039
|
}
|
|
3038
3040
|
//#endregion
|
|
3039
3041
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
|
|
3040
|
-
var
|
|
3042
|
+
var _e = 2048, ve = 2112, z = Uint8Array, ye = Uint16Array, be = Int32Array, xe = new z([
|
|
3041
3043
|
0,
|
|
3042
3044
|
0,
|
|
3043
3045
|
0,
|
|
@@ -3070,7 +3072,7 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
|
|
|
3070
3072
|
0,
|
|
3071
3073
|
0,
|
|
3072
3074
|
0
|
|
3073
|
-
]),
|
|
3075
|
+
]), Se = new z([
|
|
3074
3076
|
0,
|
|
3075
3077
|
0,
|
|
3076
3078
|
0,
|
|
@@ -3103,7 +3105,7 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
|
|
|
3103
3105
|
13,
|
|
3104
3106
|
0,
|
|
3105
3107
|
0
|
|
3106
|
-
]),
|
|
3108
|
+
]), Ce = new z([
|
|
3107
3109
|
16,
|
|
3108
3110
|
17,
|
|
3109
3111
|
18,
|
|
@@ -3123,51 +3125,51 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
|
|
|
3123
3125
|
14,
|
|
3124
3126
|
1,
|
|
3125
3127
|
15
|
|
3126
|
-
]),
|
|
3127
|
-
for (var n = new
|
|
3128
|
-
for (var i = new
|
|
3128
|
+
]), we = function(e, t) {
|
|
3129
|
+
for (var n = new ye(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
|
|
3130
|
+
for (var i = new be(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
|
|
3129
3131
|
return {
|
|
3130
3132
|
b: n,
|
|
3131
3133
|
r: i
|
|
3132
3134
|
};
|
|
3133
|
-
},
|
|
3134
|
-
|
|
3135
|
-
var
|
|
3136
|
-
|
|
3137
|
-
for (var
|
|
3138
|
-
var
|
|
3139
|
-
|
|
3140
|
-
}
|
|
3141
|
-
for (var
|
|
3142
|
-
for (var r = e.length, i = 0, a = new
|
|
3143
|
-
var o = new
|
|
3135
|
+
}, Te = we(xe, 2), Ee = Te.b, De = Te.r;
|
|
3136
|
+
Ee[28] = 258, De[258] = 28;
|
|
3137
|
+
var Oe = we(Se, 0), ke = Oe.b;
|
|
3138
|
+
Oe.r;
|
|
3139
|
+
for (var Ae = new ye(32768), B = 0; B < 32768; ++B) {
|
|
3140
|
+
var V = (B & 43690) >> 1 | (B & 21845) << 1;
|
|
3141
|
+
V = (V & 52428) >> 2 | (V & 13107) << 2, V = (V & 61680) >> 4 | (V & 3855) << 4, Ae[B] = ((V & 65280) >> 8 | (V & 255) << 8) >> 1;
|
|
3142
|
+
}
|
|
3143
|
+
for (var je = (function(e, t, n) {
|
|
3144
|
+
for (var r = e.length, i = 0, a = new ye(t); i < r; ++i) e[i] && ++a[e[i] - 1];
|
|
3145
|
+
var o = new ye(t);
|
|
3144
3146
|
for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
|
|
3145
3147
|
var s;
|
|
3146
3148
|
if (n) {
|
|
3147
|
-
s = new
|
|
3149
|
+
s = new ye(1 << t);
|
|
3148
3150
|
var c = 15 - t;
|
|
3149
|
-
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[
|
|
3150
|
-
} else for (s = new
|
|
3151
|
+
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[Ae[d] >> c] = l;
|
|
3152
|
+
} else for (s = new ye(r), i = 0; i < r; ++i) e[i] && (s[i] = Ae[o[e[i] - 1]++] >> 15 - e[i]);
|
|
3151
3153
|
return s;
|
|
3152
|
-
}),
|
|
3153
|
-
for (var
|
|
3154
|
-
for (var
|
|
3155
|
-
for (var
|
|
3156
|
-
for (var
|
|
3157
|
-
var
|
|
3154
|
+
}), Me = new z(288), B = 0; B < 144; ++B) Me[B] = 8;
|
|
3155
|
+
for (var B = 144; B < 256; ++B) Me[B] = 9;
|
|
3156
|
+
for (var B = 256; B < 280; ++B) Me[B] = 7;
|
|
3157
|
+
for (var B = 280; B < 288; ++B) Me[B] = 8;
|
|
3158
|
+
for (var Ne = new z(32), B = 0; B < 32; ++B) Ne[B] = 5;
|
|
3159
|
+
var Pe = /*#__PURE__*/ je(Me, 9, 1), Fe = /*#__PURE__*/ je(Ne, 5, 1), Ie = function(e) {
|
|
3158
3160
|
for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
|
|
3159
3161
|
return t;
|
|
3160
|
-
},
|
|
3162
|
+
}, H = function(e, t, n) {
|
|
3161
3163
|
var r = t / 8 | 0;
|
|
3162
3164
|
return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
|
|
3163
|
-
},
|
|
3165
|
+
}, Le = function(e, t) {
|
|
3164
3166
|
var n = t / 8 | 0;
|
|
3165
3167
|
return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
|
|
3166
|
-
},
|
|
3168
|
+
}, Re = function(e) {
|
|
3167
3169
|
return (e + 7) / 8 | 0;
|
|
3168
|
-
},
|
|
3169
|
-
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new
|
|
3170
|
-
},
|
|
3170
|
+
}, ze = function(e, t, n) {
|
|
3171
|
+
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new z(e.subarray(t, n));
|
|
3172
|
+
}, Be = [
|
|
3171
3173
|
"unexpected EOF",
|
|
3172
3174
|
"invalid block type",
|
|
3173
3175
|
"invalid length/literal",
|
|
@@ -3182,121 +3184,121 @@ var Ae = /*#__PURE__*/ Oe(G, 9, 1), je = /*#__PURE__*/ Oe(ke, 5, 1), Me = functi
|
|
|
3182
3184
|
"filename too long",
|
|
3183
3185
|
"stream finishing",
|
|
3184
3186
|
"invalid zip data"
|
|
3185
|
-
],
|
|
3186
|
-
var r = Error(t ||
|
|
3187
|
-
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r,
|
|
3187
|
+
], U = function(e, t, n) {
|
|
3188
|
+
var r = Error(t || Be[e]);
|
|
3189
|
+
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, U), !n) throw r;
|
|
3188
3190
|
return r;
|
|
3189
|
-
},
|
|
3191
|
+
}, Ve = function(e, t, n, r) {
|
|
3190
3192
|
var i = e.length, a = r ? r.length : 0;
|
|
3191
|
-
if (!i || t.f && !t.l) return n || new
|
|
3193
|
+
if (!i || t.f && !t.l) return n || new z(0);
|
|
3192
3194
|
var o = !n, s = o || t.i != 2, c = t.i;
|
|
3193
|
-
o && (n = new
|
|
3195
|
+
o && (n = new z(i * 3));
|
|
3194
3196
|
var l = function(e) {
|
|
3195
3197
|
var t = n.length;
|
|
3196
3198
|
if (e > t) {
|
|
3197
|
-
var r = new
|
|
3199
|
+
var r = new z(Math.max(t * 2, e));
|
|
3198
3200
|
r.set(n), n = r;
|
|
3199
3201
|
}
|
|
3200
3202
|
}, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
|
|
3201
3203
|
do {
|
|
3202
3204
|
if (!p) {
|
|
3203
|
-
u =
|
|
3204
|
-
var v =
|
|
3205
|
+
u = H(e, d, 1);
|
|
3206
|
+
var v = H(e, d + 1, 3);
|
|
3205
3207
|
if (d += 3, !v) {
|
|
3206
|
-
var y =
|
|
3208
|
+
var y = Re(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
|
|
3207
3209
|
if (x > i) {
|
|
3208
|
-
c &&
|
|
3210
|
+
c && U(0);
|
|
3209
3211
|
break;
|
|
3210
3212
|
}
|
|
3211
3213
|
s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
|
|
3212
3214
|
continue;
|
|
3213
3215
|
}
|
|
3214
|
-
if (v == 1) p =
|
|
3216
|
+
if (v == 1) p = Pe, m = Fe, h = 9, g = 5;
|
|
3215
3217
|
else if (v == 2) {
|
|
3216
|
-
var S =
|
|
3218
|
+
var S = H(e, d, 31) + 257, C = H(e, d + 10, 15) + 4, w = S + H(e, d + 5, 31) + 1;
|
|
3217
3219
|
d += 14;
|
|
3218
|
-
for (var
|
|
3220
|
+
for (var T = new z(w), E = new z(19), D = 0; D < C; ++D) E[Ce[D]] = H(e, d + D * 3, 7);
|
|
3219
3221
|
d += C * 3;
|
|
3220
|
-
for (var
|
|
3221
|
-
var
|
|
3222
|
-
d +=
|
|
3223
|
-
var y =
|
|
3224
|
-
if (y < 16)
|
|
3222
|
+
for (var O = Ie(E), k = (1 << O) - 1, A = je(E, O, 1), D = 0; D < w;) {
|
|
3223
|
+
var j = A[H(e, d, k)];
|
|
3224
|
+
d += j & 15;
|
|
3225
|
+
var y = j >> 4;
|
|
3226
|
+
if (y < 16) T[D++] = y;
|
|
3225
3227
|
else {
|
|
3226
|
-
var
|
|
3227
|
-
for (y == 16 ? (
|
|
3228
|
+
var M = 0, N = 0;
|
|
3229
|
+
for (y == 16 ? (N = 3 + H(e, d, 3), d += 2, M = T[D - 1]) : y == 17 ? (N = 3 + H(e, d, 7), d += 3) : y == 18 && (N = 11 + H(e, d, 127), d += 7); N--;) T[D++] = M;
|
|
3228
3230
|
}
|
|
3229
3231
|
}
|
|
3230
|
-
var
|
|
3231
|
-
h =
|
|
3232
|
-
} else
|
|
3232
|
+
var ee = T.subarray(0, S), P = T.subarray(S);
|
|
3233
|
+
h = Ie(ee), g = Ie(P), p = je(ee, h, 1), m = je(P, g, 1);
|
|
3234
|
+
} else U(1);
|
|
3233
3235
|
if (d > _) {
|
|
3234
|
-
c &&
|
|
3236
|
+
c && U(0);
|
|
3235
3237
|
break;
|
|
3236
3238
|
}
|
|
3237
3239
|
}
|
|
3238
3240
|
s && l(f + 131072);
|
|
3239
|
-
for (var
|
|
3240
|
-
var
|
|
3241
|
-
if (d +=
|
|
3242
|
-
c &&
|
|
3241
|
+
for (var te = (1 << h) - 1, ne = (1 << g) - 1, re = d;; re = d) {
|
|
3242
|
+
var M = p[Le(e, d) & te], ie = M >> 4;
|
|
3243
|
+
if (d += M & 15, d > _) {
|
|
3244
|
+
c && U(0);
|
|
3243
3245
|
break;
|
|
3244
3246
|
}
|
|
3245
|
-
if (
|
|
3246
|
-
else if (
|
|
3247
|
-
|
|
3247
|
+
if (M || U(2), ie < 256) n[f++] = ie;
|
|
3248
|
+
else if (ie == 256) {
|
|
3249
|
+
re = d, p = null;
|
|
3248
3250
|
break;
|
|
3249
3251
|
} else {
|
|
3250
|
-
var
|
|
3251
|
-
if (
|
|
3252
|
-
var
|
|
3253
|
-
|
|
3252
|
+
var F = ie - 254;
|
|
3253
|
+
if (ie > 264) {
|
|
3254
|
+
var D = ie - 257, I = xe[D];
|
|
3255
|
+
F = H(e, d, (1 << I) - 1) + Ee[D], d += I;
|
|
3254
3256
|
}
|
|
3255
|
-
var
|
|
3256
|
-
|
|
3257
|
-
var
|
|
3257
|
+
var L = m[Le(e, d) & ne], R = L >> 4;
|
|
3258
|
+
L || U(3), d += L & 15;
|
|
3259
|
+
var P = ke[R];
|
|
3258
3260
|
if (R > 3) {
|
|
3259
|
-
var
|
|
3260
|
-
|
|
3261
|
+
var I = Se[R];
|
|
3262
|
+
P += Le(e, d) & (1 << I) - 1, d += I;
|
|
3261
3263
|
}
|
|
3262
3264
|
if (d > _) {
|
|
3263
|
-
c &&
|
|
3265
|
+
c && U(0);
|
|
3264
3266
|
break;
|
|
3265
3267
|
}
|
|
3266
3268
|
s && l(f + 131072);
|
|
3267
|
-
var
|
|
3268
|
-
if (f <
|
|
3269
|
-
var
|
|
3270
|
-
for (
|
|
3269
|
+
var ae = f + F;
|
|
3270
|
+
if (f < P) {
|
|
3271
|
+
var oe = a - P, se = Math.min(P, ae);
|
|
3272
|
+
for (oe + f < 0 && U(3); f < se; ++f) n[f] = r[oe + f];
|
|
3271
3273
|
}
|
|
3272
|
-
for (; f <
|
|
3274
|
+
for (; f < ae; ++f) n[f] = n[f - P];
|
|
3273
3275
|
}
|
|
3274
3276
|
}
|
|
3275
|
-
t.l = p, t.p =
|
|
3277
|
+
t.l = p, t.p = re, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
|
|
3276
3278
|
} while (!u);
|
|
3277
|
-
return f != n.length && o ?
|
|
3278
|
-
},
|
|
3279
|
-
(e[0] != 31 || e[1] != 139 || e[2] != 8) &&
|
|
3279
|
+
return f != n.length && o ? ze(n, 0, f) : n.subarray(0, f);
|
|
3280
|
+
}, He = /*#__PURE__*/ new z(0), Ue = function(e) {
|
|
3281
|
+
(e[0] != 31 || e[1] != 139 || e[2] != 8) && U(6, "invalid gzip data");
|
|
3280
3282
|
var t = e[3], n = 10;
|
|
3281
3283
|
t & 4 && (n += (e[10] | e[11] << 8) + 2);
|
|
3282
3284
|
for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
|
|
3283
3285
|
return n + (t & 2);
|
|
3284
|
-
},
|
|
3286
|
+
}, We = function(e) {
|
|
3285
3287
|
var t = e.length;
|
|
3286
3288
|
return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
|
|
3287
3289
|
};
|
|
3288
|
-
function
|
|
3289
|
-
var n =
|
|
3290
|
-
return n + 8 > e.length &&
|
|
3290
|
+
function Ge(e, t) {
|
|
3291
|
+
var n = Ue(e);
|
|
3292
|
+
return n + 8 > e.length && U(6, "invalid gzip data"), Ve(e.subarray(n, -8), { i: 2 }, t && t.out || new z(We(e)), t && t.dictionary);
|
|
3291
3293
|
}
|
|
3292
|
-
var
|
|
3294
|
+
var Ke = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
|
|
3293
3295
|
try {
|
|
3294
|
-
|
|
3296
|
+
Ke.decode(He, { stream: !0 });
|
|
3295
3297
|
} catch {}
|
|
3296
3298
|
//#endregion
|
|
3297
3299
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
|
|
3298
|
-
var
|
|
3299
|
-
function
|
|
3300
|
+
var qe = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
|
|
3301
|
+
function Je(e) {
|
|
3300
3302
|
let t = e.length;
|
|
3301
3303
|
for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
|
|
3302
3304
|
e[n + 3],
|
|
@@ -3305,15 +3307,15 @@ function We(e) {
|
|
|
3305
3307
|
e[n]
|
|
3306
3308
|
];
|
|
3307
3309
|
}
|
|
3308
|
-
function
|
|
3309
|
-
var
|
|
3310
|
+
function Ye(e) {}
|
|
3311
|
+
var Xe = qe ? Je : Ye, Ze = new TextDecoder(), Qe = class e {
|
|
3310
3312
|
constructor(e) {
|
|
3311
3313
|
if (e instanceof Uint8Array) {
|
|
3312
3314
|
let t = 0, n = new DataView(e.buffer);
|
|
3313
3315
|
if (this.highStart = n.getUint32(0, !0), this.errorValue = n.getUint32(4, !0), t = n.getUint32(8, !0), t !== 4294967295) throw Error("Trie created with old version of @cto.af/unicode-trie.");
|
|
3314
3316
|
if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
|
|
3315
3317
|
let r = e.subarray(16 + t);
|
|
3316
|
-
this.values = r.length ? JSON.parse(
|
|
3318
|
+
this.values = r.length ? JSON.parse(Ze.decode(Ge(r))) : [], e = Ge(e.subarray(16, 16 + t)), Xe(e), this.data = new Int32Array(e.buffer);
|
|
3317
3319
|
} else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
|
|
3318
3320
|
}
|
|
3319
3321
|
static fromBase64(t) {
|
|
@@ -3326,10 +3328,10 @@ var Ke = Ue ? We : Ge, qe = new TextDecoder(), Je = class e {
|
|
|
3326
3328
|
let n = (this.data[e >> 5] << 2) + (e & 31);
|
|
3327
3329
|
t = this.data[n];
|
|
3328
3330
|
} else if (e <= 65535) {
|
|
3329
|
-
let n = (this.data[
|
|
3331
|
+
let n = (this.data[_e + (e - 55296 >> 5)] << 2) + (e & 31);
|
|
3330
3332
|
t = this.data[n];
|
|
3331
3333
|
} else if (e < this.highStart) {
|
|
3332
|
-
let n = this.data[
|
|
3334
|
+
let n = this.data[ve - 32 + (e >> 11)];
|
|
3333
3335
|
n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
|
|
3334
3336
|
} else t = this.data[this.data.length - 4];
|
|
3335
3337
|
return t;
|
|
@@ -3338,144 +3340,936 @@ var Ke = Ue ? We : Ge, qe = new TextDecoder(), Je = class e {
|
|
|
3338
3340
|
let t = this.get(e);
|
|
3339
3341
|
return this.values[t] ?? t;
|
|
3340
3342
|
}
|
|
3341
|
-
},
|
|
3342
|
-
|
|
3343
|
-
|
|
3343
|
+
}, $e = Qe.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48FEw3NTwDTp/BxwAZgJLgaXgCvAAnADuA3cDe4Hj0rPLQerwLPgJfAaeBe8Az4EnT/Ram0D\n eoBdwe5gENgX0DsOhHkQGAlGgTHgaHACGA8mgilgGpgBLgJzweVgPlgIbgF3iPOl4BGwAqwG\n a8Er4C2wDnwEumzRanUDPUFv0B8MBgeAL4BDwNfAN8C3wIngO+A0cCZowd/nwrwA/Eic/wzm\n L8EMHM+HuRDcDP4g7t8Hk3hYmI8BCv+TwvwLTOZvglfBawKyQ7wrjv8Ns1OXVqsroPNuwuwJ\n szfoL86JwTgeIp3HYJj0vhE4Hg3GgnHgZMDhnYDjyWCqZP9CHM8Gc8S1y2BeBa4FvweLxPN3\n wVwq7Dwirp0KVuB4NVgLXgSvg/fA+6C1Jf6gO+gF+oI9wQa3YQ4FwwDlwREwR4Mj+L6GY3Dv\n eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9cA64Dt4I7wT3gQfA4eAI8DdaKd7wizLdgvg86dUWa\n g+1BL0D3+sIcAAaLc5X9xfUDYR4EDlUYJR2PAUeCY8FJ4DRwJjgXTAezwBwwD1wDrgO3gjuF\n G/fAfBA8Js5XwnwaPF/htypeFfbfhvm+w7OdtkL6Axe3thP2uSzuhPM+YICA6tZ9YA4FwwGV\n 55F0XTBGOlY5GhwHxoOJYAqYBn4AfiyOLwVXgvnSc9dKxzeC28XxEoNbbdq0iQvXEe24aNOm\n TZs2bdq0aePC0ob55yFhPg5IHlI3Rl4Je8+I/vALMN+T7v3DMN5+B/c+BJ23hhwQ0LUeMM+G\n OQrshuM9AMkJ94b5WfBF8GVwKPg6+CYgOc7xME8BLFsiJuH8LPA9MFO8/yJhMnNxfjm4AlwJ\n rgK/AleD+e177Xvte+177XvR7/0O3ARuBSQzLcmd8ENJSoe/TZsmE9qfvR9l7FHwhNL3c+Ep\n zbPP4trz4FXwT/AB2Gyb/7WzJc67g16gLxgIBgOasxkCcxgoXf/c2+1jDu7ean0fLDbwDvjc\n 9pi7Aj8H8r1V4vxlmLvtgLlCMBesBNvs+PG9g2GeBxaB5aB7j1brOczh9UN8nAiuBs8BGg8c\n BqgP/xOqI2n+VvAQzile53T6L6NwLts5G+eLwSpxfT3M4dtiTg0sAevB8O1wDuT35GZJA9yX\n 461NmzZtNiXWow6cTrpKaCNGU3uhtPNjcW0cOEFq28fjeAI4HUwWz8iQbIvsrYM5VTw3HSbp\n Fs2EebG4dpnGPYL0hM4n3SfcXyDsLhTmzTBvA3eI86VKn6MK0lshfao/kt9x/pjk7ydFW7lG\n vIt0rl4W99+EuQ58BEh3jP3bBW1oVxHObjjeCfQB7B7bG8DXYJ5OelYwvwS+Ath9fuY0KT4O\n E88dKcxjYJIs8NswT5WeVSG/k/0zYOcccL54nuLvh+QHmD8V5jJA8fILnP8Lz10N87eAdMRu\n grlY9Bfo/AGYfwYrxPl9eOdqHK8l/+D47zDfFv76AOZmyFeTcLwVzB1AL9AXDAT7gSFgGBgB\n yH87ks4ZjseK86+CcdQ+a8JI90/GvQniPtufjPOp4vkLYc4Gc8Hl4NfgesP7Fin3OE3uwvVl\n 4BGwQrKzGsd/BS+C18Hb4APhdif0J7sC1unbHsf83C7SMd3vh/O9yC4YCoaBQ8Aoyd4YHB8J\n jgUngVMBlQ8qG2dI9nScg/sXgJngYsnupTi+EvxG+DMnXI7UuCZuNPjn9pqwboxQOeXwc50Q\n gyUinh8wxPfDFfeW4/qqAvmmaVDb6PvsGiX+XvLM2/1Qb76xEZeLGOlEdTC1i+tEnNMx1Z8f\n ivPOGJtvDXYEJNfw9eeueL4uHLvDziBA/Rb5+gG4Rvq0n5feQTKJXHp8rlBfaiT8R7KcKnnV\n 4Yb42BQ4wjL9joG9E8Apjul9uBL3TS+/kxC+74LzGpAvTHl7BvznUyYuwnM05iGoLM/F+Tzl\n XdyHqStbZM4S5/PxjoXgJvEuWqvAdkmuKIeL6hV5TET9e6r/qsJPazHIvBfveQgsF248BXMF\n 1YcOcXGERXv4AslIPeNXhuL3TVFnroO5HmwB2WtT8j21Mdsa/NMT93qDDevFkJ79Fbsb1s7g\n 2hDLMFE/cZh434iAeKD3jDY8T/fHGu5TuMfVuH+y8KeOCeJZPp+cIU1JD4fcmiq5NVvIIaqe\n oXJyIezPBpeAK8AC8Xxvi/5YXd1+A951C6C1R4uFeTdMurdMmC78Cc+sBM+ANdLzNF/xBlgH\n PpKud8G8xXagB9gZ9AF0fQ+Yg8QxcQCOh4rz4TBHimM5TQ/HNT5egHDQfdZFOkrcI/nEcTge\n Dyh+JsKcIt41TZgzYM5S3j9H8gsxD+dXSe4x10rXrleeyc2iwu6XhsJ/F8WBqMeJ/ysfBpaJ\n PNKReXzzThvYDKd1YFn0hscg/tsALZ21ec4GsTS0hWLZou4kDX9oaELHdI1EeiT24ntUtVGX\n g0yq7igpbCD7BL2HIXfl89RQWCgMHJ7ckPuUlpj63XBO8Y9pyE2aTf2nK5NQC4hWvuvoKfIl\n lXkqGwzlz50EfMx1BOVhztP8HNvdWXlWhp6Xz8ndlOWN/V6K0u43Dc4fch7gc9s4U/OU/Azn\n vZLkKrdNheqTKnzeVxff/FOvc19D/dW9SzZjkuKdMfPmxlrn5Ix3mzzWBKhs9NL4l9rxqj5J\n 06HwcD6W8zQf01iDzLrfLhmpc1vNVza/qvGXnP7UZ2PUcZlLnHOcksk0KZ+nyGe2412KW13c\n p65rOQ3qwmCyo8afzi7bsY2PmPV4yfYqZl7qKO1F6nhyreNs6rvY+S9XnOjaai7TssxAHqfn\n 8GuV/9XrVfZi5PVcZaXK367u636hfuP8bCtL8u3np+6vURhK9BObUPZjxm+scZ0810DkrFfV\n 8uY6zgotWy5ygSq35DJYlyZqedWVX5s2UTeeqQqT6pZr+vJ4QRc/fF1uj6rCZYprU1hypG/d\n sRznpnS1Sd+6dKzLa3X5wzZ9dfWEa5/Mtfzq0qRE+vqWX10eqErfkL6tOubxLb8s1zG54RLO\n nPWzb/3pkl9z1J8ufcQqP9fl9ao6w9Re6cKsS7u6a3Xto2s81NWvpjxqW/5s5IEpxpncTtr2\n 4XPWpbHGWa79Idv0NMWZKR5i1aemn+38oxwum2dKpm+M9jJm+pr6RrHSV9eH9dXnyN0XijEO\n i5GedX16VzluqvZXHr9UpY1P/9a1zSs176m2kbb+NY13qvKLjYwqtP1V/eLT//5kQ1B/1G8I\n eZ/LfA3LgUzxw8dVcZYiLuvcjB33IX7wybe6NKM+gox8jfRq+JjSi87l+ViGrut0buvaqdhy\n QPKj3MawSbqApBfLZoi81kcuXqV3XXc9VHbeBH0L+nF5N7W/Nm2NnBer+rasD9bEute1flTD\n lst9Ux1vK8PWjZFD+x27Fma3wvQujG/fMFQ/0iX/hD7f9PClnr9OHX8+Mh65PTS1Iyn9UULX\n M/b8vq9uKf9ID7KkjkvOtOe+om/8cxvu6meXubpY+jcuc0Wx3TeNBVOH33e+LKQ+rZM55pQd\n cNz3kc4578rygFhy7Fj1H4872f88FpD1hNV1Iy76tbnr35Dyn1v3yCT3KhEnJdpnG1mui46u\n ryzBNNaiH5eH0HFfbPlWqvouVX0ZKjdW65S68XQqfWC1nJSUO8eoj0OfjxGGUjI1V/erZGIh\n P507n8qIa7z1tXinLK/sZwnb/7TS7+drNtj43+Y9sttN00121aMOnR+wTb/UuIZ/d4FrfydV\n PSOXCRmf+jfl/E9KuUMpuVPMfnKMdQIucze69X6m8YPvngAl9yOwqWNt5Wsu+hSp9xRoytr0\n UN3tunhPHQ91brDsoqqOZSivyed7iDzXX8p/JJ8le2QSA4C8lwntkcP7bvGxfC7bJfaUIDd5\n j7CqsiCv/dYh+4HcIbkTYdpLgOWwbNdk31R/k/tqnKpy2oGB43o1H9js0cPhk/ebUfegsZVT\n h8pW5D2aVNQ9nFzQPStf4+MQN4jYfZ4Q+TDndzUNTfqAVfs7uazFtc03KfaP0u3LZYvP877u\n ++6zpf5SuOfiJ9+w6PylXtPdZ1Pdx80UZ1VxoYahLl/Y7tflUxbqwhyr7OjioCpuTOexymmM\n 99vGWe5960LdoT5PrDlkNn39yrIdFzdTxKkqa0o9n5NyfjbFL6T9i03O9jTEjVT9CZt61qWe\n DAmTbX1rkw4ubWysflyu/Uh19Utdv8QUb/wevs/vlN3YK0J95hvGWP26FP0CXV0ix6XOfmi8\n lNw7tlSc284PqXnZlKf5umpfVx7Ue3K5q4onnT9079H5h8ubyX5VGZHfIVOiPynLz2RkPSTV\n /2p/0NZM2Ufw7dPm3tveJp46kn5prDC7miXDUCoOc7QdKeU9KeZZbNZTsw6ZKjPna6G6jLZ6\n v6Y9S0rqHMbaN8j3flUbVIdpnonTleaP+JsiapunntfVOer7WUdXNw+jCyvNYxE6P9Ix+7Mu\n TCa3uM3mb9JUmfLe1q59N19yulXnD5dfU/yRyn/8vR2Cr9H8JB/btsm29undfCw/56tbVmVX\n d53nXtV0+Iw4rjNTk8udOvdtwl13j1B1YuT5b04HMpsW/7HCr8t/dF0Of846J3W9HPtdNnUf\n x7UvpdsiV1mJjawiFLWODEm73G1mLF1J2/GB7X7UtvqhJeeTfPc4T7mPtLpuWqWJ66malIZV\n Oq6uerCp9Oh1dlzCzrpIudKf92/hsZbP+hIbHa0Q/fQYe/v4lmd5T5s6veq6vYViyzJT69KV\n 2t/FlN451zKFrm3i9U0264J0fQOX9U5Vfe6S+xPRL8VaHJe8rK69qpNJqe92jX81XX3X2fr8\n XPaHsq1PdPWWa12Sag1GaXmwT98pZ/2vy8+h7e8gsHdGcrvn+ou5l5j6K7GfmPobXJiY4xLb\n d9C3GKnM2H7Xkd7j+z1I03X5ftWxjd9KwDLy0mNPV/fUtSCh4wyeF5DXS8nzWnSd9Jqrfrye\n UWfa3NP1O131E9TnTDItvs/rn9Qwm9y3lS/yuiSdDK2J32LmH61l4/l7DpMcFl0cy/HpKvNU\n 5Z6yuzmgsPj4PZX78jydfMzx1BFk7Gr61smlU9yXf7w+UL7Pa5Fc9pe3lTntI+YJYvTvQ9Y9\n x9gbNOU66lxyYJPsuqPtBRpjvW7uX6n9Y3LpfMUe8+fYy6sJ+99x2QyVR1TJrEvlz9Lxmzq8\n Kct+jO8mpnIrV35pYv3rso+6j2w1RzkxpWeOslpV38Xey7lJ7XVVnDdFVyDn2o2m7A1s871r\n U3+hbp661LfjbL6l6vL9O5v5uiqdcd/9mG3sVrlrktHl3m+5Ln46Qply/f51rDq2afV3U92P\n 9Z2CVPu71+kExf4uhm265Mpfcrjl9S+p/WGjb9FEeYmrHlhsXTLb772b2v3U8bKvoAk6VaQ3\n ZdqvWf2FytNd9g1W/c57VNf9+JuMuXT+ZJ1tnZ6T7U+un1PXpSm/BxKiZ+b6nUC5P+bybdoU\n 3wWR9zP1WcOrrtc06dG7rA9gf6lzCCVlQKl1cKvW16r7MjdxPqHue3m55l5M6yRy1q8p6i+d\n GzbfR5Dtqeeu1D2rulVlp+67ulXfzlDPqS/AP52us+kb5aoetdp226wrqOtHuvxc9InlsMrX\n 5HCkgvtULt80VtPB5tvHlLbU51R1leQ+nW0ftknjClM7Ktf7Pt9n161FKfULHbeU/P5brO/5\n 8PeveZ2l+s31OpmmizxP5z/VrssvNP7Vb9XbUGr+LWSdWKr4c/lemct7U/1KfJcs5nfiXNcz\n Va3lCf2OXi75c+gaSd/4SyH/pmds+8G2fWCbvmwMeZapf6v2g9hU16vF7l/65K8cc6uh7bIs\n W8jdLyyxp4BPPOru6+Qx8rd8beIyhew8xjoMtU8l90dcyldseUOJPpPLevpc7ZnvL8f4oaRO\n ad34WVeefPYVSdG+27T7vPdESj0VV5leyvXoufQvffKZTpZmGy+27UNKfYCc5dWmj2fbp44Z\n P6G/WN9X1cl8beoieS7ad7+PGP14nz1ATO1q3Xx2jHnpWO1xR1uPovumYQndrFD9uyrdvpD4\n b9L8Yaz9wxl5bbVu/XlT9j2X/Rr6Hl7brYPd0V1jM5bOk+84oUn7xpeeH7IhVJ7j25+IrU9s\n ig+XOi7lGMtGj9pGB903/kuMQVPuORpjv7+c35AvvYYkNO1CviFvU4/HkF+qe2ZTG+VTn1bt\n fV7y5/PtqNR76oeuy4zlH3n/9ND3qPuxu7xb3cuj7heahiXq4ljrC1R5vm5M39HGFz7yzRLr\n k1PoMMfcPzeGvDPWPssxw6Rzo8QcXmp3XGSSHX2/Et08k67f5dtmuupKN2FvMpOsKObeDnVx\n k3ofp1h6VrFIVVdV7T2fYm9013l7k/5rbNlKaBuXso7LLV+K1d67uuWiJ19ShhcjvUP97FsO\n Q+V7pdfDpy5rtv2qEPkU7XFY0v3Q+Oc8FpqHdHV9Xf415XFbPTPfPk7qNWsufow9vkqlz6v+\n eA4udH9l3XxtiA5ZyN5XpvxSNzdetRdQlWnKjzbP695Xt9+WTz/bJk5y6tDVlYHUe0Crv9Bv\n vMf+bnzq79DHenfs/ZD3y4TO7b0S7vPM8Z5yL2mTG1XXKcyMLh5093OzvwbVfzr/1hHDby7u\n ufhH5z/Vrm1YZPsheUtn2pQh+RnfMmCqy3PN7aSeN0oRtrp8m6oONOXflHVfrnj0ccdU1lVS\n yYu7Ssjz96ZwxEgz13rX1c3Y+Sp2vJve7eN+zP3nYsojYunAhMq1cs2vM1X9J99+Q2g+d+1z\n 5OznpXJD1zcKcc/U33KN39TzgCnr4lz95Fz1cW79kxT6SDF00UruT5ZDZ8Xl9x83MV0I0CwB\n AB+LCAC4xcFoAgMdjksWhCAMBO/CelYzJ4gMCqiI4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), et = Object.fromEntries($e.values.map((e, t) => [e, t])), { values: tt } = $e, { AI: nt, AL: rt, CJ: it, CM: at, NS: ot, SA: st, SG: ct, SP: lt, XX: ut } = et;
|
|
3344
|
+
function dt(e) {
|
|
3345
|
+
switch (e) {
|
|
3346
|
+
case null: return null;
|
|
3347
|
+
case -1: return "sot";
|
|
3348
|
+
case -2: return "eot";
|
|
3349
|
+
default: return tt[e];
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
function ft(e, t) {
|
|
3353
|
+
switch (e) {
|
|
3354
|
+
case nt:
|
|
3355
|
+
case ct:
|
|
3356
|
+
case ut: return rt;
|
|
3357
|
+
case st: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? at : rt;
|
|
3358
|
+
case it: return ot;
|
|
3359
|
+
}
|
|
3360
|
+
return e;
|
|
3361
|
+
}
|
|
3362
|
+
var pt = class {
|
|
3363
|
+
cp = -Infinity;
|
|
3364
|
+
cls = -1;
|
|
3365
|
+
char = "";
|
|
3366
|
+
len = 0;
|
|
3367
|
+
ignored = !1;
|
|
3368
|
+
constructor(e, t, n, r) {
|
|
3369
|
+
this.cls = e, this.cp = t, this.char = n, this.len = r;
|
|
3370
|
+
}
|
|
3371
|
+
[Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
|
|
3372
|
+
return `${dt(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
|
|
3373
|
+
}
|
|
3374
|
+
}, mt = class {
|
|
3375
|
+
str = "";
|
|
3376
|
+
len = 0;
|
|
3377
|
+
prevChunk = 0;
|
|
3378
|
+
prev = new pt(-1, -Infinity, "", 0);
|
|
3379
|
+
cur = new pt(-1, -Infinity, "", 0);
|
|
3380
|
+
next = new pt(-1, -Infinity, "", 0);
|
|
3381
|
+
LB8 = !1;
|
|
3382
|
+
spaces = !1;
|
|
3383
|
+
RI = 0;
|
|
3384
|
+
props = void 0;
|
|
3385
|
+
extra = {};
|
|
3386
|
+
constructor(e) {
|
|
3387
|
+
this.str = e, this.len = e.length;
|
|
3388
|
+
}
|
|
3389
|
+
push(e) {
|
|
3390
|
+
this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
|
|
3391
|
+
}
|
|
3392
|
+
pushEnd() {
|
|
3393
|
+
this.push(new pt(-2, Infinity, "", this.next.len));
|
|
3394
|
+
}
|
|
3395
|
+
*codePoints(e, t = !0) {
|
|
3396
|
+
if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
|
|
3397
|
+
else {
|
|
3398
|
+
let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = $e.get(t);
|
|
3399
|
+
e += n.length, yield new pt(ft(r, n), t, n, e);
|
|
3400
|
+
}
|
|
3401
|
+
else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
|
|
3402
|
+
else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
|
|
3403
|
+
else {
|
|
3404
|
+
let t = e - 1, n = this.str.charCodeAt(t);
|
|
3405
|
+
n >= 56320 && n <= 57343 && t--;
|
|
3406
|
+
let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
|
|
3407
|
+
yield new pt(ft($e.get(r), i), r, i, e), e = t;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
classAfterSpaces(e) {
|
|
3411
|
+
for (let { cls: t } of this.codePoints(e)) if (t !== lt) return t;
|
|
3412
|
+
return -2;
|
|
3413
|
+
}
|
|
3414
|
+
afterNext(e = 1) {
|
|
3415
|
+
for (let t of this.codePoints(this.next.len)) if (--e <= 0) return t;
|
|
3416
|
+
return null;
|
|
3417
|
+
}
|
|
3418
|
+
setProp(e, t) {
|
|
3419
|
+
this.props ||= {}, this.props[e] = t;
|
|
3420
|
+
}
|
|
3421
|
+
[Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
|
|
3422
|
+
let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
|
|
3423
|
+
return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
|
|
3424
|
+
}
|
|
3425
|
+
}, ht = class {
|
|
3426
|
+
string = void 0;
|
|
3427
|
+
props = void 0;
|
|
3428
|
+
constructor(e, t = !1) {
|
|
3429
|
+
this.position = e, this.required = t;
|
|
3430
|
+
}
|
|
3431
|
+
}, gt = Qe.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
|
|
3432
|
+
Object.fromEntries(gt.values.map((e, t) => [e, t]));
|
|
3433
|
+
var { values: _t } = gt, { AK: vt, AL: W, AP: yt, AS: bt, B2: xt, BA: G, BB: St, BK: Ct, CB: wt, CL: Tt, CM: Et, CP: Dt, CR: Ot, EB: kt, EM: At, EX: jt, GL: Mt, H2: Nt, H3: Pt, HH: Ft, HL: K, HY: It, ID: Lt, IN: Rt, IS: zt, JL: Bt, JT: Vt, JV: Ht, LF: Ut, NU: q, OP: Wt, NL: Gt, NS: Kt, PO: qt, PR: Jt, RI: Yt, SP: J, SY: Xt, QU: Zt, VF: Qt, VI: $t, WJ: en, ZW: tn, ZWJ: nn } = et, rn = /* @__PURE__ */ new Set([
|
|
3434
|
+
W,
|
|
3435
|
+
K,
|
|
3436
|
+
q
|
|
3437
|
+
]), an = /* @__PURE__ */ new Set([
|
|
3438
|
+
Ct,
|
|
3439
|
+
Ot,
|
|
3440
|
+
Ut,
|
|
3441
|
+
Gt,
|
|
3442
|
+
J,
|
|
3443
|
+
tn
|
|
3444
|
+
]), on = /* @__PURE__ */ new Set([
|
|
3445
|
+
Lt,
|
|
3446
|
+
kt,
|
|
3447
|
+
At
|
|
3448
|
+
]), sn = /* @__PURE__ */ new Set([
|
|
3449
|
+
Bt,
|
|
3450
|
+
Ht,
|
|
3451
|
+
Nt,
|
|
3452
|
+
Pt
|
|
3453
|
+
]), cn = /* @__PURE__ */ new Set([
|
|
3454
|
+
Bt,
|
|
3455
|
+
Ht,
|
|
3456
|
+
Vt,
|
|
3457
|
+
Nt,
|
|
3458
|
+
Pt
|
|
3459
|
+
]), ln = /* @__PURE__ */ new Set([Ht, Vt]), un = /* @__PURE__ */ new Set([
|
|
3460
|
+
J,
|
|
3461
|
+
Mt,
|
|
3462
|
+
en,
|
|
3463
|
+
Tt,
|
|
3464
|
+
Zt,
|
|
3465
|
+
Dt,
|
|
3466
|
+
jt,
|
|
3467
|
+
zt,
|
|
3468
|
+
Xt,
|
|
3469
|
+
Ct,
|
|
3470
|
+
Ot,
|
|
3471
|
+
Ut,
|
|
3472
|
+
Gt,
|
|
3473
|
+
tn
|
|
3474
|
+
]), dn = /* @__PURE__ */ new Set([
|
|
3475
|
+
-1,
|
|
3476
|
+
Ct,
|
|
3477
|
+
Ot,
|
|
3478
|
+
Ut,
|
|
3479
|
+
Gt,
|
|
3480
|
+
Wt,
|
|
3481
|
+
Zt,
|
|
3482
|
+
Mt,
|
|
3483
|
+
J,
|
|
3484
|
+
tn
|
|
3485
|
+
]), Y = Symbol("PASS"), X = Symbol("NO_BREAK"), fn = Symbol("MAY_BREAK"), pn = Symbol("MUST_BREAK");
|
|
3486
|
+
function mn(e) {
|
|
3487
|
+
return e.cur.cls === -1 && e.next.cls !== -2 ? X : Y;
|
|
3488
|
+
}
|
|
3489
|
+
function hn(e) {
|
|
3490
|
+
return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? pn : Y;
|
|
3491
|
+
}
|
|
3492
|
+
function gn(e) {
|
|
3493
|
+
return e.cur.cls === Ct ? pn : Y;
|
|
3494
|
+
}
|
|
3495
|
+
function _n(e) {
|
|
3496
|
+
switch (e.cur.cls) {
|
|
3497
|
+
case Ot: return e.next.cls === Ut ? X : pn;
|
|
3498
|
+
case Ut:
|
|
3499
|
+
case Gt: return pn;
|
|
3500
|
+
}
|
|
3501
|
+
return Y;
|
|
3502
|
+
}
|
|
3503
|
+
function vn(e) {
|
|
3504
|
+
switch (e.next.cls) {
|
|
3505
|
+
case Ct:
|
|
3506
|
+
case Ot:
|
|
3507
|
+
case Ut:
|
|
3508
|
+
case Gt: return X;
|
|
3509
|
+
}
|
|
3510
|
+
return Y;
|
|
3511
|
+
}
|
|
3512
|
+
function yn(e) {
|
|
3513
|
+
return e.cur.cls !== Yt && (e.RI = 0), e.spaces ? (e.next.cls !== J && (e.spaces = !1), X) : Y;
|
|
3514
|
+
}
|
|
3515
|
+
function bn(e) {
|
|
3516
|
+
if (e.next.cls === tn) return X;
|
|
3517
|
+
if (e.next.cls === J) switch (e.cur.cls) {
|
|
3518
|
+
case tn:
|
|
3519
|
+
case Wt:
|
|
3520
|
+
case Zt:
|
|
3521
|
+
case Tt:
|
|
3522
|
+
case Dt:
|
|
3523
|
+
case xt: break;
|
|
3524
|
+
default: return X;
|
|
3525
|
+
}
|
|
3526
|
+
return Y;
|
|
3527
|
+
}
|
|
3528
|
+
function xn(e) {
|
|
3529
|
+
return e.LB8 ? (e.LB8 = !1, fn) : e.cur.cls === tn ? e.next.cls === J ? (e.LB8 = !0, X) : fn : Y;
|
|
3530
|
+
}
|
|
3531
|
+
function Sn(e) {
|
|
3532
|
+
return e.cur.cls === nn ? X : Y;
|
|
3533
|
+
}
|
|
3534
|
+
function Cn(e) {
|
|
3535
|
+
return !an.has(e.cur.cls) && (e.next.cls === Et || e.next.cls === nn) ? (e.next.ignored = !0, X) : Y;
|
|
3536
|
+
}
|
|
3537
|
+
function wn(e) {
|
|
3538
|
+
return e.cur.cls === Et && (e.cur.cls = W), e.next.cls === Et && (e.next.cls = W), Y;
|
|
3539
|
+
}
|
|
3540
|
+
function Tn(e) {
|
|
3541
|
+
return e.next.cls === en || e.cur.cls === en ? X : Y;
|
|
3542
|
+
}
|
|
3543
|
+
function En(e) {
|
|
3544
|
+
return e.cur.cls === Mt ? X : Y;
|
|
3545
|
+
}
|
|
3546
|
+
function Dn(e) {
|
|
3547
|
+
if (e.next.cls === Mt) switch (e.cur.cls) {
|
|
3548
|
+
case J:
|
|
3549
|
+
case G:
|
|
3550
|
+
case It:
|
|
3551
|
+
case Ft: return Y;
|
|
3552
|
+
default: return X;
|
|
3553
|
+
}
|
|
3554
|
+
return Y;
|
|
3555
|
+
}
|
|
3556
|
+
function On(e) {
|
|
3557
|
+
switch (e.next.cls) {
|
|
3558
|
+
case Tt:
|
|
3559
|
+
case Dt:
|
|
3560
|
+
case jt:
|
|
3561
|
+
case Xt: return X;
|
|
3562
|
+
}
|
|
3563
|
+
return Y;
|
|
3564
|
+
}
|
|
3565
|
+
function kn(e) {
|
|
3566
|
+
return e.cur.cls === Wt ? (e.next.cls === J && (e.spaces = !0), X) : Y;
|
|
3567
|
+
}
|
|
3568
|
+
function An(e) {
|
|
3569
|
+
return dn.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === Zt ? (e.spaces = !0, X) : Y;
|
|
3570
|
+
}
|
|
3571
|
+
function jn(e) {
|
|
3572
|
+
if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls === Zt) {
|
|
3573
|
+
let t = e.afterNext();
|
|
3574
|
+
if (!t || un.has(t.cls)) return X;
|
|
3575
|
+
}
|
|
3576
|
+
return Y;
|
|
3577
|
+
}
|
|
3578
|
+
function Mn(e) {
|
|
3579
|
+
return e.cur.cls === J && e.next.cls === zt && e.afterNext()?.cls === q ? fn : Y;
|
|
3580
|
+
}
|
|
3581
|
+
function Nn(e) {
|
|
3582
|
+
return e.next.cls === zt ? X : Y;
|
|
3583
|
+
}
|
|
3584
|
+
function Pn(e) {
|
|
3585
|
+
if (e.cur.cls === Tt || e.cur.cls === Dt) {
|
|
3586
|
+
if (e.classAfterSpaces(e.cur.len) === Kt) return e.next.cls === J && (e.spaces = !0), X;
|
|
3587
|
+
if (e.next.cls === J) return X;
|
|
3588
|
+
}
|
|
3589
|
+
return Y;
|
|
3590
|
+
}
|
|
3591
|
+
function Fn(e) {
|
|
3592
|
+
if (e.cur.cls === xt) {
|
|
3593
|
+
if (e.classAfterSpaces(e.cur.len) === xt) return e.next.cls === J && (e.spaces = !0), X;
|
|
3594
|
+
if (e.next.cls === J) return X;
|
|
3595
|
+
}
|
|
3596
|
+
return Y;
|
|
3597
|
+
}
|
|
3598
|
+
function In(e) {
|
|
3599
|
+
return e.cur.cls === J ? fn : Y;
|
|
3600
|
+
}
|
|
3601
|
+
function Ln(e) {
|
|
3602
|
+
return e.next.cls === Zt && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === Zt && !/^\p{Pf}$/u.test(e.cur.char) ? X : Y;
|
|
3603
|
+
}
|
|
3604
|
+
function Rn(e) {
|
|
3605
|
+
if (!gt.get(e.cur.cp) && e.next.cls === Zt) return X;
|
|
3606
|
+
if (e.next.cls === Zt) {
|
|
3607
|
+
let t = e.afterNext();
|
|
3608
|
+
if (!t || !gt.get(t.cp)) return X;
|
|
3609
|
+
}
|
|
3610
|
+
return e.cur.cls === Zt && !gt.get(e.next.cp) || (e.prev.cls === -1 || !gt.get(e.prev.cp)) && e.cur.cls === Zt ? X : Y;
|
|
3611
|
+
}
|
|
3612
|
+
function zn(e) {
|
|
3613
|
+
return e.cur.cls === wt || e.next.cls === wt ? fn : Y;
|
|
3614
|
+
}
|
|
3615
|
+
var Bn = /* @__PURE__ */ new Set([
|
|
3616
|
+
-1,
|
|
3617
|
+
Ct,
|
|
3618
|
+
Ot,
|
|
3619
|
+
Ut,
|
|
3620
|
+
Gt,
|
|
3621
|
+
J,
|
|
3622
|
+
tn,
|
|
3623
|
+
wt,
|
|
3624
|
+
Mt
|
|
3625
|
+
]);
|
|
3626
|
+
function Vn(e) {
|
|
3627
|
+
return Bn.has(e.prev.cls) && (e.cur.cls === It || e.cur.cls === Ft) && (e.next.cls === W || e.next.cls === K) ? X : Y;
|
|
3628
|
+
}
|
|
3629
|
+
function Hn(e) {
|
|
3630
|
+
if (e.cur.cls === St) return X;
|
|
3631
|
+
switch (e.next.cls) {
|
|
3632
|
+
case G:
|
|
3633
|
+
case Ft:
|
|
3634
|
+
case It:
|
|
3635
|
+
case Kt: return X;
|
|
3636
|
+
}
|
|
3637
|
+
return Y;
|
|
3638
|
+
}
|
|
3639
|
+
function Un(e) {
|
|
3640
|
+
return e.prev.cls === K && (e.cur.cls === It || e.cur.cls === Ft) && e.next.cls !== K ? X : Y;
|
|
3641
|
+
}
|
|
3642
|
+
function Wn(e) {
|
|
3643
|
+
return e.cur.cls === Xt && e.next.cls === K ? X : Y;
|
|
3644
|
+
}
|
|
3645
|
+
function Gn(e) {
|
|
3646
|
+
return e.next.cls === Rt ? X : Y;
|
|
3647
|
+
}
|
|
3648
|
+
function Kn(e) {
|
|
3649
|
+
switch (e.cur.cls) {
|
|
3650
|
+
case W:
|
|
3651
|
+
case K:
|
|
3652
|
+
if (e.next.cls === q) return X;
|
|
3653
|
+
break;
|
|
3654
|
+
case q: if (e.next.cls === W || e.next.cls === K) return X;
|
|
3655
|
+
}
|
|
3656
|
+
return Y;
|
|
3657
|
+
}
|
|
3658
|
+
function qn(e) {
|
|
3659
|
+
return e.cur.cls === Jt && on.has(e.next.cls) || e.next.cls === qt && on.has(e.cur.cls) ? X : Y;
|
|
3660
|
+
}
|
|
3661
|
+
function Jn(e) {
|
|
3662
|
+
return (e.cur.cls === Jt || e.cur.cls === qt) && (e.next.cls === W || e.next.cls === K) || (e.cur.cls === W || e.cur.cls === K) && (e.next.cls === Jt || e.next.cls === qt) ? X : Y;
|
|
3663
|
+
}
|
|
3664
|
+
var Yn = /* @__PURE__ */ new Set([qt, Jt]), Xn = /* @__PURE__ */ new Set([Tt, Dt]);
|
|
3665
|
+
function Zn(e) {
|
|
3666
|
+
let t = null;
|
|
3667
|
+
if (Yn.has(e.next.cls) ? t = Xn.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === q && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
|
|
3668
|
+
case Xt:
|
|
3669
|
+
case zt: continue;
|
|
3670
|
+
case q: return X;
|
|
3671
|
+
default: break SyIsLoop;
|
|
3672
|
+
}
|
|
3673
|
+
if (e.cur.cls === qt || e.cur.cls === Jt) {
|
|
3674
|
+
if (e.next.cls === Wt) {
|
|
3675
|
+
let t = e.afterNext();
|
|
3676
|
+
if (t && (t.cls === q || t.cls === zt && e.afterNext(2)?.cls === q)) return X;
|
|
3677
|
+
} else if (e.next.cls === q) return X;
|
|
3678
|
+
}
|
|
3679
|
+
return e.cur.cls === It && e.next.cls === q || e.cur.cls === zt && e.next.cls === q ? X : Y;
|
|
3680
|
+
}
|
|
3681
|
+
function Qn(e) {
|
|
3682
|
+
switch (e.cur.cls) {
|
|
3683
|
+
case Bt:
|
|
3684
|
+
if (sn.has(e.next.cls)) return X;
|
|
3685
|
+
break;
|
|
3686
|
+
case Ht:
|
|
3687
|
+
case Nt:
|
|
3688
|
+
if (ln.has(e.next.cls)) return X;
|
|
3689
|
+
break;
|
|
3690
|
+
case Vt:
|
|
3691
|
+
case Pt: if (e.next.cls === Vt) return X;
|
|
3692
|
+
}
|
|
3693
|
+
return Y;
|
|
3694
|
+
}
|
|
3695
|
+
function $n(e) {
|
|
3696
|
+
switch (e.cur.cls) {
|
|
3697
|
+
case Bt:
|
|
3698
|
+
case Ht:
|
|
3699
|
+
case Vt:
|
|
3700
|
+
case Nt:
|
|
3701
|
+
case Pt:
|
|
3702
|
+
if (e.next.cls === qt) return X;
|
|
3703
|
+
break;
|
|
3704
|
+
case Jt: if (cn.has(e.next.cls)) return X;
|
|
3705
|
+
}
|
|
3706
|
+
return Y;
|
|
3707
|
+
}
|
|
3708
|
+
function er(e) {
|
|
3709
|
+
return (e.cur.cls === W || e.cur.cls === K) && (e.next.cls === W || e.next.cls === K) ? X : Y;
|
|
3710
|
+
}
|
|
3711
|
+
function tr(e) {
|
|
3712
|
+
let { prev: t, cur: n, next: r } = e;
|
|
3713
|
+
function i(e) {
|
|
3714
|
+
return e.cls === vt || e.char === "◌" || e.cls === bt;
|
|
3715
|
+
}
|
|
3716
|
+
return n.cls === yt && i(r) || i(n) && (r.cls === Qt || r.cls === $t) || i(t) && n.cls === $t && (r.cls === vt || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === Qt ? X : Y;
|
|
3717
|
+
}
|
|
3718
|
+
function nr(e) {
|
|
3719
|
+
return e.cur.cls === zt && (e.next.cls === W || e.next.cls === K) ? X : Y;
|
|
3720
|
+
}
|
|
3721
|
+
function rr(e) {
|
|
3722
|
+
switch (e.cur.cls) {
|
|
3723
|
+
case W:
|
|
3724
|
+
case K:
|
|
3725
|
+
case q:
|
|
3726
|
+
if (e.next.cls === Wt && !gt.get(e.next.cp)) return X;
|
|
3727
|
+
break;
|
|
3728
|
+
case Dt: if (!gt.get(e.cur.cp) && rn.has(e.next.cls)) return X;
|
|
3729
|
+
}
|
|
3730
|
+
return Y;
|
|
3731
|
+
}
|
|
3732
|
+
function ar(e) {
|
|
3733
|
+
if (e.cur.cls === Yt) {
|
|
3734
|
+
if (e.next.cls === Yt && ++e.RI % 2 != 0) return X;
|
|
3735
|
+
} else e.RI = 0;
|
|
3736
|
+
return Y;
|
|
3737
|
+
}
|
|
3738
|
+
function or(e) {
|
|
3739
|
+
return e.cur.cls === kt && e.next.cls === At || e.next.cls === At && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? X : Y;
|
|
3740
|
+
}
|
|
3741
|
+
function sr() {
|
|
3742
|
+
return fn;
|
|
3743
|
+
}
|
|
3744
|
+
var cr = [
|
|
3745
|
+
mn,
|
|
3746
|
+
hn,
|
|
3747
|
+
gn,
|
|
3748
|
+
_n,
|
|
3749
|
+
vn,
|
|
3750
|
+
yn,
|
|
3751
|
+
bn,
|
|
3752
|
+
xn,
|
|
3753
|
+
Sn,
|
|
3754
|
+
Cn,
|
|
3755
|
+
wn,
|
|
3756
|
+
Tn,
|
|
3757
|
+
En,
|
|
3758
|
+
Dn,
|
|
3759
|
+
On,
|
|
3760
|
+
kn,
|
|
3761
|
+
An,
|
|
3762
|
+
jn,
|
|
3763
|
+
Mn,
|
|
3764
|
+
Nn,
|
|
3765
|
+
Pn,
|
|
3766
|
+
Fn,
|
|
3767
|
+
In,
|
|
3768
|
+
Ln,
|
|
3769
|
+
Rn,
|
|
3770
|
+
zn,
|
|
3771
|
+
Vn,
|
|
3772
|
+
Un,
|
|
3773
|
+
Hn,
|
|
3774
|
+
Wn,
|
|
3775
|
+
Gn,
|
|
3776
|
+
Kn,
|
|
3777
|
+
qn,
|
|
3778
|
+
Jn,
|
|
3779
|
+
Zn,
|
|
3780
|
+
Qn,
|
|
3781
|
+
$n,
|
|
3782
|
+
er,
|
|
3783
|
+
tr,
|
|
3784
|
+
nr,
|
|
3785
|
+
rr,
|
|
3786
|
+
ar,
|
|
3787
|
+
or,
|
|
3788
|
+
sr
|
|
3789
|
+
], lr = class {
|
|
3790
|
+
#e;
|
|
3791
|
+
constructor(e = {}) {
|
|
3792
|
+
if (this.#e = {
|
|
3793
|
+
string: !1,
|
|
3794
|
+
example7: !1,
|
|
3795
|
+
verbose: !1,
|
|
3796
|
+
...e
|
|
3797
|
+
}, this.rules = [...cr], this.#e.example7) throw Error("'example7' flag deprecated");
|
|
3798
|
+
this.#e.verbose && this.rules.unshift((e) => (console.log(e.cur.len, e), Y));
|
|
3799
|
+
}
|
|
3800
|
+
removeRule(...e) {
|
|
3801
|
+
let t = [];
|
|
3802
|
+
return this.rules = this.rules.filter((n) => !e.includes(n.name) || (t.push(n), !1)), t;
|
|
3803
|
+
}
|
|
3804
|
+
addRuleAfter(e, ...t) {
|
|
3805
|
+
let n = this.rules.findIndex((t) => t.name === e);
|
|
3806
|
+
if (n === -1) throw Error(`Rule not found: "${e}"`);
|
|
3807
|
+
return this.rules.splice(n + 1, 0, ...t), n + 1;
|
|
3808
|
+
}
|
|
3809
|
+
addRuleBefore(e, ...t) {
|
|
3810
|
+
let n = this.rules.findIndex((t) => t.name === e);
|
|
3811
|
+
if (n === -1) throw Error(`Rule not found: "${e}"`);
|
|
3812
|
+
return this.rules.splice(n, 0, ...t), n;
|
|
3813
|
+
}
|
|
3814
|
+
replaceRule(e, ...t) {
|
|
3815
|
+
let n = this.rules.findIndex((t) => t.name === e);
|
|
3816
|
+
if (n === -1) throw Error(`Rule not found: "${e}"`);
|
|
3817
|
+
return this.rules.splice(n, 1, ...t);
|
|
3818
|
+
}
|
|
3819
|
+
#t(e) {
|
|
3820
|
+
for (let t of this.rules) {
|
|
3821
|
+
let n = t.call(this, e);
|
|
3822
|
+
switch (n) {
|
|
3823
|
+
case Y: break;
|
|
3824
|
+
case X: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
|
|
3825
|
+
case fn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new ht(e.cur.len);
|
|
3826
|
+
case pn: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new ht(e.cur.len, !0);
|
|
3827
|
+
default: throw Error(`Invalid state: "${n}"`);
|
|
3828
|
+
}
|
|
3829
|
+
}
|
|
3830
|
+
return null;
|
|
3831
|
+
}
|
|
3832
|
+
*#n(e) {
|
|
3833
|
+
let t = this.#t(e);
|
|
3834
|
+
t && (this.#e.string && (t.string = e.str.slice(e.prevChunk, e.cur.len)), e.props &&= (t.props = e.props, void 0), yield t, e.prevChunk = e.cur.len);
|
|
3835
|
+
}
|
|
3836
|
+
*breaks(e) {
|
|
3837
|
+
let t = new mt(e);
|
|
3838
|
+
for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
|
|
3839
|
+
t.pushEnd(), yield* this.#n(t);
|
|
3840
|
+
}
|
|
3841
|
+
};
|
|
3842
|
+
//#endregion
|
|
3843
|
+
//#region src/text-layout.ts
|
|
3844
|
+
function ur(e, t) {
|
|
3845
|
+
let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = /* @__PURE__ */ new Set([0]);
|
|
3846
|
+
for (let t of n.segment(e)) r.add(t.index + t.segment.length);
|
|
3847
|
+
return r;
|
|
3848
|
+
}
|
|
3849
|
+
var dr = class {
|
|
3850
|
+
#e = new lr();
|
|
3851
|
+
#t;
|
|
3852
|
+
constructor(e = "ja") {
|
|
3853
|
+
this.#t = e;
|
|
3854
|
+
}
|
|
3855
|
+
getBreakOpportunities(e) {
|
|
3856
|
+
let t = ur(e, this.#t), n = /* @__PURE__ */ new Map();
|
|
3857
|
+
for (let r of this.#e.breaks(e)) t.has(r.position) && n.set(r.position, (n.get(r.position) ?? !1) || r.required);
|
|
3858
|
+
return Object.freeze([...n].sort(([e], [t]) => e - t).map(([e, t]) => Object.freeze({
|
|
3859
|
+
position: e,
|
|
3860
|
+
required: t
|
|
3861
|
+
})));
|
|
3862
|
+
}
|
|
3863
|
+
}, fr = /* @__PURE__ */ new Map(), pr = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
|
|
3864
|
+
function mr(e) {
|
|
3865
|
+
let t = fr.get(e);
|
|
3866
|
+
if (t) return t;
|
|
3867
|
+
let n = new dr(e);
|
|
3868
|
+
return fr.set(e, n), n;
|
|
3869
|
+
}
|
|
3870
|
+
function hr(e, t) {
|
|
3871
|
+
if (!Number.isFinite(e) || e < 0) throw TypeError(`${t} must return a non-negative finite number.`);
|
|
3872
|
+
return e;
|
|
3873
|
+
}
|
|
3874
|
+
function gr(e, t, n) {
|
|
3875
|
+
let r = /* @__PURE__ */ new Map();
|
|
3876
|
+
for (let i of t.getBreakOpportunities(e)) {
|
|
3877
|
+
let { position: t, required: a } = i;
|
|
3878
|
+
!Number.isInteger(t) || t <= 0 || t > e.length || !n.has(t) || r.set(t, (r.get(t) ?? !1) || a);
|
|
3879
|
+
}
|
|
3880
|
+
return r.set(e.length, !0), [...r].sort(([e], [t]) => e - t).map(([e, t]) => ({
|
|
3881
|
+
position: e,
|
|
3882
|
+
required: t
|
|
3883
|
+
}));
|
|
3884
|
+
}
|
|
3885
|
+
function _r(e, t, n, r, i) {
|
|
3886
|
+
if (e.length === 0) return [{
|
|
3887
|
+
text: "",
|
|
3888
|
+
start: t,
|
|
3889
|
+
end: t,
|
|
3890
|
+
width: 0
|
|
3891
|
+
}];
|
|
3892
|
+
let a = ur(e, i), o = [...a].sort((e, t) => e - t), s = gr(e, r, a), c = [], l = 0;
|
|
3893
|
+
for (; l < e.length;) {
|
|
3894
|
+
let r = s.find((e) => e.position > l && e.required)?.position ?? e.length, i, a = 0;
|
|
3895
|
+
for (let t of s) {
|
|
3896
|
+
if (t.position <= l || t.position > r) continue;
|
|
3897
|
+
let o = e.slice(l, t.position), s = hr(n.measureText(o), "measureText");
|
|
3898
|
+
s <= n.maxWidth && (i = t.position, a = s);
|
|
3899
|
+
}
|
|
3900
|
+
if (i === void 0) {
|
|
3901
|
+
let t = o.filter((e) => e > l && e <= r);
|
|
3902
|
+
for (let r of t) {
|
|
3903
|
+
let t = e.slice(l, r), o = hr(n.measureText(t), "measureText");
|
|
3904
|
+
o <= n.maxWidth && (i = r, a = o);
|
|
3905
|
+
}
|
|
3906
|
+
i === void 0 && (i = t[0] ?? r, a = hr(n.measureText(e.slice(l, i)), "measureText"));
|
|
3907
|
+
}
|
|
3908
|
+
c.push({
|
|
3909
|
+
text: e.slice(l, i),
|
|
3910
|
+
start: t + l,
|
|
3911
|
+
end: t + i,
|
|
3912
|
+
width: a
|
|
3913
|
+
}), l = i;
|
|
3914
|
+
}
|
|
3915
|
+
return c;
|
|
3916
|
+
}
|
|
3917
|
+
function vr(e) {
|
|
3918
|
+
if (typeof e.text != "string") throw TypeError("text must be a string.");
|
|
3919
|
+
if (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw TypeError("maxWidth must be a positive finite number.");
|
|
3920
|
+
if (typeof e.measureText != "function") throw TypeError("measureText must be a function.");
|
|
3921
|
+
let t = e.locale ?? "ja", n = e.lineBreakProvider ?? mr(t), r = [], i = 0;
|
|
3922
|
+
for (let a of e.text.matchAll(pr)) {
|
|
3923
|
+
let o = a.index;
|
|
3924
|
+
r.push(..._r(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
|
|
3925
|
+
}
|
|
3926
|
+
return r.push(..._r(e.text.slice(i), i, e, n, t)), Object.freeze({
|
|
3927
|
+
lines: Object.freeze(r.map((e) => Object.freeze(e))),
|
|
3928
|
+
maxLineWidth: Math.max(0, ...r.map((e) => e.width))
|
|
3929
|
+
});
|
|
3930
|
+
}
|
|
3931
|
+
//#endregion
|
|
3932
|
+
//#region src/reveal.ts
|
|
3933
|
+
var yr = Object.freeze([
|
|
3934
|
+
"CHARACTER",
|
|
3935
|
+
"WORD",
|
|
3936
|
+
"LINE",
|
|
3937
|
+
"BLOCK"
|
|
3938
|
+
]);
|
|
3939
|
+
function br(e) {
|
|
3940
|
+
let t = globalThis.Intl?.Segmenter;
|
|
3941
|
+
return typeof t == "function" ? [...new t(void 0, { granularity: "grapheme" }).segment(e)].map(({ segment: e }) => e) : Array.from(e);
|
|
3942
|
+
}
|
|
3943
|
+
function xr(e) {
|
|
3944
|
+
if (typeof e != "string" || !yr.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
|
|
3945
|
+
return e;
|
|
3946
|
+
}
|
|
3947
|
+
function Sr(e) {
|
|
3948
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Bubble reveal must be an object.");
|
|
3949
|
+
let t = e, n = /* @__PURE__ */ new Set([
|
|
3950
|
+
"unit",
|
|
3951
|
+
"delimiters",
|
|
3952
|
+
"showDelimiters",
|
|
3953
|
+
"layout",
|
|
3954
|
+
"intervalSeconds",
|
|
3955
|
+
"sound"
|
|
3956
|
+
]);
|
|
3957
|
+
if (Object.keys(t).filter((e) => !n.has(e)).length > 0 || t.unit === void 0) throw TypeError("Bubble reveal has unknown or missing properties.");
|
|
3958
|
+
let r = xr(t.unit), i = t.delimiters ?? " \\t\\r\\n";
|
|
3959
|
+
if (typeof i != "string" || i.length === 0) throw TypeError("Bubble WORD delimiters must be a non-empty string.");
|
|
3960
|
+
let a = t.showDelimiters ?? !1;
|
|
3961
|
+
if (typeof a != "boolean") throw TypeError("Bubble reveal showDelimiters must be boolean.");
|
|
3962
|
+
let o = t.layout ?? "DYNAMIC";
|
|
3963
|
+
if (o !== "DYNAMIC" && o !== "RESERVED") throw TypeError("Bubble reveal layout must be DYNAMIC or RESERVED.");
|
|
3964
|
+
let s = t.intervalSeconds ?? 0;
|
|
3965
|
+
if (typeof s != "number" || !Number.isFinite(s) || s < 0) throw TypeError("Bubble reveal intervalSeconds must be zero or greater.");
|
|
3966
|
+
let c = t.sound;
|
|
3967
|
+
if (c !== void 0 && (typeof c != "string" || c.trim() === "")) throw TypeError("Bubble reveal sound must be a non-empty asset name.");
|
|
3968
|
+
return Object.freeze({
|
|
3969
|
+
unit: r,
|
|
3970
|
+
delimiters: i,
|
|
3971
|
+
showDelimiters: a,
|
|
3972
|
+
layout: o,
|
|
3973
|
+
intervalSeconds: s,
|
|
3974
|
+
...c === void 0 ? {} : { sound: c.trim() }
|
|
3975
|
+
});
|
|
3976
|
+
}
|
|
3977
|
+
function Cr(e, t, n) {
|
|
3978
|
+
let r = new Set(br(t)), i = [], a = "";
|
|
3979
|
+
for (let t of br(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
|
|
3980
|
+
return a.length > 0 && i.push(a), i.filter((e) => e.length > 0);
|
|
3981
|
+
}
|
|
3982
|
+
function wr(e, t) {
|
|
3983
|
+
if (e.length === 0) return Object.freeze([""]);
|
|
3984
|
+
if (t.unit === "CHARACTER") return Object.freeze(br(e));
|
|
3985
|
+
if (t.unit === "WORD") {
|
|
3986
|
+
let n = Cr(e, t.delimiters, t.showDelimiters);
|
|
3987
|
+
if (t.showDelimiters) return Object.freeze(n);
|
|
3988
|
+
let r = [], i = 0;
|
|
3989
|
+
for (let a of n) {
|
|
3990
|
+
let n = e.indexOf(a, i);
|
|
3991
|
+
if (n < 0) r.push(a);
|
|
3992
|
+
else for (r.push(a), i = n + a.length; i < e.length && t.delimiters.includes(e[i] ?? "");) i += 1;
|
|
3993
|
+
}
|
|
3994
|
+
return Object.freeze(r);
|
|
3995
|
+
}
|
|
3996
|
+
let n = t.unit === "LINE" ? /(?<=\n)/u : /\n{2,}/u, r = e.split(n).filter((e) => e.length > 0);
|
|
3997
|
+
if (t.unit === "BLOCK") {
|
|
3998
|
+
let t = [...e.matchAll(/\n{2,}/gu)].map(([e]) => e), n = r.map((e, n) => n < t.length ? `${e}${t[n] ?? ""}` : e);
|
|
3999
|
+
return Object.freeze(n.length > 0 ? n : [e]);
|
|
4000
|
+
}
|
|
4001
|
+
let i = r;
|
|
4002
|
+
return Object.freeze(i.length > 0 ? i : [e]);
|
|
4003
|
+
}
|
|
4004
|
+
function Tr(e, t) {
|
|
4005
|
+
return e.slice(0, Math.max(0, Math.min(t, e.length))).join("");
|
|
4006
|
+
}
|
|
4007
|
+
//#endregion
|
|
4008
|
+
//#region src/composition.ts
|
|
4009
|
+
var Z = class extends Error {
|
|
3344
4010
|
code;
|
|
3345
4011
|
constructor(e, t) {
|
|
3346
4012
|
super(t), this.name = "BubbleCompositionError", this.code = e;
|
|
3347
4013
|
}
|
|
3348
|
-
},
|
|
4014
|
+
}, Er = /* @__PURE__ */ new Set(["say", "think"]), Dr = /* @__PURE__ */ new Set([
|
|
3349
4015
|
"idle",
|
|
3350
4016
|
"talking",
|
|
3351
|
-
"awaiting-
|
|
4017
|
+
"awaiting-continue"
|
|
4018
|
+
]), Or = /* @__PURE__ */ new Set([
|
|
4019
|
+
"fadeIn",
|
|
4020
|
+
"fadeOut",
|
|
4021
|
+
"floatIn",
|
|
4022
|
+
"floatOut",
|
|
4023
|
+
"zoomIn",
|
|
4024
|
+
"zoomOut",
|
|
4025
|
+
"riseUp",
|
|
4026
|
+
"sink",
|
|
4027
|
+
"shake",
|
|
4028
|
+
"explode",
|
|
4029
|
+
"animateBubbleShape"
|
|
4030
|
+
]), kr = /* @__PURE__ */ new Set([
|
|
4031
|
+
"linear",
|
|
4032
|
+
"easeIn",
|
|
4033
|
+
"easeOut",
|
|
4034
|
+
"easeInOut"
|
|
3352
4035
|
]);
|
|
3353
|
-
function
|
|
4036
|
+
function Q(e) {
|
|
3354
4037
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3355
4038
|
}
|
|
3356
|
-
function
|
|
4039
|
+
function Ar(e, t, n, r) {
|
|
3357
4040
|
let i = /* @__PURE__ */ new Set([...t, ...n]), a = t.filter((t) => !Object.prototype.hasOwnProperty.call(e, t)), o = Object.keys(e).filter((e) => !i.has(e));
|
|
3358
|
-
if (a.length > 0 || o.length > 0) throw new
|
|
4041
|
+
if (a.length > 0 || o.length > 0) throw new Z("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
|
|
3359
4042
|
}
|
|
3360
|
-
function
|
|
3361
|
-
if (typeof e != "string" || e.trim().length === 0) throw new
|
|
4043
|
+
function jr(e, t) {
|
|
4044
|
+
if (typeof e != "string" || e.trim().length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
3362
4045
|
return e.trim();
|
|
3363
4046
|
}
|
|
3364
|
-
function
|
|
3365
|
-
if (!
|
|
3366
|
-
if (
|
|
3367
|
-
let r = Object.freeze(e.frames.map((e, n) =>
|
|
3368
|
-
if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new
|
|
4047
|
+
function Mr(e, t, n) {
|
|
4048
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4049
|
+
if (Ar(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
|
|
4050
|
+
let r = Object.freeze(e.frames.map((e, n) => jr(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
|
|
4051
|
+
if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
|
|
3369
4052
|
return Object.freeze({
|
|
3370
4053
|
frames: r,
|
|
3371
4054
|
frameIntervalSeconds: i
|
|
3372
4055
|
});
|
|
3373
4056
|
}
|
|
3374
|
-
function
|
|
3375
|
-
if (!
|
|
3376
|
-
|
|
3377
|
-
let t = e.blink === void 0 ? void 0 :
|
|
4057
|
+
function Nr(e) {
|
|
4058
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
|
|
4059
|
+
Ar(e, ["base"], ["blink", "lipSync"], "Bubble portrait");
|
|
4060
|
+
let t = e.blink === void 0 ? void 0 : Mr(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Mr(e.lipSync, "Bubble portrait lip-sync", 1);
|
|
3378
4061
|
return Object.freeze({
|
|
3379
|
-
base:
|
|
4062
|
+
base: jr(e.base, "Bubble portrait base"),
|
|
3380
4063
|
...t === void 0 ? {} : { blink: t },
|
|
3381
|
-
...n === void 0 ? {} : {
|
|
4064
|
+
...n === void 0 ? {} : { lipSync: n }
|
|
3382
4065
|
});
|
|
3383
4066
|
}
|
|
3384
|
-
function
|
|
3385
|
-
if (!
|
|
3386
|
-
|
|
4067
|
+
function Pr(e, t) {
|
|
4068
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4069
|
+
if (Ar(e, ["name"], [
|
|
4070
|
+
"durationSeconds",
|
|
4071
|
+
"ease",
|
|
4072
|
+
"direction",
|
|
4073
|
+
"count",
|
|
4074
|
+
"relativeScale",
|
|
4075
|
+
"speed",
|
|
4076
|
+
"visualStyle"
|
|
4077
|
+
], t), !Or.has(e.name)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
|
|
4078
|
+
let n = (n, r, i = !1) => {
|
|
4079
|
+
let a = e[n];
|
|
4080
|
+
if (a !== void 0) {
|
|
4081
|
+
if (typeof a != "number" || !Number.isFinite(a) || a < r || i && !Number.isInteger(a)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.${n} is invalid.`);
|
|
4082
|
+
return a;
|
|
4083
|
+
}
|
|
4084
|
+
}, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
|
|
4085
|
+
if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Z("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
|
|
4086
|
+
let c = e.ease ?? "easeInOut";
|
|
4087
|
+
if (typeof c != "string" || !kr.has(c)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
|
|
4088
|
+
let l = e.visualStyle;
|
|
4089
|
+
if (l !== void 0 && (typeof l != "string" || !j.includes(l))) throw new Z("BUBBLE-COMPOSITION-001", `${t}.visualStyle is invalid.`);
|
|
4090
|
+
return Object.freeze({
|
|
4091
|
+
name: e.name,
|
|
4092
|
+
...r === void 0 ? {} : { durationSeconds: r },
|
|
4093
|
+
ease: c,
|
|
4094
|
+
...s === void 0 ? {} : { direction: s },
|
|
4095
|
+
...i === void 0 ? {} : { count: i },
|
|
4096
|
+
...a === void 0 ? {} : { relativeScale: a },
|
|
4097
|
+
...o === void 0 ? {} : { speed: o },
|
|
4098
|
+
...l === void 0 ? {} : { visualStyle: l }
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
function Fr(e) {
|
|
4102
|
+
if (e === void 0) return;
|
|
4103
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
|
|
4104
|
+
Ar(e, [], [
|
|
4105
|
+
"voice",
|
|
4106
|
+
"reveal",
|
|
4107
|
+
"finish"
|
|
4108
|
+
], "Bubble audio");
|
|
4109
|
+
let t = {};
|
|
4110
|
+
for (let n of [
|
|
4111
|
+
"voice",
|
|
4112
|
+
"reveal",
|
|
4113
|
+
"finish"
|
|
4114
|
+
]) {
|
|
4115
|
+
let r = e[n];
|
|
4116
|
+
r !== void 0 && (t[n] = jr(r, `Bubble audio ${n}`));
|
|
4117
|
+
}
|
|
4118
|
+
return Object.freeze(t);
|
|
4119
|
+
}
|
|
4120
|
+
function Ir(e) {
|
|
4121
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
|
|
4122
|
+
Ar(e, ["name", "textStyle"], [
|
|
3387
4123
|
"placement",
|
|
4124
|
+
"maxWidth",
|
|
4125
|
+
"textLocale",
|
|
3388
4126
|
"distance",
|
|
3389
4127
|
"tailLength",
|
|
3390
4128
|
"offset",
|
|
3391
4129
|
"visualStyle",
|
|
3392
4130
|
"portrait",
|
|
3393
|
-
"
|
|
4131
|
+
"continueIndicator",
|
|
4132
|
+
"reveal",
|
|
4133
|
+
"audio",
|
|
4134
|
+
"showAnimation",
|
|
4135
|
+
"hideAnimation"
|
|
3394
4136
|
], "Bubble style");
|
|
3395
|
-
let t = e.portrait === void 0 ? void 0 :
|
|
4137
|
+
let t = e.portrait === void 0 ? void 0 : Nr(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Mr(e.continueIndicator, "Bubble continue indicator", 2), r;
|
|
4138
|
+
if (e.reveal !== void 0) try {
|
|
4139
|
+
r = Sr(e.reveal);
|
|
4140
|
+
} catch (e) {
|
|
4141
|
+
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4142
|
+
}
|
|
4143
|
+
let i = Fr(e.audio), a = e.showAnimation === void 0 ? void 0 : Pr(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : Pr(e.hideAnimation, "Bubble hideAnimation"), s;
|
|
3396
4144
|
try {
|
|
3397
|
-
|
|
4145
|
+
s = _(e.placement ?? "up-right");
|
|
3398
4146
|
} catch (e) {
|
|
3399
|
-
throw new
|
|
4147
|
+
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble placement is invalid.");
|
|
3400
4148
|
}
|
|
3401
|
-
let
|
|
4149
|
+
let c, l, u;
|
|
3402
4150
|
try {
|
|
3403
|
-
|
|
4151
|
+
c = x(e.distance ?? 12), l = S(e.tailLength ?? 18), u = e.offset === void 0 ? y : C(e.offset);
|
|
3404
4152
|
} catch (e) {
|
|
3405
|
-
throw new
|
|
4153
|
+
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble actor-relative transform is invalid.");
|
|
4154
|
+
}
|
|
4155
|
+
let d = e.visualStyle ?? "NORMAL";
|
|
4156
|
+
if (typeof d != "string" || !j.includes(d)) throw new Z("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(d)}`);
|
|
4157
|
+
let f;
|
|
4158
|
+
if (e.maxWidth !== void 0) {
|
|
4159
|
+
if (typeof e.maxWidth != "number" || !Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style maxWidth must be a positive finite number.");
|
|
4160
|
+
f = e.maxWidth;
|
|
3406
4161
|
}
|
|
3407
|
-
let
|
|
3408
|
-
if (typeof s != "string" || !O.includes(s)) throw new X("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(s)}`);
|
|
4162
|
+
let p = e.textLocale === void 0 ? void 0 : jr(e.textLocale, "Bubble style text locale");
|
|
3409
4163
|
return Object.freeze({
|
|
3410
|
-
name:
|
|
3411
|
-
textStyle:
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
4164
|
+
name: jr(e.name, "Bubble style name"),
|
|
4165
|
+
textStyle: jr(e.textStyle, "Bubble text style name"),
|
|
4166
|
+
...f === void 0 ? {} : { maxWidth: f },
|
|
4167
|
+
...p === void 0 ? {} : { textLocale: p },
|
|
4168
|
+
placement: s,
|
|
4169
|
+
distance: c,
|
|
4170
|
+
tailLength: l,
|
|
4171
|
+
offset: u,
|
|
4172
|
+
visualStyle: d,
|
|
3417
4173
|
...t === void 0 ? {} : { portrait: t },
|
|
3418
|
-
...n === void 0 ? {} : {
|
|
4174
|
+
...n === void 0 ? {} : { continueIndicator: n },
|
|
4175
|
+
...r === void 0 ? {} : { reveal: r },
|
|
4176
|
+
...i === void 0 ? {} : { audio: i },
|
|
4177
|
+
...a === void 0 ? {} : { showAnimation: a },
|
|
4178
|
+
...o === void 0 ? {} : { hideAnimation: o }
|
|
3419
4179
|
});
|
|
3420
4180
|
}
|
|
3421
|
-
function
|
|
3422
|
-
if (
|
|
4181
|
+
function Lr(e) {
|
|
4182
|
+
if (e !== void 0) {
|
|
4183
|
+
if (!Q(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
|
|
4184
|
+
return e;
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
function Rr(e) {
|
|
4188
|
+
if (e !== void 0) {
|
|
4189
|
+
if (!Q(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
|
|
4190
|
+
if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
|
|
4191
|
+
if (e.getMimeType !== void 0 && typeof e.getMimeType != "function") throw TypeError("Bubble audio capability getMimeType must be a function.");
|
|
4192
|
+
return e;
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
function zr(e) {
|
|
4196
|
+
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
|
|
3423
4197
|
return e;
|
|
3424
4198
|
}
|
|
3425
|
-
function
|
|
3426
|
-
if (!
|
|
4199
|
+
function Br(e) {
|
|
4200
|
+
if (!Q(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble SVG Text composition must provide setText and releaseTarget.");
|
|
3427
4201
|
return e;
|
|
3428
4202
|
}
|
|
3429
|
-
function
|
|
4203
|
+
function Vr() {
|
|
3430
4204
|
return Object.freeze({
|
|
3431
4205
|
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
3432
4206
|
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
3433
4207
|
});
|
|
3434
4208
|
}
|
|
3435
|
-
function
|
|
3436
|
-
if (!
|
|
4209
|
+
function Hr(e) {
|
|
4210
|
+
if (!Q(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
|
|
3437
4211
|
return e;
|
|
3438
4212
|
}
|
|
3439
|
-
function
|
|
3440
|
-
if (!
|
|
4213
|
+
function Ur(e, t) {
|
|
4214
|
+
if (!Q(e) || typeof e.id != "string" || e.id.length === 0 || typeof e.isStage != "boolean") throw new Z("BUBBLE-COMPOSITION-004", `${t} must provide id and isStage.`);
|
|
3441
4215
|
return e;
|
|
3442
4216
|
}
|
|
3443
|
-
function
|
|
3444
|
-
if (!
|
|
4217
|
+
function Wr(e) {
|
|
4218
|
+
if (!Q(e) || typeof e.drawableID != "number" || !Number.isInteger(e.drawableID) || e.drawableID < 0) throw new Z("BUBBLE-COMPOSITION-004", "Bubble text target must provide a non-negative integer drawableID.");
|
|
3445
4219
|
return e;
|
|
3446
4220
|
}
|
|
3447
|
-
function
|
|
3448
|
-
if (!
|
|
4221
|
+
function Gr(e, t) {
|
|
4222
|
+
if (!Q(e) || !Q(e.targets) || typeof e.setLayerVisible != "function" || typeof e.updateStyle != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new Z("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
|
|
3449
4223
|
let n = e.targets;
|
|
3450
|
-
|
|
4224
|
+
Wr(n.text);
|
|
3451
4225
|
let r = /* @__PURE__ */ new Set(), i = (e, t) => {
|
|
3452
4226
|
let i = n[e];
|
|
3453
4227
|
if (!t && i === void 0) return;
|
|
3454
|
-
let a =
|
|
3455
|
-
if (r.has(a.id)) throw new
|
|
4228
|
+
let a = Ur(i, `Bubble surface ${e}`);
|
|
4229
|
+
if (r.has(a.id)) throw new Z("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
|
|
3456
4230
|
r.add(a.id);
|
|
3457
4231
|
};
|
|
3458
|
-
return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("
|
|
4232
|
+
return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitLipSync", t.portrait?.lipSync !== void 0), i("continueIndicator", t.continueIndicator !== void 0), e;
|
|
4233
|
+
}
|
|
4234
|
+
function Kr(e, t) {
|
|
4235
|
+
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
|
|
4236
|
+
if (!e.isRegistered(t)) throw new Z("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
|
|
4237
|
+
if (!e.getMimeType(t).startsWith("image/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
|
|
3459
4238
|
}
|
|
3460
|
-
function
|
|
3461
|
-
if (
|
|
3462
|
-
if (
|
|
4239
|
+
function qr(e, t) {
|
|
4240
|
+
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
|
|
4241
|
+
if (e.isRegistered?.(t) === !1) throw new Z("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
|
|
4242
|
+
let n = e.getMimeType?.(t);
|
|
4243
|
+
if (n !== void 0 && !n.startsWith("audio/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
|
|
3463
4244
|
}
|
|
3464
|
-
function
|
|
4245
|
+
function Jr(e) {
|
|
3465
4246
|
return [...e.portrait === void 0 ? [] : [
|
|
3466
4247
|
e.portrait.base,
|
|
3467
4248
|
...e.portrait.blink?.frames ?? [],
|
|
3468
|
-
...e.portrait.
|
|
3469
|
-
], ...e.
|
|
4249
|
+
...e.portrait.lipSync?.frames ?? []
|
|
4250
|
+
], ...e.continueIndicator?.frames ?? []];
|
|
4251
|
+
}
|
|
4252
|
+
function Yr(e, t, n) {
|
|
4253
|
+
if (t.maxWidth === void 0) return e;
|
|
4254
|
+
if (typeof n.measureText != "function") throw new Z("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
|
|
4255
|
+
return vr({
|
|
4256
|
+
text: e,
|
|
4257
|
+
maxWidth: t.maxWidth,
|
|
4258
|
+
...t.textLocale === void 0 ? {} : { locale: t.textLocale },
|
|
4259
|
+
measureText: (e) => n.measureText?.({
|
|
4260
|
+
styleName: t.textStyle,
|
|
4261
|
+
text: e
|
|
4262
|
+
}) ?? 0
|
|
4263
|
+
}).lines.map(({ text: e }) => e).join("\n");
|
|
3470
4264
|
}
|
|
3471
|
-
function
|
|
4265
|
+
function Xr(e, t) {
|
|
3472
4266
|
if (e.length === 1) throw e[0];
|
|
3473
4267
|
if (e.length > 1) throw AggregateError(e, t);
|
|
3474
4268
|
}
|
|
3475
|
-
function
|
|
4269
|
+
function Zr(e) {
|
|
3476
4270
|
let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
|
|
3477
4271
|
let n = e.animation.frames[t];
|
|
3478
|
-
n !== void 0 && await e.
|
|
4272
|
+
n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
|
|
3479
4273
|
}, s = (t, n) => {
|
|
3480
4274
|
e.onError?.(t, Object.freeze({
|
|
3481
4275
|
actorKey: e.actorKey,
|
|
@@ -3507,220 +4301,389 @@ function mn(e) {
|
|
|
3507
4301
|
}
|
|
3508
4302
|
});
|
|
3509
4303
|
}
|
|
3510
|
-
function
|
|
3511
|
-
if (!
|
|
3512
|
-
if (
|
|
4304
|
+
function Qr(e) {
|
|
4305
|
+
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
|
|
4306
|
+
if (Ar(e, [
|
|
3513
4307
|
"actor",
|
|
3514
4308
|
"actorKey",
|
|
3515
4309
|
"kind",
|
|
3516
4310
|
"text",
|
|
3517
4311
|
"styleName"
|
|
3518
|
-
], ["animationMode"], "Show bubble input"), !
|
|
3519
|
-
if (typeof e.text != "string") throw new
|
|
4312
|
+
], ["animationMode", "reveal"], "Show bubble input"), !Er.has(e.kind)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
|
|
4313
|
+
if (typeof e.text != "string") throw new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string.");
|
|
3520
4314
|
let t = e.animationMode ?? "talking";
|
|
3521
|
-
if (!
|
|
4315
|
+
if (!Dr.has(t)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
|
|
4316
|
+
let n;
|
|
4317
|
+
if (e.reveal !== void 0) try {
|
|
4318
|
+
n = Sr(e.reveal);
|
|
4319
|
+
} catch (e) {
|
|
4320
|
+
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4321
|
+
}
|
|
3522
4322
|
return {
|
|
3523
4323
|
actor: e.actor,
|
|
3524
|
-
actorKey:
|
|
4324
|
+
actorKey: jr(e.actorKey, "Bubble actor key"),
|
|
3525
4325
|
kind: e.kind,
|
|
3526
4326
|
text: e.text,
|
|
3527
|
-
styleName:
|
|
3528
|
-
animationMode: t
|
|
4327
|
+
styleName: jr(e.styleName, "Bubble style name"),
|
|
4328
|
+
animationMode: t,
|
|
4329
|
+
...n === void 0 ? {} : { reveal: n }
|
|
3529
4330
|
};
|
|
3530
4331
|
}
|
|
3531
|
-
function
|
|
3532
|
-
if (!
|
|
3533
|
-
let t =
|
|
4332
|
+
function $r(e) {
|
|
4333
|
+
if (!Q(e)) throw TypeError("Bubble composition options must be an object.");
|
|
4334
|
+
let t = Lr(e.imageResolver), n = Rr(e.audio), r = Br(e.svgText);
|
|
3534
4335
|
if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
|
|
3535
4336
|
if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
|
|
3536
|
-
let
|
|
3537
|
-
if (
|
|
3538
|
-
},
|
|
3539
|
-
let n = (
|
|
3540
|
-
|
|
4337
|
+
let i = Hr(e.scheduler ?? Vr()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
|
|
4338
|
+
if (c) throw new Z("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
|
|
4339
|
+
}, u = async (e, t) => {
|
|
4340
|
+
let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
|
|
4341
|
+
s.set(e, n);
|
|
3541
4342
|
try {
|
|
3542
4343
|
return await n;
|
|
3543
4344
|
} finally {
|
|
3544
|
-
|
|
3545
|
-
}
|
|
3546
|
-
},
|
|
3547
|
-
|
|
3548
|
-
let
|
|
3549
|
-
if (!
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
4345
|
+
s.get(e) === n && s.delete(e);
|
|
4346
|
+
}
|
|
4347
|
+
}, d = async (s) => {
|
|
4348
|
+
l();
|
|
4349
|
+
let c = a.get(s.styleName);
|
|
4350
|
+
if (!c) throw new Z("BUBBLE-COMPOSITION-002", `Bubble style is not defined: ${s.styleName}`);
|
|
4351
|
+
let u = c;
|
|
4352
|
+
s.reveal !== void 0 && (u = Object.freeze({
|
|
4353
|
+
...c,
|
|
4354
|
+
reveal: s.reveal
|
|
4355
|
+
}));
|
|
4356
|
+
let d = s.text, f = (e) => {
|
|
4357
|
+
let n = new Set(Jr(e)), r = n.size === 0 ? void 0 : zr(t);
|
|
4358
|
+
for (let e of n) Kr(r, e);
|
|
4359
|
+
return r;
|
|
4360
|
+
}, p = f(u);
|
|
4361
|
+
for (let e of [
|
|
4362
|
+
u.audio?.voice,
|
|
4363
|
+
u.audio?.reveal,
|
|
4364
|
+
u.audio?.finish,
|
|
4365
|
+
u.reveal?.sound
|
|
4366
|
+
]) e !== void 0 && qr(n, e);
|
|
4367
|
+
let m = async (e, t = !1) => {
|
|
4368
|
+
e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
|
|
4369
|
+
}, h = async (e, t, n) => {
|
|
4370
|
+
let r = Jr(e).length === 0 ? void 0 : zr(t), i = [];
|
|
4371
|
+
if (e.portrait) {
|
|
4372
|
+
let t = zr(r);
|
|
4373
|
+
i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
|
|
4374
|
+
let a = e.portrait.blink?.frames[0];
|
|
4375
|
+
a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
|
|
4376
|
+
let o = e.portrait.lipSync?.frames[0];
|
|
4377
|
+
o !== void 0 && i.push(Promise.resolve(t.applyToTarget(o, n.targets.portraitLipSync)));
|
|
4378
|
+
}
|
|
4379
|
+
let a = e.continueIndicator?.frames[0];
|
|
4380
|
+
if (a !== void 0) {
|
|
4381
|
+
let e = zr(r);
|
|
4382
|
+
i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
|
|
4383
|
+
}
|
|
4384
|
+
await Promise.all(i);
|
|
4385
|
+
}, g = (t, n, r) => {
|
|
4386
|
+
x = t.portrait?.blink === void 0 ? void 0 : Zr({
|
|
4387
|
+
actorKey: s.actorKey,
|
|
3576
4388
|
layer: "portraitBlink",
|
|
3577
|
-
animation:
|
|
3578
|
-
target:
|
|
3579
|
-
|
|
3580
|
-
scheduler:
|
|
4389
|
+
animation: t.portrait.blink,
|
|
4390
|
+
target: r.targets.portraitBlink,
|
|
4391
|
+
imageResolver: zr(n),
|
|
4392
|
+
scheduler: i,
|
|
3581
4393
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
3582
|
-
}),
|
|
3583
|
-
actorKey:
|
|
3584
|
-
layer: "
|
|
3585
|
-
animation:
|
|
3586
|
-
target:
|
|
3587
|
-
|
|
3588
|
-
scheduler:
|
|
4394
|
+
}), S = t.portrait?.lipSync === void 0 ? void 0 : Zr({
|
|
4395
|
+
actorKey: s.actorKey,
|
|
4396
|
+
layer: "portraitLipSync",
|
|
4397
|
+
animation: t.portrait.lipSync,
|
|
4398
|
+
target: r.targets.portraitLipSync,
|
|
4399
|
+
imageResolver: zr(n),
|
|
4400
|
+
scheduler: i,
|
|
3589
4401
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
3590
|
-
}),
|
|
3591
|
-
actorKey:
|
|
3592
|
-
layer: "
|
|
3593
|
-
animation:
|
|
3594
|
-
target:
|
|
3595
|
-
|
|
3596
|
-
scheduler:
|
|
4402
|
+
}), C = t.continueIndicator === void 0 ? void 0 : Zr({
|
|
4403
|
+
actorKey: s.actorKey,
|
|
4404
|
+
layer: "continueIndicator",
|
|
4405
|
+
animation: t.continueIndicator,
|
|
4406
|
+
target: r.targets.continueIndicator,
|
|
4407
|
+
imageResolver: zr(n),
|
|
4408
|
+
scheduler: i,
|
|
3597
4409
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
3598
4410
|
});
|
|
3599
|
-
|
|
3600
|
-
|
|
4411
|
+
}, _ = o.get(s.actorKey);
|
|
4412
|
+
_ && await _.close();
|
|
4413
|
+
let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? wr(s.text, w) : Object.freeze([s.text]), E = w ? Math.min(1, T.length) : 1, D, O = 0;
|
|
4414
|
+
try {
|
|
4415
|
+
v = Gr(await e.createSurface(Object.freeze({
|
|
4416
|
+
actor: s.actor,
|
|
4417
|
+
actorKey: s.actorKey,
|
|
4418
|
+
kind: s.kind,
|
|
4419
|
+
style: u
|
|
4420
|
+
})), u);
|
|
4421
|
+
let t = Yr(s.text, u, r);
|
|
4422
|
+
w?.layout === "RESERVED" && (r.setText({
|
|
4423
|
+
styleName: u.textStyle,
|
|
4424
|
+
target: v.targets.text,
|
|
4425
|
+
text: t
|
|
4426
|
+
}), v.captureTextLayout?.()), r.setText({
|
|
4427
|
+
styleName: u.textStyle,
|
|
4428
|
+
target: v.targets.text,
|
|
4429
|
+
text: Yr(w ? Tr(T, E) : s.text, u, r)
|
|
4430
|
+
}), y = !0, await h(u, p, v), g(u, p, v);
|
|
4431
|
+
let a = "idle", c = !1, l = Promise.resolve(), _ = async () => {
|
|
4432
|
+
if (!v) return;
|
|
4433
|
+
let e = w ? Tr(T, E) : d;
|
|
4434
|
+
r.setText({
|
|
4435
|
+
styleName: u.textStyle,
|
|
4436
|
+
target: v.targets.text,
|
|
4437
|
+
text: Yr(e, u, r)
|
|
4438
|
+
}), await v.show();
|
|
4439
|
+
}, k = () => {
|
|
4440
|
+
O += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
|
|
4441
|
+
}, A = async () => !w || E >= T.length ? !1 : (E += 1, await _(), await m(w.sound ?? u.audio?.reveal), E >= T.length && k(), !0), j = () => {
|
|
4442
|
+
if (!w || w.intervalSeconds <= 0 || E >= T.length) return;
|
|
4443
|
+
let e = O;
|
|
4444
|
+
D = i.setTimeout(() => {
|
|
4445
|
+
D = void 0, !(c || e !== O) && (l = l.then(() => A()).then(() => j()));
|
|
4446
|
+
}, w.intervalSeconds * 1e3);
|
|
4447
|
+
}, M = async (e) => {
|
|
4448
|
+
e !== a && (e === "talking" ? (await C?.stop(), await v?.setLayerVisible("continueIndicator", !1), await v?.setLayerVisible("portraitLipSync", S !== void 0), await S?.start({ primed: !0 })) : e === "awaiting-continue" ? (await S?.stop({ reset: !0 }), await v?.setLayerVisible("portraitLipSync", !1), await v?.setLayerVisible("continueIndicator", C !== void 0), await C?.start({ primed: !0 })) : (await Promise.all([S?.stop({ reset: !0 }), C?.stop()]), await Promise.all([v?.setLayerVisible("portraitLipSync", !1), v?.setLayerVisible("continueIndicator", !1)])), a = e);
|
|
3601
4449
|
};
|
|
3602
4450
|
await Promise.all([
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
]), await
|
|
3608
|
-
let
|
|
3609
|
-
actorKey:
|
|
3610
|
-
kind:
|
|
4451
|
+
v.setLayerVisible("portraitBase", u.portrait !== void 0),
|
|
4452
|
+
v.setLayerVisible("portraitBlink", u.portrait?.blink !== void 0),
|
|
4453
|
+
v.setLayerVisible("portraitLipSync", !1),
|
|
4454
|
+
v.setLayerVisible("continueIndicator", !1)
|
|
4455
|
+
]), await v.show(), b = !0, await m(u.audio?.voice), w !== void 0 && await m(w.sound ?? u.audio?.reveal), await x?.start({ primed: !0 }), await M(s.animationMode);
|
|
4456
|
+
let N = Object.freeze({
|
|
4457
|
+
actorKey: s.actorKey,
|
|
4458
|
+
kind: s.kind,
|
|
3611
4459
|
get animationMode() {
|
|
3612
|
-
return
|
|
4460
|
+
return a;
|
|
3613
4461
|
},
|
|
3614
4462
|
setText(e) {
|
|
3615
|
-
return
|
|
3616
|
-
|
|
3617
|
-
styleName:
|
|
3618
|
-
target:
|
|
3619
|
-
text: e
|
|
3620
|
-
}), await
|
|
3621
|
-
}),
|
|
4463
|
+
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : typeof e == "string" ? (l = l.then(async () => {
|
|
4464
|
+
v && (k(), d = e, w ? (T = wr(e, w), E = Math.min(1, T.length), w.layout === "RESERVED" && (r.setText({
|
|
4465
|
+
styleName: u.textStyle,
|
|
4466
|
+
target: v.targets.text,
|
|
4467
|
+
text: Yr(e, u, r)
|
|
4468
|
+
}), v.captureTextLayout?.()), await _(), j()) : await _());
|
|
4469
|
+
}), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
|
|
4470
|
+
},
|
|
4471
|
+
updateStyle(e) {
|
|
4472
|
+
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4473
|
+
let t;
|
|
4474
|
+
try {
|
|
4475
|
+
t = Ir(e);
|
|
4476
|
+
} catch (e) {
|
|
4477
|
+
return Promise.reject(e);
|
|
4478
|
+
}
|
|
4479
|
+
return l = l.then(async () => {
|
|
4480
|
+
if (!v) return;
|
|
4481
|
+
Gr(v, t);
|
|
4482
|
+
let e = f(t);
|
|
4483
|
+
for (let e of [
|
|
4484
|
+
t.audio?.voice,
|
|
4485
|
+
t.audio?.reveal,
|
|
4486
|
+
t.audio?.finish,
|
|
4487
|
+
t.reveal?.sound
|
|
4488
|
+
]) e !== void 0 && qr(n, e);
|
|
4489
|
+
await Promise.all([
|
|
4490
|
+
x?.stop(),
|
|
4491
|
+
S?.stop(),
|
|
4492
|
+
C?.stop()
|
|
4493
|
+
]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? wr(d, w) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, k(), w?.layout === "RESERVED" && (r.setText({
|
|
4494
|
+
styleName: t.textStyle,
|
|
4495
|
+
target: v.targets.text,
|
|
4496
|
+
text: Yr(d, t, r)
|
|
4497
|
+
}), v.captureTextLayout?.()), r.setText({
|
|
4498
|
+
styleName: t.textStyle,
|
|
4499
|
+
target: v.targets.text,
|
|
4500
|
+
text: Yr(d, t, r)
|
|
4501
|
+
}), g(t, e, v), await Promise.all([
|
|
4502
|
+
v.setLayerVisible("portraitBase", t.portrait !== void 0),
|
|
4503
|
+
v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
|
|
4504
|
+
v.setLayerVisible("portraitLipSync", !1),
|
|
4505
|
+
v.setLayerVisible("continueIndicator", !1)
|
|
4506
|
+
]);
|
|
4507
|
+
let i = a;
|
|
4508
|
+
a = "idle", await x?.start({ primed: !0 }), await M(i), await _(), j(), await m(u.audio?.voice);
|
|
4509
|
+
}), l;
|
|
3622
4510
|
},
|
|
3623
4511
|
setAnimationMode(e) {
|
|
3624
|
-
return
|
|
4512
|
+
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : Dr.has(e) ? (l = l.then(() => M(e)), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
|
|
4513
|
+
},
|
|
4514
|
+
revealNext() {
|
|
4515
|
+
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4516
|
+
let e = !1;
|
|
4517
|
+
return l = l.then(async () => {
|
|
4518
|
+
e = await A(), e && j();
|
|
4519
|
+
}), l.then(() => e);
|
|
4520
|
+
},
|
|
4521
|
+
revealAll() {
|
|
4522
|
+
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : (l = l.then(async () => {
|
|
4523
|
+
if (k(), w) for (; await A(););
|
|
4524
|
+
}), l);
|
|
4525
|
+
},
|
|
4526
|
+
finish(e = {}) {
|
|
4527
|
+
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4528
|
+
let t = e.timeoutSeconds ?? 0;
|
|
4529
|
+
return !Number.isFinite(t) || t < 0 ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish timeoutSeconds must be zero or greater.")) : e.condition !== void 0 && typeof e.condition != "function" ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish condition must be a function.")) : (l = l.then(async () => {
|
|
4530
|
+
if (k(), e.unit !== void 0 && (w = Sr({
|
|
4531
|
+
...w ?? {},
|
|
4532
|
+
unit: e.unit
|
|
4533
|
+
}), T = wr(d, w), E = Math.min(1, T.length), w.layout === "RESERVED" && v && (r.setText({
|
|
4534
|
+
styleName: u.textStyle,
|
|
4535
|
+
target: v.targets.text,
|
|
4536
|
+
text: Yr(d, u, r)
|
|
4537
|
+
}), v.captureTextLayout?.())), w) for (; await A(););
|
|
4538
|
+
let n = e.condition;
|
|
4539
|
+
if (n === void 0 && t === 0) {
|
|
4540
|
+
await m(u.audio?.finish);
|
|
4541
|
+
return;
|
|
4542
|
+
}
|
|
4543
|
+
await new Promise((e, r) => {
|
|
4544
|
+
let a = !1, o, s, c = () => {
|
|
4545
|
+
a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), m(u.audio?.finish).then(e, r));
|
|
4546
|
+
};
|
|
4547
|
+
if (t > 0 && (o = i.setTimeout(c, t * 1e3)), !n) return;
|
|
4548
|
+
let l = () => {
|
|
4549
|
+
let e;
|
|
4550
|
+
try {
|
|
4551
|
+
e = n();
|
|
4552
|
+
} catch (e) {
|
|
4553
|
+
a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), r(e));
|
|
4554
|
+
return;
|
|
4555
|
+
}
|
|
4556
|
+
Promise.resolve(e).then((e) => {
|
|
4557
|
+
e ? c() : a || (s = i.setTimeout(l, 16));
|
|
4558
|
+
}, (e) => {
|
|
4559
|
+
a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), r(e));
|
|
4560
|
+
});
|
|
4561
|
+
};
|
|
4562
|
+
l();
|
|
4563
|
+
});
|
|
4564
|
+
}), l);
|
|
4565
|
+
},
|
|
4566
|
+
animate(e) {
|
|
4567
|
+
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4568
|
+
let t;
|
|
4569
|
+
try {
|
|
4570
|
+
t = Pr(e, "Bubble motion");
|
|
4571
|
+
} catch (e) {
|
|
4572
|
+
return Promise.reject(e);
|
|
4573
|
+
}
|
|
4574
|
+
return l = l.then(async () => {
|
|
4575
|
+
if (t.name === "animateBubbleShape" && t.visualStyle) {
|
|
4576
|
+
let e = Object.freeze({
|
|
4577
|
+
...u,
|
|
4578
|
+
visualStyle: t.visualStyle
|
|
4579
|
+
});
|
|
4580
|
+
await v?.animate?.(t), u = e, await v?.updateStyle(u);
|
|
4581
|
+
return;
|
|
4582
|
+
}
|
|
4583
|
+
await v?.animate?.(t);
|
|
4584
|
+
}), l;
|
|
3625
4585
|
},
|
|
3626
4586
|
async close() {
|
|
3627
|
-
if (
|
|
3628
|
-
|
|
4587
|
+
if (c) return;
|
|
4588
|
+
c = !0;
|
|
3629
4589
|
let e = [];
|
|
4590
|
+
k();
|
|
3630
4591
|
try {
|
|
3631
|
-
await
|
|
4592
|
+
await l;
|
|
3632
4593
|
} catch (t) {
|
|
3633
4594
|
e.push(t);
|
|
3634
4595
|
}
|
|
3635
4596
|
for (let t of [
|
|
3636
|
-
() =>
|
|
3637
|
-
() =>
|
|
3638
|
-
() =>
|
|
4597
|
+
() => u.hideAnimation === void 0 ? void 0 : v?.animate?.(u.hideAnimation),
|
|
4598
|
+
() => x?.stop(),
|
|
4599
|
+
() => S?.stop(),
|
|
4600
|
+
() => C?.stop(),
|
|
3639
4601
|
async () => {
|
|
3640
|
-
|
|
4602
|
+
b && await v?.hide();
|
|
3641
4603
|
},
|
|
3642
4604
|
async () => {
|
|
3643
|
-
|
|
4605
|
+
y && v && r.releaseTarget(v.targets.text);
|
|
3644
4606
|
},
|
|
3645
|
-
async () =>
|
|
4607
|
+
async () => v?.dispose()
|
|
3646
4608
|
]) try {
|
|
3647
4609
|
await t();
|
|
3648
4610
|
} catch (t) {
|
|
3649
4611
|
e.push(t);
|
|
3650
4612
|
}
|
|
3651
|
-
|
|
4613
|
+
o.get(s.actorKey) === N && o.delete(s.actorKey), Xr(e, `Failed to close bubble: ${s.actorKey}`);
|
|
3652
4614
|
}
|
|
3653
4615
|
});
|
|
3654
|
-
return
|
|
4616
|
+
return o.set(s.actorKey, N), j(), u.showAnimation !== void 0 && await N.animate(u.showAnimation), N;
|
|
3655
4617
|
} catch (e) {
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
4618
|
+
o.delete(s.actorKey);
|
|
4619
|
+
let t = [], n = await Promise.allSettled([
|
|
4620
|
+
x?.stop(),
|
|
4621
|
+
S?.stop(),
|
|
4622
|
+
C?.stop()
|
|
3660
4623
|
]);
|
|
3661
|
-
if (t.push(...
|
|
3662
|
-
await
|
|
4624
|
+
if (t.push(...n.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), b && v) try {
|
|
4625
|
+
await v.hide();
|
|
3663
4626
|
} catch (e) {
|
|
3664
4627
|
t.push(e);
|
|
3665
4628
|
}
|
|
3666
|
-
if (
|
|
3667
|
-
|
|
4629
|
+
if (y && v) try {
|
|
4630
|
+
r.releaseTarget(v.targets.text);
|
|
3668
4631
|
} catch (e) {
|
|
3669
4632
|
t.push(e);
|
|
3670
4633
|
}
|
|
3671
|
-
if (
|
|
3672
|
-
await
|
|
4634
|
+
if (v) try {
|
|
4635
|
+
await v.dispose();
|
|
3673
4636
|
} catch (e) {
|
|
3674
4637
|
t.push(e);
|
|
3675
4638
|
}
|
|
3676
|
-
throw t.length > 0 ? AggregateError([e, ...t], `Failed to show and clean up bubble: ${
|
|
4639
|
+
throw t.length > 0 ? AggregateError([e, ...t], `Failed to show and clean up bubble: ${s.actorKey}`, { cause: e }) : e;
|
|
3677
4640
|
}
|
|
3678
4641
|
};
|
|
3679
4642
|
return Object.freeze({
|
|
3680
4643
|
defineStyle(e) {
|
|
3681
|
-
|
|
3682
|
-
let t =
|
|
3683
|
-
|
|
4644
|
+
l();
|
|
4645
|
+
let t = Ir(e);
|
|
4646
|
+
a.set(t.name, t);
|
|
3684
4647
|
},
|
|
3685
4648
|
hasActiveBubble(e) {
|
|
3686
|
-
return
|
|
4649
|
+
return o.has(jr(e, "Bubble actor key"));
|
|
3687
4650
|
},
|
|
3688
4651
|
async show(e) {
|
|
3689
|
-
|
|
3690
|
-
let t =
|
|
3691
|
-
return
|
|
4652
|
+
l();
|
|
4653
|
+
let t = Qr(e);
|
|
4654
|
+
return u(t.actorKey, () => d(t));
|
|
3692
4655
|
},
|
|
3693
4656
|
releaseTarget(e) {
|
|
3694
|
-
|
|
3695
|
-
let t =
|
|
3696
|
-
return
|
|
3697
|
-
await
|
|
4657
|
+
l();
|
|
4658
|
+
let t = jr(e, "Bubble actor key");
|
|
4659
|
+
return u(t, async () => {
|
|
4660
|
+
await o.get(t)?.close();
|
|
3698
4661
|
});
|
|
3699
4662
|
},
|
|
3700
4663
|
async releaseAll() {
|
|
3701
|
-
|
|
4664
|
+
l(), await Promise.allSettled([...s.values()]), Xr((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
|
|
3702
4665
|
},
|
|
3703
4666
|
async dispose() {
|
|
3704
|
-
if (
|
|
3705
|
-
|
|
3706
|
-
let e = await Promise.allSettled([...
|
|
3707
|
-
|
|
4667
|
+
if (c) return;
|
|
4668
|
+
c = !0, await Promise.allSettled([...s.values()]);
|
|
4669
|
+
let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
|
|
4670
|
+
a.clear(), Xr(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
|
|
3708
4671
|
}
|
|
3709
4672
|
});
|
|
3710
4673
|
}
|
|
3711
4674
|
//#endregion
|
|
3712
4675
|
//#region src/turbowarp-adapter.ts
|
|
3713
|
-
var
|
|
4676
|
+
var ei = "sprite", ti = 96, ni = 18, ri = 8, ii = 16, ai = 0, $ = class extends Error {
|
|
3714
4677
|
code;
|
|
3715
4678
|
constructor(e, t) {
|
|
3716
4679
|
super(t), this.name = "BubbleRuntimeAdapterError", this.code = e;
|
|
3717
4680
|
}
|
|
3718
4681
|
};
|
|
3719
|
-
function
|
|
4682
|
+
function oi(e) {
|
|
3720
4683
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3721
4684
|
}
|
|
3722
|
-
function
|
|
3723
|
-
if (!
|
|
4685
|
+
function si(e) {
|
|
4686
|
+
if (!oi(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
|
|
3724
4687
|
let t = [
|
|
3725
4688
|
"createSVGSkin",
|
|
3726
4689
|
"createDrawable",
|
|
@@ -3736,15 +4699,15 @@ function wn(e) {
|
|
|
3736
4699
|
if (t.some((t) => typeof e[t] != "function")) throw new $("BUBBLE-RUNTIME-001", `Bubble renderer must provide ${t.join(", ")}.`);
|
|
3737
4700
|
return e;
|
|
3738
4701
|
}
|
|
3739
|
-
function
|
|
3740
|
-
if (!
|
|
4702
|
+
function ci(e) {
|
|
4703
|
+
if (!oi(e) || typeof e.isLoaded != "function" || typeof e.getAssetMimeType != "function" || typeof e.resolveSkin != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble image assets require an imageResolver capability. Load @kubohiroya/turbowarp-asset-manager or provide options.imageResolver before using image features.");
|
|
3741
4704
|
return e;
|
|
3742
4705
|
}
|
|
3743
|
-
function
|
|
3744
|
-
if (!
|
|
4706
|
+
function li(e) {
|
|
4707
|
+
if (!oi(e) || typeof e.setText != "function" || typeof e.releaseTextActor != "function") throw new $("BUBBLE-RUNTIME-003", "Bubble requires SVG Text. Load @kubohiroya/turbowarp-svg-text before using Bubble blocks.");
|
|
3745
4708
|
return e;
|
|
3746
4709
|
}
|
|
3747
|
-
function
|
|
4710
|
+
function ui(e) {
|
|
3748
4711
|
try {
|
|
3749
4712
|
let t = e.getBoundsForBubble?.();
|
|
3750
4713
|
if (t && [
|
|
@@ -3762,7 +4725,7 @@ function Dn(e) {
|
|
|
3762
4725
|
top: n
|
|
3763
4726
|
};
|
|
3764
4727
|
}
|
|
3765
|
-
function
|
|
4728
|
+
function di(e, t, n) {
|
|
3766
4729
|
let r = e.getCurrentSkinSize(t.drawableID);
|
|
3767
4730
|
if (!Array.isArray(r) || r.length < 2) return n;
|
|
3768
4731
|
let i = Number(r[0]), a = Number(r[1]);
|
|
@@ -3771,8 +4734,42 @@ function On(e, t, n) {
|
|
|
3771
4734
|
height: a
|
|
3772
4735
|
};
|
|
3773
4736
|
}
|
|
3774
|
-
function
|
|
3775
|
-
|
|
4737
|
+
function fi(e) {
|
|
4738
|
+
return Math.max(0, Math.min(1, e));
|
|
4739
|
+
}
|
|
4740
|
+
function pi(e, t) {
|
|
4741
|
+
let n = fi(e);
|
|
4742
|
+
switch (t) {
|
|
4743
|
+
case "linear": return n;
|
|
4744
|
+
case "easeIn": return n * n;
|
|
4745
|
+
case "easeOut": return 1 - (1 - n) * (1 - n);
|
|
4746
|
+
case "easeInOut": return n < .5 ? 2 * n * n : 1 - (-2 * n + 2) ** 2 / 2;
|
|
4747
|
+
default: return n;
|
|
4748
|
+
}
|
|
4749
|
+
}
|
|
4750
|
+
function mi(e, t, n) {
|
|
4751
|
+
let r = Math.max(0, t * 1e3);
|
|
4752
|
+
return r === 0 ? (n(1), Promise.resolve()) : new Promise((t, i) => {
|
|
4753
|
+
let a = 0, o, s = () => {
|
|
4754
|
+
let c = Math.min(16, r - a);
|
|
4755
|
+
a += c;
|
|
4756
|
+
try {
|
|
4757
|
+
n(fi(a / r));
|
|
4758
|
+
} catch (t) {
|
|
4759
|
+
o !== void 0 && e.clearTimeout(o), i(t);
|
|
4760
|
+
return;
|
|
4761
|
+
}
|
|
4762
|
+
if (a >= r) {
|
|
4763
|
+
t();
|
|
4764
|
+
return;
|
|
4765
|
+
}
|
|
4766
|
+
o = e.setTimeout(s, Math.min(16, r - a));
|
|
4767
|
+
};
|
|
4768
|
+
o = e.setTimeout(s, Math.min(16, r));
|
|
4769
|
+
});
|
|
4770
|
+
}
|
|
4771
|
+
function hi(e, t, n, r = 1) {
|
|
4772
|
+
let i = di(e, t, {
|
|
3776
4773
|
width: n,
|
|
3777
4774
|
height: n
|
|
3778
4775
|
}), a = Math.min(n / i.width, n / i.height) * r;
|
|
@@ -3781,179 +4778,276 @@ function kn(e, t, n, r = 1) {
|
|
|
3781
4778
|
height: i.height * a
|
|
3782
4779
|
};
|
|
3783
4780
|
}
|
|
3784
|
-
function
|
|
4781
|
+
function gi(e, t, n) {
|
|
3785
4782
|
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
3786
4783
|
}
|
|
3787
|
-
function
|
|
4784
|
+
function _i(e, t, n, r, i) {
|
|
3788
4785
|
let a = t + r * 2, o = n + i * 2;
|
|
3789
4786
|
return e.replace(/<svg\b[^>]*>/u, (e) => e.replace(/\bwidth="[^"]*"/u, `width="${a}"`).replace(/\bheight="[^"]*"/u, `height="${o}"`).replace(/\bviewBox="[^"]*"/u, `viewBox="${-r} ${-i} ${a} ${o}"`));
|
|
3790
4787
|
}
|
|
3791
|
-
function
|
|
4788
|
+
function vi(e) {
|
|
3792
4789
|
let t = v(e);
|
|
3793
4790
|
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
3794
4791
|
}
|
|
3795
|
-
function
|
|
3796
|
-
let
|
|
3797
|
-
|
|
3798
|
-
let
|
|
3799
|
-
let t =
|
|
4792
|
+
function yi(e, t, n, r, i) {
|
|
4793
|
+
let a = e.renderer, o = ai;
|
|
4794
|
+
ai += 1;
|
|
4795
|
+
let s = [], c, l = (e) => {
|
|
4796
|
+
let t = a.createDrawable(ei);
|
|
3800
4797
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", `TurboWarp did not create the Bubble ${e} drawable.`);
|
|
3801
4798
|
let r = Object.freeze({
|
|
3802
|
-
id: `bubble:${n}:${
|
|
4799
|
+
id: `bubble:${n}:${o}:${e}`,
|
|
3803
4800
|
isStage: !1,
|
|
3804
4801
|
drawableID: t
|
|
3805
4802
|
});
|
|
3806
|
-
return
|
|
4803
|
+
return s.push(r), a.updateDrawableVisible(t, !1), a.setDrawableOrder?.(t, Infinity, ei), r;
|
|
3807
4804
|
};
|
|
3808
4805
|
try {
|
|
3809
|
-
let n =
|
|
3810
|
-
text:
|
|
3811
|
-
...
|
|
3812
|
-
...
|
|
3813
|
-
...
|
|
3814
|
-
...
|
|
3815
|
-
}),
|
|
3816
|
-
|
|
3817
|
-
let
|
|
3818
|
-
let
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
4806
|
+
let n = l("body"), o = r.portrait ? l("portrait-base") : void 0, u = r.portrait?.blink ? l("portrait-blink") : void 0, d = r.portrait?.lipSync ? l("portrait-lip-sync") : void 0, f = l("text"), p = r.continueIndicator ? l("continue-indicator") : void 0, m = Object.freeze({
|
|
4807
|
+
text: f,
|
|
4808
|
+
...o ? { portraitBase: o } : {},
|
|
4809
|
+
...u ? { portraitBlink: u } : {},
|
|
4810
|
+
...d ? { portraitLipSync: d } : {},
|
|
4811
|
+
...p ? { continueIndicator: p } : {}
|
|
4812
|
+
}), h = /* @__PURE__ */ new Map();
|
|
4813
|
+
o && h.set("portraitBase", o), u && h.set("portraitBlink", u), d && h.set("portraitLipSync", d), p && h.set("continueIndicator", p);
|
|
4814
|
+
let g = /* @__PURE__ */ new Map(), _ = !1, y = !1, b = "", x = r, S, C = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), E = [0, 0], D = 1, O = 1, k, A = () => {
|
|
4815
|
+
for (let e of s) {
|
|
4816
|
+
let t = C.get(e.drawableID);
|
|
4817
|
+
t && a.updateDrawablePosition(e.drawableID, [t[0] + E[0], t[1] + E[1]]);
|
|
4818
|
+
let n = T.get(e.drawableID);
|
|
4819
|
+
n && a.updateDrawableScale(e.drawableID, [n[0] * D, n[1] * D]), a.updateDrawableEffect?.(e.drawableID, "ghost", (1 - O) * 100);
|
|
4820
|
+
}
|
|
4821
|
+
}, j = () => {
|
|
4822
|
+
let r = x.placement.basis === "background" || t.visible !== !1;
|
|
4823
|
+
a.updateDrawableVisible(n.drawableID, _ && r && x.visualStyle !== "NO_BUBBLE" && (a.updateDrawableEffect !== void 0 || O > 0)), a.updateDrawableVisible(f.drawableID, _ && r && (a.updateDrawableEffect !== void 0 || O > 0));
|
|
4824
|
+
for (let [e, t] of h) a.updateDrawableVisible(t.drawableID, _ && r && (g.get(e) ?? !1) && (a.updateDrawableEffect !== void 0 || O > 0));
|
|
4825
|
+
A(), e.requestRedraw?.();
|
|
4826
|
+
}, M = () => {
|
|
4827
|
+
if (y) return;
|
|
4828
|
+
let e = x.placement.basis === "actor" ? x.offset.scalePercent / 100 : 1, r = S ?? di(a, f, {
|
|
3825
4829
|
width: 180,
|
|
3826
4830
|
height: 48
|
|
3827
4831
|
});
|
|
3828
|
-
|
|
3829
|
-
let
|
|
3830
|
-
width:
|
|
3831
|
-
height:
|
|
3832
|
-
},
|
|
4832
|
+
a.updateDrawableScale(f.drawableID, [e * 100, e * 100]);
|
|
4833
|
+
let i = {
|
|
4834
|
+
width: r.width * e,
|
|
4835
|
+
height: r.height * e
|
|
4836
|
+
}, s = o ? hi(a, o, ti, e) : {
|
|
3833
4837
|
width: 0,
|
|
3834
4838
|
height: 0
|
|
3835
4839
|
};
|
|
3836
|
-
for (let t of [
|
|
3837
|
-
let
|
|
4840
|
+
for (let t of [u, d]) t && hi(a, t, ti, e);
|
|
4841
|
+
let l = p ? hi(a, p, ni, e) : {
|
|
3838
4842
|
width: 0,
|
|
3839
4843
|
height: 0
|
|
3840
|
-
},
|
|
3841
|
-
if (
|
|
4844
|
+
}, m = s.width + (o ? ri * e : 0) + i.width, h = Math.max(s.height, i.height), g = m / e + 48, _ = h / e + 48, v = m, E = h, D = a.getNativeSize(), O = Array.isArray(D) && Number(D[0]) > 0 ? Number(D[0]) : 480, M = Array.isArray(D) && Number(D[1]) > 0 ? Number(D[1]) : 360, N = -O / 2, ee = O / 2, P = M / 2, te = -M / 2, ne = N + v / 2, re = ee - v / 2, ie = te + E / 2, F = P - E / 2, I, L;
|
|
4845
|
+
if (x.placement.basis === "background") I = 0, L = x.placement.region === "HEADER_LIKE" ? P - ii - E / 2 : x.placement.region === "FOOTER_LIKE" ? te + ii + E / 2 : 0;
|
|
3842
4846
|
else {
|
|
3843
|
-
let e =
|
|
3844
|
-
bounds:
|
|
3845
|
-
bubbleWidth:
|
|
3846
|
-
bubbleHeight:
|
|
3847
|
-
direction:
|
|
3848
|
-
distance:
|
|
3849
|
-
tailLength:
|
|
3850
|
-
offset:
|
|
4847
|
+
let e = w({
|
|
4848
|
+
bounds: ui(t),
|
|
4849
|
+
bubbleWidth: v,
|
|
4850
|
+
bubbleHeight: E,
|
|
4851
|
+
direction: x.placement.direction,
|
|
4852
|
+
distance: x.distance,
|
|
4853
|
+
tailLength: x.tailLength,
|
|
4854
|
+
offset: x.offset
|
|
3851
4855
|
});
|
|
3852
|
-
|
|
4856
|
+
I = e.x, L = e.y;
|
|
3853
4857
|
}
|
|
3854
|
-
|
|
3855
|
-
let
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
4858
|
+
I = gi(I, ne, re), L = gi(L, ie, F);
|
|
4859
|
+
let R = x.placement.basis === "actor" ? vi(x.placement.direction) : null, ae = x.placement.basis === "actor" ? [
|
|
4860
|
+
x.offset.x,
|
|
4861
|
+
x.offset.y,
|
|
4862
|
+
x.offset.scalePercent
|
|
3859
4863
|
] : [
|
|
3860
4864
|
0,
|
|
3861
4865
|
0,
|
|
3862
4866
|
100
|
|
3863
|
-
],
|
|
4867
|
+
], oe = R === null ? {
|
|
3864
4868
|
x: 0,
|
|
3865
4869
|
y: 0
|
|
3866
|
-
} :
|
|
3867
|
-
style:
|
|
3868
|
-
width:
|
|
3869
|
-
height:
|
|
3870
|
-
tailDirection:
|
|
3871
|
-
tailLength:
|
|
3872
|
-
offset:
|
|
3873
|
-
}),
|
|
3874
|
-
baseBubbleHeight:
|
|
3875
|
-
baseBubbleWidth:
|
|
3876
|
-
bodyOffset:
|
|
3877
|
-
tailDirection:
|
|
3878
|
-
tailLength:
|
|
3879
|
-
viewportExtraX:
|
|
3880
|
-
viewportExtraY:
|
|
3881
|
-
visualStyle:
|
|
4870
|
+
} : me({
|
|
4871
|
+
style: x.visualStyle,
|
|
4872
|
+
width: g,
|
|
4873
|
+
height: _,
|
|
4874
|
+
tailDirection: R,
|
|
4875
|
+
tailLength: x.tailLength,
|
|
4876
|
+
offset: ae
|
|
4877
|
+
}), se = Math.abs(ae[0]) + g * Math.abs(e - 1) + Math.max(0, x.tailLength - 18) + 8, ce = Math.abs(ae[1]) + _ * Math.abs(e - 1) + Math.max(0, x.tailLength - 18) + 8, le = JSON.stringify({
|
|
4878
|
+
baseBubbleHeight: _,
|
|
4879
|
+
baseBubbleWidth: g,
|
|
4880
|
+
bodyOffset: ae,
|
|
4881
|
+
tailDirection: R,
|
|
4882
|
+
tailLength: x.tailLength,
|
|
4883
|
+
viewportExtraX: se,
|
|
4884
|
+
viewportExtraY: ce,
|
|
4885
|
+
visualStyle: x.visualStyle,
|
|
4886
|
+
shapeTransition: k
|
|
3882
4887
|
});
|
|
3883
|
-
if (
|
|
3884
|
-
let e =
|
|
3885
|
-
style:
|
|
4888
|
+
if (le !== b) {
|
|
4889
|
+
let e = _i(ge({
|
|
4890
|
+
style: x.visualStyle,
|
|
3886
4891
|
lines: [],
|
|
3887
|
-
width:
|
|
3888
|
-
height:
|
|
3889
|
-
tailDirection:
|
|
3890
|
-
tailLength:
|
|
3891
|
-
offset:
|
|
3892
|
-
title: `${
|
|
3893
|
-
|
|
4892
|
+
width: g,
|
|
4893
|
+
height: _,
|
|
4894
|
+
tailDirection: R,
|
|
4895
|
+
tailLength: x.tailLength,
|
|
4896
|
+
offset: ae,
|
|
4897
|
+
title: `${x.name} Bubble body`,
|
|
4898
|
+
...k === void 0 ? {} : { shapeTransition: k }
|
|
4899
|
+
}), g, _, se, ce), t = a.createSVGSkin(e);
|
|
3894
4900
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble body SVG skin.");
|
|
3895
4901
|
try {
|
|
3896
|
-
|
|
4902
|
+
a.updateDrawableSkinId(n.drawableID, t);
|
|
3897
4903
|
} catch (e) {
|
|
3898
|
-
throw
|
|
4904
|
+
throw a.destroySkin(t), e;
|
|
3899
4905
|
}
|
|
3900
|
-
let
|
|
3901
|
-
|
|
4906
|
+
let r = c;
|
|
4907
|
+
c = t, b = le, r !== void 0 && a.destroySkin(r);
|
|
3902
4908
|
}
|
|
3903
|
-
|
|
3904
|
-
let
|
|
4909
|
+
a.updateDrawableScale(n.drawableID, [100, 100]), a.updateDrawablePosition(n.drawableID, [I - oe.x, L + oe.y]);
|
|
4910
|
+
let ue = I - m / 2, de = ue + s.width / 2, fe = ue + s.width + (o ? ri * e : 0) + i.width / 2;
|
|
3905
4911
|
for (let e of [
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
]) e &&
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
4912
|
+
o,
|
|
4913
|
+
u,
|
|
4914
|
+
d
|
|
4915
|
+
]) e && a.updateDrawablePosition(e.drawableID, [de, L]);
|
|
4916
|
+
a.updateDrawablePosition(f.drawableID, [fe, L]), p && a.updateDrawablePosition(p.drawableID, [fe + i.width / 2 - l.width / 2 - ri * e, L - i.height / 2 + l.height / 2 + ri * e]);
|
|
4917
|
+
let pe = (e, t) => {
|
|
4918
|
+
e && C.set(e.drawableID, t);
|
|
4919
|
+
};
|
|
4920
|
+
pe(n, [I - oe.x, L + oe.y]), pe(f, [fe, L]), pe(o, [de, L]), pe(u, [de, L]), pe(d, [de, L]), T.set(n.drawableID, [100, 100]), T.set(f.drawableID, [e * 100, e * 100]), o && T.set(o.drawableID, [e * 100, e * 100]), u && T.set(u.drawableID, [e * 100, e * 100]), d && T.set(d.drawableID, [e * 100, e * 100]), p && T.set(p.drawableID, [e * 100, e * 100]), p && pe(p, [fe + i.width / 2 - l.width / 2 - ri * e, L - i.height / 2 + l.height / 2 + ri * e]), A(), j();
|
|
4921
|
+
}, N = t.onTargetVisualChange, ee = (e) => {
|
|
4922
|
+
N?.(e), M();
|
|
3913
4923
|
};
|
|
3914
|
-
return
|
|
3915
|
-
targets:
|
|
4924
|
+
return x.placement.basis === "actor" && (t.onTargetVisualChange = ee), Object.freeze({
|
|
4925
|
+
targets: m,
|
|
3916
4926
|
setLayerVisible(e, t) {
|
|
3917
|
-
|
|
4927
|
+
y || (g.set(e, t), j());
|
|
4928
|
+
},
|
|
4929
|
+
updateStyle(e) {
|
|
4930
|
+
if (y) return;
|
|
4931
|
+
let n = x.placement.basis === "actor";
|
|
4932
|
+
x = e, E = [0, 0], D = 1, O = 1, k = void 0, e.reveal?.layout !== "RESERVED" && (S = void 0);
|
|
4933
|
+
let r = x.placement.basis === "actor";
|
|
4934
|
+
n && !r ? t.onTargetVisualChange === ee && (t.onTargetVisualChange = N ?? null) : !n && r && (t.onTargetVisualChange = ee), M();
|
|
4935
|
+
},
|
|
4936
|
+
captureTextLayout() {
|
|
4937
|
+
y || (S = di(a, f, {
|
|
4938
|
+
width: 180,
|
|
4939
|
+
height: 48
|
|
4940
|
+
}), M());
|
|
4941
|
+
},
|
|
4942
|
+
clearTextLayout() {
|
|
4943
|
+
S = void 0, M();
|
|
4944
|
+
},
|
|
4945
|
+
async animate(e) {
|
|
4946
|
+
if (y) return;
|
|
4947
|
+
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
4948
|
+
y || (A(), j());
|
|
4949
|
+
}, r = (t) => pi(t, e.ease ?? "easeInOut");
|
|
4950
|
+
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
4951
|
+
_ = !0;
|
|
4952
|
+
let a = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
4953
|
+
E = a, D = o, O = e.name === "fadeIn" ? 0 : 1, n(), await mi(i, t, (t) => {
|
|
4954
|
+
let i = r(t);
|
|
4955
|
+
E = [a[0] * (1 - i), a[1] * (1 - i)], D = o + (1 - o) * i, O = e.name === "fadeIn" ? i : 1, n();
|
|
4956
|
+
}), E = [0, 0], D = 1, O = 1, M();
|
|
4957
|
+
return;
|
|
4958
|
+
}
|
|
4959
|
+
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
4960
|
+
let a = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
4961
|
+
E = [0, 0], D = 1, O = 1, n(), await mi(i, t, (t) => {
|
|
4962
|
+
let i = r(t);
|
|
4963
|
+
E = [a[0] * i, a[1] * i], D = 1 + (o - 1) * i, O = e.name === "fadeOut" ? 1 - i : 1, n();
|
|
4964
|
+
}), E = a, D = o, O = e.name === "fadeOut" ? 0 : 1, n(), _ = !1, j(), E = [0, 0], D = 1, O = 1;
|
|
4965
|
+
return;
|
|
4966
|
+
}
|
|
4967
|
+
if (e.name === "shake") {
|
|
4968
|
+
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .08, s = v(typeof e.direction == "number" ? e.direction : e.direction ?? "right") ?? v("right");
|
|
4969
|
+
E = [0, 0], await mi(i, o, (e) => {
|
|
4970
|
+
let t = r(e) * a * Math.PI * 2, i = Math.sin(t) * 5;
|
|
4971
|
+
E = [s.x * i, s.y * i], n();
|
|
4972
|
+
}), E = [0, 0], M();
|
|
4973
|
+
return;
|
|
4974
|
+
}
|
|
4975
|
+
if (e.name === "explode") {
|
|
4976
|
+
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .12, s = e.relativeScale ?? 1.15;
|
|
4977
|
+
await mi(i, o, (e) => {
|
|
4978
|
+
let t = r(e), i = Math.abs(Math.sin(t * a * Math.PI));
|
|
4979
|
+
D = 1 + (s - 1) * i, n();
|
|
4980
|
+
}), D = 1, M();
|
|
4981
|
+
return;
|
|
4982
|
+
}
|
|
4983
|
+
if (e.name === "animateBubbleShape") {
|
|
4984
|
+
let n = e.visualStyle ?? x.visualStyle, r = x.visualStyle, a = e.speed === void 0 ? 1 : Math.max(0, e.speed);
|
|
4985
|
+
k = {
|
|
4986
|
+
from: r,
|
|
4987
|
+
to: n,
|
|
4988
|
+
progress: 0
|
|
4989
|
+
}, M(), await mi(i, t, (i) => {
|
|
4990
|
+
let o = t === 0 ? 1 : fi(i * Math.max(a, 1) / 1);
|
|
4991
|
+
k = {
|
|
4992
|
+
from: r,
|
|
4993
|
+
to: n,
|
|
4994
|
+
progress: pi(o, e.ease ?? "easeInOut")
|
|
4995
|
+
}, M();
|
|
4996
|
+
}), k = void 0, M();
|
|
4997
|
+
return;
|
|
4998
|
+
}
|
|
3918
4999
|
},
|
|
3919
5000
|
show() {
|
|
3920
|
-
|
|
5001
|
+
y || (_ = !0, M());
|
|
3921
5002
|
},
|
|
3922
5003
|
hide() {
|
|
3923
|
-
|
|
5004
|
+
y || (_ = !1, j());
|
|
3924
5005
|
},
|
|
3925
5006
|
dispose() {
|
|
3926
|
-
if (!
|
|
3927
|
-
|
|
3928
|
-
for (let e of [...
|
|
3929
|
-
|
|
5007
|
+
if (!y) {
|
|
5008
|
+
y = !0, x.placement.basis === "actor" && t.onTargetVisualChange === ee && (t.onTargetVisualChange = N ?? null);
|
|
5009
|
+
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID, ei);
|
|
5010
|
+
c !== void 0 && (a.destroySkin(c), c = void 0), e.requestRedraw?.();
|
|
3930
5011
|
}
|
|
3931
5012
|
}
|
|
3932
5013
|
});
|
|
3933
5014
|
} catch (e) {
|
|
3934
|
-
for (let e of [...
|
|
3935
|
-
throw
|
|
5015
|
+
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID, ei);
|
|
5016
|
+
throw c !== void 0 && a.destroySkin(c), e;
|
|
3936
5017
|
}
|
|
3937
5018
|
}
|
|
3938
|
-
function
|
|
3939
|
-
if (!
|
|
3940
|
-
let n = e, r =
|
|
3941
|
-
return
|
|
3942
|
-
|
|
5019
|
+
function bi(e, t = {}) {
|
|
5020
|
+
if (!oi(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp runtime.");
|
|
5021
|
+
let n = e, r = si(n.renderer), i = () => ci(n.ext_kubohiroyaassetmanager), a = t.svgText ? null : li(n.ext_kubohiroyasvgtext);
|
|
5022
|
+
return $r({
|
|
5023
|
+
imageResolver: t.imageResolver ?? {
|
|
3943
5024
|
isRegistered(e) {
|
|
3944
|
-
return i
|
|
5025
|
+
return i().isLoaded({ NAME: e });
|
|
3945
5026
|
},
|
|
3946
5027
|
getMimeType(e) {
|
|
3947
|
-
return i
|
|
5028
|
+
return i().getAssetMimeType({ NAME: e });
|
|
3948
5029
|
},
|
|
3949
5030
|
async applyToTarget(e, t) {
|
|
3950
5031
|
let a = t.drawableID;
|
|
3951
5032
|
if (!Number.isInteger(a) || a < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
|
|
3952
|
-
let o = await i
|
|
3953
|
-
if (!
|
|
5033
|
+
let o = await i().resolveSkin(e);
|
|
5034
|
+
if (!oi(o) || !Number.isInteger(o.skinId) || o.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
|
|
3954
5035
|
r.updateDrawableSkinId(a, o.skinId), n.requestRedraw?.();
|
|
3955
5036
|
}
|
|
3956
5037
|
},
|
|
5038
|
+
audio: t.audio ?? {
|
|
5039
|
+
isRegistered(e) {
|
|
5040
|
+
return i().isLoaded({ NAME: e });
|
|
5041
|
+
},
|
|
5042
|
+
getMimeType(e) {
|
|
5043
|
+
return i().getAssetMimeType({ NAME: e });
|
|
5044
|
+
},
|
|
5045
|
+
async playSound(e, t = {}) {
|
|
5046
|
+
let n = i(), r = t.untilDone ? n?.playSoundUntilDone : n?.playSound;
|
|
5047
|
+
if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp Asset Manager does not provide audio playback.");
|
|
5048
|
+
await r.call(n, { NAME: e });
|
|
5049
|
+
}
|
|
5050
|
+
},
|
|
3957
5051
|
svgText: t.svgText ?? {
|
|
3958
5052
|
setText({ styleName: e, target: t, text: n }) {
|
|
3959
5053
|
a?.setText({
|
|
@@ -3963,15 +5057,23 @@ function Pn(e, t = {}) {
|
|
|
3963
5057
|
},
|
|
3964
5058
|
releaseTarget(e) {
|
|
3965
5059
|
a?.releaseTextActor(e);
|
|
5060
|
+
},
|
|
5061
|
+
measureText({ styleName: e, text: t }) {
|
|
5062
|
+
let n = a?.measureText;
|
|
5063
|
+
if (typeof n != "function") throw new $("BUBBLE-RUNTIME-003", "SVG Text does not provide text measurement.");
|
|
5064
|
+
return n.call(a, e, t);
|
|
3966
5065
|
}
|
|
3967
5066
|
},
|
|
3968
|
-
createSurface({ actor: e, actorKey:
|
|
3969
|
-
if (!
|
|
3970
|
-
return
|
|
5067
|
+
createSurface({ actor: e, actorKey: r, style: i }) {
|
|
5068
|
+
if (!oi(e) || typeof e.id != "string") throw new $("BUBBLE-RUNTIME-001", "Bubble actor target is invalid.");
|
|
5069
|
+
return yi(n, e, r, i, t.scheduler ?? {
|
|
5070
|
+
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
5071
|
+
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
5072
|
+
});
|
|
3971
5073
|
},
|
|
3972
5074
|
...t.scheduler === void 0 ? {} : { scheduler: t.scheduler },
|
|
3973
5075
|
...t.onAnimationError === void 0 ? {} : { onAnimationError: t.onAnimationError }
|
|
3974
5076
|
});
|
|
3975
5077
|
}
|
|
3976
5078
|
//#endregion
|
|
3977
|
-
export { $ as BubbleRuntimeAdapterError,
|
|
5079
|
+
export { $ as BubbleRuntimeAdapterError, bi as createTurboWarpBubbleComposition };
|