flipbookengine 0.1.4 → 0.1.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.
@@ -415,12 +415,12 @@ class p {
415
415
  }
416
416
  static axialAlignedBoundingBox(I, g, C) {
417
417
  const A = g[0], i = g[1], Z = g[2], d = g[3], s = g[4], c = g[5], G = I[0], m = I[1], W = I[2], a = I[3];
418
- let t = A * G + s, e = t, X = A * W + s, V = X, y = d * m + c, N = y, o = d * a + c, h = o;
418
+ let n = A * G + s, t = n, N = A * W + s, V = N, y = d * m + c, X = y, o = d * a + c, h = o;
419
419
  if (i !== 0 || Z !== 0) {
420
- const n = i * G, R = i * W, u = Z * m, H = Z * a;
421
- t += u, V += u, X += H, e += H, y += n, h += n, o += R, N += R;
420
+ const e = i * G, R = i * W, u = Z * m, H = Z * a;
421
+ n += u, V += u, N += H, t += H, y += e, h += e, o += R, X += R;
422
422
  }
423
- C[0] = Math.min(C[0], t, X, e, V), C[1] = Math.min(C[1], y, o, N, h), C[2] = Math.max(C[2], t, X, e, V), C[3] = Math.max(C[3], y, o, N, h);
423
+ C[0] = Math.min(C[0], n, N, t, V), C[1] = Math.min(C[1], y, o, X, h), C[2] = Math.max(C[2], n, N, t, V), C[3] = Math.max(C[3], y, o, X, h);
424
424
  }
425
425
  static inverseTransform(I) {
426
426
  const g = I[0] * I[3] - I[1] * I[2];
@@ -454,8 +454,8 @@ class p {
454
454
  sl = new WeakSet(), cb = function(I, g, C, A, i, Z, d, s, c, G) {
455
455
  if (c <= 0 || c >= 1)
456
456
  return;
457
- const m = 1 - c, W = c * c, a = W * c, t = m * (m * (m * I + 3 * c * g) + 3 * W * C) + a * A, e = m * (m * (m * i + 3 * c * Z) + 3 * W * d) + a * s;
458
- G[0] = Math.min(G[0], t), G[1] = Math.min(G[1], e), G[2] = Math.max(G[2], t), G[3] = Math.max(G[3], e);
457
+ const m = 1 - c, W = c * c, a = W * c, n = m * (m * (m * I + 3 * c * g) + 3 * W * C) + a * A, t = m * (m * (m * i + 3 * c * Z) + 3 * W * d) + a * s;
458
+ G[0] = Math.min(G[0], n), G[1] = Math.min(G[1], t), G[2] = Math.max(G[2], n), G[3] = Math.max(G[3], t);
459
459
  }, U0 = function(I, g, C, A, i, Z, d, s, c, G, m, W) {
460
460
  if (Math.abs(c) < 1e-12) {
461
461
  Math.abs(G) >= 1e-12 && Y(this, sl, cb).call(this, I, g, C, A, i, Z, d, s, -m / G, W);
@@ -464,8 +464,8 @@ sl = new WeakSet(), cb = function(I, g, C, A, i, Z, d, s, c, G) {
464
464
  const a = G ** 2 - 4 * m * c;
465
465
  if (a < 0)
466
466
  return;
467
- const t = Math.sqrt(a), e = 2 * c;
468
- Y(this, sl, cb).call(this, I, g, C, A, i, Z, d, s, (-G + t) / e, W), Y(this, sl, cb).call(this, I, g, C, A, i, Z, d, s, (-G - t) / e, W);
467
+ const n = Math.sqrt(a), t = 2 * c;
468
+ Y(this, sl, cb).call(this, I, g, C, A, i, Z, d, s, (-G + n) / t, W), Y(this, sl, cb).call(this, I, g, C, A, i, Z, d, s, (-G - n) / t, W);
469
469
  }, w(p, sl);
470
470
  function Fh(b) {
471
471
  return decodeURIComponent(escape(b));
@@ -672,34 +672,34 @@ class WB {
672
672
  }
673
673
  const G = [[A, -1, Z]];
674
674
  for (; G.length > 0; ) {
675
- const [a, t, e] = G.at(-1);
676
- if (t + 1 === a.children.length) {
675
+ const [a, n, t] = G.at(-1);
676
+ if (n + 1 === a.children.length) {
677
677
  G.pop();
678
678
  continue;
679
679
  }
680
- const X = a.children[++G.at(-1)[1]];
681
- if (X === null)
680
+ const N = a.children[++G.at(-1)[1]];
681
+ if (N === null)
682
682
  continue;
683
683
  const {
684
684
  name: V
685
- } = X;
685
+ } = N;
686
686
  if (V === "#text") {
687
- const N = document.createTextNode(X.value);
688
- c.push(N), e.append(N);
687
+ const X = document.createTextNode(N.value);
688
+ c.push(X), t.append(X);
689
689
  continue;
690
690
  }
691
- const y = (m = X == null ? void 0 : X.attributes) != null && m.xmlns ? document.createElementNS(X.attributes.xmlns, V) : document.createElement(V);
692
- if (e.append(y), X.attributes && this.setAttributes({
691
+ const y = (m = N == null ? void 0 : N.attributes) != null && m.xmlns ? document.createElementNS(N.attributes.xmlns, V) : document.createElement(V);
692
+ if (t.append(y), N.attributes && this.setAttributes({
693
693
  html: y,
694
- element: X,
694
+ element: N,
695
695
  storage: g,
696
696
  intent: i,
697
697
  linkService: C
698
- }), ((W = X.children) == null ? void 0 : W.length) > 0)
699
- G.push([X, -1, y]);
700
- else if (X.value) {
701
- const N = document.createTextNode(X.value);
702
- d && $s.shouldBuildText(V) && c.push(N), y.append(N);
698
+ }), ((W = N.children) == null ? void 0 : W.length) > 0)
699
+ G.push([N, -1, y]);
700
+ else if (N.value) {
701
+ const X = document.createTextNode(N.value);
702
+ d && $s.shouldBuildText(V) && c.push(X), y.append(X);
703
703
  }
704
704
  }
705
705
  for (const a of s.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
@@ -782,8 +782,8 @@ class EG {
782
782
  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
783
783
  }
784
784
  d && (W = -W, a = -a);
785
- let t, e, X, V;
786
- G === 0 ? (t = Math.abs(c - I[1]) * C + i, e = Math.abs(s - I[0]) * C + Z, X = (I[3] - I[1]) * C, V = (I[2] - I[0]) * C) : (t = Math.abs(s - I[0]) * C + i, e = Math.abs(c - I[1]) * C + Z, X = (I[2] - I[0]) * C, V = (I[3] - I[1]) * C), this.transform = [G * C, m * C, W * C, a * C, t - G * C * s - W * C * c, e - m * C * s - a * C * c], this.width = X, this.height = V;
785
+ let n, t, N, V;
786
+ G === 0 ? (n = Math.abs(c - I[1]) * C + i, t = Math.abs(s - I[0]) * C + Z, N = (I[3] - I[1]) * C, V = (I[2] - I[0]) * C) : (n = Math.abs(s - I[0]) * C + i, t = Math.abs(c - I[1]) * C + Z, N = (I[2] - I[0]) * C, V = (I[3] - I[1]) * C), this.transform = [G * C, m * C, W * C, a * C, n - G * C * s - W * C * c, t - m * C * s - a * C * c], this.width = N, this.height = V;
787
787
  }
788
788
  get rawDims() {
789
789
  const I = this.viewBox;
@@ -1748,7 +1748,7 @@ M(l0, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Ca
1748
1748
  let q0 = l0;
1749
1749
  var Ad, Ug, ld, pI, PI, id, aC, Zd, YC, tg, tl, el, dd, nl, qC, tC, ti, sc, cc, sd, Gc, _C, Vl, cd, Nl, $C, i0, Xl, Gd, bc, Rl, ei, bd, yl, mc, xI, sI, uA, ul, Hl, oc, md, Bc, Ml, IA, HA, Wc, hc, eC, S, bb, _0, XB, RB, Ks, yB, uB, HB, $0, MB, DB, KB, SB, Xg, VA, pB, FB, Im, JB, Ss, gm;
1750
1750
  const vZ = class vZ {
1751
- constructor(I, g, C, A, i, Z, d, s, c, G, m, W, a, t, e, X) {
1751
+ constructor(I, g, C, A, i, Z, d, s, c, G, m, W, a, n, t, N) {
1752
1752
  w(this, S);
1753
1753
  w(this, Ad, new AbortController());
1754
1754
  w(this, Ug, null);
@@ -1830,10 +1830,10 @@ const vZ = class vZ {
1830
1830
  }, {
1831
1831
  capture: !0,
1832
1832
  signal: V
1833
- }), Y(this, S, yB).call(this), Y(this, S, SB).call(this), Y(this, S, $0).call(this), B(this, aC, s.annotationStorage), B(this, Gc, s.filterFactory), B(this, Hl, c), B(this, cd, G || null), B(this, sc, m), B(this, cc, W), B(this, sd, a), B(this, mc, t || null), this.viewParameters = {
1833
+ }), Y(this, S, yB).call(this), Y(this, S, SB).call(this), Y(this, S, $0).call(this), B(this, aC, s.annotationStorage), B(this, Gc, s.filterFactory), B(this, Hl, c), B(this, cd, G || null), B(this, sc, m), B(this, cc, W), B(this, sd, a), B(this, mc, n || null), this.viewParameters = {
1834
1834
  realScale: di.PDF_TO_CSS_UNITS,
1835
1835
  rotation: 0
1836
- }, this.isShiftKeyDown = !1, this._editorUndoBar = e || null, this._supportsPinchToZoom = X !== !1, i == null || i.setSidebarUiManager(this);
1836
+ }, this.isShiftKeyDown = !1, this._editorUndoBar = t || null, this._supportsPinchToZoom = N !== !1, i == null || i.setSidebarUiManager(this);
1837
1837
  }
1838
1838
  static get _keyboardManager() {
1839
1839
  const I = vZ.prototype, g = (Z) => l(Z, HA).contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && Z.hasSomethingToControl(), C = (Z, {
@@ -2095,8 +2095,8 @@ const vZ = class vZ {
2095
2095
  if (!m)
2096
2096
  return;
2097
2097
  C.empty();
2098
- const W = Y(this, S, _0).call(this, G), a = l(this, xI) === P.NONE, t = () => {
2099
- const e = W == null ? void 0 : W.createAndAddNewEditor({
2098
+ const W = Y(this, S, _0).call(this, G), a = l(this, xI) === P.NONE, n = () => {
2099
+ const t = W == null ? void 0 : W.createAndAddNewEditor({
2100
2100
  x: 0,
2101
2101
  y: 0
2102
2102
  }, !1, {
@@ -2108,13 +2108,13 @@ const vZ = class vZ {
2108
2108
  focusOffset: d,
2109
2109
  text: s
2110
2110
  });
2111
- a && this.showAllEditors("highlight", !0, !0), g && (e == null || e.editComment());
2111
+ a && this.showAllEditors("highlight", !0, !0), g && (t == null || t.editComment());
2112
2112
  };
2113
2113
  if (a) {
2114
- this.switchToMode(P.HIGHLIGHT, t);
2114
+ this.switchToMode(P.HIGHLIGHT, n);
2115
2115
  return;
2116
2116
  }
2117
- t();
2117
+ n();
2118
2118
  }
2119
2119
  commentSelection(I = "") {
2120
2120
  this.highlightSelection(I, !0);
@@ -2318,25 +2318,25 @@ const vZ = class vZ {
2318
2318
  for (const a of l(this, PI).values())
2319
2319
  a.updateMode(I);
2320
2320
  if (I === P.POPUP) {
2321
- l(this, ld) || B(this, ld, await l(this, md).getAnnotationsByType(new Set(l(this, tC).map((e) => e._editorType))));
2322
- const a = /* @__PURE__ */ new Set(), t = [];
2323
- for (const e of l(this, pI).values()) {
2321
+ l(this, ld) || B(this, ld, await l(this, md).getAnnotationsByType(new Set(l(this, tC).map((t) => t._editorType))));
2322
+ const a = /* @__PURE__ */ new Set(), n = [];
2323
+ for (const t of l(this, pI).values()) {
2324
2324
  const {
2325
- annotationElementId: X,
2325
+ annotationElementId: N,
2326
2326
  hasComment: V,
2327
2327
  deleted: y
2328
- } = e;
2329
- X && a.add(X), V && !y && t.push(e.getData());
2328
+ } = t;
2329
+ N && a.add(N), V && !y && n.push(t.getData());
2330
2330
  }
2331
- for (const e of l(this, ld)) {
2331
+ for (const t of l(this, ld)) {
2332
2332
  const {
2333
- id: X,
2333
+ id: N,
2334
2334
  popupRef: V,
2335
2335
  contentsObj: y
2336
- } = e;
2337
- V && (y != null && y.str) && !a.has(X) && !l(this, nl).has(X) && t.push(e);
2336
+ } = t;
2337
+ V && (y != null && y.str) && !a.has(N) && !l(this, nl).has(N) && n.push(t);
2338
2338
  }
2339
- (W = l(this, tg)) == null || W.showSidebar(t);
2339
+ (W = l(this, tg)) == null || W.showSidebar(n);
2340
2340
  }
2341
2341
  if (!g) {
2342
2342
  A && this.addNewEditorFromKeyboard(), l(this, eC).resolve();
@@ -2700,10 +2700,10 @@ const vZ = class vZ {
2700
2700
  for (const {
2701
2701
  x: W,
2702
2702
  y: a,
2703
- width: t,
2704
- height: e
2703
+ width: n,
2704
+ height: t
2705
2705
  } of m.getClientRects())
2706
- t === 0 || e === 0 || s.push(d(W, a, t, e));
2706
+ n === 0 || t === 0 || s.push(d(W, a, n, t));
2707
2707
  }
2708
2708
  return s.length === 0 ? null : s;
2709
2709
  }
@@ -3369,15 +3369,15 @@ Wd = new WeakMap(), ui = new WeakMap(), Yc = new WeakMap(), tc = new WeakMap(),
3369
3369
  touch0Y: G,
3370
3370
  touch1X: m,
3371
3371
  touch1Y: W
3372
- } = s, a = m - c, t = W - G, e = Z - A, X = d - i, V = Math.hypot(e, X) || 1, y = Math.hypot(a, t) || 1;
3372
+ } = s, a = m - c, n = W - G, t = Z - A, N = d - i, V = Math.hypot(t, N) || 1, y = Math.hypot(a, n) || 1;
3373
3373
  if (!l(this, ui) && Math.abs(y - V) <= Ho.MIN_TOUCH_DISTANCE_TO_PINCH)
3374
3374
  return;
3375
3375
  if (s.touch0X = A, s.touch0Y = i, s.touch1X = Z, s.touch1Y = d, !l(this, ui)) {
3376
3376
  B(this, ui, !0);
3377
3377
  return;
3378
3378
  }
3379
- const N = [(A + Z) / 2, (i + d) / 2];
3380
- (o = l(this, nc)) == null || o.call(this, N, y, V);
3379
+ const X = [(A + Z) / 2, (i + d) / 2];
3380
+ (o = l(this, nc)) == null || o.call(this, X, y, V);
3381
3381
  }, LB = function(I) {
3382
3382
  var g;
3383
3383
  I.touches.length >= 2 || (l(this, SA) && (l(this, SA).abort(), B(this, SA, null), (g = l(this, Vc)) == null || g.call(this)), l(this, KA) && (LI(I), B(this, KA, null), B(this, ui, !1)));
@@ -3923,16 +3923,16 @@ const E = class E {
3923
3923
  I.changeParent(this), this.x = g, this.y = C, this.fixAndSetPosition(), this._onTranslated();
3924
3924
  }
3925
3925
  getRect(I, g, C = this.rotation) {
3926
- const A = this.parentScale, [i, Z] = this.pageDimensions, [d, s] = this.pageTranslation, c = I / A, G = g / A, m = this.x * i, W = this.y * Z, a = this.width * i, t = this.height * Z;
3926
+ const A = this.parentScale, [i, Z] = this.pageDimensions, [d, s] = this.pageTranslation, c = I / A, G = g / A, m = this.x * i, W = this.y * Z, a = this.width * i, n = this.height * Z;
3927
3927
  switch (C) {
3928
3928
  case 0:
3929
- return [m + c + d, Z - W - G - t + s, m + c + a + d, Z - W - G + s];
3929
+ return [m + c + d, Z - W - G - n + s, m + c + a + d, Z - W - G + s];
3930
3930
  case 90:
3931
- return [m + G + d, Z - W + c + s, m + G + t + d, Z - W + c + a + s];
3931
+ return [m + G + d, Z - W + c + s, m + G + n + d, Z - W + c + a + s];
3932
3932
  case 180:
3933
- return [m - c - a + d, Z - W + G + s, m - c + d, Z - W + G + t + s];
3933
+ return [m - c - a + d, Z - W + G + s, m - c + d, Z - W + G + n + s];
3934
3934
  case 270:
3935
- return [m - G - t + d, Z - W - c - a + s, m - G + d, Z - W - c + s];
3935
+ return [m - G - n + d, Z - W - c - a + s, m - G + d, Z - W - c + s];
3936
3936
  default:
3937
3937
  throw new Error("Invalid rotation");
3938
3938
  }
@@ -4412,37 +4412,37 @@ Di = new WeakMap(), JC = new WeakMap(), yI = new WeakMap(), wI = new WeakMap(),
4412
4412
  mustExec: !0
4413
4413
  });
4414
4414
  }, Zm = function(I, g) {
4415
- const [C, A] = this.parentDimensions, i = this.x, Z = this.y, d = this.width, s = this.height, c = E.MIN_SIZE / C, G = E.MIN_SIZE / A, m = Y(this, j, ob).call(this, this.rotation), W = (r, Q) => [m[0] * r + m[2] * Q, m[1] * r + m[3] * Q], a = Y(this, j, ob).call(this, 360 - this.rotation), t = (r, Q) => [a[0] * r + a[2] * Q, a[1] * r + a[3] * Q];
4416
- let e, X, V = !1, y = !1;
4415
+ const [C, A] = this.parentDimensions, i = this.x, Z = this.y, d = this.width, s = this.height, c = E.MIN_SIZE / C, G = E.MIN_SIZE / A, m = Y(this, j, ob).call(this, this.rotation), W = (r, Q) => [m[0] * r + m[2] * Q, m[1] * r + m[3] * Q], a = Y(this, j, ob).call(this, 360 - this.rotation), n = (r, Q) => [a[0] * r + a[2] * Q, a[1] * r + a[3] * Q];
4416
+ let t, N, V = !1, y = !1;
4417
4417
  switch (I) {
4418
4418
  case "topLeft":
4419
- V = !0, e = (r, Q) => [0, 0], X = (r, Q) => [r, Q];
4419
+ V = !0, t = (r, Q) => [0, 0], N = (r, Q) => [r, Q];
4420
4420
  break;
4421
4421
  case "topMiddle":
4422
- e = (r, Q) => [r / 2, 0], X = (r, Q) => [r / 2, Q];
4422
+ t = (r, Q) => [r / 2, 0], N = (r, Q) => [r / 2, Q];
4423
4423
  break;
4424
4424
  case "topRight":
4425
- V = !0, e = (r, Q) => [r, 0], X = (r, Q) => [0, Q];
4425
+ V = !0, t = (r, Q) => [r, 0], N = (r, Q) => [0, Q];
4426
4426
  break;
4427
4427
  case "middleRight":
4428
- y = !0, e = (r, Q) => [r, Q / 2], X = (r, Q) => [0, Q / 2];
4428
+ y = !0, t = (r, Q) => [r, Q / 2], N = (r, Q) => [0, Q / 2];
4429
4429
  break;
4430
4430
  case "bottomRight":
4431
- V = !0, e = (r, Q) => [r, Q], X = (r, Q) => [0, 0];
4431
+ V = !0, t = (r, Q) => [r, Q], N = (r, Q) => [0, 0];
4432
4432
  break;
4433
4433
  case "bottomMiddle":
4434
- e = (r, Q) => [r / 2, Q], X = (r, Q) => [r / 2, 0];
4434
+ t = (r, Q) => [r / 2, Q], N = (r, Q) => [r / 2, 0];
4435
4435
  break;
4436
4436
  case "bottomLeft":
4437
- V = !0, e = (r, Q) => [0, Q], X = (r, Q) => [r, 0];
4437
+ V = !0, t = (r, Q) => [0, Q], N = (r, Q) => [r, 0];
4438
4438
  break;
4439
4439
  case "middleLeft":
4440
- y = !0, e = (r, Q) => [0, Q / 2], X = (r, Q) => [r, Q / 2];
4440
+ y = !0, t = (r, Q) => [0, Q / 2], N = (r, Q) => [r, Q / 2];
4441
4441
  break;
4442
4442
  }
4443
- const N = e(d, s), o = X(d, s);
4443
+ const X = t(d, s), o = N(d, s);
4444
4444
  let h = W(...o);
4445
- const n = E._round(i + h[0]), R = E._round(Z + h[1]);
4445
+ const e = E._round(i + h[0]), R = E._round(Z + h[1]);
4446
4446
  let u = 1, H = 1, K, D;
4447
4447
  if (g.fromKeyboard)
4448
4448
  ({
@@ -4456,13 +4456,13 @@ Di = new WeakMap(), JC = new WeakMap(), yI = new WeakMap(), wI = new WeakMap(),
4456
4456
  } = g, [iI, Ng] = l(this, Ki);
4457
4457
  [K, D] = this.screenToPageTranslation(r - iI, Q - Ng), l(this, Ki)[0] = r, l(this, Ki)[1] = Q;
4458
4458
  }
4459
- if ([K, D] = t(K / C, D / A), V) {
4459
+ if ([K, D] = n(K / C, D / A), V) {
4460
4460
  const r = Math.hypot(d, s);
4461
- u = H = Math.max(Math.min(Math.hypot(o[0] - N[0] - K, o[1] - N[1] - D) / r, 1 / d, 1 / s), c / d, G / s);
4462
- } else y ? u = Dg(Math.abs(o[0] - N[0] - K), c, 1) / d : H = Dg(Math.abs(o[1] - N[1] - D), G, 1) / s;
4461
+ u = H = Math.max(Math.min(Math.hypot(o[0] - X[0] - K, o[1] - X[1] - D) / r, 1 / d, 1 / s), c / d, G / s);
4462
+ } else y ? u = Dg(Math.abs(o[0] - X[0] - K), c, 1) / d : H = Dg(Math.abs(o[1] - X[1] - D), G, 1) / s;
4463
4463
  const z = E._round(d * u), L = E._round(s * H);
4464
- h = W(...X(z, L));
4465
- const T = n - h[0], x = R - h[1];
4464
+ h = W(...N(z, L));
4465
+ const T = e - h[0], x = R - h[1];
4466
4466
  l(this, vg) || B(this, vg, [this.x, this.y, this.width, this.height]), this.width = z, this.height = L, this.x = T, this.y = x, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4467
4467
  }, QB = function() {
4468
4468
  var I;
@@ -4476,14 +4476,14 @@ Di = new WeakMap(), JC = new WeakMap(), yI = new WeakMap(), wI = new WeakMap(),
4476
4476
  let i = 0.7 * (C / g) + 1 - 0.7;
4477
4477
  if (i === 1)
4478
4478
  return;
4479
- const Z = Y(this, j, ob).call(this, this.rotation), d = (n, R) => [Z[0] * n + Z[2] * R, Z[1] * n + Z[3] * R], [s, c] = this.parentDimensions, G = this.x, m = this.y, W = this.width, a = this.height, t = E.MIN_SIZE / s, e = E.MIN_SIZE / c;
4480
- i = Math.max(Math.min(i, 1 / W, 1 / a), t / W, e / a);
4481
- const X = E._round(W * i), V = E._round(a * i);
4482
- if (X === W && V === a)
4479
+ const Z = Y(this, j, ob).call(this, this.rotation), d = (e, R) => [Z[0] * e + Z[2] * R, Z[1] * e + Z[3] * R], [s, c] = this.parentDimensions, G = this.x, m = this.y, W = this.width, a = this.height, n = E.MIN_SIZE / s, t = E.MIN_SIZE / c;
4480
+ i = Math.max(Math.min(i, 1 / W, 1 / a), n / W, t / a);
4481
+ const N = E._round(W * i), V = E._round(a * i);
4482
+ if (N === W && V === a)
4483
4483
  return;
4484
4484
  l(this, vg) || B(this, vg, [G, m, W, a]);
4485
- const y = d(W / 2, a / 2), N = E._round(G + y[0]), o = E._round(m + y[1]), h = d(X / 2, V / 2);
4486
- this.x = N - h[0], this.y = o - h[1], this.width = X, this.height = V, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4485
+ const y = d(W / 2, a / 2), X = E._round(G + y[0]), o = E._round(m + y[1]), h = d(N / 2, V / 2);
4486
+ this.x = X - h[0], this.y = o - h[1], this.width = N, this.height = V, this.setDims(), this.fixAndSetPosition(), this._onResizing();
4487
4487
  }, xB = function() {
4488
4488
  var I;
4489
4489
  (I = l(this, yI)) == null || I.toggle(!0), this.parent.togglePointerEvents(!0), Y(this, j, Bb).call(this);
@@ -4516,8 +4516,8 @@ Di = new WeakMap(), JC = new WeakMap(), yI = new WeakMap(), wI = new WeakMap(),
4516
4516
  LI(c);
4517
4517
  return;
4518
4518
  }
4519
- const [a, t] = this.screenToPageTranslation(G - l(this, wd), m - l(this, ad));
4520
- B(this, wd, G), B(this, ad, m), this._uiManager.dragSelectedEditors(a, t);
4519
+ const [a, n] = this.screenToPageTranslation(G - l(this, wd), m - l(this, ad));
4520
+ B(this, wd, G), B(this, ad, m), this._uiManager.dragSelectedEditors(a, n);
4521
4521
  }, Z), window.addEventListener("touchmove", LI, Z), window.addEventListener("pointerdown", (c) => {
4522
4522
  c.pointerType === l(this, Nc) && (l(this, Fi) || c.isPrimary) && d(c), LI(c);
4523
4523
  }, Z));
@@ -4575,8 +4575,8 @@ class PB {
4575
4575
  let g, C;
4576
4576
  if (typeof I == "string") {
4577
4577
  g = new Uint8Array(I.length * 2), C = 0;
4578
- for (let e = 0, X = I.length; e < X; e++) {
4579
- const V = I.charCodeAt(e);
4578
+ for (let t = 0, N = I.length; t < N; t++) {
4579
+ const V = I.charCodeAt(t);
4580
4580
  V <= 255 ? g[C++] = V : (g[C++] = V >>> 8, g[C++] = V & 255);
4581
4581
  }
4582
4582
  } else if (ArrayBuffer.isView(I))
@@ -4585,16 +4585,16 @@ class PB {
4585
4585
  throw new Error("Invalid data format, must be a string or TypedArray.");
4586
4586
  const A = C >> 2, i = C - A * 4, Z = new Uint32Array(g.buffer, 0, A);
4587
4587
  let d = 0, s = 0, c = this.h1, G = this.h2;
4588
- const m = 3432918353, W = 461845907, a = m & PC, t = W & PC;
4589
- for (let e = 0; e < A; e++)
4590
- e & 1 ? (d = Z[e], d = d * m & BC | d * a & PC, d = d << 15 | d >>> 17, d = d * W & BC | d * t & PC, c ^= d, c = c << 13 | c >>> 19, c = c * 5 + 3864292196) : (s = Z[e], s = s * m & BC | s * a & PC, s = s << 15 | s >>> 17, s = s * W & BC | s * t & PC, G ^= s, G = G << 13 | G >>> 19, G = G * 5 + 3864292196);
4588
+ const m = 3432918353, W = 461845907, a = m & PC, n = W & PC;
4589
+ for (let t = 0; t < A; t++)
4590
+ t & 1 ? (d = Z[t], d = d * m & BC | d * a & PC, d = d << 15 | d >>> 17, d = d * W & BC | d * n & PC, c ^= d, c = c << 13 | c >>> 19, c = c * 5 + 3864292196) : (s = Z[t], s = s * m & BC | s * a & PC, s = s << 15 | s >>> 17, s = s * W & BC | s * n & PC, G ^= s, G = G << 13 | G >>> 19, G = G * 5 + 3864292196);
4591
4591
  switch (d = 0, i) {
4592
4592
  case 3:
4593
4593
  d ^= g[A * 4 + 2] << 16;
4594
4594
  case 2:
4595
4595
  d ^= g[A * 4 + 1] << 8;
4596
4596
  case 1:
4597
- d ^= g[A * 4], d = d * m & BC | d * a & PC, d = d << 15 | d >>> 17, d = d * W & BC | d * t & PC, A & 1 ? c ^= d : G ^= d;
4597
+ d ^= g[A * 4], d = d * m & BC | d * a & PC, d = d << 15 | d >>> 17, d = d * W & BC | d * n & PC, A & 1 ? c ^= d : G ^= d;
4598
4598
  }
4599
4599
  this.h1 = c, this.h2 = G;
4600
4600
  }
@@ -4882,8 +4882,8 @@ class _h {
4882
4882
  function C(o, h) {
4883
4883
  return o.charCodeAt(h) << 24 | o.charCodeAt(h + 1) << 16 | o.charCodeAt(h + 2) << 8 | o.charCodeAt(h + 3) & 255;
4884
4884
  }
4885
- function A(o, h, n, R) {
4886
- const u = o.substring(0, h), H = o.substring(h + n);
4885
+ function A(o, h, e, R) {
4886
+ const u = o.substring(0, h), H = o.substring(h + e);
4887
4887
  return u + R + H;
4888
4888
  }
4889
4889
  let i, Z;
@@ -4905,21 +4905,21 @@ class _h {
4905
4905
  const m = `lt${Date.now()}${this.loadTestFontId++}`;
4906
4906
  let W = this._loadTestFont;
4907
4907
  W = A(W, 976, m.length, m);
4908
- const t = 16, e = 1482184792;
4909
- let X = C(W, t);
4908
+ const n = 16, t = 1482184792;
4909
+ let N = C(W, n);
4910
4910
  for (i = 0, Z = m.length - 3; i < Z; i += 4)
4911
- X = X - e + C(m, i) | 0;
4912
- i < m.length && (X = X - e + C(m + "XXX", i) | 0), W = A(W, t, 4, Kh(X));
4911
+ N = N - t + C(m, i) | 0;
4912
+ i < m.length && (N = N - t + C(m + "XXX", i) | 0), W = A(W, n, 4, Kh(N));
4913
4913
  const V = `url(data:font/opentype;base64,${btoa(W)});`, y = `@font-face {font-family:"${m}";src:${V}}`;
4914
4914
  this.insertRule(y);
4915
- const N = this._document.createElement("div");
4916
- N.style.visibility = "hidden", N.style.width = N.style.height = "10px", N.style.position = "absolute", N.style.top = N.style.left = "0px";
4915
+ const X = this._document.createElement("div");
4916
+ X.style.visibility = "hidden", X.style.width = X.style.height = "10px", X.style.position = "absolute", X.style.top = X.style.left = "0px";
4917
4917
  for (const o of [I.loadedName, m]) {
4918
4918
  const h = this._document.createElement("span");
4919
- h.textContent = "Hi", h.style.fontFamily = o, N.append(h);
4919
+ h.textContent = "Hi", h.style.fontFamily = o, X.append(h);
4920
4920
  }
4921
- this._document.body.append(N), G(m, () => {
4922
- N.remove(), g.complete();
4921
+ this._document.body.append(X), G(m, () => {
4922
+ X.remove(), g.complete();
4923
4923
  });
4924
4924
  }
4925
4925
  }
@@ -5118,8 +5118,8 @@ const PZ = class PZ {
5118
5118
  let m = 0;
5119
5119
  G.setUint8(m++, I.guessFallback ? 1 : 0), G.setUint32(m, 0), m += 4, A = 0;
5120
5120
  for (const W of PZ.strings) {
5121
- const a = C[W], t = a.length;
5122
- A += 4 + t, G.setUint32(m, t), c.set(a, m + 4), m += 4 + t;
5121
+ const a = C[W], n = a.length;
5122
+ A += 4 + n, G.setUint32(m, n), c.set(a, m + 4), m += 4 + n;
5123
5123
  }
5124
5124
  return G.setUint32(m - A - 4, A), I.style && (G.setUint32(m, i.length), c.set(i, m + 4), m += 4 + i.length, G.setUint32(m, Z.length), c.set(Z, m + 4), m += 4 + Z.length), CI(m <= s.byteLength, "SubstitionInfo.write: Buffer overflow"), s.transferToFixedLength(m);
5125
5125
  }
@@ -5300,53 +5300,53 @@ const f = class f {
5300
5300
  static write(I) {
5301
5301
  const g = I.systemFontInfo ? vb.write(I.systemFontInfo) : null, C = I.cssFontInfo ? Ob.write(I.cssFontInfo) : null, A = new TextEncoder(), i = {};
5302
5302
  let Z = 0;
5303
- for (const e of f.strings)
5304
- i[e] = A.encode(I[e]), Z += 4 + i[e].length;
5303
+ for (const t of f.strings)
5304
+ i[t] = A.encode(I[t]), Z += 4 + i[t].length;
5305
5305
  const d = l(f, Eg) + 4 + Z + 4 + (g ? g.byteLength : 0) + 4 + (C ? C.byteLength : 0) + 4 + (I.data ? I.data.length : 0), s = new ArrayBuffer(d), c = new Uint8Array(s), G = new DataView(s);
5306
5306
  let m = 0;
5307
5307
  const W = f.bools.length;
5308
- let a = 0, t = 0;
5309
- for (let e = 0; e < W; e++) {
5310
- const X = I[f.bools[e]];
5311
- a |= (X === void 0 ? 0 : X ? 2 : 1) << t, t += 2, (t === 8 || e === W - 1) && (G.setUint8(m++, a), a = 0, t = 0);
5308
+ let a = 0, n = 0;
5309
+ for (let t = 0; t < W; t++) {
5310
+ const N = I[f.bools[t]];
5311
+ a |= (N === void 0 ? 0 : N ? 2 : 1) << n, n += 2, (n === 8 || t === W - 1) && (G.setUint8(m++, a), a = 0, n = 0);
5312
5312
  }
5313
5313
  CI(m === l(f, Vd), "FontInfo.write: Boolean properties offset mismatch");
5314
- for (const e of f.numbers)
5315
- G.setFloat64(m, I[e]), m += 8;
5314
+ for (const t of f.numbers)
5315
+ G.setFloat64(m, I[t]), m += 8;
5316
5316
  if (CI(m === l(f, Nd), "FontInfo.write: Number properties offset mismatch"), I.bbox) {
5317
5317
  G.setUint8(m++, 4);
5318
- for (const e of I.bbox)
5319
- G.setInt16(m, e, !0), m += 2;
5318
+ for (const t of I.bbox)
5319
+ G.setInt16(m, t, !0), m += 2;
5320
5320
  } else
5321
5321
  G.setUint8(m++, 0), m += 2 * 4;
5322
5322
  if (CI(m === l(f, Xd), "FontInfo.write: BBox properties offset mismatch"), I.fontMatrix) {
5323
5323
  G.setUint8(m++, 6);
5324
- for (const e of I.fontMatrix)
5325
- G.setFloat64(m, e, !0), m += 8;
5324
+ for (const t of I.fontMatrix)
5325
+ G.setFloat64(m, t, !0), m += 8;
5326
5326
  } else
5327
5327
  G.setUint8(m++, 0), m += 8 * 6;
5328
5328
  if (CI(m === l(f, Rd), "FontInfo.write: FontMatrix properties offset mismatch"), I.defaultVMetrics) {
5329
5329
  G.setUint8(m++, 1);
5330
- for (const e of I.defaultVMetrics)
5331
- G.setInt16(m, e, !0), m += 2;
5330
+ for (const t of I.defaultVMetrics)
5331
+ G.setInt16(m, t, !0), m += 2;
5332
5332
  } else
5333
5333
  G.setUint8(m++, 0), m += 3 * 2;
5334
5334
  CI(m === l(f, Eg), "FontInfo.write: DefaultVMetrics properties offset mismatch"), G.setUint32(l(f, Eg), 0), m += 4;
5335
- for (const e of f.strings) {
5336
- const X = i[e], V = X.length;
5337
- G.setUint32(m, V), c.set(X, m + 4), m += 4 + V;
5335
+ for (const t of f.strings) {
5336
+ const N = i[t], V = N.length;
5337
+ G.setUint32(m, V), c.set(N, m + 4), m += 4 + V;
5338
5338
  }
5339
5339
  if (G.setUint32(l(f, Eg), m - l(f, Eg) - 4), !g)
5340
5340
  G.setUint32(m, 0), m += 4;
5341
5341
  else {
5342
- const e = g.byteLength;
5343
- G.setUint32(m, e), CI(m + 4 + e <= s.byteLength, "FontInfo.write: Buffer overflow at systemFontInfo"), c.set(new Uint8Array(g), m + 4), m += 4 + e;
5342
+ const t = g.byteLength;
5343
+ G.setUint32(m, t), CI(m + 4 + t <= s.byteLength, "FontInfo.write: Buffer overflow at systemFontInfo"), c.set(new Uint8Array(g), m + 4), m += 4 + t;
5344
5344
  }
5345
5345
  if (!C)
5346
5346
  G.setUint32(m, 0), m += 4;
5347
5347
  else {
5348
- const e = C.byteLength;
5349
- G.setUint32(m, e), CI(m + 4 + e <= s.byteLength, "FontInfo.write: Buffer overflow at cssFontInfo"), c.set(new Uint8Array(C), m + 4), m += 4 + e;
5348
+ const t = C.byteLength;
5349
+ G.setUint32(m, t), CI(m + 4 + t <= s.byteLength, "FontInfo.write: Buffer overflow at cssFontInfo"), c.set(new Uint8Array(C), m + 4), m += 4 + t;
5350
5350
  }
5351
5351
  return I.data === void 0 ? (G.setUint32(m, 0), m += 4) : (G.setUint32(m, I.data.length), c.set(I.data, m + 4), m += 4 + I.data.length), CI(m <= s.byteLength, "FontInfo.write: Buffer overflow"), s.transferToFixedLength(m);
5352
5352
  }
@@ -5384,24 +5384,24 @@ const nI = class nI {
5384
5384
  throw new Error(`Unsupported pattern type: ${I[0]}`);
5385
5385
  }
5386
5386
  const G = Math.floor(A.length / 2), m = Math.floor(i.length / 3), W = Z.length, a = d.length;
5387
- let t = 0;
5387
+ let n = 0;
5388
5388
  for (const h of d)
5389
- t += 1, t = Math.ceil(t / 4) * 4, t += 4 + h.coords.length * 4, t += 4 + h.colors.length * 4, h.verticesPerRow !== void 0 && (t += 4);
5390
- const e = 20 + G * 8 + m * 3 + W * 8 + (C ? 16 : 0) + (c ? 3 : 0) + t, X = new ArrayBuffer(e), V = new DataView(X), y = new Uint8Array(X);
5389
+ n += 1, n = Math.ceil(n / 4) * 4, n += 4 + h.coords.length * 4, n += 4 + h.colors.length * 4, h.verticesPerRow !== void 0 && (n += 4);
5390
+ const t = 20 + G * 8 + m * 3 + W * 8 + (C ? 16 : 0) + (c ? 3 : 0) + n, N = new ArrayBuffer(t), V = new DataView(N), y = new Uint8Array(N);
5391
5391
  V.setUint8(l(nI, Kc), g), V.setUint8(l(nI, Sc), C ? 1 : 0), V.setUint8(l(nI, pc), c ? 1 : 0), V.setUint8(l(nI, Fc), s), V.setUint32(l(nI, Jc), G, !0), V.setUint32(l(nI, zc), m, !0), V.setUint32(l(nI, kc), W, !0), V.setUint32(l(nI, Lc), a, !0);
5392
- let N = 20;
5393
- new Float32Array(X, N, G * 2).set(A), N += G * 8, y.set(i, N), N += m * 3;
5394
- for (const [h, n] of Z)
5395
- V.setFloat32(N, h, !0), N += 4, V.setUint32(N, parseInt(n.slice(1), 16), !0), N += 4;
5392
+ let X = 20;
5393
+ new Float32Array(N, X, G * 2).set(A), X += G * 8, y.set(i, X), X += m * 3;
5394
+ for (const [h, e] of Z)
5395
+ V.setFloat32(X, h, !0), X += 4, V.setUint32(X, parseInt(e.slice(1), 16), !0), X += 4;
5396
5396
  if (C)
5397
5397
  for (const h of C)
5398
- V.setFloat32(N, h, !0), N += 4;
5399
- c && (y.set(c, N), N += 3);
5398
+ V.setFloat32(X, h, !0), X += 4;
5399
+ c && (y.set(c, X), X += 3);
5400
5400
  for (let h = 0; h < d.length; h++) {
5401
- const n = d[h];
5402
- V.setUint8(N, n.type), N += 1, N = Math.ceil(N / 4) * 4, V.setUint32(N, n.coords.length, !0), N += 4, new Int32Array(X, N, n.coords.length).set(n.coords), N += n.coords.length * 4, V.setUint32(N, n.colors.length, !0), N += 4, new Int32Array(X, N, n.colors.length).set(n.colors), N += n.colors.length * 4, n.verticesPerRow !== void 0 && (V.setUint32(N, n.verticesPerRow, !0), N += 4);
5401
+ const e = d[h];
5402
+ V.setUint8(X, e.type), X += 1, X = Math.ceil(X / 4) * 4, V.setUint32(X, e.coords.length, !0), X += 4, new Int32Array(N, X, e.coords.length).set(e.coords), X += e.coords.length * 4, V.setUint32(X, e.colors.length, !0), X += 4, new Int32Array(N, X, e.colors.length).set(e.colors), X += e.colors.length * 4, e.verticesPerRow !== void 0 && (V.setUint32(X, e.verticesPerRow, !0), X += 4);
5403
5403
  }
5404
- return X;
5404
+ return N;
5405
5405
  }
5406
5406
  getIR() {
5407
5407
  const I = this.view, g = this.data[l(nI, Kc)], C = !!this.data[l(nI, Sc)], A = !!this.data[l(nI, pc)], i = I.getUint32(l(nI, Jc), !0), Z = I.getUint32(l(nI, zc), !0), d = I.getUint32(l(nI, kc), !0), s = I.getUint32(l(nI, Lc), !0);
@@ -5411,7 +5411,7 @@ const nI = class nI {
5411
5411
  const m = new Uint8Array(this.buffer, c, Z * 3);
5412
5412
  c += Z * 3;
5413
5413
  const W = [];
5414
- for (let X = 0; X < d; ++X) {
5414
+ for (let N = 0; N < d; ++N) {
5415
5415
  const V = I.getFloat32(c, !0);
5416
5416
  c += 4;
5417
5417
  const y = I.getUint32(c, !0);
@@ -5420,46 +5420,46 @@ const nI = class nI {
5420
5420
  let a = null;
5421
5421
  if (C) {
5422
5422
  a = [];
5423
- for (let X = 0; X < 4; ++X)
5423
+ for (let N = 0; N < 4; ++N)
5424
5424
  a.push(I.getFloat32(c, !0)), c += 4;
5425
5425
  }
5426
- let t = null;
5427
- A && (t = new Uint8Array(this.buffer, c, 3), c += 3);
5428
- const e = [];
5429
- for (let X = 0; X < s; ++X) {
5426
+ let n = null;
5427
+ A && (n = new Uint8Array(this.buffer, c, 3), c += 3);
5428
+ const t = [];
5429
+ for (let N = 0; N < s; ++N) {
5430
5430
  const V = I.getUint8(c);
5431
5431
  c += 1, c = Math.ceil(c / 4) * 4;
5432
5432
  const y = I.getUint32(c, !0);
5433
5433
  c += 4;
5434
- const N = new Int32Array(this.buffer, c, y);
5434
+ const X = new Int32Array(this.buffer, c, y);
5435
5435
  c += y * 4;
5436
5436
  const o = I.getUint32(c, !0);
5437
5437
  c += 4;
5438
5438
  const h = new Int32Array(this.buffer, c, o);
5439
5439
  c += o * 4;
5440
- const n = {
5440
+ const e = {
5441
5441
  type: V,
5442
- coords: N,
5442
+ coords: X,
5443
5443
  colors: h
5444
5444
  };
5445
- V === j0.LATTICE && (n.verticesPerRow = I.getUint32(c, !0), c += 4), e.push(n);
5445
+ V === j0.LATTICE && (e.verticesPerRow = I.getUint32(c, !0), c += 4), t.push(e);
5446
5446
  }
5447
5447
  if (g === 1)
5448
5448
  return ["RadialAxial", "axial", a, W, Array.from(G.slice(0, 2)), Array.from(G.slice(2, 4)), null, null];
5449
5449
  if (g === 2)
5450
5450
  return ["RadialAxial", "radial", a, W, [G[0], G[1]], [G[3], G[4]], G[2], G[5]];
5451
5451
  if (g === 3) {
5452
- const X = this.data[l(nI, Fc)];
5452
+ const N = this.data[l(nI, Fc)];
5453
5453
  let V = null;
5454
5454
  if (G.length > 0) {
5455
- let y = G[0], N = G[0], o = G[1], h = G[1];
5456
- for (let n = 0; n < G.length; n += 2) {
5457
- const R = G[n], u = G[n + 1];
5458
- y = y > R ? R : y, o = o > u ? u : o, N = N < R ? R : N, h = h < u ? u : h;
5455
+ let y = G[0], X = G[0], o = G[1], h = G[1];
5456
+ for (let e = 0; e < G.length; e += 2) {
5457
+ const R = G[e], u = G[e + 1];
5458
+ y = y > R ? R : y, o = o > u ? u : o, X = X < R ? R : X, h = h < u ? u : h;
5459
5459
  }
5460
- V = [y, o, N, h];
5460
+ V = [y, o, X, h];
5461
5461
  }
5462
- return ["Mesh", X, G, m, e, V, a, t];
5462
+ return ["Mesh", N, G, m, t, V, a, n];
5463
5463
  }
5464
5464
  throw new Error(`Unsupported pattern kind: ${g}`);
5465
5465
  }
@@ -5995,10 +5995,10 @@ class dw extends AW {
5995
5995
  return Y(this, F, rs).call(this, A, i, Z, G), c;
5996
5996
  }
5997
5997
  addHCMFilter(g, C) {
5998
- var t;
5998
+ var n;
5999
5999
  const A = `${g}-${C}`, i = "base";
6000
6000
  let Z = l(this, F, Ls).get(i);
6001
- if ((Z == null ? void 0 : Z.key) === A || (Z ? ((t = Z.filter) == null || t.remove(), Z.key = A, Z.url = "none", Z.filter = null) : (Z = {
6001
+ if ((Z == null ? void 0 : Z.key) === A || (Z ? ((n = Z.filter) == null || n.remove(), Z.key = A, Z.url = "none", Z.filter = null) : (Z = {
6002
6002
  key: A,
6003
6003
  url: "none",
6004
6004
  filter: null
@@ -6010,17 +6010,17 @@ class dw extends AW {
6010
6010
  if (C = p.makeHexColor(...s), l(this, F, LZ).style.color = "", g === "#000000" && C === "#ffffff" || g === C)
6011
6011
  return Z.url;
6012
6012
  const c = new Array(256);
6013
- for (let e = 0; e <= 255; e++) {
6014
- const X = e / 255;
6015
- c[e] = X <= 0.03928 ? X / 12.92 : ((X + 0.055) / 1.055) ** 2.4;
6013
+ for (let t = 0; t <= 255; t++) {
6014
+ const N = t / 255;
6015
+ c[t] = N <= 0.03928 ? N / 12.92 : ((N + 0.055) / 1.055) ** 2.4;
6016
6016
  }
6017
6017
  const G = c.join(","), m = `g_${l(this, TA)}_hcm_filter`, W = Z.filter = Y(this, F, rZ).call(this, m);
6018
6018
  Y(this, F, rs).call(this, G, G, G, W), Y(this, F, Bm).call(this, W);
6019
- const a = (e, X) => {
6020
- const V = d[e] / 255, y = s[e] / 255, N = new Array(X + 1);
6021
- for (let o = 0; o <= X; o++)
6022
- N[o] = V + o / X * (y - V);
6023
- return N.join(",");
6019
+ const a = (t, N) => {
6020
+ const V = d[t] / 255, y = s[t] / 255, X = new Array(N + 1);
6021
+ for (let o = 0; o <= N; o++)
6022
+ X[o] = V + o / N * (y - V);
6023
+ return X.join(",");
6024
6024
  };
6025
6025
  return Y(this, F, rs).call(this, a(0, 5), a(1, 5), a(2, 5), W), Z.url = Y(this, F, TZ).call(this, m), Z.url;
6026
6026
  }
@@ -6059,22 +6059,22 @@ class dw extends AW {
6059
6059
  }, l(this, F, Ls).set(g, s)), !C || !A))
6060
6060
  return s.url;
6061
6061
  const [c, G] = [C, A].map(Y(this, F, Qs).bind(this));
6062
- let m = Math.round(0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]), W = Math.round(0.2126 * G[0] + 0.7152 * G[1] + 0.0722 * G[2]), [a, t] = [i, Z].map(Y(this, F, Qs).bind(this));
6063
- W < m && ([m, W, a, t] = [W, m, t, a]), l(this, F, LZ).style.color = "";
6064
- const e = (N, o, h) => {
6065
- const n = new Array(256), R = (W - m) / h, u = N / 255, H = (o - N) / (255 * h);
6062
+ let m = Math.round(0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]), W = Math.round(0.2126 * G[0] + 0.7152 * G[1] + 0.0722 * G[2]), [a, n] = [i, Z].map(Y(this, F, Qs).bind(this));
6063
+ W < m && ([m, W, a, n] = [W, m, n, a]), l(this, F, LZ).style.color = "";
6064
+ const t = (X, o, h) => {
6065
+ const e = new Array(256), R = (W - m) / h, u = X / 255, H = (o - X) / (255 * h);
6066
6066
  let K = 0;
6067
6067
  for (let D = 0; D <= h; D++) {
6068
6068
  const z = Math.round(m + D * R), L = u + D * H;
6069
6069
  for (let T = K; T <= z; T++)
6070
- n[T] = L;
6070
+ e[T] = L;
6071
6071
  K = z + 1;
6072
6072
  }
6073
6073
  for (let D = K; D < 256; D++)
6074
- n[D] = n[K - 1];
6075
- return n.join(",");
6076
- }, X = `g_${l(this, TA)}_hcm_${g}_filter`, V = s.filter = Y(this, F, rZ).call(this, X);
6077
- return Y(this, F, Bm).call(this, V), Y(this, F, rs).call(this, e(a[0], t[0], 5), e(a[1], t[1], 5), e(a[2], t[2], 5), V), s.url = Y(this, F, TZ).call(this, X), s.url;
6074
+ e[D] = e[K - 1];
6075
+ return e.join(",");
6076
+ }, N = `g_${l(this, TA)}_hcm_${g}_filter`, V = s.filter = Y(this, F, rZ).call(this, N);
6077
+ return Y(this, F, Bm).call(this, V), Y(this, F, rs).call(this, t(a[0], n[0], 5), t(a[1], n[1], 5), t(a[2], n[2], 5), V), s.url = Y(this, F, TZ).call(this, N), s.url;
6078
6078
  }
6079
6079
  destroy(g = !1) {
6080
6080
  var C, A, i, Z;
@@ -6643,10 +6643,10 @@ class Ww extends Vo {
6643
6643
  if (this.isOriginBased()) {
6644
6644
  let W = p.transform(C, g.baseTransform);
6645
6645
  this.matrix && (W = p.transform(W, this.matrix));
6646
- const a = 1e-3, t = Math.hypot(W[0], W[1]), e = Math.hypot(W[2], W[3]), X = (W[0] * W[2] + W[1] * W[3]) / (t * e);
6647
- if (Math.abs(X) < a)
6646
+ const a = 1e-3, n = Math.hypot(W[0], W[1]), t = Math.hypot(W[2], W[3]), N = (W[0] * W[2] + W[1] * W[3]) / (n * t);
6647
+ if (Math.abs(N) < a)
6648
6648
  if (this.isRadial()) {
6649
- if (Math.abs(t - e) < a)
6649
+ if (Math.abs(n - t) < a)
6650
6650
  return this._createGradient(I, W);
6651
6651
  } else
6652
6652
  return this._createGradient(I, W);
@@ -6664,21 +6664,21 @@ function p0(b, I, g, C, A, i, Z, d) {
6664
6664
  const s = I.coords, c = I.colors, G = b.data, m = b.width * 4;
6665
6665
  let W;
6666
6666
  s[g + 1] > s[C + 1] && (W = g, g = C, C = W, W = i, i = Z, Z = W), s[C + 1] > s[A + 1] && (W = C, C = A, A = W, W = Z, Z = d, d = W), s[g + 1] > s[C + 1] && (W = g, g = C, C = W, W = i, i = Z, Z = W);
6667
- const a = (s[g] + I.offsetX) * I.scaleX, t = (s[g + 1] + I.offsetY) * I.scaleY, e = (s[C] + I.offsetX) * I.scaleX, X = (s[C + 1] + I.offsetY) * I.scaleY, V = (s[A] + I.offsetX) * I.scaleX, y = (s[A + 1] + I.offsetY) * I.scaleY;
6668
- if (t >= y)
6667
+ const a = (s[g] + I.offsetX) * I.scaleX, n = (s[g + 1] + I.offsetY) * I.scaleY, t = (s[C] + I.offsetX) * I.scaleX, N = (s[C + 1] + I.offsetY) * I.scaleY, V = (s[A] + I.offsetX) * I.scaleX, y = (s[A + 1] + I.offsetY) * I.scaleY;
6668
+ if (n >= y)
6669
6669
  return;
6670
- const N = c[i], o = c[i + 1], h = c[i + 2], n = c[Z], R = c[Z + 1], u = c[Z + 2], H = c[d], K = c[d + 1], D = c[d + 2], z = Math.round(t), L = Math.round(y);
6670
+ const X = c[i], o = c[i + 1], h = c[i + 2], e = c[Z], R = c[Z + 1], u = c[Z + 2], H = c[d], K = c[d + 1], D = c[d + 2], z = Math.round(n), L = Math.round(y);
6671
6671
  let T, x, r, Q, iI, Ng, Wg, pg;
6672
6672
  for (let hI = z; hI <= L; hI++) {
6673
- if (hI < X) {
6674
- const SI = hI < t ? 0 : (t - hI) / (t - X);
6675
- T = a - (a - e) * SI, x = N - (N - n) * SI, r = o - (o - R) * SI, Q = h - (h - u) * SI;
6673
+ if (hI < N) {
6674
+ const SI = hI < n ? 0 : (n - hI) / (n - N);
6675
+ T = a - (a - t) * SI, x = X - (X - e) * SI, r = o - (o - R) * SI, Q = h - (h - u) * SI;
6676
6676
  } else {
6677
6677
  let SI;
6678
- hI > y ? SI = 1 : X === y ? SI = 0 : SI = (X - hI) / (X - y), T = e - (e - V) * SI, x = n - (n - H) * SI, r = R - (R - K) * SI, Q = u - (u - D) * SI;
6678
+ hI > y ? SI = 1 : N === y ? SI = 0 : SI = (N - hI) / (N - y), T = t - (t - V) * SI, x = e - (e - H) * SI, r = R - (R - K) * SI, Q = u - (u - D) * SI;
6679
6679
  }
6680
6680
  let eI;
6681
- hI < t ? eI = 0 : hI > y ? eI = 1 : eI = (t - hI) / (t - y), iI = a - (a - V) * eI, Ng = N - (N - H) * eI, Wg = o - (o - K) * eI, pg = h - (h - D) * eI;
6681
+ hI < n ? eI = 0 : hI > y ? eI = 1 : eI = (n - hI) / (n - y), iI = a - (a - V) * eI, Ng = X - (X - H) * eI, Wg = o - (o - K) * eI, pg = h - (h - D) * eI;
6682
6682
  const DC = Math.round(Math.min(T, iI)), HI = Math.round(Math.max(T, iI));
6683
6683
  let hg = m * hI + DC * 4;
6684
6684
  for (let SI = DC; SI <= HI; SI++)
@@ -6710,27 +6710,27 @@ class ww extends Vo {
6710
6710
  super(), this._coords = I[2], this._colors = I[3], this._figures = I[4], this._bounds = I[5], this._bbox = I[6], this._background = I[7], this.matrix = null;
6711
6711
  }
6712
6712
  _createMeshCanvas(I, g, C) {
6713
- const d = Math.floor(this._bounds[0]), s = Math.floor(this._bounds[1]), c = Math.ceil(this._bounds[2]) - d, G = Math.ceil(this._bounds[3]) - s, m = Math.min(Math.ceil(Math.abs(c * I[0] * 1.1)), 3e3), W = Math.min(Math.ceil(Math.abs(G * I[1] * 1.1)), 3e3), a = c / m, t = G / W, e = {
6713
+ const d = Math.floor(this._bounds[0]), s = Math.floor(this._bounds[1]), c = Math.ceil(this._bounds[2]) - d, G = Math.ceil(this._bounds[3]) - s, m = Math.min(Math.ceil(Math.abs(c * I[0] * 1.1)), 3e3), W = Math.min(Math.ceil(Math.abs(G * I[1] * 1.1)), 3e3), a = c / m, n = G / W, t = {
6714
6714
  coords: this._coords,
6715
6715
  colors: this._colors,
6716
6716
  offsetX: -d,
6717
6717
  offsetY: -s,
6718
6718
  scaleX: 1 / a,
6719
- scaleY: 1 / t
6720
- }, X = m + 2 * 2, V = W + 2 * 2, y = C.getCanvas("mesh", X, V), N = y.context, o = N.createImageData(m, W);
6719
+ scaleY: 1 / n
6720
+ }, N = m + 2 * 2, V = W + 2 * 2, y = C.getCanvas("mesh", N, V), X = y.context, o = X.createImageData(m, W);
6721
6721
  if (g) {
6722
- const n = o.data;
6723
- for (let R = 0, u = n.length; R < u; R += 4)
6724
- n[R] = g[0], n[R + 1] = g[1], n[R + 2] = g[2], n[R + 3] = 255;
6722
+ const e = o.data;
6723
+ for (let R = 0, u = e.length; R < u; R += 4)
6724
+ e[R] = g[0], e[R + 1] = g[1], e[R + 2] = g[2], e[R + 3] = 255;
6725
6725
  }
6726
- for (const n of this._figures)
6727
- hw(o, n, e);
6728
- return N.putImageData(o, 2, 2), {
6726
+ for (const e of this._figures)
6727
+ hw(o, e, t);
6728
+ return X.putImageData(o, 2, 2), {
6729
6729
  canvas: y.canvas,
6730
6730
  offsetX: d - 2 * a,
6731
- offsetY: s - 2 * t,
6731
+ offsetY: s - 2 * n,
6732
6732
  scaleX: a,
6733
- scaleY: t
6733
+ scaleY: n
6734
6734
  };
6735
6735
  }
6736
6736
  isModifyingCurrentTransform() {
@@ -6789,19 +6789,19 @@ const fo = {
6789
6789
  ystep: G
6790
6790
  } = this;
6791
6791
  c = Math.abs(c), G = Math.abs(G), n0("TilingType: " + Z);
6792
- const m = C[0], W = C[1], a = C[2], t = C[3], e = a - m, X = t - W, V = new Float32Array(2);
6792
+ const m = C[0], W = C[1], a = C[2], n = C[3], t = a - m, N = n - W, V = new Float32Array(2);
6793
6793
  p.singularValueDecompose2dScale(this.matrix, V);
6794
- const [y, N] = V;
6794
+ const [y, X] = V;
6795
6795
  p.singularValueDecompose2dScale(this.baseTransform, V);
6796
- const o = y * V[0], h = N * V[1];
6797
- let n = e, R = X, u = !1, H = !1;
6798
- const K = Math.ceil(c * o), D = Math.ceil(G * h), z = Math.ceil(e * o), L = Math.ceil(X * h);
6799
- K >= z ? n = c : u = !0, D >= L ? R = G : H = !0;
6800
- const T = this.getSizeAndScale(n, this.ctx.canvas.width, o), x = this.getSizeAndScale(R, this.ctx.canvas.height, h), r = I.cachedCanvases.getCanvas("pattern", T.size, x.size), Q = r.context, iI = s.createCanvasGraphics(Q, g);
6801
- if (iI.groupLevel = I.groupLevel, this.setFillAndStrokeStyleToContext(iI, i, d), Q.translate(-T.scale * m, -x.scale * W), iI.transform(0, T.scale, 0, 0, x.scale, 0, 0), Q.save(), (Ng = iI.dependencyTracker) == null || Ng.save(), this.clipBbox(iI, m, W, a, t), iI.baseTransform = DI(iI.ctx), iI.executeOperatorList(A), iI.endDrawing(), (Wg = iI.dependencyTracker) == null || Wg.restore(), Q.restore(), u || H) {
6796
+ const o = y * V[0], h = X * V[1];
6797
+ let e = t, R = N, u = !1, H = !1;
6798
+ const K = Math.ceil(c * o), D = Math.ceil(G * h), z = Math.ceil(t * o), L = Math.ceil(N * h);
6799
+ K >= z ? e = c : u = !0, D >= L ? R = G : H = !0;
6800
+ const T = this.getSizeAndScale(e, this.ctx.canvas.width, o), x = this.getSizeAndScale(R, this.ctx.canvas.height, h), r = I.cachedCanvases.getCanvas("pattern", T.size, x.size), Q = r.context, iI = s.createCanvasGraphics(Q, g);
6801
+ if (iI.groupLevel = I.groupLevel, this.setFillAndStrokeStyleToContext(iI, i, d), Q.translate(-T.scale * m, -x.scale * W), iI.transform(0, T.scale, 0, 0, x.scale, 0, 0), Q.save(), (Ng = iI.dependencyTracker) == null || Ng.save(), this.clipBbox(iI, m, W, a, n), iI.baseTransform = DI(iI.ctx), iI.executeOperatorList(A), iI.endDrawing(), (Wg = iI.dependencyTracker) == null || Wg.restore(), Q.restore(), u || H) {
6802
6802
  const pg = r.canvas;
6803
- u && (n = c), H && (R = G);
6804
- const hI = this.getSizeAndScale(n, this.ctx.canvas.width, o), eI = this.getSizeAndScale(R, this.ctx.canvas.height, h), DC = hI.size, HI = eI.size, hg = I.cachedCanvases.getCanvas("pattern-workaround", DC, HI), SI = hg.context, R0 = u ? Math.floor(e / c) : 0, y0 = H ? Math.floor(X / G) : 0;
6803
+ u && (e = c), H && (R = G);
6804
+ const hI = this.getSizeAndScale(e, this.ctx.canvas.width, o), eI = this.getSizeAndScale(R, this.ctx.canvas.height, h), DC = hI.size, HI = eI.size, hg = I.cachedCanvases.getCanvas("pattern-workaround", DC, HI), SI = hg.context, R0 = u ? Math.floor(t / c) : 0, y0 = H ? Math.floor(N / G) : 0;
6805
6805
  for (let Ns = 0; Ns <= R0; Ns++)
6806
6806
  for (let ci = 0; ci <= y0; ci++)
6807
6807
  SI.drawImage(pg, DC * Ns, HI * ci, DC, HI, 0, 0, DC, HI);
@@ -6877,16 +6877,16 @@ function tw({
6877
6877
  const d = _I.isLittleEndian ? 4278190080 : 255, [s, c] = Z ? [i, d] : [d, i], G = C >> 3, m = C & 7, W = b.length;
6878
6878
  g = new Uint32Array(g.buffer);
6879
6879
  let a = 0;
6880
- for (let t = 0; t < A; t++) {
6881
- for (const X = I + G; I < X; I++) {
6880
+ for (let n = 0; n < A; n++) {
6881
+ for (const N = I + G; I < N; I++) {
6882
6882
  const V = I < W ? b[I] : 255;
6883
6883
  g[a++] = V & 128 ? c : s, g[a++] = V & 64 ? c : s, g[a++] = V & 32 ? c : s, g[a++] = V & 16 ? c : s, g[a++] = V & 8 ? c : s, g[a++] = V & 4 ? c : s, g[a++] = V & 2 ? c : s, g[a++] = V & 1 ? c : s;
6884
6884
  }
6885
6885
  if (m === 0)
6886
6886
  continue;
6887
- const e = I < W ? b[I++] : 255;
6888
- for (let X = 0; X < m; X++)
6889
- g[a++] = e & 1 << 7 - X ? c : s;
6887
+ const t = I < W ? b[I++] : 255;
6888
+ for (let N = 0; N < m; N++)
6889
+ g[a++] = t & 1 << 7 - N ? c : s;
6890
6890
  }
6891
6891
  return {
6892
6892
  srcPos: I,
@@ -6950,18 +6950,18 @@ class Vw {
6950
6950
  }
6951
6951
  }
6952
6952
  function lb(b, I, g, C, A, i, Z, d, s, c) {
6953
- const [G, m, W, a, t, e] = DI(b);
6953
+ const [G, m, W, a, n, t] = DI(b);
6954
6954
  if (m === 0 && W === 0) {
6955
- const y = Z * G + t, N = Math.round(y), o = d * a + e, h = Math.round(o), n = (Z + s) * G + t, R = Math.abs(Math.round(n) - N) || 1, u = (d + c) * a + e, H = Math.abs(Math.round(u) - h) || 1;
6956
- return b.setTransform(Math.sign(G), 0, 0, Math.sign(a), N, h), b.drawImage(I, g, C, A, i, 0, 0, R, H), b.setTransform(G, m, W, a, t, e), [R, H];
6955
+ const y = Z * G + n, X = Math.round(y), o = d * a + t, h = Math.round(o), e = (Z + s) * G + n, R = Math.abs(Math.round(e) - X) || 1, u = (d + c) * a + t, H = Math.abs(Math.round(u) - h) || 1;
6956
+ return b.setTransform(Math.sign(G), 0, 0, Math.sign(a), X, h), b.drawImage(I, g, C, A, i, 0, 0, R, H), b.setTransform(G, m, W, a, n, t), [R, H];
6957
6957
  }
6958
6958
  if (G === 0 && a === 0) {
6959
- const y = d * W + t, N = Math.round(y), o = Z * m + e, h = Math.round(o), n = (d + c) * W + t, R = Math.abs(Math.round(n) - N) || 1, u = (Z + s) * m + e, H = Math.abs(Math.round(u) - h) || 1;
6960
- return b.setTransform(0, Math.sign(m), Math.sign(W), 0, N, h), b.drawImage(I, g, C, A, i, 0, 0, H, R), b.setTransform(G, m, W, a, t, e), [H, R];
6959
+ const y = d * W + n, X = Math.round(y), o = Z * m + t, h = Math.round(o), e = (d + c) * W + n, R = Math.abs(Math.round(e) - X) || 1, u = (Z + s) * m + t, H = Math.abs(Math.round(u) - h) || 1;
6960
+ return b.setTransform(0, Math.sign(m), Math.sign(W), 0, X, h), b.drawImage(I, g, C, A, i, 0, 0, H, R), b.setTransform(G, m, W, a, n, t), [H, R];
6961
6961
  }
6962
6962
  b.drawImage(I, g, C, A, i, Z, d, s, c);
6963
- const X = Math.hypot(G, m), V = Math.hypot(W, a);
6964
- return [X * s, V * c];
6963
+ const N = Math.hypot(G, m), V = Math.hypot(W, a);
6964
+ return [N * s, V * c];
6965
6965
  }
6966
6966
  class IB {
6967
6967
  constructor(I, g, C) {
@@ -7027,14 +7027,14 @@ function gB(b, I) {
7027
7027
  const g = I.height, C = I.width, A = g % jg, i = (g - A) / jg, Z = A === 0 ? i : i + 1, d = b.createImageData(C, jg);
7028
7028
  let s = 0, c;
7029
7029
  const G = I.data, m = d.data;
7030
- let W, a, t, e;
7030
+ let W, a, n, t;
7031
7031
  if (I.kind === sb.GRAYSCALE_1BPP) {
7032
- const X = G.byteLength, V = new Uint32Array(m.buffer, 0, m.byteLength >> 2), y = V.length, N = C + 7 >> 3, o = 4294967295, h = _I.isLittleEndian ? 4278190080 : 255;
7032
+ const N = G.byteLength, V = new Uint32Array(m.buffer, 0, m.byteLength >> 2), y = V.length, X = C + 7 >> 3, o = 4294967295, h = _I.isLittleEndian ? 4278190080 : 255;
7033
7033
  for (W = 0; W < Z; W++) {
7034
- for (t = W < i ? jg : A, c = 0, a = 0; a < t; a++) {
7035
- const n = X - s;
7034
+ for (n = W < i ? jg : A, c = 0, a = 0; a < n; a++) {
7035
+ const e = N - s;
7036
7036
  let R = 0;
7037
- const u = n > N ? C : n * 8 - 7, H = u & -8;
7037
+ const u = e > X ? C : e * 8 - 7, H = u & -8;
7038
7038
  let K = 0, D = 0;
7039
7039
  for (; R < H; R += 8)
7040
7040
  D = G[s++], V[c++] = D & 128 ? o : h, V[c++] = D & 64 ? o : h, V[c++] = D & 32 ? o : h, V[c++] = D & 16 ? o : h, V[c++] = D & 8 ? o : h, V[c++] = D & 4 ? o : h, V[c++] = D & 2 ? o : h, V[c++] = D & 1 ? o : h;
@@ -7046,12 +7046,12 @@ function gB(b, I) {
7046
7046
  b.putImageData(d, 0, W * jg);
7047
7047
  }
7048
7048
  } else if (I.kind === sb.RGBA_32BPP) {
7049
- for (a = 0, e = C * jg * 4, W = 0; W < i; W++)
7050
- m.set(G.subarray(s, s + e)), s += e, b.putImageData(d, 0, a), a += jg;
7051
- W < Z && (e = C * A * 4, m.set(G.subarray(s, s + e)), b.putImageData(d, 0, a));
7049
+ for (a = 0, t = C * jg * 4, W = 0; W < i; W++)
7050
+ m.set(G.subarray(s, s + t)), s += t, b.putImageData(d, 0, a), a += jg;
7051
+ W < Z && (t = C * A * 4, m.set(G.subarray(s, s + t)), b.putImageData(d, 0, a));
7052
7052
  } else if (I.kind === sb.RGB_24BPP)
7053
- for (t = jg, e = C * t, W = 0; W < Z; W++) {
7054
- for (W >= i && (t = A, e = C * t), c = 0, a = e; a--; )
7053
+ for (n = jg, t = C * n, W = 0; W < Z; W++) {
7054
+ for (W >= i && (n = A, t = C * n), c = 0, a = t; a--; )
7055
7055
  m[c++] = G[s++], m[c++] = G[s++], m[c++] = G[s++], m[c++] = 255;
7056
7056
  b.putImageData(d, 0, W * jg);
7057
7057
  }
@@ -7136,20 +7136,20 @@ const Do = class Do {
7136
7136
  return s;
7137
7137
  const G = c - s > $o && typeof C == "function", m = G ? Date.now() + ew : 0;
7138
7138
  let W = 0;
7139
- const a = this.commonObjs, t = this.objs;
7140
- let e, X;
7139
+ const a = this.commonObjs, n = this.objs;
7140
+ let t, N;
7141
7141
  for (; ; ) {
7142
7142
  if (A !== void 0 && s === A.nextBreakPoint)
7143
7143
  return A.breakIt(s, C), s;
7144
7144
  if (!i || i(s))
7145
- if (e = d[s], X = Z[s] ?? null, e !== _s.dependency)
7146
- X === null ? this[e](s) : this[e](s, ...X);
7145
+ if (t = d[s], N = Z[s] ?? null, t !== _s.dependency)
7146
+ N === null ? this[t](s) : this[t](s, ...N);
7147
7147
  else
7148
- for (const y of X) {
7148
+ for (const y of N) {
7149
7149
  (V = this.dependencyTracker) == null || V.recordNamedData(y, s);
7150
- const N = y.startsWith("g_") ? a : t;
7151
- if (!N.has(y))
7152
- return N.get(y, C), s;
7150
+ const X = y.startsWith("g_") ? a : n;
7151
+ if (!X.has(y))
7152
+ return X.get(y, C), s;
7153
7153
  }
7154
7154
  if (s++, s === c)
7155
7155
  return s;
@@ -7206,12 +7206,12 @@ const Do = class Do {
7206
7206
  m || (W = this.cachedCanvases.getCanvas("maskCanvas", A, i), CB(W.context, g));
7207
7207
  let a = p.transform(s, [1 / A, 0, 0, -1 / i, 0, 0]);
7208
7208
  a = p.transform(a, [1, 0, 0, 1, 0, -i]);
7209
- const t = OZ.slice();
7210
- p.axialAlignedBoundingBox([0, 0, A, i], a, t);
7211
- const [e, X, V, y] = t, N = Math.round(V - e) || 1, o = Math.round(y - X) || 1, h = this.cachedCanvases.getCanvas("fillCanvas", N, o), n = h.context, R = e, u = X;
7212
- n.translate(-R, -u), n.transform(...a), m || (m = this._scaleImage(W.canvas, EC(n)), m = m.img, c && d && c.set(G, m)), n.imageSmoothingEnabled = AB(DI(n), g.interpolate), lb(n, m, 0, 0, m.width, m.height, 0, 0, A, i), n.globalCompositeOperation = "source-in";
7213
- const H = p.transform(EC(n), [1, 0, 0, 1, -R, -u]);
7214
- return n.fillStyle = d ? Z.getPattern(C, this, H, mg.FILL, I) : Z, n.fillRect(0, 0, A, i), c && !d && (this.cachedCanvases.delete("fillCanvas"), c.set(G, h.canvas)), (D = this.dependencyTracker) == null || D.recordDependencies(I, WC.transformAndFill), {
7209
+ const n = OZ.slice();
7210
+ p.axialAlignedBoundingBox([0, 0, A, i], a, n);
7211
+ const [t, N, V, y] = n, X = Math.round(V - t) || 1, o = Math.round(y - N) || 1, h = this.cachedCanvases.getCanvas("fillCanvas", X, o), e = h.context, R = t, u = N;
7212
+ e.translate(-R, -u), e.transform(...a), m || (m = this._scaleImage(W.canvas, EC(e)), m = m.img, c && d && c.set(G, m)), e.imageSmoothingEnabled = AB(DI(e), g.interpolate), lb(e, m, 0, 0, m.width, m.height, 0, 0, A, i), e.globalCompositeOperation = "source-in";
7213
+ const H = p.transform(EC(e), [1, 0, 0, 1, -R, -u]);
7214
+ return e.fillStyle = d ? Z.getPattern(C, this, H, mg.FILL, I) : Z, e.fillRect(0, 0, A, i), c && !d && (this.cachedCanvases.delete("fillCanvas"), c.set(G, h.canvas)), (D = this.dependencyTracker) == null || D.recordDependencies(I, WC.transformAndFill), {
7215
7215
  canvas: h.canvas,
7216
7216
  offsetX: Math.round(R),
7217
7217
  offsetY: Math.round(u)
@@ -7320,19 +7320,19 @@ const Do = class Do {
7320
7320
  d === 0 || s === 0 || (this.genericComposeSMask(g.context, C, d, s, g.subtype, g.backdrop, g.transferMap, i, Z, g.offsetX, g.offsetY), I.save(), I.globalAlpha = 1, I.globalCompositeOperation = "source-over", I.setTransform(1, 0, 0, 1, 0, 0), I.drawImage(C.canvas, 0, 0), I.restore());
7321
7321
  }
7322
7322
  genericComposeSMask(I, g, C, A, i, Z, d, s, c, G, m) {
7323
- let W = I.canvas, a = s - G, t = c - m;
7323
+ let W = I.canvas, a = s - G, n = c - m;
7324
7324
  if (Z)
7325
- if (a < 0 || t < 0 || a + C > W.width || t + A > W.height) {
7326
- const X = this.cachedCanvases.getCanvas("maskExtension", C, A), V = X.context;
7327
- V.drawImage(W, -a, -t), V.globalCompositeOperation = "destination-atop", V.fillStyle = Z, V.fillRect(0, 0, C, A), V.globalCompositeOperation = "source-over", W = X.canvas, a = t = 0;
7325
+ if (a < 0 || n < 0 || a + C > W.width || n + A > W.height) {
7326
+ const N = this.cachedCanvases.getCanvas("maskExtension", C, A), V = N.context;
7327
+ V.drawImage(W, -a, -n), V.globalCompositeOperation = "destination-atop", V.fillStyle = Z, V.fillRect(0, 0, C, A), V.globalCompositeOperation = "source-over", W = N.canvas, a = n = 0;
7328
7328
  } else {
7329
7329
  I.save(), I.globalAlpha = 1, I.setTransform(1, 0, 0, 1, 0, 0);
7330
- const X = new Path2D();
7331
- X.rect(a, t, C, A), I.clip(X), I.globalCompositeOperation = "destination-atop", I.fillStyle = Z, I.fillRect(a, t, C, A), I.restore();
7330
+ const N = new Path2D();
7331
+ N.rect(a, n, C, A), I.clip(N), I.globalCompositeOperation = "destination-atop", I.fillStyle = Z, I.fillRect(a, n, C, A), I.restore();
7332
7332
  }
7333
7333
  g.save(), g.globalAlpha = 1, g.setTransform(1, 0, 0, 1, 0, 0), i === "Alpha" && d ? g.filter = this.filterFactory.addAlphaFilter(d) : i === "Luminosity" && (g.filter = this.filterFactory.addLuminosityFilter(d));
7334
- const e = new Path2D();
7335
- e.rect(s, c, C, A), g.clip(e), g.globalCompositeOperation = "destination-in", g.drawImage(W, a, t, C, A, s, c, C, A), g.restore();
7334
+ const t = new Path2D();
7335
+ t.rect(s, c, C, A), g.clip(t), g.globalCompositeOperation = "destination-in", g.drawImage(W, a, n, C, A, s, c, C, A), g.restore();
7336
7336
  }
7337
7337
  save(I) {
7338
7338
  var C;
@@ -7515,40 +7515,40 @@ const Do = class Do {
7515
7515
  this.moveText(I, 0, this.current.leading), (g = this.dependencyTracker) == null || g.recordIncrementalData("moveText", this.dependencyTracker.getSimpleIndex("leading") ?? I);
7516
7516
  }
7517
7517
  paintChar(I, g, C, A, i, Z) {
7518
- var V, y, N, o;
7519
- const d = this.ctx, s = this.current, c = s.font, G = s.textRenderingMode, m = s.fontSize / s.fontSizeScale, W = G & vI.FILL_STROKE_MASK, a = !!(G & vI.ADD_TO_PATH_FLAG), t = s.patternFill && !c.missingFile, e = s.patternStroke && !c.missingFile;
7520
- let X;
7521
- if ((c.disableFontFace || a || t || e) && !c.missingFile && (X = c.getPathGenerator(this.commonObjs, g)), X && (c.disableFontFace || t || e)) {
7518
+ var V, y, X, o;
7519
+ const d = this.ctx, s = this.current, c = s.font, G = s.textRenderingMode, m = s.fontSize / s.fontSizeScale, W = G & vI.FILL_STROKE_MASK, a = !!(G & vI.ADD_TO_PATH_FLAG), n = s.patternFill && !c.missingFile, t = s.patternStroke && !c.missingFile;
7520
+ let N;
7521
+ if ((c.disableFontFace || a || n || t) && !c.missingFile && (N = c.getPathGenerator(this.commonObjs, g)), N && (c.disableFontFace || n || t)) {
7522
7522
  d.save(), d.translate(C, A), d.scale(m, -m), (V = this.dependencyTracker) == null || V.recordCharacterBBox(I, d, c);
7523
7523
  let h;
7524
7524
  if (W === vI.FILL || W === vI.FILL_STROKE)
7525
7525
  if (i) {
7526
7526
  h = d.getTransform(), d.setTransform(...i);
7527
- const n = Y(this, vC, nm).call(this, X, h, i);
7528
- d.fill(n);
7527
+ const e = Y(this, vC, nm).call(this, N, h, i);
7528
+ d.fill(e);
7529
7529
  } else
7530
- d.fill(X);
7530
+ d.fill(N);
7531
7531
  if (W === vI.STROKE || W === vI.FILL_STROKE)
7532
7532
  if (Z) {
7533
7533
  h || (h = d.getTransform()), d.setTransform(...Z);
7534
7534
  const {
7535
- a: n,
7535
+ a: e,
7536
7536
  b: R,
7537
7537
  c: u,
7538
7538
  d: H
7539
- } = h, K = p.inverseTransform(Z), D = p.transform([n, R, u, H, 0, 0], K);
7540
- p.singularValueDecompose2dScale(D, bC), d.lineWidth *= Math.max(bC[0], bC[1]) / m, d.stroke(Y(this, vC, nm).call(this, X, h, Z));
7539
+ } = h, K = p.inverseTransform(Z), D = p.transform([e, R, u, H, 0, 0], K);
7540
+ p.singularValueDecompose2dScale(D, bC), d.lineWidth *= Math.max(bC[0], bC[1]) / m, d.stroke(Y(this, vC, nm).call(this, N, h, Z));
7541
7541
  } else
7542
- d.lineWidth /= m, d.stroke(X);
7542
+ d.lineWidth /= m, d.stroke(N);
7543
7543
  d.restore();
7544
7544
  } else
7545
- (W === vI.FILL || W === vI.FILL_STROKE) && (d.fillText(g, C, A), (y = this.dependencyTracker) == null || y.recordCharacterBBox(I, d, c, m, C, A, () => d.measureText(g))), (W === vI.STROKE || W === vI.FILL_STROKE) && (this.dependencyTracker && ((N = this.dependencyTracker) == null || N.recordCharacterBBox(I, d, c, m, C, A, () => d.measureText(g)).recordDependencies(I, WC.stroke)), d.strokeText(g, C, A));
7545
+ (W === vI.FILL || W === vI.FILL_STROKE) && (d.fillText(g, C, A), (y = this.dependencyTracker) == null || y.recordCharacterBBox(I, d, c, m, C, A, () => d.measureText(g))), (W === vI.STROKE || W === vI.FILL_STROKE) && (this.dependencyTracker && ((X = this.dependencyTracker) == null || X.recordCharacterBBox(I, d, c, m, C, A, () => d.measureText(g)).recordDependencies(I, WC.stroke)), d.strokeText(g, C, A));
7546
7546
  a && ((this.pendingTextPaths || (this.pendingTextPaths = [])).push({
7547
7547
  transform: DI(d),
7548
7548
  x: C,
7549
7549
  y: A,
7550
7550
  fontSize: m,
7551
- path: X
7551
+ path: N
7552
7552
  }), (o = this.dependencyTracker) == null || o.recordCharacterBBox(I, d, c, m, C, A));
7553
7553
  }
7554
7554
  get isFontSubpixelAAEnabled() {
@@ -7578,23 +7578,23 @@ const Do = class Do {
7578
7578
  (z = this.dependencyTracker) == null || z.recordOperation(I);
7579
7579
  return;
7580
7580
  }
7581
- const Z = this.ctx, d = C.fontSizeScale, s = C.charSpacing, c = C.wordSpacing, G = C.fontDirection, m = C.textHScale * G, W = g.length, a = A.vertical, t = a ? 1 : -1, e = A.defaultVMetrics, X = i * C.fontMatrix[0], V = C.textRenderingMode === vI.FILL && !A.disableFontFace && !C.patternFill;
7581
+ const Z = this.ctx, d = C.fontSizeScale, s = C.charSpacing, c = C.wordSpacing, G = C.fontDirection, m = C.textHScale * G, W = g.length, a = A.vertical, n = a ? 1 : -1, t = A.defaultVMetrics, N = i * C.fontMatrix[0], V = C.textRenderingMode === vI.FILL && !A.disableFontFace && !C.patternFill;
7582
7582
  Z.save(), C.textMatrix && Z.transform(...C.textMatrix), Z.translate(C.x, C.y + C.textRise), G > 0 ? Z.scale(m, -1) : Z.scale(m, 1);
7583
- let y, N;
7584
- const o = C.textRenderingMode & vI.FILL_STROKE_MASK, h = o === vI.FILL || o === vI.FILL_STROKE, n = o === vI.STROKE || o === vI.FILL_STROKE;
7583
+ let y, X;
7584
+ const o = C.textRenderingMode & vI.FILL_STROKE_MASK, h = o === vI.FILL || o === vI.FILL_STROKE, e = o === vI.STROKE || o === vI.FILL_STROKE;
7585
7585
  if (h && C.patternFill) {
7586
7586
  Z.save();
7587
7587
  const x = C.fillColor.getPattern(Z, this, EC(Z), mg.FILL, I);
7588
7588
  y = DI(Z), Z.restore(), Z.fillStyle = x;
7589
7589
  }
7590
- if (n && C.patternStroke) {
7590
+ if (e && C.patternStroke) {
7591
7591
  Z.save();
7592
7592
  const x = C.strokeColor.getPattern(Z, this, EC(Z), mg.STROKE, I);
7593
- N = DI(Z), Z.restore(), Z.strokeStyle = x;
7593
+ X = DI(Z), Z.restore(), Z.strokeStyle = x;
7594
7594
  }
7595
7595
  let R = C.lineWidth;
7596
7596
  const u = C.textMatrixScale;
7597
- if (u === 0 || R === 0 ? n && (R = this.getSinglePixelWidth()) : R /= u, d !== 1 && (Z.scale(d, d), R /= d), Z.lineWidth = R, A.isInvalidPDFjsFont) {
7597
+ if (u === 0 || R === 0 ? e && (R = this.getSinglePixelWidth()) : R /= u, d !== 1 && (Z.scale(d, d), R /= d), Z.lineWidth = R, A.isInvalidPDFjsFont) {
7598
7598
  const x = [];
7599
7599
  let r = 0;
7600
7600
  for (const iI of g)
@@ -7604,21 +7604,21 @@ const Do = class Do {
7604
7604
  const iI = Z.measureText(Q);
7605
7605
  this.dependencyTracker.recordBBox(I, this.ctx, -iI.actualBoundingBoxLeft, iI.actualBoundingBoxRight, -iI.actualBoundingBoxAscent, iI.actualBoundingBoxDescent).recordShowTextOperation(I);
7606
7606
  }
7607
- C.x += r * X * m, Z.restore(), this.compose();
7607
+ C.x += r * N * m, Z.restore(), this.compose();
7608
7608
  return;
7609
7609
  }
7610
7610
  let H = 0, K;
7611
7611
  for (K = 0; K < W; ++K) {
7612
7612
  const x = g[K];
7613
7613
  if (typeof x == "number") {
7614
- H += t * x * i / 1e3;
7614
+ H += n * x * i / 1e3;
7615
7615
  continue;
7616
7616
  }
7617
7617
  let r = !1;
7618
7618
  const Q = (x.isSpace ? c : 0) + s, iI = x.fontChar, Ng = x.accent;
7619
7619
  let Wg, pg, hI = x.width;
7620
7620
  if (a) {
7621
- const HI = x.vmetric || e, hg = -(x.vmetric ? HI[1] : hI * 0.5) * X, SI = HI[2] * X;
7621
+ const HI = x.vmetric || t, hg = -(x.vmetric ? HI[1] : hI * 0.5) * N, SI = HI[2] * N;
7622
7622
  hI = HI ? -HI[0] : hI, Wg = hg / d, pg = (H + SI) / d;
7623
7623
  } else
7624
7624
  Wg = H / d, pg = 0;
@@ -7636,34 +7636,34 @@ const Do = class Do {
7636
7636
  Z.fillText(iI, Wg, pg), (L = this.dependencyTracker) == null || L.recordCharacterBBox(I, Z, eI ? {
7637
7637
  bbox: null
7638
7638
  } : A, i / d, Wg, pg, () => eI ?? Z.measureText(iI));
7639
- else if (this.paintChar(I, iI, Wg, pg, y, N), Ng) {
7639
+ else if (this.paintChar(I, iI, Wg, pg, y, X), Ng) {
7640
7640
  const HI = Wg + i * Ng.offset.x / d, hg = pg - i * Ng.offset.y / d;
7641
- this.paintChar(I, Ng.fontChar, HI, hg, y, N);
7641
+ this.paintChar(I, Ng.fontChar, HI, hg, y, X);
7642
7642
  }
7643
7643
  }
7644
- const DC = a ? hI * X - Q * G : hI * X + Q * G;
7644
+ const DC = a ? hI * N - Q * G : hI * N + Q * G;
7645
7645
  H += DC, r && Z.restore();
7646
7646
  }
7647
7647
  a ? C.y -= H : C.x += H * m, Z.restore(), this.compose(), (T = this.dependencyTracker) == null || T.recordShowTextOperation(I);
7648
7648
  }
7649
7649
  showType3Text(I, g) {
7650
- const C = this.ctx, A = this.current, i = A.font, Z = A.fontSize, d = A.fontDirection, s = i.vertical ? 1 : -1, c = A.charSpacing, G = A.wordSpacing, m = A.textHScale * d, W = A.fontMatrix || Q0, a = g.length, t = A.textRenderingMode === vI.INVISIBLE;
7651
- let e, X, V, y;
7652
- if (t || Z === 0)
7650
+ const C = this.ctx, A = this.current, i = A.font, Z = A.fontSize, d = A.fontDirection, s = i.vertical ? 1 : -1, c = A.charSpacing, G = A.wordSpacing, m = A.textHScale * d, W = A.fontMatrix || Q0, a = g.length, n = A.textRenderingMode === vI.INVISIBLE;
7651
+ let t, N, V, y;
7652
+ if (n || Z === 0)
7653
7653
  return;
7654
7654
  this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, C.save(), A.textMatrix && C.transform(...A.textMatrix), C.translate(A.x, A.y + A.textRise), C.scale(m, d);
7655
- const N = this.dependencyTracker;
7656
- for (this.dependencyTracker = N ? new Eb(N, I) : null, e = 0; e < a; ++e) {
7657
- if (X = g[e], typeof X == "number") {
7658
- y = s * X * Z / 1e3, this.ctx.translate(y, 0), A.x += y * m;
7655
+ const X = this.dependencyTracker;
7656
+ for (this.dependencyTracker = X ? new Eb(X, I) : null, t = 0; t < a; ++t) {
7657
+ if (N = g[t], typeof N == "number") {
7658
+ y = s * N * Z / 1e3, this.ctx.translate(y, 0), A.x += y * m;
7659
7659
  continue;
7660
7660
  }
7661
- const o = (X.isSpace ? G : 0) + c, h = i.charProcOperatorList[X.operatorListId];
7662
- h ? this.contentVisible && (this.save(), C.scale(Z, Z), C.transform(...W), this.executeOperatorList(h), this.restore()) : O(`Type3 character "${X.operatorListId}" is not available.`);
7663
- const n = [X.width, 0];
7664
- p.applyTransform(n, W), V = n[0] * Z + o, C.translate(V, 0), A.x += V * m;
7661
+ const o = (N.isSpace ? G : 0) + c, h = i.charProcOperatorList[N.operatorListId];
7662
+ h ? this.contentVisible && (this.save(), C.scale(Z, Z), C.transform(...W), this.executeOperatorList(h), this.restore()) : O(`Type3 character "${N.operatorListId}" is not available.`);
7663
+ const e = [N.width, 0];
7664
+ p.applyTransform(e, W), V = e[0] * Z + o, C.translate(V, 0), A.x += V * m;
7665
7665
  }
7666
- C.restore(), N && (this.dependencyTracker = N);
7666
+ C.restore(), X && (this.dependencyTracker = X);
7667
7667
  }
7668
7668
  setCharWidth(I, g, C) {
7669
7669
  }
@@ -7753,7 +7753,7 @@ const Do = class Do {
7753
7753
  this.contentVisible && (this.restore(I), this.baseTransform = this.baseTransformStack.pop());
7754
7754
  }
7755
7755
  beginGroup(I, g) {
7756
- var N;
7756
+ var X;
7757
7757
  if (!this.contentVisible)
7758
7758
  return;
7759
7759
  this.save(I), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
@@ -7772,13 +7772,13 @@ const Do = class Do {
7772
7772
  g.smask && (m += "_smask_" + this.smaskCounter++ % 2);
7773
7773
  const W = this.cachedCanvases.getCanvas(m, c, G), a = W.context;
7774
7774
  a.translate(-d, -s), a.transform(...A);
7775
- let t = new Path2D();
7776
- const [e, X, V, y] = g.bbox;
7777
- if (t.rect(e, X, V - e, y - X), g.matrix) {
7775
+ let n = new Path2D();
7776
+ const [t, N, V, y] = g.bbox;
7777
+ if (n.rect(t, N, V - t, y - N), g.matrix) {
7778
7778
  const o = new Path2D();
7779
- o.addPath(t, new DOMMatrix(g.matrix)), t = o;
7779
+ o.addPath(n, new DOMMatrix(g.matrix)), n = o;
7780
7780
  }
7781
- a.clip(t), g.smask && this.smaskStack.push({
7781
+ a.clip(n), g.smask && this.smaskStack.push({
7782
7782
  canvas: W.canvas,
7783
7783
  context: a,
7784
7784
  offsetX: d,
@@ -7787,7 +7787,7 @@ const Do = class Do {
7787
7787
  backdrop: g.smask.backdrop,
7788
7788
  transferMap: g.smask.transferMap || null,
7789
7789
  startTransformInverse: null
7790
- }), (!g.smask || this.dependencyTracker) && (C.setTransform(1, 0, 0, 1, 0, 0), C.translate(d, s), C.save()), Rs(C, a), this.ctx = a, (N = this.dependencyTracker) == null || N.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha", "strokeAlpha", "globalCompositeOperation"]).pushBaseTransform(C), this.setGState(I, [["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(C), this.groupLevel++;
7790
+ }), (!g.smask || this.dependencyTracker) && (C.setTransform(1, 0, 0, 1, 0, 0), C.translate(d, s), C.save()), Rs(C, a), this.ctx = a, (X = this.dependencyTracker) == null || X.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha", "strokeAlpha", "globalCompositeOperation"]).pushBaseTransform(C), this.setGState(I, [["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(C), this.groupLevel++;
7791
7791
  }
7792
7792
  endGroup(I, g) {
7793
7793
  var i;
@@ -7850,9 +7850,9 @@ const Do = class Do {
7850
7850
  s.transform(C, A, i, Z, 0, 0);
7851
7851
  const G = this._createMaskCanvas(I, g);
7852
7852
  s.setTransform(1, 0, 0, 1, G.offsetX - c[4], G.offsetY - c[5]), (m = this.dependencyTracker) == null || m.resetBBox(I);
7853
- for (let t = 0, e = d.length; t < e; t += 2) {
7854
- const X = p.transform(c, [C, A, i, Z, d[t], d[t + 1]]);
7855
- s.drawImage(G.canvas, X[4], X[5]), (W = this.dependencyTracker) == null || W.recordBBox(I, this.ctx, X[4], X[4] + G.canvas.width, X[5], X[5] + G.canvas.height);
7853
+ for (let n = 0, t = d.length; n < t; n += 2) {
7854
+ const N = p.transform(c, [C, A, i, Z, d[n], d[n + 1]]);
7855
+ s.drawImage(G.canvas, N[4], N[5]), (W = this.dependencyTracker) == null || W.recordBBox(I, this.ctx, N[4], N[4] + G.canvas.width, N[5], N[5] + G.canvas.height);
7856
7856
  }
7857
7857
  s.restore(), this.compose(), (a = this.dependencyTracker) == null || a.recordOperation(I);
7858
7858
  }
@@ -7868,10 +7868,10 @@ const Do = class Do {
7868
7868
  width: m,
7869
7869
  height: W,
7870
7870
  transform: a
7871
- } = c, t = this.cachedCanvases.getCanvas("maskCanvas", m, W), e = t.context;
7872
- e.save();
7873
- const X = this.getObject(I, G, c);
7874
- CB(e, X), e.globalCompositeOperation = "source-in", e.fillStyle = i ? A.getPattern(e, this, EC(C), mg.FILL, I) : A, e.fillRect(0, 0, m, W), e.restore(), C.save(), C.transform(...a), C.scale(1, -1), lb(C, t.canvas, 0, 0, m, W, 0, -1, 1, 1), (d = this.dependencyTracker) == null || d.recordBBox(I, C, 0, m, 0, W), C.restore();
7871
+ } = c, n = this.cachedCanvases.getCanvas("maskCanvas", m, W), t = n.context;
7872
+ t.save();
7873
+ const N = this.getObject(I, G, c);
7874
+ CB(t, N), t.globalCompositeOperation = "source-in", t.fillStyle = i ? A.getPattern(t, this, EC(C), mg.FILL, I) : A, t.fillRect(0, 0, m, W), t.restore(), C.save(), C.transform(...a), C.scale(1, -1), lb(C, n.canvas, 0, 0, m, W, 0, -1, 1, 1), (d = this.dependencyTracker) == null || d.recordBBox(I, C, 0, m, 0, W), C.restore();
7875
7875
  }
7876
7876
  this.compose(), (s = this.dependencyTracker) == null || s.recordOperation(I);
7877
7877
  }
@@ -8561,20 +8561,20 @@ function Sw(b) {
8561
8561
  let W;
8562
8562
  const a = C("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
8563
8563
  for (; (W = a.exec(G)) !== null; ) {
8564
- let [, e, X, V] = W;
8565
- if (e = parseInt(e, 10), e in m) {
8566
- if (e === 0)
8564
+ let [, t, N, V] = W;
8565
+ if (t = parseInt(t, 10), t in m) {
8566
+ if (t === 0)
8567
8567
  break;
8568
8568
  continue;
8569
8569
  }
8570
- m[e] = [X, V];
8570
+ m[t] = [N, V];
8571
8571
  }
8572
- const t = [];
8573
- for (let e = 0; e < m.length && e in m; ++e) {
8574
- let [X, V] = m[e];
8575
- V = d(V), X && (V = unescape(V), e === 0 && (V = s(V))), t.push(V);
8572
+ const n = [];
8573
+ for (let t = 0; t < m.length && t in m; ++t) {
8574
+ let [N, V] = m[t];
8575
+ V = d(V), N && (V = unescape(V), t === 0 && (V = s(V))), n.push(V);
8576
8576
  }
8577
- return t.join("");
8577
+ return n.join("");
8578
8578
  }
8579
8579
  function d(G) {
8580
8580
  if (G.startsWith('"')) {
@@ -8591,20 +8591,20 @@ function Sw(b) {
8591
8591
  const m = G.indexOf("'");
8592
8592
  if (m === -1)
8593
8593
  return G;
8594
- const W = G.slice(0, m), t = G.slice(m + 1).replace(/^[^']*'/, "");
8595
- return A(W, t);
8594
+ const W = G.slice(0, m), n = G.slice(m + 1).replace(/^[^']*'/, "");
8595
+ return A(W, n);
8596
8596
  }
8597
8597
  function c(G) {
8598
- return !G.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(G) ? G : G.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(m, W, a, t) {
8598
+ return !G.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(G) ? G : G.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(m, W, a, n) {
8599
8599
  if (a === "q" || a === "Q")
8600
- return t = t.replaceAll("_", " "), t = t.replaceAll(/=([0-9a-fA-F]{2})/g, function(e, X) {
8601
- return String.fromCharCode(parseInt(X, 16));
8602
- }), A(W, t);
8600
+ return n = n.replaceAll("_", " "), n = n.replaceAll(/=([0-9a-fA-F]{2})/g, function(t, N) {
8601
+ return String.fromCharCode(parseInt(N, 16));
8602
+ }), A(W, n);
8603
8603
  try {
8604
- t = atob(t);
8604
+ n = atob(n);
8605
8605
  } catch {
8606
8606
  }
8607
- return A(W, t);
8607
+ return A(W, n);
8608
8608
  });
8609
8609
  }
8610
8610
  return "";
@@ -9396,7 +9396,7 @@ zl = new WeakMap(), fg = new WeakMap(), qc = new WeakMap(), _c = new WeakMap(),
9396
9396
  C.push(Z.str), Y(this, ml, WW).call(this, Z);
9397
9397
  }
9398
9398
  }, WW = function(I) {
9399
- var t;
9399
+ var n;
9400
9400
  const g = document.createElement("span"), C = {
9401
9401
  angle: 0,
9402
9402
  canvasWidth: 0,
@@ -9411,7 +9411,7 @@ zl = new WeakMap(), fg = new WeakMap(), qc = new WeakMap(), _c = new WeakMap(),
9411
9411
  Z.vertical && (i += Math.PI / 2);
9412
9412
  let d = l(this, _c) && Z.fontSubstitution || Z.fontFamily;
9413
9413
  d = Zg.fontFamilyMap.get(d) || d;
9414
- const s = Math.hypot(A[2], A[3]), c = s * Y(t = Zg, oC, wW).call(t, d, Z, l(this, vi));
9414
+ const s = Math.hypot(A[2], A[3]), c = s * Y(n = Zg, oC, wW).call(n, d, Z, l(this, vi));
9415
9415
  let G, m;
9416
9416
  i === 0 ? (G = A[4], m = A[5] - c) : (G = A[4] + c * Math.sin(i), m = A[5] - c * Math.cos(i));
9417
9417
  const W = g.style;
@@ -9420,12 +9420,12 @@ zl = new WeakMap(), fg = new WeakMap(), qc = new WeakMap(), _c = new WeakMap(),
9420
9420
  if (I.str.length > 1)
9421
9421
  a = !0;
9422
9422
  else if (I.str !== " " && I.transform[0] !== I.transform[3]) {
9423
- const e = Math.abs(I.transform[0]), X = Math.abs(I.transform[3]);
9424
- e !== X && Math.max(e, X) / Math.min(e, X) > 1.5 && (a = !0);
9423
+ const t = Math.abs(I.transform[0]), N = Math.abs(I.transform[3]);
9424
+ t !== N && Math.max(t, N) / Math.min(t, N) > 1.5 && (a = !0);
9425
9425
  }
9426
9426
  if (a && (C.canvasWidth = Z.vertical ? I.height : I.width), l(this, AG).set(g, C), l(this, xA).div = g, l(this, xA).properties = C, Y(this, ml, Xm).call(this, l(this, xA)), C.hasText && l(this, fg).append(g), C.hasEOL) {
9427
- const e = document.createElement("br");
9428
- e.setAttribute("role", "presentation"), l(this, fg).append(e);
9427
+ const t = document.createElement("br");
9428
+ t.setAttribute("role", "presentation"), l(this, fg).append(t);
9429
9429
  }
9430
9430
  }, Xm = function(I) {
9431
9431
  var Z;
@@ -9494,7 +9494,7 @@ function aW(b = {}) {
9494
9494
  docId: g
9495
9495
  } = I, C = b.url ? gw(b.url) : null, A = b.data ? Cw(b.data) : null, i = b.httpHeaders || null, Z = b.withCredentials === !0, d = b.password ?? null, s = b.range instanceof YW ? b.range : null, c = Number.isInteger(b.rangeChunkSize) && b.rangeChunkSize > 0 ? b.rangeChunkSize : 2 ** 16;
9496
9496
  let G = b.worker instanceof gc ? b.worker : null;
9497
- const m = b.verbosity, W = typeof b.docBaseUrl == "string" && !V0(b.docBaseUrl) ? b.docBaseUrl : null, a = Ib(b.cMapUrl), t = b.cMapPacked !== !1, e = b.CMapReaderFactory || (Mg ? Gw : Uo), X = Ib(b.iccUrl), V = Ib(b.standardFontDataUrl), y = b.StandardFontDataFactory || (Mg ? bw : Oo), N = Ib(b.wasmUrl), o = b.WasmFactory || (Mg ? mw : vo), h = b.stopAtErrors !== !0, n = Number.isInteger(b.maxImageSize) && b.maxImageSize > -1 ? b.maxImageSize : -1, R = b.isEvalSupported !== !1, u = typeof b.isOffscreenCanvasSupported == "boolean" ? b.isOffscreenCanvasSupported : !Mg, H = typeof b.isImageDecoderSupported == "boolean" ? b.isImageDecoderSupported : !Mg && (_I.platform.isFirefox || !globalThis.chrome), K = Number.isInteger(b.canvasMaxAreaInBytes) ? b.canvasMaxAreaInBytes : -1, D = typeof b.disableFontFace == "boolean" ? b.disableFontFace : Mg, z = b.fontExtraProperties === !0, L = b.enableXfa === !0, T = b.ownerDocument || globalThis.document, x = b.disableRange === !0, r = b.disableStream === !0, Q = b.disableAutoFetch === !0, iI = b.pdfBug === !0, Ng = b.CanvasFactory || (Mg ? cw : Zw), Wg = b.FilterFactory || (Mg ? sw : dw), pg = b.enableHWA === !0, hI = b.useWasm !== !1, eI = s ? s.length : b.length ?? NaN, DC = typeof b.useSystemFonts == "boolean" ? b.useSystemFonts : !Mg && !D, HI = typeof b.useWorkerFetch == "boolean" ? b.useWorkerFetch : !!(e === Uo && y === Oo && o === vo && a && V && N && Ms(a, document.baseURI) && Ms(V, document.baseURI) && Ms(N, document.baseURI)), hg = null;
9497
+ const m = b.verbosity, W = typeof b.docBaseUrl == "string" && !V0(b.docBaseUrl) ? b.docBaseUrl : null, a = Ib(b.cMapUrl), n = b.cMapPacked !== !1, t = b.CMapReaderFactory || (Mg ? Gw : Uo), N = Ib(b.iccUrl), V = Ib(b.standardFontDataUrl), y = b.StandardFontDataFactory || (Mg ? bw : Oo), X = Ib(b.wasmUrl), o = b.WasmFactory || (Mg ? mw : vo), h = b.stopAtErrors !== !0, e = Number.isInteger(b.maxImageSize) && b.maxImageSize > -1 ? b.maxImageSize : -1, R = b.isEvalSupported !== !1, u = typeof b.isOffscreenCanvasSupported == "boolean" ? b.isOffscreenCanvasSupported : !Mg, H = typeof b.isImageDecoderSupported == "boolean" ? b.isImageDecoderSupported : !Mg && (_I.platform.isFirefox || !globalThis.chrome), K = Number.isInteger(b.canvasMaxAreaInBytes) ? b.canvasMaxAreaInBytes : -1, D = typeof b.disableFontFace == "boolean" ? b.disableFontFace : Mg, z = b.fontExtraProperties === !0, L = b.enableXfa === !0, T = b.ownerDocument || globalThis.document, x = b.disableRange === !0, r = b.disableStream === !0, Q = b.disableAutoFetch === !0, iI = b.pdfBug === !0, Ng = b.CanvasFactory || (Mg ? cw : Zw), Wg = b.FilterFactory || (Mg ? sw : dw), pg = b.enableHWA === !0, hI = b.useWasm !== !1, eI = s ? s.length : b.length ?? NaN, DC = typeof b.useSystemFonts == "boolean" ? b.useSystemFonts : !Mg && !D, HI = typeof b.useWorkerFetch == "boolean" ? b.useWorkerFetch : !!(t === Uo && y === Oo && o === vo && a && V && X && Ms(a, document.baseURI) && Ms(V, document.baseURI) && Ms(X, document.baseURI)), hg = null;
9498
9498
  uh(m);
9499
9499
  const SI = {
9500
9500
  canvasFactory: new Ng({
@@ -9505,15 +9505,15 @@ function aW(b = {}) {
9505
9505
  docId: g,
9506
9506
  ownerDocument: T
9507
9507
  }),
9508
- cMapReaderFactory: HI ? null : new e({
9508
+ cMapReaderFactory: HI ? null : new t({
9509
9509
  baseUrl: a,
9510
- isCompressed: t
9510
+ isCompressed: n
9511
9511
  }),
9512
9512
  standardFontDataFactory: HI ? null : new y({
9513
9513
  baseUrl: V
9514
9514
  }),
9515
9515
  wasmFactory: HI ? null : new o({
9516
- baseUrl: N
9516
+ baseUrl: X
9517
9517
  })
9518
9518
  };
9519
9519
  G || (G = gc.create({
@@ -9531,7 +9531,7 @@ function aW(b = {}) {
9531
9531
  docBaseUrl: W,
9532
9532
  enableXfa: L,
9533
9533
  evaluatorOptions: {
9534
- maxImageSize: n,
9534
+ maxImageSize: e,
9535
9535
  disableFontFace: D,
9536
9536
  ignoreErrors: h,
9537
9537
  isEvalSupported: R,
@@ -9543,9 +9543,9 @@ function aW(b = {}) {
9543
9543
  useWasm: hI,
9544
9544
  useWorkerFetch: HI,
9545
9545
  cMapUrl: a,
9546
- iccUrl: X,
9546
+ iccUrl: N,
9547
9547
  standardFontDataUrl: V,
9548
- wasmUrl: N
9548
+ wasmUrl: X
9549
9549
  }
9550
9550
  }, y0 = {
9551
9551
  ownerDocument: T,
@@ -9868,36 +9868,36 @@ class fw {
9868
9868
  printAnnotationStorage: m = null,
9869
9869
  isEditing: W = !1,
9870
9870
  recordOperations: a = !1,
9871
- operationsFilter: t = null
9871
+ operationsFilter: n = null
9872
9872
  }) {
9873
9873
  var H, K, D;
9874
9874
  (H = this._stats) == null || H.time("Overall");
9875
- const e = this._transport.getRenderingIntent(A, i, m, W), {
9876
- renderingIntent: X,
9875
+ const t = this._transport.getRenderingIntent(A, i, m, W), {
9876
+ renderingIntent: N,
9877
9877
  cacheKey: V
9878
- } = e;
9879
- B(this, UA, !1), s || (s = this._transport.getOptionalContentConfig(X));
9878
+ } = t;
9879
+ B(this, UA, !1), s || (s = this._transport.getOptionalContentConfig(N));
9880
9880
  let y = this._intentStates.get(V);
9881
9881
  y || (y = /* @__PURE__ */ Object.create(null), this._intentStates.set(V, y)), y.streamReaderCancelTimeout && (clearTimeout(y.streamReaderCancelTimeout), y.streamReaderCancelTimeout = null);
9882
- const N = !!(X & GC.PRINT);
9882
+ const X = !!(N & GC.PRINT);
9883
9883
  y.displayReadyCapability || (y.displayReadyCapability = Promise.withResolvers(), y.operatorList = {
9884
9884
  fnArray: [],
9885
9885
  argsArray: [],
9886
9886
  lastChunk: !1,
9887
9887
  separateAnnots: null
9888
- }, (K = this._stats) == null || K.time("Page Request"), this._pumpOperatorList(e));
9889
- const o = !!(this._pdfBug && ((D = globalThis.StepperManager) != null && D.enabled)), h = !this.recordedBBoxes && (a || o), n = (z) => {
9888
+ }, (K = this._stats) == null || K.time("Page Request"), this._pumpOperatorList(t));
9889
+ const o = !!(this._pdfBug && ((D = globalThis.StepperManager) != null && D.enabled)), h = !this.recordedBBoxes && (a || o), e = (z) => {
9890
9890
  var L, T;
9891
9891
  if (y.renderTasks.delete(R), h) {
9892
9892
  const x = (L = R.gfx) == null ? void 0 : L.dependencyTracker.take();
9893
9893
  x && (R.stepper && R.stepper.setOperatorBBoxes(x, R.gfx.dependencyTracker.takeDebugMetadata()), a && (this.recordedBBoxes = x));
9894
9894
  }
9895
- N && B(this, UA, !0), Y(this, _i, js).call(this), z ? (R.capability.reject(z), this._abortOperatorList({
9895
+ X && B(this, UA, !0), Y(this, _i, js).call(this), z ? (R.capability.reject(z), this._abortOperatorList({
9896
9896
  intentState: y,
9897
9897
  reason: z instanceof Error ? z : new Error(z)
9898
9898
  })) : R.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (T = globalThis.Stats) != null && T.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
9899
9899
  }, R = new um({
9900
- callback: n,
9900
+ callback: e,
9901
9901
  params: {
9902
9902
  canvas: g,
9903
9903
  canvasContext: I,
@@ -9913,27 +9913,27 @@ class fw {
9913
9913
  pageIndex: this._pageIndex,
9914
9914
  canvasFactory: this._transport.canvasFactory,
9915
9915
  filterFactory: this._transport.filterFactory,
9916
- useRequestAnimationFrame: !N,
9916
+ useRequestAnimationFrame: !X,
9917
9917
  pdfBug: this._pdfBug,
9918
9918
  pageColors: G,
9919
9919
  enableHWA: this._transport.enableHWA,
9920
- operationsFilter: t
9920
+ operationsFilter: n
9921
9921
  });
9922
9922
  (y.renderTasks || (y.renderTasks = /* @__PURE__ */ new Set())).add(R);
9923
9923
  const u = R.task;
9924
9924
  return Promise.all([y.displayReadyCapability.promise, s]).then(([z, L]) => {
9925
9925
  var T;
9926
9926
  if (this.destroyed) {
9927
- n();
9927
+ e();
9928
9928
  return;
9929
9929
  }
9930
- if ((T = this._stats) == null || T.time("Rendering"), !(L.renderingIntent & X))
9930
+ if ((T = this._stats) == null || T.time("Rendering"), !(L.renderingIntent & N))
9931
9931
  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
9932
9932
  R.initializeGraphics({
9933
9933
  transparency: z,
9934
9934
  optionalContentConfig: L
9935
9935
  }), R.operatorListChanged();
9936
- }).catch(n), u;
9936
+ }).catch(e), u;
9937
9937
  }
9938
9938
  getOperatorList({
9939
9939
  intent: I = "display",
@@ -10724,10 +10724,10 @@ const Bi = class Bi {
10724
10724
  pdfBug: m = !1,
10725
10725
  pageColors: W = null,
10726
10726
  enableHWA: a = !1,
10727
- operationsFilter: t = null
10727
+ operationsFilter: n = null
10728
10728
  }) {
10729
10729
  w(this, rl, null);
10730
- this.callback = I, this.params = g, this.objs = C, this.commonObjs = A, this.annotationCanvasMap = i, this.operatorListIdx = null, this.operatorList = Z, this._pageIndex = d, this.canvasFactory = s, this.filterFactory = c, this._pdfBug = m, this.pageColors = W, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = G === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new _w(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = g.canvas, this._canvasContext = g.canvas ? null : g.canvasContext, this._enableHWA = a, this._dependencyTracker = g.dependencyTracker, this._operationsFilter = t;
10730
+ this.callback = I, this.params = g, this.objs = C, this.commonObjs = A, this.annotationCanvasMap = i, this.operatorListIdx = null, this.operatorList = Z, this._pageIndex = d, this.canvasFactory = s, this.filterFactory = c, this._pdfBug = m, this.pageColors = W, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = G === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new _w(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = g.canvas, this._canvasContext = g.canvas ? null : g.canvasContext, this._enableHWA = a, this._dependencyTracker = g.dependencyTracker, this._operationsFilter = n;
10731
10731
  }
10732
10732
  get completed() {
10733
10733
  return this.capability.promise.catch(function() {
@@ -11257,9 +11257,9 @@ const Ko = class Ko {
11257
11257
  } = i;
11258
11258
  if (Z.zIndex = this.parent.zIndex, this.parent.zIndex += 2, g.alternativeText && (i.title = g.alternativeText), g.noRotate && i.classList.add("norotate"), !g.rect || this instanceof Sm) {
11259
11259
  const {
11260
- rotation: e
11260
+ rotation: t
11261
11261
  } = g;
11262
- return !g.hasOwnCanvas && e !== 0 && this.setRotation(e, i), i;
11262
+ return !g.hasOwnCanvas && t !== 0 && this.setRotation(t, i), i;
11263
11263
  }
11264
11264
  const {
11265
11265
  width: d,
@@ -11267,9 +11267,9 @@ const Ko = class Ko {
11267
11267
  } = this;
11268
11268
  if (!I && g.borderStyle.width > 0) {
11269
11269
  Z.borderWidth = `${g.borderStyle.width}px`;
11270
- const e = g.borderStyle.horizontalCornerRadius, X = g.borderStyle.verticalCornerRadius;
11271
- if (e > 0 || X > 0) {
11272
- const y = `calc(${e}px * var(--total-scale-factor)) / calc(${X}px * var(--total-scale-factor))`;
11270
+ const t = g.borderStyle.horizontalCornerRadius, N = g.borderStyle.verticalCornerRadius;
11271
+ if (t > 0 || N > 0) {
11272
+ const y = `calc(${t}px * var(--total-scale-factor)) / calc(${N}px * var(--total-scale-factor))`;
11273
11273
  Z.borderRadius = y;
11274
11274
  } else if (this instanceof XW) {
11275
11275
  const y = `calc(${d}px * var(--total-scale-factor)) / calc(${s}px * var(--total-scale-factor))`;
@@ -11303,9 +11303,9 @@ const Ko = class Ko {
11303
11303
  } = A.rawDims;
11304
11304
  Z.left = `${100 * (c[0] - W) / G}%`, Z.top = `${100 * (c[1] - a) / m}%`;
11305
11305
  const {
11306
- rotation: t
11306
+ rotation: n
11307
11307
  } = g;
11308
- return g.hasOwnCanvas || t === 0 ? (Z.width = `${100 * d / G}%`, Z.height = `${100 * s / m}%`) : this.setRotation(t, i), i;
11308
+ return g.hasOwnCanvas || n === 0 ? (Z.width = `${100 * d / G}%`, Z.height = `${100 * s / m}%`) : this.setRotation(n, i), i;
11309
11309
  }
11310
11310
  setRotation(I, g = this.container) {
11311
11311
  if (!this.data.rect)
@@ -11426,10 +11426,10 @@ const Ko = class Ko {
11426
11426
  } = this.data;
11427
11427
  if (!I)
11428
11428
  return;
11429
- const [g, C, A, i] = this.data.rect.map((e) => Math.fround(e));
11429
+ const [g, C, A, i] = this.data.rect.map((t) => Math.fround(t));
11430
11430
  if (I.length === 8) {
11431
- const [e, X, V, y] = I.subarray(2, 6);
11432
- if (A === e && i === X && g === V && C === y)
11431
+ const [t, N, V, y] = I.subarray(2, 6);
11432
+ if (A === t && i === N && g === V && C === y)
11433
11433
  return;
11434
11434
  }
11435
11435
  const {
@@ -11438,10 +11438,10 @@ const Ko = class Ko {
11438
11438
  let d;
11439
11439
  if (l(this, fd)) {
11440
11440
  const {
11441
- borderColor: e,
11442
- borderWidth: X
11441
+ borderColor: t,
11442
+ borderWidth: N
11443
11443
  } = Z;
11444
- Z.borderWidth = 0, d = ["url('data:image/svg+xml;utf8,", '<svg xmlns="http://www.w3.org/2000/svg"', ' preserveAspectRatio="none" viewBox="0 0 1 1">', `<g fill="transparent" stroke="${e}" stroke-width="${X}">`], this.container.classList.add("hasBorder");
11444
+ Z.borderWidth = 0, d = ["url('data:image/svg+xml;utf8,", '<svg xmlns="http://www.w3.org/2000/svg"', ' preserveAspectRatio="none" viewBox="0 0 1 1">', `<g fill="transparent" stroke="${t}" stroke-width="${N}">`], this.container.classList.add("hasBorder");
11445
11445
  }
11446
11446
  const s = A - g, c = i - C, {
11447
11447
  svgFactory: G
@@ -11449,13 +11449,13 @@ const Ko = class Ko {
11449
11449
  m.classList.add("quadrilateralsContainer"), m.setAttribute("width", 0), m.setAttribute("height", 0), m.role = "none";
11450
11450
  const W = G.createElement("defs");
11451
11451
  m.append(W);
11452
- const a = G.createElement("clipPath"), t = `clippath_${this.data.id}`;
11453
- a.setAttribute("id", t), a.setAttribute("clipPathUnits", "objectBoundingBox"), W.append(a);
11454
- for (let e = 2, X = I.length; e < X; e += 8) {
11455
- const V = I[e], y = I[e + 1], N = I[e + 2], o = I[e + 3], h = G.createElement("rect"), n = (N - g) / s, R = (i - y) / c, u = (V - N) / s, H = (y - o) / c;
11456
- h.setAttribute("x", n), h.setAttribute("y", R), h.setAttribute("width", u), h.setAttribute("height", H), a.append(h), d == null || d.push(`<rect vector-effect="non-scaling-stroke" x="${n}" y="${R}" width="${u}" height="${H}"/>`);
11452
+ const a = G.createElement("clipPath"), n = `clippath_${this.data.id}`;
11453
+ a.setAttribute("id", n), a.setAttribute("clipPathUnits", "objectBoundingBox"), W.append(a);
11454
+ for (let t = 2, N = I.length; t < N; t += 8) {
11455
+ const V = I[t], y = I[t + 1], X = I[t + 2], o = I[t + 3], h = G.createElement("rect"), e = (X - g) / s, R = (i - y) / c, u = (V - X) / s, H = (y - o) / c;
11456
+ h.setAttribute("x", e), h.setAttribute("y", R), h.setAttribute("width", u), h.setAttribute("height", H), a.append(h), d == null || d.push(`<rect vector-effect="non-scaling-stroke" x="${e}" y="${R}" width="${u}" height="${H}"/>`);
11457
11457
  }
11458
- l(this, fd) && (d.push("</g></svg>')"), Z.backgroundImage = d.join("")), this.container.append(m), this.container.style.clipPath = `url(#${t})`;
11458
+ l(this, fd) && (d.push("</g></svg>')"), Z.backgroundImage = d.join("")), this.container.append(m), this.container.style.clipPath = `url(#${n})`;
11459
11459
  }
11460
11460
  _createPopup(I = null) {
11461
11461
  const {
@@ -11692,15 +11692,15 @@ class No extends KI {
11692
11692
  if (i.length !== 0 || Z.length !== 0) {
11693
11693
  const W = new Set(Z);
11694
11694
  for (const a of i) {
11695
- const t = this._fieldObjects[a] || [];
11695
+ const n = this._fieldObjects[a] || [];
11696
11696
  for (const {
11697
- id: e
11698
- } of t)
11699
- W.add(e);
11697
+ id: t
11698
+ } of n)
11699
+ W.add(t);
11700
11700
  }
11701
11701
  for (const a of Object.values(this._fieldObjects))
11702
- for (const t of a)
11703
- W.has(t.id) === d && s.push(t);
11702
+ for (const n of a)
11703
+ W.has(n.id) === d && s.push(n);
11704
11704
  } else
11705
11705
  for (const W of Object.values(this._fieldObjects))
11706
11706
  s.push(...W);
@@ -11711,39 +11711,39 @@ class No extends KI {
11711
11711
  } = W;
11712
11712
  switch (G.push(a), W.type) {
11713
11713
  case "text": {
11714
- const e = W.defaultValue || "";
11714
+ const t = W.defaultValue || "";
11715
11715
  c.setValue(a, {
11716
- value: e
11716
+ value: t
11717
11717
  });
11718
11718
  break;
11719
11719
  }
11720
11720
  case "checkbox":
11721
11721
  case "radiobutton": {
11722
- const e = W.defaultValue === W.exportValues;
11722
+ const t = W.defaultValue === W.exportValues;
11723
11723
  c.setValue(a, {
11724
- value: e
11724
+ value: t
11725
11725
  });
11726
11726
  break;
11727
11727
  }
11728
11728
  case "combobox":
11729
11729
  case "listbox": {
11730
- const e = W.defaultValue || "";
11730
+ const t = W.defaultValue || "";
11731
11731
  c.setValue(a, {
11732
- value: e
11732
+ value: t
11733
11733
  });
11734
11734
  break;
11735
11735
  }
11736
11736
  default:
11737
11737
  continue;
11738
11738
  }
11739
- const t = document.querySelector(`[data-element-id="${a}"]`);
11740
- if (t) {
11741
- if (!SZ.has(t)) {
11739
+ const n = document.querySelector(`[data-element-id="${a}"]`);
11740
+ if (n) {
11741
+ if (!SZ.has(n)) {
11742
11742
  O(`_bindResetFormAction - element not allowed: ${a}`);
11743
11743
  continue;
11744
11744
  }
11745
11745
  } else continue;
11746
- t.dispatchEvent(new Event("resetform"));
11746
+ n.dispatchEvent(new Event("resetform"));
11747
11747
  }
11748
11748
  return this.enableScripting && ((m = this.linkService.eventBus) == null || m.dispatch("dispatcheventinsandbox", {
11749
11749
  source: this,
@@ -11898,83 +11898,83 @@ class Za extends FZ {
11898
11898
  datetimeFormat: m,
11899
11899
  datetimeType: W,
11900
11900
  timeStep: a
11901
- } = this.data, t = !!W && this.enableScripting;
11902
- m && (C.title = m), this._setRequired(C, this.data.required), s && (C.maxLength = s), C.addEventListener("input", (X) => {
11901
+ } = this.data, n = !!W && this.enableScripting;
11902
+ m && (C.title = m), this._setRequired(C, this.data.required), s && (C.maxLength = s), C.addEventListener("input", (N) => {
11903
11903
  I.setValue(g, {
11904
- value: X.target.value
11905
- }), this.setPropertyOnSiblings(C, "value", X.target.value, "value"), G.formattedValue = null;
11906
- }), C.addEventListener("resetform", (X) => {
11904
+ value: N.target.value
11905
+ }), this.setPropertyOnSiblings(C, "value", N.target.value, "value"), G.formattedValue = null;
11906
+ }), C.addEventListener("resetform", (N) => {
11907
11907
  const V = this.data.defaultFieldValue ?? "";
11908
11908
  C.value = G.userValue = V, G.formattedValue = null;
11909
11909
  });
11910
- let e = (X) => {
11910
+ let t = (N) => {
11911
11911
  const {
11912
11912
  formattedValue: V
11913
11913
  } = G;
11914
- V != null && (X.target.value = V), X.target.scrollLeft = 0;
11914
+ V != null && (N.target.value = V), N.target.scrollLeft = 0;
11915
11915
  };
11916
11916
  if (this.enableScripting && this.hasJSActions) {
11917
11917
  C.addEventListener("focus", (V) => {
11918
- var N;
11918
+ var X;
11919
11919
  if (G.focused)
11920
11920
  return;
11921
11921
  const {
11922
11922
  target: y
11923
11923
  } = V;
11924
- if (t && (y.type = W, a && (y.step = a)), G.userValue) {
11924
+ if (n && (y.type = W, a && (y.step = a)), G.userValue) {
11925
11925
  const o = G.userValue;
11926
- if (t)
11926
+ if (n)
11927
11927
  if (W === "time") {
11928
- const h = new Date(o), n = [h.getHours(), h.getMinutes(), h.getSeconds()];
11929
- y.value = n.map((R) => R.toString().padStart(2, "0")).join(":");
11928
+ const h = new Date(o), e = [h.getHours(), h.getMinutes(), h.getSeconds()];
11929
+ y.value = e.map((R) => R.toString().padStart(2, "0")).join(":");
11930
11930
  } else
11931
11931
  y.value = new Date(o - Aa).toISOString().split(W === "date" ? "T" : ".", 1)[0];
11932
11932
  else
11933
11933
  y.value = o;
11934
11934
  }
11935
- G.lastCommittedValue = y.value, G.commitKey = 1, (N = this.data.actions) != null && N.Focus || (G.focused = !0);
11935
+ G.lastCommittedValue = y.value, G.commitKey = 1, (X = this.data.actions) != null && X.Focus || (G.focused = !0);
11936
11936
  }), C.addEventListener("updatefromsandbox", (V) => {
11937
11937
  this.showElementAndHideCanvas(V.target);
11938
11938
  const y = {
11939
- value(N) {
11940
- G.userValue = N.detail.value ?? "", t || I.setValue(g, {
11939
+ value(X) {
11940
+ G.userValue = X.detail.value ?? "", n || I.setValue(g, {
11941
11941
  value: G.userValue.toString()
11942
- }), N.target.value = G.userValue;
11942
+ }), X.target.value = G.userValue;
11943
11943
  },
11944
- formattedValue(N) {
11944
+ formattedValue(X) {
11945
11945
  const {
11946
11946
  formattedValue: o
11947
- } = N.detail;
11948
- G.formattedValue = o, o != null && N.target !== document.activeElement && (N.target.value = o);
11947
+ } = X.detail;
11948
+ G.formattedValue = o, o != null && X.target !== document.activeElement && (X.target.value = o);
11949
11949
  const h = {
11950
11950
  formattedValue: o
11951
11951
  };
11952
- t && (h.value = o), I.setValue(g, h);
11952
+ n && (h.value = o), I.setValue(g, h);
11953
11953
  },
11954
- selRange(N) {
11955
- N.target.setSelectionRange(...N.detail.selRange);
11954
+ selRange(X) {
11955
+ X.target.setSelectionRange(...X.detail.selRange);
11956
11956
  },
11957
- charLimit: (N) => {
11957
+ charLimit: (X) => {
11958
11958
  var R;
11959
11959
  const {
11960
11960
  charLimit: o
11961
- } = N.detail, {
11961
+ } = X.detail, {
11962
11962
  target: h
11963
- } = N;
11963
+ } = X;
11964
11964
  if (o === 0) {
11965
11965
  h.removeAttribute("maxLength");
11966
11966
  return;
11967
11967
  }
11968
11968
  h.setAttribute("maxLength", o);
11969
- let n = G.userValue;
11970
- !n || n.length <= o || (n = n.slice(0, o), h.value = G.userValue = n, I.setValue(g, {
11971
- value: n
11969
+ let e = G.userValue;
11970
+ !e || e.length <= o || (e = e.slice(0, o), h.value = G.userValue = e, I.setValue(g, {
11971
+ value: e
11972
11972
  }), (R = this.linkService.eventBus) == null || R.dispatch("dispatcheventinsandbox", {
11973
11973
  source: this,
11974
11974
  detail: {
11975
11975
  id: g,
11976
11976
  name: "Keystroke",
11977
- value: n,
11977
+ value: e,
11978
11978
  willCommit: !0,
11979
11979
  commitKey: 1,
11980
11980
  selStart: h.selectionStart,
@@ -11991,14 +11991,14 @@ class Za extends FZ {
11991
11991
  if (V.key === "Escape" ? y = 0 : V.key === "Enter" && !this.data.multiLine ? y = 2 : V.key === "Tab" && (G.commitKey = 3), y === -1)
11992
11992
  return;
11993
11993
  const {
11994
- value: N
11994
+ value: X
11995
11995
  } = V.target;
11996
- G.lastCommittedValue !== N && (G.lastCommittedValue = N, G.userValue = N, (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
11996
+ G.lastCommittedValue !== X && (G.lastCommittedValue = X, G.userValue = X, (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
11997
11997
  source: this,
11998
11998
  detail: {
11999
11999
  id: g,
12000
12000
  name: "Keystroke",
12001
- value: N,
12001
+ value: X,
12002
12002
  willCommit: !0,
12003
12003
  commitKey: y,
12004
12004
  selStart: V.target.selectionStart,
@@ -12006,8 +12006,8 @@ class Za extends FZ {
12006
12006
  }
12007
12007
  }));
12008
12008
  });
12009
- const X = e;
12010
- e = null, C.addEventListener("blur", (V) => {
12009
+ const N = t;
12010
+ t = null, C.addEventListener("blur", (V) => {
12011
12011
  var o, h;
12012
12012
  if (!G.focused || !V.relatedTarget)
12013
12013
  return;
@@ -12016,40 +12016,40 @@ class Za extends FZ {
12016
12016
  target: y
12017
12017
  } = V;
12018
12018
  let {
12019
- value: N
12019
+ value: X
12020
12020
  } = y;
12021
- if (t) {
12022
- if (N && W === "time") {
12023
- const n = N.split(":").map((R) => parseInt(R, 10));
12024
- N = new Date(2e3, 0, 1, n[0], n[1], n[2] || 0).valueOf(), y.step = "";
12021
+ if (n) {
12022
+ if (X && W === "time") {
12023
+ const e = X.split(":").map((R) => parseInt(R, 10));
12024
+ X = new Date(2e3, 0, 1, e[0], e[1], e[2] || 0).valueOf(), y.step = "";
12025
12025
  } else
12026
- N.includes("T") || (N = `${N}T00:00`), N = new Date(N).valueOf();
12026
+ X.includes("T") || (X = `${X}T00:00`), X = new Date(X).valueOf();
12027
12027
  y.type = "text";
12028
12028
  }
12029
- G.userValue = N, G.lastCommittedValue !== N && ((h = this.linkService.eventBus) == null || h.dispatch("dispatcheventinsandbox", {
12029
+ G.userValue = X, G.lastCommittedValue !== X && ((h = this.linkService.eventBus) == null || h.dispatch("dispatcheventinsandbox", {
12030
12030
  source: this,
12031
12031
  detail: {
12032
12032
  id: g,
12033
12033
  name: "Keystroke",
12034
- value: N,
12034
+ value: X,
12035
12035
  willCommit: !0,
12036
12036
  commitKey: G.commitKey,
12037
12037
  selStart: V.target.selectionStart,
12038
12038
  selEnd: V.target.selectionEnd
12039
12039
  }
12040
- })), X(V);
12040
+ })), N(V);
12041
12041
  }), (i = this.data.actions) != null && i.Keystroke && C.addEventListener("beforeinput", (V) => {
12042
12042
  var H;
12043
12043
  G.lastCommittedValue = null;
12044
12044
  const {
12045
12045
  data: y,
12046
- target: N
12046
+ target: X
12047
12047
  } = V, {
12048
12048
  value: o,
12049
12049
  selectionStart: h,
12050
- selectionEnd: n
12051
- } = N;
12052
- let R = h, u = n;
12050
+ selectionEnd: e
12051
+ } = X;
12052
+ let R = h, u = e;
12053
12053
  switch (V.inputType) {
12054
12054
  case "deleteWordBackward": {
12055
12055
  const K = o.substring(0, h).match(/\w*[^\w]*$/);
@@ -12062,10 +12062,10 @@ class Za extends FZ {
12062
12062
  break;
12063
12063
  }
12064
12064
  case "deleteContentBackward":
12065
- h === n && (R -= 1);
12065
+ h === e && (R -= 1);
12066
12066
  break;
12067
12067
  case "deleteContentForward":
12068
- h === n && (u += 1);
12068
+ h === e && (u += 1);
12069
12069
  break;
12070
12070
  }
12071
12071
  V.preventDefault(), (H = this.linkService.eventBus) == null || H.dispatch("dispatcheventinsandbox", {
@@ -12082,7 +12082,7 @@ class Za extends FZ {
12082
12082
  });
12083
12083
  }), this._setEventListeners(C, G, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (V) => V.target.value);
12084
12084
  }
12085
- if (e && C.addEventListener("blur", e), this.data.comb) {
12085
+ if (t && C.addEventListener("blur", t), this.data.comb) {
12086
12086
  const V = (this.data.rect[2] - this.data.rect[0]) / s;
12087
12087
  C.classList.add("comb"), C.style.letterSpacing = `calc(${V}px * var(--total-scale-factor) - 1ch)`;
12088
12088
  }
@@ -12246,7 +12246,7 @@ class Ga extends FZ {
12246
12246
  options: W,
12247
12247
  multiple: a
12248
12248
  } = A;
12249
- return a ? Array.prototype.filter.call(W, (t) => t.selected).map((t) => t[m]) : W.selectedIndex === -1 ? null : W[W.selectedIndex][m];
12249
+ return a ? Array.prototype.filter.call(W, (n) => n.selected).map((n) => n[m]) : W.selectedIndex === -1 ? null : W[W.selectedIndex][m];
12250
12250
  };
12251
12251
  let s = d(!1);
12252
12252
  const c = (G) => {
@@ -12260,9 +12260,9 @@ class Ga extends FZ {
12260
12260
  const m = {
12261
12261
  value(W) {
12262
12262
  Z == null || Z();
12263
- const a = W.detail.value, t = new Set(Array.isArray(a) ? a : [a]);
12264
- for (const e of A.options)
12265
- e.selected = t.has(e.value);
12263
+ const a = W.detail.value, n = new Set(Array.isArray(a) ? a : [a]);
12264
+ for (const t of A.options)
12265
+ t.selected = n.has(t.value);
12266
12266
  I.setValue(g, {
12267
12267
  value: d(!0)
12268
12268
  }), s = d(!1);
@@ -12271,8 +12271,8 @@ class Ga extends FZ {
12271
12271
  A.multiple = !0;
12272
12272
  },
12273
12273
  remove(W) {
12274
- const a = A.options, t = W.detail.remove;
12275
- a[t].selected = !1, A.remove(t), a.length > 0 && Array.prototype.findIndex.call(a, (X) => X.selected) === -1 && (a[0].selected = !0), I.setValue(g, {
12274
+ const a = A.options, n = W.detail.remove;
12275
+ a[n].selected = !1, A.remove(n), a.length > 0 && Array.prototype.findIndex.call(a, (N) => N.selected) === -1 && (a[0].selected = !0), I.setValue(g, {
12276
12276
  value: d(!0),
12277
12277
  items: c(W)
12278
12278
  }), s = d(!1);
@@ -12288,10 +12288,10 @@ class Ga extends FZ {
12288
12288
  insert(W) {
12289
12289
  const {
12290
12290
  index: a,
12291
- displayValue: t,
12292
- exportValue: e
12293
- } = W.detail.insert, X = A.children[a], V = document.createElement("option");
12294
- V.textContent = t, V.value = e, X ? X.before(V) : A.append(V), I.setValue(g, {
12291
+ displayValue: n,
12292
+ exportValue: t
12293
+ } = W.detail.insert, N = A.children[a], V = document.createElement("option");
12294
+ V.textContent = n, V.value = t, N ? N.before(V) : A.append(V), I.setValue(g, {
12295
12295
  value: d(!0),
12296
12296
  items: c(W)
12297
12297
  }), s = d(!1);
@@ -12302,12 +12302,12 @@ class Ga extends FZ {
12302
12302
  } = W.detail;
12303
12303
  for (; A.length !== 0; )
12304
12304
  A.remove(0);
12305
- for (const t of a) {
12305
+ for (const n of a) {
12306
12306
  const {
12307
- displayValue: e,
12308
- exportValue: X
12309
- } = t, V = document.createElement("option");
12310
- V.textContent = e, V.value = X, A.append(V);
12307
+ displayValue: t,
12308
+ exportValue: N
12309
+ } = n, V = document.createElement("option");
12310
+ V.textContent = t, V.value = N, A.append(V);
12311
12311
  }
12312
12312
  A.options.length > 0 && (A.options[0].selected = !0), I.setValue(g, {
12313
12313
  value: d(!0),
@@ -12316,8 +12316,8 @@ class Ga extends FZ {
12316
12316
  },
12317
12317
  indices(W) {
12318
12318
  const a = new Set(W.detail.indices);
12319
- for (const t of W.target.options)
12320
- t.selected = a.has(t.index);
12319
+ for (const n of W.target.options)
12320
+ n.selected = a.has(n.index);
12321
12321
  I.setValue(g, {
12322
12322
  value: d(!0)
12323
12323
  }), s = d(!1);
@@ -12741,9 +12741,9 @@ _g = new WeakMap(), jl = new WeakMap(), o0 = new WeakMap(), B0 = new WeakMap(),
12741
12741
  }
12742
12742
  } = l(this, $d);
12743
12743
  let Z = !!l(this, Is), d = Z ? l(this, Is) : l(this, wG);
12744
- for (const t of l(this, ZZ))
12745
- if (!d || p.intersect(t.data.rect, d) !== null) {
12746
- d = t.data.rect, Z = !0;
12744
+ for (const n of l(this, ZZ))
12745
+ if (!d || p.intersect(n.data.rect, d) !== null) {
12746
+ d = n.data.rect, Z = !0;
12747
12747
  break;
12748
12748
  }
12749
12749
  const s = p.normalizeRect([d[0], I[3] - d[1] + I[1], d[2], I[3] - d[3] + I[1]]), G = Z ? d[2] - d[0] + 5 : 0, m = s[0] + G, W = s[1];
@@ -12888,8 +12888,8 @@ class DW extends KI {
12888
12888
  const s = this.svgFactory.create(Z, d, !0);
12889
12889
  let c = [];
12890
12890
  for (let m = 0, W = C.length; m < W; m += 2) {
12891
- const a = C[m] - g[0], t = g[3] - C[m + 1];
12892
- c.push(`${a},${t}`);
12891
+ const a = C[m] - g[0], n = g[3] - C[m + 1];
12892
+ c.push(`${a},${n}`);
12893
12893
  }
12894
12894
  c = c.join(" ");
12895
12895
  const G = B(this, eG, this.svgFactory.createElement(this.svgElementName));
@@ -12948,8 +12948,8 @@ class Xo extends KI {
12948
12948
  } = Y(this, VG, Tm).call(this, C, g), G = this.svgFactory.create(s, c, !0), m = B(this, nG, this.svgFactory.createElement("svg:g"));
12949
12949
  G.append(m), m.setAttribute("stroke-width", i.width || 1), m.setAttribute("stroke-linecap", "round"), m.setAttribute("stroke-linejoin", "round"), m.setAttribute("stroke-miterlimit", 10), m.setAttribute("stroke", "transparent"), m.setAttribute("fill", "transparent"), m.setAttribute("transform", d);
12950
12950
  for (let W = 0, a = A.length; W < a; W++) {
12951
- const t = this.svgFactory.createElement(this.svgElementName);
12952
- l(this, sZ).push(t), t.setAttribute("points", A[W].join(",")), m.append(t);
12951
+ const n = this.svgFactory.createElement(this.svgElementName);
12952
+ l(this, sZ).push(n), n.setAttribute("points", A[W].join(",")), m.append(n);
12953
12953
  }
12954
12954
  return !Z && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this.container.append(G), this._editOnDoubleClick(), this.container;
12955
12955
  }
@@ -13351,10 +13351,10 @@ cZ = new WeakMap(), GZ = new WeakMap(), Cs = new WeakMap(), El = new WeakMap(),
13351
13351
  return 1;
13352
13352
  if (G === W && m === a)
13353
13353
  return -1;
13354
- const t = c, e = d, X = (d + c) / 2, V = a, y = m, N = (m + a) / 2;
13355
- if (X >= V && N <= e)
13354
+ const n = c, t = d, N = (d + c) / 2, V = a, y = m, X = (m + a) / 2;
13355
+ if (N >= V && X <= t)
13356
13356
  return -1;
13357
- if (N >= t && X <= y)
13357
+ if (X >= n && N <= y)
13358
13358
  return 1;
13359
13359
  const o = (Z + s) / 2, h = (G + W) / 2;
13360
13360
  return o - h;
@@ -13589,22 +13589,22 @@ const XI = class XI extends NI {
13589
13589
  let [s, c] = this.getInitialTranslation();
13590
13590
  [s, c] = this.pageTranslationToScreen(s, c);
13591
13591
  const [G, m] = this.pageDimensions, [W, a] = this.pageTranslation;
13592
- let t, e;
13592
+ let n, t;
13593
13593
  switch (this.rotation) {
13594
13594
  case 0:
13595
- t = g + (d[0] - W) / G, e = C + this.height - (d[1] - a) / m;
13595
+ n = g + (d[0] - W) / G, t = C + this.height - (d[1] - a) / m;
13596
13596
  break;
13597
13597
  case 90:
13598
- t = g + (d[0] - W) / G, e = C - (d[1] - a) / m, [s, c] = [c, -s];
13598
+ n = g + (d[0] - W) / G, t = C - (d[1] - a) / m, [s, c] = [c, -s];
13599
13599
  break;
13600
13600
  case 180:
13601
- t = g - this.width + (d[0] - W) / G, e = C - (d[1] - a) / m, [s, c] = [-s, -c];
13601
+ n = g - this.width + (d[0] - W) / G, t = C - (d[1] - a) / m, [s, c] = [-s, -c];
13602
13602
  break;
13603
13603
  case 270:
13604
- t = g + (d[0] - W - this.height * m) / G, e = C + (d[1] - a - this.width * G) / m, [s, c] = [-c, s];
13604
+ n = g + (d[0] - W - this.height * m) / G, t = C + (d[1] - a - this.width * G) / m, [s, c] = [-c, s];
13605
13605
  break;
13606
13606
  }
13607
- this.setAt(t * i, e * Z, s, c);
13607
+ this.setAt(n * i, t * Z, s, c);
13608
13608
  } else
13609
13609
  this._moveAfterPaste(g, C);
13610
13610
  Y(this, UI, Hb).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
@@ -13613,14 +13613,14 @@ const XI = class XI extends NI {
13613
13613
  return this.div;
13614
13614
  }
13615
13615
  editorDivPaste(g) {
13616
- var t, e, X;
13616
+ var n, t, N;
13617
13617
  const C = g.clipboardData || window.clipboardData, {
13618
13618
  types: A
13619
13619
  } = C;
13620
13620
  if (A.length === 1 && A[0] === "text/plain")
13621
13621
  return;
13622
13622
  g.preventDefault();
13623
- const i = Y(t = XI, Gl, Um).call(t, C.getData("text") || "").replaceAll(Zb, `
13623
+ const i = Y(n = XI, Gl, Um).call(n, C.getData("text") || "").replaceAll(Zb, `
13624
13624
  `);
13625
13625
  if (!i)
13626
13626
  return;
@@ -13642,19 +13642,19 @@ const XI = class XI extends NI {
13642
13642
  const V = s.parentElement;
13643
13643
  if (m.push(s.nodeValue.slice(c).replaceAll(Zb, "")), V !== this.editorDiv) {
13644
13644
  let y = G;
13645
- for (const N of this.editorDiv.childNodes) {
13646
- if (N === V) {
13645
+ for (const X of this.editorDiv.childNodes) {
13646
+ if (X === V) {
13647
13647
  y = m;
13648
13648
  continue;
13649
13649
  }
13650
- y.push(Y(e = XI, Gl, ub).call(e, N));
13650
+ y.push(Y(t = XI, Gl, ub).call(t, X));
13651
13651
  }
13652
13652
  }
13653
13653
  G.push(s.nodeValue.slice(0, c).replaceAll(Zb, ""));
13654
13654
  } else if (s === this.editorDiv) {
13655
13655
  let V = G, y = 0;
13656
- for (const N of this.editorDiv.childNodes)
13657
- y++ === c && (V = m), V.push(Y(X = XI, Gl, ub).call(X, N));
13656
+ for (const X of this.editorDiv.childNodes)
13657
+ y++ === c && (V = m), V.push(Y(N = XI, Gl, ub).call(N, X));
13658
13658
  }
13659
13659
  B(this, gC, `${G.join(`
13660
13660
  `)}${i}${m.join(`
@@ -13695,13 +13695,13 @@ const XI = class XI extends NI {
13695
13695
  rotation: m,
13696
13696
  id: W,
13697
13697
  popupRef: a,
13698
- richText: t,
13699
- contentsObj: e,
13700
- creationDate: X,
13698
+ richText: n,
13699
+ contentsObj: t,
13700
+ creationDate: N,
13701
13701
  modificationDate: V
13702
13702
  },
13703
13703
  textContent: y,
13704
- textPosition: N,
13704
+ textPosition: X,
13705
13705
  parent: {
13706
13706
  page: {
13707
13707
  pageNumber: o
@@ -13716,7 +13716,7 @@ const XI = class XI extends NI {
13716
13716
  fontSize: s,
13717
13717
  value: y.join(`
13718
13718
  `),
13719
- position: N,
13719
+ position: X,
13720
13720
  pageIndex: o - 1,
13721
13721
  rect: G.slice(0),
13722
13722
  rotation: m,
@@ -13724,9 +13724,9 @@ const XI = class XI extends NI {
13724
13724
  id: W,
13725
13725
  deleted: !1,
13726
13726
  popupRef: a,
13727
- comment: (e == null ? void 0 : e.str) || null,
13728
- richText: t,
13729
- creationDate: X,
13727
+ comment: (t == null ? void 0 : t.str) || null,
13728
+ richText: n,
13729
+ creationDate: N,
13730
13730
  modificationDate: V
13731
13731
  };
13732
13732
  }
@@ -13936,11 +13936,11 @@ const RA = class RA {
13936
13936
  const m = I - c, W = g - G, a = Math.hypot(m, W);
13937
13937
  if (a < l(this, HG))
13938
13938
  return !1;
13939
- const t = a - l(this, MG), e = t / a, X = e * m, V = e * W;
13940
- let y = d, N = s;
13941
- d = c, s = G, c += X, G += V, (H = l(this, Pl)) == null || H.push(I, g);
13942
- const o = -V / t, h = X / t, n = o * l(this, Zs), R = h * l(this, Zs);
13943
- return l(this, $).set(l(this, $).subarray(2, 8), 0), l(this, $).set([c + n, G + R], 4), l(this, $).set(l(this, $).subarray(14, 18), 12), l(this, $).set([c - n, G - R], 16), isNaN(l(this, $)[6]) ? (l(this, oA).length === 0 && (l(this, $).set([d + n, s + R], 2), l(this, oA).push(NaN, NaN, NaN, NaN, (d + n - C) / i, (s + R - A) / Z), l(this, $).set([d - n, s - R], 14), l(this, rC).push(NaN, NaN, NaN, NaN, (d - n - C) / i, (s - R - A) / Z)), l(this, $).set([y, N, d, s, c, G], 6), !this.isEmpty()) : (l(this, $).set([y, N, d, s, c, G], 6), Math.abs(Math.atan2(N - s, y - d) - Math.atan2(V, X)) < Math.PI / 2 ? ([d, s, c, G] = l(this, $).subarray(2, 6), l(this, oA).push(NaN, NaN, NaN, NaN, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), [d, s, y, N] = l(this, $).subarray(14, 18), l(this, rC).push(NaN, NaN, NaN, NaN, ((y + d) / 2 - C) / i, ((N + s) / 2 - A) / Z), !0) : ([y, N, d, s, c, G] = l(this, $).subarray(0, 6), l(this, oA).push(((y + 5 * d) / 6 - C) / i, ((N + 5 * s) / 6 - A) / Z, ((5 * d + c) / 6 - C) / i, ((5 * s + G) / 6 - A) / Z, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), [c, G, d, s, y, N] = l(this, $).subarray(12, 18), l(this, rC).push(((y + 5 * d) / 6 - C) / i, ((N + 5 * s) / 6 - A) / Z, ((5 * d + c) / 6 - C) / i, ((5 * s + G) / 6 - A) / Z, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), !0));
13939
+ const n = a - l(this, MG), t = n / a, N = t * m, V = t * W;
13940
+ let y = d, X = s;
13941
+ d = c, s = G, c += N, G += V, (H = l(this, Pl)) == null || H.push(I, g);
13942
+ const o = -V / n, h = N / n, e = o * l(this, Zs), R = h * l(this, Zs);
13943
+ return l(this, $).set(l(this, $).subarray(2, 8), 0), l(this, $).set([c + e, G + R], 4), l(this, $).set(l(this, $).subarray(14, 18), 12), l(this, $).set([c - e, G - R], 16), isNaN(l(this, $)[6]) ? (l(this, oA).length === 0 && (l(this, $).set([d + e, s + R], 2), l(this, oA).push(NaN, NaN, NaN, NaN, (d + e - C) / i, (s + R - A) / Z), l(this, $).set([d - e, s - R], 14), l(this, rC).push(NaN, NaN, NaN, NaN, (d - e - C) / i, (s - R - A) / Z)), l(this, $).set([y, X, d, s, c, G], 6), !this.isEmpty()) : (l(this, $).set([y, X, d, s, c, G], 6), Math.abs(Math.atan2(X - s, y - d) - Math.atan2(V, N)) < Math.PI / 2 ? ([d, s, c, G] = l(this, $).subarray(2, 6), l(this, oA).push(NaN, NaN, NaN, NaN, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), [d, s, y, X] = l(this, $).subarray(14, 18), l(this, rC).push(NaN, NaN, NaN, NaN, ((y + d) / 2 - C) / i, ((X + s) / 2 - A) / Z), !0) : ([y, X, d, s, c, G] = l(this, $).subarray(0, 6), l(this, oA).push(((y + 5 * d) / 6 - C) / i, ((X + 5 * s) / 6 - A) / Z, ((5 * d + c) / 6 - C) / i, ((5 * s + G) / 6 - A) / Z, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), [c, G, d, s, y, X] = l(this, $).subarray(12, 18), l(this, rC).push(((y + 5 * d) / 6 - C) / i, ((X + 5 * s) / 6 - A) / Z, ((5 * d + c) / 6 - C) / i, ((5 * s + G) / 6 - A) / Z, ((d + c) / 2 - C) / i, ((s + G) / 2 - A) / Z), !0));
13944
13944
  }
13945
13945
  toSVGPath() {
13946
13946
  if (this.isEmpty())
@@ -14070,16 +14070,16 @@ class UW extends J {
14070
14070
  return new _b(g, C, A, i, Z, d);
14071
14071
  }
14072
14072
  getNewOutline(g, C) {
14073
- const [A, i, Z, d] = l(this, WZ), [s, c, G, m] = l(this, ds), W = Z * G, a = d * m, t = A * G + s, e = i * m + c, X = this.newOutliner({
14074
- x: l(this, lC)[0] * W + t,
14075
- y: l(this, lC)[1] * a + e
14073
+ const [A, i, Z, d] = l(this, WZ), [s, c, G, m] = l(this, ds), W = Z * G, a = d * m, n = A * G + s, t = i * m + c, N = this.newOutliner({
14074
+ x: l(this, lC)[0] * W + n,
14075
+ y: l(this, lC)[1] * a + t
14076
14076
  }, l(this, ds), l(this, SG), g, l(this, KG), C ?? l(this, Il));
14077
14077
  for (let V = 2; V < l(this, lC).length; V += 2)
14078
- X.add({
14079
- x: l(this, lC)[V] * W + t,
14080
- y: l(this, lC)[V + 1] * a + e
14078
+ N.add({
14079
+ x: l(this, lC)[V] * W + n,
14080
+ y: l(this, lC)[V + 1] * a + t
14081
14081
  });
14082
- return X.getOutlines();
14082
+ return N.getOutlines();
14083
14083
  }
14084
14084
  }
14085
14085
  ds = new WeakMap(), WZ = new WeakMap(), Il = new WeakMap(), KG = new WeakMap(), lC = new WeakMap(), SG = new WeakMap(), rI = new WeakMap(), w0 = new WeakSet(), OW = function(g) {
@@ -14088,9 +14088,9 @@ ds = new WeakMap(), WZ = new WeakMap(), Il = new WeakMap(), KG = new WeakMap(),
14088
14088
  const Z = [A, i, A, i];
14089
14089
  let d = A, s = i, c = A, G = i;
14090
14090
  const m = g ? Math.max : Math.min, W = new Float32Array(4);
14091
- for (let t = 6, e = C.length; t < e; t += 6) {
14092
- const X = C[t + 4], V = C[t + 5];
14093
- isNaN(C[t]) ? (p.pointBoundingBox(X, V, Z), s > V ? (d = X, s = V) : s === V && (d = m(d, X)), G < V ? (c = X, G = V) : G === V && (c = m(c, X))) : (W[0] = W[1] = 1 / 0, W[2] = W[3] = -1 / 0, p.bezierBoundingBox(A, i, ...C.slice(t, t + 6), W), p.rectBoundingBox(W[0], W[1], W[2], W[3], Z), s > W[1] ? (d = W[0], s = W[1]) : s === W[1] && (d = m(d, W[0])), G < W[3] ? (c = W[2], G = W[3]) : G === W[3] && (c = m(c, W[2]))), A = X, i = V;
14091
+ for (let n = 6, t = C.length; n < t; n += 6) {
14092
+ const N = C[n + 4], V = C[n + 5];
14093
+ isNaN(C[n]) ? (p.pointBoundingBox(N, V, Z), s > V ? (d = N, s = V) : s === V && (d = m(d, N)), G < V ? (c = N, G = V) : G === V && (c = m(c, N))) : (W[0] = W[1] = 1 / 0, W[2] = W[3] = -1 / 0, p.bezierBoundingBox(A, i, ...C.slice(n, n + 6), W), p.rectBoundingBox(W[0], W[1], W[2], W[3], Z), s > W[1] ? (d = W[0], s = W[1]) : s === W[1] && (d = m(d, W[0])), G < W[3] ? (c = W[2], G = W[3]) : G === W[3] && (c = m(c, W[2]))), A = N, i = V;
14094
14094
  }
14095
14095
  const a = l(this, WZ);
14096
14096
  a[0] = Z[0] - l(this, Il), a[1] = Z[1] - l(this, Il), a[2] = Z[2] - Z[0] + 2 * l(this, Il), a[3] = Z[3] - Z[1] + 2 * l(this, Il), this.firstPoint = [d, s], this.lastPoint = [c, G];
@@ -14106,22 +14106,22 @@ class Om {
14106
14106
  w(this, QC, []);
14107
14107
  const i = [1 / 0, 1 / 0, -1 / 0, -1 / 0], Z = 10 ** -4;
14108
14108
  for (const {
14109
- x: e,
14110
- y: X,
14109
+ x: t,
14110
+ y: N,
14111
14111
  width: V,
14112
14112
  height: y
14113
14113
  } of I) {
14114
- const N = Math.floor((e - g) / Z) * Z, o = Math.ceil((e + V + g) / Z) * Z, h = Math.floor((X - g) / Z) * Z, n = Math.ceil((X + y + g) / Z) * Z, R = [N, h, n, !0], u = [o, h, n, !1];
14115
- l(this, fl).push(R, u), p.rectBoundingBox(N, h, o, n, i);
14114
+ const X = Math.floor((t - g) / Z) * Z, o = Math.ceil((t + V + g) / Z) * Z, h = Math.floor((N - g) / Z) * Z, e = Math.ceil((N + y + g) / Z) * Z, R = [X, h, e, !0], u = [o, h, e, !1];
14115
+ l(this, fl).push(R, u), p.rectBoundingBox(X, h, o, e, i);
14116
14116
  }
14117
14117
  const d = i[2] - i[0] + 2 * C, s = i[3] - i[1] + 2 * C, c = i[0] - C, G = i[1] - C;
14118
14118
  let m = A ? -1 / 0 : 1 / 0, W = 1 / 0;
14119
- const a = l(this, fl).at(A ? -1 : -2), t = [a[0], a[2]];
14120
- for (const e of l(this, fl)) {
14121
- const [X, V, y, N] = e;
14122
- !N && A ? V < W ? (W = V, m = X) : V === W && (m = Math.max(m, X)) : N && !A && (V < W ? (W = V, m = X) : V === W && (m = Math.min(m, X))), e[0] = (X - c) / d, e[1] = (V - G) / s, e[2] = (y - G) / s;
14119
+ const a = l(this, fl).at(A ? -1 : -2), n = [a[0], a[2]];
14120
+ for (const t of l(this, fl)) {
14121
+ const [N, V, y, X] = t;
14122
+ !X && A ? V < W ? (W = V, m = N) : V === W && (m = Math.max(m, N)) : X && !A && (V < W ? (W = V, m = N) : V === W && (m = Math.min(m, N))), t[0] = (N - c) / d, t[1] = (V - G) / s, t[2] = (y - G) / s;
14123
14123
  }
14124
- B(this, pG, new Float32Array([c, G, d, s])), B(this, FG, [m, W]), B(this, JG, t);
14124
+ B(this, pG, new Float32Array([c, G, d, s])), B(this, FG, [m, W]), B(this, JG, n);
14125
14125
  }
14126
14126
  getOutlines() {
14127
14127
  l(this, fl).sort((g, C) => g[0] - C[0] || g[1] - C[1] || g[2] - C[2]);
@@ -14150,14 +14150,14 @@ pG = new WeakMap(), FG = new WeakMap(), JG = new WeakMap(), fl = new WeakMap(),
14150
14150
  C.delete(Z);
14151
14151
  let W = d, a = s;
14152
14152
  for (i = [d, c], A.push(i); ; ) {
14153
- let t;
14153
+ let n;
14154
14154
  if (C.has(G))
14155
- t = G;
14155
+ n = G;
14156
14156
  else if (C.has(m))
14157
- t = m;
14157
+ n = m;
14158
14158
  else
14159
14159
  break;
14160
- C.delete(t), [d, s, c, G, m] = t, W !== d && (i.push(W, a, d, a === s ? s : c), W = d), a = a === s ? c : s;
14160
+ C.delete(n), [d, s, c, G, m] = n, W !== d && (i.push(W, a, d, a === s ? s : c), W = d), a = a === s ? c : s;
14161
14161
  }
14162
14162
  i.push(W, a);
14163
14163
  }
@@ -14507,8 +14507,8 @@ const ZI = class ZI extends NI {
14507
14507
  y: s,
14508
14508
  width: c,
14509
14509
  height: G
14510
- } = A.getBoundingClientRect(), m = new AbortController(), W = g.combinedSignal(m), a = (t) => {
14511
- m.abort(), Y(this, uC, Ah).call(this, g, t);
14510
+ } = A.getBoundingClientRect(), m = new AbortController(), W = g.combinedSignal(m), a = (n) => {
14511
+ m.abort(), Y(this, uC, Ah).call(this, g, n);
14512
14512
  };
14513
14513
  window.addEventListener("blur", a, {
14514
14514
  signal: W
@@ -14545,15 +14545,15 @@ const ZI = class ZI extends NI {
14545
14545
  }, !0, !0);
14546
14546
  }
14547
14547
  static async deserialize(g, C, A) {
14548
- var e, X, V, y;
14548
+ var t, N, V, y;
14549
14549
  let i = null;
14550
14550
  if (g instanceof KW) {
14551
14551
  const {
14552
14552
  data: {
14553
- quadPoints: N,
14553
+ quadPoints: X,
14554
14554
  rect: o,
14555
14555
  rotation: h,
14556
- id: n,
14556
+ id: e,
14557
14557
  color: R,
14558
14558
  opacity: u,
14559
14559
  popupRef: H,
@@ -14572,13 +14572,13 @@ const ZI = class ZI extends NI {
14572
14572
  annotationType: P.HIGHLIGHT,
14573
14573
  color: Array.from(R),
14574
14574
  opacity: u,
14575
- quadPoints: N,
14575
+ quadPoints: X,
14576
14576
  boxes: null,
14577
14577
  pageIndex: T - 1,
14578
14578
  rect: o.slice(0),
14579
14579
  rotation: h,
14580
- annotationElementId: n,
14581
- id: n,
14580
+ annotationElementId: e,
14581
+ id: e,
14582
14582
  deleted: !1,
14583
14583
  popupRef: H,
14584
14584
  richText: K,
@@ -14589,10 +14589,10 @@ const ZI = class ZI extends NI {
14589
14589
  } else if (g instanceof Xo) {
14590
14590
  const {
14591
14591
  data: {
14592
- inkLists: N,
14592
+ inkLists: X,
14593
14593
  rect: o,
14594
14594
  rotation: h,
14595
- id: n,
14595
+ id: e,
14596
14596
  color: R,
14597
14597
  borderStyle: {
14598
14598
  rawWidth: u
@@ -14613,13 +14613,13 @@ const ZI = class ZI extends NI {
14613
14613
  annotationType: P.HIGHLIGHT,
14614
14614
  color: Array.from(R),
14615
14615
  thickness: u,
14616
- inkLists: N,
14616
+ inkLists: X,
14617
14617
  boxes: null,
14618
14618
  pageIndex: T - 1,
14619
14619
  rect: o.slice(0),
14620
14620
  rotation: h,
14621
- annotationElementId: n,
14622
- id: n,
14621
+ annotationElementId: e,
14622
+ id: e,
14623
14623
  deleted: !1,
14624
14624
  popupRef: H,
14625
14625
  richText: K,
@@ -14635,27 +14635,27 @@ const ZI = class ZI extends NI {
14635
14635
  opacity: c
14636
14636
  } = g, G = await super.deserialize(g, C, A);
14637
14637
  G.color = p.makeHexColor(...Z), G.opacity = c || 1, s && B(G, RC, g.thickness), G._initialData = i, g.comment && G.setCommentData(g);
14638
- const [m, W] = G.pageDimensions, [a, t] = G.pageTranslation;
14638
+ const [m, W] = G.pageDimensions, [a, n] = G.pageTranslation;
14639
14639
  if (d) {
14640
- const N = B(G, gl, []);
14640
+ const X = B(G, gl, []);
14641
14641
  for (let o = 0; o < d.length; o += 8)
14642
- N.push({
14642
+ X.push({
14643
14643
  x: (d[o] - a) / m,
14644
- y: 1 - (d[o + 1] - t) / W,
14644
+ y: 1 - (d[o + 1] - n) / W,
14645
14645
  width: (d[o + 2] - d[o]) / m,
14646
14646
  height: (d[o + 1] - d[o + 5]) / W
14647
14647
  });
14648
- Y(e = G, q, Pm).call(e), Y(X = G, q, mi).call(X), G.rotate(G.rotation);
14648
+ Y(t = G, q, Pm).call(t), Y(N = G, q, mi).call(N), G.rotate(G.rotation);
14649
14649
  } else if (s) {
14650
14650
  B(G, Gg, !0);
14651
- const N = s[0], o = {
14652
- x: N[0] - a,
14653
- y: W - (N[1] - t)
14651
+ const X = s[0], o = {
14652
+ x: X[0] - a,
14653
+ y: W - (X[1] - n)
14654
14654
  }, h = new Em(o, [0, 0, m, W], 1, l(G, RC) / 2, !0, 1e-3);
14655
- for (let u = 0, H = N.length; u < H; u += 2)
14656
- o.x = N[u] - a, o.y = W - (N[u + 1] - t), h.add(o);
14655
+ for (let u = 0, H = X.length; u < H; u += 2)
14656
+ o.x = X[u] - a, o.y = W - (X[u + 1] - n), h.add(o);
14657
14657
  const {
14658
- id: n,
14658
+ id: e,
14659
14659
  clipPathId: R
14660
14660
  } = C.drawLayer.draw({
14661
14661
  bbox: [0, 0, 1, 1],
@@ -14674,7 +14674,7 @@ const ZI = class ZI extends NI {
14674
14674
  }, !0, !0);
14675
14675
  Y(V = G, q, Db).call(V, {
14676
14676
  highlightOutlines: h.getOutlines(),
14677
- highlightId: n,
14677
+ highlightId: e,
14678
14678
  clipPathId: R
14679
14679
  }), Y(y = G, q, mi).call(y), G.rotate(G.parentRotation);
14680
14680
  }
@@ -14740,14 +14740,14 @@ cs = new WeakMap(), kG = new WeakMap(), gl = new WeakMap(), hZ = new WeakMap(),
14740
14740
  }
14741
14741
  }, !0));
14742
14742
  else if (this.parent) {
14743
- const t = this.parent.viewport.rotation;
14743
+ const n = this.parent.viewport.rotation;
14744
14744
  this.parent.drawLayer.updateProperties(l(this, ZC), {
14745
- bbox: Y(W = ZI, uC, jZ).call(W, l(this, iC).box, (t - this.rotation + 360) % 360),
14745
+ bbox: Y(W = ZI, uC, jZ).call(W, l(this, iC).box, (n - this.rotation + 360) % 360),
14746
14746
  path: {
14747
14747
  d: g.toSVGPath()
14748
14748
  }
14749
14749
  }), this.parent.drawLayer.updateProperties(l(this, Vg), {
14750
- bbox: Y(a = ZI, uC, jZ).call(a, l(this, rg).box, t),
14750
+ bbox: Y(a = ZI, uC, jZ).call(a, l(this, rg).box, n),
14751
14751
  path: {
14752
14752
  d: l(this, rg).toSVGPath()
14753
14753
  }
@@ -14759,16 +14759,16 @@ cs = new WeakMap(), kG = new WeakMap(), gl = new WeakMap(), hZ = new WeakMap(),
14759
14759
  this.x = Z, this.y = d, this.width = s, this.height = c;
14760
14760
  break;
14761
14761
  case 90: {
14762
- const [t, e] = this.parentDimensions;
14763
- this.x = d, this.y = 1 - Z, this.width = s * e / t, this.height = c * t / e;
14762
+ const [n, t] = this.parentDimensions;
14763
+ this.x = d, this.y = 1 - Z, this.width = s * t / n, this.height = c * n / t;
14764
14764
  break;
14765
14765
  }
14766
14766
  case 180:
14767
14767
  this.x = 1 - Z, this.y = 1 - d, this.width = s, this.height = c;
14768
14768
  break;
14769
14769
  case 270: {
14770
- const [t, e] = this.parentDimensions;
14771
- this.x = 1 - d, this.y = Z, this.width = s * e / t, this.height = c * t / e;
14770
+ const [n, t] = this.parentDimensions;
14771
+ this.x = 1 - d, this.y = Z, this.width = s * t / n, this.height = c * n / t;
14772
14772
  break;
14773
14773
  }
14774
14774
  }
@@ -14876,8 +14876,8 @@ cs = new WeakMap(), kG = new WeakMap(), gl = new WeakMap(), hZ = new WeakMap(),
14876
14876
  width: m,
14877
14877
  height: W
14878
14878
  } of Z) {
14879
- const a = c * g + A, t = (1 - G) * C + i;
14880
- d[s] = d[s + 4] = a, d[s + 1] = d[s + 3] = t, d[s + 2] = d[s + 6] = a + m * g, d[s + 5] = d[s + 7] = t - W * C, s += 8;
14879
+ const a = c * g + A, n = (1 - G) * C + i;
14880
+ d[s] = d[s + 4] = a, d[s + 1] = d[s + 3] = n, d[s + 2] = d[s + 6] = a + m * g, d[s + 5] = d[s + 7] = n - W * C, s += 8;
14881
14881
  }
14882
14882
  return d;
14883
14883
  }, gh = function(g) {
@@ -15103,7 +15103,7 @@ const II = class II extends NI {
15103
15103
  tI("Not implemented");
15104
15104
  }
15105
15105
  static startDrawing(g, C, A, i) {
15106
- var X;
15106
+ var N;
15107
15107
  const {
15108
15108
  target: Z,
15109
15109
  offsetX: d,
@@ -15120,30 +15120,30 @@ const II = class II extends NI {
15120
15120
  } = g, {
15121
15121
  width: W,
15122
15122
  height: a
15123
- } = Z.getBoundingClientRect(), t = B(II, YZ, new AbortController()), e = g.combinedSignal(t);
15123
+ } = Z.getBoundingClientRect(), n = B(II, YZ, new AbortController()), t = g.combinedSignal(n);
15124
15124
  if (ag.setPointer(G, c), window.addEventListener("pointerup", (V) => {
15125
15125
  ag.isSamePointerIdOrRemove(V.pointerId) && this._endDraw(V);
15126
15126
  }, {
15127
- signal: e
15127
+ signal: t
15128
15128
  }), window.addEventListener("pointercancel", (V) => {
15129
15129
  ag.isSamePointerIdOrRemove(V.pointerId) && this._currentParent.endDrawingSession();
15130
15130
  }, {
15131
- signal: e
15131
+ signal: t
15132
15132
  }), window.addEventListener("pointerdown", (V) => {
15133
15133
  ag.isSamePointerType(V.pointerType) && (ag.initializeAndAddPointerId(V.pointerId), l(II, gg).isCancellable() && (l(II, gg).removeLastElement(), l(II, gg).isEmpty() ? this._currentParent.endDrawingSession(!0) : this._endDraw(null)));
15134
15134
  }, {
15135
15135
  capture: !0,
15136
15136
  passive: !1,
15137
- signal: e
15137
+ signal: t
15138
15138
  }), window.addEventListener("contextmenu", MC, {
15139
- signal: e
15139
+ signal: t
15140
15140
  }), Z.addEventListener("pointermove", this._drawMove.bind(this), {
15141
- signal: e
15141
+ signal: t
15142
15142
  }), Z.addEventListener("touchmove", (V) => {
15143
15143
  ag.isSameTimeStamp(V.timeStamp) && LI(V);
15144
15144
  }, {
15145
- signal: e
15146
- }), g.toggleDrawing(), (X = C._editorUndoBar) == null || X.hide(), l(II, gg)) {
15145
+ signal: t
15146
+ }), g.toggleDrawing(), (N = C._editorUndoBar) == null || N.hide(), l(II, gg)) {
15147
15147
  g.drawLayer.updateProperties(this._currentDrawId, l(II, gg).startNew(d, s, W, a, m));
15148
15148
  return;
15149
15149
  }
@@ -15531,30 +15531,30 @@ class _G extends J {
15531
15531
  }
15532
15532
  serialize([g, C, A, i], Z) {
15533
15533
  const d = [], s = [], [c, G, m, W] = Y(this, og, dh).call(this);
15534
- let a, t, e, X, V, y, N, o, h;
15534
+ let a, n, t, N, V, y, X, o, h;
15535
15535
  switch (l(this, ws)) {
15536
15536
  case 0:
15537
- h = J._rescale, a = g, t = C + i, e = A, X = -i, V = g + c * A, y = C + (1 - G - W) * i, N = g + (c + m) * A, o = C + (1 - G) * i;
15537
+ h = J._rescale, a = g, n = C + i, t = A, N = -i, V = g + c * A, y = C + (1 - G - W) * i, X = g + (c + m) * A, o = C + (1 - G) * i;
15538
15538
  break;
15539
15539
  case 90:
15540
- h = J._rescaleAndSwap, a = g, t = C, e = A, X = i, V = g + G * A, y = C + c * i, N = g + (G + W) * A, o = C + (c + m) * i;
15540
+ h = J._rescaleAndSwap, a = g, n = C, t = A, N = i, V = g + G * A, y = C + c * i, X = g + (G + W) * A, o = C + (c + m) * i;
15541
15541
  break;
15542
15542
  case 180:
15543
- h = J._rescale, a = g + A, t = C, e = -A, X = i, V = g + (1 - c - m) * A, y = C + G * i, N = g + (1 - c) * A, o = C + (G + W) * i;
15543
+ h = J._rescale, a = g + A, n = C, t = -A, N = i, V = g + (1 - c - m) * A, y = C + G * i, X = g + (1 - c) * A, o = C + (G + W) * i;
15544
15544
  break;
15545
15545
  case 270:
15546
- h = J._rescaleAndSwap, a = g + A, t = C + i, e = -A, X = -i, V = g + (1 - G - W) * A, y = C + (1 - c - m) * i, N = g + (1 - G) * A, o = C + (1 - c) * i;
15546
+ h = J._rescaleAndSwap, a = g + A, n = C + i, t = -A, N = -i, V = g + (1 - G - W) * A, y = C + (1 - c - m) * i, X = g + (1 - G) * A, o = C + (1 - c) * i;
15547
15547
  break;
15548
15548
  }
15549
15549
  for (const {
15550
- line: n,
15550
+ line: e,
15551
15551
  points: R
15552
15552
  } of l(this, sC))
15553
- d.push(h(n, a, t, e, X, Z ? new Array(n.length) : null)), s.push(h(R, a, t, e, X, Z ? new Array(R.length) : null));
15553
+ d.push(h(e, a, n, t, N, Z ? new Array(e.length) : null)), s.push(h(R, a, n, t, N, Z ? new Array(R.length) : null));
15554
15554
  return {
15555
15555
  lines: d,
15556
15556
  points: s,
15557
- rect: [V, y, N, o]
15557
+ rect: [V, y, X, o]
15558
15558
  };
15559
15559
  }
15560
15560
  static deserialize(g, C, A, i, Z, {
@@ -15566,47 +15566,47 @@ class _G extends J {
15566
15566
  thickness: G
15567
15567
  }) {
15568
15568
  const m = [];
15569
- let W, a, t, e, X;
15569
+ let W, a, n, t, N;
15570
15570
  switch (c) {
15571
15571
  case 0:
15572
- X = J._rescale, W = -g / A, a = C / i + 1, t = 1 / A, e = -1 / i;
15572
+ N = J._rescale, W = -g / A, a = C / i + 1, n = 1 / A, t = -1 / i;
15573
15573
  break;
15574
15574
  case 90:
15575
- X = J._rescaleAndSwap, W = -C / i, a = -g / A, t = 1 / i, e = 1 / A;
15575
+ N = J._rescaleAndSwap, W = -C / i, a = -g / A, n = 1 / i, t = 1 / A;
15576
15576
  break;
15577
15577
  case 180:
15578
- X = J._rescale, W = g / A + 1, a = -C / i, t = -1 / A, e = 1 / i;
15578
+ N = J._rescale, W = g / A + 1, a = -C / i, n = -1 / A, t = 1 / i;
15579
15579
  break;
15580
15580
  case 270:
15581
- X = J._rescaleAndSwap, W = C / i + 1, a = g / A + 1, t = -1 / i, e = -1 / A;
15581
+ N = J._rescaleAndSwap, W = C / i + 1, a = g / A + 1, n = -1 / i, t = -1 / A;
15582
15582
  break;
15583
15583
  }
15584
15584
  if (!d) {
15585
15585
  d = [];
15586
15586
  for (const y of s) {
15587
- const N = y.length;
15588
- if (N === 2) {
15587
+ const X = y.length;
15588
+ if (X === 2) {
15589
15589
  d.push(new Float32Array([NaN, NaN, NaN, NaN, y[0], y[1]]));
15590
15590
  continue;
15591
15591
  }
15592
- if (N === 4) {
15592
+ if (X === 4) {
15593
15593
  d.push(new Float32Array([NaN, NaN, NaN, NaN, y[0], y[1], NaN, NaN, NaN, NaN, y[2], y[3]]));
15594
15594
  continue;
15595
15595
  }
15596
- const o = new Float32Array(3 * (N - 2));
15596
+ const o = new Float32Array(3 * (X - 2));
15597
15597
  d.push(o);
15598
- let [h, n, R, u] = y.subarray(0, 4);
15599
- o.set([NaN, NaN, NaN, NaN, h, n], 0);
15600
- for (let H = 4; H < N; H += 2) {
15598
+ let [h, e, R, u] = y.subarray(0, 4);
15599
+ o.set([NaN, NaN, NaN, NaN, h, e], 0);
15600
+ for (let H = 4; H < X; H += 2) {
15601
15601
  const K = y[H], D = y[H + 1];
15602
- o.set(J.createBezierPoints(h, n, R, u, K, D), (H - 2) * 3), [h, n, R, u] = [R, u, K, D];
15602
+ o.set(J.createBezierPoints(h, e, R, u, K, D), (H - 2) * 3), [h, e, R, u] = [R, u, K, D];
15603
15603
  }
15604
15604
  }
15605
15605
  }
15606
- for (let y = 0, N = d.length; y < N; y++)
15606
+ for (let y = 0, X = d.length; y < X; y++)
15607
15607
  m.push({
15608
- line: X(d[y].map((o) => o ?? NaN), W, a, t, e),
15609
- points: X(s[y].map((o) => o ?? NaN), W, a, t, e)
15608
+ line: N(d[y].map((o) => o ?? NaN), W, a, n, t),
15609
+ points: N(s[y].map((o) => o ?? NaN), W, a, n, t)
15610
15610
  });
15611
15611
  const V = new this.prototype.constructor();
15612
15612
  return V.build(m, A, i, 1, c, G, Z), V;
@@ -15665,19 +15665,19 @@ class _G extends J {
15665
15665
  getPathResizingSVGProperties([g, C, A, i]) {
15666
15666
  const [Z, d] = Y(this, og, NA).call(this), [s, c, G, m] = l(this, ug);
15667
15667
  if (Math.abs(G - Z) <= J.PRECISION || Math.abs(m - d) <= J.PRECISION) {
15668
- const X = g + A / 2 - (s + G / 2), V = C + i / 2 - (c + m / 2);
15668
+ const N = g + A / 2 - (s + G / 2), V = C + i / 2 - (c + m / 2);
15669
15669
  return {
15670
15670
  path: {
15671
15671
  "transform-origin": `${J.svgRound(g)} ${J.svgRound(C)}`,
15672
- transform: `${this.rotationTransform} translate(${X} ${V})`
15672
+ transform: `${this.rotationTransform} translate(${N} ${V})`
15673
15673
  }
15674
15674
  };
15675
15675
  }
15676
- const W = (A - 2 * Z) / (G - 2 * Z), a = (i - 2 * d) / (m - 2 * d), t = G / A, e = m / i;
15676
+ const W = (A - 2 * Z) / (G - 2 * Z), a = (i - 2 * d) / (m - 2 * d), n = G / A, t = m / i;
15677
15677
  return {
15678
15678
  path: {
15679
15679
  "transform-origin": `${J.svgRound(s)} ${J.svgRound(c)}`,
15680
- transform: `${this.rotationTransform} scale(${t} ${e}) translate(${J.svgRound(Z)} ${J.svgRound(d)}) scale(${W} ${a}) translate(${J.svgRound(-Z)} ${J.svgRound(-d)})`
15680
+ transform: `${this.rotationTransform} scale(${n} ${t}) translate(${J.svgRound(Z)} ${J.svgRound(d)}) scale(${W} ${a}) translate(${J.svgRound(-Z)} ${J.svgRound(-d)})`
15681
15681
  }
15682
15682
  };
15683
15683
  }
@@ -15686,10 +15686,10 @@ class _G extends J {
15686
15686
  if (s[0] = g, s[1] = C, s[2] = A, s[3] = i, Math.abs(m - Z) <= J.PRECISION || Math.abs(W - d) <= J.PRECISION) {
15687
15687
  const V = g + A / 2 - (c + m / 2), y = C + i / 2 - (G + W / 2);
15688
15688
  for (const {
15689
- line: N,
15689
+ line: X,
15690
15690
  points: o
15691
15691
  } of l(this, sC))
15692
- J._translate(N, V, y, N), J._translate(o, V, y, o);
15692
+ J._translate(X, V, y, X), J._translate(o, V, y, o);
15693
15693
  return {
15694
15694
  root: {
15695
15695
  viewBox: this.viewBox
@@ -15701,13 +15701,13 @@ class _G extends J {
15701
15701
  }
15702
15702
  };
15703
15703
  }
15704
- const a = (A - 2 * Z) / (m - 2 * Z), t = (i - 2 * d) / (W - 2 * d), e = -a * (c + Z) + g + Z, X = -t * (G + d) + C + d;
15705
- if (a !== 1 || t !== 1 || e !== 0 || X !== 0)
15704
+ const a = (A - 2 * Z) / (m - 2 * Z), n = (i - 2 * d) / (W - 2 * d), t = -a * (c + Z) + g + Z, N = -n * (G + d) + C + d;
15705
+ if (a !== 1 || n !== 1 || t !== 0 || N !== 0)
15706
15706
  for (const {
15707
15707
  line: V,
15708
15708
  points: y
15709
15709
  } of l(this, sC))
15710
- J._rescale(V, e, X, a, t, V), J._rescale(y, e, X, a, t, y);
15710
+ J._rescale(V, t, N, a, n, V), J._rescale(y, t, N, a, n, y);
15711
15711
  return {
15712
15712
  root: {
15713
15713
  viewBox: this.viewBox
@@ -15783,8 +15783,8 @@ ug = new WeakMap(), jG = new WeakMap(), xG = new WeakMap(), sC = new WeakMap(),
15783
15783
  }
15784
15784
  let Z = i[4], d = i[5];
15785
15785
  for (let s = 6, c = i.length; s < c; s += 6) {
15786
- const [G, m, W, a, t, e] = i.subarray(s, s + 6);
15787
- p.bezierBoundingBox(Z, d, G, m, W, a, t, e, g), Z = t, d = e;
15786
+ const [G, m, W, a, n, t] = i.subarray(s, s + 6);
15787
+ p.bezierBoundingBox(Z, d, G, m, W, a, n, t, g), Z = n, d = t;
15788
15788
  }
15789
15789
  }
15790
15790
  const [C, A] = Y(this, og, NA).call(this);
@@ -15858,15 +15858,15 @@ const fZ = class fZ extends I0 {
15858
15858
  borderStyle: {
15859
15859
  rawWidth: a
15860
15860
  },
15861
- popupRef: t,
15862
- richText: e,
15863
- contentsObj: X,
15861
+ popupRef: n,
15862
+ richText: t,
15863
+ contentsObj: N,
15864
15864
  creationDate: V,
15865
15865
  modificationDate: y
15866
15866
  },
15867
15867
  parent: {
15868
15868
  page: {
15869
- pageNumber: N
15869
+ pageNumber: X
15870
15870
  }
15871
15871
  }
15872
15872
  } = g;
@@ -15879,15 +15879,15 @@ const fZ = class fZ extends I0 {
15879
15879
  points: d
15880
15880
  },
15881
15881
  boxes: null,
15882
- pageIndex: N - 1,
15882
+ pageIndex: X - 1,
15883
15883
  rect: s.slice(0),
15884
15884
  rotation: c,
15885
15885
  annotationElementId: G,
15886
15886
  id: G,
15887
15887
  deleted: !1,
15888
- popupRef: t,
15889
- richText: e,
15890
- comment: (X == null ? void 0 : X.str) || null,
15888
+ popupRef: n,
15889
+ richText: t,
15890
+ comment: (N == null ? void 0 : N.str) || null,
15891
15891
  creationDate: V,
15892
15892
  modificationDate: y
15893
15893
  };
@@ -16002,23 +16002,23 @@ class dl {
16002
16002
  });
16003
16003
  const m = 200, W = G.font = `${C} ${A} ${m}px ${g}`, {
16004
16004
  actualBoundingBoxLeft: a,
16005
- actualBoundingBoxRight: t,
16006
- actualBoundingBoxAscent: e,
16007
- actualBoundingBoxDescent: X,
16005
+ actualBoundingBoxRight: n,
16006
+ actualBoundingBoxAscent: t,
16007
+ actualBoundingBoxDescent: N,
16008
16008
  fontBoundingBoxAscent: V,
16009
16009
  fontBoundingBoxDescent: y,
16010
- width: N
16011
- } = G.measureText(I), o = 1.5, h = Math.ceil(Math.max(Math.abs(a) + Math.abs(t) || 0, N) * o), n = Math.ceil(Math.max(Math.abs(e) + Math.abs(X) || m, Math.abs(V) + Math.abs(y) || m) * o);
16012
- c = new OffscreenCanvas(h, n), G = c.getContext("2d", {
16010
+ width: X
16011
+ } = G.measureText(I), o = 1.5, h = Math.ceil(Math.max(Math.abs(a) + Math.abs(n) || 0, X) * o), e = Math.ceil(Math.max(Math.abs(t) + Math.abs(N) || m, Math.abs(V) + Math.abs(y) || m) * o);
16012
+ c = new OffscreenCanvas(h, e), G = c.getContext("2d", {
16013
16013
  alpha: !0,
16014
16014
  willReadFrequently: !0
16015
- }), G.font = W, G.filter = "grayscale(1)", G.fillStyle = "white", G.fillRect(0, 0, h, n), G.fillStyle = "black", G.fillText(I, h * (o - 1) / 2, n * (3 - o) / 2);
16016
- const R = Y(this, dI, lo).call(this, G.getImageData(0, 0, h, n).data), u = Y(this, dI, Wh).call(this, R), H = Y(this, dI, io).call(this, u), K = Y(this, dI, Ao).call(this, R, h, n, H);
16015
+ }), G.font = W, G.filter = "grayscale(1)", G.fillStyle = "white", G.fillRect(0, 0, h, e), G.fillStyle = "black", G.fillText(I, h * (o - 1) / 2, e * (3 - o) / 2);
16016
+ const R = Y(this, dI, lo).call(this, G.getImageData(0, 0, h, e).data), u = Y(this, dI, Wh).call(this, R), H = Y(this, dI, io).call(this, u), K = Y(this, dI, Ao).call(this, R, h, e, H);
16017
16017
  return this.processDrawnLines({
16018
16018
  lines: {
16019
16019
  curves: K,
16020
16020
  width: h,
16021
- height: n
16021
+ height: e
16022
16022
  },
16023
16023
  pageWidth: i,
16024
16024
  pageHeight: Z,
@@ -16058,27 +16058,27 @@ class dl {
16058
16058
  curves: s,
16059
16059
  width: c,
16060
16060
  height: G
16061
- } = I, m = I.thickness ?? 0, W = [], a = Math.min(g / c, C / G), t = a / g, e = a / C, X = [];
16061
+ } = I, m = I.thickness ?? 0, W = [], a = Math.min(g / c, C / G), n = a / g, t = a / C, N = [];
16062
16062
  for (const {
16063
16063
  points: y
16064
16064
  } of s) {
16065
- const N = Z ? Y(this, dI, oh).call(this, y) : y;
16066
- if (!N)
16065
+ const X = Z ? Y(this, dI, oh).call(this, y) : y;
16066
+ if (!X)
16067
16067
  continue;
16068
- X.push(N);
16069
- const o = N.length, h = new Float32Array(o), n = new Float32Array(3 * (o === 2 ? 2 : o - 2));
16068
+ N.push(X);
16069
+ const o = X.length, h = new Float32Array(o), e = new Float32Array(3 * (o === 2 ? 2 : o - 2));
16070
16070
  if (W.push({
16071
- line: n,
16071
+ line: e,
16072
16072
  points: h
16073
16073
  }), o === 2) {
16074
- h[0] = N[0] * t, h[1] = N[1] * e, n.set([NaN, NaN, NaN, NaN, h[0], h[1]], 0);
16074
+ h[0] = X[0] * n, h[1] = X[1] * t, e.set([NaN, NaN, NaN, NaN, h[0], h[1]], 0);
16075
16075
  continue;
16076
16076
  }
16077
- let [R, u, H, K] = N;
16078
- R *= t, u *= e, H *= t, K *= e, h.set([R, u, H, K], 0), n.set([NaN, NaN, NaN, NaN, R, u], 0);
16077
+ let [R, u, H, K] = X;
16078
+ R *= n, u *= t, H *= n, K *= t, h.set([R, u, H, K], 0), e.set([NaN, NaN, NaN, NaN, R, u], 0);
16079
16079
  for (let D = 4; D < o; D += 2) {
16080
- const z = h[D] = N[D] * t, L = h[D + 1] = N[D + 1] * e;
16081
- n.set(J.createBezierPoints(R, u, H, K, z, L), (D - 2) * 3), [R, u, H, K] = [H, K, z, L];
16080
+ const z = h[D] = X[D] * n, L = h[D + 1] = X[D + 1] * t;
16081
+ e.set(J.createBezierPoints(R, u, H, K, z, L), (D - 2) * 3), [R, u, H, K] = [H, K, z, L];
16082
16082
  }
16083
16083
  }
16084
16084
  if (W.length === 0)
@@ -16086,7 +16086,7 @@ class dl {
16086
16086
  const V = d ? new go() : new _G();
16087
16087
  return V.build(W, g, C, 1, A, d ? 0 : m, i), {
16088
16088
  outline: V,
16089
- newCurves: X,
16089
+ newCurves: N,
16090
16090
  areContours: d,
16091
16091
  thickness: m,
16092
16092
  width: c,
@@ -16101,11 +16101,11 @@ class dl {
16101
16101
  height: i
16102
16102
  }) {
16103
16103
  let Z = 1 / 0, d = -1 / 0, s = 0;
16104
- for (const N of I) {
16105
- s += N.length;
16106
- for (let o = 2, h = N.length; o < h; o++) {
16107
- const n = N[o] - N[o - 2];
16108
- Z = Math.min(Z, n), d = Math.max(d, n);
16104
+ for (const X of I) {
16105
+ s += X.length;
16106
+ for (let o = 2, h = X.length; o < h; o++) {
16107
+ const e = X[o] - X[o - 2];
16108
+ Z = Math.min(Z, e), d = Math.max(d, e);
16109
16109
  }
16110
16110
  }
16111
16111
  let c;
@@ -16113,19 +16113,19 @@ class dl {
16113
16113
  const G = I.length, m = db + Hs * G, W = new Uint32Array(m);
16114
16114
  let a = 0;
16115
16115
  W[a++] = m * Uint32Array.BYTES_PER_ELEMENT + (s - 2 * G) * c.BYTES_PER_ELEMENT, W[a++] = 0, W[a++] = A, W[a++] = i, W[a++] = g ? 0 : 1, W[a++] = Math.max(0, Math.floor(C ?? 0)), W[a++] = G, W[a++] = c.BYTES_PER_ELEMENT;
16116
- for (const N of I)
16117
- W[a++] = N.length - 2, W[a++] = N[0], W[a++] = N[1];
16118
- const t = new CompressionStream("deflate-raw"), e = t.writable.getWriter();
16119
- await e.ready, e.write(W);
16120
- const X = c.prototype.constructor;
16121
- for (const N of I) {
16122
- const o = new X(N.length - 2);
16123
- for (let h = 2, n = N.length; h < n; h++)
16124
- o[h - 2] = N[h] - N[h - 2];
16125
- e.write(o);
16126
- }
16127
- e.close();
16128
- const V = await new Response(t.readable).arrayBuffer(), y = new Uint8Array(V);
16116
+ for (const X of I)
16117
+ W[a++] = X.length - 2, W[a++] = X[0], W[a++] = X[1];
16118
+ const n = new CompressionStream("deflate-raw"), t = n.writable.getWriter();
16119
+ await t.ready, t.write(W);
16120
+ const N = c.prototype.constructor;
16121
+ for (const X of I) {
16122
+ const o = new N(X.length - 2);
16123
+ for (let h = 2, e = X.length; h < e; h++)
16124
+ o[h - 2] = X[h] - X[h - 2];
16125
+ t.write(o);
16126
+ }
16127
+ t.close();
16128
+ const V = await new Response(n.readable).arrayBuffer(), y = new Uint8Array(V);
16129
16129
  return BB(y);
16130
16130
  }
16131
16131
  static async decompressSignature(I) {
@@ -16139,14 +16139,14 @@ class dl {
16139
16139
  }).catch(() => {
16140
16140
  });
16141
16141
  let Z = null, d = 0;
16142
- for await (const N of C)
16143
- Z || (Z = new Uint8Array(new Uint32Array(N.buffer, 0, 4)[0])), Z.set(N, d), d += N.length;
16142
+ for await (const X of C)
16143
+ Z || (Z = new Uint8Array(new Uint32Array(X.buffer, 0, 4)[0])), Z.set(X, d), d += X.length;
16144
16144
  const s = new Uint32Array(Z.buffer, 0, Z.length >> 2), c = s[1];
16145
16145
  if (c !== 0)
16146
16146
  throw new Error(`Invalid version: ${c}`);
16147
- const G = s[2], m = s[3], W = s[4] === 0, a = s[5], t = s[6], e = s[7], X = [], V = (db + Hs * t) * Uint32Array.BYTES_PER_ELEMENT;
16147
+ const G = s[2], m = s[3], W = s[4] === 0, a = s[5], n = s[6], t = s[7], N = [], V = (db + Hs * n) * Uint32Array.BYTES_PER_ELEMENT;
16148
16148
  let y;
16149
- switch (e) {
16149
+ switch (t) {
16150
16150
  case Int8Array.BYTES_PER_ELEMENT:
16151
16151
  y = new Int8Array(Z.buffer, V);
16152
16152
  break;
@@ -16158,18 +16158,18 @@ class dl {
16158
16158
  break;
16159
16159
  }
16160
16160
  d = 0;
16161
- for (let N = 0; N < t; N++) {
16162
- const o = s[Hs * N + db], h = new Float32Array(o + 2);
16163
- X.push(h);
16164
- for (let n = 0; n < Hs - 1; n++)
16165
- h[n] = s[Hs * N + db + n + 1];
16166
- for (let n = 0; n < o; n++)
16167
- h[n + 2] = h[n] + y[d++];
16161
+ for (let X = 0; X < n; X++) {
16162
+ const o = s[Hs * X + db], h = new Float32Array(o + 2);
16163
+ N.push(h);
16164
+ for (let e = 0; e < Hs - 1; e++)
16165
+ h[e] = s[Hs * X + db + e + 1];
16166
+ for (let e = 0; e < o; e++)
16167
+ h[e + 2] = h[e] + y[d++];
16168
16168
  }
16169
16169
  return {
16170
16170
  areContours: W,
16171
16171
  thickness: a,
16172
- outlines: X,
16172
+ outlines: N,
16173
16173
  width: G,
16174
16174
  height: m
16175
16175
  };
@@ -16212,49 +16212,49 @@ RZ = new WeakMap(), dI = new WeakSet(), Co = function(I, g, C, A) {
16212
16212
  const W = G * g + m, a = Z[W];
16213
16213
  if (a === 0)
16214
16214
  continue;
16215
- let t = G, e = m;
16215
+ let n = G, t = m;
16216
16216
  if (a === 1 && Z[W - 1] === 0)
16217
- d += 1, e -= 1;
16217
+ d += 1, t -= 1;
16218
16218
  else if (a >= 1 && Z[W + 1] === 0)
16219
- d += 1, e += 1, a > 1 && (s = a);
16219
+ d += 1, t += 1, a > 1 && (s = a);
16220
16220
  else {
16221
16221
  a !== 1 && (s = Math.abs(a));
16222
16222
  continue;
16223
16223
  }
16224
- const X = [m, G], V = e === m + 1, y = {
16224
+ const N = [m, G], V = t === m + 1, y = {
16225
16225
  isHole: V,
16226
- points: X,
16226
+ points: N,
16227
16227
  id: d,
16228
16228
  parent: 0
16229
16229
  };
16230
16230
  c.push(y);
16231
- let N;
16231
+ let X;
16232
16232
  for (const D of c)
16233
16233
  if (D.id === s) {
16234
- N = D;
16234
+ X = D;
16235
16235
  break;
16236
16236
  }
16237
- N ? N.isHole ? y.parent = V ? N.parent : s : y.parent = V ? s : N.parent : y.parent = V ? s : 0;
16238
- const o = Y(this, dI, bh).call(this, Z, g, G, m, t, e, 0);
16237
+ X ? X.isHole ? y.parent = V ? X.parent : s : y.parent = V ? s : X.parent : y.parent = V ? s : 0;
16238
+ const o = Y(this, dI, bh).call(this, Z, g, G, m, n, t, 0);
16239
16239
  if (o === -1) {
16240
16240
  Z[W] = -d, Z[W] !== 1 && (s = Math.abs(Z[W]));
16241
16241
  continue;
16242
16242
  }
16243
- let h = l(this, jC)[2 * o], n = l(this, jC)[2 * o + 1];
16244
- const R = G + h, u = m + n;
16245
- t = R, e = u;
16243
+ let h = l(this, jC)[2 * o], e = l(this, jC)[2 * o + 1];
16244
+ const R = G + h, u = m + e;
16245
+ n = R, t = u;
16246
16246
  let H = G, K = m;
16247
16247
  for (; ; ) {
16248
- const D = Y(this, dI, mh).call(this, Z, g, H, K, t, e, 1);
16249
- h = l(this, jC)[2 * D], n = l(this, jC)[2 * D + 1];
16250
- const z = H + h, L = K + n;
16251
- X.push(L, z);
16248
+ const D = Y(this, dI, mh).call(this, Z, g, H, K, n, t, 1);
16249
+ h = l(this, jC)[2 * D], e = l(this, jC)[2 * D + 1];
16250
+ const z = H + h, L = K + e;
16251
+ N.push(L, z);
16252
16252
  const T = H * g + K;
16253
16253
  if (Z[T + 1] === 0 ? Z[T] = -d : Z[T] === 1 && (Z[T] = d), z === G && L === m && H === R && K === u) {
16254
16254
  Z[W] !== 1 && (s = Math.abs(Z[W]));
16255
16255
  break;
16256
16256
  } else
16257
- t = H, e = K, H = z, K = L;
16257
+ n = H, t = K, H = z, K = L;
16258
16258
  }
16259
16259
  }
16260
16260
  }
@@ -16265,46 +16265,46 @@ RZ = new WeakMap(), dI = new WeakSet(), Co = function(I, g, C, A) {
16265
16265
  A.push(I[R], I[R + 1]);
16266
16266
  return;
16267
16267
  }
16268
- const i = I[g], Z = I[g + 1], d = I[C - 4] - i, s = I[C - 3] - Z, c = Math.hypot(d, s), G = d / c, m = s / c, W = G * Z - m * i, a = s / d, t = 1 / c, e = Math.atan(a), X = Math.cos(e), V = Math.sin(e), y = t * (Math.abs(X) + Math.abs(V)), N = t * (1 - y + y ** 2), o = Math.max(Math.atan(Math.abs(V + X) * N), Math.atan(Math.abs(V - X) * N));
16269
- let h = 0, n = g;
16268
+ const i = I[g], Z = I[g + 1], d = I[C - 4] - i, s = I[C - 3] - Z, c = Math.hypot(d, s), G = d / c, m = s / c, W = G * Z - m * i, a = s / d, n = 1 / c, t = Math.atan(a), N = Math.cos(t), V = Math.sin(t), y = n * (Math.abs(N) + Math.abs(V)), X = n * (1 - y + y ** 2), o = Math.max(Math.atan(Math.abs(V + N) * X), Math.atan(Math.abs(V - N) * X));
16269
+ let h = 0, e = g;
16270
16270
  for (let R = g + 2; R < C - 2; R += 2) {
16271
16271
  const u = Math.abs(W - G * I[R + 1] + m * I[R]);
16272
- u > h && (n = R, h = u);
16272
+ u > h && (e = R, h = u);
16273
16273
  }
16274
- h > (c * o) ** 2 ? (Y(this, dI, Jb).call(this, I, g, n + 2, A), Y(this, dI, Jb).call(this, I, n, C, A)) : A.push(i, Z);
16274
+ h > (c * o) ** 2 ? (Y(this, dI, Jb).call(this, I, g, e + 2, A), Y(this, dI, Jb).call(this, I, e, C, A)) : A.push(i, Z);
16275
16275
  }, oh = function(I) {
16276
16276
  const g = [], C = I.length;
16277
16277
  return Y(this, dI, Jb).call(this, I, 0, C, g), g.push(I[C - 2], I[C - 1]), g.length <= 4 ? null : g;
16278
16278
  }, Bh = function(I, g, C, A, i, Z) {
16279
16279
  const d = new Float32Array(Z ** 2), s = -2 * A ** 2, c = Z >> 1;
16280
- for (let e = 0; e < Z; e++) {
16281
- const X = (e - c) ** 2;
16280
+ for (let t = 0; t < Z; t++) {
16281
+ const N = (t - c) ** 2;
16282
16282
  for (let V = 0; V < Z; V++)
16283
- d[e * Z + V] = Math.exp((X + (V - c) ** 2) / s);
16283
+ d[t * Z + V] = Math.exp((N + (V - c) ** 2) / s);
16284
16284
  }
16285
16285
  const G = new Float32Array(256), m = -2 * i ** 2;
16286
- for (let e = 0; e < 256; e++)
16287
- G[e] = Math.exp(e ** 2 / m);
16288
- const W = I.length, a = new Uint8Array(W), t = new Uint32Array(256);
16289
- for (let e = 0; e < C; e++)
16290
- for (let X = 0; X < g; X++) {
16291
- const V = e * g + X, y = I[V];
16292
- let N = 0, o = 0;
16293
- for (let n = 0; n < Z; n++) {
16294
- const R = e + n - c;
16286
+ for (let t = 0; t < 256; t++)
16287
+ G[t] = Math.exp(t ** 2 / m);
16288
+ const W = I.length, a = new Uint8Array(W), n = new Uint32Array(256);
16289
+ for (let t = 0; t < C; t++)
16290
+ for (let N = 0; N < g; N++) {
16291
+ const V = t * g + N, y = I[V];
16292
+ let X = 0, o = 0;
16293
+ for (let e = 0; e < Z; e++) {
16294
+ const R = t + e - c;
16295
16295
  if (!(R < 0 || R >= C))
16296
16296
  for (let u = 0; u < Z; u++) {
16297
- const H = X + u - c;
16297
+ const H = N + u - c;
16298
16298
  if (H < 0 || H >= g)
16299
16299
  continue;
16300
- const K = I[R * g + H], D = d[n * Z + u] * G[Math.abs(K - y)];
16301
- N += K * D, o += D;
16300
+ const K = I[R * g + H], D = d[e * Z + u] * G[Math.abs(K - y)];
16301
+ X += K * D, o += D;
16302
16302
  }
16303
16303
  }
16304
- const h = a[V] = Math.round(N / o);
16305
- t[h]++;
16304
+ const h = a[V] = Math.round(X / o);
16305
+ n[h]++;
16306
16306
  }
16307
- return [a, t];
16307
+ return [a, n];
16308
16308
  }, Wh = function(I) {
16309
16309
  const g = new Uint32Array(256);
16310
16310
  for (const C of I)
@@ -16341,16 +16341,16 @@ RZ = new WeakMap(), dI = new WeakSet(), Co = function(I, g, C, A) {
16341
16341
  } = l(this, RZ);
16342
16342
  let Z = C, d = A;
16343
16343
  if (C > i || A > i) {
16344
- let W = C, a = A, t = Math.log2(Math.max(C, A) / i);
16345
- const e = Math.floor(t);
16346
- t = t === e ? e - 1 : e;
16347
- for (let V = 0; V < t; V++) {
16344
+ let W = C, a = A, n = Math.log2(Math.max(C, A) / i);
16345
+ const t = Math.floor(n);
16346
+ n = n === t ? t - 1 : t;
16347
+ for (let V = 0; V < n; V++) {
16348
16348
  Z = Math.ceil(W / 2), d = Math.ceil(a / 2);
16349
16349
  const y = new OffscreenCanvas(Z, d);
16350
16350
  y.getContext("2d").drawImage(I, 0, 0, W, a, 0, 0, Z, d), W = Z, a = d, I !== g && I.close(), I = y.transferToImageBitmap();
16351
16351
  }
16352
- const X = Math.min(i / Z, i / d);
16353
- Z = Math.round(Z * X), d = Math.round(d * X);
16352
+ const N = Math.min(i / Z, i / d);
16353
+ Z = Math.round(Z * N), d = Math.round(d * N);
16354
16354
  }
16355
16355
  const c = new OffscreenCanvas(Z, d).getContext("2d", {
16356
16356
  willReadFrequently: !0
@@ -16459,7 +16459,7 @@ const xg = class xg extends I0 {
16459
16459
  pageHeight: W
16460
16460
  },
16461
16461
  rotation: a
16462
- } = this.parent.viewport, t = dl.processDrawnLines({
16462
+ } = this.parent.viewport, n = dl.processDrawnLines({
16463
16463
  lines: i,
16464
16464
  pageWidth: m,
16465
16465
  pageHeight: W,
@@ -16468,7 +16468,7 @@ const xg = class xg extends I0 {
16468
16468
  mustSmooth: Z,
16469
16469
  areContours: d
16470
16470
  });
16471
- this.addSignature(t, G, s, c);
16471
+ this.addSignature(n, G, s, c);
16472
16472
  } else
16473
16473
  this.div.setAttribute("data-l10n-args", JSON.stringify({
16474
16474
  description: ""
@@ -16779,31 +16779,31 @@ class so extends NI {
16779
16779
  c = Math.floor(i * R), G = Math.floor(Z * R);
16780
16780
  }
16781
16781
  m = document.createElement("canvas");
16782
- const a = m.width = Math.ceil(c * d.sx), t = m.height = Math.ceil(G * d.sy);
16783
- l(this, cC) || (s = Y(this, lI, Lb).call(this, a, t));
16784
- const e = m.getContext("2d");
16785
- e.filter = this._uiManager.hcmFilter;
16786
- let X = "white", V = "#cfcfd8";
16787
- this._uiManager.hcmFilter !== "none" ? V = "black" : xh.isDarkMode && (X = "#8f8f9d", V = "#42414d");
16788
- const y = 15, N = y * d.sx, o = y * d.sy, h = new OffscreenCanvas(N * 2, o * 2), n = h.getContext("2d");
16789
- n.fillStyle = X, n.fillRect(0, 0, N * 2, o * 2), n.fillStyle = V, n.fillRect(0, 0, N, o), n.fillRect(N, o, N, o), e.fillStyle = e.createPattern(h, "repeat"), e.fillRect(0, 0, a, t), e.drawImage(s, 0, 0, s.width, s.height, 0, 0, a, t);
16782
+ const a = m.width = Math.ceil(c * d.sx), n = m.height = Math.ceil(G * d.sy);
16783
+ l(this, cC) || (s = Y(this, lI, Lb).call(this, a, n));
16784
+ const t = m.getContext("2d");
16785
+ t.filter = this._uiManager.hcmFilter;
16786
+ let N = "white", V = "#cfcfd8";
16787
+ this._uiManager.hcmFilter !== "none" ? V = "black" : xh.isDarkMode && (N = "#8f8f9d", V = "#42414d");
16788
+ const y = 15, X = y * d.sx, o = y * d.sy, h = new OffscreenCanvas(X * 2, o * 2), e = h.getContext("2d");
16789
+ e.fillStyle = N, e.fillRect(0, 0, X * 2, o * 2), e.fillStyle = V, e.fillRect(0, 0, X, o), e.fillRect(X, o, X, o), t.fillStyle = t.createPattern(h, "repeat"), t.fillRect(0, 0, a, n), t.drawImage(s, 0, 0, s.width, s.height, 0, 0, a, n);
16790
16790
  }
16791
16791
  let W = null;
16792
16792
  if (A) {
16793
- let a, t;
16793
+ let a, n;
16794
16794
  if (d.symmetric && s.width < g && s.height < g)
16795
- a = s.width, t = s.height;
16795
+ a = s.width, n = s.height;
16796
16796
  else if (s = l(this, uI), i > g || Z > g) {
16797
16797
  const V = Math.min(g / i, g / Z);
16798
- a = Math.floor(i * V), t = Math.floor(Z * V), l(this, cC) || (s = Y(this, lI, Lb).call(this, a, t));
16798
+ a = Math.floor(i * V), n = Math.floor(Z * V), l(this, cC) || (s = Y(this, lI, Lb).call(this, a, n));
16799
16799
  }
16800
- const X = new OffscreenCanvas(a, t).getContext("2d", {
16800
+ const N = new OffscreenCanvas(a, n).getContext("2d", {
16801
16801
  willReadFrequently: !0
16802
16802
  });
16803
- X.drawImage(s, 0, 0, s.width, s.height, 0, 0, a, t), W = {
16803
+ N.drawImage(s, 0, 0, s.width, s.height, 0, 0, a, n), W = {
16804
16804
  width: a,
16805
- height: t,
16806
- data: X.getImageData(0, 0, a, t).data
16805
+ height: n,
16806
+ data: N.getImageData(0, 0, a, n).data
16807
16807
  };
16808
16808
  }
16809
16809
  return {
@@ -16814,17 +16814,17 @@ class so extends NI {
16814
16814
  };
16815
16815
  }
16816
16816
  static async deserialize(g, C, A) {
16817
- var X;
16817
+ var N;
16818
16818
  let i = null, Z = !1;
16819
16819
  if (g instanceof SW) {
16820
16820
  const {
16821
16821
  data: {
16822
16822
  rect: V,
16823
16823
  rotation: y,
16824
- id: N,
16824
+ id: X,
16825
16825
  structParent: o,
16826
16826
  popupRef: h,
16827
- richText: n,
16827
+ richText: e,
16828
16828
  contentsObj: R,
16829
16829
  creationDate: u,
16830
16830
  modificationDate: H
@@ -16842,7 +16842,7 @@ class so extends NI {
16842
16842
  id: L,
16843
16843
  bitmap: T
16844
16844
  } = A.imageManager.getFromCanvas(K.id, z), z.remove()) : (Z = !0, g._hasNoCanvas = !0);
16845
- const x = ((X = await C._structTree.getAriaAttributes(`${UZ}${N}`)) == null ? void 0 : X.get("aria-label")) || "";
16845
+ const x = ((N = await C._structTree.getAriaAttributes(`${UZ}${X}`)) == null ? void 0 : N.get("aria-label")) || "";
16846
16846
  i = g = {
16847
16847
  annotationType: P.STAMP,
16848
16848
  bitmapId: L,
@@ -16850,8 +16850,8 @@ class so extends NI {
16850
16850
  pageIndex: D - 1,
16851
16851
  rect: V.slice(0),
16852
16852
  rotation: y,
16853
- annotationElementId: N,
16854
- id: N,
16853
+ annotationElementId: X,
16854
+ id: X,
16855
16855
  deleted: !1,
16856
16856
  accessibilityData: {
16857
16857
  decorative: !1,
@@ -16860,7 +16860,7 @@ class so extends NI {
16860
16860
  isSvg: !1,
16861
16861
  structParent: o,
16862
16862
  popupRef: h,
16863
- richText: n,
16863
+ richText: e,
16864
16864
  comment: (R == null ? void 0 : R.str) || null,
16865
16865
  creationDate: u,
16866
16866
  modificationDate: H
@@ -16875,8 +16875,8 @@ class so extends NI {
16875
16875
  accessibilityData: a
16876
16876
  } = g;
16877
16877
  Z ? (A.addMissingCanvas(g.id, d), B(d, uZ, !0)) : m && A.imageManager.isValidId(m) ? (B(d, lg, m), c && B(d, uI, c)) : B(d, Cl, G), B(d, cC, W);
16878
- const [t, e] = d.pageDimensions;
16879
- return d.width = (s[2] - s[0]) / t, d.height = (s[3] - s[1]) / e, a && (d.altTextData = a), d._initialData = i, g.comment && d.setCommentData(g), B(d, Ys, !!i), d;
16878
+ const [n, t] = d.pageDimensions;
16879
+ return d.width = (s[2] - s[0]) / n, d.height = (s[3] - s[1]) / t, a && (d.altTextData = a), d._initialData = i, g.comment && d.setCommentData(g), B(d, Ys, !!i), d;
16880
16880
  }
16881
16881
  serialize(g = !1, C = null) {
16882
16882
  if (this.isEmpty())
@@ -17207,17 +17207,17 @@ const SC = class SC {
17207
17207
  const a = document.elementsFromPoint(s, c);
17208
17208
  if (W.toggle("getElements", !1), !this.div.contains(a[0]))
17209
17209
  return;
17210
- let t;
17211
- const e = new RegExp(`^${qs}[0-9]+$`);
17210
+ let n;
17211
+ const t = new RegExp(`^${qs}[0-9]+$`);
17212
17212
  for (const V of a)
17213
- if (e.test(V.id)) {
17214
- t = V.id;
17213
+ if (t.test(V.id)) {
17214
+ n = V.id;
17215
17215
  break;
17216
17216
  }
17217
- if (!t)
17217
+ if (!n)
17218
17218
  return;
17219
- const X = l(this, Qg).get(t);
17220
- (X == null ? void 0 : X.annotationElementId) === null && (Z.stopPropagation(), Z.preventDefault(), X.dblclick(Z));
17219
+ const N = l(this, Qg).get(n);
17220
+ (N == null ? void 0 : N.annotationElementId) === null && (Z.stopPropagation(), Z.preventDefault(), N.dblclick(Z));
17221
17221
  }, {
17222
17222
  signal: i,
17223
17223
  capture: !0
@@ -17813,22 +17813,22 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17813
17813
  }
17814
17814
  }
17815
17815
  class A extends C {
17816
- constructor(o, h, n) {
17817
- super(o, n), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = h;
17816
+ constructor(o, h, e) {
17817
+ super(o, e), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = h;
17818
17818
  }
17819
17819
  draw(o) {
17820
- const h = this.render.getContext(), n = this.render.convertToGlobal(this.state.position), R = this.render.getRect().pageWidth, u = this.render.getRect().height;
17821
- h.save(), h.translate(n.x, n.y), h.beginPath();
17822
- for (let H of this.state.area) H !== null && (H = this.render.convertToGlobal(H), h.lineTo(H.x - n.x, H.y - n.y));
17820
+ const h = this.render.getContext(), e = this.render.convertToGlobal(this.state.position), R = this.render.getRect().pageWidth, u = this.render.getRect().height;
17821
+ h.save(), h.translate(e.x, e.y), h.beginPath();
17822
+ for (let H of this.state.area) H !== null && (H = this.render.convertToGlobal(H), h.lineTo(H.x - e.x, H.y - e.y));
17823
17823
  h.rotate(this.state.angle), h.clip(), this.isLoad ? h.drawImage(this.image, 0, 0, R, u) : this.drawLoader(h, { x: 0, y: 0 }, R, u), h.restore();
17824
17824
  }
17825
17825
  simpleDraw(o) {
17826
- const h = this.render.getRect(), n = this.render.getContext(), R = h.pageWidth, u = h.height, H = o === 1 ? h.left + h.pageWidth : h.left, K = h.top;
17827
- this.isLoad ? n.drawImage(this.image, H, K, R, u) : this.drawLoader(n, { x: H, y: K }, R, u);
17826
+ const h = this.render.getRect(), e = this.render.getContext(), R = h.pageWidth, u = h.height, H = o === 1 ? h.left + h.pageWidth : h.left, K = h.top;
17827
+ this.isLoad ? e.drawImage(this.image, H, K, R, u) : this.drawLoader(e, { x: H, y: K }, R, u);
17828
17828
  }
17829
- drawLoader(o, h, n, R) {
17830
- o.beginPath(), o.strokeStyle = "rgb(200, 200, 200)", o.fillStyle = "rgb(255, 255, 255)", o.lineWidth = 1, o.rect(h.x + 1, h.y + 1, n - 1, R - 1), o.stroke(), o.fill();
17831
- const u = { x: h.x + n / 2, y: h.y + R / 2 };
17829
+ drawLoader(o, h, e, R) {
17830
+ o.beginPath(), o.strokeStyle = "rgb(200, 200, 200)", o.fillStyle = "rgb(255, 255, 255)", o.lineWidth = 1, o.rect(h.x + 1, h.y + 1, e - 1, R - 1), o.stroke(), o.fill();
17831
+ const u = { x: h.x + e / 2, y: h.y + R / 2 };
17832
17832
  o.beginPath(), o.lineWidth = 10, o.arc(u.x, u.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), o.stroke(), o.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
17833
17833
  }
17834
17834
  load() {
@@ -17864,7 +17864,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17864
17864
  }
17865
17865
  getSpreadIndexByPage(o) {
17866
17866
  const h = this.getSpread();
17867
- for (let n = 0; n < h.length; n++) if (o === h[n][0] || o === h[n][1]) return n;
17867
+ for (let e = 0; e < h.length; e++) if (o === h[e][0] || o === h[e][1]) return e;
17868
17868
  return null;
17869
17869
  }
17870
17870
  getPageCount() {
@@ -17889,16 +17889,16 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17889
17889
  const h = this.currentSpreadIndex;
17890
17890
  if (this.render.getOrientation() === "portrait") return o === 0 ? this.pages[h].newTemporaryCopy() : this.pages[h - 1];
17891
17891
  {
17892
- const n = o === 0 ? this.getSpread()[h + 1] : this.getSpread()[h - 1];
17893
- return n.length === 1 || o === 0 ? this.pages[n[0]] : this.pages[n[1]];
17892
+ const e = o === 0 ? this.getSpread()[h + 1] : this.getSpread()[h - 1];
17893
+ return e.length === 1 || o === 0 ? this.pages[e[0]] : this.pages[e[1]];
17894
17894
  }
17895
17895
  }
17896
17896
  getBottomPage(o) {
17897
17897
  const h = this.currentSpreadIndex;
17898
17898
  if (this.render.getOrientation() === "portrait") return o === 0 ? this.pages[h + 1] : this.pages[h - 1];
17899
17899
  {
17900
- const n = o === 0 ? this.getSpread()[h + 1] : this.getSpread()[h - 1];
17901
- return n.length === 1 ? this.pages[n[0]] : o === 0 ? this.pages[n[1]] : this.pages[n[0]];
17900
+ const e = o === 0 ? this.getSpread()[h + 1] : this.getSpread()[h - 1];
17901
+ return e.length === 1 ? this.pages[e[0]] : o === 0 ? this.pages[e[1]] : this.pages[e[0]];
17902
17902
  }
17903
17903
  }
17904
17904
  showNext() {
@@ -17928,8 +17928,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17928
17928
  }
17929
17929
  }
17930
17930
  class Z extends i {
17931
- constructor(o, h, n) {
17932
- super(o, h), this.imagesHref = n;
17931
+ constructor(o, h, e) {
17932
+ super(o, h), this.imagesHref = e;
17933
17933
  }
17934
17934
  load() {
17935
17935
  for (const o of this.imagesHref) {
@@ -17947,44 +17947,44 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17947
17947
  return d.GetDistanceBetweenTwoPoint(o[0], o[1]);
17948
17948
  }
17949
17949
  static GetAngleBetweenTwoLine(o, h) {
17950
- const n = o[0].y - o[1].y, R = h[0].y - h[1].y, u = o[1].x - o[0].x, H = h[1].x - h[0].x;
17951
- return Math.acos((n * R + u * H) / (Math.sqrt(n * n + u * u) * Math.sqrt(R * R + H * H)));
17950
+ const e = o[0].y - o[1].y, R = h[0].y - h[1].y, u = o[1].x - o[0].x, H = h[1].x - h[0].x;
17951
+ return Math.acos((e * R + u * H) / (Math.sqrt(e * e + u * u) * Math.sqrt(R * R + H * H)));
17952
17952
  }
17953
17953
  static PointInRect(o, h) {
17954
17954
  return h === null ? null : h.x >= o.left && h.x <= o.width + o.left && h.y >= o.top && h.y <= o.top + o.height ? h : null;
17955
17955
  }
17956
- static GetRotatedPoint(o, h, n) {
17957
- return { x: o.x * Math.cos(n) + o.y * Math.sin(n) + h.x, y: o.y * Math.cos(n) - o.x * Math.sin(n) + h.y };
17956
+ static GetRotatedPoint(o, h, e) {
17957
+ return { x: o.x * Math.cos(e) + o.y * Math.sin(e) + h.x, y: o.y * Math.cos(e) - o.x * Math.sin(e) + h.y };
17958
17958
  }
17959
- static LimitPointToCircle(o, h, n) {
17960
- if (d.GetDistanceBetweenTwoPoint(o, n) <= h) return n;
17961
- const R = o.x, u = o.y, H = n.x, K = n.y;
17959
+ static LimitPointToCircle(o, h, e) {
17960
+ if (d.GetDistanceBetweenTwoPoint(o, e) <= h) return e;
17961
+ const R = o.x, u = o.y, H = e.x, K = e.y;
17962
17962
  let D = Math.sqrt(Math.pow(h, 2) * Math.pow(R - H, 2) / (Math.pow(R - H, 2) + Math.pow(u - K, 2))) + R;
17963
- n.x < 0 && (D *= -1);
17963
+ e.x < 0 && (D *= -1);
17964
17964
  let z = (D - R) * (u - K) / (R - H) + u;
17965
17965
  return R - H + u === 0 && (z = h), { x: D, y: z };
17966
17966
  }
17967
- static GetIntersectBetweenTwoSegment(o, h, n) {
17968
- return d.PointInRect(o, d.GetIntersectBeetwenTwoLine(h, n));
17967
+ static GetIntersectBetweenTwoSegment(o, h, e) {
17968
+ return d.PointInRect(o, d.GetIntersectBeetwenTwoLine(h, e));
17969
17969
  }
17970
17970
  static GetIntersectBeetwenTwoLine(o, h) {
17971
- const n = o[0].y - o[1].y, R = h[0].y - h[1].y, u = o[1].x - o[0].x, H = h[1].x - h[0].x, K = o[0].x * o[1].y - o[1].x * o[0].y, D = h[0].x * h[1].y - h[1].x * h[0].y, z = n * D - R * K, L = u * D - H * K, T = -(K * H - D * u) / (n * H - R * u), x = -(n * D - R * K) / (n * H - R * u);
17971
+ const e = o[0].y - o[1].y, R = h[0].y - h[1].y, u = o[1].x - o[0].x, H = h[1].x - h[0].x, K = o[0].x * o[1].y - o[1].x * o[0].y, D = h[0].x * h[1].y - h[1].x * h[0].y, z = e * D - R * K, L = u * D - H * K, T = -(K * H - D * u) / (e * H - R * u), x = -(e * D - R * K) / (e * H - R * u);
17972
17972
  if (isFinite(T) && isFinite(x)) return { x: T, y: x };
17973
17973
  if (Math.abs(z - L) < 0.1) throw new Error("Segment included");
17974
17974
  return null;
17975
17975
  }
17976
17976
  static GetCordsFromTwoPoint(o, h) {
17977
- const n = Math.abs(o.x - h.x), R = Math.abs(o.y - h.y), u = Math.max(n, R), H = [o];
17977
+ const e = Math.abs(o.x - h.x), R = Math.abs(o.y - h.y), u = Math.max(e, R), H = [o];
17978
17978
  function K(D, z, L, T, x) {
17979
17979
  return z > D ? D + x * (L / T) : z < D ? D - x * (L / T) : D;
17980
17980
  }
17981
- for (let D = 1; D <= u; D += 1) H.push({ x: K(o.x, h.x, n, u, D), y: K(o.y, h.y, R, u, D) });
17981
+ for (let D = 1; D <= u; D += 1) H.push({ x: K(o.x, h.x, e, u, D), y: K(o.y, h.y, R, u, D) });
17982
17982
  return H;
17983
17983
  }
17984
17984
  }
17985
17985
  class s extends C {
17986
- constructor(o, h, n) {
17987
- super(o, n), this.copiedElement = null, this.temporaryCopy = null, this.isLoad = !1, this.element = h, this.element.classList.add("stf__item"), this.element.classList.add("--" + n);
17986
+ constructor(o, h, e) {
17987
+ super(o, e), this.copiedElement = null, this.temporaryCopy = null, this.isLoad = !1, this.element = h, this.element.classList.add("stf__item"), this.element.classList.add("--" + e);
17988
17988
  }
17989
17989
  newTemporaryCopy() {
17990
17990
  return this.nowDrawingDensity === "hard" ? this : (this.temporaryCopy === null && (this.copiedElement = this.element.cloneNode(!0), this.element.parentElement.appendChild(this.copiedElement), this.temporaryCopy = new s(this.render, this.copiedElement, this.nowDrawingDensity)), this.getTemporaryCopy());
@@ -17996,7 +17996,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
17996
17996
  this.temporaryCopy !== null && (this.copiedElement.remove(), this.copiedElement = null, this.temporaryCopy = null);
17997
17997
  }
17998
17998
  draw(o) {
17999
- const h = o || this.nowDrawingDensity, n = this.render.convertToGlobal(this.state.position), R = this.render.getRect().pageWidth, u = this.render.getRect().height;
17999
+ const h = o || this.nowDrawingDensity, e = this.render.convertToGlobal(this.state.position), R = this.render.getRect().pageWidth, u = this.render.getRect().height;
18000
18000
  this.element.classList.remove("--simple");
18001
18001
  const H = `
18002
18002
  display: block;
@@ -18006,38 +18006,38 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18006
18006
  width: ${R}px;
18007
18007
  height: ${u}px;
18008
18008
  `;
18009
- h === "hard" ? this.drawHard(H) : this.drawSoft(n, H);
18009
+ h === "hard" ? this.drawHard(H) : this.drawSoft(e, H);
18010
18010
  }
18011
18011
  drawHard(o = "") {
18012
- const h = this.render.getRect().left + this.render.getRect().width / 2, n = this.state.hardDrawingAngle, R = o + `
18012
+ const h = this.render.getRect().left + this.render.getRect().width / 2, e = this.state.hardDrawingAngle, R = o + `
18013
18013
  backface-visibility: hidden;
18014
18014
  -webkit-backface-visibility: hidden;
18015
18015
  clip-path: none;
18016
18016
  -webkit-clip-path: none;
18017
18017
  ` + (this.orientation === 0 ? `transform-origin: ${this.render.getRect().pageWidth}px 0;
18018
- transform: translate3d(0, 0, 0) rotateY(${n}deg);` : `transform-origin: 0 0;
18019
- transform: translate3d(${h}px, 0, 0) rotateY(${n}deg);`);
18018
+ transform: translate3d(0, 0, 0) rotateY(${e}deg);` : `transform-origin: 0 0;
18019
+ transform: translate3d(${h}px, 0, 0) rotateY(${e}deg);`);
18020
18020
  this.element.style.cssText = R;
18021
18021
  }
18022
18022
  drawSoft(o, h = "") {
18023
- let n = "polygon( ";
18023
+ let e = "polygon( ";
18024
18024
  for (const u of this.state.area) if (u !== null) {
18025
18025
  let H = this.render.getDirection() === 1 ? { x: -u.x + this.state.position.x, y: u.y - this.state.position.y } : { x: u.x - this.state.position.x, y: u.y - this.state.position.y };
18026
- H = d.GetRotatedPoint(H, { x: 0, y: 0 }, this.state.angle), n += H.x + "px " + H.y + "px, ";
18026
+ H = d.GetRotatedPoint(H, { x: 0, y: 0 }, this.state.angle), e += H.x + "px " + H.y + "px, ";
18027
18027
  }
18028
- n = n.slice(0, -2), n += ")";
18029
- const R = h + `transform-origin: 0 0; clip-path: ${n}; -webkit-clip-path: ${n};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${o.x}px, ${o.y}px);` : `transform: translate3d(${o.x}px, ${o.y}px, 0) rotate(${this.state.angle}rad);`);
18028
+ e = e.slice(0, -2), e += ")";
18029
+ const R = h + `transform-origin: 0 0; clip-path: ${e}; -webkit-clip-path: ${e};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${o.x}px, ${o.y}px);` : `transform: translate3d(${o.x}px, ${o.y}px, 0) rotate(${this.state.angle}rad);`);
18030
18030
  this.element.style.cssText = R;
18031
18031
  }
18032
18032
  simpleDraw(o) {
18033
- const h = this.render.getRect(), n = h.pageWidth, R = h.height, u = o === 1 ? h.left + h.pageWidth : h.left, H = h.top;
18033
+ const h = this.render.getRect(), e = h.pageWidth, R = h.height, u = o === 1 ? h.left + h.pageWidth : h.left, H = h.top;
18034
18034
  this.element.classList.add("--simple"), this.element.style.cssText = `
18035
18035
  position: absolute;
18036
18036
  display: block;
18037
18037
  height: ${R}px;
18038
18038
  left: ${u}px;
18039
18039
  top: ${H}px;
18040
- width: ${n}px;
18040
+ width: ${e}px;
18041
18041
  z-index: ${this.render.getSettings().startZIndex + 1};`;
18042
18042
  }
18043
18043
  getElement() {
@@ -18054,8 +18054,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18054
18054
  }
18055
18055
  }
18056
18056
  class c extends i {
18057
- constructor(o, h, n, R) {
18058
- super(o, h), this.element = n, this.pagesElement = R;
18057
+ constructor(o, h, e, R) {
18058
+ super(o, h), this.element = e, this.pagesElement = R;
18059
18059
  }
18060
18060
  load() {
18061
18061
  for (const o of this.pagesElement) {
@@ -18066,8 +18066,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18066
18066
  }
18067
18067
  }
18068
18068
  class G {
18069
- constructor(o, h, n, R) {
18070
- this.direction = o, this.corner = h, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(n, 10), this.pageHeight = parseInt(R, 10);
18069
+ constructor(o, h, e, R) {
18070
+ this.direction = o, this.corner = h, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(e, 10), this.pageHeight = parseInt(R, 10);
18071
18071
  }
18072
18072
  calc(o) {
18073
18073
  try {
@@ -18125,9 +18125,9 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18125
18125
  this.angle = this.calculateAngle(o), this.rect = this.getPageRect(o);
18126
18126
  }
18127
18127
  calculateAngle(o) {
18128
- const h = this.pageWidth - o.x + 1, n = this.corner === "bottom" ? this.pageHeight - o.y : o.y;
18129
- let R = 2 * Math.acos(h / Math.sqrt(n * n + h * h));
18130
- n < 0 && (R = -R);
18128
+ const h = this.pageWidth - o.x + 1, e = this.corner === "bottom" ? this.pageHeight - o.y : o.y;
18129
+ let R = 2 * Math.acos(h / Math.sqrt(e * e + h * h));
18130
+ e < 0 && (R = -R);
18131
18131
  const u = Math.PI - R;
18132
18132
  if (!isFinite(R) || u >= 0 && u < 3e-3) throw new Error("The G point is too small");
18133
18133
  return this.corner === "bottom" && (R = -R), R;
@@ -18145,14 +18145,14 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18145
18145
  const h = { left: -1, top: -1, width: this.pageWidth + 2, height: this.pageHeight + 2 };
18146
18146
  this.corner === "top" ? (this.topIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [o, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [o, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [o, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = d.GetIntersectBetweenTwoSegment(h, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
18147
18147
  }
18148
- checkPositionAtCenterLine(o, h, n) {
18148
+ checkPositionAtCenterLine(o, h, e) {
18149
18149
  let R = o;
18150
18150
  const u = d.LimitPointToCircle(h, this.pageWidth, R);
18151
18151
  R !== u && (R = u, this.updateAngleAndGeometry(R));
18152
18152
  const H = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
18153
18153
  let K = this.rect.bottomRight, D = this.rect.topLeft;
18154
18154
  if (this.corner === "bottom" && (K = this.rect.topRight, D = this.rect.bottomLeft), K.x <= 0) {
18155
- const z = d.LimitPointToCircle(n, H, D);
18155
+ const z = d.LimitPointToCircle(e, H, D);
18156
18156
  z !== R && (R = z, this.updateAngleAndGeometry(R));
18157
18157
  }
18158
18158
  return R;
@@ -18173,12 +18173,12 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18173
18173
  if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(o) || (this.calc !== null && this.render.finishAnimation(), !this.start(o))) return;
18174
18174
  const h = this.getBoundsRect();
18175
18175
  this.setState("flipping");
18176
- const n = h.height / 10, R = this.calc.getCorner() === "bottom" ? h.height - n : n, u = this.calc.getCorner() === "bottom" ? h.height : 0;
18177
- this.calc.calc({ x: h.pageWidth - n, y: R }), this.animateFlippingTo({ x: h.pageWidth - n, y: R }, { x: -h.pageWidth, y: u }, !0);
18176
+ const e = h.height / 10, R = this.calc.getCorner() === "bottom" ? h.height - e : e, u = this.calc.getCorner() === "bottom" ? h.height : 0;
18177
+ this.calc.calc({ x: h.pageWidth - e, y: R }), this.animateFlippingTo({ x: h.pageWidth - e, y: R }, { x: -h.pageWidth, y: u }, !0);
18178
18178
  }
18179
18179
  start(o) {
18180
18180
  this.reset();
18181
- const h = this.render.convertToBook(o), n = this.getBoundsRect(), R = this.getDirectionByPoint(h), u = h.y >= n.height / 2 ? "bottom" : "top";
18181
+ const h = this.render.convertToBook(o), e = this.getBoundsRect(), R = this.getDirectionByPoint(h), u = h.y >= e.height / 2 ? "bottom" : "top";
18182
18182
  if (!this.checkDirection(R)) return !1;
18183
18183
  try {
18184
18184
  if (this.flippingPage = this.app.getPageCollection().getFlippingPage(R), this.bottomPage = this.app.getPageCollection().getBottomPage(R), this.render.getOrientation() === "landscape") if (R === 1) {
@@ -18188,7 +18188,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18188
18188
  const H = this.app.getPageCollection().prevBy(this.flippingPage);
18189
18189
  H !== null && this.flippingPage.getDensity() !== H.getDensity() && (this.flippingPage.setDrawingDensity("hard"), H.setDrawingDensity("hard"));
18190
18190
  }
18191
- return this.render.setDirection(R), this.calc = new G(R, u, n.pageWidth.toString(10), n.height.toString(10)), !0;
18191
+ return this.render.setDirection(R), this.calc = new G(R, u, e.pageWidth.toString(10), e.height.toString(10)), !0;
18192
18192
  } catch {
18193
18193
  return !1;
18194
18194
  }
@@ -18200,9 +18200,9 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18200
18200
  }
18201
18201
  }
18202
18202
  flipToPage(o, h) {
18203
- const n = this.app.getPageCollection().getCurrentSpreadIndex(), R = this.app.getPageCollection().getSpreadIndexByPage(o);
18203
+ const e = this.app.getPageCollection().getCurrentSpreadIndex(), R = this.app.getPageCollection().getSpreadIndexByPage(o);
18204
18204
  try {
18205
- R > n && (this.app.getPageCollection().setCurrentSpreadIndex(R - 1), this.flipNext(h)), R < n && (this.app.getPageCollection().setCurrentSpreadIndex(R + 1), this.flipPrev(h));
18205
+ R > e && (this.app.getPageCollection().setCurrentSpreadIndex(R - 1), this.flipNext(h)), R < e && (this.app.getPageCollection().setCurrentSpreadIndex(R + 1), this.flipPrev(h));
18206
18206
  } catch {
18207
18207
  }
18208
18208
  }
@@ -18214,26 +18214,26 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18214
18214
  }
18215
18215
  stopMove() {
18216
18216
  if (this.calc === null) return;
18217
- const o = this.calc.getPosition(), h = this.getBoundsRect(), n = this.calc.getCorner() === "bottom" ? h.height : 0;
18218
- o.x <= 0 ? this.animateFlippingTo(o, { x: -h.pageWidth, y: n }, !0) : this.animateFlippingTo(o, { x: h.pageWidth, y: n }, !1);
18217
+ const o = this.calc.getPosition(), h = this.getBoundsRect(), e = this.calc.getCorner() === "bottom" ? h.height : 0;
18218
+ o.x <= 0 ? this.animateFlippingTo(o, { x: -h.pageWidth, y: e }, !0) : this.animateFlippingTo(o, { x: h.pageWidth, y: e }, !1);
18219
18219
  }
18220
18220
  showCorner(o) {
18221
18221
  if (!this.checkState("read", "fold_corner")) return;
18222
- const h = this.getBoundsRect(), n = h.pageWidth;
18222
+ const h = this.getBoundsRect(), e = h.pageWidth;
18223
18223
  if (this.isPointOnCorners(o)) if (this.calc === null) {
18224
18224
  if (!this.start(o)) return;
18225
- this.setState("fold_corner"), this.calc.calc({ x: n - 1, y: 1 });
18225
+ this.setState("fold_corner"), this.calc.calc({ x: e - 1, y: 1 });
18226
18226
  const R = 50, u = this.calc.getCorner() === "bottom" ? h.height - 1 : 1, H = this.calc.getCorner() === "bottom" ? h.height - R : R;
18227
- this.animateFlippingTo({ x: n - 1, y: u }, { x: n - R, y: H }, !1, !1);
18227
+ this.animateFlippingTo({ x: e - 1, y: u }, { x: e - R, y: H }, !1, !1);
18228
18228
  } else this.do(this.render.convertToPage(o));
18229
18229
  else this.setState("read"), this.render.finishAnimation(), this.stopMove();
18230
18230
  }
18231
- animateFlippingTo(o, h, n, R = !0) {
18231
+ animateFlippingTo(o, h, e, R = !0) {
18232
18232
  const u = d.GetCordsFromTwoPoint(o, h), H = [];
18233
18233
  for (const D of u) H.push(() => this.do(D));
18234
18234
  const K = this.getAnimationDuration(u.length);
18235
18235
  this.render.startAnimation(H, K, () => {
18236
- this.calc && (n && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), R && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
18236
+ this.calc && (e && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), R && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
18237
18237
  });
18238
18238
  }
18239
18239
  getCalculation() {
@@ -18270,15 +18270,15 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18270
18270
  return !1;
18271
18271
  }
18272
18272
  isPointOnCorners(o) {
18273
- const h = this.getBoundsRect(), n = h.pageWidth, R = Math.sqrt(Math.pow(n, 2) + Math.pow(h.height, 2)) / 5, u = this.render.convertToBook(o);
18273
+ const h = this.getBoundsRect(), e = h.pageWidth, R = Math.sqrt(Math.pow(e, 2) + Math.pow(h.height, 2)) / 5, u = this.render.convertToBook(o);
18274
18274
  return u.x > 0 && u.y > 0 && u.x < h.width && u.y < h.height && (u.x < R || u.x > h.width - R) && (u.y < R || u.y > h.height - R);
18275
18275
  }
18276
18276
  }
18277
18277
  class W {
18278
18278
  constructor(o, h) {
18279
18279
  this.leftPage = null, this.rightPage = null, this.flippingPage = null, this.bottomPage = null, this.direction = null, this.orientation = null, this.shadow = null, this.animation = null, this.pageRect = null, this.boundsRect = null, this.timer = 0, this.safari = !1, this.setting = h, this.app = o;
18280
- const n = new RegExp("Version\\/[\\d\\.]+.*Safari/");
18281
- this.safari = n.exec(window.navigator.userAgent) !== null;
18280
+ const e = new RegExp("Version\\/[\\d\\.]+.*Safari/");
18281
+ this.safari = e.exec(window.navigator.userAgent) !== null;
18282
18282
  }
18283
18283
  render(o) {
18284
18284
  if (this.animation !== null) {
@@ -18294,8 +18294,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18294
18294
  };
18295
18295
  requestAnimationFrame(o);
18296
18296
  }
18297
- startAnimation(o, h, n) {
18298
- this.finishAnimation(), this.animation = { frames: o, duration: h, durationFrame: h / o.length, onAnimateEnd: n, startedAt: this.timer };
18297
+ startAnimation(o, h, e) {
18298
+ this.finishAnimation(), this.animation = { frames: o, duration: h, durationFrame: h / o.length, onAnimateEnd: e, startedAt: this.timer };
18299
18299
  }
18300
18300
  finishAnimation() {
18301
18301
  this.animation !== null && (this.animation.frames[this.animation.frames.length - 1](), this.animation.onAnimateEnd !== null && this.animation.onAnimateEnd()), this.animation = null;
@@ -18307,14 +18307,14 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18307
18307
  }
18308
18308
  calculateBoundsRect() {
18309
18309
  let o = "landscape";
18310
- const h = this.getBlockWidth(), n = h / 2, R = this.getBlockHeight() / 2, u = this.setting.width / this.setting.height;
18311
- let H = this.setting.width, K = this.setting.height, D = n - H;
18312
- return this.setting.size === "stretch" ? (h < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (o = "portrait"), H = o === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, H > this.setting.maxWidth && (H = this.setting.maxWidth), K = H / u, K > this.getBlockHeight() && (K = this.getBlockHeight(), H = K * u), D = o === "portrait" ? n - H / 2 - H : n - H) : h < 2 * H && this.app.getSettings().usePortrait && (o = "portrait", D = n - H / 2 - H), this.boundsRect = { left: D, top: R - K / 2, width: 2 * H, height: K, pageWidth: H }, o;
18310
+ const h = this.getBlockWidth(), e = h / 2, R = this.getBlockHeight() / 2, u = this.setting.width / this.setting.height;
18311
+ let H = this.setting.width, K = this.setting.height, D = e - H;
18312
+ return this.setting.size === "stretch" ? (h < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (o = "portrait"), H = o === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, H > this.setting.maxWidth && (H = this.setting.maxWidth), K = H / u, K > this.getBlockHeight() && (K = this.getBlockHeight(), H = K * u), D = o === "portrait" ? e - H / 2 - H : e - H) : h < 2 * H && this.app.getSettings().usePortrait && (o = "portrait", D = e - H / 2 - H), this.boundsRect = { left: D, top: R - K / 2, width: 2 * H, height: K, pageWidth: H }, o;
18313
18313
  }
18314
- setShadowData(o, h, n, R) {
18314
+ setShadowData(o, h, e, R) {
18315
18315
  if (!this.app.getSettings().drawShadow) return;
18316
18316
  const u = 100 * this.getSettings().maxShadowOpacity;
18317
- this.shadow = { pos: o, angle: h, width: 3 * this.getRect().pageWidth / 4 * n / 100, opacity: (100 - n) * u / 100 / 100, direction: R, progress: 2 * n };
18317
+ this.shadow = { pos: o, angle: h, width: 3 * this.getRect().pageWidth / 4 * e / 100, opacity: (100 - e) * u / 100 / 100, direction: R, progress: 2 * e };
18318
18318
  }
18319
18319
  clearShadow() {
18320
18320
  this.shadow = null;
@@ -18364,21 +18364,21 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18364
18364
  }
18365
18365
  convertToPage(o, h) {
18366
18366
  h || (h = this.direction);
18367
- const n = this.getRect();
18368
- return { x: h === 0 ? o.x - n.left - n.width / 2 : n.width / 2 - o.x + n.left, y: o.y - n.top };
18367
+ const e = this.getRect();
18368
+ return { x: h === 0 ? o.x - e.left - e.width / 2 : e.width / 2 - o.x + e.left, y: o.y - e.top };
18369
18369
  }
18370
18370
  convertToGlobal(o, h) {
18371
18371
  if (h || (h = this.direction), o == null) return null;
18372
- const n = this.getRect();
18373
- return { x: h === 0 ? o.x + n.left + n.width / 2 : n.width / 2 - o.x + n.left, y: o.y + n.top };
18372
+ const e = this.getRect();
18373
+ return { x: h === 0 ? o.x + e.left + e.width / 2 : e.width / 2 - o.x + e.left, y: o.y + e.top };
18374
18374
  }
18375
18375
  convertRectToGlobal(o, h) {
18376
18376
  return h || (h = this.direction), { topLeft: this.convertToGlobal(o.topLeft, h), topRight: this.convertToGlobal(o.topRight, h), bottomLeft: this.convertToGlobal(o.bottomLeft, h), bottomRight: this.convertToGlobal(o.bottomRight, h) };
18377
18377
  }
18378
18378
  }
18379
18379
  class a extends W {
18380
- constructor(o, h, n) {
18381
- super(o, h), this.canvas = n, this.ctx = n.getContext("2d");
18380
+ constructor(o, h, e) {
18381
+ super(o, h), this.canvas = e, this.ctx = e.getContext("2d");
18382
18382
  }
18383
18383
  getContext() {
18384
18384
  return this.ctx;
@@ -18395,8 +18395,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18395
18395
  this.ctx.save(), this.ctx.beginPath();
18396
18396
  const h = o.width / 20;
18397
18397
  this.ctx.rect(o.left, o.top, o.width, o.height);
18398
- const n = { x: o.left + o.width / 2 - h / 2, y: 0 };
18399
- this.ctx.translate(n.x, n.y);
18398
+ const e = { x: o.left + o.width / 2 - h / 2, y: 0 };
18399
+ this.ctx.translate(e.x, e.y);
18400
18400
  const R = this.ctx.createLinearGradient(0, 0, h, 0);
18401
18401
  R.addColorStop(0, "rgba(0, 0, 0, 0)"), R.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), R.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), R.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), R.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), R.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = R, this.ctx.fillRect(0, 0, h, 2 * o.height), this.ctx.restore();
18402
18402
  }
@@ -18405,14 +18405,14 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18405
18405
  this.ctx.save(), this.ctx.beginPath(), this.ctx.rect(o.left, o.top, o.width, o.height);
18406
18406
  const h = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y });
18407
18407
  this.ctx.translate(h.x, h.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
18408
- const n = this.ctx.createLinearGradient(0, 0, this.shadow.width, 0);
18409
- this.shadow.direction === 0 ? (this.ctx.translate(0, -100), n.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), n.addColorStop(1, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(-this.shadow.width, -100), n.addColorStop(0, "rgba(0, 0, 0, 0)"), n.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")")), this.ctx.clip(), this.ctx.fillStyle = n, this.ctx.fillRect(0, 0, this.shadow.width, 2 * o.height), this.ctx.restore();
18408
+ const e = this.ctx.createLinearGradient(0, 0, this.shadow.width, 0);
18409
+ this.shadow.direction === 0 ? (this.ctx.translate(0, -100), e.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), e.addColorStop(1, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(-this.shadow.width, -100), e.addColorStop(0, "rgba(0, 0, 0, 0)"), e.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")")), this.ctx.clip(), this.ctx.fillStyle = e, this.ctx.fillRect(0, 0, this.shadow.width, 2 * o.height), this.ctx.restore();
18410
18410
  }
18411
18411
  drawInnerShadow() {
18412
18412
  const o = this.getRect();
18413
18413
  this.ctx.save(), this.ctx.beginPath();
18414
- const h = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), n = this.convertRectToGlobal(this.pageRect);
18415
- this.ctx.moveTo(n.topLeft.x, n.topLeft.y), this.ctx.lineTo(n.topRight.x, n.topRight.y), this.ctx.lineTo(n.bottomRight.x, n.bottomRight.y), this.ctx.lineTo(n.bottomLeft.x, n.bottomLeft.y), this.ctx.translate(h.x, h.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
18414
+ const h = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), e = this.convertRectToGlobal(this.pageRect);
18415
+ this.ctx.moveTo(e.topLeft.x, e.topLeft.y), this.ctx.lineTo(e.topRight.x, e.topRight.y), this.ctx.lineTo(e.bottomRight.x, e.bottomRight.y), this.ctx.lineTo(e.bottomLeft.x, e.bottomLeft.y), this.ctx.translate(h.x, h.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
18416
18416
  const R = 3 * this.shadow.width / 4, u = this.ctx.createLinearGradient(0, 0, R, 0);
18417
18417
  this.shadow.direction === 0 ? (this.ctx.translate(-R, -100), u.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), u.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), u.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), u.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), u.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), u.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), u.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), u.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = u, this.ctx.fillRect(0, 0, R, 2 * o.height), this.ctx.restore();
18418
18418
  }
@@ -18420,8 +18420,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18420
18420
  this.ctx.fillStyle = "white", this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
18421
18421
  }
18422
18422
  }
18423
- class t {
18424
- constructor(o, h, n) {
18423
+ class n {
18424
+ constructor(o, h, e) {
18425
18425
  this.touchPoint = null, this.swipeTimeout = 250, this.onResize = () => {
18426
18426
  this.update();
18427
18427
  }, this.onMouseDown = (u) => {
@@ -18459,7 +18459,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18459
18459
  }
18460
18460
  }, this.parentElement = o, o.classList.add("stf__parent"), o.insertAdjacentHTML("afterbegin", '<div class="stf__wrapper"></div>'), this.wrapper = o.querySelector(".stf__wrapper"), this.app = h;
18461
18461
  const R = this.app.getSettings().usePortrait ? 1 : 2;
18462
- o.style.minWidth = n.minWidth * R + "px", o.style.minHeight = n.minHeight + "px", n.size === "fixed" && (o.style.minWidth = n.width * R + "px", o.style.minHeight = n.height + "px"), n.autoSize && (o.style.width = "100%", o.style.maxWidth = 2 * n.maxWidth + "px"), o.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = n.swipeDistance;
18462
+ o.style.minWidth = e.minWidth * R + "px", o.style.minHeight = e.minHeight + "px", e.size === "fixed" && (o.style.minWidth = e.width * R + "px", o.style.minHeight = e.height + "px"), e.autoSize && (o.style.width = "100%", o.style.maxWidth = 2 * e.maxWidth + "px"), o.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = e.swipeDistance;
18463
18463
  }
18464
18464
  destroy() {
18465
18465
  this.app.getSettings().useMouseEvents && this.removeHandlers(), this.distElement.remove(), this.wrapper.remove();
@@ -18480,16 +18480,16 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18480
18480
  window.addEventListener("resize", this.onResize, !1), this.app.getSettings().useMouseEvents && (this.distElement.addEventListener("mousedown", this.onMouseDown), this.distElement.addEventListener("touchstart", this.onTouchStart), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("touchmove", this.onTouchMove, { passive: !this.app.getSettings().mobileScrollSupport }), window.addEventListener("mouseup", this.onMouseUp), window.addEventListener("touchend", this.onTouchEnd));
18481
18481
  }
18482
18482
  getMousePos(o, h) {
18483
- const n = this.distElement.getBoundingClientRect();
18484
- return { x: o - n.left, y: h - n.top };
18483
+ const e = this.distElement.getBoundingClientRect();
18484
+ return { x: o - e.left, y: h - e.top };
18485
18485
  }
18486
18486
  checkTarget(o) {
18487
18487
  return !this.app.getSettings().clickEventForward || !["a", "button"].includes(o.tagName.toLowerCase());
18488
18488
  }
18489
18489
  }
18490
- class e extends t {
18491
- constructor(o, h, n, R) {
18492
- super(o, h, n), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = o.querySelector(".stf__block"), this.items = R;
18490
+ class t extends n {
18491
+ constructor(o, h, e, R) {
18492
+ super(o, h, e), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = o.querySelector(".stf__block"), this.items = R;
18493
18493
  for (const u of R) this.distElement.appendChild(u);
18494
18494
  this.setHandlers();
18495
18495
  }
@@ -18505,13 +18505,13 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18505
18505
  this.app.getRender().update();
18506
18506
  }
18507
18507
  }
18508
- class X extends t {
18509
- constructor(o, h, n) {
18510
- super(o, h, n), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = o.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
18508
+ class N extends n {
18509
+ constructor(o, h, e) {
18510
+ super(o, h, e), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = o.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
18511
18511
  }
18512
18512
  resizeCanvas() {
18513
- const o = getComputedStyle(this.canvas), h = parseInt(o.getPropertyValue("width"), 10), n = parseInt(o.getPropertyValue("height"), 10);
18514
- this.canvas.width = h, this.canvas.height = n;
18513
+ const o = getComputedStyle(this.canvas), h = parseInt(o.getPropertyValue("width"), 10), e = parseInt(o.getPropertyValue("height"), 10);
18514
+ this.canvas.width = h, this.canvas.height = e;
18515
18515
  }
18516
18516
  getCanvas() {
18517
18517
  return this.canvas;
@@ -18521,8 +18521,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18521
18521
  }
18522
18522
  }
18523
18523
  class V extends W {
18524
- constructor(o, h, n) {
18525
- super(o, h), this.outerShadow = null, this.innerShadow = null, this.hardShadow = null, this.hardInnerShadow = null, this.element = n, this.createShadows();
18524
+ constructor(o, h, e) {
18525
+ super(o, h), this.outerShadow = null, this.innerShadow = null, this.hardShadow = null, this.hardInnerShadow = null, this.element = e, this.createShadows();
18526
18526
  }
18527
18527
  createShadows() {
18528
18528
  this.element.insertAdjacentHTML("beforeend", `<div class="stf__outerShadow"></div>
@@ -18538,12 +18538,12 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18538
18538
  }
18539
18539
  drawHardInnerShadow() {
18540
18540
  const o = this.getRect(), h = this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress;
18541
- let n = (100 - h) * (2.5 * o.pageWidth) / 100 + 20;
18542
- n > o.pageWidth && (n = o.pageWidth);
18541
+ let e = (100 - h) * (2.5 * o.pageWidth) / 100 + 20;
18542
+ e > o.pageWidth && (e = o.pageWidth);
18543
18543
  let R = `
18544
18544
  display: block;
18545
18545
  z-index: ${(this.getSettings().startZIndex + 5).toString(10)};
18546
- width: ${n}px;
18546
+ width: ${e}px;
18547
18547
  height: ${o.height}px;
18548
18548
  background: linear-gradient(to right,
18549
18549
  rgba(0, 0, 0, ${this.shadow.opacity * h / 100}) 5%,
@@ -18557,7 +18557,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18557
18557
  const o = this.getRect();
18558
18558
  let h = (100 - (this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress)) * (2.5 * o.pageWidth) / 100 + 20;
18559
18559
  h > o.pageWidth && (h = o.pageWidth);
18560
- let n = `
18560
+ let e = `
18561
18561
  display: block;
18562
18562
  z-index: ${(this.getSettings().startZIndex + 4).toString(10)};
18563
18563
  width: ${h}px;
@@ -18566,14 +18566,14 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18566
18566
  left: ${o.left + o.width / 2}px;
18567
18567
  transform-origin: 0 0;
18568
18568
  `;
18569
- n += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0) rotateY(180deg);" : "transform: translate3d(0, 0, 0);", this.hardShadow.style.cssText = n;
18569
+ e += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0) rotateY(180deg);" : "transform: translate3d(0, 0, 0);", this.hardShadow.style.cssText = e;
18570
18570
  }
18571
18571
  drawInnerShadow() {
18572
- const o = this.getRect(), h = 3 * this.shadow.width / 4, n = this.getDirection() === 0 ? h : 0, R = this.getDirection() === 0 ? "to left" : "to right", u = this.convertToGlobal(this.shadow.pos), H = this.shadow.angle + 3 * Math.PI / 2, K = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
18572
+ const o = this.getRect(), h = 3 * this.shadow.width / 4, e = this.getDirection() === 0 ? h : 0, R = this.getDirection() === 0 ? "to left" : "to right", u = this.convertToGlobal(this.shadow.pos), H = this.shadow.angle + 3 * Math.PI / 2, K = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
18573
18573
  let D = "polygon( ";
18574
18574
  for (const L of K) {
18575
18575
  let T = this.getDirection() === 1 ? { x: -L.x + this.shadow.pos.x, y: L.y - this.shadow.pos.y } : { x: L.x - this.shadow.pos.x, y: L.y - this.shadow.pos.y };
18576
- T = d.GetRotatedPoint(T, { x: n, y: 100 }, H), D += T.x + "px " + T.y + "px, ";
18576
+ T = d.GetRotatedPoint(T, { x: e, y: 100 }, H), D += T.x + "px " + T.y + "px, ";
18577
18577
  }
18578
18578
  D = D.slice(0, -2), D += ")";
18579
18579
  const z = `
@@ -18586,19 +18586,19 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18586
18586
  rgba(0, 0, 0, 0.05) 15%,
18587
18587
  rgba(0, 0, 0, ${this.shadow.opacity}) 35%,
18588
18588
  rgba(0, 0, 0, 0) 100%);
18589
- transform-origin: ${n}px 100px;
18590
- transform: translate3d(${u.x - n}px, ${u.y - 100}px, 0) rotate(${H}rad);
18589
+ transform-origin: ${e}px 100px;
18590
+ transform: translate3d(${u.x - e}px, ${u.y - 100}px, 0) rotate(${H}rad);
18591
18591
  clip-path: ${D};
18592
18592
  -webkit-clip-path: ${D};
18593
18593
  `;
18594
18594
  this.innerShadow.style.cssText = z;
18595
18595
  }
18596
18596
  drawOuterShadow() {
18597
- const o = this.getRect(), h = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), n = this.shadow.angle + 3 * Math.PI / 2, R = this.getDirection() === 1 ? this.shadow.width : 0, u = this.getDirection() === 0 ? "to right" : "to left", H = [{ x: 0, y: 0 }, { x: o.pageWidth, y: 0 }, { x: o.pageWidth, y: o.height }, { x: 0, y: o.height }];
18597
+ const o = this.getRect(), h = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), e = this.shadow.angle + 3 * Math.PI / 2, R = this.getDirection() === 1 ? this.shadow.width : 0, u = this.getDirection() === 0 ? "to right" : "to left", H = [{ x: 0, y: 0 }, { x: o.pageWidth, y: 0 }, { x: o.pageWidth, y: o.height }, { x: 0, y: o.height }];
18598
18598
  let K = "polygon( ";
18599
18599
  for (const z of H) if (z !== null) {
18600
18600
  let L = this.getDirection() === 1 ? { x: -z.x + this.shadow.pos.x, y: z.y - this.shadow.pos.y } : { x: z.x - this.shadow.pos.x, y: z.y - this.shadow.pos.y };
18601
- L = d.GetRotatedPoint(L, { x: R, y: 100 }, n), K += L.x + "px " + L.y + "px, ";
18601
+ L = d.GetRotatedPoint(L, { x: R, y: 100 }, e), K += L.x + "px " + L.y + "px, ";
18602
18602
  }
18603
18603
  K = K.slice(0, -2), K += ")";
18604
18604
  const D = `
@@ -18608,7 +18608,7 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18608
18608
  height: ${2 * o.height}px;
18609
18609
  background: linear-gradient(${u}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
18610
18610
  transform-origin: ${R}px 100px;
18611
- transform: translate3d(${h.x - R}px, ${h.y - 100}px, 0) rotate(${n}rad);
18611
+ transform: translate3d(${h.x - R}px, ${h.y - 100}px, 0) rotate(${e}rad);
18612
18612
  clip-path: ${K};
18613
18613
  -webkit-clip-path: ${K};
18614
18614
  `;
@@ -18647,12 +18647,12 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18647
18647
  return h.size === "stretch" ? (h.minWidth <= 0 && (h.minWidth = 100), h.maxWidth < h.minWidth && (h.maxWidth = 2e3), h.minHeight <= 0 && (h.minHeight = 100), h.maxHeight < h.minHeight && (h.maxHeight = 2e3)) : (h.minWidth = h.width, h.maxWidth = h.width, h.minHeight = h.height, h.maxHeight = h.height), h;
18648
18648
  }
18649
18649
  }
18650
- (function(N, o) {
18650
+ (function(X, o) {
18651
18651
  o === void 0 && (o = {});
18652
18652
  var h = o.insertAt;
18653
18653
  if (typeof document < "u") {
18654
- var n = document.head || document.getElementsByTagName("head")[0], R = document.createElement("style");
18655
- R.type = "text/css", h === "top" && n.firstChild ? n.insertBefore(R, n.firstChild) : n.appendChild(R), R.styleSheet ? R.styleSheet.cssText = N : R.appendChild(document.createTextNode(N));
18654
+ var e = document.head || document.getElementsByTagName("head")[0], R = document.createElement("style");
18655
+ R.type = "text/css", h === "top" && e.firstChild ? e.insertBefore(R, e.firstChild) : e.appendChild(R), R.styleSheet ? R.styleSheet.cssText = X : R.appendChild(document.createTextNode(X));
18656
18656
  }
18657
18657
  })(`.stf__parent {
18658
18658
  position: relative;
@@ -18718,18 +18718,18 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18718
18718
  constructor() {
18719
18719
  this.events = /* @__PURE__ */ new Map();
18720
18720
  }
18721
- on(N, o) {
18722
- return this.events.has(N) ? this.events.get(N).push(o) : this.events.set(N, [o]), this;
18721
+ on(X, o) {
18722
+ return this.events.has(X) ? this.events.get(X).push(o) : this.events.set(X, [o]), this;
18723
18723
  }
18724
- off(N) {
18725
- this.events.delete(N);
18724
+ off(X) {
18725
+ this.events.delete(X);
18726
18726
  }
18727
- trigger(N, o, h = null) {
18728
- if (this.events.has(N)) for (const n of this.events.get(N)) n({ data: h, object: o });
18727
+ trigger(X, o, h = null) {
18728
+ if (this.events.has(X)) for (const e of this.events.get(X)) e({ data: h, object: o });
18729
18729
  }
18730
18730
  } {
18731
- constructor(N, o) {
18732
- super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new y().getSettings(o), this.block = N;
18731
+ constructor(X, o) {
18732
+ super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new y().getSettings(o), this.block = X;
18733
18733
  }
18734
18734
  destroy() {
18735
18735
  this.ui.destroy(), this.block.remove();
@@ -18737,25 +18737,25 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18737
18737
  update() {
18738
18738
  this.render.update(), this.pages.show();
18739
18739
  }
18740
- loadFromImages(N) {
18741
- this.ui = new X(this.block, this, this.setting);
18740
+ loadFromImages(X) {
18741
+ this.ui = new N(this.block, this, this.setting);
18742
18742
  const o = this.ui.getCanvas();
18743
- this.render = new a(this, this.setting, o), this.flipController = new m(this.render, this), this.pages = new Z(this, this.render, N), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
18743
+ this.render = new a(this, this.setting, o), this.flipController = new m(this.render, this), this.pages = new Z(this, this.render, X), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
18744
18744
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
18745
18745
  }, 1);
18746
18746
  }
18747
- loadFromHTML(N) {
18748
- this.ui = new e(this.block, this, this.setting, N), this.render = new V(this, this.setting, this.ui.getDistElement()), this.flipController = new m(this.render, this), this.pages = new c(this, this.render, this.ui.getDistElement(), N), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
18747
+ loadFromHTML(X) {
18748
+ this.ui = new t(this.block, this, this.setting, X), this.render = new V(this, this.setting, this.ui.getDistElement()), this.flipController = new m(this.render, this), this.pages = new c(this, this.render, this.ui.getDistElement(), X), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
18749
18749
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
18750
18750
  }, 1);
18751
18751
  }
18752
- updateFromImages(N) {
18752
+ updateFromImages(X) {
18753
18753
  const o = this.pages.getCurrentPageIndex();
18754
- this.pages.destroy(), this.pages = new Z(this, this.render, N), this.pages.load(), this.pages.show(o), this.trigger("update", this, { page: o, mode: this.render.getOrientation() });
18754
+ this.pages.destroy(), this.pages = new Z(this, this.render, X), this.pages.load(), this.pages.show(o), this.trigger("update", this, { page: o, mode: this.render.getOrientation() });
18755
18755
  }
18756
- updateFromHtml(N) {
18756
+ updateFromHtml(X) {
18757
18757
  const o = this.pages.getCurrentPageIndex();
18758
- this.pages.destroy(), this.pages = new c(this, this.render, this.ui.getDistElement(), N), this.pages.load(), this.ui.updateItems(N), this.render.reload(), this.pages.show(o), this.trigger("update", this, { page: o, mode: this.render.getOrientation() });
18758
+ this.pages.destroy(), this.pages = new c(this, this.render, this.ui.getDistElement(), X), this.pages.load(), this.ui.updateItems(X), this.render.reload(), this.pages.show(o), this.trigger("update", this, { page: o, mode: this.render.getOrientation() });
18759
18759
  }
18760
18760
  clear() {
18761
18761
  this.pages.destroy(), this.ui.clear();
@@ -18766,26 +18766,26 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18766
18766
  turnToNextPage() {
18767
18767
  this.pages.showNext();
18768
18768
  }
18769
- turnToPage(N) {
18770
- this.pages.show(N);
18769
+ turnToPage(X) {
18770
+ this.pages.show(X);
18771
18771
  }
18772
- flipNext(N = "top") {
18773
- this.flipController.flipNext(N);
18772
+ flipNext(X = "top") {
18773
+ this.flipController.flipNext(X);
18774
18774
  }
18775
- flipPrev(N = "top") {
18776
- this.flipController.flipPrev(N);
18775
+ flipPrev(X = "top") {
18776
+ this.flipController.flipPrev(X);
18777
18777
  }
18778
- flip(N, o = "top") {
18779
- this.flipController.flipToPage(N, o);
18778
+ flip(X, o = "top") {
18779
+ this.flipController.flipToPage(X, o);
18780
18780
  }
18781
- updateState(N) {
18782
- this.trigger("changeState", this, N);
18781
+ updateState(X) {
18782
+ this.trigger("changeState", this, X);
18783
18783
  }
18784
- updatePageIndex(N) {
18785
- this.trigger("flip", this, N);
18784
+ updatePageIndex(X) {
18785
+ this.trigger("flip", this, X);
18786
18786
  }
18787
- updateOrientation(N) {
18788
- this.ui.setOrientationStyle(N), this.update(), this.trigger("changeOrientation", this, N);
18787
+ updateOrientation(X) {
18788
+ this.ui.setOrientationStyle(X), this.update(), this.trigger("changeOrientation", this, X);
18789
18789
  }
18790
18790
  getPageCount() {
18791
18791
  return this.pages.getPageCount();
@@ -18793,8 +18793,8 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18793
18793
  getCurrentPageIndex() {
18794
18794
  return this.pages.getCurrentPageIndex();
18795
18795
  }
18796
- getPage(N) {
18797
- return this.pages.getPage(N);
18796
+ getPage(X) {
18797
+ return this.pages.getPage(X);
18798
18798
  }
18799
18799
  getRender() {
18800
18800
  return this.render;
@@ -18820,20 +18820,20 @@ var Na = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
18820
18820
  getPageCollection() {
18821
18821
  return this.pages;
18822
18822
  }
18823
- startUserTouch(N) {
18824
- this.mousePosition = N, this.isUserTouch = !0, this.isUserMove = !1;
18823
+ startUserTouch(X) {
18824
+ this.mousePosition = X, this.isUserTouch = !0, this.isUserMove = !1;
18825
18825
  }
18826
- userMove(N, o) {
18827
- this.isUserTouch || o || !this.setting.showPageCorners ? this.isUserTouch && d.GetDistanceBetweenTwoPoint(this.mousePosition, N) > 5 && (this.isUserMove = !0, this.flipController.fold(N)) : this.flipController.showCorner(N);
18826
+ userMove(X, o) {
18827
+ this.isUserTouch || o || !this.setting.showPageCorners ? this.isUserTouch && d.GetDistanceBetweenTwoPoint(this.mousePosition, X) > 5 && (this.isUserMove = !0, this.flipController.fold(X)) : this.flipController.showCorner(X);
18828
18828
  }
18829
- userStop(N, o = !1) {
18830
- this.isUserTouch && (this.isUserTouch = !1, o || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(N)));
18829
+ userStop(X, o = !1) {
18830
+ this.isUserTouch && (this.isUserTouch = !1, o || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(X)));
18831
18831
  }
18832
18832
  }, Object.defineProperty(g, "__esModule", { value: !0 });
18833
18833
  });
18834
18834
  })(wo, wo.exports);
18835
18835
  var Xa = wo.exports;
18836
- const Ra = ':root{--flipbook-bg-main: var(--bs-body-bg, #f8f9fa);--flipbook-bg-surface: var(--bs-secondary-bg, #ffffff);--flipbook-bg-surface-alt: var(--bs-tertiary-bg, #f1f3f5);--flipbook-bg-panel: var(--bs-dark, #212529);--flipbook-bg-panel-soft: color-mix(in srgb, var(--flipbook-bg-panel) 88%, white 12%);--flipbook-text-main: var(--bs-body-color, #212529);--flipbook-text-muted: var(--bs-secondary-color, #6c757d);--flipbook-toolbar-text: #f8f9fa;--flipbook-toolbar-button-text: #f8f9fa;--flipbook-border: var(--bs-border-color, rgba(0, 0, 0, .15));--flipbook-accent: var(--bs-primary, #0d6efd);--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: color-mix(in srgb, var(--flipbook-bg-panel) 95%, black 5%);--flipbook-thumb-bg: #ffffff;--flipbook-thumb-text: #ffffff;--flipbook-thumbscroll-track: rgba(0, 0, 0, .18);--flipbook-thumbscroll-thumb: rgba(255, 255, 255, .22);--flipbook-navbutton-bg: rgba(0, 0, 0, .6);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(0, 0, 0, .35);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: var(--flipbook-bg-panel);--flipbook-download-bg: #198754;--flipbook-download-border: #198754;--flipbook-download-text: #ffffff;--flipbook-settings-bg: var(--flipbook-bg-surface);--flipbook-settings-text: var(--flipbook-text-main);--flipbook-radius-sm: .375rem;--flipbook-radius-md: .5rem;--flipbook-toolbar-height: 60px;--flipbook-thumbs-height: 110px;--flipbook-navbutton-size: 50px;--flipbook-page-padding: 20px;--flipbook-font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", sans-serif)}[data-bs-theme=dark]{--flipbook-bg-main: var(--bs-body-bg, #121826);--flipbook-bg-surface: var(--bs-secondary-bg, #1b2232);--flipbook-bg-surface-alt: var(--bs-tertiary-bg, #222b3c);--flipbook-bg-panel: #141927;--flipbook-bg-panel-soft: #1d2434;--flipbook-text-main: var(--bs-body-color, #f8f9fa);--flipbook-text-muted: var(--bs-secondary-color, #adb5bd);--flipbook-toolbar-text: #f8f9fa;--flipbook-toolbar-button-text: #f8f9fa;--flipbook-border: var(--bs-border-color, rgba(255, 255, 255, .12));--flipbook-thumbrail-bg: #101522;--flipbook-thumb-bg: #ffffff;--flipbook-settings-bg: #1d2434;--flipbook-settings-text: #f8f9fa;--flipbook-emptycover-bg: #101522;--flipbook-shadow: rgba(0, 0, 0, .5)}.bk-theme-light{color-scheme:light;--flipbook-bg-main: #f8fafc;--flipbook-bg-surface: #ffffff;--flipbook-bg-surface-alt: #f1f5f9;--flipbook-bg-panel: #e2e8f0;--flipbook-bg-panel-soft: #f1f5f9;--flipbook-text-main: #0f172a;--flipbook-text-muted: #64748b;--flipbook-toolbar-text: #0f172a;--flipbook-toolbar-button-text: #334155;--flipbook-border: rgba(15, 23, 42, .1);--flipbook-accent: #4f46e5;--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: #f8fafc;--flipbook-thumb-bg: #ffffff;--flipbook-thumb-text: #0f172a;--flipbook-thumbscroll-track: rgba(15, 23, 42, .08);--flipbook-thumbscroll-thumb: rgba(15, 23, 42, .18);--flipbook-navbutton-bg: rgba(15, 23, 42, .65);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(15, 23, 42, .08);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: #e2e8f0;--flipbook-download-bg: #10b981;--flipbook-download-border: #10b981;--flipbook-download-text: #ffffff;--flipbook-settings-bg: #ffffff;--flipbook-settings-text: #0f172a}.bk-theme-dark{color-scheme:dark;--flipbook-bg-main: #0b0f19;--flipbook-bg-surface: #111827;--flipbook-bg-surface-alt: #1f2937;--flipbook-bg-panel: #111827;--flipbook-bg-panel-soft: #1f2937;--flipbook-text-main: #f9fafb;--flipbook-text-muted: #9ca3af;--flipbook-toolbar-text: #f9fafb;--flipbook-toolbar-button-text: #e5e7eb;--flipbook-border: rgba(255, 255, 255, .08);--flipbook-accent: #7367f0;--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: #0b0f19;--flipbook-thumb-bg: #1f2937;--flipbook-thumb-text: #f9fafb;--flipbook-thumbscroll-track: rgba(255, 255, 255, .08);--flipbook-thumbscroll-thumb: rgba(255, 255, 255, .18);--flipbook-navbutton-bg: rgba(0, 0, 0, .6);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(0, 0, 0, .5);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: #101522;--flipbook-download-bg: #10b981;--flipbook-download-border: #10b981;--flipbook-download-text: #ffffff;--flipbook-settings-bg: #1f2937;--flipbook-settings-text: #f9fafb}.bk-container,.bk-container *{box-sizing:border-box}.bk-container{color:var(--flipbook-text-main);font-family:var(--flipbook-font-family)}.bk-wrapper{position:relative;width:100%;height:100%;display:flex;flex-direction:column;background:var(--flipbook-bg-main);color:var(--flipbook-text-main);overflow:hidden;font-family:var(--flipbook-font-family);border-radius:var(--flipbook-radius-md)}.bk-main-area{flex:1;position:relative;overflow:hidden;width:100%;min-height:0;background:var(--flipbook-bg-main)}#bk-book-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--flipbook-page-padding);display:flex;justify-content:center;align-items:center;transition:transform .3s ease;transform-origin:center center}#bk-book-wrapper.zoomed{transition:none;cursor:grab}#bk-book-wrapper.zoomed:active{cursor:grabbing}#bk-book-wrapper.zoomed #bk-book{pointer-events:none}#bk-book-sizer{position:relative;margin:0 auto;transition:transform .4s ease}#bk-book-wrapper.bk-is-cover #bk-book-sizer{transform:translate(-25%)}#bk-book-wrapper.bk-is-back-cover #bk-book-sizer{transform:translate(25%)}.bk-container.double-mode:not(.bk-is-cover):not(.bk-is-back-cover) .stf__block{background-color:#00000080}#bk-book{width:100%;height:100%}#bk-single-view{display:none;width:100%;height:100%;justify-content:center;align-items:center;overflow:hidden}#bk-single-img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 5px 20px var(--flipbook-shadow);background:var(--flipbook-bookpage-bg);transition:transform .3s ease,opacity .3s ease;pointer-events:none}.slide-left{transform:translate(-100%);opacity:0}.slide-right{transform:translate(100%);opacity:0}.bz-page{background-color:var(--flipbook-bg-main);overflow:hidden;box-shadow:0 0 15px var(--flipbook-shadow)}.page-shadow{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:5}.bz-page--left .page-shadow{background:linear-gradient(to right,#0000001a,#0000 3%,#0000 85%,#0006)}.bz-page--right .page-shadow{background:linear-gradient(to right,#0006,#0000 15%,#0000 97%,#0000001a)}.bz-page--cover .page-shadow{display:none!important}.page-content{width:100%;height:100%;object-fit:contain;pointer-events:none;background:var(--flipbook-bookpage-bg);display:block}.page-content--split{width:100%;max-width:none;height:100%;object-fit:cover;object-position:left center}.page-content--left{object-position:left center}.page-content--right{object-position:right center}#bk-single-img.page-content--split{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}.bk-toolbar{height:var(--flipbook-toolbar-height);background:var(--flipbook-bg-panel-soft);color:var(--flipbook-toolbar-text);display:flex;align-items:center;justify-content:space-between;padding:0 15px;z-index:10;flex-shrink:0;border-top:1px solid var(--flipbook-border);gap:.75rem;overflow-x:auto}.bk-toolbar::-webkit-scrollbar{height:4px}.bk-toolbar::-webkit-scrollbar-thumb{background:var(--flipbook-border);border-radius:999px}.bk-btn-group{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.bk-btn-group--center{flex-grow:1;justify-content:center}.bk-btn{background:color-mix(in srgb,var(--flipbook-bg-surface) 18%,transparent 82%);border:1px solid color-mix(in srgb,var(--flipbook-border) 80%,transparent 20%);color:var(--flipbook-toolbar-button-text);padding:0 15px;height:38px;border-radius:var(--flipbook-radius-sm);cursor:pointer;font-size:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.bk-btn:hover,.bk-btn.active{background:var(--flipbook-accent);border-color:var(--flipbook-accent);color:var(--flipbook-accent-text)}.bk-btn:focus-visible,.thumb-item:focus-visible,.nav-float:focus-visible{outline:2px solid var(--flipbook-accent);outline-offset:2px}.bk-btn--download{background:var(--flipbook-download-bg);border-color:var(--flipbook-download-border);color:var(--flipbook-download-text)}#bk-page-info{color:var(--flipbook-toolbar-text);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:14px;min-width:70px;text-align:center;font-weight:700}.bk-thumbs{height:var(--flipbook-thumbs-height);background:var(--flipbook-thumbrail-bg);overflow-x:auto;padding:15px;gap:15px;z-index:10;flex-shrink:0;align-items:center;border-top:1px solid var(--flipbook-border)}.bk-thumbs::-webkit-scrollbar{height:6px}.bk-thumbs::-webkit-scrollbar-track{background:var(--flipbook-thumbscroll-track);border-radius:999px}.bk-thumbs::-webkit-scrollbar-thumb{background:var(--flipbook-thumbscroll-thumb);border-radius:999px;transition:background-color .2s ease}.bk-thumbs::-webkit-scrollbar-thumb:hover{background:var(--flipbook-accent)}.thumb-item{display:flex;flex-direction:column;align-items:center;cursor:pointer;opacity:.68;transition:opacity .2s ease,transform .2s ease;flex-shrink:0;color:var(--flipbook-thumb-text)}.thumb-item:hover,.thumb-item.active{opacity:1}.thumb-item.active img{border-color:var(--flipbook-accent);transform:scale(1.05);box-shadow:0 0 15px color-mix(in srgb,var(--flipbook-accent) 45%,transparent 55%)}.thumb-img{height:60px;width:auto;border:2px solid transparent;border-radius:var(--flipbook-radius-sm);background:var(--flipbook-thumb-bg);transition:border-color .2s ease,transform .2s ease,box-shadow .2s ease}.thumb-img--split{width:96px;max-width:none;object-fit:cover}.thumb-img--left{object-position:left center}.thumb-img--right{object-position:right center}.thumb-item span{color:var(--flipbook-thumb-text);font-size:11px;margin-top:6px;font-weight:700}.nav-float{position:absolute;z-index:10;background:var(--flipbook-navbutton-bg);border:none;border-radius:999px;width:var(--flipbook-navbutton-size);height:var(--flipbook-navbutton-size);color:var(--flipbook-navbutton-text);font-size:20px;cursor:pointer;transition:background-color .2s ease;top:50%;transform:translateY(-50%)}.nav-float:hover{background:var(--flipbook-accent)}#nav-prev{left:20px}#nav-next{right:20px}.bk-settings-panel{position:absolute;bottom:70px;right:15px;background:var(--flipbook-settings-bg);color:var(--flipbook-settings-text);border:1px solid var(--flipbook-border);border-radius:var(--flipbook-radius-md);padding:15px;display:none;z-index:20;min-width:200px;box-shadow:0 10px 30px var(--flipbook-shadow)}.setting-item{display:flex;align-items:center;justify-content:space-between;gap:1rem;font-size:14px;margin-bottom:10px}.setting-item:last-child{margin-bottom:0}.bk-empty-state{display:grid;place-items:center;width:100%;min-height:240px;padding:1.5rem;background:var(--flipbook-bg-main);color:var(--flipbook-text-main);border:1px dashed var(--flipbook-border);border-radius:var(--flipbook-radius-md)}.bk-empty-state__title{margin:0;font-size:1.125rem;font-weight:600}.empty-cover{background-color:var(--flipbook-emptycover-bg)!important;box-shadow:none!important}.bk-attribution{position:absolute;bottom:15px;left:15px;background:#0f172abf;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:#fff;padding:6px 12px;border-radius:var(--flipbook-radius-sm);font-size:11px;text-decoration:none;z-index:20;display:flex;align-items:center;gap:6px;box-shadow:0 4px 12px #0006;border:1px solid rgba(255,255,255,.15);transition:all .2s ease;opacity:.85}.bk-attribution:hover{opacity:1;transform:translateY(-2px);box-shadow:0 6px 16px #0009;border-color:var(--flipbook-accent);color:#fff}.bk-attribution-icon{font-size:13px}.bk-attribution-img{height:24px;width:auto;object-fit:contain;display:block}@media (max-width: 768px){:root{--flipbook-toolbar-height: 50px;--flipbook-thumbs-height: 85px;--flipbook-navbutton-size: 35px;--flipbook-page-padding: 12px}.bk-toolbar{padding:0 5px}.bk-btn{padding:0 8px;font-size:12px;height:32px}.bk-btn-group{gap:4px}#bk-page-info{min-width:50px;font-size:12px}.nav-float{font-size:16px}#nav-prev{left:10px}#nav-next{right:10px}.bk-thumbs{padding:10px}.thumb-img{height:45px}.bk-settings-panel{bottom:60px}}.bk-btn.muted{opacity:.5;position:relative}.bk-btn.muted:after{content:"";position:absolute;width:80%;height:2px;background:currentColor;top:50%;left:10%;transform:rotate(-45deg);border-radius:1px}';
18836
+ const Ra = ':root{--flipbook-bg-main: var(--bs-body-bg, #f8f9fa);--flipbook-bg-surface: var(--bs-secondary-bg, #ffffff);--flipbook-bg-surface-alt: var(--bs-tertiary-bg, #f1f3f5);--flipbook-bg-panel: var(--bs-dark, #212529);--flipbook-bg-panel-soft: color-mix(in srgb, var(--flipbook-bg-panel) 88%, white 12%);--flipbook-text-main: var(--bs-body-color, #212529);--flipbook-text-muted: var(--bs-secondary-color, #6c757d);--flipbook-toolbar-text: #f8f9fa;--flipbook-toolbar-button-text: #f8f9fa;--flipbook-border: var(--bs-border-color, rgba(0, 0, 0, .15));--flipbook-accent: var(--bs-primary, #0d6efd);--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: color-mix(in srgb, var(--flipbook-bg-panel) 95%, black 5%);--flipbook-thumb-bg: #ffffff;--flipbook-thumb-text: #ffffff;--flipbook-thumbscroll-track: rgba(0, 0, 0, .18);--flipbook-thumbscroll-thumb: rgba(255, 255, 255, .22);--flipbook-navbutton-bg: rgba(0, 0, 0, .6);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(0, 0, 0, .35);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: var(--flipbook-bg-panel);--flipbook-download-bg: #198754;--flipbook-download-border: #198754;--flipbook-download-text: #ffffff;--flipbook-settings-bg: var(--flipbook-bg-surface);--flipbook-settings-text: var(--flipbook-text-main);--flipbook-radius-sm: .375rem;--flipbook-radius-md: .5rem;--flipbook-toolbar-height: 60px;--flipbook-thumbs-height: 110px;--flipbook-navbutton-size: 50px;--flipbook-page-padding: 20px;--flipbook-font-family: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", sans-serif)}[data-bs-theme=dark]{--flipbook-bg-main: var(--bs-body-bg, #121826);--flipbook-bg-surface: var(--bs-secondary-bg, #1b2232);--flipbook-bg-surface-alt: var(--bs-tertiary-bg, #222b3c);--flipbook-bg-panel: #141927;--flipbook-bg-panel-soft: #1d2434;--flipbook-text-main: var(--bs-body-color, #f8f9fa);--flipbook-text-muted: var(--bs-secondary-color, #adb5bd);--flipbook-toolbar-text: #f8f9fa;--flipbook-toolbar-button-text: #f8f9fa;--flipbook-border: var(--bs-border-color, rgba(255, 255, 255, .12));--flipbook-thumbrail-bg: #101522;--flipbook-thumb-bg: #ffffff;--flipbook-settings-bg: #1d2434;--flipbook-settings-text: #f8f9fa;--flipbook-emptycover-bg: #101522;--flipbook-shadow: rgba(0, 0, 0, .5)}.bk-theme-light{color-scheme:light;--flipbook-bg-main: #f8fafc;--flipbook-bg-surface: #ffffff;--flipbook-bg-surface-alt: #f1f5f9;--flipbook-bg-panel: #e2e8f0;--flipbook-bg-panel-soft: #f1f5f9;--flipbook-text-main: #0f172a;--flipbook-text-muted: #64748b;--flipbook-toolbar-text: #0f172a;--flipbook-toolbar-button-text: #334155;--flipbook-border: rgba(15, 23, 42, .1);--flipbook-accent: #4f46e5;--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: #f8fafc;--flipbook-thumb-bg: #ffffff;--flipbook-thumb-text: #0f172a;--flipbook-thumbscroll-track: rgba(15, 23, 42, .08);--flipbook-thumbscroll-thumb: rgba(15, 23, 42, .18);--flipbook-navbutton-bg: rgba(15, 23, 42, .65);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(15, 23, 42, .08);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: #e2e8f0;--flipbook-download-bg: #10b981;--flipbook-download-border: #10b981;--flipbook-download-text: #ffffff;--flipbook-settings-bg: #ffffff;--flipbook-settings-text: #0f172a}.bk-theme-dark{color-scheme:dark;--flipbook-bg-main: #0b0f19;--flipbook-bg-surface: #111827;--flipbook-bg-surface-alt: #1f2937;--flipbook-bg-panel: #111827;--flipbook-bg-panel-soft: #1f2937;--flipbook-text-main: #f9fafb;--flipbook-text-muted: #9ca3af;--flipbook-toolbar-text: #f9fafb;--flipbook-toolbar-button-text: #e5e7eb;--flipbook-border: rgba(255, 255, 255, .08);--flipbook-accent: #7367f0;--flipbook-accent-text: #ffffff;--flipbook-thumbrail-bg: #0b0f19;--flipbook-thumb-bg: #1f2937;--flipbook-thumb-text: #f9fafb;--flipbook-thumbscroll-track: rgba(255, 255, 255, .08);--flipbook-thumbscroll-thumb: rgba(255, 255, 255, .18);--flipbook-navbutton-bg: rgba(0, 0, 0, .6);--flipbook-navbutton-text: #ffffff;--flipbook-shadow: rgba(0, 0, 0, .5);--flipbook-bookpage-bg: #ffffff;--flipbook-emptycover-bg: #101522;--flipbook-download-bg: #10b981;--flipbook-download-border: #10b981;--flipbook-download-text: #ffffff;--flipbook-settings-bg: #1f2937;--flipbook-settings-text: #f9fafb}.bk-container,.bk-container *{box-sizing:border-box}.bk-container{color:var(--flipbook-text-main);font-family:var(--flipbook-font-family)}.bk-wrapper{position:relative;width:100%;height:100%;display:flex;flex-direction:column;background:var(--flipbook-bg-main);color:var(--flipbook-text-main);overflow:hidden;font-family:var(--flipbook-font-family);border-radius:var(--flipbook-radius-md)}.bk-main-area{flex:1;position:relative;overflow:hidden;width:100%;min-height:0;background:var(--flipbook-bg-main)}#bk-book-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--flipbook-page-padding);display:flex;justify-content:center;align-items:center;transition:transform .3s ease;transform-origin:center center}#bk-book-wrapper.zoomed{transition:none;cursor:grab}#bk-book-wrapper.zoomed:active{cursor:grabbing}#bk-book-wrapper.zoomed #bk-book{pointer-events:none}#bk-book-sizer{position:relative;margin:0 auto;transition:transform .4s ease}#bk-book-wrapper.bk-is-cover #bk-book-sizer{transform:translate(-25%)}#bk-book-wrapper.bk-is-back-cover #bk-book-sizer{transform:translate(25%)}.bk-container.double-mode:not(.bk-is-cover):not(.bk-is-back-cover) .stf__block{background-color:#00000080}#bk-book{width:100%;height:100%;position:relative}#bk-single-view{display:none;width:100%;height:100%;justify-content:center;align-items:center;overflow:hidden}#bk-single-img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 5px 20px var(--flipbook-shadow);background:var(--flipbook-bookpage-bg);transition:transform .3s ease,opacity .3s ease;pointer-events:none}.slide-left{transform:translate(-100%);opacity:0}.slide-right{transform:translate(100%);opacity:0}.bz-page{background-color:var(--flipbook-bg-main);overflow:hidden;box-shadow:0 0 15px var(--flipbook-shadow)}.page-shadow{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:5}.bz-page--left .page-shadow{background:linear-gradient(to right,#0000001a,#0000 3%,#0000 85%,#0006)}.bz-page--right .page-shadow{background:linear-gradient(to right,#0006,#0000 15%,#0000 97%,#0000001a)}.bz-page--cover .page-shadow{display:none!important}.page-content{width:100%;height:100%;object-fit:contain;pointer-events:none;background:var(--flipbook-bookpage-bg);display:block}.page-content--split{width:100%;max-width:none;height:100%;object-fit:cover;object-position:left center}.page-content--left{object-position:left center}.page-content--right{object-position:right center}#bk-single-img.page-content--split{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}.bk-toolbar{height:var(--flipbook-toolbar-height);background:var(--flipbook-bg-panel-soft);color:var(--flipbook-toolbar-text);display:flex;align-items:center;justify-content:space-between;padding:0 15px;z-index:10;flex-shrink:0;border-top:1px solid var(--flipbook-border);gap:.75rem;overflow-x:auto}.bk-toolbar::-webkit-scrollbar{height:4px}.bk-toolbar::-webkit-scrollbar-thumb{background:var(--flipbook-border);border-radius:999px}.bk-btn-group{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.bk-btn-group--center{flex-grow:1;justify-content:center}.bk-btn{background:color-mix(in srgb,var(--flipbook-bg-surface) 18%,transparent 82%);border:1px solid color-mix(in srgb,var(--flipbook-border) 80%,transparent 20%);color:var(--flipbook-toolbar-button-text);padding:0 15px;height:38px;border-radius:var(--flipbook-radius-sm);cursor:pointer;font-size:15px;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease}.bk-btn:hover,.bk-btn.active{background:var(--flipbook-accent);border-color:var(--flipbook-accent);color:var(--flipbook-accent-text)}.bk-btn:focus-visible,.thumb-item:focus-visible,.nav-float:focus-visible{outline:2px solid var(--flipbook-accent);outline-offset:2px}.bk-btn--download{background:var(--flipbook-download-bg);border-color:var(--flipbook-download-border);color:var(--flipbook-download-text)}#bk-page-info{color:var(--flipbook-toolbar-text);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:14px;min-width:70px;text-align:center;font-weight:700}.bk-thumbs{height:var(--flipbook-thumbs-height);background:var(--flipbook-thumbrail-bg);overflow-x:auto;padding:15px;gap:15px;z-index:10;flex-shrink:0;align-items:center;border-top:1px solid var(--flipbook-border)}.bk-thumbs::-webkit-scrollbar{height:6px}.bk-thumbs::-webkit-scrollbar-track{background:var(--flipbook-thumbscroll-track);border-radius:999px}.bk-thumbs::-webkit-scrollbar-thumb{background:var(--flipbook-thumbscroll-thumb);border-radius:999px;transition:background-color .2s ease}.bk-thumbs::-webkit-scrollbar-thumb:hover{background:var(--flipbook-accent)}.thumb-item{display:flex;flex-direction:column;align-items:center;cursor:pointer;opacity:.68;transition:opacity .2s ease,transform .2s ease;flex-shrink:0;color:var(--flipbook-thumb-text)}.thumb-item:hover,.thumb-item.active{opacity:1}.thumb-item.active img{border-color:var(--flipbook-accent);transform:scale(1.05);box-shadow:0 0 15px color-mix(in srgb,var(--flipbook-accent) 45%,transparent 55%)}.thumb-img{height:60px;width:auto;border:2px solid transparent;border-radius:var(--flipbook-radius-sm);background:var(--flipbook-thumb-bg);transition:border-color .2s ease,transform .2s ease,box-shadow .2s ease}.thumb-img--split{width:96px;max-width:none;object-fit:cover}.thumb-img--left{object-position:left center}.thumb-img--right{object-position:right center}.thumb-item span{color:var(--flipbook-thumb-text);font-size:11px;margin-top:6px;font-weight:700}.nav-float{position:absolute;z-index:10;background:var(--flipbook-navbutton-bg);border:none;border-radius:999px;width:var(--flipbook-navbutton-size);height:var(--flipbook-navbutton-size);color:var(--flipbook-navbutton-text);font-size:20px;cursor:pointer;transition:background-color .2s ease;top:50%;transform:translateY(-50%)}.nav-float:hover{background:var(--flipbook-accent)}#nav-prev{left:20px}#nav-next{right:20px}.bk-settings-panel{position:absolute;bottom:70px;right:15px;background:var(--flipbook-settings-bg);color:var(--flipbook-settings-text);border:1px solid var(--flipbook-border);border-radius:var(--flipbook-radius-md);padding:15px;display:none;z-index:20;min-width:200px;box-shadow:0 10px 30px var(--flipbook-shadow)}.setting-item{display:flex;align-items:center;justify-content:space-between;gap:1rem;font-size:14px;margin-bottom:10px}.setting-item:last-child{margin-bottom:0}.bk-empty-state{display:grid;place-items:center;width:100%;min-height:240px;padding:1.5rem;background:var(--flipbook-bg-main);color:var(--flipbook-text-main);border:1px dashed var(--flipbook-border);border-radius:var(--flipbook-radius-md)}.bk-empty-state__title{margin:0;font-size:1.125rem;font-weight:600}.empty-cover{background-color:var(--flipbook-emptycover-bg)!important;box-shadow:none!important}.bk-attribution{position:absolute;bottom:15px;left:15px;background:#0f172abf;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:#fff;padding:6px 12px;border-radius:var(--flipbook-radius-sm);font-size:11px;text-decoration:none;z-index:20;display:flex;align-items:center;gap:6px;box-shadow:0 4px 12px #0006;border:1px solid rgba(255,255,255,.15);transition:all .2s ease;opacity:.85}.bk-attribution:hover{opacity:1;transform:translateY(-2px);box-shadow:0 6px 16px #0009;border-color:var(--flipbook-accent);color:#fff}.bk-attribution-icon{font-size:13px}.bk-attribution-img{height:24px;width:auto;object-fit:contain;display:block}@media (max-width: 768px){:root{--flipbook-toolbar-height: 50px;--flipbook-thumbs-height: 85px;--flipbook-navbutton-size: 35px;--flipbook-page-padding: 12px}.bk-toolbar{padding:0 5px}.bk-btn{padding:0 8px;font-size:12px;height:32px}.bk-btn-group{gap:4px}#bk-page-info{min-width:50px;font-size:12px}.nav-float{font-size:16px}#nav-prev{left:10px}#nav-next{right:10px}.bk-thumbs{padding:10px}.thumb-img{height:45px}.bk-settings-panel{bottom:60px}}.bk-btn.muted{opacity:.5;position:relative}.bk-btn.muted:after{content:"";position:absolute;width:80%;height:2px;background:currentColor;top:50%;left:10%;transform:rotate(-45deg);border-radius:1px}';
18837
18837
  let L0 = !1;
18838
18838
  function sB() {
18839
18839
  if (typeof document > "u" || L0) return;
@@ -19043,6 +19043,7 @@ const Bl = class Bl {
19043
19043
  M(this, "orientationMediaQuery", null);
19044
19044
  M(this, "orientationChangeHandler", null);
19045
19045
  M(this, "initialized", !1);
19046
+ M(this, "resizeObserver", null);
19046
19047
  M(this, "state", { showThumbs: !0, isSingle: !1, currentPage: 0, orientation: "landscape" });
19047
19048
  M(this, "touchStartX", 0);
19048
19049
  M(this, "flipState", "read");
@@ -19220,14 +19221,16 @@ const Bl = class Bl {
19220
19221
  }
19221
19222
  setupOrientationHandling() {
19222
19223
  this.orientationMediaQuery = window.matchMedia("(orientation: portrait)"), this.orientationChangeHandler = () => {
19223
- var C;
19224
- const I = this.orientationMediaQuery.matches, g = window.innerWidth <= 1024;
19225
- I || g ? this.state.isSingle || this.setSingleMode(!0) : (C = this.ui) != null && C.toggleSingle && !this.ui.toggleSingle.checked && this.state.isSingle && this.setSingleMode(!1);
19226
- }, this.orientationChangeHandler(), this.orientationMediaQuery.addEventListener("change", this.orientationChangeHandler), window.addEventListener("resize", this.orientationChangeHandler, { signal: this.getEventSignal() });
19224
+ var A;
19225
+ const I = this.orientationMediaQuery.matches, g = window.innerWidth <= 1024, C = this.ui.bookWrapper ? this.ui.bookWrapper.clientWidth > 0 && this.ui.bookWrapper.clientWidth < 800 : !1;
19226
+ I || g || C ? this.state.isSingle || this.setSingleMode(!0) : (A = this.ui) != null && A.toggleSingle && !this.ui.toggleSingle.checked && this.state.isSingle && this.setSingleMode(!1);
19227
+ }, this.orientationChangeHandler(), this.orientationMediaQuery.addEventListener("change", this.orientationChangeHandler), window.addEventListener("resize", this.orientationChangeHandler, { signal: this.getEventSignal() }), typeof ResizeObserver < "u" && this.ui.bookWrapper && (this.resizeObserver = new ResizeObserver(() => {
19228
+ this.orientationChangeHandler && this.orientationChangeHandler(), this.updateBookAspectRatio();
19229
+ }), this.resizeObserver.observe(this.ui.bookWrapper));
19227
19230
  }
19228
19231
  teardownRuntimeBindings() {
19229
19232
  var I;
19230
- (I = this.domEventController) == null || I.abort(), this.domEventController = null, this.orientationMediaQuery && this.orientationChangeHandler && this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler), this.orientationMediaQuery = null, this.orientationChangeHandler = null;
19233
+ (I = this.domEventController) == null || I.abort(), this.domEventController = null, this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null), this.orientationMediaQuery && this.orientationChangeHandler && this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler), this.orientationMediaQuery = null, this.orientationChangeHandler = null;
19231
19234
  }
19232
19235
  getEventSignal() {
19233
19236
  return this.domEventController || (this.domEventController = new AbortController()), this.domEventController.signal;
@@ -19240,7 +19243,7 @@ const Bl = class Bl {
19240
19243
  let s = g * d, c = g;
19241
19244
  s > I && (s = I, c = I / d);
19242
19245
  let G = Math.ceil(s);
19243
- G % 2 !== 0 && (G += 1), this.ui.bookSizer.style.width = `${G}px`, this.ui.bookSizer.style.height = `${Math.floor(c)}px`, this.ui.bookSizer.style.aspectRatio = "";
19246
+ G % 2 !== 0 && (G += 1), this.ui.bookSizer.style.width = `${G}px`, this.ui.bookSizer.style.height = `${Math.floor(c)}px`, this.pageFlip && this.pageFlip.update(), this.ui.bookSizer.style.aspectRatio = "";
19244
19247
  }
19245
19248
  playSound() {
19246
19249
  if (this.options.soundEnabled)
@@ -19269,8 +19272,8 @@ const Bl = class Bl {
19269
19272
  dataset: { idx: A.toString() }
19270
19273
  }, [Z, G]);
19271
19274
  I.appendChild(m);
19272
- const W = this.createThumbnailImage(C, !1), a = U("span", null, [C.pageNumber.toString()]), t = U("div", { class: `thumb-item ${A === 0 ? "active" : ""}`, dataset: { pageIndex: A.toString() } }, [W, a]);
19273
- g.appendChild(t);
19275
+ const W = this.createThumbnailImage(C, !1), a = U("span", null, [C.pageNumber.toString()]), n = U("div", { class: `thumb-item ${A === 0 ? "active" : ""}`, dataset: { pageIndex: A.toString() } }, [W, a]);
19276
+ g.appendChild(n);
19274
19277
  });
19275
19278
  }
19276
19279
  initPageFlip() {
@@ -19338,8 +19341,8 @@ const Bl = class Bl {
19338
19341
  const W = m.getContext("2d");
19339
19342
  W && (await s.render({ canvasContext: W, viewport: G }).promise, m.toBlob((a) => {
19340
19343
  if (a) {
19341
- const t = URL.createObjectURL(a);
19342
- this.pdfPagesCache || (this.pdfPagesCache = /* @__PURE__ */ new Map()), this.pdfPagesCache.set(Z, t), C.src = t;
19344
+ const n = URL.createObjectURL(a);
19345
+ this.pdfPagesCache || (this.pdfPagesCache = /* @__PURE__ */ new Map()), this.pdfPagesCache.set(Z, n), C.src = n;
19343
19346
  }
19344
19347
  m.width = 0, m.height = 0;
19345
19348
  }, "image/webp", 0.85));
@@ -19446,10 +19449,10 @@ const Bl = class Bl {
19446
19449
  });
19447
19450
  }
19448
19451
  bindEvents() {
19449
- var d, s, c, G, m, W, a;
19450
- const I = this.getEventSignal(), g = (t, e) => {
19451
- t && t.addEventListener("click", (X) => {
19452
- X.preventDefault(), X.stopPropagation(), e();
19452
+ var d, s, c, G, m, W, a, n;
19453
+ const I = this.getEventSignal(), g = (t, N) => {
19454
+ t && t.addEventListener("click", (V) => {
19455
+ V.preventDefault(), V.stopPropagation(), N();
19453
19456
  }, { signal: I });
19454
19457
  };
19455
19458
  this.ui.btnSound && (this.options.soundEnabled || this.ui.btnSound.classList.add("muted"), this.ui.btnSound.addEventListener("click", (t) => {
@@ -19457,38 +19460,38 @@ const Bl = class Bl {
19457
19460
  }, { signal: I })), document.addEventListener("keydown", (t) => {
19458
19461
  t.target instanceof HTMLInputElement || t.target instanceof HTMLTextAreaElement || (t.key === "ArrowRight" ? this.goNext() : t.key === "ArrowLeft" && this.goPrev());
19459
19462
  }, { signal: I }), g(this.ui.bkNext, () => this.goNext()), g(this.ui.navNext, () => this.goNext()), g(this.ui.bkPrev, () => this.goPrev()), g(this.ui.navPrev, () => this.goPrev()), this.ui.thumbs.querySelectorAll(".thumb-item").forEach((t) => {
19460
- t.addEventListener("click", (e) => {
19461
- e.preventDefault(), e.stopPropagation();
19462
- let X = parseInt(e.currentTarget.dataset.pageIndex);
19463
+ t.addEventListener("click", (N) => {
19464
+ N.preventDefault(), N.stopPropagation();
19465
+ let V = parseInt(N.currentTarget.dataset.pageIndex);
19463
19466
  if (this.state.isSingle)
19464
- this.state.currentPage = X, this.updateSingleView();
19467
+ this.state.currentPage = V, this.updateSingleView();
19465
19468
  else if (this.pageFlip) {
19466
- const V = this.ui.book.querySelector(".empty-cover") !== null;
19467
- let y = V ? X + 1 : X;
19468
- this.state.orientation === "landscape" && V && y % 2 !== 0 && y > 1 && (y = y - 1), this.pageFlip.flip(y);
19469
+ const y = this.ui.book.querySelector(".empty-cover") !== null;
19470
+ let X = y ? V + 1 : V;
19471
+ this.state.orientation === "landscape" && y && X % 2 !== 0 && X > 1 && (X = X - 1), this.pageFlip.flip(X);
19469
19472
  }
19470
19473
  }, { signal: I });
19471
19474
  });
19472
19475
  const C = () => {
19473
19476
  this.state.showThumbs = !this.state.showThumbs;
19474
- const t = this.ui.thumbs, e = this.ui.btnToggleThumbs, X = this.ui.toggleThumbs;
19477
+ const t = this.ui.thumbs, N = this.ui.btnToggleThumbs, V = this.ui.toggleThumbs;
19475
19478
  t.style.display = this.state.showThumbs ? "flex" : "none";
19476
- const V = t.querySelector(".thumb-item.active");
19477
- if (V) {
19478
- const y = t.offsetWidth / 2, N = V.offsetLeft + V.offsetWidth / 2;
19479
+ const y = t.querySelector(".thumb-item.active");
19480
+ if (y) {
19481
+ const X = t.offsetWidth / 2, o = y.offsetLeft + y.offsetWidth / 2;
19479
19482
  t.scrollTo({
19480
- left: N - y,
19483
+ left: o - X,
19481
19484
  behavior: "smooth"
19482
19485
  });
19483
19486
  }
19484
- this.state.showThumbs ? e.classList.add("active") : e.classList.remove("active"), X && (X.checked = this.state.showThumbs), !this.state.isSingle && this.pageFlip && this.pageFlip.update(), this.emit("thumbsToggle", { showThumbs: this.state.showThumbs });
19487
+ this.state.showThumbs ? N.classList.add("active") : N.classList.remove("active"), V && (V.checked = this.state.showThumbs), !this.state.isSingle && this.pageFlip && this.pageFlip.update(), this.emit("thumbsToggle", { showThumbs: this.state.showThumbs });
19485
19488
  };
19486
19489
  (d = this.ui.btnToggleThumbs) == null || d.addEventListener("click", C, { signal: I }), (s = this.ui.toggleThumbs) == null || s.addEventListener("change", C, { signal: I }), (c = this.ui.toggleSingle) == null || c.addEventListener("change", (t) => {
19487
19490
  this.setSingleMode(t.target.checked);
19488
19491
  }, { signal: I }), (G = this.ui.btnSettings) == null || G.addEventListener("click", (t) => {
19489
19492
  t.stopPropagation();
19490
- const e = this.ui.settingsPanel;
19491
- e.style.display = e.style.display === "block" ? "none" : "block";
19493
+ const N = this.ui.settingsPanel;
19494
+ N.style.display = N.style.display === "block" ? "none" : "block";
19492
19495
  }, { signal: I });
19493
19496
  const A = this.ui.bookWrapper;
19494
19497
  (m = this.ui.zoomIn) == null || m.addEventListener("click", () => {
@@ -19497,30 +19500,34 @@ const Bl = class Bl {
19497
19500
  this.currentZoom > 0.5 && (this.currentZoom -= 0.5, this.updateTransform(), this.currentZoom <= 1 && (this.currentZoom = 1, this.zoomState.isActive = !1, this.zoomState.translateX = 0, this.zoomState.translateY = 0, A.classList.remove("zoomed"), this.updateTransform()), this.emitZoomChange());
19498
19501
  }, { signal: I });
19499
19502
  const i = this.ui.area;
19500
- i.addEventListener("dblclick", (t) => {
19503
+ (a = this.ui.singleView) == null || a.addEventListener("click", (t) => {
19504
+ if (!this.state.isSingle || this.zoomState.isActive) return;
19505
+ const N = this.ui.singleView.getBoundingClientRect(), V = t.clientX - N.left;
19506
+ V < N.width / 3 ? this.goPrev() : V > N.width * 2 / 3 && this.goNext();
19507
+ }, { signal: I }), i.addEventListener("dblclick", (t) => {
19501
19508
  this.currentZoom > 1 ? (this.currentZoom = 1, this.zoomState.isActive = !1, this.zoomState.translateX = 0, this.zoomState.translateY = 0, A.classList.remove("zoomed")) : (this.currentZoom = 2.5, this.zoomState.isActive = !0, A.classList.add("zoomed"), this.loadHighResForVisiblePages()), this.updateTransform(), this.emitZoomChange();
19502
19509
  }, { signal: I });
19503
19510
  let Z = 0;
19504
19511
  i.addEventListener("wheel", (t) => {
19505
19512
  if (this.zoomState.isActive) return;
19506
- const e = Date.now();
19507
- e - Z < 500 || (t.deltaY > 0 ? (this.goNext(), Z = e) : t.deltaY < 0 && (this.goPrev(), Z = e));
19513
+ const N = Date.now();
19514
+ N - Z < 500 || (t.deltaY > 0 ? (this.goNext(), Z = N) : t.deltaY < 0 && (this.goPrev(), Z = N));
19508
19515
  }, { signal: I }), i.addEventListener("mousedown", (t) => this.handleDragStart(t.clientX, t.clientY), { signal: I }), window.addEventListener("mousemove", (t) => this.handleDragMove(t.clientX, t.clientY), { signal: I }), window.addEventListener("mouseup", () => this.handleDragEnd(), { signal: I }), i.addEventListener("touchstart", (t) => {
19509
19516
  t.touches.length === 1 && (this.touchStartX = t.touches[0].clientX, this.handleDragStart(t.touches[0].clientX, t.touches[0].clientY));
19510
19517
  }, { passive: !1, signal: I }), window.addEventListener("touchmove", (t) => {
19511
19518
  this.zoomState.isActive && t.touches.length === 1 && (t.preventDefault(), this.handleDragMove(t.touches[0].clientX, t.touches[0].clientY));
19512
19519
  }, { passive: !1, signal: I }), window.addEventListener("touchend", (t) => {
19513
19520
  if (!this.zoomState.isActive && this.state.isSingle && t.changedTouches.length === 1) {
19514
- const e = t.changedTouches[0].clientX - this.touchStartX;
19515
- e < -50 ? this.goNext() : e > 50 && this.goPrev();
19521
+ const N = t.changedTouches[0].clientX - this.touchStartX;
19522
+ N < -50 ? this.goNext() : N > 50 && this.goPrev();
19516
19523
  }
19517
19524
  this.handleDragEnd();
19518
- }, { signal: I }), (a = this.ui.fullscreen) == null || a.addEventListener("click", () => {
19525
+ }, { signal: I }), (n = this.ui.fullscreen) == null || n.addEventListener("click", () => {
19519
19526
  const t = this.ui.wrapper;
19520
- !document.fullscreenElement && t ? t.requestFullscreen().catch((e) => console.log(e)) : document.exitFullscreen();
19527
+ !document.fullscreenElement && t ? t.requestFullscreen().catch((N) => console.log(N)) : document.exitFullscreen();
19521
19528
  }, { signal: I }), this.ui.downloadBtn && this.downloadUrl && this.ui.downloadBtn.addEventListener("click", () => {
19522
- var t, e;
19523
- (e = (t = this.options).onDownload) == null || e.call(t, this.downloadUrl), window.open(this.downloadUrl, "_blank");
19529
+ var t, N;
19530
+ (N = (t = this.options).onDownload) == null || N.call(t, this.downloadUrl), window.open(this.downloadUrl, "_blank");
19524
19531
  }, { signal: I });
19525
19532
  }
19526
19533
  handleDragStart(I, g) {