@pie-players/pie-tool-text-to-speech 0.3.53 → 0.3.55

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.
@@ -1,5 +1,5 @@
1
1
  import { t as v } from "./defineProperty-Dt7ri80W.js";
2
- var gc = Object.create, ra = Object.defineProperty, mc = Object.getOwnPropertyDescriptor, vc = Object.getOwnPropertyNames, _c = Object.getPrototypeOf, bc = Object.prototype.hasOwnProperty, fg = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), yc = (e, t, n, r) => {
2
+ var gc = Object.create, ra = Object.defineProperty, mc = Object.getOwnPropertyDescriptor, vc = Object.getOwnPropertyNames, _c = Object.getPrototypeOf, bc = Object.prototype.hasOwnProperty, ug = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), yc = (e, t, n, r) => {
3
3
  if (t && typeof t == "object" || typeof t == "function")
4
4
  for (var i = vc(t), o = 0, s = i.length, a; o < s; o++)
5
5
  a = i[o], !bc.call(e, a) && a !== n && ra(e, a, {
@@ -10,16 +10,16 @@ var gc = Object.create, ra = Object.defineProperty, mc = Object.getOwnPropertyDe
10
10
  }, Tc = (e, t, n) => (n = e != null ? gc(_c(e)) : {}, yc(t || !e || !e.__esModule ? ra(n, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
- }) : n, e)), hg = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
13
+ }) : n, e)), dg = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : 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
  });
17
17
  if (typeof window < "u") {
18
- var Yo, Xo;
19
- ((Yo = (Xo = window).__svelte ?? (Xo.__svelte = {})).v ?? (Yo.v = /* @__PURE__ */ new Set())).add("5");
18
+ var Xo, Ko;
19
+ ((Xo = (Ko = window).__svelte ?? (Ko.__svelte = {})).v ?? (Xo.v = /* @__PURE__ */ new Set())).add("5");
20
20
  }
21
21
  var Cn = {}, Q = /* @__PURE__ */ Symbol("uninitialized");
22
- var Sc = Array.isArray, wc = Array.prototype.indexOf, $r = Array.prototype.includes, kc = Array.from, zr = Object.keys, Dr = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, Ec = Object.getOwnPropertyDescriptors, xc = Object.prototype, Ac = Array.prototype, ia = Object.getPrototypeOf, Ko = Object.isExtensible, Cc = () => {
22
+ var Sc = Array.isArray, wc = Array.prototype.indexOf, zr = Array.prototype.includes, kc = Array.from, Dr = Object.keys, Hr = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, Ec = Object.getOwnPropertyDescriptors, xc = Object.prototype, Ac = Array.prototype, ia = Object.getPrototypeOf, Jo = Object.isExtensible, Cc = () => {
23
23
  };
24
24
  function Mc(e) {
25
25
  for (var t = 0; t < e.length; t++) e[t]();
@@ -34,13 +34,13 @@ function oa() {
34
34
  reject: t
35
35
  };
36
36
  }
37
- var pg = 1 << 24, Me = 1024, Le = 2048, on = 4096, po = 8192, Oc = 16384, go = 32768, Jo = 1 << 25, mo = 65536, gg = 1 << 17, mg = 1 << 18, Pn = 1 << 19, Ic = 1 << 20, cr = 65536, Zo = 1 << 21, Rc = 1 << 22, Wr = 1 << 23, rr = /* @__PURE__ */ Symbol("$state"), sa = /* @__PURE__ */ Symbol("legacy props"), Lc = /* @__PURE__ */ Symbol(""), Pc = /* @__PURE__ */ Symbol("proxy path"), Pi = /* @__PURE__ */ Symbol("attributes"), Ni = /* @__PURE__ */ Symbol("class"), $i = /* @__PURE__ */ Symbol("style"), Cr = /* @__PURE__ */ Symbol("text"), aa = /* @__PURE__ */ Symbol("form reset");
38
- var Qr = new class extends Error {
37
+ var fg = 1 << 24, Me = 1024, Le = 2048, on = 4096, go = 8192, Oc = 16384, mo = 32768, Zo = 1 << 25, vo = 65536, hg = 1 << 17, pg = 1 << 18, Nn = 1 << 19, Ic = 1 << 20, cr = 65536, Qo = 1 << 21, Rc = 1 << 22, Wr = 1 << 23, rr = /* @__PURE__ */ Symbol("$state"), sa = /* @__PURE__ */ Symbol("legacy props"), Lc = /* @__PURE__ */ Symbol(""), Nc = /* @__PURE__ */ Symbol("proxy path"), Pi = /* @__PURE__ */ Symbol("attributes"), $i = /* @__PURE__ */ Symbol("class"), zi = /* @__PURE__ */ Symbol("style"), Cr = /* @__PURE__ */ Symbol("text"), aa = /* @__PURE__ */ Symbol("form reset");
38
+ var ei = 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
42
  }(), la = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
43
- function Nc(e) {
43
+ function Pc(e) {
44
44
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
45
45
  }
46
46
  function $c() {
@@ -52,10 +52,10 @@ function zc(e) {
52
52
  function Dc() {
53
53
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
54
54
  }
55
- function Wc(e) {
55
+ function Hc(e) {
56
56
  throw new Error("https://svelte.dev/e/effect_orphan");
57
57
  }
58
- function Hc() {
58
+ function Wc() {
59
59
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
60
60
  }
61
61
  function Fc() {
@@ -79,7 +79,7 @@ function Vc() {
79
79
  function qc() {
80
80
  console.warn("https://svelte.dev/e/derived_inert");
81
81
  }
82
- function ei(e) {
82
+ function ti(e) {
83
83
  console.warn("https://svelte.dev/e/hydration_mismatch");
84
84
  }
85
85
  function Yc() {
@@ -92,20 +92,20 @@ function En(e) {
92
92
  var $;
93
93
  function Oe(e) {
94
94
  if (e === null)
95
- throw ei(), Cn;
95
+ throw ti(), Cn;
96
96
  return $ = e;
97
97
  }
98
- function vo() {
98
+ function _o() {
99
99
  return Oe(/* @__PURE__ */ gt($));
100
100
  }
101
101
  function oe(e) {
102
102
  if (D) {
103
103
  if (/* @__PURE__ */ gt($) !== null)
104
- throw ei(), Cn;
104
+ throw ti(), Cn;
105
105
  $ = e;
106
106
  }
107
107
  }
108
- function zi(e = 1) {
108
+ function Di(e = 1) {
109
109
  if (D) {
110
110
  for (var t = e, n = $; t--; ) n = /* @__PURE__ */ gt(n);
111
111
  $ = n;
@@ -126,7 +126,7 @@ function ca(e = !0) {
126
126
  }
127
127
  function Xc(e) {
128
128
  if (!e || e.nodeType !== 8)
129
- throw ei(), Cn;
129
+ throw ti(), Cn;
130
130
  return e.data;
131
131
  }
132
132
  function ua(e) {
@@ -139,11 +139,11 @@ function da(e) {
139
139
  return !Kc(e, this.v);
140
140
  }
141
141
  var ut = !1, ur = !1;
142
- function Qo(e, t) {
142
+ function es(e, t) {
143
143
  return e.label = t, Jc(e.v, t), e;
144
144
  }
145
145
  function Jc(e, t) {
146
- return e?.[Pc]?.(t), e;
146
+ return e?.[Nc]?.(t), e;
147
147
  }
148
148
  var B = null;
149
149
  function Mn(e) {
@@ -220,7 +220,7 @@ var Qc = ~(Le | on | Me);
220
220
  function V(e, t) {
221
221
  e.f = e.f & Qc | t;
222
222
  }
223
- function _o(e) {
223
+ function bo(e) {
224
224
  (e.f & 512) !== 0 || e.deps === null ? V(e, Me) : V(e, on);
225
225
  }
226
226
  function ma(e) {
@@ -243,7 +243,7 @@ function tu(e) {
243
243
  function _a(e, t) {
244
244
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
245
245
  }
246
- function bo(e, t) {
246
+ function yo(e, t) {
247
247
  _a(e, t), t.add(e);
248
248
  }
249
249
  function A(e, t, n) {
@@ -259,10 +259,10 @@ function E(e, t, n) {
259
259
  function h(e, t) {
260
260
  return e.get(O(e, t));
261
261
  }
262
- var ba, Hr = null, Tn = null, R = null, Di = null, de = null, Wi = null, ir = !1, mi = !1, On = null, Fr = null, ya = 0;
263
- var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), Ur = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Hi = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakSet(), sn = class Ta {
262
+ var ba, Fr = null, Tn = null, R = null, Hi = null, de = null, Wi = null, ir = !1, vi = !1, On = null, Br = null, ya = 0;
263
+ var nu = 1, Ur = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), jr = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Fi = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakSet(), sn = class Ta {
264
264
  constructor() {
265
- bo(this, q), v(this, "id", nu++), A(this, Br, !1), v(this, "linked", !0), A(this, qt, null), A(this, Ut, null), v(this, "async_deriveds", /* @__PURE__ */ new Map()), v(this, "current", /* @__PURE__ */ new Map()), v(this, "previous", /* @__PURE__ */ new Map()), A(this, Ur, /* @__PURE__ */ new Set()), A(this, Tr, /* @__PURE__ */ new Set()), A(this, Sn, 0), A(this, Ft, /* @__PURE__ */ new Map()), A(this, Jn, null), A(this, Ae, []), A(this, Hi, []), A(this, tn, /* @__PURE__ */ new Set()), A(this, ct, /* @__PURE__ */ new Set()), A(this, At, /* @__PURE__ */ new Map()), A(this, Mr, /* @__PURE__ */ new Set()), v(this, "is_fork", !1), A(this, Zn, !1), Tn === null ? Hr = Tn = this : (E(Ut, Tn, this), E(qt, this, Tn)), Tn = this;
265
+ yo(this, q), v(this, "id", nu++), A(this, Ur, !1), v(this, "linked", !0), A(this, qt, null), A(this, Ut, null), v(this, "async_deriveds", /* @__PURE__ */ new Map()), v(this, "current", /* @__PURE__ */ new Map()), v(this, "previous", /* @__PURE__ */ new Map()), A(this, jr, /* @__PURE__ */ new Set()), A(this, Tr, /* @__PURE__ */ new Set()), A(this, Sn, 0), A(this, Ft, /* @__PURE__ */ new Map()), A(this, Jn, null), A(this, Ae, []), A(this, Fi, []), A(this, tn, /* @__PURE__ */ new Set()), A(this, ct, /* @__PURE__ */ new Set()), A(this, At, /* @__PURE__ */ new Map()), A(this, Mr, /* @__PURE__ */ new Set()), v(this, "is_fork", !1), A(this, Zn, !1), Tn === null ? Fr = Tn = this : (E(Ut, Tn, this), E(qt, this, Tn)), Tn = this;
266
266
  }
267
267
  skip_effect(t) {
268
268
  h(At, this).has(t) || h(At, this).set(t, {
@@ -292,17 +292,17 @@ var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
292
292
  }
293
293
  flush() {
294
294
  try {
295
- mi = !0, R = this, O(q, this, jr).call(this);
295
+ vi = !0, R = this, O(q, this, Gr).call(this);
296
296
  } finally {
297
- ya = 0, Wi = null, On = null, Fr = null, mi = !1, R = null, de = null, Kt.clear();
297
+ ya = 0, Wi = null, On = null, Br = null, vi = !1, R = null, de = null, Kt.clear();
298
298
  }
299
299
  }
300
300
  discard() {
301
301
  for (const t of h(Tr, this)) t(this);
302
- h(Tr, this).clear(), O(q, this, Gr).call(this), h(Jn, this)?.resolve();
302
+ h(Tr, this).clear(), O(q, this, Vr).call(this), h(Jn, this)?.resolve();
303
303
  }
304
304
  register_created_effect(t) {
305
- h(Hi, this).push(t);
305
+ h(Fi, this).push(t);
306
306
  }
307
307
  increment(t, n) {
308
308
  if (E(Sn, this, h(Sn, this) + 1), t) {
@@ -325,7 +325,7 @@ var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
325
325
  t.clear(), n.clear();
326
326
  }
327
327
  oncommit(t) {
328
- h(Ur, this).add(t);
328
+ h(jr, this).add(t);
329
329
  }
330
330
  ondiscard(t) {
331
331
  h(Tr, this).add(t);
@@ -336,8 +336,8 @@ var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
336
336
  static ensure() {
337
337
  if (R === null) {
338
338
  const t = R = new Ta();
339
- !mi && !ir && en(() => {
340
- h(Br, t) || t.flush();
339
+ !vi && !ir && en(() => {
340
+ h(Ur, t) || t.flush();
341
341
  });
342
342
  }
343
343
  return R;
@@ -349,7 +349,7 @@ var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
349
349
  }
350
350
  de = /* @__PURE__ */ new Map();
351
351
  for (const [n, [r]] of this.current) de.set(n, r);
352
- for (let n = Hr; n !== null; n = h(Ut, n))
352
+ for (let n = Fr; n !== null; n = h(Ut, n))
353
353
  if (!(n === this || n.is_fork)) {
354
354
  var t = !1;
355
355
  if (n.id < this.id) {
@@ -382,7 +382,7 @@ var nu = 1, Br = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
382
382
  }
383
383
  };
384
384
  ba = sn;
385
- function es() {
385
+ function ts() {
386
386
  if (this.is_fork) return !0;
387
387
  for (const n of h(Ft, this).keys()) {
388
388
  for (var e = n, t = !1; e.parent !== null; ) {
@@ -396,28 +396,28 @@ function es() {
396
396
  }
397
397
  return !1;
398
398
  }
399
- function jr() {
400
- E(Br, this, !0), ya++ > 1e3 && (O(q, this, Gr).call(this), su());
399
+ function Gr() {
400
+ E(Ur, this, !0), ya++ > 1e3 && (O(q, this, Vr).call(this), su());
401
401
  for (const a of h(tn, this))
402
402
  h(ct, this).delete(a), V(a, Le), this.schedule(a);
403
403
  for (const a of h(ct, this))
404
404
  V(a, on), this.schedule(a);
405
405
  const e = h(Ae, this);
406
406
  E(Ae, this, []), this.apply();
407
- var t = On = [], n = [], r = Fr = [];
407
+ var t = On = [], n = [], r = Br = [];
408
408
  for (const a of e) try {
409
409
  O(q, this, Sa).call(this, a, t, n);
410
410
  } catch (l) {
411
- throw Ea(a), O(q, this, es).call(this) || this.discard(), l;
411
+ throw Ea(a), O(q, this, ts).call(this) || this.discard(), l;
412
412
  }
413
413
  if (R = null, r.length > 0) {
414
414
  var i = ba.ensure();
415
415
  for (const a of r) i.schedule(a);
416
416
  }
417
- if (On = null, Fr = null, O(q, this, es).call(this)) {
417
+ if (On = null, Br = null, O(q, this, ts).call(this)) {
418
418
  O(q, this, Qn).call(this, n), O(q, this, Qn).call(this, t);
419
419
  for (const [a, l] of h(At, this)) ka(a, l);
420
- r.length > 0 && O(q, R, jr).call(R);
420
+ r.length > 0 && O(q, R, Gr).call(R);
421
421
  return;
422
422
  }
423
423
  const o = O(q, this, ru).call(this);
@@ -426,14 +426,14 @@ function jr() {
426
426
  return;
427
427
  }
428
428
  h(tn, this).clear(), h(ct, this).clear();
429
- for (const a of h(Ur, this)) a(this);
430
- h(Ur, this).clear(), Di = this, ts(n), ts(t), Di = null, h(Jn, this)?.resolve();
429
+ for (const a of h(jr, this)) a(this);
430
+ h(jr, this).clear(), Hi = this, ns(n), ns(t), Hi = null, h(Jn, this)?.resolve();
431
431
  var s = R;
432
- if (h(Sn, this) === 0 && (h(Ae, this).length === 0 || s !== null) && (O(q, this, Gr).call(this), ut && (O(q, this, ou).call(this), R = s)), h(Ae, this).length > 0) if (s !== null) {
432
+ if (h(Sn, this) === 0 && (h(Ae, this).length === 0 || s !== null) && (O(q, this, Vr).call(this), ut && (O(q, this, ou).call(this), R = s)), h(Ae, this).length > 0) if (s !== null) {
433
433
  const a = s;
434
434
  h(Ae, a).push(...h(Ae, this).filter((l) => !h(Ae, a).includes(l)));
435
435
  } else s = this;
436
- s !== null && O(q, s, jr).call(s);
436
+ s !== null && O(q, s, Gr).call(s);
437
437
  }
438
438
  function Sa(e, t, n) {
439
439
  e.f ^= Me;
@@ -487,13 +487,13 @@ function iu(e) {
487
487
  }
488
488
  };
489
489
  for (const n of this.current.keys()) t(n);
490
- this.oncommit(() => e.discard()), O(q, e, Gr).call(e), R = this, O(q, this, jr).call(this);
490
+ this.oncommit(() => e.discard()), O(q, e, Vr).call(e), R = this, O(q, this, Gr).call(this);
491
491
  }
492
492
  function Qn(e) {
493
493
  for (var t = 0; t < e.length; t += 1) va(e[t], h(tn, this), h(ct, this));
494
494
  }
495
495
  function ou() {
496
- for (let c = Hr; c !== null; c = h(Ut, c)) {
496
+ for (let c = Fr; c !== null; c = h(Ut, c)) {
497
497
  var e = c.id < this.id, t = [];
498
498
  for (const [u, [f, p]] of this.current) {
499
499
  if (c.current.has(u)) {
@@ -507,7 +507,7 @@ function ou() {
507
507
  const p = c.async_deriveds.get(u);
508
508
  p && f.promise.then(p.resolve).catch(p.reject);
509
509
  }
510
- if (h(Br, c)) {
510
+ if (h(Ur, c)) {
511
511
  var r = [...c.current.keys()].filter((u) => !c.current.get(u)[1] && !this.current.has(u));
512
512
  if (r.length === 0)
513
513
  e && c.discard();
@@ -524,7 +524,7 @@ function ou() {
524
524
  return p ? p[0] !== f[0] || p[1] !== f[1] : !0;
525
525
  }).map(([u]) => u);
526
526
  if (a.length > 0)
527
- for (const u of h(Hi, this)) (u.f & 155648) === 0 && yo(u, a, o) && ((u.f & 4194320) !== 0 ? (V(u, Le), c.schedule(u)) : h(tn, c).add(u));
527
+ for (const u of h(Fi, this)) (u.f & 155648) === 0 && To(u, a, o) && ((u.f & 4194320) !== 0 ? (V(u, Le), c.schedule(u)) : h(tn, c).add(u));
528
528
  if (h(Ae, c).length > 0 && !h(Zn, c)) {
529
529
  c.apply();
530
530
  for (var l of h(Ae, c)) O(q, c, Sa).call(c, l, [], []);
@@ -535,10 +535,10 @@ function ou() {
535
535
  }
536
536
  }
537
537
  }
538
- function Gr() {
538
+ function Vr() {
539
539
  if (this.linked) {
540
540
  var e = h(qt, this), t = h(Ut, this);
541
- e === null ? Hr = t : E(Ut, e, t), t === null ? Tn = e : E(qt, t, e), this.linked = !1;
541
+ e === null ? Fr = t : E(Ut, e, t), t === null ? Tn = e : E(qt, t, e), this.linked = !1;
542
542
  }
543
543
  }
544
544
  function er(e) {
@@ -561,13 +561,13 @@ function su() {
561
561
  var t;
562
562
  }
563
563
  try {
564
- Hc();
564
+ Wc();
565
565
  } catch (n) {
566
566
  Ct(n, Wi);
567
567
  }
568
568
  }
569
569
  var qe = null;
570
- function ts(e) {
570
+ function ns(e) {
571
571
  var t = e.length;
572
572
  if (t !== 0) {
573
573
  for (var n = 0; n < t; ) {
@@ -595,20 +595,20 @@ function wa(e, t, n, r) {
595
595
  if (!n.has(e) && (n.add(e), e.reactions !== null))
596
596
  for (const i of e.reactions) {
597
597
  const o = i.f;
598
- (o & 2) !== 0 ? wa(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && yo(i, t, r) && (V(i, Le), To(i));
598
+ (o & 2) !== 0 ? wa(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && To(i, t, r) && (V(i, Le), So(i));
599
599
  }
600
600
  }
601
- function yo(e, t, n) {
601
+ function To(e, t, n) {
602
602
  const r = n.get(e);
603
603
  if (r !== void 0) return r;
604
604
  if (e.deps !== null) for (const i of e.deps) {
605
- if ($r.call(t, i)) return !0;
606
- if ((i.f & 2) !== 0 && yo(i, t, n))
605
+ if (zr.call(t, i)) return !0;
606
+ if ((i.f & 2) !== 0 && To(i, t, n))
607
607
  return n.set(i, !0), !0;
608
608
  }
609
609
  return n.set(e, !1), !1;
610
610
  }
611
- function To(e) {
611
+ function So(e) {
612
612
  R.schedule(e);
613
613
  }
614
614
  function ka(e, t) {
@@ -626,38 +626,38 @@ function Ea(e) {
626
626
  function au(e) {
627
627
  let t = 0, n = fr(0), r;
628
628
  return () => {
629
- Eo() && (y(n), xo(() => (t === 0 && (r = ni(() => e(() => or(n)))), t += 1, () => {
629
+ xo() && (y(n), Ao(() => (t === 0 && (r = ri(() => e(() => or(n)))), t += 1, () => {
630
630
  en(() => {
631
631
  t -= 1, t === 0 && (r?.(), r = void 0, or(n));
632
632
  });
633
633
  })));
634
634
  };
635
635
  }
636
- var lu = mo | Pn;
636
+ var lu = vo | Nn;
637
637
  function cu(e, t, n, r) {
638
638
  new uu(e, t, n, r);
639
639
  }
640
- var He = /* @__PURE__ */ new WeakMap(), Fi = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Ui = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), ns = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakSet(), uu = class {
640
+ var We = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(), Ui = /* @__PURE__ */ new WeakMap(), ji = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), rs = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakSet(), uu = class {
641
641
  constructor(e, t, n, r) {
642
- bo(this, ae), v(this, "parent", void 0), v(this, "is_pending", !1), v(this, "transform_error", void 0), A(this, He, void 0), A(this, Fi, D ? $ : null), A(this, Ye, void 0), A(this, sr, void 0), A(this, Ce, void 0), A(this, Xe, null), A(this, _e, null), A(this, De, null), A(this, Yt, null), A(this, wn, 0), A(this, Xt, 0), A(this, Sr, !1), A(this, Bi, /* @__PURE__ */ new Set()), A(this, Ui, /* @__PURE__ */ new Set()), A(this, Wt, null), A(this, ns, au(() => (E(Wt, this, fr(h(wn, this))), () => {
643
- E(Wt, this, null);
644
- }))), E(He, this, e), E(Ye, this, t), E(sr, this, (i) => {
642
+ yo(this, ae), v(this, "parent", void 0), v(this, "is_pending", !1), v(this, "transform_error", void 0), A(this, We, void 0), A(this, Bi, D ? $ : null), A(this, Ye, void 0), A(this, sr, void 0), A(this, Ce, void 0), A(this, Xe, null), A(this, _e, null), A(this, De, null), A(this, Yt, null), A(this, wn, 0), A(this, Xt, 0), A(this, Sr, !1), A(this, Ui, /* @__PURE__ */ new Set()), A(this, ji, /* @__PURE__ */ new Set()), A(this, Ht, null), A(this, rs, au(() => (E(Ht, this, fr(h(wn, this))), () => {
643
+ E(Ht, this, null);
644
+ }))), E(We, this, e), E(Ye, this, t), E(sr, this, (i) => {
645
645
  var o = C;
646
646
  o.b = this, o.f |= 128, n(i);
647
- }), this.parent = C.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), E(Ce, this, Ha(() => {
647
+ }), this.parent = C.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), E(Ce, this, Wa(() => {
648
648
  if (D) {
649
- const i = h(Fi, this);
650
- vo();
649
+ const i = h(Bi, this);
650
+ _o();
651
651
  const o = i.data === "[!";
652
652
  if (i.data.startsWith("[?")) {
653
653
  const s = JSON.parse(i.data.slice(2));
654
654
  O(ae, this, fu).call(this, s);
655
655
  } else o ? O(ae, this, hu).call(this) : O(ae, this, du).call(this);
656
656
  } else O(ae, this, xa).call(this);
657
- }, lu)), D && E(He, this, $);
657
+ }, lu)), D && E(We, this, $);
658
658
  }
659
659
  defer_effect(e) {
660
- va(e, h(Bi, this), h(Ui, this));
660
+ va(e, h(Ui, this), h(ji, this));
661
661
  }
662
662
  is_rendered() {
663
663
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
@@ -666,23 +666,23 @@ var He = /* @__PURE__ */ new WeakMap(), Fi = /* @__PURE__ */ new WeakMap(), Ye =
666
666
  return !!h(Ye, this).pending;
667
667
  }
668
668
  update_pending_count(e, t) {
669
- O(ae, this, Aa).call(this, e, t), E(wn, this, h(wn, this) + e), !(!h(Wt, this) || h(Sr, this)) && (E(Sr, this, !0), en(() => {
670
- E(Sr, this, !1), h(Wt, this) && Yr(h(Wt, this), h(wn, this));
669
+ O(ae, this, Aa).call(this, e, t), E(wn, this, h(wn, this) + e), !(!h(Ht, this) || h(Sr, this)) && (E(Sr, this, !0), en(() => {
670
+ E(Sr, this, !1), h(Ht, this) && Xr(h(Ht, this), h(wn, this));
671
671
  }));
672
672
  }
673
673
  get_effect_pending() {
674
- return h(ns, this).call(this), y(h(Wt, this));
674
+ return h(rs, this).call(this), y(h(Ht, this));
675
675
  }
676
676
  error(e) {
677
677
  if (!h(Ye, this).onerror && !h(Ye, this).failed) throw e;
678
678
  R?.is_fork ? (h(Xe, this) && R.skip_effect(h(Xe, this)), h(_e, this) && R.skip_effect(h(_e, this)), h(De, this) && R.skip_effect(h(De, this)), R.oncommit(() => {
679
- O(ae, this, rs).call(this, e);
680
- })) : O(ae, this, rs).call(this, e);
679
+ O(ae, this, is).call(this, e);
680
+ })) : O(ae, this, is).call(this, e);
681
681
  }
682
682
  };
683
683
  function du() {
684
684
  try {
685
- E(Xe, this, dt(() => h(sr, this).call(this, h(He, this))));
685
+ E(Xe, this, dt(() => h(sr, this).call(this, h(We, this))));
686
686
  } catch (e) {
687
687
  this.error(e);
688
688
  }
@@ -690,37 +690,37 @@ function du() {
690
690
  function fu(e) {
691
691
  const t = h(Ye, this).failed;
692
692
  t && E(De, this, dt(() => {
693
- t(h(He, this), () => e, () => () => {
693
+ t(h(We, this), () => e, () => () => {
694
694
  });
695
695
  }));
696
696
  }
697
697
  function hu() {
698
698
  const e = h(Ye, this).pending;
699
- e && (this.is_pending = !0, E(_e, this, dt(() => e(h(He, this)))), en(() => {
699
+ e && (this.is_pending = !0, E(_e, this, dt(() => e(h(We, this)))), en(() => {
700
700
  var t = E(Yt, this, document.createDocumentFragment()), n = Be();
701
- t.append(n), E(Xe, this, O(ae, this, ji).call(this, () => dt(() => h(sr, this).call(this, n)))), h(Xt, this) === 0 && (h(He, this).before(t), E(Yt, this, null), hr(h(_e, this), () => {
701
+ t.append(n), E(Xe, this, O(ae, this, Gi).call(this, () => dt(() => h(sr, this).call(this, n)))), h(Xt, this) === 0 && (h(We, this).before(t), E(Yt, this, null), hr(h(_e, this), () => {
702
702
  E(_e, this, null);
703
- }), O(ae, this, So).call(this, R));
703
+ }), O(ae, this, wo).call(this, R));
704
704
  }));
705
705
  }
706
706
  function xa() {
707
707
  try {
708
708
  if (this.is_pending = this.has_pending_snippet(), E(Xt, this, 0), E(wn, this, 0), E(Xe, this, dt(() => {
709
- h(sr, this).call(this, h(He, this));
709
+ h(sr, this).call(this, h(We, this));
710
710
  })), h(Xt, this) > 0) {
711
711
  var e = E(Yt, this, document.createDocumentFragment());
712
712
  Ga(h(Xe, this), e);
713
713
  const t = h(Ye, this).pending;
714
- E(_e, this, dt(() => t(h(He, this))));
715
- } else O(ae, this, So).call(this, R);
714
+ E(_e, this, dt(() => t(h(We, this))));
715
+ } else O(ae, this, wo).call(this, R);
716
716
  } catch (t) {
717
717
  this.error(t);
718
718
  }
719
719
  }
720
- function So(e) {
721
- this.is_pending = !1, e.transfer_effects(h(Bi, this), h(Ui, this));
720
+ function wo(e) {
721
+ this.is_pending = !1, e.transfer_effects(h(Ui, this), h(ji, this));
722
722
  }
723
- function ji(e) {
723
+ function Gi(e) {
724
724
  var t = C, n = L, r = B;
725
725
  Ke(h(Ce, this)), Ie(h(Ce, this)), Mn(h(Ce, this).ctx);
726
726
  try {
@@ -739,12 +739,12 @@ function Aa(e, t) {
739
739
  }
740
740
  return;
741
741
  }
742
- E(Xt, this, h(Xt, this) + e), h(Xt, this) === 0 && (O(ae, this, So).call(this, t), h(_e, this) && hr(h(_e, this), () => {
742
+ E(Xt, this, h(Xt, this) + e), h(Xt, this) === 0 && (O(ae, this, wo).call(this, t), h(_e, this) && hr(h(_e, this), () => {
743
743
  E(_e, this, null);
744
- }), h(Yt, this) && (h(He, this).before(h(Yt, this)), E(Yt, this, null)));
744
+ }), h(Yt, this) && (h(We, this).before(h(Yt, this)), E(Yt, this, null)));
745
745
  }
746
- function rs(e) {
747
- h(Xe, this) && (ge(h(Xe, this)), E(Xe, this, null)), h(_e, this) && (ge(h(_e, this)), E(_e, this, null)), h(De, this) && (ge(h(De, this)), E(De, this, null)), D && (Oe(h(Fi, this)), zi(), Oe(ca()));
746
+ function is(e) {
747
+ h(Xe, this) && (ge(h(Xe, this)), E(Xe, this, null)), h(_e, this) && (ge(h(_e, this)), E(_e, this, null)), h(De, this) && (ge(h(De, this)), E(De, this, null)), D && (Oe(h(Bi, this)), Di(), Oe(ca()));
748
748
  var t = h(Ye, this).onerror;
749
749
  let n = h(Ye, this).failed;
750
750
  var r = !1, i = !1;
@@ -755,7 +755,7 @@ function rs(e) {
755
755
  }
756
756
  r = !0, i && Vc(), h(De, this) !== null && hr(h(De, this), () => {
757
757
  E(De, this, null);
758
- }), O(ae, this, ji).call(this, () => {
758
+ }), O(ae, this, Gi).call(this, () => {
759
759
  O(ae, this, xa).call(this);
760
760
  });
761
761
  }, s = (a) => {
@@ -764,11 +764,11 @@ function rs(e) {
764
764
  } catch (l) {
765
765
  Ct(l, h(Ce, this) && h(Ce, this).parent);
766
766
  }
767
- n && E(De, this, O(ae, this, ji).call(this, () => {
767
+ n && E(De, this, O(ae, this, Gi).call(this, () => {
768
768
  try {
769
769
  return dt(() => {
770
770
  var l = C;
771
- l.b = this, l.f |= 128, n(h(He, this), () => a, () => o);
771
+ l.b = this, l.f |= 128, n(h(We, this), () => a, () => o);
772
772
  });
773
773
  } catch (l) {
774
774
  return Ct(l, h(Ce, this).parent), null;
@@ -802,7 +802,7 @@ function pu(e, t, n, r) {
802
802
  } catch (g) {
803
803
  Ct(g, s);
804
804
  }
805
- Vr();
805
+ qr();
806
806
  }
807
807
  }
808
808
  var u = Ca();
@@ -814,7 +814,7 @@ function pu(e, t, n, r) {
814
814
  Promise.all(n.map((p) => /* @__PURE__ */ mu(p))).then((p) => c([...t.map(i), ...p])).catch((p) => Ct(p, s)).finally(u);
815
815
  }
816
816
  l ? l.then(() => {
817
- a(), f(), Vr();
817
+ a(), f(), qr();
818
818
  }) : f();
819
819
  }
820
820
  function gu() {
@@ -824,7 +824,7 @@ function gu() {
824
824
  Ke(e), Ie(t), Mn(n), s && (e.f & 16384) === 0 && (r?.activate(), r?.apply());
825
825
  };
826
826
  }
827
- function Vr(e = !0) {
827
+ function qr(e = !0) {
828
828
  Ke(null), Ie(null), Mn(null), e && R?.deactivate();
829
829
  }
830
830
  function Ca() {
@@ -836,7 +836,7 @@ function Ca() {
836
836
  // @__NO_SIDE_EFFECTS__
837
837
  function ar(e) {
838
838
  var t = 2 | Le;
839
- return C !== null && (C.f |= Pn), {
839
+ return C !== null && (C.f |= Nn), {
840
840
  ctx: B,
841
841
  deps: null,
842
842
  effects: null,
@@ -862,10 +862,10 @@ function mu(e, t, n) {
862
862
  i = c.promise;
863
863
  try {
864
864
  Promise.resolve(e()).then(c.resolve, (g) => {
865
- g !== Qr && c.reject(g);
866
- }).finally(Vr);
865
+ g !== ei && c.reject(g);
866
+ }).finally(qr);
867
867
  } catch (g) {
868
- c.reject(g), Vr();
868
+ c.reject(g), qr();
869
869
  }
870
870
  var u = R;
871
871
  if (s) {
@@ -875,7 +875,7 @@ function mu(e, t, n) {
875
875
  a.add(c), u.async_deriveds.set(l, c);
876
876
  }
877
877
  const p = (g, m = void 0) => {
878
- f?.(), a.delete(c), m !== wr && (u.activate(), m ? (o.f |= Wr, Yr(o, m)) : ((o.f & 8388608) !== 0 && (o.f ^= Wr), Yr(o, g)), u.deactivate());
878
+ f?.(), a.delete(c), m !== wr && (u.activate(), m ? (o.f |= Wr, Xr(o, m)) : ((o.f & 8388608) !== 0 && (o.f ^= Wr), Xr(o, g)), u.deactivate());
879
879
  };
880
880
  c.promise.then(p, (g) => p(null, g || "unknown"));
881
881
  }), Ou(() => {
@@ -907,7 +907,7 @@ function _u(e) {
907
907
  for (var n = 0; n < t.length; n += 1) ge(t[n]);
908
908
  }
909
909
  }
910
- function wo(e) {
910
+ function ko(e) {
911
911
  var t, n = C, r = e.parent;
912
912
  if (!ft && r !== null && e.v !== Q && (r.f & 24576) !== 0)
913
913
  return qc(), e.v;
@@ -920,22 +920,22 @@ function wo(e) {
920
920
  return t;
921
921
  }
922
922
  function Oa(e) {
923
- var t = wo(e);
924
- if (!e.equals(t) && (e.wv = Ya(), (!R?.is_fork || e.deps === null) && (R !== null ? (R.capture(e, t, !0), Di?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
923
+ var t = ko(e);
924
+ if (!e.equals(t) && (e.wv = Ya(), (!R?.is_fork || e.deps === null) && (R !== null ? (R.capture(e, t, !0), Hi?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
925
925
  V(e, Me);
926
926
  return;
927
927
  }
928
- ft || (de !== null ? (Eo() || R?.is_fork) && de.set(e, t) : _o(e));
928
+ ft || (de !== null ? (xo() || R?.is_fork) && de.set(e, t) : bo(e));
929
929
  }
930
930
  function bu(e) {
931
931
  if (e.effects !== null)
932
- for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Qr), t.fn !== null && (t.teardown = Cc), t.ac = null, lr(t, 0), Ao(t));
932
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(ei), t.fn !== null && (t.teardown = Cc), t.ac = null, lr(t, 0), Co(t));
933
933
  }
934
934
  function Ia(e) {
935
935
  if (e.effects !== null)
936
936
  for (const t of e.effects) t.teardown && t.fn !== null && Rn(t);
937
937
  }
938
- var qr = /* @__PURE__ */ new Set(), Kt = /* @__PURE__ */ new Map();
938
+ var Yr = /* @__PURE__ */ new Set(), Kt = /* @__PURE__ */ new Map();
939
939
  var Ra = !1;
940
940
  function fr(e, t) {
941
941
  var n = {
@@ -962,26 +962,26 @@ function yu(e, t = !1, n = !0) {
962
962
  }
963
963
  return r;
964
964
  }
965
- function P(e, t, n = !1) {
966
- L !== null && (!We || (L.f & 131072) !== 0) && dr() && (L.f & 4325394) !== 0 && (Fe === null || !Fe.has(e)) && Gc();
965
+ function N(e, t, n = !1) {
966
+ L !== null && (!He || (L.f & 131072) !== 0) && dr() && (L.f & 4325394) !== 0 && (Fe === null || !Fe.has(e)) && Gc();
967
967
  let r = n ? Mt(t) : t;
968
- return Yr(e, r, Fr);
968
+ return Xr(e, r, Br);
969
969
  }
970
- function Yr(e, t, n = null) {
970
+ function Xr(e, t, n = null) {
971
971
  if (!e.equals(t)) {
972
972
  Kt.set(e, ft ? t : e.v);
973
973
  var r = sn.ensure();
974
974
  if (r.capture(e, t), (e.f & 2) !== 0) {
975
975
  const i = e;
976
- (e.f & 2048) !== 0 && wo(i), de === null && _o(i);
976
+ (e.f & 2048) !== 0 && ko(i), de === null && bo(i);
977
977
  }
978
- e.wv = Ya(), La(e, Le, n), dr() && C !== null && (C.f & 1024) !== 0 && (C.f & 96) === 0 && (xe === null ? zu([e]) : xe.push(e)), !r.is_fork && qr.size > 0 && !Ra && Tu();
978
+ e.wv = Ya(), La(e, Le, n), dr() && C !== null && (C.f & 1024) !== 0 && (C.f & 96) === 0 && (xe === null ? zu([e]) : xe.push(e)), !r.is_fork && Yr.size > 0 && !Ra && Tu();
979
979
  }
980
980
  return t;
981
981
  }
982
982
  function Tu() {
983
983
  Ra = !1;
984
- for (const e of qr) {
984
+ for (const e of Yr) {
985
985
  (e.f & 1024) !== 0 && V(e, on);
986
986
  let t;
987
987
  try {
@@ -991,10 +991,10 @@ function Tu() {
991
991
  }
992
992
  t && Rn(e);
993
993
  }
994
- qr.clear();
994
+ Yr.clear();
995
995
  }
996
996
  function or(e) {
997
- P(e, e.v + 1);
997
+ N(e, e.v + 1);
998
998
  }
999
999
  function La(e, t, n) {
1000
1000
  var r = e.reactions;
@@ -1003,13 +1003,13 @@ function La(e, t, n) {
1003
1003
  var a = r[s], l = a.f;
1004
1004
  if (!(!i && a === C)) {
1005
1005
  var c = (l & Le) === 0;
1006
- if (c && V(a, t), (l & 131072) !== 0) qr.add(a);
1006
+ if (c && V(a, t), (l & 131072) !== 0) Yr.add(a);
1007
1007
  else if ((l & 2) !== 0) {
1008
1008
  var u = a;
1009
1009
  de?.delete(u), (l & 65536) === 0 && (l & 512 && (C === null || (C.f & 2097152) === 0) && (a.f |= cr), La(u, on, n));
1010
1010
  } else if (c) {
1011
1011
  var f = a;
1012
- (l & 16) !== 0 && qe !== null && qe.add(f), n !== null ? n.push(f) : To(f);
1012
+ (l & 16) !== 0 && qe !== null && qe.add(f), n !== null ? n.push(f) : So(f);
1013
1013
  }
1014
1014
  }
1015
1015
  }
@@ -1022,17 +1022,17 @@ function Mt(e) {
1022
1022
  var n = /* @__PURE__ */ new Map(), r = Sc(e), i = /* @__PURE__ */ Y(0), o = null, s = Jt, a = (f) => {
1023
1023
  if (Jt === s) return f();
1024
1024
  var p = L, g = Jt;
1025
- Ie(null), cs(s);
1025
+ Ie(null), us(s);
1026
1026
  var m = f();
1027
- return Ie(p), cs(g), m;
1027
+ return Ie(p), us(g), m;
1028
1028
  };
1029
1029
  r && n.set("length", /* @__PURE__ */ Y(e.length, o));
1030
1030
  var l = "";
1031
1031
  let c = !1;
1032
1032
  function u(f) {
1033
1033
  if (!c) {
1034
- c = !0, l = f, Qo(i, `${l} version`);
1035
- for (const [p, g] of n) Qo(g, wu(l, p));
1034
+ c = !0, l = f, es(i, `${l} version`);
1035
+ for (const [p, g] of n) es(g, wu(l, p));
1036
1036
  c = !1;
1037
1037
  }
1038
1038
  }
@@ -1043,7 +1043,7 @@ function Mt(e) {
1043
1043
  return m === void 0 ? a(() => {
1044
1044
  var b = /* @__PURE__ */ Y(g.value, o);
1045
1045
  return n.set(p, b), b;
1046
- }) : P(m, g.value, !0), !0;
1046
+ }) : N(m, g.value, !0), !0;
1047
1047
  },
1048
1048
  deleteProperty(f, p) {
1049
1049
  var g = n.get(p);
@@ -1053,7 +1053,7 @@ function Mt(e) {
1053
1053
  n.set(p, m), or(i);
1054
1054
  }
1055
1055
  } else
1056
- P(g, Q), or(i);
1056
+ N(g, Q), or(i);
1057
1057
  return !0;
1058
1058
  },
1059
1059
  get(f, p, g) {
@@ -1095,21 +1095,21 @@ function Mt(e) {
1095
1095
  set(f, p, g, m) {
1096
1096
  var b = n.get(p), T = p in f;
1097
1097
  if (r && p === "length") for (var I = g; I < b.v; I += 1) {
1098
- var W = n.get(I + "");
1099
- W !== void 0 ? P(W, Q) : I in f && (W = a(() => /* @__PURE__ */ Y(Q, o)), n.set(I + "", W));
1098
+ var H = n.get(I + "");
1099
+ H !== void 0 ? N(H, Q) : I in f && (H = a(() => /* @__PURE__ */ Y(Q, o)), n.set(I + "", H));
1100
1100
  }
1101
1101
  if (b === void 0)
1102
- (!T || Vt(f, p)?.writable) && (b = a(() => /* @__PURE__ */ Y(void 0, o)), P(b, Mt(g)), n.set(p, b));
1102
+ (!T || Vt(f, p)?.writable) && (b = a(() => /* @__PURE__ */ Y(void 0, o)), N(b, Mt(g)), n.set(p, b));
1103
1103
  else {
1104
1104
  T = b.v !== Q;
1105
1105
  var J = a(() => Mt(g));
1106
- P(b, J);
1106
+ N(b, J);
1107
1107
  }
1108
1108
  var w = Reflect.getOwnPropertyDescriptor(f, p);
1109
1109
  if (w?.set && w.set.call(m, g), !T) {
1110
1110
  if (r && typeof p == "string") {
1111
1111
  var X = n.get("length"), le = Number(p);
1112
- Number.isInteger(le) && le >= X.v && P(X, le + 1);
1112
+ Number.isInteger(le) && le >= X.v && N(X, le + 1);
1113
1113
  }
1114
1114
  or(i);
1115
1115
  }
@@ -1132,12 +1132,12 @@ function Mt(e) {
1132
1132
  function wu(e, t) {
1133
1133
  return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : Su.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1134
1134
  }
1135
- var is, ku, Pa, Na, $a;
1136
- function Gi() {
1137
- if (is === void 0) {
1138
- is = window, ku = document, Pa = /Firefox/.test(navigator.userAgent);
1135
+ var os, ku, Na, Pa, $a;
1136
+ function Vi() {
1137
+ if (os === void 0) {
1138
+ os = window, ku = document, Na = /Firefox/.test(navigator.userAgent);
1139
1139
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1140
- Na = Vt(t, "firstChild").get, $a = Vt(t, "nextSibling").get, Ko(e) && (e[Ni] = void 0, e[Pi] = null, e[$i] = void 0, e.__e = void 0), Ko(n) && (n[Cr] = void 0);
1140
+ Pa = Vt(t, "firstChild").get, $a = Vt(t, "nextSibling").get, Jo(e) && (e[$i] = void 0, e[Pi] = null, e[zi] = void 0, e.__e = void 0), Jo(n) && (n[Cr] = void 0);
1141
1141
  }
1142
1142
  }
1143
1143
  function Be(e = "") {
@@ -1145,7 +1145,7 @@ function Be(e = "") {
1145
1145
  }
1146
1146
  // @__NO_SIDE_EFFECTS__
1147
1147
  function In(e) {
1148
- return Na.call(e);
1148
+ return Pa.call(e);
1149
1149
  }
1150
1150
  // @__NO_SIDE_EFFECTS__
1151
1151
  function gt(e) {
@@ -1159,9 +1159,9 @@ function se(e, t) {
1159
1159
  var r = Be();
1160
1160
  return n?.before(r), Oe(r), r;
1161
1161
  }
1162
- return t && ti(n), Oe(n), n;
1162
+ return t && ni(n), Oe(n), n;
1163
1163
  }
1164
- function os(e, t = !1) {
1164
+ function ss(e, t = !1) {
1165
1165
  if (!D) {
1166
1166
  var n = /* @__PURE__ */ In(e);
1167
1167
  return n instanceof Comment && n.data === "" ? /* @__PURE__ */ gt(n) : n;
@@ -1171,7 +1171,7 @@ function os(e, t = !1) {
1171
1171
  var r = Be();
1172
1172
  return $?.before(r), Oe(r), r;
1173
1173
  }
1174
- ti($);
1174
+ ni($);
1175
1175
  }
1176
1176
  return $;
1177
1177
  }
@@ -1185,7 +1185,7 @@ function ke(e, t = 1, n = !1) {
1185
1185
  var o = Be();
1186
1186
  return r === null ? i?.after(o) : r.before(o), Oe(o), o;
1187
1187
  }
1188
- ti(r);
1188
+ ni(r);
1189
1189
  }
1190
1190
  return Oe(r), r;
1191
1191
  }
@@ -1193,20 +1193,20 @@ function Eu(e) {
1193
1193
  e.textContent = "";
1194
1194
  }
1195
1195
  function xu() {
1196
- return !ut || qe !== null ? !1 : (C.f & go) !== 0;
1196
+ return !ut || qe !== null ? !1 : (C.f & mo) !== 0;
1197
1197
  }
1198
- function ko(e, t, n) {
1198
+ function Eo(e, t, n) {
1199
1199
  return t == null || t === "http://www.w3.org/1999/xhtml" ? n ? document.createElement(e, { is: n }) : document.createElement(e) : n ? document.createElementNS(t, e, { is: n }) : document.createElementNS(t, e);
1200
1200
  }
1201
- function ti(e) {
1201
+ function ni(e) {
1202
1202
  if (e.nodeValue.length < 65536) return;
1203
1203
  let t = e.nextSibling;
1204
1204
  for (; t !== null && t.nodeType === 3; )
1205
1205
  t.remove(), e.nodeValue += t.nodeValue, t = e.nextSibling;
1206
1206
  }
1207
- var ss = !1;
1207
+ var as = !1;
1208
1208
  function Au() {
1209
- ss || (ss = !0, document.addEventListener("reset", (e) => {
1209
+ as || (as = !0, document.addEventListener("reset", (e) => {
1210
1210
  Promise.resolve().then(() => {
1211
1211
  if (!e.defaultPrevented) for (const t of e.target.elements) t[aa]?.();
1212
1212
  });
@@ -1222,7 +1222,7 @@ function za(e) {
1222
1222
  }
1223
1223
  }
1224
1224
  function Cu(e) {
1225
- C === null && (L === null && Wc(e), Dc()), ft && zc(e);
1225
+ C === null && (L === null && Hc(e), Dc()), ft && zc(e);
1226
1226
  }
1227
1227
  function Mu(e, t) {
1228
1228
  var n = t.last;
@@ -1230,7 +1230,7 @@ function Mu(e, t) {
1230
1230
  }
1231
1231
  function Je(e, t) {
1232
1232
  var n = C;
1233
- n !== null && (n.f & 8192) !== 0 && (e |= po);
1233
+ n !== null && (n.f & 8192) !== 0 && (e |= go);
1234
1234
  var r = {
1235
1235
  ctx: B,
1236
1236
  deps: null,
@@ -1256,7 +1256,7 @@ function Je(e, t) {
1256
1256
  } catch (s) {
1257
1257
  throw ge(r), s;
1258
1258
  }
1259
- 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 |= mo));
1259
+ 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 |= vo));
1260
1260
  }
1261
1261
  if (i !== null && (i.parent = n, n !== null && Mu(i, n), L !== null && (L.f & 2) !== 0 && (e & 64) === 0)) {
1262
1262
  var o = L;
@@ -1264,8 +1264,8 @@ function Je(e, t) {
1264
1264
  }
1265
1265
  return r;
1266
1266
  }
1267
- function Eo() {
1268
- return L !== null && !We;
1267
+ function xo() {
1268
+ return L !== null && !He;
1269
1269
  }
1270
1270
  function Ou(e) {
1271
1271
  const t = Je(8, null);
@@ -1284,27 +1284,27 @@ function Da(e) {
1284
1284
  }
1285
1285
  function Iu(e) {
1286
1286
  sn.ensure();
1287
- const t = Je(64 | Pn, e);
1287
+ const t = Je(64 | Nn, e);
1288
1288
  return () => {
1289
1289
  ge(t);
1290
1290
  };
1291
1291
  }
1292
1292
  function Ru(e) {
1293
1293
  sn.ensure();
1294
- const t = Je(64 | Pn, e);
1294
+ const t = Je(64 | Nn, e);
1295
1295
  return (n = {}) => new Promise((r) => {
1296
1296
  n.outro ? hr(t, () => {
1297
1297
  ge(t), r(void 0);
1298
1298
  }) : (ge(t), r(void 0));
1299
1299
  });
1300
1300
  }
1301
- function Wa(e) {
1301
+ function Ha(e) {
1302
1302
  return Je(4, e);
1303
1303
  }
1304
1304
  function Lu(e) {
1305
- return Je(Rc | Pn, e);
1305
+ return Je(Rc | Nn, e);
1306
1306
  }
1307
- function xo(e, t = 0) {
1307
+ function Ao(e, t = 0) {
1308
1308
  return Je(8 | t, e);
1309
1309
  }
1310
1310
  function Un(e, t = [], n = [], r = []) {
@@ -1312,37 +1312,37 @@ function Un(e, t = [], n = [], r = []) {
1312
1312
  Je(8, () => e(...i.map(y)));
1313
1313
  });
1314
1314
  }
1315
- function Ha(e, t = 0) {
1315
+ function Wa(e, t = 0) {
1316
1316
  var n = Je(16 | t, e);
1317
1317
  return n;
1318
1318
  }
1319
1319
  function dt(e) {
1320
- return Je(32 | Pn, e);
1320
+ return Je(32 | Nn, e);
1321
1321
  }
1322
1322
  function Fa(e) {
1323
1323
  var t = e.teardown;
1324
1324
  if (t !== null) {
1325
1325
  const n = ft, r = L;
1326
- ls(!0), Ie(null);
1326
+ cs(!0), Ie(null);
1327
1327
  try {
1328
1328
  t.call(null);
1329
1329
  } finally {
1330
- ls(n), Ie(r);
1330
+ cs(n), Ie(r);
1331
1331
  }
1332
1332
  }
1333
1333
  }
1334
- function Ao(e, t = !1) {
1334
+ function Co(e, t = !1) {
1335
1335
  var n = e.first;
1336
1336
  for (e.first = e.last = null; n !== null; ) {
1337
1337
  const i = n.ac;
1338
1338
  i !== null && za(() => {
1339
- i.abort(Qr);
1339
+ i.abort(ei);
1340
1340
  });
1341
1341
  var r = n.next;
1342
1342
  (n.f & 64) !== 0 ? n.parent = null : ge(n, t), n = r;
1343
1343
  }
1344
1344
  }
1345
- function Pu(e) {
1345
+ function Nu(e) {
1346
1346
  for (var t = e.first; t !== null; ) {
1347
1347
  var n = t.next;
1348
1348
  (t.f & 32) === 0 && ge(t), t = n;
@@ -1350,14 +1350,14 @@ function Pu(e) {
1350
1350
  }
1351
1351
  function ge(e, t = !0) {
1352
1352
  var n = !1;
1353
- (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Nu(e.nodes.start, e.nodes.end), n = !0), V(e, Jo), Ao(e, t && !n), lr(e, 0);
1353
+ (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Pu(e.nodes.start, e.nodes.end), n = !0), V(e, Zo), Co(e, t && !n), lr(e, 0);
1354
1354
  var r = e.nodes && e.nodes.t;
1355
1355
  if (r !== null) for (const o of r) o.stop();
1356
- Fa(e), e.f ^= Jo, e.f |= Oc;
1356
+ Fa(e), e.f ^= Zo, e.f |= Oc;
1357
1357
  var i = e.parent;
1358
1358
  i !== null && i.first !== null && Ba(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1359
1359
  }
1360
- function Nu(e, t) {
1360
+ function Pu(e, t) {
1361
1361
  for (; e !== null; ) {
1362
1362
  var n = e === t ? null : /* @__PURE__ */ gt(e);
1363
1363
  e.remove(), e = n;
@@ -1380,7 +1380,7 @@ function hr(e, t, n = !0) {
1380
1380
  }
1381
1381
  function Ua(e, t, n) {
1382
1382
  if ((e.f & 8192) === 0) {
1383
- e.f ^= po;
1383
+ e.f ^= go;
1384
1384
  var r = e.nodes && e.nodes.t;
1385
1385
  if (r !== null)
1386
1386
  for (const a of r) (a.is_global || n) && t.push(a);
@@ -1394,12 +1394,12 @@ function Ua(e, t, n) {
1394
1394
  }
1395
1395
  }
1396
1396
  }
1397
- function as(e) {
1397
+ function ls(e) {
1398
1398
  ja(e, !0);
1399
1399
  }
1400
1400
  function ja(e, t) {
1401
1401
  if ((e.f & 8192) !== 0) {
1402
- e.f ^= po, (e.f & 1024) === 0 && (V(e, Le), sn.ensure().schedule(e));
1402
+ e.f ^= go, (e.f & 1024) === 0 && (V(e, Le), sn.ensure().schedule(e));
1403
1403
  for (var n = e.first; n !== null; ) {
1404
1404
  var r = n.next, i = (n.f & 65536) !== 0 || (n.f & 32) !== 0;
1405
1405
  ja(n, i ? t : !1), n = r;
@@ -1417,10 +1417,10 @@ function Ga(e, t) {
1417
1417
  }
1418
1418
  }
1419
1419
  var $u = null, Ir = !1, ft = !1;
1420
- function ls(e) {
1420
+ function cs(e) {
1421
1421
  ft = e;
1422
1422
  }
1423
- var L = null, We = !1;
1423
+ var L = null, He = !1;
1424
1424
  function Ie(e) {
1425
1425
  L = e;
1426
1426
  }
@@ -1437,7 +1437,7 @@ function zu(e) {
1437
1437
  xe = e;
1438
1438
  }
1439
1439
  var qa = 1, jt = 0, Jt = jt;
1440
- function cs(e) {
1440
+ function us(e) {
1441
1441
  Jt = e;
1442
1442
  }
1443
1443
  function Ya() {
@@ -1460,30 +1460,30 @@ function Xa(e, t, n = !0) {
1460
1460
  if (r !== null && !(!ut && Fe !== null && Fe.has(e)))
1461
1461
  for (var i = 0; i < r.length; i++) {
1462
1462
  var o = r[i];
1463
- (o.f & 2) !== 0 ? Xa(o, t, !1) : t === o && (n ? V(o, Le) : (o.f & 1024) !== 0 && V(o, on), To(o));
1463
+ (o.f & 2) !== 0 ? Xa(o, t, !1) : t === o && (n ? V(o, Le) : (o.f & 1024) !== 0 && V(o, on), So(o));
1464
1464
  }
1465
1465
  }
1466
1466
  function Ka(e) {
1467
- var t = pe, n = ve, r = xe, i = L, o = Fe, s = B, a = We, l = Jt, c = e.f;
1468
- pe = null, ve = 0, xe = null, L = (c & 96) === 0 ? e : null, Fe = null, Mn(e.ctx), We = !1, Jt = ++jt, e.ac !== null && (za(() => {
1469
- e.ac.abort(Qr);
1467
+ var t = pe, n = ve, r = xe, i = L, o = Fe, s = B, a = He, l = Jt, c = e.f;
1468
+ pe = null, ve = 0, xe = null, L = (c & 96) === 0 ? e : null, Fe = null, Mn(e.ctx), He = !1, Jt = ++jt, e.ac !== null && (za(() => {
1469
+ e.ac.abort(ei);
1470
1470
  }), e.ac = null);
1471
1471
  try {
1472
- e.f |= Zo;
1472
+ e.f |= Qo;
1473
1473
  var u = e.fn, f = u();
1474
- e.f |= go;
1474
+ e.f |= mo;
1475
1475
  var p = e.deps, g = R?.is_fork;
1476
1476
  if (pe !== null) {
1477
1477
  var m;
1478
1478
  if (g || lr(e, ve), p !== null && ve > 0)
1479
1479
  for (p.length = ve + pe.length, m = 0; m < pe.length; m++) p[ve + m] = pe[m];
1480
1480
  else e.deps = p = pe;
1481
- if (Eo() && (e.f & 512) !== 0) for (m = ve; m < p.length; m++) {
1481
+ if (xo() && (e.f & 512) !== 0) for (m = ve; m < p.length; m++) {
1482
1482
  var b;
1483
1483
  ((b = p[m]).reactions ?? (b.reactions = [])).push(e);
1484
1484
  }
1485
1485
  } else !g && p !== null && ve < p.length && (lr(e, ve), p.length = ve);
1486
- if (dr() && xe !== null && !We && p !== null && (e.f & 6146) === 0) for (m = 0; m < xe.length; m++) Xa(xe[m], e);
1486
+ if (dr() && xe !== null && !He && p !== null && (e.f & 6146) === 0) for (m = 0; m < xe.length; m++) Xa(xe[m], e);
1487
1487
  if (i !== null && i !== e) {
1488
1488
  if (jt++, i.deps !== null) for (let T = 0; T < n; T += 1) i.deps[T].rv = jt;
1489
1489
  if (t !== null) for (const T of t) T.rv = jt;
@@ -1493,7 +1493,7 @@ function Ka(e) {
1493
1493
  } catch (T) {
1494
1494
  return ga(T);
1495
1495
  } finally {
1496
- e.f ^= Zo, pe = t, ve = n, xe = r, L = i, Fe = o, Mn(s), We = a, Jt = l;
1496
+ e.f ^= Qo, pe = t, ve = n, xe = r, L = i, Fe = o, Mn(s), He = a, Jt = l;
1497
1497
  }
1498
1498
  }
1499
1499
  function Du(e, t) {
@@ -1505,9 +1505,9 @@ function Du(e, t) {
1505
1505
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
1506
1506
  }
1507
1507
  }
1508
- if (n === null && (t.f & 2) !== 0 && (pe === null || !$r.call(pe, t))) {
1508
+ if (n === null && (t.f & 2) !== 0 && (pe === null || !zr.call(pe, t))) {
1509
1509
  var o = t;
1510
- (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cr), o.v !== Q && _o(o), bu(o), lr(o, 0);
1510
+ (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cr), o.v !== Q && bo(o), bu(o), lr(o, 0);
1511
1511
  }
1512
1512
  }
1513
1513
  function lr(e, t) {
@@ -1523,7 +1523,7 @@ function Rn(e) {
1523
1523
  if (C = e, Ir = !0, 0)
1524
1524
  var i, o;
1525
1525
  try {
1526
- (t & 16777232) !== 0 ? Pu(e) : Ao(e), Fa(e);
1526
+ (t & 16777232) !== 0 ? Nu(e) : Co(e), Fa(e);
1527
1527
  var s = Ka(e);
1528
1528
  if (e.teardown = typeof s == "function" ? s : null, e.wv = qa, 0)
1529
1529
  for (var a of e.deps) ;
@@ -1534,21 +1534,21 @@ function Rn(e) {
1534
1534
  }
1535
1535
  function y(e) {
1536
1536
  var t = (e.f & 2) !== 0;
1537
- if ($u?.add(e), L !== null && !We && !(C !== null && (C.f & 16384) !== 0) && (Fe === null || !Fe.has(e))) {
1537
+ if ($u?.add(e), L !== null && !He && !(C !== null && (C.f & 16384) !== 0) && (Fe === null || !Fe.has(e))) {
1538
1538
  var n = L.deps;
1539
1539
  if ((L.f & 2097152) !== 0)
1540
1540
  e.rv < jt && (e.rv = jt, pe === null && n !== null && n[ve] === e ? ve++ : pe === null ? pe = [e] : pe.push(e));
1541
1541
  else {
1542
1542
  var r;
1543
- (r = L).deps ?? (r.deps = []), $r.call(L.deps, e) || L.deps.push(e);
1543
+ (r = L).deps ?? (r.deps = []), zr.call(L.deps, e) || L.deps.push(e);
1544
1544
  var i = e.reactions;
1545
- i === null ? e.reactions = [L] : $r.call(i, L) || i.push(L);
1545
+ i === null ? e.reactions = [L] : zr.call(i, L) || i.push(L);
1546
1546
  }
1547
1547
  }
1548
1548
  if (0) {
1549
- if (!We && reactivity_loss_tracker && !reactivity_loss_tracker.warned && (reactivity_loss_tracker.effect.f & 2097152) === 0 && !reactivity_loss_tracker.effect_deps.has(e))
1549
+ if (!He && reactivity_loss_tracker && !reactivity_loss_tracker.warned && (reactivity_loss_tracker.effect.f & 2097152) === 0 && !reactivity_loss_tracker.effect_deps.has(e))
1550
1550
  var o;
1551
- if (tracing_mode_flag && !We && tracing_expressions !== null && L !== null && tracing_expressions.reaction === L && !e.trace) {
1551
+ if (tracing_mode_flag && !He && tracing_expressions !== null && L !== null && tracing_expressions.reaction === L && !e.trace) {
1552
1552
  if (o)
1553
1553
  var s, a;
1554
1554
  }
@@ -1558,9 +1558,9 @@ function y(e) {
1558
1558
  var l = e;
1559
1559
  if (ft) {
1560
1560
  var c = l.v;
1561
- return ((l.f & 1024) === 0 && l.reactions !== null || Za(l)) && (c = wo(l)), Kt.set(l, c), c;
1561
+ return ((l.f & 1024) === 0 && l.reactions !== null || Za(l)) && (c = ko(l)), Kt.set(l, c), c;
1562
1562
  }
1563
- var u = (l.f & 512) === 0 && !We && L !== null && (Ir || (L.f & 512) !== 0), f = (l.f & go) === 0;
1563
+ var u = (l.f & 512) === 0 && !He && L !== null && (Ir || (L.f & 512) !== 0), f = (l.f & mo) === 0;
1564
1564
  pr(l) && (u && (l.f |= 512), Oa(l)), u && !f && (Ia(l), Ja(l));
1565
1565
  }
1566
1566
  if (de?.has(e)) return de.get(e);
@@ -1579,27 +1579,27 @@ function Za(e) {
1579
1579
  if (Kt.has(t) || (t.f & 2) !== 0 && Za(t)) return !0;
1580
1580
  return !1;
1581
1581
  }
1582
- function ni(e) {
1583
- var t = We;
1582
+ function ri(e) {
1583
+ var t = He;
1584
1584
  try {
1585
- return We = !0, e();
1585
+ return He = !0, e();
1586
1586
  } finally {
1587
- We = t;
1587
+ He = t;
1588
1588
  }
1589
1589
  }
1590
- var xn = /* @__PURE__ */ Symbol("events"), Qa = /* @__PURE__ */ new Set(), Vi = /* @__PURE__ */ new Set();
1590
+ var xn = /* @__PURE__ */ Symbol("events"), Qa = /* @__PURE__ */ new Set(), qi = /* @__PURE__ */ new Set();
1591
1591
  function vn(e, t, n) {
1592
1592
  (t[xn] ?? (t[xn] = {}))[e] = n;
1593
1593
  }
1594
- function Wu(e) {
1594
+ function Hu(e) {
1595
1595
  for (var t = 0; t < e.length; t++) Qa.add(e[t]);
1596
- for (var n of Vi) n(e);
1596
+ for (var n of qi) n(e);
1597
1597
  }
1598
- var us = null;
1599
- function ds(e) {
1598
+ var ds = null;
1599
+ function fs(e) {
1600
1600
  var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
1601
- us = e;
1602
- var s = 0, a = us === e && e[xn];
1601
+ ds = e;
1602
+ var s = 0, a = ds === e && e[xn];
1603
1603
  if (a) {
1604
1604
  var l = i.indexOf(a);
1605
1605
  if (l !== -1 && (t === document || t === window)) {
@@ -1611,7 +1611,7 @@ function ds(e) {
1611
1611
  l <= c && (s = l);
1612
1612
  }
1613
1613
  if (o = i[s] || e.target, o !== t) {
1614
- Dr(e, "currentTarget", {
1614
+ Hr(e, "currentTarget", {
1615
1615
  configurable: !0,
1616
1616
  get() {
1617
1617
  return o || n;
@@ -1641,12 +1641,12 @@ function ds(e) {
1641
1641
  }
1642
1642
  }
1643
1643
  }
1644
- var Hu = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1644
+ var Wu = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1645
1645
  function Fu(e) {
1646
- return Hu?.createHTML(e) ?? e;
1646
+ return Wu?.createHTML(e) ?? e;
1647
1647
  }
1648
1648
  function Bu(e) {
1649
- var t = ko("template");
1649
+ var t = Eo("template");
1650
1650
  return t.innerHTML = Fu(e.replaceAll("<!>", "<!---->")), t.content;
1651
1651
  }
1652
1652
  function Ot(e, t) {
@@ -1665,7 +1665,7 @@ function Ze(e, t) {
1665
1665
  if (D)
1666
1666
  return Ot($, null), $;
1667
1667
  i === void 0 && (i = Bu(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ In(i)));
1668
- var s = r || Pa ? document.importNode(i, !0) : i.cloneNode(!0);
1668
+ var s = r || Na ? document.importNode(i, !0) : i.cloneNode(!0);
1669
1669
  if (n) {
1670
1670
  var a = /* @__PURE__ */ In(s), l = s.lastChild;
1671
1671
  Ot(a, l);
@@ -1679,7 +1679,7 @@ function Uu(e = "") {
1679
1679
  return Ot(t, t), t;
1680
1680
  }
1681
1681
  var n = $;
1682
- return n.nodeType !== 3 ? (n.before(n = Be()), Oe(n)) : ti(n), Ot(n, n), n;
1682
+ return n.nodeType !== 3 ? (n.before(n = Be()), Oe(n)) : ni(n), Ot(n, n), n;
1683
1683
  }
1684
1684
  function ju() {
1685
1685
  if (D)
@@ -1690,7 +1690,7 @@ function ju() {
1690
1690
  function me(e, t) {
1691
1691
  if (D) {
1692
1692
  var n = C;
1693
- ((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = $), vo();
1693
+ ((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = $), _o();
1694
1694
  return;
1695
1695
  }
1696
1696
  e !== null && e.before(t);
@@ -1724,7 +1724,7 @@ var Gu = [
1724
1724
  "defer",
1725
1725
  "disablepictureinpicture",
1726
1726
  "disableremoteplayback"
1727
- ], _g = [
1727
+ ], mg = [
1728
1728
  ...Gu,
1729
1729
  "formNoValidate",
1730
1730
  "isMap",
@@ -1749,7 +1749,7 @@ var Yu = [
1749
1749
  "$state.raw",
1750
1750
  "$derived",
1751
1751
  "$derived.by"
1752
- ], bg = [
1752
+ ], vg = [
1753
1753
  ...Yu,
1754
1754
  "$state.eager",
1755
1755
  "$state.snapshot",
@@ -1765,7 +1765,7 @@ var Yu = [
1765
1765
  "$inspect().with",
1766
1766
  "$inspect.trace",
1767
1767
  "$host"
1768
- ], fs = !0;
1768
+ ], hs = !0;
1769
1769
  function kr(e, t) {
1770
1770
  var n, r = t == null ? "" : typeof t == "object" ? `${t}` : t;
1771
1771
  r !== ((n = e)[Cr] ?? (n[Cr] = e.nodeValue)) && (e[Cr] = r, e.nodeValue = `${r}`);
@@ -1774,7 +1774,7 @@ function el(e, t) {
1774
1774
  return tl(e, t);
1775
1775
  }
1776
1776
  function Xu(e, t) {
1777
- Gi(), t.intro = t.intro ?? !1;
1777
+ Vi(), t.intro = t.intro ?? !1;
1778
1778
  const n = t.target, r = D, i = $;
1779
1779
  try {
1780
1780
  for (var o = /* @__PURE__ */ In(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ gt(o);
@@ -1788,22 +1788,22 @@ function Xu(e, t) {
1788
1788
  } catch (s) {
1789
1789
  if (s instanceof Error && s.message.split(`
1790
1790
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
1791
- return s !== Cn && console.warn("Failed to hydrate: ", s), t.recover === !1 && Fc(), Gi(), Eu(n), En(!1), el(e, t);
1791
+ return s !== Cn && console.warn("Failed to hydrate: ", s), t.recover === !1 && Fc(), Vi(), Eu(n), En(!1), el(e, t);
1792
1792
  } finally {
1793
1793
  En(r), Oe(i);
1794
1794
  }
1795
1795
  }
1796
1796
  var Er = /* @__PURE__ */ new Map();
1797
1797
  function tl(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1798
- Gi();
1798
+ Vi();
1799
1799
  var l = void 0, c = Ru(() => {
1800
1800
  var u = n ?? t.appendChild(Be());
1801
1801
  cu(u, { pending: () => {
1802
1802
  } }, (g) => {
1803
1803
  fa({});
1804
1804
  var m = B;
1805
- if (o && (m.c = o), i && (r.$$events = i), D && Ot(g, null), fs = s, l = e(g, r) || {}, fs = !0, D && (C.nodes.end = $, $ === null || $.nodeType !== 8 || $.data !== "]"))
1806
- throw ei(), Cn;
1805
+ if (o && (m.c = o), i && (r.$$events = i), D && Ot(g, null), hs = s, l = e(g, r) || {}, hs = !0, D && (C.nodes.end = $, $ === null || $.nodeType !== 8 || $.data !== "]"))
1806
+ throw ti(), Cn;
1807
1807
  ha();
1808
1808
  }, a);
1809
1809
  var f = /* @__PURE__ */ new Set(), p = (g) => {
@@ -1815,37 +1815,37 @@ function tl(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
1815
1815
  for (const J of [t, document]) {
1816
1816
  var I = Er.get(J);
1817
1817
  I === void 0 && (I = /* @__PURE__ */ new Map(), Er.set(J, I));
1818
- var W = I.get(b);
1819
- W === void 0 ? (J.addEventListener(b, ds, { passive: T }), I.set(b, 1)) : I.set(b, W + 1);
1818
+ var H = I.get(b);
1819
+ H === void 0 ? (J.addEventListener(b, fs, { passive: T }), I.set(b, 1)) : I.set(b, H + 1);
1820
1820
  }
1821
1821
  }
1822
1822
  }
1823
1823
  };
1824
- return p(kc(Qa)), Vi.add(p), () => {
1824
+ return p(kc(Qa)), qi.add(p), () => {
1825
1825
  for (var g of f) for (const T of [t, document]) {
1826
1826
  var m = Er.get(T), b = m.get(g);
1827
- --b == 0 ? (T.removeEventListener(g, ds), m.delete(g), m.size === 0 && Er.delete(T)) : m.set(g, b);
1827
+ --b == 0 ? (T.removeEventListener(g, fs), m.delete(g), m.size === 0 && Er.delete(T)) : m.set(g, b);
1828
1828
  }
1829
- Vi.delete(p), u !== n && u.parentNode?.removeChild(u);
1829
+ qi.delete(p), u !== n && u.parentNode?.removeChild(u);
1830
1830
  };
1831
1831
  });
1832
- return qi.set(l, c), l;
1832
+ return Yi.set(l, c), l;
1833
1833
  }
1834
- var qi = /* @__PURE__ */ new WeakMap();
1834
+ var Yi = /* @__PURE__ */ new WeakMap();
1835
1835
  function Ku(e, t) {
1836
- const n = qi.get(e);
1837
- return n ? (qi.delete(e), n(t)) : Promise.resolve();
1836
+ const n = Yi.get(e);
1837
+ return n ? (Yi.delete(e), n(t)) : Promise.resolve();
1838
1838
  }
1839
- var lt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), vi = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), hs = /* @__PURE__ */ new WeakMap(), Ju = class {
1839
+ var lt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), bi = /* @__PURE__ */ new WeakMap(), ps = /* @__PURE__ */ new WeakMap(), Ju = class {
1840
1840
  constructor(e, t = !0) {
1841
- v(this, "anchor", void 0), A(this, lt, /* @__PURE__ */ new Map()), A(this, kt, /* @__PURE__ */ new Map()), A(this, $e, /* @__PURE__ */ new Map()), A(this, jn, /* @__PURE__ */ new Set()), A(this, vi, !0), A(this, _i, (n) => {
1841
+ v(this, "anchor", void 0), A(this, lt, /* @__PURE__ */ new Map()), A(this, kt, /* @__PURE__ */ new Map()), A(this, $e, /* @__PURE__ */ new Map()), A(this, jn, /* @__PURE__ */ new Set()), A(this, _i, !0), A(this, bi, (n) => {
1842
1842
  if (h(lt, this).has(n)) {
1843
1843
  var r = h(lt, this).get(n), i = h(kt, this).get(r);
1844
1844
  if (i)
1845
- as(i), h(jn, this).delete(r);
1845
+ ls(i), h(jn, this).delete(r);
1846
1846
  else {
1847
1847
  var o = h($e, this).get(r);
1848
- o && (as(o.effect), h(kt, this).set(r, o.effect), h($e, this).delete(r), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), i = o.effect);
1848
+ o && (ls(o.effect), h(kt, this).set(r, o.effect), h($e, this).delete(r), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), i = o.effect);
1849
1849
  }
1850
1850
  for (const [s, a] of h(lt, this)) {
1851
1851
  if (h(lt, this).delete(s), s === n) break;
@@ -1864,14 +1864,14 @@ var lt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), $e =
1864
1864
  } else ge(a);
1865
1865
  h(jn, this).delete(s), h(kt, this).delete(s);
1866
1866
  };
1867
- h(vi, this) || !i ? (h(jn, this).add(s), hr(a, l, !1)) : l();
1867
+ h(_i, this) || !i ? (h(jn, this).add(s), hr(a, l, !1)) : l();
1868
1868
  }
1869
1869
  }
1870
- }), A(this, hs, (n) => {
1870
+ }), A(this, ps, (n) => {
1871
1871
  h(lt, this).delete(n);
1872
1872
  const r = Array.from(h(lt, this).values());
1873
1873
  for (const [i, o] of h($e, this)) r.includes(i) || (ge(o.effect), h($e, this).delete(i));
1874
- }), this.anchor = e, E(vi, this, t);
1874
+ }), this.anchor = e, E(_i, this, t);
1875
1875
  }
1876
1876
  ensure(e, t) {
1877
1877
  var n = R, r = xu();
@@ -1885,14 +1885,14 @@ var lt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), $e =
1885
1885
  if (h(lt, this).set(n, e), r) {
1886
1886
  for (const [s, a] of h(kt, this)) s === e ? n.unskip_effect(a) : n.skip_effect(a);
1887
1887
  for (const [s, a] of h($e, this)) s === e ? n.unskip_effect(a.effect) : n.skip_effect(a.effect);
1888
- n.oncommit(h(_i, this)), n.ondiscard(h(hs, this));
1888
+ n.oncommit(h(bi, this)), n.ondiscard(h(ps, this));
1889
1889
  } else
1890
- D && (this.anchor = $), h(_i, this).call(this, n);
1890
+ D && (this.anchor = $), h(bi, this).call(this, n);
1891
1891
  }
1892
1892
  };
1893
1893
  function Zu(e) {
1894
- B === null && Nc("onMount"), ur && B.l !== null ? Qu(B).m.push(e) : Or(() => {
1895
- const t = ni(e);
1894
+ B === null && Pc("onMount"), ur && B.l !== null ? Qu(B).m.push(e) : Or(() => {
1895
+ const t = ri(e);
1896
1896
  if (typeof t == "function") return t;
1897
1897
  });
1898
1898
  }
@@ -1906,8 +1906,8 @@ function Qu(e) {
1906
1906
  }
1907
1907
  function _n(e, t, n = !1) {
1908
1908
  var r;
1909
- D && (r = $, vo());
1910
- var i = new Ju(e), o = n ? mo : 0;
1909
+ D && (r = $, _o());
1910
+ var i = new Ju(e), o = n ? vo : 0;
1911
1911
  function s(a, l) {
1912
1912
  if (D) {
1913
1913
  var c = Xc(r);
@@ -1919,7 +1919,7 @@ function _n(e, t, n = !1) {
1919
1919
  }
1920
1920
  i.ensure(a, l);
1921
1921
  }
1922
- Ha(() => {
1922
+ Wa(() => {
1923
1923
  var a = !1;
1924
1924
  t((l, c = 0) => {
1925
1925
  a = !0, s(c, l);
@@ -1927,15 +1927,15 @@ function _n(e, t, n = !1) {
1927
1927
  }, o);
1928
1928
  }
1929
1929
  function ed(e, t) {
1930
- Wa(() => {
1930
+ Ha(() => {
1931
1931
  var n = e.getRootNode(), r = n.host ? n : n.head ?? n.ownerDocument.head;
1932
1932
  if (!r.querySelector("#" + t.hash)) {
1933
- const i = ko("style");
1933
+ const i = Eo("style");
1934
1934
  i.id = t.hash, i.textContent = t.code, r.appendChild(i);
1935
1935
  }
1936
1936
  });
1937
1937
  }
1938
- var ps = [...`
1938
+ var gs = [...`
1939
1939
  \r\f \v\uFEFF`];
1940
1940
  function td(e, t, n) {
1941
1941
  var r = e == null ? "" : "" + e;
@@ -1944,12 +1944,12 @@ function td(e, t, n) {
1944
1944
  else if (r.length)
1945
1945
  for (var o = i.length, s = 0; (s = r.indexOf(i, s)) >= 0; ) {
1946
1946
  var a = s + o;
1947
- (s === 0 || ps.includes(r[s - 1])) && (a === r.length || ps.includes(r[a])) ? r = (s === 0 ? "" : r.substring(0, s)) + r.substring(a + 1) : s = a;
1947
+ (s === 0 || gs.includes(r[s - 1])) && (a === r.length || gs.includes(r[a])) ? r = (s === 0 ? "" : r.substring(0, s)) + r.substring(a + 1) : s = a;
1948
1948
  }
1949
1949
  }
1950
1950
  return r === "" ? null : r;
1951
1951
  }
1952
- function gs(e, t = !1) {
1952
+ function ms(e, t = !1) {
1953
1953
  var n = t ? " !important;" : ";", r = "";
1954
1954
  for (var i of Object.keys(e)) {
1955
1955
  var o = e[i];
@@ -1957,7 +1957,7 @@ function gs(e, t = !1) {
1957
1957
  }
1958
1958
  return r;
1959
1959
  }
1960
- function bi(e) {
1960
+ function yi(e) {
1961
1961
  return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
1962
1962
  }
1963
1963
  function nd(e, t) {
@@ -1966,7 +1966,7 @@ function nd(e, t) {
1966
1966
  if (Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, e) {
1967
1967
  e = String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
1968
1968
  var o = !1, s = 0, a = !1, l = [];
1969
- r && l.push(...Object.keys(r).map(bi)), i && l.push(...Object.keys(i).map(bi));
1969
+ r && l.push(...Object.keys(r).map(yi)), i && l.push(...Object.keys(i).map(yi));
1970
1970
  var c = 0, u = -1;
1971
1971
  const b = e.length;
1972
1972
  for (var f = 0; f < b; f++) {
@@ -1975,7 +1975,7 @@ function nd(e, t) {
1975
1975
  if (p === ":" && u === -1) u = f;
1976
1976
  else if (p === ";" || f === b - 1) {
1977
1977
  if (u !== -1) {
1978
- var g = bi(e.substring(c, u).trim());
1978
+ var g = yi(e.substring(c, u).trim());
1979
1979
  if (!l.includes(g)) {
1980
1980
  p !== ";" && f++;
1981
1981
  var m = e.substring(c, f).trim();
@@ -1987,33 +1987,33 @@ function nd(e, t) {
1987
1987
  }
1988
1988
  }
1989
1989
  }
1990
- return r && (n += gs(r)), i && (n += gs(i, !0)), n = n.trim(), n === "" ? null : n;
1990
+ return r && (n += ms(r)), i && (n += ms(i, !0)), n = n.trim(), n === "" ? null : n;
1991
1991
  }
1992
1992
  return e == null ? null : String(e);
1993
1993
  }
1994
1994
  function rd(e, t, n, r, i, o) {
1995
- var s = e[Ni];
1995
+ var s = e[$i];
1996
1996
  if (D || s !== n || s === void 0) {
1997
1997
  var a = td(n, r, o);
1998
- (!D || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Ni] = n;
1998
+ (!D || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[$i] = n;
1999
1999
  } else if (o && i !== o) for (var l in o) {
2000
2000
  var c = !!o[l];
2001
2001
  (i == null || c !== !!i[l]) && e.classList.toggle(l, c);
2002
2002
  }
2003
2003
  return o;
2004
2004
  }
2005
- function yi(e, t = {}, n, r) {
2005
+ function Ti(e, t = {}, n, r) {
2006
2006
  for (var i in n) {
2007
2007
  var o = n[i];
2008
2008
  t[i] !== o && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, o, r));
2009
2009
  }
2010
2010
  }
2011
2011
  function id(e, t, n, r) {
2012
- var i = e[$i];
2012
+ var i = e[zi];
2013
2013
  if (D || i !== t) {
2014
2014
  var o = nd(t, r);
2015
- (!D || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[$i] = t;
2016
- } else r && (Array.isArray(r) ? (yi(e, n?.[0], r[0]), yi(e, n?.[1], r[1], "important")) : yi(e, n, r));
2015
+ (!D || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[zi] = t;
2016
+ } else r && (Array.isArray(r) ? (Ti(e, n?.[0], r[0]), Ti(e, n?.[1], r[1], "important")) : Ti(e, n, r));
2017
2017
  return r;
2018
2018
  }
2019
2019
  var od = /* @__PURE__ */ Symbol("is custom element"), sd = /* @__PURE__ */ Symbol("is html"), ad = la ? "link" : "LINK", ld = la ? "progress" : "PROGRESS";
@@ -2023,11 +2023,11 @@ function cd(e) {
2023
2023
  if (!t) {
2024
2024
  if (t = !0, e.hasAttribute("value")) {
2025
2025
  var r = e.value;
2026
- Yi(e, "value", null), e.value = r;
2026
+ Xi(e, "value", null), e.value = r;
2027
2027
  }
2028
2028
  if (e.hasAttribute("checked")) {
2029
2029
  var i = e.checked;
2030
- Yi(e, "checked", null), e.checked = i;
2030
+ Xi(e, "checked", null), e.checked = i;
2031
2031
  }
2032
2032
  }
2033
2033
  };
@@ -2038,7 +2038,7 @@ function ud(e, t) {
2038
2038
  var n = nl(e);
2039
2039
  n.value === (n.value = t ?? void 0) || e.value === t && (t !== 0 || e.nodeName !== ld) || (e.value = t ?? "");
2040
2040
  }
2041
- function Yi(e, t, n, r) {
2041
+ function Xi(e, t, n, r) {
2042
2042
  var i = nl(e);
2043
2043
  if (D && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ad)) {
2044
2044
  r || void 0;
@@ -2053,11 +2053,11 @@ function nl(e) {
2053
2053
  [sd]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
2054
2054
  });
2055
2055
  }
2056
- var ms = /* @__PURE__ */ new Map();
2056
+ var vs = /* @__PURE__ */ new Map();
2057
2057
  function dd(e) {
2058
- var t = e.getAttribute("is") || e.nodeName, n = ms.get(t);
2058
+ var t = e.getAttribute("is") || e.nodeName, n = vs.get(t);
2059
2059
  if (n) return n;
2060
- ms.set(t, n = []);
2060
+ vs.set(t, n = []);
2061
2061
  for (var r, i = e, o = Element.prototype; o !== i; ) {
2062
2062
  r = Ec(i);
2063
2063
  for (var s in r) r[s].set && s !== "innerHTML" && s !== "textContent" && s !== "innerText" && n.push(s);
@@ -2065,21 +2065,21 @@ function dd(e) {
2065
2065
  }
2066
2066
  return n;
2067
2067
  }
2068
- var rl, kn = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), Ti = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakSet(), il = class {
2068
+ var rl, kn = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), _s = /* @__PURE__ */ new WeakSet(), il = class {
2069
2069
  constructor(e) {
2070
- bo(this, vs), A(this, kn, /* @__PURE__ */ new WeakMap()), A(this, Xr, void 0), A(this, Ti, void 0), E(Ti, this, e);
2070
+ yo(this, _s), A(this, kn, /* @__PURE__ */ new WeakMap()), A(this, Kr, void 0), A(this, Si, void 0), E(Si, this, e);
2071
2071
  }
2072
2072
  observe(e, t) {
2073
2073
  var n = h(kn, this).get(e) || /* @__PURE__ */ new Set();
2074
- return n.add(t), h(kn, this).set(e, n), O(vs, this, fd).call(this).observe(e, h(Ti, this)), () => {
2074
+ return n.add(t), h(kn, this).set(e, n), O(_s, this, fd).call(this).observe(e, h(Si, this)), () => {
2075
2075
  var r = h(kn, this).get(e);
2076
- r.delete(t), r.size === 0 && (h(kn, this).delete(e), h(Xr, this).unobserve(e));
2076
+ r.delete(t), r.size === 0 && (h(kn, this).delete(e), h(Kr, this).unobserve(e));
2077
2077
  };
2078
2078
  }
2079
2079
  };
2080
2080
  rl = il;
2081
2081
  function fd() {
2082
- return h(Xr, this) ?? E(Xr, this, new ResizeObserver((e) => {
2082
+ return h(Kr, this) ?? E(Kr, this, new ResizeObserver((e) => {
2083
2083
  for (var t of e) {
2084
2084
  rl.entries.set(t.target, t);
2085
2085
  for (var n of h(kn, this).get(t.target) || []) n(t);
@@ -2087,22 +2087,22 @@ function fd() {
2087
2087
  }));
2088
2088
  }
2089
2089
  v(il, "entries", /* @__PURE__ */ new WeakMap());
2090
- function Si(e, t) {
2090
+ function wi(e, t) {
2091
2091
  return e === t || e?.[rr] === t;
2092
2092
  }
2093
- function _s(e = {}, t, n, r) {
2093
+ function bs(e = {}, t, n, r) {
2094
2094
  var i = B.r, o = C;
2095
- return Wa(() => {
2095
+ return Ha(() => {
2096
2096
  var s, a;
2097
- return xo(() => {
2098
- s = a, a = r?.() || [], ni(() => {
2099
- Si(n(...a), e) || (t(e, ...a), s && Si(n(...s), e) && t(null, ...s));
2097
+ return Ao(() => {
2098
+ s = a, a = r?.() || [], ri(() => {
2099
+ wi(n(...a), e) || (t(e, ...a), s && wi(n(...s), e) && t(null, ...s));
2100
2100
  });
2101
2101
  }), () => {
2102
2102
  let l = o;
2103
2103
  for (; l !== i && l.parent !== null && l.parent.f & 33554432; ) l = l.parent;
2104
2104
  const c = () => {
2105
- a && Si(n(...a), e) && t(null, ...a);
2105
+ a && wi(n(...a), e) && t(null, ...a);
2106
2106
  }, u = l.teardown;
2107
2107
  l.teardown = () => {
2108
2108
  c(), u?.();
@@ -2111,7 +2111,7 @@ function _s(e = {}, t, n, r) {
2111
2111
  }), e;
2112
2112
  }
2113
2113
  function xr(e, t, n, r) {
2114
- var i = !ur || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ ar(r)), y(c)) : (l && (l = !1, a = s ? ni(r) : r), a);
2114
+ var i = !ur || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ ar(r)), y(c)) : (l && (l = !1, a = s ? ri(r) : r), a);
2115
2115
  let f;
2116
2116
  if (o) {
2117
2117
  var p = rr in e || sa in e;
@@ -2133,23 +2133,23 @@ function xr(e, t, n, r) {
2133
2133
  return arguments.length > 0 ? ((!i || !X || T || m) && f(X ? b() : w), w) : b();
2134
2134
  });
2135
2135
  }
2136
- var I = !1, W = ((n & 1) !== 0 ? ar : Ma)(() => (I = !1, b()));
2137
- o && y(W);
2136
+ var I = !1, H = ((n & 1) !== 0 ? ar : Ma)(() => (I = !1, b()));
2137
+ o && y(H);
2138
2138
  var J = C;
2139
2139
  return (function(w, X) {
2140
2140
  if (arguments.length > 0) {
2141
- const le = X ? y(W) : i && o ? Mt(w) : w;
2142
- return P(W, le), I = !0, a !== void 0 && (a = le), w;
2141
+ const le = X ? y(H) : i && o ? Mt(w) : w;
2142
+ return N(H, le), I = !0, a !== void 0 && (a = le), w;
2143
2143
  }
2144
- return ft && I || (J.f & 16384) !== 0 ? W.v : y(W);
2144
+ return ft && I || (J.f & 16384) !== 0 ? H.v : y(H);
2145
2145
  });
2146
2146
  }
2147
2147
  function hd(e) {
2148
2148
  return new pd(e);
2149
2149
  }
2150
- var Ht = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), pd = class {
2150
+ var Wt = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), pd = class {
2151
2151
  constructor(e) {
2152
- A(this, Ht, void 0), A(this, Ge, void 0);
2152
+ A(this, Wt, void 0), A(this, Ge, void 0);
2153
2153
  var t = /* @__PURE__ */ new Map(), n = (i, o) => {
2154
2154
  var s = /* @__PURE__ */ yu(o, !1, !1);
2155
2155
  return t.set(i, s), s;
@@ -2165,7 +2165,7 @@ var Ht = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), pd =
2165
2165
  return o === sa ? !0 : (y(t.get(o) ?? n(o, Reflect.get(i, o))), Reflect.has(i, o));
2166
2166
  },
2167
2167
  set(i, o, s) {
2168
- return P(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
2168
+ return N(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
2169
2169
  }
2170
2170
  });
2171
2171
  E(Ge, this, (e.hydrate ? Xu : el)(e.component, {
@@ -2176,9 +2176,9 @@ var Ht = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), pd =
2176
2176
  intro: e.intro ?? !1,
2177
2177
  recover: e.recover,
2178
2178
  transformError: e.transformError
2179
- })), !ut && (!e?.props?.$$host || e.sync === !1) && er(), E(Ht, this, r.$$events);
2179
+ })), !ut && (!e?.props?.$$host || e.sync === !1) && er(), E(Wt, this, r.$$events);
2180
2180
  for (const i of Object.keys(h(Ge, this)))
2181
- i === "$set" || i === "$destroy" || i === "$on" || Dr(this, i, {
2181
+ i === "$set" || i === "$destroy" || i === "$on" || Hr(this, i, {
2182
2182
  get() {
2183
2183
  return h(Ge, this)[i];
2184
2184
  },
@@ -2197,10 +2197,10 @@ var Ht = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), pd =
2197
2197
  h(Ge, this).$set(e);
2198
2198
  }
2199
2199
  $on(e, t) {
2200
- h(Ht, this)[e] = h(Ht, this)[e] || [];
2200
+ h(Wt, this)[e] = h(Wt, this)[e] || [];
2201
2201
  const n = (...r) => t.call(this, ...r);
2202
- return h(Ht, this)[e].push(n), () => {
2203
- h(Ht, this)[e] = h(Ht, this)[e].filter((r) => r !== n);
2202
+ return h(Wt, this)[e].push(n), () => {
2203
+ h(Wt, this)[e] = h(Wt, this)[e].filter((r) => r !== n);
2204
2204
  };
2205
2205
  }
2206
2206
  $destroy() {
@@ -2228,7 +2228,7 @@ typeof HTMLElement == "function" && (ol = class extends HTMLElement {
2228
2228
  if (this.$$cn = !0, !this.$$c) {
2229
2229
  let e = function(r) {
2230
2230
  return (i) => {
2231
- const o = ko("slot");
2231
+ const o = Eo("slot");
2232
2232
  r !== "default" && (o.name = r), me(i, o);
2233
2233
  };
2234
2234
  };
@@ -2249,9 +2249,9 @@ typeof HTMLElement == "function" && (ol = class extends HTMLElement {
2249
2249
  $$host: this
2250
2250
  }
2251
2251
  }), this.$$me = Iu(() => {
2252
- xo(() => {
2252
+ Ao(() => {
2253
2253
  this.$$r = !0;
2254
- for (const r of zr(this.$$c)) {
2254
+ for (const r of Dr(this.$$c)) {
2255
2255
  if (!this.$$p_d[r]?.reflect) continue;
2256
2256
  this.$$d[r] = this.$$c[r];
2257
2257
  const i = Rr(r, this.$$d[r], this.$$p_d, "toAttribute");
@@ -2276,7 +2276,7 @@ typeof HTMLElement == "function" && (ol = class extends HTMLElement {
2276
2276
  });
2277
2277
  }
2278
2278
  $$g_p(e) {
2279
- return zr(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
2279
+ return Dr(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
2280
2280
  }
2281
2281
  });
2282
2282
  function Rr(e, t, n, r) {
@@ -2317,11 +2317,11 @@ function md(e, t, n, r, i, o) {
2317
2317
  super(e, n, i), this.$$p_d = t;
2318
2318
  }
2319
2319
  static get observedAttributes() {
2320
- return zr(t).map((a) => (t[a].attribute || a).toLowerCase());
2320
+ return Dr(t).map((a) => (t[a].attribute || a).toLowerCase());
2321
2321
  }
2322
2322
  };
2323
- return zr(t).forEach((a) => {
2324
- Dr(s.prototype, a, {
2323
+ return Dr(t).forEach((a) => {
2324
+ Hr(s.prototype, a, {
2325
2325
  get() {
2326
2326
  return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
2327
2327
  },
@@ -2332,12 +2332,12 @@ function md(e, t, n, r, i, o) {
2332
2332
  }
2333
2333
  });
2334
2334
  }), r.forEach((a) => {
2335
- Dr(s.prototype, a, { get() {
2335
+ Hr(s.prototype, a, { get() {
2336
2336
  return this.$$c?.[a];
2337
2337
  } });
2338
2338
  }), o && (s = o(s)), e.element = s, s;
2339
2339
  }
2340
- var ri = (e) => e, yg = ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Tg = ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Sg = ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), wg = ri(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext")), vd = class {
2340
+ var ii = (e) => e, _g = ii(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), bg = ii(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), yg = ii(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), Tg = ii(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext")), vd = class {
2341
2341
  serialize(e, t) {
2342
2342
  return {
2343
2343
  startContainer: this.getNodePath(e.startContainer, t),
@@ -2410,7 +2410,7 @@ var An;
2410
2410
  (function(e) {
2411
2411
  e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
2412
2412
  })(An || (An = {}));
2413
- var sl = class Xi {
2413
+ var sl = class Ki {
2414
2414
  constructor(t = {}) {
2415
2415
  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 vd(), typeof CSS > "u" || !("highlights" in CSS)) {
2416
2416
  console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
@@ -2529,7 +2529,7 @@ var sl = class Xi {
2529
2529
  }
2530
2530
  cn > p && (p = cn, f = X);
2531
2531
  }
2532
- const g = Math.max(0.24, Math.min(0.85, f * 0.55)), m = Math.max(0.55, Math.min(0.95, f + 0.2)), b = Math.max(0.22, Math.min(0.6, f * 0.45)), T = l, I = this.blend(T, a, m), W = this.contrastRatio(I, a), J = this.relativeLuminance(a) > 0.45 ? [
2532
+ const g = Math.max(0.24, Math.min(0.85, f * 0.55)), m = Math.max(0.55, Math.min(0.95, f + 0.2)), b = Math.max(0.22, Math.min(0.6, f * 0.45)), T = l, I = this.blend(T, a, m), H = this.contrastRatio(I, a), J = this.relativeLuminance(a) > 0.45 ? [
2533
2533
  0,
2534
2534
  0,
2535
2535
  0
@@ -2537,7 +2537,7 @@ var sl = class Xi {
2537
2537
  255,
2538
2538
  255,
2539
2539
  255
2540
- ], w = W >= 1.35 ? T : J;
2540
+ ], w = H >= 1.35 ? T : J;
2541
2541
  return {
2542
2542
  wordHighlight: `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${f})`,
2543
2543
  sentenceHighlight: `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${g})`,
@@ -2655,10 +2655,10 @@ var sl = class Xi {
2655
2655
  }
2656
2656
  }
2657
2657
  highlightTTSElementFallbacks(t) {
2658
- typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, Xi.SENTENCE_FALLBACK_SELECTOR);
2658
+ typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, Ki.SENTENCE_FALLBACK_SELECTOR);
2659
2659
  }
2660
2660
  highlightTTSWordElementFallbacks(t) {
2661
- typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights, Xi.WORD_FALLBACK_SELECTOR);
2661
+ typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights, Ki.WORD_FALLBACK_SELECTOR);
2662
2662
  }
2663
2663
  highlightElementFallbacks(t, n, r, i) {
2664
2664
  for (const o of t) {
@@ -2829,17 +2829,17 @@ function al(e) {
2829
2829
  console.debug(`[${e}]`, ...t);
2830
2830
  };
2831
2831
  }
2832
- var kg = al("I18nService"), wi = {
2832
+ var Sg = al("I18nService"), ki = {
2833
2833
  assessment: [],
2834
2834
  section: [],
2835
2835
  item: [],
2836
2836
  passage: [],
2837
2837
  rubric: [],
2838
2838
  element: []
2839
- }, ki = {
2840
- section: [...wi.section],
2841
- item: [...wi.item],
2842
- passage: [...wi.passage]
2839
+ }, Ei = {
2840
+ section: [...ki.section],
2841
+ item: [...ki.item],
2842
+ passage: [...ki.passage]
2843
2843
  };
2844
2844
  function Zt(e) {
2845
2845
  return typeof e == "object" && e !== null && !Array.isArray(e);
@@ -2906,9 +2906,9 @@ function wd(e) {
2906
2906
  blocked: xt(Et(t?.blocked, "policy.blocked"))
2907
2907
  },
2908
2908
  placement: {
2909
- section: xt(Et(n?.section, "placement.section")).length ? xt(Et(n?.section, "placement.section")) : [...ki.section],
2910
- item: xt(Et(n?.item, "placement.item")).length ? xt(Et(n?.item, "placement.item")) : [...ki.item],
2911
- passage: xt(Et(n?.passage, "placement.passage")).length ? xt(Et(n?.passage, "placement.passage")) : [...ki.passage]
2909
+ section: xt(Et(n?.section, "placement.section")).length ? xt(Et(n?.section, "placement.section")) : [...Ei.section],
2910
+ item: xt(Et(n?.item, "placement.item")).length ? xt(Et(n?.item, "placement.item")) : [...Ei.item],
2911
+ passage: xt(Et(n?.passage, "placement.passage")).length ? xt(Et(n?.passage, "placement.passage")) : [...Ei.passage]
2912
2912
  },
2913
2913
  providers: r
2914
2914
  };
@@ -2950,7 +2950,7 @@ function xd(e, t, n) {
2950
2950
  for (const { pattern: s, reason: a } of Ed) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2951
2951
  }
2952
2952
  }
2953
- function bs(e) {
2953
+ function ys(e) {
2954
2954
  if (Lr(e.toolId, "toolId"), Lr(e.name, "name"), Lr(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.`);
2955
2955
  if (typeof e.icon == "string" && xd(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.`);
2956
2956
  const t = e.supportedLevels.find((n) => !kd.includes(n));
@@ -2973,12 +2973,12 @@ var Ad = class {
2973
2973
  return e.map((t) => this.normalizeToolId(t));
2974
2974
  }
2975
2975
  register(e) {
2976
- if (bs(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
2976
+ if (ys(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
2977
2977
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const t of e.pnpSupportIds)
2978
2978
  this.pnpIndex.has(t) || this.pnpIndex.set(t, /* @__PURE__ */ new Set()), this.pnpIndex.get(t).add(e.toolId);
2979
2979
  }
2980
2980
  override(e) {
2981
- if (bs(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
2981
+ if (ys(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
2982
2982
  const t = this.tools.get(e.toolId);
2983
2983
  if (t.pnpSupportIds) for (const n of t.pnpSupportIds) this.pnpIndex.get(n)?.delete(e.toolId);
2984
2984
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const n of e.pnpSupportIds)
@@ -3117,7 +3117,7 @@ function Md(e) {
3117
3117
  function ul(e) {
3118
3118
  return e.level === "element";
3119
3119
  }
3120
- function Co(e) {
3120
+ function Mo(e) {
3121
3121
  if (ul(e)) {
3122
3122
  const t = e.item.config;
3123
3123
  if (!t) return "";
@@ -3177,8 +3177,8 @@ function Co(e) {
3177
3177
  }
3178
3178
  return "";
3179
3179
  }
3180
- function ii(e) {
3181
- const t = Co(e);
3180
+ function oi(e) {
3181
+ const t = Mo(e);
3182
3182
  return [
3183
3183
  /<math[>\s]/i,
3184
3184
  /\\\[([^\]]+)\\\]/,
@@ -3215,11 +3215,11 @@ function Od(e) {
3215
3215
  }
3216
3216
  return !1;
3217
3217
  }
3218
- function oi(e) {
3219
- return Co(e).trim().length >= 10;
3218
+ function si(e) {
3219
+ return Mo(e).trim().length >= 10;
3220
3220
  }
3221
3221
  function Id(e) {
3222
- const t = Co(e);
3222
+ const t = Mo(e);
3223
3223
  return [
3224
3224
  /chemistry|chemical|element|atom|molecule|compound/i,
3225
3225
  /periodic\s+table/i,
@@ -3236,16 +3236,16 @@ var Rd = [
3236
3236
  "passage",
3237
3237
  "rubric"
3238
3238
  ], Ld = new Set(Rd);
3239
- function Pd(e) {
3239
+ function Nd(e) {
3240
3240
  return Ld.has(e);
3241
3241
  }
3242
- function Mo(e, t, n) {
3242
+ function Oo(e, t, n) {
3243
3243
  const r = e.trim(), i = n.trim();
3244
3244
  if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
3245
- if (!Pd(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3245
+ if (!Nd(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3246
3246
  return `${r}:${t}:${i}`;
3247
3247
  }
3248
- var Nd = class {
3248
+ var Pd = class {
3249
3249
  constructor() {
3250
3250
  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);
3251
3251
  }
@@ -3322,7 +3322,7 @@ var Nd = class {
3322
3322
  destroy() {
3323
3323
  this.desmosProvider && (this.desmosProvider.destroy(), this.desmosProvider = null), this.config = null, console.log("[DesmosToolProvider] Destroyed");
3324
3324
  }
3325
- }, Oo = (e, t) => {
3325
+ }, Io = (e, t) => {
3326
3326
  const n = t?.useSentenceSegmenter !== !1;
3327
3327
  try {
3328
3328
  if (!n) throw new Error("Segmenter disabled by policy");
@@ -3369,14 +3369,14 @@ var Nd = class {
3369
3369
  if (a) return a;
3370
3370
  }
3371
3371
  return e[0] || null;
3372
- }, Dd = (e) => !e.default, Io = class {
3372
+ }, Dd = (e) => !e.default, Ro = class {
3373
3373
  constructor() {
3374
3374
  v(this, "providerId", "browser"), v(this, "providerName", "Browser Speech Synthesis"), v(this, "version", "1.0.0");
3375
3375
  }
3376
3376
  async initialize(e) {
3377
3377
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
3378
3378
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
3379
- return new Wd(e);
3379
+ return new Hd(e);
3380
3380
  }
3381
3381
  supportsFeature(e) {
3382
3382
  return !0;
@@ -3394,7 +3394,7 @@ var Nd = class {
3394
3394
  }
3395
3395
  destroy() {
3396
3396
  }
3397
- }, Wd = class {
3397
+ }, Hd = class {
3398
3398
  constructor(e) {
3399
3399
  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;
3400
3400
  }
@@ -3464,7 +3464,7 @@ var Nd = class {
3464
3464
  }
3465
3465
  segmentSentences(e) {
3466
3466
  const t = this.getSegmentationPolicy();
3467
- return Oo(e, {
3467
+ return Io(e, {
3468
3468
  locale: t.locale,
3469
3469
  useSentenceSegmenter: t.useSentenceSegmenter
3470
3470
  });
@@ -3536,7 +3536,7 @@ var Nd = class {
3536
3536
  ...e.providerOptions || {}
3537
3537
  });
3538
3538
  }
3539
- }, Hd = class {
3539
+ }, Wd = class {
3540
3540
  async emitTelemetry(e, t) {
3541
3541
  try {
3542
3542
  await this.config?.onTelemetry?.(e, t);
@@ -3568,7 +3568,7 @@ var Nd = class {
3568
3568
  }
3569
3569
  async _initializeBrowserTTS(e) {
3570
3570
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
3571
- this.ttsProvider = new Io(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3571
+ this.ttsProvider = new Ro(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3572
3572
  }
3573
3573
  async _initializeServerTTS(e) {
3574
3574
  if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -3664,29 +3664,29 @@ var Nd = class {
3664
3664
  context: t,
3665
3665
  toolbarContext: n
3666
3666
  }) : Gd(i);
3667
- }, Ki = /* @__PURE__ */ new WeakMap();
3667
+ }, Ji = /* @__PURE__ */ new WeakMap();
3668
3668
  function Vd(e, t) {
3669
3669
  if (!e) return null;
3670
- const n = Ki.get(e), r = n?.get(t);
3670
+ const n = Ji.get(e), r = n?.get(t);
3671
3671
  return r ? r.isConnected ? r : (n?.delete(t), null) : null;
3672
3672
  }
3673
3673
  function qd(e, t, n) {
3674
3674
  if (!e) return;
3675
- let r = Ki.get(e);
3676
- r || (r = /* @__PURE__ */ new Map(), Ki.set(e, r)), r.set(t, n);
3675
+ let r = Ji.get(e);
3676
+ r || (r = /* @__PURE__ */ new Map(), Ji.set(e, r)), r.set(t, n);
3677
3677
  }
3678
- function ys(e) {
3678
+ function Ts(e) {
3679
3679
  return e === "basic" || e === "scientific" ? e : null;
3680
3680
  }
3681
3681
  function Yd(e) {
3682
- const t = e.getToolRenderParams?.("calculator") ?? {}, n = ys(t.calculatorType), r = t.availableTypes;
3682
+ const t = e.getToolRenderParams?.("calculator") ?? {}, n = Ts(t.calculatorType), r = t.availableTypes;
3683
3683
  return {
3684
3684
  calculatorType: n,
3685
- availableTypes: Array.isArray(r) ? r.map((i) => ys(i)).filter((i) => i !== null) : n ? [n] : null,
3685
+ availableTypes: Array.isArray(r) ? r.map((i) => Ts(i)).filter((i) => i !== null) : n ? [n] : null,
3686
3686
  displayName: n === "scientific" ? "Scientific Calculator" : n === "basic" ? "Basic Calculator" : "Calculator"
3687
3687
  };
3688
3688
  }
3689
- function Ts(e, t, n) {
3689
+ function Ss(e, t, n) {
3690
3690
  const r = e;
3691
3691
  t ? (r.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete r.calculatorType, e.removeAttribute("calculator-type")), n && n.length > 0 ? r.availableTypes = n : delete r.availableTypes;
3692
3692
  }
@@ -3697,7 +3697,7 @@ var Xd = {
3697
3697
  icon: "calculator",
3698
3698
  provider: {
3699
3699
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
3700
- createProvider: () => new Nd(),
3700
+ createProvider: () => new Pd(),
3701
3701
  getInitConfig: (e) => e?.provider?.init ?? {},
3702
3702
  getAuthFetcher: (e) => {
3703
3703
  const t = e?.provider?.runtime?.authFetcher;
@@ -3720,11 +3720,11 @@ var Xd = {
3720
3720
  "scientificCalculator"
3721
3721
  ],
3722
3722
  isVisibleInContext(e) {
3723
- return ii(e);
3723
+ return oi(e);
3724
3724
  },
3725
3725
  renderToolbar(e, t) {
3726
- const { calculatorType: n, availableTypes: r, displayName: i } = Yd(t), o = Mo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = Vd(t.toolCoordinator, o), l = a ?? Qe(this.toolId, e, t, s);
3727
- a || qd(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ts(l, n, r);
3726
+ const { calculatorType: n, availableTypes: r, displayName: i } = Yd(t), o = Oo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = Vd(t.toolCoordinator, o), l = a ?? Qe(this.toolId, e, t, s);
3727
+ a || qd(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ss(l, n, r);
3728
3728
  const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, f = {
3729
3729
  toolId: this.toolId,
3730
3730
  label: i,
@@ -3751,13 +3751,17 @@ var Xd = {
3751
3751
  minWidth: 380,
3752
3752
  minHeight: 420,
3753
3753
  initialAlign: "bottom-right",
3754
- initialMargin: 16
3754
+ initialMargin: 16,
3755
+ content: {
3756
+ overflowY: "auto",
3757
+ preserveMinHeight: !0
3758
+ }
3755
3759
  }
3756
3760
  }],
3757
3761
  button: f,
3758
3762
  sync: () => {
3759
3763
  const g = t.isToolVisible(o);
3760
- f.active = g, f.label = i, f.ariaLabel = g ? u : c, f.tooltip = g ? `Close ${i.toLowerCase()}` : i, p !== g && (l.visible = g, p = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Ts(l, n, r);
3764
+ f.active = g, f.label = i, f.ariaLabel = g ? u : c, f.tooltip = g ? `Close ${i.toLowerCase()}` : i, p !== g && (l.visible = g, p = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Ss(l, n, r);
3761
3765
  },
3762
3766
  subscribeActive: (g) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3763
3767
  g(t.isToolVisible(o));
@@ -3776,7 +3780,7 @@ var Xd = {
3776
3780
  if ((n.position === "absolute" || n.position === "fixed") && o && (n.overflow === "hidden" || s) || n.opacity === "0" && o) return !0;
3777
3781
  }
3778
3782
  return !1;
3779
- }, Nn = (e, t) => {
3783
+ }, Pn = (e, t) => {
3780
3784
  let n = e.nodeType === 1 ? e : e.parentElement;
3781
3785
  for (; n; ) {
3782
3786
  if (pl(n)) return !0;
@@ -3798,7 +3802,7 @@ var Xd = {
3798
3802
  }
3799
3803
  const i = /[A-Za-z0-9]/.test(e), o = /[A-Za-z0-9]/.test(t);
3800
3804
  return i && o;
3801
- }, Kr = (e, t) => {
3805
+ }, Jr = (e, t) => {
3802
3806
  const n = /* @__PURE__ */ new Map();
3803
3807
  if (typeof document > "u" || typeof document.createTreeWalker != "function" || typeof NodeFilter > "u") return {
3804
3808
  text: "",
@@ -3810,18 +3814,18 @@ var Xd = {
3810
3814
  let u = c.nextNode();
3811
3815
  for (; u; ) {
3812
3816
  const p = u;
3813
- if (p.parentElement && !Nn(p, e)) {
3817
+ if (p.parentElement && !Pn(p, e)) {
3814
3818
  const g = p.textContent || "", m = g.match(/\S/), b = m ? m[0] : null;
3815
3819
  !o && !s && gl(l, b, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
3816
3820
  for (let T = 0; T < g.length; T++) {
3817
- const I = g[T], W = /\s/.test(I);
3818
- o ? W || (o = !1, r.push(I), n.set(i, {
3821
+ const I = g[T], H = /\s/.test(I);
3822
+ o ? H || (o = !1, r.push(I), n.set(i, {
3819
3823
  node: p,
3820
3824
  offset: T
3821
3825
  }), a = {
3822
3826
  node: p,
3823
3827
  offset: T
3824
- }, i++, s = !1, l = I) : W ? (s || (r.push(" "), n.set(i, {
3828
+ }, i++, s = !1, l = I) : H ? (s || (r.push(" "), n.set(i, {
3825
3829
  node: p,
3826
3830
  offset: T
3827
3831
  }), a = {
@@ -3844,13 +3848,13 @@ var Xd = {
3844
3848
  text: f,
3845
3849
  map: n
3846
3850
  };
3847
- }, Ei = null, Ss = Promise.resolve(), Kd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Jd = async () => (Ei || (Ei = import("./sre-5M5pQS1Z.js").then((e) => /* @__PURE__ */ Tc(e.default, 1)).then((e) => {
3851
+ }, xi = null, ws = Promise.resolve(), Kd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Jd = async () => (xi || (xi = import("./sre-5M5pQS1Z.js").then((e) => /* @__PURE__ */ Tc(e.default, 1)).then((e) => {
3848
3852
  const t = e.default || e;
3849
3853
  if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
3850
3854
  return t;
3851
- })), Ei), Zd = (e) => e === "en" ? "clearspeak" : "mathspeak", ws = (e) => !!e && typeof e == "object" && !Array.isArray(e), ks = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, si = (e) => {
3852
- if (!ws(e)) return;
3853
- const t = ks(e.domain), n = ks(e.style), r = ws(e.engineOptions) ? e.engineOptions : void 0;
3855
+ })), xi), Zd = (e) => e === "en" ? "clearspeak" : "mathspeak", ks = (e) => !!e && typeof e == "object" && !Array.isArray(e), Es = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, ai = (e) => {
3856
+ if (!ks(e)) return;
3857
+ const t = Es(e.domain), n = Es(e.style), r = ks(e.engineOptions) ? e.engineOptions : void 0;
3854
3858
  if (!(!t && !n && !r))
3855
3859
  return {
3856
3860
  ...t ? { domain: t } : {},
@@ -3858,7 +3862,7 @@ var Xd = {
3858
3862
  ...r ? { engineOptions: r } : {}
3859
3863
  };
3860
3864
  }, Qd = async (e, t, n, r) => {
3861
- const i = Kd(t), o = si(r);
3865
+ const i = Kd(t), o = ai(r);
3862
3866
  await e.setupEngine?.({
3863
3867
  ...o?.engineOptions || {},
3864
3868
  locale: i,
@@ -3868,8 +3872,8 @@ var Xd = {
3868
3872
  markup: n
3869
3873
  }), await e.engineReady?.();
3870
3874
  }, ef = async (e) => {
3871
- const t = Ss.then(e, e);
3872
- return Ss = t.then(() => {
3875
+ const t = ws.then(e, e);
3876
+ return ws = t.then(() => {
3873
3877
  }, () => {
3874
3878
  }), t;
3875
3879
  }, ml = async (e, t, n, r, i) => ef(async () => (await Qd(e, n, r, i), e.toSpeech(t))), tf = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), nf = async (e, t, n, r) => {
@@ -3917,55 +3921,71 @@ var Xd = {
3917
3921
  "expanding-row",
3918
3922
  "floating-overlay",
3919
3923
  "left-aligned"
3920
- ]), Es = (e) => e && typeof e == "object" ? e : {}, of = (e) => e === "polly" || e === "google" || e === "server", Ee = (e, t) => e === void 0 ? t : e, Jr = (e, t = "left-aligned") => typeof e == "string" && rf.has(e) ? e : t, xs = Object.freeze([0.8, 1.25]), As = (e) => {
3921
- if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return;
3922
- const t = Math.round(e * 100) / 100;
3923
- return t === 1 ? void 0 : t;
3924
+ ]), Zi = (e) => e && typeof e == "object" ? e : {}, of = (e) => e === "polly" || e === "google" || e === "server", Ee = (e, t) => e === void 0 ? t : e, Zr = (e, t = "left-aligned") => typeof e == "string" && rf.has(e) ? e : t, wg = Object.freeze([0.8, 1.25]), xs = Object.freeze([
3925
+ {
3926
+ rate: 0.8,
3927
+ label: "Slow",
3928
+ ariaLabel: "Slow speed"
3929
+ },
3930
+ {
3931
+ rate: 1,
3932
+ label: "Normal",
3933
+ ariaLabel: "Normal speed",
3934
+ default: !0
3935
+ },
3936
+ {
3937
+ rate: 1.25,
3938
+ label: "Fast",
3939
+ ariaLabel: "Fast speed"
3940
+ }
3941
+ ]), As = (e) => {
3942
+ if (!(typeof e != "number" || !Number.isFinite(e) || e <= 0))
3943
+ return Math.round(e * 100) / 100;
3924
3944
  }, Cs = (e) => {
3925
3945
  if (typeof e != "string") return;
3926
3946
  const t = e.trim();
3927
3947
  return t.length ? t : void 0;
3928
- }, Ms = (e) => `${e}x`, _l = (e, t) => t ? `Speed ${e}` : `${e} speed`, sf = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : _l(e, n), af = (e) => {
3929
- if (typeof e == "number") return As(e);
3930
- if (!e || typeof e != "object" || Array.isArray(e)) return;
3931
- const t = e, n = As(t.rate);
3932
- if (n === void 0) return;
3933
- const r = Cs(t.label), i = Cs(t.ariaLabel);
3934
- return {
3935
- rate: n,
3936
- ...r ? { label: r } : {},
3937
- ...i ? { ariaLabel: i } : {}
3938
- };
3939
- }, Ji = (e) => {
3940
- if (!Array.isArray(e)) return [...xs];
3941
- if (e.length === 0) return [];
3942
- const t = /* @__PURE__ */ new Set(), n = [];
3943
- for (const r of e) {
3944
- const i = af(r);
3945
- if (i === void 0) continue;
3946
- const o = typeof i == "number" ? i : i.rate;
3947
- t.has(o) || (t.add(o), n.push(i));
3948
- }
3949
- return n.length ? n : [...xs];
3950
- }, lf = (e) => Ji(e).map((t) => {
3951
- if (typeof t == "number") {
3952
- const i = Ms(t);
3953
- return {
3954
- rate: t,
3955
- label: i,
3956
- ariaLabel: _l(i, !0)
3957
- };
3948
+ }, Ms = (e) => `${e}x`, _l = (e, t) => e.toLowerCase() === "normal" ? "Normal speed" : t ? `Speed ${e}` : `${e} speed`, sf = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : _l(e, n), Nr = (e) => {
3949
+ const t = Array.isArray(e) ? e : [...xs];
3950
+ if (t.length === 0) return [];
3951
+ const n = /* @__PURE__ */ new Set(), r = [];
3952
+ for (const s of t) {
3953
+ const a = Zi(s), l = As(typeof s == "number" ? s : a.rate);
3954
+ if (l === void 0 || n.has(l)) continue;
3955
+ n.add(l);
3956
+ const c = l === 1 ? "Normal" : Ms(l), u = typeof s == "number" ? c : Cs(a.label) || c, f = typeof s == "number" ? l === 1 ? "Normal speed" : _l(u, !0) : sf(u, Cs(a.ariaLabel), u === c);
3957
+ r.push({
3958
+ rate: l,
3959
+ label: u,
3960
+ ariaLabel: f,
3961
+ isDefault: !1,
3962
+ requestedDefault: a.default === !0 || a.isDefault === !0
3963
+ });
3958
3964
  }
3959
- const n = Ms(t.rate), r = t.label || n;
3960
- return {
3961
- rate: t.rate,
3962
- label: r,
3963
- ariaLabel: sf(r, t.ariaLabel, r === n)
3964
- };
3965
- }), cf = (e) => {
3965
+ if (!r.length) return Nr(xs);
3966
+ if (!n.has(1)) {
3967
+ const s = {
3968
+ rate: 1,
3969
+ label: "Normal",
3970
+ ariaLabel: "Normal speed",
3971
+ isDefault: !1,
3972
+ requestedDefault: !1
3973
+ }, a = r.findIndex((l) => l.rate > 1);
3974
+ a >= 0 ? r.splice(a, 0, s) : r.push(s);
3975
+ }
3976
+ const i = r.findIndex((s) => s.requestedDefault), o = i >= 0 ? i : r.findIndex((s) => s.rate === 1);
3977
+ return r.map(({ requestedDefault: s, ...a }, l) => ({
3978
+ ...a,
3979
+ isDefault: l === o
3980
+ }));
3981
+ }, kg = Object.freeze([
3982
+ 0.8,
3983
+ 1,
3984
+ 1.25
3985
+ ]), af = (e) => {
3966
3986
  const t = {
3967
3987
  ...e,
3968
- layoutMode: Jr(e.layoutMode)
3988
+ layoutMode: Zr(e.layoutMode)
3969
3989
  }, n = e.backend || "browser";
3970
3990
  if (!of(n)) return t;
3971
3991
  const r = {
@@ -3988,14 +4008,14 @@ var Xd = {
3988
4008
  ...r,
3989
4009
  defaultVoice: Ee(r.defaultVoice, "en-US-Wavenet-A")
3990
4010
  } : r;
3991
- }, xi = (e) => {
3992
- const t = Es(e), n = Es(t.settings);
3993
- return cf({
4011
+ }, Ai = (e) => {
4012
+ const t = Zi(e), n = Zi(t.settings);
4013
+ return af({
3994
4014
  ...t,
3995
4015
  ...n
3996
4016
  });
3997
- }, Zi = (e) => e.backend || "browser", bl = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, yl = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), uf = (e) => {
3998
- const t = Zi(e), n = bl(e, t), r = yl(e, n), i = si(e.mathSpeech);
4017
+ }, Qi = (e) => e.backend || "browser", bl = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, yl = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), lf = (e) => {
4018
+ const t = Qi(e), n = bl(e, t), r = yl(e, n), i = ai(e.mathSpeech);
3999
4019
  return {
4000
4020
  voice: e.defaultVoice,
4001
4021
  rate: e.rate,
@@ -4021,7 +4041,7 @@ var Xd = {
4021
4041
  validateEndpoint: e.validateEndpoint,
4022
4042
  ...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
4023
4043
  };
4024
- }, Tl = (e) => Jr(e.layoutMode), df = (e) => {
4044
+ }, Tl = (e) => Zr(e.layoutMode), cf = (e) => {
4025
4045
  switch (Tl(e)) {
4026
4046
  case "reserved-row":
4027
4047
  return {
@@ -4048,21 +4068,21 @@ var Xd = {
4048
4068
  }
4049
4069
  };
4050
4070
  }
4051
- }, Gn = /* @__PURE__ */ new Map(), ff = "__pieToolElementUnmount", Os = "pie-tool-active-change", hf = {
4071
+ }, Gn = /* @__PURE__ */ new Map(), uf = "__pieToolElementUnmount", Os = "pie-tool-active-change", df = {
4052
4072
  toolId: "textToSpeech",
4053
4073
  name: "Text to Speech",
4054
4074
  description: "Read content aloud",
4055
4075
  icon: "volume-up",
4056
4076
  provider: {
4057
4077
  getProviderId: () => "tts",
4058
- createProvider: (e) => new Hd(Zi(xi(e))),
4078
+ createProvider: (e) => new Wd(Qi(Ai(e))),
4059
4079
  getInitConfig: (e) => {
4060
- const t = xi(e), n = Zi(t), r = bl(t, n);
4080
+ const t = Ai(e), n = Qi(t), r = bl(t, n);
4061
4081
  return {
4062
4082
  backend: n,
4063
4083
  serverProvider: r,
4064
4084
  transportMode: yl(t, r),
4065
- ...uf(t)
4085
+ ...lf(t)
4066
4086
  };
4067
4087
  },
4068
4088
  getAuthFetcher: (e) => {
@@ -4071,9 +4091,9 @@ var Xd = {
4071
4091
  },
4072
4092
  sanitizeConfig: (e) => {
4073
4093
  const t = e.settings && typeof e.settings == "object" ? { ...e.settings } : void 0;
4074
- t && "layoutMode" in t && (t.layoutMode = Jr(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = Ji(t.speedOptions));
4094
+ t && "layoutMode" in t && (t.layoutMode = Zr(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = Nr(t.speedOptions));
4075
4095
  const n = { ...e };
4076
- return "layoutMode" in n && (n.layoutMode = Jr(n.layoutMode)), "speedOptions" in n && (n.speedOptions = Ji(n.speedOptions)), t && (n.settings = t), n;
4096
+ return "layoutMode" in n && (n.layoutMode = Zr(n.layoutMode)), "speedOptions" in n && (n.speedOptions = Nr(n.speedOptions)), t && (n.settings = t), n;
4077
4097
  },
4078
4098
  lazy: !0
4079
4099
  },
@@ -4085,17 +4105,17 @@ var Xd = {
4085
4105
  "speechOutput"
4086
4106
  ],
4087
4107
  isVisibleInContext(e) {
4088
- return oi(e);
4108
+ return si(e);
4089
4109
  },
4090
4110
  renderToolbar(e, t) {
4091
- const n = () => xi(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => lf(n().speedOptions), i = () => Tl(n()), o = () => df(n()), s = Mo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4111
+ const n = () => Ai(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => Nr(n().speedOptions), i = () => Tl(n()), o = () => cf(n()), s = Oo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4092
4112
  const u = t.ui?.size;
4093
4113
  return u === "sm" || u === "lg" ? u : "md";
4094
4114
  }, l = () => {
4095
4115
  let u = Gn.get(s);
4096
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (Gn.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[ff] = () => {
4116
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (Gn.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[uf] = () => {
4097
4117
  Gn.get(s) === u && Gn.delete(s);
4098
- }, Gn.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 = r(), u;
4118
+ }, Gn.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 = r(), u.showSingleSpeedOption = n().showSingleSpeedOption === !0, u;
4099
4119
  }, c = o();
4100
4120
  return {
4101
4121
  toolId: this.toolId,
@@ -4119,13 +4139,13 @@ var Xd = {
4119
4139
  },
4120
4140
  sync: () => {
4121
4141
  const u = l();
4122
- 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 = r();
4142
+ 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 = r(), u.showSingleSpeedOption = n().showSingleSpeedOption === !0;
4123
4143
  }
4124
4144
  };
4125
4145
  }
4126
4146
  };
4127
4147
  function mt(e, t) {
4128
- const n = Mo(e, t.scope.level, t.scope.scopeId);
4148
+ const n = Oo(e, t.scope.level, t.scope.scopeId);
4129
4149
  return {
4130
4150
  fullToolId: n,
4131
4151
  isActive: () => t.isToolVisible(n),
@@ -4139,10 +4159,10 @@ function vt(e) {
4139
4159
  const t = e.isActive();
4140
4160
  e.button.active = t, e.overlay.visible = t, e.onActiveChange?.(t);
4141
4161
  }
4142
- function Ro(e, t) {
4162
+ function Lo(e, t) {
4143
4163
  e.setAttribute("data-pie-tool-surface", t);
4144
4164
  }
4145
- var pf = {
4165
+ var ff = {
4146
4166
  toolId: "ruler",
4147
4167
  name: "Ruler",
4148
4168
  description: "On-screen ruler for measurements",
@@ -4154,7 +4174,7 @@ var pf = {
4154
4174
  ],
4155
4175
  pnpSupportIds: ["ruler", "measurement"],
4156
4176
  isVisibleInContext(e) {
4157
- return ii(e);
4177
+ return oi(e);
4158
4178
  },
4159
4179
  renderToolbar(e, t) {
4160
4180
  const n = mt(this.toolId, t), r = {
@@ -4167,7 +4187,7 @@ var pf = {
4167
4187
  onClick: () => t.toggleTool(this.toolId),
4168
4188
  active: n.isActive()
4169
4189
  }, i = t.componentOverrides ?? {}, o = Qe(this.toolId, e, t, i);
4170
- return o.setAttribute("tool-id", n.fullToolId), Ro(o, "frameless"), {
4190
+ return o.setAttribute("tool-id", n.fullToolId), Lo(o, "frameless"), {
4171
4191
  toolId: this.toolId,
4172
4192
  button: r,
4173
4193
  elements: [{
@@ -4184,7 +4204,7 @@ var pf = {
4184
4204
  subscribeActive: n.subscribeActive
4185
4205
  };
4186
4206
  }
4187
- }, gf = {
4207
+ }, hf = {
4188
4208
  toolId: "protractor",
4189
4209
  name: "Protractor",
4190
4210
  description: "On-screen protractor for angle measurements",
@@ -4196,7 +4216,7 @@ var pf = {
4196
4216
  ],
4197
4217
  pnpSupportIds: ["protractor", "angleMeasurement"],
4198
4218
  isVisibleInContext(e) {
4199
- return ii(e);
4219
+ return oi(e);
4200
4220
  },
4201
4221
  renderToolbar(e, t) {
4202
4222
  const n = mt(this.toolId, t), r = {
@@ -4209,7 +4229,7 @@ var pf = {
4209
4229
  onClick: () => t.toggleTool(this.toolId),
4210
4230
  active: n.isActive()
4211
4231
  }, i = t.componentOverrides ?? {}, o = Qe(this.toolId, e, t, i);
4212
- return o.setAttribute("tool-id", n.fullToolId), Ro(o, "frameless"), {
4232
+ return o.setAttribute("tool-id", n.fullToolId), Lo(o, "frameless"), {
4213
4233
  toolId: this.toolId,
4214
4234
  button: r,
4215
4235
  elements: [{
@@ -4226,7 +4246,7 @@ var pf = {
4226
4246
  subscribeActive: n.subscribeActive
4227
4247
  };
4228
4248
  }
4229
- }, mf = {
4249
+ }, pf = {
4230
4250
  toolId: "answerEliminator",
4231
4251
  name: "Answer Eliminator",
4232
4252
  description: "Strike through answer choices",
@@ -4273,7 +4293,7 @@ var pf = {
4273
4293
  subscribeActive: n.subscribeActive
4274
4294
  };
4275
4295
  }
4276
- }, vf = {
4296
+ }, gf = {
4277
4297
  toolId: "highlighter",
4278
4298
  name: "Highlighter",
4279
4299
  description: "Highlight text",
@@ -4291,7 +4311,7 @@ var pf = {
4291
4311
  "annotation"
4292
4312
  ],
4293
4313
  isVisibleInContext(e) {
4294
- return oi(e);
4314
+ return si(e);
4295
4315
  },
4296
4316
  renderToolbar(e, t) {
4297
4317
  const n = mt(this.toolId, t), r = {
@@ -4324,7 +4344,7 @@ var pf = {
4324
4344
  subscribeActive: n.subscribeActive
4325
4345
  };
4326
4346
  }
4327
- }, _f = {
4347
+ }, mf = {
4328
4348
  toolId: "lineReader",
4329
4349
  name: "Line Reader",
4330
4350
  description: "Reading guide overlay",
@@ -4343,7 +4363,7 @@ var pf = {
4343
4363
  "trackingGuide"
4344
4364
  ],
4345
4365
  isVisibleInContext(e) {
4346
- return oi(e);
4366
+ return si(e);
4347
4367
  },
4348
4368
  renderToolbar(e, t) {
4349
4369
  const n = mt(this.toolId, t), r = {
@@ -4356,7 +4376,7 @@ var pf = {
4356
4376
  onClick: () => t.toggleTool(this.toolId),
4357
4377
  active: n.isActive()
4358
4378
  }, i = t.componentOverrides ?? {}, o = Qe(this.toolId, e, t, i);
4359
- return o.setAttribute("tool-id", n.fullToolId), Ro(o, "frameless"), {
4379
+ return o.setAttribute("tool-id", n.fullToolId), Lo(o, "frameless"), {
4360
4380
  toolId: this.toolId,
4361
4381
  button: r,
4362
4382
  elements: [{
@@ -4373,7 +4393,7 @@ var pf = {
4373
4393
  subscribeActive: n.subscribeActive
4374
4394
  };
4375
4395
  }
4376
- }, bf = {
4396
+ }, vf = {
4377
4397
  toolId: "theme",
4378
4398
  name: "Theme",
4379
4399
  description: "Accessible themes and contrast",
@@ -4428,7 +4448,7 @@ var pf = {
4428
4448
  subscribeActive: n.subscribeActive
4429
4449
  };
4430
4450
  }
4431
- }, yf = {
4451
+ }, _f = {
4432
4452
  toolId: "annotationToolbar",
4433
4453
  name: "Highlighter",
4434
4454
  description: "Highlight and annotate text",
@@ -4449,7 +4469,7 @@ var pf = {
4449
4469
  "annotation"
4450
4470
  ],
4451
4471
  isVisibleInContext(e) {
4452
- return oi(e);
4472
+ return si(e);
4453
4473
  },
4454
4474
  renderToolbar(e, t) {
4455
4475
  const n = mt(this.toolId, t), r = {
@@ -4479,7 +4499,7 @@ var pf = {
4479
4499
  subscribeActive: n.subscribeActive
4480
4500
  };
4481
4501
  }
4482
- }, Tf = {
4502
+ }, bf = {
4483
4503
  toolId: "graph",
4484
4504
  name: "Graph",
4485
4505
  description: "Graphing calculator and coordinate plane",
@@ -4492,7 +4512,7 @@ var pf = {
4492
4512
  "graphingTool"
4493
4513
  ],
4494
4514
  isVisibleInContext(e) {
4495
- return ii(e);
4515
+ return oi(e);
4496
4516
  },
4497
4517
  renderToolbar(e, t) {
4498
4518
  const n = mt(this.toolId, t), r = {
@@ -4532,7 +4552,7 @@ var pf = {
4532
4552
  subscribeActive: n.subscribeActive
4533
4553
  };
4534
4554
  }
4535
- }, Sf = {
4555
+ }, yf = {
4536
4556
  toolId: "periodicTable",
4537
4557
  name: "Periodic Table",
4538
4558
  description: "Chemistry periodic table reference",
@@ -4584,8 +4604,10 @@ var pf = {
4584
4604
  subscribeActive: n.subscribeActive
4585
4605
  };
4586
4606
  }
4587
- }, wf = [
4607
+ }, Tf = [
4588
4608
  Xd,
4609
+ df,
4610
+ ff,
4589
4611
  hf,
4590
4612
  pf,
4591
4613
  gf,
@@ -4593,11 +4615,9 @@ var pf = {
4593
4615
  vf,
4594
4616
  _f,
4595
4617
  bf,
4596
- yf,
4597
- Tf,
4598
- Sf
4618
+ yf
4599
4619
  ];
4600
- function kf(e = {}) {
4620
+ function Sf(e = {}) {
4601
4621
  const t = new Ad(), n = {
4602
4622
  toolTagMap: {
4603
4623
  ...fl,
@@ -4606,32 +4626,32 @@ function kf(e = {}) {
4606
4626
  toolComponentFactory: e.toolComponentFactory,
4607
4627
  toolComponentFactories: e.toolComponentFactories
4608
4628
  }, r = (i) => e.overrides?.[i.toolId] || i;
4609
- return e.includePackagedTools && Ef(t, {
4629
+ return e.includePackagedTools && wf(t, {
4610
4630
  toolIds: e.toolIds,
4611
4631
  applyOverrides: r
4612
4632
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
4613
4633
  }
4614
- function Ef(e, t = {}) {
4634
+ function wf(e, t = {}) {
4615
4635
  const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
4616
- for (const i of wf)
4636
+ for (const i of Tf)
4617
4637
  n && !n.has(i.toolId) || e.register(r(i));
4618
4638
  }
4619
- function xf(e = {}) {
4620
- return kf({
4639
+ function kf(e = {}) {
4640
+ return Sf({
4621
4641
  ...e,
4622
4642
  includePackagedTools: !0
4623
4643
  });
4624
4644
  }
4625
- function Af() {
4626
- const e = xf(), t = /* @__PURE__ */ new Set();
4645
+ function Ef() {
4646
+ const e = kf(), t = /* @__PURE__ */ new Set();
4627
4647
  for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
4628
4648
  return [...t].sort();
4629
4649
  }
4630
- var Cf = Af(), Eg = {
4631
- supports: [...Cf],
4650
+ var xf = Ef(), Eg = {
4651
+ supports: [...xf],
4632
4652
  prohibitedSupports: [],
4633
4653
  activateAtInit: []
4634
- }, Mf = {
4654
+ }, Af = {
4635
4655
  visual: {
4636
4656
  magnification: "magnification",
4637
4657
  screenMagnifier: "screenMagnifier",
@@ -4744,11 +4764,11 @@ var Cf = Af(), Eg = {
4744
4764
  itemGlossary: "itemGlossary",
4745
4765
  tutorialAvailable: "tutorialAvailable"
4746
4766
  }
4747
- }, xg = Object.values(Mf).flatMap((e) => Object.values(e)), Ag = al("ToolCoordinator"), Qi;
4767
+ }, xg = Object.values(Af).flatMap((e) => Object.values(e)), Ag = al("ToolCoordinator"), eo;
4748
4768
  (function(e) {
4749
4769
  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";
4750
- })(Qi || (Qi = {}));
4751
- var Of = /* @__PURE__ */ new Set([
4770
+ })(eo || (eo = {}));
4771
+ var Cf = /* @__PURE__ */ new Set([
4752
4772
  "speak",
4753
4773
  "p",
4754
4774
  "s",
@@ -4762,7 +4782,7 @@ var Of = /* @__PURE__ */ new Set([
4762
4782
  char: t[r],
4763
4783
  rawOffset: n === null ? null : n + r
4764
4784
  });
4765
- }, If = (e, t, n) => {
4785
+ }, Mf = (e, t, n) => {
4766
4786
  const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4767
4787
  return r ? (Pr(e, Sl(r[0]), n), r[0].length) : 0;
4768
4788
  }, Rs = (e) => {
@@ -4770,7 +4790,7 @@ var Of = /* @__PURE__ */ new Set([
4770
4790
  char: " ",
4771
4791
  rawOffset: null
4772
4792
  });
4773
- }, Rf = (e) => {
4793
+ }, Of = (e) => {
4774
4794
  const t = /* @__PURE__ */ new Map(), n = [];
4775
4795
  let r = !0;
4776
4796
  for (const i of e) {
@@ -4786,7 +4806,7 @@ var Of = /* @__PURE__ */ new Set([
4786
4806
  text: n.join(""),
4787
4807
  rawToSpokenOffsetMap: t
4788
4808
  };
4789
- }, Lf = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Pf = (e, t) => {
4809
+ }, If = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Rf = (e, t) => {
4790
4810
  const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
4791
4811
  return Sl(r?.[2] ?? r?.[3] ?? "") || null;
4792
4812
  }, wl = (e) => {
@@ -4796,7 +4816,7 @@ var Of = /* @__PURE__ */ new Set([
4796
4816
  const s = e[i];
4797
4817
  if (s !== "<") {
4798
4818
  if (s === "&") {
4799
- const p = If(t, e, i);
4819
+ const p = Mf(t, e, i);
4800
4820
  if (p > 0) {
4801
4821
  i += p;
4802
4822
  continue;
@@ -4811,9 +4831,9 @@ var Of = /* @__PURE__ */ new Set([
4811
4831
  continue;
4812
4832
  }
4813
4833
  r = !0;
4814
- const l = e.slice(i, a + 1), c = Lf(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
4834
+ const l = e.slice(i, a + 1), c = If(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
4815
4835
  if (!u && c === "sub") {
4816
- const p = Pf(l, "alias");
4836
+ const p = Rf(l, "alias");
4817
4837
  if (!p) {
4818
4838
  n = !0, i = a + 1;
4819
4839
  continue;
@@ -4831,16 +4851,16 @@ var Of = /* @__PURE__ */ new Set([
4831
4851
  i = a + 1;
4832
4852
  continue;
4833
4853
  }
4834
- c && !Of.has(c) && !Is.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && Rs(t), i = a + 1;
4854
+ c && !Cf.has(c) && !Is.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && Rs(t), i = a + 1;
4835
4855
  }
4836
- const o = Rf(t);
4856
+ const o = Of(t);
4837
4857
  return {
4838
4858
  spokenText: G(o.text),
4839
4859
  rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
4840
4860
  unsupportedSemantic: n,
4841
4861
  hasMarkup: r
4842
4862
  };
4843
- }, Nf = hl(), kl = /* @__PURE__ */ new Map([
4863
+ }, Lf = hl(), kl = /* @__PURE__ */ new Map([
4844
4864
  ["zero", "0"],
4845
4865
  ["one", "1"],
4846
4866
  ["two", "2"],
@@ -4852,7 +4872,7 @@ var Of = /* @__PURE__ */ new Set([
4852
4872
  ["eight", "8"],
4853
4873
  ["nine", "9"],
4854
4874
  ["ten", "10"]
4855
- ]), $f = [
4875
+ ]), Nf = [
4856
4876
  {
4857
4877
  phrase: [
4858
4878
  "plus",
@@ -4927,9 +4947,9 @@ var Of = /* @__PURE__ */ new Set([
4927
4947
  visible: "+",
4928
4948
  score: 5
4929
4949
  }
4930
- ], eo = (e) => {
4950
+ ], to = (e) => {
4931
4951
  const t = [];
4932
- for (const n of e.matchAll(Nf)) {
4952
+ for (const n of e.matchAll(Lf)) {
4933
4953
  const r = n[0], i = n.index ?? 0;
4934
4954
  t.push({
4935
4955
  text: r,
@@ -4939,16 +4959,16 @@ var Of = /* @__PURE__ */ new Set([
4939
4959
  });
4940
4960
  }
4941
4961
  return t;
4942
- }, to = (e) => kl.get(e.normalized) || e.normalized, zf = (e, t) => {
4962
+ }, no = (e) => kl.get(e.normalized) || e.normalized, Pf = (e, t) => {
4943
4963
  const n = [];
4944
4964
  for (let r = 0; r < e.length; r++) {
4945
- for (let i = 0; i < t.length; i++) to(e[r]) === to(t[i]) && n.push({
4965
+ for (let i = 0; i < t.length; i++) no(e[r]) === no(t[i]) && n.push({
4946
4966
  spokenStartToken: r,
4947
4967
  spokenEndToken: r + 1,
4948
4968
  visibleToken: i,
4949
4969
  score: 10
4950
4970
  });
4951
- for (const i of $f) {
4971
+ for (const i of Nf) {
4952
4972
  const o = e.slice(r, r + i.phrase.length);
4953
4973
  if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
4954
4974
  for (let s = 0; s < t.length; s++)
@@ -4961,8 +4981,8 @@ var Of = /* @__PURE__ */ new Set([
4961
4981
  }
4962
4982
  }
4963
4983
  return n;
4964
- }, Df = (e, t) => {
4965
- const n = zf(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4984
+ }, $f = (e, t) => {
4985
+ const n = Pf(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4966
4986
  for (let l = 0; l < n.length; l++) {
4967
4987
  const c = n[l];
4968
4988
  r[l] = c.score;
@@ -4991,12 +5011,12 @@ var Of = /* @__PURE__ */ new Set([
4991
5011
  score: l.score
4992
5012
  };
4993
5013
  });
4994
- }, Wf = (e, t, n) => {
5014
+ }, zf = (e, t, n) => {
4995
5015
  if (e.length === 0) return 0;
4996
5016
  const r = e.length / Math.max(1, Math.min(t.length, n.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
4997
5017
  return Math.min(1, r * i);
4998
5018
  }, El = (e) => {
4999
- const t = wl(e.speechText), n = G(e.visibleText), r = t.spokenText, i = eo(r), o = eo(n), s = t.unsupportedSemantic ? [] : Df(i, o), a = Wf(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", f = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
5019
+ const t = wl(e.speechText), n = G(e.visibleText), r = t.spokenText, i = to(r), o = to(n), s = t.unsupportedSemantic ? [] : $f(i, o), a = zf(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", f = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
5000
5020
  return {
5001
5021
  speechText: e.speechText,
5002
5022
  spokenText: r,
@@ -5009,16 +5029,16 @@ var Of = /* @__PURE__ */ new Set([
5009
5029
  visibleTokens: o,
5010
5030
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
5011
5031
  };
5012
- }, Lo = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, xl = (e) => {
5032
+ }, No = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, xl = (e) => {
5013
5033
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5014
- const t = eo(e)[0];
5034
+ const t = to(e)[0];
5015
5035
  return t ? kl.get(t.normalized) || t.normalized : null;
5016
5036
  }, Ls = (e, t, n) => {
5017
5037
  const r = xl(n);
5018
5038
  if (!t || !r) return !1;
5019
- const i = Lo(e.spokenTokens, t.start);
5020
- return i ? to(i) === r : !1;
5021
- }, Ps = (e, t) => {
5039
+ const i = No(e.spokenTokens, t.start);
5040
+ return i ? no(i) === r : !1;
5041
+ }, Ns = (e, t) => {
5022
5042
  const n = e.rawToSpokenOffsetMap.get(t);
5023
5043
  if (n !== void 0) return n;
5024
5044
  for (let r = t; r < e.speechText.length; r++) {
@@ -5027,27 +5047,27 @@ var Of = /* @__PURE__ */ new Set([
5027
5047
  if (e.speechText[r] === ">") break;
5028
5048
  }
5029
5049
  return null;
5030
- }, Ns = (e, t, n) => {
5031
- const r = Ps(e, t);
5050
+ }, Ps = (e, t, n) => {
5051
+ const r = Ns(e, t);
5032
5052
  if (r === null) return null;
5033
- const i = Ps(e, Math.max(t, t + n - 1)), o = Lo(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
5053
+ const i = Ns(e, Math.max(t, t + n - 1)), o = No(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
5034
5054
  return {
5035
5055
  start: r,
5036
5056
  length: Math.max(1, s)
5037
5057
  };
5038
5058
  }, $s = (e, t, n) => {
5039
5059
  if (t < 0 || t >= e.spokenText.length) return null;
5040
- const r = Lo(e.spokenTokens, t);
5060
+ const r = No(e.spokenTokens, t);
5041
5061
  return r ? {
5042
5062
  start: t,
5043
5063
  length: Math.min(n, r.end - t)
5044
5064
  } : null;
5045
- }, Hf = (e, t, n = 1, r) => {
5065
+ }, Df = (e, t, n = 1, r) => {
5046
5066
  if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
5047
5067
  const i = Math.max(1, Number.isFinite(n) ? n : 1);
5048
5068
  if (r && /^<[^>]+>$/.test(r.trim())) return null;
5049
5069
  if (e.boundaryOffsetMode === "raw-ssml") {
5050
- const o = Ns(e, t, i), s = $s(e, t, i);
5070
+ const o = Ps(e, t, i), s = $s(e, t, i);
5051
5071
  if (r) {
5052
5072
  if (Ls(e, o, r)) return o;
5053
5073
  if (Ls(e, s, r)) return s;
@@ -5055,8 +5075,8 @@ var Of = /* @__PURE__ */ new Set([
5055
5075
  }
5056
5076
  return o || s;
5057
5077
  }
5058
- return $s(e, t, i) || Ns(e, t, i);
5059
- }, Ff = (e, t) => {
5078
+ return $s(e, t, i) || Ps(e, t, i);
5079
+ }, Hf = (e, t) => {
5060
5080
  if (e.playbackMode === "region-fallback") return null;
5061
5081
  const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
5062
5082
  if (n) return {
@@ -5078,7 +5098,7 @@ var Of = /* @__PURE__ */ new Set([
5078
5098
  start: Math.min(r.visibleStart, i.visibleStart),
5079
5099
  end: Math.max(r.visibleEnd, i.visibleEnd)
5080
5100
  } : null;
5081
- }, Bf = /* @__PURE__ */ new Map([
5101
+ }, Wf = /* @__PURE__ */ new Map([
5082
5102
  ["+", ["plus"]],
5083
5103
  ["-", ["minus", "negative"]],
5084
5104
  ["−", ["minus", "negative"]],
@@ -5102,12 +5122,12 @@ var Of = /* @__PURE__ */ new Set([
5102
5122
  ["•", ["times"]],
5103
5123
  ["·", ["times"]],
5104
5124
  ["⁢", ["times", "multiplied by"]]
5105
- ]), Uf = /* @__PURE__ */ new Map([
5125
+ ]), Ff = /* @__PURE__ */ new Map([
5106
5126
  ["⁡", "function-application"],
5107
5127
  ["⁢", "implicit-multiply"],
5108
5128
  ["⁣", "invisible-separator"],
5109
5129
  ["⁤", "invisible-plus"]
5110
- ]), Al = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), jf = /* @__PURE__ */ new Map([
5130
+ ]), Al = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), Bf = /* @__PURE__ */ new Map([
5111
5131
  ["msqrt", "radical"],
5112
5132
  ["mroot", "radical"],
5113
5133
  ["msub", "subscript"],
@@ -5117,11 +5137,11 @@ var Of = /* @__PURE__ */ new Set([
5117
5137
  ["munderover", "underoverscript"],
5118
5138
  ["mmultiscripts", "multiscript"],
5119
5139
  ["menclose", "enclosure"]
5120
- ]), Gf = (e) => e.replace(/\s+/g, " ").trim(), Qt = (e) => (e.localName || e.tagName || "").toLowerCase(), Vf = (e) => e.nodeType === Node.ELEMENT_NODE, Ln = (e) => Array.from(e.childNodes).filter(Vf), Po = (e) => Gf(e.textContent || ""), ht = (e, t) => ({
5140
+ ]), Uf = (e) => e.replace(/\s+/g, " ").trim(), Qt = (e) => (e.localName || e.tagName || "").toLowerCase(), jf = (e) => e.nodeType === Node.ELEMENT_NODE, Ln = (e) => Array.from(e.childNodes).filter(jf), Po = (e) => Uf(e.textContent || ""), ht = (e, t) => ({
5121
5141
  type: "element-range",
5122
5142
  quality: t,
5123
5143
  element: e
5124
- }), qf = (e) => {
5144
+ }), Gf = (e) => {
5125
5145
  switch (e) {
5126
5146
  case "mi":
5127
5147
  return "identifier";
@@ -5137,15 +5157,15 @@ var Of = /* @__PURE__ */ new Set([
5137
5157
  default:
5138
5158
  return "unknown";
5139
5159
  }
5140
- }, Yf = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), Xf = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Al.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? Bf.get(e) || [] : [], nn = (e) => {
5141
- const t = e.normalized ?? Yf(e.text, e.kind || "unknown");
5160
+ }, Vf = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), qf = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Al.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? Wf.get(e) || [] : [], nn = (e) => {
5161
+ const t = e.normalized ?? Vf(e.text, e.kind || "unknown");
5142
5162
  return {
5143
5163
  id: `math-token-${e.state.nextId++}`,
5144
5164
  kind: e.kind,
5145
5165
  role: e.role,
5146
5166
  text: e.text,
5147
5167
  normalized: t,
5148
- spokenAliases: Xf(e.text, e.kind, e.role),
5168
+ spokenAliases: qf(e.text, e.kind, e.role),
5149
5169
  sourceElement: e.sourceElement,
5150
5170
  path: e.path,
5151
5171
  target: e.target || ht(e.sourceElement, "element-range"),
@@ -5155,7 +5175,7 @@ var Of = /* @__PURE__ */ new Set([
5155
5175
  e[n].push(t);
5156
5176
  }, Cl = (e, t, n) => {
5157
5177
  Ln(e).forEach((r, i) => pt(r, t, `${n}/${Qt(r)}[${i}]`));
5158
- }, Kf = (e, t, n) => {
5178
+ }, Yf = (e, t, n) => {
5159
5179
  const r = Ln(e);
5160
5180
  r[0] && pt(r[0], t, `${n}/numerator`), rn(t, nn({
5161
5181
  state: t,
@@ -5166,7 +5186,7 @@ var Of = /* @__PURE__ */ new Set([
5166
5186
  path: n,
5167
5187
  target: ht(e, "element-range")
5168
5188
  })), r[1] && pt(r[1], t, `${n}/denominator`);
5169
- }, Jf = (e, t, n) => {
5189
+ }, Xf = (e, t, n) => {
5170
5190
  const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
5171
5191
  rn(t, nn({
5172
5192
  state: t,
@@ -5185,7 +5205,7 @@ var Of = /* @__PURE__ */ new Set([
5185
5205
  path: `${n}/close`,
5186
5206
  target: ht(e, "element-range")
5187
5207
  }));
5188
- }, Zf = (e, t, n) => {
5208
+ }, Kf = (e, t, n) => {
5189
5209
  const r = Ln(e);
5190
5210
  r[0] && pt(r[0], t, `${n}/base`);
5191
5211
  const i = r[1];
@@ -5205,7 +5225,7 @@ var Of = /* @__PURE__ */ new Set([
5205
5225
  return;
5206
5226
  }
5207
5227
  pt(i, t, `${n}/exponent`);
5208
- }, Qf = (e, t, n, r) => {
5228
+ }, Jf = (e, t, n, r) => {
5209
5229
  rn(t, nn({
5210
5230
  state: t,
5211
5231
  kind: "structure",
@@ -5216,7 +5236,7 @@ var Of = /* @__PURE__ */ new Set([
5216
5236
  path: n,
5217
5237
  target: ht(e, "element-range")
5218
5238
  }));
5219
- }, eh = (e, t, n) => {
5239
+ }, Zf = (e, t, n) => {
5220
5240
  let r = 0;
5221
5241
  for (const i of Ln(e))
5222
5242
  (Qt(i) === "mtr" || Qt(i) === "mlabeledtr") && (r++, rn(t, nn({
@@ -5229,10 +5249,10 @@ var Of = /* @__PURE__ */ new Set([
5229
5249
  path: `${n}/row[${r}]`,
5230
5250
  target: ht(i, "region-fallback")
5231
5251
  }), "layoutTargets")), pt(i, t, `${n}/${Qt(i)}[${r}]`);
5232
- }, th = (e, t, n) => {
5252
+ }, Qf = (e, t, n) => {
5233
5253
  const r = Po(e);
5234
5254
  if (!r) return;
5235
- const i = qf(Qt(e)), o = i === "operator" ? Uf.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
5255
+ const i = Gf(Qt(e)), o = i === "operator" ? Ff.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
5236
5256
  rn(t, nn({
5237
5257
  state: t,
5238
5258
  kind: i,
@@ -5263,19 +5283,19 @@ var Of = /* @__PURE__ */ new Set([
5263
5283
  case "mtext":
5264
5284
  case "ms":
5265
5285
  case "mspace":
5266
- th(e, t, n);
5286
+ Qf(e, t, n);
5267
5287
  return;
5268
5288
  case "mfrac":
5269
- Kf(e, t, n);
5289
+ Yf(e, t, n);
5270
5290
  return;
5271
5291
  case "msup":
5272
- Zf(e, t, n);
5292
+ Kf(e, t, n);
5273
5293
  return;
5274
5294
  case "mfenced":
5275
- Jf(e, t, n);
5295
+ Xf(e, t, n);
5276
5296
  return;
5277
5297
  case "mtable":
5278
- eh(e, t, n);
5298
+ Zf(e, t, n);
5279
5299
  return;
5280
5300
  case "mphantom":
5281
5301
  return;
@@ -5285,15 +5305,15 @@ var Of = /* @__PURE__ */ new Set([
5285
5305
  return;
5286
5306
  }
5287
5307
  default: {
5288
- const i = jf.get(r);
5308
+ const i = Bf.get(r);
5289
5309
  if (i) {
5290
- Qf(e, t, n, i);
5310
+ Jf(e, t, n, i);
5291
5311
  return;
5292
5312
  }
5293
5313
  Cl(e, t, n);
5294
5314
  }
5295
5315
  }
5296
- }, nh = (e) => {
5316
+ }, eh = (e) => {
5297
5317
  const t = {
5298
5318
  tokens: [],
5299
5319
  layoutTargets: [],
@@ -5304,7 +5324,7 @@ var Of = /* @__PURE__ */ new Set([
5304
5324
  layoutTargets: t.layoutTargets,
5305
5325
  expressionTarget: ht(e, "region-fallback")
5306
5326
  };
5307
- }, rh = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, ih = 0.95, oh = (e) => {
5327
+ }, th = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, nh = 0.95, rh = (e) => {
5308
5328
  const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
5309
5329
  const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
5310
5330
  if (o.length === 0) return;
@@ -5329,11 +5349,11 @@ var Of = /* @__PURE__ */ new Set([
5329
5349
  o && (r = i.length);
5330
5350
  }
5331
5351
  return r;
5332
- }, sh = (e, t) => {
5352
+ }, ih = (e, t) => {
5333
5353
  const n = [];
5334
5354
  let r = 0;
5335
5355
  for (const i of t) {
5336
- const o = oh(i);
5356
+ const o = rh(i);
5337
5357
  if (i.optional) {
5338
5358
  const s = zs(e, r, o);
5339
5359
  s > 0 && (n.push({
@@ -5355,23 +5375,23 @@ var Of = /* @__PURE__ */ new Set([
5355
5375
  }
5356
5376
  }
5357
5377
  return n;
5358
- }, ah = (e, t, n) => {
5378
+ }, oh = (e, t, n) => {
5359
5379
  const r = n.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
5360
5380
  return r > 0 && i === r && o === t.length;
5361
- }, lh = (e) => e.map(({ speechTokens: t, math: n }) => ({
5381
+ }, sh = (e) => e.map(({ speechTokens: t, math: n }) => ({
5362
5382
  speechTokenIds: t.map((r) => r.id),
5363
5383
  mathTokenIds: [n.id],
5364
5384
  score: 1,
5365
5385
  confidence: 1,
5366
5386
  target: n.target
5367
- })), ch = (e) => {
5368
- const t = e.minExactWordConfidence ?? ih, n = sh(e.speech.tokens, e.math.tokens), r = ah(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
5387
+ })), ah = (e) => {
5388
+ const t = e.minExactWordConfidence ?? nh, n = ih(e.speech.tokens, e.math.tokens), r = oh(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
5369
5389
  return {
5370
- segments: r >= t ? lh(n) : [],
5390
+ segments: r >= t ? sh(n) : [],
5371
5391
  confidence: r,
5372
5392
  fallbackTarget: e.math.expressionTarget
5373
5393
  };
5374
- }, Ml = hl(), uh = /* @__PURE__ */ new Map([
5394
+ }, Ml = hl(), lh = /* @__PURE__ */ new Map([
5375
5395
  ["zero", "0"],
5376
5396
  ["one", "1"],
5377
5397
  ["two", "2"],
@@ -5385,8 +5405,8 @@ var Of = /* @__PURE__ */ new Set([
5385
5405
  ["ten", "10"]
5386
5406
  ]), Ol = (e) => {
5387
5407
  const t = e.toLowerCase();
5388
- return uh.get(t) || t;
5389
- }, dh = (e) => {
5408
+ return lh.get(t) || t;
5409
+ }, ch = (e) => {
5390
5410
  const t = [];
5391
5411
  for (const n of e.matchAll(Ml)) {
5392
5412
  const r = n[0], i = n.index ?? 0;
@@ -5407,17 +5427,17 @@ var Of = /* @__PURE__ */ new Set([
5407
5427
  return {
5408
5428
  speechText: e.speechText,
5409
5429
  spokenText: t.spokenText,
5410
- tokens: dh(t.spokenText),
5430
+ tokens: ch(t.spokenText),
5411
5431
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
5412
5432
  boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
5413
5433
  unsupportedSemantic: t.unsupportedSemantic,
5414
5434
  hasMarkup: t.hasMarkup
5415
5435
  };
5416
- }, No = (e) => {
5436
+ }, $o = (e) => {
5417
5437
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5418
5438
  const t = e.match(Ml);
5419
5439
  return t?.[0] ? Ol(t[0]) : null;
5420
- }, fh = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, hh = (e, t) => {
5440
+ }, uh = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, dh = (e, t) => {
5421
5441
  const n = e.rawToSpokenOffsetMap.get(t);
5422
5442
  if (n !== void 0) return n;
5423
5443
  for (let r = t; r < e.speechText.length; r++) {
@@ -5426,57 +5446,57 @@ var Of = /* @__PURE__ */ new Set([
5426
5446
  if (e.speechText[r] === ">") break;
5427
5447
  }
5428
5448
  return null;
5429
- }, no = (e, t, n) => {
5449
+ }, ro = (e, t, n) => {
5430
5450
  if (t === null) return null;
5431
- const r = fh(e.tokens, t);
5451
+ const r = uh(e.tokens, t);
5432
5452
  return r ? {
5433
5453
  token: r,
5434
5454
  start: t,
5435
5455
  length: Math.max(1, Math.min(n, r.end - t)),
5436
5456
  confidence: 0.75
5437
5457
  } : null;
5438
- }, ro = (e, t) => {
5439
- const n = No(t);
5458
+ }, io = (e, t) => {
5459
+ const n = $o(t);
5440
5460
  return !!(e && n && e.token.normalized === n);
5441
- }, ph = (e) => {
5461
+ }, fh = (e) => {
5442
5462
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5443
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = no(e.tokenization, hh(e.tokenization, e.position), t), r = no(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5444
- return ro(n, e.boundaryWord) ? {
5463
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = ro(e.tokenization, dh(e.tokenization, e.position), t), r = ro(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5464
+ return io(n, e.boundaryWord) ? {
5445
5465
  ...n,
5446
5466
  confidence: 1
5447
- } : ro(r, e.boundaryWord) ? {
5467
+ } : io(r, e.boundaryWord) ? {
5448
5468
  ...r,
5449
5469
  confidence: 1
5450
- } : e.boundaryWord && No(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
5451
- }, gh = (e) => {
5470
+ } : e.boundaryWord && $o(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
5471
+ }, hh = (e) => {
5452
5472
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5453
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = no(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5454
- return ro(n, e.boundaryWord) ? {
5473
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = ro(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5474
+ return io(n, e.boundaryWord) ? {
5455
5475
  ...n,
5456
5476
  confidence: 1
5457
- } : e.boundaryWord && No(e.boundaryWord) ? null : n;
5458
- }, Zr = (e) => {
5459
- const t = gr({ speechText: e.speechText }), n = nh(e.mathElement);
5477
+ } : e.boundaryWord && $o(e.boundaryWord) ? null : n;
5478
+ }, Qr = (e) => {
5479
+ const t = gr({ speechText: e.speechText }), n = eh(e.mathElement);
5460
5480
  return {
5461
5481
  speech: t,
5462
5482
  math: n,
5463
- result: ch({
5483
+ result: ah({
5464
5484
  speech: t,
5465
5485
  math: n
5466
5486
  })
5467
5487
  };
5468
- }, mh = (e, t) => {
5469
- const n = gh({
5488
+ }, ph = (e, t) => {
5489
+ const n = hh({
5470
5490
  tokenization: e.speech,
5471
5491
  position: t.position,
5472
5492
  length: t.length,
5473
5493
  boundaryWord: t.boundaryWord
5474
5494
  });
5475
- return rh({
5495
+ return th({
5476
5496
  alignment: e.result,
5477
5497
  boundary: n
5478
5498
  });
5479
- }, vh = (e, t) => {
5499
+ }, gh = (e, t) => {
5480
5500
  if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5481
5501
  const n = gr({ speechText: t.boundaryWord }).tokens[0];
5482
5502
  if (!n) return null;
@@ -5485,7 +5505,7 @@ var Of = /* @__PURE__ */ new Set([
5485
5505
  return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
5486
5506
  });
5487
5507
  return r.length === 1 ? r[0].target : null;
5488
- }, io = "http://www.w3.org/1998/Math/MathML", _h = /* @__PURE__ */ new Set([
5508
+ }, oo = "http://www.w3.org/1998/Math/MathML", mh = /* @__PURE__ */ new Set([
5489
5509
  "math",
5490
5510
  "maction",
5491
5511
  "menclose",
@@ -5519,7 +5539,7 @@ var Of = /* @__PURE__ */ new Set([
5519
5539
  "semantics",
5520
5540
  "annotation",
5521
5541
  "annotation-xml"
5522
- ]), bh = /* @__PURE__ */ new Set([
5542
+ ]), vh = /* @__PURE__ */ new Set([
5523
5543
  "accent",
5524
5544
  "accentunder",
5525
5545
  "align",
@@ -5571,29 +5591,29 @@ var Of = /* @__PURE__ */ new Set([
5571
5591
  "width",
5572
5592
  "xmlns",
5573
5593
  "xml:lang"
5574
- ]), Il = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), yh = (e) => Il(e).replace(/"/g, "&quot;"), Th = (e, t) => {
5594
+ ]), Il = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), _h = (e) => Il(e).replace(/"/g, "&quot;"), bh = (e, t) => {
5575
5595
  const n = e.toLowerCase(), r = t.trim().toLowerCase();
5576
- return !!(n.startsWith("on") || !bh.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5577
- }, Sh = (e) => {
5596
+ return !!(n.startsWith("on") || !vh.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5597
+ }, yh = (e) => {
5578
5598
  const t = e.localName.toLowerCase();
5579
- if (!_h.has(t)) return !1;
5599
+ if (!mh.has(t)) return !1;
5580
5600
  const n = e.namespaceURI;
5581
- return !n || n === io || n === "http://www.w3.org/1999/xhtml";
5601
+ return !n || n === oo || n === "http://www.w3.org/1999/xhtml";
5582
5602
  }, Rl = (e) => {
5583
5603
  if (e.nodeType === Node.TEXT_NODE) return Il(e.textContent || "");
5584
5604
  if (e.nodeType === Node.COMMENT_NODE) return "";
5585
5605
  if (e.nodeType !== Node.ELEMENT_NODE) return null;
5586
5606
  const t = e;
5587
- if (!Sh(t)) return null;
5607
+ if (!yh(t)) return null;
5588
5608
  const n = t.localName.toLowerCase(), r = [];
5589
5609
  for (const o of Array.from(t.attributes)) {
5590
5610
  const s = o.name.toLowerCase();
5591
- if (!Th(s, o.value)) {
5592
- if (s === "xmlns" && o.value !== io) return null;
5593
- r.push(`${s}="${yh(o.value)}"`);
5611
+ if (!bh(s, o.value)) {
5612
+ if (s === "xmlns" && o.value !== oo) return null;
5613
+ r.push(`${s}="${_h(o.value)}"`);
5594
5614
  }
5595
5615
  }
5596
- n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${io}"`);
5616
+ n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${oo}"`);
5597
5617
  const i = [];
5598
5618
  for (const o of Array.from(t.childNodes)) {
5599
5619
  const s = Rl(o);
@@ -5601,10 +5621,10 @@ var Of = /* @__PURE__ */ new Set([
5601
5621
  i.push(s);
5602
5622
  }
5603
5623
  return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
5604
- }, wh = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Ai = (e) => {
5624
+ }, Th = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Ci = (e) => {
5605
5625
  const t = String(e || "").trim();
5606
5626
  if (!t) return null;
5607
- const n = wh(t);
5627
+ const n = Th(t);
5608
5628
  if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
5609
5629
  const r = n.documentElement;
5610
5630
  return !r || r.localName.toLowerCase() !== "math" ? null : Rl(r);
@@ -5616,28 +5636,28 @@ var Of = /* @__PURE__ */ new Set([
5616
5636
  lastCharWasWhitespace: !1,
5617
5637
  lastMapped: null,
5618
5638
  options: e
5619
- }), Pl = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Nl = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", $l = (e) => {
5639
+ }), Nl = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Pl = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", $l = (e) => {
5620
5640
  const t = e.tagName?.toLowerCase();
5621
5641
  return t === "annotation" || t === "annotation-xml";
5622
- }, kh = (e) => {
5642
+ }, Sh = (e) => {
5623
5643
  const t = e.getAttribute("data-mathml");
5624
5644
  return t && t.trim() ? t : null;
5625
- }, Eh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, xh = (e) => {
5626
- if (e.tagName.toLowerCase() === "math") return Ai(e.outerHTML);
5627
- const t = kh(e);
5645
+ }, wh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, kh = (e) => {
5646
+ if (e.tagName.toLowerCase() === "math") return Ci(e.outerHTML);
5647
+ const t = Sh(e);
5628
5648
  if (t) {
5629
- const n = Ai(t);
5649
+ const n = Ci(t);
5630
5650
  if (n) return n;
5631
5651
  }
5632
- if (Pl(e)) {
5633
- const n = Eh(e);
5652
+ if (Nl(e)) {
5653
+ const n = wh(e);
5634
5654
  if (n) {
5635
- const r = Ai(n);
5655
+ const r = Ci(n);
5636
5656
  if (r) return r;
5637
5657
  }
5638
5658
  }
5639
5659
  return null;
5640
- }, Ah = /* @__PURE__ */ new Set([
5660
+ }, Eh = /* @__PURE__ */ new Set([
5641
5661
  "P",
5642
5662
  "H1",
5643
5663
  "H2",
@@ -5653,7 +5673,7 @@ var Of = /* @__PURE__ */ new Set([
5653
5673
  "FIGCAPTION",
5654
5674
  "LABEL",
5655
5675
  "BUTTON"
5656
- ]), Ch = /* @__PURE__ */ new Set([
5676
+ ]), xh = /* @__PURE__ */ new Set([
5657
5677
  "heading",
5658
5678
  "listitem",
5659
5679
  "option",
@@ -5662,18 +5682,18 @@ var Of = /* @__PURE__ */ new Set([
5662
5682
  "cell",
5663
5683
  "columnheader",
5664
5684
  "rowheader"
5665
- ]), Mh = (e, t) => {
5685
+ ]), Ah = (e, t) => {
5666
5686
  let n = e.parentElement, r = null;
5667
5687
  for (; n && n !== t; ) {
5668
5688
  const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
5669
- if (Ah.has(o) || Ch.has(i)) {
5689
+ if (Eh.has(o) || xh.has(i)) {
5670
5690
  r = n;
5671
5691
  break;
5672
5692
  }
5673
5693
  n = n.parentElement;
5674
5694
  }
5675
5695
  return r || t;
5676
- }, Oh = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Pl(e), Gt = (e, t, n) => {
5696
+ }, Ch = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Nl(e), Gt = (e, t, n) => {
5677
5697
  /[.,;:!?]/.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), n ? (e.map.set(e.position, n), e.lastMapped = n) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
5678
5698
  }, zl = (e, t) => {
5679
5699
  if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
@@ -5706,7 +5726,7 @@ var Of = /* @__PURE__ */ new Set([
5706
5726
  offset: i
5707
5727
  }), r = !0, e.lastCharWasWhitespace = !1;
5708
5728
  }
5709
- }, Ih = (e, t) => {
5729
+ }, Mh = (e, t) => {
5710
5730
  for (let n = 0; n < t.text.length; n++) {
5711
5731
  const r = t.text[n], i = /\s/.test(r), o = t.map.get(n) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
5712
5732
  node: o.node,
@@ -5734,7 +5754,7 @@ var Of = /* @__PURE__ */ new Set([
5734
5754
  offset: a
5735
5755
  });
5736
5756
  }
5737
- }, Rh = (e) => {
5757
+ }, Oh = (e) => {
5738
5758
  if (typeof DOMParser > "u") return "";
5739
5759
  const t = new DOMParser().parseFromString(e, "application/xml");
5740
5760
  if (t.getElementsByTagName("parsererror").length > 0) return "";
@@ -5750,33 +5770,33 @@ var Of = /* @__PURE__ */ new Set([
5750
5770
  for (const s of Array.from(o.childNodes)) r(s);
5751
5771
  };
5752
5772
  return r(t.documentElement), G(n.join(" "));
5753
- }, Lh = (e, t, n) => {
5773
+ }, Ih = (e, t, n) => {
5754
5774
  const r = Ll(n), i = (a) => {
5755
- if (Nn(a, e)) return;
5775
+ if (Pn(a, e)) return;
5756
5776
  if (a.nodeType === 3) {
5757
5777
  Dl(r, a);
5758
5778
  return;
5759
5779
  }
5760
5780
  if (a.nodeType !== 1) return;
5761
5781
  const l = a;
5762
- if (!(Nl(l) || $l(l)))
5782
+ if (!(Pl(l) || $l(l)))
5763
5783
  for (const c of Array.from(l.childNodes)) i(c);
5764
5784
  };
5765
- i(e), Wl(r);
5785
+ i(e), Hl(r);
5766
5786
  const o = G(r.chars.join(""));
5767
5787
  if (o) return {
5768
5788
  text: o,
5769
5789
  map: r.map
5770
5790
  };
5771
- const s = Rh(t);
5791
+ const s = Oh(t);
5772
5792
  return s ? {
5773
5793
  text: s,
5774
5794
  map: /* @__PURE__ */ new Map()
5775
- } : Kr(e, n);
5776
- }, Wl = (e) => {
5795
+ } : Jr(e, n);
5796
+ }, Hl = (e) => {
5777
5797
  for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
5778
5798
  e.chars.pop(), e.position--, e.map.delete(e.position);
5779
- }, Ph = (e, t) => {
5799
+ }, Rh = (e, t) => {
5780
5800
  const n = Ll(t), r = [];
5781
5801
  let i = 0, o, s = !1;
5782
5802
  const a = () => {
@@ -5787,20 +5807,20 @@ var Of = /* @__PURE__ */ new Set([
5787
5807
  sourceElement: o
5788
5808
  }), i = n.chars.length, o = void 0;
5789
5809
  }, l = (u) => {
5790
- if (Nn(u, e)) return;
5810
+ if (Pn(u, e)) return;
5791
5811
  if (u.nodeType === Node.TEXT_NODE) {
5792
- const g = Mh(u, e);
5812
+ const g = Ah(u, e);
5793
5813
  o && g !== o && a(), o = g, Dl(n, u);
5794
5814
  return;
5795
5815
  }
5796
5816
  if (u.nodeType !== Node.ELEMENT_NODE) return;
5797
5817
  const f = u;
5798
- if (Nl(f)) return;
5799
- const p = xh(f);
5818
+ if (Pl(f)) return;
5819
+ const p = kh(f);
5800
5820
  if (p) {
5801
5821
  a();
5802
- const g = Lh(f, p, t);
5803
- Ih(n, g);
5822
+ const g = Ih(f, p, t);
5823
+ Mh(n, g);
5804
5824
  const m = G(g.text);
5805
5825
  r.push({
5806
5826
  type: "math",
@@ -5813,7 +5833,7 @@ var Of = /* @__PURE__ */ new Set([
5813
5833
  for (const g of Array.from(f.childNodes)) l(g);
5814
5834
  };
5815
5835
  for (const u of Array.from(e.childNodes)) l(u);
5816
- Wl(n), a();
5836
+ Hl(n), a();
5817
5837
  const c = n.chars.join("");
5818
5838
  for (; n.map.has(c.length); ) n.map.delete(c.length);
5819
5839
  return {
@@ -5823,8 +5843,8 @@ var Of = /* @__PURE__ */ new Set([
5823
5843
  containsMathMarkup: s
5824
5844
  };
5825
5845
  }, tr = (e, t) => {
5826
- if (!Oh(e)) {
5827
- const { text: n, map: r } = Kr(e, t);
5846
+ if (!Ch(e)) {
5847
+ const { text: n, map: r } = Jr(e, t);
5828
5848
  return {
5829
5849
  visibleText: n,
5830
5850
  map: r,
@@ -5835,8 +5855,8 @@ var Of = /* @__PURE__ */ new Set([
5835
5855
  containsMathMarkup: !1
5836
5856
  };
5837
5857
  }
5838
- return Ph(e, t);
5839
- }, Nh = (e, t) => vl([e], t), $h = (e) => (e || "en").split("-")[0].toLowerCase() || "en", zh = /* @__PURE__ */ new Set([
5858
+ return Rh(e, t);
5859
+ }, Lh = (e, t) => vl([e], t), Nh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Ph = /* @__PURE__ */ new Set([
5840
5860
  "H1",
5841
5861
  "H2",
5842
5862
  "H3",
@@ -5846,17 +5866,17 @@ var Of = /* @__PURE__ */ new Set([
5846
5866
  "LI",
5847
5867
  "LABEL",
5848
5868
  "BUTTON"
5849
- ]), Dh = /* @__PURE__ */ new Set([
5869
+ ]), $h = /* @__PURE__ */ new Set([
5850
5870
  "heading",
5851
5871
  "listitem",
5852
5872
  "option",
5853
5873
  "radio"
5854
- ]), Wh = (e) => {
5874
+ ]), zh = (e) => {
5855
5875
  if (e.type !== "text" || !e.sourceElement) return !1;
5856
5876
  const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
5857
- return zh.has(t) || Dh.has(n);
5858
- }, Hh = async (e) => {
5859
- const t = e.resolveMathSpeech ?? Nh, { visibleText: n } = e, r = [];
5877
+ return Ph.has(t) || $h.has(n);
5878
+ }, Dh = async (e) => {
5879
+ const t = e.resolveMathSpeech ?? Lh, { visibleText: n } = e, r = [];
5860
5880
  let i = 0;
5861
5881
  const o = (a) => {
5862
5882
  const l = G(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, f = u + l.length;
@@ -5868,10 +5888,10 @@ var Of = /* @__PURE__ */ new Set([
5868
5888
  for (let a = 0; a < e.chunks.length; a++) {
5869
5889
  const l = e.chunks[a];
5870
5890
  if (l.type === "text") {
5871
- const g = Wh(l) ? [{
5891
+ const g = zh(l) ? [{
5872
5892
  text: l.text,
5873
5893
  offset: 0
5874
- }] : Oo(l.text, { locale: e.language });
5894
+ }] : Io(l.text, { locale: e.language });
5875
5895
  for (const m of g) {
5876
5896
  const b = G(m.text);
5877
5897
  if (!b) continue;
@@ -5908,19 +5928,19 @@ var Of = /* @__PURE__ */ new Set([
5908
5928
  }
5909
5929
  return {
5910
5930
  segments: r,
5911
- locale: $h(e.language),
5931
+ locale: Nh(e.language),
5912
5932
  visibleText: n,
5913
5933
  plainSpeechText: G(s.join(" "))
5914
5934
  };
5915
- }, Fh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Bh = "sre-v1", Uh = 256, oo = (e) => Array.isArray(e) ? `array:[${e.map(oo).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${oo(n)}`).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)}`, Ds = (e, t, n, r) => `${Bh}\0${Fh(e)}\0${t ? "ssml" : "plain"}\0${oo(n ?? null)}\0${r}`, jh = (e = {}) => {
5916
- const t = Math.max(1, e.maxEntries ?? Uh), n = e.resolve ?? ((o, s) => vl([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5935
+ }, Hh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Wh = "sre-v1", Fh = 256, so = (e) => Array.isArray(e) ? `array:[${e.map(so).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${so(n)}`).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)}`, Ds = (e, t, n, r) => `${Wh}\0${Hh(e)}\0${t ? "ssml" : "plain"}\0${so(n ?? null)}\0${r}`, Bh = (e = {}) => {
5936
+ const t = Math.max(1, e.maxEntries ?? Fh), n = e.resolve ?? ((o, s) => vl([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5917
5937
  for (r.delete(o), r.set(o, s); r.size > t; ) {
5918
5938
  const a = r.keys().next().value;
5919
5939
  a !== void 0 && r.delete(a);
5920
5940
  }
5921
5941
  };
5922
5942
  return async (o, s) => {
5923
- const a = si(s.mathSpeech), l = s.produceSsml === !0, c = Ds(s.language, l, a, o.mathml), u = r.get(c);
5943
+ const a = ai(s.mathSpeech), l = s.produceSsml === !0, c = Ds(s.language, l, a, o.mathml), u = r.get(c);
5924
5944
  if (u)
5925
5945
  return r.delete(c), r.set(c, u), u;
5926
5946
  const f = await n(o, {
@@ -5933,13 +5953,13 @@ var Of = /* @__PURE__ */ new Set([
5933
5953
  usedFallback: f.usedFallback
5934
5954
  }), i(c, f), f;
5935
5955
  };
5936
- }, Gh = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : gr({ speechText: e }).tokens[0]?.normalized || null, Vh = (e, t) => {
5956
+ }, Uh = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : gr({ speechText: e }).tokens[0]?.normalized || null, jh = (e, t) => {
5937
5957
  const n = gr({ speechText: e.speechText });
5938
5958
  if (!Number.isFinite(t.position)) return {
5939
5959
  boundary: null,
5940
5960
  spokenText: n.spokenText
5941
5961
  };
5942
- const r = ph({
5962
+ const r = fh({
5943
5963
  tokenization: n,
5944
5964
  position: t.position,
5945
5965
  length: t.length,
@@ -5952,8 +5972,8 @@ var Of = /* @__PURE__ */ new Set([
5952
5972
  } : null,
5953
5973
  spokenText: n.spokenText
5954
5974
  };
5955
- }, qh = (e, t, n) => n ? gr({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Yh = (e, t) => {
5956
- const n = Gh(t.word);
5975
+ }, Gh = (e, t, n) => n ? gr({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Vh = (e, t) => {
5976
+ const n = Uh(t.word);
5957
5977
  if (e.id !== t.chunkId) return {
5958
5978
  chunkId: t.chunkId,
5959
5979
  normalizedWord: n,
@@ -5972,12 +5992,12 @@ var Of = /* @__PURE__ */ new Set([
5972
5992
  };
5973
5993
  let r, i;
5974
5994
  if (e.catalogAlignment)
5975
- r = Hf(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5995
+ r = Df(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5976
5996
  else {
5977
- const o = Vh(e, t);
5997
+ const o = jh(e, t);
5978
5998
  r = o.boundary, i = o.spokenText;
5979
5999
  }
5980
- return r ? qh(i, r.start, n) ? {
6000
+ return r ? Gh(i, r.start, n) ? {
5981
6001
  chunkId: e.id,
5982
6002
  normalizedWord: n,
5983
6003
  chunkSpokenStart: r.start,
@@ -6017,12 +6037,12 @@ var Of = /* @__PURE__ */ new Set([
6017
6037
  quality: "region",
6018
6038
  confidence: e.confidence,
6019
6039
  reason: e.reason
6020
- }, Hl = /* @__PURE__ */ new Map([
6040
+ }, Wl = /* @__PURE__ */ new Map([
6021
6041
  ["mi", "mjx-mi"],
6022
6042
  ["mn", "mjx-mn"],
6023
6043
  ["mo", "mjx-mo"],
6024
6044
  ["mtext", "mjx-mtext"]
6025
- ]), so = "mi,mn,mo,mtext", Fl = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Bl = [
6045
+ ]), ao = "mi,mn,mo,mtext", Fl = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Bl = [
6026
6046
  "mjx-mfrac",
6027
6047
  "mjx-msqrt",
6028
6048
  "mjx-mroot",
@@ -6030,17 +6050,17 @@ var Of = /* @__PURE__ */ new Set([
6030
6050
  "mjx-munder",
6031
6051
  "mjx-mover",
6032
6052
  "mjx-munderover"
6033
- ].join(","), Ul = (e) => e.type === "text-range" ? e.node.parentElement : e.element, ai = (e) => {
6053
+ ].join(","), Ul = (e) => e.type === "text-range" ? e.node.parentElement : e.element, li = (e) => {
6034
6054
  let t = e;
6035
6055
  for (; t; ) {
6036
6056
  if (t.localName?.toLowerCase() === "mjx-container") return t;
6037
6057
  t = t.parentElement;
6038
6058
  }
6039
6059
  return null;
6040
- }, Ws = (e) => !e || ai(e) ? !1 : !Nn(e), jl = (e) => {
6060
+ }, Hs = (e) => !e || li(e) ? !1 : !Pn(e), jl = (e) => {
6041
6061
  const t = e.getBoundingClientRect?.();
6042
6062
  return !!(t && t.width > 0 && t.height > 0);
6043
- }, ao = (e) => {
6063
+ }, lo = (e) => {
6044
6064
  let t = e;
6045
6065
  for (; t; ) {
6046
6066
  if (t.localName?.toLowerCase() === "math") return t;
@@ -6050,35 +6070,35 @@ var Of = /* @__PURE__ */ new Set([
6050
6070
  }, Gl = (e, t) => {
6051
6071
  if (e.length === 0 || e.length !== t.length) return !1;
6052
6072
  for (let n = 0; n < e.length; n += 1) {
6053
- const r = Hl.get(e[n].localName.toLowerCase());
6073
+ const r = Wl.get(e[n].localName.toLowerCase());
6054
6074
  if (!r || t[n].localName.toLowerCase() !== r) return !1;
6055
6075
  }
6056
6076
  return !0;
6057
- }, Xh = (e, t) => {
6058
- if (!e || !Hl.has(e.localName.toLowerCase()) || t.querySelector(Bl)) return null;
6059
- const n = ao(e), r = t.querySelector("mjx-math");
6077
+ }, qh = (e, t) => {
6078
+ if (!e || !Wl.has(e.localName.toLowerCase()) || t.querySelector(Bl)) return null;
6079
+ const n = lo(e), r = t.querySelector("mjx-math");
6060
6080
  if (!n || !r) return null;
6061
- const i = Array.from(n.querySelectorAll(so)), o = i.indexOf(e);
6081
+ const i = Array.from(n.querySelectorAll(ao)), o = i.indexOf(e);
6062
6082
  if (o < 0) return null;
6063
6083
  const s = Array.from(r.querySelectorAll(Fl));
6064
6084
  if (!Gl(i, s)) return null;
6065
6085
  const a = s[o];
6066
6086
  return !a || !jl(a) ? null : a;
6067
- }, Kh = (e) => {
6068
- const t = ai(e);
6087
+ }, Yh = (e) => {
6088
+ const t = li(e);
6069
6089
  if (t) {
6070
6090
  if (t.querySelector(Bl)) return "expression";
6071
- const r = ao(e) ?? e, i = t.querySelector("mjx-math");
6091
+ const r = lo(e) ?? e, i = t.querySelector("mjx-math");
6072
6092
  if (!i) return "expression";
6073
- const o = Array.from(r.querySelectorAll(so)), s = Array.from(i.querySelectorAll(Fl));
6093
+ const o = Array.from(r.querySelectorAll(ao)), s = Array.from(i.querySelectorAll(Fl));
6074
6094
  return Gl(o, s) && s.some((a) => jl(a)) ? "token" : "expression";
6075
6095
  }
6076
- const n = ao(e) ?? e;
6077
- return Array.from(n.querySelectorAll(so)).some((r) => !Nn(r)) ? "token" : "expression";
6078
- }, lo = (e) => {
6079
- const t = Ul(e), n = ai(t);
6096
+ const n = lo(e) ?? e;
6097
+ return Array.from(n.querySelectorAll(ao)).some((r) => !Pn(r)) ? "token" : "expression";
6098
+ }, co = (e) => {
6099
+ const t = Ul(e), n = li(t);
6080
6100
  if (n) {
6081
- const r = Xh(t, n);
6101
+ const r = qh(t, n);
6082
6102
  return r ? {
6083
6103
  type: "element",
6084
6104
  quality: "semantic-token",
@@ -6089,35 +6109,35 @@ var Of = /* @__PURE__ */ new Set([
6089
6109
  element: n
6090
6110
  };
6091
6111
  }
6092
- return e.type === "text-range" ? Ws(e.node.parentElement) ? {
6112
+ return e.type === "text-range" ? Hs(e.node.parentElement) ? {
6093
6113
  type: "text-range",
6094
6114
  quality: "semantic-token",
6095
6115
  node: e.node,
6096
6116
  startOffset: e.startOffset,
6097
6117
  endOffset: e.endOffset
6098
- } : null : Ws(e.element) ? {
6118
+ } : null : Hs(e.element) ? {
6099
6119
  type: "element",
6100
6120
  quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
6101
6121
  element: e.element
6102
6122
  } : null;
6103
- }, Jh = lo, Zh = () => {
6123
+ }, Xh = co, Kh = () => {
6104
6124
  const e = /* @__PURE__ */ new WeakMap();
6105
6125
  return (t) => {
6106
- const n = Ul(t), r = ai(n);
6107
- if (!n || !r) return lo(t);
6126
+ const n = Ul(t), r = li(n);
6127
+ if (!n || !r) return co(t);
6108
6128
  if (e.has(n)) return e.get(n) ?? null;
6109
- const i = lo(t);
6129
+ const i = co(t);
6110
6130
  return e.set(n, i), i;
6111
6131
  };
6112
- }, Qh = (e, t, n, r = e.mathAlignments, i = Jh) => {
6132
+ }, Jh = (e, t, n, r = e.mathAlignments, i = Xh) => {
6113
6133
  if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
6114
6134
  let o = null;
6115
6135
  for (const s of r) {
6116
- const a = mh(s.alignment, {
6136
+ const a = ph(s.alignment, {
6117
6137
  position: t.chunkSpokenStart,
6118
6138
  length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
6119
6139
  boundaryWord: n.word
6120
- }) || vh(s.alignment, { boundaryWord: n.word });
6140
+ }) || gh(s.alignment, { boundaryWord: n.word });
6121
6141
  if (!a) continue;
6122
6142
  const l = i(a);
6123
6143
  if (l) {
@@ -6138,9 +6158,9 @@ var Of = /* @__PURE__ */ new Set([
6138
6158
  } catch {
6139
6159
  return null;
6140
6160
  }
6141
- }, ep = (e, t) => {
6161
+ }, Zh = (e, t) => {
6142
6162
  if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
6143
- const n = Ff(e.catalogAlignment, t.chunkSpokenStart);
6163
+ const n = Hf(e.catalogAlignment, t.chunkSpokenStart);
6144
6164
  if (!n) return null;
6145
6165
  const r = Vl(e.visibleMap, n.start, n.end);
6146
6166
  return r ? {
@@ -6148,7 +6168,7 @@ var Of = /* @__PURE__ */ new Set([
6148
6168
  quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
6149
6169
  range: r
6150
6170
  } : null;
6151
- }, tp = (e) => e.regionRange ? {
6171
+ }, Qh = (e) => e.regionRange ? {
6152
6172
  type: "range",
6153
6173
  quality: "region",
6154
6174
  range: e.regionRange
@@ -6156,11 +6176,11 @@ var Of = /* @__PURE__ */ new Set([
6156
6176
  type: "element",
6157
6177
  quality: "region",
6158
6178
  element: e.regionElement
6159
- } : null, Hs = (e, t = e.chunk.mathAlignments) => {
6179
+ } : null, Ws = (e, t = e.chunk.mathAlignments) => {
6160
6180
  if (t.length !== 1) return null;
6161
6181
  const n = t[0]?.alignment.result.fallbackTarget;
6162
6182
  return n ? e.renderedMathTargetResolver(n) : null;
6163
- }, np = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
6183
+ }, ep = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
6164
6184
  try {
6165
6185
  return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
6166
6186
  } catch {
@@ -6172,18 +6192,18 @@ var Of = /* @__PURE__ */ new Set([
6172
6192
  quality: "region",
6173
6193
  confidence: 0,
6174
6194
  reason: "boundary chunk id was not found"
6175
- }), Bs = (e) => e.length === 1 ? e[0].element : null, rp = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), ip = 3, op = (e, t, n) => {
6195
+ }), Bs = (e) => e.length === 1 ? e[0].element : null, tp = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), np = 3, rp = (e, t, n) => {
6176
6196
  if (!t || t.type !== "range") return !1;
6177
6197
  const { startContainer: r, endContainer: i } = t.range;
6178
- return r === i && r.nodeType === ip ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
6179
- }, sp = (e, t) => ({
6198
+ return r === i && r.nodeType === np ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
6199
+ }, ip = (e, t) => ({
6180
6200
  chunk: e,
6181
- regionTarget: tp(e),
6182
- renderedMathTargetResolver: Zh(),
6183
- mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? Kh(n) : "expression"])),
6201
+ regionTarget: Qh(e),
6202
+ renderedMathTargetResolver: Kh(),
6203
+ mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? Yh(n) : "expression"])),
6184
6204
  heldTokenByElement: /* @__PURE__ */ new Map()
6185
- }), ap = (e) => {
6186
- const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, sp(r, t)]));
6205
+ }), op = (e) => {
6206
+ const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, ip(r, t)]));
6187
6207
  return {
6188
6208
  chunks: e.chunks,
6189
6209
  resolveInitial(r) {
@@ -6192,7 +6212,7 @@ var Of = /* @__PURE__ */ new Set([
6192
6212
  const o = i.chunk.mathAlignments, s = o.length === 1 ? o[0].element : null, a = s ? i.mathCapabilityByElement.get(s) : null;
6193
6213
  return bn(a === "expression" ? {
6194
6214
  semanticTarget: null,
6195
- expressionTarget: Hs(i),
6215
+ expressionTarget: Ws(i),
6196
6216
  regionTarget: i.regionTarget,
6197
6217
  confidence: 0.5,
6198
6218
  reason: "initial expression (sticky expression mode)"
@@ -6207,7 +6227,7 @@ var Of = /* @__PURE__ */ new Set([
6207
6227
  resolveBoundary(r) {
6208
6228
  const i = n.get(r.chunkId);
6209
6229
  if (!i) return Fs();
6210
- const { chunk: o } = i, s = Yh(o, r), a = ep(o, s), l = np(a, o), c = (!a || l.length > 0 ? Qh(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6230
+ const { chunk: o } = i, s = Vh(o, r), a = Zh(o, s), l = ep(a, o), c = (!a || l.length > 0 ? Jh(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6211
6231
  if (u) {
6212
6232
  const p = Bs(l);
6213
6233
  return p && i.heldTokenByElement.set(p, u), bn({
@@ -6218,14 +6238,14 @@ var Of = /* @__PURE__ */ new Set([
6218
6238
  reason: s.reason
6219
6239
  });
6220
6240
  }
6221
- if (a && (t ? !op(i, a, l) : l.length === 0)) return bn({
6241
+ if (a && (t ? !rp(i, a, l) : l.length === 0)) return bn({
6222
6242
  semanticTarget: a,
6223
6243
  expressionTarget: null,
6224
6244
  regionTarget: i.regionTarget,
6225
6245
  confidence: s.confidence,
6226
6246
  reason: s.reason
6227
6247
  });
6228
- if (rp(i, l)) {
6248
+ if (tp(i, l)) {
6229
6249
  const p = Bs(l), g = p ? i.heldTokenByElement.get(p) ?? null : null;
6230
6250
  return bn({
6231
6251
  semanticTarget: g,
@@ -6237,21 +6257,21 @@ var Of = /* @__PURE__ */ new Set([
6237
6257
  }
6238
6258
  return bn({
6239
6259
  semanticTarget: null,
6240
- expressionTarget: f ?? Hs(i, l),
6260
+ expressionTarget: f ?? Ws(i, l),
6241
6261
  regionTarget: i.regionTarget,
6242
6262
  confidence: s.confidence,
6243
6263
  reason: s.reason
6244
6264
  });
6245
6265
  }
6246
6266
  };
6247
- }, lp = (e) => {
6267
+ }, sp = (e) => {
6248
6268
  if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
6249
6269
  const t = e.mathAlignment?.speech.boundaryOffsetSpace;
6250
6270
  return t || "plain-spoken-text";
6251
- }, cp = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6271
+ }, ap = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6252
6272
  element: e.sourceElement,
6253
6273
  alignment: e.mathAlignment
6254
- }] : [], up = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6274
+ }] : [], lp = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6255
6275
  speechText: e.speechText || "",
6256
6276
  visibleText: e.visibleText || e.speechText || "",
6257
6277
  sourceElement: e.sourceElement || e.contentRoot,
@@ -6268,9 +6288,9 @@ var Of = /* @__PURE__ */ new Set([
6268
6288
  regionRange: t.regionRange,
6269
6289
  visibleMap: t.visibleMap,
6270
6290
  catalogAlignment: t.alignment,
6271
- mathAlignments: cp(t),
6272
- offsetSpace: lp(t)
6273
- })), dp = [
6291
+ mathAlignments: ap(t),
6292
+ offsetSpace: sp(t)
6293
+ })), cp = [
6274
6294
  "[data-pie-tts-region]",
6275
6295
  "[data-catalog-region]",
6276
6296
  "li",
@@ -6281,17 +6301,17 @@ var Of = /* @__PURE__ */ new Set([
6281
6301
  "[role='region']",
6282
6302
  "div"
6283
6303
  ].join(","), ql = (e, t) => {
6284
- const n = e.closest(dp);
6304
+ const n = e.closest(cp);
6285
6305
  return n && t.contains(n) ? n : e;
6286
- }, fp = (e, t, n) => {
6306
+ }, up = (e, t, n) => {
6287
6307
  const r = /* @__PURE__ */ new Map();
6288
6308
  for (let i = t; i < n; i++) {
6289
6309
  const o = e.get(i);
6290
6310
  o && r.set(i - t, o);
6291
6311
  }
6292
6312
  return r;
6293
- }, hp = async (e) => {
6294
- const t = tr(e.contentRoot, e.textProcessingOptions), n = await Hh({
6313
+ }, dp = async (e) => {
6314
+ const t = tr(e.contentRoot, e.textProcessingOptions), n = await Dh({
6295
6315
  chunks: t.chunks,
6296
6316
  visibleText: t.visibleText,
6297
6317
  language: e.language,
@@ -6310,7 +6330,7 @@ var Of = /* @__PURE__ */ new Set([
6310
6330
  anchor: {
6311
6331
  sourceElement: a,
6312
6332
  regionElement: ql(a, e.contentRoot),
6313
- visibleMap: fp(t.map, r.visibleSpan.start, r.visibleSpan.end)
6333
+ visibleMap: up(t.map, r.visibleSpan.start, r.visibleSpan.end)
6314
6334
  }
6315
6335
  };
6316
6336
  }
@@ -6330,7 +6350,7 @@ var Of = /* @__PURE__ */ new Set([
6330
6350
  containsMathMarkup: t.containsMathMarkup,
6331
6351
  visibleText: t.visibleText
6332
6352
  };
6333
- }, pp = (e, t) => {
6353
+ }, fp = (e, t) => {
6334
6354
  const n = El({
6335
6355
  speechText: e.spokenText,
6336
6356
  visibleText: e.spokenText
@@ -6354,12 +6374,12 @@ var Of = /* @__PURE__ */ new Set([
6354
6374
  sourceElement: n,
6355
6375
  regionElement: t.regionElement,
6356
6376
  speechMatchesVisibleText: e.spokenText === e.fallbackText,
6357
- mathAlignment: n ? Zr({
6377
+ mathAlignment: n ? Qr({
6358
6378
  mathElement: n,
6359
6379
  speechText: e.spokenText
6360
6380
  }) : void 0
6361
6381
  };
6362
- }, gp = (e, t, n) => {
6382
+ }, hp = (e, t, n) => {
6363
6383
  const r = t.sourceElement;
6364
6384
  return {
6365
6385
  speechText: n,
@@ -6367,22 +6387,22 @@ var Of = /* @__PURE__ */ new Set([
6367
6387
  sourceElement: r,
6368
6388
  regionElement: t.regionElement,
6369
6389
  speechMatchesVisibleText: !1,
6370
- mathAlignment: r ? Zr({
6390
+ mathAlignment: r ? Qr({
6371
6391
  mathElement: r,
6372
6392
  speechText: n
6373
6393
  }) : void 0,
6374
6394
  plainFallback: Yl(e, t)
6375
6395
  };
6376
- }, mp = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? pp(n, r) : t.format === "ssml" && n.ssml ? gp(n, r, n.ssml) : Yl(n, r)), vp = "pie-tts-control-handoff", z;
6396
+ }, pp = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? fp(n, r) : t.format === "ssml" && n.ssml ? hp(n, r, n.ssml) : Yl(n, r)), gp = "pie-tts-control-handoff", z;
6377
6397
  (function(e) {
6378
6398
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
6379
6399
  })(z || (z = {}));
6380
- var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, _p = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Xl(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, bp = class co {
6400
+ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, mp = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Xl(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, vp = class uo {
6381
6401
  constructor() {
6382
- v(this, "currentProvider", null), v(this, "provider", null), v(this, "highlightCoordinator", null), v(this, "highlightTargetResolverProvider", null), v(this, "catalogResolver", null), v(this, "state", z.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, "activeWordBoundaryOffset", 0), v(this, "seekSegments", []), v(this, "playbackChunks", []), 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", jh());
6402
+ v(this, "currentProvider", null), v(this, "provider", null), v(this, "highlightCoordinator", null), v(this, "highlightTargetResolverProvider", null), v(this, "catalogResolver", null), v(this, "state", z.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, "activeWordBoundaryOffset", 0), v(this, "seekSegments", []), v(this, "playbackChunks", []), 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", Bh());
6383
6403
  }
6384
6404
  debugLog(t, n) {
6385
- co.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
6405
+ uo.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
6386
6406
  }
6387
6407
  async emitTelemetry(t, n) {
6388
6408
  try {
@@ -6559,12 +6579,12 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6559
6579
  }
6560
6580
  getMathSpeechOptions() {
6561
6581
  const t = (this.ttsConfig.providerOptions || {}).mathSpeech;
6562
- return si(t);
6582
+ return ai(t);
6563
6583
  }
6564
6584
  buildPositionMap(t, n, r) {
6565
6585
  this.normalizedToDOM.clear();
6566
- const { text: i, map: o } = Kr(t, this.getTextProcessingOptions(r));
6567
- this.normalizedToDOM = o, co.debugEnabled && (this.debugLog("[TTSService] Text comparison:", {
6586
+ const { text: i, map: o } = Jr(t, this.getTextProcessingOptions(r));
6587
+ this.normalizedToDOM = o, uo.debugEnabled && (this.debugLog("[TTSService] Text comparison:", {
6568
6588
  spokenLength: n.length,
6569
6589
  normalizedDomLength: i.length,
6570
6590
  match: n === i,
@@ -6673,7 +6693,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6673
6693
  return this.createSpeechPlanSegments(n, r);
6674
6694
  }
6675
6695
  collectSpeechPlanBoundaries(t, n) {
6676
- const r = /* @__PURE__ */ new Map(), { map: i } = Kr(t, this.getTextProcessingOptions()), o = this.createNodeStartOffsets(i), s = document.createTreeWalker(t, NodeFilter.SHOW_TEXT);
6696
+ const r = /* @__PURE__ */ new Map(), { map: i } = Jr(t, this.getTextProcessingOptions()), o = this.createNodeStartOffsets(i), s = document.createTreeWalker(t, NodeFilter.SHOW_TEXT);
6677
6697
  let a = s.nextNode(), l = null;
6678
6698
  for (; a; ) {
6679
6699
  const c = a, u = c.parentElement;
@@ -6713,7 +6733,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6713
6733
  }), i.filter((l) => l.text.trim().length > 0);
6714
6734
  }
6715
6735
  segmentSentences(t) {
6716
- return Oo(t, { locale: this.ttsConfig.providerOptions?.locale || void 0 });
6736
+ return Io(t, { locale: this.ttsConfig.providerOptions?.locale || void 0 });
6717
6737
  }
6718
6738
  createSeekSegmentsFromText(t) {
6719
6739
  return this.segmentSentences(t).map((n) => {
@@ -6892,7 +6912,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6892
6912
  }
6893
6913
  async switchProviderToBrowser(t, n) {
6894
6914
  if (!this.currentProvider) return !1;
6895
- const r = new Io(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6915
+ const r = new Ro(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6896
6916
  textLength: a.length,
6897
6917
  textPreview: l.length < a.length ? `${l}…` : l
6898
6918
  } : {};
@@ -7039,7 +7059,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7039
7059
  const f = Array.from(u.querySelectorAll("math"));
7040
7060
  return u.localName?.toLowerCase() === "math" ? [u, ...f] : f;
7041
7061
  }, c = (u) => {
7042
- if (Nn(u, t)) return;
7062
+ if (Pn(u, t)) return;
7043
7063
  if (u.nodeType === Node.TEXT_NODE) {
7044
7064
  i += ` ${u.textContent || ""}`;
7045
7065
  return;
@@ -7051,12 +7071,12 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7051
7071
  const g = tr(f, this.getTextProcessingOptions(n.language)), m = g.visibleText || G(f.textContent || ""), b = El({
7052
7072
  speechText: p.content,
7053
7073
  visibleText: m
7054
- }), T = a(f, m), I = T ? Zr({
7074
+ }), T = a(f, m), I = T ? Qr({
7055
7075
  mathElement: T,
7056
7076
  speechText: p.content
7057
- }) : void 0, W = I ? void 0 : l(f).map((w) => ({
7077
+ }) : void 0, H = I ? void 0 : l(f).map((w) => ({
7058
7078
  element: w,
7059
- alignment: Zr({
7079
+ alignment: Qr({
7060
7080
  mathElement: w,
7061
7081
  speechText: p.content
7062
7082
  })
@@ -7070,7 +7090,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7070
7090
  playbackMode: b.playbackMode,
7071
7091
  alignment: b,
7072
7092
  mathAlignment: I,
7073
- mathAlignments: W,
7093
+ mathAlignments: H,
7074
7094
  visibleMap: g.map
7075
7095
  });
7076
7096
  return;
@@ -7084,7 +7104,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7084
7104
  return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
7085
7105
  }
7086
7106
  async resolveGeneratedSpeechContent(t, n, r) {
7087
- const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await hp({
7107
+ const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await dp({
7088
7108
  contentRoot: t,
7089
7109
  language: r,
7090
7110
  mathSpeech: this.getMathSpeechOptions(),
@@ -7101,7 +7121,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7101
7121
  containsMathMarkup: !1,
7102
7122
  speechMatchesVisibleText: !0
7103
7123
  };
7104
- const c = mp(o, { format: i }), u = o.plainSpeechText;
7124
+ const c = pp(o, { format: i }), u = o.plainSpeechText;
7105
7125
  return {
7106
7126
  contentToSpeak: u,
7107
7127
  speechText: u,
@@ -7170,7 +7190,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7170
7190
  this.highlightCoordinator && this.paintTTSWordRange(this.resolveWordHighlightRange(t).range);
7171
7191
  }
7172
7192
  highlightRenderableRegionTarget(t) {
7173
- if (!(!this.highlightCoordinator || !t || typeof document > "u") && !(!this.highlightTargetResolverProvider && _p(this.lastRenderedRegionTarget, t)))
7193
+ if (!(!this.highlightCoordinator || !t || typeof document > "u") && !(!this.highlightTargetResolverProvider && mp(this.lastRenderedRegionTarget, t)))
7174
7194
  try {
7175
7195
  const n = document.createRange();
7176
7196
  if (t.type === "element") n.selectNodeContents(t.element);
@@ -7229,10 +7249,10 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7229
7249
  async speakCatalogChunkOnce(t, n) {
7230
7250
  if (!this.provider) return;
7231
7251
  this.lastRenderedRegionTarget = null;
7232
- const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? up({
7252
+ const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? lp({
7233
7253
  contentRoot: r,
7234
7254
  chunks: [t]
7235
- })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? ap({
7255
+ })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? op({
7236
7256
  chunks: [i],
7237
7257
  mathTokenHighlighting: o
7238
7258
  }) : null;
@@ -7369,7 +7389,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7369
7389
  this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(z.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.playbackChunks = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
7370
7390
  }
7371
7391
  requestControlHandoff() {
7372
- typeof window > "u" || window.dispatchEvent(new CustomEvent(vp, { detail: { source: "host" } }));
7392
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(gp, { detail: { source: "host" } }));
7373
7393
  }
7374
7394
  isPlaying() {
7375
7395
  return this.state === z.PLAYING;
@@ -7440,7 +7460,7 @@ var Xl = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7440
7460
  });
7441
7461
  }
7442
7462
  };
7443
- v(bp, "debugEnabled", (() => {
7463
+ v(vp, "debugEnabled", (() => {
7444
7464
  try {
7445
7465
  if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
7446
7466
  } catch {
@@ -7458,7 +7478,7 @@ var Cg = wd({
7458
7478
  passage: []
7459
7479
  },
7460
7480
  providers: {}
7461
- }), Kl = "https://proxy.pie-api.com", yp = `${Kl}/bundles/`;
7481
+ }), Kl = "https://proxy.pie-api.com", _p = `${Kl}/bundles/`;
7462
7482
  function Jl(e) {
7463
7483
  try {
7464
7484
  const t = {
@@ -7472,69 +7492,69 @@ function Jl(e) {
7472
7492
  } catch {
7473
7493
  }
7474
7494
  }
7475
- var Mg = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || Jl("PUBLIC_BUILDER_ORIGIN_URL") || Kl, Tp = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || Jl("PUBLIC_BUILDER_BUNDLE_URL") || yp, Sp = {
7495
+ var Mg = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || Jl("PUBLIC_BUILDER_ORIGIN_URL") || Kl, bp = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || Jl("PUBLIC_BUILDER_BUNDLE_URL") || _p, yp = {
7476
7496
  retryDelayMs: 3e3,
7477
7497
  timeoutMs: 12e4
7478
- }, { entries: Zl, setPrototypeOf: Us, isFrozen: wp, getPrototypeOf: kp, getOwnPropertyDescriptor: Ep } = Object, { freeze: fe, seal: Re, create: nr } = Object, { apply: uo, construct: fo } = typeof Reflect < "u" && Reflect;
7498
+ }, { entries: Zl, setPrototypeOf: Us, isFrozen: Tp, getPrototypeOf: Sp, getOwnPropertyDescriptor: wp } = Object, { freeze: fe, seal: Re, create: nr } = Object, { apply: fo, construct: ho } = typeof Reflect < "u" && Reflect;
7479
7499
  fe || (fe = function(t) {
7480
7500
  return t;
7481
7501
  });
7482
7502
  Re || (Re = function(t) {
7483
7503
  return t;
7484
7504
  });
7485
- uo || (uo = function(t, n) {
7505
+ fo || (fo = function(t, n) {
7486
7506
  for (var r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), o = 2; o < r; o++) i[o - 2] = arguments[o];
7487
7507
  return t.apply(n, i);
7488
7508
  });
7489
- fo || (fo = function(t) {
7509
+ ho || (ho = function(t) {
7490
7510
  for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
7491
7511
  return new t(...r);
7492
7512
  });
7493
- var Vn = he(Array.prototype.forEach), xp = he(Array.prototype.lastIndexOf), js = he(Array.prototype.pop), qn = he(Array.prototype.push), Ap = he(Array.prototype.splice), Nr = he(String.prototype.toLowerCase), Ci = he(String.prototype.toString), Mi = he(String.prototype.match), yn = he(String.prototype.replace), Cp = he(String.prototype.indexOf), Mp = he(String.prototype.trim), ze = he(Object.prototype.hasOwnProperty), ce = he(RegExp.prototype.test), Yn = Op(TypeError);
7513
+ var Vn = he(Array.prototype.forEach), kp = he(Array.prototype.lastIndexOf), js = he(Array.prototype.pop), qn = he(Array.prototype.push), Ep = he(Array.prototype.splice), $r = he(String.prototype.toLowerCase), Mi = he(String.prototype.toString), Oi = he(String.prototype.match), yn = he(String.prototype.replace), xp = he(String.prototype.indexOf), Ap = he(String.prototype.trim), ze = he(Object.prototype.hasOwnProperty), ce = he(RegExp.prototype.test), Yn = Cp(TypeError);
7494
7514
  function he(e) {
7495
7515
  return function(t) {
7496
7516
  t instanceof RegExp && (t.lastIndex = 0);
7497
7517
  for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) r[i - 1] = arguments[i];
7498
- return uo(e, t, r);
7518
+ return fo(e, t, r);
7499
7519
  };
7500
7520
  }
7501
- function Op(e) {
7521
+ function Cp(e) {
7502
7522
  return function() {
7503
7523
  for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
7504
- return fo(e, n);
7524
+ return ho(e, n);
7505
7525
  };
7506
7526
  }
7507
7527
  function M(e, t) {
7508
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Nr;
7528
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : $r;
7509
7529
  Us && Us(e, null);
7510
7530
  let r = t.length;
7511
7531
  for (; r--; ) {
7512
7532
  let i = t[r];
7513
7533
  if (typeof i == "string") {
7514
7534
  const o = n(i);
7515
- o !== i && (wp(t) || (t[r] = o), i = o);
7535
+ o !== i && (Tp(t) || (t[r] = o), i = o);
7516
7536
  }
7517
7537
  e[i] = !0;
7518
7538
  }
7519
7539
  return e;
7520
7540
  }
7521
- function Ip(e) {
7541
+ function Mp(e) {
7522
7542
  for (let t = 0; t < e.length; t++) ze(e, t) || (e[t] = null);
7523
7543
  return e;
7524
7544
  }
7525
7545
  function Ve(e) {
7526
7546
  const t = nr(null);
7527
- for (const [n, r] of Zl(e)) ze(e, n) && (Array.isArray(r) ? t[n] = Ip(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Ve(r) : t[n] = r);
7547
+ for (const [n, r] of Zl(e)) ze(e, n) && (Array.isArray(r) ? t[n] = Mp(r) : r && typeof r == "object" && r.constructor === Object ? t[n] = Ve(r) : t[n] = r);
7528
7548
  return t;
7529
7549
  }
7530
7550
  function Xn(e, t) {
7531
7551
  for (; e !== null; ) {
7532
- const r = Ep(e, t);
7552
+ const r = wp(e, t);
7533
7553
  if (r) {
7534
7554
  if (r.get) return he(r.get);
7535
7555
  if (typeof r.value == "function") return he(r.value);
7536
7556
  }
7537
- e = kp(e);
7557
+ e = Sp(e);
7538
7558
  }
7539
7559
  function n() {
7540
7560
  return null;
@@ -7661,7 +7681,7 @@ var Gs = fe([
7661
7681
  "var",
7662
7682
  "video",
7663
7683
  "wbr"
7664
- ]), Oi = fe([
7684
+ ]), Ii = fe([
7665
7685
  "svg",
7666
7686
  "a",
7667
7687
  "altglyph",
@@ -7709,7 +7729,7 @@ var Gs = fe([
7709
7729
  "tspan",
7710
7730
  "view",
7711
7731
  "vkern"
7712
- ]), Ii = fe([
7732
+ ]), Ri = fe([
7713
7733
  "feBlend",
7714
7734
  "feColorMatrix",
7715
7735
  "feComponentTransfer",
@@ -7735,7 +7755,7 @@ var Gs = fe([
7735
7755
  "feSpotLight",
7736
7756
  "feTile",
7737
7757
  "feTurbulence"
7738
- ]), Rp = fe([
7758
+ ]), Op = fe([
7739
7759
  "animate",
7740
7760
  "color-profile",
7741
7761
  "cursor",
@@ -7758,7 +7778,7 @@ var Gs = fe([
7758
7778
  "solidcolor",
7759
7779
  "unknown",
7760
7780
  "use"
7761
- ]), Ri = fe([
7781
+ ]), Li = fe([
7762
7782
  "math",
7763
7783
  "menclose",
7764
7784
  "merror",
@@ -7789,7 +7809,7 @@ var Gs = fe([
7789
7809
  "munder",
7790
7810
  "munderover",
7791
7811
  "mprescripts"
7792
- ]), Lp = fe([
7812
+ ]), Ip = fe([
7793
7813
  "maction",
7794
7814
  "maligngroup",
7795
7815
  "malignmark",
@@ -7923,7 +7943,7 @@ var Gs = fe([
7923
7943
  "wrap",
7924
7944
  "xmlns",
7925
7945
  "slot"
7926
- ]), Li = fe([
7946
+ ]), Ni = fe([
7927
7947
  "accent-height",
7928
7948
  "accumulate",
7929
7949
  "additive",
@@ -8173,27 +8193,27 @@ var Gs = fe([
8173
8193
  "xlink:title",
8174
8194
  "xml:space",
8175
8195
  "xmlns:xlink"
8176
- ]), Pp = Re(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Np = Re(/<%[\w\W]*|[\w\W]*%>/gm), $p = Re(/\$\{[\w\W]*/gm), zp = Re(/^data-[\-\w.\u00B7-\uFFFF]+$/), Dp = Re(/^aria-[\-\w]+$/), Ql = Re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Wp = Re(/^(?:\w+script|data):/i), Hp = Re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), ec = Re(/^html$/i), Fp = Re(/^[a-z][.\w]*(-[.\w]+)+$/i), Xs = /* @__PURE__ */ Object.freeze({
8196
+ ]), Rp = Re(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Lp = Re(/<%[\w\W]*|[\w\W]*%>/gm), Np = Re(/\$\{[\w\W]*/gm), Pp = Re(/^data-[\-\w.\u00B7-\uFFFF]+$/), $p = Re(/^aria-[\-\w]+$/), Ql = Re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zp = Re(/^(?:\w+script|data):/i), Dp = Re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), ec = Re(/^html$/i), Hp = Re(/^[a-z][.\w]*(-[.\w]+)+$/i), Xs = /* @__PURE__ */ Object.freeze({
8177
8197
  __proto__: null,
8178
- ARIA_ATTR: Dp,
8179
- ATTR_WHITESPACE: Hp,
8180
- CUSTOM_ELEMENT: Fp,
8181
- DATA_ATTR: zp,
8198
+ ARIA_ATTR: $p,
8199
+ ATTR_WHITESPACE: Dp,
8200
+ CUSTOM_ELEMENT: Hp,
8201
+ DATA_ATTR: Pp,
8182
8202
  DOCTYPE_NAME: ec,
8183
- ERB_EXPR: Np,
8203
+ ERB_EXPR: Lp,
8184
8204
  IS_ALLOWED_URI: Ql,
8185
- IS_SCRIPT_OR_DATA: Wp,
8186
- MUSTACHE_EXPR: Pp,
8187
- TMPLIT_EXPR: $p
8205
+ IS_SCRIPT_OR_DATA: zp,
8206
+ MUSTACHE_EXPR: Rp,
8207
+ TMPLIT_EXPR: Np
8188
8208
  }), Kn = {
8189
8209
  element: 1,
8190
8210
  text: 3,
8191
8211
  progressingInstruction: 7,
8192
8212
  comment: 8,
8193
8213
  document: 9
8194
- }, Bp = function() {
8214
+ }, Wp = function() {
8195
8215
  return typeof window > "u" ? null : window;
8196
- }, Up = function(t, n) {
8216
+ }, Fp = function(t, n) {
8197
8217
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
8198
8218
  let r = null;
8199
8219
  const i = "data-tt-policy-suffix";
@@ -8225,33 +8245,33 @@ var Gs = fe([
8225
8245
  };
8226
8246
  };
8227
8247
  function tc() {
8228
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Bp();
8248
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Wp();
8229
8249
  const t = (k) => tc(k);
8230
8250
  if (t.version = "3.4.0", t.removed = [], !e || !e.document || e.document.nodeType !== Kn.document || !e.Element)
8231
8251
  return t.isSupported = !1, t;
8232
8252
  let { document: n } = e;
8233
- const r = n, i = r.currentScript, { DocumentFragment: o, HTMLTemplateElement: s, Node: a, Element: l, NodeFilter: c, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: f, DOMParser: p, trustedTypes: g } = e, m = l.prototype, b = Xn(m, "cloneNode"), T = Xn(m, "remove"), I = Xn(m, "nextSibling"), W = Xn(m, "childNodes"), J = Xn(m, "parentNode");
8253
+ const r = n, i = r.currentScript, { DocumentFragment: o, HTMLTemplateElement: s, Node: a, Element: l, NodeFilter: c, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: f, DOMParser: p, trustedTypes: g } = e, m = l.prototype, b = Xn(m, "cloneNode"), T = Xn(m, "remove"), I = Xn(m, "nextSibling"), H = Xn(m, "childNodes"), J = Xn(m, "parentNode");
8234
8254
  if (typeof s == "function") {
8235
8255
  const k = n.createElement("template");
8236
8256
  k.content && k.content.ownerDocument && (n = k.content.ownerDocument);
8237
8257
  }
8238
8258
  let w, X = "";
8239
- const { implementation: le, createNodeIterator: an, createDocumentFragment: ln, getElementsByTagName: cn } = n, { importNode: li } = r;
8259
+ const { implementation: le, createNodeIterator: an, createDocumentFragment: ln, getElementsByTagName: cn } = n, { importNode: ci } = r;
8240
8260
  let te = Ks();
8241
8261
  t.isSupported = typeof Zl == "function" && typeof J == "function" && le && le.createHTMLDocument !== void 0;
8242
- const { MUSTACHE_EXPR: It, ERB_EXPR: Rt, TMPLIT_EXPR: Lt, DATA_ATTR: ci, ARIA_ATTR: ui, IS_SCRIPT_OR_DATA: mr, ATTR_WHITESPACE: vr, CUSTOM_ELEMENT: di } = Xs;
8243
- let { IS_ALLOWED_URI: x } = Xs, N = null;
8262
+ const { MUSTACHE_EXPR: It, ERB_EXPR: Rt, TMPLIT_EXPR: Lt, DATA_ATTR: ui, ARIA_ATTR: di, IS_SCRIPT_OR_DATA: mr, ATTR_WHITESPACE: vr, CUSTOM_ELEMENT: fi } = Xs;
8263
+ let { IS_ALLOWED_URI: x } = Xs, P = null;
8244
8264
  const yt = M({}, [
8245
8265
  ...Gs,
8246
- ...Oi,
8247
8266
  ...Ii,
8248
8267
  ...Ri,
8268
+ ...Li,
8249
8269
  ...Vs
8250
8270
  ]);
8251
8271
  let U = null;
8252
8272
  const $n = M({}, [
8253
8273
  ...qs,
8254
- ...Li,
8274
+ ...Ni,
8255
8275
  ...Ys,
8256
8276
  ...Ar
8257
8277
  ]);
@@ -8274,7 +8294,7 @@ function tc() {
8274
8294
  enumerable: !0,
8275
8295
  value: !1
8276
8296
  }
8277
- })), Pt = null, un = null;
8297
+ })), Nt = null, un = null;
8278
8298
  const Ue = Object.seal(nr(null, {
8279
8299
  tagCheck: {
8280
8300
  writable: !0,
@@ -8289,8 +8309,8 @@ function tc() {
8289
8309
  value: null
8290
8310
  }
8291
8311
  }));
8292
- let ie = !0, be = !0, et = !1, dn = !0, tt = !1, Nt = !0, Pe = !1, $t = !1, fn = !1, Tt = !1, nt = !1, St = !1, hn = !0, rt = !1;
8293
- const fi = "user-content-";
8312
+ let ie = !0, be = !0, et = !1, dn = !0, tt = !1, Pt = !0, Ne = !1, $t = !1, fn = !1, Tt = !1, nt = !1, St = !1, hn = !0, rt = !1;
8313
+ const hi = "user-content-";
8294
8314
  let zn = !0, zt = !1, it = {}, ye = null;
8295
8315
  const Dn = M({}, [
8296
8316
  "annotation-xml",
@@ -8345,12 +8365,12 @@ function tc() {
8345
8365
  "style",
8346
8366
  "xmlns"
8347
8367
  ]), pn = "http://www.w3.org/1998/Math/MathML", gn = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml";
8348
- let st = Te, Wn = !1, je = null;
8349
- const Hn = M({}, [
8368
+ let st = Te, Hn = !1, je = null;
8369
+ const Wn = M({}, [
8350
8370
  pn,
8351
8371
  gn,
8352
8372
  Te
8353
- ], Ci);
8373
+ ], Mi);
8354
8374
  let _r = M({}, [
8355
8375
  "mi",
8356
8376
  "mo",
@@ -8368,36 +8388,36 @@ function tc() {
8368
8388
  let Fn = null;
8369
8389
  const dc = ["application/xhtml+xml", "text/html"], fc = "text/html";
8370
8390
  let Z = null, mn = null;
8371
- const hc = n.createElement("form"), $o = function(d) {
8391
+ const hc = n.createElement("form"), zo = function(d) {
8372
8392
  return d instanceof RegExp || d instanceof Function;
8373
- }, hi = function() {
8393
+ }, pi = function() {
8374
8394
  let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
8375
8395
  if (!(mn && mn === d)) {
8376
- if ((!d || typeof d != "object") && (d = {}), d = Ve(d), Fn = dc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? fc : d.PARSER_MEDIA_TYPE, Z = Fn === "application/xhtml+xml" ? Ci : Nr, N = ze(d, "ALLOWED_TAGS") ? M({}, d.ALLOWED_TAGS, Z) : yt, U = ze(d, "ALLOWED_ATTR") ? M({}, d.ALLOWED_ATTR, Z) : $n, je = ze(d, "ALLOWED_NAMESPACES") ? M({}, d.ALLOWED_NAMESPACES, Ci) : Hn, ot = ze(d, "ADD_URI_SAFE_ATTR") ? M(Ve(wt), d.ADD_URI_SAFE_ATTR, Z) : wt, K = ze(d, "ADD_DATA_URI_TAGS") ? M(Ve(ne), d.ADD_DATA_URI_TAGS, Z) : ne, ye = ze(d, "FORBID_CONTENTS") ? M({}, d.FORBID_CONTENTS, Z) : Dn, Pt = ze(d, "FORBID_TAGS") ? M({}, d.FORBID_TAGS, Z) : Ve({}), un = ze(d, "FORBID_ATTR") ? M({}, d.FORBID_ATTR, Z) : Ve({}), it = ze(d, "USE_PROFILES") ? d.USE_PROFILES : !1, ie = d.ALLOW_ARIA_ATTR !== !1, be = d.ALLOW_DATA_ATTR !== !1, et = d.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, tt = d.SAFE_FOR_TEMPLATES || !1, Nt = d.SAFE_FOR_XML !== !1, Pe = d.WHOLE_DOCUMENT || !1, Tt = d.RETURN_DOM || !1, nt = d.RETURN_DOM_FRAGMENT || !1, St = d.RETURN_TRUSTED_TYPE || !1, fn = d.FORCE_BODY || !1, hn = d.SANITIZE_DOM !== !1, rt = d.SANITIZE_NAMED_PROPS || !1, zn = d.KEEP_CONTENT !== !1, zt = d.IN_PLACE || !1, x = d.ALLOWED_URI_REGEXP || Ql, st = d.NAMESPACE || Te, _r = d.MATHML_TEXT_INTEGRATION_POINTS || _r, br = d.HTML_INTEGRATION_POINTS || br, F = d.CUSTOM_ELEMENT_HANDLING || nr(null), d.CUSTOM_ELEMENT_HANDLING && $o(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (F.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && $o(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (F.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (F.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), tt && (be = !1), nt && (Tt = !0), it && (N = M({}, Vs), U = nr(null), it.html === !0 && (M(N, Gs), M(U, qs)), it.svg === !0 && (M(N, Oi), M(U, Li), M(U, Ar)), it.svgFilters === !0 && (M(N, Ii), M(U, Li), M(U, Ar)), it.mathMl === !0 && (M(N, Ri), M(U, Ys), M(U, Ar))), Ue.tagCheck = null, Ue.attributeCheck = null, d.ADD_TAGS && (typeof d.ADD_TAGS == "function" ? Ue.tagCheck = d.ADD_TAGS : (N === yt && (N = Ve(N)), M(N, d.ADD_TAGS, Z))), d.ADD_ATTR && (typeof d.ADD_ATTR == "function" ? Ue.attributeCheck = d.ADD_ATTR : (U === $n && (U = Ve(U)), M(U, d.ADD_ATTR, Z))), d.ADD_URI_SAFE_ATTR && M(ot, d.ADD_URI_SAFE_ATTR, Z), d.FORBID_CONTENTS && (ye === Dn && (ye = Ve(ye)), M(ye, d.FORBID_CONTENTS, Z)), d.ADD_FORBID_CONTENTS && (ye === Dn && (ye = Ve(ye)), M(ye, d.ADD_FORBID_CONTENTS, Z)), zn && (N["#text"] = !0), Pe && M(N, [
8396
+ if ((!d || typeof d != "object") && (d = {}), d = Ve(d), Fn = dc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? fc : d.PARSER_MEDIA_TYPE, Z = Fn === "application/xhtml+xml" ? Mi : $r, P = ze(d, "ALLOWED_TAGS") ? M({}, d.ALLOWED_TAGS, Z) : yt, U = ze(d, "ALLOWED_ATTR") ? M({}, d.ALLOWED_ATTR, Z) : $n, je = ze(d, "ALLOWED_NAMESPACES") ? M({}, d.ALLOWED_NAMESPACES, Mi) : Wn, ot = ze(d, "ADD_URI_SAFE_ATTR") ? M(Ve(wt), d.ADD_URI_SAFE_ATTR, Z) : wt, K = ze(d, "ADD_DATA_URI_TAGS") ? M(Ve(ne), d.ADD_DATA_URI_TAGS, Z) : ne, ye = ze(d, "FORBID_CONTENTS") ? M({}, d.FORBID_CONTENTS, Z) : Dn, Nt = ze(d, "FORBID_TAGS") ? M({}, d.FORBID_TAGS, Z) : Ve({}), un = ze(d, "FORBID_ATTR") ? M({}, d.FORBID_ATTR, Z) : Ve({}), it = ze(d, "USE_PROFILES") ? d.USE_PROFILES : !1, ie = d.ALLOW_ARIA_ATTR !== !1, be = d.ALLOW_DATA_ATTR !== !1, et = d.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, tt = d.SAFE_FOR_TEMPLATES || !1, Pt = d.SAFE_FOR_XML !== !1, Ne = d.WHOLE_DOCUMENT || !1, Tt = d.RETURN_DOM || !1, nt = d.RETURN_DOM_FRAGMENT || !1, St = d.RETURN_TRUSTED_TYPE || !1, fn = d.FORCE_BODY || !1, hn = d.SANITIZE_DOM !== !1, rt = d.SANITIZE_NAMED_PROPS || !1, zn = d.KEEP_CONTENT !== !1, zt = d.IN_PLACE || !1, x = d.ALLOWED_URI_REGEXP || Ql, st = d.NAMESPACE || Te, _r = d.MATHML_TEXT_INTEGRATION_POINTS || _r, br = d.HTML_INTEGRATION_POINTS || br, F = d.CUSTOM_ELEMENT_HANDLING || nr(null), d.CUSTOM_ELEMENT_HANDLING && zo(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (F.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && zo(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (F.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (F.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), tt && (be = !1), nt && (Tt = !0), it && (P = M({}, Vs), U = nr(null), it.html === !0 && (M(P, Gs), M(U, qs)), it.svg === !0 && (M(P, Ii), M(U, Ni), M(U, Ar)), it.svgFilters === !0 && (M(P, Ri), M(U, Ni), M(U, Ar)), it.mathMl === !0 && (M(P, Li), M(U, Ys), M(U, Ar))), Ue.tagCheck = null, Ue.attributeCheck = null, d.ADD_TAGS && (typeof d.ADD_TAGS == "function" ? Ue.tagCheck = d.ADD_TAGS : (P === yt && (P = Ve(P)), M(P, d.ADD_TAGS, Z))), d.ADD_ATTR && (typeof d.ADD_ATTR == "function" ? Ue.attributeCheck = d.ADD_ATTR : (U === $n && (U = Ve(U)), M(U, d.ADD_ATTR, Z))), d.ADD_URI_SAFE_ATTR && M(ot, d.ADD_URI_SAFE_ATTR, Z), d.FORBID_CONTENTS && (ye === Dn && (ye = Ve(ye)), M(ye, d.FORBID_CONTENTS, Z)), d.ADD_FORBID_CONTENTS && (ye === Dn && (ye = Ve(ye)), M(ye, d.ADD_FORBID_CONTENTS, Z)), zn && (P["#text"] = !0), Ne && M(P, [
8377
8397
  "html",
8378
8398
  "head",
8379
8399
  "body"
8380
- ]), N.table && (M(N, ["tbody"]), delete Pt.tbody), d.TRUSTED_TYPES_POLICY) {
8400
+ ]), P.table && (M(P, ["tbody"]), delete Nt.tbody), d.TRUSTED_TYPES_POLICY) {
8381
8401
  if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function") throw Yn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
8382
8402
  if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Yn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
8383
8403
  w = d.TRUSTED_TYPES_POLICY, X = w.createHTML("");
8384
8404
  } else
8385
- w === void 0 && (w = Up(g, i)), w !== null && typeof X == "string" && (X = w.createHTML(""));
8405
+ w === void 0 && (w = Fp(g, i)), w !== null && typeof X == "string" && (X = w.createHTML(""));
8386
8406
  fe && fe(d), mn = d;
8387
8407
  }
8388
- }, zo = M({}, [
8389
- ...Oi,
8408
+ }, Do = M({}, [
8390
8409
  ...Ii,
8391
- ...Rp
8392
- ]), Do = M({}, [...Ri, ...Lp]), pc = function(d) {
8410
+ ...Ri,
8411
+ ...Op
8412
+ ]), Ho = M({}, [...Li, ...Ip]), pc = function(d) {
8393
8413
  let _ = J(d);
8394
8414
  (!_ || !_.tagName) && (_ = {
8395
8415
  namespaceURI: st,
8396
8416
  tagName: "template"
8397
8417
  });
8398
- const S = Nr(d.tagName), j = Nr(_.tagName);
8399
- return je[d.namespaceURI] ? d.namespaceURI === gn ? _.namespaceURI === Te ? S === "svg" : _.namespaceURI === pn ? S === "svg" && (j === "annotation-xml" || _r[j]) : !!zo[S] : d.namespaceURI === pn ? _.namespaceURI === Te ? S === "math" : _.namespaceURI === gn ? S === "math" && br[j] : !!Do[S] : d.namespaceURI === Te ? _.namespaceURI === gn && !br[j] || _.namespaceURI === pn && !_r[j] ? !1 : !Do[S] && (uc[S] || !zo[S]) : !!(Fn === "application/xhtml+xml" && je[d.namespaceURI]) : !1;
8400
- }, Ne = function(d) {
8418
+ const S = $r(d.tagName), j = $r(_.tagName);
8419
+ return je[d.namespaceURI] ? d.namespaceURI === gn ? _.namespaceURI === Te ? S === "svg" : _.namespaceURI === pn ? S === "svg" && (j === "annotation-xml" || _r[j]) : !!Do[S] : d.namespaceURI === pn ? _.namespaceURI === Te ? S === "math" : _.namespaceURI === gn ? S === "math" && br[j] : !!Ho[S] : d.namespaceURI === Te ? _.namespaceURI === gn && !br[j] || _.namespaceURI === pn && !_r[j] ? !1 : !Ho[S] && (uc[S] || !Do[S]) : !!(Fn === "application/xhtml+xml" && je[d.namespaceURI]) : !1;
8420
+ }, Pe = function(d) {
8401
8421
  qn(t.removed, { element: d });
8402
8422
  try {
8403
8423
  J(d).removeChild(d);
@@ -8417,7 +8437,7 @@ function tc() {
8417
8437
  });
8418
8438
  }
8419
8439
  if (_.removeAttribute(d), d === "is") if (Tt || nt) try {
8420
- Ne(_);
8440
+ Pe(_);
8421
8441
  } catch {
8422
8442
  }
8423
8443
  else try {
@@ -8428,7 +8448,7 @@ function tc() {
8428
8448
  let _ = null, S = null;
8429
8449
  if (fn) d = "<remove></remove>" + d;
8430
8450
  else {
8431
- const Se = Mi(d, /^[\r\n\t ]+/);
8451
+ const Se = Oi(d, /^[\r\n\t ]+/);
8432
8452
  S = Se && Se[0];
8433
8453
  }
8434
8454
  Fn === "application/xhtml+xml" && st === Te && (d = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + d + "</body></html>");
@@ -8440,17 +8460,17 @@ function tc() {
8440
8460
  if (!_ || !_.documentElement) {
8441
8461
  _ = le.createDocument(st, "template", null);
8442
8462
  try {
8443
- _.documentElement.innerHTML = Wn ? X : j;
8463
+ _.documentElement.innerHTML = Hn ? X : j;
8444
8464
  } catch {
8445
8465
  }
8446
8466
  }
8447
- const H = _.body || _.documentElement;
8448
- return d && S && H.insertBefore(n.createTextNode(S), H.childNodes[0] || null), st === Te ? cn.call(_, Pe ? "html" : "body")[0] : Pe ? _.documentElement : H;
8449
- }, Ho = function(d) {
8467
+ const W = _.body || _.documentElement;
8468
+ return d && S && W.insertBefore(n.createTextNode(S), W.childNodes[0] || null), st === Te ? cn.call(_, Ne ? "html" : "body")[0] : Ne ? _.documentElement : W;
8469
+ }, Fo = function(d) {
8450
8470
  return an.call(d.ownerDocument || d, d, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
8451
- }, pi = function(d) {
8452
- return d instanceof f && (typeof d.nodeName != "string" || typeof d.textContent != "string" || typeof d.removeChild != "function" || !(d.attributes instanceof u) || typeof d.removeAttribute != "function" || typeof d.setAttribute != "function" || typeof d.namespaceURI != "string" || typeof d.insertBefore != "function" || typeof d.hasChildNodes != "function");
8453
8471
  }, gi = function(d) {
8472
+ return d instanceof f && (typeof d.nodeName != "string" || typeof d.textContent != "string" || typeof d.removeChild != "function" || !(d.attributes instanceof u) || typeof d.removeAttribute != "function" || typeof d.setAttribute != "function" || typeof d.namespaceURI != "string" || typeof d.insertBefore != "function" || typeof d.hasChildNodes != "function");
8473
+ }, mi = function(d) {
8454
8474
  return typeof a == "function" && d instanceof a;
8455
8475
  };
8456
8476
  function at(k, d, _) {
@@ -8458,48 +8478,48 @@ function tc() {
8458
8478
  S.call(t, d, _, mn);
8459
8479
  });
8460
8480
  }
8461
- const Fo = function(d) {
8481
+ const Bo = function(d) {
8462
8482
  let _ = null;
8463
- if (at(te.beforeSanitizeElements, d, null), pi(d))
8464
- return Ne(d), !0;
8483
+ if (at(te.beforeSanitizeElements, d, null), gi(d))
8484
+ return Pe(d), !0;
8465
8485
  const S = Z(d.nodeName);
8466
8486
  if (at(te.uponSanitizeElement, d, {
8467
8487
  tagName: S,
8468
- allowedTags: N
8469
- }), Nt && d.hasChildNodes() && !gi(d.firstElementChild) && ce(/<[/\w!]/g, d.innerHTML) && ce(/<[/\w!]/g, d.textContent) || Nt && d.namespaceURI === Te && S === "style" && gi(d.firstElementChild) || d.nodeType === Kn.progressingInstruction || Nt && d.nodeType === Kn.comment && ce(/<[/\w]/g, d.data))
8470
- return Ne(d), !0;
8471
- if (Pt[S] || !(Ue.tagCheck instanceof Function && Ue.tagCheck(S)) && !N[S]) {
8472
- if (!Pt[S] && Uo(S) && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, S) || F.tagNameCheck instanceof Function && F.tagNameCheck(S)))
8488
+ allowedTags: P
8489
+ }), Pt && d.hasChildNodes() && !mi(d.firstElementChild) && ce(/<[/\w!]/g, d.innerHTML) && ce(/<[/\w!]/g, d.textContent) || Pt && d.namespaceURI === Te && S === "style" && mi(d.firstElementChild) || d.nodeType === Kn.progressingInstruction || Pt && d.nodeType === Kn.comment && ce(/<[/\w]/g, d.data))
8490
+ return Pe(d), !0;
8491
+ if (Nt[S] || !(Ue.tagCheck instanceof Function && Ue.tagCheck(S)) && !P[S]) {
8492
+ if (!Nt[S] && jo(S) && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, S) || F.tagNameCheck instanceof Function && F.tagNameCheck(S)))
8473
8493
  return !1;
8474
8494
  if (zn && !ye[S]) {
8475
- const j = J(d) || d.parentNode, H = W(d) || d.childNodes;
8476
- if (H && j) {
8477
- const Se = H.length;
8495
+ const j = J(d) || d.parentNode, W = H(d) || d.childNodes;
8496
+ if (W && j) {
8497
+ const Se = W.length;
8478
8498
  for (let we = Se - 1; we >= 0; --we) {
8479
- const ee = b(H[we], !0);
8499
+ const ee = b(W[we], !0);
8480
8500
  ee.__removalCount = (d.__removalCount || 0) + 1, j.insertBefore(ee, I(d));
8481
8501
  }
8482
8502
  }
8483
8503
  }
8484
- return Ne(d), !0;
8504
+ return Pe(d), !0;
8485
8505
  }
8486
- return d instanceof l && !pc(d) || (S === "noscript" || S === "noembed" || S === "noframes") && ce(/<\/no(script|embed|frames)/i, d.innerHTML) ? (Ne(d), !0) : (tt && d.nodeType === Kn.text && (_ = d.textContent, Vn([
8506
+ return d instanceof l && !pc(d) || (S === "noscript" || S === "noembed" || S === "noframes") && ce(/<\/no(script|embed|frames)/i, d.innerHTML) ? (Pe(d), !0) : (tt && d.nodeType === Kn.text && (_ = d.textContent, Vn([
8487
8507
  It,
8488
8508
  Rt,
8489
8509
  Lt
8490
8510
  ], (j) => {
8491
8511
  _ = yn(_, j, " ");
8492
8512
  }), d.textContent !== _ && (qn(t.removed, { element: d.cloneNode() }), d.textContent = _)), at(te.afterSanitizeElements, d, null), !1);
8493
- }, Bo = function(d, _, S) {
8513
+ }, Uo = function(d, _, S) {
8494
8514
  if (un[_] || hn && (_ === "id" || _ === "name") && (S in n || S in hc)) return !1;
8495
- if (!(be && !un[_] && ce(ci, _))) {
8496
- if (!(ie && ce(ui, _))) {
8515
+ if (!(be && !un[_] && ce(ui, _))) {
8516
+ if (!(ie && ce(di, _))) {
8497
8517
  if (!(Ue.attributeCheck instanceof Function && Ue.attributeCheck(_, d))) {
8498
8518
  if (!U[_] || un[_]) {
8499
- if (!(Uo(d) && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, d) || F.tagNameCheck instanceof Function && F.tagNameCheck(d)) && (F.attributeNameCheck instanceof RegExp && ce(F.attributeNameCheck, _) || F.attributeNameCheck instanceof Function && F.attributeNameCheck(_, d)) || _ === "is" && F.allowCustomizedBuiltInElements && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, S) || F.tagNameCheck instanceof Function && F.tagNameCheck(S)))) return !1;
8519
+ if (!(jo(d) && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, d) || F.tagNameCheck instanceof Function && F.tagNameCheck(d)) && (F.attributeNameCheck instanceof RegExp && ce(F.attributeNameCheck, _) || F.attributeNameCheck instanceof Function && F.attributeNameCheck(_, d)) || _ === "is" && F.allowCustomizedBuiltInElements && (F.tagNameCheck instanceof RegExp && ce(F.tagNameCheck, S) || F.tagNameCheck instanceof Function && F.tagNameCheck(S)))) return !1;
8500
8520
  } else if (!ot[_]) {
8501
8521
  if (!ce(x, yn(S, vr, ""))) {
8502
- if (!((_ === "src" || _ === "xlink:href" || _ === "href") && d !== "script" && Cp(S, "data:") === 0 && K[d])) {
8522
+ if (!((_ === "src" || _ === "xlink:href" || _ === "href") && d !== "script" && xp(S, "data:") === 0 && K[d])) {
8503
8523
  if (!(et && !ce(mr, yn(S, vr, "")))) {
8504
8524
  if (S) return !1;
8505
8525
  }
@@ -8510,12 +8530,12 @@ function tc() {
8510
8530
  }
8511
8531
  }
8512
8532
  return !0;
8513
- }, Uo = function(d) {
8514
- return d !== "annotation-xml" && Mi(d, di);
8515
8533
  }, jo = function(d) {
8534
+ return d !== "annotation-xml" && Oi(d, fi);
8535
+ }, Go = function(d) {
8516
8536
  at(te.beforeSanitizeAttributes, d, null);
8517
8537
  const { attributes: _ } = d;
8518
- if (!_ || pi(d)) return;
8538
+ if (!_ || gi(d)) return;
8519
8539
  const S = {
8520
8540
  attrName: "",
8521
8541
  attrValue: "",
@@ -8525,38 +8545,38 @@ function tc() {
8525
8545
  };
8526
8546
  let j = _.length;
8527
8547
  for (; j--; ) {
8528
- const { name: H, namespaceURI: Se, value: we } = _[j], ee = Z(H), Bn = we;
8529
- let re = H === "value" ? Bn : Mp(Bn);
8530
- if (S.attrName = ee, S.attrValue = re, S.keepAttr = !0, S.forceKeepAttr = void 0, at(te.uponSanitizeAttribute, d, S), re = S.attrValue, rt && (ee === "id" || ee === "name") && (Dt(H, d), re = fi + re), Nt && ce(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, re)) {
8531
- Dt(H, d);
8548
+ const { name: W, namespaceURI: Se, value: we } = _[j], ee = Z(W), Bn = we;
8549
+ let re = W === "value" ? Bn : Ap(Bn);
8550
+ if (S.attrName = ee, S.attrValue = re, S.keepAttr = !0, S.forceKeepAttr = void 0, at(te.uponSanitizeAttribute, d, S), re = S.attrValue, rt && (ee === "id" || ee === "name") && (Dt(W, d), re = hi + re), Pt && ce(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, re)) {
8551
+ Dt(W, d);
8532
8552
  continue;
8533
8553
  }
8534
- if (ee === "attributename" && Mi(re, "href")) {
8535
- Dt(H, d);
8554
+ if (ee === "attributename" && Oi(re, "href")) {
8555
+ Dt(W, d);
8536
8556
  continue;
8537
8557
  }
8538
8558
  if (S.forceKeepAttr) continue;
8539
8559
  if (!S.keepAttr) {
8540
- Dt(H, d);
8560
+ Dt(W, d);
8541
8561
  continue;
8542
8562
  }
8543
8563
  if (!dn && ce(/\/>/i, re)) {
8544
- Dt(H, d);
8564
+ Dt(W, d);
8545
8565
  continue;
8546
8566
  }
8547
8567
  tt && Vn([
8548
8568
  It,
8549
8569
  Rt,
8550
8570
  Lt
8551
- ], (qo) => {
8552
- re = yn(re, qo, " ");
8571
+ ], (Yo) => {
8572
+ re = yn(re, Yo, " ");
8553
8573
  });
8554
- const Vo = Z(d.nodeName);
8555
- if (!Bo(Vo, ee, re)) {
8556
- Dt(H, d);
8574
+ const qo = Z(d.nodeName);
8575
+ if (!Uo(qo, ee, re)) {
8576
+ Dt(W, d);
8557
8577
  continue;
8558
8578
  }
8559
- if (w && typeof g == "object" && typeof g.getAttributeType == "function" && !Se) switch (g.getAttributeType(Vo, ee)) {
8579
+ if (w && typeof g == "object" && typeof g.getAttributeType == "function" && !Se) switch (g.getAttributeType(qo, ee)) {
8560
8580
  case "TrustedHTML":
8561
8581
  re = w.createHTML(re);
8562
8582
  break;
@@ -8565,40 +8585,40 @@ function tc() {
8565
8585
  break;
8566
8586
  }
8567
8587
  if (re !== Bn) try {
8568
- Se ? d.setAttributeNS(Se, H, re) : d.setAttribute(H, re), pi(d) ? Ne(d) : js(t.removed);
8588
+ Se ? d.setAttributeNS(Se, W, re) : d.setAttribute(W, re), gi(d) ? Pe(d) : js(t.removed);
8569
8589
  } catch {
8570
- Dt(H, d);
8590
+ Dt(W, d);
8571
8591
  }
8572
8592
  }
8573
8593
  at(te.afterSanitizeAttributes, d, null);
8574
- }, Go = function(d) {
8594
+ }, Vo = function(d) {
8575
8595
  let _ = null;
8576
- const S = Ho(d);
8596
+ const S = Fo(d);
8577
8597
  for (at(te.beforeSanitizeShadowDOM, d, null); _ = S.nextNode(); )
8578
- at(te.uponSanitizeShadowNode, _, null), Fo(_), jo(_), _.content instanceof o && Go(_.content);
8598
+ at(te.uponSanitizeShadowNode, _, null), Bo(_), Go(_), _.content instanceof o && Vo(_.content);
8579
8599
  at(te.afterSanitizeShadowDOM, d, null);
8580
8600
  };
8581
8601
  return t.sanitize = function(k) {
8582
- let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = null, S = null, j = null, H = null;
8583
- if (Wn = !k, Wn && (k = "<!-->"), typeof k != "string" && !gi(k)) if (typeof k.toString == "function") {
8602
+ let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = null, S = null, j = null, W = null;
8603
+ if (Hn = !k, Hn && (k = "<!-->"), typeof k != "string" && !mi(k)) if (typeof k.toString == "function") {
8584
8604
  if (k = k.toString(), typeof k != "string") throw Yn("dirty is not a string, aborting");
8585
8605
  } else throw Yn("toString is not a function");
8586
8606
  if (!t.isSupported) return k;
8587
- if ($t || hi(d), t.removed = [], typeof k == "string" && (zt = !1), zt) {
8607
+ if ($t || pi(d), t.removed = [], typeof k == "string" && (zt = !1), zt) {
8588
8608
  if (k.nodeName) {
8589
8609
  const ee = Z(k.nodeName);
8590
- if (!N[ee] || Pt[ee]) throw Yn("root node is forbidden and cannot be sanitized in-place");
8610
+ if (!P[ee] || Nt[ee]) throw Yn("root node is forbidden and cannot be sanitized in-place");
8591
8611
  }
8592
8612
  } else if (k instanceof a)
8593
8613
  _ = Wo("<!---->"), S = _.ownerDocument.importNode(k, !0), S.nodeType === Kn.element && S.nodeName === "BODY" || S.nodeName === "HTML" ? _ = S : _.appendChild(S);
8594
8614
  else {
8595
- if (!Tt && !tt && !Pe && k.indexOf("<") === -1) return w && St ? w.createHTML(k) : k;
8615
+ if (!Tt && !tt && !Ne && k.indexOf("<") === -1) return w && St ? w.createHTML(k) : k;
8596
8616
  if (_ = Wo(k), !_) return Tt ? null : St ? X : "";
8597
8617
  }
8598
- _ && fn && Ne(_.firstChild);
8599
- const Se = Ho(zt ? k : _);
8618
+ _ && fn && Pe(_.firstChild);
8619
+ const Se = Fo(zt ? k : _);
8600
8620
  for (; j = Se.nextNode(); )
8601
- Fo(j), jo(j), j.content instanceof o && Go(j.content);
8621
+ Bo(j), Go(j), j.content instanceof o && Vo(j.content);
8602
8622
  if (zt) return k;
8603
8623
  if (Tt) {
8604
8624
  if (tt) {
@@ -8613,12 +8633,12 @@ function tc() {
8613
8633
  }), _.innerHTML = ee;
8614
8634
  }
8615
8635
  if (nt)
8616
- for (H = ln.call(_.ownerDocument); _.firstChild; ) H.appendChild(_.firstChild);
8617
- else H = _;
8618
- return (U.shadowroot || U.shadowrootmode) && (H = li.call(r, H, !0)), H;
8636
+ for (W = ln.call(_.ownerDocument); _.firstChild; ) W.appendChild(_.firstChild);
8637
+ else W = _;
8638
+ return (U.shadowroot || U.shadowrootmode) && (W = ci.call(r, W, !0)), W;
8619
8639
  }
8620
- let we = Pe ? _.outerHTML : _.innerHTML;
8621
- return Pe && N["!doctype"] && _.ownerDocument && _.ownerDocument.doctype && _.ownerDocument.doctype.name && ce(ec, _.ownerDocument.doctype.name) && (we = "<!DOCTYPE " + _.ownerDocument.doctype.name + `>
8640
+ let we = Ne ? _.outerHTML : _.innerHTML;
8641
+ return Ne && P["!doctype"] && _.ownerDocument && _.ownerDocument.doctype && _.ownerDocument.doctype.name && ce(ec, _.ownerDocument.doctype.name) && (we = "<!DOCTYPE " + _.ownerDocument.doctype.name + `>
8622
8642
  ` + we), tt && Vn([
8623
8643
  It,
8624
8644
  Rt,
@@ -8627,17 +8647,17 @@ function tc() {
8627
8647
  we = yn(we, ee, " ");
8628
8648
  }), w && St ? w.createHTML(we) : we;
8629
8649
  }, t.setConfig = function() {
8630
- hi(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), $t = !0;
8650
+ pi(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), $t = !0;
8631
8651
  }, t.clearConfig = function() {
8632
8652
  mn = null, $t = !1;
8633
8653
  }, t.isValidAttribute = function(k, d, _) {
8634
- return mn || hi({}), Bo(Z(k), Z(d), _);
8654
+ return mn || pi({}), Uo(Z(k), Z(d), _);
8635
8655
  }, t.addHook = function(k, d) {
8636
8656
  typeof d == "function" && qn(te[k], d);
8637
8657
  }, t.removeHook = function(k, d) {
8638
8658
  if (d !== void 0) {
8639
- const _ = xp(te[k], d);
8640
- return _ === -1 ? void 0 : Ap(te[k], _, 1)[0];
8659
+ const _ = kp(te[k], d);
8660
+ return _ === -1 ? void 0 : Ep(te[k], _, 1)[0];
8641
8661
  }
8642
8662
  return js(te[k]);
8643
8663
  }, t.removeHooks = function(k) {
@@ -8646,15 +8666,15 @@ function tc() {
8646
8666
  te = Ks();
8647
8667
  }, t;
8648
8668
  }
8649
- var Og = tc(), ho;
8669
+ var Og = tc(), po;
8650
8670
  (function(e) {
8651
8671
  e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
8652
- })(ho || (ho = {}));
8672
+ })(po || (po = {}));
8653
8673
  var Js;
8654
8674
  (function(e) {
8655
8675
  e.loading = "loading", e.loaded = "loaded";
8656
8676
  })(Js || (Js = {}));
8657
- var Ig = Sp.timeoutMs, Zs;
8677
+ var Ig = yp.timeoutMs, Zs;
8658
8678
  (function(e) {
8659
8679
  e.SAVE = "save", e.MODEL = "model", e.SCORE = "score", e.MANUAL_SCORE = "manual-score";
8660
8680
  })(Zs || (Zs = {}));
@@ -8670,7 +8690,7 @@ var ta;
8670
8690
  (function(e) {
8671
8691
  e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
8672
8692
  })(ta || (ta = {}));
8673
- var jp = class nc extends CustomEvent {
8693
+ var Bp = class nc extends CustomEvent {
8674
8694
  constructor(t, n = !1) {
8675
8695
  super(nc.TYPE, {
8676
8696
  bubbles: !0,
@@ -8681,8 +8701,8 @@ var jp = class nc extends CustomEvent {
8681
8701
  }), v(this, "update", void 0), v(this, "reset", void 0), this.update = t, this.reset = n;
8682
8702
  }
8683
8703
  };
8684
- v(jp, "TYPE", "model.updated");
8685
- var Gp = class rc extends CustomEvent {
8704
+ v(Bp, "TYPE", "model.updated");
8705
+ var Up = class rc extends CustomEvent {
8686
8706
  constructor(t, n) {
8687
8707
  super(rc.TYPE, {
8688
8708
  bubbles: !0,
@@ -8693,8 +8713,8 @@ var Gp = class rc extends CustomEvent {
8693
8713
  }), v(this, "src", void 0), v(this, "done", void 0), this.src = t, this.done = n;
8694
8714
  }
8695
8715
  };
8696
- v(Gp, "TYPE", "delete.image");
8697
- var Vp = class ic extends CustomEvent {
8716
+ v(Up, "TYPE", "delete.image");
8717
+ var jp = class ic extends CustomEvent {
8698
8718
  constructor(t) {
8699
8719
  super(ic.TYPE, {
8700
8720
  bubbles: !0,
@@ -8702,8 +8722,8 @@ var Vp = class ic extends CustomEvent {
8702
8722
  }), v(this, "handler", void 0), this.handler = t;
8703
8723
  }
8704
8724
  };
8705
- v(Vp, "TYPE", "insert.image");
8706
- var qp = class oc extends CustomEvent {
8725
+ v(jp, "TYPE", "insert.image");
8726
+ var Gp = class oc extends CustomEvent {
8707
8727
  constructor(t, n) {
8708
8728
  super(oc.TYPE, {
8709
8729
  bubbles: !0,
@@ -8714,8 +8734,8 @@ var qp = class oc extends CustomEvent {
8714
8734
  }), v(this, "src", void 0), v(this, "done", void 0), this.src = t, this.done = n;
8715
8735
  }
8716
8736
  };
8717
- v(qp, "TYPE", "delete.sound");
8718
- var Yp = class sc extends CustomEvent {
8737
+ v(Gp, "TYPE", "delete.sound");
8738
+ var Vp = class sc extends CustomEvent {
8719
8739
  constructor(t) {
8720
8740
  super(sc.TYPE, {
8721
8741
  bubbles: !0,
@@ -8723,8 +8743,8 @@ var Yp = class sc extends CustomEvent {
8723
8743
  }), v(this, "handler", void 0), this.handler = t;
8724
8744
  }
8725
8745
  };
8726
- v(Yp, "TYPE", "insert.sound");
8727
- var Xp = class ac extends CustomEvent {
8746
+ v(Vp, "TYPE", "insert.sound");
8747
+ var qp = class ac extends CustomEvent {
8728
8748
  constructor(t, n) {
8729
8749
  super(ac.TYPE, {
8730
8750
  bubbles: !0,
@@ -8736,7 +8756,7 @@ var Xp = class ac extends CustomEvent {
8736
8756
  }), v(this, "component", void 0), v(this, "complete", void 0), this.component = t, this.complete = n;
8737
8757
  }
8738
8758
  };
8739
- v(Xp, "TYPE", "session-changed");
8759
+ v(qp, "TYPE", "session-changed");
8740
8760
  var na;
8741
8761
  (function(e) {
8742
8762
  e[e.ROOT = 0] = "ROOT", e[e.SUBJECT = 1] = "SUBJECT", e[e.LEVEL = 2] = "LEVEL", e[e.STANDARD = 3] = "STANDARD";
@@ -8755,14 +8775,14 @@ function _t(e, t) {
8755
8775
  function bt() {
8756
8776
  return typeof window < "u" && window.PIE_DEBUG === !0;
8757
8777
  }
8758
- var Rg = _t("math-rendering", () => bt()), Lg = _t("pie-scoring", () => bt()), Pg = _t("pie-updates", () => bt()), Ng = _t("pie-initialization", () => bt()), $g = {
8759
- buildServiceBase: Tp,
8760
- bundleType: ho.player,
8778
+ var Rg = _t("math-rendering", () => bt()), Lg = _t("pie-scoring", () => bt()), Ng = _t("pie-updates", () => bt()), Pg = _t("pie-initialization", () => bt()), $g = {
8779
+ buildServiceBase: bp,
8780
+ bundleType: po.player,
8761
8781
  env: {
8762
8782
  mode: "gather",
8763
8783
  role: "student"
8764
8784
  }
8765
- }, zg = _t("asset-handler", () => bt()), Dg = _t("authoring", () => bt()), Wg = _t("instrumentation-event-bridge", () => bt()), Hg = _t("instrumentation-provider-resolution", () => bt()), Fg = Object.freeze([
8785
+ }, zg = _t("asset-handler", () => bt()), Dg = _t("authoring", () => bt()), Hg = _t("instrumentation-event-bridge", () => bt()), Wg = _t("instrumentation-provider-resolution", () => bt()), Fg = Object.freeze([
8766
8786
  "composed",
8767
8787
  "engine-ready",
8768
8788
  "interactive",
@@ -8785,13 +8805,13 @@ var Rg = _t("math-rendering", () => bt()), Lg = _t("pie-scoring", () => bt()), P
8785
8805
  "[contenteditable]:not([contenteditable='false'])",
8786
8806
  "[tabindex]:not([tabindex='-1'])"
8787
8807
  ].join(",");
8788
- function Kp(e) {
8808
+ function Yp(e) {
8789
8809
  return !e.matches(lc) || e.hasAttribute("disabled") || e.closest("[inert]") ? !1 : e.offsetParent !== null || e.getClientRects().length > 0;
8790
8810
  }
8791
8811
  function cc(e) {
8792
- return Array.from(e.querySelectorAll(lc)).filter((t) => Kp(t));
8812
+ return Array.from(e.querySelectorAll(lc)).filter((t) => Yp(t));
8793
8813
  }
8794
- function Jp(e, t) {
8814
+ function Xp(e, t) {
8795
8815
  try {
8796
8816
  if (t && e.contains(t)) {
8797
8817
  t.focus();
@@ -8806,7 +8826,7 @@ function Jp(e, t) {
8806
8826
  } catch {
8807
8827
  }
8808
8828
  }
8809
- function Zp(e, t = {}) {
8829
+ function Kp(e, t = {}) {
8810
8830
  const n = typeof document < "u" ? document.activeElement : null, r = t.wrap ?? !0, i = (o) => {
8811
8831
  if (o.key === "Escape") {
8812
8832
  t.onEscape?.();
@@ -8826,7 +8846,7 @@ function Zp(e, t = {}) {
8826
8846
  }
8827
8847
  l === s.length - 1 && (r ? (o.preventDefault(), s[0].focus()) : t.onTabExit?.("forward", o));
8828
8848
  };
8829
- return queueMicrotask(() => Jp(e, t.initialFocus)), e.addEventListener("keydown", i), () => {
8849
+ return queueMicrotask(() => Xp(e, t.initialFocus)), e.addEventListener("keydown", i), () => {
8830
8850
  e.removeEventListener("keydown", i);
8831
8851
  try {
8832
8852
  n?.focus?.();
@@ -8834,7 +8854,7 @@ function Zp(e, t = {}) {
8834
8854
  }
8835
8855
  };
8836
8856
  }
8837
- var Qp = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__error-message svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z"> </span></div>'), eg = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__loading-message svelte-xk676z"><span class="svelte-xk676z">Initializing...</span></div>'), tg = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__selection-info svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 svelte-xk676z" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z"> </span></div>'), ng = /* @__PURE__ */ Ze('<p class="svelte-xk676z">Select text on the page to read it aloud.</p>'), rg = /* @__PURE__ */ Ze('<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Resume</span>', 1), ig = /* @__PURE__ */ Ze('<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Pause</span>', 1), og = /* @__PURE__ */ Ze('<span class="pie-tool-text-to-speech__pulse svelte-xk676z"></span>'), sg = /* @__PURE__ */ Ze('<div><div class="pie-tool-text-to-speech__status-icon svelte-xk676z"><!></div> <span class="svelte-xk676z"> </span></div>'), ag = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__instructions svelte-xk676z"><!></div> <div class="pie-tool-text-to-speech__control-group svelte-xk676z"><label for="tts-speed" class="svelte-xk676z"><span class="svelte-xk676z">Speed:</span> <strong class="svelte-xk676z"> </strong></label> <input id="tts-speed" type="range" min="0.5" max="2.0" step="0.25" class="svelte-xk676z"/></div> <div class="pie-tool-text-to-speech__playback-controls svelte-xk676z"><button class="pie-tool-text-to-speech__button-primary svelte-xk676z" aria-label="Play" type="button"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Play</span></button> <button class="pie-tool-text-to-speech__button-secondary svelte-xk676z" type="button"><!></button> <button class="pie-tool-text-to-speech__button-secondary svelte-xk676z" aria-label="Stop" type="button"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Stop</span></button></div> <!>', 1), lg = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech svelte-xk676z" role="dialog" aria-label="Text-to-Speech Tool" tabindex="-1"><div class="pie-tool-text-to-speech__header svelte-xk676z"><div class="pie-tool-text-to-speech__header-left svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 svelte-xk676z" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.858 18.142a3 3 0 104.243-4.242L12 12.142 7.757 7.899a3 3 0 000 4.242z" class="svelte-xk676z"></path></svg> <span class="pie-tool-text-to-speech__title svelte-xk676z">Text-to-Speech</span></div> <button class="pie-tool-text-to-speech__close-button svelte-xk676z" aria-label="Close" type="button">×</button></div> <div class="pie-tool-text-to-speech__content svelte-xk676z"><!></div></div>'), cg = {
8857
+ var Jp = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__error-message svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z"> </span></div>'), Zp = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__loading-message svelte-xk676z"><span class="svelte-xk676z">Initializing...</span></div>'), Qp = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__selection-info svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 svelte-xk676z" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z"> </span></div>'), eg = /* @__PURE__ */ Ze('<p class="svelte-xk676z">Select text on the page to read it aloud.</p>'), tg = /* @__PURE__ */ Ze('<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Resume</span>', 1), ng = /* @__PURE__ */ Ze('<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Pause</span>', 1), rg = /* @__PURE__ */ Ze('<span class="pie-tool-text-to-speech__pulse svelte-xk676z"></span>'), ig = /* @__PURE__ */ Ze('<div><div class="pie-tool-text-to-speech__status-icon svelte-xk676z"><!></div> <span class="svelte-xk676z"> </span></div>'), og = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__instructions svelte-xk676z"><!></div> <div class="pie-tool-text-to-speech__control-group svelte-xk676z"><label for="tts-speed" class="svelte-xk676z"><span class="svelte-xk676z">Speed:</span> <strong class="svelte-xk676z"> </strong></label> <input id="tts-speed" type="range" min="0.5" max="2.0" step="0.25" class="svelte-xk676z"/></div> <div class="pie-tool-text-to-speech__playback-controls svelte-xk676z"><button class="pie-tool-text-to-speech__button-primary svelte-xk676z" aria-label="Play" type="button"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Play</span></button> <button class="pie-tool-text-to-speech__button-secondary svelte-xk676z" type="button"><!></button> <button class="pie-tool-text-to-speech__button-secondary svelte-xk676z" aria-label="Stop" type="button"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 svelte-xk676z" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z" clip-rule="evenodd" class="svelte-xk676z"></path></svg> <span class="svelte-xk676z">Stop</span></button></div> <!>', 1), sg = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech svelte-xk676z" role="dialog" aria-label="Text-to-Speech Tool" tabindex="-1"><div class="pie-tool-text-to-speech__header svelte-xk676z"><div class="pie-tool-text-to-speech__header-left svelte-xk676z"><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 svelte-xk676z" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.858 18.142a3 3 0 104.243-4.242L12 12.142 7.757 7.899a3 3 0 000 4.242z" class="svelte-xk676z"></path></svg> <span class="pie-tool-text-to-speech__title svelte-xk676z">Text-to-Speech</span></div> <button class="pie-tool-text-to-speech__close-button svelte-xk676z" aria-label="Close" type="button">×</button></div> <div class="pie-tool-text-to-speech__content svelte-xk676z"><!></div></div>'), ag = {
8838
8858
  hash: "svelte-xk676z",
8839
8859
  code: `.pie-tool-text-to-speech.svelte-xk676z {position:fixed;width:300px;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border-light, #cbd5e0);border-radius:8px;box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);cursor:move;user-select:none;font-family:system-ui, -apple-system, sans-serif;}.pie-tool-text-to-speech__header.svelte-xk676z {display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:var(--pie-primary-dark, #283593);color:var(--pie-white, #fff);border-radius:8px 8px 0 0;cursor:move;}.pie-tool-text-to-speech__header-left.svelte-xk676z {display:flex;align-items:center;gap:8px;}.pie-tool-text-to-speech__title.svelte-xk676z {font-weight:600;font-size:14px;}.pie-tool-text-to-speech__close-button.svelte-xk676z {background:rgb(255 255 255 / 0.2);border:none;color:var(--pie-white, #fff);width:24px;height:24px;border-radius:4px;cursor:pointer;font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center;transition:background-color 0.2s;}.pie-tool-text-to-speech__close-button.svelte-xk676z:hover {background:rgb(255 255 255 / 0.3);}.pie-tool-text-to-speech__content.svelte-xk676z {padding:16px;}.pie-tool-text-to-speech__error-message.svelte-xk676z,
8840
8860
  .pie-tool-text-to-speech__loading-message.svelte-xk676z {display:flex;align-items:center;gap:8px;padding:12px;border-radius:6px;font-size:13px;}.pie-tool-text-to-speech__error-message.svelte-xk676z {background:color-mix(in srgb, var(--pie-incorrect, #c33) 12%, transparent);color:var(--pie-incorrect-icon, #c33);border:1px solid color-mix(in srgb, var(--pie-incorrect, #c33) 30%, transparent);}.pie-tool-text-to-speech__loading-message.svelte-xk676z {background:var(--pie-secondary-background, #f0f4f8);color:var(--pie-text, #4a5568);justify-content:center;}.pie-tool-text-to-speech__instructions.svelte-xk676z {margin-bottom:16px;font-size:13px;color:var(--pie-text, #4a5568);}.pie-tool-text-to-speech__instructions.svelte-xk676z p:where(.svelte-xk676z) {margin:0;line-height:1.5;}.pie-tool-text-to-speech__selection-info.svelte-xk676z {display:flex;align-items:center;gap:6px;padding:8px 12px;background:color-mix(in srgb, var(--pie-correct, #10b981) 12%, transparent);border:1px solid color-mix(in srgb, var(--pie-correct, #10b981) 35%, transparent);border-radius:6px;color:var(--pie-correct-icon, #234e52);font-size:12px;}.pie-tool-text-to-speech__selection-info.svelte-xk676z svg:where(.svelte-xk676z) {flex-shrink:0;}.pie-tool-text-to-speech__control-group.svelte-xk676z {margin-bottom:16px;}.pie-tool-text-to-speech__control-group.svelte-xk676z label:where(.svelte-xk676z) {display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:13px;color:var(--pie-text, #4a5568);}.pie-tool-text-to-speech__control-group.svelte-xk676z label:where(.svelte-xk676z) strong:where(.svelte-xk676z) {color:var(--pie-primary, #667eea);font-weight:600;}.pie-tool-text-to-speech__control-group.svelte-xk676z input[type="range"]:where(.svelte-xk676z) {width:100%;height:6px;border-radius:3px;background:var(--pie-secondary-background, #e2e8f0);outline:none;-webkit-appearance:none;}.pie-tool-text-to-speech__control-group.svelte-xk676z input[type="range"]:where(.svelte-xk676z)::-webkit-slider-thumb {-webkit-appearance:none;width:18px;height:18px;border-radius:50%;background:var(--pie-primary, #667eea);cursor:pointer;transition:all 0.2s;}.pie-tool-text-to-speech__control-group.svelte-xk676z input[type="range"]:where(.svelte-xk676z)::-webkit-slider-thumb:hover {background:var(--pie-primary-dark, #764ba2);transform:scale(1.1);}.pie-tool-text-to-speech__control-group.svelte-xk676z input[type="range"]:where(.svelte-xk676z):disabled {opacity:0.5;cursor:not-allowed;}.pie-tool-text-to-speech__playback-controls.svelte-xk676z {display:flex;gap:8px;margin-bottom:12px;}.pie-tool-text-to-speech__playback-controls.svelte-xk676z button:where(.svelte-xk676z) {flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all 0.2s;}.pie-tool-text-to-speech__playback-controls.svelte-xk676z button:where(.svelte-xk676z) svg:where(.svelte-xk676z) {flex-shrink:0;}.pie-tool-text-to-speech__button-primary.svelte-xk676z {background:var(--pie-primary, #667eea);color:var(--pie-white, #fff);}.pie-tool-text-to-speech__button-primary.svelte-xk676z:hover:not(:disabled) {transform:translateY(-1px);box-shadow:0 4px 6px color-mix(in srgb, var(--pie-primary, #667eea) 35%, transparent);}.pie-tool-text-to-speech__button-secondary.svelte-xk676z {background:var(--pie-button-bg, #f7fafc);color:var(--pie-button-color, #4a5568);border:1px solid var(--pie-button-border, #e2e8f0);}.pie-tool-text-to-speech__button-secondary.svelte-xk676z:hover:not(:disabled) {background:var(--pie-button-hover-bg, #edf2f7);}.pie-tool-text-to-speech__playback-controls.svelte-xk676z button:where(.svelte-xk676z):disabled {opacity:0.5;cursor:not-allowed;transform:none !important;}.pie-tool-text-to-speech__status-indicator.svelte-xk676z {display:flex;align-items:center;gap:8px;padding:8px 12px;background:color-mix(in srgb, var(--pie-correct, #4caf50) 10%, transparent);border:1px solid color-mix(in srgb, var(--pie-correct, #4caf50) 30%, transparent);border-radius:6px;font-size:12px;color:var(--pie-correct-icon, #166534);
@@ -8871,8 +8891,8 @@ var Qp = /* @__PURE__ */ Ze('<div class="pie-tool-text-to-speech__error-message
8871
8891
  animation: none !important;transition:none !important;}
8872
8892
  }`
8873
8893
  };
8874
- function ug(e, t) {
8875
- fa(t, !0), ed(e, cg);
8894
+ function lg(e, t) {
8895
+ fa(t, !0), ed(e, ag);
8876
8896
  let n = xr(t, "visible", 7, !1), r = xr(t, "toolId", 7, "textToSpeech"), i = xr(t, "coordinator", 7), o = xr(t, "ttsService", 7);
8877
8897
  const s = typeof window < "u";
8878
8898
  let a = /* @__PURE__ */ Y(void 0), l = /* @__PURE__ */ Y(void 0), c = /* @__PURE__ */ Y(!1), u = /* @__PURE__ */ Y(Mt({
@@ -8881,16 +8901,16 @@ function ug(e, t) {
8881
8901
  })), f = /* @__PURE__ */ Y(Mt({
8882
8902
  x: 0,
8883
8903
  y: 0
8884
- })), p = /* @__PURE__ */ Y(!1), g = /* @__PURE__ */ Y(!1), m = /* @__PURE__ */ Y(!1), b = /* @__PURE__ */ Y(""), T = /* @__PURE__ */ Y(1), I = /* @__PURE__ */ Y(!1), W = /* @__PURE__ */ Y(null), J = /* @__PURE__ */ Y(!1), w = null;
8904
+ })), p = /* @__PURE__ */ Y(!1), g = /* @__PURE__ */ Y(!1), m = /* @__PURE__ */ Y(!1), b = /* @__PURE__ */ Y(""), T = /* @__PURE__ */ Y(1), I = /* @__PURE__ */ Y(!1), H = /* @__PURE__ */ Y(null), J = /* @__PURE__ */ Y(!1), w = null;
8885
8905
  Or(() => {
8886
- i() && r() && !y(J) && (i().registerTool(r(), "Text-to-Speech", void 0, Qi.MODAL), P(J, !0));
8906
+ i() && r() && !y(J) && (i().registerTool(r(), "Text-to-Speech", void 0, eo.MODAL), N(J, !0));
8887
8907
  }), Zu(async () => {
8888
8908
  if (s) {
8889
8909
  try {
8890
- const x = new Io();
8891
- await o().initialize(x), P(p, !0);
8910
+ const x = new Ro();
8911
+ await o().initialize(x), N(p, !0);
8892
8912
  } catch (x) {
8893
- console.error("[TTSTool] Failed to initialize TTS:", x), P(W, x instanceof Error ? x.message : "Failed to initialize TTS", !0);
8913
+ console.error("[TTSTool] Failed to initialize TTS:", x), N(H, x instanceof Error ? x.message : "Failed to initialize TTS", !0);
8894
8914
  }
8895
8915
  return document.addEventListener("selectionchange", X), () => {
8896
8916
  s && (document.removeEventListener("selectionchange", X), o().stop()), w?.(), w = null, i() && r() && i().unregisterTool(r());
@@ -8903,7 +8923,7 @@ function ug(e, t) {
8903
8923
  w?.(), w = null;
8904
8924
  return;
8905
8925
  }
8906
- return w?.(), w = Zp(y(a), {
8926
+ return w?.(), w = Kp(y(a), {
8907
8927
  initialFocus: y(l) || null,
8908
8928
  onEscape: Lt
8909
8929
  }), () => {
@@ -8912,66 +8932,66 @@ function ug(e, t) {
8912
8932
  });
8913
8933
  function X() {
8914
8934
  const x = window.getSelection();
8915
- x && x.toString().trim().length > 0 ? (P(b, x.toString().trim(), !0), P(I, !0)) : P(I, !1);
8935
+ x && x.toString().trim().length > 0 ? (N(b, x.toString().trim(), !0), N(I, !0)) : N(I, !1);
8916
8936
  }
8917
8937
  async function le() {
8918
8938
  if (!(!y(p) || !y(I) || !y(b)))
8919
8939
  try {
8920
8940
  const x = window.getSelection();
8921
8941
  if (!x || x.rangeCount === 0) return;
8922
- const N = x.getRangeAt(0).commonAncestorContainer.parentElement;
8923
- if (!N) return;
8924
- P(g, !0), P(m, !1), o().setRootElement(N);
8925
- const yt = N.closest("[data-catalog-idref]")?.getAttribute("data-catalog-idref") || void 0;
8942
+ const P = x.getRangeAt(0).commonAncestorContainer.parentElement;
8943
+ if (!P) return;
8944
+ N(g, !0), N(m, !1), o().setRootElement(P);
8945
+ const yt = P.closest("[data-catalog-idref]")?.getAttribute("data-catalog-idref") || void 0;
8926
8946
  await o().speak(y(b), {
8927
8947
  catalogId: yt,
8928
8948
  rate: y(T),
8929
8949
  highlightWords: !0
8930
8950
  }, {
8931
8951
  onEnd: () => {
8932
- P(g, !1), P(m, !1);
8952
+ N(g, !1), N(m, !1);
8933
8953
  },
8934
8954
  onError: (U) => {
8935
- console.error("[TTSTool] TTS error:", U), P(g, !1), P(m, !1);
8955
+ console.error("[TTSTool] TTS error:", U), N(g, !1), N(m, !1);
8936
8956
  }
8937
8957
  });
8938
8958
  } catch (x) {
8939
- console.error("[TTSTool] Failed to speak:", x), P(g, !1), P(m, !1);
8959
+ console.error("[TTSTool] Failed to speak:", x), N(g, !1), N(m, !1);
8940
8960
  }
8941
8961
  }
8942
8962
  function an() {
8943
- y(g) && (y(m) ? (o().resume(), P(m, !1)) : (o().pause(), P(m, !0)));
8963
+ y(g) && (y(m) ? (o().resume(), N(m, !1)) : (o().pause(), N(m, !0)));
8944
8964
  }
8945
8965
  function ln() {
8946
- o().stop(), P(g, !1), P(m, !1);
8966
+ o().stop(), N(g, !1), N(m, !1);
8947
8967
  }
8948
8968
  function cn(x) {
8949
- const N = x.target;
8950
- P(T, parseFloat(N.value), !0);
8969
+ const P = x.target;
8970
+ N(T, parseFloat(P.value), !0);
8951
8971
  }
8952
- function li(x) {
8972
+ function ci(x) {
8953
8973
  x.target.closest("button, input, select") || te(x);
8954
8974
  }
8955
8975
  function te(x) {
8956
- y(a) && (y(a).setPointerCapture(x.pointerId), P(c, !0), P(f, {
8976
+ y(a) && (y(a).setPointerCapture(x.pointerId), N(c, !0), N(f, {
8957
8977
  x: x.clientX - y(u).x,
8958
8978
  y: x.clientY - y(u).y
8959
8979
  }, !0), i()?.bringToFront(y(a)), y(a).addEventListener("pointermove", It), y(a).addEventListener("pointerup", Rt), x.preventDefault());
8960
8980
  }
8961
8981
  function It(x) {
8962
- y(c) && (P(u, {
8982
+ y(c) && (N(u, {
8963
8983
  x: x.clientX - y(f).x,
8964
8984
  y: x.clientY - y(f).y
8965
8985
  }, !0), x.preventDefault());
8966
8986
  }
8967
8987
  function Rt(x) {
8968
- y(c) && y(a) && (y(a).releasePointerCapture(x.pointerId), P(c, !1), y(a).removeEventListener("pointermove", It), y(a).removeEventListener("pointerup", Rt));
8988
+ y(c) && y(a) && (y(a).releasePointerCapture(x.pointerId), N(c, !1), y(a).removeEventListener("pointermove", It), y(a).removeEventListener("pointerup", Rt));
8969
8989
  }
8970
8990
  function Lt() {
8971
8991
  i()?.hideTool(r());
8972
8992
  }
8973
- const ci = /* @__PURE__ */ vu(() => y(T) === 0.5 ? "Slow" : y(T) === 0.75 ? "Slower" : y(T) === 1 ? "Normal" : y(T) === 1.25 ? "Faster" : y(T) === 1.5 ? "Fast" : y(T) === 2 ? "Very Fast" : `${y(T)}x`);
8974
- var ui = {
8993
+ const ui = /* @__PURE__ */ vu(() => y(T) === 0.5 ? "Slow" : y(T) === 0.75 ? "Slower" : y(T) === 1 ? "Normal" : y(T) === 1.25 ? "Faster" : y(T) === 1.5 ? "Fast" : y(T) === 2 ? "Very Fast" : `${y(T)}x`);
8994
+ var di = {
8975
8995
  get visible() {
8976
8996
  return n();
8977
8997
  },
@@ -8996,80 +9016,80 @@ function ug(e, t) {
8996
9016
  set ttsService(x) {
8997
9017
  o(x), er();
8998
9018
  }
8999
- }, mr = ju(), vr = os(mr), di = (x) => {
9000
- var N = lg(), yt = se(N), U = ke(se(yt), 2);
9001
- _s(U, (ie) => P(l, ie), () => y(l)), oe(yt);
9002
- var $n = ke(yt, 2), F = se($n), Pt = (ie) => {
9003
- var be = Qp(), et = ke(se(be), 2), dn = se(et, !0);
9004
- oe(et), oe(be), Un(() => kr(dn, y(W))), me(ie, be);
9019
+ }, mr = ju(), vr = ss(mr), fi = (x) => {
9020
+ var P = sg(), yt = se(P), U = ke(se(yt), 2);
9021
+ bs(U, (ie) => N(l, ie), () => y(l)), oe(yt);
9022
+ var $n = ke(yt, 2), F = se($n), Nt = (ie) => {
9023
+ var be = Jp(), et = ke(se(be), 2), dn = se(et, !0);
9024
+ oe(et), oe(be), Un(() => kr(dn, y(H))), me(ie, be);
9005
9025
  }, un = (ie) => {
9006
- var be = eg();
9026
+ var be = Zp();
9007
9027
  me(ie, be);
9008
9028
  }, Ue = (ie) => {
9009
- var be = ag(), et = os(be), dn = se(et), tt = (K) => {
9010
- var ne = tg(), ot = ke(se(ne), 2), wt = se(ot);
9029
+ var be = og(), et = ss(be), dn = se(et), tt = (K) => {
9030
+ var ne = Qp(), ot = ke(se(ne), 2), wt = se(ot);
9011
9031
  oe(ot), oe(ne), Un(() => kr(wt, `${y(b).length ?? ""} characters selected`)), me(K, ne);
9012
- }, Nt = (K) => {
9013
- var ne = ng();
9032
+ }, Pt = (K) => {
9033
+ var ne = eg();
9014
9034
  me(K, ne);
9015
9035
  };
9016
9036
  _n(dn, (K) => {
9017
- y(I) ? K(tt) : K(Nt, -1);
9037
+ y(I) ? K(tt) : K(Pt, -1);
9018
9038
  }), oe(et);
9019
- var Pe = ke(et, 2), $t = se(Pe), fn = ke(se($t), 2), Tt = se(fn, !0);
9039
+ var Ne = ke(et, 2), $t = se(Ne), fn = ke(se($t), 2), Tt = se(fn, !0);
9020
9040
  oe(fn), oe($t);
9021
9041
  var nt = ke($t, 2);
9022
- cd(nt), oe(Pe);
9023
- var St = ke(Pe, 2), hn = se(St), rt = ke(hn, 2), fi = se(rt), zn = (K) => {
9024
- var ne = rg();
9025
- zi(2), me(K, ne);
9042
+ cd(nt), oe(Ne);
9043
+ var St = ke(Ne, 2), hn = se(St), rt = ke(hn, 2), hi = se(rt), zn = (K) => {
9044
+ var ne = tg();
9045
+ Di(2), me(K, ne);
9026
9046
  }, zt = (K) => {
9027
- var ne = ig();
9028
- zi(2), me(K, ne);
9047
+ var ne = ng();
9048
+ Di(2), me(K, ne);
9029
9049
  };
9030
- _n(fi, (K) => {
9050
+ _n(hi, (K) => {
9031
9051
  y(m) ? K(zn) : K(zt, -1);
9032
9052
  }), oe(rt);
9033
9053
  var it = ke(rt, 2);
9034
9054
  oe(St);
9035
9055
  var ye = ke(St, 2), Dn = (K) => {
9036
- var ne = sg();
9056
+ var ne = ig();
9037
9057
  let ot;
9038
9058
  var wt = se(ne), pn = se(wt), gn = (je) => {
9039
- var Hn = Uu("⏸");
9040
- me(je, Hn);
9059
+ var Wn = Uu("⏸");
9060
+ me(je, Wn);
9041
9061
  }, Te = (je) => {
9042
- var Hn = og();
9043
- me(je, Hn);
9062
+ var Wn = rg();
9063
+ me(je, Wn);
9044
9064
  };
9045
9065
  _n(pn, (je) => {
9046
9066
  y(m) ? je(gn) : je(Te, -1);
9047
9067
  }), oe(wt);
9048
- var st = ke(wt, 2), Wn = se(st, !0);
9068
+ var st = ke(wt, 2), Hn = se(st, !0);
9049
9069
  oe(st), oe(ne), Un(() => {
9050
- ot = rd(ne, 1, "pie-tool-text-to-speech__status-indicator svelte-xk676z", null, ot, { "pie-tool-text-to-speech__status-indicator--paused": y(m) }), kr(Wn, y(m) ? "Paused" : "Speaking...");
9070
+ ot = rd(ne, 1, "pie-tool-text-to-speech__status-indicator svelte-xk676z", null, ot, { "pie-tool-text-to-speech__status-indicator--paused": y(m) }), kr(Hn, y(m) ? "Paused" : "Speaking...");
9051
9071
  }), me(K, ne);
9052
9072
  };
9053
9073
  _n(ye, (K) => {
9054
9074
  y(g) && K(Dn);
9055
9075
  }), Un(() => {
9056
- kr(Tt, y(ci)), ud(nt, y(T)), nt.disabled = y(g), hn.disabled = !y(I) || y(g), rt.disabled = !y(g), Yi(rt, "aria-label", y(m) ? "Resume" : "Pause"), it.disabled = !y(g);
9076
+ kr(Tt, y(ui)), ud(nt, y(T)), nt.disabled = y(g), hn.disabled = !y(I) || y(g), rt.disabled = !y(g), Xi(rt, "aria-label", y(m) ? "Resume" : "Pause"), it.disabled = !y(g);
9057
9077
  }), vn("input", nt, cn), vn("click", hn, le), vn("click", rt, an), vn("click", it, ln), me(ie, be);
9058
9078
  };
9059
9079
  _n(F, (ie) => {
9060
- y(W) ? ie(Pt) : y(p) ? ie(Ue, -1) : ie(un, 1);
9061
- }), oe($n), oe(N), _s(N, (ie) => P(a, ie), () => y(a)), Un(() => id(N, `left: ${y(u).x ?? ""}px; top: ${y(u).y ?? ""}px;`)), vn("pointerdown", N, li), vn("click", U, Lt), me(x, N);
9080
+ y(H) ? ie(Nt) : y(p) ? ie(Ue, -1) : ie(un, 1);
9081
+ }), oe($n), oe(P), bs(P, (ie) => N(a, ie), () => y(a)), Un(() => id(P, `left: ${y(u).x ?? ""}px; top: ${y(u).y ?? ""}px;`)), vn("pointerdown", P, ci), vn("click", U, Lt), me(x, P);
9062
9082
  };
9063
9083
  return _n(vr, (x) => {
9064
- n() && s && x(di);
9065
- }), me(e, mr), ha(ui);
9084
+ n() && s && x(fi);
9085
+ }), me(e, mr), ha(di);
9066
9086
  }
9067
- Wu([
9087
+ Hu([
9068
9088
  "pointerdown",
9069
9089
  "click",
9070
9090
  "input"
9071
9091
  ]);
9072
- customElements.define("pie-tool-text-to-speech", md(ug, {
9092
+ customElements.define("pie-tool-text-to-speech", md(lg, {
9073
9093
  visible: {
9074
9094
  attribute: "visible",
9075
9095
  type: "Boolean"
@@ -9082,7 +9102,7 @@ customElements.define("pie-tool-text-to-speech", md(ug, {
9082
9102
  ttsService: {}
9083
9103
  }, [], [], { mode: "open" }));
9084
9104
  export {
9085
- ug as default,
9086
- hg as n,
9087
- fg as t
9105
+ lg as default,
9106
+ dg as n,
9107
+ ug as t
9088
9108
  };