@component-hook/pdf-canvas 1.4.4-alpha.0 → 1.4.4-alpha.1

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.
@@ -268,11 +268,11 @@ React keys must be passed directly to JSX without using spread:
268
268
  })()), Gs;
269
269
  }
270
270
  var $o;
271
- function Vh() {
271
+ function Wh() {
272
272
  return $o || ($o = 1, process.env.NODE_ENV === "production" ? Ai.exports = zh() : Ai.exports = Gh()), Ai.exports;
273
273
  }
274
- var Ho = Vh();
275
- const Wh = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='20'%20cy='20'%20r='10.75'%20stroke='currentColor'%20stroke-width='2.5'/%3e%3cpath%20d='M16%2024L23.7782%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3cpath%20d='M24%2024L16.2218%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3c/svg%3e", Xh = {
274
+ var Ho = Wh();
275
+ const Vh = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='20'%20cy='20'%20r='10.75'%20stroke='currentColor'%20stroke-width='2.5'/%3e%3cpath%20d='M16%2024L23.7782%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3cpath%20d='M24%2024L16.2218%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3c/svg%3e", Xh = {
276
276
  top: 100,
277
277
  left: 50,
278
278
  scaleX: 0.5,
@@ -299,7 +299,7 @@ const Wh = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%20
299
299
  }, qh = {
300
300
  stroke: "#000",
301
301
  hoverStroke: "#B7EC5D",
302
- src: Wh
302
+ src: Vh
303
303
  }, Kh = [
304
304
  "borderColor",
305
305
  "cornerStrokeColor",
@@ -409,7 +409,7 @@ const Ce = () => Go || (Go = { document, window, isTouchSupported: "ontouchstart
409
409
  }(), vr = "7.2.0";
410
410
  function tn() {
411
411
  }
412
- const Ge = Math.PI / 2, tc = Math.PI / 4, ge = 2 * Math.PI, zr = Math.PI / 180, Bt = Object.freeze([1, 0, 0, 1, 0, 0]), Gr = 16, Be = 0.4477152502, U = "center", tt = "left", Ut = "top", yr = "bottom", gt = "right", Nt = "none", Vr = /\r?\n/, Va = "moving", An = "scaling", Wa = "rotating", Wr = "rotate", Xa = "skewing", hi = "resizing", ec = "modifyPoly", sc = "modifyPath", ln = "changed", Tn = "scale", $t = "scaleX", Zt = "scaleY", Is = "skewX", Ns = "skewY", xt = "fill", Yt = "stroke", hn = "modified", Ke = "ltr", ke = "rtl", _r = "normal", vs = "json", qn = "svg", I = new class {
412
+ const Ge = Math.PI / 2, tc = Math.PI / 4, ge = 2 * Math.PI, zr = Math.PI / 180, Bt = Object.freeze([1, 0, 0, 1, 0, 0]), Gr = 16, Be = 0.4477152502, U = "center", tt = "left", Ut = "top", yr = "bottom", gt = "right", Nt = "none", Wr = /\r?\n/, Wa = "moving", An = "scaling", Va = "rotating", Vr = "rotate", Xa = "skewing", hi = "resizing", ec = "modifyPoly", sc = "modifyPath", ln = "changed", Tn = "scale", $t = "scaleX", Zt = "scaleY", Is = "skewX", Ns = "skewY", xt = "fill", Yt = "stroke", hn = "modified", Ke = "ltr", ke = "rtl", _r = "normal", vs = "json", qn = "svg", I = new class {
413
413
  constructor() {
414
414
  this[vs] = /* @__PURE__ */ new Map(), this[qn] = /* @__PURE__ */ new Map();
415
415
  }
@@ -783,7 +783,7 @@ function qa(a) {
783
783
  return mi().cancelAnimationFrame(a);
784
784
  }
785
785
  let nc = 0;
786
- const Ve = () => nc++, Ae = () => {
786
+ const We = () => nc++, Ae = () => {
787
787
  const a = Fs().createElement("canvas");
788
788
  if (!a || a.getContext === void 0) throw new ue("Failed to create `canvas` element");
789
789
  return a;
@@ -867,7 +867,7 @@ const kn = function(a) {
867
867
  });
868
868
  }, gs = function(a) {
869
869
  return (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []).reduce((t, e) => (e in a && (t[e] = a[e]), t), {});
870
- }, Qr = (a, t) => Object.keys(a).reduce((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e), {}), nt = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map((t) => nt(t, st.NUM_FRACTION_DIGITS)).join(" ") + ")", ne = (a) => !!a && a.toLive !== void 0, Vo = (a) => !!a && typeof a.toObject == "function", Wo = (a) => !!a && a.offsetX !== void 0 && "source" in a, Je = (a) => !!a && "multiSelectionStacking" in a;
870
+ }, Qr = (a, t) => Object.keys(a).reduce((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e), {}), nt = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map((t) => nt(t, st.NUM_FRACTION_DIGITS)).join(" ") + ")", ne = (a) => !!a && a.toLive !== void 0, Wo = (a) => !!a && typeof a.toObject == "function", Vo = (a) => !!a && a.offsetX !== void 0 && "source" in a, Je = (a) => !!a && "multiSelectionStacking" in a;
871
871
  function el(a) {
872
872
  const t = a && ce(a);
873
873
  let e = 0, s = 0;
@@ -933,10 +933,10 @@ class nl {
933
933
  }
934
934
  }
935
935
  const rc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Bt], patternQuality: "best" }, J = (a) => a.toString().replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
936
- let Vs;
936
+ let Ws;
937
937
  const Mn = (a) => {
938
- if (Vs || Vs || (Vs = "Intl" in mi() && "Segmenter" in Intl && new Intl.Segmenter(void 0, { granularity: "grapheme" })), Vs) {
939
- const t = Vs.segment(a);
938
+ if (Ws || Ws || (Ws = "Intl" in mi() && "Segmenter" in Intl && new Intl.Segmenter(void 0, { granularity: "grapheme" })), Ws) {
939
+ const t = Ws.segment(a);
940
940
  return Array.from(t).map((e) => {
941
941
  let { segment: s } = e;
942
942
  return s;
@@ -1202,7 +1202,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1202
1202
  }
1203
1203
  createSVGClipPathMarkup(t) {
1204
1204
  const e = this.clipPath;
1205
- return e ? (e.clipPathId = `CLIPPATH_${Ve()}`, `<clipPath id="${e.clipPathId}" >
1205
+ return e ? (e.clipPathId = `CLIPPATH_${We()}`, `<clipPath id="${e.clipPathId}" >
1206
1206
  ${e.toClipPathSVG(t.reviver)}</clipPath>
1207
1207
  `) : "";
1208
1208
  }
@@ -1255,7 +1255,7 @@ ${i}]]></style>
1255
1255
  const s = this[`${e}Color`];
1256
1256
  if (s) if (ne(s)) {
1257
1257
  const i = s.repeat || "", n = this.width, r = this.height, o = this[`${e}Vpt`] ? Ds(Xt(this.viewportTransform)) : "";
1258
- t.push(`<rect transform="${o} translate(${n / 2},${r / 2})" x="${s.offsetX - n / 2}" y="${s.offsetY - r / 2}" width="${i !== "repeat-y" && i !== "no-repeat" || !Wo(s) ? n : s.source.width}" height="${i !== "repeat-x" && i !== "no-repeat" || !Wo(s) ? r : s.source.height}" fill="url(#SVGID_${s.id})"></rect>
1258
+ t.push(`<rect transform="${o} translate(${n / 2},${r / 2})" x="${s.offsetX - n / 2}" y="${s.offsetY - r / 2}" width="${i !== "repeat-y" && i !== "no-repeat" || !Vo(s) ? n : s.source.width}" height="${i !== "repeat-x" && i !== "no-repeat" || !Vo(s) ? r : s.source.height}" fill="url(#SVGID_${s.id})"></rect>
1259
1259
  `);
1260
1260
  } else t.push('<rect x="0" y="0" width="100%" height="100%" ', 'fill="', s, '"', `></rect>
1261
1261
  `);
@@ -1576,7 +1576,7 @@ class gl {
1576
1576
  let { noStyle: e, reviver: s, withShadow: i, additionalTransform: n } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1577
1577
  const r = e ? "" : `style="${this.getSvgStyles()}" `, o = i ? `style="${this.getSvgFilter()}" ` : "", l = this.clipPath, h = this.strokeUniform ? 'vector-effect="non-scaling-stroke" ' : "", c = l && l.absolutePositioned, u = this.stroke, d = this.fill, f = this.shadow, g = [], p = t.indexOf("COMMON_PARTS");
1578
1578
  let b;
1579
- l && (l.clipPathId = `CLIPPATH_${Ve()}`, b = `<clipPath id="${l.clipPathId}" >
1579
+ l && (l.clipPathId = `CLIPPATH_${We()}`, b = `<clipPath id="${l.clipPathId}" >
1580
1580
  ${l.toClipPathSVG(s)}</clipPath>
1581
1581
  `), c && g.push("<g ", o, this.getSvgCommons(), ` >
1582
1582
  `), g.push("<g ", this.getSvgTransform(!1), c ? "" : o + this.getSvgCommons(), ` >
@@ -1593,12 +1593,12 @@ ${l.toClipPathSVG(s)}</clipPath>
1593
1593
  function Dn(a) {
1594
1594
  return new RegExp("^(" + a.join("|") + ")\\b", "i");
1595
1595
  }
1596
- const hs = "textDecorationThickness", pl = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], ml = ["underline", "overline", "linethrough"], bl = [...pl, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], vl = [...bl, ...ml, "textBackgroundColor", "direction", hs], dc = [...pl, ...ml, Yt, "strokeWidth", xt, "deltaY", "textBackgroundColor", hs], fc = { _reNewline: Vr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: _r, fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: tt, fontStyle: _r, lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: tt, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: Ke, CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.28167, overline: -0.81333 }, _fontSizeMult: 1.13, [hs]: 66.667 }, xe = "justify", mn = "justify-left", ni = "justify-right", ri = "justify-center", de = String.raw`[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?`, Qn = String.raw`(?:\s*,?\s+|\s*,\s*)`, Cr = "http://www.w3.org/2000/svg", gc = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + de + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + de + "))?\\s+(.*)"), pc = { cx: tt, x: tt, r: "radius", cy: Ut, y: Ut, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing", "text-decoration-thickness": hs }, Jn = "font-size", Zn = "clip-path", mc = Dn(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), bc = Dn(["symbol", "image", "marker", "pattern", "view", "svg"]), Zo = Dn(["symbol", "g", "a", "svg", "clipPath", "defs"]), ta = new RegExp(String.raw`^\s*(${de})${Qn}(${de})${Qn}(${de})${Qn}(${de})\s*$`), ea = "(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?", sa = new RegExp("(?:\\s|^)" + ea + ea + "(" + de + "?(?:px)?)?(?:\\s?|$)(?:$|\\s)");
1596
+ const hs = "textDecorationThickness", pl = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], ml = ["underline", "overline", "linethrough"], bl = [...pl, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], vl = [...bl, ...ml, "textBackgroundColor", "direction", hs], dc = [...pl, ...ml, Yt, "strokeWidth", xt, "deltaY", "textBackgroundColor", hs], fc = { _reNewline: Wr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: _r, fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: tt, fontStyle: _r, lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: tt, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: Ke, CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.28167, overline: -0.81333 }, _fontSizeMult: 1.13, [hs]: 66.667 }, xe = "justify", mn = "justify-left", ni = "justify-right", ri = "justify-center", de = String.raw`[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?`, Qn = String.raw`(?:\s*,?\s+|\s*,\s*)`, Cr = "http://www.w3.org/2000/svg", gc = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + de + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + de + "))?\\s+(.*)"), pc = { cx: tt, x: tt, r: "radius", cy: Ut, y: Ut, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing", "text-decoration-thickness": hs }, Jn = "font-size", Zn = "clip-path", mc = Dn(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), bc = Dn(["symbol", "image", "marker", "pattern", "view", "svg"]), Zo = Dn(["symbol", "g", "a", "svg", "clipPath", "defs"]), ta = new RegExp(String.raw`^\s*(${de})${Qn}(${de})${Qn}(${de})${Qn}(${de})\s*$`), ea = "(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?", sa = new RegExp("(?:\\s|^)" + ea + ea + "(" + de + "?(?:px)?)?(?:\\s?|$)(?:$|\\s)");
1597
1597
  class Le {
1598
1598
  constructor() {
1599
1599
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1600
1600
  const e = typeof t == "string" ? Le.parseShadow(t) : t;
1601
- Object.assign(this, Le.ownDefaults, e), this.id = Ve();
1601
+ Object.assign(this, Le.ownDefaults, e), this.id = We();
1602
1602
  }
1603
1603
  static parseShadow(t) {
1604
1604
  const e = t.trim(), [, s = 0, i = 0, n = 0] = (sa.exec(e) || []).map((r) => parseFloat(r) || 0);
@@ -2322,7 +2322,7 @@ let Te = class sn extends Tc {
2322
2322
  let e;
2323
2323
  const s = st.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: l, left: h, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: _, strokeMiterLimit: y, scaleX: w, scaleY: C, angle: A, flipX: T, flipY: k, opacity: L, visible: R, backgroundColor: F, fillRule: P, paintFirst: O, globalCompositeOperation: $, skewX: M, skewY: D } = this;
2324
2324
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2325
- const G = (at) => nt(at, s), ot = { ...gs(this, t), type: this.constructor.type, version: vr, originX: u, originY: d, left: G(h), top: G(c), width: G(f), height: G(g), fill: Vo(n) ? n.toObject() : n, stroke: Vo(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: l && l.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: _, strokeMiterLimit: G(y), scaleX: G(w), scaleY: G(C), angle: G(A), flipX: T, flipY: k, opacity: G(L), shadow: o && o.toObject(), visible: R, backgroundColor: F, fillRule: P, paintFirst: O, globalCompositeOperation: $, skewX: G(M), skewY: G(D), ...e ? { clipPath: e } : null };
2325
+ const G = (at) => nt(at, s), ot = { ...gs(this, t), type: this.constructor.type, version: vr, originX: u, originY: d, left: G(h), top: G(c), width: G(f), height: G(g), fill: Wo(n) ? n.toObject() : n, stroke: Wo(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: l && l.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: _, strokeMiterLimit: G(y), scaleX: G(w), scaleY: G(C), angle: G(A), flipX: T, flipY: k, opacity: G(L), shadow: o && o.toObject(), visible: R, backgroundColor: F, fillRule: P, paintFirst: O, globalCompositeOperation: $, skewX: G(M), skewY: G(D), ...e ? { clipPath: e } : null };
2326
2326
  return this.includeDefaultValues ? ot : this._removeDefaultValues(ot);
2327
2327
  }
2328
2328
  toDatalessObject(t) {
@@ -2432,7 +2432,7 @@ class ae {
2432
2432
  ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Mc.call(this, t, e, s, i, n) : Pc.call(this, t, e, s, i, n);
2433
2433
  }
2434
2434
  }
2435
- const Oc = (a, t, e) => e.lockRotation ? gn : t.cursorStyle, Dc = Bs(Wa, $s((a, t, e, s) => {
2435
+ const Oc = (a, t, e) => e.lockRotation ? gn : t.cursorStyle, Dc = Bs(Va, $s((a, t, e, s) => {
2436
2436
  let { target: i, ex: n, ey: r, theta: o, originX: l, originY: h } = t;
2437
2437
  const c = i.getPositionByOrigin(l, h);
2438
2438
  if (fe(i, "lockRotation")) return !1;
@@ -2507,7 +2507,7 @@ function Rn(a, t) {
2507
2507
  const ki = (a, t, e) => {
2508
2508
  const s = Rn(a, e);
2509
2509
  return t.x === 0 ? s ? Is : Zt : t.y === 0 ? s ? Ns : $t : "";
2510
- }, ws = (a, t, e, s) => Rn(a, e) ? Nc(0, t, e, s) : Qs(a, t, e, s), oa = (a, t, e, s) => Rn(a, t.target) ? Bc(a, t, e, s) : Lc(a, t, e, s), aa = (a, t, e, s) => Rn(a, t.target) ? jc(a, t, e, s) : Fc(a, t, e, s), Al = () => ({ ml: new ae({ x: -0.5, y: 0, cursorStyleHandler: ws, actionHandler: oa, getActionName: ki }), mr: new ae({ x: 0.5, y: 0, cursorStyleHandler: ws, actionHandler: oa, getActionName: ki }), mb: new ae({ x: 0, y: 0.5, cursorStyleHandler: ws, actionHandler: aa, getActionName: ki }), mt: new ae({ x: 0, y: -0.5, cursorStyleHandler: ws, actionHandler: aa, getActionName: ki }), tl: new ae({ x: -0.5, y: -0.5, cursorStyleHandler: Qs, actionHandler: Ei }), tr: new ae({ x: 0.5, y: -0.5, cursorStyleHandler: Qs, actionHandler: Ei }), bl: new ae({ x: -0.5, y: 0.5, cursorStyleHandler: Qs, actionHandler: Ei }), br: new ae({ x: 0.5, y: 0.5, cursorStyleHandler: Qs, actionHandler: Ei }), mtr: new ae({ x: 0, y: -0.5, actionHandler: Dc, cursorStyleHandler: Oc, offsetY: -40, withConnection: !0, actionName: Wr }) }), $c = () => ({ mr: new ae({ x: 0.5, y: 0, actionHandler: ra, cursorStyleHandler: ws, actionName: hi }), ml: new ae({ x: -0.5, y: 0, actionHandler: ra, cursorStyleHandler: ws, actionName: hi }) }), Hc = () => ({ ...Al(), ...$c() });
2510
+ }, ws = (a, t, e, s) => Rn(a, e) ? Nc(0, t, e, s) : Qs(a, t, e, s), oa = (a, t, e, s) => Rn(a, t.target) ? Bc(a, t, e, s) : Lc(a, t, e, s), aa = (a, t, e, s) => Rn(a, t.target) ? jc(a, t, e, s) : Fc(a, t, e, s), Al = () => ({ ml: new ae({ x: -0.5, y: 0, cursorStyleHandler: ws, actionHandler: oa, getActionName: ki }), mr: new ae({ x: 0.5, y: 0, cursorStyleHandler: ws, actionHandler: oa, getActionName: ki }), mb: new ae({ x: 0, y: 0.5, cursorStyleHandler: ws, actionHandler: aa, getActionName: ki }), mt: new ae({ x: 0, y: -0.5, cursorStyleHandler: ws, actionHandler: aa, getActionName: ki }), tl: new ae({ x: -0.5, y: -0.5, cursorStyleHandler: Qs, actionHandler: Ei }), tr: new ae({ x: 0.5, y: -0.5, cursorStyleHandler: Qs, actionHandler: Ei }), bl: new ae({ x: -0.5, y: 0.5, cursorStyleHandler: Qs, actionHandler: Ei }), br: new ae({ x: 0.5, y: 0.5, cursorStyleHandler: Qs, actionHandler: Ei }), mtr: new ae({ x: 0, y: -0.5, actionHandler: Dc, cursorStyleHandler: Oc, offsetY: -40, withConnection: !0, actionName: Vr }) }), $c = () => ({ mr: new ae({ x: 0.5, y: 0, actionHandler: ra, cursorStyleHandler: ws, actionName: hi }), ml: new ae({ x: -0.5, y: 0, actionHandler: ra, cursorStyleHandler: ws, actionName: hi }) }), Hc = () => ({ ...Al(), ...$c() });
2511
2511
  class di extends Te {
2512
2512
  static getDefaults() {
2513
2513
  return { ...super.getDefaults(), ...di.ownDefaults };
@@ -2829,7 +2829,7 @@ const Ml = function(a, t) {
2829
2829
  return s;
2830
2830
  }, Ol = (a, t) => {
2831
2831
  if (!Array.isArray(a)) return ao(a);
2832
- const e = t.split(Vr), s = {};
2832
+ const e = t.split(Wr), s = {};
2833
2833
  let i = -1, n = 0;
2834
2834
  for (let r = 0; r < e.length; r++) {
2835
2835
  const o = Mn(e[r]);
@@ -2855,12 +2855,12 @@ function Gc(a, t) {
2855
2855
  return n.length === 0;
2856
2856
  })(a, t)), s && e && t.length === 0;
2857
2857
  }
2858
- function Vc(a) {
2858
+ function Wc(a) {
2859
2859
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = {};
2860
2860
  for (const s in t) Gc(a, s.split(" ")) && (e = { ...e, ...t[s] });
2861
2861
  return e;
2862
2862
  }
2863
- const Wc = (a) => {
2863
+ const Vc = (a) => {
2864
2864
  var t;
2865
2865
  return (t = pc[a]) !== null && t !== void 0 ? t : a;
2866
2866
  }, Xc = new RegExp(`(${de})`, "gi"), Ft = `(${de})`, Uc = String.raw`(skewX)\(${Ft}\)`, Yc = String.raw`(skewY)\(${Ft}\)`, qc = String.raw`(rotate)\(${Ft}(?: ${Ft} ${Ft})?\)`, Kc = String.raw`(scale)\(${Ft}(?: ${Ft})?\)`, Qc = String.raw`(translate)\(${Ft}(?: ${Ft})?\)`, lo = `(?:${String.raw`(matrix)\(${Ft} ${Ft} ${Ft} ${Ft} ${Ft} ${Ft}\)`}|${Qc}|${qc}|${Kc}|${Uc}|${Yc})`, Jc = `(?:${lo}*)`, Zc = String.raw`^\s*(?:${Jc}?)\s*$`, tu = new RegExp(Zc), eu = new RegExp(lo), su = new RegExp(lo, "g");
@@ -2876,7 +2876,7 @@ function bn(a) {
2876
2876
  case "translate":
2877
2877
  i = js(l, h);
2878
2878
  break;
2879
- case Wr:
2879
+ case Vr:
2880
2880
  i = fs({ angle: l }, { x: h, y: c });
2881
2881
  break;
2882
2882
  case Tn:
@@ -2941,11 +2941,11 @@ function je(a, t, e) {
2941
2941
  const r = { ...t.reduce((h, c) => {
2942
2942
  const u = a.getAttribute(c);
2943
2943
  return u && (h[c] = u), h;
2944
- }, {}), ...Vc(a, e), ...nu(a) };
2944
+ }, {}), ...Wc(a, e), ...nu(a) };
2945
2945
  r[Zn] && a.setAttribute(Zn, r[Zn]), r[Jn] && (s = Rt(r[Jn], n), r[Jn] = `${s}`);
2946
2946
  const o = {};
2947
2947
  for (const h in r) {
2948
- const c = Wc(h), u = iu(c, r[h], i, s);
2948
+ const c = Vc(h), u = iu(c, r[h], i, s);
2949
2949
  o[c] = u;
2950
2950
  }
2951
2951
  o && o.font && (function(h, c) {
@@ -3055,7 +3055,7 @@ class fi {
3055
3055
  }
3056
3056
  attachHandlers(t, e) {
3057
3057
  const { target: s } = e;
3058
- return [hn, Va, hi, Wa, An, Xa, ln, ec, sc].map((i) => t.on(i, (n) => this.performLayout(i === hn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })));
3058
+ return [hn, Wa, hi, Va, An, Xa, ln, ec, sc].map((i) => t.on(i, (n) => this.performLayout(i === hn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })));
3059
3059
  }
3060
3060
  subscribe(t, e) {
3061
3061
  this.unsubscribe(t, e);
@@ -3304,7 +3304,7 @@ class Jt extends Ua(Pt) {
3304
3304
  }
3305
3305
  }
3306
3306
  x(Jt, "type", "Group"), x(Jt, "ownDefaults", { strokeWidth: 0, subTargetCheck: !1, interactive: !1 }), I.setClass(Jt);
3307
- const Fl = (a, t) => Math.min(t.width / a.width, t.height / a.height), Il = (a, t) => Math.max(t.width / a.width, t.height / a.height), kr = "\\s*,?\\s*", Ws = `${kr}(${de})`, au = `${Ws}${Ws}${Ws}${kr}([01])${kr}([01])${Ws}${Ws}`, lu = { m: "l", M: "L" }, hu = (a, t, e, s, i, n, r, o, l, h, c) => {
3307
+ const Fl = (a, t) => Math.min(t.width / a.width, t.height / a.height), Il = (a, t) => Math.max(t.width / a.width, t.height / a.height), kr = "\\s*,?\\s*", Vs = `${kr}(${de})`, au = `${Vs}${Vs}${Vs}${kr}([01])${kr}([01])${Vs}${Vs}`, lu = { m: "l", M: "L" }, hu = (a, t, e, s, i, n, r, o, l, h, c) => {
3308
3308
  const u = pe(a), d = me(a), f = pe(t), g = me(t), p = e * i * f - s * n * g + r, b = s * i * f + e * n * g + o;
3309
3309
  return ["C", h + l * (-e * i * d - s * n * u), c + l * (-s * i * d + e * n * u), p + l * (e * i * g + s * n * f), b + l * (s * i * g - e * n * f), p, b];
3310
3310
  }, ca = (a, t, e, s) => {
@@ -3519,7 +3519,7 @@ const cu = (a, t, e) => {
3519
3519
  e = a[h], h + 1 < a.length && (s = a[h + 1]);
3520
3520
  }
3521
3521
  return l && (i = e.x > a[h - 2].x ? 1 : e.x === a[h - 2].x ? 0 : -1, n = e.y > a[h - 2].y ? 1 : e.y === a[h - 2].y ? 0 : -1), r.push(["L", e.x + i * t, e.y + n * t]), r;
3522
- }, Vl = (a, t) => a.map((e) => e.map((s, i) => i === 0 || t === void 0 ? s : nt(s, t)).join(" ")).join(" "), yu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a, nn = (a, t) => {
3522
+ }, Wl = (a, t) => a.map((e) => e.map((s, i) => i === 0 || t === void 0 ? s : nt(s, t)).join(" ")).join(" "), yu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a, nn = (a, t) => {
3523
3523
  let e = a._findCenterFromElement();
3524
3524
  a.transformMatrix && (((s) => {
3525
3525
  if (s.transformMatrix) {
@@ -3553,7 +3553,7 @@ var _u = Object.freeze({ __proto__: null, addTransformToObject: ol, animate: ro,
3553
3553
  return t.concat(["offset", "stop-color", "stop-opacity"]);
3554
3554
  }
3555
3555
  return t;
3556
- }, getUnitVector: On, groupSVGElements: (a, t) => a && a.length === 1 ? a[0] : new Jt(a, t), hasStyleChanged: Ln, invertTransform: Xt, isBetweenVectors: Sr, isIdentityMatrix: Qa, isTouchEvent: un, isTransparent: El, joinPath: Vl, loadImage: ii, magnitude: dn, makeBoundingBoxFromPoints: Se, makePathSimpler: Nl, matrixToSVG: Ds, mergeClipPaths: (a, t) => {
3556
+ }, getUnitVector: On, groupSVGElements: (a, t) => a && a.length === 1 ? a[0] : new Jt(a, t), hasStyleChanged: Ln, invertTransform: Xt, isBetweenVectors: Sr, isIdentityMatrix: Qa, isTouchEvent: un, isTransparent: El, joinPath: Wl, loadImage: ii, magnitude: dn, makeBoundingBoxFromPoints: Se, makePathSimpler: Nl, matrixToSVG: Ds, mergeClipPaths: (a, t) => {
3557
3557
  var e;
3558
3558
  let s = a, i = t;
3559
3559
  s.inverted && !i.inverted && (s = t, i = a), xr(i, (e = i.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
@@ -3616,7 +3616,7 @@ class wu extends nl {
3616
3616
  }
3617
3617
  const xu = (a, t, e, s) => {
3618
3618
  const { target: i, offsetX: n, offsetY: r } = t, o = e - n, l = s - r, h = !fe(i, "lockMovementX") && i.left !== o, c = !fe(i, "lockMovementY") && i.top !== l;
3619
- return h && i.set(tt, o), c && i.set(Ut, l), (h || c) && wl(Va, dl(a, t, e, s)), h || c;
3619
+ return h && i.set(tt, o), c && i.set(Ut, l), (h || c) && wl(Wa, dl(a, t, e, s)), h || c;
3620
3620
  };
3621
3621
  class In extends yi {
3622
3622
  constructor() {
@@ -3686,7 +3686,7 @@ class In extends yi {
3686
3686
  _shouldCenterTransform(t, e, s) {
3687
3687
  if (!t) return;
3688
3688
  let i;
3689
- return e === Tn || e === $t || e === Zt || e === hi ? i = this.centeredScaling || t.centeredScaling : e === Wr && (i = this.centeredRotation || t.centeredRotation), i ? !s : s;
3689
+ return e === Tn || e === $t || e === Zt || e === hi ? i = this.centeredScaling || t.centeredScaling : e === Vr && (i = this.centeredRotation || t.centeredRotation), i ? !s : s;
3690
3690
  }
3691
3691
  _getOriginFromCorner(t, e) {
3692
3692
  const s = e ? t.controls[e].getTransformAnchorPoint() : { x: t.originX, y: t.originY };
@@ -4253,7 +4253,7 @@ class Or extends In {
4253
4253
  this.removeListeners(), this.textEditingManager.dispose(), super.destroy();
4254
4254
  }
4255
4255
  }
4256
- const Wl = { x1: 0, y1: 0, x2: 0, y2: 0 }, Au = { ...Wl, r1: 0, r2: 0 }, xs = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4256
+ const Vl = { x1: 0, y1: 0, x2: 0, y2: 0 }, Au = { ...Vl, r1: 0, r2: 0 }, xs = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4257
4257
  function Xl(a) {
4258
4258
  return a && /%$/.test(a) && Number.isFinite(parseFloat(a));
4259
4259
  }
@@ -4313,7 +4313,7 @@ function Pu(a, t) {
4313
4313
  class Js {
4314
4314
  constructor(t) {
4315
4315
  const { type: e = "linear", gradientUnits: s = "pixels", coords: i = {}, colorStops: n = [], offsetX: r = 0, offsetY: o = 0, gradientTransform: l, id: h } = t || {};
4316
- Object.assign(this, { type: e, gradientUnits: s, coords: { ...e === "radial" ? Au : Wl, ...i }, colorStops: n, offsetX: r, offsetY: o, gradientTransform: l, id: h ? `${h}_${Ve()}` : Ve() });
4316
+ Object.assign(this, { type: e, gradientUnits: s, coords: { ...e === "radial" ? Au : Vl, ...i }, colorStops: n, offsetX: r, offsetY: o, gradientTransform: l, id: h ? `${h}_${We()}` : We() });
4317
4317
  }
4318
4318
  addColorStop(t) {
4319
4319
  for (const e in t) this.colorStops.push({ offset: parseFloat(e), color: t[e] });
@@ -4379,7 +4379,7 @@ class ir {
4379
4379
  Fe("warn", "Setting type has no effect", t);
4380
4380
  }
4381
4381
  constructor(t) {
4382
- x(this, "repeat", "repeat"), x(this, "offsetX", 0), x(this, "offsetY", 0), x(this, "crossOrigin", ""), this.id = Ve(), Object.assign(this, t);
4382
+ x(this, "repeat", "repeat"), x(this, "offsetX", 0), x(this, "offsetY", 0), x(this, "crossOrigin", ""), this.id = We(), Object.assign(this, t);
4383
4383
  }
4384
4384
  isImageSource() {
4385
4385
  return !!this.source && typeof this.source.src == "string";
@@ -4459,7 +4459,7 @@ class Ze extends Pt {
4459
4459
  return this.sourcePath && (delete e.path, e.sourcePath = this.sourcePath), e;
4460
4460
  }
4461
4461
  _toSVG() {
4462
- return ["<path ", "COMMON_PARTS", `d="${Vl(this.path, st.NUM_FRACTION_DIGITS)}" stroke-linecap="round" />
4462
+ return ["<path ", "COMMON_PARTS", `d="${Wl(this.path, st.NUM_FRACTION_DIGITS)}" stroke-linecap="round" />
4463
4463
  `];
4464
4464
  }
4465
4465
  _getOffsetTransform() {
@@ -5447,7 +5447,7 @@ class Lu extends Tt {
5447
5447
  }
5448
5448
  searchWordBoundary(t, e) {
5449
5449
  const s = this._text;
5450
- let i = t > 0 && this._reSpace.test(s[t]) && (e === -1 || !Vr.test(s[t - 1])) ? t - 1 : t, n = s[i];
5450
+ let i = t > 0 && this._reSpace.test(s[t]) && (e === -1 || !Wr.test(s[t - 1])) ? t - 1 : t, n = s[i];
5451
5451
  for (; i > 0 && i < s.length && !fa.test(n); ) i += e, n = s[i];
5452
5452
  return e === -1 && fa.test(n) && i++, i;
5453
5453
  }
@@ -6324,12 +6324,12 @@ function ar() {
6324
6324
  return !or && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (or = $u()), or;
6325
6325
  }
6326
6326
  const eh = ["cropX", "cropY"];
6327
- class Wt extends Pt {
6327
+ class Vt extends Pt {
6328
6328
  static getDefaults() {
6329
- return { ...super.getDefaults(), ...Wt.ownDefaults };
6329
+ return { ...super.getDefaults(), ...Vt.ownDefaults };
6330
6330
  }
6331
6331
  constructor(t, e) {
6332
- super(), x(this, "_lastScaleX", 1), x(this, "_lastScaleY", 1), x(this, "_filterScalingX", 1), x(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, Wt.ownDefaults), this.setOptions(e), this.cacheKey = `texture${Ve()}`, this.setElement(typeof t == "string" ? (this.canvas && ce(this.canvas.getElement()) || Fs()).getElementById(t) : t, e);
6332
+ super(), x(this, "_lastScaleX", 1), x(this, "_lastScaleY", 1), x(this, "_filterScalingX", 1), x(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, Vt.ownDefaults), this.setOptions(e), this.cacheKey = `texture${We()}`, this.setElement(typeof t == "string" ? (this.canvas && ce(this.canvas.getElement()) || Fs()).getElementById(t) : t, e);
6333
6333
  }
6334
6334
  getElement() {
6335
6335
  return this._element;
@@ -6375,7 +6375,7 @@ class Wt extends Pt {
6375
6375
  let n = [], r = [], o = "", l = "";
6376
6376
  if (!e) return [];
6377
6377
  if (this.hasCrop()) {
6378
- const h = Ve();
6378
+ const h = We();
6379
6379
  n.push('<clipPath id="imageCrop_' + h + `">
6380
6380
  `, ' <rect x="' + s + '" y="' + i + '" width="' + J(this.width) + '" height="' + J(this.height) + `" />
6381
6381
  `, `</clipPath>
@@ -6491,7 +6491,7 @@ function lr(a) {
6491
6491
  } else s = a, s.removeAttribute("x"), s.removeAttribute("y"), e = s.getAttribute("transform") + e;
6492
6492
  return s.setAttribute("transform", e), m;
6493
6493
  }
6494
- x(Wt, "type", "Image"), x(Wt, "cacheProperties", [...Ne, ...eh]), x(Wt, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), x(Wt, "ATTRIBUTE_NAMES", [...Ue, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "href", "crossOrigin", "image-rendering"]), I.setClass(Wt), I.setSVGClass(Wt);
6494
+ x(Vt, "type", "Image"), x(Vt, "cacheProperties", [...Ne, ...eh]), x(Vt, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), x(Vt, "ATTRIBUTE_NAMES", [...Ue, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "href", "crossOrigin", "image-rendering"]), I.setClass(Vt), I.setSVGClass(Vt);
6495
6495
  const wn = (a) => a.tagName.replace("svg:", ""), Hu = Dn(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6496
6496
  function sh(a, t) {
6497
6497
  let e, s, i, n, r = [];
@@ -6512,7 +6512,7 @@ function ih(a, t) {
6512
6512
  t.removeAttribute(hr);
6513
6513
  }
6514
6514
  const Gu = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"], va = (a) => I.getSVGClass(wn(a).toLowerCase());
6515
- class Vu {
6515
+ class Wu {
6516
6516
  constructor(t, e, s, i, n) {
6517
6517
  this.elements = t, this.options = e, this.reviver = s, this.regexUrl = /^url\(['"]?#([^'"]+)['"]?\)/g, this.doc = i, this.clipPaths = n, this.gradientDefs = (function(r) {
6518
6518
  const o = sh(r, Gu), l = {};
@@ -6552,7 +6552,7 @@ class Vu {
6552
6552
  const e = va(t);
6553
6553
  if (e) {
6554
6554
  const s = await e.fromElement(t, this.options, this.cssRules);
6555
- return this.resolveGradient(s, t, xt), this.resolveGradient(s, t, Yt), s instanceof Wt && s._originalElement ? nn(s, s.parsePreserveAspectRatioAttribute()) : nn(s), await this.resolveClipPath(s, t), this.reviver && this.reviver(t, s), s;
6555
+ return this.resolveGradient(s, t, xt), this.resolveGradient(s, t, Yt), s instanceof Vt && s._originalElement ? nn(s, s.parsePreserveAspectRatioAttribute()) : nn(s), await this.resolveClipPath(s, t), this.reviver && this.reviver(t, s), s;
6556
6556
  }
6557
6557
  return null;
6558
6558
  }
@@ -6587,7 +6587,7 @@ class Vu {
6587
6587
  }
6588
6588
  }
6589
6589
  const ya = (a) => mc.test(wn(a));
6590
- async function Wu(a, t) {
6590
+ async function Vu(a, t) {
6591
6591
  let { crossOrigin: e, signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6592
6592
  if (s && s.aborted) return Fe("log", new za("parseSVGDocument")), { objects: [], elements: [], options: {}, allElements: [] };
6593
6593
  const i = a.documentElement;
@@ -6638,10 +6638,10 @@ async function Wu(a, t) {
6638
6638
  c.setAttribute("originalTransform", c.getAttribute("transform") || "");
6639
6639
  const u = c.getAttribute("id");
6640
6640
  l[u] = Array.from(c.getElementsByTagName("*")).filter((d) => ya(d));
6641
- }), { objects: await new Vu(o, r, t, a, l).parse(), elements: o, options: r, allElements: n };
6641
+ }), { objects: await new Wu(o, r, t, a, l).parse(), elements: o, options: r, allElements: n };
6642
6642
  }
6643
6643
  function Xu(a, t, e) {
6644
- return Wu(new (mi()).DOMParser().parseFromString(a.trim(), "text/xml"), t, e);
6644
+ return Vu(new (mi()).DOMParser().parseFromString(a.trim(), "text/xml"), t, e);
6645
6645
  }
6646
6646
  function Uu(a, t) {
6647
6647
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
@@ -6937,7 +6937,7 @@ class Ii extends St {
6937
6937
  }
6938
6938
  static async fromObject(t, e) {
6939
6939
  let { type: s, image: i, ...n } = t;
6940
- return Wt.fromObject(i, e).then((r) => new this({ ...n, image: r }));
6940
+ return Vt.fromObject(i, e).then((r) => new this({ ...n, image: r }));
6941
6941
  }
6942
6942
  }
6943
6943
  x(Ii, "type", "BlendImage"), x(Ii, "defaults", { mode: "multiply", alpha: 1 }), x(Ii, "uniformLocations", ["uTransformMatrix", "uImage"]), I.setClass(Ii);
@@ -7477,7 +7477,7 @@ class Gi extends St {
7477
7477
  }
7478
7478
  }
7479
7479
  x(Gi, "type", "Invert"), x(Gi, "defaults", { alpha: !1, invert: !0 }), x(Gi, "uniformLocations", ["uInvert", "uAlpha"]), I.setClass(Gi);
7480
- class Vi extends St {
7480
+ class Wi extends St {
7481
7481
  getFragmentSource() {
7482
7482
  return `
7483
7483
  precision highp float;
@@ -7511,8 +7511,8 @@ class Vi extends St {
7511
7511
  return this.noise === 0;
7512
7512
  }
7513
7513
  }
7514
- x(Vi, "type", "Noise"), x(Vi, "defaults", { noise: 0 }), x(Vi, "uniformLocations", ["uNoise", "uSeed"]), I.setClass(Vi);
7515
- class Wi extends St {
7514
+ x(Wi, "type", "Noise"), x(Wi, "defaults", { noise: 0 }), x(Wi, "uniformLocations", ["uNoise", "uSeed"]), I.setClass(Wi);
7515
+ class Vi extends St {
7516
7516
  applyTo2d(t) {
7517
7517
  let { imageData: { data: e, width: s, height: i } } = t;
7518
7518
  for (let n = 0; n < i; n += this.blocksize) for (let r = 0; r < s; r += this.blocksize) {
@@ -7551,7 +7551,7 @@ class Wi extends St {
7551
7551
  t.uniform1f(e.uBlocksize, this.blocksize);
7552
7552
  }
7553
7553
  }
7554
- x(Wi, "type", "Pixelate"), x(Wi, "defaults", { blocksize: 4 }), x(Wi, "uniformLocations", ["uBlocksize"]), I.setClass(Wi);
7554
+ x(Vi, "type", "Pixelate"), x(Vi, "defaults", { blocksize: 4 }), x(Vi, "uniformLocations", ["uBlocksize"]), I.setClass(Vi);
7555
7555
  class Xi extends St {
7556
7556
  getFragmentSource() {
7557
7557
  return `
@@ -7781,7 +7781,7 @@ var X = globalThis.pdfjsLib = {};
7781
7781
  oi.d(X, {
7782
7782
  AbortException: () => (
7783
7783
  /* reexport */
7784
- We
7784
+ Ve
7785
7785
  ),
7786
7786
  AnnotationEditorLayer: () => (
7787
7787
  /* reexport */
@@ -7881,7 +7881,7 @@ oi.d(X, {
7881
7881
  ),
7882
7882
  TouchManager: () => (
7883
7883
  /* reexport */
7884
- Vn
7884
+ Wn
7885
7885
  ),
7886
7886
  UnexpectedResponseException: () => (
7887
7887
  /* reexport */
@@ -8231,7 +8231,7 @@ class hd extends Ye {
8231
8231
  super(t, "FormatError");
8232
8232
  }
8233
8233
  }
8234
- class We extends Ye {
8234
+ class Ve extends Ye {
8235
8235
  constructor(t) {
8236
8236
  super(t, "AbortException");
8237
8237
  }
@@ -9141,7 +9141,7 @@ class Xe {
9141
9141
  #N = [0, 0];
9142
9142
  #F = null;
9143
9143
  #j = null;
9144
- #V = null;
9144
+ #W = null;
9145
9145
  #D = null;
9146
9146
  static TRANSLATE_SMALL = 1;
9147
9147
  static TRANSLATE_BIG = 10;
@@ -9201,7 +9201,7 @@ class Xe {
9201
9201
  }
9202
9202
  constructor(t, e, s, i, n, r, o, l, h, c, u, d, f) {
9203
9203
  const g = this._signal = this.#t.signal;
9204
- this.#j = t, this.#V = e, this.#r = s, this._eventBus = i, i._on("editingaction", this.onEditingAction.bind(this), {
9204
+ this.#j = t, this.#W = e, this.#r = s, this._eventBus = i, i._on("editingaction", this.onEditingAction.bind(this), {
9205
9205
  signal: g
9206
9206
  }), i._on("pagechanging", this.onPageChanging.bind(this), {
9207
9207
  signal: g
@@ -9301,7 +9301,7 @@ class Xe {
9301
9301
  return null;
9302
9302
  }
9303
9303
  disableUserSelect(t = !1) {
9304
- this.#V.classList.toggle("noUserSelect", t);
9304
+ this.#W.classList.toggle("noUserSelect", t);
9305
9305
  }
9306
9306
  addShouldRescale(t) {
9307
9307
  this.#g.add(t);
@@ -9621,7 +9621,7 @@ class Xe {
9621
9621
  setEditingState(t) {
9622
9622
  t ? (this.#st(), this.#q(), this.#P({
9623
9623
  isEditing: this.#C !== Y.NONE,
9624
- isEmpty: this.#W(),
9624
+ isEmpty: this.#V(),
9625
9625
  hasSomethingToUndo: this.#a.hasSomethingToUndo(),
9626
9626
  hasSomethingToRedo: this.#a.hasSomethingToRedo(),
9627
9627
  hasSelectedEditor: !1
@@ -9826,27 +9826,27 @@ class Xe {
9826
9826
  this.#a.undo(), this.#P({
9827
9827
  hasSomethingToUndo: this.#a.hasSomethingToUndo(),
9828
9828
  hasSomethingToRedo: !0,
9829
- isEmpty: this.#W()
9829
+ isEmpty: this.#V()
9830
9830
  }), this._editorUndoBar?.hide();
9831
9831
  }
9832
9832
  redo() {
9833
9833
  this.#a.redo(), this.#P({
9834
9834
  hasSomethingToUndo: !0,
9835
9835
  hasSomethingToRedo: this.#a.hasSomethingToRedo(),
9836
- isEmpty: this.#W()
9836
+ isEmpty: this.#V()
9837
9837
  });
9838
9838
  }
9839
9839
  addCommands(t) {
9840
9840
  this.#a.add(t), this.#P({
9841
9841
  hasSomethingToUndo: !0,
9842
9842
  hasSomethingToRedo: !1,
9843
- isEmpty: this.#W()
9843
+ isEmpty: this.#V()
9844
9844
  });
9845
9845
  }
9846
9846
  cleanUndoStack(t) {
9847
9847
  this.#a.cleanType(t);
9848
9848
  }
9849
- #W() {
9849
+ #V() {
9850
9850
  if (this.#s.size === 0)
9851
9851
  return !0;
9852
9852
  if (this.#s.size === 1)
@@ -10255,7 +10255,7 @@ class _e {
10255
10255
  this.#e ? e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-decorative-tooltip") : (e.removeAttribute("data-l10n-id"), e.textContent = this.#t), e.parentNode || t.append(e), this.#c.getImageForAltText()?.setAttribute("aria-describedby", e.id);
10256
10256
  }
10257
10257
  }
10258
- class Vn {
10258
+ class Wn {
10259
10259
  #t;
10260
10260
  #e = !1;
10261
10261
  #s = null;
@@ -10324,7 +10324,7 @@ class Vn {
10324
10324
  touch1X: u,
10325
10325
  touch1Y: d
10326
10326
  } = l, f = u - h, g = d - c, p = r - i, b = o - n, m = Math.hypot(p, b) || 1, v = Math.hypot(f, g) || 1;
10327
- if (!this.#e && Math.abs(v - m) <= Vn.MIN_TOUCH_DISTANCE_TO_PINCH)
10327
+ if (!this.#e && Math.abs(v - m) <= Wn.MIN_TOUCH_DISTANCE_TO_PINCH)
10328
10328
  return;
10329
10329
  if (l.touch0X = i, l.touch0Y = n, l.touch1X = r, l.touch1Y = o, t.preventDefault(), !this.#e) {
10330
10330
  this.#e = !0;
@@ -10340,7 +10340,7 @@ class Vn {
10340
10340
  this.#h?.abort(), this.#h = null;
10341
10341
  }
10342
10342
  }
10343
- class W {
10343
+ class V {
10344
10344
  #t = null;
10345
10345
  #e = null;
10346
10346
  #s = null;
@@ -10372,13 +10372,13 @@ class W {
10372
10372
  static _l10n = null;
10373
10373
  static _l10nResizer = null;
10374
10374
  #A = !1;
10375
- #E = W._zIndex++;
10375
+ #E = V._zIndex++;
10376
10376
  static _borderLineWidth = -1;
10377
10377
  static _colorManager = new yo();
10378
10378
  static _zIndex = 1;
10379
10379
  static _telemetryTimeout = 1e3;
10380
10380
  static get _resizerKeyboardManager() {
10381
- const t = W.prototype._resizeWithKeyboard, e = Xe.TRANSLATE_SMALL, s = Xe.TRANSLATE_BIG;
10381
+ const t = V.prototype._resizeWithKeyboard, e = Xe.TRANSLATE_SMALL, s = Xe.TRANSLATE_BIG;
10382
10382
  return Q(this, "_resizerKeyboardManager", new xi([[["ArrowLeft", "mac+ArrowLeft"], t, {
10383
10383
  args: [-e, 0]
10384
10384
  }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t, {
@@ -10395,7 +10395,7 @@ class W {
10395
10395
  args: [0, e]
10396
10396
  }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t, {
10397
10397
  args: [0, s]
10398
- }], [["Escape", "mac+Escape"], W.prototype._stopResizingWithKeyboard]]));
10398
+ }], [["Escape", "mac+Escape"], V.prototype._stopResizingWithKeyboard]]));
10399
10399
  }
10400
10400
  constructor(t) {
10401
10401
  this.parent = t.parent, this.id = t.id, this.width = this.height = null, this.pageIndex = t.parent.pageIndex, this.name = t.name, this.div = null, this._uiManager = t.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = t.isCentered, this._structTreeParentId = null;
@@ -10430,7 +10430,7 @@ class W {
10430
10430
  e.annotationElementId = t.annotationElementId, e.deleted = !0, e._uiManager.addToAnnotationStorage(e);
10431
10431
  }
10432
10432
  static initialize(t, e) {
10433
- if (W._l10n ??= t, W._l10nResizer ||= Object.freeze({
10433
+ if (V._l10n ??= t, V._l10nResizer ||= Object.freeze({
10434
10434
  topLeft: "pdfjs-editor-resizer-top-left",
10435
10435
  topMiddle: "pdfjs-editor-resizer-top-middle",
10436
10436
  topRight: "pdfjs-editor-resizer-top-right",
@@ -10439,10 +10439,10 @@ class W {
10439
10439
  bottomMiddle: "pdfjs-editor-resizer-bottom-middle",
10440
10440
  bottomLeft: "pdfjs-editor-resizer-bottom-left",
10441
10441
  middleLeft: "pdfjs-editor-resizer-middle-left"
10442
- }), W._borderLineWidth !== -1)
10442
+ }), V._borderLineWidth !== -1)
10443
10443
  return;
10444
10444
  const s = getComputedStyle(document.documentElement);
10445
- W._borderLineWidth = parseFloat(s.getPropertyValue("--outline-width")) || 0;
10445
+ V._borderLineWidth = parseFloat(s.getPropertyValue("--outline-width")) || 0;
10446
10446
  }
10447
10447
  static updateDefaultParams(t, e) {
10448
10448
  }
@@ -10569,7 +10569,7 @@ class W {
10569
10569
  getBaseTranslation() {
10570
10570
  const [t, e] = this.parentDimensions, {
10571
10571
  _borderLineWidth: s
10572
- } = W, i = s / t, n = s / e;
10572
+ } = V, i = s / t, n = s / e;
10573
10573
  switch (this.rotation) {
10574
10574
  case 90:
10575
10575
  return [-i, n];
@@ -10629,10 +10629,10 @@ class W {
10629
10629
  }
10630
10630
  }
10631
10631
  screenToPageTranslation(t, e) {
10632
- return W.#x(t, e, this.parentRotation);
10632
+ return V.#x(t, e, this.parentRotation);
10633
10633
  }
10634
10634
  pageTranslationToScreen(t, e) {
10635
- return W.#x(t, e, 360 - this.parentRotation);
10635
+ return V.#x(t, e, 360 - this.parentRotation);
10636
10636
  }
10637
10637
  #k(t) {
10638
10638
  switch (t) {
@@ -10764,7 +10764,7 @@ class W {
10764
10764
  return Math.round(t * 1e4) / 1e4;
10765
10765
  }
10766
10766
  #C(t, e) {
10767
- const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, l = this.height, h = W.MIN_SIZE / s, c = W.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, D) => [u[0] * M + u[2] * D, u[1] * M + u[3] * D], f = this.#k(360 - this.rotation), g = (M, D) => [f[0] * M + f[2] * D, f[1] * M + f[3] * D];
10767
+ const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, l = this.height, h = V.MIN_SIZE / s, c = V.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, D) => [u[0] * M + u[2] * D, u[1] * M + u[3] * D], f = this.#k(360 - this.rotation), g = (M, D) => [f[0] * M + f[2] * D, f[1] * M + f[3] * D];
10768
10768
  let p, b, m = !1, v = !1;
10769
10769
  switch (t) {
10770
10770
  case "topLeft":
@@ -10794,7 +10794,7 @@ class W {
10794
10794
  }
10795
10795
  const _ = p(o, l), y = b(o, l);
10796
10796
  let w = d(...y);
10797
- const C = W._round(n + w[0]), A = W._round(r + w[1]);
10797
+ const C = V._round(n + w[0]), A = V._round(r + w[1]);
10798
10798
  let T = 1, k = 1, L, R;
10799
10799
  if (e.fromKeyboard)
10800
10800
  ({
@@ -10812,7 +10812,7 @@ class W {
10812
10812
  const M = Math.hypot(o, l);
10813
10813
  T = k = Math.max(Math.min(Math.hypot(y[0] - _[0] - L, y[1] - _[1] - R) / M, 1 / o, 1 / l), h / o, c / l);
10814
10814
  } else v ? T = Math.max(h, Math.min(1, Math.abs(y[0] - _[0] - L))) / o : k = Math.max(c, Math.min(1, Math.abs(y[1] - _[1] - R))) / l;
10815
- const F = W._round(o * T), P = W._round(l * k);
10815
+ const F = V._round(o * T), P = V._round(l * k);
10816
10816
  w = d(...b(F, P));
10817
10817
  const O = C - w[0], $ = A - w[1];
10818
10818
  this.#o ||= [this.x, this.y, this.width, this.height], this.width = F, this.height = P, this.x = O, this.y = $, this.setDims(s * F, i * P), this.fixAndSetPosition(), this._onResizing();
@@ -10836,7 +10836,7 @@ class W {
10836
10836
  return this.div.getBoundingClientRect();
10837
10837
  }
10838
10838
  async addAltTextButton() {
10839
- this.#s || (_e.initialize(W._l10n), this.#s = new _e(this), this.#t && (this.#s.data = this.#t, this.#t = null), await this.addEditToolbar());
10839
+ this.#s || (_e.initialize(V._l10n), this.#s = new _e(this), this.#t && (this.#s.data = this.#t, this.#t = null), await this.addEditToolbar());
10840
10840
  }
10841
10841
  get altTextData() {
10842
10842
  return this.#s?.data;
@@ -10864,7 +10864,7 @@ class W {
10864
10864
  const [t, e] = this.parentDimensions;
10865
10865
  this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * e / t).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * t / e).toFixed(2)}%`);
10866
10866
  const [s, i] = this.getInitialTranslation();
10867
- return this.translate(s, i), Sn(this, this.div, ["pointerdown"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#S ||= new Vn({
10867
+ return this.translate(s, i), Sn(this, this.div, ["pointerdown"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#S ||= new Wn({
10868
10868
  container: this.div,
10869
10869
  isPinchingDisabled: () => !this.isSelected,
10870
10870
  onPinchStart: this.#y.bind(this),
@@ -10885,13 +10885,13 @@ class W {
10885
10885
  let n = 0.7 * (s / e) + 1 - 0.7;
10886
10886
  if (n === 1)
10887
10887
  return;
10888
- const r = this.#k(this.rotation), o = (C, A) => [r[0] * C + r[2] * A, r[1] * C + r[3] * A], [l, h] = this.parentDimensions, c = this.x, u = this.y, d = this.width, f = this.height, g = W.MIN_SIZE / l, p = W.MIN_SIZE / h;
10888
+ const r = this.#k(this.rotation), o = (C, A) => [r[0] * C + r[2] * A, r[1] * C + r[3] * A], [l, h] = this.parentDimensions, c = this.x, u = this.y, d = this.width, f = this.height, g = V.MIN_SIZE / l, p = V.MIN_SIZE / h;
10889
10889
  n = Math.max(Math.min(n, 1 / d, 1 / f), g / d, p / f);
10890
- const b = W._round(d * n), m = W._round(f * n);
10890
+ const b = V._round(d * n), m = V._round(f * n);
10891
10891
  if (b === d && m === f)
10892
10892
  return;
10893
10893
  this.#o ||= [c, u, d, f];
10894
- const v = o(d / 2, f / 2), _ = W._round(c + v[0]), y = W._round(u + v[1]), w = o(b / 2, m / 2);
10894
+ const v = o(d / 2, f / 2), _ = V._round(c + v[0]), y = V._round(u + v[1]), w = o(b / 2, m / 2);
10895
10895
  this.x = _ - w[0], this.y = y - w[1], this.width = b, this.height = m, this.setDims(l * b, h * m), this.fixAndSetPosition(), this._onResizing();
10896
10896
  }
10897
10897
  #H() {
@@ -11114,9 +11114,9 @@ class W {
11114
11114
  signal: l
11115
11115
  }), h.addEventListener("blur", o, {
11116
11116
  signal: l
11117
- }), h.addEventListener("focus", this.#V.bind(this, c), {
11117
+ }), h.addEventListener("focus", this.#W.bind(this, c), {
11118
11118
  signal: l
11119
- }), h.setAttribute("data-l10n-id", W._l10nResizer[c]);
11119
+ }), h.setAttribute("data-l10n-id", V._l10nResizer[c]);
11120
11120
  }
11121
11121
  }
11122
11122
  const s = this.#e[0];
@@ -11137,7 +11137,7 @@ class W {
11137
11137
  let r = 0;
11138
11138
  for (const o of e) {
11139
11139
  const h = this.#e[r++].getAttribute("data-resizer-name");
11140
- o.setAttribute("data-l10n-id", W._l10nResizer[h]);
11140
+ o.setAttribute("data-l10n-id", V._l10nResizer[h]);
11141
11141
  }
11142
11142
  }
11143
11143
  this.#D(0), this.#p = !0, this.#a.firstChild.focus({
@@ -11145,12 +11145,12 @@ class W {
11145
11145
  }), t.preventDefault(), t.stopImmediatePropagation();
11146
11146
  }
11147
11147
  #F(t) {
11148
- W._resizerKeyboardManager.exec(this, t);
11148
+ V._resizerKeyboardManager.exec(this, t);
11149
11149
  }
11150
11150
  #j(t) {
11151
11151
  this.#p && t.relatedTarget?.parentNode !== this.#a && this.#B();
11152
11152
  }
11153
- #V(t) {
11153
+ #W(t) {
11154
11154
  this.#u = this.#p ? t : "";
11155
11155
  }
11156
11156
  #D(t) {
@@ -11235,7 +11235,7 @@ class W {
11235
11235
  let i = this.#w.get(s);
11236
11236
  i && clearTimeout(i), i = setTimeout(() => {
11237
11237
  this._reportTelemetry(t), this.#w.delete(s), this.#w.size === 0 && (this.#w = null);
11238
- }, W._telemetryTimeout), this.#w.set(s, i);
11238
+ }, V._telemetryTimeout), this.#w.set(s, i);
11239
11239
  return;
11240
11240
  }
11241
11241
  t.type ||= this.editorType, this._uiManager._eventBus.dispatch("reporttelemetry", {
@@ -11272,7 +11272,7 @@ class W {
11272
11272
  e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
11273
11273
  }
11274
11274
  }
11275
- class Cd extends W {
11275
+ class Cd extends V {
11276
11276
  constructor(t) {
11277
11277
  super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
11278
11278
  }
@@ -11339,7 +11339,7 @@ class _o {
11339
11339
  remove(t) {
11340
11340
  if (this.#s.delete(t), this.#s.size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
11341
11341
  for (const e of this.#s.values())
11342
- if (e instanceof W)
11342
+ if (e instanceof V)
11343
11343
  return;
11344
11344
  this.onAnnotationEditor(null);
11345
11345
  }
@@ -11352,7 +11352,7 @@ class _o {
11352
11352
  s[n] !== r && (i = !0, s[n] = r);
11353
11353
  else
11354
11354
  i = !0, this.#s.set(t, e);
11355
- i && this.#i(), e instanceof W && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(e.constructor._type);
11355
+ i && this.#i(), e instanceof V && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(e.constructor._type);
11356
11356
  }
11357
11357
  has(t) {
11358
11358
  return this.#s.has(t);
@@ -11382,7 +11382,7 @@ class _o {
11382
11382
  const t = /* @__PURE__ */ new Map(), e = new hh(), s = [], i = /* @__PURE__ */ Object.create(null);
11383
11383
  let n = !1;
11384
11384
  for (const [r, o] of this.#s) {
11385
- const l = o instanceof W ? o.serialize(!1, i) : o;
11385
+ const l = o instanceof V ? o.serialize(!1, i) : o;
11386
11386
  l && (t.set(r, l), e.update(`${r}:${JSON.stringify(l)}`), n ||= !!l.bitmap);
11387
11387
  }
11388
11388
  if (n)
@@ -11398,7 +11398,7 @@ class _o {
11398
11398
  let t = null;
11399
11399
  const e = /* @__PURE__ */ new Map();
11400
11400
  for (const s of this.#s.values()) {
11401
- if (!(s instanceof W))
11401
+ if (!(s instanceof V))
11402
11402
  continue;
11403
11403
  const i = s.telemetryFinalData;
11404
11404
  if (!i)
@@ -11429,7 +11429,7 @@ class _o {
11429
11429
  return this.#e;
11430
11430
  const t = [];
11431
11431
  for (const e of this.#s.values())
11432
- !(e instanceof W) || !e.annotationElementId || !e.serialize() || t.push(e.annotationElementId);
11432
+ !(e instanceof V) || !e.annotationElementId || !e.serialize() || t.push(e.annotationElementId);
11433
11433
  return this.#e = {
11434
11434
  ids: new Set(t),
11435
11435
  hash: t.join(",")
@@ -11682,11 +11682,11 @@ const Ki = {
11682
11682
  function Aa() {
11683
11683
  }
11684
11684
  function Gt(a) {
11685
- if (a instanceof We || a instanceof Lr || a instanceof gi || a instanceof wa || a instanceof xn || a instanceof dr)
11685
+ if (a instanceof Ve || a instanceof Lr || a instanceof gi || a instanceof wa || a instanceof xn || a instanceof dr)
11686
11686
  return a;
11687
11687
  switch (a instanceof Error || typeof a == "object" && a !== null || rt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), a.name) {
11688
11688
  case "AbortException":
11689
- return new We(a.message);
11689
+ return new Ve(a.message);
11690
11690
  case "InvalidPDFException":
11691
11691
  return new Lr(a.message);
11692
11692
  case "MissingPDFException":
@@ -12557,7 +12557,7 @@ function jd({
12557
12557
  destPos: f
12558
12558
  };
12559
12559
  }
12560
- const Ea = 16, ka = 100, Bd = 15, Ma = 10, Pa = 1e3, Vt = 16;
12560
+ const Ea = 16, ka = 100, Bd = 15, Ma = 10, Pa = 1e3, Wt = 16;
12561
12561
  function $d(a, t) {
12562
12562
  if (a._removeMirroring)
12563
12563
  throw new Error("Context is already forwarding operations.");
@@ -12736,14 +12736,14 @@ function Da(a, t) {
12736
12736
  a.putImageData(t, 0, 0);
12737
12737
  return;
12738
12738
  }
12739
- const e = t.height, s = t.width, i = e % Vt, n = (e - i) / Vt, r = i === 0 ? n : n + 1, o = a.createImageData(s, Vt);
12739
+ const e = t.height, s = t.width, i = e % Wt, n = (e - i) / Wt, r = i === 0 ? n : n + 1, o = a.createImageData(s, Wt);
12740
12740
  let l = 0, h;
12741
12741
  const c = t.data, u = o.data;
12742
12742
  let d, f, g, p;
12743
12743
  if (t.kind === rn.GRAYSCALE_1BPP) {
12744
12744
  const b = c.byteLength, m = new Uint32Array(u.buffer, 0, u.byteLength >> 2), v = m.length, _ = s + 7 >> 3, y = 4294967295, w = jt.isLittleEndian ? 4278190080 : 255;
12745
12745
  for (d = 0; d < r; d++) {
12746
- for (g = d < n ? Vt : i, h = 0, f = 0; f < g; f++) {
12746
+ for (g = d < n ? Wt : i, h = 0, f = 0; f < g; f++) {
12747
12747
  const C = b - l;
12748
12748
  let A = 0;
12749
12749
  const T = C > _ ? s : C * 8 - 7, k = T & -8;
@@ -12755,17 +12755,17 @@ function Da(a, t) {
12755
12755
  }
12756
12756
  for (; h < v; )
12757
12757
  m[h++] = 0;
12758
- a.putImageData(o, 0, d * Vt);
12758
+ a.putImageData(o, 0, d * Wt);
12759
12759
  }
12760
12760
  } else if (t.kind === rn.RGBA_32BPP) {
12761
- for (f = 0, p = s * Vt * 4, d = 0; d < n; d++)
12762
- u.set(c.subarray(l, l + p)), l += p, a.putImageData(o, 0, f), f += Vt;
12761
+ for (f = 0, p = s * Wt * 4, d = 0; d < n; d++)
12762
+ u.set(c.subarray(l, l + p)), l += p, a.putImageData(o, 0, f), f += Wt;
12763
12763
  d < r && (p = s * i * 4, u.set(c.subarray(l, l + p)), a.putImageData(o, 0, f));
12764
12764
  } else if (t.kind === rn.RGB_24BPP)
12765
- for (g = Vt, p = s * g, d = 0; d < r; d++) {
12765
+ for (g = Wt, p = s * g, d = 0; d < r; d++) {
12766
12766
  for (d >= n && (g = i, p = s * g), h = 0, f = p; f--; )
12767
12767
  u[h++] = c[l++], u[h++] = c[l++], u[h++] = c[l++], u[h++] = 255;
12768
- a.putImageData(o, 0, d * Vt);
12768
+ a.putImageData(o, 0, d * Wt);
12769
12769
  }
12770
12770
  else
12771
12771
  throw new Error(`bad image kind: ${t.kind}`);
@@ -12775,11 +12775,11 @@ function Ra(a, t) {
12775
12775
  a.drawImage(t.bitmap, 0, 0);
12776
12776
  return;
12777
12777
  }
12778
- const e = t.height, s = t.width, i = e % Vt, n = (e - i) / Vt, r = i === 0 ? n : n + 1, o = a.createImageData(s, Vt);
12778
+ const e = t.height, s = t.width, i = e % Wt, n = (e - i) / Wt, r = i === 0 ? n : n + 1, o = a.createImageData(s, Wt);
12779
12779
  let l = 0;
12780
12780
  const h = t.data, c = o.data;
12781
12781
  for (let u = 0; u < r; u++) {
12782
- const d = u < n ? Vt : i;
12782
+ const d = u < n ? Wt : i;
12783
12783
  ({
12784
12784
  srcPos: l
12785
12785
  } = jd({
@@ -12789,7 +12789,7 @@ function Ra(a, t) {
12789
12789
  width: s,
12790
12790
  height: d,
12791
12791
  nonBlackColor: 0
12792
- })), a.putImageData(o, 0, u * Vt);
12792
+ })), a.putImageData(o, 0, u * Wt);
12793
12793
  }
12794
12794
  }
12795
12795
  function Us(a, t) {
@@ -12814,7 +12814,7 @@ function La(a, t) {
12814
12814
  const s = Math.fround((globalThis.devicePixelRatio || 1) * Ls.PDF_TO_CSS_UNITS);
12815
12815
  return e[0] <= s && e[1] <= s;
12816
12816
  }
12817
- const Gd = ["butt", "round", "square"], Vd = ["miter", "round", "bevel"], Wd = {}, Fa = {};
12817
+ const Gd = ["butt", "round", "square"], Wd = ["miter", "round", "bevel"], Vd = {}, Fa = {};
12818
12818
  class Es {
12819
12819
  constructor(t, e, s, i, n, {
12820
12820
  optionalContentConfig: r,
@@ -12943,7 +12943,7 @@ class Es {
12943
12943
  this.ctx.lineCap = Gd[t];
12944
12944
  }
12945
12945
  setLineJoin(t) {
12946
- this.ctx.lineJoin = Vd[t];
12946
+ this.ctx.lineJoin = Wd[t];
12947
12947
  }
12948
12948
  setMiterLimit(t) {
12949
12949
  this.ctx.miterLimit = t;
@@ -13127,7 +13127,7 @@ class Es {
13127
13127
  this.consumePath();
13128
13128
  }
13129
13129
  clip() {
13130
- this.pendingClip = Wd;
13130
+ this.pendingClip = Vd;
13131
13131
  }
13132
13132
  eoClip() {
13133
13133
  this.pendingClip = Fa;
@@ -14224,7 +14224,7 @@ function vh(a, t) {
14224
14224
  }
14225
14225
  return e;
14226
14226
  }
14227
- function Wn(a) {
14227
+ function Vn(a) {
14228
14228
  try {
14229
14229
  return new URL(a).origin;
14230
14230
  } catch {
@@ -14306,7 +14306,7 @@ class Zd {
14306
14306
  this._withCredentials = e.withCredentials || !1, this._contentLength = e.length, this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange;
14307
14307
  const s = new Headers(t.headers), i = e.url;
14308
14308
  fetch(i, xh(s, this._withCredentials, this._abortController)).then((n) => {
14309
- if (t._responseOrigin = Wn(n.url), !wh(n.status))
14309
+ if (t._responseOrigin = Vn(n.url), !wh(n.status))
14310
14310
  throw Xn(n.status, i);
14311
14311
  this._reader = n.body.getReader(), this._headersCapability.resolve();
14312
14312
  const r = n.headers, {
@@ -14318,7 +14318,7 @@ class Zd {
14318
14318
  rangeChunkSize: this._rangeChunkSize,
14319
14319
  disableRange: this._disableRange
14320
14320
  });
14321
- this._isRangeSupported = o, this._contentLength = l || this._contentLength, this._filename = _h(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new We("Streaming is disabled."));
14321
+ this._isRangeSupported = o, this._contentLength = l || this._contentLength, this._filename = _h(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Ve("Streaming is disabled."));
14322
14322
  }).catch(this._headersCapability.reject), this.onProgress = null;
14323
14323
  }
14324
14324
  get headersReady() {
@@ -14366,7 +14366,7 @@ class tf {
14366
14366
  n.append("Range", `bytes=${e}-${s - 1}`);
14367
14367
  const r = i.url;
14368
14368
  fetch(r, xh(n, this._withCredentials, this._abortController)).then((o) => {
14369
- const l = Wn(o.url);
14369
+ const l = Vn(o.url);
14370
14370
  if (l !== t._responseOrigin)
14371
14371
  throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);
14372
14372
  if (!wh(o.status))
@@ -14497,7 +14497,7 @@ class rf {
14497
14497
  }
14498
14498
  _onHeadersReceived() {
14499
14499
  const t = this._fullRequestId, e = this._manager.getRequestXhr(t);
14500
- this._manager._responseOrigin = Wn(e.responseURL);
14500
+ this._manager._responseOrigin = Vn(e.responseURL);
14501
14501
  const s = e.getAllResponseHeaders(), i = new Headers(s ? s.trimStart().replace(/[^\S ]+$/, "").split(/[\r\n]+/).map((o) => {
14502
14502
  const [l, ...h] = o.split(": ");
14503
14503
  return [l, h.join(": ")];
@@ -14590,7 +14590,7 @@ class of {
14590
14590
  }), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
14591
14591
  }
14592
14592
  _onHeadersReceived() {
14593
- const t = Wn(this._manager.getRequestXhr(this._requestId)?.responseURL);
14593
+ const t = Vn(this._manager.getRequestXhr(this._requestId)?.responseURL);
14594
14594
  t !== this._manager._responseOrigin && (this._storedError = new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`), this._onError(0));
14595
14595
  }
14596
14596
  _close() {
@@ -14741,7 +14741,7 @@ class cf {
14741
14741
  t.destroy(), this._done = !0, this._readCapability.resolve();
14742
14742
  }), t.on("error", (e) => {
14743
14743
  this._error(e);
14744
- }), !this._isStreamingSupported && this._isRangeSupported && this._error(new We("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
14744
+ }), !this._isStreamingSupported && this._isRangeSupported && this._error(new Ve("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
14745
14745
  }
14746
14746
  }
14747
14747
  class uf {
@@ -14891,7 +14891,7 @@ class Dt {
14891
14891
  }
14892
14892
  }
14893
14893
  cancel() {
14894
- const t = new We("TextLayer task cancelled.");
14894
+ const t = new Ve("TextLayer task cancelled.");
14895
14895
  this.#c?.cancel(t).catch(() => {
14896
14896
  }), this.#c = null, this.#t.reject(t);
14897
14897
  }
@@ -15691,7 +15691,7 @@ class Af {
15691
15691
  return;
15692
15692
  }
15693
15693
  }
15694
- if (t.streamReader.cancel(new We(e.message)).catch(() => {
15694
+ if (t.streamReader.cancel(new Ve(e.message)).catch(() => {
15695
15695
  }), t.streamReader = null, !this._transport.destroyed) {
15696
15696
  for (const [i, n] of this._intentStates)
15697
15697
  if (n === t) {
@@ -15961,7 +15961,7 @@ class Ef {
15961
15961
  this.#e.clear(), this.#s.clear(), this.#i.clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
15962
15962
  const e = this.messageHandler.sendWithPromise("Terminate", null);
15963
15963
  return t.push(e), Promise.all(t).then(() => {
15964
- this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(), Dt.cleanup(), this._networkStream?.cancelAllRequests(new We("Worker was terminated.")), this.messageHandler?.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
15964
+ this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(), Dt.cleanup(), this._networkStream?.cancelAllRequests(new Ve("Worker was terminated.")), this.messageHandler?.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
15965
15965
  }, this.destroyCapability.reject), this.destroyCapability.promise;
15966
15966
  }
15967
15967
  setupMessageHandler() {
@@ -16693,11 +16693,11 @@ class Rf {
16693
16693
  case _t.POLYLINE:
16694
16694
  return new Ph(t);
16695
16695
  case _t.CARET:
16696
- return new Wf(t);
16696
+ return new Vf(t);
16697
16697
  case _t.INK:
16698
16698
  return new Ao(t);
16699
16699
  case _t.POLYGON:
16700
- return new Vf(t);
16700
+ return new Wf(t);
16701
16701
  case _t.HIGHLIGHT:
16702
16702
  return new Oh(t);
16703
16703
  case _t.UNDERLINE:
@@ -18108,12 +18108,12 @@ class Ph extends mt {
18108
18108
  this.container.classList.add("highlightArea");
18109
18109
  }
18110
18110
  }
18111
- class Vf extends Ph {
18111
+ class Wf extends Ph {
18112
18112
  constructor(t) {
18113
18113
  super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
18114
18114
  }
18115
18115
  }
18116
- class Wf extends mt {
18116
+ class Vf extends mt {
18117
18117
  constructor(t) {
18118
18118
  super(t, {
18119
18119
  isRenderable: !0,
@@ -18415,7 +18415,7 @@ class Kf {
18415
18415
  }
18416
18416
  }
18417
18417
  const Zi = /\r\n?|\n/g;
18418
- class wt extends W {
18418
+ class wt extends V {
18419
18419
  #t;
18420
18420
  #e = "";
18421
18421
  #s = `${this.id}-editor`;
@@ -18461,10 +18461,10 @@ class wt extends W {
18461
18461
  super({
18462
18462
  ...t,
18463
18463
  name: "freeTextEditor"
18464
- }), this.#t = t.color || wt._defaultColor || W._defaultLineColor, this.#r = t.fontSize || wt._defaultFontSize;
18464
+ }), this.#t = t.color || wt._defaultColor || V._defaultLineColor, this.#r = t.fontSize || wt._defaultFontSize;
18465
18465
  }
18466
18466
  static initialize(t, e) {
18467
- W.initialize(t, e);
18467
+ V.initialize(t, e);
18468
18468
  const s = getComputedStyle(document.documentElement);
18469
18469
  this._internalPadding = parseFloat(s.getPropertyValue("--freetext-padding"));
18470
18470
  }
@@ -18489,7 +18489,7 @@ class wt extends W {
18489
18489
  }
18490
18490
  }
18491
18491
  static get defaultPropertiesToUpdate() {
18492
- return [[Z.FREETEXT_SIZE, wt._defaultFontSize], [Z.FREETEXT_COLOR, wt._defaultColor || W._defaultLineColor]];
18492
+ return [[Z.FREETEXT_SIZE, wt._defaultFontSize], [Z.FREETEXT_COLOR, wt._defaultColor || V._defaultLineColor]];
18493
18493
  }
18494
18494
  get propertiesToUpdate() {
18495
18495
  return [[Z.FREETEXT_SIZE, this.#r], [Z.FREETEXT_COLOR, this.#t]];
@@ -18811,7 +18811,7 @@ class wt extends W {
18811
18811
  return null;
18812
18812
  if (this.deleted)
18813
18813
  return this.serializeDeleted();
18814
- const e = wt._internalPadding * this.parentScale, s = this.getRect(e, e), i = W._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#t), n = {
18814
+ const e = wt._internalPadding * this.parentScale, s = this.getRect(e, e), i = V._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#t), n = {
18815
18815
  annotationType: Y.FREETEXT,
18816
18816
  color: i,
18817
18817
  fontSize: this.#r,
@@ -19440,7 +19440,7 @@ class ie {
19440
19440
  this.#t?.remove(), this.#t = null, this.#e = null, this.#i?.remove(), this.#i = null;
19441
19441
  }
19442
19442
  }
19443
- class ft extends W {
19443
+ class ft extends V {
19444
19444
  #t = null;
19445
19445
  #e = 0;
19446
19446
  #s;
@@ -19577,7 +19577,7 @@ class ft extends W {
19577
19577
  this.#f = [(h[0] - n) / o, (h[1] - r) / l];
19578
19578
  }
19579
19579
  static initialize(t, e) {
19580
- W.initialize(t, e), ft._defaultColor ||= e.highlightColors?.values().next().value || "#fff066";
19580
+ V.initialize(t, e), ft._defaultColor ||= e.highlightColors?.values().next().value || "#fff066";
19581
19581
  }
19582
19582
  static updateDefaultParams(t, e) {
19583
19583
  switch (t) {
@@ -20036,7 +20036,7 @@ class ft extends W {
20036
20036
  return null;
20037
20037
  if (this.deleted)
20038
20038
  return this.serializeDeleted();
20039
- const e = this.getRect(0, 0), s = W._colorManager.convert(this.color), i = {
20039
+ const e = this.getRect(0, 0), s = V._colorManager.convert(this.color), i = {
20040
20040
  annotationType: Y.HIGHLIGHT,
20041
20041
  color: s,
20042
20042
  opacity: this.#o,
@@ -20094,7 +20094,7 @@ class Zf {
20094
20094
  rt("Not implemented");
20095
20095
  }
20096
20096
  }
20097
- class V extends W {
20097
+ class W extends V {
20098
20098
  #t = null;
20099
20099
  #e;
20100
20100
  _drawId = null;
@@ -20121,7 +20121,7 @@ class V extends W {
20121
20121
  #d(t, e) {
20122
20122
  const {
20123
20123
  id: s
20124
- } = e.drawLayer.draw(V._mergeSVGProperties(this._drawingOptions.toSVGProperties(), t.defaultSVGProperties), !1, !1);
20124
+ } = e.drawLayer.draw(W._mergeSVGProperties(this._drawingOptions.toSVGProperties(), t.defaultSVGProperties), !1, !1);
20125
20125
  return s;
20126
20126
  }
20127
20127
  static _mergeSVGProperties(t, e) {
@@ -20144,7 +20144,7 @@ class V extends W {
20144
20144
  }
20145
20145
  static updateDefaultParams(t, e) {
20146
20146
  const s = this.typesMap.get(t);
20147
- s && this._defaultDrawingOptions.updateProperty(s, e), this._currentParent && (V.#s.updateProperty(s, e), this._currentParent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
20147
+ s && this._defaultDrawingOptions.updateProperty(s, e), this._currentParent && (W.#s.updateProperty(s, e), this._currentParent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
20148
20148
  }
20149
20149
  updateParams(t, e) {
20150
20150
  const s = this.constructor.typesMap.get(t);
@@ -20181,12 +20181,12 @@ class V extends W {
20181
20181
  });
20182
20182
  }
20183
20183
  _onResizing() {
20184
- this.parent?.drawLayer.updateProperties(this._drawId, V._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#g()), {
20184
+ this.parent?.drawLayer.updateProperties(this._drawId, W._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#g()), {
20185
20185
  bbox: this.#p()
20186
20186
  }));
20187
20187
  }
20188
20188
  _onResized() {
20189
- this.parent?.drawLayer.updateProperties(this._drawId, V._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#g()), {
20189
+ this.parent?.drawLayer.updateProperties(this._drawId, W._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#g()), {
20190
20190
  bbox: this.#p()
20191
20191
  }));
20192
20192
  }
@@ -20196,7 +20196,7 @@ class V extends W {
20196
20196
  });
20197
20197
  }
20198
20198
  _onTranslated() {
20199
- this.parent?.drawLayer.updateProperties(this._drawId, V._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#g(), this.parentDimensions), {
20199
+ this.parent?.drawLayer.updateProperties(this._drawId, W._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#g(), this.parentDimensions), {
20200
20200
  bbox: this.#p()
20201
20201
  }));
20202
20202
  }
@@ -20344,7 +20344,7 @@ class V extends W {
20344
20344
  }
20345
20345
  }
20346
20346
  rotate() {
20347
- this.parent && this.parent.drawLayer.updateProperties(this._drawId, V._mergeSVGProperties({
20347
+ this.parent && this.parent.drawLayer.updateProperties(this._drawId, W._mergeSVGProperties({
20348
20348
  bbox: this.#p()
20349
20349
  }, this.#t.updateRotation((this.parentRotation - this.rotation + 360) % 360)));
20350
20350
  }
@@ -20374,7 +20374,7 @@ class V extends W {
20374
20374
  pointerId: l,
20375
20375
  pointerType: h
20376
20376
  } = i;
20377
- if (V.#l && V.#l !== h)
20377
+ if (W.#l && W.#l !== h)
20378
20378
  return;
20379
20379
  const {
20380
20380
  viewport: {
@@ -20383,17 +20383,17 @@ class V extends W {
20383
20383
  } = t, {
20384
20384
  width: u,
20385
20385
  height: d
20386
- } = n.getBoundingClientRect(), f = V.#i = new AbortController(), g = t.combinedSignal(f);
20387
- if (V.#n ||= l, V.#l ??= h, window.addEventListener("pointerup", (p) => {
20388
- V.#n === p.pointerId ? this._endDraw(p) : V.#a?.delete(p.pointerId);
20386
+ } = n.getBoundingClientRect(), f = W.#i = new AbortController(), g = t.combinedSignal(f);
20387
+ if (W.#n ||= l, W.#l ??= h, window.addEventListener("pointerup", (p) => {
20388
+ W.#n === p.pointerId ? this._endDraw(p) : W.#a?.delete(p.pointerId);
20389
20389
  }, {
20390
20390
  signal: g
20391
20391
  }), window.addEventListener("pointercancel", (p) => {
20392
- V.#n === p.pointerId ? this._currentParent.endDrawingSession() : V.#a?.delete(p.pointerId);
20392
+ W.#n === p.pointerId ? this._currentParent.endDrawingSession() : W.#a?.delete(p.pointerId);
20393
20393
  }, {
20394
20394
  signal: g
20395
20395
  }), window.addEventListener("pointerdown", (p) => {
20396
- V.#l === p.pointerType && ((V.#a ||= /* @__PURE__ */ new Set()).add(p.pointerId), V.#s.isCancellable() && (V.#s.removeLastElement(), V.#s.isEmpty() ? this._currentParent.endDrawingSession(!0) : this._endDraw(null)));
20396
+ W.#l === p.pointerType && ((W.#a ||= /* @__PURE__ */ new Set()).add(p.pointerId), W.#s.isCancellable() && (W.#s.removeLastElement(), W.#s.isEmpty() ? this._currentParent.endDrawingSession(!0) : this._endDraw(null)));
20397
20397
  }, {
20398
20398
  capture: !0,
20399
20399
  passive: !1,
@@ -20403,41 +20403,41 @@ class V extends W {
20403
20403
  }), n.addEventListener("pointermove", this._drawMove.bind(this), {
20404
20404
  signal: g
20405
20405
  }), n.addEventListener("touchmove", (p) => {
20406
- p.timeStamp === V.#c && Qt(p);
20406
+ p.timeStamp === W.#c && Qt(p);
20407
20407
  }, {
20408
20408
  signal: g
20409
- }), t.toggleDrawing(), e._editorUndoBar?.hide(), V.#s) {
20410
- t.drawLayer.updateProperties(this._currentDrawId, V.#s.startNew(r, o, u, d, c));
20409
+ }), t.toggleDrawing(), e._editorUndoBar?.hide(), W.#s) {
20410
+ t.drawLayer.updateProperties(this._currentDrawId, W.#s.startNew(r, o, u, d, c));
20411
20411
  return;
20412
20412
  }
20413
- e.updateUIForDefaultProperties(this), V.#s = this.createDrawerInstance(r, o, u, d, c), V.#r = this.getDefaultDrawingOptions(), this._currentParent = t, {
20413
+ e.updateUIForDefaultProperties(this), W.#s = this.createDrawerInstance(r, o, u, d, c), W.#r = this.getDefaultDrawingOptions(), this._currentParent = t, {
20414
20414
  id: this._currentDrawId
20415
- } = t.drawLayer.draw(this._mergeSVGProperties(V.#r.toSVGProperties(), V.#s.defaultSVGProperties), !0, !1);
20415
+ } = t.drawLayer.draw(this._mergeSVGProperties(W.#r.toSVGProperties(), W.#s.defaultSVGProperties), !0, !1);
20416
20416
  }
20417
20417
  static _drawMove(t) {
20418
- if (V.#c = -1, !V.#s)
20418
+ if (W.#c = -1, !W.#s)
20419
20419
  return;
20420
20420
  const {
20421
20421
  offsetX: e,
20422
20422
  offsetY: s,
20423
20423
  pointerId: i
20424
20424
  } = t;
20425
- if (V.#n === i) {
20426
- if (V.#a?.size >= 1) {
20425
+ if (W.#n === i) {
20426
+ if (W.#a?.size >= 1) {
20427
20427
  this._endDraw(t);
20428
20428
  return;
20429
20429
  }
20430
- this._currentParent.drawLayer.updateProperties(this._currentDrawId, V.#s.add(e, s)), V.#c = t.timeStamp, Qt(t);
20430
+ this._currentParent.drawLayer.updateProperties(this._currentDrawId, W.#s.add(e, s)), W.#c = t.timeStamp, Qt(t);
20431
20431
  }
20432
20432
  }
20433
20433
  static _cleanup(t) {
20434
- t && (this._currentDrawId = -1, this._currentParent = null, V.#s = null, V.#r = null, V.#l = null, V.#c = NaN), V.#i && (V.#i.abort(), V.#i = null, V.#n = NaN, V.#a = null);
20434
+ t && (this._currentDrawId = -1, this._currentParent = null, W.#s = null, W.#r = null, W.#l = null, W.#c = NaN), W.#i && (W.#i.abort(), W.#i = null, W.#n = NaN, W.#a = null);
20435
20435
  }
20436
20436
  static _endDraw(t) {
20437
20437
  const e = this._currentParent;
20438
20438
  if (e) {
20439
- if (e.toggleDrawing(!0), this._cleanup(!1), t && e.drawLayer.updateProperties(this._currentDrawId, V.#s.end(t.offsetX, t.offsetY)), this.supportMultipleDrawings) {
20440
- const s = V.#s, i = this._currentDrawId, n = s.getLastElement();
20439
+ if (e.toggleDrawing(!0), this._cleanup(!1), t && e.drawLayer.updateProperties(this._currentDrawId, W.#s.end(t.offsetX, t.offsetY)), this.supportMultipleDrawings) {
20440
+ const s = W.#s, i = this._currentDrawId, n = s.getLastElement();
20441
20441
  e.addCommands({
20442
20442
  cmd: () => {
20443
20443
  e.drawLayer.updateProperties(i, s.setLastElement(n));
@@ -20457,7 +20457,7 @@ class V extends W {
20457
20457
  const e = this._currentParent;
20458
20458
  if (!e)
20459
20459
  return null;
20460
- if (e.toggleDrawing(!0), e.cleanUndoStack(Z.DRAW_STEP), !V.#s.isEmpty()) {
20460
+ if (e.toggleDrawing(!0), e.cleanUndoStack(Z.DRAW_STEP), !W.#s.isEmpty()) {
20461
20461
  const {
20462
20462
  pageDimensions: [s, i],
20463
20463
  scale: n
@@ -20466,8 +20466,8 @@ class V extends W {
20466
20466
  offsetY: 0
20467
20467
  }, !1, {
20468
20468
  drawId: this._currentDrawId,
20469
- drawOutlines: V.#s.getOutlines(s * n, i * n, n, this._INNER_MARGIN),
20470
- drawingOptions: V.#r,
20469
+ drawOutlines: W.#s.getOutlines(s * n, i * n, n, this._INNER_MARGIN),
20470
+ drawingOptions: W.#r,
20471
20471
  mustBeCommitted: !t
20472
20472
  });
20473
20473
  return this._cleanup(!0), r;
@@ -20954,7 +20954,7 @@ class To extends Zf {
20954
20954
  constructor(t) {
20955
20955
  super(), this.#t = t, super.updateProperties({
20956
20956
  fill: "none",
20957
- stroke: W._defaultLineColor,
20957
+ stroke: V._defaultLineColor,
20958
20958
  "stroke-opacity": 1,
20959
20959
  "stroke-width": 1,
20960
20960
  "stroke-linecap": "round",
@@ -20970,7 +20970,7 @@ class To extends Zf {
20970
20970
  return t.updateAll(this), t;
20971
20971
  }
20972
20972
  }
20973
- class Eo extends V {
20973
+ class Eo extends W {
20974
20974
  static _type = "ink";
20975
20975
  static _editorType = Y.INK;
20976
20976
  static _defaultDrawingOptions = null;
@@ -20981,7 +20981,7 @@ class Eo extends V {
20981
20981
  }), this._willKeepAspectRatio = !0;
20982
20982
  }
20983
20983
  static initialize(t, e) {
20984
- W.initialize(t, e), this._defaultDrawingOptions = new To(e.viewParameters);
20984
+ V.initialize(t, e), this._defaultDrawingOptions = new To(e.viewParameters);
20985
20985
  }
20986
20986
  static getDefaultDrawingOptions(t) {
20987
20987
  const e = this._defaultDrawingOptions.clone();
@@ -21084,7 +21084,7 @@ class Eo extends V {
21084
21084
  }
21085
21085
  } = this, l = {
21086
21086
  annotationType: Y.INK,
21087
- color: W._colorManager.convert(n),
21087
+ color: V._colorManager.convert(n),
21088
21088
  opacity: r,
21089
21089
  thickness: o,
21090
21090
  paths: {
@@ -21119,7 +21119,7 @@ class Eo extends V {
21119
21119
  }), null;
21120
21120
  }
21121
21121
  }
21122
- class ko extends W {
21122
+ class ko extends V {
21123
21123
  #t = null;
21124
21124
  #e = null;
21125
21125
  #s = null;
@@ -21139,7 +21139,7 @@ class ko extends W {
21139
21139
  }), this.#i = t.bitmapUrl, this.#r = t.bitmapFile;
21140
21140
  }
21141
21141
  static initialize(t, e) {
21142
- W.initialize(t, e);
21142
+ V.initialize(t, e);
21143
21143
  }
21144
21144
  static get supportedTypes() {
21145
21145
  return Q(this, "supportedTypes", ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"].map((e) => `image/${e}`));
@@ -21764,7 +21764,7 @@ class Me {
21764
21764
  this.detach(t), this.#o.removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
21765
21765
  }
21766
21766
  changeParent(t) {
21767
- t.parent !== this && (t.parent && t.annotationElementId && (this.#o.addDeletedAnnotationElement(t.annotationElementId), W.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), t.parent?.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
21767
+ t.parent !== this && (t.parent && t.annotationElementId && (this.#o.addDeletedAnnotationElement(t.annotationElementId), V.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), t.parent?.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
21768
21768
  }
21769
21769
  add(t) {
21770
21770
  if (!(t.parent === this && t.isAttachedToDOM)) {
@@ -22302,7 +22302,7 @@ async function pg(a, t) {
22302
22302
  }
22303
22303
  async function Fh(a, { data: t, scale: e = 0.5 }) {
22304
22304
  if (!It.get(a)) return;
22305
- const i = URL.createObjectURL(t), n = await Wt.fromURL(i);
22305
+ const i = URL.createObjectURL(t), n = await Vt.fromURL(i);
22306
22306
  n.scale(e), Ih(a, n), URL.revokeObjectURL(i);
22307
22307
  }
22308
22308
  function Ih(a, t) {
@@ -22341,12 +22341,12 @@ function _g(a) {
22341
22341
  t && (t.clear(), It.delete(a));
22342
22342
  }
22343
22343
  function wg(a, t) {
22344
- return new Wt(a, { scaleX: t, scaleY: t });
22344
+ return new Vt(a, { scaleX: t, scaleY: t });
22345
22345
  }
22346
22346
  function Hr(a, t) {
22347
22347
  if (!t) return;
22348
- const { left: e, top: s, scaleX: i, scaleY: n, width: r, height: o } = a, l = t.x * r * i, h = t.y * o * n;
22349
- a.set({ left: e - l, top: s - h });
22348
+ const { left: e, top: s } = a, i = t.x * a.getScaledWidth(), n = t.y * a.getScaledHeight();
22349
+ a.set({ left: e - i, top: s - n, originX: "left", originY: "top" });
22350
22350
  }
22351
22351
  function xg(a, t, e) {
22352
22352
  const s = a.type;
@@ -22425,7 +22425,7 @@ function Eg(a) {
22425
22425
  async function b(P, O, $) {
22426
22426
  const M = It.get(t);
22427
22427
  if (!M) return;
22428
- const D = await Wt.fromURL(P, {}, { ...Xh, ...O });
22428
+ const D = await Vt.fromURL(P, {}, { ...Xh, ...O });
22429
22429
  Hr(D, $), M.add(D), v(M, D), M.setActiveObject(D);
22430
22430
  }
22431
22431
  function m(P, O, $) {