react-edit-to-html 1.3.5 → 1.3.6

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 (3) hide show
  1. package/dist/index.cjs +20 -20
  2. package/dist/index.js +723 -707
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -188,7 +188,7 @@ var te = /* @__PURE__ */ p({
188
188
  AnnotationEditorParamsType: () => P,
189
189
  AnnotationEditorType: () => N,
190
190
  AnnotationEditorUIManager: () => Br,
191
- AnnotationLayer: () => Ch,
191
+ AnnotationLayer: () => wh,
192
192
  AnnotationMode: () => Te,
193
193
  AnnotationType: () => je,
194
194
  CSSConstants: () => zt,
@@ -199,17 +199,17 @@ var te = /* @__PURE__ */ p({
199
199
  GlobalWorkerOptions: () => Hu,
200
200
  ImageKind: () => Ae,
201
201
  InvalidPDFException: () => Ye,
202
- MathClamp: () => ft,
202
+ MathClamp: () => B,
203
203
  OPS: () => Pe,
204
204
  OutputScale: () => It,
205
205
  PDFDataRangeTransport: () => lf,
206
- PDFDateString: () => kt,
206
+ PDFDateString: () => Ot,
207
207
  PDFWorker: () => xf,
208
208
  PasswordException: () => qe,
209
209
  PasswordResponses: () => Ie,
210
210
  PermissionFlag: () => Oe,
211
- PixelsPerInch: () => gt,
212
- RenderingCancelledException: () => yt,
211
+ PixelsPerInch: () => ht,
212
+ RenderingCancelledException: () => vt,
213
213
  ResponseException: () => Xe,
214
214
  SignatureExtractor: () => yv,
215
215
  SupportedImageMimeTypes: () => Lt,
@@ -218,33 +218,33 @@ var te = /* @__PURE__ */ p({
218
218
  TouchManager: () => Qi,
219
219
  Util: () => z,
220
220
  VerbosityLevel: () => Ne,
221
- XfaLayer: () => ht,
221
+ XfaLayer: () => mt,
222
222
  applyOpacity: () => Bt,
223
223
  build: () => Kf,
224
224
  createValidAbsoluteUrl: () => Ue,
225
- fetchData: () => _t,
225
+ fetchData: () => gt,
226
226
  findContrastColor: () => Kt,
227
227
  getDocument: () => rf,
228
- getFilenameFromUrl: () => St,
229
- getPdfFilenameFromUrl: () => Ct,
230
- getRGB: () => Mt,
231
- getRGBA: () => jt,
228
+ getFilenameFromUrl: () => xt,
229
+ getPdfFilenameFromUrl: () => St,
230
+ getRGB: () => jt,
231
+ getRGBA: () => At,
232
232
  getUuid: () => st,
233
- isDataScheme: () => bt,
234
- isPdfFile: () => xt,
233
+ isDataScheme: () => yt,
234
+ isPdfFile: () => bt,
235
235
  isValidExplicitDest: () => Is,
236
236
  makeArr: () => lt,
237
237
  makeMap: () => ut,
238
238
  makeObj: () => dt,
239
- noContextMenu: () => Dt,
239
+ noContextMenu: () => Et,
240
240
  normalizeUnicode: () => ot,
241
241
  renderRichText: () => qt,
242
242
  setLayerDimensions: () => Ft,
243
243
  shadow: () => L,
244
- stopEvent: () => Ot,
244
+ stopEvent: () => Dt,
245
245
  updateUrlHash: () => We,
246
246
  version: () => Gf
247
- }), A, ne, re, ie, ae, j, oe, se, ce, le, ue, de, fe, pe, M, me, he, ge, _e, ve = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), ye = [
247
+ }), A, ne, re, ie, ae, j, oe, se, ce, le, ue, de, fe, pe, me, he, M, ge, _e, ve = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), ye = [
248
248
  Infinity,
249
249
  Infinity,
250
250
  -Infinity,
@@ -750,10 +750,10 @@ function ct(e, t, n) {
750
750
  return !0;
751
751
  }
752
752
  var lt = () => [], ut = () => /* @__PURE__ */ new Map(), dt = () => Object.create(null);
753
- function ft(e, t, n) {
753
+ function B(e, t, n) {
754
754
  return Math.min(Math.max(e, t), n);
755
755
  }
756
- var pt = class e {
756
+ var ft = class e {
757
757
  constructor({ viewBox: e, userUnit: t, scale: n, rotation: r, offsetX: i = 0, offsetY: a = 0, dontFlip: o = !1 }) {
758
758
  this.viewBox = e, this.userUnit = t, this.scale = n, this.rotation = r, this.offsetX = i, this.offsetY = a, n *= t;
759
759
  let s = (e[2] + e[0]) / 2, c = (e[3] + e[1]) / 2, l, u, d, f;
@@ -811,7 +811,7 @@ var pt = class e {
811
811
  let n = [e, t];
812
812
  return z.applyInverseTransform(n, this.transform), n;
813
813
  }
814
- }, mt = class e {
814
+ }, pt = class e {
815
815
  static textContent(t) {
816
816
  let n = [], r = {
817
817
  items: n,
@@ -831,7 +831,7 @@ var pt = class e {
831
831
  static shouldBuildText(e) {
832
832
  return !(e === "textarea" || e === "input" || e === "option" || e === "select");
833
833
  }
834
- }, ht = class {
834
+ }, mt = class {
835
835
  static setupStorage(e, t, n, r, i) {
836
836
  let a = r.getValue(t, { value: null });
837
837
  switch (n.name) {
@@ -905,7 +905,7 @@ var pt = class e {
905
905
  if (r.children.length === 0) {
906
906
  if (r.value) {
907
907
  let e = document.createTextNode(r.value);
908
- a.append(e), o && mt.shouldBuildText(r.name) && c.push(e);
908
+ a.append(e), o && pt.shouldBuildText(r.name) && c.push(e);
909
909
  }
910
910
  return { textDivs: c };
911
911
  }
@@ -943,7 +943,7 @@ var pt = class e {
943
943
  ]);
944
944
  else if (s.value) {
945
945
  let e = document.createTextNode(s.value);
946
- o && mt.shouldBuildText(f) && c.push(e), p.append(e);
946
+ o && pt.shouldBuildText(f) && c.push(e), p.append(e);
947
947
  }
948
948
  }
949
949
  for (let e of s.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")) e.setAttribute("readOnly", !0);
@@ -955,7 +955,7 @@ var pt = class e {
955
955
  }
956
956
  static getPageViewport(e, { scale: t = 1, rotation: n = 0 }) {
957
957
  let { width: r, height: i } = e.attributes.style;
958
- return new pt({
958
+ return new ft({
959
959
  viewBox: [
960
960
  0,
961
961
  0,
@@ -967,14 +967,14 @@ var pt = class e {
967
967
  rotation: n
968
968
  });
969
969
  }
970
- }, gt = class {};
971
- ne = gt, v(gt, "CSS", 96), v(gt, "PDF", 72), v(gt, "PDF_TO_CSS_UNITS", ne.CSS / ne.PDF);
972
- function _t(e) {
973
- return vt.apply(this, arguments);
970
+ }, ht = class {};
971
+ ne = ht, v(ht, "CSS", 96), v(ht, "PDF", 72), v(ht, "PDF_TO_CSS_UNITS", ne.CSS / ne.PDF);
972
+ function gt(e) {
973
+ return _t.apply(this, arguments);
974
974
  }
975
- function vt() {
976
- return vt = b(function* (e, t = "text") {
977
- if (Et(e, document.baseURI)) {
975
+ function _t() {
976
+ return _t = b(function* (e, t = "text") {
977
+ if (Tt(e, document.baseURI)) {
978
978
  let n = yield fetch(e);
979
979
  if (!n.ok) throw Error(n.statusText);
980
980
  switch (t) {
@@ -1005,27 +1005,27 @@ function vt() {
1005
1005
  }
1006
1006
  }, i.send(null);
1007
1007
  });
1008
- }), vt.apply(this, arguments);
1008
+ }), _t.apply(this, arguments);
1009
1009
  }
1010
- var yt = class extends Ke {
1010
+ var vt = class extends Ke {
1011
1011
  constructor(e, t = 0) {
1012
1012
  super(e, "RenderingCancelledException"), this.extraDelay = t;
1013
1013
  }
1014
1014
  };
1015
- function bt(e) {
1015
+ function yt(e) {
1016
1016
  let t = e.length, n = 0;
1017
1017
  for (; n < t && e[n].trim() === "";) n++;
1018
1018
  return e.substring(n, n + 5).toLowerCase() === "data:";
1019
1019
  }
1020
- function xt(e) {
1020
+ function bt(e) {
1021
1021
  return typeof e == "string" && /\.pdf$/i.test(e);
1022
1022
  }
1023
- function St(e) {
1023
+ function xt(e) {
1024
1024
  return [e] = e.split(/[#?]/, 1), Ge(e);
1025
1025
  }
1026
- function Ct(e, t = "document.pdf") {
1026
+ function St(e, t = "document.pdf") {
1027
1027
  if (typeof e != "string") return t;
1028
- if (bt(e)) return F("getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons."), t;
1028
+ if (yt(e)) return F("getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons."), t;
1029
1029
  let n = ((e) => {
1030
1030
  try {
1031
1031
  return new URL(e);
@@ -1062,42 +1062,42 @@ function Ct(e, t = "document.pdf") {
1062
1062
  }
1063
1063
  return t;
1064
1064
  }
1065
- var wt = /* @__PURE__ */ new WeakMap(), Tt = class {
1065
+ var Ct = /* @__PURE__ */ new WeakMap(), wt = class {
1066
1066
  constructor() {
1067
- S(this, wt, /* @__PURE__ */ new Map()), v(this, "times", []);
1067
+ S(this, Ct, /* @__PURE__ */ new Map()), v(this, "times", []);
1068
1068
  }
1069
1069
  time(e) {
1070
- C(wt, this).has(e) && F(`Timer is already running for ${e}`), C(wt, this).set(e, Date.now());
1070
+ C(Ct, this).has(e) && F(`Timer is already running for ${e}`), C(Ct, this).set(e, Date.now());
1071
1071
  }
1072
1072
  timeEnd(e) {
1073
- C(wt, this).has(e) || F(`Timer has not been started for ${e}`), this.times.push({
1073
+ C(Ct, this).has(e) || F(`Timer has not been started for ${e}`), this.times.push({
1074
1074
  name: e,
1075
- start: C(wt, this).get(e),
1075
+ start: C(Ct, this).get(e),
1076
1076
  end: Date.now()
1077
- }), C(wt, this).delete(e);
1077
+ }), C(Ct, this).delete(e);
1078
1078
  }
1079
1079
  toString() {
1080
1080
  let e = Math.max(...this.times.map((e) => e.name.length));
1081
1081
  return this.times.map((t) => `${t.name.padEnd(e)} ${t.end - t.start}ms\n`).join("");
1082
1082
  }
1083
1083
  };
1084
- function Et(e, t) {
1084
+ function Tt(e, t) {
1085
1085
  var n;
1086
1086
  let r = t ? URL.parse(e, t) : URL.parse(e);
1087
1087
  return /https?:/.test((n = r == null ? void 0 : r.protocol) == null ? "" : n);
1088
1088
  }
1089
- function Dt(e) {
1089
+ function Et(e) {
1090
1090
  e.preventDefault();
1091
1091
  }
1092
- function Ot(e) {
1092
+ function Dt(e) {
1093
1093
  e.preventDefault(), e.stopPropagation();
1094
1094
  }
1095
- var kt = class e {
1095
+ var Ot = class e {
1096
1096
  static toDateObject(t) {
1097
1097
  if (t instanceof Date) return t;
1098
1098
  if (!t || typeof t != "string") return null;
1099
- m(e, this, At)._ || (At._ = m(e, this, /* @__PURE__ */ RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?")));
1100
- let n = m(e, this, At)._.exec(t);
1099
+ m(e, this, kt)._ || (kt._ = m(e, this, /* @__PURE__ */ RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?")));
1100
+ let n = m(e, this, kt)._.exec(t);
1101
1101
  if (!n) return null;
1102
1102
  let r = parseInt(n[1], 10), i = parseInt(n[2], 10);
1103
1103
  i = i >= 1 && i <= 12 ? i - 1 : 0;
@@ -1114,8 +1114,8 @@ var kt = class e {
1114
1114
  let d = parseInt(n[9], 10) || 0;
1115
1115
  return d = d >= 0 && d <= 59 ? d : 0, l === "-" ? (o += u, s += d) : l === "+" && (o -= u, s -= d), new Date(Date.UTC(r, i, a, o, s, c));
1116
1116
  }
1117
- }, At = { _: void 0 };
1118
- function jt(e) {
1117
+ }, kt = { _: void 0 };
1118
+ function At(e) {
1119
1119
  if (e.startsWith("#")) {
1120
1120
  let t = e.slice(1);
1121
1121
  return [
@@ -1151,25 +1151,25 @@ function jt(e) {
1151
1151
  t[4] !== void 0 && t[4] !== "none" ? parseFloat(t[4]) : 1
1152
1152
  ] : null;
1153
1153
  }
1154
- function Mt(e) {
1155
- let t = jt(e);
1154
+ function jt(e) {
1155
+ let t = At(e);
1156
1156
  return t ? t.slice(0, 3) : (F(`Not a valid color format: "${e}"`), [
1157
1157
  0,
1158
1158
  0,
1159
1159
  0
1160
1160
  ]);
1161
1161
  }
1162
- function Nt(e) {
1162
+ function Mt(e) {
1163
1163
  let t = document.createElement("span");
1164
1164
  t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
1165
1165
  for (let n of e.keys()) {
1166
1166
  t.style.color = n;
1167
1167
  let r = window.getComputedStyle(t).color;
1168
- e.set(n, Mt(r));
1168
+ e.set(n, jt(r));
1169
1169
  }
1170
1170
  t.remove();
1171
1171
  }
1172
- function B(e) {
1172
+ function Nt(e) {
1173
1173
  let { a: t, b: n, c: r, d: i, e: a, f: o } = e.getTransform();
1174
1174
  return [
1175
1175
  t,
@@ -1192,7 +1192,7 @@ function Pt(e) {
1192
1192
  ];
1193
1193
  }
1194
1194
  function Ft(e, t, n = !1, r = !0) {
1195
- if (t instanceof pt) {
1195
+ if (t instanceof ft) {
1196
1196
  let { pageWidth: r, pageHeight: i } = t.rawDims, { style: a } = e, o = `round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`, s = `round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;
1197
1197
  !n || t.rotation % 180 == 0 ? (a.width = o, a.height = s) : (a.width = s, a.height = o);
1198
1198
  }
@@ -1247,12 +1247,12 @@ var It = class e {
1247
1247
  let { style: t } = e;
1248
1248
  t.width = t.height = "0", t.display = "none", t.color = "var(--comment-fg-color)", document.body.append(e);
1249
1249
  let { color: n } = window.getComputedStyle(e);
1250
- return e.remove(), L(this, "commentForegroundColor", Mt(n));
1250
+ return e.remove(), L(this, "commentForegroundColor", jt(n));
1251
1251
  }
1252
1252
  };
1253
1253
  function Bt(e, t) {
1254
1254
  var n;
1255
- t = ft((n = t) == null ? 1 : n, 0, 1);
1255
+ t = B((n = t) == null ? 1 : n, 0, 1);
1256
1256
  let r = 255 * (1 - t);
1257
1257
  return e.map((e) => Math.round(e * t + r));
1258
1258
  }
@@ -1339,7 +1339,7 @@ function qt({ html: e, dir: t, className: n }, r) {
1339
1339
  n.append(document.createTextNode(i)), e < t - 1 && n.append(document.createElement("br"));
1340
1340
  }
1341
1341
  i.append(n);
1342
- } else ht.render({
1342
+ } else mt.render({
1343
1343
  xfaHtml: e,
1344
1344
  div: i,
1345
1345
  intent: "richText"
@@ -1385,7 +1385,7 @@ var Yt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), Zt =
1385
1385
  let e = T(Yt, this, document.createElement("div"));
1386
1386
  e.classList.add("editToolbar", "hidden"), e.setAttribute("role", "toolbar");
1387
1387
  let t = C(Zt, this)._uiManager._signal;
1388
- t instanceof AbortSignal && !t.aborted && (e.addEventListener("contextmenu", Dt, { signal: t }), e.addEventListener("pointerdown", on, { signal: t }));
1388
+ t instanceof AbortSignal && !t.aborted && (e.addEventListener("contextmenu", Et, { signal: t }), e.addEventListener("pointerdown", on, { signal: t }));
1389
1389
  let n = T(Qt, this, document.createElement("div"));
1390
1390
  n.className = "buttons", e.append(n);
1391
1391
  let r = C(Zt, this).toolbarPosition;
@@ -1490,10 +1490,10 @@ function on(e) {
1490
1490
  e.stopPropagation();
1491
1491
  }
1492
1492
  function sn(e) {
1493
- C(Zt, this)._focusEventsAllowed = !1, Ot(e);
1493
+ C(Zt, this)._focusEventsAllowed = !1, Dt(e);
1494
1494
  }
1495
1495
  function cn(e) {
1496
- C(Zt, this)._focusEventsAllowed = !0, Ot(e);
1496
+ C(Zt, this)._focusEventsAllowed = !0, Dt(e);
1497
1497
  }
1498
1498
  function ln(e) {
1499
1499
  let t = C(Zt, this)._uiManager._signal;
@@ -1503,7 +1503,7 @@ function ln(e) {
1503
1503
  }), e.addEventListener("focusout", m(rn, this, cn).bind(this), {
1504
1504
  capture: !0,
1505
1505
  signal: t
1506
- }), e.addEventListener("contextmenu", Dt, { signal: t }), !0);
1506
+ }), e.addEventListener("contextmenu", Et, { signal: t }), !0);
1507
1507
  }
1508
1508
  function un() {
1509
1509
  let e = document.createElement("div");
@@ -1525,7 +1525,7 @@ function _n() {
1525
1525
  let e = T(pn, this, document.createElement("div"));
1526
1526
  e.className = "editToolbar", e.setAttribute("role", "toolbar");
1527
1527
  let t = C(mn, this)._signal;
1528
- t instanceof AbortSignal && !t.aborted && e.addEventListener("contextmenu", Dt, { signal: t });
1528
+ t instanceof AbortSignal && !t.aborted && e.addEventListener("contextmenu", Et, { signal: t });
1529
1529
  let n = T(fn, this, document.createElement("div"));
1530
1530
  return n.className = "buttons", e.append(n), C(mn, this).hasCommentManager() && m(hn, this, yn).call(this, "commentButton", "pdfjs-comment-floating-button", "pdfjs-comment-floating-button-label", () => {
1531
1531
  C(mn, this).commentSelection("floating_button");
@@ -1553,7 +1553,7 @@ function yn(e, t, n, r) {
1553
1553
  let a = document.createElement("span");
1554
1554
  i.append(a), a.className = "visuallyHidden", a.setAttribute("data-l10n-id", n);
1555
1555
  let o = C(mn, this)._signal;
1556
- o instanceof AbortSignal && !o.aborted && (i.addEventListener("contextmenu", Dt, { signal: o }), i.addEventListener("click", r, { signal: o })), C(fn, this).append(i);
1556
+ o instanceof AbortSignal && !o.aborted && (i.addEventListener("contextmenu", Et, { signal: o }), i.addEventListener("click", r, { signal: o })), C(fn, this).append(i);
1557
1557
  }
1558
1558
  var bn = Object.freeze({ internal: "068f09d6-5b37-4f77-a97a-f8ff4f253b68" });
1559
1559
  function xn(e, t, n) {
@@ -1701,7 +1701,7 @@ function Pn(e, t) {
1701
1701
  isSvg: !1
1702
1702
  });
1703
1703
  let e;
1704
- if (typeof t == "string" ? (r.url = t, e = yield _t(t, "blob")) : t instanceof File ? e = r.file = t : t instanceof Blob && (e = t), e.type === "image/svg+xml") {
1704
+ if (typeof t == "string" ? (r.url = t, e = yield gt(t, "blob")) : t instanceof File ? e = r.file = t : t instanceof Blob && (e = t), e.type === "image/svg+xml") {
1705
1705
  let t = re._isSVGFittingCanvas, n = new FileReader(), i = new Image(), a = new Promise((e, a) => {
1706
1706
  i.onload = () => {
1707
1707
  r.bitmap = i, r.isSvg = !0, e();
@@ -1805,7 +1805,7 @@ var Fn = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), Ln =
1805
1805
  let i = (n.altKey ? e.ALT : 0) | (n.ctrlKey ? e.CTRL : 0) | (n.metaKey ? e.META : 0) | (n.shiftKey ? e.SHIFT : 0), a = r.find((e) => e.modifiers === i);
1806
1806
  if (!a) return;
1807
1807
  let { callback: o, options: { bubbles: s = !1, args: c = [], checker: l = null } } = a;
1808
- l && !l(t, n) || (o.bind(t, ...c, n)(), s || Ot(n));
1808
+ l && !l(t, n) || (o.bind(t, ...c, n)(), s || Dt(n));
1809
1809
  }
1810
1810
  };
1811
1811
  ie = Bn;
@@ -1835,10 +1835,10 @@ v(Bn, "ALT", 1), v(Bn, "CTRL", 2), v(Bn, "META", 4), v(Bn, "SHIFT", 8);
1835
1835
  var Un = class e {
1836
1836
  get _colors() {
1837
1837
  let e = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
1838
- return Nt(e), L(this, "_colors", e);
1838
+ return Mt(e), L(this, "_colors", e);
1839
1839
  }
1840
1840
  convert(t) {
1841
- let n = Mt(t);
1841
+ let n = jt(t);
1842
1842
  if (!window.matchMedia("(forced-colors: active)").matches) return n;
1843
1843
  for (let [t, r] of this._colors) if (r.every((e, t) => e === n[t])) return e._colorsMapping.get(t);
1844
1844
  return n;
@@ -2008,7 +2008,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
2008
2008
  capture: !0,
2009
2009
  signal: _
2010
2010
  }), m(V, this, qr).call(this), m(V, this, ei).call(this), m(V, this, Xr).call(this), T(Zn, this, s.annotationStorage), T(dr, this, s.filterFactory), T(Ar, this, c), T(mr, this, l || null), T(cr, this, u), T(lr, this, d), T(ur, this, f), T(Tr, this, p || null), this.viewParameters = {
2011
- realScale: gt.PDF_TO_CSS_UNITS,
2011
+ realScale: ht.PDF_TO_CSS_UNITS,
2012
2012
  rotation: 0
2013
2013
  }, this.isShiftKeyDown = !1, this._editorUndoBar = h || null, this._supportsPinchToZoom = g !== !1, i == null || i.setSidebarUiManager(this);
2014
2014
  }
@@ -2193,7 +2193,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
2193
2193
  }
2194
2194
  onScaleChanging({ scale: e }) {
2195
2195
  var t;
2196
- this.commitOrRemove(), this.viewParameters.realScale = e * gt.PDF_TO_CSS_UNITS;
2196
+ this.commitOrRemove(), this.viewParameters.realScale = e * ht.PDF_TO_CSS_UNITS;
2197
2197
  for (let e of C(sr, this)) e.onScaleChanging();
2198
2198
  (t = C(nr, this)) == null || t.onScaleChanging();
2199
2199
  }
@@ -2940,7 +2940,7 @@ var li = /* @__PURE__ */ new WeakMap(), ui = /* @__PURE__ */ new WeakMap(), di =
2940
2940
  let n = T(fi, e, document.createElement("span"));
2941
2941
  t.append(n), C(bi, e) ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Ti._.missing), n.setAttribute("data-l10n-id", Ti._["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), n.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
2942
2942
  let r = C(_i, e)._uiManager._signal;
2943
- t.addEventListener("contextmenu", Dt, { signal: r }), t.addEventListener("pointerdown", (e) => e.stopPropagation(), { signal: r });
2943
+ t.addEventListener("contextmenu", Et, { signal: r }), t.addEventListener("pointerdown", (e) => e.stopPropagation(), { signal: r });
2944
2944
  let i = (t) => {
2945
2945
  t.preventDefault(), C(_i, e)._uiManager.editAltText(C(_i, e)), C(bi, e) && C(_i, e)._reportTelemetry({
2946
2946
  action: "pdfjs.image.alt_text.image_status_label_clicked",
@@ -3178,13 +3178,13 @@ function Ri(e, t) {
3178
3178
  e.tabIndex = "0", e.ariaHasPopup = "dialog", t ? (e.ariaControls = "commentPopup", e.setAttribute("data-l10n-id", "pdfjs-show-comment-button")) : (e.ariaControlsElements = [C(ki, this)._uiManager.getCommentDialogElement()], e.setAttribute("data-l10n-id", "pdfjs-editor-add-comment-button"));
3179
3179
  let n = C(ki, this)._uiManager._signal;
3180
3180
  if (!(n instanceof AbortSignal) || n.aborted) return e;
3181
- e.addEventListener("contextmenu", Dt, { signal: n }), t && (e.addEventListener("focusin", (e) => {
3182
- C(ki, this)._focusEventsAllowed = !1, Ot(e);
3181
+ e.addEventListener("contextmenu", Et, { signal: n }), t && (e.addEventListener("focusin", (e) => {
3182
+ C(ki, this)._focusEventsAllowed = !1, Dt(e);
3183
3183
  }, {
3184
3184
  capture: !0,
3185
3185
  signal: n
3186
3186
  }), e.addEventListener("focusout", (e) => {
3187
- C(ki, this)._focusEventsAllowed = !0, Ot(e);
3187
+ C(ki, this)._focusEventsAllowed = !0, Dt(e);
3188
3188
  }, {
3189
3189
  capture: !0,
3190
3190
  signal: n
@@ -3235,7 +3235,7 @@ function $i(e) {
3235
3235
  }
3236
3236
  };
3237
3237
  n.addEventListener("pointerdown", (e) => {
3238
- e.pointerType === "touch" && (Ot(e), i(e));
3238
+ e.pointerType === "touch" && (Dt(e), i(e));
3239
3239
  }, r), n.addEventListener("pointerup", i, r), n.addEventListener("pointercancel", i, r);
3240
3240
  return;
3241
3241
  }
@@ -3249,9 +3249,9 @@ function $i(e) {
3249
3249
  };
3250
3250
  t.addEventListener("touchmove", m(Zi, this, ea).bind(this), n);
3251
3251
  let i = m(Zi, this, ta).bind(this);
3252
- t.addEventListener("touchend", i, n), t.addEventListener("touchcancel", i, n), n.capture = !0, t.addEventListener("pointerdown", Ot, n), t.addEventListener("pointermove", Ot, n), t.addEventListener("pointercancel", Ot, n), t.addEventListener("pointerup", Ot, n), (r = C(Ui, this)) == null || r.call(this);
3252
+ t.addEventListener("touchend", i, n), t.addEventListener("touchcancel", i, n), n.capture = !0, t.addEventListener("pointerdown", Dt, n), t.addEventListener("pointermove", Dt, n), t.addEventListener("pointercancel", Dt, n), t.addEventListener("pointerup", Dt, n), (r = C(Ui, this)) == null || r.call(this);
3253
3253
  }
3254
- if (Ot(e), e.touches.length !== 2 || (n = C(Vi, this)) != null && n.call(this)) {
3254
+ if (Dt(e), e.touches.length !== 2 || (n = C(Vi, this)) != null && n.call(this)) {
3255
3255
  T(Ji, this, null);
3256
3256
  return;
3257
3257
  }
@@ -3266,7 +3266,7 @@ function $i(e) {
3266
3266
  function ea(e) {
3267
3267
  var t;
3268
3268
  if (!C(Ji, this) || e.touches.length !== 2) return;
3269
- Ot(e);
3269
+ Dt(e);
3270
3270
  let [n, r] = e.touches;
3271
3271
  n.identifier > r.identifier && ([n, r] = [r, n]);
3272
3272
  let { screenX: i, screenY: a } = n, { screenX: o, screenY: s } = r, c = C(Ji, this), { touch0X: l, touch0Y: u, touch1X: d, touch1Y: f } = c, p = d - l, m = f - u, h = o - i, g = s - a, _ = Math.hypot(h, g) || 1, v = Math.hypot(p, m) || 1;
@@ -3284,7 +3284,7 @@ function ta(e) {
3284
3284
  var t;
3285
3285
  C(Xi, this).abort(), T(Xi, this, null), (t = C(Gi, this)) == null || t.call(this);
3286
3286
  }
3287
- C(Ji, this) && (Ot(e), T(Ji, this, null), T(Bi, this, !1));
3287
+ C(Ji, this) && (Dt(e), T(Ji, this, null), T(Bi, this, !1));
3288
3288
  }
3289
3289
  }
3290
3290
  var na = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), aa = /* @__PURE__ */ new WeakMap(), oa = /* @__PURE__ */ new WeakMap(), sa = /* @__PURE__ */ new WeakMap(), ca = /* @__PURE__ */ new WeakMap(), la = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new WeakMap(), da = /* @__PURE__ */ new WeakMap(), fa = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), ma = /* @__PURE__ */ new WeakMap(), ha = /* @__PURE__ */ new WeakMap(), ga = /* @__PURE__ */ new WeakMap(), _a = /* @__PURE__ */ new WeakMap(), va = /* @__PURE__ */ new WeakMap(), ya = /* @__PURE__ */ new WeakMap(), ba = /* @__PURE__ */ new WeakMap(), xa = /* @__PURE__ */ new WeakMap(), Sa = /* @__PURE__ */ new WeakMap(), Ca = /* @__PURE__ */ new WeakMap(), wa = /* @__PURE__ */ new WeakMap(), Ta = /* @__PURE__ */ new WeakMap(), Ea = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakSet(), W = class e {
@@ -3533,16 +3533,16 @@ var na = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), ia =
3533
3533
  let { div: { style: t }, pageDimensions: [n, r] } = this, { x: i, y: a, width: o, height: s } = this;
3534
3534
  if (o *= n, s *= r, i *= n, a *= r, this._mustFixPosition) switch (e) {
3535
3535
  case 0:
3536
- i = ft(i, 0, n - o), a = ft(a, 0, r - s);
3536
+ i = B(i, 0, n - o), a = B(a, 0, r - s);
3537
3537
  break;
3538
3538
  case 90:
3539
- i = ft(i, 0, n - s), a = ft(a, o, r);
3539
+ i = B(i, 0, n - s), a = B(a, o, r);
3540
3540
  break;
3541
3541
  case 180:
3542
- i = ft(i, o, n), a = ft(a, s, r);
3542
+ i = B(i, o, n), a = B(a, s, r);
3543
3543
  break;
3544
3544
  case 270:
3545
- i = ft(i, s, n), a = ft(a, 0, r - o);
3545
+ i = B(i, s, n), a = B(a, 0, r - o);
3546
3546
  break;
3547
3547
  }
3548
3548
  this.x = i /= n, this.y = a /= r;
@@ -4210,7 +4210,7 @@ function Aa() {
4210
4210
  ], t = this._uiManager._signal;
4211
4211
  for (let n of e) {
4212
4212
  let e = document.createElement("div");
4213
- C(la, this).append(e), e.classList.add("resizer", n), e.setAttribute("data-resizer-name", n), e.addEventListener("pointerdown", m(U, this, ja).bind(this, n), { signal: t }), e.addEventListener("contextmenu", Dt, { signal: t }), e.tabIndex = -1;
4213
+ C(la, this).append(e), e.classList.add("resizer", n), e.setAttribute("data-resizer-name", n), e.addEventListener("pointerdown", m(U, this, ja).bind(this, n), { signal: t }), e.addEventListener("contextmenu", Et, { signal: t }), e.tabIndex = -1;
4214
4214
  }
4215
4215
  this.div.prepend(C(la, this));
4216
4216
  }
@@ -4227,10 +4227,10 @@ function ja(e, t) {
4227
4227
  passive: !0,
4228
4228
  capture: !0,
4229
4229
  signal: o
4230
- }), window.addEventListener("touchmove", Ot, {
4230
+ }), window.addEventListener("touchmove", Dt, {
4231
4231
  passive: !1,
4232
4232
  signal: o
4233
- }), window.addEventListener("contextmenu", Dt, { signal: o }), T(da, this, {
4233
+ }), window.addEventListener("contextmenu", Et, { signal: o }), T(da, this, {
4234
4234
  savedX: this.x,
4235
4235
  savedY: this.y,
4236
4236
  savedWidth: this.width,
@@ -4295,7 +4295,7 @@ function Pa(e, t) {
4295
4295
  if ([ee, O] = p(ee / n, O / r), _) {
4296
4296
  let e = Math.hypot(o, s);
4297
4297
  E = D = Math.max(Math.min(Math.hypot(b[0] - y[0] - ee, b[1] - y[1] - O) / e, 1 / o, 1 / s), c / o, l / s);
4298
- } else v ? E = ft(Math.abs(b[0] - y[0] - ee), c, 1) / o : D = ft(Math.abs(b[1] - y[1] - O), l, 1) / s;
4298
+ } else v ? E = B(Math.abs(b[0] - y[0] - ee), c, 1) / o : D = B(Math.abs(b[1] - y[1] - O), l, 1) / s;
4299
4299
  let k = j._round(o * E), te = j._round(s * D);
4300
4300
  x = d(...g(k, te));
4301
4301
  let A = S - x[0], ne = w - x[1];
@@ -4353,20 +4353,20 @@ function za(e) {
4353
4353
  n || (n = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
4354
4354
  let { clientX: t, clientY: r, pointerId: i } = e;
4355
4355
  if (i !== C(sa, this)) {
4356
- Ot(e);
4356
+ Dt(e);
4357
4357
  return;
4358
4358
  }
4359
4359
  let [a, o] = this.screenToPageTranslation(t - C(xa, this), r - C(Sa, this));
4360
4360
  T(xa, this, t), T(Sa, this, r), this._uiManager.dragSelectedEditors(a, o);
4361
- }, a), window.addEventListener("touchmove", Ot, a), window.addEventListener("pointerdown", (e) => {
4362
- e.pointerType === C(ca, this) && (C(wa, this) || e.isPrimary) && o(e), Ot(e);
4361
+ }, a), window.addEventListener("touchmove", Dt, a), window.addEventListener("pointerdown", (e) => {
4362
+ e.pointerType === C(ca, this) && (C(wa, this) || e.isPrimary) && o(e), Dt(e);
4363
4363
  }, a));
4364
4364
  let s = (e) => {
4365
4365
  if (!C(sa, this) || C(sa, this) === e.pointerId) {
4366
4366
  o(e);
4367
4367
  return;
4368
4368
  }
4369
- Ot(e);
4369
+ Dt(e);
4370
4370
  };
4371
4371
  window.addEventListener("pointerup", s, { signal: i }), window.addEventListener("blur", s, { signal: i });
4372
4372
  }
@@ -4432,7 +4432,7 @@ var Ka = class extends W {
4432
4432
  hash: "",
4433
4433
  transfer: void 0
4434
4434
  }), Qa = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ new WeakSet();
4435
- me = Symbol.iterator;
4435
+ he = Symbol.iterator;
4436
4436
  var ro = class {
4437
4437
  constructor() {
4438
4438
  w(this, no), S(this, Qa, !1), S(this, $a, null), S(this, eo, null), S(this, to, /* @__PURE__ */ new Map()), v(this, "onSetModified", null), v(this, "onResetModified", null), v(this, "onAnnotationEditor", null);
@@ -4541,7 +4541,7 @@ var ro = class {
4541
4541
  hash: t
4542
4542
  });
4543
4543
  }
4544
- [me]() {
4544
+ [he]() {
4545
4545
  return C(to, this).entries();
4546
4546
  }
4547
4547
  };
@@ -4698,7 +4698,7 @@ var po = new Uint32Array(new Uint8Array([
4698
4698
  i,
4699
4699
  r,
4700
4700
  a
4701
- ], s, c), C(yo, this)[0] = ft(c[0], o[0], C(yo, this)[0]), C(yo, this)[1] = ft(c[1], o[1], C(yo, this)[1]), C(yo, this)[2] = ft(c[2], C(yo, this)[2], o[2]), C(yo, this)[3] = ft(c[3], C(yo, this)[3], o[3]), this;
4701
+ ], s, c), C(yo, this)[0] = B(c[0], o[0], C(yo, this)[0]), C(yo, this)[1] = B(c[1], o[1], C(yo, this)[1]), C(yo, this)[2] = B(c[2], C(yo, this)[2], o[2]), C(yo, this)[3] = B(c[3], C(yo, this)[3], o[3]), this;
4702
4702
  }
4703
4703
  recordFullPageBBox(e) {
4704
4704
  return C(yo, this)[0] = Math.max(0, C(G, this)[0]), C(yo, this)[1] = Math.max(0, C(G, this)[1]), C(yo, this)[2] = Math.min(C(bo, this), C(G, this)[2]), C(yo, this)[3] = Math.min(C(xo, this), C(G, this)[3]), this;
@@ -5079,7 +5079,7 @@ var Do = /* @__PURE__ */ new WeakMap(), Oo = /* @__PURE__ */ new WeakMap(), ko =
5079
5079
  let e = new Yo._(C(Go, this) * 6);
5080
5080
  e.set(C(qo, this)), T(qo, this, e);
5081
5081
  }
5082
- let a = B(e), o;
5082
+ let a = Nt(e), o;
5083
5083
  if (r[0] !== Infinity) {
5084
5084
  let e = ye.slice();
5085
5085
  z.axialAlignedBoundingBox([
@@ -6062,7 +6062,7 @@ var Zs = /* @__PURE__ */ new WeakMap(), Qs = class {
6062
6062
  }, $s = class extends Qs {
6063
6063
  _fetch(e, t) {
6064
6064
  return b(function* () {
6065
- let n = yield _t(e, t === "cMapUrl" && !e.endsWith(".bcmap") ? "text" : "bytes");
6065
+ let n = yield gt(e, t === "cMapUrl" && !e.endsWith(".bcmap") ? "text" : "bytes");
6066
6066
  return n instanceof Uint8Array ? n : et(n);
6067
6067
  })();
6068
6068
  }
@@ -6294,7 +6294,7 @@ function gc(e) {
6294
6294
  if (C(ic, this) === void 0) {
6295
6295
  T(ic, this, "");
6296
6296
  let e = C(cc, this).URL;
6297
- e !== C(cc, this).baseURI && (bt(e) ? F("#createUrl: ignore \"data:\"-URL for performance reasons.") : T(ic, this, We(e, "")));
6297
+ e !== C(cc, this).baseURI && (yt(e) ? F("#createUrl: ignore \"data:\"-URL for performance reasons.") : T(ic, this, We(e, "")));
6298
6298
  }
6299
6299
  return `url(${C(ic, this)}#${e})`;
6300
6300
  }
@@ -6323,10 +6323,10 @@ function Sc(e, t) {
6323
6323
  t.append(n), m(K, this, bc).call(this, n, "feFuncA", e);
6324
6324
  }
6325
6325
  function Cc(e) {
6326
- return mc.call(m(K, this)).style.color = e, Mt(getComputedStyle(mc.call(m(K, this))).getPropertyValue("color"));
6326
+ return mc.call(m(K, this)).style.color = e, jt(getComputedStyle(mc.call(m(K, this))).getPropertyValue("color"));
6327
6327
  }
6328
6328
  function wc(e) {
6329
- return mc.call(m(K, this)).style.color = e, jt(getComputedStyle(mc.call(m(K, this))).getPropertyValue("color"));
6329
+ return mc.call(m(K, this)).style.color = e, At(getComputedStyle(mc.call(m(K, this))).getPropertyValue("color"));
6330
6330
  }
6331
6331
  function Tc(e) {
6332
6332
  let [t, n, r, i] = m(K, this, wc).call(this, e);
@@ -6598,7 +6598,7 @@ var Yc = class {
6598
6598
  if (Math.abs(a - o) < i) return this._createGradient(e, r);
6599
6599
  } else return this._createGradient(e, r);
6600
6600
  }
6601
- let a = t.current.getClippedPathBoundingBox(r, B(e)) || [
6601
+ let a = t.current.getClippedPathBoundingBox(r, Nt(e)) || [
6602
6602
  0,
6603
6603
  0,
6604
6604
  0,
@@ -6675,7 +6675,7 @@ var Qc = class extends Yc {
6675
6675
  getPattern(e, t, n, r) {
6676
6676
  Jc(e, this._bbox);
6677
6677
  let i = /* @__PURE__ */ new Float32Array(2);
6678
- if (r === qc.SHADING) z.singularValueDecompose2dScale(B(e), i);
6678
+ if (r === qc.SHADING) z.singularValueDecompose2dScale(Nt(e), i);
6679
6679
  else if (this.matrix) {
6680
6680
  z.singularValueDecompose2dScale(this.matrix, i);
6681
6681
  let [e, n] = i;
@@ -6720,7 +6720,7 @@ var tl = {
6720
6720
  _renderTileCanvas(e, t, n, r) {
6721
6721
  var i, a;
6722
6722
  let [o, s, c, l] = this.bbox, u = e.canvasFactory.create(n.size, r.size), d = u.context, f = this.canvasGraphicsFactory.createCanvasGraphics(d, t);
6723
- return f.groupLevel = e.groupLevel, this.setFillAndStrokeStyleToContext(f, this.paintType, this.color), d.translate(-n.scale * o, -r.scale * s), f.transform(0, n.scale, 0, 0, r.scale, 0, 0), d.save(), (i = f.dependencyTracker) == null || i.save(), this.clipBbox(f, o, s, c, l), f.baseTransform = B(f.ctx), f.executeOperatorList(this.operatorList), f.endDrawing(), (a = f.dependencyTracker) == null || a.restore(), d.restore(), u;
6723
+ return f.groupLevel = e.groupLevel, this.setFillAndStrokeStyleToContext(f, this.paintType, this.color), d.translate(-n.scale * o, -r.scale * s), f.transform(0, n.scale, 0, 0, r.scale, 0, 0), d.save(), (i = f.dependencyTracker) == null || i.save(), this.clipBbox(f, o, s, c, l), f.baseTransform = Nt(f.ctx), f.executeOperatorList(this.operatorList), f.endDrawing(), (a = f.dependencyTracker) == null || a.restore(), d.restore(), u;
6724
6724
  }
6725
6725
  _getCombinedScales() {
6726
6726
  let e = /* @__PURE__ */ new Float32Array(2);
@@ -6733,7 +6733,7 @@ var tl = {
6733
6733
  if (u && (e.dependencyTracker = new Vo(u, a)), e.save(), n ? e.ctx.clip(t, "evenodd") : e.ctx.clip(t), e.ctx.setTransform(...this.patternBaseMatrix), e.ctx.translate(r * this.xstep, i * this.ystep), this.needsIsolation || e.ctx.globalAlpha !== 1 || e.ctx.globalCompositeOperation !== "source-over" || e.inSMaskMode) {
6734
6734
  let t = c - o, n = l - s, [r, i] = this._getCombinedScales(), u = this.getSizeAndScale(t, this.ctx.canvas.width, r), d = this.getSizeAndScale(n, this.ctx.canvas.height, i), f = this._renderTileCanvas(e, a, u, d);
6735
6735
  e.ctx.drawImage(f.canvas, o, s, t, n), e.canvasFactory.destroy(f);
6736
- } else this.setFillAndStrokeStyleToContext(e, this.paintType, this.color), this.clipBbox(e, o, s, c, l), e.baseTransformStack.push(e.baseTransform), e.baseTransform = B(e.ctx), e.executeOperatorList(this.operatorList), e.baseTransform = e.baseTransformStack.pop();
6736
+ } else this.setFillAndStrokeStyleToContext(e, this.paintType, this.color), this.clipBbox(e, o, s, c, l), e.baseTransformStack.push(e.baseTransform), e.baseTransform = Nt(e.ctx), e.executeOperatorList(this.operatorList), e.baseTransform = e.baseTransformStack.pop();
6737
6737
  e.restore(), u && (e.dependencyTracker = u);
6738
6738
  }
6739
6739
  createPatternCanvas(e, t) {
@@ -6779,7 +6779,7 @@ var tl = {
6779
6779
  n,
6780
6780
  r,
6781
6781
  i
6782
- ], B(e.ctx), e.current.minMax), e.ctx.clip(s), e.current.updateClipFromPath();
6782
+ ], Nt(e.ctx), e.current.minMax), e.ctx.clip(s), e.current.updateClipFromPath();
6783
6783
  }
6784
6784
  setFillAndStrokeStyleToContext(e, t, n) {
6785
6785
  let r = e.ctx, i = e.current;
@@ -6842,7 +6842,7 @@ function ul(e, t) {
6842
6842
  };
6843
6843
  }
6844
6844
  function dl(e, t, n, r, i, a, o, s, c, l) {
6845
- let [u, d, f, p, m, h] = B(e);
6845
+ let [u, d, f, p, m, h] = Nt(e);
6846
6846
  if (d === 0 && f === 0) {
6847
6847
  let g = o * u + m, _ = Math.round(g), v = s * p + h, y = Math.round(v), b = (o + c) * u + m, x = Math.abs(Math.round(b) - _) || 1, S = (s + l) * p + h, C = Math.abs(Math.round(S) - y) || 1;
6848
6848
  return e.setTransform(Math.sign(u), 0, 0, Math.sign(p), _, y), e.drawImage(t, n, r, i, a, 0, 0, x, C), e.setTransform(u, d, f, p, m, h), [x, C];
@@ -6958,7 +6958,7 @@ function gl(e) {
6958
6958
  function _l(e, t) {
6959
6959
  if (t) return !0;
6960
6960
  z.singularValueDecompose2dScale(e, ll);
6961
- let n = Math.fround(It.pixelRatio * gt.PDF_TO_CSS_UNITS);
6961
+ let n = Math.fround(It.pixelRatio * ht.PDF_TO_CSS_UNITS);
6962
6962
  return ll[0] <= n && ll[1] <= n;
6963
6963
  }
6964
6964
  var vl = [
@@ -6984,9 +6984,9 @@ var vl = [
6984
6984
  let i = this.ctx.canvas.width, a = this.ctx.canvas.height, o = this.ctx.fillStyle;
6985
6985
  if (this.ctx.fillStyle = r || "#ffffff", this.ctx.fillRect(0, 0, i, a), this.ctx.fillStyle = o, n) {
6986
6986
  let e = this.transparentCanvasEntry = this.canvasFactory.create(i, a);
6987
- this.compositeCtx = this.ctx, {canvas: this.transparentCanvas, context: this.ctx} = e, this.ctx.save(), this.ctx.transform(...B(this.compositeCtx));
6987
+ this.compositeCtx = this.ctx, {canvas: this.transparentCanvas, context: this.ctx} = e, this.ctx.save(), this.ctx.transform(...Nt(this.compositeCtx));
6988
6988
  }
6989
- this.ctx.save(), gl(this.ctx), e && (this.ctx.transform(...e), this.outputScaleX = e[0], this.outputScaleY = e[3]), this.ctx.transform(...t.transform), this.viewportScale = t.scale, this.baseTransform = B(this.ctx);
6989
+ this.ctx.save(), gl(this.ctx), e && (this.ctx.transform(...e), this.outputScaleX = e[0], this.outputScaleY = e[3]), this.ctx.transform(...t.transform), this.viewportScale = t.scale, this.baseTransform = Nt(this.ctx);
6990
6990
  }
6991
6991
  executeOperatorList(e, t, n, r, i) {
6992
6992
  let a = e.argsArray, o = e.fnArray, s = t || 0, c = a.length;
@@ -7065,7 +7065,7 @@ var vl = [
7065
7065
  }
7066
7066
  _createMaskCanvas(e, t) {
7067
7067
  var n;
7068
- let r = this.ctx, { width: i, height: a } = t, o = this.current.fillColor, s = this.current.patternFill, c = B(r), l, u, d, f;
7068
+ let r = this.ctx, { width: i, height: a } = t, o = this.current.fillColor, s = this.current.patternFill, c = Nt(r), l, u, d, f;
7069
7069
  if ((t.bitmap || t.data) && t.count > 1) {
7070
7070
  let n = t.bitmap || t.data.buffer;
7071
7071
  u = JSON.stringify(s ? c : [c.slice(0, 4), o]), l = this._cachedBitmapsMap.getOrInsertComputed(n, ut);
@@ -7112,7 +7112,7 @@ var vl = [
7112
7112
  let e = this._scaleImage(f.canvas, Pt(C));
7113
7113
  d = e.img, E = e.tmpCanvas, d !== f.canvas && (this.canvasFactory.destroy(f), f = null), l && s && (l.set(u, d), E = null, f = null);
7114
7114
  }
7115
- C.imageSmoothingEnabled = _l(B(C), t.interpolate), dl(C, d, 0, 0, d.width, d.height, 0, 0, i, a), E && this.canvasFactory.destroy(E), f && this.canvasFactory.destroy(f), C.globalCompositeOperation = "source-in";
7115
+ C.imageSmoothingEnabled = _l(Nt(C), t.interpolate), dl(C, d, 0, 0, d.width, d.height, 0, 0, i, a), E && this.canvasFactory.destroy(E), f && this.canvasFactory.destroy(f), C.globalCompositeOperation = "source-in";
7116
7116
  let D = z.transform(Pt(C), [
7117
7117
  1,
7118
7118
  0,
@@ -7222,7 +7222,7 @@ var vl = [
7222
7222
  let o;
7223
7223
  if (n === "Luminosity" && r) {
7224
7224
  var s;
7225
- let [e, t, n] = jt(r), a = Math.round(.3 * e + .59 * t + .11 * n);
7225
+ let [e, t, n] = At(r), a = Math.round(.3 * e + .59 * t + .11 * n);
7226
7226
  o = (s = i == null ? void 0 : i[a]) == null ? a : s;
7227
7227
  } else {
7228
7228
  var c;
@@ -7342,7 +7342,7 @@ var vl = [
7342
7342
  let n = t === Pe.stroke ? this.current.lineWidth / 2 : 0;
7343
7343
  this.dependencyTracker.resetBBox(e).recordBBox(e, this.ctx, r[0] - n, r[2] + n, r[1] - n, r[3] + n).recordDependencies(e, ["transform"]);
7344
7344
  }
7345
- i instanceof Path2D || (i = n[0] = Jt(i)), z.axialAlignedBoundingBox(r, B(this.ctx), this.current.minMax);
7345
+ i instanceof Path2D || (i = n[0] = Jt(i)), z.axialAlignedBoundingBox(r, Nt(this.ctx), this.current.minMax);
7346
7346
  let a = this.current.tilingPatternDims;
7347
7347
  if (a && t !== Pe.stroke && t !== Pe.closeStroke && this.current.fillColor instanceof nl) {
7348
7348
  let e = z.intersect(this.current.clipBox, this.current.minMax);
@@ -7364,7 +7364,7 @@ var vl = [
7364
7364
  }
7365
7365
  this.rescaleAndStroke(t, !1), a.restore();
7366
7366
  } else this.rescaleAndStroke(t, !0);
7367
- (r = this.dependencyTracker) == null || r.recordDependencies(e, Ho.stroke), n && this.consumePath(e, t, this.current.getClippedPathBoundingBox(qc.STROKE, B(this.ctx))), a.globalAlpha = this.current.fillAlpha, m(q, this, zl).call(this, i);
7367
+ (r = this.dependencyTracker) == null || r.recordDependencies(e, Ho.stroke), n && this.consumePath(e, t, this.current.getClippedPathBoundingBox(qc.STROKE, Nt(this.ctx))), a.globalAlpha = this.current.fillAlpha, m(q, this, zl).call(this, i);
7368
7368
  }
7369
7369
  closeStroke(e, t) {
7370
7370
  this.stroke(e, t);
@@ -7465,7 +7465,7 @@ var vl = [
7465
7465
  if (o.fontMatrix = a.fontMatrix || xe, (o.fontMatrix[0] === 0 || o.fontMatrix[3] === 0) && F("Invalid font matrix for font " + t), n < 0 ? (n = -n, o.fontDirection = -1) : o.fontDirection = 1, this.current.font = a, this.current.fontSize = n, a.isType3Font) return;
7466
7466
  let s = a.loadedName || "sans-serif", c = ((i = a.systemFontInfo) == null ? void 0 : i.css) || `"${s}", ${a.fallbackName}`, l = "normal";
7467
7467
  a.black ? l = "900" : a.bold && (l = "bold");
7468
- let u = a.italic ? "italic" : "normal", d = ft(n, rl, il);
7468
+ let u = a.italic ? "italic" : "normal", d = B(n, rl, il);
7469
7469
  this.current.fontSizeScale = n / d, this.ctx.font = `${u} ${l} ${d}px ${c}`;
7470
7470
  }
7471
7471
  setTextRenderingMode(e, t) {
@@ -7533,7 +7533,7 @@ var vl = [
7533
7533
  if (f) {
7534
7534
  var b;
7535
7535
  (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
7536
- transform: B(o),
7536
+ transform: Nt(o),
7537
7537
  x: n,
7538
7538
  y: r,
7539
7539
  fontSize: u,
@@ -7575,12 +7575,12 @@ var vl = [
7575
7575
  if (ee === 0 || D === 0 ? E && (D = this.getSinglePixelWidth()) : D /= ee, u !== 1 && (l.scale(u, u), D /= u), l.lineWidth = D, T && r.patternFill) {
7576
7576
  l.save();
7577
7577
  let t = r.fillColor.getPattern(l, this, Pt(l), qc.FILL, e);
7578
- S = B(l), l.restore(), l.fillStyle = t;
7578
+ S = Nt(l), l.restore(), l.fillStyle = t;
7579
7579
  }
7580
7580
  if (E && r.patternStroke) {
7581
7581
  l.save();
7582
7582
  let t = r.strokeColor.getPattern(l, this, Pt(l), qc.STROKE, e);
7583
- C = B(l), l.restore(), l.strokeStyle = t;
7583
+ C = Nt(l), l.restore(), l.strokeStyle = t;
7584
7584
  }
7585
7585
  if (i.isInvalidPDFjsFont) {
7586
7586
  let n = [], i = 0;
@@ -7657,7 +7657,7 @@ var vl = [
7657
7657
  getColorN_Pattern(t, n) {
7658
7658
  let r;
7659
7659
  if (n[0] === "TilingPattern") {
7660
- let t = this.baseTransform || B(this.ctx);
7660
+ let t = this.baseTransform || Nt(this.ctx);
7661
7661
  r = new nl(n, this.ctx, { createCanvasGraphics: (t, n) => new e(t, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
7662
7662
  optionalContentConfig: this.optionalContentConfig,
7663
7663
  markedContentStack: this.markedContentStack
@@ -7726,7 +7726,7 @@ var vl = [
7726
7726
  I("Should not call beginImageData");
7727
7727
  }
7728
7728
  paintFormXObjectBegin(e, t, n) {
7729
- if (this.contentVisible && (this.save(e), this.baseTransformStack.push(this.baseTransform), t && this.transform(e, ...t), this.baseTransform = B(this.ctx), n)) {
7729
+ if (this.contentVisible && (this.save(e), this.baseTransformStack.push(this.baseTransform), t && this.transform(e, ...t), this.baseTransform = Nt(this.ctx), n)) {
7730
7730
  var r;
7731
7731
  z.axialAlignedBoundingBox(n, this.baseTransform, this.current.minMax);
7732
7732
  let [t, i, a, o] = n, s = new Path2D();
@@ -7756,7 +7756,7 @@ var vl = [
7756
7756
  return;
7757
7757
  }
7758
7758
  !t.isolated && !t.knockout && C(Sl, this) === 0 && Be("TODO: Fully support non-isolated non-knockout groups.");
7759
- let a = B(i);
7759
+ let a = Nt(i);
7760
7760
  t.matrix && i.transform(...t.matrix);
7761
7761
  let o = [
7762
7762
  0,
@@ -7764,7 +7764,7 @@ var vl = [
7764
7764
  i.canvas.width,
7765
7765
  i.canvas.height
7766
7766
  ], s;
7767
- t.bbox ? (s = be.slice(), z.axialAlignedBoundingBox(t.bbox, B(i), s), s = z.intersect(s, o) || [
7767
+ t.bbox ? (s = be.slice(), z.axialAlignedBoundingBox(t.bbox, Nt(i), s), s = z.intersect(s, o) || [
7768
7768
  0,
7769
7769
  0,
7770
7770
  0,
@@ -7832,7 +7832,7 @@ var vl = [
7832
7832
  if (t.isGray && m(q, this, Vl).call(this, r), this.ctx = i, this.ctx.imageSmoothingEnabled = !1, (n = this.dependencyTracker) == null || n.popBaseTransform(), t.smask) this.tempSMask = this.smaskStack.pop(), this.restore(e), this.dependencyTracker && (this.ctx.restore(), this.inSMaskMode && this.ctx.setTransform(this.suspendedCtx.getTransform())), m(q, this, Hl).call(this, a);
7833
7833
  else {
7834
7834
  this.ctx.restore();
7835
- let t = B(this.ctx);
7835
+ let t = Nt(this.ctx);
7836
7836
  this.restore(e), this.ctx.save(), this.ctx.setTransform(...t);
7837
7837
  let n = be.slice();
7838
7838
  z.axialAlignedBoundingBox([
@@ -7871,7 +7871,7 @@ var vl = [
7871
7871
  if (m(q, this, Nl).call(this), gl(this.ctx), this.ctx.save(), this.save(e), this.baseTransform && this.ctx.setTransform(...this.baseTransform), n) {
7872
7872
  let i = n[2] - n[0], s = n[3] - n[1];
7873
7873
  if (a && this.annotationCanvasMap) {
7874
- r = r.slice(), r[4] -= n[0], r[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = i, n[3] = s, z.singularValueDecompose2dScale(B(this.ctx), ll);
7874
+ r = r.slice(), r[4] -= n[0], r[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = i, n[3] = s, z.singularValueDecompose2dScale(Nt(this.ctx), ll);
7875
7875
  let { viewportScale: e } = this, a = Math.ceil(i * this.outputScaleX * e), c = Math.ceil(s * this.outputScaleY * e);
7876
7876
  this.annotationCanvas = this.canvasFactory.create(a, c);
7877
7877
  let { canvas: l, context: u } = this.annotationCanvas;
@@ -7888,7 +7888,7 @@ var vl = [
7888
7888
  t.rect(n[0], n[1], i, s), this.ctx.clip(t);
7889
7889
  }
7890
7890
  }
7891
- this.current = new fl(this.ctx.canvas.width, this.ctx.canvas.height), this.baseTransformStack.push(this.baseTransform), this.transform(e, ...r), this.transform(e, ...i), this.baseTransform = B(this.ctx);
7891
+ this.current = new fl(this.ctx.canvas.width, this.ctx.canvas.height), this.baseTransformStack.push(this.baseTransform), this.transform(e, ...r), this.transform(e, ...i), this.baseTransform = Nt(this.ctx);
7892
7892
  }
7893
7893
  endAnnotation(e) {
7894
7894
  this.annotationCanvas && (this.ctx.restore(), m(q, this, Pl).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas), this.baseTransform = this.baseTransformStack.pop();
@@ -7907,7 +7907,7 @@ var vl = [
7907
7907
  t = this.getObject(e, t.data, t);
7908
7908
  let l = m(q, this, Rl).call(this, this.current.fillAlpha), u = this.ctx;
7909
7909
  u.save();
7910
- let d = B(u);
7910
+ let d = Nt(u);
7911
7911
  u.transform(n, r, i, a, 0, 0);
7912
7912
  let f = this._createMaskCanvas(e, t);
7913
7913
  u.setTransform(1, 0, 0, 1, f.offsetX - d[4], f.offsetY - d[5]), (s = this.dependencyTracker) == null || s.resetBBox(e);
@@ -7999,7 +7999,7 @@ var vl = [
7999
7999
  pl(e.context, t), s = this.applyTransferMapsToCanvas(e.context), c = e;
8000
8000
  }
8001
8001
  let l = this._scaleImage(s, Pt(a));
8002
- if (a.imageSmoothingEnabled = _l(B(a), t.interpolate), this.dependencyTracker) {
8002
+ if (a.imageSmoothingEnabled = _l(Nt(a), t.interpolate), this.dependencyTracker) {
8003
8003
  var u;
8004
8004
  this.dependencyTracker.resetBBox(e).recordBBox(e, a, 0, n, -r, 0).recordDependencies(e, Ho.imageXObject).recordOperation(e), (u = this.imagesTracker) == null || u.record(a, n, r, this.dependencyTracker.clipBox);
8005
8005
  }
@@ -8058,7 +8058,7 @@ var vl = [
8058
8058
  }
8059
8059
  getSinglePixelWidth() {
8060
8060
  if (!this._cachedGetSinglePixelWidth) {
8061
- let e = B(this.ctx);
8061
+ let e = Nt(this.ctx);
8062
8062
  if (e[1] === 0 && e[2] === 0) this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(e[0]), Math.abs(e[3]));
8063
8063
  else {
8064
8064
  let t = Math.abs(e[0] * e[3] - e[2] * e[1]), n = Math.hypot(e[0], e[2]), r = Math.hypot(e[1], e[3]);
@@ -8381,7 +8381,7 @@ function Ql(e) {
8381
8381
  if (e.includes("%")) try {
8382
8382
  e = decodeURIComponent(e);
8383
8383
  } catch (e) {}
8384
- if (xt(e)) return e;
8384
+ if (bt(e)) return e;
8385
8385
  }
8386
8386
  return null;
8387
8387
  }
@@ -8532,7 +8532,7 @@ var fu = /* @__PURE__ */ new WeakMap(), pu = class extends Kl {
8532
8532
  let { pdfDataRangeTransport: t, disableRange: n, disableStream: r } = e._source, { length: i, contentDispositionFilename: a } = t;
8533
8533
  this._queuedChunks = e._queuedChunks || [];
8534
8534
  for (let e of this._queuedChunks) this._loaded += e.byteLength;
8535
- this._done = e._progressiveDone, this._contentLength = i, this._isStreamingSupported = !r, this._isRangeSupported = !n, xt(a) && (this._filename = a), this._headersCapability.resolve();
8535
+ this._done = e._progressiveDone, this._contentLength = i, this._isStreamingSupported = !r, this._isRangeSupported = !n, bt(a) && (this._filename = a), this._headersCapability.resolve();
8536
8536
  let o = this._loaded;
8537
8537
  Promise.resolve().then(() => {
8538
8538
  o > 0 && this._loaded === o && this._callOnProgress();
@@ -8843,7 +8843,7 @@ var Ru = class extends Gl {
8843
8843
  }
8844
8844
  };
8845
8845
  function Vu(e) {
8846
- return Et(e) ? iu : ve ? Ru : xu;
8846
+ return Tt(e) ? iu : ve ? Ru : xu;
8847
8847
  }
8848
8848
  var Hu = class e {
8849
8849
  static get workerPort() {
@@ -8861,7 +8861,7 @@ var Hu = class e {
8861
8861
  Wu._ = m(e, this, t);
8862
8862
  }
8863
8863
  }, Uu = { _: null }, Wu = { _: "" }, Gu = /* @__PURE__ */ new WeakMap(), Ku = /* @__PURE__ */ new WeakMap();
8864
- he = Symbol.iterator;
8864
+ M = Symbol.iterator;
8865
8865
  var qu = class {
8866
8866
  constructor({ parsedData: e, rawData: t }) {
8867
8867
  S(this, Gu, void 0), S(this, Ku, void 0), T(Gu, this, e), T(Ku, this, t);
@@ -8873,7 +8873,7 @@ var qu = class {
8873
8873
  var t;
8874
8874
  return (t = C(Gu, this).get(e)) == null ? null : t;
8875
8875
  }
8876
- [he]() {
8876
+ [M]() {
8877
8877
  return C(Gu, this).entries();
8878
8878
  }
8879
8879
  }, Ju = Symbol("INTERNAL"), Yu = /* @__PURE__ */ new WeakMap(), Xu = /* @__PURE__ */ new WeakMap(), Zu = /* @__PURE__ */ new WeakMap(), Qu = /* @__PURE__ */ new WeakMap(), $u = class {
@@ -9057,7 +9057,7 @@ var sd = /* @__PURE__ */ new WeakMap(), cd = /* @__PURE__ */ new WeakMap(), ld =
9057
9057
  let i = t[e] - 1;
9058
9058
  o[e] = r[i], i < n && s++;
9059
9059
  }
9060
- let c = C(ld, this), l = c - a, u = ft(n - s, 0, l);
9060
+ let c = C(ld, this), l = c - a, u = B(n - s, 0, l);
9061
9061
  for (let t = 0, n = 0; t < c; t++) e.has(t + 1) || (r[n++] = r[t]);
9062
9062
  r.copyWithin(u + a, u, l), r.set(o, u), m(fd, this, gd).call(this, i), r.every((e, t) => e === t + 1) && T(sd, this, null);
9063
9063
  }
@@ -9383,7 +9383,7 @@ function Xd(e, t, n) {
9383
9383
  var Zd = { _: /* @__PURE__ */ new Map() }, Qd = { _: /* @__PURE__ */ new Map() }, $d = { _: /* @__PURE__ */ new WeakMap() }, ef = { _: null }, tf = { _: /* @__PURE__ */ new Set() }, nf = 100;
9384
9384
  function rf(e = {}) {
9385
9385
  var t;
9386
- let n = new af(), { docId: r } = n, i = e.url ? Ms(e.url) : null, a = e.data ? Ns(e.data) : null, o = e.httpHeaders || null, s = e.withCredentials === !0, c = (t = e.password) == null ? null : t, l = e.range instanceof lf ? e.range : null, u = Number.isInteger(e.rangeChunkSize) && e.rangeChunkSize > 0 ? e.rangeChunkSize : Math.pow(2, 16), d = e.worker instanceof xf ? e.worker : null, f = e.verbosity, p = typeof e.docBaseUrl == "string" && !bt(e.docBaseUrl) ? e.docBaseUrl : null, m = Ps(e.cMapUrl), h = e.cMapPacked !== !1, g = Ps(e.iccUrl), _ = Ps(e.standardFontDataUrl), v = Ps(e.wasmUrl), y = e.stopAtErrors !== !0, b = Number.isInteger(e.maxImageSize) && e.maxImageSize > -1 ? e.maxImageSize : -1, x = typeof e.isOffscreenCanvasSupported == "boolean" ? e.isOffscreenCanvasSupported : !ve, S = typeof e.isImageDecoderSupported == "boolean" ? e.isImageDecoderSupported : !ve, C = Number.isInteger(e.canvasMaxAreaInBytes) ? e.canvasMaxAreaInBytes : -1, w = typeof e.disableFontFace == "boolean" ? e.disableFontFace : ve, T = e.fontExtraProperties === !0, E = e.enableXfa === !0, D = e.ownerDocument || globalThis.document, ee = e.disableRange === !0, O = e.disableStream === !0, k = e.disableAutoFetch === !0, te = e.pdfBug === !0, A = e.CanvasFactory || (ve ? Ac : nc), ne = e.FilterFactory || (ve ? kc : dc), re = e.BinaryDataFactory || (ve ? jc : $s), ie = e.enableHWA === !0, ae = e.enableWebGPU === !0 ? Uc() : Promise.resolve(!1), j = e.useWasm !== !1, oe = e.pagesMapper || new pd(), se = typeof e.useSystemFonts == "boolean" ? e.useSystemFonts : !ve && !w, ce = typeof e.useWorkerFetch == "boolean" ? e.useWorkerFetch : !!(re === $s && m && h && _ && v && Et(m, document.baseURI) && Et(_, document.baseURI) && Et(v, document.baseURI));
9386
+ let n = new af(), { docId: r } = n, i = e.url ? Ms(e.url) : null, a = e.data ? Ns(e.data) : null, o = e.httpHeaders || null, s = e.withCredentials === !0, c = (t = e.password) == null ? null : t, l = e.range instanceof lf ? e.range : null, u = Number.isInteger(e.rangeChunkSize) && e.rangeChunkSize > 0 ? e.rangeChunkSize : Math.pow(2, 16), d = e.worker instanceof xf ? e.worker : null, f = e.verbosity, p = typeof e.docBaseUrl == "string" && !yt(e.docBaseUrl) ? e.docBaseUrl : null, m = Ps(e.cMapUrl), h = e.cMapPacked !== !1, g = Ps(e.iccUrl), _ = Ps(e.standardFontDataUrl), v = Ps(e.wasmUrl), y = e.stopAtErrors !== !0, b = Number.isInteger(e.maxImageSize) && e.maxImageSize > -1 ? e.maxImageSize : -1, x = typeof e.isOffscreenCanvasSupported == "boolean" ? e.isOffscreenCanvasSupported : !ve, S = typeof e.isImageDecoderSupported == "boolean" ? e.isImageDecoderSupported : !ve, C = Number.isInteger(e.canvasMaxAreaInBytes) ? e.canvasMaxAreaInBytes : -1, w = typeof e.disableFontFace == "boolean" ? e.disableFontFace : ve, T = e.fontExtraProperties === !0, E = e.enableXfa === !0, D = e.ownerDocument || globalThis.document, ee = e.disableRange === !0, O = e.disableStream === !0, k = e.disableAutoFetch === !0, te = e.pdfBug === !0, A = e.CanvasFactory || (ve ? Ac : nc), ne = e.FilterFactory || (ve ? kc : dc), re = e.BinaryDataFactory || (ve ? jc : $s), ie = e.enableHWA === !0, ae = e.enableWebGPU === !0 ? Uc() : Promise.resolve(!1), j = e.useWasm !== !1, oe = e.pagesMapper || new pd(), se = typeof e.useSystemFonts == "boolean" ? e.useSystemFonts : !ve && !w, ce = typeof e.useWorkerFetch == "boolean" ? e.useWorkerFetch : !!(re === $s && m && h && _ && v && Tt(m, document.baseURI) && Tt(_, document.baseURI) && Tt(v, document.baseURI));
9387
9387
  Re(f);
9388
9388
  let le = {
9389
9389
  canvasFactory: new A({
@@ -9648,7 +9648,7 @@ var af = class {
9648
9648
  }
9649
9649
  }, df = /* @__PURE__ */ new WeakMap(), ff = /* @__PURE__ */ new WeakMap(), pf = /* @__PURE__ */ new WeakSet(), mf = class e {
9650
9650
  constructor(e, t, n, r, i = !1) {
9651
- w(this, pf), S(this, df, !1), S(this, ff, null), this._pageIndex = e, this._pageInfo = t, this._transport = n, this._stats = i ? new Tt() : null, this._pdfBug = i, this.commonObjs = n.commonObjs, this.objs = new bd(), this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1, this.recordedBBoxes = null, T(ff, this, r), this.imageCoordinates = null;
9651
+ w(this, pf), S(this, df, !1), S(this, ff, null), this._pageIndex = e, this._pageInfo = t, this._transport = n, this._stats = i ? new wt() : null, this._pdfBug = i, this.commonObjs = n.commonObjs, this.objs = new bd(), this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1, this.recordedBBoxes = null, T(ff, this, r), this.imageCoordinates = null;
9652
9652
  }
9653
9653
  clone(t) {
9654
9654
  var n;
@@ -9674,7 +9674,7 @@ var af = class {
9674
9674
  return this._pageInfo.view;
9675
9675
  }
9676
9676
  getViewport({ scale: e, rotation: t = this.rotate, offsetX: n = 0, offsetY: r = 0, dontFlip: i = !1 } = {}) {
9677
- return new pt({
9677
+ return new ft({
9678
9678
  viewBox: this.view,
9679
9679
  userUnit: this.userUnit,
9680
9680
  scale: e,
@@ -9814,7 +9814,7 @@ var af = class {
9814
9814
  getTextContent() {
9815
9815
  var e = this;
9816
9816
  return b(function* (t = {}) {
9817
- if (e._transport._htmlForXfa) return e.getXfa().then((e) => mt.textContent(e));
9817
+ if (e._transport._htmlForXfa) return e.getXfa().then((e) => pt.textContent(e));
9818
9818
  let n = e.streamTextContent(t), r = {
9819
9819
  items: [],
9820
9820
  styles: Object.create(null),
@@ -9854,7 +9854,7 @@ var af = class {
9854
9854
  cleanup(e = !1) {
9855
9855
  T(df, this, !0);
9856
9856
  let t = m(pf, this, hf).call(this);
9857
- return e && t && this._stats && (this._stats = new Tt()), t;
9857
+ return e && t && this._stats && (this._stats = new wt()), t;
9858
9858
  }
9859
9859
  _startRenderPage(e, t) {
9860
9860
  var n, r;
@@ -9903,7 +9903,7 @@ var af = class {
9903
9903
  if (e.streamReader) {
9904
9904
  if (e.streamReaderCancelTimeout && (clearTimeout(e.streamReaderCancelTimeout), e.streamReaderCancelTimeout = null), !n) {
9905
9905
  if (e.renderTasks.size > 0) return;
9906
- if (t instanceof yt) {
9906
+ if (t instanceof vt) {
9907
9907
  let n = nf;
9908
9908
  t.extraDelay > 0 && t.extraDelay < 1e3 && (n += t.extraDelay), e.streamReaderCancelTimeout = setTimeout(() => {
9909
9909
  e.streamReaderCancelTimeout = null, this._abortOperatorList({
@@ -10457,7 +10457,7 @@ function Bf({ loaded: e, total: t }) {
10457
10457
  (n = (r = this.loadingTask).onProgress) == null || n.call(r, {
10458
10458
  loaded: e,
10459
10459
  total: t,
10460
- percent: t ? ft(Math.round(e / t * 100), 0, 100) : NaN
10460
+ percent: t ? B(Math.round(e / t * 100), 0, 100) : NaN
10461
10461
  });
10462
10462
  }
10463
10463
  var Vf = class {
@@ -10507,7 +10507,7 @@ var Vf = class {
10507
10507
  }
10508
10508
  cancel(e = null, t = 0) {
10509
10509
  var n, r, i;
10510
- this.running = !1, this.cancelled = !0, (n = this.gfx) == null || n.endDrawing(), C(Hf, this) && (window.cancelAnimationFrame(C(Hf, this)), T(Hf, this, null)), Wf._.delete(this._canvas), e || (e = new yt(`Rendering cancelled, page ${this._pageIndex + 1}`, t)), this.callback(e), (r = (i = this.task).onError) == null || r.call(i, e);
10510
+ this.running = !1, this.cancelled = !0, (n = this.gfx) == null || n.endDrawing(), C(Hf, this) && (window.cancelAnimationFrame(C(Hf, this)), T(Hf, this, null)), Wf._.delete(this._canvas), e || (e = new vt(`Rendering cancelled, page ${this._pageIndex + 1}`, t)), this.callback(e), (r = (i = this.task).onError) == null || r.call(i, e);
10511
10511
  }
10512
10512
  operatorListChanged() {
10513
10513
  var e, t;
@@ -10639,7 +10639,7 @@ var Vf = class {
10639
10639
  le = ip;
10640
10640
  function ap() {
10641
10641
  let e = document.createElement("div"), t = C(np, this)._signal;
10642
- e.addEventListener("contextmenu", Dt, { signal: t }), e.className = "dropdown", e.role = "listbox", e.ariaMultiSelectable = "false", e.ariaOrientation = "vertical", e.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"), C($f, this) && (e.id = `${C($f, this).id}_colorpicker_dropdown`);
10642
+ e.addEventListener("contextmenu", Et, { signal: t }), e.className = "dropdown", e.role = "listbox", e.ariaMultiSelectable = "false", e.ariaOrientation = "vertical", e.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"), C($f, this) && (e.id = `${C($f, this).id}_colorpicker_dropdown`);
10643
10643
  for (let [n, r] of C(np, this).highlightColors) {
10644
10644
  let i = document.createElement("button");
10645
10645
  i.tabIndex = "0", i.role = "option", i.setAttribute("data-color", r), i.title = n, i.setAttribute("data-l10n-id", dp._[n]);
@@ -10694,7 +10694,7 @@ var dp = { _: null }, fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ n
10694
10694
  } else s.value = i || "#000000";
10695
10695
  return s.className = "basicColorPicker", s.tabIndex = 0, s.setAttribute("data-l10n-id", _p._[e]), s.addEventListener("input", () => {
10696
10696
  if (o) {
10697
- let e = jt(s.value);
10697
+ let e = At(s.value);
10698
10698
  if (!e) return;
10699
10699
  let [i, a, o, c] = e, l = z.makeHexColor(i, a, o);
10700
10700
  n === void 0 ? (C(hp, this).updateParams(t, l), C(hp, this).updateParams(r, c)) : C(hp, this).updateParams(n, {
@@ -10722,10 +10722,10 @@ var dp = { _: null }, fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ n
10722
10722
  hideDropdown() {}
10723
10723
  }, _p = { _: null };
10724
10724
  function vp(e) {
10725
- return Math.floor(ft(e, 0, 1) * 255).toString(16).padStart(2, "0");
10725
+ return Math.floor(B(e, 0, 1) * 255).toString(16).padStart(2, "0");
10726
10726
  }
10727
10727
  function yp(e) {
10728
- return ft(e, 0, 1) * 255;
10728
+ return B(e, 0, 1) * 255;
10729
10729
  }
10730
10730
  var bp = class {
10731
10731
  static CMYK_G([e, t, n, r]) {
@@ -10834,22 +10834,22 @@ var bp = class {
10834
10834
  }
10835
10835
  return new Bp(e);
10836
10836
  case je.POPUP: return new Jp(e);
10837
- case je.FREETEXT: return new Im(e);
10838
- case je.LINE: return new Rm(e);
10839
- case je.SQUARE: return new Bm(e);
10840
- case je.CIRCLE: return new Hm(e);
10841
- case je.POLYLINE: return new Wm(e);
10842
- case je.CARET: return new Km(e);
10843
- case je.INK: return new Xm(e);
10844
- case je.POLYGON: return new Gm(e);
10845
- case je.HIGHLIGHT: return new Qm(e);
10846
- case je.UNDERLINE: return new $m(e);
10847
- case je.SQUIGGLY: return new eh(e);
10848
- case je.STRIKEOUT: return new th(e);
10849
- case je.STAMP: return new nh(e);
10850
- case je.FILEATTACHMENT: return new ah(e);
10837
+ case je.FREETEXT: return new Lm(e);
10838
+ case je.LINE: return new zm(e);
10839
+ case je.SQUARE: return new Vm(e);
10840
+ case je.CIRCLE: return new Um(e);
10841
+ case je.POLYLINE: return new Gm(e);
10842
+ case je.CARET: return new qm(e);
10843
+ case je.INK: return new Zm(e);
10844
+ case je.POLYGON: return new Km(e);
10845
+ case je.HIGHLIGHT: return new $m(e);
10846
+ case je.UNDERLINE: return new eh(e);
10847
+ case je.SQUIGGLY: return new th(e);
10848
+ case je.STRIKEOUT: return new nh(e);
10849
+ case je.STAMP: return new rh(e);
10850
+ case je.FILEATTACHMENT: return new oh(e);
10851
10851
  case je.RICHMEDIA:
10852
- case je.SCREEN: return new dh(e);
10852
+ case je.SCREEN: return new fh(e);
10853
10853
  default: return new jp(e);
10854
10854
  }
10855
10855
  }
@@ -10931,7 +10931,7 @@ var bp = class {
10931
10931
  }
10932
10932
  _createContainer(e) {
10933
10933
  let { data: t, parent: { page: n, viewport: r } } = this, i = document.createElement("section");
10934
- i.setAttribute("data-annotation-id", t.id), !(this instanceof Bp) && !(this instanceof Fp) && !(this instanceof dh) && (i.tabIndex = 0);
10934
+ i.setAttribute("data-annotation-id", t.id), !(this instanceof Bp) && !(this instanceof Fp) && !(this instanceof fh) && (i.tabIndex = 0);
10935
10935
  let { style: a } = i;
10936
10936
  if (a.zIndex = this.parent.zIndex, this.parent.zIndex += 2, t.alternativeText && (i.title = t.alternativeText), t.noRotate && i.classList.add("norotate"), !t.rect || this instanceof Jp) {
10937
10937
  let { rotation: e } = t;
@@ -11867,7 +11867,7 @@ var zp = class extends jp {
11867
11867
  }
11868
11868
  };
11869
11869
  function Yp() {
11870
- return new Sm({
11870
+ return new Cm({
11871
11871
  container: this.container,
11872
11872
  color: this.data.color,
11873
11873
  titleObj: this.data.titleObj,
@@ -11882,16 +11882,16 @@ function Yp() {
11882
11882
  commentManager: this.parent._commentManager
11883
11883
  });
11884
11884
  }
11885
- var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakMap(), rm = /* @__PURE__ */ new WeakMap(), im = /* @__PURE__ */ new WeakMap(), am = /* @__PURE__ */ new WeakMap(), om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakMap(), um = /* @__PURE__ */ new WeakMap(), dm = /* @__PURE__ */ new WeakMap(), fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap(), gm = /* @__PURE__ */ new WeakMap(), _m = /* @__PURE__ */ new WeakMap(), vm = /* @__PURE__ */ new WeakMap(), ym = /* @__PURE__ */ new WeakMap(), bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), Sm = class {
11885
+ var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakMap(), rm = /* @__PURE__ */ new WeakMap(), im = /* @__PURE__ */ new WeakMap(), am = /* @__PURE__ */ new WeakMap(), om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakMap(), um = /* @__PURE__ */ new WeakMap(), dm = /* @__PURE__ */ new WeakMap(), fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap(), gm = /* @__PURE__ */ new WeakMap(), _m = /* @__PURE__ */ new WeakMap(), vm = /* @__PURE__ */ new WeakMap(), ym = /* @__PURE__ */ new WeakMap(), bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = /* @__PURE__ */ new WeakSet(), Cm = class {
11886
11886
  constructor({ container: e, color: t, elements: n, titleObj: r, modificationDate: i, contentsObj: a, richText: o, parent: s, rect: c, parentRect: l, open: u, commentManager: d = null }) {
11887
- w(this, Y), S(this, Xp, null), S(this, Zp, m(Y, this, jm).bind(this)), S(this, Qp, m(Y, this, Fm).bind(this)), S(this, $p, m(Y, this, Pm).bind(this)), S(this, em, m(Y, this, Nm).bind(this)), S(this, tm, null), S(this, nm, null), S(this, rm, null), S(this, im, null), S(this, am, null), S(this, om, null), S(this, sm, null), S(this, cm, !1), S(this, lm, null), S(this, um, null), S(this, dm, null), S(this, fm, null), S(this, pm, null), S(this, mm, null), S(this, hm, null), S(this, gm, null), S(this, _m, null), S(this, vm, null), S(this, ym, !1), S(this, bm, null), S(this, xm, null), T(nm, this, e), T(_m, this, r), T(rm, this, a), T(gm, this, o), T(om, this, s), T(tm, this, t), T(hm, this, c), T(sm, this, l), T(am, this, n), T(Xp, this, d), T(bm, this, n[0]), T(im, this, kt.toDateObject(i)), this.trigger = n.flatMap((e) => e.getElementsToTriggerPopup()), d || (m(Y, this, Cm).call(this), C(nm, this).hidden = !0, u && m(Y, this, Nm).call(this));
11887
+ w(this, Sm), S(this, Xp, null), S(this, Zp, m(Sm, this, Mm).bind(this)), S(this, Qp, m(Sm, this, Im).bind(this)), S(this, $p, m(Sm, this, Fm).bind(this)), S(this, em, m(Sm, this, Pm).bind(this)), S(this, tm, null), S(this, nm, null), S(this, rm, null), S(this, im, null), S(this, am, null), S(this, om, null), S(this, sm, null), S(this, cm, !1), S(this, lm, null), S(this, um, null), S(this, dm, null), S(this, fm, null), S(this, pm, null), S(this, mm, null), S(this, hm, null), S(this, gm, null), S(this, _m, null), S(this, vm, null), S(this, ym, !1), S(this, bm, null), S(this, xm, null), T(nm, this, e), T(_m, this, r), T(rm, this, a), T(gm, this, o), T(om, this, s), T(tm, this, t), T(hm, this, c), T(sm, this, l), T(am, this, n), T(Xp, this, d), T(bm, this, n[0]), T(im, this, Ot.toDateObject(i)), this.trigger = n.flatMap((e) => e.getElementsToTriggerPopup()), d || (m(Sm, this, wm).call(this), C(nm, this).hidden = !0, u && m(Sm, this, Pm).call(this));
11888
11888
  }
11889
11889
  renderCommentButton() {
11890
11890
  if (C(fm, this)) {
11891
11891
  C(fm, this).parentNode || C(bm, this).container.after(C(fm, this));
11892
11892
  return;
11893
11893
  }
11894
- if (C(pm, this) || m(Y, this, wm).call(this), !C(pm, this)) return;
11894
+ if (C(pm, this) || m(Sm, this, Tm).call(this), !C(pm, this)) return;
11895
11895
  let { signal: e } = T(um, this, new AbortController()), t = C(bm, this).hasOwnCommentButton, n = () => {
11896
11896
  C(Xp, this).toggleCommentPopup(this, !0, void 0, !t);
11897
11897
  }, r = () => {
@@ -11906,7 +11906,7 @@ var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp =
11906
11906
  let t = T(fm, this, document.createElement("button"));
11907
11907
  t.className = "annotationCommentButton";
11908
11908
  let a = C(bm, this).container;
11909
- t.style.zIndex = parseInt(a.style.zIndex, 10) + 1, t.tabIndex = 0, t.ariaHasPopup = "dialog", t.ariaControls = "commentPopup", t.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), m(Y, this, Em).call(this), m(Y, this, Tm).call(this), t.addEventListener("keydown", C(Zp, this), { signal: e }), t.addEventListener("click", n, { signal: e }), t.addEventListener("pointerenter", r, { signal: e }), t.addEventListener("pointerleave", i, { signal: e }), a.after(t);
11909
+ t.style.zIndex = parseInt(a.style.zIndex, 10) + 1, t.tabIndex = 0, t.ariaHasPopup = "dialog", t.ariaControls = "commentPopup", t.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), m(Sm, this, Dm).call(this), m(Sm, this, Em).call(this), t.addEventListener("keydown", C(Zp, this), { signal: e }), t.addEventListener("click", n, { signal: e }), t.addEventListener("pointerenter", r, { signal: e }), t.addEventListener("pointerleave", i, { signal: e }), a.after(t);
11910
11910
  }
11911
11911
  }
11912
11912
  get commentButtonColor() {
@@ -11991,7 +11991,7 @@ var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp =
11991
11991
  e.className = "popupDate", e.setAttribute("data-l10n-id", "pdfjs-annotation-date-time-string"), e.setAttribute("data-l10n-args", JSON.stringify({ dateObj: C(im, this).valueOf() })), e.dateTime = C(im, this).toISOString(), r.append(e);
11992
11992
  }
11993
11993
  qt({
11994
- html: Dm.call(m(Y, this)) || C(rm, this).str,
11994
+ html: Om.call(m(Sm, this)) || C(rm, this).str,
11995
11995
  dir: (t = C(rm, this)) == null ? void 0 : t.dir,
11996
11996
  className: "popupContent"
11997
11997
  }, n), C(nm, this).append(n);
@@ -11999,17 +11999,17 @@ var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp =
11999
11999
  updateEdited({ rect: e, popup: t, deleted: n }) {
12000
12000
  var r;
12001
12001
  if (C(Xp, this)) {
12002
- n ? (this.remove(), T(xm, this, null)) : t && (t.deleted ? this.remove() : (m(Y, this, Em).call(this), T(xm, this, t.text))), e && (T(pm, this, null), m(Y, this, wm).call(this), m(Y, this, Tm).call(this));
12002
+ n ? (this.remove(), T(xm, this, null)) : t && (t.deleted ? this.remove() : (m(Sm, this, Dm).call(this), T(xm, this, t.text))), e && (T(pm, this, null), m(Sm, this, Tm).call(this), m(Sm, this, Em).call(this));
12003
12003
  return;
12004
12004
  }
12005
12005
  if (n || t != null && t.deleted) {
12006
12006
  this.remove();
12007
12007
  return;
12008
12008
  }
12009
- m(Y, this, Cm).call(this), C(vm, this) || T(vm, this, {
12009
+ m(Sm, this, wm).call(this), C(vm, this) || T(vm, this, {
12010
12010
  contentsObj: C(rm, this),
12011
12011
  richText: C(gm, this)
12012
- }), e && T(dm, this, null), t && t.text && (T(gm, this, m(Y, this, Am).call(this, t.text)), T(im, this, kt.toDateObject(t.date)), T(rm, this, null)), (r = C(lm, this)) == null || r.remove(), T(lm, this, null);
12012
+ }), e && T(dm, this, null), t && t.text && (T(gm, this, m(Sm, this, jm).call(this, t.text)), T(im, this, Ot.toDateObject(t.date)), T(rm, this, null)), (r = C(lm, this)) == null || r.remove(), T(lm, this, null);
12013
12013
  }
12014
12014
  resetEdited() {
12015
12015
  var e;
@@ -12023,13 +12023,13 @@ var Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp =
12023
12023
  T(ym, this, this.isVisible), C(ym, this) && (C(nm, this).hidden = !0);
12024
12024
  }
12025
12025
  maybeShow() {
12026
- C(Xp, this) || (m(Y, this, Cm).call(this), C(ym, this) && (C(lm, this) || m(Y, this, Pm).call(this), T(ym, this, !1), C(nm, this).hidden = !1));
12026
+ C(Xp, this) || (m(Sm, this, wm).call(this), C(ym, this) && (C(lm, this) || m(Sm, this, Fm).call(this), T(ym, this, !1), C(nm, this).hidden = !1));
12027
12027
  }
12028
12028
  get isVisible() {
12029
12029
  return !C(Xp, this) && C(nm, this).hidden === !1;
12030
12030
  }
12031
12031
  };
12032
- function Cm() {
12032
+ function wm() {
12033
12033
  if (C(um, this)) return;
12034
12034
  T(um, this, new AbortController());
12035
12035
  let { signal: e } = C(um, this);
@@ -12039,32 +12039,32 @@ function Cm() {
12039
12039
  (t = n.container) == null || t.addEventListener("keydown", C(Zp, this), { signal: e });
12040
12040
  }
12041
12041
  }
12042
- function wm() {
12042
+ function Tm() {
12043
12043
  let e = C(am, this).find((e) => e.hasCommentButton);
12044
12044
  e && T(pm, this, e._normalizePoint(e.commentButtonPosition));
12045
12045
  }
12046
- function Tm() {
12046
+ function Em() {
12047
12047
  if (C(bm, this).extraPopupElement && !C(bm, this).editor) return;
12048
12048
  C(fm, this) || this.renderCommentButton();
12049
12049
  let [e, t] = C(pm, this), { style: n } = C(fm, this);
12050
12050
  n.left = `calc(${e}%)`, n.top = `calc(${t}% - var(--comment-button-dim))`;
12051
12051
  }
12052
- function Em() {
12052
+ function Dm() {
12053
12053
  C(bm, this).extraPopupElement || (C(fm, this) || this.renderCommentButton(), C(fm, this).style.backgroundColor = this.commentButtonColor || "");
12054
12054
  }
12055
- function Dm() {
12055
+ function Om() {
12056
12056
  let e = C(gm, this), t = C(rm, this);
12057
12057
  return e != null && e.str && (!(t != null && t.str) || t.str === e.str) && C(gm, this).html || null;
12058
12058
  }
12059
- function Om() {
12059
+ function km() {
12060
12060
  var e;
12061
- return ((e = Dm.call(m(Y, this))) == null || (e = e.attributes) == null || (e = e.style) == null ? void 0 : e.fontSize) || 0;
12061
+ return ((e = Om.call(m(Sm, this))) == null || (e = e.attributes) == null || (e = e.style) == null ? void 0 : e.fontSize) || 0;
12062
12062
  }
12063
- function km() {
12063
+ function Am() {
12064
12064
  var e;
12065
- return ((e = Dm.call(m(Y, this))) == null || (e = e.attributes) == null || (e = e.style) == null ? void 0 : e.color) || null;
12065
+ return ((e = Om.call(m(Sm, this))) == null || (e = e.attributes) == null || (e = e.style) == null ? void 0 : e.color) || null;
12066
12066
  }
12067
- function Am(e) {
12067
+ function jm(e) {
12068
12068
  let t = [], n = {
12069
12069
  str: e,
12070
12070
  html: {
@@ -12076,8 +12076,8 @@ function Am(e) {
12076
12076
  }]
12077
12077
  }
12078
12078
  }, r = { style: {
12079
- color: km.call(m(Y, this)),
12080
- fontSize: Om.call(m(Y, this)) ? `calc(${Om.call(m(Y, this))}px * var(--total-scale-factor))` : ""
12079
+ color: Am.call(m(Sm, this)),
12080
+ fontSize: km.call(m(Sm, this)) ? `calc(${km.call(m(Sm, this))}px * var(--total-scale-factor))` : ""
12081
12081
  } };
12082
12082
  for (let n of e.split("\n")) t.push({
12083
12083
  name: "span",
@@ -12086,10 +12086,10 @@ function Am(e) {
12086
12086
  });
12087
12087
  return n;
12088
12088
  }
12089
- function jm(e) {
12090
- e.altKey || e.shiftKey || e.ctrlKey || e.metaKey || (e.key === "Enter" || e.key === "Escape" && C(cm, this)) && m(Y, this, Nm).call(this);
12089
+ function Mm(e) {
12090
+ e.altKey || e.shiftKey || e.ctrlKey || e.metaKey || (e.key === "Enter" || e.key === "Escape" && C(cm, this)) && m(Sm, this, Pm).call(this);
12091
12091
  }
12092
- function Mm() {
12092
+ function Nm() {
12093
12093
  if (C(dm, this) !== null) return;
12094
12094
  let { page: { view: e }, viewport: { rawDims: { pageWidth: t, pageHeight: n, pageX: r, pageY: i } } } = C(om, this), a = !!C(sm, this), o = C(a ? sm : hm, this);
12095
12095
  for (let e of C(am, this)) if (!o || z.intersect(e.data.rect, o) !== null) {
@@ -12106,20 +12106,20 @@ function Mm() {
12106
12106
  let { style: d } = C(nm, this);
12107
12107
  d.left = `${C(dm, this)[0]}%`, d.top = `${C(dm, this)[1]}%`;
12108
12108
  }
12109
- function Nm() {
12109
+ function Pm() {
12110
12110
  if (C(Xp, this)) {
12111
12111
  C(Xp, this).toggleCommentPopup(this, !1);
12112
12112
  return;
12113
12113
  }
12114
- T(cm, this, !C(cm, this)), C(cm, this) ? (m(Y, this, Pm).call(this), C(nm, this).addEventListener("click", C(em, this)), C(nm, this).addEventListener("keydown", C(Zp, this))) : (m(Y, this, Fm).call(this), C(nm, this).removeEventListener("click", C(em, this)), C(nm, this).removeEventListener("keydown", C(Zp, this)));
12115
- }
12116
- function Pm() {
12117
- C(lm, this) || this.render(), this.isVisible ? C(cm, this) && C(nm, this).classList.add("focused") : (m(Y, this, Mm).call(this), C(nm, this).hidden = !1, C(nm, this).style.zIndex = parseInt(C(nm, this).style.zIndex, 10) + 1e3);
12114
+ T(cm, this, !C(cm, this)), C(cm, this) ? (m(Sm, this, Fm).call(this), C(nm, this).addEventListener("click", C(em, this)), C(nm, this).addEventListener("keydown", C(Zp, this))) : (m(Sm, this, Im).call(this), C(nm, this).removeEventListener("click", C(em, this)), C(nm, this).removeEventListener("keydown", C(Zp, this)));
12118
12115
  }
12119
12116
  function Fm() {
12117
+ C(lm, this) || this.render(), this.isVisible ? C(cm, this) && C(nm, this).classList.add("focused") : (m(Sm, this, Nm).call(this), C(nm, this).hidden = !1, C(nm, this).style.zIndex = parseInt(C(nm, this).style.zIndex, 10) + 1e3);
12118
+ }
12119
+ function Im() {
12120
12120
  C(nm, this).classList.remove("focused"), !(C(cm, this) || !this.isVisible) && (C(nm, this).hidden = !0, C(nm, this).style.zIndex = parseInt(C(nm, this).style.zIndex, 10) - 1e3);
12121
12121
  }
12122
- var Im = class extends jp {
12122
+ var Lm = class extends jp {
12123
12123
  constructor(e) {
12124
12124
  super(e, {
12125
12125
  isRenderable: !0,
@@ -12138,66 +12138,66 @@ var Im = class extends jp {
12138
12138
  }
12139
12139
  return !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
12140
12140
  }
12141
- }, Lm = /* @__PURE__ */ new WeakMap(), Rm = class extends jp {
12141
+ }, Rm = /* @__PURE__ */ new WeakMap(), zm = class extends jp {
12142
12142
  constructor(e) {
12143
12143
  super(e, {
12144
12144
  isRenderable: !0,
12145
12145
  ignoreBorder: !0
12146
- }), S(this, Lm, null);
12146
+ }), S(this, Rm, null);
12147
12147
  }
12148
12148
  render() {
12149
12149
  this.container.classList.add("lineAnnotation");
12150
- let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = T(Lm, this, this.svgFactory.createElement("svg:line"));
12150
+ let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = T(Rm, this, this.svgFactory.createElement("svg:line"));
12151
12151
  return i.setAttribute("x1", e.rect[2] - e.lineCoordinates[0]), i.setAttribute("y1", e.rect[3] - e.lineCoordinates[1]), i.setAttribute("x2", e.rect[2] - e.lineCoordinates[2]), i.setAttribute("y2", e.rect[3] - e.lineCoordinates[3]), i.setAttribute("stroke-width", e.borderStyle.width || 1), i.setAttribute("stroke", "transparent"), i.setAttribute("fill", "transparent"), r.append(i), this.container.append(r), !e.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12152
12152
  }
12153
12153
  getElementsToTriggerPopup() {
12154
- return C(Lm, this);
12154
+ return C(Rm, this);
12155
12155
  }
12156
12156
  addHighlightArea() {
12157
12157
  this.container.classList.add("highlightArea");
12158
12158
  }
12159
- }, zm = /* @__PURE__ */ new WeakMap(), Bm = class extends jp {
12159
+ }, Bm = /* @__PURE__ */ new WeakMap(), Vm = class extends jp {
12160
12160
  constructor(e) {
12161
12161
  super(e, {
12162
12162
  isRenderable: !0,
12163
12163
  ignoreBorder: !0
12164
- }), S(this, zm, null);
12164
+ }), S(this, Bm, null);
12165
12165
  }
12166
12166
  render() {
12167
12167
  this.container.classList.add("squareAnnotation");
12168
- let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = e.borderStyle.width, a = T(zm, this, this.svgFactory.createElement("svg:rect"));
12168
+ let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = e.borderStyle.width, a = T(Bm, this, this.svgFactory.createElement("svg:rect"));
12169
12169
  return a.setAttribute("x", i / 2), a.setAttribute("y", i / 2), a.setAttribute("width", t - i), a.setAttribute("height", n - i), a.setAttribute("stroke-width", i || 1), a.setAttribute("stroke", "transparent"), a.setAttribute("fill", "transparent"), r.append(a), this.container.append(r), !e.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12170
12170
  }
12171
12171
  getElementsToTriggerPopup() {
12172
- return C(zm, this);
12172
+ return C(Bm, this);
12173
12173
  }
12174
12174
  addHighlightArea() {
12175
12175
  this.container.classList.add("highlightArea");
12176
12176
  }
12177
- }, Vm = /* @__PURE__ */ new WeakMap(), Hm = class extends jp {
12177
+ }, Hm = /* @__PURE__ */ new WeakMap(), Um = class extends jp {
12178
12178
  constructor(e) {
12179
12179
  super(e, {
12180
12180
  isRenderable: !0,
12181
12181
  ignoreBorder: !0
12182
- }), S(this, Vm, null);
12182
+ }), S(this, Hm, null);
12183
12183
  }
12184
12184
  render() {
12185
12185
  this.container.classList.add("circleAnnotation");
12186
- let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = e.borderStyle.width, a = T(Vm, this, this.svgFactory.createElement("svg:ellipse"));
12186
+ let { data: e, width: t, height: n } = this, r = this.svgFactory.create(t, n, !0), i = e.borderStyle.width, a = T(Hm, this, this.svgFactory.createElement("svg:ellipse"));
12187
12187
  return a.setAttribute("cx", t / 2), a.setAttribute("cy", n / 2), a.setAttribute("rx", t / 2 - i / 2), a.setAttribute("ry", n / 2 - i / 2), a.setAttribute("stroke-width", i || 1), a.setAttribute("stroke", "transparent"), a.setAttribute("fill", "transparent"), r.append(a), this.container.append(r), !e.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12188
12188
  }
12189
12189
  getElementsToTriggerPopup() {
12190
- return C(Vm, this);
12190
+ return C(Hm, this);
12191
12191
  }
12192
12192
  addHighlightArea() {
12193
12193
  this.container.classList.add("highlightArea");
12194
12194
  }
12195
- }, Um = /* @__PURE__ */ new WeakMap(), Wm = class extends jp {
12195
+ }, Wm = /* @__PURE__ */ new WeakMap(), Gm = class extends jp {
12196
12196
  constructor(e) {
12197
12197
  super(e, {
12198
12198
  isRenderable: !0,
12199
12199
  ignoreBorder: !0
12200
- }), S(this, Um, null), this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
12200
+ }), S(this, Wm, null), this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
12201
12201
  }
12202
12202
  render() {
12203
12203
  this.container.classList.add(this.containerClassName);
@@ -12209,20 +12209,20 @@ var Im = class extends jp {
12209
12209
  s.push(`${r},${i}`);
12210
12210
  }
12211
12211
  s = s.join(" ");
12212
- let c = T(Um, this, this.svgFactory.createElement(this.svgElementName));
12212
+ let c = T(Wm, this, this.svgFactory.createElement(this.svgElementName));
12213
12213
  return c.setAttribute("points", s), c.setAttribute("stroke-width", n.width || 1), c.setAttribute("stroke", "transparent"), c.setAttribute("fill", "transparent"), o.append(c), this.container.append(o), !r && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12214
12214
  }
12215
12215
  getElementsToTriggerPopup() {
12216
- return C(Um, this);
12216
+ return C(Wm, this);
12217
12217
  }
12218
12218
  addHighlightArea() {
12219
12219
  this.container.classList.add("highlightArea");
12220
12220
  }
12221
- }, Gm = class extends Wm {
12221
+ }, Km = class extends Gm {
12222
12222
  constructor(e) {
12223
12223
  super(e), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
12224
12224
  }
12225
- }, Km = class extends jp {
12225
+ }, qm = class extends jp {
12226
12226
  constructor(e) {
12227
12227
  super(e, {
12228
12228
  isRenderable: !0,
@@ -12232,40 +12232,40 @@ var Im = class extends jp {
12232
12232
  render() {
12233
12233
  return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container;
12234
12234
  }
12235
- }, qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakSet(), Xm = class extends jp {
12235
+ }, Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakMap(), Xm = /* @__PURE__ */ new WeakSet(), Zm = class extends jp {
12236
12236
  constructor(e) {
12237
12237
  super(e, {
12238
12238
  isRenderable: !0,
12239
12239
  ignoreBorder: !0
12240
- }), w(this, Ym), S(this, qm, null), S(this, Jm, []), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ? N.HIGHLIGHT : N.INK;
12240
+ }), w(this, Xm), S(this, Jm, null), S(this, Ym, []), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ? N.HIGHLIGHT : N.INK;
12241
12241
  }
12242
12242
  render() {
12243
12243
  this.container.classList.add(this.containerClassName);
12244
- let { data: { rect: e, rotation: t, inkLists: n, borderStyle: r, popupRef: i } } = this, { transform: a, width: o, height: s } = m(Ym, this, Zm).call(this, t, e), c = this.svgFactory.create(o, s, !0), l = T(qm, this, this.svgFactory.createElement("svg:g"));
12244
+ let { data: { rect: e, rotation: t, inkLists: n, borderStyle: r, popupRef: i } } = this, { transform: a, width: o, height: s } = m(Xm, this, Qm).call(this, t, e), c = this.svgFactory.create(o, s, !0), l = T(Jm, this, this.svgFactory.createElement("svg:g"));
12245
12245
  c.append(l), l.setAttribute("stroke-width", r.width || 1), l.setAttribute("stroke-linecap", "round"), l.setAttribute("stroke-linejoin", "round"), l.setAttribute("stroke-miterlimit", 10), l.setAttribute("stroke", "transparent"), l.setAttribute("fill", "transparent"), l.setAttribute("transform", a);
12246
12246
  for (let e = 0, t = n.length; e < t; e++) {
12247
12247
  let t = this.svgFactory.createElement(this.svgElementName);
12248
- C(Jm, this).push(t), t.setAttribute("points", n[e].join(",")), l.append(t);
12248
+ C(Ym, this).push(t), t.setAttribute("points", n[e].join(",")), l.append(t);
12249
12249
  }
12250
12250
  return !i && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container.append(c), this._editOnDoubleClick(), this.container;
12251
12251
  }
12252
12252
  updateEdited(e) {
12253
12253
  super.updateEdited(e);
12254
- let { thickness: t, points: n, rect: r } = e, i = C(qm, this);
12255
- if (t >= 0 && i.setAttribute("stroke-width", t || 1), n) for (let e = 0, t = C(Jm, this).length; e < t; e++) C(Jm, this)[e].setAttribute("points", n[e].join(","));
12254
+ let { thickness: t, points: n, rect: r } = e, i = C(Jm, this);
12255
+ if (t >= 0 && i.setAttribute("stroke-width", t || 1), n) for (let e = 0, t = C(Ym, this).length; e < t; e++) C(Ym, this)[e].setAttribute("points", n[e].join(","));
12256
12256
  if (r) {
12257
- let { transform: e, width: t, height: n } = m(Ym, this, Zm).call(this, this.data.rotation, r);
12257
+ let { transform: e, width: t, height: n } = m(Xm, this, Qm).call(this, this.data.rotation, r);
12258
12258
  i.parentElement.setAttribute("viewBox", `0 0 ${t} ${n}`), i.setAttribute("transform", e);
12259
12259
  }
12260
12260
  }
12261
12261
  getElementsToTriggerPopup() {
12262
- return C(Jm, this);
12262
+ return C(Ym, this);
12263
12263
  }
12264
12264
  addHighlightArea() {
12265
12265
  this.container.classList.add("highlightArea");
12266
12266
  }
12267
12267
  };
12268
- function Zm(e, t) {
12268
+ function Qm(e, t) {
12269
12269
  switch (e) {
12270
12270
  case 90: return {
12271
12271
  transform: `rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,
@@ -12289,7 +12289,7 @@ function Zm(e, t) {
12289
12289
  };
12290
12290
  }
12291
12291
  }
12292
- var Qm = class extends jp {
12292
+ var $m = class extends jp {
12293
12293
  constructor(e) {
12294
12294
  super(e, {
12295
12295
  isRenderable: !0,
@@ -12305,7 +12305,7 @@ var Qm = class extends jp {
12305
12305
  }
12306
12306
  return this.container;
12307
12307
  }
12308
- }, $m = class extends jp {
12308
+ }, eh = class extends jp {
12309
12309
  constructor(e) {
12310
12310
  super(e, {
12311
12311
  isRenderable: !0,
@@ -12321,7 +12321,7 @@ var Qm = class extends jp {
12321
12321
  }
12322
12322
  return this.container;
12323
12323
  }
12324
- }, eh = class extends jp {
12324
+ }, th = class extends jp {
12325
12325
  constructor(e) {
12326
12326
  super(e, {
12327
12327
  isRenderable: !0,
@@ -12337,7 +12337,7 @@ var Qm = class extends jp {
12337
12337
  }
12338
12338
  return this.container;
12339
12339
  }
12340
- }, th = class extends jp {
12340
+ }, nh = class extends jp {
12341
12341
  constructor(e) {
12342
12342
  super(e, {
12343
12343
  isRenderable: !0,
@@ -12353,7 +12353,7 @@ var Qm = class extends jp {
12353
12353
  }
12354
12354
  return this.container;
12355
12355
  }
12356
- }, nh = class extends jp {
12356
+ }, rh = class extends jp {
12357
12357
  constructor(e) {
12358
12358
  super(e, {
12359
12359
  isRenderable: !0,
@@ -12363,10 +12363,10 @@ var Qm = class extends jp {
12363
12363
  render() {
12364
12364
  return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
12365
12365
  }
12366
- }, rh = /* @__PURE__ */ new WeakMap(), ih = /* @__PURE__ */ new WeakSet(), ah = class extends jp {
12366
+ }, ih = /* @__PURE__ */ new WeakMap(), ah = /* @__PURE__ */ new WeakSet(), oh = class extends jp {
12367
12367
  constructor(e) {
12368
12368
  var t;
12369
- super(e, { isRenderable: !0 }), w(this, ih), S(this, rh, null);
12369
+ super(e, { isRenderable: !0 }), w(this, ah), S(this, ih, null);
12370
12370
  let { fileId: n, file: r } = this.data;
12371
12371
  this.filename = r.filename, this.content = r.content, this.fileId = n, (t = this.linkService.eventBus) == null || t.dispatch("fileattachmentannotation", D({
12372
12372
  source: this,
@@ -12376,20 +12376,20 @@ var Qm = class extends jp {
12376
12376
  render() {
12377
12377
  this.container.classList.add("fileAttachmentAnnotation");
12378
12378
  let { container: e, data: t } = this, n;
12379
- t.hasAppearance || t.fillAlpha === 0 ? n = document.createElement("div") : (n = document.createElement("img"), n.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name) ? "paperclip" : "pushpin"}.svg`, t.fillAlpha && t.fillAlpha < 1 && (n.style = `filter: opacity(${Math.round(t.fillAlpha * 100)}%);`)), n.addEventListener("dblclick", m(ih, this, oh).bind(this)), T(rh, this, n);
12379
+ t.hasAppearance || t.fillAlpha === 0 ? n = document.createElement("div") : (n = document.createElement("img"), n.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name) ? "paperclip" : "pushpin"}.svg`, t.fillAlpha && t.fillAlpha < 1 && (n.style = `filter: opacity(${Math.round(t.fillAlpha * 100)}%);`)), n.addEventListener("dblclick", m(ah, this, sh).bind(this)), T(ih, this, n);
12380
12380
  let { isMac: r } = R.platform;
12381
12381
  return e.addEventListener("keydown", (e) => {
12382
- e.key === "Enter" && (r ? e.metaKey : e.ctrlKey) && m(ih, this, oh).call(this);
12382
+ e.key === "Enter" && (r ? e.metaKey : e.ctrlKey) && m(ah, this, sh).call(this);
12383
12383
  }), !t.popupRef && this.hasPopupData ? (this.hasOwnCommentButton = !0, this._createPopup()) : n.classList.add("popupTriggerArea"), e.append(n), e;
12384
12384
  }
12385
12385
  getElementsToTriggerPopup() {
12386
- return C(rh, this);
12386
+ return C(ih, this);
12387
12387
  }
12388
12388
  addHighlightArea() {
12389
12389
  this.container.classList.add("highlightArea");
12390
12390
  }
12391
12391
  };
12392
- function oh() {
12392
+ function sh() {
12393
12393
  var e = this;
12394
12394
  return b(function* () {
12395
12395
  let { fileId: t, filename: n, content: r } = e, i = (yield e.linkService.getAttachmentContent(t)) || r;
@@ -12399,20 +12399,20 @@ function oh() {
12399
12399
  }
12400
12400
  })();
12401
12401
  }
12402
- var sh = /* @__PURE__ */ new WeakMap(), ch = /* @__PURE__ */ new WeakMap(), lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakSet(), dh = class extends jp {
12402
+ var ch = /* @__PURE__ */ new WeakMap(), lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakSet(), fh = class extends jp {
12403
12403
  constructor(e) {
12404
- super(e, { isRenderable: !!e.data.richMedia }), w(this, uh), S(this, sh, new AbortController()), S(this, ch, null), S(this, lh, null);
12404
+ super(e, { isRenderable: !!e.data.richMedia }), w(this, dh), S(this, ch, new AbortController()), S(this, lh, null), S(this, uh, null);
12405
12405
  }
12406
12406
  render() {
12407
12407
  this.container.classList.add("mediaAnnotation");
12408
12408
  let { filename: e } = this.data.richMedia, t = document.createElement("button");
12409
- return t.className = "mediaPlayButton", t.type = "button", t.title = t.ariaLabel = e, t.addEventListener("click", () => m(uh, this, fh).call(this, t), { signal: C(sh, this).signal }), this.container.append(t), this.container;
12409
+ return t.className = "mediaPlayButton", t.type = "button", t.title = t.ariaLabel = e, t.addEventListener("click", () => m(dh, this, ph).call(this, t), { signal: C(ch, this).signal }), this.container.append(t), this.container;
12410
12410
  }
12411
12411
  destroy() {
12412
- C(sh, this).abort(), C(lh, this) && (C(lh, this).pause(), C(lh, this).removeAttribute("src"), C(lh, this).load(), T(lh, this, null)), m(uh, this, ph).call(this);
12412
+ C(ch, this).abort(), C(uh, this) && (C(uh, this).pause(), C(uh, this).removeAttribute("src"), C(uh, this).load(), T(uh, this, null)), m(dh, this, mh).call(this);
12413
12413
  }
12414
12414
  };
12415
- function fh(e) {
12415
+ function ph(e) {
12416
12416
  var t = this;
12417
12417
  return b(function* () {
12418
12418
  let { fileId: n, filename: r, contentType: i } = t.data.richMedia;
@@ -12426,10 +12426,10 @@ function fh(e) {
12426
12426
  e.disabled = !1;
12427
12427
  }
12428
12428
  if (!a || !e.isConnected) return;
12429
- let { signal: o } = C(sh, t), s = URL.createObjectURL(new Blob([a], { type: i }));
12430
- T(ch, t, s);
12429
+ let { signal: o } = C(ch, t), s = URL.createObjectURL(new Blob([a], { type: i }));
12430
+ T(lh, t, s);
12431
12431
  let c = i.startsWith("audio/"), l = document.createElement(c ? "audio" : "video");
12432
- if (T(lh, t, l), l.className = "mediaContent", t._setBackgroundColor(l), l.src = s, l.title = r, l.controls = !0, l.autoplay = !0, l.tabIndex = 0, c) {
12432
+ if (T(uh, t, l), l.className = "mediaContent", t._setBackgroundColor(l), l.src = s, l.title = r, l.controls = !0, l.autoplay = !0, l.tabIndex = 0, c) {
12433
12433
  let e = !1, n = !1, r = () => {
12434
12434
  l.controls = e || n;
12435
12435
  };
@@ -12443,21 +12443,21 @@ function fh(e) {
12443
12443
  n = !1, r();
12444
12444
  }, { signal: o });
12445
12445
  }
12446
- l.addEventListener("emptied", () => m(uh, t, ph).call(t, s), {
12446
+ l.addEventListener("emptied", () => m(dh, t, mh).call(t, s), {
12447
12447
  once: !0,
12448
12448
  signal: o
12449
12449
  }), e.replaceWith(l), l.play().catch(() => {});
12450
12450
  })();
12451
12451
  }
12452
- function ph(e = C(ch, this)) {
12453
- e && e === C(ch, this) && (URL.revokeObjectURL(e), T(ch, this, null));
12452
+ function mh(e = C(lh, this)) {
12453
+ e && e === C(lh, this) && (URL.revokeObjectURL(e), T(lh, this, null));
12454
12454
  }
12455
- var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakMap(), Sh = /* @__PURE__ */ new WeakSet(), Ch = class e {
12455
+ var hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakMap(), Sh = /* @__PURE__ */ new WeakMap(), Ch = /* @__PURE__ */ new WeakSet(), wh = class e {
12456
12456
  constructor({ div: e, accessibilityManager: t, annotationCanvasMap: n, annotationEditorUIManager: r, page: i, viewport: a, structTreeLayer: o, commentManager: s, linkService: c, annotationStorage: l }) {
12457
- w(this, Sh), S(this, mh, null), S(this, hh, null), S(this, gh, null), S(this, _h, /* @__PURE__ */ new Map()), S(this, vh, null), S(this, yh, null), S(this, bh, []), S(this, xh, !1), v(this, "zIndex", 0), this.div = e, T(mh, this, t), T(hh, this, n), T(vh, this, o || null), T(yh, this, c || null), T(gh, this, l || new ro()), this.page = i, this.viewport = a, this._annotationEditorUIManager = r, this._commentManager = s || null;
12457
+ w(this, Ch), S(this, hh, null), S(this, gh, null), S(this, _h, null), S(this, vh, /* @__PURE__ */ new Map()), S(this, yh, null), S(this, bh, null), S(this, xh, []), S(this, Sh, !1), v(this, "zIndex", 0), this.div = e, T(hh, this, t), T(gh, this, n), T(yh, this, o || null), T(bh, this, c || null), T(_h, this, l || new ro()), this.page = i, this.viewport = a, this._annotationEditorUIManager = r, this._commentManager = s || null;
12458
12458
  }
12459
12459
  hasEditableAnnotations() {
12460
- return C(_h, this).size > 0;
12460
+ return C(vh, this).size > 0;
12461
12461
  }
12462
12462
  render(e) {
12463
12463
  var t = this;
@@ -12467,12 +12467,12 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12467
12467
  let a = /* @__PURE__ */ new Map(), o = [], s = {
12468
12468
  data: null,
12469
12469
  layer: i,
12470
- linkService: C(yh, t),
12470
+ linkService: C(bh, t),
12471
12471
  downloadManager: e.downloadManager,
12472
12472
  imageResourcesPath: e.imageResourcesPath || "",
12473
12473
  renderForms: e.renderForms !== !1,
12474
12474
  svgFactory: new Sp(),
12475
- annotationStorage: C(gh, t),
12475
+ annotationStorage: C(_h, t),
12476
12476
  enableComment: e.enableComment === !0,
12477
12477
  enableScripting: e.enableScripting === !0,
12478
12478
  hasJSActions: e.hasJSActions,
@@ -12495,14 +12495,14 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12495
12495
  s.data = e;
12496
12496
  let i = Ep.create(s);
12497
12497
  if (!i.isRenderable) continue;
12498
- n || (C(bh, t).push(i), e.popupRef && a.getOrInsertComputed(e.popupRef, lt).push(i));
12498
+ n || (C(xh, t).push(i), e.popupRef && a.getOrInsertComputed(e.popupRef, lt).push(i));
12499
12499
  let l = i.render();
12500
12500
  if (e.hidden && (l.style.visibility = "hidden"), i.updateOC(r), i._isEditable) {
12501
12501
  var c;
12502
- C(_h, t).set(i.data.id, i), (c = t._annotationEditorUIManager) == null || c.renderAnnotationElement(i);
12502
+ C(vh, t).set(i.data.id, i), (c = t._annotationEditorUIManager) == null || c.renderAnnotationElement(i);
12503
12503
  }
12504
12504
  }
12505
- yield m(Sh, t, wh).call(t);
12505
+ yield m(Ch, t, Th).call(t);
12506
12506
  for (let e of o) {
12507
12507
  let t = s.elements = a.get(e.id);
12508
12508
  s.data = e;
@@ -12511,7 +12511,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12511
12511
  let r = n.render();
12512
12512
  n.contentElement.id = `${Ee}${e.id}`, e.hidden && (r.style.visibility = "hidden"), t.at(-1).container.after(r);
12513
12513
  }
12514
- m(Sh, t, Th).call(t);
12514
+ m(Ch, t, Eh).call(t);
12515
12515
  })();
12516
12516
  }
12517
12517
  addLinkAnnotations(t) {
@@ -12520,39 +12520,39 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12520
12520
  let r = {
12521
12521
  data: null,
12522
12522
  layer: n.div,
12523
- linkService: C(yh, n),
12523
+ linkService: C(bh, n),
12524
12524
  svgFactory: new Sp(),
12525
12525
  parent: n
12526
12526
  };
12527
12527
  for (let i of t) {
12528
12528
  i.borderStyle || (i.borderStyle = e._defaultBorderStyle), r.data = i;
12529
12529
  let t = Ep.create(r);
12530
- t.isRenderable && (t.render(), t.contentElement.id = `${Ee}${i.id}`, C(bh, n).push(t));
12530
+ t.isRenderable && (t.render(), t.contentElement.id = `${Ee}${i.id}`, C(xh, n).push(t));
12531
12531
  }
12532
- yield m(Sh, n, wh).call(n);
12532
+ yield m(Ch, n, Th).call(n);
12533
12533
  })();
12534
12534
  }
12535
12535
  update({ viewport: e, optionalContentConfig: t }) {
12536
12536
  let n = this.div;
12537
12537
  this.viewport = e, Ft(n, { rotation: e.rotation });
12538
- for (let e of C(bh, this)) e.updateOC(t);
12539
- m(Sh, this, Th).call(this), n.hidden = !1;
12538
+ for (let e of C(xh, this)) e.updateOC(t);
12539
+ m(Ch, this, Eh).call(this), n.hidden = !1;
12540
12540
  }
12541
12541
  destroy() {
12542
- for (let n of C(bh, this)) {
12542
+ for (let n of C(xh, this)) {
12543
12543
  var e, t;
12544
- (e = n.destroy) == null || e.call(n), (t = C(mh, this)) == null || t.removePointerInTextLayer(n.contentElement);
12544
+ (e = n.destroy) == null || e.call(n), (t = C(hh, this)) == null || t.removePointerInTextLayer(n.contentElement);
12545
12545
  }
12546
- C(bh, this).length = 0, C(_h, this).clear(), this.div.replaceChildren();
12546
+ C(xh, this).length = 0, C(vh, this).clear(), this.div.replaceChildren();
12547
12547
  }
12548
12548
  refreshCanvases() {
12549
- m(Sh, this, Th).call(this);
12549
+ m(Ch, this, Eh).call(this);
12550
12550
  }
12551
12551
  getEditableAnnotations() {
12552
- return C(_h, this).values();
12552
+ return C(vh, this).values();
12553
12553
  }
12554
12554
  getEditableAnnotation(e) {
12555
- return C(_h, this).get(e);
12555
+ return C(vh, this).get(e);
12556
12556
  }
12557
12557
  addFakeAnnotation(e) {
12558
12558
  let { div: t } = this, { id: n, rotation: r } = e, i = new Np({
@@ -12565,22 +12565,22 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12565
12565
  layer: t,
12566
12566
  parent: this,
12567
12567
  enableComment: !!this._commentManager,
12568
- linkService: C(yh, this),
12569
- annotationStorage: C(gh, this)
12568
+ linkService: C(bh, this),
12569
+ annotationStorage: C(_h, this)
12570
12570
  });
12571
- return i.render(), i.contentElement.id = `${Ee}${n}`, i.createOrUpdatePopup(), C(bh, this).push(i), i;
12571
+ return i.render(), i.contentElement.id = `${Ee}${n}`, i.createOrUpdatePopup(), C(xh, this).push(i), i;
12572
12572
  }
12573
12573
  removeAnnotation(e) {
12574
12574
  var t;
12575
- let n = C(bh, this).findIndex((t) => t.data.id === e);
12575
+ let n = C(xh, this).findIndex((t) => t.data.id === e);
12576
12576
  if (n < 0) return;
12577
- let [r] = C(bh, this).splice(n, 1);
12578
- (t = C(mh, this)) == null || t.removePointerInTextLayer(r.contentElement);
12577
+ let [r] = C(xh, this).splice(n, 1);
12578
+ (t = C(hh, this)) == null || t.removePointerInTextLayer(r.contentElement);
12579
12579
  }
12580
12580
  updateFakeAnnotations(e) {
12581
12581
  if (e.length !== 0) {
12582
12582
  for (let t of e) t.updateFakeAnnotationElement(this);
12583
- m(Sh, this, wh).call(this);
12583
+ m(Ch, this, Th).call(this);
12584
12584
  }
12585
12585
  }
12586
12586
  togglePointerEvents(e = !1) {
@@ -12597,40 +12597,40 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
12597
12597
  }));
12598
12598
  }
12599
12599
  };
12600
- function wh() {
12600
+ function Th() {
12601
12601
  var e = this;
12602
12602
  return b(function* () {
12603
- if (C(bh, e).length === 0) return;
12603
+ if (C(xh, e).length === 0) return;
12604
12604
  e.div.replaceChildren();
12605
12605
  let t = [];
12606
- if (!C(xh, e)) {
12607
- T(xh, e, !0);
12608
- for (let { contentElement: r, data: { id: i } } of C(bh, e)) {
12606
+ if (!C(Sh, e)) {
12607
+ T(Sh, e, !0);
12608
+ for (let { contentElement: r, data: { id: i } } of C(xh, e)) {
12609
12609
  var n;
12610
12610
  let a = r.id = `${Ee}${i}`;
12611
- t.push((n = C(vh, e)) == null ? void 0 : n.getAriaAttributes(a).then((e) => {
12611
+ t.push((n = C(yh, e)) == null ? void 0 : n.getAriaAttributes(a).then((e) => {
12612
12612
  if (e) for (let [t, n] of e) r.setAttribute(t, n);
12613
12613
  }));
12614
12614
  }
12615
12615
  }
12616
- C(bh, e).sort(({ data: { rect: [e, t, n, r] } }, { data: { rect: [i, a, o, s] } }) => {
12616
+ C(xh, e).sort(({ data: { rect: [e, t, n, r] } }, { data: { rect: [i, a, o, s] } }) => {
12617
12617
  if (e === n && t === r) return 1;
12618
12618
  if (i === o && a === s) return -1;
12619
12619
  let c = r, l = t, u = (t + r) / 2, d = s, f = a, p = (a + s) / 2;
12620
12620
  return u >= d && p <= l ? -1 : p >= c && u <= f ? 1 : (e + n) / 2 - (i + o) / 2;
12621
12621
  });
12622
12622
  let r = document.createDocumentFragment();
12623
- for (let t of C(bh, e)) if (r.append(t.container), e._commentManager) {
12623
+ for (let t of C(xh, e)) if (r.append(t.container), e._commentManager) {
12624
12624
  var i, a;
12625
12625
  (i = ((a = t.extraPopupElement) == null ? void 0 : a.popup) || t.popup) == null || i.renderCommentButton();
12626
12626
  } else t.extraPopupElement && r.append(t.extraPopupElement.render());
12627
- if (e.div.append(r), yield Promise.all(t), C(mh, e)) for (let t of C(bh, e)) C(mh, e).addPointerInTextLayer(t.contentElement, !1);
12627
+ if (e.div.append(r), yield Promise.all(t), C(hh, e)) for (let t of C(xh, e)) C(hh, e).addPointerInTextLayer(t.contentElement, !1);
12628
12628
  })();
12629
12629
  }
12630
- function Th() {
12631
- if (!C(hh, this)) return;
12630
+ function Eh() {
12631
+ if (!C(gh, this)) return;
12632
12632
  let e = this.div;
12633
- for (let [n, r] of C(hh, this)) {
12633
+ for (let [n, r] of C(gh, this)) {
12634
12634
  let i = e.querySelector(`[data-annotation-id="${n}"]`);
12635
12635
  if (!i) continue;
12636
12636
  if (Array.isArray(r)) for (let e of r) e.className = "annotationContent", e.ariaHidden = !0;
@@ -12643,15 +12643,15 @@ function Th() {
12643
12643
  let e = o;
12644
12644
  for (let t = 1, n = r.length; t < n; t++) e.after(r[t]), e = r[t];
12645
12645
  }
12646
- C(hh, this).delete(n);
12647
- let c = C(_h, this).get(n);
12646
+ C(gh, this).delete(n);
12647
+ let c = C(vh, this).get(n);
12648
12648
  if (c) if (c._hasNoCanvas) {
12649
12649
  var t;
12650
12650
  (t = this._annotationEditorUIManager) == null || t.setMissingCanvas(n, i.id, r), c._hasNoCanvas = !1;
12651
12651
  } else c.canvas = r;
12652
12652
  }
12653
12653
  }
12654
- var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakSet(), Mh = class e extends W {
12654
+ var Dh = /\r\n?|\n/g, Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakSet(), Nh = class e extends W {
12655
12655
  static get _keyboardManager() {
12656
12656
  let t = e.prototype, n = (e) => e.isEmpty(), r = Br.TRANSLATE_SMALL, i = Br.TRANSLATE_BIG;
12657
12657
  return L(this, "_keyboardManager", new Bn([
@@ -12734,7 +12734,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12734
12734
  ]));
12735
12735
  }
12736
12736
  constructor(t) {
12737
- super(D(D({}, t), {}, { name: "freeTextEditor" })), w(this, jh), S(this, Dh, ""), S(this, Oh, `${this.id}-editor`), S(this, kh, null), S(this, Ah, void 0), v(this, "_colorPicker", null), this.color = t.color || e._defaultColor || W._defaultLineColor, T(Ah, this, t.fontSize || e._defaultFontSize), this.annotationElementId || this._uiManager.a11yAlert(W._l10nAlert.freetext), this.canAddComment = !1;
12737
+ super(D(D({}, t), {}, { name: "freeTextEditor" })), w(this, Mh), S(this, Oh, ""), S(this, kh, `${this.id}-editor`), S(this, Ah, null), S(this, jh, void 0), v(this, "_colorPicker", null), this.color = t.color || e._defaultColor || W._defaultLineColor, T(jh, this, t.fontSize || e._defaultFontSize), this.annotationElementId || this._uiManager.a11yAlert(W._l10nAlert.freetext), this.canAddComment = !1;
12738
12738
  }
12739
12739
  static initialize(e, t) {
12740
12740
  W.initialize(e, t);
@@ -12754,10 +12754,10 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12754
12754
  updateParams(e, t) {
12755
12755
  switch (e) {
12756
12756
  case P.FREETEXT_SIZE:
12757
- m(jh, this, Nh).call(this, t);
12757
+ m(Mh, this, Ph).call(this, t);
12758
12758
  break;
12759
12759
  case P.FREETEXT_COLOR:
12760
- m(jh, this, Ph).call(this, t);
12760
+ m(Mh, this, Fh).call(this, t);
12761
12761
  break;
12762
12762
  }
12763
12763
  }
@@ -12765,7 +12765,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12765
12765
  return [[P.FREETEXT_SIZE, e._defaultFontSize], [P.FREETEXT_COLOR, e._defaultColor || W._defaultLineColor]];
12766
12766
  }
12767
12767
  get propertiesToUpdate() {
12768
- return [[P.FREETEXT_SIZE, C(Ah, this)], [P.FREETEXT_COLOR, this.color]];
12768
+ return [[P.FREETEXT_SIZE, C(jh, this)], [P.FREETEXT_COLOR, this.color]];
12769
12769
  }
12770
12770
  get toolbarButtons() {
12771
12771
  return this._colorPicker || (this._colorPicker = new gp(this)), [["colorPicker", this._colorPicker]];
@@ -12782,20 +12782,20 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12782
12782
  }
12783
12783
  getInitialTranslation() {
12784
12784
  let t = this.parentScale;
12785
- return [-e._internalPadding * t, -(e._internalPadding + C(Ah, this)) * t];
12785
+ return [-e._internalPadding * t, -(e._internalPadding + C(jh, this)) * t];
12786
12786
  }
12787
12787
  rebuild() {
12788
12788
  this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
12789
12789
  }
12790
12790
  enableEditMode() {
12791
12791
  if (!super.enableEditMode()) return !1;
12792
- this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), T(kh, this, new AbortController());
12793
- let e = this._uiManager.combinedSignal(C(kh, this));
12792
+ this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), T(Ah, this, new AbortController());
12793
+ let e = this._uiManager.combinedSignal(C(Ah, this));
12794
12794
  return this.editorDiv.addEventListener("keydown", this.editorDivKeydown.bind(this), { signal: e }), this.editorDiv.addEventListener("focus", this.editorDivFocus.bind(this), { signal: e }), this.editorDiv.addEventListener("blur", this.editorDivBlur.bind(this), { signal: e }), this.editorDiv.addEventListener("input", this.editorDivInput.bind(this), { signal: e }), this.editorDiv.addEventListener("paste", this.editorDivPaste.bind(this), { signal: e }), !0;
12795
12795
  }
12796
12796
  disableEditMode() {
12797
12797
  var e;
12798
- return super.disableEditMode() ? (this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", C(Oh, this)), this._isDraggable = !0, (e = C(kh, this)) == null || e.abort(), T(kh, this, null), this.div.focus({ preventScroll: !0 }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"), !0) : !1;
12798
+ return super.disableEditMode() ? (this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", C(kh, this)), this._isDraggable = !0, (e = C(Ah, this)) == null || e.abort(), T(Ah, this, null), this.div.focus({ preventScroll: !0 }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"), !0) : !1;
12799
12799
  }
12800
12800
  focusin(e) {
12801
12801
  this._focusEventsAllowed && (super.focusin(e), e.target !== this.editorDiv && this.editorDiv.focus());
@@ -12813,14 +12813,14 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12813
12813
  commit() {
12814
12814
  if (!this.isInEditMode()) return;
12815
12815
  super.commit(), this.disableEditMode();
12816
- let e = C(Dh, this), t = T(Dh, this, m(jh, this, Fh).call(this).trimEnd());
12816
+ let e = C(Oh, this), t = T(Oh, this, m(Mh, this, Ih).call(this).trimEnd());
12817
12817
  if (e === t) return;
12818
12818
  let n = (e) => {
12819
- if (T(Dh, this, e), !e) {
12819
+ if (T(Oh, this, e), !e) {
12820
12820
  this.remove();
12821
12821
  return;
12822
12822
  }
12823
- m(jh, this, Rh).call(this), this._uiManager.rebuild(this), m(jh, this, Ih).call(this);
12823
+ m(Mh, this, zh).call(this), this._uiManager.rebuild(this), m(Mh, this, Lh).call(this);
12824
12824
  };
12825
12825
  this.addCommands({
12826
12826
  cmd: () => {
@@ -12830,7 +12830,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12830
12830
  n(e);
12831
12831
  },
12832
12832
  mustExec: !1
12833
- }), m(jh, this, Ih).call(this);
12833
+ }), m(Mh, this, Lh).call(this);
12834
12834
  }
12835
12835
  shouldGetKeyboardEvents() {
12836
12836
  return this.isInEditMode();
@@ -12865,9 +12865,9 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12865
12865
  render() {
12866
12866
  if (this.div) return this.div;
12867
12867
  let e, t;
12868
- (this._isCopy || this.annotationElementId) && (e = this.x, t = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", C(Oh, this)), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text2"), this.editorDiv.setAttribute("data-l10n-attrs", "default-content"), this.enableEditing(), this.editorDiv.contentEditable = !0;
12868
+ (this._isCopy || this.annotationElementId) && (e = this.x, t = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", C(kh, this)), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text2"), this.editorDiv.setAttribute("data-l10n-attrs", "default-content"), this.enableEditing(), this.editorDiv.contentEditable = !0;
12869
12869
  let { style: n } = this.editorDiv;
12870
- if (n.fontSize = `calc(${C(Ah, this)}px * var(--total-scale-factor))`, n.color = this.color, this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), this._isCopy || this.annotationElementId) {
12870
+ if (n.fontSize = `calc(${C(jh, this)}px * var(--total-scale-factor))`, n.color = this.color, this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), this._isCopy || this.annotationElementId) {
12871
12871
  let [n, r] = this.parentDimensions;
12872
12872
  if (this.annotationElementId) {
12873
12873
  let { position: i } = this._initialData, [a, o] = this.getInitialTranslation();
@@ -12889,7 +12889,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12889
12889
  }
12890
12890
  this.setAt(d * n, f * r, a, o);
12891
12891
  } else this._moveAfterPaste(e, t);
12892
- m(jh, this, Rh).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
12892
+ m(Mh, this, zh).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
12893
12893
  } else this._isDraggable = !1, this.editorDiv.contentEditable = !0;
12894
12894
  return this.div;
12895
12895
  }
@@ -12897,7 +12897,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12897
12897
  let n = t.clipboardData || window.clipboardData, { types: r } = n;
12898
12898
  if (r.length === 1 && r[0] === "text/plain") return;
12899
12899
  t.preventDefault();
12900
- let i = Bh.call(e, n.getData("text") || "").replaceAll(Eh, "\n");
12900
+ let i = Vh.call(e, n.getData("text") || "").replaceAll(Dh, "\n");
12901
12901
  if (!i) return;
12902
12902
  let a = window.getSelection();
12903
12903
  if (!a.rangeCount) return;
@@ -12910,22 +12910,22 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12910
12910
  let { startContainer: s, startOffset: c } = o, l = [], u = [];
12911
12911
  if (s.nodeType === Node.TEXT_NODE) {
12912
12912
  let t = s.parentElement;
12913
- if (u.push(s.nodeValue.slice(c).replaceAll(Eh, "")), t !== this.editorDiv) {
12913
+ if (u.push(s.nodeValue.slice(c).replaceAll(Dh, "")), t !== this.editorDiv) {
12914
12914
  let n = l;
12915
12915
  for (let r of this.editorDiv.childNodes) {
12916
12916
  if (r === t) {
12917
12917
  n = u;
12918
12918
  continue;
12919
12919
  }
12920
- n.push(Lh.call(e, r));
12920
+ n.push(Rh.call(e, r));
12921
12921
  }
12922
12922
  }
12923
- l.push(s.nodeValue.slice(0, c).replaceAll(Eh, ""));
12923
+ l.push(s.nodeValue.slice(0, c).replaceAll(Dh, ""));
12924
12924
  } else if (s === this.editorDiv) {
12925
12925
  let t = l, n = 0;
12926
- for (let r of this.editorDiv.childNodes) n++ === c && (t = u), t.push(Lh.call(e, r));
12926
+ for (let r of this.editorDiv.childNodes) n++ === c && (t = u), t.push(Rh.call(e, r));
12927
12927
  }
12928
- T(Dh, this, `${l.join("\n")}${i}${u.join("\n")}`), m(jh, this, Rh).call(this);
12928
+ T(Oh, this, `${l.join("\n")}${i}${u.join("\n")}`), m(Mh, this, zh).call(this);
12929
12929
  let d = new Range(), f = Math.sumPrecise(l.map((e) => e.length));
12930
12930
  for (let { firstChild: e } of this.editorDiv.childNodes) if (e.nodeType === Node.TEXT_NODE) {
12931
12931
  let t = e.nodeValue.length;
@@ -12948,7 +12948,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12948
12948
  var i = () => super.deserialize, a = this;
12949
12949
  return b(function* () {
12950
12950
  let o = null;
12951
- if (t instanceof Im) {
12951
+ if (t instanceof Lm) {
12952
12952
  let { data: { defaultAppearanceData: { fontSize: e, fontColor: n }, rect: r, rotation: i, id: a, popupRef: s, richText: c, contentsObj: l, creationDate: u, modificationDate: d }, textContent: f, textPosition: p, parent: { page: { pageNumber: m } } } = t;
12953
12953
  if (!(f != null && f.length)) return null;
12954
12954
  o = t = {
@@ -12971,7 +12971,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12971
12971
  };
12972
12972
  }
12973
12973
  let s = yield i().call(a, t, n, r);
12974
- return T(Ah, s, t.fontSize), s.color = z.makeHexColor(...t.color), T(Dh, s, Bh.call(e, t.value)), s._initialData = o, t.comment && s.setCommentData(t), s;
12974
+ return T(jh, s, t.fontSize), s.color = z.makeHexColor(...t.color), T(Oh, s, Vh.call(e, t.value)), s._initialData = o, t.comment && s.setCommentData(t), s;
12975
12975
  })();
12976
12976
  }
12977
12977
  serialize(e = !1) {
@@ -12979,34 +12979,34 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
12979
12979
  if (this.deleted) return this.serializeDeleted();
12980
12980
  let t = W._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.color), n = Object.assign(super.serialize(e), {
12981
12981
  color: t,
12982
- fontSize: C(Ah, this),
12983
- value: m(jh, this, zh).call(this)
12982
+ fontSize: C(jh, this),
12983
+ value: m(Mh, this, Bh).call(this)
12984
12984
  });
12985
- return this.addComment(n), e ? (n.isCopy = !0, n) : this.annotationElementId && !m(jh, this, Vh).call(this, n) ? null : (n.id = this.annotationElementId, n);
12985
+ return this.addComment(n), e ? (n.isCopy = !0, n) : this.annotationElementId && !m(Mh, this, Hh).call(this, n) ? null : (n.id = this.annotationElementId, n);
12986
12986
  }
12987
12987
  renderAnnotationElement(e) {
12988
12988
  let t = super.renderAnnotationElement(e);
12989
12989
  if (!t) return null;
12990
12990
  let { style: n } = t;
12991
- n.fontSize = `calc(${C(Ah, this)}px * var(--total-scale-factor))`, n.color = this.color, t.replaceChildren();
12992
- for (let e of C(Dh, this).split("\n")) {
12991
+ n.fontSize = `calc(${C(jh, this)}px * var(--total-scale-factor))`, n.color = this.color, t.replaceChildren();
12992
+ for (let e of C(Oh, this).split("\n")) {
12993
12993
  let n = document.createElement("div");
12994
12994
  n.append(e ? document.createTextNode(e) : document.createElement("br")), t.append(n);
12995
12995
  }
12996
12996
  return e.updateEdited({
12997
12997
  rect: this.getPDFRect(),
12998
- popup: this._uiManager.hasCommentManager() || this.hasEditedComment ? this.comment : { text: C(Dh, this) }
12998
+ popup: this._uiManager.hasCommentManager() || this.hasEditedComment ? this.comment : { text: C(Oh, this) }
12999
12999
  }), t;
13000
13000
  }
13001
13001
  resetAnnotationElement(e) {
13002
13002
  super.resetAnnotationElement(e), e.resetEdited();
13003
13003
  }
13004
13004
  };
13005
- ue = Mh;
13006
- function Nh(e) {
13005
+ ue = Nh;
13006
+ function Ph(e) {
13007
13007
  let t = (e) => {
13008
- this.editorDiv.style.fontSize = `calc(${e}px * var(--total-scale-factor))`, this.translate(0, -(e - C(Ah, this)) * this.parentScale), T(Ah, this, e), m(jh, this, Ih).call(this);
13009
- }, n = C(Ah, this);
13008
+ this.editorDiv.style.fontSize = `calc(${e}px * var(--total-scale-factor))`, this.translate(0, -(e - C(jh, this)) * this.parentScale), T(jh, this, e), m(Mh, this, Lh).call(this);
13009
+ }, n = C(jh, this);
13010
13010
  this.addCommands({
13011
13011
  cmd: t.bind(this, e),
13012
13012
  undo: t.bind(this, n),
@@ -13017,7 +13017,7 @@ function Nh(e) {
13017
13017
  keepUndo: !0
13018
13018
  });
13019
13019
  }
13020
- function Ph(e) {
13020
+ function Fh(e) {
13021
13021
  let t = (e) => {
13022
13022
  this.color = e, this.onUpdatedColor();
13023
13023
  }, n = this.color;
@@ -13031,14 +13031,14 @@ function Ph(e) {
13031
13031
  keepUndo: !0
13032
13032
  });
13033
13033
  }
13034
- function Fh() {
13034
+ function Ih() {
13035
13035
  let e = [];
13036
13036
  this.editorDiv.normalize();
13037
13037
  let t = null;
13038
- for (let n of this.editorDiv.childNodes) (t == null ? void 0 : t.nodeType) === Node.TEXT_NODE && n.nodeName === "BR" || (e.push(Lh.call(ue, n)), t = n);
13038
+ for (let n of this.editorDiv.childNodes) (t == null ? void 0 : t.nodeType) === Node.TEXT_NODE && n.nodeName === "BR" || (e.push(Rh.call(ue, n)), t = n);
13039
13039
  return e.join("\n");
13040
13040
  }
13041
- function Ih() {
13041
+ function Lh() {
13042
13042
  let [e, t] = this.parentDimensions, n;
13043
13043
  if (this.isAttachedToDOM) n = this.div.getBoundingClientRect();
13044
13044
  else {
@@ -13047,27 +13047,27 @@ function Ih() {
13047
13047
  }
13048
13048
  this.rotation % 180 == this.parentRotation % 180 ? (this.width = n.width / e, this.height = n.height / t) : (this.width = n.height / e, this.height = n.width / t), this.fixAndSetPosition();
13049
13049
  }
13050
- function Lh(e) {
13051
- return (e.nodeType === Node.TEXT_NODE ? e.nodeValue : e.innerText).replaceAll(Eh, "");
13050
+ function Rh(e) {
13051
+ return (e.nodeType === Node.TEXT_NODE ? e.nodeValue : e.innerText).replaceAll(Dh, "");
13052
13052
  }
13053
- function Rh() {
13054
- if (this.editorDiv.replaceChildren(), C(Dh, this)) for (let e of C(Dh, this).split("\n")) {
13053
+ function zh() {
13054
+ if (this.editorDiv.replaceChildren(), C(Oh, this)) for (let e of C(Oh, this).split("\n")) {
13055
13055
  let t = document.createElement("div");
13056
13056
  t.append(e ? document.createTextNode(e) : document.createElement("br")), this.editorDiv.append(t);
13057
13057
  }
13058
13058
  }
13059
- function zh() {
13060
- return C(Dh, this).replaceAll("\xA0", " ");
13059
+ function Bh() {
13060
+ return C(Oh, this).replaceAll("\xA0", " ");
13061
13061
  }
13062
- function Bh(e) {
13062
+ function Vh(e) {
13063
13063
  return e.replaceAll(" ", "\xA0");
13064
13064
  }
13065
- function Vh(e) {
13065
+ function Hh(e) {
13066
13066
  let { value: t, fontSize: n, color: r, pageIndex: i } = this._initialData;
13067
13067
  return this.hasEditedComment || this._hasBeenMoved || e.value !== t || e.fontSize !== n || e.color.some((e, t) => e !== r[t]) || e.pageIndex !== i;
13068
13068
  }
13069
- v(Mh, "_freeTextDefaultContent", ""), v(Mh, "_internalPadding", 0), v(Mh, "_defaultColor", null), v(Mh, "_defaultFontSize", 10), v(Mh, "_type", "freetext"), v(Mh, "_editorType", N.FREETEXT);
13070
- var X = class {
13069
+ v(Nh, "_freeTextDefaultContent", ""), v(Nh, "_internalPadding", 0), v(Nh, "_defaultColor", null), v(Nh, "_defaultFontSize", 10), v(Nh, "_type", "freetext"), v(Nh, "_editorType", N.FREETEXT);
13070
+ var Y = class {
13071
13071
  toSVGPath() {
13072
13072
  I("Abstract method `toSVGPath` must be implemented.");
13073
13073
  }
@@ -13114,65 +13114,65 @@ var X = class {
13114
13114
  ];
13115
13115
  }
13116
13116
  };
13117
- v(X, "PRECISION", 1e-4);
13118
- var Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakSet(), tg = class {
13117
+ v(Y, "PRECISION", 1e-4);
13118
+ var Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakSet(), ng = class {
13119
13119
  constructor({ x: e, y: t }, n, r, i, a, o = 0) {
13120
- w(this, eg), S(this, Hh, void 0), S(this, Uh, []), S(this, Wh, void 0), S(this, Gh, void 0), S(this, Kh, []), S(this, Z, /* @__PURE__ */ new Float32Array(18)), S(this, qh, void 0), S(this, Jh, void 0), S(this, Yh, void 0), S(this, Xh, void 0), S(this, Zh, void 0), S(this, Qh, void 0), S(this, $h, []), T(Hh, this, n), T(Qh, this, i * r), T(Gh, this, a), C(Z, this).set([
13120
+ w(this, tg), S(this, Uh, void 0), S(this, Wh, []), S(this, Gh, void 0), S(this, Kh, void 0), S(this, qh, []), S(this, X, /* @__PURE__ */ new Float32Array(18)), S(this, Jh, void 0), S(this, Yh, void 0), S(this, Xh, void 0), S(this, Zh, void 0), S(this, Qh, void 0), S(this, $h, void 0), S(this, eg, []), T(Uh, this, n), T($h, this, i * r), T(Kh, this, a), C(X, this).set([
13121
13121
  NaN,
13122
13122
  NaN,
13123
13123
  NaN,
13124
13124
  NaN,
13125
13125
  e,
13126
13126
  t
13127
- ], 6), T(Wh, this, o), T(Xh, this, lg._ * r), T(Yh, this, ug._ * r), T(Zh, this, r), C($h, this).push(e, t);
13127
+ ], 6), T(Gh, this, o), T(Zh, this, ug._ * r), T(Xh, this, dg._ * r), T(Qh, this, r), C(eg, this).push(e, t);
13128
13128
  }
13129
13129
  isEmpty() {
13130
- return isNaN(C(Z, this)[8]);
13130
+ return isNaN(C(X, this)[8]);
13131
13131
  }
13132
13132
  add({ x: e, y: t }) {
13133
13133
  var n;
13134
- T(qh, this, e), T(Jh, this, t);
13135
- let [r, i, a, o] = C(Hh, this), [s, c, l, u] = C(Z, this).subarray(8, 12), d = e - l, f = t - u, p = Math.hypot(d, f);
13136
- if (p < C(Yh, this)) return !1;
13137
- let m = p - C(Xh, this), h = m / p, g = h * d, _ = h * f, v = s, y = c;
13138
- s = l, c = u, l += g, u += _, (n = C($h, this)) == null || n.push(e, t);
13139
- let b = -_ / m, x = g / m, S = b * C(Qh, this), w = x * C(Qh, this);
13140
- return C(Z, this).set(C(Z, this).subarray(2, 8), 0), C(Z, this).set([l + S, u + w], 4), C(Z, this).set(C(Z, this).subarray(14, 18), 12), C(Z, this).set([l - S, u - w], 16), isNaN(C(Z, this)[6]) ? (C(Kh, this).length === 0 && (C(Z, this).set([s + S, c + w], 2), C(Kh, this).push(NaN, NaN, NaN, NaN, (s + S - r) / a, (c + w - i) / o), C(Z, this).set([s - S, c - w], 14), C(Uh, this).push(NaN, NaN, NaN, NaN, (s - S - r) / a, (c - w - i) / o)), C(Z, this).set([
13134
+ T(Jh, this, e), T(Yh, this, t);
13135
+ let [r, i, a, o] = C(Uh, this), [s, c, l, u] = C(X, this).subarray(8, 12), d = e - l, f = t - u, p = Math.hypot(d, f);
13136
+ if (p < C(Xh, this)) return !1;
13137
+ let m = p - C(Zh, this), h = m / p, g = h * d, _ = h * f, v = s, y = c;
13138
+ s = l, c = u, l += g, u += _, (n = C(eg, this)) == null || n.push(e, t);
13139
+ let b = -_ / m, x = g / m, S = b * C($h, this), w = x * C($h, this);
13140
+ return C(X, this).set(C(X, this).subarray(2, 8), 0), C(X, this).set([l + S, u + w], 4), C(X, this).set(C(X, this).subarray(14, 18), 12), C(X, this).set([l - S, u - w], 16), isNaN(C(X, this)[6]) ? (C(qh, this).length === 0 && (C(X, this).set([s + S, c + w], 2), C(qh, this).push(NaN, NaN, NaN, NaN, (s + S - r) / a, (c + w - i) / o), C(X, this).set([s - S, c - w], 14), C(Wh, this).push(NaN, NaN, NaN, NaN, (s - S - r) / a, (c - w - i) / o)), C(X, this).set([
13141
13141
  v,
13142
13142
  y,
13143
13143
  s,
13144
13144
  c,
13145
13145
  l,
13146
13146
  u
13147
- ], 6), !this.isEmpty()) : (C(Z, this).set([
13147
+ ], 6), !this.isEmpty()) : (C(X, this).set([
13148
13148
  v,
13149
13149
  y,
13150
13150
  s,
13151
13151
  c,
13152
13152
  l,
13153
13153
  u
13154
- ], 6), Math.abs(Math.atan2(y - c, v - s) - Math.atan2(_, g)) < Math.PI / 2 ? ([s, c, l, u] = C(Z, this).subarray(2, 6), C(Kh, this).push(NaN, NaN, NaN, NaN, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), [s, c, v, y] = C(Z, this).subarray(14, 18), C(Uh, this).push(NaN, NaN, NaN, NaN, ((v + s) / 2 - r) / a, ((y + c) / 2 - i) / o), !0) : ([v, y, s, c, l, u] = C(Z, this).subarray(0, 6), C(Kh, this).push(((v + 5 * s) / 6 - r) / a, ((y + 5 * c) / 6 - i) / o, ((5 * s + l) / 6 - r) / a, ((5 * c + u) / 6 - i) / o, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), [l, u, s, c, v, y] = C(Z, this).subarray(12, 18), C(Uh, this).push(((v + 5 * s) / 6 - r) / a, ((y + 5 * c) / 6 - i) / o, ((5 * s + l) / 6 - r) / a, ((5 * c + u) / 6 - i) / o, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), !0));
13154
+ ], 6), Math.abs(Math.atan2(y - c, v - s) - Math.atan2(_, g)) < Math.PI / 2 ? ([s, c, l, u] = C(X, this).subarray(2, 6), C(qh, this).push(NaN, NaN, NaN, NaN, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), [s, c, v, y] = C(X, this).subarray(14, 18), C(Wh, this).push(NaN, NaN, NaN, NaN, ((v + s) / 2 - r) / a, ((y + c) / 2 - i) / o), !0) : ([v, y, s, c, l, u] = C(X, this).subarray(0, 6), C(qh, this).push(((v + 5 * s) / 6 - r) / a, ((y + 5 * c) / 6 - i) / o, ((5 * s + l) / 6 - r) / a, ((5 * c + u) / 6 - i) / o, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), [l, u, s, c, v, y] = C(X, this).subarray(12, 18), C(Wh, this).push(((v + 5 * s) / 6 - r) / a, ((y + 5 * c) / 6 - i) / o, ((5 * s + l) / 6 - r) / a, ((5 * c + u) / 6 - i) / o, ((s + l) / 2 - r) / a, ((c + u) / 2 - i) / o), !0));
13155
13155
  }
13156
13156
  toSVGPath() {
13157
13157
  if (this.isEmpty()) return "";
13158
- let e = C(Kh, this), t = C(Uh, this);
13159
- if (isNaN(C(Z, this)[6]) && !this.isEmpty()) return m(eg, this, rg).call(this);
13158
+ let e = C(qh, this), t = C(Wh, this);
13159
+ if (isNaN(C(X, this)[6]) && !this.isEmpty()) return m(tg, this, ig).call(this);
13160
13160
  let n = [];
13161
13161
  n.push(`M${e[4]} ${e[5]}`);
13162
13162
  for (let t = 6; t < e.length; t += 6) isNaN(e[t]) ? n.push(`L${e[t + 4]} ${e[t + 5]}`) : n.push(`C${e[t]} ${e[t + 1]} ${e[t + 2]} ${e[t + 3]} ${e[t + 4]} ${e[t + 5]}`);
13163
- m(eg, this, ag).call(this, n);
13163
+ m(tg, this, og).call(this, n);
13164
13164
  for (let e = t.length - 6; e >= 6; e -= 6) isNaN(t[e]) ? n.push(`L${t[e + 4]} ${t[e + 5]}`) : n.push(`C${t[e]} ${t[e + 1]} ${t[e + 2]} ${t[e + 3]} ${t[e + 4]} ${t[e + 5]}`);
13165
- return m(eg, this, ig).call(this, n), n.join(" ");
13165
+ return m(tg, this, ag).call(this, n), n.join(" ");
13166
13166
  }
13167
13167
  newFreeDrawOutline(e, t, n, r, i, a) {
13168
- return new yg(e, t, n, r, i, a);
13168
+ return new bg(e, t, n, r, i, a);
13169
13169
  }
13170
13170
  getOutlines() {
13171
13171
  var e, t;
13172
- let n = C(Kh, this), r = C(Uh, this), i = C(Z, this), [a, o, s, c] = C(Hh, this), l = new Float32Array(((e = (t = C($h, this)) == null ? void 0 : t.length) == null ? 0 : e) + 2);
13173
- for (let e = 0, t = l.length - 2; e < t; e += 2) l[e] = (C($h, this)[e] - a) / s, l[e + 1] = (C($h, this)[e + 1] - o) / c;
13174
- if (l[l.length - 2] = (C(qh, this) - a) / s, l[l.length - 1] = (C(Jh, this) - o) / c, isNaN(i[6]) && !this.isEmpty()) return m(eg, this, og).call(this, l);
13175
- let u = new Float32Array(C(Kh, this).length + 24 + C(Uh, this).length), d = n.length;
13172
+ let n = C(qh, this), r = C(Wh, this), i = C(X, this), [a, o, s, c] = C(Uh, this), l = new Float32Array(((e = (t = C(eg, this)) == null ? void 0 : t.length) == null ? 0 : e) + 2);
13173
+ for (let e = 0, t = l.length - 2; e < t; e += 2) l[e] = (C(eg, this)[e] - a) / s, l[e + 1] = (C(eg, this)[e + 1] - o) / c;
13174
+ if (l[l.length - 2] = (C(Jh, this) - a) / s, l[l.length - 1] = (C(Yh, this) - o) / c, isNaN(i[6]) && !this.isEmpty()) return m(tg, this, sg).call(this, l);
13175
+ let u = new Float32Array(C(qh, this).length + 24 + C(Wh, this).length), d = n.length;
13176
13176
  for (let e = 0; e < d; e += 2) {
13177
13177
  if (isNaN(n[e])) {
13178
13178
  u[e] = u[e + 1] = NaN;
@@ -13180,7 +13180,7 @@ var Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh =
13180
13180
  }
13181
13181
  u[e] = n[e], u[e + 1] = n[e + 1];
13182
13182
  }
13183
- d = m(eg, this, cg).call(this, u, d);
13183
+ d = m(tg, this, lg).call(this, u, d);
13184
13184
  for (let e = r.length - 6; e >= 6; e -= 6) for (let t = 0; t < 6; t += 2) {
13185
13185
  if (isNaN(r[e + t])) {
13186
13186
  u[d] = u[d + 1] = NaN, d += 2;
@@ -13188,32 +13188,32 @@ var Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh =
13188
13188
  }
13189
13189
  u[d] = r[e + t], u[d + 1] = r[e + t + 1], d += 2;
13190
13190
  }
13191
- return m(eg, this, sg).call(this, u, d), this.newFreeDrawOutline(u, l, C(Hh, this), C(Zh, this), C(Wh, this), C(Gh, this));
13191
+ return m(tg, this, cg).call(this, u, d), this.newFreeDrawOutline(u, l, C(Uh, this), C(Qh, this), C(Gh, this), C(Kh, this));
13192
13192
  }
13193
13193
  };
13194
- function ng() {
13195
- let e = C(Z, this).subarray(4, 6), t = C(Z, this).subarray(16, 18), [n, r, i, a] = C(Hh, this);
13194
+ function rg() {
13195
+ let e = C(X, this).subarray(4, 6), t = C(X, this).subarray(16, 18), [n, r, i, a] = C(Uh, this);
13196
13196
  return [
13197
- (C(qh, this) + (e[0] - t[0]) / 2 - n) / i,
13198
- (C(Jh, this) + (e[1] - t[1]) / 2 - r) / a,
13199
- (C(qh, this) + (t[0] - e[0]) / 2 - n) / i,
13200
- (C(Jh, this) + (t[1] - e[1]) / 2 - r) / a
13197
+ (C(Jh, this) + (e[0] - t[0]) / 2 - n) / i,
13198
+ (C(Yh, this) + (e[1] - t[1]) / 2 - r) / a,
13199
+ (C(Jh, this) + (t[0] - e[0]) / 2 - n) / i,
13200
+ (C(Yh, this) + (t[1] - e[1]) / 2 - r) / a
13201
13201
  ];
13202
13202
  }
13203
- function rg() {
13204
- let [e, t, n, r] = C(Hh, this), [i, a, o, s] = m(eg, this, ng).call(this);
13205
- return `M${(C(Z, this)[2] - e) / n} ${(C(Z, this)[3] - t) / r} L${(C(Z, this)[4] - e) / n} ${(C(Z, this)[5] - t) / r} L${i} ${a} L${o} ${s} L${(C(Z, this)[16] - e) / n} ${(C(Z, this)[17] - t) / r} L${(C(Z, this)[14] - e) / n} ${(C(Z, this)[15] - t) / r} Z`;
13203
+ function ig() {
13204
+ let [e, t, n, r] = C(Uh, this), [i, a, o, s] = m(tg, this, rg).call(this);
13205
+ return `M${(C(X, this)[2] - e) / n} ${(C(X, this)[3] - t) / r} L${(C(X, this)[4] - e) / n} ${(C(X, this)[5] - t) / r} L${i} ${a} L${o} ${s} L${(C(X, this)[16] - e) / n} ${(C(X, this)[17] - t) / r} L${(C(X, this)[14] - e) / n} ${(C(X, this)[15] - t) / r} Z`;
13206
13206
  }
13207
- function ig(e) {
13208
- let t = C(Uh, this);
13207
+ function ag(e) {
13208
+ let t = C(Wh, this);
13209
13209
  e.push(`L${t[4]} ${t[5]} Z`);
13210
13210
  }
13211
- function ag(e) {
13212
- let [t, n, r, i] = C(Hh, this), a = C(Z, this).subarray(4, 6), o = C(Z, this).subarray(16, 18), [s, c, l, u] = m(eg, this, ng).call(this);
13211
+ function og(e) {
13212
+ let [t, n, r, i] = C(Uh, this), a = C(X, this).subarray(4, 6), o = C(X, this).subarray(16, 18), [s, c, l, u] = m(tg, this, rg).call(this);
13213
13213
  e.push(`L${(a[0] - t) / r} ${(a[1] - n) / i} L${s} ${c} L${l} ${u} L${(o[0] - t) / r} ${(o[1] - n) / i}`);
13214
13214
  }
13215
- function og(e) {
13216
- let t = C(Z, this), [n, r, i, a] = C(Hh, this), [o, s, c, l] = m(eg, this, ng).call(this), u = /* @__PURE__ */ new Float32Array(36);
13215
+ function sg(e) {
13216
+ let t = C(X, this), [n, r, i, a] = C(Uh, this), [o, s, c, l] = m(tg, this, rg).call(this), u = /* @__PURE__ */ new Float32Array(36);
13217
13217
  return u.set([
13218
13218
  NaN,
13219
13219
  NaN,
@@ -13251,10 +13251,10 @@ function og(e) {
13251
13251
  NaN,
13252
13252
  (t[14] - n) / i,
13253
13253
  (t[15] - r) / a
13254
- ], 0), this.newFreeDrawOutline(u, e, C(Hh, this), C(Zh, this), C(Wh, this), C(Gh, this));
13254
+ ], 0), this.newFreeDrawOutline(u, e, C(Uh, this), C(Qh, this), C(Gh, this), C(Kh, this));
13255
13255
  }
13256
- function sg(e, t) {
13257
- let n = C(Uh, this);
13256
+ function cg(e, t) {
13257
+ let n = C(Wh, this);
13258
13258
  return e.set([
13259
13259
  NaN,
13260
13260
  NaN,
@@ -13264,8 +13264,8 @@ function sg(e, t) {
13264
13264
  n[5]
13265
13265
  ], t), t += 6;
13266
13266
  }
13267
- function cg(e, t) {
13268
- let n = C(Z, this).subarray(4, 6), r = C(Z, this).subarray(16, 18), [i, a, o, s] = C(Hh, this), [c, l, u, d] = m(eg, this, ng).call(this);
13267
+ function lg(e, t) {
13268
+ let n = C(X, this).subarray(4, 6), r = C(X, this).subarray(16, 18), [i, a, o, s] = C(Uh, this), [c, l, u, d] = m(tg, this, rg).call(this);
13269
13269
  return e.set([
13270
13270
  NaN,
13271
13271
  NaN,
@@ -13293,21 +13293,21 @@ function cg(e, t) {
13293
13293
  (r[1] - a) / s
13294
13294
  ], t), t += 24;
13295
13295
  }
13296
- var lg = { _: 8 }, ug = { _: lg._ + { _: 2 }._ }, dg = /* @__PURE__ */ new WeakMap(), fg = /* @__PURE__ */ new WeakMap(), pg = /* @__PURE__ */ new WeakMap(), mg = /* @__PURE__ */ new WeakMap(), hg = /* @__PURE__ */ new WeakMap(), gg = /* @__PURE__ */ new WeakMap(), _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakSet(), yg = class extends X {
13296
+ var ug = { _: 8 }, dg = { _: ug._ + { _: 2 }._ }, fg = /* @__PURE__ */ new WeakMap(), pg = /* @__PURE__ */ new WeakMap(), mg = /* @__PURE__ */ new WeakMap(), hg = /* @__PURE__ */ new WeakMap(), gg = /* @__PURE__ */ new WeakMap(), _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakSet(), bg = class extends Y {
13297
13297
  constructor(e, t, n, r, i, a) {
13298
- super(), w(this, vg), S(this, dg, void 0), S(this, fg, /* @__PURE__ */ new Float32Array(4)), S(this, pg, void 0), S(this, mg, void 0), S(this, hg, void 0), S(this, gg, void 0), S(this, _g, void 0), T(_g, this, e), T(hg, this, t), T(dg, this, n), T(gg, this, r), T(pg, this, i), T(mg, this, a), this.firstPoint = [NaN, NaN], this.lastPoint = [NaN, NaN], m(vg, this, bg).call(this, a);
13299
- let [o, s, c, l] = C(fg, this);
13298
+ super(), w(this, yg), S(this, fg, void 0), S(this, pg, /* @__PURE__ */ new Float32Array(4)), S(this, mg, void 0), S(this, hg, void 0), S(this, gg, void 0), S(this, _g, void 0), S(this, vg, void 0), T(vg, this, e), T(gg, this, t), T(fg, this, n), T(_g, this, r), T(mg, this, i), T(hg, this, a), this.firstPoint = [NaN, NaN], this.lastPoint = [NaN, NaN], m(yg, this, xg).call(this, a);
13299
+ let [o, s, c, l] = C(pg, this);
13300
13300
  for (let t = 0, n = e.length; t < n; t += 2) e[t] = (e[t] - o) / c, e[t + 1] = (e[t + 1] - s) / l;
13301
13301
  for (let e = 0, n = t.length; e < n; e += 2) t[e] = (t[e] - o) / c, t[e + 1] = (t[e + 1] - s) / l;
13302
13302
  }
13303
13303
  toSVGPath() {
13304
- let e = [`M${C(_g, this)[4]} ${C(_g, this)[5]}`];
13305
- for (let t = 6, n = C(_g, this).length; t < n; t += 6) {
13306
- if (isNaN(C(_g, this)[t])) {
13307
- e.push(`L${C(_g, this)[t + 4]} ${C(_g, this)[t + 5]}`);
13304
+ let e = [`M${C(vg, this)[4]} ${C(vg, this)[5]}`];
13305
+ for (let t = 6, n = C(vg, this).length; t < n; t += 6) {
13306
+ if (isNaN(C(vg, this)[t])) {
13307
+ e.push(`L${C(vg, this)[t + 4]} ${C(vg, this)[t + 5]}`);
13308
13308
  continue;
13309
13309
  }
13310
- e.push(`C${C(_g, this)[t]} ${C(_g, this)[t + 1]} ${C(_g, this)[t + 2]} ${C(_g, this)[t + 3]} ${C(_g, this)[t + 4]} ${C(_g, this)[t + 5]}`);
13310
+ e.push(`C${C(vg, this)[t]} ${C(vg, this)[t + 1]} ${C(vg, this)[t + 2]} ${C(vg, this)[t + 3]} ${C(vg, this)[t + 4]} ${C(vg, this)[t + 5]}`);
13311
13311
  }
13312
13312
  return e.push("Z"), e.join(" ");
13313
13313
  }
@@ -13315,16 +13315,16 @@ var lg = { _: 8 }, ug = { _: lg._ + { _: 2 }._ }, dg = /* @__PURE__ */ new WeakM
13315
13315
  let a = n - e, o = r - t, s, c;
13316
13316
  switch (i) {
13317
13317
  case 0:
13318
- s = X._rescale(C(_g, this), e, r, a, -o), c = X._rescale(C(hg, this), e, r, a, -o);
13318
+ s = Y._rescale(C(vg, this), e, r, a, -o), c = Y._rescale(C(gg, this), e, r, a, -o);
13319
13319
  break;
13320
13320
  case 90:
13321
- s = X._rescaleAndSwap(C(_g, this), e, t, a, o), c = X._rescaleAndSwap(C(hg, this), e, t, a, o);
13321
+ s = Y._rescaleAndSwap(C(vg, this), e, t, a, o), c = Y._rescaleAndSwap(C(gg, this), e, t, a, o);
13322
13322
  break;
13323
13323
  case 180:
13324
- s = X._rescale(C(_g, this), n, t, -a, o), c = X._rescale(C(hg, this), n, t, -a, o);
13324
+ s = Y._rescale(C(vg, this), n, t, -a, o), c = Y._rescale(C(gg, this), n, t, -a, o);
13325
13325
  break;
13326
13326
  case 270:
13327
- s = X._rescaleAndSwap(C(_g, this), n, r, -a, -o), c = X._rescaleAndSwap(C(hg, this), n, r, -a, -o);
13327
+ s = Y._rescaleAndSwap(C(vg, this), n, r, -a, -o), c = Y._rescaleAndSwap(C(gg, this), n, r, -a, -o);
13328
13328
  break;
13329
13329
  }
13330
13330
  return {
@@ -13333,25 +13333,25 @@ var lg = { _: 8 }, ug = { _: lg._ + { _: 2 }._ }, dg = /* @__PURE__ */ new WeakM
13333
13333
  };
13334
13334
  }
13335
13335
  get box() {
13336
- return C(fg, this);
13336
+ return C(pg, this);
13337
13337
  }
13338
13338
  newOutliner(e, t, n, r, i, a = 0) {
13339
- return new tg(e, t, n, r, i, a);
13339
+ return new ng(e, t, n, r, i, a);
13340
13340
  }
13341
13341
  getNewOutline(e, t) {
13342
- let [n, r, i, a] = C(fg, this), [o, s, c, l] = C(dg, this), u = i * c, d = a * l, f = n * c + o, p = r * l + s, m = this.newOutliner({
13343
- x: C(hg, this)[0] * u + f,
13344
- y: C(hg, this)[1] * d + p
13345
- }, C(dg, this), C(gg, this), e, C(mg, this), t == null ? C(pg, this) : t);
13346
- for (let e = 2; e < C(hg, this).length; e += 2) m.add({
13347
- x: C(hg, this)[e] * u + f,
13348
- y: C(hg, this)[e + 1] * d + p
13342
+ let [n, r, i, a] = C(pg, this), [o, s, c, l] = C(fg, this), u = i * c, d = a * l, f = n * c + o, p = r * l + s, m = this.newOutliner({
13343
+ x: C(gg, this)[0] * u + f,
13344
+ y: C(gg, this)[1] * d + p
13345
+ }, C(fg, this), C(_g, this), e, C(hg, this), t == null ? C(mg, this) : t);
13346
+ for (let e = 2; e < C(gg, this).length; e += 2) m.add({
13347
+ x: C(gg, this)[e] * u + f,
13348
+ y: C(gg, this)[e + 1] * d + p
13349
13349
  });
13350
13350
  return m.getOutlines();
13351
13351
  }
13352
13352
  };
13353
- function bg(e) {
13354
- let t = C(_g, this), n = t[4], r = t[5], i = [
13353
+ function xg(e) {
13354
+ let t = C(vg, this), n = t[4], r = t[5], i = [
13355
13355
  n,
13356
13356
  r,
13357
13357
  n,
@@ -13361,12 +13361,12 @@ function bg(e) {
13361
13361
  let d = t[e + 4], f = t[e + 5];
13362
13362
  isNaN(t[e]) ? (z.pointBoundingBox(d, f, i), o > f ? (a = d, o = f) : o === f && (a = l(a, d)), c < f ? (s = d, c = f) : c === f && (s = l(s, d))) : (u.set(ye, 0), z.bezierBoundingBox(n, r, ...t.slice(e, e + 6), u), z.rectBoundingBox(...u, i), o > u[1] ? (a = u[0], o = u[1]) : o === u[1] && (a = l(a, u[0])), c < u[3] ? (s = u[2], c = u[3]) : c === u[3] && (s = l(s, u[2]))), n = d, r = f;
13363
13363
  }
13364
- let d = C(fg, this);
13365
- d[0] = i[0] - C(pg, this), d[1] = i[1] - C(pg, this), d[2] = i[2] - i[0] + 2 * C(pg, this), d[3] = i[3] - i[1] + 2 * C(pg, this), this.firstPoint = [a, o], this.lastPoint = [s, c];
13364
+ let d = C(pg, this);
13365
+ d[0] = i[0] - C(mg, this), d[1] = i[1] - C(mg, this), d[2] = i[2] - i[0] + 2 * C(mg, this), d[3] = i[3] - i[1] + 2 * C(mg, this), this.firstPoint = [a, o], this.lastPoint = [s, c];
13366
13366
  }
13367
- var xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakSet(), Dg = class {
13367
+ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakMap(), Dg = /* @__PURE__ */ new WeakSet(), Og = class {
13368
13368
  constructor(e, t = 0, n = 0, r = !0) {
13369
- w(this, Eg), S(this, xg, void 0), S(this, Sg, void 0), S(this, Cg, void 0), S(this, wg, []), S(this, Tg, []);
13369
+ w(this, Dg), S(this, Sg, void 0), S(this, Cg, void 0), S(this, wg, void 0), S(this, Tg, []), S(this, Eg, []);
13370
13370
  let i = ye.slice(), a = Math.pow(10, -4);
13371
13371
  for (let { x: n, y: r, width: o, height: s } of e) {
13372
13372
  let e = Math.floor((n - t) / a) * a, c = Math.ceil((n + o + t) / a) * a, l = Math.floor((r - t) / a) * a, u = Math.ceil((r + s + t) / a) * a, d = [
@@ -13380,28 +13380,28 @@ var xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg =
13380
13380
  u,
13381
13381
  !1
13382
13382
  ];
13383
- C(wg, this).push(d, f), z.rectBoundingBox(e, l, c, u, i);
13383
+ C(Tg, this).push(d, f), z.rectBoundingBox(e, l, c, u, i);
13384
13384
  }
13385
- let o = i[2] - i[0] + 2 * n, s = i[3] - i[1] + 2 * n, c = i[0] - n, l = i[1] - n, u = r ? -Infinity : Infinity, d = Infinity, f = C(wg, this).at(r ? -1 : -2), p = [f[0], f[2]];
13386
- for (let e of C(wg, this)) {
13385
+ let o = i[2] - i[0] + 2 * n, s = i[3] - i[1] + 2 * n, c = i[0] - n, l = i[1] - n, u = r ? -Infinity : Infinity, d = Infinity, f = C(Tg, this).at(r ? -1 : -2), p = [f[0], f[2]];
13386
+ for (let e of C(Tg, this)) {
13387
13387
  let [t, n, i, a] = e;
13388
13388
  !a && r ? n < d ? (d = n, u = t) : n === d && (u = Math.max(u, t)) : a && !r && (n < d ? (d = n, u = t) : n === d && (u = Math.min(u, t))), e[0] = (t - c) / o, e[1] = (n - l) / s, e[2] = (i - l) / s;
13389
13389
  }
13390
- T(xg, this, new Float32Array([
13390
+ T(Sg, this, new Float32Array([
13391
13391
  c,
13392
13392
  l,
13393
13393
  o,
13394
13394
  s
13395
- ])), T(Sg, this, [u, d]), T(Cg, this, p);
13395
+ ])), T(Cg, this, [u, d]), T(wg, this, p);
13396
13396
  }
13397
13397
  getOutlines() {
13398
- C(wg, this).sort((e, t) => e[0] - t[0] || e[1] - t[1] || e[2] - t[2]);
13398
+ C(Tg, this).sort((e, t) => e[0] - t[0] || e[1] - t[1] || e[2] - t[2]);
13399
13399
  let e = [];
13400
- for (let t of C(wg, this)) t[3] ? (e.push(...m(Eg, this, Mg).call(this, t)), m(Eg, this, Ag).call(this, t)) : (m(Eg, this, jg).call(this, t), e.push(...m(Eg, this, Mg).call(this, t)));
13401
- return m(Eg, this, Og).call(this, e);
13400
+ for (let t of C(Tg, this)) t[3] ? (e.push(...m(Dg, this, Ng).call(this, t)), m(Dg, this, jg).call(this, t)) : (m(Dg, this, Mg).call(this, t), e.push(...m(Dg, this, Ng).call(this, t)));
13401
+ return m(Dg, this, kg).call(this, e);
13402
13402
  }
13403
13403
  };
13404
- function Og(e) {
13404
+ function kg(e) {
13405
13405
  let t = [], n = /* @__PURE__ */ new Set();
13406
13406
  for (let n of e) {
13407
13407
  let [e, r, i] = n;
@@ -13434,10 +13434,10 @@ function Og(e) {
13434
13434
  }
13435
13435
  i.push(l, u);
13436
13436
  }
13437
- return new Fg(r, C(xg, this), C(Sg, this), C(Cg, this));
13437
+ return new Ig(r, C(Sg, this), C(Cg, this), C(wg, this));
13438
13438
  }
13439
- function kg(e) {
13440
- let t = C(Tg, this), n = 0, r = t.length - 1;
13439
+ function Ag(e) {
13440
+ let t = C(Eg, this), n = 0, r = t.length - 1;
13441
13441
  for (; n <= r;) {
13442
13442
  let i = n + r >> 1, a = t[i][0];
13443
13443
  if (a === e) return i;
@@ -13445,37 +13445,37 @@ function kg(e) {
13445
13445
  }
13446
13446
  return r + 1;
13447
13447
  }
13448
- function Ag([, e, t]) {
13449
- let n = m(Eg, this, kg).call(this, e);
13450
- C(Tg, this).splice(n, 0, [e, t]);
13451
- }
13452
13448
  function jg([, e, t]) {
13453
- let n = m(Eg, this, kg).call(this, e);
13454
- for (let r = n; r < C(Tg, this).length; r++) {
13455
- let [n, i] = C(Tg, this)[r];
13449
+ let n = m(Dg, this, Ag).call(this, e);
13450
+ C(Eg, this).splice(n, 0, [e, t]);
13451
+ }
13452
+ function Mg([, e, t]) {
13453
+ let n = m(Dg, this, Ag).call(this, e);
13454
+ for (let r = n; r < C(Eg, this).length; r++) {
13455
+ let [n, i] = C(Eg, this)[r];
13456
13456
  if (n !== e) break;
13457
13457
  if (n === e && i === t) {
13458
- C(Tg, this).splice(r, 1);
13458
+ C(Eg, this).splice(r, 1);
13459
13459
  return;
13460
13460
  }
13461
13461
  }
13462
13462
  for (let r = n - 1; r >= 0; r--) {
13463
- let [n, i] = C(Tg, this)[r];
13463
+ let [n, i] = C(Eg, this)[r];
13464
13464
  if (n !== e) break;
13465
13465
  if (n === e && i === t) {
13466
- C(Tg, this).splice(r, 1);
13466
+ C(Eg, this).splice(r, 1);
13467
13467
  return;
13468
13468
  }
13469
13469
  }
13470
13470
  }
13471
- function Mg(e) {
13471
+ function Ng(e) {
13472
13472
  let [t, n, r] = e, i = [[
13473
13473
  t,
13474
13474
  n,
13475
13475
  r
13476
- ]], a = m(Eg, this, kg).call(this, r);
13476
+ ]], a = m(Dg, this, Ag).call(this, r);
13477
13477
  for (let e = 0; e < a; e++) {
13478
- let [n, r] = C(Tg, this)[e];
13478
+ let [n, r] = C(Eg, this)[e];
13479
13479
  for (let e = 0, a = i.length; e < a; e++) {
13480
13480
  let [, o, s] = i[e];
13481
13481
  if (!(r <= o || s <= n)) {
@@ -13497,13 +13497,13 @@ function Mg(e) {
13497
13497
  }
13498
13498
  return i;
13499
13499
  }
13500
- var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = class extends X {
13500
+ var Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = class extends Y {
13501
13501
  constructor(e, t, n, r) {
13502
- super(), S(this, Ng, void 0), S(this, Pg, void 0), T(Pg, this, e), T(Ng, this, t), this.firstPoint = n, this.lastPoint = r;
13502
+ super(), S(this, Pg, void 0), S(this, Fg, void 0), T(Fg, this, e), T(Pg, this, t), this.firstPoint = n, this.lastPoint = r;
13503
13503
  }
13504
13504
  toSVGPath() {
13505
13505
  let e = [];
13506
- for (let t of C(Pg, this)) {
13506
+ for (let t of C(Fg, this)) {
13507
13507
  let [n, r] = t;
13508
13508
  e.push(`M${n} ${r}`);
13509
13509
  for (let i = 2; i < t.length; i += 2) {
@@ -13516,7 +13516,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13516
13516
  }
13517
13517
  serialize([e, t, n, r], i) {
13518
13518
  let a = [], o = n - e, s = r - t;
13519
- for (let t of C(Pg, this)) {
13519
+ for (let t of C(Fg, this)) {
13520
13520
  let n = Array(t.length);
13521
13521
  for (let i = 0; i < t.length; i += 2) n[i] = e + t[i] * o, n[i + 1] = r - t[i + 1] * s;
13522
13522
  a.push(n);
@@ -13524,17 +13524,17 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13524
13524
  return a;
13525
13525
  }
13526
13526
  get box() {
13527
- return C(Ng, this);
13527
+ return C(Pg, this);
13528
13528
  }
13529
- }, Ig = class extends tg {
13529
+ }, Lg = class extends ng {
13530
13530
  newFreeDrawOutline(e, t, n, r, i, a) {
13531
- return new Lg(e, t, n, r, i, a);
13531
+ return new Rg(e, t, n, r, i, a);
13532
13532
  }
13533
- }, Lg = class extends yg {
13533
+ }, Rg = class extends bg {
13534
13534
  newOutliner(e, t, n, r, i, a = 0) {
13535
- return new Ig(e, t, n, r, i, a);
13535
+ return new Lg(e, t, n, r, i, a);
13536
13536
  }
13537
- }, Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakMap(), Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakSet(), r_ = class e extends W {
13537
+ }, zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakMap(), Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakSet(), r_ = class e extends W {
13538
13538
  static get _keyboardManager() {
13539
13539
  let t = e.prototype;
13540
13540
  return L(this, "_keyboardManager", new Bn([
@@ -13561,15 +13561,15 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13561
13561
  ]));
13562
13562
  }
13563
13563
  constructor(t) {
13564
- super(D(D({}, t), {}, { name: "highlightEditor" })), w(this, n_), S(this, Rg, null), S(this, zg, 0), S(this, Bg, void 0), S(this, Vg, null), S(this, Hg, null), S(this, Ug, null), S(this, Wg, null), S(this, Gg, 0), S(this, Kg, null), S(this, qg, null), S(this, Jg, null), S(this, Yg, !1), S(this, Xg, null), S(this, Zg, null), S(this, Qg, null), S(this, $g, ""), S(this, e_, void 0), S(this, t_, ""), this.color = t.color || e._defaultColor, T(e_, this, t.thickness || e._defaultThickness), this.opacity = t.opacity || e._defaultOpacity, T(Bg, this, t.boxes || null), T(t_, this, t.methodOfCreation || ""), T($g, this, t.text || ""), this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", t.highlightId > -1 ? (T(Yg, this, !0), m(n_, this, a_).call(this, t), m(n_, this, u_).call(this)) : C(Bg, this) && (T(Rg, this, t.anchorNode), T(zg, this, t.anchorOffset), T(Wg, this, t.focusNode), T(Gg, this, t.focusOffset), m(n_, this, i_).call(this), m(n_, this, u_).call(this), this.rotate(this.rotation)), this.annotationElementId || this._uiManager.a11yAlert(W._l10nAlert.highlight);
13564
+ super(D(D({}, t), {}, { name: "highlightEditor" })), w(this, Z), S(this, zg, null), S(this, Bg, 0), S(this, Vg, void 0), S(this, Hg, null), S(this, Ug, null), S(this, Wg, null), S(this, Gg, null), S(this, Kg, 0), S(this, qg, null), S(this, Jg, null), S(this, Yg, null), S(this, Xg, !1), S(this, Zg, null), S(this, Qg, null), S(this, $g, null), S(this, e_, ""), S(this, t_, void 0), S(this, n_, ""), this.color = t.color || e._defaultColor, T(t_, this, t.thickness || e._defaultThickness), this.opacity = t.opacity || e._defaultOpacity, T(Vg, this, t.boxes || null), T(n_, this, t.methodOfCreation || ""), T(e_, this, t.text || ""), this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", t.highlightId > -1 ? (T(Xg, this, !0), m(Z, this, a_).call(this, t), m(Z, this, u_).call(this)) : C(Vg, this) && (T(zg, this, t.anchorNode), T(Bg, this, t.anchorOffset), T(Gg, this, t.focusNode), T(Kg, this, t.focusOffset), m(Z, this, i_).call(this), m(Z, this, u_).call(this), this.rotate(this.rotation)), this.annotationElementId || this._uiManager.a11yAlert(W._l10nAlert.highlight);
13565
13565
  }
13566
13566
  get telemetryInitialData() {
13567
13567
  return {
13568
13568
  action: "added",
13569
- type: C(Yg, this) ? "free_highlight" : "highlight",
13569
+ type: C(Xg, this) ? "free_highlight" : "highlight",
13570
13570
  color: this._uiManager.getNonHCMColorName(this.color),
13571
- thickness: C(e_, this),
13572
- methodOfCreation: C(t_, this)
13571
+ thickness: C(t_, this),
13572
+ methodOfCreation: C(n_, this)
13573
13573
  };
13574
13574
  }
13575
13575
  get telemetryFinalData() {
@@ -13597,18 +13597,18 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13597
13597
  }
13598
13598
  translateInPage(e, t) {}
13599
13599
  get toolbarPosition() {
13600
- return C(Zg, this);
13600
+ return C(Qg, this);
13601
13601
  }
13602
13602
  get commentButtonPosition() {
13603
- return C(Xg, this);
13603
+ return C(Zg, this);
13604
13604
  }
13605
13605
  updateParams(e, t) {
13606
13606
  switch (e) {
13607
13607
  case P.HIGHLIGHT_COLOR:
13608
- m(n_, this, o_).call(this, t);
13608
+ m(Z, this, o_).call(this, t);
13609
13609
  break;
13610
13610
  case P.HIGHLIGHT_THICKNESS:
13611
- m(n_, this, s_).call(this, t);
13611
+ m(Z, this, s_).call(this, t);
13612
13612
  break;
13613
13613
  }
13614
13614
  }
@@ -13618,19 +13618,19 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13618
13618
  get propertiesToUpdate() {
13619
13619
  return [
13620
13620
  [P.HIGHLIGHT_COLOR, this.color || e._defaultColor],
13621
- [P.HIGHLIGHT_THICKNESS, C(e_, this) || e._defaultThickness],
13622
- [P.HIGHLIGHT_FREE, C(Yg, this)]
13621
+ [P.HIGHLIGHT_THICKNESS, C(t_, this) || e._defaultThickness],
13622
+ [P.HIGHLIGHT_FREE, C(Xg, this)]
13623
13623
  ];
13624
13624
  }
13625
13625
  onUpdatedColor() {
13626
13626
  var e, t;
13627
- (e = this.parent) == null || e.drawLayer.updateProperties(C(Jg, this), { root: {
13627
+ (e = this.parent) == null || e.drawLayer.updateProperties(C(Yg, this), { root: {
13628
13628
  fill: this.color,
13629
13629
  "fill-opacity": this.opacity
13630
- } }), (t = C(Hg, this)) == null || t.updateColor(this.color), super.onUpdatedColor();
13630
+ } }), (t = C(Ug, this)) == null || t.updateColor(this.color), super.onUpdatedColor();
13631
13631
  }
13632
13632
  get toolbarButtons() {
13633
- return this._uiManager.highlightColors ? [["colorPicker", T(Hg, this, new ip({ editor: this }))]] : super.toolbarButtons;
13633
+ return this._uiManager.highlightColors ? [["colorPicker", T(Ug, this, new ip({ editor: this }))]] : super.toolbarButtons;
13634
13634
  }
13635
13635
  disableEditing() {
13636
13636
  super.disableEditing(), this.div.classList.toggle("disabled", !0);
@@ -13639,104 +13639,104 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13639
13639
  super.enableEditing(), this.div.classList.toggle("disabled", !1);
13640
13640
  }
13641
13641
  fixAndSetPosition() {
13642
- return super.fixAndSetPosition(m(n_, this, m_).call(this));
13642
+ return super.fixAndSetPosition(m(Z, this, m_).call(this));
13643
13643
  }
13644
13644
  getBaseTranslation() {
13645
13645
  return [0, 0];
13646
13646
  }
13647
13647
  getRect(e, t) {
13648
- return super.getRect(e, t, m(n_, this, m_).call(this));
13648
+ return super.getRect(e, t, m(Z, this, m_).call(this));
13649
13649
  }
13650
13650
  onceAdded(e) {
13651
13651
  this.annotationElementId || this.parent.addUndoableEditor(this), e && this.div.focus();
13652
13652
  }
13653
13653
  remove() {
13654
- m(n_, this, l_).call(this), this._reportTelemetry({ action: "deleted" }), super.remove();
13654
+ m(Z, this, l_).call(this), this._reportTelemetry({ action: "deleted" }), super.remove();
13655
13655
  }
13656
13656
  rebuild() {
13657
- this.parent && (super.rebuild(), this.div !== null && (m(n_, this, u_).call(this), this.isAttachedToDOM || this.parent.add(this)));
13657
+ this.parent && (super.rebuild(), this.div !== null && (m(Z, this, u_).call(this), this.isAttachedToDOM || this.parent.add(this)));
13658
13658
  }
13659
13659
  setParent(e) {
13660
13660
  let t = !1;
13661
- if (this.parent && !e) m(n_, this, l_).call(this);
13661
+ if (this.parent && !e) m(Z, this, l_).call(this);
13662
13662
  else if (e) {
13663
13663
  var n;
13664
- m(n_, this, u_).call(this, e), t = !this.parent && ((n = this.div) == null ? void 0 : n.classList.contains("selectedEditor"));
13664
+ m(Z, this, u_).call(this, e), t = !this.parent && ((n = this.div) == null ? void 0 : n.classList.contains("selectedEditor"));
13665
13665
  }
13666
13666
  super.setParent(e), this.show(this._isVisible), t && this.select();
13667
13667
  }
13668
13668
  rotate(t) {
13669
13669
  let { drawLayer: n } = this.parent, r;
13670
- C(Yg, this) ? (t = (t - this.rotation + 360) % 360, r = d_.call(e, C(qg, this).box, t)) : r = d_.call(e, [
13670
+ C(Xg, this) ? (t = (t - this.rotation + 360) % 360, r = d_.call(e, C(Jg, this).box, t)) : r = d_.call(e, [
13671
13671
  this.x,
13672
13672
  this.y,
13673
13673
  this.width,
13674
13674
  this.height
13675
- ], t), n.updateProperties(C(Jg, this), {
13675
+ ], t), n.updateProperties(C(Yg, this), {
13676
13676
  bbox: r,
13677
13677
  root: { "data-main-rotation": t }
13678
- }), n.updateProperties(C(Qg, this), {
13679
- bbox: d_.call(e, C(Ug, this).box, t),
13678
+ }), n.updateProperties(C($g, this), {
13679
+ bbox: d_.call(e, C(Wg, this).box, t),
13680
13680
  root: { "data-main-rotation": t }
13681
13681
  });
13682
13682
  }
13683
13683
  render() {
13684
13684
  if (this.div) return this.div;
13685
13685
  let e = super.render();
13686
- C($g, this) && (e.setAttribute("aria-label", C($g, this)), e.setAttribute("role", "mark")), C(Yg, this) ? e.classList.add("free") : this.div.addEventListener("keydown", m(n_, this, f_).bind(this), { signal: this._uiManager._signal });
13687
- let t = T(Kg, this, document.createElement("div"));
13688
- return e.append(t), t.setAttribute("aria-hidden", "true"), t.className = "internal", t.style.clipPath = C(Vg, this), this.setDims(), xn(this, C(Kg, this), ["pointerover", "pointerleave"]), this.enableEditing(), e;
13686
+ C(e_, this) && (e.setAttribute("aria-label", C(e_, this)), e.setAttribute("role", "mark")), C(Xg, this) ? e.classList.add("free") : this.div.addEventListener("keydown", m(Z, this, f_).bind(this), { signal: this._uiManager._signal });
13687
+ let t = T(qg, this, document.createElement("div"));
13688
+ return e.append(t), t.setAttribute("aria-hidden", "true"), t.className = "internal", t.style.clipPath = C(Hg, this), this.setDims(), xn(this, C(qg, this), ["pointerover", "pointerleave"]), this.enableEditing(), e;
13689
13689
  }
13690
13690
  pointerover() {
13691
13691
  if (!this.isSelected) {
13692
13692
  var e;
13693
- (e = this.parent) == null || e.drawLayer.updateProperties(C(Qg, this), { rootClass: { hovered: !0 } });
13693
+ (e = this.parent) == null || e.drawLayer.updateProperties(C($g, this), { rootClass: { hovered: !0 } });
13694
13694
  }
13695
13695
  }
13696
13696
  pointerleave() {
13697
13697
  if (!this.isSelected) {
13698
13698
  var e;
13699
- (e = this.parent) == null || e.drawLayer.updateProperties(C(Qg, this), { rootClass: { hovered: !1 } });
13699
+ (e = this.parent) == null || e.drawLayer.updateProperties(C($g, this), { rootClass: { hovered: !1 } });
13700
13700
  }
13701
13701
  }
13702
13702
  _moveCaret(e) {
13703
13703
  switch (this.parent.unselect(this), e) {
13704
13704
  case 0:
13705
13705
  case 2:
13706
- m(n_, this, p_).call(this, !0);
13706
+ m(Z, this, p_).call(this, !0);
13707
13707
  break;
13708
13708
  case 1:
13709
13709
  case 3:
13710
- m(n_, this, p_).call(this, !1);
13710
+ m(Z, this, p_).call(this, !1);
13711
13711
  break;
13712
13712
  }
13713
13713
  }
13714
13714
  select() {
13715
13715
  var e;
13716
- super.select(), C(Qg, this) && ((e = this.parent) == null || e.drawLayer.updateProperties(C(Qg, this), { rootClass: {
13716
+ super.select(), C($g, this) && ((e = this.parent) == null || e.drawLayer.updateProperties(C($g, this), { rootClass: {
13717
13717
  hovered: !1,
13718
13718
  selected: !0
13719
13719
  } }));
13720
13720
  }
13721
13721
  unselect() {
13722
13722
  var e;
13723
- super.unselect(), C(Qg, this) && ((e = this.parent) == null || e.drawLayer.updateProperties(C(Qg, this), { rootClass: { selected: !1 } }), C(Yg, this) || m(n_, this, p_).call(this, !1));
13723
+ super.unselect(), C($g, this) && ((e = this.parent) == null || e.drawLayer.updateProperties(C($g, this), { rootClass: { selected: !1 } }), C(Xg, this) || m(Z, this, p_).call(this, !1));
13724
13724
  }
13725
13725
  get _mustFixPosition() {
13726
- return !C(Yg, this);
13726
+ return !C(Xg, this);
13727
13727
  }
13728
13728
  show(e = this._isVisible) {
13729
- super.show(e), this.parent && (this.parent.drawLayer.updateProperties(C(Jg, this), { rootClass: { hidden: !e } }), this.parent.drawLayer.updateProperties(C(Qg, this), { rootClass: { hidden: !e } }));
13729
+ super.show(e), this.parent && (this.parent.drawLayer.updateProperties(C(Yg, this), { rootClass: { hidden: !e } }), this.parent.drawLayer.updateProperties(C($g, this), { rootClass: { hidden: !e } }));
13730
13730
  }
13731
13731
  static startHighlighting(t, n, { target: r, x: i, y: a }) {
13732
13732
  let { x: o, y: s, width: c, height: l } = r.getBoundingClientRect(), u = new AbortController(), d = t.combinedSignal(u), f = (n) => {
13733
13733
  u.abort(), m(e, this, v_).call(this, t, n);
13734
13734
  };
13735
- window.addEventListener("blur", f, { signal: d }), window.addEventListener("pointerup", f, { signal: d }), window.addEventListener("pointerdown", Ot, {
13735
+ window.addEventListener("blur", f, { signal: d }), window.addEventListener("pointerup", f, { signal: d }), window.addEventListener("pointerdown", Dt, {
13736
13736
  capture: !0,
13737
13737
  passive: !1,
13738
13738
  signal: d
13739
- }), window.addEventListener("contextmenu", Dt, { signal: d }), r.addEventListener("pointermove", m(e, this, __).bind(this, t), { signal: d }), this._freeHighlight = new Ig({
13739
+ }), window.addEventListener("contextmenu", Et, { signal: d }), r.addEventListener("pointermove", m(e, this, __).bind(this, t), { signal: d }), this._freeHighlight = new Lg({
13740
13740
  x: i,
13741
13741
  y: a
13742
13742
  }, [
@@ -13767,7 +13767,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13767
13767
  var r = () => super.deserialize, i = this;
13768
13768
  return b(function* () {
13769
13769
  let a = null;
13770
- if (e instanceof Qm) {
13770
+ if (e instanceof $m) {
13771
13771
  let { data: { quadPoints: t, rect: n, rotation: r, id: i, color: o, opacity: s, popupRef: c, richText: l, contentsObj: u, creationDate: d, modificationDate: f }, parent: { page: { pageNumber: p } } } = e;
13772
13772
  a = e = {
13773
13773
  annotationType: N.HIGHLIGHT,
@@ -13787,7 +13787,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13787
13787
  creationDate: d,
13788
13788
  modificationDate: f
13789
13789
  };
13790
- } else if (e instanceof Xm) {
13790
+ } else if (e instanceof Zm) {
13791
13791
  let { data: { inkLists: t, rect: n, rotation: r, id: i, color: o, borderStyle: { rawWidth: s }, popupRef: c, richText: l, contentsObj: u, creationDate: d, modificationDate: f }, parent: { page: { pageNumber: p } } } = e;
13792
13792
  a = e = {
13793
13793
  annotationType: N.HIGHLIGHT,
@@ -13809,28 +13809,28 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13809
13809
  };
13810
13810
  }
13811
13811
  let { color: o, quadPoints: s, inkLists: c, outlines: l, opacity: u } = e, d = yield r().call(i, e, t, n);
13812
- d.color = z.makeHexColor(...o), d.opacity = u || 1, c && T(e_, d, e.thickness), d._initialData = a, e.comment && d.setCommentData(e);
13812
+ d.color = z.makeHexColor(...o), d.opacity = u || 1, c && T(t_, d, e.thickness), d._initialData = a, e.comment && d.setCommentData(e);
13813
13813
  let [f, p] = d.pageDimensions, [h, g] = d.pageTranslation;
13814
13814
  if (s) {
13815
- let e = T(Bg, d, []);
13815
+ let e = T(Vg, d, []);
13816
13816
  for (let t = 0; t < s.length; t += 8) e.push({
13817
13817
  x: (s[t] - h) / f,
13818
13818
  y: 1 - (s[t + 1] - g) / p,
13819
13819
  width: (s[t + 2] - s[t]) / f,
13820
13820
  height: (s[t + 1] - s[t + 5]) / p
13821
13821
  });
13822
- m(n_, d, i_).call(d), m(n_, d, u_).call(d), d.rotate(d.rotation);
13822
+ m(Z, d, i_).call(d), m(Z, d, u_).call(d), d.rotate(d.rotation);
13823
13823
  } else if (c || l) {
13824
- T(Yg, d, !0);
13824
+ T(Xg, d, !0);
13825
13825
  let e = (c || l.points)[0], n = {
13826
13826
  x: e[0] - h,
13827
13827
  y: p - (e[1] - g)
13828
- }, r = new Ig(n, [
13828
+ }, r = new Lg(n, [
13829
13829
  0,
13830
13830
  0,
13831
13831
  f,
13832
13832
  p
13833
- ], 1, C(e_, d) / 2, !0, .001);
13833
+ ], 1, C(t_, d) / 2, !0, .001);
13834
13834
  for (let t = 0, i = e.length; t < i; t += 2) n.x = e[t] - h, n.y = p - (e[t + 1] - g), r.add(n);
13835
13835
  let { id: i, clipPathId: a } = t.drawLayer.draw({
13836
13836
  bbox: [
@@ -13850,11 +13850,11 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13850
13850
  },
13851
13851
  path: { d: r.toSVGPath() }
13852
13852
  }, !0, !0);
13853
- m(n_, d, a_).call(d, {
13853
+ m(Z, d, a_).call(d, {
13854
13854
  highlightOutlines: r.getOutlines(),
13855
13855
  highlightId: i,
13856
13856
  clipPathId: a
13857
- }), m(n_, d, u_).call(d), d.rotate(d.parentRotation);
13857
+ }), m(Z, d, u_).call(d), d.rotate(d.parentRotation);
13858
13858
  }
13859
13859
  return d;
13860
13860
  })();
@@ -13866,10 +13866,10 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13866
13866
  return Object.assign(n, {
13867
13867
  color: t,
13868
13868
  opacity: this.opacity,
13869
- thickness: C(e_, this),
13870
- quadPoints: m(n_, this, h_).call(this),
13871
- outlines: m(n_, this, g_).call(this, n.rect)
13872
- }), this.addComment(n), this.annotationElementId && !m(n_, this, y_).call(this, n) ? null : (n.id = this.annotationElementId, n);
13869
+ thickness: C(t_, this),
13870
+ quadPoints: m(Z, this, h_).call(this),
13871
+ outlines: m(Z, this, g_).call(this, n.rect)
13872
+ }), this.addComment(n), this.annotationElementId && !m(Z, this, y_).call(this, n) ? null : (n.id = this.annotationElementId, n);
13873
13873
  }
13874
13874
  renderAnnotationElement(e) {
13875
13875
  return this.deleted ? (e.hide(), null) : (e.updateEdited({
@@ -13883,35 +13883,35 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
13883
13883
  };
13884
13884
  de = r_;
13885
13885
  function i_() {
13886
- let e = new Dg(C(Bg, this), .001);
13887
- T(qg, this, e.getOutlines()), [this.x, this.y, this.width, this.height] = C(qg, this).box;
13888
- let t = new Dg(C(Bg, this), .0025, .001, this._uiManager.direction === "ltr");
13889
- T(Ug, this, t.getOutlines());
13890
- let { firstPoint: n } = C(qg, this);
13891
- T(Xg, this, [(n[0] - this.x) / this.width, (n[1] - this.y) / this.height]);
13892
- let { lastPoint: r } = C(Ug, this);
13893
- T(Zg, this, [(r[0] - this.x) / this.width, (r[1] - this.y) / this.height]);
13886
+ let e = new Og(C(Vg, this), .001);
13887
+ T(Jg, this, e.getOutlines()), [this.x, this.y, this.width, this.height] = C(Jg, this).box;
13888
+ let t = new Og(C(Vg, this), .0025, .001, this._uiManager.direction === "ltr");
13889
+ T(Wg, this, t.getOutlines());
13890
+ let { firstPoint: n } = C(Jg, this);
13891
+ T(Zg, this, [(n[0] - this.x) / this.width, (n[1] - this.y) / this.height]);
13892
+ let { lastPoint: r } = C(Wg, this);
13893
+ T(Qg, this, [(r[0] - this.x) / this.width, (r[1] - this.y) / this.height]);
13894
13894
  }
13895
13895
  function a_({ highlightOutlines: e, highlightId: t, clipPathId: n }) {
13896
- if (T(qg, this, e), T(Ug, this, e.getNewOutline(C(e_, this) / 2 + 1.5, .0025)), t >= 0) T(Jg, this, t), T(Vg, this, n), this.parent.drawLayer.finalizeDraw(t, {
13896
+ if (T(Jg, this, e), T(Wg, this, e.getNewOutline(C(t_, this) / 2 + 1.5, .0025)), t >= 0) T(Yg, this, t), T(Hg, this, n), this.parent.drawLayer.finalizeDraw(t, {
13897
13897
  bbox: e.box,
13898
13898
  path: { d: e.toSVGPath() }
13899
- }), T(Qg, this, this.parent.drawLayer.drawOutline({
13899
+ }), T($g, this, this.parent.drawLayer.drawOutline({
13900
13900
  rootClass: {
13901
13901
  highlightOutline: !0,
13902
13902
  free: !0
13903
13903
  },
13904
- bbox: C(Ug, this).box,
13905
- path: { d: C(Ug, this).toSVGPath() }
13904
+ bbox: C(Wg, this).box,
13905
+ path: { d: C(Wg, this).toSVGPath() }
13906
13906
  }, !0));
13907
13907
  else if (this.parent) {
13908
13908
  let t = this.parent.viewport.rotation;
13909
- this.parent.drawLayer.updateProperties(C(Jg, this), {
13910
- bbox: d_.call(de, C(qg, this).box, (t - this.rotation + 360) % 360),
13909
+ this.parent.drawLayer.updateProperties(C(Yg, this), {
13910
+ bbox: d_.call(de, C(Jg, this).box, (t - this.rotation + 360) % 360),
13911
13911
  path: { d: e.toSVGPath() }
13912
- }), this.parent.drawLayer.updateProperties(C(Qg, this), {
13913
- bbox: d_.call(de, C(Ug, this).box, t),
13914
- path: { d: C(Ug, this).toSVGPath() }
13912
+ }), this.parent.drawLayer.updateProperties(C($g, this), {
13913
+ bbox: d_.call(de, C(Wg, this).box, t),
13914
+ path: { d: C(Wg, this).toSVGPath() }
13915
13915
  });
13916
13916
  }
13917
13917
  let [r, i, a, o] = e.box;
@@ -13934,9 +13934,9 @@ function a_({ highlightOutlines: e, highlightId: t, clipPathId: n }) {
13934
13934
  }
13935
13935
  }
13936
13936
  let { firstPoint: s } = e;
13937
- T(Xg, this, [(s[0] - r) / a, (s[1] - i) / o]);
13938
- let { lastPoint: c } = C(Ug, this);
13939
- T(Zg, this, [(c[0] - r) / a, (c[1] - i) / o]);
13937
+ T(Zg, this, [(s[0] - r) / a, (s[1] - i) / o]);
13938
+ let { lastPoint: c } = C(Wg, this);
13939
+ T(Qg, this, [(c[0] - r) / a, (c[1] - i) / o]);
13940
13940
  }
13941
13941
  function o_(e) {
13942
13942
  let t = (e, t) => {
@@ -13956,8 +13956,8 @@ function o_(e) {
13956
13956
  }, !0);
13957
13957
  }
13958
13958
  function s_(e) {
13959
- let t = C(e_, this), n = (e) => {
13960
- T(e_, this, e), m(n_, this, c_).call(this, e);
13959
+ let t = C(t_, this), n = (e) => {
13960
+ T(t_, this, e), m(Z, this, c_).call(this, e);
13961
13961
  };
13962
13962
  this.addCommands({
13963
13963
  cmd: n.bind(this, e),
@@ -13973,14 +13973,14 @@ function s_(e) {
13973
13973
  }, !0);
13974
13974
  }
13975
13975
  function c_(e) {
13976
- C(Yg, this) && (m(n_, this, a_).call(this, { highlightOutlines: C(qg, this).getNewOutline(e / 2) }), this.fixAndSetPosition(), this.setDims());
13976
+ C(Xg, this) && (m(Z, this, a_).call(this, { highlightOutlines: C(Jg, this).getNewOutline(e / 2) }), this.fixAndSetPosition(), this.setDims());
13977
13977
  }
13978
13978
  function l_() {
13979
- C(Jg, this) === null || !this.parent || (this.parent.drawLayer.remove(C(Jg, this)), T(Jg, this, null), this.parent.drawLayer.remove(C(Qg, this)), T(Qg, this, null));
13979
+ C(Yg, this) === null || !this.parent || (this.parent.drawLayer.remove(C(Yg, this)), T(Yg, this, null), this.parent.drawLayer.remove(C($g, this)), T($g, this, null));
13980
13980
  }
13981
13981
  function u_(e = this.parent) {
13982
- C(Jg, this) === null && ({id: k(T, [Jg, this])._, clipPathId: k(T, [Vg, this])._} = e.drawLayer.draw({
13983
- bbox: C(qg, this).box,
13982
+ C(Yg, this) === null && ({id: k(T, [Yg, this])._, clipPathId: k(T, [Hg, this])._} = e.drawLayer.draw({
13983
+ bbox: C(Jg, this).box,
13984
13984
  root: {
13985
13985
  viewBox: "0 0 1 1",
13986
13986
  fill: this.color,
@@ -13988,17 +13988,17 @@ function u_(e = this.parent) {
13988
13988
  },
13989
13989
  rootClass: {
13990
13990
  highlight: !0,
13991
- free: C(Yg, this)
13991
+ free: C(Xg, this)
13992
13992
  },
13993
- path: { d: C(qg, this).toSVGPath() }
13994
- }, !1, !0), T(Qg, this, e.drawLayer.drawOutline({
13993
+ path: { d: C(Jg, this).toSVGPath() }
13994
+ }, !1, !0), T($g, this, e.drawLayer.drawOutline({
13995
13995
  rootClass: {
13996
13996
  highlightOutline: !0,
13997
- free: C(Yg, this)
13997
+ free: C(Xg, this)
13998
13998
  },
13999
- bbox: C(Ug, this).box,
14000
- path: { d: C(Ug, this).toSVGPath() }
14001
- }, C(Yg, this))), C(Kg, this) && (C(Kg, this).style.clipPath = C(Vg, this)));
13999
+ bbox: C(Wg, this).box,
14000
+ path: { d: C(Wg, this).toSVGPath() }
14001
+ }, C(Xg, this))), C(qg, this) && (C(qg, this).style.clipPath = C(Hg, this)));
14002
14002
  }
14003
14003
  function d_([e, t, n, r], i) {
14004
14004
  switch (i) {
@@ -14032,16 +14032,16 @@ function f_(e) {
14032
14032
  de._keyboardManager.exec(this, e);
14033
14033
  }
14034
14034
  function p_(e) {
14035
- if (!C(Rg, this)) return;
14035
+ if (!C(zg, this)) return;
14036
14036
  let t = window.getSelection();
14037
- e ? t.setPosition(C(Rg, this), C(zg, this)) : t.setPosition(C(Wg, this), C(Gg, this));
14037
+ e ? t.setPosition(C(zg, this), C(Bg, this)) : t.setPosition(C(Gg, this), C(Kg, this));
14038
14038
  }
14039
14039
  function m_() {
14040
- return C(Yg, this) ? this.rotation : 0;
14040
+ return C(Xg, this) ? this.rotation : 0;
14041
14041
  }
14042
14042
  function h_() {
14043
- if (C(Yg, this)) return null;
14044
- let [e, t] = this.pageDimensions, [n, r] = this.pageTranslation, i = C(Bg, this), a = new Float32Array(i.length * 8), o = 0;
14043
+ if (C(Xg, this)) return null;
14044
+ let [e, t] = this.pageDimensions, [n, r] = this.pageTranslation, i = C(Vg, this), a = new Float32Array(i.length * 8), o = 0;
14045
14045
  for (let { x: s, y: c, width: l, height: u } of i) {
14046
14046
  let i = s * e + n, d = (1 - c) * t + r;
14047
14047
  a[o] = a[o + 4] = i, a[o + 1] = a[o + 3] = d, a[o + 2] = a[o + 6] = i + l * e, a[o + 5] = a[o + 7] = d - u * t, o += 8;
@@ -14049,7 +14049,7 @@ function h_() {
14049
14049
  return a;
14050
14050
  }
14051
14051
  function g_(e) {
14052
- return C(qg, this).serialize(e, m(n_, this, m_).call(this));
14052
+ return C(Jg, this).serialize(e, m(Z, this, m_).call(this));
14053
14053
  }
14054
14054
  function __(e, t) {
14055
14055
  this._freeHighlight.add(t) && e.drawLayer.updateProperties(this._freeHighlightId, { path: { d: this._freeHighlight.toSVGPath() } });
@@ -14266,8 +14266,8 @@ var b_ = /* @__PURE__ */ new WeakMap(), x_ = class {
14266
14266
  capture: !0,
14267
14267
  passive: !1,
14268
14268
  signal: m
14269
- }), window.addEventListener("contextmenu", Dt, { signal: m }), a.addEventListener("pointermove", this._drawMove.bind(this), { signal: m }), a.addEventListener("touchmove", (e) => {
14270
- Sn.isSameTimeStamp(e.timeStamp) && Ot(e);
14269
+ }), window.addEventListener("contextmenu", Et, { signal: m }), a.addEventListener("pointermove", this._drawMove.bind(this), { signal: m }), a.addEventListener("touchmove", (e) => {
14270
+ Sn.isSameTimeStamp(e.timeStamp) && Dt(e);
14271
14271
  }, { signal: m }), e.toggleDrawing(), (i = t._editorUndoBar) == null || i.hide(), P_._) {
14272
14272
  e.drawLayer.updateProperties(this._currentDrawId, P_._.startNew(o, s, d, f, u));
14273
14273
  return;
@@ -14282,7 +14282,7 @@ var b_ = /* @__PURE__ */ new WeakMap(), x_ = class {
14282
14282
  this._endDraw(e);
14283
14283
  return;
14284
14284
  }
14285
- this._currentParent.drawLayer.updateProperties(this._currentDrawId, P_._.add(t, n)), Sn.setTimeStamp(e.timeStamp), Ot(e);
14285
+ this._currentParent.drawLayer.updateProperties(this._currentDrawId, P_._.add(t, n)), Sn.setTimeStamp(e.timeStamp), Dt(e);
14286
14286
  }
14287
14287
  }
14288
14288
  static _cleanup(e) {
@@ -14578,7 +14578,7 @@ var L_ = /* @__PURE__ */ new WeakMap(), R_ = /* @__PURE__ */ new WeakMap(), z_ =
14578
14578
  a,
14579
14579
  e,
14580
14580
  t
14581
- ], 0), C(R_, this).push(...X.createBezierPoints(n, r, i, a, e, t)), { path: { d: this.toSVGPath() } }));
14581
+ ], 0), C(R_, this).push(...Y.createBezierPoints(n, r, i, a, e, t)), { path: { d: this.toSVGPath() } }));
14582
14582
  }
14583
14583
  end(e, t) {
14584
14584
  return this.add(e, t) || (C(H_, this).length === 2 ? { path: { d: this.toSVGPath() } } : null);
@@ -14616,20 +14616,20 @@ var L_ = /* @__PURE__ */ new WeakMap(), R_ = /* @__PURE__ */ new WeakMap(), z_ =
14616
14616
  return { path: { d: C(U_, this) } };
14617
14617
  }
14618
14618
  toSVGPath() {
14619
- let e = X.svgRound(C(R_, this)[4]), t = X.svgRound(C(R_, this)[5]);
14619
+ let e = Y.svgRound(C(R_, this)[4]), t = Y.svgRound(C(R_, this)[5]);
14620
14620
  if (C(H_, this).length === 2) return T(U_, this, `${C(U_, this)} M ${e} ${t} Z`), C(U_, this);
14621
14621
  if (C(H_, this).length <= 6) {
14622
14622
  let n = C(U_, this).lastIndexOf("M");
14623
14623
  T(U_, this, `${C(U_, this).slice(0, n)} M ${e} ${t}`), T(W_, this, 6);
14624
14624
  }
14625
14625
  if (C(H_, this).length === 4) {
14626
- let e = X.svgRound(C(R_, this)[10]), t = X.svgRound(C(R_, this)[11]);
14626
+ let e = Y.svgRound(C(R_, this)[10]), t = Y.svgRound(C(R_, this)[11]);
14627
14627
  return T(U_, this, `${C(U_, this)} L ${e} ${t}`), T(W_, this, 12), C(U_, this);
14628
14628
  }
14629
14629
  let n = [];
14630
14630
  C(W_, this) === 0 && (n.push(`M ${e} ${t}`), T(W_, this, 6));
14631
14631
  for (let e = C(W_, this), t = C(R_, this).length; e < t; e += 6) {
14632
- let [t, r, i, a, o, s] = C(R_, this).slice(e, e + 6).map(X.svgRound);
14632
+ let [t, r, i, a, o, s] = C(R_, this).slice(e, e + 6).map(Y.svgRound);
14633
14633
  n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`);
14634
14634
  }
14635
14635
  return T(U_, this, C(U_, this) + n.join(" ")), T(W_, this, C(R_, this).length), C(U_, this);
@@ -14652,9 +14652,9 @@ var L_ = /* @__PURE__ */ new WeakMap(), R_ = /* @__PURE__ */ new WeakMap(), z_ =
14652
14652
  }
14653
14653
  };
14654
14654
  function X_(e, t) {
14655
- return X._normalizePoint(e, t, C(K_, this), C(q_, this), C(B_, this));
14655
+ return Y._normalizePoint(e, t, C(K_, this), C(q_, this), C(B_, this));
14656
14656
  }
14657
- var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ = /* @__PURE__ */ new WeakMap(), ev = /* @__PURE__ */ new WeakMap(), tv = /* @__PURE__ */ new WeakMap(), nv = /* @__PURE__ */ new WeakMap(), rv = /* @__PURE__ */ new WeakMap(), iv = /* @__PURE__ */ new WeakMap(), av = /* @__PURE__ */ new WeakMap(), ov = /* @__PURE__ */ new WeakSet(), sv = class extends X {
14657
+ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ = /* @__PURE__ */ new WeakMap(), ev = /* @__PURE__ */ new WeakMap(), tv = /* @__PURE__ */ new WeakMap(), nv = /* @__PURE__ */ new WeakMap(), rv = /* @__PURE__ */ new WeakMap(), iv = /* @__PURE__ */ new WeakMap(), av = /* @__PURE__ */ new WeakMap(), ov = /* @__PURE__ */ new WeakSet(), sv = class extends Y {
14658
14658
  constructor(...e) {
14659
14659
  super(...e), w(this, ov), S(this, Z_, void 0), S(this, Q_, 0), S(this, $_, void 0), S(this, ev, void 0), S(this, tv, void 0), S(this, nv, void 0), S(this, rv, void 0), S(this, iv, void 0), S(this, av, void 0);
14660
14660
  }
@@ -14673,16 +14673,16 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14673
14673
  toSVGPath() {
14674
14674
  let e = [];
14675
14675
  for (let { line: t } of C(ev, this)) {
14676
- if (e.push(`M${X.svgRound(t[4])} ${X.svgRound(t[5])}`), t.length === 6) {
14676
+ if (e.push(`M${Y.svgRound(t[4])} ${Y.svgRound(t[5])}`), t.length === 6) {
14677
14677
  e.push("Z");
14678
14678
  continue;
14679
14679
  }
14680
14680
  if (t.length === 12 && isNaN(t[6])) {
14681
- e.push(`L${X.svgRound(t[10])} ${X.svgRound(t[11])}`);
14681
+ e.push(`L${Y.svgRound(t[10])} ${Y.svgRound(t[11])}`);
14682
14682
  continue;
14683
14683
  }
14684
14684
  for (let n = 6, r = t.length; n < r; n += 6) {
14685
- let [r, i, a, o, s, c] = t.subarray(n, n + 6).map(X.svgRound);
14685
+ let [r, i, a, o, s, c] = t.subarray(n, n + 6).map(Y.svgRound);
14686
14686
  e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`);
14687
14687
  }
14688
14688
  }
@@ -14692,16 +14692,16 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14692
14692
  let a = [], o = [], [s, c, l, u] = m(ov, this, lv).call(this), d, f, p, h, g, _, v, y, b;
14693
14693
  switch (C(iv, this)) {
14694
14694
  case 0:
14695
- b = X._rescale, d = e, f = t + r, p = n, h = -r, g = e + s * n, _ = t + (1 - c - u) * r, v = e + (s + l) * n, y = t + (1 - c) * r;
14695
+ b = Y._rescale, d = e, f = t + r, p = n, h = -r, g = e + s * n, _ = t + (1 - c - u) * r, v = e + (s + l) * n, y = t + (1 - c) * r;
14696
14696
  break;
14697
14697
  case 90:
14698
- b = X._rescaleAndSwap, d = e, f = t, p = n, h = r, g = e + c * n, _ = t + s * r, v = e + (c + u) * n, y = t + (s + l) * r;
14698
+ b = Y._rescaleAndSwap, d = e, f = t, p = n, h = r, g = e + c * n, _ = t + s * r, v = e + (c + u) * n, y = t + (s + l) * r;
14699
14699
  break;
14700
14700
  case 180:
14701
- b = X._rescale, d = e + n, f = t, p = -n, h = r, g = e + (1 - s - l) * n, _ = t + c * r, v = e + (1 - s) * n, y = t + (c + u) * r;
14701
+ b = Y._rescale, d = e + n, f = t, p = -n, h = r, g = e + (1 - s - l) * n, _ = t + c * r, v = e + (1 - s) * n, y = t + (c + u) * r;
14702
14702
  break;
14703
14703
  case 270:
14704
- b = X._rescaleAndSwap, d = e + n, f = t + r, p = -n, h = -r, g = e + (1 - c - u) * n, _ = t + (1 - s - l) * r, v = e + (1 - c) * n, y = t + (1 - s) * r;
14704
+ b = Y._rescaleAndSwap, d = e + n, f = t + r, p = -n, h = -r, g = e + (1 - c - u) * n, _ = t + (1 - s - l) * r, v = e + (1 - c) * n, y = t + (1 - s) * r;
14705
14705
  break;
14706
14706
  }
14707
14707
  for (let { line: e, points: t } of C(ev, this)) a.push(b(e, d, f, p, h, i ? Array(e.length) : null)), o.push(b(t, d, f, p, h, i ? Array(t.length) : null));
@@ -14720,16 +14720,16 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14720
14720
  let l = [], u, d, f, p, m;
14721
14721
  switch (s) {
14722
14722
  case 0:
14723
- m = X._rescale, u = -e / n, d = t / r + 1, f = 1 / n, p = -1 / r;
14723
+ m = Y._rescale, u = -e / n, d = t / r + 1, f = 1 / n, p = -1 / r;
14724
14724
  break;
14725
14725
  case 90:
14726
- m = X._rescaleAndSwap, u = -t / r, d = -e / n, f = 1 / r, p = 1 / n;
14726
+ m = Y._rescaleAndSwap, u = -t / r, d = -e / n, f = 1 / r, p = 1 / n;
14727
14727
  break;
14728
14728
  case 180:
14729
- m = X._rescale, u = e / n + 1, d = -t / r, f = -1 / n, p = 1 / r;
14729
+ m = Y._rescale, u = e / n + 1, d = -t / r, f = -1 / n, p = 1 / r;
14730
14730
  break;
14731
14731
  case 270:
14732
- m = X._rescaleAndSwap, u = t / r + 1, d = e / n + 1, f = -1 / r, p = -1 / n;
14732
+ m = Y._rescaleAndSwap, u = t / r + 1, d = e / n + 1, f = -1 / r, p = -1 / n;
14733
14733
  break;
14734
14734
  }
14735
14735
  if (!a) {
@@ -14777,7 +14777,7 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14777
14777
  ], 0);
14778
14778
  for (let a = 4; a < t; a += 2) {
14779
14779
  let t = e[a], c = e[a + 1];
14780
- n.set(X.createBezierPoints(r, i, o, s, t, c), (a - 2) * 3), [r, i, o, s] = [
14780
+ n.set(Y.createBezierPoints(r, i, o, s, t, c), (a - 2) * 3), [r, i, o, s] = [
14781
14781
  o,
14782
14782
  s,
14783
14783
  t,
@@ -14809,13 +14809,13 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14809
14809
  return T(Q_, this, e), { path: { transform: this.rotationTransform } };
14810
14810
  }
14811
14811
  get viewBox() {
14812
- return C(Z_, this).map(X.svgRound).join(" ");
14812
+ return C(Z_, this).map(Y.svgRound).join(" ");
14813
14813
  }
14814
14814
  get defaultProperties() {
14815
14815
  let [e, t] = C(Z_, this);
14816
14816
  return {
14817
14817
  root: { viewBox: this.viewBox },
14818
- path: { "transform-origin": `${X.svgRound(e)} ${X.svgRound(t)}` }
14818
+ path: { "transform-origin": `${Y.svgRound(e)} ${Y.svgRound(t)}` }
14819
14819
  };
14820
14820
  }
14821
14821
  get rotationTransform() {
@@ -14832,43 +14832,43 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14832
14832
  break;
14833
14833
  default: return "";
14834
14834
  }
14835
- return `matrix(${n} ${r} ${i} ${a} ${X.svgRound(o)} ${X.svgRound(s)})`;
14835
+ return `matrix(${n} ${r} ${i} ${a} ${Y.svgRound(o)} ${Y.svgRound(s)})`;
14836
14836
  }
14837
14837
  getPathResizingSVGProperties([e, t, n, r]) {
14838
14838
  let [i, a] = m(ov, this, cv).call(this), [o, s, c, l] = C(Z_, this);
14839
- if (Math.abs(c - i) <= X.PRECISION || Math.abs(l - a) <= X.PRECISION) {
14839
+ if (Math.abs(c - i) <= Y.PRECISION || Math.abs(l - a) <= Y.PRECISION) {
14840
14840
  let i = e + n / 2 - (o + c / 2), a = t + r / 2 - (s + l / 2);
14841
14841
  return { path: {
14842
- "transform-origin": `${X.svgRound(e)} ${X.svgRound(t)}`,
14842
+ "transform-origin": `${Y.svgRound(e)} ${Y.svgRound(t)}`,
14843
14843
  transform: `${this.rotationTransform} translate(${i} ${a})`
14844
14844
  } };
14845
14845
  }
14846
14846
  let u = (n - 2 * i) / (c - 2 * i), d = (r - 2 * a) / (l - 2 * a), f = c / n, p = l / r;
14847
14847
  return { path: {
14848
- "transform-origin": `${X.svgRound(o)} ${X.svgRound(s)}`,
14849
- transform: `${this.rotationTransform} scale(${f} ${p}) translate(${X.svgRound(i)} ${X.svgRound(a)}) scale(${u} ${d}) translate(${X.svgRound(-i)} ${X.svgRound(-a)})`
14848
+ "transform-origin": `${Y.svgRound(o)} ${Y.svgRound(s)}`,
14849
+ transform: `${this.rotationTransform} scale(${f} ${p}) translate(${Y.svgRound(i)} ${Y.svgRound(a)}) scale(${u} ${d}) translate(${Y.svgRound(-i)} ${Y.svgRound(-a)})`
14850
14850
  } };
14851
14851
  }
14852
14852
  getPathResizedSVGProperties([e, t, n, r]) {
14853
14853
  let [i, a] = m(ov, this, cv).call(this), o = C(Z_, this), [s, c, l, u] = o;
14854
- if (o[0] = e, o[1] = t, o[2] = n, o[3] = r, Math.abs(l - i) <= X.PRECISION || Math.abs(u - a) <= X.PRECISION) {
14854
+ if (o[0] = e, o[1] = t, o[2] = n, o[3] = r, Math.abs(l - i) <= Y.PRECISION || Math.abs(u - a) <= Y.PRECISION) {
14855
14855
  let i = e + n / 2 - (s + l / 2), a = t + r / 2 - (c + u / 2);
14856
- for (let { line: e, points: t } of C(ev, this)) X._translate(e, i, a, e), X._translate(t, i, a, t);
14856
+ for (let { line: e, points: t } of C(ev, this)) Y._translate(e, i, a, e), Y._translate(t, i, a, t);
14857
14857
  return {
14858
14858
  root: { viewBox: this.viewBox },
14859
14859
  path: {
14860
- "transform-origin": `${X.svgRound(e)} ${X.svgRound(t)}`,
14860
+ "transform-origin": `${Y.svgRound(e)} ${Y.svgRound(t)}`,
14861
14861
  transform: this.rotationTransform || null,
14862
14862
  d: this.toSVGPath()
14863
14863
  }
14864
14864
  };
14865
14865
  }
14866
14866
  let d = (n - 2 * i) / (l - 2 * i), f = (r - 2 * a) / (u - 2 * a), p = -d * (s + i) + e + i, h = -f * (c + a) + t + a;
14867
- if (d !== 1 || f !== 1 || p !== 0 || h !== 0) for (let { line: e, points: t } of C(ev, this)) X._rescale(e, p, h, d, f, e), X._rescale(t, p, h, d, f, t);
14867
+ if (d !== 1 || f !== 1 || p !== 0 || h !== 0) for (let { line: e, points: t } of C(ev, this)) Y._rescale(e, p, h, d, f, e), Y._rescale(t, p, h, d, f, t);
14868
14868
  return {
14869
14869
  root: { viewBox: this.viewBox },
14870
14870
  path: {
14871
- "transform-origin": `${X.svgRound(e)} ${X.svgRound(t)}`,
14871
+ "transform-origin": `${Y.svgRound(e)} ${Y.svgRound(t)}`,
14872
14872
  transform: this.rotationTransform || null,
14873
14873
  d: this.toSVGPath()
14874
14874
  }
@@ -14876,18 +14876,18 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14876
14876
  }
14877
14877
  getPathTranslatedSVGProperties([e, t], n) {
14878
14878
  let [r, i] = n, a = C(Z_, this), o = e - a[0], s = t - a[1];
14879
- if (C(tv, this) === r && C(nv, this) === i) for (let { line: e, points: t } of C(ev, this)) X._translate(e, o, s, e), X._translate(t, o, s, t);
14879
+ if (C(tv, this) === r && C(nv, this) === i) for (let { line: e, points: t } of C(ev, this)) Y._translate(e, o, s, e), Y._translate(t, o, s, t);
14880
14880
  else {
14881
14881
  let e = C(tv, this) / r, t = C(nv, this) / i;
14882
14882
  T(tv, this, r), T(nv, this, i);
14883
- for (let { line: n, points: r } of C(ev, this)) X._rescale(n, o, s, e, t, n), X._rescale(r, o, s, e, t, r);
14883
+ for (let { line: n, points: r } of C(ev, this)) Y._rescale(n, o, s, e, t, n), Y._rescale(r, o, s, e, t, r);
14884
14884
  a[2] *= e, a[3] *= t;
14885
14885
  }
14886
14886
  return a[0] = e, a[1] = t, {
14887
14887
  root: { viewBox: this.viewBox },
14888
14888
  path: {
14889
14889
  d: this.toSVGPath(),
14890
- "transform-origin": `${X.svgRound(e)} ${X.svgRound(t)}`
14890
+ "transform-origin": `${Y.svgRound(e)} ${Y.svgRound(t)}`
14891
14891
  }
14892
14892
  };
14893
14893
  }
@@ -14898,7 +14898,7 @@ var Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakMap(), $_ =
14898
14898
  rootClass: { draw: !0 },
14899
14899
  path: {
14900
14900
  d: this.toSVGPath(),
14901
- "transform-origin": `${X.svgRound(e[0])} ${X.svgRound(e[1])}`,
14901
+ "transform-origin": `${Y.svgRound(e[0])} ${Y.svgRound(e[1])}`,
14902
14902
  transform: this.rotationTransform || null
14903
14903
  },
14904
14904
  bbox: e
@@ -14932,7 +14932,7 @@ function uv() {
14932
14932
  }
14933
14933
  }
14934
14934
  let [t, n] = m(ov, this, cv).call(this);
14935
- e[0] = ft(e[0] - t, 0, 1), e[1] = ft(e[1] - n, 0, 1), e[2] = ft(e[2] + t, 0, 1), e[3] = ft(e[3] + n, 0, 1), e[2] -= e[0], e[3] -= e[1];
14935
+ e[0] = B(e[0] - t, 0, 1), e[1] = B(e[1] - n, 0, 1), e[2] = B(e[2] + t, 0, 1), e[3] = B(e[3] + n, 0, 1), e[2] -= e[0], e[3] -= e[1];
14936
14936
  }
14937
14937
  function dv(e) {
14938
14938
  let [t, n] = m(ov, this, cv).call(this);
@@ -14990,7 +14990,7 @@ var fv = class e extends x_ {
14990
14990
  var r = () => super.deserialize, i = this;
14991
14991
  return b(function* () {
14992
14992
  let a = null;
14993
- if (e instanceof Xm) {
14993
+ if (e instanceof Zm) {
14994
14994
  let { data: { inkLists: t, rect: n, rotation: r, id: i, color: o, opacity: s, borderStyle: { rawWidth: c }, popupRef: l, richText: u, contentsObj: d, creationDate: f, modificationDate: p }, parent: { page: { pageNumber: m } } } = e;
14995
14995
  a = e = {
14996
14996
  annotationType: N.INK,
@@ -15177,7 +15177,7 @@ var gv = class extends sv {
15177
15177
  ], 0);
15178
15178
  for (let e = 4; e < r; e += 2) {
15179
15179
  let t = i[e] = n[e] * g, r = i[e + 1] = n[e + 1] * _;
15180
- a.set(X.createBezierPoints(s, c, l, u, t, r), (e - 2) * 3), [s, c, l, u] = [
15180
+ a.set(Y.createBezierPoints(s, c, l, u, t, r), (e - 2) * 3), [s, c, l, u] = [
15181
15181
  l,
15182
15182
  u,
15183
15183
  t,
@@ -15800,7 +15800,7 @@ var Bv = /* @__PURE__ */ new WeakMap(), Vv = /* @__PURE__ */ new WeakMap(), Hv =
15800
15800
  var r = () => super.deserialize, i = this;
15801
15801
  return b(function* () {
15802
15802
  let a = null, o = !1;
15803
- if (e instanceof nh) {
15803
+ if (e instanceof rh) {
15804
15804
  var s;
15805
15805
  let { data: { rect: r, rotation: i, id: c, structParent: l, popupRef: u, richText: d, contentsObj: f, creationDate: p, modificationDate: m }, container: h, parent: { page: { pageNumber: g } }, canvas: _ } = e, v, y;
15806
15806
  _ ? (delete e.canvas, {id: v, bitmap: y} = n.imageManager.getFromCanvas(h.id, _), _.remove()) : (o = !0, e._hasNoCanvas = !0);
@@ -15981,7 +15981,7 @@ function ay(e) {
15981
15981
  return {width: e.width, height: e.height} = C(Bv, this), e.getContext("2d").drawImage(C(Bv, this), 0, 0), e.toDataURL();
15982
15982
  }
15983
15983
  if (C(Yv, this)) {
15984
- let [e, t] = this.pageDimensions, n = Math.round(this.width * e * gt.PDF_TO_CSS_UNITS), r = Math.round(this.height * t * gt.PDF_TO_CSS_UNITS), i = new OffscreenCanvas(n, r);
15984
+ let [e, t] = this.pageDimensions, n = Math.round(this.width * e * ht.PDF_TO_CSS_UNITS), r = Math.round(this.height * t * ht.PDF_TO_CSS_UNITS), i = new OffscreenCanvas(n, r);
15985
15985
  return i.getContext("2d").drawImage(C(Bv, this), 0, 0, C(Bv, this).width, C(Bv, this).height, 0, 0, n, r), i.transferToImageBitmap();
15986
15986
  }
15987
15987
  return structuredClone(C(Bv, this));
@@ -16100,7 +16100,7 @@ var sy = /* @__PURE__ */ new WeakMap(), cy = /* @__PURE__ */ new WeakMap(), ly =
16100
16100
  }
16101
16101
  if (!o) return;
16102
16102
  let c = C(fy, this).get(o);
16103
- (c == null ? void 0 : c.annotationElementId) === null && (Ot(e), c.dblclick(e));
16103
+ (c == null ? void 0 : c.annotationElementId) === null && (Dt(e), c.dblclick(e));
16104
16104
  }, {
16105
16105
  signal: e,
16106
16106
  capture: !0
@@ -16415,7 +16415,7 @@ function ky() {
16415
16415
  }
16416
16416
  v(Cy, "_initialized", !1);
16417
16417
  var Ay = { _: new Map([
16418
- Mh,
16418
+ Nh,
16419
16419
  mv,
16420
16420
  Qv,
16421
16421
  r_,
@@ -16561,31 +16561,31 @@ var Fy = /* @__PURE__ */ new WeakMap(), Iy = /* @__PURE__ */ new WeakMap(), Ly =
16561
16561
  }
16562
16562
  }
16563
16563
  };
16564
- M = Uy;
16564
+ me = Uy;
16565
16565
  function Wy(e) {
16566
- let t = m(M, this, ib)._.get(e);
16567
- t != null && t.selectionDiv && (t.selectionDiv.remove(), m(M, this, tb)._.delete(t.selectionDiv), t.selectionDiv = null, t.path = null);
16566
+ let t = m(me, this, ib)._.get(e);
16567
+ t != null && t.selectionDiv && (t.selectionDiv.remove(), m(me, this, tb)._.delete(t.selectionDiv), t.selectionDiv = null, t.path = null);
16568
16568
  }
16569
16569
  function Gy() {
16570
16570
  let e = document.getSelection();
16571
16571
  return !!e && !e.isCollapsed;
16572
16572
  }
16573
16573
  function Ky() {
16574
- return [...m(M, this, rb)._].filter((e) => e.isConnected).sort(jy);
16574
+ return [...m(me, this, rb)._].filter((e) => e.isConnected).sort(jy);
16575
16575
  }
16576
16576
  function qy() {
16577
16577
  let e = document.getSelection();
16578
16578
  if (!e || e.isCollapsed) {
16579
- for (let e of m(M, this, tb)._) e.remove();
16580
- m(M, this, tb)._.clear();
16579
+ for (let e of m(me, this, tb)._) e.remove();
16580
+ m(me, this, tb)._.clear();
16581
16581
  return;
16582
16582
  }
16583
- let t = /* @__PURE__ */ new WeakMap(), n = m(M, this, Ky).call(this), r = [];
16583
+ let t = /* @__PURE__ */ new WeakMap(), n = m(me, this, Ky).call(this), r = [];
16584
16584
  for (let t = 0, i = e.rangeCount; t < i; t++) {
16585
16585
  let i = e.getRangeAt(t);
16586
16586
  if (i.collapsed) continue;
16587
16587
  let { startContainer: a, startOffset: o, endContainer: s, endOffset: c } = i, l = My(a), u = My(s), d = l === null, f = u === null;
16588
- if (m(M, this, nb)._ && d !== f) return;
16588
+ if (m(me, this, nb)._ && d !== f) return;
16589
16589
  if (e.rangeCount === 1) {
16590
16590
  let { anchorNode: t, anchorOffset: n, focusNode: r, focusOffset: i } = e, d = My(t), f = My(r), p = Ny(t, n, r, i);
16591
16591
  d && f && p !== null && (p ? (a = t, o = n, l = d, s = r, c = i, u = f) : (a = r, o = i, l = f, s = t, c = n, u = d));
@@ -16631,7 +16631,7 @@ function qy() {
16631
16631
  }
16632
16632
  }
16633
16633
  let i = new Set(r.map((e) => e[1]));
16634
- for (let e of m(M, this, rb)._) i.has(e) || m(M, this, Wy).call(this, e);
16634
+ for (let e of m(me, this, rb)._) i.has(e) || m(me, this, Wy).call(this, e);
16635
16635
  for (let [e, n] of r) {
16636
16636
  let r = ib._.get(n);
16637
16637
  if (!r) continue;
@@ -16655,12 +16655,12 @@ function qy() {
16655
16655
  u = document.createElement("div"), u.className = "selection", u.style.clipPath = `url(#${e})`;
16656
16656
  let t = (s = C(Ry, l)) == null ? void 0 : s.createSelectionStyle(C(zy, l));
16657
16657
  if (t) for (let [e, n] of Object.entries(t)) u.style.setProperty(e, n);
16658
- let n = M._svgFactory.create(1, 1, !0);
16658
+ let n = me._svgFactory.create(1, 1, !0);
16659
16659
  n.setAttribute("aria-hidden", "true"), n.setAttribute("width", "100%"), n.setAttribute("height", "100%");
16660
- let i = M._svgFactory.createElement("clipPath");
16661
- i.setAttribute("id", e), i.setAttribute("clipPathUnits", "objectBoundingBox"), d = M._svgFactory.createElement("path"), i.append(d), n.append(i), u.append(n), r.path = d, r.selectionDiv = u;
16660
+ let i = me._svgFactory.createElement("clipPath");
16661
+ i.setAttribute("id", e), i.setAttribute("clipPathUnits", "objectBoundingBox"), d = me._svgFactory.createElement("path"), i.append(d), n.append(i), u.append(n), r.path = d, r.selectionDiv = u;
16662
16662
  }
16663
- !u.parentNode && C(Fy, l) && (C(Fy, l).append(u), m(M, this, tb)._.add(u)), d.setAttribute("d", c.join(" "));
16663
+ !u.parentNode && C(Fy, l) && (C(Fy, l).append(u), m(me, this, tb)._.add(u)), d.setAttribute("d", c.join(" "));
16664
16664
  }
16665
16665
  }
16666
16666
  function Jy(e, [t, n, r, i]) {
@@ -16668,15 +16668,15 @@ function Jy(e, [t, n, r, i]) {
16668
16668
  a.top = `${100 * n}%`, a.left = `${100 * t}%`, a.width = `${100 * r}%`, a.height = `${100 * i}%`;
16669
16669
  }
16670
16670
  function Yy() {
16671
- let e = M._svgFactory.create(1, 1, !0);
16671
+ let e = me._svgFactory.create(1, 1, !0);
16672
16672
  return C(Fy, this).append(e), e.setAttribute("aria-hidden", "true"), e;
16673
16673
  }
16674
16674
  function Xy(e, t) {
16675
- let n = M._svgFactory.createElement("clipPath");
16675
+ let n = me._svgFactory.createElement("clipPath");
16676
16676
  e.append(n);
16677
16677
  let r = `clip_${t}`;
16678
16678
  n.setAttribute("id", r), n.setAttribute("clipPathUnits", "objectBoundingBox");
16679
- let i = M._svgFactory.createElement("use");
16679
+ let i = me._svgFactory.createElement("use");
16680
16680
  return n.append(i), i.setAttribute("href", `#${t}`), i.classList.add("clip"), r;
16681
16681
  }
16682
16682
  function Zy(e, t) {
@@ -16741,13 +16741,13 @@ function mb([e, t, n, r, i, a]) {
16741
16741
  }), u;
16742
16742
  }
16743
16743
  var hb = { _: null };
16744
- globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib = {
16744
+ globalThis._pdfjsTestingUtils = { HighlightOutliner: Og }, globalThis.pdfjsLib = {
16745
16745
  AbortException: Qe,
16746
16746
  AnnotationEditorLayer: Cy,
16747
16747
  AnnotationEditorParamsType: P,
16748
16748
  AnnotationEditorType: N,
16749
16749
  AnnotationEditorUIManager: Br,
16750
- AnnotationLayer: Ch,
16750
+ AnnotationLayer: wh,
16751
16751
  AnnotationMode: Te,
16752
16752
  AnnotationType: je,
16753
16753
  applyOpacity: Bt,
@@ -16758,42 +16758,42 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib =
16758
16758
  DOMSVGFactory: Sp,
16759
16759
  DrawLayer: Uy,
16760
16760
  FeatureTest: R,
16761
- fetchData: _t,
16761
+ fetchData: gt,
16762
16762
  findContrastColor: Kt,
16763
16763
  getDocument: rf,
16764
- getFilenameFromUrl: St,
16765
- getPdfFilenameFromUrl: Ct,
16766
- getRGB: Mt,
16767
- getRGBA: jt,
16764
+ getFilenameFromUrl: xt,
16765
+ getPdfFilenameFromUrl: St,
16766
+ getRGB: jt,
16767
+ getRGBA: At,
16768
16768
  getUuid: st,
16769
16769
  GlobalWorkerOptions: Hu,
16770
16770
  ImageKind: Ae,
16771
16771
  InvalidPDFException: Ye,
16772
- isDataScheme: bt,
16773
- isPdfFile: xt,
16772
+ isDataScheme: yt,
16773
+ isPdfFile: bt,
16774
16774
  isValidExplicitDest: Is,
16775
16775
  makeArr: lt,
16776
16776
  makeMap: ut,
16777
16777
  makeObj: dt,
16778
- MathClamp: ft,
16779
- noContextMenu: Dt,
16778
+ MathClamp: B,
16779
+ noContextMenu: Et,
16780
16780
  normalizeUnicode: ot,
16781
16781
  OPS: Pe,
16782
16782
  OutputScale: It,
16783
16783
  PasswordException: qe,
16784
16784
  PasswordResponses: Ie,
16785
16785
  PDFDataRangeTransport: lf,
16786
- PDFDateString: kt,
16786
+ PDFDateString: Ot,
16787
16787
  PDFWorker: xf,
16788
16788
  PermissionFlag: Oe,
16789
- PixelsPerInch: gt,
16790
- RenderingCancelledException: yt,
16789
+ PixelsPerInch: ht,
16790
+ RenderingCancelledException: vt,
16791
16791
  renderRichText: qt,
16792
16792
  ResponseException: Xe,
16793
16793
  setLayerDimensions: Ft,
16794
16794
  shadow: L,
16795
16795
  SignatureExtractor: yv,
16796
- stopEvent: Ot,
16796
+ stopEvent: Dt,
16797
16797
  SupportedImageMimeTypes: Lt,
16798
16798
  TextLayer: Ud,
16799
16799
  TextLayerImages: pb,
@@ -16802,7 +16802,7 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib =
16802
16802
  Util: z,
16803
16803
  VerbosityLevel: Ne,
16804
16804
  version: Gf,
16805
- XfaLayer: ht
16805
+ XfaLayer: mt
16806
16806
  };
16807
16807
  //#endregion
16808
16808
  //#region src/constants.ts
@@ -17530,24 +17530,26 @@ function Tb({ initialBlocks: e, defaultStyles: t, defaultLogo: n, defaultBanner:
17530
17530
  return i;
17531
17531
  }));
17532
17532
  },
17533
- handleUpdateTableColumn: (e, t, n, r) => {
17534
- l && c((i) => T(i, (i) => {
17535
- if (i.id === l && i.type === "table" && i.tableInfo) {
17536
- var a;
17537
- let o = [...i.tableInfo.columns];
17538
- if (r !== void 0 && (a = o[e]) != null && a.columns) {
17539
- let i = [...o[e].columns];
17540
- i[r] = D(D({}, i[r]), {}, {
17533
+ handleUpdateTableColumn: (e, t, n, r, i) => {
17534
+ l && c((a) => T(a, (a) => {
17535
+ if (a.id === l && a.type === "table" && a.tableInfo) {
17536
+ var o;
17537
+ let s = [...a.tableInfo.columns];
17538
+ if (r !== void 0 && (o = s[e]) != null && o.columns) {
17539
+ let a = [...s[e].columns];
17540
+ a[r] = D(D({}, a[r]), {}, {
17541
17541
  columnName: t.trim(),
17542
- placeholder: n.trim()
17543
- }), o[e] = D(D({}, o[e]), {}, { columns: i });
17544
- } else o[e] && (o[e] = D(D({}, o[e]), {}, {
17542
+ placeholder: n.trim(),
17543
+ colspan: i
17544
+ }), s[e] = D(D({}, s[e]), {}, { columns: a });
17545
+ } else s[e] && (s[e] = D(D({}, s[e]), {}, {
17545
17546
  columnName: t.trim(),
17546
- placeholder: n.trim()
17547
+ placeholder: n.trim(),
17548
+ colspan: i
17547
17549
  }));
17548
- return D(D({}, i), {}, { tableInfo: D(D({}, i.tableInfo), {}, { columns: o }) });
17550
+ return D(D({}, a), {}, { tableInfo: D(D({}, a.tableInfo), {}, { columns: s }) });
17549
17551
  }
17550
- return i;
17552
+ return a;
17551
17553
  }));
17552
17554
  },
17553
17555
  handleReorderTableColumn: (e, t, n) => {
@@ -18993,7 +18995,7 @@ var wx = (e) => {
18993
18995
  };
18994
18996
  function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, updateSelectedImageInfo: r, fontSizesState: i, fontFamiliesState: a, fontWeightsState: o, handleDeleteBlock: c, newColName: f, setNewColName: p, newColPlaceholder: m, setNewColPlaceholder: h, handleAddTableColumn: g, handleRemoveTableColumn: _, handleUpdateTableColumn: v, handleReorderTableColumn: y, handleAddTableRow: b, handleRemoveTableRow: x, handleMergeTableColumns: S, addColumnToLayout: C, deleteColumnFromLayout: w, mergeColumns: T, updateColumnStyle: E, updateColumnWidth: ee, setBlocks: O, themeColor: k = "#ea580c" }) {
18995
18997
  var te;
18996
- let [A, ne] = s(null), [re, ie] = s(""), [ae, j] = s(""), [oe, se] = s(null), [ce, le] = s(""), [ue, de] = s(""), [fe, pe] = s(0), M = t();
18998
+ let [A, ne] = s(null), [re, ie] = s(""), [ae, j] = s(""), [oe, se] = s(1), [ce, le] = s(null), [ue, de] = s(""), [fe, pe] = s(""), [me, he] = s(0), M = t();
18997
18999
  if (!e || !M) return /* @__PURE__ */ d("div", {
18998
19000
  className: "space-y-5",
18999
19001
  children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
@@ -19018,12 +19020,12 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19018
19020
  })]
19019
19021
  });
19020
19022
  if (M.type === "layout") {
19021
- var me, he, ge;
19023
+ var ge, _e, ve;
19022
19024
  let e = M.layoutInfo || {
19023
19025
  columnsCount: 2,
19024
19026
  columns: [],
19025
19027
  gap: "16px"
19026
- }, t = Math.min(fe, Math.max(0, e.columns.length - 1)), n = e.columns[t];
19028
+ }, t = Math.min(me, Math.max(0, e.columns.length - 1)), n = e.columns[t];
19027
19029
  return /* @__PURE__ */ d("div", {
19028
19030
  className: "space-y-5",
19029
19031
  children: [
@@ -19102,7 +19104,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19102
19104
  children: "Select Column"
19103
19105
  }), /* @__PURE__ */ u("select", {
19104
19106
  value: t,
19105
- onChange: (e) => pe(parseInt(e.target.value, 10)),
19107
+ onChange: (e) => he(parseInt(e.target.value, 10)),
19106
19108
  className: "w-full text-xs p-2 border border-slate-200 rounded-lg bg-slate-50 font-bold text-slate-700",
19107
19109
  children: e.columns.map((e, t) => /* @__PURE__ */ d("option", {
19108
19110
  value: t,
@@ -19183,14 +19185,14 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19183
19185
  className: "flex items-center space-x-2",
19184
19186
  children: [/* @__PURE__ */ u("input", {
19185
19187
  type: "color",
19186
- value: (n == null || (me = n.style) == null ? void 0 : me.borderColor) || "#cbd5e1",
19188
+ value: (n == null || (ge = n.style) == null ? void 0 : ge.borderColor) || "#cbd5e1",
19187
19189
  onChange: (e) => {
19188
19190
  E && E(M.id, t, { borderColor: e.target.value });
19189
19191
  },
19190
19192
  className: "w-8 h-8 rounded border border-gray-200 cursor-pointer p-0.5"
19191
19193
  }), /* @__PURE__ */ u("input", {
19192
19194
  type: "text",
19193
- value: (n == null || (he = n.style) == null ? void 0 : he.borderColor) || "#cbd5e1",
19195
+ value: (n == null || (_e = n.style) == null ? void 0 : _e.borderColor) || "#cbd5e1",
19194
19196
  onChange: (e) => {
19195
19197
  E && E(M.id, t, { borderColor: e.target.value });
19196
19198
  },
@@ -19231,7 +19233,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19231
19233
  className: "flex items-center space-x-2",
19232
19234
  children: [/* @__PURE__ */ u("input", {
19233
19235
  type: "color",
19234
- value: (n == null || (ge = n.style) == null ? void 0 : ge.backgroundColor) || "#ffffff",
19236
+ value: (n == null || (ve = n.style) == null ? void 0 : ve.backgroundColor) || "#ffffff",
19235
19237
  onChange: (e) => {
19236
19238
  E && E(M.id, t, { backgroundColor: e.target.value });
19237
19239
  },
@@ -19271,7 +19273,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19271
19273
  ]
19272
19274
  });
19273
19275
  }
19274
- let _e = M.type === "table", ve = () => {
19276
+ let ye = M.type === "table", be = () => {
19275
19277
  f.trim() && (g(f, m), p(""), h(""));
19276
19278
  };
19277
19279
  if (M.type === "image") {
@@ -19684,7 +19686,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19684
19686
  children: e.label
19685
19687
  }, e.value))
19686
19688
  })]
19687
- }), !_e && /* @__PURE__ */ d("div", {
19689
+ }), !ye && /* @__PURE__ */ d("div", {
19688
19690
  className: "space-y-1",
19689
19691
  children: [/* @__PURE__ */ u("label", {
19690
19692
  className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider",
@@ -19700,7 +19702,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19700
19702
  })]
19701
19703
  })]
19702
19704
  }),
19703
- !_e && /* @__PURE__ */ d("div", {
19705
+ !ye && /* @__PURE__ */ d("div", {
19704
19706
  className: "space-y-1.5",
19705
19707
  children: [/* @__PURE__ */ u("label", {
19706
19708
  className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider block",
@@ -19718,7 +19720,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19718
19720
  }, e.value))]
19719
19721
  })]
19720
19722
  }),
19721
- !_e && /* @__PURE__ */ d("div", {
19723
+ !ye && /* @__PURE__ */ d("div", {
19722
19724
  className: "space-y-2",
19723
19725
  children: [/* @__PURE__ */ u("label", {
19724
19726
  className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider block",
@@ -19922,7 +19924,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19922
19924
  })
19923
19925
  ]
19924
19926
  }),
19925
- _e && M.tableInfo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
19927
+ ye && M.tableInfo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
19926
19928
  className: "space-y-3 pt-3 border-t border-gray-100",
19927
19929
  children: [/* @__PURE__ */ d("div", {
19928
19930
  className: "flex items-center justify-between",
@@ -19995,11 +19997,25 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19995
19997
  placeholder: "Value (e.g. {{item.sku}})",
19996
19998
  className: "w-full px-2 py-0.5 border border-gray-200 rounded text-xs font-mono bg-white"
19997
19999
  }),
20000
+ /* @__PURE__ */ d("div", {
20001
+ className: "flex items-center gap-1.5",
20002
+ children: [/* @__PURE__ */ u("span", {
20003
+ className: "text-[10px] text-slate-400 font-bold uppercase shrink-0",
20004
+ children: "Colspan"
20005
+ }), /* @__PURE__ */ u("input", {
20006
+ type: "number",
20007
+ min: 1,
20008
+ value: oe,
20009
+ onChange: (e) => se(parseInt(e.target.value, 10) || 1),
20010
+ placeholder: "Col Span (e.g. 1)",
20011
+ className: "w-full px-2 py-0.5 border border-gray-200 rounded text-xs bg-white"
20012
+ })]
20013
+ }),
19998
20014
  /* @__PURE__ */ d("div", {
19999
20015
  className: "flex justify-end gap-1",
20000
20016
  children: [/* @__PURE__ */ d("button", {
20001
20017
  onClick: () => {
20002
- v && v(t, re, ae), ne(null);
20018
+ v && v(t, re, ae, void 0, oe), ne(null);
20003
20019
  },
20004
20020
  style: { backgroundColor: k },
20005
20021
  className: "p-1 px-2 text-white rounded text-[10px] flex items-center gap-1 font-bold cursor-pointer",
@@ -20044,7 +20060,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20044
20060
  }),
20045
20061
  /* @__PURE__ */ u("button", {
20046
20062
  onClick: () => {
20047
- ne(String(t)), ie(e.columnName), j(e.placeholder);
20063
+ ne(String(t)), ie(e.columnName), j(e.placeholder), se(e.colspan || 1);
20048
20064
  },
20049
20065
  className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded transition-colors",
20050
20066
  title: "Edit column",
@@ -20163,7 +20179,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20163
20179
  })]
20164
20180
  }, r);
20165
20181
  }),
20166
- oe === t ? /* @__PURE__ */ d("div", {
20182
+ ce === t ? /* @__PURE__ */ d("div", {
20167
20183
  className: "bg-white border border-blue-200 rounded p-2 space-y-1.5 mt-1",
20168
20184
  children: [
20169
20185
  /* @__PURE__ */ u("span", {
@@ -20172,15 +20188,15 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20172
20188
  }),
20173
20189
  /* @__PURE__ */ u("input", {
20174
20190
  type: "text",
20175
- value: ce,
20176
- onChange: (e) => le(e.target.value),
20191
+ value: ue,
20192
+ onChange: (e) => de(e.target.value),
20177
20193
  placeholder: "Header Name (e.g. Price)",
20178
20194
  className: "w-full px-2 py-1 border border-gray-200 rounded text-xs bg-white"
20179
20195
  }),
20180
20196
  /* @__PURE__ */ u("input", {
20181
20197
  type: "text",
20182
- value: ue,
20183
- onChange: (e) => de(e.target.value),
20198
+ value: fe,
20199
+ onChange: (e) => pe(e.target.value),
20184
20200
  placeholder: "Value (e.g. {{item.price}})",
20185
20201
  className: "w-full px-2 py-1 border border-gray-200 rounded text-xs font-mono bg-white"
20186
20202
  }),
@@ -20188,13 +20204,13 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20188
20204
  className: "flex gap-1 pt-1",
20189
20205
  children: [/* @__PURE__ */ u("button", {
20190
20206
  onClick: () => {
20191
- ce.trim() && (g(ce, ue || "{{item.value}}", !1, t), le(""), de(""), se(null));
20207
+ ue.trim() && (g(ue, fe || "{{item.value}}", !1, t), de(""), pe(""), le(null));
20192
20208
  },
20193
20209
  className: "flex-1 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded text-[10px] font-bold",
20194
20210
  children: "Add"
20195
20211
  }), /* @__PURE__ */ u("button", {
20196
20212
  onClick: () => {
20197
- se(null), le(""), de("");
20213
+ le(null), de(""), pe("");
20198
20214
  },
20199
20215
  className: "py-1 px-2 bg-gray-100 hover:bg-gray-200 text-slate-600 rounded text-[10px]",
20200
20216
  children: "Cancel"
@@ -20202,7 +20218,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20202
20218
  })
20203
20219
  ]
20204
20220
  }) : /* @__PURE__ */ d("button", {
20205
- onClick: () => se(t),
20221
+ onClick: () => le(t),
20206
20222
  className: "w-full py-1 text-[10px] font-bold text-blue-600 hover:bg-blue-50 border border-dashed border-blue-200 rounded flex items-center justify-center space-x-1 transition-colors mt-1",
20207
20223
  children: [/* @__PURE__ */ u(nx, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Add Sub-Column" })]
20208
20224
  })
@@ -20235,7 +20251,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20235
20251
  /* @__PURE__ */ d("div", {
20236
20252
  className: "flex gap-2",
20237
20253
  children: [/* @__PURE__ */ d("button", {
20238
- onClick: ve,
20254
+ onClick: be,
20239
20255
  style: { backgroundColor: k },
20240
20256
  className: "flex-1 py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1 cursor-pointer",
20241
20257
  children: [/* @__PURE__ */ u(nx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Column" })]
@@ -20266,7 +20282,7 @@ function Tx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
20266
20282
  }
20267
20283
  //#endregion
20268
20284
  //#region src/components/SidebarPanel.tsx
20269
- function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlocks: r, selectedBlockId: i, setSelectedBlockId: a, getSelectedBlock: o, defaultStyles: s, createTextBlock: c, createImageBlock: l, createLayoutBlock: f, addColumnToLayout: p, deleteColumnFromLayout: m, mergeColumns: h, updateColumnStyle: g, updateColumnWidth: _, updateSelectedStyle: v, updateSelectedImageInfo: y, handleDeleteBlock: b, handleRemoveTableColumn: x, handleAddTableColumn: S, handleUpdateTableColumn: C, handleReorderTableColumn: w, handleAddTableRow: T, handleRemoveTableRow: E, handleMergeTableColumns: D, schemas: ee, toggleSchemaColumn: O, customTableName: k, setCustomTableName: te, customLoopStart: A, setCustomLoopStart: ne, customLoopEnd: re, setCustomLoopEnd: ie, handleAddCustomTable: ae, newColName: j, setNewColName: oe, newColPlaceholder: se, setNewColPlaceholder: ce, customImageTypes: le, newImgTypeName: ue, setNewImgTypeName: de, handleAddCustomImageType: fe, placeholders: pe, searchPlaceholder: M, setSearchPlaceholder: me, handleSidebarDragStart: he, isTablesLoading: ge, tablesLoading: _e, isPlaceholdersLoading: ve, placeholdersLoading: ye, fontSizesState: be, fontFamiliesState: xe, fontWeightsState: Se, sidebarPosition: Ce = "left" }) {
20285
+ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlocks: r, selectedBlockId: i, setSelectedBlockId: a, getSelectedBlock: o, defaultStyles: s, createTextBlock: c, createImageBlock: l, createLayoutBlock: f, addColumnToLayout: p, deleteColumnFromLayout: m, mergeColumns: h, updateColumnStyle: g, updateColumnWidth: _, updateSelectedStyle: v, updateSelectedImageInfo: y, handleDeleteBlock: b, handleRemoveTableColumn: x, handleAddTableColumn: S, handleUpdateTableColumn: C, handleReorderTableColumn: w, handleAddTableRow: T, handleRemoveTableRow: E, handleMergeTableColumns: D, schemas: ee, toggleSchemaColumn: O, customTableName: k, setCustomTableName: te, customLoopStart: A, setCustomLoopStart: ne, customLoopEnd: re, setCustomLoopEnd: ie, handleAddCustomTable: ae, newColName: j, setNewColName: oe, newColPlaceholder: se, setNewColPlaceholder: ce, customImageTypes: le, newImgTypeName: ue, setNewImgTypeName: de, handleAddCustomImageType: fe, placeholders: pe, searchPlaceholder: me, setSearchPlaceholder: he, handleSidebarDragStart: M, isTablesLoading: ge, tablesLoading: _e, isPlaceholdersLoading: ve, placeholdersLoading: ye, fontSizesState: be, fontFamiliesState: xe, fontWeightsState: Se, sidebarPosition: Ce = "left" }) {
20270
20286
  return /* @__PURE__ */ d("aside", {
20271
20287
  className: `w-full lg:col-span-4 h-full max-h-full min-h-0 flex flex-col bg-white border-t lg:border-t-0 ${Ce === "left" ? "lg:border-r lg:order-1" : "lg:border-l lg:order-2"} border-gray-200 overflow-hidden shrink-0`,
20272
20288
  children: [/* @__PURE__ */ u("div", {
@@ -20309,7 +20325,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
20309
20325
  className: "p-4 flex-1 flex flex-col min-h-0 max-h-[80%] h-[80%] overflow-y-auto custom-scrollbar",
20310
20326
  children: [
20311
20327
  e === "text" && /* @__PURE__ */ u(yx, {
20312
- handleSidebarDragStart: he,
20328
+ handleSidebarDragStart: M,
20313
20329
  createTextBlock: c,
20314
20330
  setBlocks: r,
20315
20331
  setSelectedBlockId: a,
@@ -20317,7 +20333,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
20317
20333
  defaultStyles: s
20318
20334
  }),
20319
20335
  e === "layouts" && /* @__PURE__ */ u(bx, {
20320
- handleSidebarDragStart: he,
20336
+ handleSidebarDragStart: M,
20321
20337
  createLayoutBlock: f || (() => c("p", "Layout")),
20322
20338
  setBlocks: r,
20323
20339
  setSelectedBlockId: a,
@@ -20334,7 +20350,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
20334
20350
  customLoopEnd: re,
20335
20351
  setCustomLoopEnd: ie,
20336
20352
  handleAddCustomTable: ae,
20337
- handleSidebarDragStart: he,
20353
+ handleSidebarDragStart: M,
20338
20354
  setBlocks: r,
20339
20355
  setSelectedBlockId: a,
20340
20356
  setActiveTab: t,
@@ -20348,7 +20364,7 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
20348
20364
  newImgTypeName: ue,
20349
20365
  setNewImgTypeName: de,
20350
20366
  handleAddCustomImageType: fe,
20351
- handleSidebarDragStart: he,
20367
+ handleSidebarDragStart: M,
20352
20368
  createImageBlock: l,
20353
20369
  setBlocks: r,
20354
20370
  setSelectedBlockId: a,
@@ -20358,8 +20374,8 @@ function Ex({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlock
20358
20374
  e === "placeholders" && /* @__PURE__ */ u(Cx, {
20359
20375
  placeholders: pe,
20360
20376
  schemas: ee,
20361
- searchPlaceholder: M,
20362
- setSearchPlaceholder: me,
20377
+ searchPlaceholder: me,
20378
+ setSearchPlaceholder: he,
20363
20379
  selectedBlockId: i,
20364
20380
  setBlocks: r,
20365
20381
  isPlaceholdersLoading: ve,
@@ -20454,7 +20470,7 @@ var Dx = [
20454
20470
  }), t;
20455
20471
  };
20456
20472
  function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r, setActiveTab: i, showMockData: o, placeholderMockData: c, dragOverIndex: l, setDragOverIndex: f, draggedSidebarItem: p, defaultStyles: m, zoom: h, panOffset: g, spacePressed: _, canvasHeight: v, setCanvasHeight: y, viewportRef: b, canvasContainerRef: x, contentRef: S, handleMouseDown: C, handleMouseMove: w, handleMouseUp: T, createTextBlock: E, createImageBlock: ee, createLayoutBlock: O, addColumnToLayout: k, deleteColumnFromLayout: te, mergeColumns: A, duplicateBlock: ne, reorderBlock: re, handleDeleteBlock: ie, handleSidebarDrop: ae, handleTableCellDrop: j, updateTableCell: oe, handleTextDrop: se, themeColor: ce = "#ea580c" }) {
20457
- let [le, ue] = s(null), [de, fe] = s(null), [pe, M] = s([]);
20473
+ let [le, ue] = s(null), [de, fe] = s(null), [pe, me] = s([]);
20458
20474
  a(() => {
20459
20475
  let e = () => {
20460
20476
  if (!(S != null && S.current)) return;
@@ -20465,7 +20481,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
20465
20481
  });
20466
20482
  let n = [], r = Math.max(1, Math.ceil(v / 1123));
20467
20483
  for (let e = 1; e <= r; e++) e > 1 && !t.has(e) && n.push(e);
20468
- M(n);
20484
+ me(n);
20469
20485
  };
20470
20486
  e();
20471
20487
  let t = new ResizeObserver(e);
@@ -20475,7 +20491,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
20475
20491
  v,
20476
20492
  S
20477
20493
  ]);
20478
- let me = (e) => {
20494
+ let he = (e) => {
20479
20495
  t((e) => e.map((e) => {
20480
20496
  if (e.style && (e.style.pageBreakBefore === "always" || e.style.pageBreakBefore === !0)) {
20481
20497
  let t = D({}, e.style);
@@ -20483,7 +20499,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
20483
20499
  }
20484
20500
  return e;
20485
20501
  })), y && y(Math.max(1123, (e - 1) * 1123));
20486
- }, he = (e, t) => {
20502
+ }, M = (e, t) => {
20487
20503
  e.dataTransfer.setData("blockIndex", String(t)), e.dataTransfer.setData("source", "canvas"), e.dataTransfer.effectAllowed = "move";
20488
20504
  }, ge = (e, n) => {
20489
20505
  e.preventDefault(), e.stopPropagation();
@@ -20706,7 +20722,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
20706
20722
  }), i && /* @__PURE__ */ d("button", {
20707
20723
  type: "button",
20708
20724
  onClick: (e) => {
20709
- e.stopPropagation(), me(n);
20725
+ e.stopPropagation(), he(n);
20710
20726
  },
20711
20727
  className: "flex items-center space-x-1 bg-red-500 hover:bg-red-600 text-white px-2.5 py-1 rounded-full text-[10px] font-bold shadow-md hover:shadow-lg transition-all duration-150 cursor-pointer active:scale-95 z-40",
20712
20728
  title: `Delete empty Page ${n}`,
@@ -20755,7 +20771,7 @@ function jx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
20755
20771
  return;
20756
20772
  }
20757
20773
  let r = e.findIndex((e) => e.id === a.id);
20758
- he(t, r);
20774
+ M(t, r);
20759
20775
  },
20760
20776
  onDragOver: (t) => {
20761
20777
  t.preventDefault(), f(e.findIndex((e) => e.id === a.id));
@@ -21488,13 +21504,13 @@ var Fx = (e) => {
21488
21504
  }), t;
21489
21505
  }, Ix = (e) => e ? e.replace(/contenteditable="[^"]*"/g, "").replace(/class="[^"]*"/g, "").replace(/data-placeholder="[^"]*"/g, "").replace(/&nbsp;/g, " ").trim() : "";
21490
21506
  function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: i = "HTML Template Builder", headerSubtitle: o = "Design and export templates dynamically", headerLogo: c, typographySizes: l, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: v, getHTMLOutput: y, initialBlocks: x, defaultStyles: S, showImportHtml: C = !0, showImportPdf: w = !0, showClearCanvas: T = !0, showPreview: E = !0, showExport: ee = !0, showExportPdf: O = !0, showHeader: k = !0, sidebarPosition: A = "left", themeColor: ne, primaryColor: re, isTablesLoading: ie, tablesLoading: ae, isPlaceholdersLoading: j, placeholdersLoading: oe, customButtonStyles: se, customButtonClassNames: ce, customActionComponents: le } = {}) {
21491
- let ue = ne || re || "#ea580c", { zoom: de, setZoom: fe, panOffset: pe, setPanOffset: M, spacePressed: me, canvasHeight: he, setCanvasHeight: ge, viewportRef: _e, canvasContainerRef: ve, contentRef: ye, handleMouseDown: be, handleMouseMove: xe, handleMouseUp: Se } = Eb(), { customTableName: Ce, setCustomTableName: we, customLoopStart: Te, setCustomLoopStart: Ee, customLoopEnd: De, setCustomLoopEnd: N, newColName: P, setNewColName: Oe, newColPlaceholder: ke, setNewColPlaceholder: Ae, bubbleCoords: je, setBubbleCoords: Me, schemas: Ne, isParsing: Pe, setIsParsing: Fe, parseStatusText: Ie, setParseStatusText: Le, parseError: Re, setParseError: ze, draggedSidebarItem: Be, setDraggedSidebarItem: F, dragOverIndex: I, setDragOverIndex: Ve, newImgTypeName: He, setNewImgTypeName: Ue, customImageTypes: We, searchPlaceholder: Ge, setSearchPlaceholder: L, handleAddCustomTable: Ke, handleAddCustomImageType: qe, toggleSchemaColumn: Je, applySelectionFormat: Ye, setSavedRange: Xe } = Db({ tableSchemas: e }), { blocks: Ze, setBlocks: Qe, selectedBlockId: $e, setSelectedBlockId: et, getSelectedBlock: R, createTextBlock: z, createTableBlock: tt, createImageBlock: nt, createLayoutBlock: rt, addColumnToLayout: it, deleteColumnFromLayout: at, mergeColumns: ot, updateColumnStyle: st, updateColumnWidth: ct, handleDeleteBlock: lt, handleDuplicateBlock: ut, handleMoveBlockUp: dt, handleMoveBlockDown: ft, updateSelectedStyle: pt, updateSelectedImageInfo: mt, handleRemoveTableColumn: ht, handleAddTableColumn: gt, handleUpdateTableColumn: _t, handleReorderTableColumn: vt, handleAddTableRow: yt, handleRemoveTableRow: bt, handleMergeTableColumns: xt } = Tb({
21507
+ let ue = ne || re || "#ea580c", { zoom: de, setZoom: fe, panOffset: pe, setPanOffset: me, spacePressed: he, canvasHeight: M, setCanvasHeight: ge, viewportRef: _e, canvasContainerRef: ve, contentRef: ye, handleMouseDown: be, handleMouseMove: xe, handleMouseUp: Se } = Eb(), { customTableName: Ce, setCustomTableName: we, customLoopStart: Te, setCustomLoopStart: Ee, customLoopEnd: De, setCustomLoopEnd: N, newColName: P, setNewColName: Oe, newColPlaceholder: ke, setNewColPlaceholder: Ae, bubbleCoords: je, setBubbleCoords: Me, schemas: Ne, isParsing: Pe, setIsParsing: Fe, parseStatusText: Ie, setParseStatusText: Le, parseError: Re, setParseError: ze, draggedSidebarItem: Be, setDraggedSidebarItem: F, dragOverIndex: I, setDragOverIndex: Ve, newImgTypeName: He, setNewImgTypeName: Ue, customImageTypes: We, searchPlaceholder: Ge, setSearchPlaceholder: L, handleAddCustomTable: Ke, handleAddCustomImageType: qe, toggleSchemaColumn: Je, applySelectionFormat: Ye, setSavedRange: Xe } = Db({ tableSchemas: e }), { blocks: Ze, setBlocks: Qe, selectedBlockId: $e, setSelectedBlockId: et, getSelectedBlock: R, createTextBlock: z, createTableBlock: tt, createImageBlock: nt, createLayoutBlock: rt, addColumnToLayout: it, deleteColumnFromLayout: at, mergeColumns: ot, updateColumnStyle: st, updateColumnWidth: ct, handleDeleteBlock: lt, handleDuplicateBlock: ut, handleMoveBlockUp: dt, handleMoveBlockDown: B, updateSelectedStyle: ft, updateSelectedImageInfo: pt, handleRemoveTableColumn: mt, handleAddTableColumn: ht, handleUpdateTableColumn: gt, handleReorderTableColumn: _t, handleAddTableRow: vt, handleRemoveTableRow: yt, handleMergeTableColumns: bt } = Tb({
21492
21508
  initialBlocks: x,
21493
21509
  defaultStyles: S,
21494
21510
  defaultLogo: n,
21495
21511
  defaultBanner: r,
21496
21512
  onChange: g
21497
- }), [St, Ct] = s("text"), [wt, Tt] = s(!1), [Et] = s(!0), [Dt] = s(l || [
21513
+ }), [xt, St] = s("text"), [Ct, wt] = s(!1), [Tt] = s(!0), [Et] = s(l || [
21498
21514
  {
21499
21515
  label: "8px",
21500
21516
  value: "8px"
@@ -21547,7 +21563,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21547
21563
  label: "36px",
21548
21564
  value: "36px"
21549
21565
  }
21550
- ]), [Ot] = s(p || [
21566
+ ]), [Dt] = s(p || [
21551
21567
  {
21552
21568
  label: "Outfit (Default)",
21553
21569
  value: "'Outfit', 'Inter', sans-serif"
@@ -21572,7 +21588,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21572
21588
  label: "Courier New (Mono)",
21573
21589
  value: "'Courier New', monospace"
21574
21590
  }
21575
- ]), [kt] = s(f || [
21591
+ ]), [Ot] = s(f || [
21576
21592
  {
21577
21593
  label: "Light",
21578
21594
  value: "300"
@@ -21597,7 +21613,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21597
21613
  label: "Extra Bold",
21598
21614
  value: "800"
21599
21615
  }
21600
- ]), [At] = s(m), [jt] = s(h), [Mt] = s(!0), Nt = {};
21616
+ ]), [kt] = s(m), [At] = s(h), [jt] = s(!0), Mt = {};
21601
21617
  a(() => {
21602
21618
  let e = () => {
21603
21619
  let e = window.getSelection();
@@ -21638,7 +21654,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21638
21654
  Qe((n) => n.map((n) => n.id === e ? D(D({}, n), {}, { content: t }) : n));
21639
21655
  };
21640
21656
  }, [Qe]);
21641
- let B = (e) => {
21657
+ let Nt = (e) => {
21642
21658
  var t;
21643
21659
  let n = (t = e.target.files) == null ? void 0 : t[0];
21644
21660
  if (!n) return;
@@ -21673,20 +21689,20 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21673
21689
  }), r.readAsArrayBuffer(n);
21674
21690
  }, Ft = (e) => {
21675
21691
  let t = e || "items";
21676
- if (At === "handlebars" || At === "mustache") {
21677
- let e = jt === "foreach" ? "foreach" : "each";
21692
+ if (kt === "handlebars" || kt === "mustache") {
21693
+ let e = At === "foreach" ? "foreach" : "each";
21678
21694
  return {
21679
21695
  start: `{{#${e} ${t}}}`,
21680
21696
  end: `{{/${e}}}`
21681
21697
  };
21682
21698
  }
21683
- return At === "liquid" || At === "scriban" || At === "dotnet" ? {
21699
+ return kt === "liquid" || kt === "scriban" || kt === "dotnet" ? {
21684
21700
  start: `{% for ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t} %}`,
21685
21701
  end: "{% endfor %}"
21686
- } : At === "js" || At === "ts" ? {
21702
+ } : kt === "js" || kt === "ts" ? {
21687
21703
  start: `\${${t}.map(${t.endsWith("s") ? t.slice(0, -1) : "item"} => \``,
21688
21704
  end: "`).join('')}"
21689
- } : At === "csharp" || At === "razor" ? {
21705
+ } : kt === "csharp" || kt === "razor" ? {
21690
21706
  start: `@foreach (var ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t}) {`,
21691
21707
  end: "}"
21692
21708
  } : {
@@ -21706,17 +21722,17 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21706
21722
  typeof e == "object" && e && Object.keys(e).forEach((t) => {
21707
21723
  let r = RegExp(`\\{\\{(item\\.|package\\.)?${t}\\}\\}`, "g");
21708
21724
  n = n.replace(r, e[t]);
21709
- }), Object.keys(Nt).forEach((e) => {
21710
- let t = Nt[e];
21725
+ }), Object.keys(Mt).forEach((e) => {
21726
+ let t = Mt[e];
21711
21727
  n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
21712
21728
  }), n = n.replace(/\{\{[^}]+\}\}/g, ""), i += ` <td>${n}</td>\n`;
21713
21729
  }), i += " </tr>\n";
21714
21730
  });
21715
21731
  else {
21716
21732
  let e = t.columnName || "items", n = Ft(e);
21717
- Mt ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
21733
+ jt ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
21718
21734
  i += ` <td>${e.placeholder}</td>\n`;
21719
- }), Mt ? i += ` </tr><!-- ${n.end} -->\n` : i += ` </tr>${n.end}\n`;
21735
+ }), jt ? i += ` </tr><!-- ${n.end} -->\n` : i += ` </tr>${n.end}\n`;
21720
21736
  }
21721
21737
  return i += " </tbody>\n", i += " </table>", i;
21722
21738
  };
@@ -21748,8 +21764,8 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21748
21764
  let n = Ix(a.placeholder);
21749
21765
  (e || i.mockRows && i.mockRows.length > 1) && (t && typeof t == "object" && Object.keys(t).forEach((e) => {
21750
21766
  n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t[e])), n.includes(`{{item.${e}}}`) && (n = n.replace(RegExp(`\\{\\{item\\.${e}\\}\\}`, "g"), t[e])), n.includes(`{{package.${e}}}`) && (n = n.replace(RegExp(`\\{\\{package\\.${e}\\}\\}`, "g"), t[e]));
21751
- }), Object.keys(Nt).forEach((e) => {
21752
- let t = Nt[e];
21767
+ }), Object.keys(Mt).forEach((e) => {
21768
+ let t = Mt[e];
21753
21769
  n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
21754
21770
  }), e && (n = n.replace(/\{\{[^}]+\}\}/g, ""))), r += ` <td${o}>${n}</td>\n`;
21755
21771
  }
@@ -21760,15 +21776,15 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21760
21776
  });
21761
21777
  else {
21762
21778
  let e = i.tableName === "package" ? "shipment.packages" : i.tableName === "article" ? "package.articles" : i.tableName, r = Ft(e);
21763
- Mt ? t += ` <!-- ${r.start} --><tr>\n` : t += ` ${r.start}<tr>\n`, o.forEach((e) => {
21779
+ jt ? t += ` <!-- ${r.start} --><tr>\n` : t += ` ${r.start}<tr>\n`, o.forEach((e) => {
21764
21780
  let r = e.colspan && e.colspan > 1 ? ` colspan="${e.colspan}"` : "";
21765
21781
  e.loop && e.columns && e.columns.length > 0 ? t += ` <td${r}>\n${n(e)}\n </td>\n` : t += ` <td${r}>${e.placeholder}</td>\n`;
21766
- }), Mt ? t += ` </tr><!-- ${r.end} -->\n` : t += ` </tr>${r.end}\n`;
21782
+ }), jt ? t += ` </tr><!-- ${r.end} -->\n` : t += ` </tr>${r.end}\n`;
21767
21783
  }
21768
21784
  t += " </tbody>\n", t += " </table>\n", t += " </div>\n";
21769
21785
  } else if (r.type === "image") {
21770
21786
  let n = r.imageInfo || { imageType: "logo" }, a = "", o = r.style.height || r.style.minHeight || "auto", c = r.style.imageWidth || (r.style.width && r.style.width.endsWith("px") ? r.style.width : "100%"), l = r.style.textAlign || "left", u = l === "center" ? "margin-left: auto; margin-right: auto;" : l === "right" ? "margin-left: auto; margin-right: 0;" : "margin-left: 0; margin-right: auto;";
21771
- a = n.imageType === "barcode" ? e || Et ? `<div style="width: ${c}; height: ${o}; display: block; ${u}">${xb(n.barcodeValue || "SHIP-99201")}</div>` : `<img src="${n.barcodePlaceholder || "{{barcode}}"}" style="width: ${c}; height: ${o}; display: block; ${u}" alt="Barcode" />` : `<img src="${n.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: ${c}; height: auto; max-height: ${o === "auto" ? "300px" : o}; object-fit: ${r.style.objectFit || "contain"}; ${r.style.opacity ? `opacity: ${r.style.opacity};` : ""} display: block; ${u}" alt="${n.imageType}" />`;
21787
+ a = n.imageType === "barcode" ? e || Tt ? `<div style="width: ${c}; height: ${o}; display: block; ${u}">${xb(n.barcodeValue || "SHIP-99201")}</div>` : `<img src="${n.barcodePlaceholder || "{{barcode}}"}" style="width: ${c}; height: ${o}; display: block; ${u}" alt="Barcode" />` : `<img src="${n.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: ${c}; height: auto; max-height: ${o === "auto" ? "300px" : o}; object-fit: ${r.style.objectFit || "contain"}; ${r.style.opacity ? `opacity: ${r.style.opacity};` : ""} display: block; ${u}" alt="${n.imageType}" />`;
21772
21788
  let d = i ? "100%" : r.style.width && r.style.width.endsWith("%") ? r.style.width : "100%";
21773
21789
  t += ` <div class="block-container" style="display: block; width: ${s}; text-align: ${l}; border: none; background-color: transparent; ${r.style.marginBottom ? `margin-bottom: ${r.style.marginBottom};` : ""}">\n`, t += ` <div style="width: ${d}; text-align: ${l}; display: block;">\n`, t += ` ${a}\n`, t += " </div>\n", t += " </div>\n";
21774
21790
  } else if (r.type === "layout") {
@@ -21791,14 +21807,14 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21791
21807
  if (r.loop || Array.isArray(r.columns)) t += ` <td style="border: 1px solid #e2e8f0; padding: 4px 6px; font-size: 10px;">\n${n(r)}\n </td>\n`;
21792
21808
  else {
21793
21809
  let n = Ix(r.placeholder);
21794
- (e || Et) && (Object.keys(Nt).forEach((e) => {
21795
- n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Nt[e]);
21810
+ (e || Tt) && (Object.keys(Mt).forEach((e) => {
21811
+ n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Mt[e]);
21796
21812
  }), e && (n = n.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <td style="border: 1px solid #e2e8f0; padding: 6px 8px; font-size: 10px; color: #475569;">${n}</td>\n`;
21797
21813
  }
21798
21814
  }), t += " </tr></tbody>\n", t += " </table>\n", t += " </div>\n";
21799
21815
  } else if (r.type === "image") {
21800
21816
  let n = r.imageInfo || { imageType: "logo" }, i = n.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg==", a = r.style.height || "150px", o = r.style.imageWidth || "100%";
21801
- t += ` <div class="block-container" style="width: 100%; text-align: ${r.style.textAlign || "center"}; margin-bottom: ${r.style.marginBottom || "8px"};">\n`, n.imageType === "barcode" ? e || Et ? t += ` <div style="width: ${o}; height: ${a}; display: block; margin: 0 auto;">${xb(n.barcodeValue || "SHIP-99201")}</div>\n` : t += ` <img src="${n.barcodePlaceholder || "{{barcode}}"}" style="width: ${o}; height: ${a}; display: block; margin: 0 auto;" alt="Barcode" />\n` : t += ` <img src="${i}" style="width: ${o}; height: auto; max-height: ${a}; object-fit: ${r.style.objectFit || "contain"}; display: block; margin: 0 auto;" alt="${n.imageType}" />\n`, t += " </div>\n";
21817
+ t += ` <div class="block-container" style="width: 100%; text-align: ${r.style.textAlign || "center"}; margin-bottom: ${r.style.marginBottom || "8px"};">\n`, n.imageType === "barcode" ? e || Tt ? t += ` <div style="width: ${o}; height: ${a}; display: block; margin: 0 auto;">${xb(n.barcodeValue || "SHIP-99201")}</div>\n` : t += ` <img src="${n.barcodePlaceholder || "{{barcode}}"}" style="width: ${o}; height: ${a}; display: block; margin: 0 auto;" alt="Barcode" />\n` : t += ` <img src="${i}" style="width: ${o}; height: auto; max-height: ${a}; object-fit: ${r.style.objectFit || "contain"}; display: block; margin: 0 auto;" alt="${n.imageType}" />\n`, t += " </div>\n";
21802
21818
  } else {
21803
21819
  let n = "p";
21804
21820
  [
@@ -21810,8 +21826,8 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21810
21826
  "h6"
21811
21827
  ].includes(r.type) ? n = r.type : r.type === "title" ? n = "h1" : r.type === "subtitle" ? n = "h2" : r.type === "caption" && (n = "span");
21812
21828
  let i = yb(r.style), a = Ix(r.content);
21813
- (e || Et) && (Object.keys(Nt).forEach((e) => {
21814
- a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Nt[e]);
21829
+ (e || Tt) && (Object.keys(Mt).forEach((e) => {
21830
+ a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), Mt[e]);
21815
21831
  }), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <div class="block-container" style="width: 100%; margin-bottom: ${r.style.marginBottom || "8px"}; text-align: ${r.style.textAlign || "left"};">\n`, t += ` <${n} style="${i}">${a}</${n}>\n`, t += " </div>\n";
21816
21832
  }
21817
21833
  }), t += " </div>\n";
@@ -21827,8 +21843,8 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21827
21843
  "h6"
21828
21844
  ].includes(r.type) ? n = r.type : r.type === "title" ? n = "h1" : r.type === "subtitle" ? n = "h2" : r.type === "caption" && (n = "span");
21829
21845
  let i = Ix(r.content);
21830
- (e || Et) && (Object.keys(Nt).forEach((e) => {
21831
- let t = Nt[e];
21846
+ (e || Tt) && (Object.keys(Mt).forEach((e) => {
21847
+ let t = Mt[e];
21832
21848
  i = i.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t);
21833
21849
  }), e && (i = i.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <div class="block-container" style="${u} text-align: ${r.style.textAlign};">\n`, t += ` <${n} style="${a}">${i}</${n}>\n`, t += " </div>\n";
21834
21850
  }
@@ -21917,32 +21933,32 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21917
21933
  customButtonStyles: se,
21918
21934
  customButtonClassNames: ce,
21919
21935
  customActionComponents: le,
21920
- handleHtmlImport: B,
21936
+ handleHtmlImport: Nt,
21921
21937
  handlePdfImport: Pt,
21922
- setPreviewOpen: Tt,
21938
+ setPreviewOpen: wt,
21923
21939
  handleExport: Lt,
21924
21940
  handleExportPdf: Rt,
21925
21941
  handleClearCanvas: zt,
21926
21942
  zoom: de,
21927
21943
  setZoom: fe,
21928
- setPanOffset: M,
21944
+ setPanOffset: me,
21929
21945
  themeColor: ue
21930
21946
  }), /* @__PURE__ */ u(jx, {
21931
21947
  blocks: Ze,
21932
21948
  setBlocks: Qe,
21933
21949
  selectedBlockId: $e,
21934
21950
  setSelectedBlockId: et,
21935
- setActiveTab: Ct,
21936
- showMockData: Et,
21937
- placeholderMockData: Nt,
21951
+ setActiveTab: St,
21952
+ showMockData: Tt,
21953
+ placeholderMockData: Mt,
21938
21954
  dragOverIndex: I,
21939
21955
  setDragOverIndex: Ve,
21940
21956
  draggedSidebarItem: Be,
21941
21957
  defaultStyles: S,
21942
21958
  zoom: de,
21943
21959
  panOffset: pe,
21944
- spacePressed: me,
21945
- canvasHeight: he,
21960
+ spacePressed: he,
21961
+ canvasHeight: M,
21946
21962
  setCanvasHeight: ge,
21947
21963
  viewportRef: _e,
21948
21964
  canvasContainerRef: ve,
@@ -21959,7 +21975,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21959
21975
  updateColumnStyle: st,
21960
21976
  duplicateBlock: ut,
21961
21977
  reorderBlock: (e, t) => {
21962
- t === "up" ? dt(e) : ft(e);
21978
+ t === "up" ? dt(e) : B(e);
21963
21979
  },
21964
21980
  handleDeleteBlock: lt,
21965
21981
  handleSidebarDrop: (e) => {
@@ -21975,7 +21991,7 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21975
21991
  Qe((n) => {
21976
21992
  let r = [...n];
21977
21993
  return r.splice(e, 0, t), r;
21978
- }), et(t.id), Ct("styles"), F(null);
21994
+ }), et(t.id), St("styles"), F(null);
21979
21995
  },
21980
21996
  handleTableCellDrop: Vt,
21981
21997
  updateTableCell: Ht,
@@ -21983,8 +21999,8 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21983
21999
  themeColor: ue
21984
22000
  })]
21985
22001
  }), /* @__PURE__ */ u(Ex, {
21986
- activeTab: St,
21987
- setActiveTab: Ct,
22002
+ activeTab: xt,
22003
+ setActiveTab: St,
21988
22004
  themeColor: ue,
21989
22005
  setBlocks: Qe,
21990
22006
  selectedBlockId: $e,
@@ -21999,16 +22015,16 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
21999
22015
  mergeColumns: ot,
22000
22016
  updateColumnStyle: st,
22001
22017
  updateColumnWidth: ct,
22002
- updateSelectedStyle: pt,
22003
- updateSelectedImageInfo: mt,
22018
+ updateSelectedStyle: ft,
22019
+ updateSelectedImageInfo: pt,
22004
22020
  handleDeleteBlock: lt,
22005
- handleRemoveTableColumn: ht,
22006
- handleAddTableColumn: gt,
22007
- handleUpdateTableColumn: _t,
22008
- handleReorderTableColumn: vt,
22009
- handleAddTableRow: yt,
22010
- handleRemoveTableRow: bt,
22011
- handleMergeTableColumns: xt,
22021
+ handleRemoveTableColumn: mt,
22022
+ handleAddTableColumn: ht,
22023
+ handleUpdateTableColumn: gt,
22024
+ handleReorderTableColumn: _t,
22025
+ handleAddTableRow: vt,
22026
+ handleRemoveTableRow: yt,
22027
+ handleMergeTableColumns: bt,
22012
22028
  schemas: Ne,
22013
22029
  toggleSchemaColumn: Je,
22014
22030
  customTableName: Ce,
@@ -22041,9 +22057,9 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
22041
22057
  tablesLoading: ae,
22042
22058
  isPlaceholdersLoading: j,
22043
22059
  placeholdersLoading: oe,
22044
- fontSizesState: Dt,
22045
- fontFamiliesState: Ot,
22046
- fontWeightsState: kt,
22060
+ fontSizesState: Et,
22061
+ fontFamiliesState: Dt,
22062
+ fontWeightsState: Ot,
22047
22063
  sidebarPosition: A
22048
22064
  })]
22049
22065
  }),
@@ -22052,8 +22068,8 @@ function Lx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
22052
22068
  applySelectionFormat: Ye
22053
22069
  }),
22054
22070
  /* @__PURE__ */ u(Nx, {
22055
- previewOpen: wt,
22056
- setPreviewOpen: Tt,
22071
+ previewOpen: Ct,
22072
+ setPreviewOpen: wt,
22057
22073
  generateExportHtml: It
22058
22074
  })
22059
22075
  ]