@pie-players/pie-tool-line-reader 0.3.46 → 0.3.48
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-line-reader.js +604 -581
- package/package.json +4 -4
package/dist/tool-line-reader.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as v } from "./defineProperty-Dt7ri80W.js";
|
|
2
|
-
var
|
|
2
|
+
var Js = Object.create, qi = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, Zs = Object.getOwnPropertyNames, ea = Object.getPrototypeOf, ta = Object.prototype.hasOwnProperty, lh = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ra = (e, t, r, n) => {
|
|
3
3
|
if (t && typeof t == "object" || typeof t == "function")
|
|
4
|
-
for (var i =
|
|
5
|
-
a = i[o], !
|
|
4
|
+
for (var i = Zs(t), o = 0, s = i.length, a; o < s; o++)
|
|
5
|
+
a = i[o], !ta.call(e, a) && a !== r && qi(e, a, {
|
|
6
6
|
get: ((l) => t[l]).bind(null, a),
|
|
7
|
-
enumerable: !(n =
|
|
7
|
+
enumerable: !(n = Qs(t, a)) || n.enumerable
|
|
8
8
|
});
|
|
9
9
|
return e;
|
|
10
|
-
},
|
|
10
|
+
}, na = (e, t, r) => (r = e != null ? Js(ea(e)) : {}, ra(t || !e || !e.__esModule ? qi(r, "default", {
|
|
11
11
|
value: e,
|
|
12
12
|
enumerable: !0
|
|
13
|
-
}) : r, e)),
|
|
13
|
+
}) : r, e)), ch = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, r) => (typeof require < "u" ? require : t)[r] }) : e)(function(e) {
|
|
14
14
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
15
15
|
throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
16
16
|
});
|
|
@@ -19,9 +19,9 @@ if (typeof window < "u") {
|
|
|
19
19
|
((Kn = (Xn = window).__svelte ?? (Xn.__svelte = {})).v ?? (Kn.v = /* @__PURE__ */ new Set())).add("5");
|
|
20
20
|
}
|
|
21
21
|
var ht = {}, B = /* @__PURE__ */ Symbol("uninitialized");
|
|
22
|
-
var
|
|
22
|
+
var ia = Array.isArray, oa = Array.prototype.indexOf, ir = Array.prototype.includes, sa = Array.from, or = Object.keys, sr = Object.defineProperty, je = Object.getOwnPropertyDescriptor, aa = Object.getOwnPropertyDescriptors, la = Object.prototype, ca = Array.prototype, Ui = Object.getPrototypeOf, Jn = Object.isExtensible, ua = () => {
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function da(e) {
|
|
25
25
|
for (var t = 0; t < e.length; t++) e[t]();
|
|
26
26
|
}
|
|
27
27
|
function Gi() {
|
|
@@ -34,55 +34,55 @@ function Gi() {
|
|
|
34
34
|
reject: t
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var uh = 1 << 24, te = 1024, ne = 2048, et = 4096, Tn = 8192, ha = 16384, wn = 32768, Qn = 1 << 25, Sn = 65536, dh = 1 << 17, hh = 1 << 18, bt = 1 << 19, fa = 1 << 20, Nt = 65536, Zn = 1 << 21, pa = 1 << 22, ar = 1 << 23, Ot = /* @__PURE__ */ Symbol("$state"), Yi = /* @__PURE__ */ Symbol("legacy props"), ga = /* @__PURE__ */ Symbol(""), va = /* @__PURE__ */ Symbol("proxy path"), Ur = /* @__PURE__ */ Symbol("attributes"), Gr = /* @__PURE__ */ Symbol("class"), Yr = /* @__PURE__ */ Symbol("style"), Jt = /* @__PURE__ */ Symbol("text");
|
|
38
38
|
var Tr = new class extends Error {
|
|
39
39
|
constructor(...t) {
|
|
40
40
|
super(...t), v(this, "name", "StaleReactionError"), v(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
41
41
|
}
|
|
42
|
-
}(),
|
|
43
|
-
function
|
|
42
|
+
}(), ma = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
43
|
+
function ya(e) {
|
|
44
44
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function ba() {
|
|
47
47
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function _a(e) {
|
|
50
50
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Ta() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function wa(e) {
|
|
56
56
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Sa() {
|
|
59
59
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function ka() {
|
|
62
62
|
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function xa(e) {
|
|
65
65
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Ea() {
|
|
68
68
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Aa() {
|
|
71
71
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ma() {
|
|
74
74
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Ca() {
|
|
77
77
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Oa() {
|
|
80
80
|
console.warn("https://svelte.dev/e/derived_inert");
|
|
81
81
|
}
|
|
82
82
|
function wr(e) {
|
|
83
83
|
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Ia() {
|
|
86
86
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
87
87
|
}
|
|
88
88
|
var I = !1;
|
|
@@ -124,7 +124,7 @@ function Xi(e = !0) {
|
|
|
124
124
|
e && r.remove(), r = i;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function $a(e) {
|
|
128
128
|
if (!e || e.nodeType !== 8)
|
|
129
129
|
throw wr(), ht;
|
|
130
130
|
return e.data;
|
|
@@ -132,18 +132,18 @@ function Ia(e) {
|
|
|
132
132
|
function Ji(e) {
|
|
133
133
|
return e === this.v;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Ra(e, t) {
|
|
136
136
|
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
137
137
|
}
|
|
138
138
|
function Qi(e) {
|
|
139
|
-
return
|
|
139
|
+
return !Ra(e, this.v);
|
|
140
140
|
}
|
|
141
141
|
var Te = !1, zt = !1;
|
|
142
142
|
function ti(e, t) {
|
|
143
|
-
return e.label = t,
|
|
143
|
+
return e.label = t, La(e.v, t), e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return e?.[
|
|
145
|
+
function La(e, t) {
|
|
146
|
+
return e?.[va]?.(t), e;
|
|
147
147
|
}
|
|
148
148
|
var L = null;
|
|
149
149
|
function ft(e) {
|
|
@@ -179,7 +179,7 @@ function Wt() {
|
|
|
179
179
|
var He = [];
|
|
180
180
|
function to() {
|
|
181
181
|
var e = He;
|
|
182
|
-
He = [],
|
|
182
|
+
He = [], da(e);
|
|
183
183
|
}
|
|
184
184
|
function pt(e) {
|
|
185
185
|
if (He.length === 0 && !It) {
|
|
@@ -190,7 +190,7 @@ function pt(e) {
|
|
|
190
190
|
}
|
|
191
191
|
He.push(e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Pa() {
|
|
194
194
|
for (; He.length > 0; ) to();
|
|
195
195
|
}
|
|
196
196
|
function ro(e) {
|
|
@@ -216,9 +216,9 @@ function Pe(e, t) {
|
|
|
216
216
|
}
|
|
217
217
|
throw e;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var Na = ~(ne | et | te);
|
|
220
220
|
function P(e, t) {
|
|
221
|
-
e.f = e.f &
|
|
221
|
+
e.f = e.f & Na | t;
|
|
222
222
|
}
|
|
223
223
|
function xn(e) {
|
|
224
224
|
(e.f & 512) !== 0 || e.deps === null ? P(e, te) : P(e, et);
|
|
@@ -231,8 +231,8 @@ function no(e) {
|
|
|
231
231
|
function io(e, t, r) {
|
|
232
232
|
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), no(e.deps), P(e, te);
|
|
233
233
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
234
|
+
var za = !1, Ut = !1;
|
|
235
|
+
function Wa(e) {
|
|
236
236
|
var t = Ut;
|
|
237
237
|
try {
|
|
238
238
|
return Ut = !1, [e(), Ut];
|
|
@@ -260,9 +260,9 @@ function h(e, t) {
|
|
|
260
260
|
return e.get(k(e, t));
|
|
261
261
|
}
|
|
262
262
|
var so, lr = null, it = null, x = null, Kr = null, q = null, Xr = null, It = !1, $r = !1, gt = null, cr = null, ao = 0;
|
|
263
|
-
var
|
|
263
|
+
var Ha = 1, ur = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), dr = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Jr = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakSet(), tt = class lo {
|
|
264
264
|
constructor() {
|
|
265
|
-
En(this, N), v(this, "id",
|
|
265
|
+
En(this, N), v(this, "id", Ha++), T(this, ur, !1), v(this, "linked", !0), T(this, Ve, null), T(this, Be, null), v(this, "async_deriveds", /* @__PURE__ */ new Map()), v(this, "current", /* @__PURE__ */ new Map()), v(this, "previous", /* @__PURE__ */ new Map()), T(this, dr, /* @__PURE__ */ new Set()), T(this, Gt, /* @__PURE__ */ new Set()), T(this, ot, 0), T(this, We, /* @__PURE__ */ new Map()), T(this, xt, null), T(this, Z, []), T(this, Jr, []), T(this, Je, /* @__PURE__ */ new Set()), T(this, _e, /* @__PURE__ */ new Set()), T(this, Le, /* @__PURE__ */ new Map()), T(this, Qt, /* @__PURE__ */ new Set()), v(this, "is_fork", !1), T(this, Et, !1), it === null ? lr = it = this : (_(Be, it, this), _(Ve, this, it)), it = this;
|
|
266
266
|
}
|
|
267
267
|
skip_effect(t) {
|
|
268
268
|
h(Le, this).has(t) || h(Le, this).set(t, {
|
|
@@ -371,7 +371,7 @@ var Wa = 1, ur = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap
|
|
|
371
371
|
for (var r = t; r.parent !== null; ) {
|
|
372
372
|
r = r.parent;
|
|
373
373
|
var n = r.f;
|
|
374
|
-
if (gt !== null && r === w && (Te || (A === null || (A.f & 2) === 0) && !
|
|
374
|
+
if (gt !== null && r === w && (Te || (A === null || (A.f & 2) === 0) && !za))
|
|
375
375
|
return;
|
|
376
376
|
if ((n & 96) !== 0) {
|
|
377
377
|
if ((n & 1024) === 0) return;
|
|
@@ -397,7 +397,7 @@ function ri() {
|
|
|
397
397
|
return !1;
|
|
398
398
|
}
|
|
399
399
|
function hr() {
|
|
400
|
-
_(ur, this, !0), ao++ > 1e3 && (k(N, this, fr).call(this),
|
|
400
|
+
_(ur, this, !0), ao++ > 1e3 && (k(N, this, fr).call(this), ja());
|
|
401
401
|
for (const a of h(Je, this))
|
|
402
402
|
h(_e, this).delete(a), P(a, ne), this.schedule(a);
|
|
403
403
|
for (const a of h(_e, this))
|
|
@@ -420,16 +420,16 @@ function hr() {
|
|
|
420
420
|
n.length > 0 && k(N, x, hr).call(x);
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
|
-
const o = k(N, this,
|
|
423
|
+
const o = k(N, this, Ba).call(this);
|
|
424
424
|
if (o) {
|
|
425
|
-
k(N, this, At).call(this, r), k(N, this, At).call(this, t), k(N, o,
|
|
425
|
+
k(N, this, At).call(this, r), k(N, this, At).call(this, t), k(N, o, Da).call(o, this);
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
428
|
h(Je, this).clear(), h(_e, this).clear();
|
|
429
429
|
for (const a of h(dr, this)) a(this);
|
|
430
430
|
h(dr, this).clear(), Kr = this, ni(r), ni(t), Kr = null, h(xt, this)?.resolve();
|
|
431
431
|
var s = x;
|
|
432
|
-
if (h(ot, this) === 0 && (h(Z, this).length === 0 || s !== null) && (k(N, this, fr).call(this), Te && (k(N, this,
|
|
432
|
+
if (h(ot, this) === 0 && (h(Z, this).length === 0 || s !== null) && (k(N, this, fr).call(this), Te && (k(N, this, Fa).call(this), x = s)), h(Z, this).length > 0) if (s !== null) {
|
|
433
433
|
const a = s;
|
|
434
434
|
h(Z, a).push(...h(Z, this).filter((l) => !h(Z, a).includes(l)));
|
|
435
435
|
} else s = this;
|
|
@@ -457,7 +457,7 @@ function co(e, t, r) {
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Ba() {
|
|
461
461
|
for (var e = h(Ve, this); e !== null; ) {
|
|
462
462
|
if (!e.is_fork) {
|
|
463
463
|
for (const [t, [, r]] of this.current) if (e.current.has(t) && !r) return e;
|
|
@@ -466,7 +466,7 @@ function Ha() {
|
|
|
466
466
|
}
|
|
467
467
|
return null;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Da(e) {
|
|
470
470
|
for (const [r, n] of e.current)
|
|
471
471
|
!this.previous.has(r) && e.previous.has(r) && this.previous.set(r, e.previous.get(r)), this.current.set(r, n);
|
|
472
472
|
for (const [r, n] of e.async_deriveds) {
|
|
@@ -492,7 +492,7 @@ function Ba(e) {
|
|
|
492
492
|
function At(e) {
|
|
493
493
|
for (var t = 0; t < e.length; t += 1) io(e[t], h(Je, this), h(_e, this));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Fa() {
|
|
496
496
|
for (let c = lr; c !== null; c = h(Be, c)) {
|
|
497
497
|
var e = c.id < this.id, t = [];
|
|
498
498
|
for (const [u, [d, f]] of this.current) {
|
|
@@ -547,21 +547,21 @@ function Qr(e) {
|
|
|
547
547
|
try {
|
|
548
548
|
var r;
|
|
549
549
|
for (e && (x !== null && !x.is_fork && x.flush(), r = e()); ; ) {
|
|
550
|
-
if (
|
|
550
|
+
if (Pa(), x === null) return r;
|
|
551
551
|
x.flush();
|
|
552
552
|
}
|
|
553
553
|
} finally {
|
|
554
554
|
It = t;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function ja() {
|
|
558
558
|
if (0) {
|
|
559
559
|
var e;
|
|
560
560
|
for (const r of x.current.keys()) for (const [n, i] of r.updated ?? [])
|
|
561
561
|
var t;
|
|
562
562
|
}
|
|
563
563
|
try {
|
|
564
|
-
|
|
564
|
+
Sa();
|
|
565
565
|
} catch (r) {
|
|
566
566
|
Pe(r, Xr);
|
|
567
567
|
}
|
|
@@ -623,7 +623,7 @@ function fo(e) {
|
|
|
623
623
|
for (var t = e.first; t !== null; )
|
|
624
624
|
fo(t), t = t.next;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Va(e) {
|
|
627
627
|
let t = 0, r = Ht(0), n;
|
|
628
628
|
return () => {
|
|
629
629
|
Rn() && (g(r), Ln(() => (t === 0 && (n = Sr(() => e(() => $t(r)))), t += 1, () => {
|
|
@@ -633,13 +633,13 @@ function ja(e) {
|
|
|
633
633
|
})));
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
var
|
|
637
|
-
function
|
|
638
|
-
new
|
|
636
|
+
var qa = Sn | bt;
|
|
637
|
+
function Ua(e, t, r, n) {
|
|
638
|
+
new Ga(e, t, r, n);
|
|
639
639
|
}
|
|
640
|
-
var ae = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), ii = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakSet(),
|
|
640
|
+
var ae = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), ii = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakSet(), Ga = class {
|
|
641
641
|
constructor(e, t, r, n) {
|
|
642
|
-
En(this, j), v(this, "parent", void 0), v(this, "is_pending", !1), v(this, "transform_error", void 0), T(this, ae, void 0), T(this, Zr, I ? C : null), T(this, he, void 0), T(this, Rt, void 0), T(this, ee, void 0), T(this, pe, null), T(this, X, null), T(this, oe, null), T(this, qe, null), T(this, st, 0), T(this, Ue, 0), T(this, Yt, !1), T(this, en, /* @__PURE__ */ new Set()), T(this, tn, /* @__PURE__ */ new Set()), T(this, Ne, null), T(this, ii,
|
|
642
|
+
En(this, j), v(this, "parent", void 0), v(this, "is_pending", !1), v(this, "transform_error", void 0), T(this, ae, void 0), T(this, Zr, I ? C : null), T(this, he, void 0), T(this, Rt, void 0), T(this, ee, void 0), T(this, pe, null), T(this, X, null), T(this, oe, null), T(this, qe, null), T(this, st, 0), T(this, Ue, 0), T(this, Yt, !1), T(this, en, /* @__PURE__ */ new Set()), T(this, tn, /* @__PURE__ */ new Set()), T(this, Ne, null), T(this, ii, Va(() => (_(Ne, this, Ht(h(st, this))), () => {
|
|
643
643
|
_(Ne, this, null);
|
|
644
644
|
}))), _(ae, this, e), _(he, this, t), _(Rt, this, (i) => {
|
|
645
645
|
var o = w;
|
|
@@ -651,10 +651,10 @@ var ae = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), he =
|
|
|
651
651
|
const o = i.data === "[!";
|
|
652
652
|
if (i.data.startsWith("[?")) {
|
|
653
653
|
const s = JSON.parse(i.data.slice(2));
|
|
654
|
-
k(j, this,
|
|
655
|
-
} else o ? k(j, this,
|
|
654
|
+
k(j, this, Ka).call(this, s);
|
|
655
|
+
} else o ? k(j, this, Xa).call(this) : k(j, this, Ya).call(this);
|
|
656
656
|
} else k(j, this, po).call(this);
|
|
657
|
-
},
|
|
657
|
+
}, qa)), I && _(ae, this, C);
|
|
658
658
|
}
|
|
659
659
|
defer_effect(e) {
|
|
660
660
|
io(e, h(en, this), h(tn, this));
|
|
@@ -680,21 +680,21 @@ var ae = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), he =
|
|
|
680
680
|
})) : k(j, this, oi).call(this, e);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
|
-
function
|
|
683
|
+
function Ya() {
|
|
684
684
|
try {
|
|
685
685
|
_(pe, this, Se(() => h(Rt, this).call(this, h(ae, this))));
|
|
686
686
|
} catch (e) {
|
|
687
687
|
this.error(e);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Ka(e) {
|
|
691
691
|
const t = h(he, this).failed;
|
|
692
692
|
t && _(oe, this, Se(() => {
|
|
693
693
|
t(h(ae, this), () => e, () => () => {
|
|
694
694
|
});
|
|
695
695
|
}));
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Xa() {
|
|
698
698
|
const e = h(he, this).pending;
|
|
699
699
|
e && (this.is_pending = !0, _(X, this, Se(() => e(h(ae, this)))), pt(() => {
|
|
700
700
|
var t = _(qe, this, document.createDocumentFragment()), r = we();
|
|
@@ -750,10 +750,10 @@ function oi(e) {
|
|
|
750
750
|
var n = !1, i = !1;
|
|
751
751
|
const o = () => {
|
|
752
752
|
if (n) {
|
|
753
|
-
|
|
753
|
+
Ia();
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
|
-
n = !0, i &&
|
|
756
|
+
n = !0, i && Ca(), h(oe, this) !== null && Bt(h(oe, this), () => {
|
|
757
757
|
_(oe, this, null);
|
|
758
758
|
}), k(j, this, rn).call(this, () => {
|
|
759
759
|
k(j, this, po).call(this);
|
|
@@ -786,14 +786,14 @@ function oi(e) {
|
|
|
786
786
|
a !== null && typeof a == "object" && typeof a.then == "function" ? a.then(s, (l) => Pe(l, h(ee, this) && h(ee, this).parent)) : s(a);
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Ja(e, t, r, n) {
|
|
790
790
|
const i = Wt() ? Lt : mo;
|
|
791
791
|
var o = e.filter((f) => !f.settled);
|
|
792
792
|
if (r.length === 0 && o.length === 0) {
|
|
793
793
|
n(t.map(i));
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
|
-
var s = w, a =
|
|
796
|
+
var s = w, a = Qa(), l = o.length === 1 ? o[0].promise : o.length > 1 ? Promise.all(o.map((f) => f.promise)) : null;
|
|
797
797
|
function c(f) {
|
|
798
798
|
if ((s.f & 16384) === 0) {
|
|
799
799
|
a();
|
|
@@ -811,13 +811,13 @@ function Xa(e, t, r, n) {
|
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
function d() {
|
|
814
|
-
Promise.all(r.map((f) => /* @__PURE__ */
|
|
814
|
+
Promise.all(r.map((f) => /* @__PURE__ */ Za(f))).then((f) => c([...t.map(i), ...f])).catch((f) => Pe(f, s)).finally(u);
|
|
815
815
|
}
|
|
816
816
|
l ? l.then(() => {
|
|
817
817
|
a(), d(), pr();
|
|
818
818
|
}) : d();
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Qa() {
|
|
821
821
|
var e = w, t = A, r = L, n = x;
|
|
822
822
|
if (0) var i;
|
|
823
823
|
return function(s = !0) {
|
|
@@ -853,11 +853,11 @@ function Lt(e) {
|
|
|
853
853
|
}
|
|
854
854
|
var Kt = /* @__PURE__ */ Symbol("obsolete");
|
|
855
855
|
// @__NO_SIDE_EFFECTS__
|
|
856
|
-
function
|
|
856
|
+
function Za(e, t, r) {
|
|
857
857
|
let n = w;
|
|
858
|
-
n === null &&
|
|
858
|
+
n === null && ba();
|
|
859
859
|
var i = void 0, o = Ht(B), s = !A, a = /* @__PURE__ */ new Set();
|
|
860
|
-
return
|
|
860
|
+
return pl(() => {
|
|
861
861
|
var l = w, c = Gi();
|
|
862
862
|
i = c.promise;
|
|
863
863
|
try {
|
|
@@ -878,7 +878,7 @@ function Qa(e, t, r) {
|
|
|
878
878
|
d?.(), a.delete(c), m !== Kt && (u.activate(), m ? (o.f |= ar, vr(o, m)) : ((o.f & 8388608) !== 0 && (o.f ^= ar), vr(o, p)), u.deactivate());
|
|
879
879
|
};
|
|
880
880
|
c.promise.then(f, (p) => f(null, p || "unknown"));
|
|
881
|
-
}),
|
|
881
|
+
}), dl(() => {
|
|
882
882
|
for (const l of a) l.reject(Kt);
|
|
883
883
|
}), new Promise((l) => {
|
|
884
884
|
function c(u) {
|
|
@@ -900,7 +900,7 @@ function mo(e) {
|
|
|
900
900
|
const t = /* @__PURE__ */ Lt(e);
|
|
901
901
|
return t.equals = Qi, t;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function el(e) {
|
|
904
904
|
var t = e.effects;
|
|
905
905
|
if (t !== null) {
|
|
906
906
|
e.effects = null;
|
|
@@ -910,10 +910,10 @@ function Za(e) {
|
|
|
910
910
|
function On(e) {
|
|
911
911
|
var t, r = w, n = e.parent;
|
|
912
912
|
if (!ke && n !== null && e.v !== B && (n.f & 24576) !== 0)
|
|
913
|
-
return
|
|
913
|
+
return Oa(), e.v;
|
|
914
914
|
ge(n);
|
|
915
915
|
try {
|
|
916
|
-
e.f &= ~Nt,
|
|
916
|
+
e.f &= ~Nt, el(e), t = Wo(e);
|
|
917
917
|
} finally {
|
|
918
918
|
ge(r);
|
|
919
919
|
}
|
|
@@ -927,9 +927,9 @@ function yo(e) {
|
|
|
927
927
|
}
|
|
928
928
|
ke || (q !== null ? (Rn() || x?.is_fork) && q.set(e, t) : xn(e));
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function tl(e) {
|
|
931
931
|
if (e.effects !== null)
|
|
932
|
-
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Tr), t.fn !== null && (t.teardown =
|
|
932
|
+
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Tr), t.fn !== null && (t.teardown = ua), t.ac = null, Pt(t, 0), Pn(t));
|
|
933
933
|
}
|
|
934
934
|
function bo(e) {
|
|
935
935
|
if (e.effects !== null)
|
|
@@ -954,7 +954,7 @@ function z(e, t) {
|
|
|
954
954
|
return Lo(r), r;
|
|
955
955
|
}
|
|
956
956
|
// @__NO_SIDE_EFFECTS__
|
|
957
|
-
function
|
|
957
|
+
function rl(e, t = !1, r = !0) {
|
|
958
958
|
const n = Ht(e);
|
|
959
959
|
if (t || (n.equals = Qi), zt && r && L !== null && L.l !== null) {
|
|
960
960
|
var i;
|
|
@@ -963,7 +963,7 @@ function tl(e, t = !1, r = !0) {
|
|
|
963
963
|
return n;
|
|
964
964
|
}
|
|
965
965
|
function $(e, t, r = !1) {
|
|
966
|
-
A !== null && (!se || (A.f & 131072) !== 0) && Wt() && (A.f & 4325394) !== 0 && (le === null || !le.has(e)) &&
|
|
966
|
+
A !== null && (!se || (A.f & 131072) !== 0) && Wt() && (A.f & 4325394) !== 0 && (le === null || !le.has(e)) && Ma();
|
|
967
967
|
let n = r ? fe(t) : t;
|
|
968
968
|
return vr(e, n, cr);
|
|
969
969
|
}
|
|
@@ -975,11 +975,11 @@ function vr(e, t, r = null) {
|
|
|
975
975
|
const i = e;
|
|
976
976
|
(e.f & 2048) !== 0 && On(i), q === null && xn(i);
|
|
977
977
|
}
|
|
978
|
-
e.wv = No(), To(e, ne, r), Wt() && w !== null && (w.f & 1024) !== 0 && (w.f & 96) === 0 && (Q === null ?
|
|
978
|
+
e.wv = No(), To(e, ne, r), Wt() && w !== null && (w.f & 1024) !== 0 && (w.f & 96) === 0 && (Q === null ? yl([e]) : Q.push(e)), !n.is_fork && gr.size > 0 && !_o && nl();
|
|
979
979
|
}
|
|
980
980
|
return t;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function nl() {
|
|
983
983
|
_o = !1;
|
|
984
984
|
for (const e of gr) {
|
|
985
985
|
(e.f & 1024) !== 0 && P(e, et);
|
|
@@ -1014,12 +1014,12 @@ function To(e, t, r) {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
var
|
|
1017
|
+
var il = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
1018
1018
|
function fe(e) {
|
|
1019
1019
|
if (typeof e != "object" || e === null || Ot in e) return e;
|
|
1020
1020
|
const t = Ui(e);
|
|
1021
|
-
if (t !==
|
|
1022
|
-
var r = /* @__PURE__ */ new Map(), n =
|
|
1021
|
+
if (t !== la && t !== ca) return e;
|
|
1022
|
+
var r = /* @__PURE__ */ new Map(), n = ia(e), i = /* @__PURE__ */ z(0), o = null, s = Ye, a = (d) => {
|
|
1023
1023
|
if (Ye === s) return d();
|
|
1024
1024
|
var f = A, p = Ye;
|
|
1025
1025
|
re(null), hi(s);
|
|
@@ -1032,13 +1032,13 @@ function fe(e) {
|
|
|
1032
1032
|
function u(d) {
|
|
1033
1033
|
if (!c) {
|
|
1034
1034
|
c = !0, l = d, ti(i, `${l} version`);
|
|
1035
|
-
for (const [f, p] of r) ti(p,
|
|
1035
|
+
for (const [f, p] of r) ti(p, ol(l, f));
|
|
1036
1036
|
c = !1;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
return new Proxy(e, {
|
|
1040
1040
|
defineProperty(d, f, p) {
|
|
1041
|
-
(!("value" in p) || p.configurable === !1 || p.enumerable === !1 || p.writable === !1) &&
|
|
1041
|
+
(!("value" in p) || p.configurable === !1 || p.enumerable === !1 || p.writable === !1) && Ea();
|
|
1042
1042
|
var m = r.get(f);
|
|
1043
1043
|
return m === void 0 ? a(() => {
|
|
1044
1044
|
var y = /* @__PURE__ */ z(p.value, o);
|
|
@@ -1125,17 +1125,17 @@ function fe(e) {
|
|
|
1125
1125
|
return f;
|
|
1126
1126
|
},
|
|
1127
1127
|
setPrototypeOf() {
|
|
1128
|
-
|
|
1128
|
+
Aa();
|
|
1129
1129
|
}
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` :
|
|
1132
|
+
function ol(e, t) {
|
|
1133
|
+
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : il.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
|
|
1134
1134
|
}
|
|
1135
|
-
var ai,
|
|
1135
|
+
var ai, sl, wo, So, ko;
|
|
1136
1136
|
function nn() {
|
|
1137
1137
|
if (ai === void 0) {
|
|
1138
|
-
ai = window,
|
|
1138
|
+
ai = window, sl = document, wo = /Firefox/.test(navigator.userAgent);
|
|
1139
1139
|
var e = Element.prototype, t = Node.prototype, r = Text.prototype;
|
|
1140
1140
|
So = je(t, "firstChild").get, ko = je(t, "nextSibling").get, Jn(e) && (e[Gr] = void 0, e[Ur] = null, e[Yr] = void 0, e.__e = void 0), Jn(r) && (r[Jt] = void 0);
|
|
1141
1141
|
}
|
|
@@ -1189,10 +1189,10 @@ function wt(e, t = 1, r = !1) {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
return ce(n), n;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function al(e) {
|
|
1193
1193
|
e.textContent = "";
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function ll() {
|
|
1196
1196
|
return !Te || de !== null ? !1 : (w.f & wn) !== 0;
|
|
1197
1197
|
}
|
|
1198
1198
|
function In(e, t, r) {
|
|
@@ -1213,10 +1213,10 @@ function xo(e) {
|
|
|
1213
1213
|
re(t), ge(r);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1217
|
-
w === null && (A === null &&
|
|
1216
|
+
function cl(e) {
|
|
1217
|
+
w === null && (A === null && wa(e), Ta()), ke && _a(e);
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function ul(e, t) {
|
|
1220
1220
|
var r = t.last;
|
|
1221
1221
|
r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
|
|
1222
1222
|
}
|
|
@@ -1250,7 +1250,7 @@ function ve(e, t) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= Sn));
|
|
1252
1252
|
}
|
|
1253
|
-
if (i !== null && (i.parent = r, r !== null &&
|
|
1253
|
+
if (i !== null && (i.parent = r, r !== null && ul(i, r), A !== null && (A.f & 2) !== 0 && (e & 64) === 0)) {
|
|
1254
1254
|
var o = A;
|
|
1255
1255
|
(o.effects ?? (o.effects = [])).push(i);
|
|
1256
1256
|
}
|
|
@@ -1259,12 +1259,12 @@ function ve(e, t) {
|
|
|
1259
1259
|
function Rn() {
|
|
1260
1260
|
return A !== null && !se;
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function dl(e) {
|
|
1263
1263
|
const t = ve(8, null);
|
|
1264
1264
|
return P(t, te), t.teardown = e, t;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Mt(e) {
|
|
1267
|
-
|
|
1267
|
+
cl("$effect");
|
|
1268
1268
|
var t = w.f;
|
|
1269
1269
|
if (!A && (t & 32) !== 0 && L !== null && !L.i) {
|
|
1270
1270
|
var r = L;
|
|
@@ -1272,16 +1272,16 @@ function Mt(e) {
|
|
|
1272
1272
|
} else return Eo(e);
|
|
1273
1273
|
}
|
|
1274
1274
|
function Eo(e) {
|
|
1275
|
-
return ve(4 |
|
|
1275
|
+
return ve(4 | fa, e);
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function hl(e) {
|
|
1278
1278
|
tt.ensure();
|
|
1279
1279
|
const t = ve(64 | bt, e);
|
|
1280
1280
|
return () => {
|
|
1281
1281
|
Y(t);
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function fl(e) {
|
|
1285
1285
|
tt.ensure();
|
|
1286
1286
|
const t = ve(64 | bt, e);
|
|
1287
1287
|
return (r = {}) => new Promise((n) => {
|
|
@@ -1293,14 +1293,14 @@ function hl(e) {
|
|
|
1293
1293
|
function Ao(e) {
|
|
1294
1294
|
return ve(4, e);
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
return ve(
|
|
1296
|
+
function pl(e) {
|
|
1297
|
+
return ve(pa | bt, e);
|
|
1298
1298
|
}
|
|
1299
1299
|
function Ln(e, t = 0) {
|
|
1300
1300
|
return ve(8 | t, e);
|
|
1301
1301
|
}
|
|
1302
1302
|
function ci(e, t = [], r = [], n = []) {
|
|
1303
|
-
|
|
1303
|
+
Ja(n, t, r, (i) => {
|
|
1304
1304
|
ve(8, () => e(...i.map(g)));
|
|
1305
1305
|
});
|
|
1306
1306
|
}
|
|
@@ -1334,7 +1334,7 @@ function Pn(e, t = !1) {
|
|
|
1334
1334
|
(r.f & 64) !== 0 ? r.parent = null : Y(r, t), r = n;
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function gl(e) {
|
|
1338
1338
|
for (var t = e.first; t !== null; ) {
|
|
1339
1339
|
var r = t.next;
|
|
1340
1340
|
(t.f & 32) === 0 && Y(t), t = r;
|
|
@@ -1342,14 +1342,14 @@ function pl(e) {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
function Y(e, t = !0) {
|
|
1344
1344
|
var r = !1;
|
|
1345
|
-
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (
|
|
1345
|
+
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (vl(e.nodes.start, e.nodes.end), r = !0), P(e, Qn), Pn(e, t && !r), Pt(e, 0);
|
|
1346
1346
|
var n = e.nodes && e.nodes.t;
|
|
1347
1347
|
if (n !== null) for (const o of n) o.stop();
|
|
1348
|
-
Co(e), e.f ^= Qn, e.f |=
|
|
1348
|
+
Co(e), e.f ^= Qn, e.f |= ha;
|
|
1349
1349
|
var i = e.parent;
|
|
1350
1350
|
i !== null && i.first !== null && Oo(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function vl(e, t) {
|
|
1353
1353
|
for (; e !== null; ) {
|
|
1354
1354
|
var r = e === t ? null : /* @__PURE__ */ Ae(e);
|
|
1355
1355
|
e.remove(), e = r;
|
|
@@ -1408,7 +1408,7 @@ function Ro(e, t) {
|
|
|
1408
1408
|
t.append(r), r = i;
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
var
|
|
1411
|
+
var ml = null, Zt = !1, ke = !1;
|
|
1412
1412
|
function di(e) {
|
|
1413
1413
|
ke = e;
|
|
1414
1414
|
}
|
|
@@ -1425,7 +1425,7 @@ function Lo(e) {
|
|
|
1425
1425
|
A !== null && (!Te || (A.f & 2) !== 0) && (le ?? (le = /* @__PURE__ */ new Set())).add(e);
|
|
1426
1426
|
}
|
|
1427
1427
|
var G = null, K = 0, Q = null;
|
|
1428
|
-
function
|
|
1428
|
+
function yl(e) {
|
|
1429
1429
|
Q = e;
|
|
1430
1430
|
}
|
|
1431
1431
|
var Po = 1, De = 0, Ye = De;
|
|
@@ -1488,10 +1488,10 @@ function Wo(e) {
|
|
|
1488
1488
|
e.f ^= Zn, G = t, K = r, Q = n, A = i, le = o, ft(s), se = a, Ye = l;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function bl(e, t) {
|
|
1492
1492
|
let r = t.reactions;
|
|
1493
1493
|
if (r !== null) {
|
|
1494
|
-
var n =
|
|
1494
|
+
var n = oa.call(r, e);
|
|
1495
1495
|
if (n !== -1) {
|
|
1496
1496
|
var i = r.length - 1;
|
|
1497
1497
|
i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
|
|
@@ -1499,13 +1499,13 @@ function yl(e, t) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
if (r === null && (t.f & 2) !== 0 && (G === null || !ir.call(G, t))) {
|
|
1501
1501
|
var o = t;
|
|
1502
|
-
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~Nt), o.v !== B && xn(o),
|
|
1502
|
+
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~Nt), o.v !== B && xn(o), tl(o), Pt(o, 0);
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
function Pt(e, t) {
|
|
1506
1506
|
var r = e.deps;
|
|
1507
1507
|
if (r !== null)
|
|
1508
|
-
for (var n = t; n < r.length; n++)
|
|
1508
|
+
for (var n = t; n < r.length; n++) bl(e, r[n]);
|
|
1509
1509
|
}
|
|
1510
1510
|
function mt(e) {
|
|
1511
1511
|
var t = e.f;
|
|
@@ -1515,7 +1515,7 @@ function mt(e) {
|
|
|
1515
1515
|
if (w = e, Zt = !0, 0)
|
|
1516
1516
|
var i, o;
|
|
1517
1517
|
try {
|
|
1518
|
-
(t & 16777232) !== 0 ?
|
|
1518
|
+
(t & 16777232) !== 0 ? gl(e) : Pn(e), Co(e);
|
|
1519
1519
|
var s = Wo(e);
|
|
1520
1520
|
if (e.teardown = typeof s == "function" ? s : null, e.wv = Po, 0)
|
|
1521
1521
|
for (var a of e.deps) ;
|
|
@@ -1526,7 +1526,7 @@ function mt(e) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
function g(e) {
|
|
1528
1528
|
var t = (e.f & 2) !== 0;
|
|
1529
|
-
if (
|
|
1529
|
+
if (ml?.add(e), A !== null && !se && !(w !== null && (w.f & 16384) !== 0) && (le === null || !le.has(e))) {
|
|
1530
1530
|
var r = A.deps;
|
|
1531
1531
|
if ((A.f & 2097152) !== 0)
|
|
1532
1532
|
e.rv < De && (e.rv = De, G === null && r !== null && r[K] === e ? K++ : G === null ? G = [e] : G.push(e));
|
|
@@ -1583,7 +1583,7 @@ var ct = /* @__PURE__ */ Symbol("events"), Do = /* @__PURE__ */ new Set(), on =
|
|
|
1583
1583
|
function fi(e, t, r) {
|
|
1584
1584
|
(t[ct] ?? (t[ct] = {}))[e] = r;
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function _l(e) {
|
|
1587
1587
|
for (var t = 0; t < e.length; t++) Do.add(e[t]);
|
|
1588
1588
|
for (var r of on) r(e);
|
|
1589
1589
|
}
|
|
@@ -1633,13 +1633,13 @@ function gi(e) {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
|
-
var
|
|
1637
|
-
function Tl(e) {
|
|
1638
|
-
return _l?.createHTML(e) ?? e;
|
|
1639
|
-
}
|
|
1636
|
+
var Tl = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
|
|
1640
1637
|
function wl(e) {
|
|
1638
|
+
return Tl?.createHTML(e) ?? e;
|
|
1639
|
+
}
|
|
1640
|
+
function Sl(e) {
|
|
1641
1641
|
var t = In("template");
|
|
1642
|
-
return t.innerHTML =
|
|
1642
|
+
return t.innerHTML = wl(e.replaceAll("<!>", "<!---->")), t.content;
|
|
1643
1643
|
}
|
|
1644
1644
|
function ut(e, t) {
|
|
1645
1645
|
var r = w;
|
|
@@ -1656,7 +1656,7 @@ function Fo(e, t) {
|
|
|
1656
1656
|
return () => {
|
|
1657
1657
|
if (I)
|
|
1658
1658
|
return ut(C, null), C;
|
|
1659
|
-
i === void 0 && (i =
|
|
1659
|
+
i === void 0 && (i = Sl(o ? e : "<!>" + e), r || (i = /* @__PURE__ */ vt(i)));
|
|
1660
1660
|
var s = n || wo ? document.importNode(i, !0) : i.cloneNode(!0);
|
|
1661
1661
|
if (r) {
|
|
1662
1662
|
var a = /* @__PURE__ */ vt(s), l = s.lastChild;
|
|
@@ -1665,7 +1665,7 @@ function Fo(e, t) {
|
|
|
1665
1665
|
return s;
|
|
1666
1666
|
};
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1668
|
+
function kl() {
|
|
1669
1669
|
if (I)
|
|
1670
1670
|
return ut(C, null), C;
|
|
1671
1671
|
var e = document.createDocumentFragment(), t = document.createComment(""), r = we();
|
|
@@ -1679,7 +1679,7 @@ function er(e, t) {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
e !== null && e.before(t);
|
|
1681
1681
|
}
|
|
1682
|
-
var
|
|
1682
|
+
var xl = [
|
|
1683
1683
|
"allowfullscreen",
|
|
1684
1684
|
"async",
|
|
1685
1685
|
"autofocus",
|
|
@@ -1708,8 +1708,8 @@ var kl = [
|
|
|
1708
1708
|
"defer",
|
|
1709
1709
|
"disablepictureinpicture",
|
|
1710
1710
|
"disableremoteplayback"
|
|
1711
|
-
],
|
|
1712
|
-
...
|
|
1711
|
+
], ph = [
|
|
1712
|
+
...xl,
|
|
1713
1713
|
"formNoValidate",
|
|
1714
1714
|
"isMap",
|
|
1715
1715
|
"noModule",
|
|
@@ -1724,17 +1724,17 @@ var kl = [
|
|
|
1724
1724
|
"allowFullscreen",
|
|
1725
1725
|
"disablePictureInPicture",
|
|
1726
1726
|
"disableRemotePlayback"
|
|
1727
|
-
],
|
|
1728
|
-
function
|
|
1729
|
-
return
|
|
1727
|
+
], El = ["touchstart", "touchmove"];
|
|
1728
|
+
function Al(e) {
|
|
1729
|
+
return El.includes(e);
|
|
1730
1730
|
}
|
|
1731
|
-
var
|
|
1731
|
+
var Ml = [
|
|
1732
1732
|
"$state",
|
|
1733
1733
|
"$state.raw",
|
|
1734
1734
|
"$derived",
|
|
1735
1735
|
"$derived.by"
|
|
1736
|
-
],
|
|
1737
|
-
...
|
|
1736
|
+
], gh = [
|
|
1737
|
+
...Ml,
|
|
1738
1738
|
"$state.eager",
|
|
1739
1739
|
"$state.snapshot",
|
|
1740
1740
|
"$props",
|
|
@@ -1750,14 +1750,14 @@ var Al = [
|
|
|
1750
1750
|
"$inspect.trace",
|
|
1751
1751
|
"$host"
|
|
1752
1752
|
], vi = !0;
|
|
1753
|
-
function
|
|
1753
|
+
function Cl(e, t) {
|
|
1754
1754
|
var r, n = t == null ? "" : typeof t == "object" ? `${t}` : t;
|
|
1755
1755
|
n !== ((r = e)[Jt] ?? (r[Jt] = e.nodeValue)) && (e[Jt] = n, e.nodeValue = `${n}`);
|
|
1756
1756
|
}
|
|
1757
1757
|
function jo(e, t) {
|
|
1758
1758
|
return Vo(e, t);
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1760
|
+
function Ol(e, t) {
|
|
1761
1761
|
nn(), t.intro = t.intro ?? !1;
|
|
1762
1762
|
const r = t.target, n = I, i = C;
|
|
1763
1763
|
try {
|
|
@@ -1772,7 +1772,7 @@ function Cl(e, t) {
|
|
|
1772
1772
|
} catch (s) {
|
|
1773
1773
|
if (s instanceof Error && s.message.split(`
|
|
1774
1774
|
`).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
|
|
1775
|
-
return s !== ht && console.warn("Failed to hydrate: ", s), t.recover === !1 &&
|
|
1775
|
+
return s !== ht && console.warn("Failed to hydrate: ", s), t.recover === !1 && ka(), nn(), al(r), lt(!1), jo(e, t);
|
|
1776
1776
|
} finally {
|
|
1777
1777
|
lt(n), ce(i);
|
|
1778
1778
|
}
|
|
@@ -1780,9 +1780,9 @@ function Cl(e, t) {
|
|
|
1780
1780
|
var Xt = /* @__PURE__ */ new Map();
|
|
1781
1781
|
function Vo(e, { target: t, anchor: r, props: n = {}, events: i, context: o, intro: s = !0, transformError: a }) {
|
|
1782
1782
|
nn();
|
|
1783
|
-
var l = void 0, c =
|
|
1783
|
+
var l = void 0, c = fl(() => {
|
|
1784
1784
|
var u = r ?? t.appendChild(we());
|
|
1785
|
-
|
|
1785
|
+
Ua(u, { pending: () => {
|
|
1786
1786
|
} }, (p) => {
|
|
1787
1787
|
Zi({});
|
|
1788
1788
|
var m = L;
|
|
@@ -1795,7 +1795,7 @@ function Vo(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
|
|
|
1795
1795
|
var y = p[m];
|
|
1796
1796
|
if (!d.has(y)) {
|
|
1797
1797
|
d.add(y);
|
|
1798
|
-
var b =
|
|
1798
|
+
var b = Al(y);
|
|
1799
1799
|
for (const F of [t, document]) {
|
|
1800
1800
|
var E = Xt.get(F);
|
|
1801
1801
|
E === void 0 && (E = /* @__PURE__ */ new Map(), Xt.set(F, E));
|
|
@@ -1805,7 +1805,7 @@ function Vo(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
|
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
1807
|
};
|
|
1808
|
-
return f(
|
|
1808
|
+
return f(sa(Do)), on.add(f), () => {
|
|
1809
1809
|
for (var p of d) for (const b of [t, document]) {
|
|
1810
1810
|
var m = Xt.get(b), y = m.get(p);
|
|
1811
1811
|
--y == 0 ? (b.removeEventListener(p, gi), m.delete(p), m.size === 0 && Xt.delete(b)) : m.set(p, y);
|
|
@@ -1816,11 +1816,11 @@ function Vo(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
|
|
|
1816
1816
|
return sn.set(l, c), l;
|
|
1817
1817
|
}
|
|
1818
1818
|
var sn = /* @__PURE__ */ new WeakMap();
|
|
1819
|
-
function
|
|
1819
|
+
function Il(e, t) {
|
|
1820
1820
|
const r = sn.get(e);
|
|
1821
1821
|
return r ? (sn.delete(e), r(t)) : Promise.resolve();
|
|
1822
1822
|
}
|
|
1823
|
-
var be = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), Pr = /* @__PURE__ */ new WeakMap(), mi = /* @__PURE__ */ new WeakMap(),
|
|
1823
|
+
var be = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), Pr = /* @__PURE__ */ new WeakMap(), mi = /* @__PURE__ */ new WeakMap(), $l = class {
|
|
1824
1824
|
constructor(e, t = !0) {
|
|
1825
1825
|
v(this, "anchor", void 0), T(this, be, /* @__PURE__ */ new Map()), T(this, Ie, /* @__PURE__ */ new Map()), T(this, ie, /* @__PURE__ */ new Map()), T(this, St, /* @__PURE__ */ new Set()), T(this, Lr, !0), T(this, Pr, (r) => {
|
|
1826
1826
|
if (h(be, this).has(r)) {
|
|
@@ -1858,7 +1858,7 @@ var be = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), ie =
|
|
|
1858
1858
|
}), this.anchor = e, _(Lr, this, t);
|
|
1859
1859
|
}
|
|
1860
1860
|
ensure(e, t) {
|
|
1861
|
-
var r = x, n =
|
|
1861
|
+
var r = x, n = ll();
|
|
1862
1862
|
if (t && !h(Ie, this).has(e) && !h(ie, this).has(e)) if (n) {
|
|
1863
1863
|
var i = document.createDocumentFragment(), o = we();
|
|
1864
1864
|
i.append(o), h(ie, this).set(e, {
|
|
@@ -1874,13 +1874,13 @@ var be = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), ie =
|
|
|
1874
1874
|
I && (this.anchor = C), h(Pr, this).call(this, r);
|
|
1875
1875
|
}
|
|
1876
1876
|
};
|
|
1877
|
-
function
|
|
1878
|
-
L === null &&
|
|
1877
|
+
function Rl(e) {
|
|
1878
|
+
L === null && ya("onMount"), zt && L.l !== null ? Ll(L).m.push(e) : Mt(() => {
|
|
1879
1879
|
const t = Sr(e);
|
|
1880
1880
|
if (typeof t == "function") return t;
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function Ll(e) {
|
|
1884
1884
|
var t = e.l;
|
|
1885
1885
|
return t.u ?? (t.u = {
|
|
1886
1886
|
a: [],
|
|
@@ -1891,10 +1891,10 @@ function Rl(e) {
|
|
|
1891
1891
|
function yi(e, t, r = !1) {
|
|
1892
1892
|
var n;
|
|
1893
1893
|
I && (n = C, kn());
|
|
1894
|
-
var i = new
|
|
1894
|
+
var i = new $l(e), o = r ? Sn : 0;
|
|
1895
1895
|
function s(a, l) {
|
|
1896
1896
|
if (I) {
|
|
1897
|
-
var c =
|
|
1897
|
+
var c = $a(n);
|
|
1898
1898
|
if (a !== parseInt(c.substring(1))) {
|
|
1899
1899
|
var u = Xi();
|
|
1900
1900
|
ce(u), i.anchor = u, lt(!1), i.ensure(a, l), lt(!0);
|
|
@@ -1910,7 +1910,7 @@ function yi(e, t, r = !1) {
|
|
|
1910
1910
|
}), a || s(-1, null);
|
|
1911
1911
|
}, o);
|
|
1912
1912
|
}
|
|
1913
|
-
function
|
|
1913
|
+
function Pl(e, t) {
|
|
1914
1914
|
Ao(() => {
|
|
1915
1915
|
var r = e.getRootNode(), n = r.host ? r : r.head ?? r.ownerDocument.head;
|
|
1916
1916
|
if (!n.querySelector("#" + t.hash)) {
|
|
@@ -1921,7 +1921,7 @@ function Ll(e, t) {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
var bi = [...`
|
|
1923
1923
|
\r\f \v\uFEFF`];
|
|
1924
|
-
function
|
|
1924
|
+
function Nl(e, t, r) {
|
|
1925
1925
|
var n = e == null ? "" : "" + e;
|
|
1926
1926
|
if (t && (n = n ? n + " " + t : t), r) {
|
|
1927
1927
|
for (var i of Object.keys(r)) if (r[i]) n = n ? n + " " + i : i;
|
|
@@ -1944,7 +1944,7 @@ function _i(e, t = !1) {
|
|
|
1944
1944
|
function Nr(e) {
|
|
1945
1945
|
return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function zl(e, t) {
|
|
1948
1948
|
if (t) {
|
|
1949
1949
|
var r = "", n, i;
|
|
1950
1950
|
if (Array.isArray(t) ? (n = t[0], i = t[1]) : n = t, e) {
|
|
@@ -1975,10 +1975,10 @@ function Nl(e, t) {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
return e == null ? null : String(e);
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function Wl(e, t, r, n, i, o) {
|
|
1979
1979
|
var s = e[Gr];
|
|
1980
1980
|
if (I || s !== r || s === void 0) {
|
|
1981
|
-
var a =
|
|
1981
|
+
var a = Nl(r, n, o);
|
|
1982
1982
|
(!I || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Gr] = r;
|
|
1983
1983
|
} else if (o && i !== o) for (var l in o) {
|
|
1984
1984
|
var c = !!o[l];
|
|
@@ -1995,34 +1995,34 @@ function zr(e, t = {}, r, n) {
|
|
|
1995
1995
|
function rt(e, t, r, n) {
|
|
1996
1996
|
var i = e[Yr];
|
|
1997
1997
|
if (I || i !== t) {
|
|
1998
|
-
var o =
|
|
1998
|
+
var o = zl(t, n);
|
|
1999
1999
|
(!I || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[Yr] = t;
|
|
2000
2000
|
} else n && (Array.isArray(n) ? (zr(e, r?.[0], n[0]), zr(e, r?.[1], n[1], "important")) : zr(e, r, n));
|
|
2001
2001
|
return n;
|
|
2002
2002
|
}
|
|
2003
|
-
var
|
|
2004
|
-
function
|
|
2005
|
-
var i =
|
|
2006
|
-
if (I && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName ===
|
|
2003
|
+
var Hl = /* @__PURE__ */ Symbol("is custom element"), Bl = /* @__PURE__ */ Symbol("is html"), Dl = ma ? "link" : "LINK";
|
|
2004
|
+
function Fl(e, t, r, n) {
|
|
2005
|
+
var i = jl(e);
|
|
2006
|
+
if (I && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === Dl)) {
|
|
2007
2007
|
n || void 0;
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
|
-
i[t] !== (i[t] = r) && (t === "loading" && (e[
|
|
2010
|
+
i[t] !== (i[t] = r) && (t === "loading" && (e[ga] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Vl(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function jl(e) {
|
|
2013
2013
|
var t;
|
|
2014
2014
|
return (t = e)[Ur] ?? (t[Ur] = {
|
|
2015
|
-
[
|
|
2016
|
-
[
|
|
2015
|
+
[Hl]: e.nodeName.includes("-"),
|
|
2016
|
+
[Bl]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
|
|
2017
2017
|
});
|
|
2018
2018
|
}
|
|
2019
2019
|
var Ti = /* @__PURE__ */ new Map();
|
|
2020
|
-
function
|
|
2020
|
+
function Vl(e) {
|
|
2021
2021
|
var t = e.getAttribute("is") || e.nodeName, r = Ti.get(t);
|
|
2022
2022
|
if (r) return r;
|
|
2023
2023
|
Ti.set(t, r = []);
|
|
2024
2024
|
for (var n, i = e, o = Element.prototype; o !== i; ) {
|
|
2025
|
-
n =
|
|
2025
|
+
n = aa(i);
|
|
2026
2026
|
for (var s in n) n[s].set && s !== "innerHTML" && s !== "textContent" && s !== "innerText" && r.push(s);
|
|
2027
2027
|
i = Ui(i);
|
|
2028
2028
|
}
|
|
@@ -2034,14 +2034,14 @@ var qo, at = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(),
|
|
|
2034
2034
|
}
|
|
2035
2035
|
observe(e, t) {
|
|
2036
2036
|
var r = h(at, this).get(e) || /* @__PURE__ */ new Set();
|
|
2037
|
-
return r.add(t), h(at, this).set(e, r), k(wi, this,
|
|
2037
|
+
return r.add(t), h(at, this).set(e, r), k(wi, this, ql).call(this).observe(e, h(Wr, this)), () => {
|
|
2038
2038
|
var n = h(at, this).get(e);
|
|
2039
2039
|
n.delete(t), n.size === 0 && (h(at, this).delete(e), h(mr, this).unobserve(e));
|
|
2040
2040
|
};
|
|
2041
2041
|
}
|
|
2042
2042
|
};
|
|
2043
2043
|
qo = Uo;
|
|
2044
|
-
function
|
|
2044
|
+
function ql() {
|
|
2045
2045
|
return h(mr, this) ?? _(mr, this, new ResizeObserver((e) => {
|
|
2046
2046
|
for (var t of e) {
|
|
2047
2047
|
qo.entries.set(t.target, t);
|
|
@@ -2053,7 +2053,7 @@ v(Uo, "entries", /* @__PURE__ */ new WeakMap());
|
|
|
2053
2053
|
function Hr(e, t) {
|
|
2054
2054
|
return e === t || e?.[Ot] === t;
|
|
2055
2055
|
}
|
|
2056
|
-
function
|
|
2056
|
+
function Ul(e = {}, t, r, n) {
|
|
2057
2057
|
var i = L.r, o = w;
|
|
2058
2058
|
return Ao(() => {
|
|
2059
2059
|
var s, a;
|
|
@@ -2081,7 +2081,7 @@ function Si(e, t, r, n) {
|
|
|
2081
2081
|
d = je(e, t)?.set ?? (f && t in e ? (M) => e[t] = M : void 0);
|
|
2082
2082
|
}
|
|
2083
2083
|
var p, m = !1;
|
|
2084
|
-
o ? [p, m] =
|
|
2084
|
+
o ? [p, m] = Wa(() => e[t]) : p = e[t], p === void 0 && n !== void 0 && (p = u(), d && (i && xa(t), d(p)));
|
|
2085
2085
|
var y;
|
|
2086
2086
|
if (i ? y = () => {
|
|
2087
2087
|
var M = e[t];
|
|
@@ -2107,14 +2107,14 @@ function Si(e, t, r, n) {
|
|
|
2107
2107
|
return ke && E || (F.f & 16384) !== 0 ? R.v : g(R);
|
|
2108
2108
|
});
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2111
|
-
return new
|
|
2110
|
+
function Gl(e) {
|
|
2111
|
+
return new Yl(e);
|
|
2112
2112
|
}
|
|
2113
|
-
var ze = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(),
|
|
2113
|
+
var ze = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Yl = class {
|
|
2114
2114
|
constructor(e) {
|
|
2115
2115
|
T(this, ze, void 0), T(this, ue, void 0);
|
|
2116
2116
|
var t = /* @__PURE__ */ new Map(), r = (i, o) => {
|
|
2117
|
-
var s = /* @__PURE__ */
|
|
2117
|
+
var s = /* @__PURE__ */ rl(o, !1, !1);
|
|
2118
2118
|
return t.set(i, s), s;
|
|
2119
2119
|
};
|
|
2120
2120
|
const n = new Proxy({
|
|
@@ -2131,7 +2131,7 @@ var ze = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Gl =
|
|
|
2131
2131
|
return $(t.get(o) ?? r(o, s), s), Reflect.set(i, o, s);
|
|
2132
2132
|
}
|
|
2133
2133
|
});
|
|
2134
|
-
_(ue, this, (e.hydrate ?
|
|
2134
|
+
_(ue, this, (e.hydrate ? Ol : jo)(e.component, {
|
|
2135
2135
|
target: e.target,
|
|
2136
2136
|
anchor: e.anchor,
|
|
2137
2137
|
props: n,
|
|
@@ -2153,7 +2153,7 @@ var ze = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Gl =
|
|
|
2153
2153
|
h(ue, this).$set = (i) => {
|
|
2154
2154
|
Object.assign(n, i);
|
|
2155
2155
|
}, h(ue, this).$destroy = () => {
|
|
2156
|
-
|
|
2156
|
+
Il(h(ue, this));
|
|
2157
2157
|
};
|
|
2158
2158
|
}
|
|
2159
2159
|
$set(e) {
|
|
@@ -2196,14 +2196,14 @@ typeof HTMLElement == "function" && (Go = class extends HTMLElement {
|
|
|
2196
2196
|
};
|
|
2197
2197
|
};
|
|
2198
2198
|
if (await Promise.resolve(), !this.$$cn || this.$$c) return;
|
|
2199
|
-
const t = {}, r =
|
|
2199
|
+
const t = {}, r = Kl(this);
|
|
2200
2200
|
for (const n of this.$$s) n in r && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
|
|
2201
2201
|
for (const n of this.attributes) {
|
|
2202
2202
|
const i = this.$$g_p(n.name);
|
|
2203
2203
|
i in this.$$d || (this.$$d[i] = tr(i, n.value, this.$$p_d, "toProp"));
|
|
2204
2204
|
}
|
|
2205
2205
|
for (const n in this.$$p_d) !(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
|
|
2206
|
-
this.$$c =
|
|
2206
|
+
this.$$c = Gl({
|
|
2207
2207
|
component: this.$$ctor,
|
|
2208
2208
|
target: this.$$shadowRoot || this,
|
|
2209
2209
|
props: {
|
|
@@ -2211,7 +2211,7 @@ typeof HTMLElement == "function" && (Go = class extends HTMLElement {
|
|
|
2211
2211
|
$$slots: t,
|
|
2212
2212
|
$$host: this
|
|
2213
2213
|
}
|
|
2214
|
-
}), this.$$me =
|
|
2214
|
+
}), this.$$me = hl(() => {
|
|
2215
2215
|
Ln(() => {
|
|
2216
2216
|
this.$$r = !0;
|
|
2217
2217
|
for (const n of or(this.$$c)) {
|
|
@@ -2268,13 +2268,13 @@ function tr(e, t, r, n) {
|
|
|
2268
2268
|
return t;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function Kl(e) {
|
|
2272
2272
|
const t = {};
|
|
2273
2273
|
return e.childNodes.forEach((r) => {
|
|
2274
2274
|
t[r.slot || "default"] = !0;
|
|
2275
2275
|
}), t;
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function Xl(e, t, r, n, i, o) {
|
|
2278
2278
|
let s = class extends Go {
|
|
2279
2279
|
constructor() {
|
|
2280
2280
|
super(e, r, i), this.$$p_d = t;
|
|
@@ -2300,14 +2300,14 @@ function Kl(e, t, r, n, i, o) {
|
|
|
2300
2300
|
} });
|
|
2301
2301
|
}), o && (s = o(s)), e.element = s, s;
|
|
2302
2302
|
}
|
|
2303
|
-
var
|
|
2303
|
+
var Jl = class extends Event {
|
|
2304
2304
|
constructor(e, t, r, n) {
|
|
2305
2305
|
super("context-request", {
|
|
2306
2306
|
bubbles: !0,
|
|
2307
2307
|
composed: !0
|
|
2308
2308
|
}), v(this, "context", void 0), v(this, "contextTarget", void 0), v(this, "callback", void 0), v(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = r, this.subscribe = n ?? !1;
|
|
2309
2309
|
}
|
|
2310
|
-
},
|
|
2310
|
+
}, Ql = class {
|
|
2311
2311
|
constructor(e, t) {
|
|
2312
2312
|
v(this, "host", void 0), v(this, "context", void 0), v(this, "subscribe", void 0), v(this, "onValue", void 0), v(this, "isConnected", !1), v(this, "unsubscribe", void 0), v(this, "currentValue", void 0), v(this, "handleValue", (r, n) => {
|
|
2313
2313
|
n !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = n), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = r, this.onValue?.(r);
|
|
@@ -2323,12 +2323,12 @@ var Xl = class extends Event {
|
|
|
2323
2323
|
return this.currentValue;
|
|
2324
2324
|
}
|
|
2325
2325
|
requestValue() {
|
|
2326
|
-
this.host.dispatchEvent(new
|
|
2326
|
+
this.host.dispatchEvent(new Jl(this.context, this.host, this.handleValue, this.subscribe));
|
|
2327
2327
|
}
|
|
2328
|
-
}, kr = (e) => e,
|
|
2329
|
-
function
|
|
2328
|
+
}, kr = (e) => e, Zl = kr(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), vh = kr(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), mh = kr(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), yh = kr(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
|
|
2329
|
+
function ec(e, t, r) {
|
|
2330
2330
|
let n = !1;
|
|
2331
|
-
const i = new
|
|
2331
|
+
const i = new Ql(e, {
|
|
2332
2332
|
context: t,
|
|
2333
2333
|
subscribe: !0,
|
|
2334
2334
|
onValue: (c) => {
|
|
@@ -2352,13 +2352,13 @@ function Zl(e, t, r) {
|
|
|
2352
2352
|
globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
|
|
2353
2353
|
};
|
|
2354
2354
|
}
|
|
2355
|
-
function ec(e, t) {
|
|
2356
|
-
return Zl(e, Ql, t);
|
|
2357
|
-
}
|
|
2358
2355
|
function tc(e, t) {
|
|
2359
|
-
return ec(e, t);
|
|
2356
|
+
return ec(e, Zl, t);
|
|
2360
2357
|
}
|
|
2361
|
-
|
|
2358
|
+
function rc(e, t) {
|
|
2359
|
+
return tc(e, t);
|
|
2360
|
+
}
|
|
2361
|
+
var nc = class {
|
|
2362
2362
|
serialize(e, t) {
|
|
2363
2363
|
return {
|
|
2364
2364
|
startContainer: this.getNodePath(e.startContainer, t),
|
|
@@ -2433,7 +2433,7 @@ var dt;
|
|
|
2433
2433
|
})(dt || (dt = {}));
|
|
2434
2434
|
var Yo = class an {
|
|
2435
2435
|
constructor(t = {}) {
|
|
2436
|
-
if (v(this, "config", void 0), v(this, "ttsWordHighlight", null), v(this, "ttsSentenceHighlight", null), v(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), v(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), v(this, "annotations", /* @__PURE__ */ new Map()), v(this, "colorHighlights", /* @__PURE__ */ new Map()), v(this, "nextAnnotationId", 1), v(this, "supported", !1), v(this, "rangeSerializer", void 0), v(this, "themeObserver", null), v(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new
|
|
2436
|
+
if (v(this, "config", void 0), v(this, "ttsWordHighlight", null), v(this, "ttsSentenceHighlight", null), v(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), v(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), v(this, "annotations", /* @__PURE__ */ new Map()), v(this, "colorHighlights", /* @__PURE__ */ new Map()), v(this, "nextAnnotationId", 1), v(this, "supported", !1), v(this, "rangeSerializer", void 0), v(this, "themeObserver", null), v(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new nc(), typeof CSS > "u" || !("highlights" in CSS)) {
|
|
2437
2437
|
console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
|
|
2438
2438
|
return;
|
|
2439
2439
|
}
|
|
@@ -2843,7 +2843,7 @@ function Ko(e) {
|
|
|
2843
2843
|
console.debug(`[${e}]`, ...t);
|
|
2844
2844
|
};
|
|
2845
2845
|
}
|
|
2846
|
-
var
|
|
2846
|
+
var bh = Ko("I18nService"), Br = {
|
|
2847
2847
|
assessment: [],
|
|
2848
2848
|
section: [],
|
|
2849
2849
|
item: [],
|
|
@@ -2864,19 +2864,19 @@ function $e(e, t) {
|
|
|
2864
2864
|
if (e.find((r) => typeof r != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
|
|
2865
2865
|
return e;
|
|
2866
2866
|
}
|
|
2867
|
-
function
|
|
2867
|
+
function ic(e) {
|
|
2868
2868
|
if (e != null) {
|
|
2869
2869
|
if (!Ke(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
|
|
2870
2870
|
return e;
|
|
2871
2871
|
}
|
|
2872
2872
|
}
|
|
2873
|
-
function
|
|
2873
|
+
function oc(e) {
|
|
2874
2874
|
if (e != null) {
|
|
2875
2875
|
if (!Ke(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
|
|
2876
2876
|
return e;
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
|
-
function
|
|
2879
|
+
function sc(e, t) {
|
|
2880
2880
|
if (t == null) return;
|
|
2881
2881
|
if (!Ke(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
|
|
2882
2882
|
const r = t, n = (i) => i === "polly" || i === "google" || i === "custom";
|
|
@@ -2885,11 +2885,11 @@ function oc(e, t) {
|
|
|
2885
2885
|
if ("provider" in r && r.provider !== void 0 && !Ke(r.provider) && !(e === "textToSpeech" && n(r.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
|
|
2886
2886
|
return r;
|
|
2887
2887
|
}
|
|
2888
|
-
function
|
|
2888
|
+
function ac(e) {
|
|
2889
2889
|
if (e == null) return {};
|
|
2890
2890
|
if (!Ke(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
|
|
2891
2891
|
const t = {};
|
|
2892
|
-
for (const [r, n] of Object.entries(e)) t[r] =
|
|
2892
|
+
for (const [r, n] of Object.entries(e)) t[r] = sc(r, n);
|
|
2893
2893
|
return t;
|
|
2894
2894
|
}
|
|
2895
2895
|
function Xo(e) {
|
|
@@ -2906,15 +2906,15 @@ function Re(e) {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
return Array.from(t);
|
|
2908
2908
|
}
|
|
2909
|
-
function
|
|
2909
|
+
function lc(e, t) {
|
|
2910
2910
|
if (e != null) {
|
|
2911
2911
|
if (e === "on" || e === "off") return e;
|
|
2912
2912
|
throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
|
|
2913
2913
|
}
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function cc(e) {
|
|
2916
2916
|
if (e != null && !Ke(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
|
|
2917
|
-
const t =
|
|
2917
|
+
const t = oc(e?.policy), r = ic(e?.placement), n = ac(e?.providers), i = lc(e?.pnpEnforcement, "pnpEnforcement"), o = {
|
|
2918
2918
|
policy: {
|
|
2919
2919
|
allowed: Re($e(t?.allowed, "policy.allowed")),
|
|
2920
2920
|
blocked: Re($e(t?.blocked, "policy.blocked"))
|
|
@@ -2928,7 +2928,7 @@ function lc(e) {
|
|
|
2928
2928
|
};
|
|
2929
2929
|
return i && (o.pnpEnforcement = i), o;
|
|
2930
2930
|
}
|
|
2931
|
-
var
|
|
2931
|
+
var uc = [
|
|
2932
2932
|
"assessment",
|
|
2933
2933
|
"section",
|
|
2934
2934
|
"item",
|
|
@@ -2939,7 +2939,7 @@ var cc = [
|
|
|
2939
2939
|
function rr(e, t) {
|
|
2940
2940
|
if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
|
|
2941
2941
|
}
|
|
2942
|
-
var
|
|
2942
|
+
var dc = [
|
|
2943
2943
|
{
|
|
2944
2944
|
pattern: /<script\b/i,
|
|
2945
2945
|
reason: "contains a <script> tag"
|
|
@@ -2957,17 +2957,17 @@ var uc = [
|
|
|
2957
2957
|
reason: "contains a <foreignObject> element"
|
|
2958
2958
|
}
|
|
2959
2959
|
];
|
|
2960
|
-
function
|
|
2960
|
+
function hc(e, t, r) {
|
|
2961
2961
|
const n = t.trimStart(), i = n.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(n);
|
|
2962
2962
|
if (/^data:/i.test(n)) throw new Error(`Invalid tool registration "${e}": "${r}" may not be a data: URL.`);
|
|
2963
2963
|
if (!(!i && !o)) {
|
|
2964
|
-
for (const { pattern: s, reason: a } of
|
|
2964
|
+
for (const { pattern: s, reason: a } of dc) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${a}. Inline SVG icons must not include scriptable content.`);
|
|
2965
2965
|
}
|
|
2966
2966
|
}
|
|
2967
2967
|
function ki(e) {
|
|
2968
2968
|
if (rr(e.toolId, "toolId"), rr(e.name, "name"), rr(e.description, "description"), typeof e.icon != "string" && typeof e.icon != "function") throw new Error(`Invalid tool registration "${e.toolId}": "icon" must be a string or function.`);
|
|
2969
|
-
if (typeof e.icon == "string" &&
|
|
2970
|
-
const t = e.supportedLevels.find((r) => !
|
|
2969
|
+
if (typeof e.icon == "string" && hc(e.toolId, e.icon, "icon"), !Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
|
|
2970
|
+
const t = e.supportedLevels.find((r) => !uc.includes(r));
|
|
2971
2971
|
if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
|
|
2972
2972
|
if (e.activation !== void 0 && e.activation !== "toolbar-toggle" && e.activation !== "selection-gateway") throw new Error(`Invalid tool registration "${e.toolId}": unsupported activation "${String(e.activation)}".`);
|
|
2973
2973
|
if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
|
|
@@ -2976,7 +2976,7 @@ function ki(e) {
|
|
|
2976
2976
|
if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
|
|
2977
2977
|
if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
|
|
2978
2978
|
}
|
|
2979
|
-
var
|
|
2979
|
+
var fc = class {
|
|
2980
2980
|
constructor() {
|
|
2981
2981
|
v(this, "tools", /* @__PURE__ */ new Map()), v(this, "pnpIndex", /* @__PURE__ */ new Map()), v(this, "componentOverrides", {}), v(this, "moduleLoaders", /* @__PURE__ */ new Map()), v(this, "loadedToolModules", /* @__PURE__ */ new Set()), v(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
|
|
2982
2982
|
}
|
|
@@ -3122,10 +3122,10 @@ var hc = class {
|
|
|
3122
3122
|
function Jo(e) {
|
|
3123
3123
|
return e.level === "item";
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function pc(e) {
|
|
3126
3126
|
return e.level === "passage";
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function gc(e) {
|
|
3129
3129
|
return e.level === "rubric";
|
|
3130
3130
|
}
|
|
3131
3131
|
function Qo(e) {
|
|
@@ -3166,7 +3166,7 @@ function Nn(e) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
return n.filter(Boolean).join(" ").trim();
|
|
3168
3168
|
}
|
|
3169
|
-
if (
|
|
3169
|
+
if (pc(e)) {
|
|
3170
3170
|
const t = e.passage;
|
|
3171
3171
|
if (!t?.config) return "";
|
|
3172
3172
|
const r = t.config, n = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -3185,7 +3185,7 @@ function Nn(e) {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
return n.filter(Boolean).join(" ").trim();
|
|
3187
3187
|
}
|
|
3188
|
-
if (
|
|
3188
|
+
if (gc(e)) {
|
|
3189
3189
|
const t = e.rubricBlock;
|
|
3190
3190
|
return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
3191
3191
|
}
|
|
@@ -3202,7 +3202,7 @@ function xr(e) {
|
|
|
3202
3202
|
/\d+\s*[+\-*/=]\s*\d+/
|
|
3203
3203
|
].some((r) => r.test(t));
|
|
3204
3204
|
}
|
|
3205
|
-
function
|
|
3205
|
+
function vc(e) {
|
|
3206
3206
|
const t = [
|
|
3207
3207
|
"pie-multiple-choice",
|
|
3208
3208
|
"pie-inline-choice",
|
|
@@ -3232,7 +3232,7 @@ function gc(e) {
|
|
|
3232
3232
|
function Er(e) {
|
|
3233
3233
|
return Nn(e).trim().length >= 10;
|
|
3234
3234
|
}
|
|
3235
|
-
function
|
|
3235
|
+
function mc(e) {
|
|
3236
3236
|
const t = Nn(e);
|
|
3237
3237
|
return [
|
|
3238
3238
|
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
@@ -3243,23 +3243,23 @@ function vc(e) {
|
|
|
3243
3243
|
/physics|force|energy|velocity|acceleration/i
|
|
3244
3244
|
].some((r) => r.test(t));
|
|
3245
3245
|
}
|
|
3246
|
-
var
|
|
3246
|
+
var yc = [
|
|
3247
3247
|
"assessment",
|
|
3248
3248
|
"section",
|
|
3249
3249
|
"item",
|
|
3250
3250
|
"passage",
|
|
3251
3251
|
"rubric"
|
|
3252
|
-
],
|
|
3253
|
-
function
|
|
3254
|
-
return
|
|
3252
|
+
], bc = new Set(yc);
|
|
3253
|
+
function _c(e) {
|
|
3254
|
+
return bc.has(e);
|
|
3255
3255
|
}
|
|
3256
3256
|
function zn(e, t, r) {
|
|
3257
3257
|
const n = e.trim(), i = r.trim();
|
|
3258
3258
|
if (!n || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
3259
|
-
if (!
|
|
3259
|
+
if (!_c(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
|
|
3260
3260
|
return `${n}:${t}:${i}`;
|
|
3261
3261
|
}
|
|
3262
|
-
var
|
|
3262
|
+
var Tc = class {
|
|
3263
3263
|
constructor() {
|
|
3264
3264
|
v(this, "providerId", "desmos-calculator"), v(this, "providerName", "Desmos Calculator"), v(this, "category", "calculator"), v(this, "version", "1.10"), v(this, "requiresAuth", !0), v(this, "desmosProvider", null), v(this, "config", null);
|
|
3265
3265
|
}
|
|
@@ -3363,14 +3363,34 @@ var _c = class {
|
|
|
3363
3363
|
text: e,
|
|
3364
3364
|
offset: 0
|
|
3365
3365
|
}];
|
|
3366
|
-
}, Zo =
|
|
3366
|
+
}, Zo = (e) => String(e || "").trim().toLowerCase(), wc = () => Zo((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), Sc = (e, t) => {
|
|
3367
|
+
if (t) {
|
|
3368
|
+
const s = e.find((a) => a.name === t);
|
|
3369
|
+
if (s) return s;
|
|
3370
|
+
}
|
|
3371
|
+
const r = wc(), n = r.split("-")[0] || "en", i = (s) => {
|
|
3372
|
+
const a = Zo(s.lang);
|
|
3373
|
+
return a === r || a.startsWith(`${n}-`);
|
|
3374
|
+
}, o = [
|
|
3375
|
+
(s) => s.localService && i(s),
|
|
3376
|
+
(s) => s.default && i(s),
|
|
3377
|
+
(s) => i(s),
|
|
3378
|
+
(s) => s.localService,
|
|
3379
|
+
(s) => s.default
|
|
3380
|
+
];
|
|
3381
|
+
for (const s of o) {
|
|
3382
|
+
const a = e.find(s);
|
|
3383
|
+
if (a) return a;
|
|
3384
|
+
}
|
|
3385
|
+
return e[0] || null;
|
|
3386
|
+
}, kc = (e) => !e.default, es = class {
|
|
3367
3387
|
constructor() {
|
|
3368
3388
|
v(this, "providerId", "browser"), v(this, "providerName", "Browser Speech Synthesis"), v(this, "version", "1.0.0");
|
|
3369
3389
|
}
|
|
3370
3390
|
async initialize(e) {
|
|
3371
3391
|
if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
|
|
3372
3392
|
if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
|
|
3373
|
-
return new
|
|
3393
|
+
return new xc(e);
|
|
3374
3394
|
}
|
|
3375
3395
|
supportsFeature(e) {
|
|
3376
3396
|
return !0;
|
|
@@ -3388,7 +3408,7 @@ var _c = class {
|
|
|
3388
3408
|
}
|
|
3389
3409
|
destroy() {
|
|
3390
3410
|
}
|
|
3391
|
-
},
|
|
3411
|
+
}, xc = class {
|
|
3392
3412
|
constructor(e) {
|
|
3393
3413
|
v(this, "utterance", null), v(this, "config", null), v(this, "_isPlaying", !1), v(this, "_isPaused", !1), v(this, "speakRunId", 0), v(this, "onWordBoundary", void 0), this.config = e;
|
|
3394
3414
|
}
|
|
@@ -3473,37 +3493,40 @@ var _c = class {
|
|
|
3473
3493
|
n(!1);
|
|
3474
3494
|
return;
|
|
3475
3495
|
}
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3496
|
+
const o = new SpeechSynthesisUtterance(e);
|
|
3497
|
+
this.utterance = o;
|
|
3498
|
+
const s = Sc(speechSynthesis.getVoices(), this.config?.voice);
|
|
3499
|
+
s && kc(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
|
|
3500
|
+
const a = () => {
|
|
3501
|
+
this.utterance === o && (this.utterance = null);
|
|
3502
|
+
};
|
|
3503
|
+
o.onstart = () => {
|
|
3481
3504
|
r === this.speakRunId && (this._isPlaying = !0, this._isPaused = !1);
|
|
3482
|
-
},
|
|
3483
|
-
if (r !== this.speakRunId) {
|
|
3505
|
+
}, o.onend = () => {
|
|
3506
|
+
if (a(), r !== this.speakRunId) {
|
|
3484
3507
|
n(!1);
|
|
3485
3508
|
return;
|
|
3486
3509
|
}
|
|
3487
3510
|
this._isPlaying = !1, this._isPaused = !1, n(!0);
|
|
3488
|
-
},
|
|
3489
|
-
if (r !== this.speakRunId) {
|
|
3511
|
+
}, o.onerror = (l) => {
|
|
3512
|
+
if (a(), r !== this.speakRunId) {
|
|
3490
3513
|
n(!1);
|
|
3491
3514
|
return;
|
|
3492
3515
|
}
|
|
3493
|
-
if (this._isPlaying = !1, this._isPaused = !1,
|
|
3516
|
+
if (this._isPlaying = !1, this._isPaused = !1, l.error === "interrupted" || l.error === "canceled") {
|
|
3494
3517
|
n(!1);
|
|
3495
3518
|
return;
|
|
3496
3519
|
}
|
|
3497
|
-
i(/* @__PURE__ */ new Error(`Speech synthesis error: ${
|
|
3498
|
-
},
|
|
3520
|
+
i(/* @__PURE__ */ new Error(`Speech synthesis error: ${l.error}`));
|
|
3521
|
+
}, o.onpause = () => {
|
|
3499
3522
|
r === this.speakRunId && (this._isPaused = !0);
|
|
3500
|
-
},
|
|
3523
|
+
}, o.onresume = () => {
|
|
3501
3524
|
r === this.speakRunId && (this._isPaused = !1);
|
|
3502
|
-
},
|
|
3503
|
-
if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:",
|
|
3504
|
-
const
|
|
3505
|
-
console.log("[BrowserProvider] Calling onWordBoundary with word:",
|
|
3506
|
-
}, speechSynthesis.speak(
|
|
3525
|
+
}, o.onboundary = (l) => {
|
|
3526
|
+
if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", l.name, "charIndex:", l.charIndex, "charLength:", l.charLength), l.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
|
|
3527
|
+
const c = Math.max(0, Math.min(l.charIndex, Math.max(0, e.length - 1))), u = Number(l.charLength || 0), d = this.inferWordLength(e, c), f = Number.isFinite(u) && u > 0 && u <= 80 && c + u <= e.length ? u : d, p = e.substring(c, Math.min(e.length, c + f)).trim(), m = t + c;
|
|
3528
|
+
console.log("[BrowserProvider] Calling onWordBoundary with word:", p, "at position:", m), this.onWordBoundary(p, m, f);
|
|
3529
|
+
}, speechSynthesis.speak(o);
|
|
3507
3530
|
});
|
|
3508
3531
|
}
|
|
3509
3532
|
pause() {
|
|
@@ -3513,7 +3536,7 @@ var _c = class {
|
|
|
3513
3536
|
this._isPlaying && this._isPaused && speechSynthesis.resume();
|
|
3514
3537
|
}
|
|
3515
3538
|
stop() {
|
|
3516
|
-
this.speakRunId += 1, this._isPlaying && speechSynthesis.cancel(), this._isPlaying = !1, this._isPaused = !1;
|
|
3539
|
+
this.speakRunId += 1, (this._isPlaying || this.utterance) && speechSynthesis.cancel(), this.utterance = null, this._isPlaying = !1, this._isPaused = !1;
|
|
3517
3540
|
}
|
|
3518
3541
|
isPlaying() {
|
|
3519
3542
|
return this._isPlaying && !this._isPaused;
|
|
@@ -3527,7 +3550,7 @@ var _c = class {
|
|
|
3527
3550
|
...e.providerOptions || {}
|
|
3528
3551
|
});
|
|
3529
3552
|
}
|
|
3530
|
-
},
|
|
3553
|
+
}, Ec = class {
|
|
3531
3554
|
async emitTelemetry(e, t) {
|
|
3532
3555
|
try {
|
|
3533
3556
|
await this.config?.onTelemetry?.(e, t);
|
|
@@ -3559,7 +3582,7 @@ var _c = class {
|
|
|
3559
3582
|
}
|
|
3560
3583
|
async _initializeBrowserTTS(e) {
|
|
3561
3584
|
if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
|
|
3562
|
-
this.ttsProvider = new
|
|
3585
|
+
this.ttsProvider = new es(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
|
|
3563
3586
|
}
|
|
3564
3587
|
async _initializeServerTTS(e) {
|
|
3565
3588
|
if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
|
|
@@ -3617,7 +3640,7 @@ var _c = class {
|
|
|
3617
3640
|
destroy() {
|
|
3618
3641
|
this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
|
|
3619
3642
|
}
|
|
3620
|
-
},
|
|
3643
|
+
}, Ac = /* @__PURE__ */ new Set([
|
|
3621
3644
|
"annotation-xml",
|
|
3622
3645
|
"color-profile",
|
|
3623
3646
|
"font-face",
|
|
@@ -3626,16 +3649,16 @@ var _c = class {
|
|
|
3626
3649
|
"font-face-format",
|
|
3627
3650
|
"font-face-name",
|
|
3628
3651
|
"missing-glyph"
|
|
3629
|
-
]),
|
|
3652
|
+
]), Mc = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, Cc = (e, t = "custom element tag") => {
|
|
3630
3653
|
if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
|
|
3631
3654
|
const r = e.trim();
|
|
3632
3655
|
if (!r) throw new Error(`Invalid ${t}: tag is empty`);
|
|
3633
3656
|
if (r !== r.toLowerCase()) throw new Error(`Invalid ${t} "${r}": custom element names must be lowercase`);
|
|
3634
3657
|
if (!r.includes("-")) throw new Error(`Invalid ${t} "${r}": custom element names must include a hyphen`);
|
|
3635
|
-
if (
|
|
3636
|
-
if (!
|
|
3658
|
+
if (Ac.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
|
|
3659
|
+
if (!Mc.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
3637
3660
|
return r;
|
|
3638
|
-
},
|
|
3661
|
+
}, ts = {
|
|
3639
3662
|
calculator: "pie-tool-calculator",
|
|
3640
3663
|
textToSpeech: "pie-tool-text-to-speech",
|
|
3641
3664
|
ruler: "pie-tool-ruler",
|
|
@@ -3647,21 +3670,21 @@ var _c = class {
|
|
|
3647
3670
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3648
3671
|
graph: "pie-tool-graph",
|
|
3649
3672
|
periodicTable: "pie-tool-periodic-table"
|
|
3650
|
-
},
|
|
3651
|
-
const i =
|
|
3673
|
+
}, Oc = (e, t) => Cc(t?.toolTagMap?.[e] ?? ts[e] ?? e, `tool component tag for "${e}"`), Ic = (e) => document.createElement(e), me = (e, t, r, n) => {
|
|
3674
|
+
const i = Oc(e, n), o = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
|
|
3652
3675
|
return o ? o({
|
|
3653
3676
|
toolId: e,
|
|
3654
3677
|
tagName: i,
|
|
3655
3678
|
context: t,
|
|
3656
3679
|
toolbarContext: r
|
|
3657
|
-
}) :
|
|
3680
|
+
}) : Ic(i);
|
|
3658
3681
|
}, ln = /* @__PURE__ */ new WeakMap();
|
|
3659
|
-
function
|
|
3682
|
+
function $c(e, t) {
|
|
3660
3683
|
if (!e) return null;
|
|
3661
3684
|
const r = ln.get(e), n = r?.get(t);
|
|
3662
3685
|
return n ? n.isConnected ? n : (r?.delete(t), null) : null;
|
|
3663
3686
|
}
|
|
3664
|
-
function
|
|
3687
|
+
function Rc(e, t, r) {
|
|
3665
3688
|
if (!e) return;
|
|
3666
3689
|
let n = ln.get(e);
|
|
3667
3690
|
n || (n = /* @__PURE__ */ new Map(), ln.set(e, n)), n.set(t, r);
|
|
@@ -3669,7 +3692,7 @@ function Cc(e, t, r) {
|
|
|
3669
3692
|
function xi(e) {
|
|
3670
3693
|
return e === "basic" || e === "scientific" ? e : null;
|
|
3671
3694
|
}
|
|
3672
|
-
function
|
|
3695
|
+
function Lc(e) {
|
|
3673
3696
|
const t = e.getToolRenderParams?.("calculator") ?? {}, r = xi(t.calculatorType), n = t.availableTypes;
|
|
3674
3697
|
return {
|
|
3675
3698
|
calculatorType: r,
|
|
@@ -3681,14 +3704,14 @@ function Ei(e, t, r) {
|
|
|
3681
3704
|
const n = e;
|
|
3682
3705
|
t ? (n.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete n.calculatorType, e.removeAttribute("calculator-type")), r && r.length > 0 ? n.availableTypes = r : delete n.availableTypes;
|
|
3683
3706
|
}
|
|
3684
|
-
var
|
|
3707
|
+
var Pc = {
|
|
3685
3708
|
toolId: "calculator",
|
|
3686
3709
|
name: "Calculator",
|
|
3687
3710
|
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
3688
3711
|
icon: "calculator",
|
|
3689
3712
|
provider: {
|
|
3690
3713
|
getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
|
|
3691
|
-
createProvider: () => new
|
|
3714
|
+
createProvider: () => new Tc(),
|
|
3692
3715
|
getInitConfig: (e) => e?.provider?.init ?? {},
|
|
3693
3716
|
getAuthFetcher: (e) => {
|
|
3694
3717
|
const t = e?.provider?.runtime?.authFetcher;
|
|
@@ -3714,8 +3737,8 @@ var Ic = {
|
|
|
3714
3737
|
return xr(e);
|
|
3715
3738
|
},
|
|
3716
3739
|
renderToolbar(e, t) {
|
|
3717
|
-
const { calculatorType: r, availableTypes: n, displayName: i } =
|
|
3718
|
-
a ||
|
|
3740
|
+
const { calculatorType: r, availableTypes: n, displayName: i } = Lc(t), o = zn(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = $c(t.toolCoordinator, o), l = a ?? me(this.toolId, e, t, s);
|
|
3741
|
+
a || Rc(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ei(l, r, n);
|
|
3719
3742
|
const c = r === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = r === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, d = {
|
|
3720
3743
|
toolId: this.toolId,
|
|
3721
3744
|
label: i,
|
|
@@ -3756,7 +3779,7 @@ var Ic = {
|
|
|
3756
3779
|
}
|
|
3757
3780
|
};
|
|
3758
3781
|
}
|
|
3759
|
-
}, W = (e) => e.trim().replace(/\s+/g, " "),
|
|
3782
|
+
}, W = (e) => e.trim().replace(/\s+/g, " "), rs = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, ns = (e) => {
|
|
3760
3783
|
if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
|
|
3761
3784
|
const t = e.classList;
|
|
3762
3785
|
if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
|
|
@@ -3770,12 +3793,12 @@ var Ic = {
|
|
|
3770
3793
|
}, _t = (e, t) => {
|
|
3771
3794
|
let r = e.nodeType === 1 ? e : e.parentElement;
|
|
3772
3795
|
for (; r; ) {
|
|
3773
|
-
if (
|
|
3796
|
+
if (ns(r)) return !0;
|
|
3774
3797
|
if (t && r === t) break;
|
|
3775
3798
|
r = r.parentElement;
|
|
3776
3799
|
}
|
|
3777
3800
|
return !1;
|
|
3778
|
-
},
|
|
3801
|
+
}, is = (e, t, r) => {
|
|
3779
3802
|
if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
|
|
3780
3803
|
const n = r?.boundarySpacingMode ?? "segmenterPreferred";
|
|
3781
3804
|
if (n === "none") return !1;
|
|
@@ -3803,7 +3826,7 @@ var Ic = {
|
|
|
3803
3826
|
const f = u;
|
|
3804
3827
|
if (f.parentElement && !_t(f, e)) {
|
|
3805
3828
|
const p = f.textContent || "", m = p.match(/\S/), y = m ? m[0] : null;
|
|
3806
|
-
!o && !s &&
|
|
3829
|
+
!o && !s && is(l, y, t) && (n.push(" "), a && r.set(i, a), i++, s = !0);
|
|
3807
3830
|
for (let b = 0; b < p.length; b++) {
|
|
3808
3831
|
const E = p[b], R = /\s/.test(E);
|
|
3809
3832
|
o ? R || (o = !1, n.push(E), r.set(i, {
|
|
@@ -3835,11 +3858,11 @@ var Ic = {
|
|
|
3835
3858
|
text: d,
|
|
3836
3859
|
map: r
|
|
3837
3860
|
};
|
|
3838
|
-
}, Fr = null, Ai = Promise.resolve(),
|
|
3861
|
+
}, Fr = null, Ai = Promise.resolve(), Nc = (e) => (e || "en").split("-")[0].toLowerCase() || "en", zc = async () => (Fr || (Fr = import("./sre-yGY3u7Xp.js").then((e) => /* @__PURE__ */ na(e.default, 1)).then((e) => {
|
|
3839
3862
|
const t = e.default || e;
|
|
3840
3863
|
if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
|
|
3841
3864
|
return t;
|
|
3842
|
-
})), Fr),
|
|
3865
|
+
})), Fr), Wc = (e) => e === "en" ? "clearspeak" : "mathspeak", Mi = (e) => !!e && typeof e == "object" && !Array.isArray(e), Ci = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, Ar = (e) => {
|
|
3843
3866
|
if (!Mi(e)) return;
|
|
3844
3867
|
const t = Ci(e.domain), r = Ci(e.style), n = Mi(e.engineOptions) ? e.engineOptions : void 0;
|
|
3845
3868
|
if (!(!t && !r && !n))
|
|
@@ -3848,36 +3871,36 @@ var Ic = {
|
|
|
3848
3871
|
...r ? { style: r } : {},
|
|
3849
3872
|
...n ? { engineOptions: n } : {}
|
|
3850
3873
|
};
|
|
3851
|
-
},
|
|
3852
|
-
const i =
|
|
3874
|
+
}, Hc = async (e, t, r, n) => {
|
|
3875
|
+
const i = Nc(t), o = Ar(n);
|
|
3853
3876
|
await e.setupEngine?.({
|
|
3854
3877
|
...o?.engineOptions || {},
|
|
3855
3878
|
locale: i,
|
|
3856
|
-
domain: o?.domain ||
|
|
3879
|
+
domain: o?.domain || Wc(i),
|
|
3857
3880
|
...o?.style ? { style: o.style } : {},
|
|
3858
3881
|
modality: "speech",
|
|
3859
3882
|
markup: r
|
|
3860
3883
|
}), await e.engineReady?.();
|
|
3861
|
-
},
|
|
3884
|
+
}, Bc = async (e) => {
|
|
3862
3885
|
const t = Ai.then(e, e);
|
|
3863
3886
|
return Ai = t.then(() => {
|
|
3864
3887
|
}, () => {
|
|
3865
3888
|
}), t;
|
|
3866
|
-
},
|
|
3889
|
+
}, os = async (e, t, r, n, i) => Bc(async () => (await Hc(e, r, n, i), e.toSpeech(t))), Dc = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), Fc = async (e, t, r, n) => {
|
|
3867
3890
|
try {
|
|
3868
|
-
const i =
|
|
3891
|
+
const i = Dc(await os(e, t, r, "ssml", n));
|
|
3869
3892
|
return i.includes("<speak") ? i : null;
|
|
3870
3893
|
} catch (i) {
|
|
3871
3894
|
return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
|
|
3872
3895
|
}
|
|
3873
|
-
},
|
|
3896
|
+
}, ss = async (e, t = {}) => {
|
|
3874
3897
|
if (!e.some((c) => c.type === "math")) return {
|
|
3875
3898
|
speechText: W(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
|
|
3876
3899
|
usedMathSpeech: !1,
|
|
3877
3900
|
usedFallback: !1
|
|
3878
3901
|
};
|
|
3879
3902
|
let r = null, n = !1, i = !1;
|
|
3880
|
-
const o = t.loadSre ||
|
|
3903
|
+
const o = t.loadSre || zc, s = [];
|
|
3881
3904
|
for (const c of e) {
|
|
3882
3905
|
if (c.type === "text") {
|
|
3883
3906
|
s.push(c.text);
|
|
@@ -3885,7 +3908,7 @@ var Ic = {
|
|
|
3885
3908
|
}
|
|
3886
3909
|
try {
|
|
3887
3910
|
r || (r = await o());
|
|
3888
|
-
const u = W(await
|
|
3911
|
+
const u = W(await os(r, c.mathml, t.language, "none", t.mathSpeech));
|
|
3889
3912
|
if (u) {
|
|
3890
3913
|
s.push(u), n = !0;
|
|
3891
3914
|
continue;
|
|
@@ -3897,18 +3920,18 @@ var Ic = {
|
|
|
3897
3920
|
}
|
|
3898
3921
|
const a = W(s.join(" "));
|
|
3899
3922
|
let l;
|
|
3900
|
-
return t.produceSsml && r && n && e.length === 1 && e[0].type === "math" && (l = await
|
|
3923
|
+
return t.produceSsml && r && n && e.length === 1 && e[0].type === "math" && (l = await Fc(r, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
3901
3924
|
speechText: a,
|
|
3902
3925
|
usedMathSpeech: n,
|
|
3903
3926
|
usedFallback: i,
|
|
3904
3927
|
ssml: l
|
|
3905
3928
|
};
|
|
3906
|
-
},
|
|
3929
|
+
}, jc = /* @__PURE__ */ new Set([
|
|
3907
3930
|
"reserved-row",
|
|
3908
3931
|
"expanding-row",
|
|
3909
3932
|
"floating-overlay",
|
|
3910
3933
|
"left-aligned"
|
|
3911
|
-
]), Oi = (e) => e && typeof e == "object" ? e : {},
|
|
3934
|
+
]), Oi = (e) => e && typeof e == "object" ? e : {}, Vc = (e) => e === "polly" || e === "google" || e === "server", J = (e, t) => e === void 0 ? t : e, br = (e, t = "left-aligned") => typeof e == "string" && jc.has(e) ? e : t, Ii = Object.freeze([0.8, 1.25]), jr = (e) => {
|
|
3912
3935
|
if (!Array.isArray(e)) return [...Ii];
|
|
3913
3936
|
if (e.length === 0) return [];
|
|
3914
3937
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -3918,12 +3941,12 @@ var Ic = {
|
|
|
3918
3941
|
n !== 1 && t.add(n);
|
|
3919
3942
|
}
|
|
3920
3943
|
return t.size ? Array.from(t) : [...Ii];
|
|
3921
|
-
},
|
|
3944
|
+
}, qc = (e) => {
|
|
3922
3945
|
const t = {
|
|
3923
3946
|
...e,
|
|
3924
3947
|
layoutMode: br(e.layoutMode)
|
|
3925
3948
|
}, r = e.backend || "browser";
|
|
3926
|
-
if (!
|
|
3949
|
+
if (!Vc(r)) return t;
|
|
3927
3950
|
const n = {
|
|
3928
3951
|
...t,
|
|
3929
3952
|
apiEndpoint: J(t.apiEndpoint, "/api/tts"),
|
|
@@ -3946,12 +3969,12 @@ var Ic = {
|
|
|
3946
3969
|
} : n;
|
|
3947
3970
|
}, Vr = (e) => {
|
|
3948
3971
|
const t = Oi(e), r = Oi(t.settings);
|
|
3949
|
-
return
|
|
3972
|
+
return qc({
|
|
3950
3973
|
...t,
|
|
3951
3974
|
...r
|
|
3952
3975
|
});
|
|
3953
|
-
}, cn = (e) => e.backend || "browser",
|
|
3954
|
-
const t = cn(e), r =
|
|
3976
|
+
}, cn = (e) => e.backend || "browser", as = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, ls = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Uc = (e) => {
|
|
3977
|
+
const t = cn(e), r = as(e, t), n = ls(e, r), i = Ar(e.mathSpeech);
|
|
3955
3978
|
return {
|
|
3956
3979
|
voice: e.defaultVoice,
|
|
3957
3980
|
rate: e.rate,
|
|
@@ -3977,8 +4000,8 @@ var Ic = {
|
|
|
3977
4000
|
validateEndpoint: e.validateEndpoint,
|
|
3978
4001
|
...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
|
|
3979
4002
|
};
|
|
3980
|
-
},
|
|
3981
|
-
switch (
|
|
4003
|
+
}, cs = (e) => br(e.layoutMode), Gc = (e) => {
|
|
4004
|
+
switch (cs(e)) {
|
|
3982
4005
|
case "reserved-row":
|
|
3983
4006
|
return {
|
|
3984
4007
|
mount: "before-buttons",
|
|
@@ -4004,21 +4027,21 @@ var Ic = {
|
|
|
4004
4027
|
}
|
|
4005
4028
|
};
|
|
4006
4029
|
}
|
|
4007
|
-
}, kt = /* @__PURE__ */ new Map(),
|
|
4030
|
+
}, kt = /* @__PURE__ */ new Map(), Yc = "__pieToolElementUnmount", $i = "pie-tool-active-change", Kc = {
|
|
4008
4031
|
toolId: "textToSpeech",
|
|
4009
4032
|
name: "Text to Speech",
|
|
4010
4033
|
description: "Read content aloud",
|
|
4011
4034
|
icon: "volume-up",
|
|
4012
4035
|
provider: {
|
|
4013
4036
|
getProviderId: () => "tts",
|
|
4014
|
-
createProvider: (e) => new
|
|
4037
|
+
createProvider: (e) => new Ec(cn(Vr(e))),
|
|
4015
4038
|
getInitConfig: (e) => {
|
|
4016
|
-
const t = Vr(e), r = cn(t), n =
|
|
4039
|
+
const t = Vr(e), r = cn(t), n = as(t, r);
|
|
4017
4040
|
return {
|
|
4018
4041
|
backend: r,
|
|
4019
4042
|
serverProvider: n,
|
|
4020
|
-
transportMode:
|
|
4021
|
-
...
|
|
4043
|
+
transportMode: ls(t, n),
|
|
4044
|
+
...Uc(t)
|
|
4022
4045
|
};
|
|
4023
4046
|
},
|
|
4024
4047
|
getAuthFetcher: (e) => {
|
|
@@ -4044,12 +4067,12 @@ var Ic = {
|
|
|
4044
4067
|
return Er(e);
|
|
4045
4068
|
},
|
|
4046
4069
|
renderToolbar(e, t) {
|
|
4047
|
-
const r = () => Vr(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => jr(r().speedOptions), i = () =>
|
|
4070
|
+
const r = () => Vr(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => jr(r().speedOptions), i = () => cs(r()), o = () => Gc(r()), s = zn(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
|
|
4048
4071
|
const u = t.ui?.size;
|
|
4049
4072
|
return u === "sm" || u === "lg" ? u : "md";
|
|
4050
4073
|
}, l = () => {
|
|
4051
4074
|
let u = kt.get(s);
|
|
4052
|
-
return u && typeof u.isConnected == "boolean" && !u.isConnected && (kt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[
|
|
4075
|
+
return u && typeof u.isConnected == "boolean" && !u.isConnected && (kt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Yc] = () => {
|
|
4053
4076
|
kt.get(s) === u && kt.delete(s);
|
|
4054
4077
|
}, kt.set(s, u)), u.setAttribute("tool-id", s), u.setAttribute("catalog-id", t.catalogId || t.itemId), u.setAttribute("language", t.language || "en-US"), u.setAttribute("size", a()), u.setAttribute("layout-mode", i()), u.speedOptions = n(), u;
|
|
4055
4078
|
}, c = o();
|
|
@@ -4098,7 +4121,7 @@ function Ce(e) {
|
|
|
4098
4121
|
function Hn(e, t) {
|
|
4099
4122
|
e.setAttribute("data-pie-tool-surface", t);
|
|
4100
4123
|
}
|
|
4101
|
-
var
|
|
4124
|
+
var Xc = {
|
|
4102
4125
|
toolId: "ruler",
|
|
4103
4126
|
name: "Ruler",
|
|
4104
4127
|
description: "On-screen ruler for measurements",
|
|
@@ -4140,7 +4163,7 @@ var Uc = {
|
|
|
4140
4163
|
subscribeActive: r.subscribeActive
|
|
4141
4164
|
};
|
|
4142
4165
|
}
|
|
4143
|
-
},
|
|
4166
|
+
}, Jc = {
|
|
4144
4167
|
toolId: "protractor",
|
|
4145
4168
|
name: "Protractor",
|
|
4146
4169
|
description: "On-screen protractor for angle measurements",
|
|
@@ -4182,7 +4205,7 @@ var Uc = {
|
|
|
4182
4205
|
subscribeActive: r.subscribeActive
|
|
4183
4206
|
};
|
|
4184
4207
|
}
|
|
4185
|
-
},
|
|
4208
|
+
}, Qc = {
|
|
4186
4209
|
toolId: "answerEliminator",
|
|
4187
4210
|
name: "Answer Eliminator",
|
|
4188
4211
|
description: "Strike through answer choices",
|
|
@@ -4195,7 +4218,7 @@ var Uc = {
|
|
|
4195
4218
|
"choiceMasking"
|
|
4196
4219
|
],
|
|
4197
4220
|
isVisibleInContext(e) {
|
|
4198
|
-
return
|
|
4221
|
+
return vc(e);
|
|
4199
4222
|
},
|
|
4200
4223
|
renderToolbar(e, t) {
|
|
4201
4224
|
const r = Me(this.toolId, t), n = t.componentOverrides ?? {}, i = me(this.toolId, e, t, n);
|
|
@@ -4229,7 +4252,7 @@ var Uc = {
|
|
|
4229
4252
|
subscribeActive: r.subscribeActive
|
|
4230
4253
|
};
|
|
4231
4254
|
}
|
|
4232
|
-
},
|
|
4255
|
+
}, Zc = {
|
|
4233
4256
|
toolId: "highlighter",
|
|
4234
4257
|
name: "Highlighter",
|
|
4235
4258
|
description: "Highlight text",
|
|
@@ -4280,7 +4303,7 @@ var Uc = {
|
|
|
4280
4303
|
subscribeActive: r.subscribeActive
|
|
4281
4304
|
};
|
|
4282
4305
|
}
|
|
4283
|
-
},
|
|
4306
|
+
}, eu = {
|
|
4284
4307
|
toolId: "lineReader",
|
|
4285
4308
|
name: "Line Reader",
|
|
4286
4309
|
description: "Reading guide overlay",
|
|
@@ -4329,7 +4352,7 @@ var Uc = {
|
|
|
4329
4352
|
subscribeActive: r.subscribeActive
|
|
4330
4353
|
};
|
|
4331
4354
|
}
|
|
4332
|
-
},
|
|
4355
|
+
}, tu = {
|
|
4333
4356
|
toolId: "theme",
|
|
4334
4357
|
name: "Theme",
|
|
4335
4358
|
description: "Accessible themes and contrast",
|
|
@@ -4384,7 +4407,7 @@ var Uc = {
|
|
|
4384
4407
|
subscribeActive: r.subscribeActive
|
|
4385
4408
|
};
|
|
4386
4409
|
}
|
|
4387
|
-
},
|
|
4410
|
+
}, ru = {
|
|
4388
4411
|
toolId: "annotationToolbar",
|
|
4389
4412
|
name: "Highlighter",
|
|
4390
4413
|
description: "Highlight and annotate text",
|
|
@@ -4435,7 +4458,7 @@ var Uc = {
|
|
|
4435
4458
|
subscribeActive: r.subscribeActive
|
|
4436
4459
|
};
|
|
4437
4460
|
}
|
|
4438
|
-
},
|
|
4461
|
+
}, nu = {
|
|
4439
4462
|
toolId: "graph",
|
|
4440
4463
|
name: "Graph",
|
|
4441
4464
|
description: "Graphing calculator and coordinate plane",
|
|
@@ -4488,7 +4511,7 @@ var Uc = {
|
|
|
4488
4511
|
subscribeActive: r.subscribeActive
|
|
4489
4512
|
};
|
|
4490
4513
|
}
|
|
4491
|
-
},
|
|
4514
|
+
}, iu = {
|
|
4492
4515
|
toolId: "periodicTable",
|
|
4493
4516
|
name: "Periodic Table",
|
|
4494
4517
|
description: "Chemistry periodic table reference",
|
|
@@ -4500,7 +4523,7 @@ var Uc = {
|
|
|
4500
4523
|
"elementReference"
|
|
4501
4524
|
],
|
|
4502
4525
|
isVisibleInContext(e) {
|
|
4503
|
-
return
|
|
4526
|
+
return mc(e);
|
|
4504
4527
|
},
|
|
4505
4528
|
renderToolbar(e, t) {
|
|
4506
4529
|
const r = Me(this.toolId, t), n = {
|
|
@@ -4540,54 +4563,54 @@ var Uc = {
|
|
|
4540
4563
|
subscribeActive: r.subscribeActive
|
|
4541
4564
|
};
|
|
4542
4565
|
}
|
|
4543
|
-
},
|
|
4544
|
-
|
|
4545
|
-
qc,
|
|
4546
|
-
Uc,
|
|
4547
|
-
Gc,
|
|
4548
|
-
Yc,
|
|
4566
|
+
}, ou = [
|
|
4567
|
+
Pc,
|
|
4549
4568
|
Kc,
|
|
4550
4569
|
Xc,
|
|
4551
4570
|
Jc,
|
|
4552
4571
|
Qc,
|
|
4553
4572
|
Zc,
|
|
4554
|
-
eu
|
|
4573
|
+
eu,
|
|
4574
|
+
tu,
|
|
4575
|
+
ru,
|
|
4576
|
+
nu,
|
|
4577
|
+
iu
|
|
4555
4578
|
];
|
|
4556
|
-
function
|
|
4557
|
-
const t = new
|
|
4579
|
+
function su(e = {}) {
|
|
4580
|
+
const t = new fc(), r = {
|
|
4558
4581
|
toolTagMap: {
|
|
4559
|
-
...
|
|
4582
|
+
...ts,
|
|
4560
4583
|
...e.toolTagMap || {}
|
|
4561
4584
|
},
|
|
4562
4585
|
toolComponentFactory: e.toolComponentFactory,
|
|
4563
4586
|
toolComponentFactories: e.toolComponentFactories
|
|
4564
4587
|
}, n = (i) => e.overrides?.[i.toolId] || i;
|
|
4565
|
-
return e.includePackagedTools &&
|
|
4588
|
+
return e.includePackagedTools && au(t, {
|
|
4566
4589
|
toolIds: e.toolIds,
|
|
4567
4590
|
applyOverrides: n
|
|
4568
4591
|
}), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(r), t;
|
|
4569
4592
|
}
|
|
4570
|
-
function
|
|
4593
|
+
function au(e, t = {}) {
|
|
4571
4594
|
const r = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, n = t.applyOverrides || ((i) => i);
|
|
4572
|
-
for (const i of
|
|
4595
|
+
for (const i of ou)
|
|
4573
4596
|
r && !r.has(i.toolId) || e.register(n(i));
|
|
4574
4597
|
}
|
|
4575
|
-
function
|
|
4576
|
-
return
|
|
4598
|
+
function lu(e = {}) {
|
|
4599
|
+
return su({
|
|
4577
4600
|
...e,
|
|
4578
4601
|
includePackagedTools: !0
|
|
4579
4602
|
});
|
|
4580
4603
|
}
|
|
4581
|
-
function
|
|
4582
|
-
const e =
|
|
4604
|
+
function cu() {
|
|
4605
|
+
const e = lu(), t = /* @__PURE__ */ new Set();
|
|
4583
4606
|
for (const r of e.getAllTools()) for (const n of r.pnpSupportIds || []) t.add(n);
|
|
4584
4607
|
return [...t].sort();
|
|
4585
4608
|
}
|
|
4586
|
-
var
|
|
4587
|
-
supports: [...
|
|
4609
|
+
var uu = cu(), _h = {
|
|
4610
|
+
supports: [...uu],
|
|
4588
4611
|
prohibitedSupports: [],
|
|
4589
4612
|
activateAtInit: []
|
|
4590
|
-
},
|
|
4613
|
+
}, du = {
|
|
4591
4614
|
visual: {
|
|
4592
4615
|
magnification: "magnification",
|
|
4593
4616
|
screenMagnifier: "screenMagnifier",
|
|
@@ -4700,11 +4723,11 @@ var su = ou(), vh = {
|
|
|
4700
4723
|
itemGlossary: "itemGlossary",
|
|
4701
4724
|
tutorialAvailable: "tutorialAvailable"
|
|
4702
4725
|
}
|
|
4703
|
-
},
|
|
4726
|
+
}, Th = Object.values(du).flatMap((e) => Object.values(e)), wh = Ko("ToolCoordinator"), un;
|
|
4704
4727
|
(function(e) {
|
|
4705
4728
|
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
4706
4729
|
})(un || (un = {}));
|
|
4707
|
-
var
|
|
4730
|
+
var hu = /* @__PURE__ */ new Set([
|
|
4708
4731
|
"speak",
|
|
4709
4732
|
"p",
|
|
4710
4733
|
"s",
|
|
@@ -4713,20 +4736,20 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4713
4736
|
"say-as",
|
|
4714
4737
|
"voice",
|
|
4715
4738
|
"lang"
|
|
4716
|
-
]), Ri = /* @__PURE__ */ new Set(["audio", "phoneme"]),
|
|
4739
|
+
]), Ri = /* @__PURE__ */ new Set(["audio", "phoneme"]), us = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ").replace(/ /g, " ").replace(/&/g, "&"), nr = (e, t, r) => {
|
|
4717
4740
|
for (let n = 0; n < t.length; n++) e.push({
|
|
4718
4741
|
char: t[n],
|
|
4719
4742
|
rawOffset: r === null ? null : r + n
|
|
4720
4743
|
});
|
|
4721
|
-
},
|
|
4744
|
+
}, fu = (e, t, r) => {
|
|
4722
4745
|
const n = t.slice(r).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
|
|
4723
|
-
return n ? (nr(e,
|
|
4746
|
+
return n ? (nr(e, us(n[0]), r), n[0].length) : 0;
|
|
4724
4747
|
}, Li = (e) => {
|
|
4725
4748
|
e.push({
|
|
4726
4749
|
char: " ",
|
|
4727
4750
|
rawOffset: null
|
|
4728
4751
|
});
|
|
4729
|
-
},
|
|
4752
|
+
}, pu = (e) => {
|
|
4730
4753
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
4731
4754
|
let n = !0;
|
|
4732
4755
|
for (const i of e) {
|
|
@@ -4742,17 +4765,17 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4742
4765
|
text: r.join(""),
|
|
4743
4766
|
rawToSpokenOffsetMap: t
|
|
4744
4767
|
};
|
|
4745
|
-
},
|
|
4768
|
+
}, gu = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", vu = (e, t) => {
|
|
4746
4769
|
const r = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), n = e.match(r);
|
|
4747
|
-
return
|
|
4748
|
-
},
|
|
4770
|
+
return us(n?.[2] ?? n?.[3] ?? "") || null;
|
|
4771
|
+
}, ds = (e) => {
|
|
4749
4772
|
const t = [];
|
|
4750
4773
|
let r = !1, n = !1, i = 0;
|
|
4751
4774
|
for (; i < e.length; ) {
|
|
4752
4775
|
const s = e[i];
|
|
4753
4776
|
if (s !== "<") {
|
|
4754
4777
|
if (s === "&") {
|
|
4755
|
-
const f =
|
|
4778
|
+
const f = fu(t, e, i);
|
|
4756
4779
|
if (f > 0) {
|
|
4757
4780
|
i += f;
|
|
4758
4781
|
continue;
|
|
@@ -4767,9 +4790,9 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4767
4790
|
continue;
|
|
4768
4791
|
}
|
|
4769
4792
|
n = !0;
|
|
4770
|
-
const l = e.slice(i, a + 1), c =
|
|
4793
|
+
const l = e.slice(i, a + 1), c = gu(l), u = /^<\s*\//.test(l), d = /\/\s*>$/.test(l);
|
|
4771
4794
|
if (!u && c === "sub") {
|
|
4772
|
-
const f =
|
|
4795
|
+
const f = vu(l, "alias");
|
|
4773
4796
|
if (!f) {
|
|
4774
4797
|
r = !0, i = a + 1;
|
|
4775
4798
|
continue;
|
|
@@ -4787,16 +4810,16 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4787
4810
|
i = a + 1;
|
|
4788
4811
|
continue;
|
|
4789
4812
|
}
|
|
4790
|
-
c && !
|
|
4813
|
+
c && !hu.has(c) && !Ri.has(c) && c !== "break" && c !== "sub" && (r = !0), !u && (c === "p" || c === "s") && Li(t), i = a + 1;
|
|
4791
4814
|
}
|
|
4792
|
-
const o =
|
|
4815
|
+
const o = pu(t);
|
|
4793
4816
|
return {
|
|
4794
4817
|
spokenText: W(o.text),
|
|
4795
4818
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
4796
4819
|
unsupportedSemantic: r,
|
|
4797
4820
|
hasMarkup: n
|
|
4798
4821
|
};
|
|
4799
|
-
},
|
|
4822
|
+
}, mu = rs(), hs = /* @__PURE__ */ new Map([
|
|
4800
4823
|
["zero", "0"],
|
|
4801
4824
|
["one", "1"],
|
|
4802
4825
|
["two", "2"],
|
|
@@ -4808,7 +4831,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4808
4831
|
["eight", "8"],
|
|
4809
4832
|
["nine", "9"],
|
|
4810
4833
|
["ten", "10"]
|
|
4811
|
-
]),
|
|
4834
|
+
]), yu = [
|
|
4812
4835
|
{
|
|
4813
4836
|
phrase: [
|
|
4814
4837
|
"plus",
|
|
@@ -4885,7 +4908,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4885
4908
|
}
|
|
4886
4909
|
], dn = (e) => {
|
|
4887
4910
|
const t = [];
|
|
4888
|
-
for (const r of e.matchAll(
|
|
4911
|
+
for (const r of e.matchAll(mu)) {
|
|
4889
4912
|
const n = r[0], i = r.index ?? 0;
|
|
4890
4913
|
t.push({
|
|
4891
4914
|
text: n,
|
|
@@ -4895,7 +4918,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4895
4918
|
});
|
|
4896
4919
|
}
|
|
4897
4920
|
return t;
|
|
4898
|
-
}, hn = (e) =>
|
|
4921
|
+
}, hn = (e) => hs.get(e.normalized) || e.normalized, bu = (e, t) => {
|
|
4899
4922
|
const r = [];
|
|
4900
4923
|
for (let n = 0; n < e.length; n++) {
|
|
4901
4924
|
for (let i = 0; i < t.length; i++) hn(e[n]) === hn(t[i]) && r.push({
|
|
@@ -4904,7 +4927,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4904
4927
|
visibleToken: i,
|
|
4905
4928
|
score: 10
|
|
4906
4929
|
});
|
|
4907
|
-
for (const i of
|
|
4930
|
+
for (const i of yu) {
|
|
4908
4931
|
const o = e.slice(n, n + i.phrase.length);
|
|
4909
4932
|
if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
|
|
4910
4933
|
for (let s = 0; s < t.length; s++)
|
|
@@ -4917,8 +4940,8 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4917
4940
|
}
|
|
4918
4941
|
}
|
|
4919
4942
|
return r;
|
|
4920
|
-
},
|
|
4921
|
-
const r =
|
|
4943
|
+
}, _u = (e, t) => {
|
|
4944
|
+
const r = bu(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), n = new Array(r.length).fill(0), i = new Array(r.length).fill(-1);
|
|
4922
4945
|
for (let l = 0; l < r.length; l++) {
|
|
4923
4946
|
const c = r[l];
|
|
4924
4947
|
n[l] = c.score;
|
|
@@ -4947,12 +4970,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4947
4970
|
score: l.score
|
|
4948
4971
|
};
|
|
4949
4972
|
});
|
|
4950
|
-
},
|
|
4973
|
+
}, Tu = (e, t, r) => {
|
|
4951
4974
|
if (e.length === 0) return 0;
|
|
4952
4975
|
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;
|
|
4953
4976
|
return Math.min(1, n * i);
|
|
4954
|
-
},
|
|
4955
|
-
const t =
|
|
4977
|
+
}, fs = (e) => {
|
|
4978
|
+
const t = ds(e.speechText), r = W(e.visibleText), n = t.spokenText, i = dn(n), o = dn(r), s = t.unsupportedSemantic ? [] : _u(i, o), a = Tu(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", d = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
|
|
4956
4979
|
return {
|
|
4957
4980
|
speechText: e.speechText,
|
|
4958
4981
|
spokenText: n,
|
|
@@ -4965,12 +4988,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4965
4988
|
visibleTokens: o,
|
|
4966
4989
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
|
|
4967
4990
|
};
|
|
4968
|
-
}, Bn = (e, t) => e.find((r) => r.start <= t && t < r.end) || null,
|
|
4991
|
+
}, Bn = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, ps = (e) => {
|
|
4969
4992
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
4970
4993
|
const t = dn(e)[0];
|
|
4971
|
-
return t ?
|
|
4994
|
+
return t ? hs.get(t.normalized) || t.normalized : null;
|
|
4972
4995
|
}, Pi = (e, t, r) => {
|
|
4973
|
-
const n =
|
|
4996
|
+
const n = ps(r);
|
|
4974
4997
|
if (!t || !n) return !1;
|
|
4975
4998
|
const i = Bn(e.spokenTokens, t.start);
|
|
4976
4999
|
return i ? hn(i) === n : !1;
|
|
@@ -4998,7 +5021,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
4998
5021
|
start: t,
|
|
4999
5022
|
length: Math.min(r, n.end - t)
|
|
5000
5023
|
} : null;
|
|
5001
|
-
},
|
|
5024
|
+
}, wu = (e, t, r = 1, n) => {
|
|
5002
5025
|
if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
|
|
5003
5026
|
const i = Math.max(1, Number.isFinite(r) ? r : 1);
|
|
5004
5027
|
if (n && /^<[^>]+>$/.test(n.trim())) return null;
|
|
@@ -5007,12 +5030,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5007
5030
|
if (n) {
|
|
5008
5031
|
if (Pi(e, o, n)) return o;
|
|
5009
5032
|
if (Pi(e, s, n)) return s;
|
|
5010
|
-
if (
|
|
5033
|
+
if (ps(n)) return null;
|
|
5011
5034
|
}
|
|
5012
5035
|
return o || s;
|
|
5013
5036
|
}
|
|
5014
5037
|
return Wi(e, t, i) || zi(e, t, i);
|
|
5015
|
-
},
|
|
5038
|
+
}, Su = (e, t) => {
|
|
5016
5039
|
if (e.playbackMode === "region-fallback") return null;
|
|
5017
5040
|
const r = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
|
|
5018
5041
|
if (r) return {
|
|
@@ -5034,7 +5057,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5034
5057
|
start: Math.min(n.visibleStart, i.visibleStart),
|
|
5035
5058
|
end: Math.max(n.visibleEnd, i.visibleEnd)
|
|
5036
5059
|
} : null;
|
|
5037
|
-
},
|
|
5060
|
+
}, ku = /* @__PURE__ */ new Map([
|
|
5038
5061
|
["+", ["plus"]],
|
|
5039
5062
|
["-", ["minus", "negative"]],
|
|
5040
5063
|
["−", ["minus", "negative"]],
|
|
@@ -5058,12 +5081,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5058
5081
|
["•", ["times"]],
|
|
5059
5082
|
["·", ["times"]],
|
|
5060
5083
|
["", ["times", "multiplied by"]]
|
|
5061
|
-
]),
|
|
5084
|
+
]), xu = /* @__PURE__ */ new Map([
|
|
5062
5085
|
["", "function-application"],
|
|
5063
5086
|
["", "implicit-multiply"],
|
|
5064
5087
|
["", "invisible-separator"],
|
|
5065
5088
|
["", "invisible-plus"]
|
|
5066
|
-
]),
|
|
5089
|
+
]), gs = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), Eu = /* @__PURE__ */ new Map([
|
|
5067
5090
|
["msqrt", "radical"],
|
|
5068
5091
|
["mroot", "radical"],
|
|
5069
5092
|
["msub", "subscript"],
|
|
@@ -5073,11 +5096,11 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5073
5096
|
["munderover", "underoverscript"],
|
|
5074
5097
|
["mmultiscripts", "multiscript"],
|
|
5075
5098
|
["menclose", "enclosure"]
|
|
5076
|
-
]),
|
|
5099
|
+
]), Au = (e) => e.replace(/\s+/g, " ").trim(), Xe = (e) => (e.localName || e.tagName || "").toLowerCase(), Mu = (e) => e.nodeType === Node.ELEMENT_NODE, yt = (e) => Array.from(e.childNodes).filter(Mu), Dn = (e) => Au(e.textContent || ""), xe = (e, t) => ({
|
|
5077
5100
|
type: "element-range",
|
|
5078
5101
|
quality: t,
|
|
5079
5102
|
element: e
|
|
5080
|
-
}),
|
|
5103
|
+
}), Cu = (e) => {
|
|
5081
5104
|
switch (e) {
|
|
5082
5105
|
case "mi":
|
|
5083
5106
|
return "identifier";
|
|
@@ -5093,15 +5116,15 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5093
5116
|
default:
|
|
5094
5117
|
return "unknown";
|
|
5095
5118
|
}
|
|
5096
|
-
},
|
|
5097
|
-
const t = e.normalized ??
|
|
5119
|
+
}, Ou = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), Iu = (e, t, r) => r === "fraction" ? ["over", "divided by"] : r === "superscript" ? gs.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? ku.get(e) || [] : [], Qe = (e) => {
|
|
5120
|
+
const t = e.normalized ?? Ou(e.text, e.kind || "unknown");
|
|
5098
5121
|
return {
|
|
5099
5122
|
id: `math-token-${e.state.nextId++}`,
|
|
5100
5123
|
kind: e.kind,
|
|
5101
5124
|
role: e.role,
|
|
5102
5125
|
text: e.text,
|
|
5103
5126
|
normalized: t,
|
|
5104
|
-
spokenAliases:
|
|
5127
|
+
spokenAliases: Iu(e.text, e.kind, e.role),
|
|
5105
5128
|
sourceElement: e.sourceElement,
|
|
5106
5129
|
path: e.path,
|
|
5107
5130
|
target: e.target || xe(e.sourceElement, "element-range"),
|
|
@@ -5109,9 +5132,9 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5109
5132
|
};
|
|
5110
5133
|
}, Ze = (e, t, r = "tokens") => {
|
|
5111
5134
|
e[r].push(t);
|
|
5112
|
-
},
|
|
5135
|
+
}, vs = (e, t, r) => {
|
|
5113
5136
|
yt(e).forEach((n, i) => Ee(n, t, `${r}/${Xe(n)}[${i}]`));
|
|
5114
|
-
},
|
|
5137
|
+
}, $u = (e, t, r) => {
|
|
5115
5138
|
const n = yt(e);
|
|
5116
5139
|
n[0] && Ee(n[0], t, `${r}/numerator`), Ze(t, Qe({
|
|
5117
5140
|
state: t,
|
|
@@ -5122,7 +5145,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5122
5145
|
path: r,
|
|
5123
5146
|
target: xe(e, "element-range")
|
|
5124
5147
|
})), n[1] && Ee(n[1], t, `${r}/denominator`);
|
|
5125
|
-
},
|
|
5148
|
+
}, Ru = (e, t, r) => {
|
|
5126
5149
|
const n = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
|
|
5127
5150
|
Ze(t, Qe({
|
|
5128
5151
|
state: t,
|
|
@@ -5132,7 +5155,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5132
5155
|
sourceElement: e,
|
|
5133
5156
|
path: `${r}/open`,
|
|
5134
5157
|
target: xe(e, "element-range")
|
|
5135
|
-
})),
|
|
5158
|
+
})), vs(e, t, r), Ze(t, Qe({
|
|
5136
5159
|
state: t,
|
|
5137
5160
|
kind: "operator",
|
|
5138
5161
|
role: i === "|" ? "absolute-value-fence" : "close-fence",
|
|
@@ -5141,13 +5164,13 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5141
5164
|
path: `${r}/close`,
|
|
5142
5165
|
target: xe(e, "element-range")
|
|
5143
5166
|
}));
|
|
5144
|
-
},
|
|
5167
|
+
}, Lu = (e, t, r) => {
|
|
5145
5168
|
const n = yt(e);
|
|
5146
5169
|
n[0] && Ee(n[0], t, `${r}/base`);
|
|
5147
5170
|
const i = n[1];
|
|
5148
5171
|
if (!i) return;
|
|
5149
5172
|
const o = Dn(i);
|
|
5150
|
-
if (
|
|
5173
|
+
if (gs.has(o)) {
|
|
5151
5174
|
Ze(t, Qe({
|
|
5152
5175
|
state: t,
|
|
5153
5176
|
kind: "structure",
|
|
@@ -5161,7 +5184,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5161
5184
|
return;
|
|
5162
5185
|
}
|
|
5163
5186
|
Ee(i, t, `${r}/exponent`);
|
|
5164
|
-
},
|
|
5187
|
+
}, Pu = (e, t, r, n) => {
|
|
5165
5188
|
Ze(t, Qe({
|
|
5166
5189
|
state: t,
|
|
5167
5190
|
kind: "structure",
|
|
@@ -5172,7 +5195,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5172
5195
|
path: r,
|
|
5173
5196
|
target: xe(e, "element-range")
|
|
5174
5197
|
}));
|
|
5175
|
-
},
|
|
5198
|
+
}, Nu = (e, t, r) => {
|
|
5176
5199
|
let n = 0;
|
|
5177
5200
|
for (const i of yt(e))
|
|
5178
5201
|
(Xe(i) === "mtr" || Xe(i) === "mlabeledtr") && (n++, Ze(t, Qe({
|
|
@@ -5185,10 +5208,10 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5185
5208
|
path: `${r}/row[${n}]`,
|
|
5186
5209
|
target: xe(i, "region-fallback")
|
|
5187
5210
|
}), "layoutTargets")), Ee(i, t, `${r}/${Xe(i)}[${n}]`);
|
|
5188
|
-
},
|
|
5211
|
+
}, zu = (e, t, r) => {
|
|
5189
5212
|
const n = Dn(e);
|
|
5190
5213
|
if (!n) return;
|
|
5191
|
-
const i =
|
|
5214
|
+
const i = Cu(Xe(e)), o = i === "operator" ? xu.get(n) : void 0, s = o ?? (i === "operator" && (n === "(" || n === ")") ? "grouping-fence" : i);
|
|
5192
5215
|
Ze(t, Qe({
|
|
5193
5216
|
state: t,
|
|
5194
5217
|
kind: i,
|
|
@@ -5219,19 +5242,19 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5219
5242
|
case "mtext":
|
|
5220
5243
|
case "ms":
|
|
5221
5244
|
case "mspace":
|
|
5222
|
-
|
|
5245
|
+
zu(e, t, r);
|
|
5223
5246
|
return;
|
|
5224
5247
|
case "mfrac":
|
|
5225
|
-
|
|
5248
|
+
$u(e, t, r);
|
|
5226
5249
|
return;
|
|
5227
5250
|
case "msup":
|
|
5228
|
-
|
|
5251
|
+
Lu(e, t, r);
|
|
5229
5252
|
return;
|
|
5230
5253
|
case "mfenced":
|
|
5231
|
-
|
|
5254
|
+
Ru(e, t, r);
|
|
5232
5255
|
return;
|
|
5233
5256
|
case "mtable":
|
|
5234
|
-
|
|
5257
|
+
Nu(e, t, r);
|
|
5235
5258
|
return;
|
|
5236
5259
|
case "mphantom":
|
|
5237
5260
|
return;
|
|
@@ -5241,15 +5264,15 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5241
5264
|
return;
|
|
5242
5265
|
}
|
|
5243
5266
|
default: {
|
|
5244
|
-
const i =
|
|
5267
|
+
const i = Eu.get(n);
|
|
5245
5268
|
if (i) {
|
|
5246
|
-
|
|
5269
|
+
Pu(e, t, r, i);
|
|
5247
5270
|
return;
|
|
5248
5271
|
}
|
|
5249
|
-
|
|
5272
|
+
vs(e, t, r);
|
|
5250
5273
|
}
|
|
5251
5274
|
}
|
|
5252
|
-
},
|
|
5275
|
+
}, Wu = (e) => {
|
|
5253
5276
|
const t = {
|
|
5254
5277
|
tokens: [],
|
|
5255
5278
|
layoutTargets: [],
|
|
@@ -5260,7 +5283,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5260
5283
|
layoutTargets: t.layoutTargets,
|
|
5261
5284
|
expressionTarget: xe(e, "region-fallback")
|
|
5262
5285
|
};
|
|
5263
|
-
},
|
|
5286
|
+
}, Hu = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Bu = 0.95, Du = (e) => {
|
|
5264
5287
|
const t = [], r = /* @__PURE__ */ new Set(), n = (i) => {
|
|
5265
5288
|
const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
5266
5289
|
if (o.length === 0) return;
|
|
@@ -5285,11 +5308,11 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5285
5308
|
o && (n = i.length);
|
|
5286
5309
|
}
|
|
5287
5310
|
return n;
|
|
5288
|
-
},
|
|
5311
|
+
}, Fu = (e, t) => {
|
|
5289
5312
|
const r = [];
|
|
5290
5313
|
let n = 0;
|
|
5291
5314
|
for (const i of t) {
|
|
5292
|
-
const o =
|
|
5315
|
+
const o = Du(i);
|
|
5293
5316
|
if (i.optional) {
|
|
5294
5317
|
const s = Hi(e, n, o);
|
|
5295
5318
|
s > 0 && (r.push({
|
|
@@ -5311,23 +5334,23 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5311
5334
|
}
|
|
5312
5335
|
}
|
|
5313
5336
|
return r;
|
|
5314
|
-
},
|
|
5337
|
+
}, ju = (e, t, r) => {
|
|
5315
5338
|
const n = r.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
|
|
5316
5339
|
return n > 0 && i === n && o === t.length;
|
|
5317
|
-
},
|
|
5340
|
+
}, Vu = (e) => e.map(({ speechTokens: t, math: r }) => ({
|
|
5318
5341
|
speechTokenIds: t.map((n) => n.id),
|
|
5319
5342
|
mathTokenIds: [r.id],
|
|
5320
5343
|
score: 1,
|
|
5321
5344
|
confidence: 1,
|
|
5322
5345
|
target: r.target
|
|
5323
|
-
})),
|
|
5324
|
-
const t = e.minExactWordConfidence ??
|
|
5346
|
+
})), qu = (e) => {
|
|
5347
|
+
const t = e.minExactWordConfidence ?? Bu, r = Fu(e.speech.tokens, e.math.tokens), n = ju(r, e.speech.tokens, e.math.tokens) ? 1 : 0;
|
|
5325
5348
|
return {
|
|
5326
|
-
segments: n >= t ?
|
|
5349
|
+
segments: n >= t ? Vu(r) : [],
|
|
5327
5350
|
confidence: n,
|
|
5328
5351
|
fallbackTarget: e.math.expressionTarget
|
|
5329
5352
|
};
|
|
5330
|
-
},
|
|
5353
|
+
}, ms = rs(), Uu = /* @__PURE__ */ new Map([
|
|
5331
5354
|
["zero", "0"],
|
|
5332
5355
|
["one", "1"],
|
|
5333
5356
|
["two", "2"],
|
|
@@ -5339,17 +5362,17 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5339
5362
|
["eight", "8"],
|
|
5340
5363
|
["nine", "9"],
|
|
5341
5364
|
["ten", "10"]
|
|
5342
|
-
]),
|
|
5365
|
+
]), ys = (e) => {
|
|
5343
5366
|
const t = e.toLowerCase();
|
|
5344
|
-
return
|
|
5345
|
-
},
|
|
5367
|
+
return Uu.get(t) || t;
|
|
5368
|
+
}, Gu = (e) => {
|
|
5346
5369
|
const t = [];
|
|
5347
|
-
for (const r of e.matchAll(
|
|
5370
|
+
for (const r of e.matchAll(ms)) {
|
|
5348
5371
|
const n = r[0], i = r.index ?? 0;
|
|
5349
5372
|
t.push({
|
|
5350
5373
|
id: `speech-token-${t.length}`,
|
|
5351
5374
|
text: n,
|
|
5352
|
-
normalized:
|
|
5375
|
+
normalized: ys(n),
|
|
5353
5376
|
start: i,
|
|
5354
5377
|
end: i + n.length,
|
|
5355
5378
|
sourceStart: i,
|
|
@@ -5359,11 +5382,11 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5359
5382
|
}
|
|
5360
5383
|
return t;
|
|
5361
5384
|
}, Ft = (e) => {
|
|
5362
|
-
const t =
|
|
5385
|
+
const t = ds(e.speechText);
|
|
5363
5386
|
return {
|
|
5364
5387
|
speechText: e.speechText,
|
|
5365
5388
|
spokenText: t.spokenText,
|
|
5366
|
-
tokens:
|
|
5389
|
+
tokens: Gu(t.spokenText),
|
|
5367
5390
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
|
|
5368
5391
|
boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
|
|
5369
5392
|
unsupportedSemantic: t.unsupportedSemantic,
|
|
@@ -5371,9 +5394,9 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5371
5394
|
};
|
|
5372
5395
|
}, Fn = (e) => {
|
|
5373
5396
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
5374
|
-
const t = e.match(
|
|
5375
|
-
return t?.[0] ?
|
|
5376
|
-
},
|
|
5397
|
+
const t = e.match(ms);
|
|
5398
|
+
return t?.[0] ? ys(t[0]) : null;
|
|
5399
|
+
}, Yu = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Ku = (e, t) => {
|
|
5377
5400
|
const r = e.rawToSpokenOffsetMap.get(t);
|
|
5378
5401
|
if (r !== void 0) return r;
|
|
5379
5402
|
for (let n = t; n < e.speechText.length; n++) {
|
|
@@ -5384,7 +5407,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5384
5407
|
return null;
|
|
5385
5408
|
}, fn = (e, t, r) => {
|
|
5386
5409
|
if (t === null) return null;
|
|
5387
|
-
const n =
|
|
5410
|
+
const n = Yu(e.tokens, t);
|
|
5388
5411
|
return n ? {
|
|
5389
5412
|
token: n,
|
|
5390
5413
|
start: t,
|
|
@@ -5394,9 +5417,9 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5394
5417
|
}, pn = (e, t) => {
|
|
5395
5418
|
const r = Fn(t);
|
|
5396
5419
|
return !!(e && r && e.token.normalized === r);
|
|
5397
|
-
},
|
|
5420
|
+
}, Xu = (e) => {
|
|
5398
5421
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5399
|
-
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = fn(e.tokenization,
|
|
5422
|
+
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = fn(e.tokenization, Ku(e.tokenization, e.position), t), n = fn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5400
5423
|
return pn(r, e.boundaryWord) ? {
|
|
5401
5424
|
...r,
|
|
5402
5425
|
confidence: 1
|
|
@@ -5404,7 +5427,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5404
5427
|
...n,
|
|
5405
5428
|
confidence: 1
|
|
5406
5429
|
} : e.boundaryWord && Fn(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? r || n : n || r;
|
|
5407
|
-
},
|
|
5430
|
+
}, Ju = (e) => {
|
|
5408
5431
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5409
5432
|
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = fn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5410
5433
|
return pn(r, e.boundaryWord) ? {
|
|
@@ -5412,27 +5435,27 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5412
5435
|
confidence: 1
|
|
5413
5436
|
} : e.boundaryWord && Fn(e.boundaryWord) ? null : r;
|
|
5414
5437
|
}, _r = (e) => {
|
|
5415
|
-
const t = Ft({ speechText: e.speechText }), r =
|
|
5438
|
+
const t = Ft({ speechText: e.speechText }), r = Wu(e.mathElement);
|
|
5416
5439
|
return {
|
|
5417
5440
|
speech: t,
|
|
5418
5441
|
math: r,
|
|
5419
|
-
result:
|
|
5442
|
+
result: qu({
|
|
5420
5443
|
speech: t,
|
|
5421
5444
|
math: r
|
|
5422
5445
|
})
|
|
5423
5446
|
};
|
|
5424
|
-
},
|
|
5425
|
-
const r =
|
|
5447
|
+
}, Qu = (e, t) => {
|
|
5448
|
+
const r = Ju({
|
|
5426
5449
|
tokenization: e.speech,
|
|
5427
5450
|
position: t.position,
|
|
5428
5451
|
length: t.length,
|
|
5429
5452
|
boundaryWord: t.boundaryWord
|
|
5430
5453
|
});
|
|
5431
|
-
return
|
|
5454
|
+
return Hu({
|
|
5432
5455
|
alignment: e.result,
|
|
5433
5456
|
boundary: r
|
|
5434
5457
|
});
|
|
5435
|
-
},
|
|
5458
|
+
}, Zu = (e, t) => {
|
|
5436
5459
|
if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
|
|
5437
5460
|
const r = Ft({ speechText: t.boundaryWord }).tokens[0];
|
|
5438
5461
|
if (!r) return null;
|
|
@@ -5441,7 +5464,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5441
5464
|
return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
|
|
5442
5465
|
});
|
|
5443
5466
|
return n.length === 1 ? n[0].target : null;
|
|
5444
|
-
}, gn = "http://www.w3.org/1998/Math/MathML",
|
|
5467
|
+
}, gn = "http://www.w3.org/1998/Math/MathML", ed = /* @__PURE__ */ new Set([
|
|
5445
5468
|
"math",
|
|
5446
5469
|
"maction",
|
|
5447
5470
|
"menclose",
|
|
@@ -5475,7 +5498,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5475
5498
|
"semantics",
|
|
5476
5499
|
"annotation",
|
|
5477
5500
|
"annotation-xml"
|
|
5478
|
-
]),
|
|
5501
|
+
]), td = /* @__PURE__ */ new Set([
|
|
5479
5502
|
"accent",
|
|
5480
5503
|
"accentunder",
|
|
5481
5504
|
"align",
|
|
@@ -5527,44 +5550,44 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5527
5550
|
"width",
|
|
5528
5551
|
"xmlns",
|
|
5529
5552
|
"xml:lang"
|
|
5530
|
-
]),
|
|
5553
|
+
]), bs = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), rd = (e) => bs(e).replace(/"/g, """), nd = (e, t) => {
|
|
5531
5554
|
const r = e.toLowerCase(), n = t.trim().toLowerCase();
|
|
5532
|
-
return !!(r.startsWith("on") || !
|
|
5533
|
-
},
|
|
5555
|
+
return !!(r.startsWith("on") || !td.has(r) || n.includes("javascript:") || n.includes("data:text/html"));
|
|
5556
|
+
}, id = (e) => {
|
|
5534
5557
|
const t = e.localName.toLowerCase();
|
|
5535
|
-
if (!
|
|
5558
|
+
if (!ed.has(t)) return !1;
|
|
5536
5559
|
const r = e.namespaceURI;
|
|
5537
5560
|
return !r || r === gn || r === "http://www.w3.org/1999/xhtml";
|
|
5538
|
-
},
|
|
5539
|
-
if (e.nodeType === Node.TEXT_NODE) return
|
|
5561
|
+
}, _s = (e) => {
|
|
5562
|
+
if (e.nodeType === Node.TEXT_NODE) return bs(e.textContent || "");
|
|
5540
5563
|
if (e.nodeType === Node.COMMENT_NODE) return "";
|
|
5541
5564
|
if (e.nodeType !== Node.ELEMENT_NODE) return null;
|
|
5542
5565
|
const t = e;
|
|
5543
|
-
if (!
|
|
5566
|
+
if (!id(t)) return null;
|
|
5544
5567
|
const r = t.localName.toLowerCase(), n = [];
|
|
5545
5568
|
for (const o of Array.from(t.attributes)) {
|
|
5546
5569
|
const s = o.name.toLowerCase();
|
|
5547
|
-
if (!
|
|
5570
|
+
if (!nd(s, o.value)) {
|
|
5548
5571
|
if (s === "xmlns" && o.value !== gn) return null;
|
|
5549
|
-
n.push(`${s}="${
|
|
5572
|
+
n.push(`${s}="${rd(o.value)}"`);
|
|
5550
5573
|
}
|
|
5551
5574
|
}
|
|
5552
5575
|
r === "math" && !n.some((o) => o.startsWith("xmlns=")) && n.unshift(`xmlns="${gn}"`);
|
|
5553
5576
|
const i = [];
|
|
5554
5577
|
for (const o of Array.from(t.childNodes)) {
|
|
5555
|
-
const s =
|
|
5578
|
+
const s = _s(o);
|
|
5556
5579
|
if (s === null) return null;
|
|
5557
5580
|
i.push(s);
|
|
5558
5581
|
}
|
|
5559
5582
|
return `<${r}${n.length > 0 ? ` ${n.join(" ")}` : ""}>${i.join("")}</${r}>`;
|
|
5560
|
-
},
|
|
5583
|
+
}, od = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, qr = (e) => {
|
|
5561
5584
|
const t = String(e || "").trim();
|
|
5562
5585
|
if (!t) return null;
|
|
5563
|
-
const r =
|
|
5586
|
+
const r = od(t);
|
|
5564
5587
|
if (!r || r.getElementsByTagName("parsererror").length > 0) return null;
|
|
5565
5588
|
const n = r.documentElement;
|
|
5566
|
-
return !n || n.localName.toLowerCase() !== "math" ? null :
|
|
5567
|
-
},
|
|
5589
|
+
return !n || n.localName.toLowerCase() !== "math" ? null : _s(n);
|
|
5590
|
+
}, Ts = (e) => ({
|
|
5568
5591
|
chars: [],
|
|
5569
5592
|
map: /* @__PURE__ */ new Map(),
|
|
5570
5593
|
position: 0,
|
|
@@ -5572,28 +5595,28 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5572
5595
|
lastCharWasWhitespace: !1,
|
|
5573
5596
|
lastMapped: null,
|
|
5574
5597
|
options: e
|
|
5575
|
-
}),
|
|
5598
|
+
}), ws = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Ss = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", ks = (e) => {
|
|
5576
5599
|
const t = e.tagName?.toLowerCase();
|
|
5577
5600
|
return t === "annotation" || t === "annotation-xml";
|
|
5578
|
-
},
|
|
5601
|
+
}, sd = (e) => {
|
|
5579
5602
|
const t = e.getAttribute("data-mathml");
|
|
5580
5603
|
return t && t.trim() ? t : null;
|
|
5581
|
-
},
|
|
5604
|
+
}, ad = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, ld = (e) => {
|
|
5582
5605
|
if (e.tagName.toLowerCase() === "math") return qr(e.outerHTML);
|
|
5583
|
-
const t =
|
|
5606
|
+
const t = sd(e);
|
|
5584
5607
|
if (t) {
|
|
5585
5608
|
const r = qr(t);
|
|
5586
5609
|
if (r) return r;
|
|
5587
5610
|
}
|
|
5588
|
-
if (
|
|
5589
|
-
const r =
|
|
5611
|
+
if (ws(e)) {
|
|
5612
|
+
const r = ad(e);
|
|
5590
5613
|
if (r) {
|
|
5591
5614
|
const n = qr(r);
|
|
5592
5615
|
if (n) return n;
|
|
5593
5616
|
}
|
|
5594
5617
|
}
|
|
5595
5618
|
return null;
|
|
5596
|
-
},
|
|
5619
|
+
}, cd = /* @__PURE__ */ new Set([
|
|
5597
5620
|
"P",
|
|
5598
5621
|
"H1",
|
|
5599
5622
|
"H2",
|
|
@@ -5609,7 +5632,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5609
5632
|
"FIGCAPTION",
|
|
5610
5633
|
"LABEL",
|
|
5611
5634
|
"BUTTON"
|
|
5612
|
-
]),
|
|
5635
|
+
]), ud = /* @__PURE__ */ new Set([
|
|
5613
5636
|
"heading",
|
|
5614
5637
|
"listitem",
|
|
5615
5638
|
"option",
|
|
@@ -5618,24 +5641,24 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5618
5641
|
"cell",
|
|
5619
5642
|
"columnheader",
|
|
5620
5643
|
"rowheader"
|
|
5621
|
-
]),
|
|
5644
|
+
]), dd = (e, t) => {
|
|
5622
5645
|
let r = e.parentElement, n = null;
|
|
5623
5646
|
for (; r && r !== t; ) {
|
|
5624
5647
|
const i = (r.getAttribute("role") || "").toLowerCase(), o = r.tagName.toUpperCase();
|
|
5625
|
-
if (
|
|
5648
|
+
if (cd.has(o) || ud.has(i)) {
|
|
5626
5649
|
n = r;
|
|
5627
5650
|
break;
|
|
5628
5651
|
}
|
|
5629
5652
|
r = r.parentElement;
|
|
5630
5653
|
}
|
|
5631
5654
|
return n || t;
|
|
5632
|
-
},
|
|
5655
|
+
}, hd = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || ws(e), Fe = (e, t, r) => {
|
|
5633
5656
|
/[.,;:!?]/.test(t) && e.chars.length > 0 && e.chars[e.chars.length - 1] === " " && (e.chars.pop(), e.position--, e.map.delete(e.position)), e.chars.push(t), r ? (e.map.set(e.position, r), e.lastMapped = r) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
|
|
5634
|
-
},
|
|
5657
|
+
}, xs = (e, t) => {
|
|
5635
5658
|
if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
|
|
5636
5659
|
const r = e.chars[e.chars.length - 1];
|
|
5637
|
-
return
|
|
5638
|
-
},
|
|
5660
|
+
return is(r, t, e.options);
|
|
5661
|
+
}, Es = (e, t) => {
|
|
5639
5662
|
const r = t.textContent || "";
|
|
5640
5663
|
let n = !1;
|
|
5641
5664
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -5654,7 +5677,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5654
5677
|
}), e.lastCharWasWhitespace = !0;
|
|
5655
5678
|
continue;
|
|
5656
5679
|
}
|
|
5657
|
-
!n &&
|
|
5680
|
+
!n && xs(e, o) && Fe(e, " ", {
|
|
5658
5681
|
node: t,
|
|
5659
5682
|
offset: i
|
|
5660
5683
|
}), Fe(e, o, {
|
|
@@ -5662,7 +5685,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5662
5685
|
offset: i
|
|
5663
5686
|
}), n = !0, e.lastCharWasWhitespace = !1;
|
|
5664
5687
|
}
|
|
5665
|
-
},
|
|
5688
|
+
}, fd = (e, t) => {
|
|
5666
5689
|
for (let r = 0; r < t.text.length; r++) {
|
|
5667
5690
|
const n = t.text[r], i = /\s/.test(n), o = t.map.get(r) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
|
|
5668
5691
|
node: o.node,
|
|
@@ -5679,7 +5702,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5679
5702
|
e.lastCharWasWhitespace || Fe(e, " ", l), e.lastCharWasWhitespace = !0;
|
|
5680
5703
|
continue;
|
|
5681
5704
|
}
|
|
5682
|
-
r === 0 &&
|
|
5705
|
+
r === 0 && xs(e, n) && Fe(e, " ", l), Fe(e, n, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
|
|
5683
5706
|
node: o.node,
|
|
5684
5707
|
offset: o.offset
|
|
5685
5708
|
}), e.lastMapped = {
|
|
@@ -5690,7 +5713,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5690
5713
|
offset: a
|
|
5691
5714
|
});
|
|
5692
5715
|
}
|
|
5693
|
-
},
|
|
5716
|
+
}, pd = (e) => {
|
|
5694
5717
|
if (typeof DOMParser > "u") return "";
|
|
5695
5718
|
const t = new DOMParser().parseFromString(e, "application/xml");
|
|
5696
5719
|
if (t.getElementsByTagName("parsererror").length > 0) return "";
|
|
@@ -5702,38 +5725,38 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5702
5725
|
}
|
|
5703
5726
|
if (i.nodeType !== 1) return;
|
|
5704
5727
|
const o = i;
|
|
5705
|
-
if (!
|
|
5728
|
+
if (!ks(o))
|
|
5706
5729
|
for (const s of Array.from(o.childNodes)) n(s);
|
|
5707
5730
|
};
|
|
5708
5731
|
return n(t.documentElement), W(r.join(" "));
|
|
5709
|
-
},
|
|
5710
|
-
const n =
|
|
5732
|
+
}, gd = (e, t, r) => {
|
|
5733
|
+
const n = Ts(r), i = (a) => {
|
|
5711
5734
|
if (_t(a, e)) return;
|
|
5712
5735
|
if (a.nodeType === 3) {
|
|
5713
|
-
|
|
5736
|
+
Es(n, a);
|
|
5714
5737
|
return;
|
|
5715
5738
|
}
|
|
5716
5739
|
if (a.nodeType !== 1) return;
|
|
5717
5740
|
const l = a;
|
|
5718
|
-
if (!(
|
|
5741
|
+
if (!(Ss(l) || ks(l)))
|
|
5719
5742
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5720
5743
|
};
|
|
5721
|
-
i(e),
|
|
5744
|
+
i(e), As(n);
|
|
5722
5745
|
const o = W(n.chars.join(""));
|
|
5723
5746
|
if (o) return {
|
|
5724
5747
|
text: o,
|
|
5725
5748
|
map: n.map
|
|
5726
5749
|
};
|
|
5727
|
-
const s =
|
|
5750
|
+
const s = pd(t);
|
|
5728
5751
|
return s ? {
|
|
5729
5752
|
text: s,
|
|
5730
5753
|
map: /* @__PURE__ */ new Map()
|
|
5731
5754
|
} : yr(e, r);
|
|
5732
|
-
},
|
|
5755
|
+
}, As = (e) => {
|
|
5733
5756
|
for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
|
|
5734
5757
|
e.chars.pop(), e.position--, e.map.delete(e.position);
|
|
5735
|
-
},
|
|
5736
|
-
const r =
|
|
5758
|
+
}, vd = (e, t) => {
|
|
5759
|
+
const r = Ts(t), n = [];
|
|
5737
5760
|
let i = 0, o, s = !1;
|
|
5738
5761
|
const a = () => {
|
|
5739
5762
|
const u = W(r.chars.slice(i, r.chars.length).join(""));
|
|
@@ -5745,18 +5768,18 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5745
5768
|
}, l = (u) => {
|
|
5746
5769
|
if (_t(u, e)) return;
|
|
5747
5770
|
if (u.nodeType === Node.TEXT_NODE) {
|
|
5748
|
-
const p =
|
|
5749
|
-
o && p !== o && a(), o = p,
|
|
5771
|
+
const p = dd(u, e);
|
|
5772
|
+
o && p !== o && a(), o = p, Es(r, u);
|
|
5750
5773
|
return;
|
|
5751
5774
|
}
|
|
5752
5775
|
if (u.nodeType !== Node.ELEMENT_NODE) return;
|
|
5753
5776
|
const d = u;
|
|
5754
|
-
if (
|
|
5755
|
-
const f =
|
|
5777
|
+
if (Ss(d)) return;
|
|
5778
|
+
const f = ld(d);
|
|
5756
5779
|
if (f) {
|
|
5757
5780
|
a();
|
|
5758
|
-
const p =
|
|
5759
|
-
|
|
5781
|
+
const p = gd(d, f, t);
|
|
5782
|
+
fd(r, p);
|
|
5760
5783
|
const m = W(p.text);
|
|
5761
5784
|
n.push({
|
|
5762
5785
|
type: "math",
|
|
@@ -5769,7 +5792,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5769
5792
|
for (const p of Array.from(d.childNodes)) l(p);
|
|
5770
5793
|
};
|
|
5771
5794
|
for (const u of Array.from(e.childNodes)) l(u);
|
|
5772
|
-
|
|
5795
|
+
As(r), a();
|
|
5773
5796
|
const c = r.chars.join("");
|
|
5774
5797
|
for (; r.map.has(c.length); ) r.map.delete(c.length);
|
|
5775
5798
|
return {
|
|
@@ -5779,7 +5802,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5779
5802
|
containsMathMarkup: s
|
|
5780
5803
|
};
|
|
5781
5804
|
}, Ct = (e, t) => {
|
|
5782
|
-
if (!
|
|
5805
|
+
if (!hd(e)) {
|
|
5783
5806
|
const { text: r, map: n } = yr(e, t);
|
|
5784
5807
|
return {
|
|
5785
5808
|
visibleText: r,
|
|
@@ -5791,8 +5814,8 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5791
5814
|
containsMathMarkup: !1
|
|
5792
5815
|
};
|
|
5793
5816
|
}
|
|
5794
|
-
return
|
|
5795
|
-
},
|
|
5817
|
+
return vd(e, t);
|
|
5818
|
+
}, md = (e, t) => ss([e], t), yd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", bd = /* @__PURE__ */ new Set([
|
|
5796
5819
|
"H1",
|
|
5797
5820
|
"H2",
|
|
5798
5821
|
"H3",
|
|
@@ -5802,17 +5825,17 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5802
5825
|
"LI",
|
|
5803
5826
|
"LABEL",
|
|
5804
5827
|
"BUTTON"
|
|
5805
|
-
]),
|
|
5828
|
+
]), _d = /* @__PURE__ */ new Set([
|
|
5806
5829
|
"heading",
|
|
5807
5830
|
"listitem",
|
|
5808
5831
|
"option",
|
|
5809
5832
|
"radio"
|
|
5810
|
-
]),
|
|
5833
|
+
]), Td = (e) => {
|
|
5811
5834
|
if (e.type !== "text" || !e.sourceElement) return !1;
|
|
5812
5835
|
const t = e.sourceElement.tagName.toUpperCase(), r = (e.sourceElement.getAttribute("role") || "").toLowerCase();
|
|
5813
|
-
return
|
|
5814
|
-
},
|
|
5815
|
-
const t = e.resolveMathSpeech ??
|
|
5836
|
+
return bd.has(t) || _d.has(r);
|
|
5837
|
+
}, wd = async (e) => {
|
|
5838
|
+
const t = e.resolveMathSpeech ?? md, { visibleText: r } = e, n = [];
|
|
5816
5839
|
let i = 0;
|
|
5817
5840
|
const o = (a) => {
|
|
5818
5841
|
const l = W(a), c = r.indexOf(l, i), u = c >= 0 ? c : i, d = u + l.length;
|
|
@@ -5824,7 +5847,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5824
5847
|
for (let a = 0; a < e.chunks.length; a++) {
|
|
5825
5848
|
const l = e.chunks[a];
|
|
5826
5849
|
if (l.type === "text") {
|
|
5827
|
-
const p =
|
|
5850
|
+
const p = Td(l) ? [{
|
|
5828
5851
|
text: l.text,
|
|
5829
5852
|
offset: 0
|
|
5830
5853
|
}] : Wn(l.text, { locale: e.language });
|
|
@@ -5864,12 +5887,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5864
5887
|
}
|
|
5865
5888
|
return {
|
|
5866
5889
|
segments: n,
|
|
5867
|
-
locale:
|
|
5890
|
+
locale: yd(e.language),
|
|
5868
5891
|
visibleText: r,
|
|
5869
5892
|
plainSpeechText: W(s.join(" "))
|
|
5870
5893
|
};
|
|
5871
|
-
},
|
|
5872
|
-
const t = Math.max(1, e.maxEntries ??
|
|
5894
|
+
}, Sd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", kd = "sre-v1", xd = 256, vn = (e) => Array.isArray(e) ? `array:[${e.map(vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${JSON.stringify(t)}:${vn(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)}`, Bi = (e, t, r, n) => `${kd}\0${Sd(e)}\0${t ? "ssml" : "plain"}\0${vn(r ?? null)}\0${n}`, Ed = (e = {}) => {
|
|
5895
|
+
const t = Math.max(1, e.maxEntries ?? xd), r = e.resolve ?? ((o, s) => ss([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
5873
5896
|
for (n.delete(o), n.set(o, s); n.size > t; ) {
|
|
5874
5897
|
const a = n.keys().next().value;
|
|
5875
5898
|
a !== void 0 && n.delete(a);
|
|
@@ -5889,13 +5912,13 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5889
5912
|
usedFallback: d.usedFallback
|
|
5890
5913
|
}), i(c, d), d;
|
|
5891
5914
|
};
|
|
5892
|
-
},
|
|
5915
|
+
}, Ad = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Ft({ speechText: e }).tokens[0]?.normalized || null, Md = (e, t) => {
|
|
5893
5916
|
const r = Ft({ speechText: e.speechText });
|
|
5894
5917
|
if (!Number.isFinite(t.position)) return {
|
|
5895
5918
|
boundary: null,
|
|
5896
5919
|
spokenText: r.spokenText
|
|
5897
5920
|
};
|
|
5898
|
-
const n =
|
|
5921
|
+
const n = Xu({
|
|
5899
5922
|
tokenization: r,
|
|
5900
5923
|
position: t.position,
|
|
5901
5924
|
length: t.length,
|
|
@@ -5908,8 +5931,8 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5908
5931
|
} : null,
|
|
5909
5932
|
spokenText: r.spokenText
|
|
5910
5933
|
};
|
|
5911
|
-
},
|
|
5912
|
-
const r =
|
|
5934
|
+
}, Cd = (e, t, r) => r ? Ft({ speechText: e }).tokens.find((n) => n.start <= t && t < n.end)?.normalized === r : !0, Od = (e, t) => {
|
|
5935
|
+
const r = Ad(t.word);
|
|
5913
5936
|
if (e.id !== t.chunkId) return {
|
|
5914
5937
|
chunkId: t.chunkId,
|
|
5915
5938
|
normalizedWord: r,
|
|
@@ -5928,12 +5951,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5928
5951
|
};
|
|
5929
5952
|
let n, i;
|
|
5930
5953
|
if (e.catalogAlignment)
|
|
5931
|
-
n =
|
|
5954
|
+
n = wu(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
|
|
5932
5955
|
else {
|
|
5933
|
-
const o =
|
|
5956
|
+
const o = Md(e, t);
|
|
5934
5957
|
n = o.boundary, i = o.spokenText;
|
|
5935
5958
|
}
|
|
5936
|
-
return n ?
|
|
5959
|
+
return n ? Cd(i, n.start, r) ? {
|
|
5937
5960
|
chunkId: e.id,
|
|
5938
5961
|
normalizedWord: r,
|
|
5939
5962
|
chunkSpokenStart: n.start,
|
|
@@ -5973,12 +5996,12 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5973
5996
|
quality: "region",
|
|
5974
5997
|
confidence: e.confidence,
|
|
5975
5998
|
reason: e.reason
|
|
5976
|
-
},
|
|
5999
|
+
}, Ms = /* @__PURE__ */ new Map([
|
|
5977
6000
|
["mi", "mjx-mi"],
|
|
5978
6001
|
["mn", "mjx-mn"],
|
|
5979
6002
|
["mo", "mjx-mo"],
|
|
5980
6003
|
["mtext", "mjx-mtext"]
|
|
5981
|
-
]), mn = "mi,mn,mo,mtext",
|
|
6004
|
+
]), mn = "mi,mn,mo,mtext", Cs = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Os = [
|
|
5982
6005
|
"mjx-mfrac",
|
|
5983
6006
|
"mjx-msqrt",
|
|
5984
6007
|
"mjx-mroot",
|
|
@@ -5986,14 +6009,14 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
5986
6009
|
"mjx-munder",
|
|
5987
6010
|
"mjx-mover",
|
|
5988
6011
|
"mjx-munderover"
|
|
5989
|
-
].join(","),
|
|
6012
|
+
].join(","), Is = (e) => e.type === "text-range" ? e.node.parentElement : e.element, Mr = (e) => {
|
|
5990
6013
|
let t = e;
|
|
5991
6014
|
for (; t; ) {
|
|
5992
6015
|
if (t.localName?.toLowerCase() === "mjx-container") return t;
|
|
5993
6016
|
t = t.parentElement;
|
|
5994
6017
|
}
|
|
5995
6018
|
return null;
|
|
5996
|
-
}, Di = (e) => !e || Mr(e) ? !1 : !_t(e),
|
|
6019
|
+
}, Di = (e) => !e || Mr(e) ? !1 : !_t(e), $s = (e) => {
|
|
5997
6020
|
const t = e.getBoundingClientRect?.();
|
|
5998
6021
|
return !!(t && t.width > 0 && t.height > 0);
|
|
5999
6022
|
}, yn = (e) => {
|
|
@@ -6003,38 +6026,38 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6003
6026
|
t = t.parentElement;
|
|
6004
6027
|
}
|
|
6005
6028
|
return null;
|
|
6006
|
-
},
|
|
6029
|
+
}, Rs = (e, t) => {
|
|
6007
6030
|
if (e.length === 0 || e.length !== t.length) return !1;
|
|
6008
6031
|
for (let r = 0; r < e.length; r += 1) {
|
|
6009
|
-
const n =
|
|
6032
|
+
const n = Ms.get(e[r].localName.toLowerCase());
|
|
6010
6033
|
if (!n || t[r].localName.toLowerCase() !== n) return !1;
|
|
6011
6034
|
}
|
|
6012
6035
|
return !0;
|
|
6013
|
-
},
|
|
6014
|
-
if (!e || !
|
|
6036
|
+
}, Id = (e, t) => {
|
|
6037
|
+
if (!e || !Ms.has(e.localName.toLowerCase()) || t.querySelector(Os)) return null;
|
|
6015
6038
|
const r = yn(e), n = t.querySelector("mjx-math");
|
|
6016
6039
|
if (!r || !n) return null;
|
|
6017
6040
|
const i = Array.from(r.querySelectorAll(mn)), o = i.indexOf(e);
|
|
6018
6041
|
if (o < 0) return null;
|
|
6019
|
-
const s = Array.from(n.querySelectorAll(
|
|
6020
|
-
if (
|
|
6042
|
+
const s = Array.from(n.querySelectorAll(Cs));
|
|
6043
|
+
if (!Rs(i, s)) return null;
|
|
6021
6044
|
const a = s[o];
|
|
6022
|
-
return !a ||
|
|
6023
|
-
},
|
|
6045
|
+
return !a || !$s(a) ? null : a;
|
|
6046
|
+
}, $d = (e) => {
|
|
6024
6047
|
const t = Mr(e);
|
|
6025
6048
|
if (t) {
|
|
6026
|
-
if (t.querySelector(
|
|
6049
|
+
if (t.querySelector(Os)) return "expression";
|
|
6027
6050
|
const n = yn(e) ?? e, i = t.querySelector("mjx-math");
|
|
6028
6051
|
if (!i) return "expression";
|
|
6029
|
-
const o = Array.from(n.querySelectorAll(mn)), s = Array.from(i.querySelectorAll(
|
|
6030
|
-
return
|
|
6052
|
+
const o = Array.from(n.querySelectorAll(mn)), s = Array.from(i.querySelectorAll(Cs));
|
|
6053
|
+
return Rs(o, s) && s.some((a) => $s(a)) ? "token" : "expression";
|
|
6031
6054
|
}
|
|
6032
6055
|
const r = yn(e) ?? e;
|
|
6033
6056
|
return Array.from(r.querySelectorAll(mn)).some((n) => !_t(n)) ? "token" : "expression";
|
|
6034
6057
|
}, bn = (e) => {
|
|
6035
|
-
const t =
|
|
6058
|
+
const t = Is(e), r = Mr(t);
|
|
6036
6059
|
if (r) {
|
|
6037
|
-
const n =
|
|
6060
|
+
const n = Id(t, r);
|
|
6038
6061
|
return n ? {
|
|
6039
6062
|
type: "element",
|
|
6040
6063
|
quality: "semantic-token",
|
|
@@ -6056,24 +6079,24 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6056
6079
|
quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
|
|
6057
6080
|
element: e.element
|
|
6058
6081
|
} : null;
|
|
6059
|
-
},
|
|
6082
|
+
}, Rd = bn, Ld = () => {
|
|
6060
6083
|
const e = /* @__PURE__ */ new WeakMap();
|
|
6061
6084
|
return (t) => {
|
|
6062
|
-
const r =
|
|
6085
|
+
const r = Is(t), n = Mr(r);
|
|
6063
6086
|
if (!r || !n) return bn(t);
|
|
6064
6087
|
if (e.has(r)) return e.get(r) ?? null;
|
|
6065
6088
|
const i = bn(t);
|
|
6066
6089
|
return e.set(r, i), i;
|
|
6067
6090
|
};
|
|
6068
|
-
},
|
|
6091
|
+
}, Pd = (e, t, r, n = e.mathAlignments, i = Rd) => {
|
|
6069
6092
|
if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
|
|
6070
6093
|
let o = null;
|
|
6071
6094
|
for (const s of n) {
|
|
6072
|
-
const a =
|
|
6095
|
+
const a = Qu(s.alignment, {
|
|
6073
6096
|
position: t.chunkSpokenStart,
|
|
6074
6097
|
length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
|
|
6075
6098
|
boundaryWord: r.word
|
|
6076
|
-
}) ||
|
|
6099
|
+
}) || Zu(s.alignment, { boundaryWord: r.word });
|
|
6077
6100
|
if (!a) continue;
|
|
6078
6101
|
const l = i(a);
|
|
6079
6102
|
if (l) {
|
|
@@ -6082,7 +6105,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6082
6105
|
}
|
|
6083
6106
|
}
|
|
6084
6107
|
return o;
|
|
6085
|
-
},
|
|
6108
|
+
}, Ls = (e, t, r) => {
|
|
6086
6109
|
if (!e || typeof document > "u" || r <= t) return null;
|
|
6087
6110
|
const n = e.get(t);
|
|
6088
6111
|
let i = e.get(Math.max(t, r - 1));
|
|
@@ -6094,17 +6117,17 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6094
6117
|
} catch {
|
|
6095
6118
|
return null;
|
|
6096
6119
|
}
|
|
6097
|
-
},
|
|
6120
|
+
}, Nd = (e, t) => {
|
|
6098
6121
|
if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
|
|
6099
|
-
const r =
|
|
6122
|
+
const r = Su(e.catalogAlignment, t.chunkSpokenStart);
|
|
6100
6123
|
if (!r) return null;
|
|
6101
|
-
const n =
|
|
6124
|
+
const n = Ls(e.visibleMap, r.start, r.end);
|
|
6102
6125
|
return n ? {
|
|
6103
6126
|
type: "range",
|
|
6104
6127
|
quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
|
|
6105
6128
|
range: n
|
|
6106
6129
|
} : null;
|
|
6107
|
-
},
|
|
6130
|
+
}, zd = (e) => e.regionRange ? {
|
|
6108
6131
|
type: "range",
|
|
6109
6132
|
quality: "region",
|
|
6110
6133
|
range: e.regionRange
|
|
@@ -6116,7 +6139,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6116
6139
|
if (t.length !== 1) return null;
|
|
6117
6140
|
const r = t[0]?.alignment.result.fallbackTarget;
|
|
6118
6141
|
return r ? e.renderedMathTargetResolver(r) : null;
|
|
6119
|
-
},
|
|
6142
|
+
}, Wd = (e, t) => e ? t.mathAlignments.filter(({ element: r }) => {
|
|
6120
6143
|
try {
|
|
6121
6144
|
return e.type === "range" ? e.range.intersectsNode(r) : e.type === "element" ? e.element === r || e.element.contains(r) : e.node.parentElement?.contains(r) || !1;
|
|
6122
6145
|
} catch {
|
|
@@ -6128,18 +6151,18 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6128
6151
|
quality: "region",
|
|
6129
6152
|
confidence: 0,
|
|
6130
6153
|
reason: "boundary chunk id was not found"
|
|
6131
|
-
}), Vi = (e) => e.length === 1 ? e[0].element : null,
|
|
6154
|
+
}), Vi = (e) => e.length === 1 ? e[0].element : null, Hd = (e, t) => t.length > 0 && t.every(({ element: r }) => e.mathCapabilityByElement.get(r) === "token"), Bd = 3, Dd = (e, t, r) => {
|
|
6132
6155
|
if (!t || t.type !== "range") return !1;
|
|
6133
6156
|
const { startContainer: n, endContainer: i } = t.range;
|
|
6134
|
-
return n === i && n.nodeType ===
|
|
6135
|
-
},
|
|
6157
|
+
return n === i && n.nodeType === Bd ? !1 : r.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(n) && o.contains(i));
|
|
6158
|
+
}, Fd = (e, t) => ({
|
|
6136
6159
|
chunk: e,
|
|
6137
|
-
regionTarget:
|
|
6138
|
-
renderedMathTargetResolver:
|
|
6139
|
-
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ?
|
|
6160
|
+
regionTarget: zd(e),
|
|
6161
|
+
renderedMathTargetResolver: Ld(),
|
|
6162
|
+
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ? $d(r) : "expression"])),
|
|
6140
6163
|
heldTokenByElement: /* @__PURE__ */ new Map()
|
|
6141
|
-
}),
|
|
6142
|
-
const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id,
|
|
6164
|
+
}), jd = (e) => {
|
|
6165
|
+
const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id, Fd(n, t)]));
|
|
6143
6166
|
return {
|
|
6144
6167
|
chunks: e.chunks,
|
|
6145
6168
|
resolveInitial(n) {
|
|
@@ -6163,7 +6186,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6163
6186
|
resolveBoundary(n) {
|
|
6164
6187
|
const i = r.get(n.chunkId);
|
|
6165
6188
|
if (!i) return ji();
|
|
6166
|
-
const { chunk: o } = i, s =
|
|
6189
|
+
const { chunk: o } = i, s = Od(o, n), a = Nd(o, s), l = Wd(a, o), c = (!a || l.length > 0 ? Pd(o, s, n, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, d = c && c.quality === "expression" ? c : null;
|
|
6167
6190
|
if (u) {
|
|
6168
6191
|
const f = Vi(l);
|
|
6169
6192
|
return f && i.heldTokenByElement.set(f, u), nt({
|
|
@@ -6174,14 +6197,14 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6174
6197
|
reason: s.reason
|
|
6175
6198
|
});
|
|
6176
6199
|
}
|
|
6177
|
-
if (a && (t ? !
|
|
6200
|
+
if (a && (t ? !Dd(i, a, l) : l.length === 0)) return nt({
|
|
6178
6201
|
semanticTarget: a,
|
|
6179
6202
|
expressionTarget: null,
|
|
6180
6203
|
regionTarget: i.regionTarget,
|
|
6181
6204
|
confidence: s.confidence,
|
|
6182
6205
|
reason: s.reason
|
|
6183
6206
|
});
|
|
6184
|
-
if (
|
|
6207
|
+
if (Hd(i, l)) {
|
|
6185
6208
|
const f = Vi(l), p = f ? i.heldTokenByElement.get(f) ?? null : null;
|
|
6186
6209
|
return nt({
|
|
6187
6210
|
semanticTarget: p,
|
|
@@ -6200,14 +6223,14 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6200
6223
|
});
|
|
6201
6224
|
}
|
|
6202
6225
|
};
|
|
6203
|
-
},
|
|
6226
|
+
}, Vd = (e) => {
|
|
6204
6227
|
if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
|
|
6205
6228
|
const t = e.mathAlignment?.speech.boundaryOffsetSpace;
|
|
6206
6229
|
return t || "plain-spoken-text";
|
|
6207
|
-
},
|
|
6230
|
+
}, qd = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
|
|
6208
6231
|
element: e.sourceElement,
|
|
6209
6232
|
alignment: e.mathAlignment
|
|
6210
|
-
}] : [],
|
|
6233
|
+
}] : [], Ud = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
|
|
6211
6234
|
speechText: e.speechText || "",
|
|
6212
6235
|
visibleText: e.visibleText || e.speechText || "",
|
|
6213
6236
|
sourceElement: e.sourceElement || e.contentRoot,
|
|
@@ -6224,9 +6247,9 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6224
6247
|
regionRange: t.regionRange,
|
|
6225
6248
|
visibleMap: t.visibleMap,
|
|
6226
6249
|
catalogAlignment: t.alignment,
|
|
6227
|
-
mathAlignments:
|
|
6228
|
-
offsetSpace:
|
|
6229
|
-
})),
|
|
6250
|
+
mathAlignments: qd(t),
|
|
6251
|
+
offsetSpace: Vd(t)
|
|
6252
|
+
})), Gd = [
|
|
6230
6253
|
"[data-pie-tts-region]",
|
|
6231
6254
|
"[data-catalog-region]",
|
|
6232
6255
|
"li",
|
|
@@ -6236,18 +6259,18 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6236
6259
|
"[role='group']",
|
|
6237
6260
|
"[role='region']",
|
|
6238
6261
|
"div"
|
|
6239
|
-
].join(","),
|
|
6240
|
-
const r = e.closest(
|
|
6262
|
+
].join(","), Ps = (e, t) => {
|
|
6263
|
+
const r = e.closest(Gd);
|
|
6241
6264
|
return r && t.contains(r) ? r : e;
|
|
6242
|
-
},
|
|
6265
|
+
}, Yd = (e, t, r) => {
|
|
6243
6266
|
const n = /* @__PURE__ */ new Map();
|
|
6244
6267
|
for (let i = t; i < r; i++) {
|
|
6245
6268
|
const o = e.get(i);
|
|
6246
6269
|
o && n.set(i - t, o);
|
|
6247
6270
|
}
|
|
6248
6271
|
return n;
|
|
6249
|
-
},
|
|
6250
|
-
const t = Ct(e.contentRoot, e.textProcessingOptions), r = await
|
|
6272
|
+
}, Kd = async (e) => {
|
|
6273
|
+
const t = Ct(e.contentRoot, e.textProcessingOptions), r = await wd({
|
|
6251
6274
|
chunks: t.chunks,
|
|
6252
6275
|
visibleText: t.visibleText,
|
|
6253
6276
|
language: e.language,
|
|
@@ -6265,8 +6288,8 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6265
6288
|
segment: n,
|
|
6266
6289
|
anchor: {
|
|
6267
6290
|
sourceElement: a,
|
|
6268
|
-
regionElement:
|
|
6269
|
-
visibleMap:
|
|
6291
|
+
regionElement: Ps(a, e.contentRoot),
|
|
6292
|
+
visibleMap: Yd(t.map, n.visibleSpan.start, n.visibleSpan.end)
|
|
6270
6293
|
}
|
|
6271
6294
|
};
|
|
6272
6295
|
}
|
|
@@ -6286,8 +6309,8 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6286
6309
|
containsMathMarkup: t.containsMathMarkup,
|
|
6287
6310
|
visibleText: t.visibleText
|
|
6288
6311
|
};
|
|
6289
|
-
},
|
|
6290
|
-
const r =
|
|
6312
|
+
}, Xd = (e, t) => {
|
|
6313
|
+
const r = fs({
|
|
6291
6314
|
speechText: e.spokenText,
|
|
6292
6315
|
visibleText: e.spokenText
|
|
6293
6316
|
});
|
|
@@ -6296,13 +6319,13 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6296
6319
|
visibleText: e.visibleText,
|
|
6297
6320
|
sourceElement: t.sourceElement,
|
|
6298
6321
|
regionElement: t.regionElement,
|
|
6299
|
-
regionRange:
|
|
6322
|
+
regionRange: Ls(t.visibleMap, 0, e.visibleText.length) ?? void 0,
|
|
6300
6323
|
speechMatchesVisibleText: !0,
|
|
6301
6324
|
playbackMode: r.playbackMode,
|
|
6302
6325
|
alignment: r,
|
|
6303
6326
|
visibleMap: t.visibleMap
|
|
6304
6327
|
};
|
|
6305
|
-
},
|
|
6328
|
+
}, Ns = (e, t) => {
|
|
6306
6329
|
const r = t.sourceElement;
|
|
6307
6330
|
return {
|
|
6308
6331
|
speechText: e.spokenText,
|
|
@@ -6315,7 +6338,7 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6315
6338
|
speechText: e.spokenText
|
|
6316
6339
|
}) : void 0
|
|
6317
6340
|
};
|
|
6318
|
-
},
|
|
6341
|
+
}, Jd = (e, t, r) => {
|
|
6319
6342
|
const n = t.sourceElement;
|
|
6320
6343
|
return {
|
|
6321
6344
|
speechText: r,
|
|
@@ -6327,15 +6350,15 @@ var lu = /* @__PURE__ */ new Set([
|
|
|
6327
6350
|
mathElement: n,
|
|
6328
6351
|
speechText: r
|
|
6329
6352
|
}) : void 0,
|
|
6330
|
-
plainFallback:
|
|
6353
|
+
plainFallback: Ns(e, t)
|
|
6331
6354
|
};
|
|
6332
|
-
},
|
|
6355
|
+
}, Qd = (e, t = {}) => e.items.map(({ segment: r, anchor: n }) => r.kind === "prose" ? Xd(r, n) : t.format === "ssml" && r.ssml ? Jd(r, n, r.ssml) : Ns(r, n)), Zd = "pie-tts-control-handoff", O;
|
|
6333
6356
|
(function(e) {
|
|
6334
6357
|
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
6335
6358
|
})(O || (O = {}));
|
|
6336
|
-
var
|
|
6359
|
+
var eh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, th = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? eh(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, rh = class _n {
|
|
6337
6360
|
constructor() {
|
|
6338
|
-
v(this, "currentProvider", null), v(this, "provider", null), v(this, "highlightCoordinator", null), v(this, "catalogResolver", null), v(this, "state", O.IDLE), v(this, "ttsConfig", {}), v(this, "currentText", null), v(this, "currentContentElement", null), v(this, "normalizedToDOM", /* @__PURE__ */ new Map()), v(this, "listeners", /* @__PURE__ */ new Map()), v(this, "lastError", null), v(this, "speakRunId", 0), v(this, "currentBoundaryOffset", 0), v(this, "seekSegments", []), v(this, "sentenceHighlightSegments", []), v(this, "currentSeekSegmentIndex", 0), v(this, "activeSentenceStartOffset", null), v(this, "activeHighlightMode", "word"), v(this, "lastRenderedRegionTarget", null), v(this, "telemetryReporter", null), v(this, "generatedMathSpeechResolver",
|
|
6361
|
+
v(this, "currentProvider", null), v(this, "provider", null), v(this, "highlightCoordinator", null), v(this, "catalogResolver", null), v(this, "state", O.IDLE), v(this, "ttsConfig", {}), v(this, "currentText", null), v(this, "currentContentElement", null), v(this, "normalizedToDOM", /* @__PURE__ */ new Map()), v(this, "listeners", /* @__PURE__ */ new Map()), v(this, "lastError", null), v(this, "speakRunId", 0), v(this, "currentBoundaryOffset", 0), v(this, "seekSegments", []), v(this, "sentenceHighlightSegments", []), v(this, "currentSeekSegmentIndex", 0), v(this, "activeSentenceStartOffset", null), v(this, "activeHighlightMode", "word"), v(this, "lastRenderedRegionTarget", null), v(this, "telemetryReporter", null), v(this, "generatedMathSpeechResolver", Ed());
|
|
6339
6362
|
}
|
|
6340
6363
|
debugLog(t, r) {
|
|
6341
6364
|
_n.debugEnabled && (r === void 0 ? console.debug(t) : console.debug(t, r));
|
|
@@ -6458,7 +6481,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6458
6481
|
return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
|
|
6459
6482
|
}
|
|
6460
6483
|
isElementHidden(t) {
|
|
6461
|
-
return
|
|
6484
|
+
return ns(t);
|
|
6462
6485
|
}
|
|
6463
6486
|
getBoundaryStrength(t) {
|
|
6464
6487
|
const r = Number(t.getAttribute("data-tts-break-ms"));
|
|
@@ -6710,7 +6733,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6710
6733
|
}
|
|
6711
6734
|
async switchProviderToBrowser(t, r) {
|
|
6712
6735
|
if (!this.currentProvider) return !1;
|
|
6713
|
-
const n = new
|
|
6736
|
+
const n = new es(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = r?.operation || "tts-initialize", a = r?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
|
|
6714
6737
|
textLength: a.length,
|
|
6715
6738
|
textPreview: l.length < a.length ? `${l}…` : l
|
|
6716
6739
|
} : {};
|
|
@@ -6866,7 +6889,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6866
6889
|
const d = u, f = s(d);
|
|
6867
6890
|
if (f) {
|
|
6868
6891
|
o();
|
|
6869
|
-
const p = Ct(d, this.getTextProcessingOptions(r.language)), m = p.visibleText || W(d.textContent || ""), y =
|
|
6892
|
+
const p = Ct(d, this.getTextProcessingOptions(r.language)), m = p.visibleText || W(d.textContent || ""), y = fs({
|
|
6870
6893
|
speechText: f.content,
|
|
6871
6894
|
visibleText: m
|
|
6872
6895
|
}), b = a(d, m), E = b ? _r({
|
|
@@ -6883,7 +6906,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6883
6906
|
speechText: f.content,
|
|
6884
6907
|
visibleText: m,
|
|
6885
6908
|
sourceElement: d,
|
|
6886
|
-
regionElement:
|
|
6909
|
+
regionElement: Ps(d, t),
|
|
6887
6910
|
speechMatchesVisibleText: F === m,
|
|
6888
6911
|
playbackMode: y.playbackMode,
|
|
6889
6912
|
alignment: y,
|
|
@@ -6902,7 +6925,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6902
6925
|
return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
|
|
6903
6926
|
}
|
|
6904
6927
|
async resolveGeneratedSpeechContent(t, r, n) {
|
|
6905
|
-
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await
|
|
6928
|
+
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Kd({
|
|
6906
6929
|
contentRoot: t,
|
|
6907
6930
|
language: n,
|
|
6908
6931
|
mathSpeech: this.getMathSpeechOptions(),
|
|
@@ -6919,7 +6942,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6919
6942
|
containsMathMarkup: !1,
|
|
6920
6943
|
speechMatchesVisibleText: !0
|
|
6921
6944
|
};
|
|
6922
|
-
const c =
|
|
6945
|
+
const c = Qd(o, { format: i }), u = o.plainSpeechText;
|
|
6923
6946
|
return {
|
|
6924
6947
|
contentToSpeak: u,
|
|
6925
6948
|
speechText: u,
|
|
@@ -6992,7 +7015,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6992
7015
|
}
|
|
6993
7016
|
}
|
|
6994
7017
|
highlightRenderableRegionTarget(t) {
|
|
6995
|
-
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !
|
|
7018
|
+
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !th(this.lastRenderedRegionTarget, t))
|
|
6996
7019
|
try {
|
|
6997
7020
|
const r = document.createRange();
|
|
6998
7021
|
if (t.type === "element") r.selectNodeContents(t.element);
|
|
@@ -7043,10 +7066,10 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7043
7066
|
async speakCatalogChunkOnce(t, r) {
|
|
7044
7067
|
if (!this.provider) return;
|
|
7045
7068
|
this.lastRenderedRegionTarget = null;
|
|
7046
|
-
const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ?
|
|
7069
|
+
const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ? Ud({
|
|
7047
7070
|
contentRoot: n,
|
|
7048
7071
|
chunks: [t]
|
|
7049
|
-
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ?
|
|
7072
|
+
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? jd({
|
|
7050
7073
|
chunks: [i],
|
|
7051
7074
|
mathTokenHighlighting: o
|
|
7052
7075
|
}) : null;
|
|
@@ -7157,7 +7180,7 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7157
7180
|
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(O.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
7158
7181
|
}
|
|
7159
7182
|
requestControlHandoff() {
|
|
7160
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
7183
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(Zd, { detail: { source: "host" } }));
|
|
7161
7184
|
}
|
|
7162
7185
|
isPlaying() {
|
|
7163
7186
|
return this.state === O.PLAYING;
|
|
@@ -7228,14 +7251,14 @@ var Xd = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7228
7251
|
});
|
|
7229
7252
|
}
|
|
7230
7253
|
};
|
|
7231
|
-
v(
|
|
7254
|
+
v(rh, "debugEnabled", (() => {
|
|
7232
7255
|
try {
|
|
7233
7256
|
if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
|
|
7234
7257
|
} catch {
|
|
7235
7258
|
}
|
|
7236
7259
|
return globalThis.__PIE_TTS_DEBUG__ === !0;
|
|
7237
7260
|
})());
|
|
7238
|
-
var
|
|
7261
|
+
var Sh = cc({
|
|
7239
7262
|
policy: {
|
|
7240
7263
|
allowed: [],
|
|
7241
7264
|
blocked: []
|
|
@@ -7246,7 +7269,7 @@ var bh = lc({
|
|
|
7246
7269
|
passage: []
|
|
7247
7270
|
},
|
|
7248
7271
|
providers: {}
|
|
7249
|
-
}),
|
|
7272
|
+
}), nh = /* @__PURE__ */ Fo('<div class="pie-tool-line-reader__mask pie-tool-line-reader__mask--top svelte-1a3d6dx" aria-hidden="true"></div> <div class="pie-tool-line-reader__mask pie-tool-line-reader__mask--bottom svelte-1a3d6dx" aria-hidden="true"></div> <div class="pie-tool-line-reader__mask pie-tool-line-reader__mask--left svelte-1a3d6dx" aria-hidden="true"></div> <div class="pie-tool-line-reader__mask pie-tool-line-reader__mask--right svelte-1a3d6dx" aria-hidden="true"></div>', 1), ih = /* @__PURE__ */ Fo('<div class="pie-sr-only svelte-1a3d6dx" role="status" aria-live="polite" aria-atomic="true"> </div> <!> <div role="group" tabindex="0" aria-roledescription="Draggable and resizable reading guide overlay"><div class="pie-tool-line-reader__container svelte-1a3d6dx"></div> <div class="pie-tool-line-reader__resize-handle pie-tool-line-reader__resize-handle--bottom svelte-1a3d6dx" title="Drag to resize height" role="button" tabindex="-1" aria-label="Resize handle - drag to adjust height"><svg width="20" height="8" viewBox="0 0 20 8" aria-hidden="true"><rect x="8" y="3" width="4" height="2" fill="var(--pie-primary, #4CAF50)" rx="1"></rect></svg></div></div>', 1), oh = {
|
|
7250
7273
|
hash: "svelte-1a3d6dx",
|
|
7251
7274
|
code: `.pie-sr-only.svelte-1a3d6dx {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}.pie-tool-line-reader.svelte-1a3d6dx {border:none;cursor:move;overflow:visible;position:absolute;transform:translate(-50%, -50%);user-select:none;pointer-events:auto;touch-action:none;}.pie-tool-line-reader.svelte-1a3d6dx:focus-visible {outline:3px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2));outline-offset:2px;}.pie-tool-line-reader__container.svelte-1a3d6dx {width:100%;height:100%;position:relative;transition:background-color 0.2s ease;}.pie-tool-line-reader__resize-handle.svelte-1a3d6dx {position:absolute;cursor:ns-resize;z-index:10;display:flex;align-items:center;justify-content:center;}.pie-tool-line-reader__resize-handle--bottom.svelte-1a3d6dx {bottom:-12px;left:50%;transform:translateX(-50%);width:44px;height:24px;background-color:color-mix(in srgb, var(--pie-background, #fff) 90%, transparent);border-radius:12px;border:2px solid var(--pie-primary, #4caf50);}.pie-tool-line-reader__resize-handle.svelte-1a3d6dx:hover {background-color:color-mix(in srgb, var(--pie-primary, #4caf50) 20%, transparent);}.pie-tool-line-reader__resize-handle.svelte-1a3d6dx:active {cursor:ns-resize;}.pie-tool-line-reader.svelte-1a3d6dx:active {cursor:grabbing;}
|
|
7252
7275
|
|
|
@@ -7260,8 +7283,8 @@ var bh = lc({
|
|
|
7260
7283
|
|
|
7261
7284
|
/* In masking mode, the window should be transparent to show content underneath */.pie-tool-line-reader.pie-tool-line-reader--masking-mode.svelte-1a3d6dx .pie-tool-line-reader__container:where(.svelte-1a3d6dx) {background-color:transparent !important;}`
|
|
7262
7285
|
};
|
|
7263
|
-
function
|
|
7264
|
-
Zi(t, !0),
|
|
7286
|
+
function sh(e, t) {
|
|
7287
|
+
Zi(t, !0), Pl(e, oh);
|
|
7265
7288
|
let r = Si(t, "visible", 7, !1), n = Si(t, "toolId", 7, "lineReader");
|
|
7266
7289
|
const i = typeof window < "u";
|
|
7267
7290
|
let o = /* @__PURE__ */ z(void 0), s = /* @__PURE__ */ z(null);
|
|
@@ -7304,7 +7327,7 @@ function rh(e, t) {
|
|
|
7304
7327
|
], M = 10, U = 10;
|
|
7305
7328
|
Mt(() => {
|
|
7306
7329
|
if (g(o))
|
|
7307
|
-
return
|
|
7330
|
+
return rc(g(o), (S) => {
|
|
7308
7331
|
$(s, S, !0);
|
|
7309
7332
|
});
|
|
7310
7333
|
});
|
|
@@ -7321,16 +7344,16 @@ function rh(e, t) {
|
|
|
7321
7344
|
function Vt() {
|
|
7322
7345
|
$(E, g(E) === "highlight" ? "obscure" : "highlight", !0), H(`Mode changed to ${g(E) === "highlight" ? "highlight" : "masking"}`);
|
|
7323
7346
|
}
|
|
7324
|
-
function Ns(S) {
|
|
7325
|
-
S.target.closest(".resize-handle") ? Ws(S) : zs(S);
|
|
7326
|
-
}
|
|
7327
7347
|
function zs(S) {
|
|
7348
|
+
S.target.closest(".resize-handle") ? Hs(S) : Ws(S);
|
|
7349
|
+
}
|
|
7350
|
+
function Ws(S) {
|
|
7328
7351
|
g(o) && (g(o).setPointerCapture(S.pointerId), $(l, !0), $(f, {
|
|
7329
7352
|
x: S.clientX - g(u).x,
|
|
7330
7353
|
y: S.clientY - g(u).y
|
|
7331
7354
|
}, !0), g(a)?.bringToFront(g(o)), g(o).addEventListener("pointermove", Cr), g(o).addEventListener("pointerup", Or), S.preventDefault());
|
|
7332
7355
|
}
|
|
7333
|
-
function
|
|
7356
|
+
function Hs(S) {
|
|
7334
7357
|
g(o) && (g(o).setPointerCapture(S.pointerId), $(c, !0), $(p, {
|
|
7335
7358
|
width: g(d).width,
|
|
7336
7359
|
height: g(d).height,
|
|
@@ -7350,7 +7373,7 @@ function rh(e, t) {
|
|
|
7350
7373
|
function Or(S) {
|
|
7351
7374
|
g(o) && (g(o).releasePointerCapture(S.pointerId), g(o).removeEventListener("pointermove", Cr), g(o).removeEventListener("pointerup", Or), $(l, !1), $(c, !1));
|
|
7352
7375
|
}
|
|
7353
|
-
function
|
|
7376
|
+
function Bs(S) {
|
|
7354
7377
|
let D = !1;
|
|
7355
7378
|
switch (S.key) {
|
|
7356
7379
|
case "ArrowUp":
|
|
@@ -7392,15 +7415,15 @@ function rh(e, t) {
|
|
|
7392
7415
|
}
|
|
7393
7416
|
Mt(() => {
|
|
7394
7417
|
g(a) && n() && !g(R) && (g(a).registerTool(n(), "Line Reader", void 0, un.TOOL), $(R, !0));
|
|
7395
|
-
}),
|
|
7418
|
+
}), Rl(() => () => {
|
|
7396
7419
|
g(a) && n() && g(a).unregisterTool(n());
|
|
7397
7420
|
}), Mt(() => {
|
|
7398
7421
|
g(a) && g(o) && n() && g(a).updateToolElement(n(), g(o));
|
|
7399
7422
|
}), Mt(() => {
|
|
7400
7423
|
r() && g(o) && setTimeout(() => g(o)?.focus(), 100);
|
|
7401
7424
|
});
|
|
7402
|
-
let
|
|
7403
|
-
var
|
|
7425
|
+
let Ds = /* @__PURE__ */ si(() => g(y) + Math.round(g(b) * 255).toString(16).padStart(2, "0"));
|
|
7426
|
+
var Fs = {
|
|
7404
7427
|
get visible() {
|
|
7405
7428
|
return r();
|
|
7406
7429
|
},
|
|
@@ -7413,31 +7436,31 @@ function rh(e, t) {
|
|
|
7413
7436
|
set toolId(S = "lineReader") {
|
|
7414
7437
|
n(S), Qr();
|
|
7415
7438
|
}
|
|
7416
|
-
}, jn =
|
|
7417
|
-
var D =
|
|
7439
|
+
}, jn = kl(), js = Rr(jn), Vs = (S) => {
|
|
7440
|
+
var D = ih(), Ir = Rr(D), qs = li(Ir, !0);
|
|
7418
7441
|
ei(Ir);
|
|
7419
|
-
var Vn = wt(Ir, 2),
|
|
7420
|
-
var qt =
|
|
7421
|
-
ci((
|
|
7422
|
-
rt(Un, `height: ${
|
|
7442
|
+
var Vn = wt(Ir, 2), Us = (ye) => {
|
|
7443
|
+
var qt = nh(), Un = Rr(qt), Gn = wt(Un, 2), Yn = wt(Gn, 2), Ys = wt(Yn, 2);
|
|
7444
|
+
ci((Ks, Xs) => {
|
|
7445
|
+
rt(Un, `height: ${Ks ?? ""}px;`), rt(Gn, `top: ${g(u).y + g(d).height / 2}px;`), rt(Yn, `top: ${g(u).y - g(d).height / 2}px; height: ${g(d).height ?? ""}px; width: ${Xs ?? ""}px;`), rt(Ys, `top: ${g(u).y - g(d).height / 2}px; height: ${g(d).height ?? ""}px; left: ${g(u).x + g(d).width / 2}px;`);
|
|
7423
7446
|
}, [() => Math.max(0, g(u).y - g(d).height / 2), () => Math.max(0, g(u).x - g(d).width / 2)]), er(ye, qt);
|
|
7424
7447
|
};
|
|
7425
7448
|
yi(Vn, (ye) => {
|
|
7426
|
-
g(E) === "obscure" && ye(
|
|
7449
|
+
g(E) === "obscure" && ye(Us);
|
|
7427
7450
|
});
|
|
7428
7451
|
var Oe = wt(Vn, 2);
|
|
7429
7452
|
let qn;
|
|
7430
|
-
var
|
|
7431
|
-
Ki(2), ei(Oe),
|
|
7432
|
-
|
|
7433
|
-
}, [() => F.find((ye) => ye.value === g(y))?.name, () => Math.round(g(b) * 100)]), fi("pointerdown", Oe,
|
|
7453
|
+
var Gs = li(Oe);
|
|
7454
|
+
Ki(2), ei(Oe), Ul(Oe, (ye) => $(o, ye), () => g(o)), ci((ye, qt) => {
|
|
7455
|
+
Cl(qs, g(m)), qn = Wl(Oe, 1, "pie-tool-line-reader svelte-1a3d6dx", null, qn, { "pie-tool-line-reader--masking-mode": g(E) === "obscure" }), rt(Oe, `left: ${g(u).x ?? ""}px; top: ${g(u).y ?? ""}px; width: ${g(d).width ?? ""}px; height: ${g(d).height ?? ""}px;`), Fl(Oe, "aria-label", `Line Reader tool. Mode: ${g(E) === "highlight" ? "Highlight" : "Masking"}. Use arrow keys to move, +/- to resize height, C to change color, [ and ] to adjust opacity, M to toggle mode. Current color: ${ye ?? ""}, Opacity: ${qt ?? ""}%`), rt(Gs, `background-color: ${g(Ds) ?? ""};`);
|
|
7456
|
+
}, [() => F.find((ye) => ye.value === g(y))?.name, () => Math.round(g(b) * 100)]), fi("pointerdown", Oe, zs), fi("keydown", Oe, Bs), er(S, D);
|
|
7434
7457
|
};
|
|
7435
|
-
return yi(
|
|
7436
|
-
r() && S(
|
|
7437
|
-
}), er(e, jn), eo(
|
|
7458
|
+
return yi(js, (S) => {
|
|
7459
|
+
r() && S(Vs);
|
|
7460
|
+
}), er(e, jn), eo(Fs);
|
|
7438
7461
|
}
|
|
7439
|
-
|
|
7440
|
-
customElements.define("pie-tool-line-reader",
|
|
7462
|
+
_l(["pointerdown", "keydown"]);
|
|
7463
|
+
customElements.define("pie-tool-line-reader", Xl(sh, {
|
|
7441
7464
|
visible: {
|
|
7442
7465
|
attribute: "visible",
|
|
7443
7466
|
type: "Boolean"
|
|
@@ -7448,7 +7471,7 @@ customElements.define("pie-tool-line-reader", Kl(rh, {
|
|
|
7448
7471
|
}
|
|
7449
7472
|
}, [], [], { mode: "open" }));
|
|
7450
7473
|
export {
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7474
|
+
sh as default,
|
|
7475
|
+
ch as n,
|
|
7476
|
+
lh as t
|
|
7454
7477
|
};
|