@pie-players/pie-tool-theme 0.3.52 → 0.3.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tool-color-scheme.js +104 -81
- package/package.json +5 -5
|
@@ -220,11 +220,11 @@ function Rt(e, t) {
|
|
|
220
220
|
throw e;
|
|
221
221
|
}
|
|
222
222
|
var gu = ~(We | nr | Pe);
|
|
223
|
-
function
|
|
223
|
+
function Y(e, t) {
|
|
224
224
|
e.f = e.f & gu | t;
|
|
225
225
|
}
|
|
226
226
|
function xo(e) {
|
|
227
|
-
(e.f & 512) !== 0 || e.deps === null ?
|
|
227
|
+
(e.f & 512) !== 0 || e.deps === null ? Y(e, Pe) : Y(e, nr);
|
|
228
228
|
}
|
|
229
229
|
function Oa(e) {
|
|
230
230
|
if (e !== null)
|
|
@@ -232,7 +232,7 @@ function Oa(e) {
|
|
|
232
232
|
(t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= cn, Oa(t.deps));
|
|
233
233
|
}
|
|
234
234
|
function Ia(e, t, r) {
|
|
235
|
-
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), Oa(e.deps),
|
|
235
|
+
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), Oa(e.deps), Y(e, Pe);
|
|
236
236
|
}
|
|
237
237
|
var mu = !1, Sn = !1;
|
|
238
238
|
function vu(e) {
|
|
@@ -263,9 +263,9 @@ function p(e, t) {
|
|
|
263
263
|
return e.get(L(e, t));
|
|
264
264
|
}
|
|
265
265
|
var La, jn = null, yr = null, P = null, ji = null, pe = null, qi = null, nn = !1, yi = !1, Or = null, qn = null, Pa = 0;
|
|
266
|
-
var bu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Vi = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(),
|
|
266
|
+
var bu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Vi = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), ir = class Na {
|
|
267
267
|
constructor() {
|
|
268
|
-
Co(this,
|
|
268
|
+
Co(this, X), m(this, "id", bu++), M(this, Vn, !1), m(this, "linked", !0), M(this, qt, null), M(this, Ft, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), M(this, Gn, /* @__PURE__ */ new Set()), M(this, wn, /* @__PURE__ */ new Set()), M(this, _r, 0), M(this, Ht, /* @__PURE__ */ new Map()), M(this, Yr, null), M(this, Oe, []), M(this, Vi, []), M(this, Zt, /* @__PURE__ */ new Set()), M(this, ht, /* @__PURE__ */ new Set()), M(this, It, /* @__PURE__ */ new Map()), M(this, Rn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), M(this, Kr, !1), yr === null ? jn = yr = this : (C(Ft, yr, this), C(qt, this, yr)), yr = this;
|
|
269
269
|
}
|
|
270
270
|
skip_effect(t) {
|
|
271
271
|
p(It, this).has(t) || p(It, this).set(t, {
|
|
@@ -278,9 +278,9 @@ var bu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
|
|
|
278
278
|
if (n) {
|
|
279
279
|
p(It, this).delete(t);
|
|
280
280
|
for (var i of n.d)
|
|
281
|
-
|
|
281
|
+
Y(i, We), r(i);
|
|
282
282
|
for (i of n.m)
|
|
283
|
-
|
|
283
|
+
Y(i, nr), r(i);
|
|
284
284
|
}
|
|
285
285
|
p(Rn, this).add(t);
|
|
286
286
|
}
|
|
@@ -295,14 +295,14 @@ var bu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
|
|
|
295
295
|
}
|
|
296
296
|
flush() {
|
|
297
297
|
try {
|
|
298
|
-
yi = !0, P = this, L(
|
|
298
|
+
yi = !0, P = this, L(X, this, Yn).call(this);
|
|
299
299
|
} finally {
|
|
300
300
|
Pa = 0, qi = null, Or = null, qn = null, yi = !1, P = null, pe = null, Yt.clear();
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
discard() {
|
|
304
304
|
for (const t of p(wn, this)) t(this);
|
|
305
|
-
p(wn, this).clear(), L(
|
|
305
|
+
p(wn, this).clear(), L(X, this, Kn).call(this), p(Yr, this)?.resolve();
|
|
306
306
|
}
|
|
307
307
|
register_created_effect(t) {
|
|
308
308
|
p(Vi, this).push(t);
|
|
@@ -400,43 +400,43 @@ function ms() {
|
|
|
400
400
|
return !1;
|
|
401
401
|
}
|
|
402
402
|
function Yn() {
|
|
403
|
-
C(Vn, this, !0), Pa++ > 1e3 && (L(
|
|
403
|
+
C(Vn, this, !0), Pa++ > 1e3 && (L(X, this, Kn).call(this), Su());
|
|
404
404
|
for (const a of p(Zt, this))
|
|
405
|
-
p(ht, this).delete(a),
|
|
405
|
+
p(ht, this).delete(a), Y(a, We), this.schedule(a);
|
|
406
406
|
for (const a of p(ht, this))
|
|
407
|
-
|
|
407
|
+
Y(a, nr), this.schedule(a);
|
|
408
408
|
const e = p(Oe, this);
|
|
409
409
|
C(Oe, this, []), this.apply();
|
|
410
410
|
var t = Or = [], r = [], n = qn = [];
|
|
411
411
|
for (const a of e) try {
|
|
412
|
-
L(
|
|
412
|
+
L(X, this, $a).call(this, a, t, r);
|
|
413
413
|
} catch (l) {
|
|
414
|
-
throw Ha(a), L(
|
|
414
|
+
throw Ha(a), L(X, this, ms).call(this) || this.discard(), l;
|
|
415
415
|
}
|
|
416
416
|
if (P = null, n.length > 0) {
|
|
417
417
|
var i = La.ensure();
|
|
418
418
|
for (const a of n) i.schedule(a);
|
|
419
419
|
}
|
|
420
|
-
if (Or = null, qn = null, L(
|
|
421
|
-
L(
|
|
420
|
+
if (Or = null, qn = null, L(X, this, ms).call(this)) {
|
|
421
|
+
L(X, this, Xr).call(this, r), L(X, this, Xr).call(this, t);
|
|
422
422
|
for (const [a, l] of p(It, this)) Wa(a, l);
|
|
423
|
-
n.length > 0 && L(
|
|
423
|
+
n.length > 0 && L(X, P, Yn).call(P);
|
|
424
424
|
return;
|
|
425
425
|
}
|
|
426
|
-
const o = L(
|
|
426
|
+
const o = L(X, this, yu).call(this);
|
|
427
427
|
if (o) {
|
|
428
|
-
L(
|
|
428
|
+
L(X, this, Xr).call(this, r), L(X, this, Xr).call(this, t), L(X, o, _u).call(o, this);
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
431
|
p(Zt, this).clear(), p(ht, this).clear();
|
|
432
432
|
for (const a of p(Gn, this)) a(this);
|
|
433
433
|
p(Gn, this).clear(), ji = this, vs(r), vs(t), ji = null, p(Yr, this)?.resolve();
|
|
434
434
|
var s = P;
|
|
435
|
-
if (p(_r, this) === 0 && (p(Oe, this).length === 0 || s !== null) && (L(
|
|
435
|
+
if (p(_r, this) === 0 && (p(Oe, this).length === 0 || s !== null) && (L(X, this, Kn).call(this), gt && (L(X, this, Tu).call(this), P = s)), p(Oe, this).length > 0) if (s !== null) {
|
|
436
436
|
const a = s;
|
|
437
437
|
p(Oe, a).push(...p(Oe, this).filter((l) => !p(Oe, a).includes(l)));
|
|
438
438
|
} else s = this;
|
|
439
|
-
s !== null && L(
|
|
439
|
+
s !== null && L(X, s, Yn).call(s);
|
|
440
440
|
}
|
|
441
441
|
function $a(e, t, r) {
|
|
442
442
|
e.f ^= Pe;
|
|
@@ -485,12 +485,12 @@ function _u(e) {
|
|
|
485
485
|
if ((i & 2) !== 0) t(s);
|
|
486
486
|
else {
|
|
487
487
|
var o = s;
|
|
488
|
-
i & 4194320 && !this.async_deriveds.has(o) && (p(ht, this).delete(o),
|
|
488
|
+
i & 4194320 && !this.async_deriveds.has(o) && (p(ht, this).delete(o), Y(o, We), this.schedule(o));
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
for (const r of this.current.keys()) t(r);
|
|
493
|
-
this.oncommit(() => e.discard()), L(
|
|
493
|
+
this.oncommit(() => e.discard()), L(X, e, Kn).call(e), P = this, L(X, this, Yn).call(this);
|
|
494
494
|
}
|
|
495
495
|
function Xr(e) {
|
|
496
496
|
for (var t = 0; t < e.length; t += 1) Ia(e[t], p(Zt, this), p(ht, this));
|
|
@@ -516,7 +516,7 @@ function Tu() {
|
|
|
516
516
|
e && c.discard();
|
|
517
517
|
else if (t.length > 0) {
|
|
518
518
|
if (e) for (const u of p(Rn, this)) c.unskip_effect(u, (f) => {
|
|
519
|
-
(f.f & 4194320) !== 0 ? c.schedule(f) : L(
|
|
519
|
+
(f.f & 4194320) !== 0 ? c.schedule(f) : L(X, c, Xr).call(c, [f]);
|
|
520
520
|
});
|
|
521
521
|
c.activate();
|
|
522
522
|
var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
@@ -527,10 +527,10 @@ function Tu() {
|
|
|
527
527
|
return h ? h[0] !== f[0] || h[1] !== f[1] : !0;
|
|
528
528
|
}).map(([u]) => u);
|
|
529
529
|
if (a.length > 0)
|
|
530
|
-
for (const u of p(Vi, this)) (u.f & 155648) === 0 && Mo(u, a, o) && ((u.f & 4194320) !== 0 ? (
|
|
530
|
+
for (const u of p(Vi, this)) (u.f & 155648) === 0 && Mo(u, a, o) && ((u.f & 4194320) !== 0 ? (Y(u, We), c.schedule(u)) : p(Zt, c).add(u));
|
|
531
531
|
if (p(Oe, c).length > 0 && !p(Kr, c)) {
|
|
532
532
|
c.apply();
|
|
533
|
-
for (var l of p(Oe, c)) L(
|
|
533
|
+
for (var l of p(Oe, c)) L(X, c, $a).call(c, l, [], []);
|
|
534
534
|
C(Oe, c, []);
|
|
535
535
|
}
|
|
536
536
|
c.deactivate();
|
|
@@ -598,7 +598,7 @@ function Da(e, t, r, n) {
|
|
|
598
598
|
if (!r.has(e) && (r.add(e), e.reactions !== null))
|
|
599
599
|
for (const i of e.reactions) {
|
|
600
600
|
const o = i.f;
|
|
601
|
-
(o & 2) !== 0 ? Da(i, t, r, n) : (o & 4194320) !== 0 && (o & 2048) === 0 && Mo(i, t, n) && (
|
|
601
|
+
(o & 2) !== 0 ? Da(i, t, r, n) : (o & 4194320) !== 0 && (o & 2048) === 0 && Mo(i, t, n) && (Y(i, We), Oo(i));
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
function Mo(e, t, r) {
|
|
@@ -616,13 +616,13 @@ function Oo(e) {
|
|
|
616
616
|
}
|
|
617
617
|
function Wa(e, t) {
|
|
618
618
|
if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
|
|
619
|
-
(e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e),
|
|
619
|
+
(e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), Y(e, Pe);
|
|
620
620
|
for (var r = e.first; r !== null; )
|
|
621
621
|
Wa(r, t), r = r.next;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
function Ha(e) {
|
|
625
|
-
|
|
625
|
+
Y(e, Pe);
|
|
626
626
|
for (var t = e.first; t !== null; )
|
|
627
627
|
Ha(t), t = t.next;
|
|
628
628
|
}
|
|
@@ -925,7 +925,7 @@ function Lo(e) {
|
|
|
925
925
|
function Ua(e) {
|
|
926
926
|
var t = Lo(e);
|
|
927
927
|
if (!e.equals(t) && (e.wv = ll(), (!P?.is_fork || e.deps === null) && (P !== null ? (P.capture(e, t, !0), ji?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
|
|
928
|
-
|
|
928
|
+
Y(e, Pe);
|
|
929
929
|
return;
|
|
930
930
|
}
|
|
931
931
|
mt || (pe !== null ? ($o() || P?.is_fork) && pe.set(e, t) : xo(e));
|
|
@@ -985,7 +985,7 @@ function Ir(e, t, r = null) {
|
|
|
985
985
|
function Nu() {
|
|
986
986
|
qa = !1;
|
|
987
987
|
for (const e of Jn) {
|
|
988
|
-
(e.f & 1024) !== 0 &&
|
|
988
|
+
(e.f & 1024) !== 0 && Y(e, nr);
|
|
989
989
|
let t;
|
|
990
990
|
try {
|
|
991
991
|
t = dn(e);
|
|
@@ -1006,7 +1006,7 @@ function Ga(e, t, r) {
|
|
|
1006
1006
|
var a = n[s], l = a.f;
|
|
1007
1007
|
if (!(!i && a === O)) {
|
|
1008
1008
|
var c = (l & We) === 0;
|
|
1009
|
-
if (c &&
|
|
1009
|
+
if (c && Y(a, t), (l & 131072) !== 0) Jn.add(a);
|
|
1010
1010
|
else if ((l & 2) !== 0) {
|
|
1011
1011
|
var u = a;
|
|
1012
1012
|
pe?.delete(u), (l & 65536) === 0 && (l & 512 && (O === null || (O.f & 2097152) === 0) && (a.f |= cn), Ga(u, nr, r));
|
|
@@ -1264,7 +1264,7 @@ function $o() {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
function Bu(e) {
|
|
1266
1266
|
const t = rt(8, null);
|
|
1267
|
-
return
|
|
1267
|
+
return Y(t, Pe), t.teardown = e, t;
|
|
1268
1268
|
}
|
|
1269
1269
|
function Sr(e) {
|
|
1270
1270
|
zu("$effect");
|
|
@@ -1345,7 +1345,7 @@ function Vu(e) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
function ge(e, t = !0) {
|
|
1347
1347
|
var r = !1;
|
|
1348
|
-
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Gu(e.nodes.start, e.nodes.end), r = !0),
|
|
1348
|
+
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Gu(e.nodes.start, e.nodes.end), r = !0), Y(e, hs), Ho(e, t && !r), ln(e, 0);
|
|
1349
1349
|
var n = e.nodes && e.nodes.t;
|
|
1350
1350
|
if (n !== null) for (const o of n) o.stop();
|
|
1351
1351
|
rl(e), e.f ^= hs, e.f |= qc;
|
|
@@ -1394,7 +1394,7 @@ function Qn(e) {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
function ol(e, t) {
|
|
1396
1396
|
if ((e.f & 8192) !== 0) {
|
|
1397
|
-
e.f ^= ko, (e.f & 1024) === 0 && (
|
|
1397
|
+
e.f ^= ko, (e.f & 1024) === 0 && (Y(e, We), ir.ensure().schedule(e));
|
|
1398
1398
|
for (var r = e.first; r !== null; ) {
|
|
1399
1399
|
var n = r.next, i = (r.f & 65536) !== 0 || (r.f & 32) !== 0;
|
|
1400
1400
|
ol(r, i ? t : !1), r = n;
|
|
@@ -1446,7 +1446,7 @@ function dn(e) {
|
|
|
1446
1446
|
var o = r[i];
|
|
1447
1447
|
if (dn(o) && Ua(o), o.wv > e.wv) return !0;
|
|
1448
1448
|
}
|
|
1449
|
-
(t & 512) !== 0 && pe === null &&
|
|
1449
|
+
(t & 512) !== 0 && pe === null && Y(e, Pe);
|
|
1450
1450
|
}
|
|
1451
1451
|
return !1;
|
|
1452
1452
|
}
|
|
@@ -1455,7 +1455,7 @@ function cl(e, t, r = !0) {
|
|
|
1455
1455
|
if (n !== null && !(!gt && qe !== null && qe.has(e)))
|
|
1456
1456
|
for (var i = 0; i < n.length; i++) {
|
|
1457
1457
|
var o = n[i];
|
|
1458
|
-
(o.f & 2) !== 0 ? cl(o, t, !1) : t === o && (r ?
|
|
1458
|
+
(o.f & 2) !== 0 ? cl(o, t, !1) : t === o && (r ? Y(o, We) : (o.f & 1024) !== 0 && Y(o, nr), Oo(o));
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
1461
|
function ul(e) {
|
|
@@ -1513,7 +1513,7 @@ function ln(e, t) {
|
|
|
1513
1513
|
function Rr(e) {
|
|
1514
1514
|
var t = e.f;
|
|
1515
1515
|
if ((t & 16384) === 0) {
|
|
1516
|
-
|
|
1516
|
+
Y(e, Pe);
|
|
1517
1517
|
var r = O, n = Ln;
|
|
1518
1518
|
if (O = e, Ln = !0, 0)
|
|
1519
1519
|
var i, o;
|
|
@@ -3981,7 +3981,7 @@ var md = {
|
|
|
3981
3981
|
}
|
|
3982
3982
|
};
|
|
3983
3983
|
}
|
|
3984
|
-
},
|
|
3984
|
+
}, G = (e) => e.trim().replace(/\s+/g, " "), Cl = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, Ml = (e) => {
|
|
3985
3985
|
if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
|
|
3986
3986
|
const t = e.classList;
|
|
3987
3987
|
if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
|
|
@@ -4097,7 +4097,7 @@ var md = {
|
|
|
4097
4097
|
}
|
|
4098
4098
|
}, Rl = async (e, t = {}) => {
|
|
4099
4099
|
if (!e.some((c) => c.type === "math")) return {
|
|
4100
|
-
speechText:
|
|
4100
|
+
speechText: G(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
|
|
4101
4101
|
usedMathSpeech: !1,
|
|
4102
4102
|
usedFallback: !1
|
|
4103
4103
|
};
|
|
@@ -4110,7 +4110,7 @@ var md = {
|
|
|
4110
4110
|
}
|
|
4111
4111
|
try {
|
|
4112
4112
|
r || (r = await o());
|
|
4113
|
-
const u =
|
|
4113
|
+
const u = G(await Il(r, c.mathml, t.language, "none", t.mathSpeech));
|
|
4114
4114
|
if (u) {
|
|
4115
4115
|
s.push(u), n = !0;
|
|
4116
4116
|
continue;
|
|
@@ -4120,7 +4120,7 @@ var md = {
|
|
|
4120
4120
|
i = !0, console.debug("[TTSService] Math speech generation failed; using visible fallback", { message: u instanceof Error ? u.message : String(u) }), s.push(c.fallbackText);
|
|
4121
4121
|
}
|
|
4122
4122
|
}
|
|
4123
|
-
const a =
|
|
4123
|
+
const a = G(s.join(" "));
|
|
4124
4124
|
let l;
|
|
4125
4125
|
return t.produceSsml && r && n && e.length === 1 && e[0].type === "math" && (l = await wd(r, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
4126
4126
|
speechText: a,
|
|
@@ -5051,7 +5051,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
5051
5051
|
}
|
|
5052
5052
|
const o = Qd(t);
|
|
5053
5053
|
return {
|
|
5054
|
-
spokenText:
|
|
5054
|
+
spokenText: G(o.text),
|
|
5055
5055
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
5056
5056
|
unsupportedSemantic: r,
|
|
5057
5057
|
hasMarkup: n
|
|
@@ -5212,7 +5212,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
5212
5212
|
const n = e.length / Math.max(1, Math.min(t.length, r.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
|
|
5213
5213
|
return Math.min(1, n * i);
|
|
5214
5214
|
}, zl = (e) => {
|
|
5215
|
-
const t = Wl(e.speechText), r =
|
|
5215
|
+
const t = Wl(e.speechText), r = G(e.visibleText), n = t.spokenText, i = so(n), o = so(r), s = t.unsupportedSemantic ? [] : ih(i, o), a = oh(s, i, o), l = n === r && n.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", f = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
|
|
5216
5216
|
return {
|
|
5217
5217
|
speechText: e.speechText,
|
|
5218
5218
|
spokenText: n,
|
|
@@ -5965,7 +5965,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
5965
5965
|
if (!Jl(o))
|
|
5966
5966
|
for (const s of Array.from(o.childNodes)) n(s);
|
|
5967
5967
|
};
|
|
5968
|
-
return n(t.documentElement),
|
|
5968
|
+
return n(t.documentElement), G(r.join(" "));
|
|
5969
5969
|
}, Zh = (e, t, r) => {
|
|
5970
5970
|
const n = Yl(r), i = (a) => {
|
|
5971
5971
|
if (Nr(a, e)) return;
|
|
@@ -5979,7 +5979,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
5979
5979
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5980
5980
|
};
|
|
5981
5981
|
i(e), ec(n);
|
|
5982
|
-
const o =
|
|
5982
|
+
const o = G(n.chars.join(""));
|
|
5983
5983
|
if (o) return {
|
|
5984
5984
|
text: o,
|
|
5985
5985
|
map: n.map
|
|
@@ -5996,7 +5996,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
5996
5996
|
const r = Yl(t), n = [];
|
|
5997
5997
|
let i = 0, o, s = !1;
|
|
5998
5998
|
const a = () => {
|
|
5999
|
-
const u =
|
|
5999
|
+
const u = G(r.chars.slice(i, r.chars.length).join(""));
|
|
6000
6000
|
u && n.push({
|
|
6001
6001
|
type: "text",
|
|
6002
6002
|
text: u,
|
|
@@ -6017,7 +6017,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
6017
6017
|
a();
|
|
6018
6018
|
const g = Zh(f, h, t);
|
|
6019
6019
|
Jh(r, g);
|
|
6020
|
-
const v =
|
|
6020
|
+
const v = G(g.text);
|
|
6021
6021
|
n.push({
|
|
6022
6022
|
type: "math",
|
|
6023
6023
|
mathml: h,
|
|
@@ -6075,7 +6075,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
6075
6075
|
const t = e.resolveMathSpeech ?? tp, { visibleText: r } = e, n = [];
|
|
6076
6076
|
let i = 0;
|
|
6077
6077
|
const o = (a) => {
|
|
6078
|
-
const l =
|
|
6078
|
+
const l = G(a), c = r.indexOf(l, i), u = c >= 0 ? c : i, f = u + l.length;
|
|
6079
6079
|
return i = f, {
|
|
6080
6080
|
start: u,
|
|
6081
6081
|
end: f
|
|
@@ -6089,7 +6089,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
6089
6089
|
offset: 0
|
|
6090
6090
|
}] : jo(l.text, { locale: e.language });
|
|
6091
6091
|
for (const v of g) {
|
|
6092
|
-
const _ =
|
|
6092
|
+
const _ = G(v.text);
|
|
6093
6093
|
if (!_) continue;
|
|
6094
6094
|
const b = o(_);
|
|
6095
6095
|
n.push({
|
|
@@ -6126,7 +6126,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
6126
6126
|
segments: n,
|
|
6127
6127
|
locale: rp(e.language),
|
|
6128
6128
|
visibleText: r,
|
|
6129
|
-
plainSpeechText:
|
|
6129
|
+
plainSpeechText: G(s.join(" "))
|
|
6130
6130
|
};
|
|
6131
6131
|
}, ap = (e) => (e || "en").split("-")[0].toLowerCase() || "en", lp = "sre-v1", cp = 256, fo = (e) => Array.isArray(e) ? `array:[${e.map(fo).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${JSON.stringify(t)}:${fo(r)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, Js = (e, t, r, n) => `${lp}\0${ap(e)}\0${t ? "ssml" : "plain"}\0${fo(r ?? null)}\0${n}`, up = (e = {}) => {
|
|
6132
6132
|
const t = Math.max(1, e.maxEntries ?? cp), r = e.resolve ?? ((o, s) => Rl([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
@@ -6595,7 +6595,7 @@ var Xd = /* @__PURE__ */ new Set([
|
|
|
6595
6595
|
})(z || (z = {}));
|
|
6596
6596
|
var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Wp = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? uc(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Hp = class mo {
|
|
6597
6597
|
constructor() {
|
|
6598
|
-
m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "highlightTargetResolverProvider", null), m(this, "catalogResolver", null), m(this, "state", z.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "activeWordBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", up());
|
|
6598
|
+
m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "highlightTargetResolverProvider", null), m(this, "catalogResolver", null), m(this, "state", z.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "activeWordBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "playbackChunks", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", up());
|
|
6599
6599
|
}
|
|
6600
6600
|
debugLog(t, r) {
|
|
6601
6601
|
mo.debugEnabled && (r === void 0 ? console.debug(t) : console.debug(t, r));
|
|
@@ -6970,6 +6970,17 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6970
6970
|
const n = t.playbackSegments.map((i) => i.startOffset).filter((i) => i > 0);
|
|
6971
6971
|
return this.splitSegmentsAtBoundaries(r, n, t.contentToSpeak);
|
|
6972
6972
|
}
|
|
6973
|
+
createSeekSegmentsFromSpeechChunks(t) {
|
|
6974
|
+
let r = 0;
|
|
6975
|
+
return t.map((n) => {
|
|
6976
|
+
const i = G(n.plainFallback?.speechText || (this.hasExplicitBreakSemantics(n.speechText) ? n.visibleText : n.speechText) || n.visibleText) || n.visibleText || "", o = {
|
|
6977
|
+
text: i,
|
|
6978
|
+
startOffset: r,
|
|
6979
|
+
pauseMsAfter: 0
|
|
6980
|
+
};
|
|
6981
|
+
return r += Math.max(1, i.length + 1), o;
|
|
6982
|
+
});
|
|
6983
|
+
}
|
|
6973
6984
|
getCurrentSeekSegmentIndex() {
|
|
6974
6985
|
if (this.seekSegments.length === 0) return 0;
|
|
6975
6986
|
let t = 0;
|
|
@@ -7069,7 +7080,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7069
7080
|
const g = r?.highlightModeOverride || (f ? this.resolveHighlightMode() : "sentence");
|
|
7070
7081
|
this.activeHighlightMode = g, this.activeWordBoundaryOffset = r?.wordBoundaryOffset || 0;
|
|
7071
7082
|
const v = this.hasExplicitBreakSemantics(o), _ = !!this.currentContentElement && !c && !v && f;
|
|
7072
|
-
if (this.seekSegments = v || !f ? [] : _ && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = v ? [] : this.createSentenceHighlightSegments({
|
|
7083
|
+
if (this.playbackChunks = h?.length ? h : [], this.seekSegments = this.playbackChunks.length ? this.createSeekSegmentsFromSpeechChunks(this.playbackChunks) : v || !f ? [] : _ && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = v ? [] : this.createSentenceHighlightSegments({
|
|
7073
7084
|
contentToSpeak: a,
|
|
7074
7085
|
shouldUsePlan: _,
|
|
7075
7086
|
playbackSegments: this.seekSegments
|
|
@@ -7148,7 +7159,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7148
7159
|
}, "updateSettings" in this.provider && typeof this.provider.updateSettings == "function" && await this.provider.updateSettings({ providerOptions: o });
|
|
7149
7160
|
}
|
|
7150
7161
|
async resolveSpeechContent(t, r) {
|
|
7151
|
-
const n =
|
|
7162
|
+
const n = G(t);
|
|
7152
7163
|
if (r?.ignoreCatalogs) return {
|
|
7153
7164
|
contentToSpeak: n,
|
|
7154
7165
|
speechText: n,
|
|
@@ -7168,7 +7179,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7168
7179
|
context: r.catalogContext
|
|
7169
7180
|
});
|
|
7170
7181
|
if (o) {
|
|
7171
|
-
const s = r?.contentElement && Zr(r.contentElement, this.getTextProcessingOptions(r.language)).visibleText || n, a =
|
|
7182
|
+
const s = r?.contentElement && Zr(r.contentElement, this.getTextProcessingOptions(r.language)).visibleText || n, a = G(o.content);
|
|
7172
7183
|
return this.debugLog(`[TTSService] Using catalog content for "${r.catalogId}" (${o.language})`), {
|
|
7173
7184
|
contentToSpeak: o.content,
|
|
7174
7185
|
speechText: o.content,
|
|
@@ -7202,7 +7213,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7202
7213
|
if (!this.catalogResolver) return null;
|
|
7203
7214
|
const i = this.collectCatalogSpeechChunks(t, n);
|
|
7204
7215
|
if (!i.some((a) => a.sourceElement)) return null;
|
|
7205
|
-
const o =
|
|
7216
|
+
const o = G(i.map((a) => a.speechText).join(" ")), s = Zr(t, this.getTextProcessingOptions(n.language)).visibleText || r;
|
|
7206
7217
|
return {
|
|
7207
7218
|
contentToSpeak: o,
|
|
7208
7219
|
speechText: o,
|
|
@@ -7220,7 +7231,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7220
7231
|
const n = [];
|
|
7221
7232
|
let i = "";
|
|
7222
7233
|
const o = () => {
|
|
7223
|
-
const u =
|
|
7234
|
+
const u = G(i);
|
|
7224
7235
|
i = "", u && n.push({
|
|
7225
7236
|
speechText: u,
|
|
7226
7237
|
visibleText: u,
|
|
@@ -7238,7 +7249,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7238
7249
|
}, a = (u, f) => {
|
|
7239
7250
|
const h = l(u);
|
|
7240
7251
|
if (h.length !== 1) return null;
|
|
7241
|
-
const g = h[0], v = Zr(g, this.getTextProcessingOptions(r.language)).visibleText ||
|
|
7252
|
+
const g = h[0], v = Zr(g, this.getTextProcessingOptions(r.language)).visibleText || G(g.textContent || ""), _ = (b) => G(b).replace(/\s+/g, "");
|
|
7242
7253
|
return _(v) === _(f) ? g : null;
|
|
7243
7254
|
}, l = (u) => {
|
|
7244
7255
|
const f = Array.from(u.querySelectorAll("math"));
|
|
@@ -7253,7 +7264,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7253
7264
|
const f = u, h = s(f);
|
|
7254
7265
|
if (h) {
|
|
7255
7266
|
o();
|
|
7256
|
-
const g = Zr(f, this.getTextProcessingOptions(r.language)), v = g.visibleText ||
|
|
7267
|
+
const g = Zr(f, this.getTextProcessingOptions(r.language)), v = g.visibleText || G(f.textContent || ""), _ = zl({
|
|
7257
7268
|
speechText: h.content,
|
|
7258
7269
|
visibleText: v
|
|
7259
7270
|
}), b = a(f, v), T = b ? ri({
|
|
@@ -7265,7 +7276,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7265
7276
|
mathElement: S,
|
|
7266
7277
|
speechText: h.content
|
|
7267
7278
|
})
|
|
7268
|
-
})), N =
|
|
7279
|
+
})), N = G(h.content);
|
|
7269
7280
|
n.push({
|
|
7270
7281
|
speechText: h.content,
|
|
7271
7282
|
visibleText: v,
|
|
@@ -7328,7 +7339,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7328
7339
|
});
|
|
7329
7340
|
}
|
|
7330
7341
|
initializeSpeakTracking(t, r) {
|
|
7331
|
-
this.currentText = t, this.currentContentElement = r?.contentElement || null, this.lastError = null, this.currentBoundaryOffset = 0, this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
7342
|
+
this.currentText = t, this.currentContentElement = r?.contentElement || null, this.lastError = null, this.currentBoundaryOffset = 0, this.playbackChunks = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
7332
7343
|
}
|
|
7333
7344
|
prepareHighlightsForSpeak(t) {
|
|
7334
7345
|
if (!this.currentContentElement || !this.highlightCoordinator || (this.buildPositionMap(this.currentContentElement, t.contentToSpeak, t.options?.language), t.highlightMode === "sentence" && t.shouldUsePlan)) return;
|
|
@@ -7473,9 +7484,13 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7473
7484
|
}
|
|
7474
7485
|
async executeSpeakPlayback(t) {
|
|
7475
7486
|
if (t.speechChunks?.length && this.provider) {
|
|
7476
|
-
for (
|
|
7487
|
+
for (let r = 0; r < t.speechChunks.length; r++) {
|
|
7477
7488
|
if (t.runId !== this.speakRunId) return;
|
|
7478
|
-
|
|
7489
|
+
this.currentSeekSegmentIndex = r;
|
|
7490
|
+
const n = this.seekSegments[r];
|
|
7491
|
+
n && (this.currentBoundaryOffset = n.startOffset);
|
|
7492
|
+
const i = t.speechChunks[r];
|
|
7493
|
+
await this.speakCatalogChunk(i, t.runId);
|
|
7479
7494
|
}
|
|
7480
7495
|
return;
|
|
7481
7496
|
}
|
|
@@ -7487,7 +7502,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7487
7502
|
this.provider && await this.provider.speak(t.contentToSpeak);
|
|
7488
7503
|
}
|
|
7489
7504
|
clearHighlightsAndTracking() {
|
|
7490
|
-
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
7505
|
+
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.playbackChunks = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
7491
7506
|
}
|
|
7492
7507
|
async speakRange(t, r) {
|
|
7493
7508
|
if (!this.provider) throw new Error("TTS service not initialized");
|
|
@@ -7501,7 +7516,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7501
7516
|
if (!i) return;
|
|
7502
7517
|
const o = document.createRange();
|
|
7503
7518
|
o.selectNodeContents(i), o.setEnd(t.startContainer, t.startOffset);
|
|
7504
|
-
const s = o.toString(), a =
|
|
7519
|
+
const s = o.toString(), a = G(s), l = a.length + (/\s$/.test(s) && a ? 1 : 0);
|
|
7505
7520
|
this.debugLog("[TTSService] speakRange offset calculation:", {
|
|
7506
7521
|
selectedText: n,
|
|
7507
7522
|
textBeforeRange: s.substring(0, 100),
|
|
@@ -7524,19 +7539,27 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7524
7539
|
}
|
|
7525
7540
|
async restartFromSeekIndex(t) {
|
|
7526
7541
|
if (!this.provider || this.seekSegments.length === 0) return;
|
|
7527
|
-
const r = Math.max(0, Math.min(this.seekSegments.length - 1, t));
|
|
7542
|
+
const r = Math.max(0, Math.min(this.seekSegments.length - 1, t)), n = this.playbackChunks.length ? this.playbackChunks.slice(r) : null;
|
|
7528
7543
|
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = r;
|
|
7529
|
-
const
|
|
7544
|
+
const i = ++this.speakRunId, o = this.seekSegments.slice(r);
|
|
7530
7545
|
this.setState(z.PLAYING);
|
|
7531
7546
|
try {
|
|
7532
7547
|
if (this.configureWordBoundaryHighlighting({
|
|
7533
7548
|
highlightMode: this.activeHighlightMode,
|
|
7534
7549
|
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
7535
|
-
}),
|
|
7550
|
+
}), n) for (let s = 0; s < n.length; s++) {
|
|
7551
|
+
if (i !== this.speakRunId) return;
|
|
7552
|
+
const a = r + s;
|
|
7553
|
+
this.currentSeekSegmentIndex = a;
|
|
7554
|
+
const l = this.seekSegments[a];
|
|
7555
|
+
l && (this.currentBoundaryOffset = l.startOffset), await this.speakCatalogChunk(n[s], i);
|
|
7556
|
+
}
|
|
7557
|
+
else await this.speakWithPlan(o, i, { highlightMode: this.activeHighlightMode });
|
|
7558
|
+
if (i !== this.speakRunId) return;
|
|
7536
7559
|
this.setState(z.IDLE), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null;
|
|
7537
|
-
} catch (
|
|
7538
|
-
if (
|
|
7539
|
-
throw this.lastError =
|
|
7560
|
+
} catch (s) {
|
|
7561
|
+
if (i !== this.speakRunId) return;
|
|
7562
|
+
throw this.lastError = s instanceof Error ? s.message : String(s), this.setState(z.ERROR), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null, s;
|
|
7540
7563
|
}
|
|
7541
7564
|
}
|
|
7542
7565
|
async setPlaybackRate(t) {
|
|
@@ -7559,7 +7582,7 @@ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7559
7582
|
await this.seekBy(-r);
|
|
7560
7583
|
}
|
|
7561
7584
|
stop() {
|
|
7562
|
-
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(z.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
7585
|
+
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(z.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.playbackChunks = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
7563
7586
|
}
|
|
7564
7587
|
requestControlHandoff() {
|
|
7565
7588
|
typeof window > "u" || window.dispatchEvent(new CustomEvent(Dp, { detail: { source: "host" } }));
|
|
@@ -9030,7 +9053,7 @@ function vc() {
|
|
|
9030
9053
|
let Q = ua();
|
|
9031
9054
|
t.isSupported = typeof pc == "function" && typeof N == "function" && B && B.createHTMLDocument !== void 0;
|
|
9032
9055
|
const { MUSTACHE_EXPR: wt, ERB_EXPR: sr, TMPLIT_EXPR: k, DATA_ATTR: x, ARIA_ATTR: H, IS_SCRIPT_OR_DATA: ae, ATTR_WHITESPACE: ot, CUSTOM_ELEMENT: be } = ca;
|
|
9033
|
-
let { IS_ALLOWED_URI: ar } = ca,
|
|
9056
|
+
let { IS_ALLOWED_URI: ar } = ca, K = null;
|
|
9034
9057
|
const pn = R({}, [
|
|
9035
9058
|
...oa,
|
|
9036
9059
|
...Di,
|
|
@@ -9163,11 +9186,11 @@ function vc() {
|
|
|
9163
9186
|
}, mi = function() {
|
|
9164
9187
|
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9165
9188
|
if (!(gr && gr === d)) {
|
|
9166
|
-
if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Wr = Cc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Mc : d.PARSER_MEDIA_TYPE, te = Wr === "application/xhtml+xml" ? Ni : Wn,
|
|
9189
|
+
if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Wr = Cc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Mc : d.PARSER_MEDIA_TYPE, te = Wr === "application/xhtml+xml" ? Ni : Wn, K = Fe(d, "ALLOWED_TAGS") ? R({}, d.ALLOWED_TAGS, te) : pn, Z = Fe(d, "ALLOWED_ATTR") ? R({}, d.ALLOWED_ATTR, te) : lr, gi = Fe(d, "ALLOWED_NAMESPACES") ? R({}, d.ALLOWED_NAMESPACES, Ni) : Ac, hi = Fe(d, "ADD_URI_SAFE_ATTR") ? R(Xe(Jo), d.ADD_URI_SAFE_ATTR, te) : Jo, Ko = Fe(d, "ADD_DATA_URI_TAGS") ? R(Xe(Xo), d.ADD_DATA_URI_TAGS, te) : Xo, ye = Fe(d, "FORBID_CONTENTS") ? R({}, d.FORBID_CONTENTS, te) : Dr, kt = Fe(d, "FORBID_TAGS") ? R({}, d.FORBID_TAGS, te) : Xe({}), cr = Fe(d, "FORBID_ATTR") ? R({}, d.FORBID_ATTR, te) : Xe({}), At = Fe(d, "USE_PROFILES") ? d.USE_PROFILES : !1, gn = d.ALLOW_ARIA_ATTR !== !1, st = d.ALLOW_DATA_ATTR !== !1, ur = d.ALLOW_UNKNOWN_PROTOCOLS || !1, fr = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ne = d.SAFE_FOR_TEMPLATES || !1, Se = d.SAFE_FOR_XML !== !1, Ge = d.WHOLE_DOCUMENT || !1, at = d.RETURN_DOM || !1, dr = d.RETURN_DOM_FRAGMENT || !1, Et = d.RETURN_TRUSTED_TYPE || !1, Pt = d.FORCE_BODY || !1, hr = d.SANITIZE_DOM !== !1, mn = d.SANITIZE_NAMED_PROPS || !1, $r = d.KEEP_CONTENT !== !1, Nt = d.IN_PLACE || !1, ar = d.ALLOWED_URI_REGEXP || gc, pr = d.NAMESPACE || Ye, _n = d.MATHML_TEXT_INTEGRATION_POINTS || _n, Tn = d.HTML_INTEGRATION_POINTS || Tn, j = d.CUSTOM_ELEMENT_HANDLING || en(null), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (j.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (j.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (j.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ne && (st = !1), dr && (at = !0), At && (K = R({}, sa), Z = en(null), At.html === !0 && (R(K, oa), R(Z, aa)), At.svg === !0 && (R(K, Di), R(Z, zi), R(Z, On)), At.svgFilters === !0 && (R(K, Wi), R(Z, zi), R(Z, On)), At.mathMl === !0 && (R(K, Hi), R(Z, la), R(Z, On))), Ve.tagCheck = null, Ve.attributeCheck = null, d.ADD_TAGS && (typeof d.ADD_TAGS == "function" ? Ve.tagCheck = d.ADD_TAGS : (K === pn && (K = Xe(K)), R(K, d.ADD_TAGS, te))), d.ADD_ATTR && (typeof d.ADD_ATTR == "function" ? Ve.attributeCheck = d.ADD_ATTR : (Z === lr && (Z = Xe(Z)), R(Z, d.ADD_ATTR, te))), d.ADD_URI_SAFE_ATTR && R(hi, d.ADD_URI_SAFE_ATTR, te), d.FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.FORBID_CONTENTS, te)), d.ADD_FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.ADD_FORBID_CONTENTS, te)), $r && (K["#text"] = !0), Ge && R(K, [
|
|
9167
9190
|
"html",
|
|
9168
9191
|
"head",
|
|
9169
9192
|
"body"
|
|
9170
|
-
]),
|
|
9193
|
+
]), K.table && (R(K, ["tbody"]), delete kt.tbody), d.TRUSTED_TYPES_POLICY) {
|
|
9171
9194
|
if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function") throw qr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
9172
9195
|
if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
9173
9196
|
S = d.TRUSTED_TYPES_POLICY, F = S.createHTML("");
|
|
@@ -9255,10 +9278,10 @@ function vc() {
|
|
|
9255
9278
|
const E = te(d.nodeName);
|
|
9256
9279
|
if (lt(Q.uponSanitizeElement, d, {
|
|
9257
9280
|
tagName: E,
|
|
9258
|
-
allowedTags:
|
|
9281
|
+
allowedTags: K
|
|
9259
9282
|
}), Se && d.hasChildNodes() && !bi(d.firstElementChild) && de(/<[/\w!]/g, d.innerHTML) && de(/<[/\w!]/g, d.textContent) || Se && d.namespaceURI === Ye && E === "style" && bi(d.firstElementChild) || d.nodeType === Gr.progressingInstruction || Se && d.nodeType === Gr.comment && de(/<[/\w]/g, d.data))
|
|
9260
9283
|
return He(d), !0;
|
|
9261
|
-
if (kt[E] || !(Ve.tagCheck instanceof Function && Ve.tagCheck(E)) && !
|
|
9284
|
+
if (kt[E] || !(Ve.tagCheck instanceof Function && Ve.tagCheck(E)) && !K[E]) {
|
|
9262
9285
|
if (!kt[E] && os(E) && (j.tagNameCheck instanceof RegExp && de(j.tagNameCheck, E) || j.tagNameCheck instanceof Function && j.tagNameCheck(E)))
|
|
9263
9286
|
return !1;
|
|
9264
9287
|
if ($r && !ye[E]) {
|
|
@@ -9377,7 +9400,7 @@ function vc() {
|
|
|
9377
9400
|
if (Lt || mi(d), t.removed = [], typeof A == "string" && (Nt = !1), Nt) {
|
|
9378
9401
|
if (A.nodeName) {
|
|
9379
9402
|
const ie = te(A.nodeName);
|
|
9380
|
-
if (!
|
|
9403
|
+
if (!K[ie] || kt[ie]) throw qr("root node is forbidden and cannot be sanitized in-place");
|
|
9381
9404
|
}
|
|
9382
9405
|
} else if (A instanceof a)
|
|
9383
9406
|
y = ts("<!---->"), E = y.ownerDocument.importNode(A, !0), E.nodeType === Gr.element && E.nodeName === "BODY" || E.nodeName === "HTML" ? y = E : y.appendChild(E);
|
|
@@ -9408,7 +9431,7 @@ function vc() {
|
|
|
9408
9431
|
return (Z.shadowroot || Z.shadowrootmode) && (U = J.call(n, U, !0)), U;
|
|
9409
9432
|
}
|
|
9410
9433
|
let xe = Ge ? y.outerHTML : y.innerHTML;
|
|
9411
|
-
return Ge &&
|
|
9434
|
+
return Ge && K["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && de(mc, y.ownerDocument.doctype.name) && (xe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
|
|
9412
9435
|
` + xe), ne && Ur([
|
|
9413
9436
|
wt,
|
|
9414
9437
|
sr,
|
|
@@ -9809,7 +9832,7 @@ function zg(e, t) {
|
|
|
9809
9832
|
s(k), Jr();
|
|
9810
9833
|
}
|
|
9811
9834
|
}, Q = rf(), wt = Hu(Q), sr = (k) => {
|
|
9812
|
-
var x = Wg(), H = fe(x), ae = ct(fe(H), 2), ot = fe(ae), be = fe(ot), ar = fe(be),
|
|
9835
|
+
var x = Wg(), H = fe(x), ae = ct(fe(H), 2), ot = fe(ae), be = fe(ot), ar = fe(be), K = fe(ar), pn = ct(K, 2);
|
|
9813
9836
|
ce(ar), ce(be);
|
|
9814
9837
|
var Z = ct(be, 2), lr = fe(Z), j = fe(lr, !0);
|
|
9815
9838
|
ce(lr);
|
|
@@ -9840,7 +9863,7 @@ function zg(e, t) {
|
|
|
9840
9863
|
ki(Ve, (st) => {
|
|
9841
9864
|
w(N) && st(gn);
|
|
9842
9865
|
}), ce(H), ce(x), xf(x, (st) => oe(a, st), () => w(a)), Ts(() => {
|
|
9843
|
-
xi(ae, "aria-expanded", w(N)), mr(ar, `background-color: ${w(ee).preview.bg ?? ""}`), mr(
|
|
9866
|
+
xi(ae, "aria-expanded", w(N)), mr(ar, `background-color: ${w(ee).preview.bg ?? ""}`), mr(K, `color: ${w(ee).preview.text ?? ""}`), mr(pn, `background-color: ${w(ee).preview.primary ?? ""}`), An(j, w(ee).name), An(cr, w(ee).description);
|
|
9844
9867
|
}), Ti("keydown", x, it), Ti("click", ae, se), wr(k, x);
|
|
9845
9868
|
};
|
|
9846
9869
|
return ki(wt, (k) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-tool-theme",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Theme tool for PIE assessment player - provides accessible themes and color schemes",
|
|
6
6
|
"repository": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"unpkg": "./dist/tool-color-scheme.js",
|
|
37
37
|
"jsdelivr": "./dist/tool-color-scheme.js",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@pie-players/pie-assessment-toolkit": "0.3.
|
|
40
|
-
"@pie-players/pie-context": "0.3.
|
|
41
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
42
|
-
"@pie-players/pie-theme": "0.3.
|
|
39
|
+
"@pie-players/pie-assessment-toolkit": "0.3.53",
|
|
40
|
+
"@pie-players/pie-context": "0.3.53",
|
|
41
|
+
"@pie-players/pie-players-shared": "0.3.53",
|
|
42
|
+
"@pie-players/pie-theme": "0.3.53"
|
|
43
43
|
},
|
|
44
44
|
"types": "./dist/index.d.ts",
|
|
45
45
|
"scripts": {
|