@silurus/ooxml 0.89.11 → 0.89.12

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.
Files changed (49) hide show
  1. package/dist/assets/{render-worker-jGsxSIGb.js → render-worker-BD7EhV2y.js} +17 -17
  2. package/dist/assets/render-worker-BiKxVVB1.js +16 -0
  3. package/dist/assets/{render-worker-j1PT6zsz.js → render-worker-CVqXtEMW.js} +13 -13
  4. package/dist/{bounded-raw-part-cache-B5a6cGKO.js → bounded-raw-part-cache-D2Q0FIoE.js} +719 -663
  5. package/dist/{canvas-viewer-mechanics-BsqaoYgK.js → canvas-viewer-mechanics-_ZBxW_sN.js} +1 -1
  6. package/dist/{comment-overlay-controller-b3tKmzMa.js → comment-overlay-controller-CVvQCYhQ.js} +8 -8
  7. package/dist/{comment-ui-runtime-Bp37ytDC.js → comment-ui-runtime-CYkt_9-b.js} +2 -2
  8. package/dist/{comment-ui-runtime-DM65K2I9.js → comment-ui-runtime-DhTTGSay.js} +3 -3
  9. package/dist/{document-model-source-zVS9qt4o.js → document-model-source-C6wGN8m3.js} +45 -45
  10. package/dist/{document-pull-client-DIRkBd6z.js → document-pull-client-BfGXPuQc.js} +640 -640
  11. package/dist/{document-pull-worker-hMKJ5RdB.js → document-pull-worker-Bl3wlLXC.js} +4 -4
  12. package/dist/{docx-hRmOTAbV.js → docx-CNscQaT8.js} +496 -496
  13. package/dist/{docx-Bsp9NgeG.js → docx-Cry-eklK.js} +7 -7
  14. package/dist/{docx-model-source-BSNwPdvb.js → docx-model-source-Cj8DGdLl.js} +6 -6
  15. package/dist/docx.mjs +3 -3
  16. package/dist/{drawingml-shape-B1_kg4BV.js → drawingml-shape-CFzAXuvj.js} +88 -116
  17. package/dist/{font-preload-demand-NqcVKIpX.js → font-preload-demand-DhFVOxz4.js} +1 -1
  18. package/dist/{host-layout-measure-IFLllYwV.js → host-layout-measure-CWKDrVpo.js} +1 -1
  19. package/dist/index.mjs +3 -3
  20. package/dist/internal-companion.mjs +2 -2
  21. package/dist/{line-distribute-CwtditQo.js → line-distribute-DxnuaRdO.js} +24 -24
  22. package/dist/{model-source-Cch44xsb.js → model-source-DksDDVb4.js} +1 -1
  23. package/dist/{model-source-session-DRcqFGfM.js → model-source-session-8wqlNxsQ.js} +2 -2
  24. package/dist/{model-source-session-ClNCRDOg.js → model-source-session-BogYRDwj.js} +2 -2
  25. package/dist/{model-source-session-DSABX94B.js → model-source-session-ifwyPPhZ.js} +2 -2
  26. package/dist/node.mjs +4 -4
  27. package/dist/{pptx-DbjWegUB.js → pptx-Bons7t3Y.js} +26 -26
  28. package/dist/{pptx-C1CiFW1D.js → pptx-CQtPbMxI.js} +10 -10
  29. package/dist/{pptx-model-source-C9TuBisH.js → pptx-model-source-mg-O0LR9.js} +5 -5
  30. package/dist/pptx.mjs +4 -4
  31. package/dist/{presentation-model-source-DLNioq7T.js → presentation-model-source-CK6_hY1W.js} +5 -5
  32. package/dist/{render-Bf_Gywxw.js → render-C7F07FrC.js} +2 -2
  33. package/dist/{render-worker-host-CVr53kg0.js → render-worker-host-Cj-U3WPe.js} +1 -1
  34. package/dist/{render-worker-host-PC5hgu9x.js → render-worker-host-D7L6GMbE.js} +1 -1
  35. package/dist/{render-worker-host-pKls3F_t.js → render-worker-host-stI5Lppz.js} +1 -1
  36. package/dist/{renderer-DuYC3xXi.js → renderer-N76SnQW7.js} +1286 -1212
  37. package/dist/{resource-measurement-CfJtbwiR.js → resource-measurement-B2hzmYlu.js} +90 -90
  38. package/dist/{session-DPXK_lpI.js → session-D5au4i-W.js} +166 -166
  39. package/dist/{slide-pull-client-3g6TxaKa.js → slide-pull-client-3mJmNjjB.js} +854 -904
  40. package/dist/{wasm-runtime-generation-D97yoAXz.js → wasm-runtime-generation--_2SjW2G.js} +1 -1
  41. package/dist/{workbook-model-source-D1dmkDMP.js → workbook-model-source-CI1q6nxK.js} +6 -6
  42. package/dist/{worksheet-pull-client-BudfclVl.js → worksheet-pull-client-C2h4AMwt.js} +18 -18
  43. package/dist/{xlsx-DBhYlJKp.js → xlsx-CKXeKvxl.js} +452 -452
  44. package/dist/{xlsx-DA0uR1B1.js → xlsx-DujIp7CR.js} +4 -4
  45. package/dist/{xlsx-model-source-zemVDAfl.js → xlsx-model-source-fs0svOUo.js} +6 -6
  46. package/dist/xlsx.mjs +4 -4
  47. package/dist/xlsx_parser_bg.wasm +0 -0
  48. package/package.json +1 -1
  49. package/dist/assets/render-worker-Ck21oePL.js +0 -16
@@ -1,11 +1,11 @@
1
1
  import { Ao as e, Co as t, Dr as n, Eo as r, Fo as i, Hr as a, Io as o, Jr as s, Kr as c, Lr as l, No as u, Qr as d, So as f, Sr as p, To as m, Tr as h, Ur as g, Vr as _, Wr as v, Xr as y, Yn as b, _o as x, a as S, bo as C, c as w, d as T, do as E, fo as D, go as O, h as k, jo as A, m as j, mo as M, ni as N, o as P, or as F, po as I, qr as L, r as R, rr as z, u as B, uo as V, ur as H, vo as U, wo as ee, wr as W, xo as te, xr as ne } from "./plot-area-frame-DNYMd9Pf.js";
2
- import { $ as re, $t as ie, C as ae, D as oe, E as G, Ht as se, Mn as ce, Nn as le, O as ue, Pn as de, Q as fe, S as pe, St as me, T as he, Yt as ge, Z as _e, Zt as ve, _ as ye, a as be, an as xe, at as Se, b as Ce, bt as we, c as Te, ct as Ee, dt as De, fn as Oe, g as ke, h as Ae, ht as je, i as Me, in as Ne, it as Pe, k as Fe, kn as Ie, ln as Le, m as Re, mt as ze, nn as Be, nt as Ve, o as He, on as Ue, pn as We, pt as Ge, qt as Ke, r as qe, rn as Je, s as Ye, sn as Xe, tn as Ze, tt as Qe, u as $e, un as et, ut as tt, v as nt, vt as rt, w as it, xt as at, y as ot, yt as st } from "./bounded-raw-part-cache-B5a6cGKO.js";
3
- import { _ as ct, d as lt, f as ut, g as dt, h as ft, i as pt, l as mt, m as ht, n as gt, p as _t, r as vt, t as yt, v as bt, y as xt } from "./line-distribute-CwtditQo.js";
2
+ import { $ as re, $t as ie, C as ae, D as oe, E as G, In as se, Kt as ce, Ln as le, Nn as ue, O as de, Q as fe, Rn as pe, S as me, St as he, T as ge, Z as _e, Zt as ve, _ as ye, _n as be, a as xe, an as Se, at as Ce, b as we, bt as Te, c as Ee, cn as De, ct as Oe, dn as ke, dt as Ae, g as je, gn as Me, h as Ne, ht as Pe, i as Fe, it as Ie, k as Le, ln as Re, m as ze, mn as Be, mt as Ve, nt as He, o as Ue, on as We, pn as Ge, pt as Ke, r as qe, rn as Je, s as Ye, sn as Xe, tn as Ze, tt as Qe, u as $e, un as et, ut as tt, v as nt, vt as rt, w as it, xt as at, y as ot, yt as st } from "./bounded-raw-part-cache-D2Q0FIoE.js";
3
+ import { _ as ct, d as lt, f as ut, g as dt, h as ft, i as pt, l as mt, m as ht, n as gt, p as _t, r as vt, t as yt, v as bt, y as xt } from "./line-distribute-DxnuaRdO.js";
4
4
  import { f as St, s as Ct, u as wt } from "./pixel-budget-DI82Hn3R.js";
5
5
  import { H as Tt, L as Et, R as Dt, V as Ot, n as kt, r as At, t as jt } from "./renderer-DpTePxGq.js";
6
6
  import { i as Mt } from "./tiff-contract-DEd8CGuz.js";
7
7
  import { r as Nt } from "./raster-target-Ca3tyA0L.js";
8
- import { a as Pt, i as Ft, n as It, o as Lt, r as Rt, t as zt } from "./drawingml-shape-B1_kg4BV.js";
8
+ import { a as Pt, i as Ft, n as It, o as Lt, r as Rt, t as zt } from "./drawingml-shape-CFzAXuvj.js";
9
9
  import { a as Bt, i as Vt, n as Ht } from "./duotone-GK4Hqn7f.js";
10
10
  function Ut(e, t) {
11
11
  let n = e.trim();
@@ -809,11 +809,11 @@ async function sr(e) {
809
809
  if (!e || typeof FontFace > "u") return null;
810
810
  let t = [];
811
811
  try {
812
- for (let n of $n) t.push(de(`native-route-sentinel:${n.family}`, e, () => {
812
+ for (let n of $n) t.push(pe(`native-route-sentinel:${n.family}`, e, () => {
813
813
  let t = new FontFace(n.family, ir(n.advance, n.ascent, n.descent, n.inkUp, n.inkDown, n.family.replace(/_/g, "")));
814
814
  return e.add(t), t;
815
815
  }).face);
816
- if (await ce(Promise.all(t.map((e) => e.load())))) return t;
816
+ if (await se(Promise.all(t.map((e) => e.load())))) return t;
817
817
  } catch {}
818
818
  return le(t), null;
819
819
  }
@@ -1098,7 +1098,7 @@ function Fr(e, t) {
1098
1098
  return Math.abs(e.height - 2 * t.height) <= 3 && Math.abs(e.ascent - 2 * t.ascent) <= 1 && Math.abs(e.descent - 2 * t.descent) <= 1;
1099
1099
  }
1100
1100
  async function Ir(e, t, n) {
1101
- let r = `${e.family}_coverage`, { face: i } = de(`local-coverage:${t}:${e.weight}:${e.style}`, n, () => {
1101
+ let r = `${e.family}_coverage`, { face: i } = pe(`local-coverage:${t}:${e.weight}:${e.style}`, n, () => {
1102
1102
  let i = new FontFace(r, t, {
1103
1103
  weight: e.weight,
1104
1104
  style: e.style,
@@ -1107,7 +1107,7 @@ async function Ir(e, t, n) {
1107
1107
  return n.add(i), i;
1108
1108
  });
1109
1109
  try {
1110
- if (await ce(i.load()) && i.status === "loaded" && i.sizeAdjust === "0%" && Rr(i, e)) return i;
1110
+ if (await se(i.load()) && i.status === "loaded" && i.sizeAdjust === "0%" && Rr(i, e)) return i;
1111
1111
  } catch {}
1112
1112
  return le([i]), null;
1113
1113
  }
@@ -1131,7 +1131,7 @@ function zr() {
1131
1131
  var Br, Vr = /^[\x20-\x7e]*$/;
1132
1132
  function Hr(e) {
1133
1133
  if (Vr.test(e)) return e;
1134
- let t = Je();
1134
+ let t = Xe();
1135
1135
  return t ? Array.from(t.segment(e), (e) => e.segment) : [e];
1136
1136
  }
1137
1137
  var Ur = /* @__PURE__ */ new WeakMap();
@@ -1191,7 +1191,7 @@ function qr(e, t) {
1191
1191
  return n.width === 0 && n.actualBoundingBoxAscent === 0 && n.actualBoundingBoxDescent === 0;
1192
1192
  }
1193
1193
  async function Jr(e, t, n, r, i, a) {
1194
- let { face: o } = de(`local-normal:${e}:${n}:${r}`, a.fonts, () => {
1194
+ let { face: o } = pe(`local-normal:${e}:${n}:${r}`, a.fonts, () => {
1195
1195
  let i = new FontFace(`${t}_normal`, e, {
1196
1196
  weight: String(n),
1197
1197
  style: r
@@ -1199,7 +1199,7 @@ async function Jr(e, t, n, r, i, a) {
1199
1199
  return a.fonts.add(i), i;
1200
1200
  });
1201
1201
  try {
1202
- let e = await ce(o.load()), t = a.createElement("canvas").getContext("2d");
1202
+ let e = await se(o.load()), t = a.createElement("canvas").getContext("2d");
1203
1203
  return e && t ? jr(o, a.fonts, t, i, a) : null;
1204
1204
  } catch {
1205
1205
  return null;
@@ -3493,7 +3493,7 @@ function gs(e, t, n, r, i) {
3493
3493
  }).advancePt, l = (e) => {
3494
3494
  let n = [
3495
3495
  0,
3496
- ...Ne(e),
3496
+ ...De(e),
3497
3497
  e.length
3498
3498
  ].filter((e, t, n) => t === 0 || e !== n[t - 1]), r = n.length - 1;
3499
3499
  for (; r > 0 && c(`${e.slice(0, n[r])}…`) > t;) --r;
@@ -3503,7 +3503,7 @@ function gs(e, t, n, r, i) {
3503
3503
  }, d = (e) => {
3504
3504
  let n = [
3505
3505
  0,
3506
- ...Ne(e),
3506
+ ...De(e),
3507
3507
  e.length
3508
3508
  ].filter((e, t, n) => t === 0 || e !== n[t - 1]), r = 0;
3509
3509
  for (; r < n.length - 1;) {
@@ -4163,7 +4163,7 @@ function Cc(e, t, n = !1, r = !1, i, a = !0, o = !1) {
4163
4163
  }
4164
4164
  }
4165
4165
  function wc(e, t, n, r, i) {
4166
- if (e === void 0 || i || !et(t.codePointAt(0))) return !1;
4166
+ if (e === void 0 || i || !Be(t.codePointAt(0))) return !1;
4167
4167
  if (e === "none") return !0;
4168
4168
  if (!r.enabled) return !1;
4169
4169
  let a = n();
@@ -4217,7 +4217,7 @@ function jc(e, t) {
4217
4217
  function Mc(e, t) {
4218
4218
  return e === "super" ? t * .35 : e === "sub" ? -t * .15 : 0;
4219
4219
  }
4220
- var Nc = Te;
4220
+ var Nc = Ee;
4221
4221
  function Pc(e, t) {
4222
4222
  return e === 15 && !t.numbering && !t.framePr && t.lineSpacing?.rule === "auto" && t.lineSpacing.value > 1 && t.runs.length > 0 && t.runs.every((e) => e.type === "image" && e.anchor !== !0 || e.type === "shape" && e.inline === !0);
4223
4223
  }
@@ -4317,7 +4317,7 @@ function Qc(e, t) {
4317
4317
  function $c(e) {
4318
4318
  for (let t = 0; t < e.length;) {
4319
4319
  let n = e.codePointAt(t);
4320
- if (et(n)) return !0;
4320
+ if (Be(n)) return !0;
4321
4321
  t += n > 65535 ? 2 : 1;
4322
4322
  }
4323
4323
  return !1;
@@ -4367,7 +4367,7 @@ function al(e, t) {
4367
4367
  function ol(e) {
4368
4368
  let t = [], n = null, r = "";
4369
4369
  for (let i of e) {
4370
- let e = et(i.codePointAt(0));
4370
+ let e = Be(i.codePointAt(0));
4371
4371
  n === null || e === n ? (n = e, r += i) : (t.push({
4372
4372
  text: r,
4373
4373
  ea: n
@@ -4540,7 +4540,7 @@ function Dl(e, t) {
4540
4540
  };
4541
4541
  }
4542
4542
  function Ol(e) {
4543
- return /^[A-Za-z]\p{M}+$/u.test(e) && Ne(e).length === 0;
4543
+ return /^[A-Za-z]\p{M}+$/u.test(e) && De(e).length === 0;
4544
4544
  }
4545
4545
  var kl = /^(?:[\p{Script=Latin}\u0020-\u0040\u005B-\u0060\u007B-\u007E\u00A0-\u00AC\u00AE-\u00BF\u00D7\u00F7\u0300-\u036F])+$/u;
4546
4546
  function Al(e) {
@@ -5065,7 +5065,7 @@ function nu(e) {
5065
5065
  if (D) return D;
5066
5066
  let O = [], k = Object.freeze([...new Set([
5067
5067
  0,
5068
- ...Ne(t.text),
5068
+ ...De(t.text),
5069
5069
  t.text.length
5070
5070
  ])].sort((e, t) => e - t)), A = new Set(k), j = _(t.text);
5071
5071
  j.forEach((e) => {
@@ -5253,7 +5253,7 @@ var au = (e) => Ye(e, ru), ou = Object.freeze({
5253
5253
  ...ru,
5254
5254
  isolateDirection: Gc,
5255
5255
  isolateRequiresUniformSlices: !0
5256
- }), su = (e, t) => He(e, t, ou), cu = (e) => e === "word" ? ou : ru, lu = (e, t, n = "line-level") => be(e, t, cu(n)), uu = (e, t, n, r) => Me(e, t, n, n ? ou : ru, r === "word" ? ou : ru), du = (e) => {
5256
+ }), su = (e, t) => Ue(e, t, ou), cu = (e) => e === "word" ? ou : ru, lu = (e, t, n = "line-level") => xe(e, t, cu(n)), uu = (e, t, n, r) => Fe(e, t, n, n ? ou : ru, r === "word" ? ou : ru), du = (e) => {
5257
5257
  let t = e.text;
5258
5258
  return typeof t == "string" ? t : void 0;
5259
5259
  }, fu = () => {
@@ -7125,14 +7125,14 @@ function Tp(e, t, n = 0) {
7125
7125
  let r = wp(e);
7126
7126
  return [
7127
7127
  0,
7128
- ...Ne(e.text),
7128
+ ...De(e.text),
7129
7129
  e.text.length
7130
7130
  ].filter((e, t, n) => n.indexOf(e) === t).filter((e) => e >= n && e <= t && !r.has(e)).at(-1) ?? 0;
7131
7131
  }
7132
7132
  function Ep(e) {
7133
7133
  if (e.hardJoinPrev !== !0 || e.text.length === 0) return;
7134
7134
  let t = wp(e);
7135
- return [...Ne(e.text), e.text.length].find((e) => e > 0 && !t.has(e)) ?? e.text.length;
7135
+ return [...De(e.text), e.text.length].find((e) => e > 0 && !t.has(e)) ?? e.text.length;
7136
7136
  }
7137
7137
  function Dp(e, t, n) {
7138
7138
  let r = e.semanticSlotSpans, i = (e.semanticSlotRange?.start ?? 0) + t, a = (e.semanticSlotRange?.start ?? 0) + n;
@@ -7201,7 +7201,7 @@ function Ap(e) {
7201
7201
  }
7202
7202
  let e = r, i = e.punctuationCompressions ?? [], a = new Map(i.map((e, t) => [e.end, t])), o = i.length > 0 ? kp(e) : void 0, s = [
7203
7203
  0,
7204
- ...Ne(e.text),
7204
+ ...De(e.text),
7205
7205
  e.text.length
7206
7206
  ];
7207
7207
  for (let r = 0; r < s.length - 1; r += 1) {
@@ -7278,7 +7278,7 @@ function zp(e, t, n, r) {
7278
7278
  function Bp(e, t, n, r, i, a) {
7279
7279
  let o = [...new Set([
7280
7280
  t,
7281
- ...Ne(e.text.slice(t, n)).map((e) => t + e),
7281
+ ...De(e.text.slice(t, n)).map((e) => t + e),
7282
7282
  n
7283
7283
  ])].sort((e, t) => e - t), s = (t, n) => {
7284
7284
  if (n <= t) return 0;
@@ -7443,7 +7443,7 @@ var Yp = class {
7443
7443
  if (n === t.text.startsWith(" ")) return 0;
7444
7444
  if (n && (e.script === t.script || qp(e) || qp(t))) return this.wordBoundaryAdvance(e, t);
7445
7445
  if (!Jp(e, t, this.scale)) return 0;
7446
- let r = e.text.slice(Ne(e.text).at(-1) ?? 0), i = t.text.slice(0, Ne(t.text)[0] ?? t.text.length), a = this.fontForSegment(e), o = `${a}\u0000${r}\u0000${i}`, s = this.kernedSeamPairs.get(o);
7446
+ let r = e.text.slice(De(e.text).at(-1) ?? 0), i = t.text.slice(0, De(t.text)[0] ?? t.text.length), a = this.fontForSegment(e), o = `${a}\u0000${r}\u0000${i}`, s = this.kernedSeamPairs.get(o);
7447
7447
  if (s !== void 0) return s * jp(t);
7448
7448
  let c = this.selectedFont ?? this.initialFont, l = this.context.fontKerning;
7449
7449
  this.setFont(a), this.context.fontKerning = "normal";
@@ -8353,7 +8353,7 @@ function sh(e) {
8353
8353
  }
8354
8354
  function ch(e) {
8355
8355
  if (e.length === 0) return;
8356
- let t = Ne(e);
8356
+ let t = De(e);
8357
8357
  return String.fromCodePoint(e.codePointAt(t.at(-1) ?? 0));
8358
8358
  }
8359
8359
  function lh(e, t, n) {
@@ -8379,7 +8379,7 @@ function uh(e, t) {
8379
8379
  if (!("text" in n) || !oh(n)) a = void 0;
8380
8380
  else if (n.text.length > 0) {
8381
8381
  let e = n.seaBreaks !== void 0;
8382
- for (let t of [0, ...Ne(n.text)]) {
8382
+ for (let t of [0, ...De(n.text)]) {
8383
8383
  let i = String.fromCodePoint(n.text.codePointAt(t));
8384
8384
  nh.test(i) || (!e && t > 0 && r(a, i) && o.push(t), a = i);
8385
8385
  }
@@ -8681,7 +8681,7 @@ function Fh(e, t, n) {
8681
8681
  for (; i < n.length && t(n[i]);) a.push(n[i++]);
8682
8682
  let o = a.map((e) => e.text).join("");
8683
8683
  if (o.includes("-")) {
8684
- let e = [...Ne(o), o.length], t = 0, n = /* @__PURE__ */ new Set(), r = 0;
8684
+ let e = [...De(o), o.length], t = 0, n = /* @__PURE__ */ new Set(), r = 0;
8685
8685
  for (let e of a) {
8686
8686
  for (let t of e.noBreakRanges ?? []) n.add(r + t.start), n.add(r + t.end);
8687
8687
  e.hardJoinPrev && n.add(r), r += e.text.length;
@@ -8726,7 +8726,7 @@ function Fh(e, t, n) {
8726
8726
  }
8727
8727
  let l = /* @__PURE__ */ new Set();
8728
8728
  for (let e of o.matchAll(/\S+/gu)) {
8729
- let t = e[0], n = e.index, r = new Set(Ne(t).map((e) => n + e)), i = new Set([...s].filter((e) => e > n && e <= n + t.length).map((e) => e - n)), a = new Set([...r].map((e) => e - n));
8729
+ let t = e[0], n = e.index, r = new Set(De(t).map((e) => n + e)), i = new Set([...s].filter((e) => e > n && e <= n + t.length).map((e) => e - n)), a = new Set([...r].map((e) => e - n));
8730
8730
  for (let e of Ac(t, a, i)) l.add(n + e);
8731
8731
  }
8732
8732
  if (l.size === 0) {
@@ -8804,7 +8804,7 @@ function Fh(e, t, n) {
8804
8804
  let r = n[e - 1];
8805
8805
  if (!("text" in r) || r.text.length === 0 || /\s$/u.test(r.text) || /^\s/u.test(t.text)) continue;
8806
8806
  let i = [...r.text].at(-1), a = [...t.text][0], o = i?.codePointAt(0), s = a?.codePointAt(0);
8807
- o === void 0 || s === void 0 || o === 8203 || s === 8203 || Ze(r.text) || Ze(t.text) || $c(r.text) || $c(t.text) || ae(o, s) && (t.joinPrev = !0);
8807
+ o === void 0 || s === void 0 || o === 8203 || s === 8203 || Se(r.text) || Se(t.text) || $c(r.text) || $c(t.text) || ae(o, s) && (t.joinPrev = !0);
8808
8808
  }
8809
8809
  let i = /* @__PURE__ */ new Set();
8810
8810
  for (let e of n) !("text" in e) || e.fitTextRegionIndex === void 0 || (i.has(e.fitTextRegionIndex) ? e.joinPrev = !0 : (e.fitTextRegionStart = !0, i.add(e.fitTextRegionIndex)));
@@ -8927,7 +8927,7 @@ function Bh(e, t, n, r, i, a = !1, o = !1, s) {
8927
8927
  if (!a && d && m === void 0) {
8928
8928
  let i = [
8929
8929
  0,
8930
- ...Ne(t),
8930
+ ...De(t),
8931
8931
  t.length
8932
8932
  ];
8933
8933
  if (i.slice(0, -1).map((e, n) => t.slice(e, i[n + 1])).some((e) => nl(e, l.characterSpacingControl))) {
@@ -8976,7 +8976,7 @@ function Bh(e, t, n, r, i, a = !1, o = !1, s) {
8976
8976
  punctuationCompressions: a && d ? (() => {
8977
8977
  let e = [
8978
8978
  0,
8979
- ...Ne(t),
8979
+ ...De(t),
8980
8980
  t.length
8981
8981
  ], n = [];
8982
8982
  for (let r = 0; r < e.length - 1; r += 1) {
@@ -9536,9 +9536,9 @@ function qh(e, t, n, r, i) {
9536
9536
  segIndex: t,
9537
9537
  charOffset: 0,
9538
9538
  ...e.sourceCursorStart === void 0 ? {} : { sourceTextStart: e.sourceCursorStart }
9539
- }, "text" in e && Ze(e.text)) {
9539
+ }, "text" in e && Se(e.text)) {
9540
9540
  let t = wp(e);
9541
- e.seaBreaks = Le(e.text, {
9541
+ e.seaBreaks = Ge(e.text, {
9542
9542
  cjk: !0,
9543
9543
  kinsoku: n
9544
9544
  }).filter((e) => !t.has(e));
@@ -10116,7 +10116,7 @@ function Rg(e, t, n, r, i, a = {}) {
10116
10116
  function zg(e, t, n, r, i, a) {
10117
10117
  let o = i.text.codePointAt(0), s = e.currentLine[e.currentLine.length - 1];
10118
10118
  if (o === void 0 || !t.lineStartForbidden.has(o) || s === void 0 || !("text" in s)) return { kind: "none" };
10119
- let c = s, l = [...c.text], u = he(l, t, e.currentLine.length > 1 ? 0 : 1);
10119
+ let c = s, l = [...c.text], u = ge(l, t, e.currentLine.length > 1 ? 0 : 1);
10120
10120
  if (u <= 0) return { kind: "none" };
10121
10121
  let d = l.slice(0, l.length - u).join(""), f = d.length;
10122
10122
  if (f === 0 && c.hardJoinPrev === !0 || wp(c).has(f)) return { kind: "blocked" };
@@ -10149,7 +10149,7 @@ function zg(e, t, n, r, i, a) {
10149
10149
  };
10150
10150
  }
10151
10151
  function Bg(e, t, n, r, i, a, o, s) {
10152
- let c = Ne(i.text)[0] ?? i.text.length;
10152
+ let c = De(i.text)[0] ?? i.text.length;
10153
10153
  if (c <= 0) return !1;
10154
10154
  let l = i.text.slice(0, c), u = t(i, l);
10155
10155
  return n({
@@ -10675,7 +10675,7 @@ function E_(e, t) {
10675
10675
  t.textLayoutService && t.textShapeRequest && !t.shapedClusters && i(t, !0);
10676
10676
  let c = t.shapedClusters?.length ? t.shapedClusters : null, l = c == null ? [...new Set([
10677
10677
  0,
10678
- ...Ne(t.text),
10678
+ ...De(t.text),
10679
10679
  t.text.length
10680
10680
  ])].sort((e, t) => e - t) : null, u = c?.map((e) => ({
10681
10681
  start: e.range.start,
@@ -10749,7 +10749,7 @@ function A_(e) {
10749
10749
  }
10750
10750
  var j_ = /^[\p{Grapheme_Extend}\u200d]$/u, M_ = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]$/u;
10751
10751
  function N_(e) {
10752
- return e !== void 0 && e !== 65532 && (et(e) || M_.test(String.fromCodePoint(e)));
10752
+ return e !== void 0 && e !== 65532 && (Be(e) || M_.test(String.fromCodePoint(e)));
10753
10753
  }
10754
10754
  function P_(e, t, n) {
10755
10755
  return n * jp(t) + Np(t, e.characterGrid, e.scale);
@@ -11104,7 +11104,7 @@ function Y_(e, t, n, r = !0) {
11104
11104
  e.reservePrefixWork(t.text.length);
11105
11105
  let h = wp(t), g = [...new Set([
11106
11106
  0,
11107
- ...Ne(t.text),
11107
+ ...De(t.text),
11108
11108
  t.text.length
11109
11109
  ])], _ = 0;
11110
11110
  if (n > 0) if (hp(t, d) >= 0 && Hp(t, p) !== "latin") s(ug(t.bold, t.italic, o(t), t.fontFamily, f, t.fontRoute)), a.withSegmentKerning(t, () => {
@@ -11390,7 +11390,7 @@ function uv(e, t) {
11390
11390
  let O = (t, r, i, a) => {
11391
11391
  let s = nc(t, r, bg(e)), c = Iv(e, a ? a.at(-1).segment : p, i);
11392
11392
  return c === void 0 ? s === t || !e.baseRtl || e.fitsMeasuredWidth(n.currentWidth + t, o()) || !e.fitsMeasuredWidth(n.currentWidth + s, o()) ? s : nv(e, a ? a.map((e) => e.segment) : [p]) ? t : s : t + c;
11393
- }, k = O(_, E, n.queue.peek()), A = p.seaBreaks !== void 0 && xe(p.text);
11393
+ }, k = O(_, E, n.queue.peek()), A = p.seaBreaks !== void 0 && Re(p.text);
11394
11394
  p.measuredWidth = g;
11395
11395
  let j = !Dv(e, p) || p.autoSpaceBeforePt !== void 0, M = j && e.justifiedCompressionAdmissionOnly === !0 && k_(e) && n.justifiedUnitEnd === void 0 && !(n.justifiedCompressionPx > 0) && !p.optionalHyphenWord && p.explicitBreaks === void 0 && e.fitsMeasuredWidth(n.currentWidth + k, o()) && vg(p, n.queue.peek());
11396
11396
  if (j && !M && R_(e, p, e.justifiedCompressionAdmissionOnly === !0 ? m : void 0) || (p.leadingWordBoundaryPx = h === 0 ? void 0 : h, p.measuredWidth = g, tv(e, p))) return;
@@ -11845,7 +11845,7 @@ function Mv(e, t) {
11845
11845
  let e = n.queue[Symbol.iterator]();
11846
11846
  for (let n = e.next(); !n.done; n = e.next()) {
11847
11847
  let r = n.value;
11848
- if (p = r, !("text" in r) || r.seaBreaks === void 0 || !xe(r.text)) break;
11848
+ if (p = r, !("text" in r) || r.seaBreaks === void 0 || !Re(r.text)) break;
11849
11849
  let i = r, s = a(i), c = i.text.replace(/ +$/, "");
11850
11850
  if (t += s, f.push({ segment: i }), u = i.text.endsWith(" ") ? s - o(i, c) : 0, i.text.endsWith(" ")) {
11851
11851
  p = e.next().value;
@@ -11962,7 +11962,7 @@ function Nv(e, t) {
11962
11962
  let t = b(S);
11963
11963
  if (t.kind === "blocked") {
11964
11964
  let t = iv(n.currentLine);
11965
- e.forcedPlacement(sv(n.currentLine, t) + d(S, S.text.slice(0, Ne(S.text).find((e) => e > 0) ?? S.text.length)), t), x(S, C, w, T);
11965
+ e.forcedPlacement(sv(n.currentLine, t) + d(S, S.text.slice(0, De(S.text).find((e) => e > 0) ?? S.text.length)), t), x(S, C, w, T);
11966
11966
  return;
11967
11967
  }
11968
11968
  r(void 0, !1, t.kind === "retracted" ? t.tail.src : S.src), n.queue.unshift(S), t.kind === "retracted" && n.queue.unshift(t.tail);
@@ -11990,7 +11990,7 @@ function Nv(e, t) {
11990
11990
  }
11991
11991
  }
11992
11992
  function Pv(e, t) {
11993
- let { breakerState: n, flush: r, addToLine: i, scale: a, characterGrid: o, availW: s, strAdvance: c, emergencyTextSplit: l, strNaturalAdvance: u, retractCurrentLineForLeadingKinsoku: d, keepLeadingKinsokuWithCurrentLine: f } = e, { s: p, h: m, asc: h, desc: g } = t, _ = p, v = s() - n.currentWidth, y = (e) => c(_, e), b = Ue(_.text) && hp(_, a) >= 0 && Hp(_, o) !== "latin", x = Be(_.text, _.seaBreaks, 0, v, y, b);
11993
+ let { breakerState: n, flush: r, addToLine: i, scale: a, characterGrid: o, availW: s, strAdvance: c, emergencyTextSplit: l, strNaturalAdvance: u, retractCurrentLineForLeadingKinsoku: d, keepLeadingKinsokuWithCurrentLine: f } = e, { s: p, h: m, asc: h, desc: g } = t, _ = p, v = s() - n.currentWidth, y = (e) => c(_, e), b = et(_.text) && hp(_, a) >= 0 && Hp(_, o) !== "latin", x = We(_.text, _.seaBreaks, 0, v, y, b);
11994
11994
  if (x > 0 && n.currentLine.length === 0 && av(e, _, _.text.slice(0, x)) && e.forcedPlacement(e.minimalLegalTextWidth(_)), x > 0) {
11995
11995
  let e = _.text.slice(0, x), t = u(_, e);
11996
11996
  i({
@@ -12014,13 +12014,13 @@ function Pv(e, t) {
12014
12014
  let t = d(_);
12015
12015
  if (t.kind === "blocked") {
12016
12016
  let t = iv(n.currentLine);
12017
- e.forcedPlacement(sv(n.currentLine, t) + c(_, _.text.slice(0, Ne(_.text).find((e) => e > 0) ?? _.text.length)), t), f(_, m, h, g);
12017
+ e.forcedPlacement(sv(n.currentLine, t) + c(_, _.text.slice(0, De(_.text).find((e) => e > 0) ?? _.text.length)), t), f(_, m, h, g);
12018
12018
  return;
12019
12019
  }
12020
12020
  r(void 0, !1, t.kind === "retracted" ? t.tail.src : _.src), n.queue.unshift(_), t.kind === "retracted" && n.queue.unshift(t.tail);
12021
12021
  } else {
12022
12022
  e.forcedPlacement(e.minimalLegalTextWidth(_));
12023
- let t = _.seaBreaks[0] ?? _.text.length, r = _.text.slice(0, t), a = Ne(r), o = Be(r, a, 0, v, y, b);
12023
+ let t = _.seaBreaks[0] ?? _.text.length, r = _.text.slice(0, t), a = De(r), o = We(r, a, 0, v, y, b);
12024
12024
  o <= 0 && (o = a.length > 0 ? a[0] : r.length), o = Tp(_, o) || l(_, v, !0);
12025
12025
  let s = _.text.slice(0, o), c = u(_, s);
12026
12026
  i({
@@ -12300,7 +12300,7 @@ function Kv(e, t) {
12300
12300
  return n <= 0 ? e : e <= n ? n : Math.ceil(e / n) * n;
12301
12301
  }
12302
12302
  function qv(e, t, n, r, i, a) {
12303
- let o = Gv(t), s = Tx(t, n.availableWidthPt), c = Math.max(1, n.availableWidthPt - t.physicalIndentLeftPt - t.physicalIndentRightPt - s), l = n.paragraphXPt + t.physicalIndentLeftPt, u = t.spaceBeforePt, d = t.spaceAfterPt, f = Object.freeze({ ...n }), p = r.fontFamilyClasses, m = i.documentHasEastAsianText === !0 || i.useFeLayout === !0 && t.lineGrid.active, h = t.lineSpacing?.rule === "exact" && t.lineSpacing.value > 0 ? void 0 : i.firstLinePictureMarkerHeightPt, g = h !== void 0 && Number.isFinite(h) && h > 0 ? h : void 0, _ = a ? void 0 : g, v = n.startYPt + (n.suppressSpaceBefore ? 0 : u);
12303
+ let o = Gv(t), s = Ex(t, n.availableWidthPt), c = Math.max(1, n.availableWidthPt - t.physicalIndentLeftPt - t.physicalIndentRightPt - s), l = n.paragraphXPt + t.physicalIndentLeftPt, u = t.spaceBeforePt, d = t.spaceAfterPt, f = Object.freeze({ ...n }), p = r.fontFamilyClasses, m = i.documentHasEastAsianText === !0 || i.useFeLayout === !0 && t.lineGrid.active, h = t.lineSpacing?.rule === "exact" && t.lineSpacing.value > 0 ? void 0 : i.firstLinePictureMarkerHeightPt, g = h !== void 0 && Number.isFinite(h) && h > 0 ? h : void 0, _ = a ? void 0 : g, v = n.startYPt + (n.suppressSpaceBefore ? 0 : u);
12304
12304
  n.wrap && (v = n.wrap.skipTopAndBottomBands({
12305
12305
  yPt: v,
12306
12306
  columnXPt: n.paragraphXPt,
@@ -12618,21 +12618,21 @@ function uy(e, t) {
12618
12618
  let n = $v(e), r = $v(t), i = n.numerator * r.denominator - r.numerator * n.denominator;
12619
12619
  return i < 0n ? -1 : +(i > 0n);
12620
12620
  }
12621
- var Q = 1e-9;
12622
- function dy(e, t, n, r, i = !1) {
12621
+ var dy = 1e-9;
12622
+ function fy(e, t, n, r, i = !1) {
12623
12623
  let a = Number.isFinite(e) ? Math.max(0, e) : 0, o = Math.max(0, t), s = o + Math.max(1, n);
12624
12624
  return {
12625
12625
  startPt: (o === 0 ? a : a / 2) * (i && a > 0 ? 2 : 1),
12626
12626
  endPt: (s >= Math.max(0, r) ? a : a / 2) * (i && a > 0 ? 2 : 1)
12627
12627
  };
12628
12628
  }
12629
- function fy(e) {
12630
- return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
12631
- }
12632
12629
  function py(e) {
12633
- return e.map((e) => Math.abs(e) <= Q ? 0 : e);
12630
+ return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
12634
12631
  }
12635
12632
  function my(e) {
12633
+ return e.map((e) => Math.abs(e) <= dy ? 0 : e);
12634
+ }
12635
+ function hy(e) {
12636
12636
  let t = e.gridWidthsPt.length;
12637
12637
  for (let n of e.rows) {
12638
12638
  for (let e of n.cells) t = Math.max(t, e.columnStart + Math.max(1, e.columnSpan));
@@ -12641,32 +12641,32 @@ function my(e) {
12641
12641
  }
12642
12642
  return t;
12643
12643
  }
12644
- function hy(e, t, n) {
12644
+ function gy(e, t, n) {
12645
12645
  let r = 0, i = Math.min(e.length, t + Math.max(1, n));
12646
12646
  for (let n = Math.max(0, t); n < i; n += 1) r += e[n] ?? 0;
12647
12647
  return r;
12648
12648
  }
12649
- function gy(e, t) {
12650
- return e ? e.kind === "pct" ? fy(e.value) * t : fy(e.value) : null;
12649
+ function _y(e, t) {
12650
+ return e ? e.kind === "pct" ? py(e.value) * t : py(e.value) : null;
12651
12651
  }
12652
- function _y(e, t, n, r) {
12652
+ function vy(e, t, n, r) {
12653
12653
  let i = Math.max(0, t), a = Math.max(1, Math.min(n, e.length - i));
12654
12654
  if (a <= 0) return;
12655
- let o = hy(e, i, a);
12656
- if (o <= Q) {
12655
+ let o = gy(e, i, a);
12656
+ if (o <= dy) {
12657
12657
  e[i + a - 1] = r;
12658
12658
  return;
12659
12659
  }
12660
12660
  let s = r / o;
12661
12661
  for (let t = i; t < i + a; t += 1) e[t] = (e[t] ?? 0) * s;
12662
12662
  }
12663
- function vy(e, t, n, r) {
12663
+ function yy(e, t, n, r) {
12664
12664
  let i = Math.max(0, t), a = Math.max(1, Math.min(n, e.length - i));
12665
12665
  if (a <= 0) return;
12666
- let o = hy(e, i, a);
12667
- r <= o + Q || (e[i + a - 1] += r - o);
12666
+ let o = gy(e, i, a);
12667
+ r <= o + dy || (e[i + a - 1] += r - o);
12668
12668
  }
12669
- function yy(e, t) {
12669
+ function by(e, t) {
12670
12670
  let n = [];
12671
12671
  e.before && e.before.columnSpan > 0 && n.push({
12672
12672
  start: 0,
@@ -12684,22 +12684,22 @@ function yy(e, t) {
12684
12684
  preferred: e.after.preferredWidth
12685
12685
  }), n;
12686
12686
  }
12687
- function by(e, t) {
12688
- let n = Array.from({ length: t }, (t, n) => fy(e.gridWidthsPt[n] ?? 0)), r = n.reduce((e, t) => e + t, 0), i = e.tablePreferredWidthPt ?? (r > 0 ? r : fy(e.availableWidthPt));
12687
+ function xy(e, t) {
12688
+ let n = Array.from({ length: t }, (t, n) => py(e.gridWidthsPt[n] ?? 0)), r = n.reduce((e, t) => e + t, 0), i = e.tablePreferredWidthPt ?? (r > 0 ? r : py(e.availableWidthPt));
12689
12689
  e.rows.forEach((e, r) => {
12690
- for (let a of yy(e, t)) {
12691
- let e = gy(a.preferred, i);
12692
- e !== null && (r === 0 ? _y(n, a.start, a.span, e) : vy(n, a.start, a.span, e));
12690
+ for (let a of by(e, t)) {
12691
+ let e = _y(a.preferred, i);
12692
+ e !== null && (r === 0 ? vy(n, a.start, a.span, e) : yy(n, a.start, a.span, e));
12693
12693
  }
12694
- }), e.tablePreferredWidthPt === null && xy(n, e.rows);
12694
+ }), e.tablePreferredWidthPt === null && Sy(n, e.rows);
12695
12695
  let a = e.tablePreferredWidthPt, o = n.reduce((e, t) => e + t, 0);
12696
- if (a !== null && a >= 0 && o <= Q && n.length > 0) return n.map(() => a / n.length);
12697
- if (a !== null && a >= 0 && o > Q) {
12696
+ if (a !== null && a >= 0 && o <= dy && n.length > 0) return n.map(() => a / n.length);
12697
+ if (a !== null && a >= 0 && o > dy) {
12698
12698
  if (e.layout === "autofit" && a < o) {
12699
12699
  let r = e.rows.flatMap((e) => e.cells);
12700
12700
  if (r.some((e) => e.noWrap === !0 && e.preferredWidth?.kind === "dxa")) {
12701
- let { minimums: i } = Sy(e.rows, t, o);
12702
- return ky(n, i, r, a, 0);
12701
+ let { minimums: i } = Cy(e.rows, t, o);
12702
+ return Ay(n, i, r, a, 0);
12703
12703
  }
12704
12704
  }
12705
12705
  let r = a / o;
@@ -12707,23 +12707,23 @@ function by(e, t) {
12707
12707
  }
12708
12708
  return n;
12709
12709
  }
12710
- function xy(e, t) {
12710
+ function Sy(e, t) {
12711
12711
  let n = Array(e.length).fill(0);
12712
12712
  for (let r of t) for (let t of r.cells) {
12713
12713
  if (t.columnSpan !== 1 || t.preferredWidth?.kind !== "pct") continue;
12714
12714
  let r = t.columnStart;
12715
- r < 0 || r >= e.length || (n[r] = Math.max(n[r] ?? 0, fy(t.preferredWidth.value)));
12715
+ r < 0 || r >= e.length || (n[r] = Math.max(n[r] ?? 0, py(t.preferredWidth.value)));
12716
12716
  }
12717
- let r = e.reduce((e, t) => e + t, 0), i = n.map((t, n) => t * r > e[n] + Q), a = /* @__PURE__ */ new Set();
12717
+ let r = e.reduce((e, t) => e + t, 0), i = n.map((t, n) => t * r > e[n] + dy), a = /* @__PURE__ */ new Set();
12718
12718
  for (; i.some(Boolean);) {
12719
12719
  let t = i.map((e) => e ? "1" : "0").join("");
12720
12720
  if (a.has(t)) return;
12721
12721
  a.add(t);
12722
12722
  let o = 0, s = 0;
12723
12723
  for (let t = 0; t < e.length; t += 1) i[t] ? s += n[t] ?? 0 : o += e[t] ?? 0;
12724
- if (s >= 1 - Q) return;
12724
+ if (s >= 1 - dy) return;
12725
12725
  r = o / (1 - s);
12726
- let c = n.map((t, n) => t * r > e[n] + Q);
12726
+ let c = n.map((t, n) => t * r > e[n] + dy);
12727
12727
  if (c.every((e, t) => e === i[t])) {
12728
12728
  for (let t = 0; t < e.length; t += 1) i[t] && (e[t] = n[t] * r);
12729
12729
  return;
@@ -12731,14 +12731,14 @@ function xy(e, t) {
12731
12731
  i = c;
12732
12732
  }
12733
12733
  }
12734
- function Sy(e, t, n) {
12734
+ function Cy(e, t, n) {
12735
12735
  let r = Array(t).fill(0), i = Array(t).fill(0);
12736
- for (let n of e) for (let e of n.cells) e.columnSpan !== 1 || e.columnStart < 0 || e.columnStart >= t || (r[e.columnStart] = Math.max(r[e.columnStart] ?? 0, fy(e.minContentWidthPt)), i[e.columnStart] = Math.max(i[e.columnStart] ?? 0, fy(e.maxContentWidthPt)));
12736
+ for (let n of e) for (let e of n.cells) e.columnSpan !== 1 || e.columnStart < 0 || e.columnStart >= t || (r[e.columnStart] = Math.max(r[e.columnStart] ?? 0, py(e.minContentWidthPt)), i[e.columnStart] = Math.max(i[e.columnStart] ?? 0, py(e.maxContentWidthPt)));
12737
12737
  let a = Array(t).fill(!1);
12738
12738
  for (let o of e) for (let e of o.cells) {
12739
12739
  let o = e.columnStart;
12740
12740
  if (e.columnSpan !== 1 || o < 0 || o >= t || a[o] || e.preferredWidth === null) continue;
12741
- let s = gy(e.preferredWidth, n);
12741
+ let s = _y(e.preferredWidth, n);
12742
12742
  s !== null && (i[o] = Math.max(r[o] ?? 0, s), a[o] = !0);
12743
12743
  }
12744
12744
  for (let e = 0; e < t; e += 1) i[e] = Math.max(r[e] ?? 0, i[e] ?? 0);
@@ -12747,24 +12747,24 @@ function Sy(e, t, n) {
12747
12747
  maximums: i
12748
12748
  };
12749
12749
  }
12750
- function Cy(e, t, n, r, i) {
12750
+ function wy(e, t, n, r, i) {
12751
12751
  let a = Math.min(e.length, n + r), o = e.map((e, t) => t).filter((e) => e < n || e >= a), s = o.map((n) => Math.max(0, e[n] - (t[n] ?? 0))), c = s.reduce((e, t) => e + t, 0), l = Math.min(i, c);
12752
- return l <= Q || c <= Q ? 0 : (o.forEach((t, n) => {
12752
+ return l <= dy || c <= dy ? 0 : (o.forEach((t, n) => {
12753
12753
  e[t] -= l * ((s[n] ?? 0) / c);
12754
12754
  }), l);
12755
12755
  }
12756
- function wy(e, t, n, r) {
12757
- if (r <= Q || n <= 0) return;
12758
- let i = hy(e, t, n);
12756
+ function Ty(e, t, n, r) {
12757
+ if (r <= dy || n <= 0) return;
12758
+ let i = gy(e, t, n);
12759
12759
  for (let a = 0; a < n; a += 1) {
12760
- let o = t + a, s = i > Q ? (e[o] ?? 0) / i : 1 / n;
12760
+ let o = t + a, s = i > dy ? (e[o] ?? 0) / i : 1 / n;
12761
12761
  e[o] += r * s;
12762
12762
  }
12763
12763
  }
12764
- function Ty(e) {
12765
- let t = my(e);
12764
+ function Ey(e) {
12765
+ let t = hy(e);
12766
12766
  if (e.layout === "fixed") {
12767
- let n = by(e, t).reduce((e, t) => e + t, 0);
12767
+ let n = xy(e, t).reduce((e, t) => e + t, 0);
12768
12768
  return Object.freeze({
12769
12769
  minWidthPt: n,
12770
12770
  maxWidthPt: n
@@ -12773,8 +12773,8 @@ function Ty(e) {
12773
12773
  let n = Array(t).fill(0), r = Array(t).fill(0), i = e.rows.flatMap((e) => e.cells).sort((e, t) => e.columnSpan - t.columnSpan), a = (e, t, n) => {
12774
12774
  let r = Math.max(0, t.columnStart), i = Math.max(1, Math.min(t.columnSpan, e.length - r));
12775
12775
  if (i <= 0) return;
12776
- let a = fy(n) - hy(e, r, i);
12777
- a > Q && wy(e, r, i, a);
12776
+ let a = py(n) - gy(e, r, i);
12777
+ a > dy && Ty(e, r, i, a);
12778
12778
  };
12779
12779
  for (let e of i) a(n, e, e.minContentWidthPt), a(r, e, Math.max(e.minContentWidthPt, e.maxContentWidthPt));
12780
12780
  let o = n.reduce((e, t) => e + t, 0), s = Math.max(o, r.reduce((e, t) => e + t, 0));
@@ -12783,32 +12783,32 @@ function Ty(e) {
12783
12783
  maxWidthPt: s
12784
12784
  });
12785
12785
  }
12786
- function Ey(e, t, n, r, i) {
12786
+ function Dy(e, t, n, r, i) {
12787
12787
  let a = Math.max(0, i.columnStart), o = Math.max(1, Math.min(i.columnSpan, e.length - a));
12788
12788
  if (o <= 0) return;
12789
- let s = fy(i.minContentWidthPt), c = hy(e, a, o);
12790
- if (s <= c + Q) return;
12791
- let l = o === 1 ? r[a] ?? s : Math.max(s, fy(i.maxContentWidthPt));
12792
- wy(e, a, o, Cy(e, n, a, o, Math.max(0, l - c)));
12793
- let u = hy(e, a, o);
12794
- if (u < s - Q) {
12795
- wy(e, a, o, Cy(e, t, a, o, s - u));
12796
- let n = hy(e, a, o);
12797
- n < s - Q && wy(e, a, o, s - n);
12798
- }
12799
- }
12800
- function Dy(e, t, n) {
12789
+ let s = py(i.minContentWidthPt), c = gy(e, a, o);
12790
+ if (s <= c + dy) return;
12791
+ let l = o === 1 ? r[a] ?? s : Math.max(s, py(i.maxContentWidthPt));
12792
+ Ty(e, a, o, wy(e, n, a, o, Math.max(0, l - c)));
12793
+ let u = gy(e, a, o);
12794
+ if (u < s - dy) {
12795
+ Ty(e, a, o, wy(e, t, a, o, s - u));
12796
+ let n = gy(e, a, o);
12797
+ n < s - dy && Ty(e, a, o, s - n);
12798
+ }
12799
+ }
12800
+ function Oy(e, t, n) {
12801
12801
  let r = [...t];
12802
12802
  for (let t of n) {
12803
12803
  if (t.noWrap !== !0 || t.preferredWidth?.kind !== "dxa") continue;
12804
- let n = Math.max(0, t.columnStart), i = Math.max(1, Math.min(t.columnSpan, e.length - n)), a = hy(e, n, i);
12805
- if (a <= Q) continue;
12806
- let o = fy(t.preferredWidth.value);
12804
+ let n = Math.max(0, t.columnStart), i = Math.max(1, Math.min(t.columnSpan, e.length - n)), a = gy(e, n, i);
12805
+ if (a <= dy) continue;
12806
+ let o = py(t.preferredWidth.value);
12807
12807
  for (let t = n; t < n + i; t += 1) r[t] = Math.max(r[t] ?? 0, e[t] * o / a);
12808
12808
  }
12809
12809
  return r;
12810
12810
  }
12811
- function Oy(e, t, n, r, i, a) {
12811
+ function ky(e, t, n, r, i, a) {
12812
12812
  let o = e.map(() => !1);
12813
12813
  for (let t of r) t.preferredWidth === null && t.columnSpan === 1 && t.columnStart >= 0 && t.columnStart < e.length && (o[t.columnStart] = !0);
12814
12814
  for (let t of r) {
@@ -12825,13 +12825,13 @@ function Oy(e, t, n, r, i, a) {
12825
12825
  e[r] = Math.min(t, n[r] ?? t);
12826
12826
  });
12827
12827
  let u = e.map((e, t) => o[t] ? Math.max(0, (n[t] ?? 0) - e) : 0), d = u.reduce((e, t) => e + t, 0);
12828
- if (d <= Q) return;
12829
- if (u.filter((e) => e > Q).length > 1) {
12828
+ if (d <= dy) return;
12829
+ if (u.filter((e) => e > dy).length > 1) {
12830
12830
  if (!l) return;
12831
12831
  let r = t.reduce((e, t) => e + t, 0);
12832
12832
  if (r > a) return;
12833
12833
  let i = n.map((e, n) => Math.max(0, e - (t[n] ?? 0))), o = i.reduce((e, t) => e + t, 0);
12834
- if (o <= Q) return;
12834
+ if (o <= dy) return;
12835
12835
  let s = Math.min(1, (a - r) / o);
12836
12836
  e.forEach((n, r) => {
12837
12837
  e[r] = (t[r] ?? 0) + s * i[r];
@@ -12839,52 +12839,52 @@ function Oy(e, t, n, r, i, a) {
12839
12839
  return;
12840
12840
  }
12841
12841
  let f = a - e.reduce((e, t) => e + t, 0);
12842
- if (f <= Q) return;
12842
+ if (f <= dy) return;
12843
12843
  let p = Math.min(f, d);
12844
12844
  u.forEach((t, n) => {
12845
12845
  e[n] = (e[n] ?? 0) + p * t / d;
12846
12846
  });
12847
12847
  }
12848
- function ky(e, t, n, r, i) {
12848
+ function Ay(e, t, n, r, i) {
12849
12849
  let a = e.reduce((e, t) => e + t, 0);
12850
- if (a <= r + Q || a <= Q) return e;
12851
- let o = [...e], s = Dy(o, t, n), c = (e, t) => {
12850
+ if (a <= r + dy || a <= dy) return e;
12851
+ let o = [...e], s = Oy(o, t, n), c = (e, t) => {
12852
12852
  let n = o.map((t, n) => Math.max(0, t - (e[n] ?? 0))), r = n.reduce((e, t) => e + t, 0), i = Math.min(t, r);
12853
- return i <= Q || r <= Q ? 0 : (o.forEach((e, t) => {
12853
+ return i <= dy || r <= dy ? 0 : (o.forEach((e, t) => {
12854
12854
  o[t] -= i * ((n[t] ?? 0) / r);
12855
12855
  }), i);
12856
12856
  }, l = a - r;
12857
12857
  c(t, l - c(s, l));
12858
12858
  for (let e of n) {
12859
12859
  if (e.columnSpan <= 1) continue;
12860
- let n = Math.max(0, e.columnStart), r = Math.max(1, Math.min(e.columnSpan, o.length - n)), i = fy(e.minContentWidthPt) - hy(o, n, r);
12861
- if (i <= Q) continue;
12862
- let a = Cy(o, s, n, r, i), c = a + Cy(o, t, n, r, i - a);
12863
- wy(o, n, r, c), c < i - Q && wy(o, n, r, i - c);
12860
+ let n = Math.max(0, e.columnStart), r = Math.max(1, Math.min(e.columnSpan, o.length - n)), i = py(e.minContentWidthPt) - gy(o, n, r);
12861
+ if (i <= dy) continue;
12862
+ let a = wy(o, s, n, r, i), c = a + wy(o, t, n, r, i - a);
12863
+ Ty(o, n, r, c), c < i - dy && Ty(o, n, r, i - c);
12864
12864
  }
12865
12865
  let u = o.reduce((e, t) => e + t, 0);
12866
- if (u <= r + Q || u <= Q) return py(o);
12866
+ if (u <= r + dy || u <= dy) return my(o);
12867
12867
  let d = n.find((e) => e.noWrap === !0 && e.preferredWidth === null && e.columnSpan === 1);
12868
- if (i > Q && (d?.minContentWidthPt ?? 0) > r - i + Q && o.length === 2 && n.length === 2 && n.every((e) => e.columnSpan === 1) && n.some((e) => e.columnStart === 0) && n.some((e) => e.columnStart === 1) && d && n.filter((e) => e.noWrap === !0).length === 1) {
12868
+ if (i > dy && (d?.minContentWidthPt ?? 0) > r - i + dy && o.length === 2 && n.length === 2 && n.every((e) => e.columnSpan === 1) && n.some((e) => e.columnStart === 0) && n.some((e) => e.columnStart === 1) && d && n.filter((e) => e.noWrap === !0).length === 1) {
12869
12869
  let e = [0, 0];
12870
- for (let t of n) e[t.columnStart] = fy(t.horizontalMarginsPt);
12870
+ for (let t of n) e[t.columnStart] = py(t.horizontalMarginsPt);
12871
12871
  let t = o.map((t, n) => Math.max(0, t - (e[n] ?? 0))), a = t.reduce((e, t) => e + t, 0);
12872
- if (a > Q) {
12872
+ if (a > dy) {
12873
12873
  let e = Math.max(0, r - i), n = t.map((t) => t * e / a), o = d.columnStart, s = 1 - o;
12874
- return n[o] += i * (t[s] ?? 0) / a, n[s] += i * (t[o] ?? 0) / a, py(n);
12874
+ return n[o] += i * (t[s] ?? 0) / a, n[s] += i * (t[o] ?? 0) / a, my(n);
12875
12875
  }
12876
12876
  }
12877
12877
  let f = Math.max(0, r) / u;
12878
- return py(o.map((e) => e * f));
12878
+ return my(o.map((e) => e * f));
12879
12879
  }
12880
- function Ay(e) {
12881
- let t = my(e), n = e.separatedCellSpacingPt ?? 0;
12880
+ function jy(e) {
12881
+ let t = hy(e), n = e.separatedCellSpacingPt ?? 0;
12882
12882
  if (e.layout !== "autofit" || n <= 0 || t === 0 || e.growUnpreferredColumns !== "nonbinding" || !e.rows.every((e) => e.before === null && e.after === null && e.cells.length === t && e.cells.every((e, t) => e.columnSpan === 1 && e.columnStart === t && e.preferredWidth === null))) return null;
12883
- let { maximums: r } = Sy(e.rows, t, 0), i = r.reduce((e, t) => e + t, 0), a = (t + 1) * 2 * n;
12883
+ let { maximums: r } = Cy(e.rows, t, 0), i = r.reduce((e, t) => e + t, 0), a = (t + 1) * 2 * n;
12884
12884
  return i + a <= (e.availableWidthPt ?? 0) && i + a < (e.contentBandPt ?? 0) ? r : null;
12885
12885
  }
12886
- function jy(e) {
12887
- let t = my(e);
12886
+ function My(e) {
12887
+ let t = hy(e);
12888
12888
  if (t === 0) return Object.freeze([]);
12889
12889
  let n = e.separatedCellSpacingPt ?? 0;
12890
12890
  if (n > 0) {
@@ -12893,36 +12893,36 @@ function jy(e) {
12893
12893
  separatedCellSpacingPt: void 0
12894
12894
  }, a;
12895
12895
  if (e.layout === "fixed") {
12896
- let e = jy(i), t = e.reduce((e, t) => e + t, 0);
12896
+ let e = My(i), t = e.reduce((e, t) => e + t, 0);
12897
12897
  if (t <= r) return e;
12898
12898
  a = e.map((e) => e * (t - r) / t);
12899
12899
  } else {
12900
- let t = Ay(e);
12901
- if (!t) return jy(i);
12900
+ let t = jy(e);
12901
+ if (!t) return My(i);
12902
12902
  a = t;
12903
12903
  }
12904
12904
  return Object.freeze(a.map((e, r) => {
12905
- let i = dy(n, r, 1, t, !0);
12905
+ let i = fy(n, r, 1, t, !0);
12906
12906
  return e + i.startPt + i.endPt;
12907
12907
  }));
12908
12908
  }
12909
- let r = by(e, t);
12909
+ let r = xy(e, t);
12910
12910
  if (e.layout === "fixed") {
12911
12911
  if (e.availableWidthPt === null) return Object.freeze(r);
12912
- let t = r.reduce((e, t) => e + t, 0), n = fy(e.availableWidthPt);
12913
- if (t <= n + Q || t <= Q) return Object.freeze(r);
12912
+ let t = r.reduce((e, t) => e + t, 0), n = py(e.availableWidthPt);
12913
+ if (t <= n + dy || t <= dy) return Object.freeze(r);
12914
12914
  let i = n / t;
12915
- return Object.freeze(py(r.map((e) => e * i)));
12915
+ return Object.freeze(my(r.map((e) => e * i)));
12916
12916
  }
12917
- let i = r.reduce((e, t) => e + t, 0), { minimums: a, maximums: o } = Sy(e.rows, t, i), s = e.rows.flatMap((e) => e.cells);
12917
+ let i = r.reduce((e, t) => e + t, 0), { minimums: a, maximums: o } = Cy(e.rows, t, i), s = e.rows.flatMap((e) => e.cells);
12918
12918
  s.sort((e, t) => e.columnSpan - t.columnSpan);
12919
- let c = Dy(r, a, s);
12920
- for (let e of s) Ey(r, a, c, o, e);
12921
- let l = o.reduce((e, t) => e + t, 0), u = l <= fy(e.availableWidthPt) + Q && e.contentBandPt !== void 0 && l < fy(e.contentBandPt) - Q;
12922
- return (e.growUnpreferredColumns === !0 || e.growUnpreferredColumns === "nonbinding" && u) && e.tablePreferredWidthPt === null && Oy(r, a, o, s, e.rows, fy(e.availableWidthPt)), Object.freeze(ky(r, a, s, fy(e.availableWidthPt), fy(e.outerMarginAllowancePt)));
12919
+ let c = Oy(r, a, s);
12920
+ for (let e of s) Dy(r, a, c, o, e);
12921
+ let l = o.reduce((e, t) => e + t, 0), u = l <= py(e.availableWidthPt) + dy && e.contentBandPt !== void 0 && l < py(e.contentBandPt) - dy;
12922
+ return (e.growUnpreferredColumns === !0 || e.growUnpreferredColumns === "nonbinding" && u) && e.tablePreferredWidthPt === null && ky(r, a, o, s, e.rows, py(e.availableWidthPt)), Object.freeze(Ay(r, a, s, py(e.availableWidthPt), py(e.outerMarginAllowancePt)));
12923
12923
  }
12924
- function My(e) {
12925
- let t = jy(e), n = t.map((t, n) => {
12924
+ function Ny(e) {
12925
+ let t = My(e), n = t.map((t, n) => {
12926
12926
  let r = t !== e.gridWidthsPt[n];
12927
12927
  return !r && e.gridWidthKeys?.[n] === null ? null : !r && e.gridWidthKeys?.[n] !== void 0 ? e.gridWidthKeys[n] : ny(t) ?? "0/1";
12928
12928
  });
@@ -12931,42 +12931,42 @@ function My(e) {
12931
12931
  widthKeys: Object.freeze(n)
12932
12932
  });
12933
12933
  }
12934
- function Ny(e) {
12935
- return My(e).widthsPt;
12934
+ function Py(e) {
12935
+ return Ny(e).widthsPt;
12936
12936
  }
12937
- function Py(e, t) {
12937
+ function Fy(e, t) {
12938
12938
  if (e === null) return null;
12939
12939
  let n = e.trim(), r = t && n.endsWith("%") ? n.slice(0, -1) : n;
12940
12940
  if (r.length === 0) return null;
12941
12941
  let i = Number(r);
12942
12942
  return Number.isFinite(i) ? i : null;
12943
12943
  }
12944
- function Fy(e) {
12944
+ function Iy(e) {
12945
12945
  return e.value?.trim().endsWith("%") ? "pct" : e.kind ?? "dxa";
12946
12946
  }
12947
- function Iy(e) {
12947
+ function Ly(e) {
12948
12948
  if (!e) return null;
12949
- let t = e.value?.trim() ?? "", n = Fy(e);
12949
+ let t = e.value?.trim() ?? "", n = Iy(e);
12950
12950
  if (n === "dxa") {
12951
- let t = Py(e.value ?? "0", !1);
12951
+ let t = Fy(e.value ?? "0", !1);
12952
12952
  return t === null ? null : {
12953
12953
  kind: "dxa",
12954
12954
  value: t / 20
12955
12955
  };
12956
12956
  }
12957
12957
  if (n !== "pct") return null;
12958
- let r = Py(e.value ?? "0", !0);
12958
+ let r = Fy(e.value ?? "0", !0);
12959
12959
  return r === null ? null : {
12960
12960
  kind: "pct",
12961
12961
  value: t.endsWith("%") ? r / 100 : r / 5e3
12962
12962
  };
12963
12963
  }
12964
- function Ly(e) {
12965
- let t = Iy(e);
12964
+ function Ry(e) {
12965
+ let t = Ly(e);
12966
12966
  return t?.kind === "dxa" ? t.value : null;
12967
12967
  }
12968
- function Ry(e, t) {
12969
- let n = t ? Iy(t) : e.widthPt == null ? e.widthPct == null ? null : {
12968
+ function zy(e, t) {
12969
+ let n = t ? Ly(t) : e.widthPt == null ? e.widthPct == null ? null : {
12970
12970
  kind: "pct",
12971
12971
  value: e.widthPct / 5e3
12972
12972
  } : {
@@ -12975,95 +12975,95 @@ function Ry(e, t) {
12975
12975
  };
12976
12976
  return n?.value === 0 ? null : n;
12977
12977
  }
12978
- function zy(e, t) {
12978
+ function By(e, t) {
12979
12979
  let n = e.format.firstRowException?.preferredWidth ?? null;
12980
12980
  if (e.format.firstRowException?.preferredWidthAuthored) return n?.kind === "dxa" ? n.value > 0 ? n.value : null : n?.kind === "pct" && n.value > 0 ? n.value * t : null;
12981
- let r = Iy(e.lexical.table?.preferredWidth);
12981
+ let r = Ly(e.lexical.table?.preferredWidth);
12982
12982
  return r?.kind === "dxa" ? r.value > 0 ? r.value : null : r?.kind === "pct" ? r.value > 0 ? r.value * t : null : e.semantic.widthPt != null && e.semantic.widthPt > 0 ? e.semantic.widthPt : e.semantic.widthPct != null && e.semantic.widthPct > 0 ? e.semantic.widthPct / 5e3 * t : null;
12983
12983
  }
12984
- function By(e) {
12984
+ function Vy(e) {
12985
12985
  if (e.format.firstRowException?.preferredWidthAuthored) {
12986
12986
  let t = e.format.firstRowException.preferredWidth;
12987
12987
  return t?.kind === "dxa" && t.value > 0 ? t.value : null;
12988
12988
  }
12989
- let t = Iy(e.lexical.table?.preferredWidth);
12989
+ let t = Ly(e.lexical.table?.preferredWidth);
12990
12990
  return t ? t.kind === "dxa" && t.value > 0 ? t.value : null : e.semantic.widthPt != null && e.semantic.widthPt > 0 ? e.semantic.widthPt : null;
12991
12991
  }
12992
- var Vy = Object.freeze({
12992
+ var Hy = Object.freeze({
12993
12993
  pt: "1/1",
12994
12994
  in: "72/1",
12995
12995
  cm: "3600/127",
12996
12996
  mm: "360/127",
12997
12997
  pc: "12/1",
12998
12998
  pi: "12/1"
12999
- }), Hy = "18446744073709551615";
13000
- function Uy(e) {
12999
+ }), Uy = "18446744073709551615";
13000
+ function Wy(e) {
13001
13001
  let t = e.replace(/[\u0009\u000a\u000d\u0020]+/g, " ").replace(/^ | $/g, ""), n = /^([+-]?)([0-9]+)$/.exec(t);
13002
13002
  if (!n) return null;
13003
13003
  let [, r, i] = n;
13004
13004
  if (r === "-" && /[1-9]/.test(i)) return null;
13005
13005
  let a = i.replace(/^0+/, "") || "0";
13006
- return a.length > 20 || a.length === 20 && a > Hy ? null : t;
13006
+ return a.length > 20 || a.length === 20 && a > Uy ? null : t;
13007
13007
  }
13008
- var Wy = {
13008
+ var Gy = {
13009
13009
  key: "0/1",
13010
13010
  widthPt: 0
13011
13011
  };
13012
- function Gy(e) {
13012
+ function Ky(e) {
13013
13013
  let t = ay(e);
13014
13014
  return Number.isFinite(t) ? {
13015
13015
  key: e,
13016
13016
  widthPt: t
13017
- } : Wy;
13017
+ } : Gy;
13018
13018
  }
13019
- function Ky(e, t) {
13019
+ function qy(e, t) {
13020
13020
  let n = Number(e);
13021
- if (!Number.isFinite(n)) return Wy;
13021
+ if (!Number.isFinite(n)) return Gy;
13022
13022
  let r = ny(n), i = r === null ? 0 : ay(sy(r, t));
13023
13023
  return Number.isFinite(i) ? {
13024
13024
  key: null,
13025
13025
  widthPt: i
13026
- } : Wy;
13026
+ } : Gy;
13027
13027
  }
13028
- function qy(e) {
13029
- if (e == null) return Wy;
13030
- let t = Uy(e);
13028
+ function Jy(e) {
13029
+ if (e == null) return Gy;
13030
+ let t = Wy(e);
13031
13031
  if (t !== null) {
13032
13032
  let e = ty(t);
13033
- return e === null ? Wy : Gy(ly(e, 20n));
13033
+ return e === null ? Gy : Ky(ly(e, 20n));
13034
13034
  }
13035
13035
  let n = /^([0-9]+(?:\.[0-9]+)?)(mm|cm|in|pt|pc|pi)$/.exec(e);
13036
- if (!n) return Wy;
13037
- let r = Vy[n[2]], i = ty(n[1]);
13038
- return i === null ? Ky(n[1], r) : Gy(sy(i, r));
13036
+ if (!n) return Gy;
13037
+ let r = Hy[n[2]], i = ty(n[1]);
13038
+ return i === null ? qy(n[1], r) : Ky(sy(i, r));
13039
13039
  }
13040
- function Jy(e) {
13040
+ function Yy(e) {
13041
13041
  let t = e.lexical.table?.grid;
13042
13042
  if (!t) {
13043
13043
  let t = e.semantic.colWidths.map((e) => Number.isFinite(e) && e >= 0 ? {
13044
13044
  widthPt: e,
13045
13045
  key: ny(e) ?? "0/1"
13046
- } : Wy);
13046
+ } : Gy);
13047
13047
  return {
13048
13048
  widthsPt: t.map((e) => e.widthPt),
13049
13049
  widthKeys: t.map((e) => e.key)
13050
13050
  };
13051
13051
  }
13052
- let n = Math.max(t.requiredColumnCount, t.columns.length), r = Array.from({ length: n }, (e, n) => qy(t.columns[n]?.width ?? null));
13052
+ let n = Math.max(t.requiredColumnCount, t.columns.length), r = Array.from({ length: n }, (e, n) => Jy(t.columns[n]?.width ?? null));
13053
13053
  return {
13054
13054
  widthsPt: r.map((e) => e.widthPt),
13055
13055
  widthKeys: r.map((e) => e.key)
13056
13056
  };
13057
13057
  }
13058
- function Yy(e, t) {
13059
- let n = Iy(e);
13058
+ function Xy(e, t) {
13059
+ let n = Ly(e);
13060
13060
  return n?.kind === "pct" ? {
13061
13061
  kind: "dxa",
13062
13062
  value: Math.max(0, n.value) * Math.max(0, t)
13063
13063
  } : n;
13064
13064
  }
13065
- function Xy(e, t, n, r = t, i) {
13066
- let a = e.semantic, { widthsPt: o, widthKeys: s } = Jy(e), c = e.format.firstRowException?.layout === "fixed" ? "fixed" : e.lexical.table?.layout?.kind ?? a.layout, l = e.lexical.table?.grid.authored ? e.lexical.table.grid.columns.length : null, u = a.rows.map((e) => {
13065
+ function Zy(e, t, n, r = t, i) {
13066
+ let a = e.semantic, { widthsPt: o, widthKeys: s } = Yy(e), c = e.format.firstRowException?.layout === "fixed" ? "fixed" : e.lexical.table?.layout?.kind ?? a.layout, l = e.lexical.table?.grid.authored ? e.lexical.table.grid.columns.length : null, u = a.rows.map((e) => {
13067
13067
  let t = Math.max(0, e.gridBefore ?? 0);
13068
13068
  return l !== null && t > l ? 0 : t;
13069
13069
  }), d = Math.max(l ?? 0, e.lexical.table?.grid.requiredColumnCount ?? 0, ...a.rows.map((e, t) => (u[t] ?? 0) + e.cells.reduce((e, t) => e + Math.max(1, t.colSpan), 0)));
@@ -13073,23 +13073,23 @@ function Xy(e, t, n, r = t, i) {
13073
13073
  availableWidthPt: r === null ? null : Math.max(0, r),
13074
13074
  gridWidthsPt: o,
13075
13075
  gridWidthKeys: s,
13076
- tablePreferredWidthPt: zy(e, t),
13076
+ tablePreferredWidthPt: By(e, t),
13077
13077
  rows: a.rows.map((r, a) => {
13078
13078
  let s = e.lexical.rows[a], f = u[a] ?? 0, p = Math.max(0, r.gridAfter ?? 0), m = f + r.cells.reduce((e, t) => e + Math.max(1, t.colSpan), 0), h = l !== null && m + p > d ? 0 : p, g = f;
13079
13079
  return {
13080
13080
  before: f > 0 ? {
13081
13081
  columnSpan: f,
13082
- preferredWidth: Yy(s?.row?.beforeWidth, t)
13082
+ preferredWidth: Xy(s?.row?.beforeWidth, t)
13083
13083
  } : null,
13084
13084
  after: h > 0 ? {
13085
13085
  columnSpan: h,
13086
- preferredWidth: Yy(s?.row?.afterWidth, t)
13086
+ preferredWidth: Xy(s?.row?.afterWidth, t)
13087
13087
  } : null,
13088
13088
  cells: r.cells.map((t, r) => {
13089
- let l = s?.cells[r] ?? null, u = Math.max(1, t.colSpan), d = Ry(t, l?.preferredWidth), f = c === "fixed" ? {
13089
+ let l = s?.cells[r] ?? null, u = Math.max(1, t.colSpan), d = zy(t, l?.preferredWidth), f = c === "fixed" ? {
13090
13090
  minWidthPt: 0,
13091
13091
  maxWidthPt: 0
13092
- } : n(a, r, d), p = dy(e.format.rows[a]?.cellSpacingPt ?? 0, g, u, o.length), m = i ? 2 * i.borderPt : p.startPt + p.endPt, h = e.format.rows[a]?.cells[r]?.marginsPt, _ = Math.max(0, h?.left ?? 0) + Math.max(0, h?.right ?? 0), v = {
13092
+ } : n(a, r, d), p = fy(e.format.rows[a]?.cellSpacingPt ?? 0, g, u, o.length), m = i ? 2 * i.borderPt : p.startPt + p.endPt, h = e.format.rows[a]?.cells[r]?.marginsPt, _ = Math.max(0, h?.left ?? 0) + Math.max(0, h?.right ?? 0), v = {
13093
13093
  columnStart: g,
13094
13094
  columnSpan: u,
13095
13095
  preferredWidth: d,
@@ -13104,21 +13104,21 @@ function Xy(e, t, n, r = t, i) {
13104
13104
  })
13105
13105
  };
13106
13106
  }
13107
- function Zy(e) {
13107
+ function Qy(e) {
13108
13108
  let t = e.leadingIndentPt + e.authoredFirstIndentPt + e.markerShiftPt;
13109
13109
  return {
13110
13110
  startPt: t,
13111
13111
  endPt: t + e.markerWidthPt
13112
13112
  };
13113
13113
  }
13114
- function Qy(e) {
13114
+ function $y(e) {
13115
13115
  let t = e.authoredFirstIndentPt + e.markerShiftPt;
13116
13116
  return e.baseRtl ? e.alignedLeadingEdgePt - t - e.markerWidthPt : e.alignedLeadingEdgePt + t;
13117
13117
  }
13118
- function $y(e, t) {
13118
+ function eb(e, t) {
13119
13119
  let { numbering: n, markerInput: r, service: i } = t, a = n != null && (n.text !== "" || n.picBulletImagePath != null) && (!e.baseRtl || (n?.suff || "tab") === "tab" && t.authoredFirstIndentPt < 0);
13120
13120
  if (!n || !r || !i || !a) return e;
13121
- let o = nb(n, r, {
13121
+ let o = rb(n, r, {
13122
13122
  authoredFirstIndentPt: t.authoredFirstIndentPt,
13123
13123
  physicalIndentLeftPt: e.physicalIndentLeftPt,
13124
13124
  tabStops: t.tabStops,
@@ -13132,7 +13132,7 @@ function $y(e, t) {
13132
13132
  numberingMarkerGeometry: o
13133
13133
  };
13134
13134
  }
13135
- function eb(e, t, n, r, i = !0) {
13135
+ function tb(e, t, n, r, i = !0) {
13136
13136
  if (!r) return null;
13137
13137
  let a = r.shape({
13138
13138
  text: t,
@@ -13173,11 +13173,11 @@ function eb(e, t, n, r, i = !0) {
13173
13173
  lineBox: u
13174
13174
  };
13175
13175
  }
13176
- function tb(e, t, n) {
13176
+ function nb(e, t, n) {
13177
13177
  return t.find((t) => Oc(e, t)) ?? Tl(e, [...t], n);
13178
13178
  }
13179
- function nb(e, t, n, r, i = !0) {
13180
- let a = e.picBulletImagePath ? "" : ft(e.text, e.fontFamily ?? null), o = a ? eb(t, a, 1, r, i) ?? null : null, s = o?.shape ?? null, c = e.picBulletImagePath ? e.picBulletWidthPt ?? t.fontSizePt : s?.advancePt ?? 0, l = e.jc === "right" ? -c : e.jc === "center" ? -c / 2 : 0, u = n.authoredFirstIndentPt + l + c, d = e.suff || "tab", f = u;
13179
+ function rb(e, t, n, r, i = !0) {
13180
+ let a = e.picBulletImagePath ? "" : ft(e.text, e.fontFamily ?? null), o = a ? tb(t, a, 1, r, i) ?? null : null, s = o?.shape ?? null, c = e.picBulletImagePath ? e.picBulletWidthPt ?? t.fontSizePt : s?.advancePt ?? 0, l = e.jc === "right" ? -c : e.jc === "center" ? -c / 2 : 0, u = n.authoredFirstIndentPt + l + c, d = e.suff || "tab", f = u;
13181
13181
  if (d === "space") {
13182
13182
  let o = Dc({
13183
13183
  compatibilityMode: n.compatibilityMode,
@@ -13197,9 +13197,9 @@ function nb(e, t, n, r, i = !0) {
13197
13197
  themeFonts: void 0,
13198
13198
  themeFontPresence: void 0
13199
13199
  } : t;
13200
- f += eb(o, " ", 1, r, i)?.shape.advancePt ?? 0;
13200
+ f += tb(o, " ", 1, r, i)?.shape.advancePt ?? 0;
13201
13201
  } else if (d === "tab" && (f = 0, u > 0)) {
13202
- let e = n.suffixFrameOriginPt, t = e === void 0 ? tb(n.physicalIndentLeftPt + u, n.tabStops, n.defaultTabPt) : tb(n.physicalIndentLeftPt + u - e, [...n.tabStops, {
13202
+ let e = n.suffixFrameOriginPt, t = e === void 0 ? nb(n.physicalIndentLeftPt + u, n.tabStops, n.defaultTabPt) : nb(n.physicalIndentLeftPt + u - e, [...n.tabStops, {
13203
13203
  pos: Math.max(n.physicalIndentLeftPt, e) - e,
13204
13204
  alignment: "num",
13205
13205
  leader: "none"
@@ -13215,7 +13215,7 @@ function nb(e, t, n, r, i = !0) {
13215
13215
  ...o ? { lineBox: o.lineBox } : {}
13216
13216
  };
13217
13217
  }
13218
- function rb(e) {
13218
+ function ib(e) {
13219
13219
  return {
13220
13220
  textAnchor: "cell-start",
13221
13221
  widthBasis: "host-cell-content",
@@ -13232,28 +13232,28 @@ function rb(e) {
13232
13232
  ...e.yAlign == null ? {} : { yAlign: e.yAlign }
13233
13233
  };
13234
13234
  }
13235
- function ib(e) {
13235
+ function ab(e) {
13236
13236
  let t = e.blocks[0]?.layout;
13237
13237
  if (e.columnStart !== 0 || e.vAlign !== "top" || e.verticalMerge !== "none" || e.verticalText || t?.kind !== "paragraph" || t.clipBounds || t.cellContainmentBounds || t.lines.length !== 1 || t.resources.length !== 0 || t.textBoxes.length !== 0 || t.events.length !== 0 || t.exclusions.length !== 0 || t.drawings.length !== 1 || t.anchorFrames?.length !== 1) return !1;
13238
13238
  let n = t.anchorFrames[0];
13239
13239
  return n.status === "resolved" && n.axes.vertical.relativeFrom === "paragraph" && n.geometry.wrap.kind === "none" && t.lines[0].placements.every((e) => e.kind === "anchor-host" && e.anchorOccurrenceId === n.occurrenceId || e.kind === "drawing" && e.advancePt === 0);
13240
13240
  }
13241
- function ab(e) {
13241
+ function ob(e) {
13242
13242
  let t = e.runs.filter((e) => e.type === "shape"), n = t.length === 1 ? t[0]?.anchorAcquisitionInput : void 0;
13243
13243
  return e.numbering == null && n !== void 0 && n.vertical.relativeFrom === "paragraph" && n.wrap.kind === "none" && n.behavior.allowOverlap === !0 && n.behavior.layoutInCell === !0 && e.runs.every((e) => e.type === "shape" || e.type === "anchorHost" && e.anchorOccurrenceId === n.occurrenceId);
13244
13244
  }
13245
- function ob(e) {
13245
+ function sb(e) {
13246
13246
  return e.runs.length === 0 && e.numbering == null;
13247
13247
  }
13248
- function sb(e) {
13248
+ function cb(e) {
13249
13249
  let t = e.story, n = t === "body" || t === "header" || t === "footer" || t === "footnote" || t === "textbox", r = e.topLevel || t === "body" && e.tableCellDepth === 1;
13250
- return fb(e.mode) && n && r && !e.verticalText && e.commonFrame && e.marginClass && !e.outerEdgeIndent && e.ordinaryFlow && !e.positioned && !e.rowOverrides && !e.gridSkips && !e.unfittedContentSizedAutoFit;
13250
+ return pb(e.mode) && n && r && !e.verticalText && e.commonFrame && e.marginClass && !e.outerEdgeIndent && e.ordinaryFlow && !e.positioned && !e.rowOverrides && !e.gridSkips && !e.unfittedContentSizedAutoFit;
13251
13251
  }
13252
- function cb(e) {
13252
+ function lb(e) {
13253
13253
  let t = e.rows.length <= 1, n = e.rows.every((e) => e.cells.length <= 1), r = Object.entries(e.borders ?? {}).filter(([e]) => !(e === "insideH" && t) && !(e === "insideV" && n)).map(([, e]) => !e || e.style === "nil" || e.style === "none" ? 0 : e.style === "single" && Number.isFinite(e.width) ? e.width : null);
13254
13254
  return r.some((e) => e === null || e !== r[0]) || e.rows.some((e) => e.cells.some((e) => Object.values(e.borders).some((e) => e != null) || e.vMerge != null || e.textDirection != null && e.textDirection !== "lrTb" || e.content.some((e) => e.type === "table"))) ? null : r[0] ?? 0;
13255
13255
  }
13256
- function lb(e) {
13256
+ function ub(e) {
13257
13257
  let t = e.justification == null || e.justification === "left" || e.justification === "start", n = e.justification === "center", r = t ? e.indentPt : 0;
13258
13258
  if (e.mode === 15) {
13259
13259
  let i = (n ? 0 : (t === e.bidi ? -1 : 1) * e.borderPt / 2) - (e.bidi ? e.borderPt / 2 : 0);
@@ -13263,35 +13263,35 @@ function lb(e) {
13263
13263
  let i = t ? e.leadingMarginPt : e.trailingMarginPt, a = (e.bidi ? e.spacingPt : 2 * e.spacingPt) + e.borderPt + i;
13264
13264
  return r + (t ? -a : a);
13265
13265
  }
13266
- function ub(e) {
13267
- let t = e.story;
13268
- return !fb(e.mode) || !e.topLevel || e.verticalText || !e.commonFrame || !e.marginClass || e.spacing || e.outerEdgeIndent || !e.ordinaryFlow || e.positioned || e.rowOverrides || e.gridSkips ? "none" : t === "body" || t === "header" || t === "footer" || t === "footnote" ? "all" : t === "textbox" ? "leading" : "none";
13269
- }
13270
13266
  function db(e) {
13271
- return e === 11 || e === 12 || e === 14 || e === 15;
13267
+ let t = e.story;
13268
+ return !pb(e.mode) || !e.topLevel || e.verticalText || !e.commonFrame || !e.marginClass || e.spacing || e.outerEdgeIndent || !e.ordinaryFlow || e.positioned || e.rowOverrides || e.gridSkips ? "none" : t === "body" || t === "header" || t === "footer" || t === "footnote" ? "all" : t === "textbox" ? "leading" : "none";
13272
13269
  }
13273
13270
  function fb(e) {
13274
- return e === void 0 || db(e);
13271
+ return e === 11 || e === 12 || e === 14 || e === 15;
13275
13272
  }
13276
13273
  function pb(e) {
13274
+ return e === void 0 || fb(e);
13275
+ }
13276
+ function mb(e) {
13277
13277
  return e.compatibility === "word" && e.availableHeightPt + e.epsilonPt < e.freshPageHeightPt;
13278
13278
  }
13279
- function mb(e, t) {
13279
+ function hb(e, t) {
13280
13280
  return Math.max(0, e ?? 0) + Math.max(0, ...t);
13281
13281
  }
13282
- function hb(e, t, n) {
13282
+ function gb(e, t, n) {
13283
13283
  return (e ? 0 : Math.max(0, t)) + Math.max(0, n);
13284
13284
  }
13285
- function gb(e) {
13285
+ function _b(e) {
13286
13286
  return e != null && e !== "none";
13287
13287
  }
13288
- function _b(e, t, n) {
13288
+ function vb(e, t, n) {
13289
13289
  return n ? e - t : e + t;
13290
13290
  }
13291
- function vb(e) {
13292
- return e.spacingPt > 0 && !gb(e.directStyle) && gb(e.conditionalInsideStyle);
13291
+ function yb(e) {
13292
+ return e.spacingPt > 0 && !_b(e.directStyle) && _b(e.conditionalInsideStyle);
13293
13293
  }
13294
- function yb(e, t) {
13294
+ function bb(e, t) {
13295
13295
  let n = Math.min(e.xPt, t.xPt), r = Math.max(e.xPt + e.widthPt, t.xPt + t.widthPt);
13296
13296
  return Object.freeze({
13297
13297
  xPt: n,
@@ -13300,16 +13300,16 @@ function yb(e, t) {
13300
13300
  heightPt: e.heightPt
13301
13301
  });
13302
13302
  }
13303
- function bb(e) {
13303
+ function xb(e) {
13304
13304
  return e.compatibility === "word" && e.availableHeightPt + e.epsilonPt >= e.freshPageHeightPt;
13305
13305
  }
13306
- function xb(e) {
13306
+ function Sb(e) {
13307
13307
  return e.compatibility === "word" && !e.repeatedHeader && (e.heightRule === "exact" || e.heightRule === "atLeast") && e.authoredHeightPt !== null && (e.heightRule === "exact" || e.wholeHeightPt <= e.authoredHeightPt + e.epsilonPt) && e.authoredHeightPt > e.availableHeightPt + e.epsilonPt && e.wholeHeightPt <= e.freshAvailableHeightPt + e.epsilonPt;
13308
13308
  }
13309
- function Sb(e) {
13309
+ function Cb(e) {
13310
13310
  return e.compatibility === "word" && e.hasUnfinishedParagraphWithoutProgress;
13311
13311
  }
13312
- var Cb = Object.freeze([
13312
+ var wb = Object.freeze([
13313
13313
  "single",
13314
13314
  "thick",
13315
13315
  "double",
@@ -13335,7 +13335,7 @@ var Cb = Object.freeze([
13335
13335
  "threeDEngrave",
13336
13336
  "outset",
13337
13337
  "inset"
13338
- ]), wb = Object.freeze({
13338
+ ]), Tb = Object.freeze({
13339
13339
  single: 1,
13340
13340
  thick: 2,
13341
13341
  double: 3,
@@ -13360,30 +13360,30 @@ var Cb = Object.freeze([
13360
13360
  outset: 26,
13361
13361
  inset: 27
13362
13362
  });
13363
- function Tb(e, t) {
13364
- return e === "dotted" || e === "dashed" ? 1 : Math.max(0, t) * 8 * (o(wb, e) ?? 0);
13365
- }
13366
13363
  function Eb(e, t) {
13367
- return t ? e : "atLeast";
13364
+ return e === "dotted" || e === "dashed" ? 1 : Math.max(0, t) * 8 * (o(Tb, e) ?? 0);
13368
13365
  }
13369
13366
  function Db(e, t) {
13367
+ return t ? e : "atLeast";
13368
+ }
13369
+ function Ob(e, t) {
13370
13370
  return e === "pct" || e === "auto" || e === "nil" ? 0 : t;
13371
13371
  }
13372
- function Ob(e) {
13372
+ function kb(e) {
13373
13373
  return e.kind === "dxa" ? e.dxaValuePt : e.scope === "cell" || e.scope === "exception" ? null : (e.edge === "start" || e.edge === "end") && (e.kind === "pct" || e.kind === "auto" || e.kind === "nil") ? 0 : null;
13374
13374
  }
13375
- function kb(e) {
13375
+ function Ab(e) {
13376
13376
  return e.measured && (e.justification === "center" || e.justification === "right" || e.justification === "end") ? 0 : e.indentPt;
13377
13377
  }
13378
- function Ab(e) {
13379
- let t = kb({
13378
+ function jb(e) {
13379
+ let t = Ab({
13380
13380
  ...e,
13381
13381
  measured: e.measured || e.nonleadingIndentIgnored === !0
13382
13382
  });
13383
13383
  return !e.measured || e.justification === "center" ? t : e.justification === "right" || e.justification === "end" ? t + (e.mode === 15 ? 0 : e.rowLeftMarginPt) : t - (e.mode !== 15 && e.indentAuthored ? e.firstLeftMarginPt : 0);
13384
13384
  }
13385
- function jb(e, t, n) {
13386
- return !db(t) || !n || e.layout !== "fixed" || e.rows.length === 0 || !e.rows.every((e) => e.cells.length > 0 && e.cells[0]?.columnStart === 1 && e.after === null && e.cells.every((e) => e.columnSpan === 1 && e.preferredWidth?.kind === "dxa" && e.preferredWidth.value > 0)) ? e : {
13385
+ function Mb(e, t, n) {
13386
+ return !fb(t) || !n || e.layout !== "fixed" || e.rows.length === 0 || !e.rows.every((e) => e.cells.length > 0 && e.cells[0]?.columnStart === 1 && e.after === null && e.cells.every((e) => e.columnSpan === 1 && e.preferredWidth?.kind === "dxa" && e.preferredWidth.value > 0)) ? e : {
13387
13387
  ...e,
13388
13388
  gridWidthsPt: e.gridWidthsPt.map((e, t) => t === 0 ? 0 : e),
13389
13389
  gridWidthKeys: e.gridWidthKeys?.map((e, t) => t === 0 ? null : e),
@@ -13393,14 +13393,14 @@ function jb(e, t, n) {
13393
13393
  }))
13394
13394
  };
13395
13395
  }
13396
- function Mb(e) {
13396
+ function Nb(e) {
13397
13397
  return e === "body" || e === "header" || e === "footer";
13398
13398
  }
13399
- function Nb(e) {
13399
+ function Pb(e) {
13400
13400
  let t = e.cells[0]?.content[0];
13401
13401
  return t?.type !== "paragraph" || !t.framePr || t.framePr.dropCap !== "none" ? null : t.framePr;
13402
13402
  }
13403
- function Pb(e) {
13403
+ function Fb(e) {
13404
13404
  return Zr("w:framePr:owner-run", [
13405
13405
  e.hAnchor,
13406
13406
  e.vAnchor,
@@ -13416,10 +13416,10 @@ function Pb(e) {
13416
13416
  e.vSpace
13417
13417
  ]);
13418
13418
  }
13419
- function Fb(e, t, n, r = "autofit", i = Ry(e)) {
13419
+ function Ib(e, t, n, r = "autofit", i = zy(e)) {
13420
13420
  let a = 0, o = 0, s = 0;
13421
13421
  for (let t of e.content) {
13422
- let e = t.type === "paragraph" && ob(t), r = t.type === "paragraph" ? e ? {
13422
+ let e = t.type === "paragraph" && sb(t), r = t.type === "paragraph" ? e ? {
13423
13423
  minWidthPt: 0,
13424
13424
  maxWidthPt: 0
13425
13425
  } : n.paragraph(t) : n.nestedTable(t);
@@ -13431,7 +13431,7 @@ function Fb(e, t, n, r = "autofit", i = Ry(e)) {
13431
13431
  maxWidthPt: Math.max(a, o) + c
13432
13432
  };
13433
13433
  }
13434
- function Ib(e) {
13434
+ function Lb(e) {
13435
13435
  let t = e.textShapeRequest, n = (e) => e ? [
13436
13436
  e.ascii ?? null,
13437
13437
  e.highAnsi ?? null,
@@ -13485,18 +13485,18 @@ function Ib(e) {
13485
13485
  e.verticalRun ?? !1
13486
13486
  ]);
13487
13487
  }
13488
- function Lb(e, t) {
13489
- return (e.textLayoutService?.fingerprint ?? null) === (t.textLayoutService?.fingerprint ?? null) && Ib(e) === Ib(t);
13490
- }
13491
13488
  function Rb(e, t) {
13489
+ return (e.textLayoutService?.fingerprint ?? null) === (t.textLayoutService?.fingerprint ?? null) && Lb(e) === Lb(t);
13490
+ }
13491
+ function zb(e, t) {
13492
13492
  let n = e.textShapeRequest?.substituteContext, r = t.textShapeRequest?.substituteContext;
13493
13493
  return n !== void 0 && r !== void 0 && n.text === r.text && n.offset + e.text.length === r.offset;
13494
13494
  }
13495
- function zb(e, t) {
13495
+ function Bb(e, t) {
13496
13496
  let n = [], r, i;
13497
13497
  for (let a of e) {
13498
13498
  let e = n.at(-1);
13499
- if (e && "text" in e && "text" in a && sp(e, a) && !e.optionalHyphen && !a.optionalHyphen && !(a.hardJoinPrev && e.optionalHyphenBreaks?.at(-1)?.offset === e.text.length) && !e.semanticSlotSpans && !a.semanticSlotSpans && a.autoSpaceBeforePt === void 0 && !(a.textShapeRequest?.kerning === !0 && e.text.endsWith(" ") !== a.text.startsWith(" ") && (e.script !== a.script || !Jp(e, a, 1) || Hp(e, t) !== null || Hp(a, t) !== null || Pp(e, t, 1) || Pp(a, t, 1))) && !(a.textShapeRequest?.kerning === !0 && (e.sourceRunIndex !== a.sourceRunIndex || e.sourceTextSequence !== a.sourceTextSequence)) && Lb(e, a) && (e.substituteScope === void 0 && a.substituteScope === void 0 || e.textShapeRequest?.substituteContext?.text === a.textShapeRequest?.substituteContext?.text && e.textShapeRequest?.substituteContext !== void 0 && a.textShapeRequest?.substituteContext?.offset === e.textShapeRequest.substituteContext.offset + e.text.length)) {
13499
+ if (e && "text" in e && "text" in a && sp(e, a) && !e.optionalHyphen && !a.optionalHyphen && !(a.hardJoinPrev && e.optionalHyphenBreaks?.at(-1)?.offset === e.text.length) && !e.semanticSlotSpans && !a.semanticSlotSpans && a.autoSpaceBeforePt === void 0 && !(a.textShapeRequest?.kerning === !0 && e.text.endsWith(" ") !== a.text.startsWith(" ") && (e.script !== a.script || !Jp(e, a, 1) || Hp(e, t) !== null || Hp(a, t) !== null || Pp(e, t, 1) || Pp(a, t, 1))) && !(a.textShapeRequest?.kerning === !0 && (e.sourceRunIndex !== a.sourceRunIndex || e.sourceTextSequence !== a.sourceTextSequence)) && Rb(e, a) && (e.substituteScope === void 0 && a.substituteScope === void 0 || e.textShapeRequest?.substituteContext?.text === a.textShapeRequest?.substituteContext?.text && e.textShapeRequest?.substituteContext !== void 0 && a.textShapeRequest?.substituteContext?.offset === e.textShapeRequest.substituteContext.offset + e.text.length)) {
13500
13500
  let t = e.text.length, o = e.text + a.text;
13501
13501
  if (a.explicitBreakBefore || a.explicitBreaks) {
13502
13502
  r ??= [], a.explicitBreakBefore && r.push(t);
@@ -13522,7 +13522,7 @@ function zb(e, t) {
13522
13522
  textShapeRequest: e.textShapeRequest ? {
13523
13523
  ...e.textShapeRequest,
13524
13524
  text: o,
13525
- substituteContext: e.substituteScope !== void 0 || a.substituteScope !== void 0 || e.textShapeRequest.kerning === !0 && Rb(e, a) ? e.textShapeRequest.substituteContext : {
13525
+ substituteContext: e.substituteScope !== void 0 || a.substituteScope !== void 0 || e.textShapeRequest.kerning === !0 && zb(e, a) ? e.textShapeRequest.substituteContext : {
13526
13526
  text: o,
13527
13527
  offset: 0
13528
13528
  }
@@ -13537,7 +13537,7 @@ function zb(e, t) {
13537
13537
  }
13538
13538
  return r && Object.freeze(r), i && Object.freeze(i), n;
13539
13539
  }
13540
- function Bb(e, t, n, r, i, a, o) {
13540
+ function Vb(e, t, n, r, i, a, o) {
13541
13541
  let s = 0, c, l, u, d = null, f = a?.type === "snapToChars" && a.characterPitchPt != null && a.characterPitchPt > 0 ? a.characterPitchPt : null, p = () => {
13542
13542
  !d || f == null || (s += Up(d.naturalWidthPt, d.kind, f), d = null);
13543
13543
  }, m = 0, h = e.length;
@@ -13582,7 +13582,7 @@ function Bb(e, t, n, r, i, a, o) {
13582
13582
  clusterGeometry: !0
13583
13583
  }).clusters : void 0, t = e?.length ? null : [...new Set([
13584
13584
  0,
13585
- ...Ne(_),
13585
+ ...De(_),
13586
13586
  _.length
13587
13587
  ])].sort((e, t) => e - t), n = e?.map((e) => ({
13588
13588
  start: e.range.start,
@@ -13623,21 +13623,21 @@ function Bb(e, t, n, r, i, a, o) {
13623
13623
  }
13624
13624
  return p(), s;
13625
13625
  }
13626
- function Vb(e, t, n) {
13626
+ function Hb(e, t, n) {
13627
13627
  let r = 0;
13628
- return Ub(e, t, n, (e) => (r = Math.max(r, e), !1)), r;
13628
+ return Wb(e, t, n, (e) => (r = Math.max(r, e), !1)), r;
13629
13629
  }
13630
- function Hb(e, t, n, r) {
13630
+ function Ub(e, t, n, r) {
13631
13631
  let i = Wv(n)?.type === "snapToChars", a = [];
13632
13632
  for (let t = 0; t < e.length; t += 1) {
13633
13633
  let o = e[t];
13634
13634
  if (!("isTab" in o)) continue;
13635
13635
  let s;
13636
- !o.ptab && Gf(e[t + 1], e[t + 2], i, n.baseRtl) && (s = 0, Ub([e[t + 1]], n, r, (e) => (s = e, !0))), a.push(s);
13636
+ !o.ptab && Gf(e[t + 1], e[t + 2], i, n.baseRtl) && (s = 0, Wb([e[t + 1]], n, r, (e) => (s = e, !0))), a.push(s);
13637
13637
  }
13638
13638
  return a.length === t.filter((e) => "isTab" in e).length ? a : [];
13639
13639
  }
13640
- function Ub(e, t, n, r) {
13640
+ function Wb(e, t, n, r) {
13641
13641
  let i = Wv(t);
13642
13642
  for (let a = 0; a < e.length; a += 1) {
13643
13643
  let o = e[a];
@@ -13671,14 +13671,14 @@ function Ub(e, t, n, r) {
13671
13671
  e.push(l), e.sort((e, t) => e - t);
13672
13672
  let t = o;
13673
13673
  for (let a of new Set(e)) {
13674
- if (r(Bb(s, c, t, a, n, i, f.get(a)))) return;
13674
+ if (r(Vb(s, c, t, a, n, i, f.get(a)))) return;
13675
13675
  t = a;
13676
13676
  }
13677
13677
  continue;
13678
13678
  }
13679
13679
  let d = [
13680
13680
  0,
13681
- ...Ne(a),
13681
+ ...De(a),
13682
13682
  a.length
13683
13683
  ], _ = [];
13684
13684
  for (let e = 1; e < d.length; e += 1) _.push({
@@ -13696,18 +13696,18 @@ function Ub(e, t, n, r) {
13696
13696
  };
13697
13697
  }
13698
13698
  y && v.push(y);
13699
- for (let e of v) if (r(Bb(s, c, e.start, e.end, n, i))) return;
13699
+ for (let e of v) if (r(Vb(s, c, e.start, e.end, n, i))) return;
13700
13700
  }
13701
13701
  }
13702
13702
  }
13703
- function Wb(e, t, n) {
13703
+ function Gb(e, t, n) {
13704
13704
  let r = (n.baseRtl ? n.physicalIndentRightPt : n.physicalIndentLeftPt) + (t === 0 ? n.firstIndentPt : 0) + e.xOffset;
13705
13705
  return {
13706
13706
  startPt: r,
13707
13707
  endPt: r + e.segments.reduce((e, t) => e + t.measuredWidth, 0)
13708
13708
  };
13709
13709
  }
13710
- function Gb(e, t, n, r, i, a, o = {}) {
13710
+ function Kb(e, t, n, r, i, a, o = {}) {
13711
13711
  if (!Number.isFinite(n) || n < 0) throw RangeError("maximumWidthPt must be finite and non-negative");
13712
13712
  if (n === 0) return {
13713
13713
  minWidthPt: 0,
@@ -13723,19 +13723,19 @@ function Gb(e, t, n, r, i, a, o = {}) {
13723
13723
  paragraphRtl: t.baseRtl,
13724
13724
  autoSpaceDE: e.autoSpaceDE,
13725
13725
  autoSpaceDN: e.autoSpaceDN
13726
- }), c = zb(s, Wv(t)), l = Hb(s, c, t, r), u = Math.max(1, n - t.physicalIndentLeftPt - t.physicalIndentRightPt), d = c.length === 0 ? [] : zv(r.context, c, u, t.firstIndentPt, 1, [...t.tabStops], void 0, r.fontFamilyClasses, t.physicalIndentLeftPt, t.kinsoku, Wv(t), t.defaultTabPt, u + t.physicalIndentRightPt, t.baseRtl, t.isJustified, t.stretchLastLine, void 0, "intrinsic", i.verticalGlyphMeasurement, t.overflowPunct !== !1, !1, void 0, t.cjkClosingMarkHang), f = t.baseRtl ? t.physicalIndentLeftPt : t.physicalIndentRightPt, p = 0, m = 0;
13726
+ }), c = Bb(s, Wv(t)), l = Ub(s, c, t, r), u = Math.max(1, n - t.physicalIndentLeftPt - t.physicalIndentRightPt), d = c.length === 0 ? [] : zv(r.context, c, u, t.firstIndentPt, 1, [...t.tabStops], void 0, r.fontFamilyClasses, t.physicalIndentLeftPt, t.kinsoku, Wv(t), t.defaultTabPt, u + t.physicalIndentRightPt, t.baseRtl, t.isJustified, t.stretchLastLine, void 0, "intrinsic", i.verticalGlyphMeasurement, t.overflowPunct !== !1, !1, void 0, t.cjkClosingMarkHang), f = t.baseRtl ? t.physicalIndentLeftPt : t.physicalIndentRightPt, p = 0, m = 0;
13727
13727
  d.forEach((e, n) => {
13728
- let r = Wb(e, n, t);
13728
+ let r = Gb(e, n, t);
13729
13729
  p = Math.min(p, r.startPt), m = Math.max(m, r.endPt);
13730
13730
  });
13731
- let h = a ? Zy({
13731
+ let h = a ? Qy({
13732
13732
  leadingIndentPt: t.baseRtl ? t.physicalIndentRightPt : t.physicalIndentLeftPt,
13733
13733
  authoredFirstIndentPt: e.indentFirst,
13734
13734
  markerShiftPt: a.markerShiftPt,
13735
13735
  markerWidthPt: a.markerWidthPt
13736
13736
  }) : void 0;
13737
13737
  h && (p = Math.min(p, h.startPt), m = Math.max(m, h.endPt));
13738
- let g = Vb(c, t, r), _ = 0;
13738
+ let g = Hb(c, t, r), _ = 0;
13739
13739
  for (let e of d) {
13740
13740
  let n = 0, r = e.segments.reduce((e, t) => e + t.measuredWidth, 0);
13741
13741
  for (let i of e.segments) if (n += i.measuredWidth, "imagePath" in i && !i.anchor) g = Math.max(g, i.measuredWidth);
@@ -13747,7 +13747,7 @@ function Gb(e, t, n, r, i, a, o = {}) {
13747
13747
  }
13748
13748
  let v = t.baseRtl ? t.physicalIndentRightPt : t.physicalIndentLeftPt, y = o.preserveWhitespaceOnlyContent && c.length > 0 && c.every((e) => "text" in e && /^[\s\u00a0]+$/u.test(e.text)) ? c : null, b = y ? (() => {
13749
13749
  let e = "";
13750
- return Bb(y.map((t) => {
13750
+ return Vb(y.map((t) => {
13751
13751
  let n = e.length;
13752
13752
  return e += t.text, {
13753
13753
  segment: t,
@@ -13768,27 +13768,27 @@ function Gb(e, t, n, r, i, a, o = {}) {
13768
13768
  maxWidthPt: x
13769
13769
  };
13770
13770
  }
13771
- function Kb(e, t) {
13771
+ function qb(e, t) {
13772
13772
  if (!e || t?.suppressBottom) return 0;
13773
13773
  let n = e.bottom;
13774
13774
  return !n || n.style === "none" ? 0 : (n.space ?? 0) + (n.width ?? 0) / 2;
13775
13775
  }
13776
- function qb(e, t) {
13776
+ function Jb(e, t) {
13777
13777
  if (!e || t === "none") return 0;
13778
13778
  let n = e[t];
13779
13779
  return !n || n.style === "none" || n.style === "nil" ? 0 : (n.space ?? 0) + (n.width ?? 0) / 2;
13780
13780
  }
13781
- function Jb(e) {
13781
+ function Yb(e) {
13782
13782
  return e == null || e.style === "none" ? null : e;
13783
13783
  }
13784
- function Yb(e, t) {
13785
- let n = Jb(e), r = Jb(t);
13784
+ function Xb(e, t) {
13785
+ let n = Yb(e), r = Yb(t);
13786
13786
  return n == null || r == null ? n == null && r == null : n.style === r.style && n.width === r.width && (n.space ?? 0) === (r.space ?? 0) && (n.color ?? null) === (r.color ?? null);
13787
13787
  }
13788
- function Xb(e, t) {
13789
- return !e || !t ? !1 : Yb(e.top, t.top) && Yb(e.bottom, t.bottom) && Yb(e.left, t.left) && Yb(e.right, t.right) && Yb(e.between, t.between);
13788
+ function Zb(e, t) {
13789
+ return !e || !t ? !1 : Xb(e.top, t.top) && Xb(e.bottom, t.bottom) && Xb(e.left, t.left) && Xb(e.right, t.right) && Xb(e.between, t.between);
13790
13790
  }
13791
- function Zb(e) {
13791
+ function Qb(e) {
13792
13792
  return e ? [
13793
13793
  e.top,
13794
13794
  e.right,
@@ -13797,20 +13797,20 @@ function Zb(e) {
13797
13797
  e.between
13798
13798
  ].some((e) => e != null && e.style !== "none") : !1;
13799
13799
  }
13800
- function Qb(e, t) {
13801
- return !e || !t || e.framePr || t.framePr ? !1 : Zb(e.borders) && Zb(t.borders) && Xb(e.borders, t.borders);
13800
+ function $b(e, t) {
13801
+ return !e || !t || e.framePr || t.framePr ? !1 : Qb(e.borders) && Qb(t.borders) && Zb(e.borders, t.borders);
13802
13802
  }
13803
- function $b(e, t, n, r = !1) {
13804
- let i = (e, t) => r ? !!e && !!t && !!e.framePr && !!t.framePr && Zb(e.borders) && Zb(t.borders) && Xb(e.borders, t.borders) : Qb(e, t), a = i(e, t), o = i(t, n), s = t.borders?.between;
13803
+ function ex(e, t, n, r = !1) {
13804
+ let i = (e, t) => r ? !!e && !!t && !!e.framePr && !!t.framePr && Qb(e.borders) && Qb(t.borders) && Zb(e.borders, t.borders) : $b(e, t), a = i(e, t), o = i(t, n), s = t.borders?.between;
13805
13805
  return Object.freeze({
13806
13806
  top: a ? s && s.style !== "none" ? "between" : "none" : "top",
13807
13807
  bottom: o ? "none" : "bottom"
13808
13808
  });
13809
13809
  }
13810
- function ex(e, t, n, r, i, a) {
13811
- return Gb(e, t, n, r, i, a).maxWidthPt;
13810
+ function tx(e, t, n, r, i, a) {
13811
+ return Kb(e, t, n, r, i, a).maxWidthPt;
13812
13812
  }
13813
- function tx(e) {
13813
+ function nx(e) {
13814
13814
  let t = e;
13815
13815
  return Zr("w:framePr", [
13816
13816
  t.dropCap,
@@ -13830,7 +13830,7 @@ function tx(e) {
13830
13830
  t.__anchorLock === !0
13831
13831
  ]);
13832
13832
  }
13833
- function nx(e) {
13833
+ function rx(e) {
13834
13834
  let t = /* @__PURE__ */ new WeakMap();
13835
13835
  for (let n = 0; n < e.length;) {
13836
13836
  let r = e[n];
@@ -13838,10 +13838,10 @@ function nx(e) {
13838
13838
  n += 1;
13839
13839
  continue;
13840
13840
  }
13841
- let i = tx(r.framePr), a = [r], o = [n], s = n + 1;
13841
+ let i = nx(r.framePr), a = [r], o = [n], s = n + 1;
13842
13842
  for (; s < e.length;) {
13843
13843
  let t = e[s];
13844
- if (t?.type !== "paragraph" || !t.framePr || tx(t.framePr) !== i) break;
13844
+ if (t?.type !== "paragraph" || !t.framePr || nx(t.framePr) !== i) break;
13845
13845
  a.push(t), o.push(s), s += 1;
13846
13846
  }
13847
13847
  let c = Object.freeze({
@@ -13856,23 +13856,23 @@ function nx(e) {
13856
13856
  }
13857
13857
  return t;
13858
13858
  }
13859
- var rx = /* @__PURE__ */ new WeakMap(), ix = /* @__PURE__ */ new WeakMap();
13860
- function ax(e) {
13861
- let t = nx(e);
13859
+ var ix = /* @__PURE__ */ new WeakMap(), ax = /* @__PURE__ */ new WeakMap();
13860
+ function ox(e) {
13861
+ let t = rx(e);
13862
13862
  for (let n = 0; n < e.length; n += 1) {
13863
13863
  let r = e[n];
13864
13864
  if (r.type !== "paragraph") continue;
13865
13865
  let i = t.get(r);
13866
- i && rx.set(r, i);
13866
+ i && ix.set(r, i);
13867
13867
  let a = e[n - 1], o = e[n + 1], s = a?.type === "paragraph" && t.get(a) === i ? a : null, c = o?.type === "paragraph" && t.get(o) === i ? o : null;
13868
- ix.set(r, $b(i ? s : a?.type === "paragraph" ? a : null, r, i ? c : o?.type === "paragraph" ? o : null, i !== void 0));
13868
+ ax.set(r, ex(i ? s : a?.type === "paragraph" ? a : null, r, i ? c : o?.type === "paragraph" ? o : null, i !== void 0));
13869
13869
  }
13870
13870
  }
13871
- var ox = (e) => rx.get(e), sx = (e) => ix.get(e);
13872
- function cx(e) {
13871
+ var sx = (e) => ix.get(e), cx = (e) => ax.get(e);
13872
+ function lx(e) {
13873
13873
  return e.textDirection == null || e.textDirection === "lrTb";
13874
13874
  }
13875
- function lx(e, t) {
13875
+ function ux(e, t) {
13876
13876
  return {
13877
13877
  story: e.story,
13878
13878
  containers: [...e.containers, { kind: "tableCell" }],
@@ -13881,37 +13881,37 @@ function lx(e, t) {
13881
13881
  ...e.closingMarkHangAdmitted && e.story === "body" && t ? { closingMarkHangAdmitted: !0 } : {}
13882
13882
  };
13883
13883
  }
13884
- function ux(e) {
13884
+ function dx(e) {
13885
13885
  if (!e.closingMarkHangAdmitted) return e;
13886
13886
  let { closingMarkHangAdmitted: t, ...n } = e;
13887
13887
  return n;
13888
13888
  }
13889
- function dx(e) {
13889
+ function fx(e) {
13890
13890
  return e.runs.some((e) => e.type === "text" && !!e.ruby);
13891
13891
  }
13892
- function fx(e) {
13892
+ function px(e) {
13893
13893
  return e.runs.some((e) => e.type === "text" && wl.test(e.text));
13894
13894
  }
13895
- function px(e) {
13895
+ function mx(e) {
13896
13896
  for (let t of e) {
13897
13897
  if (t.type === "paragraph") {
13898
- if (fx(t)) return !0;
13898
+ if (px(t)) return !0;
13899
13899
  continue;
13900
13900
  }
13901
13901
  if (t.type === "table") {
13902
- for (let e of t.rows) for (let t of e.cells) if (px(t.content)) return !0;
13902
+ for (let e of t.rows) for (let t of e.cells) if (mx(t.content)) return !0;
13903
13903
  }
13904
13904
  }
13905
13905
  return !1;
13906
13906
  }
13907
- function mx(e, t = { normalStyleFontSizePt: 10 }) {
13908
- return ax(e.body), {
13909
- kinsoku: ue(e.settings),
13907
+ function hx(e, t = { normalStyleFontSizePt: 10 }) {
13908
+ return ox(e.body), {
13909
+ kinsoku: de(e.settings),
13910
13910
  ...e.settings?.noLineBreaksBefore !== void 0 || e.settings?.noLineBreaksAfter !== void 0 ? { hasCustomKinsokuRules: !0 } : {},
13911
13911
  defaultTabPt: Wf(e.settings),
13912
13912
  characterSpacingControl: e.settings?.characterSpacingControl,
13913
13913
  mathDefJc: e.settings?.mathDefJc,
13914
- documentHasEastAsianText: px(e.body),
13914
+ documentHasEastAsianText: mx(e.body),
13915
13915
  normalStyleFontSizePt: t.normalStyleFontSizePt,
13916
13916
  compat: {
13917
13917
  adjustLineHeightInTable: e.settings?.adjustLineHeightInTable ?? !1,
@@ -13929,7 +13929,7 @@ function mx(e, t = { normalStyleFontSizePt: 10 }) {
13929
13929
  }
13930
13930
  };
13931
13931
  }
13932
- function hx(e) {
13932
+ function gx(e) {
13933
13933
  let t = e.pageWidth - e.marginLeft - e.marginRight, n = e.columns;
13934
13934
  if (!n || n.count <= 1) return [{
13935
13935
  xPt: e.marginLeft,
@@ -13949,7 +13949,7 @@ function hx(e) {
13949
13949
  wPt: r
13950
13950
  }));
13951
13951
  }
13952
- function gx(e) {
13952
+ function _x(e) {
13953
13953
  switch (e) {
13954
13954
  case "lines":
13955
13955
  case "linesAndChars":
@@ -13957,21 +13957,21 @@ function gx(e) {
13957
13957
  default: return "none";
13958
13958
  }
13959
13959
  }
13960
- function _x(e) {
13960
+ function vx(e) {
13961
13961
  return e === void 0 ? {} : { cjkClosingMarkHang: e };
13962
13962
  }
13963
- function vx(e) {
13963
+ function yx(e) {
13964
13964
  if (e.cjkClosingMarkHang === void 0) return e;
13965
13965
  let { cjkClosingMarkHang: t, ...n } = e;
13966
13966
  return n;
13967
13967
  }
13968
- function yx(e) {
13968
+ function bx(e) {
13969
13969
  return e === "lines" || e === "linesAndChars" || e === "snapToChars";
13970
13970
  }
13971
- function bx(e) {
13971
+ function xx(e) {
13972
13972
  return e === "linesAndChars" || e === "snapToChars";
13973
13973
  }
13974
- function xx(e, t, n) {
13974
+ function Sx(e, t, n) {
13975
13975
  return {
13976
13976
  geometry: {
13977
13977
  pageWidth: t.pageWidth,
@@ -13983,10 +13983,10 @@ function xx(e, t, n) {
13983
13983
  headerDistance: t.headerDistance,
13984
13984
  footerDistance: t.footerDistance
13985
13985
  },
13986
- columns: hx(t),
13986
+ columns: gx(t),
13987
13987
  columnSeparator: t.columns?.sep === !0,
13988
13988
  grid: {
13989
- kind: gx(t.docGridType),
13989
+ kind: _x(t.docGridType),
13990
13990
  linePitchPt: t.docGridLinePitch ?? null,
13991
13991
  charSpacePt: t.docGridCharSpace == null ? null : t.docGridCharSpace / 4096
13992
13992
  },
@@ -13997,11 +13997,11 @@ function xx(e, t, n) {
13997
13997
  lineNumbering: t.lineNumbering ?? void 0
13998
13998
  };
13999
13999
  }
14000
- function Sx(e) {
14000
+ function Cx(e) {
14001
14001
  return e.containers.some((e) => e.kind === "tableCell");
14002
14002
  }
14003
- function Cx(e, t, n, r) {
14004
- let i = yx(t.grid.kind) && t.grid.linePitchPt != null && t.grid.linePitchPt > 0 && r.snapToGrid !== !1 && r.lineSpacing?.rule !== "exact" && (!Sx(n) || e.compat.adjustLineHeightInTable), a = bx(t.grid.kind), o = r.bidi === !0, s = ml(e, t, n, r), c = Sx(n), l = a ? e.normalStyleFontSizePt + (t.grid.charSpacePt ?? 0) : null, u = t.grid.kind === "linesAndChars" && qs(e.compat.compatibilityMode) ? l : null, d = r.numbering, f = d != null && (d.text !== "" || d.picBulletImagePath != null), p = o && f && (d.suff || "tab") === "tab" && r.indentFirst < 0;
14003
+ function wx(e, t, n, r) {
14004
+ let i = bx(t.grid.kind) && t.grid.linePitchPt != null && t.grid.linePitchPt > 0 && r.snapToGrid !== !1 && r.lineSpacing?.rule !== "exact" && (!Cx(n) || e.compat.adjustLineHeightInTable), a = xx(t.grid.kind), o = r.bidi === !0, s = ml(e, t, n, r), c = Cx(n), l = a ? e.normalStyleFontSizePt + (t.grid.charSpacePt ?? 0) : null, u = t.grid.kind === "linesAndChars" && qs(e.compat.compatibilityMode) ? l : null, d = r.numbering, f = d != null && (d.text !== "" || d.picBulletImagePath != null), p = o && f && (d.suff || "tab") === "tab" && r.indentFirst < 0;
14005
14005
  return {
14006
14006
  lineGrid: {
14007
14007
  active: i,
@@ -14026,21 +14026,21 @@ function Cx(e, t, n, r) {
14026
14026
  baseRtl: o,
14027
14027
  isJustified: gu(r.alignment),
14028
14028
  stretchLastLine: _u(r.alignment),
14029
- tabStops: wx(r),
14030
- hasRuby: dx(r),
14031
- hasEastAsianText: fx(r),
14029
+ tabStops: Tx(r),
14030
+ hasRuby: fx(r),
14031
+ hasEastAsianText: px(r),
14032
14032
  kinsoku: s ? pl(e.kinsoku) : e.kinsoku,
14033
14033
  ...s ? { documentKinsoku: e.kinsoku } : {},
14034
- ...Ex(gl(e, r, s)),
14034
+ ...Dx(gl(e, r, s)),
14035
14035
  defaultTabPt: e.defaultTabPt,
14036
14036
  overflowPunct: r.overflowPunct !== !1,
14037
- ..._x(Cc(r.alignment, n.closingMarkHangAdmitted === !0 && r.framePr == null && r.overflowPunct !== !1 && !o && t.textDirection === "lrTb" && t.sectionFlow === void 0 && (!yx(t.grid.kind) && !a || s && r.kinsoku === !1), c, r.kinsoku === !1, e.compat.compatibilityMode, e.kinsoku.enabled, s)),
14037
+ ...vx(Cc(r.alignment, n.closingMarkHangAdmitted === !0 && r.framePr == null && r.overflowPunct !== !1 && !o && t.textDirection === "lrTb" && t.sectionFlow === void 0 && (!bx(t.grid.kind) && !a || s && r.kinsoku === !1), c, r.kinsoku === !1, e.compat.compatibilityMode, e.kinsoku.enabled, s)),
14038
14038
  ...r.wordWrap === !1 ? { wordWrap: !1 } : {},
14039
14039
  ...r.endsAtHardBreak === !0 ? { endsAtHardBreak: !0 } : {},
14040
14040
  mathDefJc: e.mathDefJc
14041
14041
  };
14042
14042
  }
14043
- function wx(e) {
14043
+ function Tx(e) {
14044
14044
  let t = e.tabStops.filter((e) => e.alignment !== "clear").map((e) => ({ ...e })), n = e.indentLeft, r = t.some((e) => e.pos === n && Ys(e.alignment));
14045
14045
  return (e.indentFirst < 0 && !r ? [{
14046
14046
  pos: n,
@@ -14048,26 +14048,26 @@ function wx(e) {
14048
14048
  leader: "none"
14049
14049
  }, ...t] : t).sort((e, t) => e.pos - t.pos);
14050
14050
  }
14051
- function Tx(e, t) {
14051
+ function Ex(e, t) {
14052
14052
  let { pitchPt: n, paragraphAllowsAdjustment: r } = e.rightIndentGrid;
14053
14053
  return !r || n == null ? 0 : Js(t, n);
14054
14054
  }
14055
- function Ex(e) {
14055
+ function Dx(e) {
14056
14056
  return e ? { lineEdgeRules: e } : {};
14057
14057
  }
14058
- function Dx(e) {
14058
+ function Ox(e) {
14059
14059
  return e ?? 18;
14060
14060
  }
14061
- function Ox(e, t, n) {
14061
+ function kx(e, t, n) {
14062
14062
  return e + t - n;
14063
14063
  }
14064
- function kx(e) {
14064
+ function Ax(e) {
14065
14065
  return !e.hasContinuationBoundary && e.inkless && e.undecorated && !e.keepNext && e.markReservePt === 0 && e.pageBottomIsUnreserved && e.physicalRegionBottomIsActive ? e.followsNextPageSectionBoundary ? Math.max(0, e.markExtentPt) : e.markOnLineGrid ? e.hasFollowingInk ? e.markGridAfterLeadingPt ?? 0 : 0 : e.hasFollowingInk ? e.markBelowBaselinePt : 0 : 0;
14066
14066
  }
14067
- function Ax() {
14067
+ function jx() {
14068
14068
  return "right";
14069
14069
  }
14070
- function jx(e) {
14070
+ function Mx(e) {
14071
14071
  if (e.sectionOccurrenceId.length === 0) throw RangeError("Section occurrence id must not be empty");
14072
14072
  if (e.columns.length === 0) throw RangeError("A page-flow section requires at least one column");
14073
14073
  return Object.freeze({
@@ -14084,16 +14084,16 @@ function jx(e) {
14084
14084
  })
14085
14085
  });
14086
14086
  }
14087
- function Mx(e) {
14088
- return Px(e.geometry.marginTop);
14089
- }
14090
14087
  function Nx(e) {
14091
- return e.geometry.pageHeight - Px(e.geometry.marginBottom);
14088
+ return Fx(e.geometry.marginTop);
14092
14089
  }
14093
14090
  function Px(e) {
14091
+ return e.geometry.pageHeight - Fx(e.geometry.marginBottom);
14092
+ }
14093
+ function Fx(e) {
14094
14094
  return Math.abs(e);
14095
14095
  }
14096
- function Fx(e, t) {
14096
+ function Ix(e, t) {
14097
14097
  if (t != null) {
14098
14098
  let t = Ps(js("sideways-lr", {
14099
14099
  widthPt: e.pageWidth,
@@ -14126,7 +14126,7 @@ function Fx(e, t) {
14126
14126
  footerDistance: e.footerDistance
14127
14127
  };
14128
14128
  }
14129
- function Ix(e, t) {
14129
+ function Lx(e, t) {
14130
14130
  if (t != null) {
14131
14131
  let t = Ps(As("sideways-lr", {
14132
14132
  widthPt: e.pageHeight,
@@ -14159,13 +14159,13 @@ function Ix(e, t) {
14159
14159
  footerDistance: e.footerDistance
14160
14160
  };
14161
14161
  }
14162
- function Lx(e) {
14162
+ function Rx(e) {
14163
14163
  return e === "tbRl" || e === "tbRlV" || e === "tbLrV" || e === "btLr";
14164
14164
  }
14165
- function Rx(e, t) {
14165
+ function zx(e, t) {
14166
14166
  if (!Number.isInteger(t) || t < 0) throw RangeError("Physical page index must be a non-negative integer");
14167
14167
  let { pageWidth: n, pageHeight: r } = e.physicalGeometry, { marginTop: i, marginRight: a, marginBottom: o, marginLeft: s } = e.physicalGeometry, c = e.bookFoldPrinting || e.bookFoldRevPrinting;
14168
- return c ? (n /= 2, Ax() === "right" && (a += e.gutterPt)) : e.printTwoOnOne ? (r /= 2, i += e.gutterPt) : e.gutterAtTop && !e.mirrorMargins ? i += e.gutterPt : e.rtlGutter ? a += e.gutterPt : s += e.gutterPt, !c && !e.printTwoOnOne && e.mirrorMargins && t % 2 == 1 && ([s, a] = [a, s]), {
14168
+ return c ? (n /= 2, jx() === "right" && (a += e.gutterPt)) : e.printTwoOnOne ? (r /= 2, i += e.gutterPt) : e.gutterAtTop && !e.mirrorMargins ? i += e.gutterPt : e.rtlGutter ? a += e.gutterPt : s += e.gutterPt, !c && !e.printTwoOnOne && e.mirrorMargins && t % 2 == 1 && ([s, a] = [a, s]), {
14169
14169
  ...e.physicalGeometry,
14170
14170
  pageWidth: n,
14171
14171
  pageHeight: r,
@@ -14175,12 +14175,12 @@ function Rx(e, t) {
14175
14175
  marginLeft: s
14176
14176
  };
14177
14177
  }
14178
- function zx(e, t, n) {
14179
- let r = Rx(t, n), i = Lx(t.textDirection) ? Fx(r, e.sectionFlow) : r;
14178
+ function Bx(e, t, n) {
14179
+ let r = zx(t, n), i = Rx(t.textDirection) ? Ix(r, e.sectionFlow) : r;
14180
14180
  return Object.freeze({
14181
14181
  ...e,
14182
14182
  geometry: Object.freeze(i),
14183
- columns: Object.freeze(hx({
14183
+ columns: Object.freeze(gx({
14184
14184
  ...i,
14185
14185
  titlePage: !1,
14186
14186
  evenAndOddHeaders: !1,
@@ -14188,7 +14188,7 @@ function zx(e, t, n) {
14188
14188
  }).map((e) => Object.freeze(e)))
14189
14189
  });
14190
14190
  }
14191
- function Bx(e) {
14191
+ function Vx(e) {
14192
14192
  return {
14193
14193
  pageWidth: e.pageWidth,
14194
14194
  pageHeight: e.pageHeight,
@@ -14200,7 +14200,7 @@ function Bx(e) {
14200
14200
  footerDistance: e.footerDistance
14201
14201
  };
14202
14202
  }
14203
- function Vx() {
14203
+ function Hx() {
14204
14204
  return {
14205
14205
  pageWidth: 612,
14206
14206
  pageHeight: 792,
@@ -14212,11 +14212,11 @@ function Vx() {
14212
14212
  footerDistance: 36
14213
14213
  };
14214
14214
  }
14215
- function Hx(e, t = !1, n) {
14215
+ function Ux(e, t = !1, n) {
14216
14216
  let r = e.docGridType === "lines" || e.docGridType === "linesAndChars" || e.docGridType === "snapToChars" ? e.docGridType : "none";
14217
14217
  return Object.freeze({
14218
- geometry: Object.freeze(Bx(e)),
14219
- columns: Object.freeze(hx(e).map((e) => Object.freeze(e))),
14218
+ geometry: Object.freeze(Vx(e)),
14219
+ columns: Object.freeze(gx(e).map((e) => Object.freeze(e))),
14220
14220
  columnSeparator: e.columns?.sep === !0,
14221
14221
  grid: Object.freeze({
14222
14222
  kind: r,
@@ -14230,52 +14230,52 @@ function Hx(e, t = !1, n) {
14230
14230
  ...e.lineNumbering === null || e.lineNumbering === void 0 ? {} : { lineNumbering: Object.freeze({ ...e.lineNumbering }) }
14231
14231
  });
14232
14232
  }
14233
- function Ux(e, t) {
14233
+ function Wx(e, t) {
14234
14234
  switch (e.display) {
14235
14235
  case "firstPage": return t;
14236
14236
  case "notFirstPage": return !t;
14237
14237
  default: return !0;
14238
14238
  }
14239
14239
  }
14240
- function Wx(e) {
14240
+ function Gx(e) {
14241
14241
  return e !== void 0 && /^[0-9a-fA-F]{6}$/.test(e) ? `#${e}` : "#000000";
14242
14242
  }
14243
- function Gx(e) {
14243
+ function Kx(e) {
14244
14244
  return e !== void 0 && Number.isFinite(e.space) ? e.space : 0;
14245
14245
  }
14246
- function Kx(e, t, n, r) {
14246
+ function qx(e, t, n, r) {
14247
14247
  let i = Number.isFinite(e.width) ? e.width : .5;
14248
14248
  return Object.freeze({
14249
14249
  edge: t,
14250
14250
  from: Object.freeze(n),
14251
14251
  to: Object.freeze(r),
14252
- color: Wx(e.color),
14252
+ color: Gx(e.color),
14253
14253
  widthPt: i,
14254
14254
  ...Rs(e.style, i)
14255
14255
  });
14256
14256
  }
14257
- function qx(e, t, n, r) {
14258
- if (!e || !Ux(e, r)) return null;
14259
- let { geometry: i } = t, a = e.offsetFrom === "text", o = a ? i.marginLeft : 0, s = a ? i.pageWidth - i.marginRight : i.pageWidth, c = a ? Px(i.marginTop) : 0, l = a ? i.pageHeight - Px(i.marginBottom) : i.pageHeight, u = c + Gx(e.top), d = l - Gx(e.bottom), f = o + Gx(e.left), p = s - Gx(e.right), m = [];
14260
- if (e.top && m.push(Kx(e.top, "top", {
14257
+ function Jx(e, t, n, r) {
14258
+ if (!e || !Wx(e, r)) return null;
14259
+ let { geometry: i } = t, a = e.offsetFrom === "text", o = a ? i.marginLeft : 0, s = a ? i.pageWidth - i.marginRight : i.pageWidth, c = a ? Fx(i.marginTop) : 0, l = a ? i.pageHeight - Fx(i.marginBottom) : i.pageHeight, u = c + Kx(e.top), d = l - Kx(e.bottom), f = o + Kx(e.left), p = s - Kx(e.right), m = [];
14260
+ if (e.top && m.push(qx(e.top, "top", {
14261
14261
  xPt: f,
14262
14262
  yPt: u
14263
14263
  }, {
14264
14264
  xPt: p,
14265
14265
  yPt: u
14266
- })), e.bottom && m.push(Kx(e.bottom, "bottom", {
14266
+ })), e.bottom && m.push(qx(e.bottom, "bottom", {
14267
14267
  xPt: f,
14268
14268
  yPt: d
14269
14269
  }, {
14270
14270
  xPt: p,
14271
14271
  yPt: d
14272
- })), e.left && m.push(Kx(e.left, "left", {
14272
+ })), e.left && m.push(qx(e.left, "left", {
14273
14273
  xPt: f,
14274
14274
  yPt: u
14275
14275
  }, {
14276
14276
  xPt: f,
14277
14277
  yPt: d
14278
- })), e.right && m.push(Kx(e.right, "right", {
14278
+ })), e.right && m.push(qx(e.right, "right", {
14279
14279
  xPt: p,
14280
14280
  yPt: u
14281
14281
  }, {
@@ -14289,11 +14289,11 @@ function qx(e, t, n, r) {
14289
14289
  segments: Object.freeze(m)
14290
14290
  });
14291
14291
  }
14292
- function Jx(e, t, n) {
14292
+ function Yx(e, t, n) {
14293
14293
  return `page:${e}:region:${encodeURIComponent(t)}:column:${n}`;
14294
14294
  }
14295
- function Yx(e) {
14296
- return Xx(e), {
14295
+ function Xx(e) {
14296
+ return Zx(e), {
14297
14297
  xPt: 0,
14298
14298
  yPt: 0,
14299
14299
  widthPt: e.widthPt,
@@ -14302,29 +14302,29 @@ function Yx(e) {
14302
14302
  contentBottomPt: e.contentBottomPt
14303
14303
  };
14304
14304
  }
14305
- function Xx(e) {
14305
+ function Zx(e) {
14306
14306
  if (!Number.isFinite(e.widthPt) || !Number.isFinite(e.heightPt) || !Number.isFinite(e.contentTopPt) || !Number.isFinite(e.contentBottomPt) || e.widthPt <= 0 || e.heightPt <= 0 || e.contentTopPt < 0 || e.contentTopPt > e.contentBottomPt || e.contentBottomPt > e.heightPt) throw RangeError("Effective page edges must satisfy 0 <= contentTopPt <= contentBottomPt <= heightPt");
14307
14307
  }
14308
- function Zx(e, t) {
14308
+ function Qx(e, t) {
14309
14309
  if (e.length === 0) throw RangeError(`${t} must not be empty`);
14310
14310
  }
14311
- function Qx(e, t) {
14311
+ function $x(e, t) {
14312
14312
  if (e && t === void 0) throw RangeError("Page-border finalization requires explicit section-owned page identity");
14313
14313
  return t ?? !1;
14314
14314
  }
14315
- function $x(e, t) {
14315
+ function eS(e, t) {
14316
14316
  return e.length === t.length && e.every((e, n) => {
14317
14317
  let r = t[n];
14318
14318
  return r !== void 0 && e.xPt === r.xPt && e.wPt === r.wPt;
14319
14319
  });
14320
14320
  }
14321
- function eS(e, t) {
14321
+ function tS(e, t) {
14322
14322
  return e === t || e !== void 0 && t !== void 0 && e.start === t.start && e.countBy === t.countBy && e.distance === t.distance && e.restart === t.restart;
14323
14323
  }
14324
- function tS(e, t) {
14325
- return e.geometry.pageWidth === t.geometry.pageWidth && e.geometry.pageHeight === t.geometry.pageHeight && e.geometry.marginTop === t.geometry.marginTop && e.geometry.marginRight === t.geometry.marginRight && e.geometry.marginBottom === t.geometry.marginBottom && e.geometry.marginLeft === t.geometry.marginLeft && e.geometry.headerDistance === t.geometry.headerDistance && e.geometry.footerDistance === t.geometry.footerDistance && $x(e.columns, t.columns) && e.columnSeparator === t.columnSeparator && e.textDirection === t.textDirection && (e.sectionFlow ?? null) === (t.sectionFlow ?? null) && e.sectionBidi === !0 == (t.sectionBidi === !0) && e.grid.kind === t.grid.kind && e.grid.linePitchPt === t.grid.linePitchPt && e.grid.charSpacePt === t.grid.charSpacePt && e.verticalAlignment === t.verticalAlignment && eS(e.lineNumbering, t.lineNumbering);
14324
+ function nS(e, t) {
14325
+ return e.geometry.pageWidth === t.geometry.pageWidth && e.geometry.pageHeight === t.geometry.pageHeight && e.geometry.marginTop === t.geometry.marginTop && e.geometry.marginRight === t.geometry.marginRight && e.geometry.marginBottom === t.geometry.marginBottom && e.geometry.marginLeft === t.geometry.marginLeft && e.geometry.headerDistance === t.geometry.headerDistance && e.geometry.footerDistance === t.geometry.footerDistance && eS(e.columns, t.columns) && e.columnSeparator === t.columnSeparator && e.textDirection === t.textDirection && (e.sectionFlow ?? null) === (t.sectionFlow ?? null) && e.sectionBidi === !0 == (t.sectionBidi === !0) && e.grid.kind === t.grid.kind && e.grid.linePitchPt === t.grid.linePitchPt && e.grid.charSpacePt === t.grid.charSpacePt && e.verticalAlignment === t.verticalAlignment && tS(e.lineNumbering, t.lineNumbering);
14326
14326
  }
14327
- function nS(e) {
14327
+ function rS(e) {
14328
14328
  if (Cs(e.section) !== e.writingMode) throw RangeError("Section region writing mode must agree with its section text direction");
14329
14329
  let t = e.section.sectionBidi === !0 ? "rtl" : "ltr";
14330
14330
  if (e.columnFlowDirection !== void 0 && e.columnFlowDirection !== t) throw RangeError("Section region column flow direction must agree with sectPr bidi");
@@ -14334,15 +14334,15 @@ function nS(e) {
14334
14334
  return i === void 0 || t.inlineStartPt !== i.xPt || t.inlineExtentPt !== i.wPt;
14335
14335
  })) throw RangeError("Section region columns must equal its normalized section columns");
14336
14336
  }
14337
- function rS(e) {
14337
+ function iS(e) {
14338
14338
  if (!Number.isInteger(e) || e < 0) throw RangeError("Layout page index must be a non-negative integer");
14339
14339
  }
14340
- function iS(e, t, n) {
14340
+ function aS(e, t, n) {
14341
14341
  let r = [], i = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c, l = [];
14342
14342
  for (let u of n) {
14343
- if (Zx(u.id, "Section region id"), Zx(u.sectionOccurrenceId, "Section occurrence id"), o.has(u.id) || s.has(u.sectionOccurrenceId)) throw RangeError("Section region and occurrence identities must be unique");
14343
+ if (Qx(u.id, "Section region id"), Qx(u.sectionOccurrenceId, "Section occurrence id"), o.has(u.id) || s.has(u.sectionOccurrenceId)) throw RangeError("Section region and occurrence identities must be unique");
14344
14344
  if (o.add(u.id), s.add(u.sectionOccurrenceId), c !== void 0 && c !== u.writingMode) throw RangeError("One physical page cannot mix writing modes");
14345
- c = u.writingMode, nS(u);
14345
+ c = u.writingMode, rS(u);
14346
14346
  let n = ks({
14347
14347
  widthPt: u.section.geometry.pageWidth,
14348
14348
  heightPt: u.section.geometry.pageHeight
@@ -14355,7 +14355,7 @@ function iS(e, t, n) {
14355
14355
  let r = m[n];
14356
14356
  if (!Number.isFinite(t.inlineStartPt) || !Number.isFinite(t.inlineExtentPt) || t.inlineStartPt < 0 || t.inlineExtentPt <= 0 || t.inlineStartPt + t.inlineExtentPt > f || t.inlineStartPt < h) throw RangeError("Columns must be ordered, disjoint, and inside the logical page");
14357
14357
  h = t.inlineStartPt + t.inlineExtentPt;
14358
- let o = Jx(e, u.id, r);
14358
+ let o = Yx(e, u.id, r);
14359
14359
  if (a.has(o)) throw RangeError(`Duplicate flow domain ${o}`);
14360
14360
  let s = {
14361
14361
  xPt: t.inlineStartPt,
@@ -14389,28 +14389,28 @@ function iS(e, t, n) {
14389
14389
  sectionByDomain: a
14390
14390
  };
14391
14391
  }
14392
- function aS(e, t) {
14392
+ function oS(e, t) {
14393
14393
  if (e.kind === "paragraph") {
14394
- t(e), e.drawings.forEach((e) => aS(e, t)), e.textBoxes.forEach((e) => aS(e, t));
14394
+ t(e), e.drawings.forEach((e) => oS(e, t)), e.textBoxes.forEach((e) => oS(e, t));
14395
14395
  return;
14396
14396
  }
14397
14397
  if (e.kind === "table") {
14398
- oS(e, t);
14398
+ sS(e, t);
14399
14399
  return;
14400
14400
  }
14401
- e.kind === "textbox" && sS(e, t);
14402
- }
14403
- function oS(e, t) {
14404
- for (let n of e.rows) for (let e of n.cells) for (let n of e.blocks) aS(n.layout, t);
14401
+ e.kind === "textbox" && cS(e, t);
14405
14402
  }
14406
14403
  function sS(e, t) {
14407
- e.story.blocks.forEach((e) => aS(e, t));
14404
+ for (let n of e.rows) for (let e of n.cells) for (let n of e.blocks) oS(n.layout, t);
14405
+ }
14406
+ function cS(e, t) {
14407
+ e.story.blocks.forEach((e) => oS(e, t));
14408
14408
  }
14409
- function cS(e, t, n) {
14409
+ function lS(e, t, n) {
14410
14410
  let r = [], i = /* @__PURE__ */ new Set();
14411
14411
  for (let a of e) {
14412
14412
  let e = n.get(a.flowDomainId) ?? t;
14413
- aS(a, (t) => {
14413
+ oS(a, (t) => {
14414
14414
  for (let n of t.bookmarkStarts ?? []) !n || i.has(n) || (i.add(n), r.push({
14415
14415
  name: n,
14416
14416
  nodeId: t.id,
@@ -14420,7 +14420,7 @@ function cS(e, t, n) {
14420
14420
  }
14421
14421
  return r;
14422
14422
  }
14423
- function lS(e) {
14423
+ function uS(e) {
14424
14424
  let t = e.sectionRegions ?? [], n = new Map(t.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map();
14425
14425
  for (let e of t) for (let t of e.flowDomainIds) r.set(t, e.sectionOccurrenceId);
14426
14426
  for (let i of e.flowDomains) {
@@ -14430,67 +14430,67 @@ function lS(e) {
14430
14430
  }
14431
14431
  return r;
14432
14432
  }
14433
- function uS(e, t = lS(e)) {
14434
- return cS(ms(e), e.sectionOccurrenceId ?? "", t);
14433
+ function dS(e, t = uS(e)) {
14434
+ return lS(ms(e), e.sectionOccurrenceId ?? "", t);
14435
14435
  }
14436
- function dS(e) {
14436
+ function fS(e) {
14437
14437
  return e.parityBlank ? e : Object.freeze({
14438
14438
  ...e,
14439
- bookmarkStarts: Object.freeze([...uS(e)])
14439
+ bookmarkStarts: Object.freeze([...dS(e)])
14440
14440
  });
14441
14441
  }
14442
- function fS(e) {
14443
- rS(e.pageIndex), Zx(e.sectionOccurrenceId, "Page-start section occurrence id");
14444
- let { regions: t, domains: n, sectionByDomain: r } = iS(e.pageIndex, e.physicalPage, e.sectionRegions), i = e.sectionRegions[0], a = i?.pageBorders ?? e.pageBorders;
14445
- if (i !== void 0 && (e.sectionOccurrenceId !== i.sectionOccurrenceId || !tS(e.section, i.section))) throw RangeError("Page-start section context must equal the first section region");
14442
+ function pS(e) {
14443
+ iS(e.pageIndex), Qx(e.sectionOccurrenceId, "Page-start section occurrence id");
14444
+ let { regions: t, domains: n, sectionByDomain: r } = aS(e.pageIndex, e.physicalPage, e.sectionRegions), i = e.sectionRegions[0], a = i?.pageBorders ?? e.pageBorders;
14445
+ if (i !== void 0 && (e.sectionOccurrenceId !== i.sectionOccurrenceId || !nS(e.section, i.section))) throw RangeError("Page-start section context must equal the first section region");
14446
14446
  return {
14447
14447
  pageIndex: e.pageIndex,
14448
- geometry: Yx(e.physicalPage),
14448
+ geometry: Xx(e.physicalPage),
14449
14449
  flowDomains: n,
14450
14450
  section: e.section,
14451
14451
  sectionOccurrenceId: e.sectionOccurrenceId,
14452
14452
  parityBlank: !1,
14453
- bookmarkStarts: cS(e.paint.map(({ node: e }) => e), e.sectionOccurrenceId, r),
14453
+ bookmarkStarts: lS(e.paint.map(({ node: e }) => e), e.sectionOccurrenceId, r),
14454
14454
  pageNumber: e.pageNumber,
14455
14455
  sectionRegions: t,
14456
14456
  columnSeparators: Ls(t),
14457
- pageBorder: qx(a, e.section, e.physicalPage, Qx(a, e.firstSectionOwnedPage)),
14457
+ pageBorder: Jx(a, e.section, e.physicalPage, $x(a, e.firstSectionOwnedPage)),
14458
14458
  layers: ds(e.paint),
14459
14459
  readingOrder: e.readingOrder.map((e) => e.id)
14460
14460
  };
14461
14461
  }
14462
- function pS(e) {
14463
- return rS(e.pageIndex), Zx(e.sectionOccurrenceId, "Page-start section occurrence id"), Xx(e.physicalPage), Object.freeze({
14462
+ function mS(e) {
14463
+ return iS(e.pageIndex), Qx(e.sectionOccurrenceId, "Page-start section occurrence id"), Zx(e.physicalPage), Object.freeze({
14464
14464
  ...e,
14465
14465
  sectionRegions: Object.freeze([]),
14466
14466
  paint: Object.freeze([]),
14467
14467
  readingOrder: Object.freeze([])
14468
14468
  });
14469
14469
  }
14470
- function mS(e, t) {
14470
+ function hS(e, t) {
14471
14471
  return Object.freeze({
14472
14472
  ...e,
14473
14473
  sectionRegions: Object.freeze([...e.sectionRegions, t])
14474
14474
  });
14475
14475
  }
14476
- function hS(e, t, n) {
14476
+ function gS(e, t, n) {
14477
14477
  return Object.freeze({
14478
14478
  ...e,
14479
14479
  paint: Object.freeze([...e.paint, t]),
14480
14480
  readingOrder: n ? Object.freeze([...e.readingOrder, t.node]) : e.readingOrder
14481
14481
  });
14482
14482
  }
14483
- function gS(e, t, n) {
14484
- return fS({
14483
+ function _S(e, t, n) {
14484
+ return pS({
14485
14485
  ...e,
14486
14486
  pageNumber: t,
14487
14487
  firstSectionOwnedPage: n
14488
14488
  });
14489
14489
  }
14490
- function _S(e) {
14491
- return rS(e.pageIndex), Zx(e.sectionOccurrenceId, "Page-start section occurrence id"), {
14490
+ function vS(e) {
14491
+ return iS(e.pageIndex), Qx(e.sectionOccurrenceId, "Page-start section occurrence id"), {
14492
14492
  pageIndex: e.pageIndex,
14493
- geometry: Yx(e.physicalPage),
14493
+ geometry: Xx(e.physicalPage),
14494
14494
  flowDomains: [],
14495
14495
  section: e.section,
14496
14496
  sectionOccurrenceId: e.sectionOccurrenceId,
@@ -14499,12 +14499,12 @@ function _S(e) {
14499
14499
  pageNumber: e.pageNumber,
14500
14500
  sectionRegions: [],
14501
14501
  columnSeparators: [],
14502
- pageBorder: qx(e.pageBorders, e.section, e.physicalPage, Qx(e.pageBorders, e.firstSectionOwnedPage)),
14502
+ pageBorder: Jx(e.pageBorders, e.section, e.physicalPage, $x(e.pageBorders, e.firstSectionOwnedPage)),
14503
14503
  layers: ds([]),
14504
14504
  readingOrder: []
14505
14505
  };
14506
14506
  }
14507
- function vS(e) {
14507
+ function yS(e) {
14508
14508
  if (e.length === 0) return null;
14509
14509
  let t = Math.min(...e.map((e) => e.xPt)), n = Math.min(...e.map((e) => e.yPt)), r = Math.max(...e.map((e) => e.xPt + e.widthPt)), i = Math.max(...e.map((e) => e.yPt + e.heightPt));
14510
14510
  return {
@@ -14514,7 +14514,7 @@ function vS(e) {
14514
14514
  heightPt: i - n
14515
14515
  };
14516
14516
  }
14517
- var yS = NaN, bS = {
14517
+ var bS = NaN, xS = {
14518
14518
  FLOW_OVERLAP: !0,
14519
14519
  BOTTOM_MARGIN_INVASION: !0,
14520
14520
  FLOW_DOMAIN_INVASION: !0,
@@ -14524,56 +14524,56 @@ var yS = NaN, bS = {
14524
14524
  MISSING_RESOURCE: !0,
14525
14525
  NON_CONVERGENCE: !0,
14526
14526
  UNSUPPORTED_FEATURE: !0
14527
- }, xS = {
14527
+ }, SS = {
14528
14528
  body: !0,
14529
14529
  header: !0,
14530
14530
  footer: !0,
14531
14531
  footnote: !0,
14532
14532
  endnote: !0,
14533
14533
  textbox: !0
14534
- }, SS = new Set(Object.keys(bS)), CS = new Set(Object.keys(xS));
14535
- function wS(e, t) {
14534
+ }, CS = new Set(Object.keys(xS)), wS = new Set(Object.keys(SS));
14535
+ function TS(e, t) {
14536
14536
  let n = e;
14537
14537
  for (let e of t) n += typeof e == "number" ? `[${e}]` : `.${e}`;
14538
14538
  return n;
14539
14539
  }
14540
- function TS(e, t, n = /* @__PURE__ */ new WeakSet(), r = !1) {
14540
+ function ES(e, t, n = /* @__PURE__ */ new WeakSet(), r = !1) {
14541
14541
  let i = [], a = /* @__PURE__ */ new Set(), o = (e, r) => {
14542
14542
  if (!(e === null || typeof e == "string" || typeof e == "boolean")) {
14543
14543
  if (typeof e == "number") {
14544
- if (!Number.isFinite(e)) throw new J("INVALID_GEOMETRY", `${wS(t, i)} is not finite`);
14544
+ if (!Number.isFinite(e)) throw new J("INVALID_GEOMETRY", `${TS(t, i)} is not finite`);
14545
14545
  return;
14546
14546
  }
14547
- if (typeof e != "object") throw new J("INVALID_GEOMETRY", `${wS(t, i)} contains ${typeof e}`);
14547
+ if (typeof e != "object") throw new J("INVALID_GEOMETRY", `${TS(t, i)} contains ${typeof e}`);
14548
14548
  if (!a.has(e)) {
14549
- if (n.has(e)) throw new J("INVALID_GEOMETRY", `${wS(t, i)} contains a cycle`);
14549
+ if (n.has(e)) throw new J("INVALID_GEOMETRY", `${TS(t, i)} contains a cycle`);
14550
14550
  n.add(e);
14551
14551
  try {
14552
14552
  if (Array.isArray(e)) {
14553
14553
  let n = 0;
14554
14554
  for (let a of Reflect.ownKeys(e)) {
14555
14555
  if (a === "length") continue;
14556
- if (typeof a != "string") throw new J("INVALID_GEOMETRY", `${wS(t, i)} has a symbol key`);
14556
+ if (typeof a != "string") throw new J("INVALID_GEOMETRY", `${TS(t, i)} has a symbol key`);
14557
14557
  let s = Number(a);
14558
- if (!Number.isInteger(s) || s < 0 || String(s) !== a || s >= e.length) throw new J("INVALID_GEOMETRY", `${wS(t, i)}.${a} is not an array index`);
14558
+ if (!Number.isInteger(s) || s < 0 || String(s) !== a || s >= e.length) throw new J("INVALID_GEOMETRY", `${TS(t, i)}.${a} is not an array index`);
14559
14559
  let c = Object.getOwnPropertyDescriptor(e, a);
14560
- if (!c?.enumerable || !("value" in c)) throw new J("INVALID_GEOMETRY", `${wS(t, i)}[${a}] is not plain data`);
14560
+ if (!c?.enumerable || !("value" in c)) throw new J("INVALID_GEOMETRY", `${TS(t, i)}[${a}] is not plain data`);
14561
14561
  if (!(r && t === "layout" && i.length === 1 && i[0] === "pages")) {
14562
14562
  let e = c.value;
14563
14563
  e !== null && typeof e != "string" && typeof e != "boolean" && !(typeof e == "number" && Number.isFinite(e)) && (i.push(s), o(e, !1), i.pop());
14564
14564
  }
14565
14565
  n += 1;
14566
14566
  }
14567
- if (n !== e.length) throw new J("INVALID_GEOMETRY", `${wS(t, i)} is sparse`);
14567
+ if (n !== e.length) throw new J("INVALID_GEOMETRY", `${TS(t, i)} is sparse`);
14568
14568
  r || a.add(e);
14569
14569
  return;
14570
14570
  }
14571
14571
  let n = Object.getPrototypeOf(e);
14572
- if (n !== Object.prototype && n !== null) throw new J("INVALID_GEOMETRY", `${wS(t, i)} is not a plain record`);
14572
+ if (n !== Object.prototype && n !== null) throw new J("INVALID_GEOMETRY", `${TS(t, i)} is not a plain record`);
14573
14573
  for (let n of Reflect.ownKeys(e)) {
14574
- if (typeof n != "string") throw new J("INVALID_GEOMETRY", `${wS(t, i)} has a symbol key`);
14574
+ if (typeof n != "string") throw new J("INVALID_GEOMETRY", `${TS(t, i)} has a symbol key`);
14575
14575
  let a = Object.getOwnPropertyDescriptor(e, n);
14576
- if (!a?.enumerable || !("value" in a)) throw new J("INVALID_GEOMETRY", `${wS(t, i)}.${n} is not plain data`);
14576
+ if (!a?.enumerable || !("value" in a)) throw new J("INVALID_GEOMETRY", `${TS(t, i)}.${n} is not plain data`);
14577
14577
  let s = a.value;
14578
14578
  s !== null && typeof s != "string" && typeof s != "boolean" && !(typeof s == "number" && Number.isFinite(s)) && (i.push(n), o(s, r), i.pop());
14579
14579
  }
@@ -14586,7 +14586,7 @@ function TS(e, t, n = /* @__PURE__ */ new WeakSet(), r = !1) {
14586
14586
  };
14587
14587
  o(e, r);
14588
14588
  }
14589
- function ES(e, t) {
14589
+ function Q(e, t) {
14590
14590
  if (!Number.isFinite(e)) throw new J("INVALID_GEOMETRY", `${t} is not finite`);
14591
14591
  }
14592
14592
  function DS(e) {
@@ -14594,10 +14594,10 @@ function DS(e) {
14594
14594
  }
14595
14595
  function OS(e, t) {
14596
14596
  if (!DS(e)) throw new J("INVALID_GEOMETRY", `${t} is not a point`);
14597
- ES(e.xPt, `${t}.xPt`), ES(e.yPt, `${t}.yPt`);
14597
+ Q(e.xPt, `${t}.xPt`), Q(e.yPt, `${t}.yPt`);
14598
14598
  }
14599
14599
  function kS(e, t) {
14600
- if (OS(e, t), ES(e.widthPt, `${t}.widthPt`), ES(e.heightPt, `${t}.heightPt`), e.widthPt < 0 || e.heightPt < 0) throw new J("INVALID_GEOMETRY", `${t} has a negative extent`);
14600
+ if (OS(e, t), Q(e.widthPt, `${t}.widthPt`), Q(e.heightPt, `${t}.heightPt`), e.widthPt < 0 || e.heightPt < 0) throw new J("INVALID_GEOMETRY", `${t} has a negative extent`);
14601
14601
  }
14602
14602
  function AS(e, t) {
14603
14603
  if (!DS(e)) throw new J("INVALID_GEOMETRY", `${t} is not a matrix`);
@@ -14608,7 +14608,7 @@ function AS(e, t) {
14608
14608
  "d",
14609
14609
  "e",
14610
14610
  "f"
14611
- ]) ES(e[n], `${t}.${n}`);
14611
+ ]) Q(e[n], `${t}.${n}`);
14612
14612
  }
14613
14613
  function jS(e, t) {
14614
14614
  if (e !== "horizontal-tb" && e !== "vertical-rl" && e !== "vertical-lr" && e !== "sideways-lr") throw new J("INVALID_GEOMETRY", `${t} is unsupported`);
@@ -14619,24 +14619,24 @@ function MS(e, t) {
14619
14619
  }
14620
14620
  function NS(e, t) {
14621
14621
  let { plan: n } = e;
14622
- TS(n, `${t}.plan`);
14622
+ ES(n, `${t}.plan`);
14623
14623
  try {
14624
14624
  Pt(n, 1);
14625
14625
  } catch (e) {
14626
14626
  throw new J("INVALID_GEOMETRY", `${t}.plan: ${e instanceof Error ? e.message : "invalid retained DrawingML geometry"}`);
14627
14627
  }
14628
- if (ES(n.rect.x, `${t}.plan.rect.x`), ES(n.rect.y, `${t}.plan.rect.y`), ES(n.rect.w, `${t}.plan.rect.w`), ES(n.rect.h, `${t}.plan.rect.h`), n.rect.w < 0 || n.rect.h < 0) throw new J("INVALID_GEOMETRY", `${t}.plan.rect has a negative extent`);
14629
- if (ES(n.transform.rotationDeg, `${t}.plan.transform.rotationDeg`), n.geometry.kind === "preset") {
14628
+ if (Q(n.rect.x, `${t}.plan.rect.x`), Q(n.rect.y, `${t}.plan.rect.y`), Q(n.rect.w, `${t}.plan.rect.w`), Q(n.rect.h, `${t}.plan.rect.h`), n.rect.w < 0 || n.rect.h < 0) throw new J("INVALID_GEOMETRY", `${t}.plan.rect has a negative extent`);
14629
+ if (Q(n.transform.rotationDeg, `${t}.plan.transform.rotationDeg`), n.geometry.kind === "preset") {
14630
14630
  if (n.geometry.name.length === 0) throw new J("INVALID_GEOMETRY", `${t}.plan.geometry.name is empty`);
14631
14631
  n.geometry.adjustments.forEach((e, n) => {
14632
- e !== null && ES(e, `${t}.plan.geometry.adjustments[${n}]`);
14632
+ e !== null && Q(e, `${t}.plan.geometry.adjustments[${n}]`);
14633
14633
  });
14634
14634
  } else n.geometry.subpaths.forEach((e, n) => {
14635
14635
  e.forEach((e, r) => {
14636
14636
  if (e.cmd.length === 0) throw new J("INVALID_GEOMETRY", `${t}.plan.geometry.subpaths[${n}][${r}].cmd is empty`);
14637
14637
  });
14638
14638
  });
14639
- if (n.stroke && (ES(n.stroke.width, `${t}.plan.stroke.width`), n.stroke.width < 0)) throw new J("INVALID_GEOMETRY", `${t}.plan.stroke.width is negative`);
14639
+ if (n.stroke && (Q(n.stroke.width, `${t}.plan.stroke.width`), n.stroke.width < 0)) throw new J("INVALID_GEOMETRY", `${t}.plan.stroke.width is negative`);
14640
14640
  }
14641
14641
  function PS(e, t) {
14642
14642
  if (e <= t) return !0;
@@ -14677,7 +14677,7 @@ function US(e, t) {
14677
14677
  if (!Array.isArray(n.segments) || n.segments.length === 0) throw new J("INVALID_GEOMETRY", `${t}.segments is empty`);
14678
14678
  n.segments.forEach((e, n) => {
14679
14679
  let r = `${t}.segments[${n}]`;
14680
- if (OS(e.from, `${r}.from`), OS(e.to, `${r}.to`), ES(e.widthPt, `${r}.widthPt`), e.from.xPt !== e.to.xPt && e.from.yPt !== e.to.yPt) throw new J("INVALID_GEOMETRY", `${r} is not an axis-aligned page edge`);
14680
+ if (OS(e.from, `${r}.from`), OS(e.to, `${r}.to`), Q(e.widthPt, `${r}.widthPt`), e.from.xPt !== e.to.xPt && e.from.yPt !== e.to.yPt) throw new J("INVALID_GEOMETRY", `${r} is not an axis-aligned page edge`);
14681
14681
  if (!/^#[0-9a-fA-F]{6}$/.test(e.color)) throw new J("INVALID_REFERENCE", `${r}.color is invalid`);
14682
14682
  });
14683
14683
  }
@@ -14711,15 +14711,15 @@ function KS(e, t) {
14711
14711
  for (let [n, r] of [["leading", e.leading], ["trailing", e.trailing]]) {
14712
14712
  if (!r) continue;
14713
14713
  let i = `${t}.${n}`;
14714
- if (kS(r.flowBounds, `${i}.flowBounds`), ES(r.advancePt, `${i}.advancePt`), !PS(e.flowBounds.yPt, r.flowBounds.yPt) || !PS(r.flowBounds.yPt + r.advancePt, e.flowBounds.yPt + e.flowBounds.heightPt)) throw new J("FLOW_DOMAIN_INVASION", `${i} lies outside its note`);
14714
+ if (kS(r.flowBounds, `${i}.flowBounds`), Q(r.advancePt, `${i}.advancePt`), !PS(e.flowBounds.yPt, r.flowBounds.yPt) || !PS(r.flowBounds.yPt + r.advancePt, e.flowBounds.yPt + e.flowBounds.heightPt)) throw new J("FLOW_DOMAIN_INVASION", `${i} lies outside its note`);
14715
14715
  if (r.paragraph && r.paragraph.flowDomainId !== e.flowDomainId) throw new J("INVALID_REFERENCE", `${i} leaves its note flow domain`);
14716
- if (r.rule) for (let e of [r.rule.segment.from, r.rule.segment.to]) ES(e.xPt, `${i}.rule.xPt`), ES(e.yPt, `${i}.rule.yPt`);
14716
+ if (r.rule) for (let e of [r.rule.segment.from, r.rule.segment.to]) Q(e.xPt, `${i}.rule.xPt`), Q(e.yPt, `${i}.rule.yPt`);
14717
14717
  }
14718
14718
  }
14719
14719
  }
14720
14720
  function qS(e, t) {
14721
14721
  if (e.kind === "paragraph") {
14722
- let n = vS(e.drawings.filter((e) => e.anchorLayer?.cellContainment === !0).map((e) => e.flowBounds));
14722
+ let n = yS(e.drawings.filter((e) => e.anchorLayer?.cellContainment === !0).map((e) => e.flowBounds));
14723
14723
  if (e.cellContainmentBounds && kS(e.cellContainmentBounds, `${t}.cellContainmentBounds`), n === null != (e.cellContainmentBounds === void 0) || n && e.cellContainmentBounds && !VS(n, e.cellContainmentBounds)) throw new J("INVALID_GEOMETRY", `${t}.cellContainmentBounds does not match its retained layoutInCell drawings`);
14724
14724
  let r = /* @__PURE__ */ new Set();
14725
14725
  (e.anchorCollisions ?? []).forEach((e, n) => {
@@ -14744,7 +14744,7 @@ function JS(e, t) {
14744
14744
  "d",
14745
14745
  "e",
14746
14746
  "f"
14747
- ]) ES(e.transform[n], `${t}.transform.${n}`);
14747
+ ]) Q(e.transform[n], `${t}.transform.${n}`);
14748
14748
  e.clip?.kind === "rect" && kS(e.clip.rect, `${t}.clip.rect`), e.clip?.kind === "polygon" && e.clip.points.forEach((e, n) => OS(e, `${t}.clip.points[${n}]`)), e.commands.forEach((e, n) => {
14749
14749
  let r = `${t}.commands[${n}]`;
14750
14750
  if (e.kind !== "noop") {
@@ -14752,9 +14752,9 @@ function JS(e, t) {
14752
14752
  if (NS(e, r), e.concentricFill) {
14753
14753
  let t = e.concentricFill;
14754
14754
  t.bounds && kS(t.bounds, `${r}.concentricFill.bounds`);
14755
- for (let [e, n] of Object.entries(t.focus)) ES(n, `${r}.concentricFill.focus.${e}`);
14755
+ for (let [e, n] of Object.entries(t.focus)) Q(n, `${r}.concentricFill.focus.${e}`);
14756
14756
  t.rings.forEach((e, t) => {
14757
- ES(e.outside, `${r}.concentricFill.rings[${t}]`);
14757
+ Q(e.outside, `${r}.concentricFill.rings[${t}]`);
14758
14758
  });
14759
14759
  }
14760
14760
  return;
@@ -14766,33 +14766,33 @@ function JS(e, t) {
14766
14766
  "t",
14767
14767
  "r",
14768
14768
  "b"
14769
- ]) ES(e.fillRect[t], `${r}.fillRect.${t}`);
14769
+ ]) Q(e.fillRect[t], `${r}.fillRect.${t}`);
14770
14770
  return;
14771
14771
  }
14772
- if (kS(e.rect, `${r}.rect`), e.kind === "stroke-rect" && (ES(e.lineWidthPt, `${r}.lineWidthPt`), e.dashPt.forEach((e, t) => ES(e, `${r}.dashPt[${t}]`))), e.kind === "text" && (ES(e.fontSizePt, `${r}.fontSizePt`), ES(e.fontWeight, `${r}.fontWeight`)), e.kind === "watermark-text") {
14772
+ if (kS(e.rect, `${r}.rect`), e.kind === "stroke-rect" && (Q(e.lineWidthPt, `${r}.lineWidthPt`), e.dashPt.forEach((e, t) => Q(e, `${r}.dashPt[${t}]`))), e.kind === "text" && (Q(e.fontSizePt, `${r}.fontSizePt`), Q(e.fontWeight, `${r}.fontWeight`)), e.kind === "watermark-text") {
14773
14773
  if (e.maskBounds && kS(e.maskBounds, `${r}.maskBounds`), kS(e.sourceBounds, `${r}.sourceBounds`), e.sourceBounds.widthPt <= 0 || e.sourceBounds.heightPt <= 0) throw new J("INVALID_GEOMETRY", `${r}.sourceBounds must have positive extents`);
14774
- if (ES(e.opacity, `${r}.opacity`), ES(e.rotationDeg, `${r}.rotationDeg`), ES(e.fontSizePt, `${r}.fontSizePt`), e.opacity < 0 || e.opacity > 1 || e.fontSizePt <= 0) throw new J("INVALID_GEOMETRY", `${r} has invalid textPath paint metrics`);
14774
+ if (Q(e.opacity, `${r}.opacity`), Q(e.rotationDeg, `${r}.rotationDeg`), Q(e.fontSizePt, `${r}.fontSizePt`), e.opacity < 0 || e.opacity > 1 || e.fontSizePt <= 0) throw new J("INVALID_GEOMETRY", `${r} has invalid textPath paint metrics`);
14775
14775
  e.pathSlices?.forEach((e, t) => {
14776
- for (let [n, i] of Object.entries(e)) ES(i, `${r}.pathSlices[${t}].${n}`);
14776
+ for (let [n, i] of Object.entries(e)) Q(i, `${r}.pathSlices[${t}].${n}`);
14777
14777
  }), e.spans.forEach((e, t) => {
14778
- ES(e.advancePt, `${r}.spans[${t}].advancePt`), ES(e.fontWeight, `${r}.spans[${t}].fontWeight`);
14778
+ Q(e.advancePt, `${r}.spans[${t}].advancePt`), Q(e.fontWeight, `${r}.spans[${t}].fontWeight`);
14779
14779
  });
14780
14780
  }
14781
14781
  }
14782
14782
  });
14783
14783
  }
14784
14784
  function* YS(e) {
14785
- TS(e, "layout", /* @__PURE__ */ new WeakSet(), !0), e.diagnostics.forEach((e, t) => {
14785
+ ES(e, "layout", /* @__PURE__ */ new WeakSet(), !0), e.diagnostics.forEach((e, t) => {
14786
14786
  let n = `diagnostics[${t}]`;
14787
- if (!SS.has(e.code)) throw new J("INVALID_REFERENCE", `${n}.code is unknown`);
14787
+ if (!CS.has(e.code)) throw new J("INVALID_REFERENCE", `${n}.code is unknown`);
14788
14788
  if (e.severity !== "warning" && e.severity !== "error") throw new J("INVALID_REFERENCE", `${n}.severity is unknown`);
14789
14789
  if (typeof e.message != "string" || e.message.length === 0) throw new J("INVALID_REFERENCE", `${n}.message is empty`);
14790
- if (e.source !== void 0 && (!CS.has(e.source.story) || typeof e.source.storyInstance != "string" || e.source.storyInstance.length === 0 || !Array.isArray(e.source.path) || e.source.path.some((e) => !Number.isSafeInteger(e) || e < 0))) throw new J("INVALID_REFERENCE", `${n}.source is invalid`);
14790
+ if (e.source !== void 0 && (!wS.has(e.source.story) || typeof e.source.storyInstance != "string" || e.source.storyInstance.length === 0 || !Array.isArray(e.source.path) || e.source.path.some((e) => !Number.isSafeInteger(e) || e < 0))) throw new J("INVALID_REFERENCE", `${n}.source is invalid`);
14791
14791
  });
14792
14792
  let t = /* @__PURE__ */ new Set();
14793
14793
  for (let [n, r] of e.pages.entries()) {
14794
- if (TS(r, `layout.pages[${n}]`), !Number.isInteger(r.pageIndex) || r.pageIndex !== n) throw new J("INVALID_REFERENCE", `pages[${n}] has invalid page index ${r.pageIndex}`);
14795
- if (kS(r.geometry, `pages[${n}].geometry`), ES(r.geometry.contentTopPt, `pages[${n}].geometry.contentTopPt`), ES(r.geometry.contentBottomPt, `pages[${n}].geometry.contentBottomPt`), r.geometry.widthPt <= 0 || r.geometry.heightPt <= 0 || r.geometry.contentTopPt < 0 || r.geometry.contentTopPt > r.geometry.contentBottomPt || r.geometry.contentBottomPt > r.geometry.heightPt) throw new J("INVALID_GEOMETRY", `pages[${n}] has invalid effective page edges`);
14794
+ if (ES(r, `layout.pages[${n}]`), !Number.isInteger(r.pageIndex) || r.pageIndex !== n) throw new J("INVALID_REFERENCE", `pages[${n}] has invalid page index ${r.pageIndex}`);
14795
+ if (kS(r.geometry, `pages[${n}].geometry`), Q(r.geometry.contentTopPt, `pages[${n}].geometry.contentTopPt`), Q(r.geometry.contentBottomPt, `pages[${n}].geometry.contentBottomPt`), r.geometry.widthPt <= 0 || r.geometry.heightPt <= 0 || r.geometry.contentTopPt < 0 || r.geometry.contentTopPt > r.geometry.contentBottomPt || r.geometry.contentBottomPt > r.geometry.heightPt) throw new J("INVALID_GEOMETRY", `pages[${n}] has invalid effective page edges`);
14796
14796
  US(r, `pages[${n}].pageBorder`);
14797
14797
  let e = /* @__PURE__ */ new Map();
14798
14798
  if (r.flowDomains.forEach((t, r) => {
@@ -14828,7 +14828,7 @@ function* YS(e) {
14828
14828
  heightPt: u.section.geometry.pageHeight
14829
14829
  }, p);
14830
14830
  if (g.widthPt !== r.geometry.widthPt || g.heightPt !== r.geometry.heightPt) throw new J("INVALID_GEOMETRY", `${f} section geometry does not match the upright physical page`);
14831
- if (ES(u.blockStartPt, `${f}.blockStartPt`), ES(u.blockEndPt, `${f}.blockEndPt`), u.columnFlowDirection !== "ltr" && u.columnFlowDirection !== "rtl") throw new J("INVALID_GEOMETRY", `${f} has an invalid column flow direction`);
14831
+ if (Q(u.blockStartPt, `${f}.blockStartPt`), Q(u.blockEndPt, `${f}.blockEndPt`), u.columnFlowDirection !== "ltr" && u.columnFlowDirection !== "rtl") throw new J("INVALID_GEOMETRY", `${f} has an invalid column flow direction`);
14832
14832
  let _ = u.section.sectionBidi === !0 ? "rtl" : "ltr";
14833
14833
  if (u.columnFlowDirection !== _) throw new J("INVALID_GEOMETRY", `${f} column flow direction contradicts its section bidi`);
14834
14834
  if (u.blockStartPt < 0 || u.blockEndPt < u.blockStartPt || u.blockEndPt > h.heightPt) throw new J("INVALID_GEOMETRY", `${f} has an invalid block interval`);
@@ -14857,7 +14857,7 @@ function* YS(e) {
14857
14857
  }), !r.parityBlank && r.sectionRegions.length > 0) {
14858
14858
  let e = r.sectionRegions[0];
14859
14859
  if (r.sectionOccurrenceId !== e.sectionOccurrenceId) throw new J("INVALID_REFERENCE", `pages[${n}] page-start section occurrence does not match its first region`);
14860
- if (!tS(r.section, e.section)) throw new J("INVALID_GEOMETRY", `pages[${n}] page-start section facts do not match its first region`);
14860
+ if (!nS(r.section, e.section)) throw new J("INVALID_GEOMETRY", `pages[${n}] page-start section facts do not match its first region`);
14861
14861
  }
14862
14862
  }
14863
14863
  let o = Ls(r.sectionRegions ?? []);
@@ -14875,7 +14875,7 @@ function* YS(e) {
14875
14875
  }
14876
14876
  for (let e of r.flowDomains) if (!a.has(e.id) && !VS(e.logicalBounds, e.physicalBounds)) throw new J("INVALID_GEOMETRY", `${e.id} has unequal logical and physical bounds without a section region`);
14877
14877
  if (r.pageNumber) {
14878
- if (ES(r.pageNumber.displayNumber, `pages[${n}].pageNumber.displayNumber`), !Number.isInteger(r.pageNumber.displayNumber)) throw new J("INVALID_GEOMETRY", `pages[${n}] page number is not an integer`);
14878
+ if (Q(r.pageNumber.displayNumber, `pages[${n}].pageNumber.displayNumber`), !Number.isInteger(r.pageNumber.displayNumber)) throw new J("INVALID_GEOMETRY", `pages[${n}] page number is not an integer`);
14879
14879
  if (r.pageNumber.format.length === 0 || !i.has(r.pageNumber.sectionOccurrenceId)) throw new J("INVALID_REFERENCE", `pages[${n}] has an invalid page number section owner`);
14880
14880
  }
14881
14881
  let c = [];
@@ -14887,7 +14887,7 @@ function* YS(e) {
14887
14887
  let l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set();
14888
14888
  ps(r).forEach(({ node: r }, i) => {
14889
14889
  let o = `pages[${n}].nodes[${i}]`;
14890
- l.set(r.id, r), GS(r, u, t), qS(r, o), KS(r, o), kS(r.flowBounds, `${o}.flowBounds`), kS(r.inkBounds, `${o}.inkBounds`), r.clipBounds && kS(r.clipBounds, `${o}.clipBounds`), ES(r.advancePt, `${o}.advancePt`), r.kind === "drawing" && JS(r, o);
14890
+ l.set(r.id, r), GS(r, u, t), qS(r, o), KS(r, o), kS(r.flowBounds, `${o}.flowBounds`), kS(r.inkBounds, `${o}.inkBounds`), r.clipBounds && kS(r.clipBounds, `${o}.clipBounds`), Q(r.advancePt, `${o}.advancePt`), r.kind === "drawing" && JS(r, o);
14891
14891
  let s = e.get(r.flowDomainId);
14892
14892
  if (!s) throw new J("INVALID_REFERENCE", `${r.id} references missing flow domain ${r.flowDomainId}`);
14893
14893
  if (r.ordinaryFlow && s.kind === "body" && s.logicalBounds.heightPt === 0) throw new J("FLOW_DOMAIN_INVASION", `${r.id} claims ordinary flow in an empty body domain`);
@@ -14905,7 +14905,7 @@ function* YS(e) {
14905
14905
  if (!l.has(e) || d.has(e)) throw new J("INVALID_REFERENCE", `invalid reading-order reference ${e}`);
14906
14906
  d.add(e);
14907
14907
  }), r.bookmarkStarts !== void 0) {
14908
- let e = uS(r, new Map([...a].map(([e, t]) => [e, t.sectionOccurrenceId]))), t = e.every((e) => e.sectionOccurrenceId.length > 0 && i.has(e.sectionOccurrenceId)), o = r.bookmarkStarts.length === e.length && r.bookmarkStarts.every((t, n) => {
14908
+ let e = dS(r, new Map([...a].map(([e, t]) => [e, t.sectionOccurrenceId]))), t = e.every((e) => e.sectionOccurrenceId.length > 0 && i.has(e.sectionOccurrenceId)), o = r.bookmarkStarts.length === e.length && r.bookmarkStarts.every((t, n) => {
14909
14909
  let r = e[n];
14910
14910
  return r !== void 0 && t.name === r.name && t.nodeId === r.nodeId && t.sectionOccurrenceId === r.sectionOccurrenceId;
14911
14911
  });
@@ -14917,7 +14917,7 @@ function* YS(e) {
14917
14917
  let a = e.get(r.flowDomainId), o = e.get(i.flowDomainId), s = r.flowDomainId === i.flowDomainId, l = a?.kind === "body" && (o?.kind === "footnote" || o?.kind === "endnote") || o?.kind === "body" && (a?.kind === "footnote" || a?.kind === "endnote"), u = a?.id !== o?.id && (a?.kind === "footnote" || a?.kind === "endnote") && (o?.kind === "footnote" || o?.kind === "endnote");
14918
14918
  if ((s || l || u) && IS(r.flowBounds, i.flowBounds)) throw new J("FLOW_OVERLAP", `${r.id} overlaps ${i.id}`);
14919
14919
  }
14920
- yield yS;
14920
+ yield bS;
14921
14921
  }
14922
14922
  }
14923
14923
  function* XS(e) {
@@ -14944,13 +14944,13 @@ function eC(e) {
14944
14944
  return QS.add(t), t;
14945
14945
  }
14946
14946
  function tC(e) {
14947
- return QS.has(e) ? e : (li() && TS(e, "layout"), eC(e));
14947
+ return QS.has(e) ? e : (li() && ES(e, "layout"), eC(e));
14948
14948
  }
14949
14949
  function* nC(e) {
14950
14950
  if ($S.has(e)) return e;
14951
14951
  yield* XS(e);
14952
14952
  let t = /* @__PURE__ */ new WeakSet();
14953
- for (let n of e.pages) ZS(n, t), yield yS;
14953
+ for (let n of e.pages) ZS(n, t), yield bS;
14954
14954
  let n = ZS(e, t);
14955
14955
  return QS.add(n), $S.add(n), n;
14956
14956
  }
@@ -15584,7 +15584,7 @@ function UC(e) {
15584
15584
  return e instanceof ee || St(e) || Mt(e) || e instanceof t && e.code === "unsupported-image-effect";
15585
15585
  }
15586
15586
  function WC(e, t, n, r, i) {
15587
- return `${e}${t ? `|clr:${t}` : ""}${n ? `|duo:${n.clr1}:${n.clr2}` : ""}${i?.length ? `|effects:${Ee({
15587
+ return `${e}${t ? `|clr:${t}` : ""}${n ? `|duo:${n.clr1}:${n.clr2}` : ""}${i?.length ? `|effects:${Oe({
15588
15588
  effects: i,
15589
15589
  duotone: n
15590
15590
  })}` : ""}${r ? `|vml-pen:${r.clr1}:${r.clr2}` : ""}`;
@@ -15625,7 +15625,7 @@ async function JC(e, t, n, r, i) {
15625
15625
  return a;
15626
15626
  }
15627
15627
  async function YC(e, t, n, r, i = 0, a = 0, o, s, c, l, u, d, f, p) {
15628
- if (f?.length) return Pe(e, t, {
15628
+ if (f?.length) return Ie(e, t, {
15629
15629
  effects: n && !f.some((e) => e.type === "colorChange") ? [{
15630
15630
  type: "colorChange",
15631
15631
  from: n,
@@ -15642,23 +15642,23 @@ async function YC(e, t, n, r, i = 0, a = 0, o, s, c, l, u, d, f, p) {
15642
15642
  tiff: s,
15643
15643
  ...c,
15644
15644
  ...l ? { maxRetainedPixels: l } : {},
15645
- svgDecoder: u ?? (typeof Image < "u" ? we : void 0),
15645
+ svgDecoder: u ?? (typeof Image < "u" ? Te : void 0),
15646
15646
  failClosedOnDuotoneFailure: !0
15647
15647
  });
15648
- let m = Math.floor(Ct / (n || o || d ? 4 : 1)), h = Number.isSafeInteger(l) && (l ?? 0) > 0 ? Math.min(m, l) : m, g = n || o || d ? De(r, KC) : void 0, _ = {
15648
+ let m = Math.floor(Ct / (n || o || d ? 4 : 1)), h = Number.isSafeInteger(l) && (l ?? 0) > 0 ? Math.min(m, l) : m, g = n || o || d ? Ae(r, KC) : void 0, _ = {
15649
15649
  widthPt: i,
15650
15650
  heightPt: a,
15651
- svgDecoder: u ?? (t === "image/svg+xml" && typeof Image < "u" ? we : void 0),
15651
+ svgDecoder: u ?? (t === "image/svg+xml" && typeof Image < "u" ? Te : void 0),
15652
15652
  tiff: s,
15653
15653
  maxRetainedPixels: h,
15654
15654
  ...c ?? {}
15655
- }, v = await Ge(e, t, r, { ..._ });
15655
+ }, v = await Ke(e, t, r, { ..._ });
15656
15656
  if (!v) return null;
15657
15657
  if (!n && !o && !d) return v;
15658
15658
  let y = v.width * v.height;
15659
15659
  if (y > h) throw new wt("image-pixels", h, y);
15660
15660
  let b = await rt(e, t, r, _, g, v), x = Nt(v.width, v.height, c?.targetWidthPx, c?.targetHeightPx), S = x ? `|resize:${x.resizeWidth}x${x.resizeHeight}` : "";
15661
- return ze(KC, `${WC(b, n, o, d)}${S}`, r, async () => {
15661
+ return Ve(KC, `${WC(b, n, o, d)}${S}`, r, async () => {
15662
15662
  let e = await JC(v, n, o, c, d);
15663
15663
  return {
15664
15664
  bitmap: e,
@@ -15789,20 +15789,20 @@ async function ZC(e, t, n, r, i, a, o, s) {
15789
15789
  targetWidthPx: t.targetWidthPx,
15790
15790
  targetHeightPx: t.targetHeightPx,
15791
15791
  workerDecoder: a
15792
- }) : tt(e, n), u = XC(e, t, i), d = me((await Promise.all(u.map(async (e) => {
15792
+ }) : tt(e, n), u = XC(e, t, i), d = he((await Promise.all(u.map(async (e) => {
15793
15793
  if (!e.targetWidthPx || !e.targetHeightPx || e.colorReplaceFrom || e.duotone || e.vmlStrokePattern || e.blipEffects?.length) return null;
15794
15794
  let t = e.mimeType === "image/svg+xml", i = {
15795
15795
  svgImagePath: e.svgImagePath,
15796
15796
  srcRect: e.hasCrop || null
15797
15797
  };
15798
- if (t || Se(i)) return null;
15798
+ if (t || Ce(i)) return null;
15799
15799
  if (Et(e.mimeType) && (c.resolution === "display" || c.strategy === "adaptive")) return {
15800
15800
  key: GC(e),
15801
15801
  targetWidthPx: e.targetWidthPx,
15802
15802
  targetHeightPx: e.targetHeightPx,
15803
15803
  retainedSurfaceCount: 1
15804
15804
  };
15805
- let a = await je(e.imagePath, e.mimeType, n).catch((e) => {
15805
+ let a = await Pe(e.imagePath, e.mimeType, n).catch((e) => {
15806
15806
  if (e instanceof ee || St(e)) throw e;
15807
15807
  return null;
15808
15808
  });
@@ -15816,7 +15816,7 @@ async function ZC(e, t, n, r, i, a, o, s) {
15816
15816
  };
15817
15817
  }))).filter((e) => e !== null), c);
15818
15818
  for (let e of u) {
15819
- if (e.mimeType === "image/svg+xml" || !e.colorReplaceFrom && !e.duotone && !e.vmlStrokePattern && !e.blipEffects?.length && Se({
15819
+ if (e.mimeType === "image/svg+xml" || !e.colorReplaceFrom && !e.duotone && !e.vmlStrokePattern && !e.blipEffects?.length && Ce({
15820
15820
  svgImagePath: e.svgImagePath,
15821
15821
  srcRect: e.hasCrop || null
15822
15822
  })) continue;
@@ -15829,7 +15829,7 @@ async function ZC(e, t, n, r, i, a, o, s) {
15829
15829
  svgImagePath: e.svgImagePath,
15830
15830
  srcRect: e.hasCrop || null
15831
15831
  }, o;
15832
- if (Se(i) && !e.colorReplaceFrom && !e.duotone && !e.vmlStrokePattern && !e.blipEffects?.length) try {
15832
+ if (Ce(i) && !e.colorReplaceFrom && !e.duotone && !e.vmlStrokePattern && !e.blipEffects?.length) try {
15833
15833
  o = await l(i.svgImagePath, e);
15834
15834
  } catch (i) {
15835
15835
  if (UC(i)) throw i;
@@ -15846,7 +15846,7 @@ async function ZC(e, t, n, r, i, a, o, s) {
15846
15846
  targetWidthPx: e.targetWidthPx,
15847
15847
  targetHeightPx: e.targetHeightPx
15848
15848
  } : void 0, e.plannedPixelLimit, a, e.vmlStrokePattern, e.blipEffects, e.orientation);
15849
- if (Se(i)) try {
15849
+ if (Ce(i)) try {
15850
15850
  o = await t(i.svgImagePath, "image/svg+xml");
15851
15851
  } catch (n) {
15852
15852
  if (UC(n)) throw n;
@@ -16668,7 +16668,7 @@ function jw(e, t) {
16668
16668
  if (t.glyphOrientation === "upright") {
16669
16669
  n.save(), n.translate(i, a), n.rotate(-Math.PI / 2), (t.scaleX !== 1 || t.scaleY !== void 0) && (t.writingMode === "vertical-rl" ? n.scale(1, t.scaleX) : n.scale(t.scaleX, t.scaleY ?? 1)), n.textAlign = "center", n.textBaseline = "middle", n.letterSpacing = `${t.letterSpacingPt}px`;
16670
16670
  let e = () => n.fillText(r, o, s);
16671
- t.verticalFeature ? ke(n, e) : e(), n.restore();
16671
+ t.verticalFeature ? je(n, e) : e(), n.restore();
16672
16672
  } else t.glyphOrientation === "rotate" ? (n.save(), n.translate(i, a), t.scaleX !== 1 && n.scale(t.scaleX, 1), n.textAlign = "center", n.textBaseline = "middle", n.letterSpacing = `${t.letterSpacingPt / t.scaleX}px`, n.fillText(r, o, s), n.restore()) : t.scaleX === 1 ? (n.letterSpacing = `${t.letterSpacingPt}px`, n.fillText(r, i + o, a + s)) : (n.save(), n.translate(i + o, a + s), n.scale(t.scaleX, 1), n.letterSpacing = `${t.letterSpacingPt / t.scaleX}px`, n.fillText(r, 0, 0), n.restore());
16673
16673
  }
16674
16674
  if (n.letterSpacing = r, n.fontKerning = i, e.ruby) {
@@ -17205,7 +17205,7 @@ async function dT(e, n, r, i, a) {
17205
17205
  svgImagePath: a.svgImagePath,
17206
17206
  srcRect: f ? !0 : null
17207
17207
  };
17208
- if (!a.blipEffects?.length && Se(c)) try {
17208
+ if (!a.blipEffects?.length && Ce(c)) try {
17209
17209
  i = await r(c.svgImagePath, "image/svg+xml");
17210
17210
  } catch (e) {
17211
17211
  if (UC(e)) throw e;
@@ -17667,8 +17667,8 @@ function OT(e) {
17667
17667
  });
17668
17668
  }
17669
17669
  function kT(e) {
17670
- let { kind: t, region: n, ...r } = e, i = pS(r);
17671
- if (n && (i = mS(i, n)), t === "content" && i.sectionRegions.length === 0) throw RangeError("A content page draft requires an initial section region");
17670
+ let { kind: t, region: n, ...r } = e, i = mS(r);
17671
+ if (n && (i = hS(i, n)), t === "content" && i.sectionRegions.length === 0) throw RangeError("A content page draft requires an initial section region");
17672
17672
  if (t === "parity-blank" && i.sectionRegions.length !== 0) throw RangeError("A parity blank cannot retain a section region");
17673
17673
  return Object.freeze({
17674
17674
  kind: t,
@@ -17759,7 +17759,7 @@ function LT(e) {
17759
17759
  return t[t.indexOf(e.columnIndex) + 1];
17760
17760
  }
17761
17761
  function RT(e, t = {}) {
17762
- let n = Mx(e), r = Nx(e), i = t.pageContentStartBlockPt ?? n, a = t.pageContentEndBlockPt ?? r, o = t.regionStartBlockPt ?? i, s = t.regionEndBlockPt ?? a, c = t.cursorBlockPt ?? o, l = t.deepestColumnBlockPt ?? c, u = t.pageIndex ?? 0, d = Object.freeze([...t.columnSubset ?? e.columns.map((e, t) => t)]), f = IT(e, d), p = t.columnIndex ?? f[0] ?? -1;
17762
+ let n = Nx(e), r = Px(e), i = t.pageContentStartBlockPt ?? n, a = t.pageContentEndBlockPt ?? r, o = t.regionStartBlockPt ?? i, s = t.regionEndBlockPt ?? a, c = t.cursorBlockPt ?? o, l = t.deepestColumnBlockPt ?? c, u = t.pageIndex ?? 0, d = Object.freeze([...t.columnSubset ?? e.columns.map((e, t) => t)]), f = IT(e, d), p = t.columnIndex ?? f[0] ?? -1;
17763
17763
  if (!Number.isInteger(u) || u < 0) throw RangeError("Page index must be a non-negative integer");
17764
17764
  if (!Number.isInteger(p) || p < 0 || p >= e.columns.length) throw RangeError("Column index must identify a column in the active section");
17765
17765
  if (d.length === 0 || d.some((t, n) => !Number.isInteger(t) || t < 0 || t >= e.columns.length || n > 0 && t <= d[n - 1]) || !d.includes(p)) throw RangeError("Column subset must be ordered, unique, and contain the active column");
@@ -17846,7 +17846,7 @@ function GT(e, t, n) {
17846
17846
  heightPt: t.geometry.pageHeight
17847
17847
  }, a);
17848
17848
  (o.widthPt !== s.widthPt || o.heightPt !== s.heightPt) && r("page-extent");
17849
- let c = n.incomingPageContentStartBlockPt ?? Mx(t), l = n.incomingPageContentEndBlockPt ?? Nx(t);
17849
+ let c = n.incomingPageContentStartBlockPt ?? Nx(t), l = n.incomingPageContentEndBlockPt ?? Px(t);
17850
17850
  (c !== e.pageContentStartBlockPt || l !== e.pageContentEndBlockPt) && r("block-band"), HT(e.section.grid, t.grid) || r("grid");
17851
17851
  let u = IT(e.section, e.columnSubset), d = u.indexOf(e.columnIndex), f = u[d + 1];
17852
17852
  if (f === void 0) throw Error("nextColumn destination resolution requires a same-page successor");
@@ -18448,7 +18448,7 @@ function TE(e, t, n) {
18448
18448
  });
18449
18449
  return;
18450
18450
  }
18451
- if (l >= 24) throw new se("VML projected vector cannot meet numerical precision");
18451
+ if (l >= 24) throw new ce("VML projected vector cannot meet numerical precision");
18452
18452
  let d = (i + o) / 2;
18453
18453
  a(i, d, s, u[1], l + 1), a(d, o, u[1], c, l + 1);
18454
18454
  };
@@ -18514,7 +18514,7 @@ function EE(e, t, n = Infinity) {
18514
18514
  function DE(e, t, n = Infinity) {
18515
18515
  n = Math.min(n, 1048576);
18516
18516
  let r = e.resolvedGeometry ?? Lt(e, 1, n), i = r.workUnits, a = (e = 1) => {
18517
- if (i += e, i > n) throw new se("VML affine geometry work budget exceeded");
18517
+ if (i += e, i > n) throw new ce("VML affine geometry work budget exceeded");
18518
18518
  }, o = ([n, i]) => {
18519
18519
  a();
18520
18520
  let o = e.rect.x - r.originX, s = e.rect.y - r.originY, c = t([n + o, i + s]);
@@ -18604,7 +18604,7 @@ function jE(e, t = Infinity) {
18604
18604
  let n = e.resolvedGeometry, r = Lt(e, 1, t);
18605
18605
  if (!n) return r;
18606
18606
  let i = r.workUnits + n.workUnits;
18607
- if (i > t) throw new se("VML geometry pass work budget exceeded");
18607
+ if (i > t) throw new ce("VML geometry pass work budget exceeded");
18608
18608
  if (!e.stroke) return {
18609
18609
  ...r,
18610
18610
  originX: n.originX,
@@ -18680,7 +18680,7 @@ function NE(e, t, n = Infinity, r = t.rect) {
18680
18680
  if (!i || i.opacity === 0) return [];
18681
18681
  n = Math.min(n, 1048576);
18682
18682
  let { x: a, y: o, w: s, h: c } = t.rect, l = r, u = 0, d = (e = 1) => {
18683
- if (u += e, u > n) throw new se("VML shadow geometry allowance exceeded");
18683
+ if (u += e, u > n) throw new ce("VML shadow geometry allowance exceeded");
18684
18684
  }, f = [], p = i.kind === "double" || i.kind === "emboss" ? [[i.offset, i.color], [i.offset2, i.color2]] : [[i.offset, i.color]];
18685
18685
  for (let [r, m] of p) {
18686
18686
  let p = r.xPt + r.xFraction * l.w, h = r.yPt + r.yFraction * l.h, g = t.stroke ? {
@@ -18958,7 +18958,7 @@ function LE(e) {
18958
18958
  function RE(e, t, n, r, i = Infinity) {
18959
18959
  i = Math.min(i, 1048576);
18960
18960
  let a = 0, o = (e = 1) => {
18961
- if (a += e, a > i) throw new se("VML text path work budget exceeded");
18961
+ if (a += e, a > i) throw new ce("VML text path work budget exceeded");
18962
18962
  }, s = [], c = [], l = {
18963
18963
  x: 0,
18964
18964
  y: 0
@@ -18996,7 +18996,7 @@ function RE(e, t, n, r, i = Infinity) {
18996
18996
  }, {
18997
18997
  x: t.widthPt,
18998
18998
  y: t.heightPt
18999
- }]) : (Ke({
18999
+ }]) : (ve({
19000
19000
  moveTo: (e, t) => {
19001
19001
  d(), u(e, t);
19002
19002
  },
@@ -21306,7 +21306,7 @@ function VO(e, t) {
21306
21306
  let e = new Map(t.clusters.map((e) => [e.range.start - t.range.start, e.advancePt])), s = 0;
21307
21307
  for (let a of t.text) {
21308
21308
  let t = a.codePointAt(0), c = r.at(-1);
21309
- if (!n(t) && (t < 32 || t > 126) || c !== void 0 && n(t) !== n(c) && t !== 32 && c !== 32 || Xe(t) && (c === void 0 || c === 32) || s > 0 && c !== void 0 && (n(c) || c === 32) && !Xe(t) && !e.has(s)) return;
21309
+ if (!n(t) && (t < 32 || t > 126) || c !== void 0 && n(t) !== n(c) && t !== 32 && c !== 32 || ke(t) && (c === void 0 || c === 32) || s > 0 && c !== void 0 && (n(c) || c === 32) && !ke(t) && !e.has(s)) return;
21310
21310
  o ||= n(t), r.push(t), i.push(e.get(s) ?? 0), s += a.length;
21311
21311
  }
21312
21312
  }
@@ -21314,7 +21314,7 @@ function VO(e, t) {
21314
21314
  let n = (a[e] ?? 0) + t;
21315
21315
  if (r[n] === 32) return i[n] ?? 0;
21316
21316
  let o = 0;
21317
- for (; n >= 0 && (o += i[n] ?? 0, Xe(r[n] ?? 0)); --n);
21317
+ for (; n >= 0 && (o += i[n] ?? 0, ke(r[n] ?? 0)); --n);
21318
21318
  return o;
21319
21319
  };
21320
21320
  }
@@ -21382,7 +21382,7 @@ function WO(e, t) {
21382
21382
  if (i.length === 0) return;
21383
21383
  let t = "", a = [];
21384
21384
  for (let n of i) a.push(t.length), t += e[n].text;
21385
- let o = Ne(t), s = 0;
21385
+ let o = De(t), s = 0;
21386
21386
  i.forEach((e, c) => {
21387
21387
  let l = a[c], u = a[c + 1] ?? t.length, d = /* @__PURE__ */ new Set();
21388
21388
  for (; s < o.length && o[s] < u;) o[s] >= l && d.add(o[s] - l), s += 1;
@@ -22244,7 +22244,7 @@ function xk(e, t) {
22244
22244
  start: i.range.start,
22245
22245
  end: t.at(-1).range.end
22246
22246
  },
22247
- bounds: vS(t.map((e) => e.bounds)),
22247
+ bounds: yS(t.map((e) => e.bounds)),
22248
22248
  placements: t.flatMap((e) => e.placements),
22249
22249
  wrapFragments: t.flatMap((e) => e.wrapFragments ?? [e.wrapBounds ?? e.bounds])
22250
22250
  }, t));
@@ -22603,7 +22603,7 @@ function Vk(e, t, n) {
22603
22603
  if (!r) return;
22604
22604
  if (t.numberingMarkerGeometry) return t.numberingMarkerGeometry;
22605
22605
  let i = e.numberingMarkerShapeInput, a = n.environment.layoutServices?.text;
22606
- if (!(!i || !a)) return nb(r, i, {
22606
+ if (!(!i || !a)) return rb(r, i, {
22607
22607
  authoredFirstIndentPt: e.indentFirst,
22608
22608
  physicalIndentLeftPt: t.physicalIndentLeftPt,
22609
22609
  tabStops: e.tabStops,
@@ -22625,7 +22625,7 @@ function Wk(e, t, n, r) {
22625
22625
  return {
22626
22626
  authoredFirstIndentPx: e.indentFirst,
22627
22627
  ...c ? { columnOriginInsetPx: t.physicalIndentLeftPt } : {},
22628
- bodyIndentAt: (r) => nb(i, a, {
22628
+ bodyIndentAt: (r) => rb(i, a, {
22629
22629
  authoredFirstIndentPt: r,
22630
22630
  ...c ? { suffixFrameOriginPt: r - e.indentFirst } : {},
22631
22631
  physicalIndentLeftPt: t.baseRtl ? t.physicalIndentRightPt : t.physicalIndentLeftPt,
@@ -22645,7 +22645,7 @@ function Gk(e, t, n, r, i, a) {
22645
22645
  }
22646
22646
  function Kk(e, t, n, r, i, a, o) {
22647
22647
  if (!e.shape || e.markerText === "") return [];
22648
- let s = e.shape, c = Qy({
22648
+ let s = e.shape, c = $y({
22649
22649
  baseRtl: n.baseRtl,
22650
22650
  alignedLeadingEdgePt: Gk(e, n, r, i, a, o === void 0 ? void 0 : {
22651
22651
  leadingEdgePx: o,
@@ -24004,7 +24004,7 @@ function wA(e, t) {
24004
24004
  baseRtl: n,
24005
24005
  isJustified: gu(t.alignment),
24006
24006
  stretchLastLine: _u(t.alignment),
24007
- tabStops: wx(t),
24007
+ tabStops: Tx(t),
24008
24008
  hasRuby: r,
24009
24009
  hasEastAsianText: i
24010
24010
  };
@@ -24276,12 +24276,12 @@ function NA(e, t, n) {
24276
24276
  yPt: p.yPt + m.topPt,
24277
24277
  widthPt: Math.max(0, p.widthPt - m.leftPt - m.rightPt),
24278
24278
  heightPt: Math.max(0, p.heightPt - m.topPt - m.bottomPt)
24279
- }, _ = vS(h.map((e) => e.flowBounds)) ?? {
24279
+ }, _ = yS(h.map((e) => e.flowBounds)) ?? {
24280
24280
  xPt: g.xPt,
24281
24281
  yPt: g.yPt,
24282
24282
  widthPt: 0,
24283
24283
  heightPt: 0
24284
- }, y = vS(h.map((e) => e.inkBounds)) ?? {
24284
+ }, y = yS(h.map((e) => e.inkBounds)) ?? {
24285
24285
  xPt: g.xPt,
24286
24286
  yPt: g.yPt,
24287
24287
  widthPt: 0,
@@ -24870,7 +24870,7 @@ function nj(e, t) {
24870
24870
  tj(t.anchorFrames)
24871
24871
  ]), o = n.get(a);
24872
24872
  if (o) return o;
24873
- let s = e.framePr, c = s.w == null ? Math.max(0, ...e.members.map((e, n) => ex(e, t.contexts[n], t.maximumWidthPt, t.measurer, t.environment, Vk(t.inputs[n], t.contexts[n], t)))) : Math.max(0, s.w), l = Math.max(1, c), u = (() => {
24873
+ let s = e.framePr, c = s.w == null ? Math.max(0, ...e.members.map((e, n) => tx(e, t.contexts[n], t.maximumWidthPt, t.measurer, t.environment, Vk(t.inputs[n], t.contexts[n], t)))) : Math.max(0, s.w), l = Math.max(1, c), u = (() => {
24874
24874
  let n = DO(`${i}:${e.id}`), a = 0, o = null, s = 0, c = 0, u = [];
24875
24875
  return e.members.forEach((d, f) => {
24876
24876
  let p = t.contexts[f], m = Math.max(mO(o, d, s, p.spaceBeforePt), c), h = {
@@ -24940,7 +24940,7 @@ function rj(e, t, n) {
24940
24940
  let r = t.continuesFromPrevious ? {
24941
24941
  ...t.context,
24942
24942
  firstIndentPt: 0
24943
- } : t.context, i = t.placement.paragraphXPt + r.physicalIndentLeftPt, a = Tx(r, t.placement.availableWidthPt), o = t.placement.availableWidthPt - r.physicalIndentLeftPt - r.physicalIndentRightPt - a, s = nA(e, n, t.environment.showTrackedChanges), c = t.continuesFromPrevious ? void 0 : Vk(e, r, t), l = aA(n, e, i, o, t.source, t.id, r, s, c, t.environment.layoutServices?.text, t.environment.verticalGlyphMeasurement, t.environment.verticalPageFrame, t.environment.compatibilityMode, t.environment.paragraphMarkShapeInput, xs(t.environment.verticalPageFrame, t.environment.pageWritingMode), t.environment.ulTrailSpace === !0, t.environment.doNotExpandShiftReturn === !0);
24943
+ } : t.context, i = t.placement.paragraphXPt + r.physicalIndentLeftPt, a = Ex(r, t.placement.availableWidthPt), o = t.placement.availableWidthPt - r.physicalIndentLeftPt - r.physicalIndentRightPt - a, s = nA(e, n, t.environment.showTrackedChanges), c = t.continuesFromPrevious ? void 0 : Vk(e, r, t), l = aA(n, e, i, o, t.source, t.id, r, s, c, t.environment.layoutServices?.text, t.environment.verticalGlyphMeasurement, t.environment.verticalPageFrame, t.environment.compatibilityMode, t.environment.paragraphMarkShapeInput, xs(t.environment.verticalPageFrame, t.environment.pageWritingMode), t.environment.ulTrailSpace === !0, t.environment.doNotExpandShiftReturn === !0);
24944
24944
  return t.sourceRangeStart !== void 0 && (l = cA(l, t.sourceRangeStart)), l = oA(l, t.placement.paragraphXPt, t.placement.availableWidthPt, r.baseRtl, r.tabStops), c && n.markOnly && l.length === 0 && (c.markerText !== "" || e.numbering?.picBulletImagePath) && (l = [lA(n, e, i, o, r)]), {
24945
24945
  lines: l,
24946
24946
  planningContext: r,
@@ -25091,7 +25091,7 @@ function ij(e, t, n, r) {
25091
25091
  if (!l) throw Error("Picture-bullet acquisition requires resolved marker font geometry");
25092
25092
  let n = e.numbering.picBulletWidthPt ?? l.markerWidthPt, r = e.numbering.picBulletHeightPt ?? e.numberingMarkerShapeInput?.fontSizePt;
25093
25093
  if (r === void 0) throw Error("Picture-bullet acquisition requires resolved marker height");
25094
- let i = Qy({
25094
+ let i = $y({
25095
25095
  baseRtl: t.context.baseRtl,
25096
25096
  alignedLeadingEdgePt: Gk(l, t.context, o, s, a[0], b === void 0 ? void 0 : {
25097
25097
  leadingEdgePx: b,
@@ -25153,7 +25153,7 @@ function ij(e, t, n, r) {
25153
25153
  widthPt: t.width,
25154
25154
  ...Rs(t.style, t.width)
25155
25155
  }];
25156
- }) : [], E = t.trailingExtentPt ?? n.requestedSpaceAfterPt, D = vS(g);
25156
+ }) : [], E = t.trailingExtentPt ?? n.requestedSpaceAfterPt, D = yS(g);
25157
25157
  return Tk({
25158
25158
  kind: "paragraph",
25159
25159
  id: t.id,
@@ -25293,7 +25293,7 @@ function pj(e, t, n = `${e.id}:${t.lineStart}-${t.lineEnd}`) {
25293
25293
  yPt: c.bounds.yPt,
25294
25294
  widthPt: Math.max(...s.map((e) => e.bounds.xPt + e.bounds.widthPt)) - Math.min(...s.map((e) => e.bounds.xPt)),
25295
25295
  heightPt: l.bounds.yPt + l.bounds.heightPt - c.bounds.yPt
25296
- } : e.inkBounds, d = fj(e, r, o, t), f = new Set(r.flatMap((e) => e.placements.flatMap((e) => e.kind === "drawing" ? [e.drawingId] : []))), p = e.drawings.filter((e) => f.has(e.id)).map((e) => e.anchorLayer?.verticalOwnership === "page" ? e : sj(e, o)), m = vS(p.filter((e) => e.anchorLayer?.cellContainment === !0).map((e) => e.flowBounds)), h = new Set(e.drawings.flatMap((e) => {
25296
+ } : e.inkBounds, d = fj(e, r, o, t), f = new Set(r.flatMap((e) => e.placements.flatMap((e) => e.kind === "drawing" ? [e.drawingId] : []))), p = e.drawings.filter((e) => f.has(e.id)).map((e) => e.anchorLayer?.verticalOwnership === "page" ? e : sj(e, o)), m = yS(p.filter((e) => e.anchorLayer?.cellContainment === !0).map((e) => e.flowBounds)), h = new Set(e.drawings.flatMap((e) => {
25297
25297
  if (e.anchorLayer?.verticalOwnership !== "host") return [];
25298
25298
  let t = e.anchorLayer.acquisitionOccurrenceId ?? e.anchorLayer.occurrenceId;
25299
25299
  return t === void 0 ? [] : [t];
@@ -25588,7 +25588,7 @@ function Oj(e, t) {
25588
25588
  if (!r) continue;
25589
25589
  let i = [...o, e];
25590
25590
  if (r.type === "paragraph") {
25591
- let a = n.content[e - 1], o = n.content[e + 1], u = r, d = t.acquireParagraph(c, u, s, i, $b(a?.type === "paragraph" ? a : null, u, o?.type === "paragraph" ? o : null));
25591
+ let a = n.content[e - 1], o = n.content[e + 1], u = r, d = t.acquireParagraph(c, u, s, i, ex(a?.type === "paragraph" ? a : null, u, o?.type === "paragraph" ? o : null));
25592
25592
  l.push(d), t.advanceState(c, d.advancePt);
25593
25593
  continue;
25594
25594
  }
@@ -25607,11 +25607,11 @@ function Oj(e, t) {
25607
25607
  return l;
25608
25608
  }
25609
25609
  function kj(e) {
25610
- return Tb(e.style, e.width);
25610
+ return Eb(e.style, e.width);
25611
25611
  }
25612
25612
  function Aj(e) {
25613
- let t = Cb.indexOf(e);
25614
- return t === -1 ? Cb.length : t;
25613
+ let t = wb.indexOf(e);
25614
+ return t === -1 ? wb.length : t;
25615
25615
  }
25616
25616
  function jj(e) {
25617
25617
  let t = e ? Bt(e.replace(/^#/, "")) : null;
@@ -25651,7 +25651,7 @@ function Nj(e, t) {
25651
25651
  return l === 0 || l < 0 ? r : i;
25652
25652
  }
25653
25653
  function Pj(...e) {
25654
- for (let t of e) if (t && gb(t.authoredStyle)) return t;
25654
+ for (let t of e) if (t && _b(t.authoredStyle)) return t;
25655
25655
  return null;
25656
25656
  }
25657
25657
  function Fj(e) {
@@ -25746,7 +25746,7 @@ function Gj(e, t, n, r) {
25746
25746
  return r.verticalMerge !== "continue" || n.logicalRowIndex !== e ? r.verticalMerge : t?.cells.some((e) => e.verticalMerge !== "none" && e.columnStart === r.columnStart && e.columnSpan === r.columnSpan) ?? !1 ? "continue" : "restart";
25747
25747
  }
25748
25748
  function Kj(e) {
25749
- return e.heightRule === "exact" ? mb(e.heightPt, e.cells.map((e) => e.margins.bottomPt)) : e.heightRule === "atLeast" ? Math.max(0, e.heightPt ?? 0) : 0;
25749
+ return e.heightRule === "exact" ? hb(e.heightPt, e.cells.map((e) => e.margins.bottomPt)) : e.heightRule === "atLeast" ? Math.max(0, e.heightPt ?? 0) : 0;
25750
25750
  }
25751
25751
  function qj(e, t) {
25752
25752
  return e.verticalMerge === "continue" && e.columnStart === t.columnStart && e.columnSpan === t.columnSpan;
@@ -25927,7 +25927,7 @@ function iM(e, t) {
25927
25927
  };
25928
25928
  }
25929
25929
  function aM(e, t, n = iM(e, t)) {
25930
- return e.rows.map((e, t) => hb(e.heightRule === "exact", n.top[t] ?? 0, n.bottom[t] ?? 0));
25930
+ return e.rows.map((e, t) => gb(e.heightRule === "exact", n.top[t] ?? 0, n.bottom[t] ?? 0));
25931
25931
  }
25932
25932
  function oM(e) {
25933
25933
  return iM(e, nM(e));
@@ -25975,7 +25975,7 @@ function dM(e, t, n, r, i) {
25975
25975
  f.add(o);
25976
25976
  let s = e.rows[a.rowIndex];
25977
25977
  if (!s) return;
25978
- let u = zj(s), p = c(a.rowIndex, a.input.columnStart), m = c(a.rowIndex, Math.min(e.columnWidthsPt.length, a.input.columnStart + a.input.columnSpan)), { startPt: h, endPt: g } = dy(u, a.input.columnStart, a.input.columnSpan, e.columnWidthsPt.length), _ = Math.min(p, m) + (e.bidiVisual ? g : h), v = Math.max(p, m) - (e.bidiVisual ? h : g), y = l(a.rowIndex) + Bj(e.rows, a.rowIndex).topPt, b = l(a.lastRowIndex + 1) - Bj(e.rows, a.lastRowIndex).bottomPt, x = Zj(a.input, lM, null, a.rowIndex, a.lastRowIndex, e.rows.length, e.columnWidthsPt.length, e.bidiVisual), S = r === "top" ? x.top : x.bottom, C = r === "top" ? y : b;
25978
+ let u = zj(s), p = c(a.rowIndex, a.input.columnStart), m = c(a.rowIndex, Math.min(e.columnWidthsPt.length, a.input.columnStart + a.input.columnSpan)), { startPt: h, endPt: g } = fy(u, a.input.columnStart, a.input.columnSpan, e.columnWidthsPt.length), _ = Math.min(p, m) + (e.bidiVisual ? g : h), v = Math.max(p, m) - (e.bidiVisual ? h : g), y = l(a.rowIndex) + Bj(e.rows, a.rowIndex).topPt, b = l(a.lastRowIndex + 1) - Bj(e.rows, a.lastRowIndex).bottomPt, x = Zj(a.input, lM, null, a.rowIndex, a.lastRowIndex, e.rows.length, e.columnWidthsPt.length, e.bidiVisual), S = r === "top" ? x.top : x.bottom, C = r === "top" ? y : b;
25979
25979
  d(uM(S), i, {
25980
25980
  xPt: _,
25981
25981
  yPt: C
@@ -26015,7 +26015,7 @@ function dM(e, t, n, r, i) {
26015
26015
  return i(t[0] ?? 0, n, (t[0] ?? 0) + s, l(e.rows.length), e.borders), e.rows.forEach((t, n) => {
26016
26016
  let a = Bj(e.rows, n);
26017
26017
  for (let o of t.cells) {
26018
- let s = c(n, o.columnStart), u = c(n, o.columnStart + o.columnSpan), d = dy(t.cellSpacingPt, o.columnStart, o.columnSpan, e.columnWidthsPt.length, !0), f = Zj(o, e.borders, null, n, n, e.rows.length, e.columnWidthsPt.length, e.bidiVisual);
26018
+ let s = c(n, o.columnStart), u = c(n, o.columnStart + o.columnSpan), d = fy(t.cellSpacingPt, o.columnStart, o.columnSpan, e.columnWidthsPt.length, !0), f = Zj(o, e.borders, null, n, n, e.rows.length, e.columnWidthsPt.length, e.bidiVisual);
26019
26019
  i(Math.min(s, u) + (e.bidiVisual ? d.endPt : d.startPt), l(n) + a.topPt + (n === 0 ? r : 0), Math.max(s, u) - (e.bidiVisual ? d.startPt : d.endPt), l(n + 1) - a.bottomPt - (n === e.rows.length - 1 ? r : 0), {
26020
26020
  top: uM(f.top),
26021
26021
  bottom: uM(f.bottom),
@@ -26045,7 +26045,7 @@ function dM(e, t, n, r, i) {
26045
26045
  directEdge: "top"
26046
26046
  }].some(({ side: e, directEdge: t }) => {
26047
26047
  let n = e.owner;
26048
- return n ? vb({
26048
+ return n ? yb({
26049
26049
  spacingPt: a,
26050
26050
  directStyle: n.input.borders[t]?.authoredStyle,
26051
26051
  conditionalInsideStyle: n.input.borders.insideH?.authoredStyle
@@ -26145,11 +26145,11 @@ function dM(e, t, n, r, i) {
26145
26145
  yPt: u
26146
26146
  });
26147
26147
  let p = /* @__PURE__ */ new Set();
26148
- for (let e of n.cells) vb({
26148
+ for (let e of n.cells) yb({
26149
26149
  spacingPt: a,
26150
26150
  directStyle: e.borders.left?.authoredStyle,
26151
26151
  conditionalInsideStyle: e.borders.insideV?.authoredStyle
26152
- }) && p.add(e.columnStart), vb({
26152
+ }) && p.add(e.columnStart), yb({
26153
26153
  spacingPt: a,
26154
26154
  directStyle: e.borders.right?.authoredStyle,
26155
26155
  conditionalInsideStyle: e.borders.insideV?.authoredStyle
@@ -26169,7 +26169,7 @@ function dM(e, t, n, r, i) {
26169
26169
  for (let t of n.cells) {
26170
26170
  let i = Wj(e, n, r, t);
26171
26171
  if (i === "continue") continue;
26172
- let o = i === "restart" ? Uj(e.rows, r, t.columnStart, t.columnSpan) : r, s = c(r, t.columnStart), u = c(r, Math.min(e.columnWidthsPt.length, t.columnStart + t.columnSpan)), { startPt: f, endPt: p } = dy(a, t.columnStart, t.columnSpan, e.columnWidthsPt.length), m = Math.min(s, u) + (e.bidiVisual ? p : f), h = Math.max(s, u) - (e.bidiVisual ? f : p), g = l(r) + Bj(e.rows, r).topPt, _ = l(o + 1) - Bj(e.rows, o).bottomPt, v = Zj(t, lM, null, r, o, e.rows.length, e.columnWidthsPt.length, e.bidiVisual);
26172
+ let o = i === "restart" ? Uj(e.rows, r, t.columnStart, t.columnSpan) : r, s = c(r, t.columnStart), u = c(r, Math.min(e.columnWidthsPt.length, t.columnStart + t.columnSpan)), { startPt: f, endPt: p } = fy(a, t.columnStart, t.columnSpan, e.columnWidthsPt.length), m = Math.min(s, u) + (e.bidiVisual ? p : f), h = Math.max(s, u) - (e.bidiVisual ? f : p), g = l(r) + Bj(e.rows, r).topPt, _ = l(o + 1) - Bj(e.rows, o).bottomPt, v = Zj(t, lM, null, r, o, e.rows.length, e.columnWidthsPt.length, e.bidiVisual);
26173
26173
  d(uM(v.right), "right", {
26174
26174
  xPt: h,
26175
26175
  yPt: g
@@ -26189,7 +26189,7 @@ function dM(e, t, n, r, i) {
26189
26189
  if (!r.diagonalBorders) continue;
26190
26190
  let i = Wj(e, t, n, r);
26191
26191
  if (i === "continue") continue;
26192
- let a = i === "restart" ? Uj(e.rows, n, r.columnStart, r.columnSpan) : n, o = c(n, r.columnStart), s = c(n, Math.min(e.columnWidthsPt.length, r.columnStart + r.columnSpan)), { startPt: u, endPt: f } = dy(zj(t), r.columnStart, r.columnSpan, e.columnWidthsPt.length), p = Math.min(o, s) + (e.bidiVisual ? f : u), m = Math.max(o, s) - (e.bidiVisual ? u : f), h = l(n) + Bj(e.rows, n).topPt, g = l(a + 1) - Bj(e.rows, a).bottomPt, { tl2br: _, tr2bl: v } = r.diagonalBorders;
26192
+ let a = i === "restart" ? Uj(e.rows, n, r.columnStart, r.columnSpan) : n, o = c(n, r.columnStart), s = c(n, Math.min(e.columnWidthsPt.length, r.columnStart + r.columnSpan)), { startPt: u, endPt: f } = fy(zj(t), r.columnStart, r.columnSpan, e.columnWidthsPt.length), p = Math.min(o, s) + (e.bidiVisual ? f : u), m = Math.max(o, s) - (e.bidiVisual ? u : f), h = l(n) + Bj(e.rows, n).topPt, g = l(a + 1) - Bj(e.rows, a).bottomPt, { tl2br: _, tr2bl: v } = r.diagonalBorders;
26193
26193
  d(_, void 0, {
26194
26194
  xPt: p,
26195
26195
  yPt: h
@@ -26208,7 +26208,7 @@ function dM(e, t, n, r, i) {
26208
26208
  }
26209
26209
  function fM(e, t, n, r, i) {
26210
26210
  let a = r.availableBounds, o = e === "center" ? a.xPt + (a.widthPt - i) / 2 : e === "right" ? a.xPt + a.widthPt - i : a.xPt;
26211
- return t === 0 ? o : _b(o, t, n);
26211
+ return t === 0 ? o : vb(o, t, n);
26212
26212
  }
26213
26213
  function pM(e, t) {
26214
26214
  if (t.length === 0) return e;
@@ -26288,7 +26288,7 @@ function _M(e, t, n, r, i, a, o, s = n.heightPt) {
26288
26288
  yPt: n.yPt + e.margins.topPt,
26289
26289
  widthPt: Math.max(0, n.widthPt - e.margins.leftPt - e.margins.rightPt),
26290
26290
  heightPt: r
26291
- }, u = l.widthPt, d = t.inkHeightPt >= u ? -Math.min(0, t.inkTopPt) : e.vAlign === "center" ? (u - t.inkHeightPt) / 2 - t.inkTopPt : e.vAlign === "bottom" ? u - t.inkHeightPt - t.inkTopPt : -Math.min(0, t.inkTopPt), f = Hj(c.mode, l), p = a ? yb({
26291
+ }, u = l.widthPt, d = t.inkHeightPt >= u ? -Math.min(0, t.inkTopPt) : e.vAlign === "center" ? (u - t.inkHeightPt) / 2 - t.inkTopPt : e.vAlign === "bottom" ? u - t.inkHeightPt - t.inkTopPt : -Math.min(0, t.inkTopPt), f = Hj(c.mode, l), p = a ? bb({
26292
26292
  ...n,
26293
26293
  heightPt: s
26294
26294
  }, o.availableBounds) : n;
@@ -26347,7 +26347,7 @@ function vM(e, t, n) {
26347
26347
  yPt: d,
26348
26348
  widthPt: Math.max(0, b - y),
26349
26349
  heightPt: u
26350
- }, S = vS([x, ...v.map((e) => e.inkBounds)]) ?? x;
26350
+ }, S = yS([x, ...v.map((e) => e.inkBounds)]) ?? x;
26351
26351
  return q({
26352
26352
  layout: q({
26353
26353
  kind: "table",
@@ -26376,7 +26376,7 @@ function yM(e) {
26376
26376
  }
26377
26377
  function bM(e, t, n, r, i = e.rows[t]) {
26378
26378
  let { yPt: a, rowOffsetsPt: o, rowHeightsPt: s, rowXPt: c, xPt: l, widthPt: u, columnOffsetsPt: d, flows: f, ruleInsetsPt: p } = n, m = (n) => (c[t] ?? l) + (e.bidiVisual ? u - (d[n] ?? 0) : d[n] ?? 0), h = a + (o[t] ?? 0), g = s[t] ?? 0, _ = c[t] ?? l, v = Bj(e.rows, t), y = zj(i), b = i.cells.map((n) => {
26379
- let s = Wj(e, i, t, n) === "restart", c = s ? Uj(e.rows, t, n.columnStart, n.columnSpan) : t, l = Bj(e.rows, c), u = a + (o[c + 1] ?? o[t + 1] ?? 0) - l.bottomPt, d = m(n.columnStart), _ = m(Math.min(e.columnWidthsPt.length, n.columnStart + n.columnSpan)), b = Math.min(d, _), x = Math.max(d, _), { startPt: S, endPt: C } = dy(y, n.columnStart, n.columnSpan, e.columnWidthsPt.length, i.spacingGeometry !== void 0), w = b + (e.bidiVisual ? C : S), T = x - (e.bidiVisual ? S : C), E = Math.max(0, T - w), D = h + v.topPt + (i.spacingGeometry ? p.top[t] ?? 0 : 0), O = s ? Math.max(0, u - D) : Math.max(0, g - v.topPt - v.bottomPt - (i.spacingGeometry ? (p.top[t] ?? 0) + (p.bottom[t] ?? 0) : 0)), k = f.get(n.id) ?? Ij([]), A = {
26379
+ let s = Wj(e, i, t, n) === "restart", c = s ? Uj(e.rows, t, n.columnStart, n.columnSpan) : t, l = Bj(e.rows, c), u = a + (o[c + 1] ?? o[t + 1] ?? 0) - l.bottomPt, d = m(n.columnStart), _ = m(Math.min(e.columnWidthsPt.length, n.columnStart + n.columnSpan)), b = Math.min(d, _), x = Math.max(d, _), { startPt: S, endPt: C } = fy(y, n.columnStart, n.columnSpan, e.columnWidthsPt.length, i.spacingGeometry !== void 0), w = b + (e.bidiVisual ? C : S), T = x - (e.bidiVisual ? S : C), E = Math.max(0, T - w), D = h + v.topPt + (i.spacingGeometry ? p.top[t] ?? 0 : 0), O = s ? Math.max(0, u - D) : Math.max(0, g - v.topPt - v.bottomPt - (i.spacingGeometry ? (p.top[t] ?? 0) + (p.bottom[t] ?? 0) : 0)), k = f.get(n.id) ?? Ij([]), A = {
26380
26380
  ...n.margins,
26381
26381
  topPt: n.margins.topPt + (i.spacingGeometry?.borderPt ?? p.top[t] ?? 0),
26382
26382
  bottomPt: n.margins.bottomPt + (i.spacingGeometry?.borderPt ?? p.bottom[c] ?? 0)
@@ -26400,13 +26400,13 @@ function bM(e, t, n, r, i = e.rows[t]) {
26400
26400
  yPt: D,
26401
26401
  widthPt: E,
26402
26402
  heightPt: O
26403
- }, R = n.verticalMerge !== "continue" && M ? yb({
26403
+ }, R = n.verticalMerge !== "continue" && M ? bb({
26404
26404
  ...L,
26405
26405
  heightPt: Math.max(0, O - (p.bottom[c] ?? 0))
26406
26406
  }, r.availableBounds) : void 0, z = n.verticalMerge === "continue" ? [] : k.blocks.map((e) => ({
26407
26407
  ...e,
26408
26408
  offsetPt: F + e.offsetPt
26409
- })), B = vS([L, ...z.map((e) => gM(e, I.xPt, L.yPt)).map((e) => R ? hM(e, R) : e).filter((e) => e !== null)]) ?? L;
26409
+ })), B = yS([L, ...z.map((e) => gM(e, I.xPt, L.yPt)).map((e) => R ? hM(e, R) : e).filter((e) => e !== null)]) ?? L;
26410
26410
  return {
26411
26411
  kind: "table-cell",
26412
26412
  id: n.id,
@@ -26429,7 +26429,7 @@ function bM(e, t, n, r, i = e.rows[t]) {
26429
26429
  yPt: h,
26430
26430
  widthPt: u,
26431
26431
  heightPt: g
26432
- }, S = vS([x, ...b.map((e) => e.inkBounds)]) ?? x;
26432
+ }, S = yS([x, ...b.map((e) => e.inkBounds)]) ?? x;
26433
26433
  return {
26434
26434
  kind: "table-row",
26435
26435
  id: i.id,
@@ -26649,7 +26649,7 @@ function CM(e, t) {
26649
26649
  } });
26650
26650
  }
26651
26651
  function wM(e) {
26652
- return typeof e == "string" && Lx(e);
26652
+ return typeof e == "string" && Rx(e);
26653
26653
  }
26654
26654
  function TM(e) {
26655
26655
  return e === "btLr";
@@ -26657,17 +26657,17 @@ function TM(e) {
26657
26657
  function EM(e, t) {
26658
26658
  return {
26659
26659
  ...e,
26660
- ...Fx(e, t)
26660
+ ...Ix(e, t)
26661
26661
  };
26662
26662
  }
26663
26663
  function DM(e, t) {
26664
26664
  return {
26665
26665
  ...e,
26666
- ...Ix(e, t)
26666
+ ...Lx(e, t)
26667
26667
  };
26668
26668
  }
26669
26669
  function OM(e, t, n) {
26670
- let r = t.firstRowException, i = r?.indentAuthored ? r.indentPt ?? 0 : e.tblInd ?? 0, a = t.ordinaryFlow && e.widthPct == null && (!r?.preferredWidthAuthored || r.preferredWidth?.kind !== "pct") && (r?.layout === "fixed" || e.layout === "fixed" || (r?.preferredWidthAuthored ? r.preferredWidth?.kind === "dxa" && r.preferredWidth.value > 0 : e.widthPt != null && e.widthPt > 0)) && e.rows.every((e) => e.cells.every((e) => e.widthPt != null && e.widthPt > 0 && e.widthPct == null)) && t.rows.every((e) => e.cellSpacingPt === 0), o = fb(n) && a && t.rows.every((e) => e.cells[0]?.originLeftMarginPt != null), s = db(n) && a && t.rows.every((e) => e.cells.every((e) => e.horizontalMarginsOmitted === !0)), c = r?.indentAuthored || e.tblInd != null;
26670
+ let r = t.firstRowException, i = r?.indentAuthored ? r.indentPt ?? 0 : e.tblInd ?? 0, a = t.ordinaryFlow && e.widthPct == null && (!r?.preferredWidthAuthored || r.preferredWidth?.kind !== "pct") && (r?.layout === "fixed" || e.layout === "fixed" || (r?.preferredWidthAuthored ? r.preferredWidth?.kind === "dxa" && r.preferredWidth.value > 0 : e.widthPt != null && e.widthPt > 0)) && e.rows.every((e) => e.cells.every((e) => e.widthPt != null && e.widthPt > 0 && e.widthPct == null)) && t.rows.every((e) => e.cellSpacingPt === 0), o = pb(n) && a && t.rows.every((e) => e.cells[0]?.originLeftMarginPt != null), s = fb(n) && a && t.rows.every((e) => e.cells.every((e) => e.horizontalMarginsOmitted === !0)), c = r?.indentAuthored || e.tblInd != null;
26671
26671
  return {
26672
26672
  measuredOrigin: o,
26673
26673
  omittedMarginEndOrigin: s,
@@ -26685,14 +26685,14 @@ var kM = Object.freeze({
26685
26685
  spacingGeometry: null
26686
26686
  });
26687
26687
  function AM(e, t, n, r, i, a, o = r, s = !1, c = !1, l = kM) {
26688
- let { marginHang: u, nestedNegativeIndentIgnored: d, contentFitted: f, spacingGeometry: p } = l, m = t.format, h = m.firstRowException, g = o ? n.tableIndentPt : h?.indentAuthored ? h.indentPt ?? 0 : e.tblInd ?? 0, _ = o ? n.tableIndentPt : Number.isFinite(e.tblInd) ? e.tblInd ?? 0 : 0, v = o ? n.tableIndentInherited : !h?.indentAuthored && e.tblIndInherited === !0, y = o ? n.tableIndentInherited : e.tblIndInherited === !0, b = (e) => e == null || e === "left" || e === "start" || e === "both", x = (e, t, n) => n && !b(e) ? 0 : d && b(e) ? Math.max(0, t) : t, S = (e) => r || s && e === "end" || u === "all" || u === "leading" && b(e), C = (e, t, n = y) => kb({
26688
+ let { marginHang: u, nestedNegativeIndentIgnored: d, contentFitted: f, spacingGeometry: p } = l, m = t.format, h = m.firstRowException, g = o ? n.tableIndentPt : h?.indentAuthored ? h.indentPt ?? 0 : e.tblInd ?? 0, _ = o ? n.tableIndentPt : Number.isFinite(e.tblInd) ? e.tblInd ?? 0 : 0, v = o ? n.tableIndentInherited : !h?.indentAuthored && e.tblIndInherited === !0, y = o ? n.tableIndentInherited : e.tblIndInherited === !0, b = (e) => e == null || e === "left" || e === "start" || e === "both", x = (e, t, n) => n && !b(e) ? 0 : d && b(e) ? Math.max(0, t) : t, S = (e) => r || s && e === "end" || u === "all" || u === "leading" && b(e), C = (e, t, n = y) => Ab({
26689
26689
  measured: f ? r || s && e === "end" : S(e) || c,
26690
26690
  justification: e,
26691
26691
  indentPt: x(e, t, n)
26692
26692
  }), w = m.rows.map((t) => {
26693
26693
  let n = !o && t.exception?.indentAuthored === !0;
26694
26694
  return C(t.justification ?? e.jc, n ? t.exception?.indentPt ?? 0 : _, !n && y);
26695
- }), T = m.rows.map((t) => p ? lb({
26695
+ }), T = m.rows.map((t) => p ? ub({
26696
26696
  mode: a.mode,
26697
26697
  justification: t.justification ?? e.jc,
26698
26698
  bidi: e.bidiVisual === !0,
@@ -26701,7 +26701,7 @@ function AM(e, t, n, r, i, a, o = r, s = !1, c = !1, l = kM) {
26701
26701
  ...p,
26702
26702
  leadingMarginPt: e.bidiVisual ? t.cells[0]?.marginsPt.right ?? 0 : t.cells[0]?.marginsPt.left ?? 0,
26703
26703
  trailingMarginPt: e.bidiVisual ? t.cells.at(-1)?.marginsPt.left ?? 0 : t.cells.at(-1)?.marginsPt.right ?? 0
26704
- }) : Ab({
26704
+ }) : jb({
26705
26705
  mode: a.mode,
26706
26706
  measured: S(t.justification ?? e.jc),
26707
26707
  justification: t.justification ?? e.jc,
@@ -26725,12 +26725,12 @@ function AM(e, t, n, r, i, a, o = r, s = !1, c = !1, l = kM) {
26725
26725
  if (r === "right") return a.contentX + i + o;
26726
26726
  let s = a.contentX + i / 2 + o;
26727
26727
  return 2 * Math.min(s, a.pageWidth - s);
26728
- })), N = zy(t, i) !== null, P = (e.colWidths ?? []).reduce((e, t) => e + (Number.isFinite(t) ? Math.max(0, t) : 0), 0), F = A.every(({ justification: e, indentPt: t }) => !(e === "center" || e === "right" || e === "end") || Math.abs(P + t - i) <= 1e-9), I = a.mode, L = I === void 0 || I === 14 || I === 15, R = E !== "fixed" && m.ordinaryFlow && O && !wM(a.textDirection) && !N && L && F, z = p ? f ? "nonbinding" : "none" : R ? "band" : f ? "nonbinding" : "none", B = I === void 0 || I === 14, V = R ? Math.max(0, Math.min(...A.map(({ justification: e, indentPt: t }) => e !== "center" && !(e === "right" || e === "end") || B ? i - t : i))) : i, H = E === "fixed" || !m.ordinaryFlow || a.story === "textbox" || k && !R || wM(a.textDirection) || a.inTableCell || m.rows.length === 0 ? 0 : m.rows.reduce((t, n, r) => {
26728
+ })), N = By(t, i) !== null, P = (e.colWidths ?? []).reduce((e, t) => e + (Number.isFinite(t) ? Math.max(0, t) : 0), 0), F = A.every(({ justification: e, indentPt: t }) => !(e === "center" || e === "right" || e === "end") || Math.abs(P + t - i) <= 1e-9), I = a.mode, L = I === void 0 || I === 14 || I === 15, R = E !== "fixed" && m.ordinaryFlow && O && !wM(a.textDirection) && !N && L && F, z = p ? f ? "nonbinding" : "none" : R ? "band" : f ? "nonbinding" : "none", B = I === void 0 || I === 14, V = R ? Math.max(0, Math.min(...A.map(({ justification: e, indentPt: t }) => e !== "center" && !(e === "right" || e === "end") || B ? i - t : i))) : i, H = E === "fixed" || !m.ordinaryFlow || a.story === "textbox" || k && !R || wM(a.textDirection) || a.inTableCell || m.rows.length === 0 ? 0 : m.rows.reduce((t, n, r) => {
26729
26729
  let i = e.rows[r];
26730
26730
  if (!i || (i.gridBefore ?? 0) > 0 || (i.gridAfter ?? 0) > 0) return 0;
26731
26731
  let a = n.cells[0]?.marginsPt, o = n.cells.at(-1)?.marginsPt, s = a?.left, c = o?.right, l = typeof s == "number" && Number.isFinite(s) && typeof c == "number" && Number.isFinite(c) ? Math.max(0, s) + Math.max(0, c) : 0;
26732
26732
  return Math.min(t, l);
26733
- }, Infinity), U = R ? H : Math.min(H, Math.max(0, P - i)), ee = R ? B ? H : 0 : Math.min(H, Math.max(0, P - i)), W = (k && !R ? Math.max(i, M) : V) + ee, te = E !== "fixed" && !a.inTableCell ? By(t) : null, ne = te === null ? W : Math.max(W, Math.min(te, P)), re = E === "fixed" && a.inTableCell, ie = m.rows[0]?.cells, ae = u === "all" && a.mode !== 15 && O && ie ? i + Math.max(0, ie[0]?.marginsPt.left ?? 0) + Math.max(0, ie.at(-1)?.marginsPt.right ?? 0) : i;
26733
+ }, Infinity), U = R ? H : Math.min(H, Math.max(0, P - i)), ee = R ? B ? H : 0 : Math.min(H, Math.max(0, P - i)), W = (k && !R ? Math.max(i, M) : V) + ee, te = E !== "fixed" && !a.inTableCell ? Vy(t) : null, ne = te === null ? W : Math.max(W, Math.min(te, P)), re = E === "fixed" && a.inTableCell, ie = m.rows[0]?.cells, ae = u === "all" && a.mode !== 15 && O && ie ? i + Math.max(0, ie[0]?.marginsPt.left ?? 0) + Math.max(0, ie.at(-1)?.marginsPt.right ?? 0) : i;
26734
26734
  return Object.freeze({
26735
26735
  source: t,
26736
26736
  tableIndentPt: d && b(e.jc) ? Math.max(0, g) : g,
@@ -26749,10 +26749,10 @@ function jM(e, t, n, r, i, a = !0, o = !0, s) {
26749
26749
  let c = t.format.outerEdgeIndent === !0 && i.mode !== void 0 ? {
26750
26750
  ...i,
26751
26751
  mode: void 0
26752
- } : i, l = OM(e, t.format, c.mode), u = c.topLevel && c.story === "body", d = a && o && u && l.measuredOrigin && t.format.outerEdgeIndent !== !0, f = a && o && u && l.omittedMarginEndOrigin && t.format.outerEdgeIndent !== !0, p = Xy(t, r, () => ({
26752
+ } : i, l = OM(e, t.format, c.mode), u = c.topLevel && c.story === "body", d = a && o && u && l.measuredOrigin && t.format.outerEdgeIndent !== !0, f = a && o && u && l.omittedMarginEndOrigin && t.format.outerEdgeIndent !== !0, p = Zy(t, r, () => ({
26753
26753
  minWidthPt: 0,
26754
26754
  maxWidthPt: 0
26755
- }), r), m = a && o && u && t.format.ordinaryFlow && e.widthPct == null && t.format.firstRowException?.preferredWidth?.kind !== "pct" && t.format.rows.every((e) => e.cellSpacingPt === 0), h = jb(p, c.mode, m) !== p, g = d || h, _ = t.format, v = _.firstRowException != null || _.rows.some((e) => e.exception != null || e.justification != null), y = e.rows.some((e) => (e.gridBefore ?? 0) > 0 || (e.gridAfter ?? 0) > 0) || t.lexical.rows.some((e) => e.row?.gridSkipAuthored === !0), b = n.length <= 1, x = p.layout !== "fixed" && p.tablePreferredWidthPt === null && p.rows.every((e) => e.cells.every((e) => e.preferredWidth === null)), S = _.rows[0]?.cellSpacingPt ?? 0, C = S > 0 ? cb(e) : null, w = S > 0 && C !== null && b && a && o && u && c.singleColumn && !c.inTableCell && !wM(c.textDirection) && c.quarterTurnedStory !== !0 && _.ordinaryFlow && _.positioning == null && _.outerEdgeIndent !== !0 && !v && !y && t.lexical.rows.every(({ row: e }) => e?.cellSpacing == null && e?.exception?.cellSpacing == null) && fb(c.mode) && _.rows.every((e) => e.cellSpacingPt === S && e.height == null && e.cells.every((e) => e.dxaHorizontalMarginsOnly === !0)) && (p.layout === "fixed" && e.widthPt != null && e.widthPt > (p.gridWidthsPt.length + 1) * 2 * S && e.widthPct == null || x && p.gridWidthsPt.length > 0 && r > (p.gridWidthsPt.length + 1) * 2 * S && p.rows.every((e) => e.cells.length === p.gridWidthsPt.length && e.cells.every((e, t) => e.columnSpan === 1 && e.columnStart === t))) ? Object.freeze({
26755
+ }), r), m = a && o && u && t.format.ordinaryFlow && e.widthPct == null && t.format.firstRowException?.preferredWidth?.kind !== "pct" && t.format.rows.every((e) => e.cellSpacingPt === 0), h = Mb(p, c.mode, m) !== p, g = d || h, _ = t.format, v = _.firstRowException != null || _.rows.some((e) => e.exception != null || e.justification != null), y = e.rows.some((e) => (e.gridBefore ?? 0) > 0 || (e.gridAfter ?? 0) > 0) || t.lexical.rows.some((e) => e.row?.gridSkipAuthored === !0), b = n.length <= 1, x = p.layout !== "fixed" && p.tablePreferredWidthPt === null && p.rows.every((e) => e.cells.every((e) => e.preferredWidth === null)), S = _.rows[0]?.cellSpacingPt ?? 0, C = S > 0 ? lb(e) : null, w = S > 0 && C !== null && b && a && o && u && c.singleColumn && !c.inTableCell && !wM(c.textDirection) && c.quarterTurnedStory !== !0 && _.ordinaryFlow && _.positioning == null && _.outerEdgeIndent !== !0 && !v && !y && t.lexical.rows.every(({ row: e }) => e?.cellSpacing == null && e?.exception?.cellSpacing == null) && pb(c.mode) && _.rows.every((e) => e.cellSpacingPt === S && e.height == null && e.cells.every((e) => e.dxaHorizontalMarginsOnly === !0)) && (p.layout === "fixed" && e.widthPt != null && e.widthPt > (p.gridWidthsPt.length + 1) * 2 * S && e.widthPct == null || x && p.gridWidthsPt.length > 0 && r > (p.gridWidthsPt.length + 1) * 2 * S && p.rows.every((e) => e.cells.length === p.gridWidthsPt.length && e.cells.every((e, t) => e.columnSpan === 1 && e.columnStart === t))) ? Object.freeze({
26756
26756
  spacingPt: S,
26757
26757
  borderPt: C
26758
26758
  }) : null;
@@ -26764,7 +26764,7 @@ function jM(e, t, n, r, i, a = !0, o = !0, s) {
26764
26764
  });
26765
26765
  s?.(n) !== !0 && (w = null);
26766
26766
  }
26767
- let T = x && b && _.ordinaryFlow && _.positioning == null && _.outerEdgeIndent !== !0 && !v && !y && _.rows.every((e) => (e.cellSpacingPt === 0 || w !== null) && e.cells.every((e) => e.dxaHorizontalMarginsOnly === !0)) && (p.gridWidthsPt.length === 2 || w !== null) && p.rows.every((e) => e.cells.length === p.gridWidthsPt.length && e.cells.every((e, t) => e.columnSpan === 1 && e.columnStart === t)) && c.topLevel && !wM(c.textDirection) && c.quarterTurnedStory !== !0 && (c.story === "header" || c.story === "footer" || c.story === "body" && c.singleColumn) && fb(c.mode), E = sb({
26767
+ let T = x && b && _.ordinaryFlow && _.positioning == null && _.outerEdgeIndent !== !0 && !v && !y && _.rows.every((e) => (e.cellSpacingPt === 0 || w !== null) && e.cells.every((e) => e.dxaHorizontalMarginsOnly === !0)) && (p.gridWidthsPt.length === 2 || w !== null) && p.rows.every((e) => e.cells.length === p.gridWidthsPt.length && e.cells.every((e, t) => e.columnSpan === 1 && e.columnStart === t)) && c.topLevel && !wM(c.textDirection) && c.quarterTurnedStory !== !0 && (c.story === "header" || c.story === "footer" || c.story === "body" && c.singleColumn) && pb(c.mode), E = cb({
26768
26768
  mode: c.mode,
26769
26769
  story: c.story,
26770
26770
  topLevel: c.topLevel,
@@ -26778,7 +26778,7 @@ function jM(e, t, n, r, i, a = !0, o = !0, s) {
26778
26778
  rowOverrides: v,
26779
26779
  gridSkips: y,
26780
26780
  unfittedContentSizedAutoFit: x && !T
26781
- }), D = E && !c.topLevel && c.story === "body" && c.tableCellDepth === 1 && l.effectiveLayout === "fixed" && _.rows.every((e) => e.cellSpacingPt === 0), O = d || !E || !b ? "none" : ub({
26781
+ }), D = E && !c.topLevel && c.story === "body" && c.tableCellDepth === 1 && l.effectiveLayout === "fixed" && _.rows.every((e) => e.cellSpacingPt === 0), O = d || !E || !b ? "none" : db({
26782
26782
  mode: c.mode,
26783
26783
  story: c.story,
26784
26784
  topLevel: c.topLevel,
@@ -27013,10 +27013,10 @@ function VM(e, t, n) {
27013
27013
  }
27014
27014
  var HM = Object.freeze({ kind: "cell" });
27015
27015
  function UM(e) {
27016
- return Mb(e.kind === "story-root" ? e.story : null);
27016
+ return Nb(e.kind === "story-root" ? e.story : null);
27017
27017
  }
27018
27018
  function WM(e, t) {
27019
- let n = Nb(e);
27019
+ let n = Pb(e);
27020
27020
  return n ? Object.freeze({
27021
27021
  framePr: n,
27022
27022
  source: Object.freeze({
@@ -27039,7 +27039,7 @@ var KM = /* @__PURE__ */ new WeakMap();
27039
27039
  function qM(e) {
27040
27040
  let t = e.rows;
27041
27041
  if (!t.some((e) => e.ownerCarrier)) return null;
27042
- let n = t.map((e) => e.ownerCarrier ? Pb(e.ownerCarrier.framePr) : null), r = [], i = 0;
27042
+ let n = t.map((e) => e.ownerCarrier ? Fb(e.ownerCarrier.framePr) : null), r = [], i = 0;
27043
27043
  for (let e = 1; e <= t.length; e += 1) {
27044
27044
  if (e < t.length && n[e] === n[i]) continue;
27045
27045
  let a = t[i].ownerCarrier;
@@ -27368,7 +27368,7 @@ function PN(e, t, n, r, i, a, o, s = HM) {
27368
27368
  left: n.marginLeft ?? e.cellMarginLeft
27369
27369
  }, m = s, h = Math.min(Math.max(1, n.colSpan), Math.max(0, t.length - m));
27370
27370
  s += h;
27371
- let g = t.slice(m, m + h).reduce((e, t) => e + t, 0), _ = dy(o?.cellSpacingPt ?? 0, m, h, t.length, p.spacingGeometry !== null), x = 2 * (p.spacingGeometry?.borderPt ?? 0), S = [
27371
+ let g = t.slice(m, m + h).reduce((e, t) => e + t, 0), _ = fy(o?.cellSpacingPt ?? 0, m, h, t.length, p.spacingGeometry !== null), x = 2 * (p.spacingGeometry?.borderPt ?? 0), S = [
27372
27372
  ...l,
27373
27373
  i,
27374
27374
  c
@@ -27943,7 +27943,7 @@ var wP = Object.freeze({
27943
27943
  hostFlows: []
27944
27944
  });
27945
27945
  function TP(e, t, n, r, i, a) {
27946
- let o = (e, i) => r.paragraphAnchorReferenceDeltaPt !== void 0 && n === "source" && (!a || a.rowIndex === 0 && a.rowFragmentIndex === 0 && a.cells.length === 0) && t.logicalRowIndex === 0 && !t.repeatedHeader && e === 0 && i === 0 && ib(t.cells[e]);
27946
+ let o = (e, i) => r.paragraphAnchorReferenceDeltaPt !== void 0 && n === "source" && (!a || a.rowIndex === 0 && a.rowFragmentIndex === 0 && a.cells.length === 0) && t.logicalRowIndex === 0 && !t.repeatedHeader && e === 0 && i === 0 && ab(t.cells[e]);
27947
27947
  if (!mN(e, t, r.chargeSourceScan) && !o(0, 0)) return null;
27948
27948
  let s = r.pagePlacement;
27949
27949
  if (!s) return null;
@@ -28470,7 +28470,7 @@ function BP(e, t, n, r, i, a, o, s) {
28470
28470
  blocks: []
28471
28471
  }))
28472
28472
  }, h = m && s?.current(m), g = m && s?.fresh(m), _ = Math.max(0, h ? o.availableHeightPt - (h.flowBounds.yPt + h.heightPt - o.placement.cursor.yPt) : r - l - d - p), v = Math.max(0, g ? o.freshPageHeightPt - (g.flowBounds.yPt + g.heightPt - o.placement.cursor.yPt) : i - l - d - p), y = t.cells.map((t, n) => zP(e, t, c[n], _, v, a, o)), b = (e, t) => e.next.blockIndex !== c[t]?.blockIndex || e.next.paragraphLineStart !== c[t]?.paragraphLineStart || e.next.nestedFragmentIndex !== c[t]?.nestedFragmentIndex, x = y.some((e, n) => !e.complete && !b(e, n) && t.cells[n]?.blocks[c[n]?.blockIndex ?? 0]?.layout.kind === "paragraph");
28473
- if (Sb({
28473
+ if (Cb({
28474
28474
  compatibility: o.compatibility,
28475
28475
  hasUnfinishedParagraphWithoutProgress: x
28476
28476
  }) || !y.some(b)) return {
@@ -28715,7 +28715,7 @@ function qP(e, t, n, r) {
28715
28715
  nextCursor: t,
28716
28716
  requiresFreshPage: !0
28717
28717
  });
28718
- if (bb({
28718
+ if (xb({
28719
28719
  compatibility: n.compatibility,
28720
28720
  availableHeightPt: n.availableHeightPt,
28721
28721
  freshPageHeightPt: n.freshPageHeightPt,
@@ -28729,7 +28729,7 @@ function qP(e, t, n, r) {
28729
28729
  break;
28730
28730
  }
28731
28731
  }
28732
- if (j && xb({
28732
+ if (j && Sb({
28733
28733
  compatibility: n.compatibility,
28734
28734
  heightRule: N.heightRule,
28735
28735
  repeatedHeader: N.repeatedHeader,
@@ -28802,7 +28802,7 @@ function qP(e, t, n, r) {
28802
28802
  });
28803
28803
  }
28804
28804
  let k = VP(e, i, n), A = n.placement.cursor.yPt + n.availableHeightPt;
28805
- for (; pb({
28805
+ for (; mb({
28806
28806
  compatibility: n.compatibility,
28807
28807
  availableHeightPt: n.availableHeightPt,
28808
28808
  freshPageHeightPt: n.freshPageHeightPt,
@@ -28977,7 +28977,7 @@ function cF(e = () => !1, t) {
28977
28977
  fragment: Object.freeze({
28978
28978
  ...p,
28979
28979
  flowBounds: g,
28980
- inkBounds: l ? Object.freeze(vS([p.inkBounds, g])) : g,
28980
+ inkBounds: l ? Object.freeze(yS([p.inkBounds, g])) : g,
28981
28981
  advancePt: h,
28982
28982
  trailing: m
28983
28983
  }),
@@ -29112,7 +29112,7 @@ function lF(e, t, n, r, i, a, o = Infinity, s) {
29112
29112
  ...e.story,
29113
29113
  blocks: Object.freeze(_),
29114
29114
  flowBounds: S,
29115
- inkBounds: a ? Object.freeze(vS([S, ..._.map((e) => e.inkBounds)])) : S,
29115
+ inkBounds: a ? Object.freeze(yS([S, ..._.map((e) => e.inkBounds)])) : S,
29116
29116
  advancePt: g - h
29117
29117
  }), w = Object.freeze({
29118
29118
  ...e.flowBounds,
@@ -29123,7 +29123,7 @@ function lF(e, t, n, r, i, a, o = Infinity, s) {
29123
29123
  ...e,
29124
29124
  story: C,
29125
29125
  flowBounds: w,
29126
- inkBounds: a ? Object.freeze(vS([w, C.inkBounds])) : w,
29126
+ inkBounds: a ? Object.freeze(yS([w, C.inkBounds])) : w,
29127
29127
  advancePt: g
29128
29128
  }),
29129
29129
  nextCursor: v,
@@ -29154,7 +29154,7 @@ function uF(e, t) {
29154
29154
  receiver: Object.freeze({
29155
29155
  ...t,
29156
29156
  flowBounds: l,
29157
- inkBounds: Object.freeze(vS([t.inkBounds, l])),
29157
+ inkBounds: Object.freeze(yS([t.inkBounds, l])),
29158
29158
  advancePt: c,
29159
29159
  trailing: s
29160
29160
  })
@@ -29409,7 +29409,7 @@ function OF(e, t, n) {
29409
29409
  for (let e of l) {
29410
29410
  let n = a[e];
29411
29411
  if (n.kind === "paragraph" && n.ordinaryFlow && y) {
29412
- let e = DF(n, b, Math.max(1, y.countBy), Dx(y.distance), t);
29412
+ let e = DF(n, b, Math.max(1, y.countBy), Ox(y.distance), t);
29413
29413
  n = e.paragraph, b = e.counterEnd;
29414
29414
  }
29415
29415
  v !== 0 && (n.ordinaryFlow || n.sectionFlowOwnership === "host-flow") && (n.kind === "paragraph" || n.kind === "table") && (n = wo(n, {
@@ -29771,11 +29771,11 @@ function cI(e) {
29771
29771
  return t;
29772
29772
  }
29773
29773
  function lI(e, t) {
29774
- return zx(e.context, e.pageLayout, t);
29774
+ return Bx(e.context, e.pageLayout, t);
29775
29775
  }
29776
29776
  function uI(e, t) {
29777
29777
  let n = lI(e, t);
29778
- return jx({
29778
+ return Mx({
29779
29779
  sectionOccurrenceId: e.sectionOccurrenceId,
29780
29780
  geometry: n.geometry,
29781
29781
  columns: n.columns,
@@ -29851,7 +29851,7 @@ function _I(e) {
29851
29851
  return Object.freeze({
29852
29852
  pageIndex: e.flow.pageIndex,
29853
29853
  columnIndex: e.flow.columnIndex,
29854
- flowDomainId: Jx(e.flow.pageIndex, t.id, e.flow.columnIndex),
29854
+ flowDomainId: Yx(e.flow.pageIndex, t.id, e.flow.columnIndex),
29855
29855
  section: t.section,
29856
29856
  cursorPt: Object.freeze({
29857
29857
  xPt: r.inlineStartPt,
@@ -29921,7 +29921,7 @@ function vI(e, t) {
29921
29921
  })(), l = Object.freeze([...a.slice(0, -1), c]);
29922
29922
  return Object.freeze({
29923
29923
  ...e,
29924
- accumulator: mS(Object.freeze({
29924
+ accumulator: hS(Object.freeze({
29925
29925
  ...e.accumulator,
29926
29926
  sectionRegions: l
29927
29927
  }), dI(i, r.pageIndex, s, r.regionStartBlockPt, t.columnSubset))
@@ -29932,7 +29932,7 @@ function vI(e, t) {
29932
29932
  function yI(e, t, n, r, i, a, o, s) {
29933
29933
  let c = e.pages.at(-1);
29934
29934
  if (!c || c.kind !== "content") throw Error("Body content requires an active page");
29935
- let l = hI(e), u = l.columnIndexes ?? l.section.columns.map((e, t) => t), d = l.columns[u.indexOf(e.flow.columnIndex)], f = Jx(e.flow.pageIndex, l.id, e.flow.columnIndex), p = Qr(n, f, i);
29935
+ let l = hI(e), u = l.columnIndexes ?? l.section.columns.map((e, t) => t), d = l.columns[u.indexOf(e.flow.columnIndex)], f = Yx(e.flow.pageIndex, l.id, e.flow.columnIndex), p = Qr(n, f, i);
29936
29936
  if (a.has(p)) throw Error(`Duplicate body occurrence acceptance: ${p}`);
29937
29937
  a.add(p);
29938
29938
  let m = To(t, {
@@ -29973,7 +29973,7 @@ function yI(e, t, n, r, i, a, o, s) {
29973
29973
  blockStartPt: b.blockStartPt,
29974
29974
  blockEndPt: b.blockEndPt
29975
29975
  }));
29976
- let x = hS(c.accumulator, {
29976
+ let x = gS(c.accumulator, {
29977
29977
  layer: "body",
29978
29978
  node: v,
29979
29979
  ...s?.coordinateSpace === "upright-physical" ? { coordinateSpace: "upright-physical" } : {}
@@ -30074,13 +30074,13 @@ function EI(e) {
30074
30074
  pageIndex: e.accumulator.pageIndex,
30075
30075
  sectionRegions: e.accumulator.sectionRegions.map((t) => ({
30076
30076
  sectionOccurrenceId: t.sectionOccurrenceId,
30077
- flowDomainIds: (t.columnIndexes ?? t.section.columns.map((e, t) => t)).map((n) => Jx(e.accumulator.pageIndex, t.id, n))
30077
+ flowDomainIds: (t.columnIndexes ?? t.section.columns.map((e, t) => t)).map((n) => Yx(e.accumulator.pageIndex, t.id, n))
30078
30078
  })),
30079
30079
  contentFlowDomainIds: e.accumulator.readingOrder.map((e) => e.flowDomainId)
30080
30080
  };
30081
30081
  }
30082
30082
  function DI(e, t, n, r, i) {
30083
- let a = n?.sectionOccurrenceId !== e.sectionOccurrenceId, o = a && e.pageNumbering.start !== null ? Ox(e.pageNumbering.start, t, r ?? t) : (n?.displayNumber ?? 0) + 1;
30083
+ let a = n?.sectionOccurrenceId !== e.sectionOccurrenceId, o = a && e.pageNumbering.start !== null ? kx(e.pageNumbering.start, t, r ?? t) : (n?.displayNumber ?? 0) + 1;
30084
30084
  return {
30085
30085
  owner: e,
30086
30086
  pageIndex: t,
@@ -30098,7 +30098,7 @@ function DI(e, t, n, r, i) {
30098
30098
  function OI(e, t) {
30099
30099
  let n = PF(e.pages.map(EI)), r, i = [], a = e.pages.map((e) => {
30100
30100
  let a = t.get(e.accumulator.sectionOccurrenceId), o = DI(a, e.accumulator.pageIndex, r, n.get(a.sectionOccurrenceId), e.kind === "parity-blank"), { pageNumber: s, firstPageOfSection: c } = o;
30101
- return r = s, i.push(o), e.kind === "parity-blank" ? _S({
30101
+ return r = s, i.push(o), e.kind === "parity-blank" ? vS({
30102
30102
  pageIndex: e.accumulator.pageIndex,
30103
30103
  physicalPage: e.accumulator.physicalPage,
30104
30104
  sectionOccurrenceId: e.accumulator.sectionOccurrenceId,
@@ -30106,7 +30106,7 @@ function OI(e, t) {
30106
30106
  pageBorders: e.accumulator.pageBorders,
30107
30107
  firstSectionOwnedPage: c,
30108
30108
  pageNumber: s
30109
- }) : gS(e.accumulator, s, c);
30109
+ }) : _S(e.accumulator, s, c);
30110
30110
  }), o = /* @__PURE__ */ new WeakSet();
30111
30111
  return {
30112
30112
  layout: {
@@ -30982,7 +30982,7 @@ function* NI(e, t, n, r, i, a, o, s, c = null) {
30982
30982
  continue;
30983
30983
  }
30984
30984
  }
30985
- let x = l.boundary === null && c.inkless === !0 && !c.keepNext && wI(s.layout) ? Je(s.layout, a.availableBounds.widthPt).reservePt : 0, S = (r[C.flow.pageIndex]?.bottom ?? 0) === 0 && C.footnoteReservePt === 0, w = gI(C) === hI(C).blockEndPt, T = y?.kind === "begin-section" && y.section.startType === "nextPage", k = kx({
30985
+ let x = l.boundary === null && c.inkless === !0 && !c.keepNext && wI(s.layout) ? Je(s.layout, a.availableBounds.widthPt).reservePt : 0, S = (r[C.flow.pageIndex]?.bottom ?? 0) === 0 && C.footnoteReservePt === 0, w = gI(C) === hI(C).blockEndPt, T = y?.kind === "begin-section" && y.section.startType === "nextPage", k = Ax({
30986
30986
  hasContinuationBoundary: l.boundary !== null,
30987
30987
  inkless: c.inkless === !0,
30988
30988
  undecorated: wI(s.layout),
@@ -31451,7 +31451,7 @@ function BI(e, t, n, r, i) {
31451
31451
  if (!(Object.values(l.headers).some((e) => e !== null) || Object.values(l.footers).some((e) => e !== null) || (r.get(s.pageIndex)?.length ?? 0) > 0 || (i.get(s.pageIndex)?.length ?? 0) > 0)) return s;
31452
31452
  throw Error("Page-story composition requires a story-capable layout session");
31453
31453
  }
31454
- let u = Cs(s.section) !== "horizontal-tb", d = u ? Ix(s.section.geometry, s.section.sectionFlow) : s.section.geometry, f = Math.abs(d.marginLeft), p = Math.max(0, d.pageWidth - Math.abs(d.marginLeft) - Math.abs(d.marginRight)), m = u ? "upright-physical" : "section-logical", { sectionFlow: h, ...g } = s.section, _ = u ? Object.freeze({
31454
+ let u = Cs(s.section) !== "horizontal-tb", d = u ? Lx(s.section.geometry, s.section.sectionFlow) : s.section.geometry, f = Math.abs(d.marginLeft), p = Math.max(0, d.pageWidth - Math.abs(d.marginLeft) - Math.abs(d.marginRight)), m = u ? "upright-physical" : "section-logical", { sectionFlow: h, ...g } = s.section, _ = u ? Object.freeze({
31455
31455
  ...g,
31456
31456
  geometry: Object.freeze({ ...d }),
31457
31457
  columns: Object.freeze([Object.freeze({
@@ -31955,7 +31955,7 @@ function* sL(e, t, n, r, i, a, o, s = !1) {
31955
31955
  let t = e[r];
31956
31956
  if (t.kind === "parity-blank") continue;
31957
31957
  let i = r === 0 || e[r - 1].accumulator.sectionOccurrenceId !== t.accumulator.sectionOccurrenceId;
31958
- n.push(gS(t.accumulator, oL, i));
31958
+ n.push(_S(t.accumulator, oL, i));
31959
31959
  }
31960
31960
  f(n), o = t;
31961
31961
  }
@@ -32243,7 +32243,7 @@ function gL(e, t, n, r, i) {
32243
32243
  diagnostics: Object.freeze([...u, ...l.diagnostics])
32244
32244
  }), f = Object.freeze({
32245
32245
  ...d,
32246
- pages: Object.freeze(d.pages.map(dS))
32246
+ pages: Object.freeze(d.pages.map(fS))
32247
32247
  });
32248
32248
  return r.showTrackedChanges === !0 ? NF(f) : f;
32249
32249
  }
@@ -32378,7 +32378,7 @@ async function DL(e, t) {
32378
32378
  if (i.has(a.resourceKey)) throw Error(`Duplicate math occurrence: ${a.resourceKey}`);
32379
32379
  i.add(a.resourceKey);
32380
32380
  try {
32381
- let e = await t.mathMLToSvg(Ve(a.nodes, a.display)), i = await Qe(e, "#000000");
32381
+ let e = await t.mathMLToSvg(He(a.nodes, a.display)), i = await Qe(e, "#000000");
32382
32382
  n.push({
32383
32383
  resourceKey: a.resourceKey,
32384
32384
  widthEm: e.widthEm,
@@ -32718,7 +32718,7 @@ function XL(e) {
32718
32718
  };
32719
32719
  }
32720
32720
  function ZL(e, t, n) {
32721
- return $y(n, {
32721
+ return eb(n, {
32722
32722
  numbering: t.numbering,
32723
32723
  ...t.numbering ? { markerInput: e.acquisitionInputs.numberingMarkerShapeInput(t.numbering, pg(t)) } : {},
32724
32724
  authoredFirstIndentPt: t.indentFirst,
@@ -32729,15 +32729,15 @@ function ZL(e, t, n) {
32729
32729
  });
32730
32730
  }
32731
32731
  function QL(e, t) {
32732
- return ZL(e, t, Cx(e.layoutSettings, e.sectionLayout, e.storyContext === YL ? YL : JL, t));
32732
+ return ZL(e, t, wx(e.layoutSettings, e.sectionLayout, e.storyContext === YL ? YL : JL, t));
32733
32733
  }
32734
32734
  function $L(e, t) {
32735
- return ZL(e, t, Cx(e.layoutSettings, e.sectionLayout, e.storyContext ?? JL, t));
32735
+ return ZL(e, t, wx(e.layoutSettings, e.sectionLayout, e.storyContext ?? JL, t));
32736
32736
  }
32737
32737
  function eR(e, t) {
32738
32738
  return {
32739
32739
  ...e,
32740
- storyContext: lx(e.storyContext ?? JL, t)
32740
+ storyContext: ux(e.storyContext ?? JL, t)
32741
32741
  };
32742
32742
  }
32743
32743
  function tR(e, t) {
@@ -33278,7 +33278,7 @@ function xR(e, t, n, r, i) {
33278
33278
  });
33279
33279
  if (!d.fragment || d.requiresFreshPage) return Object.freeze({ kind: "fresh-flow-region" });
33280
33280
  let g = t.unwrappedLocation;
33281
- if (g && g.flowDomainId === t.location.flowDomainId && g.pageIndex === t.location.pageIndex && g.columnIndex === t.location.columnIndex && s.verticalPhys === void 0 && !r.input.bidiVisual && r.input.source.story === "body" && r.input.rows[0]?.cells[0] !== void 0 && ib(r.input.rows[0].cells[0]) && g.cursorPt.yPt < t.location.cursorPt.yPt && i.rowIndex === 0 && i.rowFragmentIndex === 0 && i.cells.length === 0) {
33281
+ if (g && g.flowDomainId === t.location.flowDomainId && g.pageIndex === t.location.pageIndex && g.columnIndex === t.location.columnIndex && s.verticalPhys === void 0 && !r.input.bidiVisual && r.input.source.story === "body" && r.input.rows[0]?.cells[0] !== void 0 && ab(r.input.rows[0].cells[0]) && g.cursorPt.yPt < t.location.cursorPt.yPt && i.rowIndex === 0 && i.rowFragmentIndex === 0 && i.cells.length === 0) {
33282
33282
  let e = wd({
33283
33283
  inlineStartPt: f,
33284
33284
  inlineEndPt: p,
@@ -34094,7 +34094,7 @@ function XR(e) {
34094
34094
  return jd(e.wrapMode) && YR(e.anchorYRelativeFrom ?? null, e.anchorYFromPara ?? !1);
34095
34095
  }
34096
34096
  function ZR(e) {
34097
- let t = Ce(e);
34097
+ let t = we(e);
34098
34098
  return t === "U" || t === "Tu" ? "upright" : t === "Tr" ? "rotate" : "sideways";
34099
34099
  }
34100
34100
  function QR(e) {
@@ -34113,10 +34113,10 @@ function QR(e) {
34113
34113
  }
34114
34114
  var $R = () => !1;
34115
34115
  function ez(e) {
34116
- return ZR(e) === "rotate" && nt(e) === null && !pe(e);
34116
+ return ZR(e) === "rotate" && nt(e) === null && !me(e);
34117
34117
  }
34118
34118
  function tz(e) {
34119
- let t = Ce(e);
34119
+ let t = we(e);
34120
34120
  return t === "Tu" || t === "Tr";
34121
34121
  }
34122
34122
  function nz(e, t) {
@@ -34133,7 +34133,7 @@ function nz(e, t) {
34133
34133
  function rz(e, t, n, r, i, a, o) {
34134
34134
  let s = e.textAlign, c = e.textBaseline, l = () => (e.textAlign = n === "sideways" ? "left" : "center", e.textBaseline = n === "sideways" ? "alphabetic" : "middle", e.measureText(t)), u;
34135
34135
  try {
34136
- u = o ? ke(e, l) : l();
34136
+ u = o ? je(e, l) : l();
34137
34137
  } finally {
34138
34138
  e.textAlign = s, e.textBaseline = c;
34139
34139
  }
@@ -34155,7 +34155,7 @@ function rz(e, t, n, r, i, a, o) {
34155
34155
  function iz(e, t, n, r, i) {
34156
34156
  let a = e.measureText(t).width;
34157
34157
  if (tz(n) && r(n)) {
34158
- let n = Re(e, t);
34158
+ let n = ze(e, t);
34159
34159
  return {
34160
34160
  naturalPx: n.cellAdvancePx,
34161
34161
  vert: n,
@@ -34202,7 +34202,7 @@ function az(e, t, n, r, i = 1, a = !1, o = $R, s = "vertical-rl", c = 0, l) {
34202
34202
  yPt: d
34203
34203
  }, n = [...new Set([
34204
34204
  0,
34205
- ...Ne(r.text),
34205
+ ...De(r.text),
34206
34206
  r.text.length
34207
34207
  ])].sort((e, t) => e - t), a = h ? n.slice(0, -1).map((t, i) => {
34208
34208
  let a = n[i + 1], o = n[Math.max(0, i - 4)];
@@ -34259,7 +34259,7 @@ function az(e, t, n, r, i = 1, a = !1, o = $R, s = "vertical-rl", c = 0, l) {
34259
34259
  continue;
34260
34260
  }
34261
34261
  for (let t of r.text) {
34262
- let r = t.codePointAt(0) ?? 0, c = ZR(r), l = c === "rotate" ? nt(r) : null, d = c === "rotate" && l === null && pe(r), m = iz(e, t, r, o, a), h = g(t, p, m.naturalPx * i), _ = h.advancePt, v = h.floored ? { floored: !0 } : {}, y = {
34262
+ let r = t.codePointAt(0) ?? 0, c = ZR(r), l = c === "rotate" ? nt(r) : null, d = c === "rotate" && l === null && me(r), m = iz(e, t, r, o, a), h = g(t, p, m.naturalPx * i), _ = h.advancePt, v = h.floored ? { floored: !0 } : {}, y = {
34263
34263
  start: p,
34264
34264
  end: p + t.length
34265
34265
  };
@@ -34332,7 +34332,7 @@ function oz(e, t, n) {
34332
34332
  return r - e.measureText(t).width;
34333
34333
  }
34334
34334
  function sz(e, t) {
34335
- return oz(e, t, (t) => Ae(e, t));
34335
+ return oz(e, t, (t) => Ne(e, t));
34336
34336
  }
34337
34337
  function cz(e, t, n, r, i) {
34338
34338
  return {
@@ -34412,7 +34412,7 @@ function hz(e, t, n, r) {
34412
34412
  for (a || (a = /* @__PURE__ */ new Map(), i.set(t, a)), a.delete(n), a.set(n, r); a.size > fz;) a.delete(a.keys().next().value);
34413
34413
  }
34414
34414
  function gz(e, t, n, r) {
34415
- ax(e.blocks.body);
34415
+ ox(e.blocks.body);
34416
34416
  let i = e.acquisition, a = i.acquisitionInputs, o = i.effectiveTablePositioning, s = i.publicAnchorBridge, c = sg(e.fonts.familyClasses, e.fonts.familyPitches), l = Object.freeze({
34417
34417
  source: e,
34418
34418
  measureContext: t,
@@ -34425,7 +34425,7 @@ function gz(e, t, n, r) {
34425
34425
  yPt: 0
34426
34426
  });
34427
34427
  function f(e, t, n, r, i = !1) {
34428
- let a = i ? 0 : qb(t.borders, n);
34428
+ let a = i ? 0 : Jb(t.borders, n);
34429
34429
  return a === 0 ? {
34430
34430
  context: e,
34431
34431
  suppressSpaceBefore: r
@@ -34438,7 +34438,7 @@ function gz(e, t, n, r) {
34438
34438
  };
34439
34439
  }
34440
34440
  function p(e, t, n = {}, r, i = {}, o, c, l) {
34441
- let u = xx(r, t, l), d = o;
34441
+ let u = Sx(r, t, l), d = o;
34442
34442
  return {
34443
34443
  ctx: e,
34444
34444
  verticalGlyphMeasurement: Ra(d),
@@ -34451,8 +34451,8 @@ function gz(e, t, n, r) {
34451
34451
  totalPages: Ya(d).totalPages,
34452
34452
  marginLeft: t.marginLeft,
34453
34453
  marginRight: t.marginRight,
34454
- marginTop: Px(t.marginTop),
34455
- marginBottom: Px(t.marginBottom),
34454
+ marginTop: Fx(t.marginTop),
34455
+ marginBottom: Fx(t.marginBottom),
34456
34456
  pageWidth: t.pageWidth,
34457
34457
  floats: [],
34458
34458
  floatParaSeq: 0,
@@ -34469,7 +34469,7 @@ function gz(e, t, n, r) {
34469
34469
  tableDecision: oe,
34470
34470
  resolveColumns: G,
34471
34471
  createCellState: (e, t, n) => ({
34472
- ...eR(Se(e), cx(n)),
34472
+ ...eR(Se(e), lx(n)),
34473
34473
  contentX: 0,
34474
34474
  contentW: t,
34475
34475
  y: 0,
@@ -34516,7 +34516,7 @@ function gz(e, t, n, r) {
34516
34516
  },
34517
34517
  containerShading: e.containerShading,
34518
34518
  ...a ? { paragraphBorderEdges: a } : {},
34519
- trailingExtentPt: Math.max(d.spaceAfterPt, a?.bottom === "none" ? 0 : Kb(t.borders)),
34519
+ trailingExtentPt: Math.max(d.spaceAfterPt, a?.bottom === "none" ? 0 : qb(t.borders)),
34520
34520
  continuesFromPrevious: !1,
34521
34521
  anchorFrames: XL(e),
34522
34522
  acquireCompleteStory: H(e),
@@ -34601,14 +34601,14 @@ function gz(e, t, n, r) {
34601
34601
  }
34602
34602
  function m(e) {
34603
34603
  if (!wM(e.textDirection)) return;
34604
- let t = Ix(e.geometry, e.sectionFlow);
34604
+ let t = Lx(e.geometry, e.sectionFlow);
34605
34605
  return {
34606
34606
  pageWidth: t.pageWidth,
34607
34607
  pageHeight: t.pageHeight,
34608
34608
  marginLeft: t.marginLeft,
34609
34609
  marginRight: t.marginRight,
34610
- marginTop: Px(t.marginTop),
34611
- marginBottom: Px(t.marginBottom),
34610
+ marginTop: Fx(t.marginTop),
34611
+ marginBottom: Fx(t.marginBottom),
34612
34612
  physicalPageWidthPt: t.pageWidth,
34613
34613
  ...e.sectionFlow ? { sectionFlow: e.sectionFlow } : {}
34614
34614
  };
@@ -34657,12 +34657,12 @@ function gz(e, t, n, r) {
34657
34657
  });
34658
34658
  if (r.type !== "table") return !1;
34659
34659
  let i = r.rows[t.path[n + 1]]?.cells[t.path[n + 2]];
34660
- if (!i || !cx(i)) return !1;
34660
+ if (!i || !lx(i)) return !1;
34661
34661
  }
34662
34662
  return !0;
34663
34663
  }
34664
34664
  function y(e, t, n, r, i, a, o = Object.freeze({ boundary: null }), s) {
34665
- let c = sx(t) ?? {
34665
+ let c = cx(t) ?? {
34666
34666
  top: "top",
34667
34667
  bottom: "bottom"
34668
34668
  }, l = QL(e, t), u = VR(e.floats, r.flowDomainId), p = e.layoutServices && Ia(e.layoutServices), m = p && qL(p, e.sectionLayout, e.storyContext, t, l, i, u.length !== 0), h = GL(e), g = m === void 0 ? h : {
@@ -34691,7 +34691,7 @@ function gz(e, t, n, r) {
34691
34691
  anchorCollisions: s ?? HR(e.floats),
34692
34692
  containerShading: e.containerShading,
34693
34693
  paragraphBorderEdges: c,
34694
- trailingExtentPt: Math.max(l.spaceAfterPt, c.bottom === "none" ? 0 : Kb(t.borders)),
34694
+ trailingExtentPt: Math.max(l.spaceAfterPt, c.bottom === "none" ? 0 : qb(t.borders)),
34695
34695
  continuesFromPrevious: o.boundary !== null,
34696
34696
  ...o.sourceRangeStart === void 0 ? {} : { sourceRangeStart: o.sourceRangeStart },
34697
34697
  anchorFrames: XL(e),
@@ -34832,8 +34832,8 @@ function gz(e, t, n, r) {
34832
34832
  pageH: t.container.capacity === "unbounded" ? 2 ** 53 - 1 : t.section.geometry.pageHeight,
34833
34833
  marginLeft: t.section.geometry.marginLeft,
34834
34834
  marginRight: t.section.geometry.marginRight,
34835
- marginTop: Px(t.section.geometry.marginTop),
34836
- marginBottom: Px(t.section.geometry.marginBottom),
34835
+ marginTop: Fx(t.section.geometry.marginTop),
34836
+ marginBottom: Fx(t.section.geometry.marginBottom),
34837
34837
  contentX: t.container.bounds.xPt,
34838
34838
  contentW: t.container.bounds.widthPt,
34839
34839
  y: t.container.bounds.yPt,
@@ -34871,7 +34871,7 @@ function gz(e, t, n, r) {
34871
34871
  marginRight: _.marginRight,
34872
34872
  marginTop: _.marginTop,
34873
34873
  marginBottom: _.marginBottom
34874
- }, r = e === "horizontal-tb" ? n : Ix(n, t.section.sectionFlow), i = js(e, {
34874
+ }, r = e === "horizontal-tb" ? n : Lx(n, t.section.sectionFlow), i = js(e, {
34875
34875
  widthPt: r.pageWidth,
34876
34876
  heightPt: r.pageHeight
34877
34877
  });
@@ -34920,7 +34920,7 @@ function gz(e, t, n, r) {
34920
34920
  input: t
34921
34921
  })), t;
34922
34922
  }) : (E.set(u.id, l), [u]);
34923
- }), j = i === void 0 ? void 0 : n[i - 1], M = j?.type === "paragraph" ? j : null, N = nx(k), P = /* @__PURE__ */ new Map(), F = {
34923
+ }), j = i === void 0 ? void 0 : n[i - 1], M = j?.type === "paragraph" ? j : null, N = rx(k), P = /* @__PURE__ */ new Map(), F = {
34924
34924
  layoutParagraph(e, r) {
34925
34925
  let i = a?.paragraph ?? x(o, e.source);
34926
34926
  if (i.type !== "paragraph") throw Error("Story paragraph source kind mismatch");
@@ -34962,7 +34962,7 @@ function gz(e, t, n, r) {
34962
34962
  ...i,
34963
34963
  runs: Object.freeze(C)
34964
34964
  }), _, _.y);
34965
- let w = $L(_, i), T = $b(m, i, g), E = f(w, i, T.top, y.suppressBefore || d, d), O = BR(_, i, {
34965
+ let w = $L(_, i), T = ex(m, i, g), E = f(w, i, T.top, y.suppressBefore || d, d), O = BR(_, i, {
34966
34966
  id: `${e.source.story}:${e.source.storyInstance}:${e.source.path.join(".")}`,
34967
34967
  source: e.source,
34968
34968
  flowDomainId: r.container.id,
@@ -34991,7 +34991,7 @@ function gz(e, t, n, r) {
34991
34991
  anchorCollisions: HR(_.floats),
34992
34992
  containerShading: _.containerShading,
34993
34993
  paragraphBorderEdges: T,
34994
- trailingExtentPt: Math.max(w.spaceAfterPt, T.bottom === "none" ? 0 : Kb(i.borders)),
34994
+ trailingExtentPt: Math.max(w.spaceAfterPt, T.bottom === "none" ? 0 : qb(i.borders)),
34995
34995
  continuesFromPrevious: d,
34996
34996
  ...u?.sourceRangeStart === void 0 ? {} : { sourceRangeStart: u.sourceRangeStart },
34997
34997
  anchorFrames: XL(_),
@@ -35193,7 +35193,7 @@ function gz(e, t, n, r) {
35193
35193
  let r = n.section.geometry;
35194
35194
  t.sectionLayout = n.section, t.verticalPhys = m(n.section), t.pageIndex = n.pageIndex;
35195
35195
  let i = Ya(e).resolveDestinationPage?.(n.pageIndex);
35196
- t.displayPageNumber = i?.displayPageNumber ?? n.pageIndex + 1, t.pageNumberFormat = i?.pageNumberFormat ?? t.pageNumberFormat, t.pageWidth = r.pageWidth, t.pageH = r.pageHeight, t.marginLeft = r.marginLeft, t.marginRight = r.marginRight, t.marginTop = Px(r.marginTop), t.marginBottom = Px(r.marginBottom), t.contentX = n.availableBounds.xPt, t.contentW = n.availableBounds.widthPt, t.y = n.cursorPt.yPt;
35196
+ t.displayPageNumber = i?.displayPageNumber ?? n.pageIndex + 1, t.pageNumberFormat = i?.pageNumberFormat ?? t.pageNumberFormat, t.pageWidth = r.pageWidth, t.pageH = r.pageHeight, t.marginLeft = r.marginLeft, t.marginRight = r.marginRight, t.marginTop = Fx(r.marginTop), t.marginBottom = Fx(r.marginBottom), t.contentX = n.availableBounds.xPt, t.contentW = n.availableBounds.widthPt, t.y = n.cursorPt.yPt;
35197
35197
  }
35198
35198
  function E(e, t, n, r) {
35199
35199
  n.location = r, T(e, t, r);
@@ -35213,7 +35213,7 @@ function gz(e, t, n, r) {
35213
35213
  if (c.type !== "paragraph") throw Error("Paragraph source kind mismatch");
35214
35214
  if (c.framePr) {
35215
35215
  if (t.continuation.boundary !== null) throw Error("Body frame acquisition cannot continue across flow regions");
35216
- let e, r = ox(c);
35216
+ let e, r = sx(c);
35217
35217
  if (!r) throw Error("Body frame acquisition requires an indexed adjacency group");
35218
35218
  let i = `frame:${r.id}`, s = t.input.textFrameMember === !0, l = s ? a.frozenAnchorFrames?.get(i) : void 0, u = de(c, r, a, le(n.blocks.body, c, a), {
35219
35219
  onAcquired: (t) => {
@@ -35510,7 +35510,7 @@ function gz(e, t, n, r) {
35510
35510
  });
35511
35511
  }
35512
35512
  function N(e, t) {
35513
- let { dependencies: n, services: r, state: i, sessionState: a, publicAnchorBridge: o } = e, s = t.location.section.geometry, c = Px(s.marginTop), l = Px(s.marginBottom), u = Object.freeze({
35513
+ let { dependencies: n, services: r, state: i, sessionState: a, publicAnchorBridge: o } = e, s = t.location.section.geometry, c = Fx(s.marginTop), l = Fx(s.marginBottom), u = Object.freeze({
35514
35514
  page: Object.freeze({
35515
35515
  xPt: 0,
35516
35516
  yPt: 0,
@@ -35828,7 +35828,7 @@ function gz(e, t, n, r) {
35828
35828
  if (n.acquired.kind !== "paragraph") return n.acquired;
35829
35829
  let r = _(t, n.acquired.source);
35830
35830
  if (r.type !== "paragraph") throw Error("Table paragraph re-acquisition source kind mismatch");
35831
- let i = n.paragraphAnchorReferenceDeltaPt !== void 0 && ab(e.acquisitionInputs.paragraphAcquisitionInput(r, n.acquired.source)) ? n.paragraphAnchorReferenceDeltaPt : void 0, a = {
35831
+ let i = n.paragraphAnchorReferenceDeltaPt !== void 0 && ob(e.acquisitionInputs.paragraphAcquisitionInput(r, n.acquired.source)) ? n.paragraphAnchorReferenceDeltaPt : void 0, a = {
35832
35832
  ...eR(Se(e), v(t, n.acquired.source)),
35833
35833
  contentX: 0,
35834
35834
  contentW: n.acquired.flowBounds.widthPt,
@@ -35881,7 +35881,7 @@ function gz(e, t, n, r) {
35881
35881
  function U(e, t, n) {
35882
35882
  let { sectionFlow: r, ...i } = e.sectionLayout, a = n.coordinateSpace === "upright-physical" ? {
35883
35883
  ...i,
35884
- geometry: Ix(e.sectionLayout.geometry, r),
35884
+ geometry: Lx(e.sectionLayout.geometry, r),
35885
35885
  textDirection: "lrTb"
35886
35886
  } : e.sectionLayout;
35887
35887
  return C(t, {
@@ -36072,7 +36072,7 @@ function gz(e, t, n, r) {
36072
36072
  }), t.map(({ table: e }, t) => ({
36073
36073
  table: e,
36074
36074
  source: o[t]
36075
- })), n, ae(e), i, a, (t) => Ay(se(s, n, e, t)) !== null);
36075
+ })), n, ae(e), i, a, (t) => jy(se(s, n, e, t)) !== null);
36076
36076
  return {
36077
36077
  decision: l,
36078
36078
  logicalColumns: l.usesLogicalProperties ? G(s, n, e, l, l.logical) : null
@@ -36097,11 +36097,11 @@ function gz(e, t, n, r) {
36097
36097
  return jM(e, r, [{
36098
36098
  table: e,
36099
36099
  source: r
36100
- }], t, ae(n), !0, !0, (r) => Ay(se(e, t, n, r)) !== null);
36100
+ }], t, ae(n), !0, !0, (r) => jy(se(e, t, n, r)) !== null);
36101
36101
  }
36102
36102
  function G(e, t, n, r = oe(e, t, n), i = r.logical) {
36103
36103
  let a = se(e, t, n, i);
36104
- return [...Ny(r.dropsUnusedLeadingGrid ? {
36104
+ return [...Py(r.dropsUnusedLeadingGrid ? {
36105
36105
  ...a,
36106
36106
  gridWidthsPt: a.gridWidthsPt.map((e, t) => t === 0 ? 0 : e),
36107
36107
  gridWidthKeys: a.gridWidthKeys?.map((e, t) => t === 0 ? null : e),
@@ -36118,10 +36118,10 @@ function gz(e, t, n, r) {
36118
36118
  let r = c.rows[t]?.cells[n]?.marginsPt;
36119
36119
  f.set(e, r ?? Ae(e, i));
36120
36120
  })), (r, a) => {
36121
- let c = lx(o, cx(r));
36122
- return Fb(r, f.get(r) ?? Ae(r, i), {
36121
+ let c = ux(o, lx(r));
36122
+ return Ib(r, f.get(r) ?? Ae(r, i), {
36123
36123
  paragraph: (o) => {
36124
- let l = Cx(n.layoutSettings, n.sectionLayout, n.storyContext ?? JL, o), u = o.numbering ? n.acquisitionInputs.numberingMarkerShapeInput(o.numbering, pg(o)) : void 0, f = $y(c.closingMarkHangAdmitted ? l : vx(l), {
36124
+ let l = wx(n.layoutSettings, n.sectionLayout, n.storyContext ?? JL, o), u = o.numbering ? n.acquisitionInputs.numberingMarkerShapeInput(o.numbering, pg(o)) : void 0, f = eb(c.closingMarkHangAdmitted ? l : yx(l), {
36125
36125
  numbering: o.numbering,
36126
36126
  ...u ? { markerInput: u } : {},
36127
36127
  authoredFirstIndentPt: o.indentFirst,
@@ -36130,19 +36130,19 @@ function gz(e, t, n, r) {
36130
36130
  service: n.layoutServices?.text,
36131
36131
  clusterGeometry: !1,
36132
36132
  compatibilityMode: n.layoutSettings.compat.compatibilityMode
36133
- }), p = f.numberingMarkerGeometry ?? (o.numbering && u && n.layoutServices?.text ? nb(o.numbering, u, {
36133
+ }), p = f.numberingMarkerGeometry ?? (o.numbering && u && n.layoutServices?.text ? rb(o.numbering, u, {
36134
36134
  authoredFirstIndentPt: o.indentFirst,
36135
36135
  physicalIndentLeftPt: f.physicalIndentLeftPt,
36136
36136
  tabStops: o.tabStops,
36137
36137
  defaultTabPt: n.defaultTabPt,
36138
36138
  compatibilityMode: n.layoutSettings.compat.compatibilityMode,
36139
36139
  baseRtl: f.baseRtl
36140
- }, n.layoutServices.text, !1) : void 0), m = Gb(o, f, s === "band" && i === e && d !== "fixed" && a === null ? 2 ** 53 - 1 : t, {
36140
+ }, n.layoutServices.text, !1) : void 0), m = Kb(o, f, s === "band" && i === e && d !== "fixed" && a === null ? 2 ** 53 - 1 : t, {
36141
36141
  context: n.ctx,
36142
36142
  fontFamilyClasses: n.fontFamilyClasses
36143
36143
  }, GL(n, c), p, { preserveWhitespaceOnlyContent: !0 });
36144
36144
  if (r.noWrap !== !0 || a?.kind === "dxa" || d === "fixed") return m;
36145
- let h = Gb(o, {
36145
+ let h = Kb(o, {
36146
36146
  ...f,
36147
36147
  firstIndentPt: 0
36148
36148
  }, 2 ** 53 - 1, {
@@ -36164,13 +36164,13 @@ function gz(e, t, n, r) {
36164
36164
  inTableCell: !0,
36165
36165
  tableCellDepth: (ae(n).tableCellDepth ?? 0) + 1
36166
36166
  }).logical, c);
36167
- return Ty(Xy(r, t, (t, n, r) => i(e.rows[t].cells[n], r), t));
36167
+ return Ey(Zy(r, t, (t, n, r) => i(e.rows[t].cells[n], r), t));
36168
36168
  }
36169
36169
  }, d, a);
36170
36170
  };
36171
36171
  }, d = o ? null : i.ordinaryFlow ? r.effectiveLayout === "fixed" ? null : a : Math.max(t, n.pageWidth), f = u(e);
36172
36172
  return {
36173
- ...Xy(r.source, r.percentWidthBasePt, (t, n, r) => f(e.rows[t].cells[n], r), d, r.spacingGeometry),
36173
+ ...Zy(r.source, r.percentWidthBasePt, (t, n, r) => f(e.rows[t].cells[n], r), d, r.spacingGeometry),
36174
36174
  outerMarginAllowancePt: c,
36175
36175
  growUnpreferredColumns: s === "band" ? !0 : s === "nonbinding" ? "nonbinding" : !1,
36176
36176
  contentBandPt: t
@@ -36198,10 +36198,10 @@ function gz(e, t, n, r) {
36198
36198
  }
36199
36199
  function ue(e, t) {
36200
36200
  let n = e.members.indexOf(t);
36201
- return $b(e.members[n - 1] ?? null, t, e.members[n + 1] ?? null, !0);
36201
+ return ex(e.members[n - 1] ?? null, t, e.members[n + 1] ?? null, !0);
36202
36202
  }
36203
36203
  function de(e, t, n, r, i) {
36204
- let { onAcquired: a, story: o, borderEdgesFor: s = sx } = i, c = {
36204
+ let { onAcquired: a, story: o, borderEdgesFor: s = cx } = i, c = {
36205
36205
  context: n.ctx,
36206
36206
  fontFamilyClasses: n.fontFamilyClasses
36207
36207
  }, l = GL(n), u = t.members.map(s), d = NM(t.framePr.hAnchor, n), f = {
@@ -36214,7 +36214,7 @@ function gz(e, t, n, r) {
36214
36214
  contexts: t.members.map((e) => QL(n, e)),
36215
36215
  inputs: t.members,
36216
36216
  borderEdges: u,
36217
- borderExtentsPt: t.members.map((e, t) => u[t]?.bottom === "none" ? 0 : Kb(e.borders)),
36217
+ borderExtentsPt: t.members.map((e, t) => u[t]?.bottom === "none" ? 0 : qb(e.borders)),
36218
36218
  measurer: c,
36219
36219
  environment: l,
36220
36220
  containerShading: n.containerShading,
@@ -36347,11 +36347,11 @@ function gz(e, t, n, r) {
36347
36347
  let { sectionFlow: t, ...n } = e.sectionLayout;
36348
36348
  return {
36349
36349
  ...Ce(e),
36350
- storyContext: ux(e.storyContext),
36350
+ storyContext: dx(e.storyContext),
36351
36351
  uprightPhysicalTable: !1,
36352
36352
  sectionLayout: {
36353
36353
  ...n,
36354
- geometry: Ix(e.sectionLayout.geometry, t),
36354
+ geometry: Lx(e.sectionLayout.geometry, t),
36355
36355
  textDirection: "lrTb"
36356
36356
  }
36357
36357
  };
@@ -36577,7 +36577,7 @@ function _z(e) {
36577
36577
  continue;
36578
36578
  }
36579
36579
  let y = /* @__PURE__ */ new Map(), b = 0, x = Math.min(e.maximumWork, 1048576), S = (e, t, n, r) => {
36580
- if (++b > x) throw new se("Native glyph contour work budget exceeded");
36580
+ if (++b > x) throw new ce("Native glyph contour work budget exceeded");
36581
36581
  let i = t * f + e, a = r * f + n, o = y.get(i);
36582
36582
  o ? o.push(a) : y.set(i, [a]);
36583
36583
  };
@@ -36603,7 +36603,7 @@ function _z(e) {
36603
36603
  for (; n.length;) {
36604
36604
  let [r, a] = n.pop(), o = e[r], s = e[a], c = s.x - o.x, l = s.y - o.y, u = -1, d = Math.SQRT2 / i;
36605
36605
  for (let t = r + 1; t < a; t++) {
36606
- if (++b > x) throw new se("Native glyph contour simplification work budget exceeded");
36606
+ if (++b > x) throw new ce("Native glyph contour simplification work budget exceeded");
36607
36607
  let n = e[t], r = Math.max(0, Math.min(1, ((n.x - o.x) * c + (n.y - o.y) * l) / (c * c + l * l || 1))), i = Math.hypot(n.x - o.x - r * c, n.y - o.y - r * l);
36608
36608
  i > d && (u = t, d = i);
36609
36609
  }
@@ -36666,7 +36666,7 @@ function wz(e, t = {}) {
36666
36666
  i.set(t, [...i.get(t) ?? [], e]);
36667
36667
  }
36668
36668
  let a = Object.freeze(Object.fromEntries(Object.entries(t.nativeFamilyLists ?? {}).filter(([e, t]) => e.trim() && t.trim()).map(([e, t]) => [bz(e), t]).sort(([e], [t]) => e.localeCompare(t)))), s = Object.freeze(Object.fromEntries(Object.entries(t.regionalFamilyLists ?? {}).map(([e, t]) => [e, Object.freeze(Object.fromEntries(Object.entries(t).map(([e, t]) => [bz(e), t]).sort(([e], [t]) => e.localeCompare(t))))]).sort(([e], [t]) => String(e).localeCompare(String(t))))), c = (e, t, n) => {
36669
- let r = ge(t) ?? n, i = r ? s[r] : void 0;
36669
+ let r = ie(t) ?? n, i = r ? s[r] : void 0;
36670
36670
  return (i ? o(i, bz(e)) : void 0) ?? o(a, bz(e));
36671
36671
  }, l = Object.freeze(Object.fromEntries(Object.entries(t.scriptScopedFamilies ?? {}).map(([e, t]) => [bz(e), Object.freeze({
36672
36672
  script: t.script,
@@ -36863,7 +36863,7 @@ function zz(e, t) {
36863
36863
  let e = Number(t);
36864
36864
  return e >= 100 && e <= 900 ? [e] : [];
36865
36865
  }
36866
- return [400, 700].filter((e) => ve(t, e));
36866
+ return [400, 700].filter((e) => Ze(t, e));
36867
36867
  }, c = (e) => e.flatMap((e) => {
36868
36868
  if (e.status !== "loaded") return [];
36869
36869
  let t = a(e);
@@ -36933,7 +36933,7 @@ function zz(e, t) {
36933
36933
  ...e.fonts.renderedFamilies,
36934
36934
  ...e.fonts.majorFamily ? [e.fonts.majorFamily] : [],
36935
36935
  ...e.fonts.minorFamily ? [e.fonts.minorFamily] : []
36936
- ])], y = new Set(v.map(i)), b = t.fontSet === void 0 ? Ie() : t.fontSet, x = /* @__PURE__ */ new Set();
36936
+ ])], y = new Set(v.map(i)), b = t.fontSet === void 0 ? ue() : t.fontSet, x = /* @__PURE__ */ new Set();
36937
36937
  if (b && typeof b[Symbol.iterator] == "function") {
36938
36938
  for (let e of b) if (y.has(i(e.family))) {
36939
36939
  e.status === "loaded" && x.add(i(e.family));
@@ -37176,7 +37176,7 @@ function Jz(e, t) {
37176
37176
  path: Object.freeze([n])
37177
37177
  }),
37178
37178
  startType: Gz(e.startType),
37179
- context: Object.freeze(Hx(qz(e), e.sectionBidi, e.sectionFlow)),
37179
+ context: Object.freeze(Ux(qz(e), e.sectionBidi, e.sectionFlow)),
37180
37180
  pageNumbering: Object.freeze({
37181
37181
  start: e.pageNumType?.start ?? null,
37182
37182
  format: e.pageNumType?.fmt ?? null
@@ -37461,7 +37461,7 @@ function DB(e) {
37461
37461
  }
37462
37462
  function OB(e) {
37463
37463
  return {
37464
- rule: Eb(DB(e.rule), e.ruleAuthored),
37464
+ rule: Db(DB(e.rule), e.ruleAuthored),
37465
37465
  valuePt: EB(e.value)
37466
37466
  };
37467
37467
  }
@@ -37476,15 +37476,15 @@ function kB(e) {
37476
37476
  function AB(...e) {
37477
37477
  for (let t of e) {
37478
37478
  if (!t) continue;
37479
- let e = Db(Fy(t), Ly(t));
37479
+ let e = Ob(Iy(t), Ry(t));
37480
37480
  if (e !== null) return e;
37481
37481
  }
37482
37482
  return null;
37483
37483
  }
37484
37484
  function jB(e, t, n) {
37485
37485
  if (!e) return null;
37486
- let r = Fy(e);
37487
- return Ob({
37486
+ let r = Iy(e);
37487
+ return kb({
37488
37488
  kind: r,
37489
37489
  dxaValuePt: r === "dxa" ? EB(e.value ?? "0") : null,
37490
37490
  scope: t,
@@ -37549,7 +37549,7 @@ function MB(e, t, n, r, i, a, o) {
37549
37549
  i,
37550
37550
  a,
37551
37551
  o
37552
- ].every((e) => e?.start == null && e?.end == null && [e?.left, e?.right].every((e) => e == null || Fy(e) === "dxa")),
37552
+ ].every((e) => e?.start == null && e?.end == null && [e?.left, e?.right].every((e) => e == null || Iy(e) === "dxa")),
37553
37553
  marginsPt: {
37554
37554
  top: u("top", {
37555
37555
  width: r?.top,
@@ -37584,14 +37584,14 @@ function MB(e, t, n, r, i, a, o) {
37584
37584
  }
37585
37585
  function NB(e) {
37586
37586
  if (!e) return null;
37587
- let t = e.indent ? Fy(e.indent) : null;
37587
+ let t = e.indent ? Iy(e.indent) : null;
37588
37588
  return {
37589
37589
  preferredWidthAuthored: e.preferredWidth != null,
37590
- preferredWidth: Iy(e.preferredWidth),
37590
+ preferredWidth: Ly(e.preferredWidth),
37591
37591
  layout: e.layout?.kind === "fixed" || e.layout?.kind === "autofit" ? e.layout.kind : null,
37592
37592
  justification: e.justification,
37593
37593
  indentAuthored: e.indent != null && (t === "dxa" || t === "nil"),
37594
- indentPt: t === "nil" ? 0 : Ly(e.indent),
37594
+ indentPt: t === "nil" ? 0 : Ry(e.indent),
37595
37595
  borders: e.borders
37596
37596
  };
37597
37597
  }
@@ -37619,7 +37619,7 @@ function PB(e) {
37619
37619
  logicalSequenceId: n.table?.logicalSequenceId ?? null,
37620
37620
  logicalRowOffset: n.table?.logicalRowOffset ?? 0,
37621
37621
  logicalTotalRows: n.table?.logicalTotalRows ?? 0,
37622
- positioning: r ? null : i ? rb(i) : e.tblpPr == null ? null : wB(e.tblpPr),
37622
+ positioning: r ? null : i ? ib(i) : e.tblpPr == null ? null : wB(e.tblpPr),
37623
37623
  rows: a,
37624
37624
  firstRowException: a[0]?.exception ?? null
37625
37625
  }, "DOCX table format input");
@@ -37775,10 +37775,10 @@ function UB(e, t) {
37775
37775
  }));
37776
37776
  }
37777
37777
  function WB(e, t) {
37778
- return zy(xB(e), t);
37778
+ return By(xB(e), t);
37779
37779
  }
37780
37780
  function GB(e, t, n, r = t) {
37781
- return Xy(xB(e), t, (t, r, i) => n(e.rows[t].cells[r], i), r);
37781
+ return Zy(xB(e), t, (t, r, i) => n(e.rows[t].cells[r], i), r);
37782
37782
  }
37783
37783
  function KB(e, t, n) {
37784
37784
  if (!t || typeof t != "object") return;
@@ -37821,7 +37821,7 @@ function qB(e) {
37821
37821
  rtlGutter: r?.rtlGutter ?? null,
37822
37822
  pageBordersAuthored: r?.pageBordersAuthored ?? e.section?.pageBorders != null,
37823
37823
  pageBorders: r?.pageBorders ?? e.section?.pageBorders ?? null,
37824
- pageGeometry: r?.pageGeometry ?? (e.section ? Bx(e.section) : {}),
37824
+ pageGeometry: r?.pageGeometry ?? (e.section ? Vx(e.section) : {}),
37825
37825
  ...uB(r, e.section?.textDirection)
37826
37826
  }, "DOCX final-section placement input")
37827
37827
  });
@@ -37875,7 +37875,7 @@ function YB(e) {
37875
37875
  final: !0,
37876
37876
  startType: e.section.sectionStart ?? "nextPage",
37877
37877
  columns: e.section.columns ?? null,
37878
- authoredGeometry: i.pageGeometry == null ? Bx(e.section) : dB(i.pageGeometry),
37878
+ authoredGeometry: i.pageGeometry == null ? Vx(e.section) : dB(i.pageGeometry),
37879
37879
  textDirection: e.section.textDirection ?? null,
37880
37880
  ...i.sectionFlow ? { sectionFlow: i.sectionFlow } : {},
37881
37881
  pageNumType: e.section.pageNumType ?? null,
@@ -37894,7 +37894,7 @@ function YB(e) {
37894
37894
  pageBorders: i.pageBorders,
37895
37895
  placement: fB(i)
37896
37896
  });
37897
- let a = Array(t.length), o = Bx(e.section), s = null, c = null;
37897
+ let a = Array(t.length), o = Vx(e.section), s = null, c = null;
37898
37898
  for (let e = t.length - 1; e >= 0; --e) {
37899
37899
  let n = t[e], r = n.startType === "continuous" && s !== null ? s : o, i = n.authoredGeometry, l = {
37900
37900
  pageWidth: i.pageWidth ?? r.pageWidth,
@@ -38721,7 +38721,7 @@ async function FV(e, t) {
38721
38721
  return t ? {
38722
38722
  lines: i,
38723
38723
  faces: r
38724
- } : (ie(r), {
38724
+ } : (Je(r), {
38725
38725
  lines: i,
38726
38726
  faces: []
38727
38727
  });
@@ -38972,12 +38972,12 @@ function WV(e, t) {
38972
38972
  effectiveTablePreferredWidthPt(e, t) {
38973
38973
  let n = c.get(e);
38974
38974
  if (!n) throw Error("Unknown table acquisition input");
38975
- return zy(n.input, t);
38975
+ return By(n.input, t);
38976
38976
  },
38977
38977
  tableColumnLayoutInput(e, t, n, r) {
38978
38978
  let i = c.get(e);
38979
38979
  if (!i) throw Error("Unknown table acquisition input");
38980
- return Xy(i.input, t, (t, r, i) => n(e.rows[t].cells[r], i), r);
38980
+ return Zy(i.input, t, (t, r, i) => n(e.rows[t].cells[r], i), r);
38981
38981
  },
38982
38982
  tableParticipatesInOrdinaryFlow(e) {
38983
38983
  let t = c.get(e);
@@ -39162,7 +39162,7 @@ function YV(e, t) {
39162
39162
  let n = e?.trim(), r = n?.toLowerCase(), s = o(vz, r);
39163
39163
  n && r && s && !a.has(r) && !i.has(r) && xt(s, t.text, "any") && i.set(r, n);
39164
39164
  }
39165
- let e = ge(t.eastAsiaLanguage);
39165
+ let e = ie(t.eastAsiaLanguage);
39166
39166
  if (e) for (let n of te([t.text], e, !0)) r.add(n);
39167
39167
  else n.addText([t.text]);
39168
39168
  }
@@ -39250,7 +39250,7 @@ function tH(e) {
39250
39250
  }
39251
39251
  var nH = /* @__PURE__ */ new WeakMap();
39252
39252
  function rH(e) {
39253
- let t = Vx(), n = e.section ?? {}, r = (e, t) => Number.isFinite(e) ? e : t, i = (e) => ({
39253
+ let t = Hx(), n = e.section ?? {}, r = (e, t) => Number.isFinite(e) ? e : t, i = (e) => ({
39254
39254
  default: e?.default ?? null,
39255
39255
  first: e?.first ?? null,
39256
39256
  even: e?.even ?? null
@@ -39538,7 +39538,7 @@ function vH(e) {
39538
39538
  return yH(t, t, !0, e).source;
39539
39539
  }
39540
39540
  function yH(e, t, n, r) {
39541
- let i = t.document, a = t.bodyModelGateway.acquisitionInputs, o = t.bodyLayoutInput, s = mx(i, tB(i)), c = Fi(i, a, t.mathOccurrences, (e) => {
39541
+ let i = t.document, a = t.bodyModelGateway.acquisitionInputs, o = t.bodyLayoutInput, s = hx(i, tB(i)), c = Fi(i, a, t.mathOccurrences, (e) => {
39542
39542
  let t = e.numbering;
39543
39543
  if (!t) throw Error("Picture-bullet metadata requires numbering");
39544
39544
  let n = a.numberingMarkerShapeInput(t, pg(e));
@@ -39712,7 +39712,7 @@ function CH(e, t, n = {}) {
39712
39712
  async function wH(e, t, n = {}) {
39713
39713
  let r = await FV(CH(e, t, n), !0);
39714
39714
  return r.faces.length > 0 ? {
39715
- nativeRouteMetrics: IV(r.lines, Ie()),
39715
+ nativeRouteMetrics: IV(r.lines, ue()),
39716
39716
  faces: r.faces
39717
39717
  } : { faces: [] };
39718
39718
  }
@@ -39769,7 +39769,7 @@ function TH(e, t = {}) {
39769
39769
  let t = r.font, n = r.fontKerning;
39770
39770
  r.font = e.font, r.fontKerning = e.fontKerning;
39771
39771
  try {
39772
- return az(r, e.text, e.fontSizePt, e.letterSpacingPt, e.charScale, e.growTrRotateInk, (e) => Ae(r, e), e.writingMode, e.characterGridDeltaPt, e.characterAdjustmentPt);
39772
+ return az(r, e.text, e.fontSizePt, e.letterSpacingPt, e.charScale, e.growTrRotateInk, (e) => Ne(r, e), e.writingMode, e.characterGridDeltaPt, e.characterAdjustmentPt);
39773
39773
  } finally {
39774
39774
  r.font = t, r.fontKerning = n;
39775
39775
  }
@@ -39784,7 +39784,7 @@ function TH(e, t = {}) {
39784
39784
  localMetrics: l,
39785
39785
  fontMetrics: u,
39786
39786
  measureContext: i,
39787
- fontSet: (re(a) ? a.ownerDocument?.fonts : void 0) ?? Ie(),
39787
+ fontSet: (re(a) ? a.ownerDocument?.fonts : void 0) ?? ue(),
39788
39788
  verticalGlyphMeasurement: c
39789
39789
  }), p = f.text.fontMetrics ?? u;
39790
39790
  return Fa(f, n), Na(f, xH(n, i, p, d)), f;
@@ -39856,7 +39856,7 @@ function jH(e, t, n) {
39856
39856
  defaultCurrentDateMs: n
39857
39857
  });
39858
39858
  }
39859
- var MH = 1024 * 1024, NH = Math.max(Oe, We);
39859
+ var MH = 1024 * 1024, NH = Math.max(Me, be);
39860
39860
  async function PH(e, t, n = {}) {
39861
39861
  let r = [];
39862
39862
  return RH(e, t, n, {
@@ -39897,7 +39897,7 @@ async function LH(e, t, n = {}) {
39897
39897
  });
39898
39898
  }
39899
39899
  async function RH(e, t, n, r) {
39900
- let i = new Fe(e, {
39900
+ let i = new Le(e, {
39901
39901
  ...t,
39902
39902
  maxByteCredit: NH,
39903
39903
  timeoutMs: n.timeoutMs