@component-hook/pdf-canvas 1.2.2-alpha.0 → 1.2.2-alpha.2

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.
@@ -11,8 +11,8 @@ var Eo = (a, t, e, s) => ({
11
11
  return se(a, t, s);
12
12
  }
13
13
  });
14
- import { onMounted as jl, onBeforeUnmount as Ha, defineComponent as Bl, ref as Hl, computed as ko, nextTick as zl, watch as Wn, createElementBlock as Gl, openBlock as Vl, withModifiers as Un, normalizeStyle as Xl, createElementVNode as Wl, normalizeClass as Ul } from "vue";
15
- const Yl = "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", $l = {
14
+ import { onMounted as Bl, onBeforeUnmount as Ha, defineComponent as Hl, ref as zl, computed as ko, nextTick as Gl, watch as Wn, createElementBlock as Vl, openBlock as Xl, withModifiers as Un, normalizeStyle as Wl, createElementVNode as Ul, normalizeClass as Yl } from "vue";
15
+ const $l = "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", ql = {
16
16
  top: 100,
17
17
  left: 50,
18
18
  scaleX: 0.5,
@@ -21,7 +21,7 @@ const Yl = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%20
21
21
  cornerStrokeColor: "black",
22
22
  cornerSize: 6,
23
23
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
24
- }, ql = {
24
+ }, Kl = {
25
25
  top: 100,
26
26
  left: 50,
27
27
  fontFamily: "helvetica",
@@ -31,16 +31,16 @@ const Yl = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%20
31
31
  scaleY: 0.7,
32
32
  cornerSize: 6,
33
33
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
34
- }, Kl = {
34
+ }, Jl = {
35
35
  borderColor: "black",
36
36
  cornerStrokeColor: "black",
37
37
  cornerSize: 8,
38
38
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
39
- }, Jl = {
39
+ }, Zl = {
40
40
  stroke: "#000",
41
41
  hoverStroke: "#B7EC5D",
42
- src: Yl
43
- }, Zl = [
42
+ src: $l
43
+ }, Ql = [
44
44
  "borderColor",
45
45
  "cornerStrokeColor",
46
46
  "cornerSize",
@@ -132,7 +132,7 @@ const q = new class extends Po {
132
132
  const t = new Po(), e = a?.reduce(((s, i) => (s[i] = t[i], s)), {}) || t;
133
133
  this.configure(e);
134
134
  }
135
- }(), Le = function(a) {
135
+ }(), Re = function(a) {
136
136
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) e[s - 1] = arguments[s];
137
137
  return console[a]("fabric", ...e);
138
138
  };
@@ -146,9 +146,9 @@ class Br extends _e {
146
146
  super("".concat(t, " 'options.signal' is in 'aborted' state"));
147
147
  }
148
148
  }
149
- class Ql {
149
+ class tc {
150
150
  }
151
- class tc extends Ql {
151
+ class ec extends tc {
152
152
  testPrecision(t, e) {
153
153
  const s = "precision ".concat(e, ` float;
154
154
  void main(){}`), i = t.createShader(t.FRAGMENT_SHADER);
@@ -156,16 +156,16 @@ void main(){}`), i = t.createShader(t.FRAGMENT_SHADER);
156
156
  }
157
157
  queryWebGL(t) {
158
158
  const e = t.getContext("webgl");
159
- e && (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.GLPrecision = ["highp", "mediump", "lowp"].find(((s) => this.testPrecision(e, s))), e.getExtension("WEBGL_lose_context").loseContext(), Le("log", "WebGL: max texture size ".concat(this.maxTextureSize)));
159
+ e && (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE), this.GLPrecision = ["highp", "mediump", "lowp"].find(((s) => this.testPrecision(e, s))), e.getExtension("WEBGL_lose_context").loseContext(), Re("log", "WebGL: max texture size ".concat(this.maxTextureSize)));
160
160
  }
161
161
  isSupported(t) {
162
162
  return !!this.maxTextureSize && this.maxTextureSize >= t;
163
163
  }
164
164
  }
165
- const ec = {};
165
+ const sc = {};
166
166
  let Oo;
167
- const xe = () => Oo || (Oo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new tc(), dispose() {
168
- }, copyPasteData: ec }), Fs = () => xe().document, di = () => xe().window, za = () => {
167
+ const xe = () => Oo || (Oo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new ec(), dispose() {
168
+ }, copyPasteData: sc }), Fs = () => xe().document, di = () => xe().window, za = () => {
169
169
  var a;
170
170
  return Math.max((a = q.devicePixelRatio) !== null && a !== void 0 ? a : di().devicePixelRatio, 1);
171
171
  }, Zs = new class {
@@ -190,7 +190,7 @@ const xe = () => Oo || (Oo = { document, window, isTouchSupported: "ontouchstart
190
190
  }(), mr = "6.9.0";
191
191
  function rs() {
192
192
  }
193
- const Ve = Math.PI / 2, Fe = 2 * Math.PI, Hr = Math.PI / 180, Bt = Object.freeze([1, 0, 0, 1, 0, 0]), zr = 16, Be = 0.4477152502, X = "center", J = "left", Wt = "top", br = "bottom", ut = "right", It = "none", Gr = /\r?\n/, Ga = "moving", wn = "scaling", Va = "rotating", Vr = "rotate", Xa = "skewing", oi = "resizing", sc = "modifyPoly", ic = "modifyPath", en = "changed", xn = "scale", Ht = "scaleX", Kt = "scaleY", Is = "skewX", Ns = "skewY", vt = "fill", Nt = "stroke", sn = "modified", vs = "json", Yn = "svg", F = new class {
193
+ const Ve = Math.PI / 2, Fe = 2 * Math.PI, Hr = Math.PI / 180, Bt = Object.freeze([1, 0, 0, 1, 0, 0]), zr = 16, Be = 0.4477152502, X = "center", J = "left", Wt = "top", br = "bottom", ut = "right", It = "none", Gr = /\r?\n/, Ga = "moving", wn = "scaling", Va = "rotating", Vr = "rotate", Xa = "skewing", oi = "resizing", ic = "modifyPoly", nc = "modifyPath", en = "changed", xn = "scale", Ht = "scaleX", Kt = "scaleY", Is = "skewX", Ns = "skewY", vt = "fill", Nt = "stroke", sn = "modified", vs = "json", Yn = "svg", F = new class {
194
194
  constructor() {
195
195
  this[vs] = /* @__PURE__ */ new Map(), this[Yn] = /* @__PURE__ */ new Map();
196
196
  }
@@ -234,7 +234,7 @@ const Ve = Math.PI / 2, Fe = 2 * Math.PI, Hr = Math.PI / 180, Bt = Object.freeze
234
234
  return t.forEach(((e) => e.abort())), t;
235
235
  }
236
236
  }();
237
- class nc {
237
+ class rc {
238
238
  constructor() {
239
239
  x(this, "__eventListeners", {});
240
240
  }
@@ -535,7 +535,7 @@ function Wa(a) {
535
535
  }
536
536
  return t;
537
537
  }
538
- class Ua extends nc {
538
+ class Ua extends rc {
539
539
  _setOptions() {
540
540
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
541
541
  for (const e in t) this.set(e, t[e]);
@@ -563,8 +563,8 @@ function Qs(a) {
563
563
  function Ya(a) {
564
564
  return di().cancelAnimationFrame(a);
565
565
  }
566
- let rc = 0;
567
- const Xe = () => rc++, Se = () => {
566
+ let oc = 0;
567
+ const Xe = () => oc++, Se = () => {
568
568
  const a = Fs().createElement("canvas");
569
569
  if (!a || a.getContext === void 0) throw new _e("Failed to create `canvas` element");
570
570
  return a;
@@ -648,7 +648,7 @@ const Cn = function(a) {
648
648
  }));
649
649
  }, fs = function(a) {
650
650
  return (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []).reduce(((t, e) => (e in a && (t[e] = a[e]), t)), {});
651
- }, qr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}), Q = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map(((t) => Q(t, q.NUM_FRACTION_DIGITS))).join(" ") + ")", ee = (a) => !!a && a.toLive !== void 0, Do = (a) => !!a && typeof a.toObject == "function", Ro = (a) => !!a && a.offsetX !== void 0 && "source" in a, Ke = (a) => !!a && "multiSelectionStacking" in a;
651
+ }, qr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}), Q = (a, t) => parseFloat(Number(a).toFixed(t)), Ds = (a) => "matrix(" + a.map(((t) => Q(t, q.NUM_FRACTION_DIGITS))).join(" ") + ")", ee = (a) => !!a && a.toLive !== void 0, Do = (a) => !!a && typeof a.toObject == "function", Lo = (a) => !!a && a.offsetX !== void 0 && "source" in a, Ke = (a) => !!a && "multiSelectionStacking" in a;
652
652
  function Qa(a) {
653
653
  const t = a && ae(a);
654
654
  let e = 0, s = 0;
@@ -668,7 +668,7 @@ const ae = (a) => a.ownerDocument || null, th = (a) => {
668
668
  let { width: e, height: s } = t;
669
669
  e && (a.style.width = typeof e == "number" ? "".concat(e, "px") : e), s && (a.style.height = typeof s == "number" ? "".concat(s, "px") : s);
670
670
  };
671
- function Lo(a) {
671
+ function Ro(a) {
672
672
  return a.onselectstart !== void 0 && (a.onselectstart = () => !1), a.style.userSelect = It, a;
673
673
  }
674
674
  class sh {
@@ -713,7 +713,7 @@ class sh {
713
713
  xe().dispose(this.lower.el), delete this.lower;
714
714
  }
715
715
  }
716
- const oc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Bt] }, ac = ["objects"];
716
+ const ac = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Bt] }, hc = ["objects"];
717
717
  class pi extends Wa(Ua) {
718
718
  get lowerCanvasEl() {
719
719
  var t;
@@ -747,7 +747,7 @@ class pi extends Wa(Ua) {
747
747
  return t.length > 0 && this.renderOnAddRemove && this.requestRenderAll(), t;
748
748
  }
749
749
  _onObjectAdded(t) {
750
- t.canvas && t.canvas !== this && (Le("warn", `Canvas is trying to add an object that belongs to a different canvas.
750
+ t.canvas && t.canvas !== this && (Re("warn", `Canvas is trying to add an object that belongs to a different canvas.
751
751
  Resulting to default behavior: removing object from previous canvas and adding to new canvas`), t.canvas.remove(t)), t._set("canvas", this), t.setCoords(), this.fire("object:added", { target: t }), t.fire("added", { target: this });
752
752
  }
753
753
  _onObjectRemoved(t) {
@@ -1011,7 +1011,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1011
1011
  const s = this["".concat(e, "Color")];
1012
1012
  if (s) if (ee(s)) {
1013
1013
  const i = s.repeat || "", n = this.width, r = this.height, o = this["".concat(e, "Vpt")] ? Ds(Xt(this.viewportTransform)) : "";
1014
- t.push('<rect transform="'.concat(o, " translate(").concat(n / 2, ",").concat(r / 2, ')" x="').concat(s.offsetX - n / 2, '" y="').concat(s.offsetY - r / 2, '" width="').concat(i !== "repeat-y" && i !== "no-repeat" || !Ro(s) ? n : s.source.width, '" height="').concat(i !== "repeat-x" && i !== "no-repeat" || !Ro(s) ? r : s.source.height, '" fill="url(#SVGID_').concat(s.id, `)"></rect>
1014
+ t.push('<rect transform="'.concat(o, " translate(").concat(n / 2, ",").concat(r / 2, ')" x="').concat(s.offsetX - n / 2, '" y="').concat(s.offsetY - r / 2, '" width="').concat(i !== "repeat-y" && i !== "no-repeat" || !Lo(s) ? n : s.source.width, '" height="').concat(i !== "repeat-x" && i !== "no-repeat" || !Lo(s) ? r : s.source.height, '" fill="url(#SVGID_').concat(s.id, `)"></rect>
1015
1015
  `));
1016
1016
  } else t.push('<rect x="0" y="0" width="100%" height="100%" ', 'fill="', s, '"', `></rect>
1017
1017
  `);
@@ -1019,7 +1019,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1019
1019
  loadFromJSON(t, e) {
1020
1020
  let { signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1021
1021
  if (!t) return Promise.reject(new _e("`json` is undefined"));
1022
- const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = st(i, ac), { backgroundImage: o, background: h, overlayImage: l, overlay: c, clipPath: u } = r, d = this.renderOnAddRemove;
1022
+ const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = st(i, hc), { backgroundImage: o, background: h, overlayImage: l, overlay: c, clipPath: u } = r, d = this.renderOnAddRemove;
1023
1023
  return this.renderOnAddRemove = !1, Promise.all([Os(n, { reviver: e, signal: s }), gi({ backgroundImage: o, backgroundColor: h, overlayImage: l, overlayColor: c, clipPath: u }, { signal: s })]).then(((f) => {
1024
1024
  let [g, p] = f;
1025
1025
  return this.clear(), this.add(...g), this.set(r), this.set(p), this.renderOnAddRemove = d, this;
@@ -1063,14 +1063,14 @@ Resulting to default behavior: removing object from previous canvas and adding t
1063
1063
  return "#<Canvas (".concat(this.complexity(), "): { objects: ").concat(this._objects.length, " }>");
1064
1064
  }
1065
1065
  }
1066
- x(pi, "ownDefaults", oc);
1067
- const hc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1066
+ x(pi, "ownDefaults", ac);
1067
+ const lc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1068
1068
  const t = Qa(a.target), e = (function(s) {
1069
1069
  const i = s.changedTouches;
1070
1070
  return i && i[0] ? i[0] : s;
1071
1071
  })(a);
1072
1072
  return new C(e.clientX + t.left, e.clientY + t.top);
1073
- }, rn = (a) => hc.includes(a.type) || a.pointerType === "touch", Fo = (a) => {
1073
+ }, rn = (a) => lc.includes(a.type) || a.pointerType === "touch", Fo = (a) => {
1074
1074
  a.preventDefault(), a.stopPropagation();
1075
1075
  }, we = (a) => {
1076
1076
  let t = 0, e = 0, s = 0, i = 0;
@@ -1079,8 +1079,8 @@ const hc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1079
1079
  (o > s || !n) && (s = o), (o < t || !n) && (t = o), (h > i || !n) && (i = h), (h < e || !n) && (e = h);
1080
1080
  }
1081
1081
  return { left: t, top: e, width: s - t, height: i - e };
1082
- }, lc = ["translateX", "translateY", "scaleX", "scaleY"], nh = (a, t) => Rs(a, dt(t, a.calcOwnMatrix())), Rs = (a, t) => {
1083
- const e = as(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = st(e, lc), h = new C(s, i);
1082
+ }, cc = ["translateX", "translateY", "scaleX", "scaleY"], nh = (a, t) => Ls(a, dt(t, a.calcOwnMatrix())), Ls = (a, t) => {
1083
+ const e = as(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = st(e, cc), h = new C(s, i);
1084
1084
  a.flipX = !1, a.flipY = !1, Object.assign(a, o), a.set({ scaleX: n, scaleY: r }), a.setPositionByOrigin(h, X, X);
1085
1085
  }, rh = (a) => {
1086
1086
  a.scaleX = 1, a.scaleY = 1, a.skewX = 0, a.skewY = 0, a.flipX = !1, a.flipY = !1, a.rotate(0);
@@ -1098,12 +1098,12 @@ const hc = ["touchstart", "touchmove", "touchend"], ih = (a) => {
1098
1098
  return a.transform(mi(t, e), !0);
1099
1099
  }, yr = (a, t, e) => {
1100
1100
  const s = mi(t, e);
1101
- return Rs(a, dt(s, a.calcOwnMatrix())), s;
1101
+ return Ls(a, dt(s, a.calcOwnMatrix())), s;
1102
1102
  }, ah = (a, t) => {
1103
1103
  var e;
1104
1104
  const { transform: { target: s } } = t;
1105
1105
  (e = s.canvas) === null || e === void 0 || e.fire("object:".concat(a), w(w({}, t), {}, { target: s })), s.fire(a, t);
1106
- }, cc = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, mt = (a) => typeof a == "string" ? cc[a] : a - 0.5, on = "not-allowed";
1106
+ }, uc = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, mt = (a) => typeof a == "string" ? uc[a] : a - 0.5, on = "not-allowed";
1107
1107
  function hh(a) {
1108
1108
  return mt(a.originX) === mt(X) && mt(a.originY) === mt(X);
1109
1109
  }
@@ -1124,7 +1124,7 @@ function Jr(a, t, e, s, i) {
1124
1124
  })(r, new C(s, i), t, e);
1125
1125
  return u.x >= c && (u.x -= c), u.x <= -c && (u.x += c), u.y >= c && (u.y -= c), u.y <= c && (u.y += c), u.x -= h.offsetX, u.y -= h.offsetY, u;
1126
1126
  }
1127
- const uc = (a, t, e, s) => {
1127
+ const dc = (a, t, e, s) => {
1128
1128
  const { target: i, offsetX: n, offsetY: r } = t, o = e - n, h = s - r, l = !le(i, "lockMovementX") && i.left !== o, c = !le(i, "lockMovementY") && i.top !== h;
1129
1129
  return l && i.set(J, o), c && i.set(Wt, h), (l || c) && ah(Ga, lh(a, t, e, s)), l || c;
1130
1130
  }, an = (a) => a.replace(/\s+/g, " "), No = { aliceblue: "#F0F8FF", antiquewhite: "#FAEBD7", aqua: "#0FF", aquamarine: "#7FFFD4", azure: "#F0FFFF", beige: "#F5F5DC", bisque: "#FFE4C4", black: "#000", blanchedalmond: "#FFEBCD", blue: "#00F", blueviolet: "#8A2BE2", brown: "#A52A2A", burlywood: "#DEB887", cadetblue: "#5F9EA0", chartreuse: "#7FFF00", chocolate: "#D2691E", coral: "#FF7F50", cornflowerblue: "#6495ED", cornsilk: "#FFF8DC", crimson: "#DC143C", cyan: "#0FF", darkblue: "#00008B", darkcyan: "#008B8B", darkgoldenrod: "#B8860B", darkgray: "#A9A9A9", darkgrey: "#A9A9A9", darkgreen: "#006400", darkkhaki: "#BDB76B", darkmagenta: "#8B008B", darkolivegreen: "#556B2F", darkorange: "#FF8C00", darkorchid: "#9932CC", darkred: "#8B0000", darksalmon: "#E9967A", darkseagreen: "#8FBC8F", darkslateblue: "#483D8B", darkslategray: "#2F4F4F", darkslategrey: "#2F4F4F", darkturquoise: "#00CED1", darkviolet: "#9400D3", deeppink: "#FF1493", deepskyblue: "#00BFFF", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1E90FF", firebrick: "#B22222", floralwhite: "#FFFAF0", forestgreen: "#228B22", fuchsia: "#F0F", gainsboro: "#DCDCDC", ghostwhite: "#F8F8FF", gold: "#FFD700", goldenrod: "#DAA520", gray: "#808080", grey: "#808080", green: "#008000", greenyellow: "#ADFF2F", honeydew: "#F0FFF0", hotpink: "#FF69B4", indianred: "#CD5C5C", indigo: "#4B0082", ivory: "#FFFFF0", khaki: "#F0E68C", lavender: "#E6E6FA", lavenderblush: "#FFF0F5", lawngreen: "#7CFC00", lemonchiffon: "#FFFACD", lightblue: "#ADD8E6", lightcoral: "#F08080", lightcyan: "#E0FFFF", lightgoldenrodyellow: "#FAFAD2", lightgray: "#D3D3D3", lightgrey: "#D3D3D3", lightgreen: "#90EE90", lightpink: "#FFB6C1", lightsalmon: "#FFA07A", lightseagreen: "#20B2AA", lightskyblue: "#87CEFA", lightslategray: "#789", lightslategrey: "#789", lightsteelblue: "#B0C4DE", lightyellow: "#FFFFE0", lime: "#0F0", limegreen: "#32CD32", linen: "#FAF0E6", magenta: "#F0F", maroon: "#800000", mediumaquamarine: "#66CDAA", mediumblue: "#0000CD", mediumorchid: "#BA55D3", mediumpurple: "#9370DB", mediumseagreen: "#3CB371", mediumslateblue: "#7B68EE", mediumspringgreen: "#00FA9A", mediumturquoise: "#48D1CC", mediumvioletred: "#C71585", midnightblue: "#191970", mintcream: "#F5FFFA", mistyrose: "#FFE4E1", moccasin: "#FFE4B5", navajowhite: "#FFDEAD", navy: "#000080", oldlace: "#FDF5E6", olive: "#808000", olivedrab: "#6B8E23", orange: "#FFA500", orangered: "#FF4500", orchid: "#DA70D6", palegoldenrod: "#EEE8AA", palegreen: "#98FB98", paleturquoise: "#AFEEEE", palevioletred: "#DB7093", papayawhip: "#FFEFD5", peachpuff: "#FFDAB9", peru: "#CD853F", pink: "#FFC0CB", plum: "#DDA0DD", powderblue: "#B0E0E6", purple: "#800080", rebeccapurple: "#639", red: "#F00", rosybrown: "#BC8F8F", royalblue: "#4169E1", saddlebrown: "#8B4513", salmon: "#FA8072", sandybrown: "#F4A460", seagreen: "#2E8B57", seashell: "#FFF5EE", sienna: "#A0522D", silver: "#C0C0C0", skyblue: "#87CEEB", slateblue: "#6A5ACD", slategray: "#708090", slategrey: "#708090", snow: "#FFFAFA", springgreen: "#00FF7F", steelblue: "#4682B4", tan: "#D2B48C", teal: "#008080", thistle: "#D8BFD8", tomato: "#FF6347", turquoise: "#40E0D0", violet: "#EE82EE", wheat: "#F5DEB3", white: "#FFF", whitesmoke: "#F5F5F5", yellow: "#FF0", yellowgreen: "#9ACD32" }, $n = (a, t, e) => (e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? a + 6 * (t - a) * e : e < 0.5 ? t : e < 2 / 3 ? a + (t - a) * (2 / 3 - e) * 6 : a), jo = (a, t, e, s) => {
@@ -1265,7 +1265,7 @@ class Z {
1265
1265
  return e.includes("rad") ? Ce(s) : e.includes("turn") ? 360 * s : s;
1266
1266
  }
1267
1267
  }
1268
- const Rt = function(a) {
1268
+ const Lt = function(a) {
1269
1269
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zr;
1270
1270
  const e = /\D{0,2}$/.exec(a), s = parseFloat(a), i = q.DPI;
1271
1271
  switch (e?.[0]) {
@@ -1349,9 +1349,9 @@ class uh {
1349
1349
  function Tn(a) {
1350
1350
  return new RegExp("^(" + a.join("|") + ")\\b", "i");
1351
1351
  }
1352
- const hs = "textDecorationThickness", dh = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], fh = ["underline", "overline", "linethrough"], gh = [...dh, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], ph = [...gh, ...fh, "textBackgroundColor", "direction", hs], dc = [...dh, ...fh, Nt, "strokeWidth", vt, "deltaY", "textBackgroundColor", hs], fc = { _reNewline: Gr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: "normal", fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: J, fontStyle: "normal", lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: J, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: "ltr", 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 }, ye = "justify", hn = "justify-left", ei = "justify-right", si = "justify-center";
1352
+ const hs = "textDecorationThickness", dh = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], fh = ["underline", "overline", "linethrough"], gh = [...dh, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], ph = [...gh, ...fh, "textBackgroundColor", "direction", hs], fc = [...dh, ...fh, Nt, "strokeWidth", vt, "deltaY", "textBackgroundColor", hs], gc = { _reNewline: Gr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: "normal", fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: J, fontStyle: "normal", lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: J, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: "ltr", 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 }, ye = "justify", hn = "justify-left", ei = "justify-right", si = "justify-center";
1353
1353
  var zo, Go, Vo;
1354
- const he = String.raw(zo || (zo = Ae(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))), qn = String.raw(Go || (Go = Ae(["(?:s*,?s+|s*,s*)"], ["(?:\\s*,?\\s+|\\s*,\\s*)"]))), _r = "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*(" + he + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + he + "))?\\s+(.*)"), pc = { cx: J, x: J, r: "radius", cy: Wt, y: Wt, 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 }, Kn = "font-size", Jn = "clip-path", mc = Tn(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), bc = Tn(["symbol", "image", "marker", "pattern", "view", "svg"]), Xo = Tn(["symbol", "g", "a", "svg", "clipPath", "defs"]), Wo = new RegExp(String.raw(Vo || (Vo = Ae(["^s*(", ")", "(", ")", "(", ")", "(", ")s*$"], ["^\\s*(", ")", "(", ")", "(", ")", "(", ")\\s*$"])), he, qn, he, qn, he, qn, he)), vc = new C(1, 0), mh = new C(), Qr = (a, t) => a.rotate(t), ln = (a, t) => new C(t).subtract(a), cn = (a) => a.distanceFrom(mh), un = (a, t) => Math.atan2(As(a, t), vh(a, t)), bh = (a) => un(vc, a), En = (a) => a.eq(mh) ? a : a.scalarDivide(cn(a)), to = function(a) {
1354
+ const he = String.raw(zo || (zo = Ae(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))), qn = String.raw(Go || (Go = Ae(["(?:s*,?s+|s*,s*)"], ["(?:\\s*,?\\s+|\\s*,\\s*)"]))), _r = "http://www.w3.org/2000/svg", pc = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + he + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + he + "))?\\s+(.*)"), mc = { cx: J, x: J, r: "radius", cy: Wt, y: Wt, 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 }, Kn = "font-size", Jn = "clip-path", bc = Tn(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), vc = Tn(["symbol", "image", "marker", "pattern", "view", "svg"]), Xo = Tn(["symbol", "g", "a", "svg", "clipPath", "defs"]), Wo = new RegExp(String.raw(Vo || (Vo = Ae(["^s*(", ")", "(", ")", "(", ")", "(", ")s*$"], ["^\\s*(", ")", "(", ")", "(", ")", "(", ")\\s*$"])), he, qn, he, qn, he, qn, he)), yc = new C(1, 0), mh = new C(), Qr = (a, t) => a.rotate(t), ln = (a, t) => new C(t).subtract(a), cn = (a) => a.distanceFrom(mh), un = (a, t) => Math.atan2(As(a, t), vh(a, t)), bh = (a) => un(yc, a), En = (a) => a.eq(mh) ? a : a.scalarDivide(cn(a)), to = function(a) {
1355
1355
  let t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
1356
1356
  return En(new C(-a.y, a.x).scalarMultiply(t ? 1 : -1));
1357
1357
  }, As = (a, t) => a.x * t.y - a.y * t.x, vh = (a, t) => a.x * t.x + a.y * t.y, wr = (a, t, e) => {
@@ -1359,10 +1359,10 @@ const he = String.raw(zo || (zo = Ae(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["
1359
1359
  const s = As(t, e), i = As(t, a), n = As(e, a);
1360
1360
  return s >= 0 ? i >= 0 && n <= 0 : !(i <= 0 && n >= 0);
1361
1361
  }, Uo = "(-?\\d+(?:\\.\\d*)?(?:px)?(?:\\s?|$))?", Yo = new RegExp("(?:\\s|^)" + Uo + Uo + "(" + he + "?(?:px)?)?(?:\\s?|$)(?:$|\\s)");
1362
- class Re {
1362
+ class Le {
1363
1363
  constructor(t) {
1364
- const e = typeof t == "string" ? Re.parseShadow(t) : t;
1365
- Object.assign(this, Re.ownDefaults, e), this.id = Xe();
1364
+ const e = typeof t == "string" ? Le.parseShadow(t) : t;
1365
+ Object.assign(this, Le.ownDefaults, e), this.id = Xe();
1366
1366
  }
1367
1367
  static parseShadow(t) {
1368
1368
  const e = t.trim(), [, s = 0, i = 0, n = 0] = (Yo.exec(e) || []).map(((r) => parseFloat(r) || 0));
@@ -1387,16 +1387,16 @@ class Re {
1387
1387
  `);
1388
1388
  }
1389
1389
  toObject() {
1390
- const t = { color: this.color, blur: this.blur, offsetX: this.offsetX, offsetY: this.offsetY, affectStroke: this.affectStroke, nonScaling: this.nonScaling, type: this.constructor.type }, e = Re.ownDefaults;
1390
+ const t = { color: this.color, blur: this.blur, offsetX: this.offsetX, offsetY: this.offsetY, affectStroke: this.affectStroke, nonScaling: this.nonScaling, type: this.constructor.type }, e = Le.ownDefaults;
1391
1391
  return this.includeDefaultValues ? t : qr(t, ((s, i) => s !== e[i]));
1392
1392
  }
1393
1393
  static async fromObject(t) {
1394
1394
  return new this(t);
1395
1395
  }
1396
1396
  }
1397
- x(Re, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Re, "type", "shadow"), F.setClass(Re, "shadow");
1398
- const ls = (a, t, e) => Math.max(a, Math.min(t, e)), yc = [Wt, J, Ht, Kt, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Is, Ns], Ie = [vt, Nt, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], _c = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: J, originY: Wt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: vt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, Zn = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Fe * Math.asin(1) : e / Fe * Math.asin(t / a), { a, c: t, p: e, s }), $o = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Fe / e), yh = (a, t, e, s) => -e * Math.cos(a / s * Ve) + e + t, xr = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, qo = (a, t, e, s) => e - xr(s - a, 0, e, s) + t;
1399
- var wc = Object.freeze({ __proto__: null, defaultEasing: yh, easeInBack: function(a, t, e, s) {
1397
+ x(Le, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Le, "type", "shadow"), F.setClass(Le, "shadow");
1398
+ const ls = (a, t, e) => Math.max(a, Math.min(t, e)), _c = [Wt, J, Ht, Kt, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Is, Ns], Ie = [vt, Nt, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], wc = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: J, originY: Wt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: vt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, Zn = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Fe * Math.asin(1) : e / Fe * Math.asin(t / a), { a, c: t, p: e, s }), $o = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Fe / e), yh = (a, t, e, s) => -e * Math.cos(a / s * Ve) + e + t, xr = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, qo = (a, t, e, s) => e - xr(s - a, 0, e, s) + t;
1399
+ var xc = Object.freeze({ __proto__: null, defaultEasing: yh, easeInBack: function(a, t, e, s) {
1400
1400
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1.70158;
1401
1401
  return e * (a /= s) * a * ((i + 1) * a - i) + t;
1402
1402
  }, easeInBounce: qo, easeInCirc: (a, t, e, s) => -e * (Math.sqrt(1 - (a /= s) * a) - 1) + t, easeInCubic: (a, t, e, s) => e * (a / s) ** 3 + t, easeInElastic: (a, t, e, s) => {
@@ -1430,10 +1430,10 @@ var wc = Object.freeze({ __proto__: null, defaultEasing: yh, easeInBack: functio
1430
1430
  const { a: r, s: o, p: h, c: l } = Zn(i, e, n, 1.70158);
1431
1431
  return r * 2 ** (-10 * a) * Math.sin((a * s - o) * Fe / h) + l + t;
1432
1432
  }, easeOutExpo: (a, t, e, s) => a === s ? t + e : e * -(2 ** (-10 * a / s) + 1) + t, easeOutQuad: (a, t, e, s) => -e * (a /= s) * (a - 2) + t, easeOutQuart: (a, t, e, s) => -e * ((a = a / s - 1) * a ** 3 - 1) + t, easeOutQuint: (a, t, e, s) => e * ((a / s - 1) ** 5 + 1) + t, easeOutSine: (a, t, e, s) => e * Math.sin(a / s * Ve) + t });
1433
- const xc = () => !1;
1433
+ const Sc = () => !1;
1434
1434
  class eo {
1435
1435
  constructor(t) {
1436
- let { startValue: e, byValue: s, duration: i = 500, delay: n = 0, easing: r = yh, onStart: o = rs, onChange: h = rs, onComplete: l = rs, abort: c = xc, target: u } = t;
1436
+ let { startValue: e, byValue: s, duration: i = 500, delay: n = 0, easing: r = yh, onStart: o = rs, onChange: h = rs, onComplete: l = rs, abort: c = Sc, target: u } = t;
1437
1437
  x(this, "_state", "pending"), x(this, "durationProgress", 0), x(this, "valueProgress", 0), this.tick = this.tick.bind(this), this.duration = i, this.delay = n, this.easing = r, this._onStart = o, this._onChange = h, this._onComplete = l, this._abort = c, this.target = u, this.startValue = e, this.byValue = s, this.value = this.startValue, this.endValue = Object.freeze(this.calculate(this.duration).value);
1438
1438
  }
1439
1439
  get state() {
@@ -1464,32 +1464,32 @@ class eo {
1464
1464
  this._state = "aborted", this.unregister();
1465
1465
  }
1466
1466
  }
1467
- const Sc = ["startValue", "endValue"];
1468
- class Cc extends eo {
1467
+ const Cc = ["startValue", "endValue"];
1468
+ class Ac extends eo {
1469
1469
  constructor(t) {
1470
1470
  let { startValue: e = 0, endValue: s = 100 } = t;
1471
- super(w(w({}, st(t, Sc)), {}, { startValue: e, byValue: s - e }));
1471
+ super(w(w({}, st(t, Cc)), {}, { startValue: e, byValue: s - e }));
1472
1472
  }
1473
1473
  calculate(t) {
1474
1474
  const e = this.easing(t, this.startValue, this.byValue, this.duration);
1475
1475
  return { value: e, valueProgress: Math.abs((e - this.startValue) / this.byValue) };
1476
1476
  }
1477
1477
  }
1478
- const Ac = ["startValue", "endValue"];
1479
- class Tc extends eo {
1478
+ const Tc = ["startValue", "endValue"];
1479
+ class Ec extends eo {
1480
1480
  constructor(t) {
1481
1481
  let { startValue: e = [0], endValue: s = [100] } = t;
1482
- super(w(w({}, st(t, Ac)), {}, { startValue: e, byValue: s.map(((i, n) => i - e[n])) }));
1482
+ super(w(w({}, st(t, Tc)), {}, { startValue: e, byValue: s.map(((i, n) => i - e[n])) }));
1483
1483
  }
1484
1484
  calculate(t) {
1485
1485
  const e = this.startValue.map(((s, i) => this.easing(t, s, this.byValue[i], this.duration, i)));
1486
1486
  return { value: e, valueProgress: Math.abs((e[0] - this.startValue[0]) / this.byValue[0]) };
1487
1487
  }
1488
1488
  }
1489
- const Ec = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], kc = (a, t, e, s) => t + e * (1 - Math.cos(a / s * Ve)), Qn = (a) => a && ((t, e, s) => a(new Z(t).toRgba(), e, s));
1490
- class Mc extends eo {
1489
+ const kc = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], Mc = (a, t, e, s) => t + e * (1 - Math.cos(a / s * Ve)), Qn = (a) => a && ((t, e, s) => a(new Z(t).toRgba(), e, s));
1490
+ class Pc extends eo {
1491
1491
  constructor(t) {
1492
- let { startValue: e, endValue: s, easing: i = kc, onChange: n, onComplete: r, abort: o } = t, h = st(t, Ec);
1492
+ let { startValue: e, endValue: s, easing: i = Mc, onChange: n, onComplete: r, abort: o } = t, h = st(t, kc);
1493
1493
  const l = new Z(e).getSource(), c = new Z(s).getSource();
1494
1494
  super(w(w({}, h), {}, { startValue: l, byValue: c.map(((u, d) => u - l[d])), easing: i, onChange: Qn(n), onComplete: Qn(r), abort: Qn(o) }));
1495
1495
  }
@@ -1499,11 +1499,11 @@ class Mc extends eo {
1499
1499
  }
1500
1500
  }
1501
1501
  function so(a) {
1502
- const t = ((e) => Array.isArray(e.startValue) || Array.isArray(e.endValue))(a) ? new Tc(a) : new Cc(a);
1502
+ const t = ((e) => Array.isArray(e.startValue) || Array.isArray(e.endValue))(a) ? new Ec(a) : new Ac(a);
1503
1503
  return t.start(), t;
1504
1504
  }
1505
1505
  function _h(a) {
1506
- const t = new Mc(a);
1506
+ const t = new Pc(a);
1507
1507
  return t.start(), t;
1508
1508
  }
1509
1509
  class ot {
@@ -1581,7 +1581,7 @@ class ot {
1581
1581
  return ot.intersectPolygonPolygon(t, [i, r, n, o]);
1582
1582
  }
1583
1583
  }
1584
- class Pc extends Ua {
1584
+ class Oc extends Ua {
1585
1585
  getX() {
1586
1586
  return this.getXY().x;
1587
1587
  }
@@ -1766,8 +1766,8 @@ class Pc extends Ua {
1766
1766
  return this.translateToOriginPoint(this.getRelativeCenterPoint(), J, Wt);
1767
1767
  }
1768
1768
  }
1769
- const Oc = ["type"], Dc = ["extraParam"];
1770
- let Te = class Ki extends Pc {
1769
+ const Dc = ["type"], Lc = ["extraParam"];
1770
+ let Te = class Ki extends Oc {
1771
1771
  static getDefaults() {
1772
1772
  return Ki.ownDefaults;
1773
1773
  }
@@ -1776,7 +1776,7 @@ let Te = class Ki extends Pc {
1776
1776
  return t === "FabricObject" ? "object" : t.toLowerCase();
1777
1777
  }
1778
1778
  set type(t) {
1779
- Le("warn", "Setting type has no effect", t);
1779
+ Re("warn", "Setting type has no effect", t);
1780
1780
  }
1781
1781
  constructor(t) {
1782
1782
  super(), x(this, "_cacheContext", null), Object.assign(this, Ki.ownDefaults), this.setOptions(t);
@@ -1833,7 +1833,7 @@ let Te = class Ki extends Pc {
1833
1833
  return Math.abs(t) < this.minScaleLimit ? t < 0 ? -this.minScaleLimit : this.minScaleLimit : t === 0 ? 1e-4 : t;
1834
1834
  }
1835
1835
  _set(t, e) {
1836
- t !== Ht && t !== Kt || (e = this._constrainScale(e)), t === Ht && e < 0 ? (this.flipX = !this.flipX, e *= -1) : t === "scaleY" && e < 0 ? (this.flipY = !this.flipY, e *= -1) : t !== "shadow" || !e || e instanceof Re || (e = new Re(e));
1836
+ t !== Ht && t !== Kt || (e = this._constrainScale(e)), t === Ht && e < 0 ? (this.flipX = !this.flipX, e *= -1) : t === "scaleY" && e < 0 ? (this.flipY = !this.flipY, e *= -1) : t !== "shadow" || !e || e instanceof Le || (e = new Le(e));
1837
1837
  const s = this[t] !== e;
1838
1838
  return this[t] = e, s && this.constructor.cacheProperties.includes(t) && (this.dirty = !0), this.parent && (this.dirty || s && this.constructor.stateProperties.includes(t)) && this.parent._set("dirty", !0), this;
1839
1839
  }
@@ -2081,9 +2081,9 @@ let Te = class Ki extends Pc {
2081
2081
  toObject() {
2082
2082
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(Ki.customProperties, this.constructor.customProperties || []);
2083
2083
  let e;
2084
- const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: O, opacity: N, visible: D, backgroundColor: L, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: M, skewY: R } = this;
2084
+ const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: O, opacity: N, visible: D, backgroundColor: R, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: M, skewY: L } = this;
2085
2085
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2086
- const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: O, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: L, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: G(M), skewY: G(R) }, e ? { clipPath: e } : null);
2086
+ const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: O, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: R, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: G(M), skewY: G(L) }, e ? { clipPath: e } : null);
2087
2087
  return this.includeDefaultValues ? it : this._removeDefaultValues(it);
2088
2088
  }
2089
2089
  toDatalessObject(t) {
@@ -2101,14 +2101,14 @@ let Te = class Ki extends Pc {
2101
2101
  return "#<".concat(this.constructor.type, ">");
2102
2102
  }
2103
2103
  static _fromObject(t) {
2104
- let e = st(t, Oc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = st(s, Dc);
2104
+ let e = st(t, Dc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = st(s, Lc);
2105
2105
  return gi(e, n).then(((r) => i ? (delete r[i], new this(e[i], r)) : new this(r)));
2106
2106
  }
2107
2107
  static fromObject(t, e) {
2108
2108
  return this._fromObject(t, e);
2109
2109
  }
2110
2110
  };
2111
- x(Te, "stateProperties", yc), x(Te, "cacheProperties", Ie), x(Te, "ownDefaults", _c), x(Te, "type", "FabricObject"), x(Te, "colorProperties", [vt, Nt, "backgroundColor"]), x(Te, "customProperties", []), F.setClass(Te), F.setClass(Te, "object");
2111
+ x(Te, "stateProperties", _c), x(Te, "cacheProperties", Ie), x(Te, "ownDefaults", wc), x(Te, "type", "FabricObject"), x(Te, "colorProperties", [vt, Nt, "backgroundColor"]), x(Te, "customProperties", []), F.setClass(Te), F.setClass(Te, "object");
2112
2112
  const Bs = (a, t, e) => (s, i, n, r) => {
2113
2113
  const o = t(s, i, n, r);
2114
2114
  return o && ah(a, w(w({}, lh(s, i, n, r)), e)), o;
@@ -2133,7 +2133,7 @@ function Rc(a, t, e, s, i) {
2133
2133
  let c, u = t, d = e;
2134
2134
  a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", n > r ? (c = n, a.scale(1, r / n), d = e * n / r) : r > n ? (c = r, a.scale(n / r, 1), u = t * r / n) : c = n, a.beginPath(), a.arc(u, d, c / 2, 0, Fe, !1), a[h](), l && a.stroke(), a.restore();
2135
2135
  }
2136
- function Lc(a, t, e, s, i) {
2136
+ function Fc(a, t, e, s, i) {
2137
2137
  s = s || {};
2138
2138
  const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Nt : vt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor), c = n / 2, u = r / 2;
2139
2139
  a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", a.translate(t, e);
@@ -2179,10 +2179,10 @@ class ne {
2179
2179
  return { tl: new C(-0.5, -0.5).transform(o), tr: new C(0.5, -0.5).transform(o), br: new C(0.5, 0.5).transform(o), bl: new C(-0.5, 0.5).transform(o) };
2180
2180
  }
2181
2181
  render(t, e, s, i, n) {
2182
- ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Rc.call(this, t, e, s, i, n) : Lc.call(this, t, e, s, i, n);
2182
+ ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Rc.call(this, t, e, s, i, n) : Fc.call(this, t, e, s, i, n);
2183
2183
  }
2184
2184
  }
2185
- const Fc = (a, t, e) => e.lockRotation ? on : t.cursorStyle, Ic = Bs(Va, Hs(((a, t, e, s) => {
2185
+ const Ic = (a, t, e) => e.lockRotation ? on : t.cursorStyle, Nc = Bs(Va, Hs(((a, t, e, s) => {
2186
2186
  let { target: i, ex: n, ey: r, theta: o, originX: h, originY: l } = t;
2187
2187
  const c = i.translateToOriginPoint(i.getRelativeCenterPoint(), h, l);
2188
2188
  if (le(i, "lockRotation")) return !1;
@@ -2206,11 +2206,11 @@ function xh(a, t, e) {
2206
2206
  const { width: n, height: r, strokeWidth: o } = a;
2207
2207
  return n === 0 && o === 0 && t !== "y" || r === 0 && o === 0 && t !== "x";
2208
2208
  }
2209
- const Nc = ["e", "se", "s", "sw", "w", "nw", "n", "ne", "e"], $s = (a, t, e) => {
2209
+ const jc = ["e", "se", "s", "sw", "w", "nw", "n", "ne", "e"], $s = (a, t, e) => {
2210
2210
  const s = wh(a, e);
2211
2211
  if (xh(e, t.x !== 0 && t.y === 0 ? "x" : t.x === 0 && t.y !== 0 ? "y" : "", s)) return on;
2212
2212
  const i = ch(e, t);
2213
- return "".concat(Nc[i], "-resize");
2213
+ return "".concat(jc[i], "-resize");
2214
2214
  };
2215
2215
  function io(a, t, e, s) {
2216
2216
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {};
@@ -2229,18 +2229,18 @@ function io(a, t, e, s) {
2229
2229
  const g = n.scaleX, p = n.scaleY;
2230
2230
  return r ? (r === "x" && n.set(Ht, l), r === "y" && n.set(Kt, c)) : (!le(n, "lockScalingX") && n.set(Ht, l), !le(n, "lockScalingY") && n.set(Kt, c)), g !== n.scaleX || p !== n.scaleY;
2231
2231
  }
2232
- const xi = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s)))), jc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "x" })))), Bc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "y" })))), Hc = ["target", "ex", "ey", "skewingSide"], tr = { x: { counterAxis: "y", scale: Ht, skew: Is, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: Kt, skew: Ns, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, zc = ["ns", "nesw", "ew", "nwse"], Gc = (a, t, e) => {
2232
+ const xi = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s)))), Bc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "x" })))), Hc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "y" })))), zc = ["target", "ex", "ey", "skewingSide"], tr = { x: { counterAxis: "y", scale: Ht, skew: Is, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: Kt, skew: Ns, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, Gc = ["ns", "nesw", "ew", "nwse"], Vc = (a, t, e) => {
2233
2233
  if (t.x !== 0 && le(e, "lockSkewingY") || t.y !== 0 && le(e, "lockSkewingX")) return on;
2234
2234
  const s = ch(e, t) % 4;
2235
- return "".concat(zc[s], "-resize");
2235
+ return "".concat(Gc[s], "-resize");
2236
2236
  };
2237
2237
  function Sh(a, t, e, s, i) {
2238
2238
  const { target: n } = e, { counterAxis: r, origin: o, lockSkewing: h, skew: l, flip: c } = tr[a];
2239
2239
  if (le(n, h)) return !1;
2240
2240
  const { origin: u, flip: d } = tr[r], f = mt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && Jr(e, X, X, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
2241
2241
  return Bs(Xa, Hs(((m, v, y, _) => (function(S, A, T) {
2242
- let { target: E, ex: O, ey: N, skewingSide: D } = A, L = st(A, Hc);
2243
- const { skew: k } = tr[S], P = T.subtract(new C(O, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = L[k], R = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * P * D / Math.max(G, 1) + R, at = Ce(Math.atan(it));
2242
+ let { target: E, ex: O, ey: N, skewingSide: D } = A, R = st(A, zc);
2243
+ const { skew: k } = tr[S], P = T.subtract(new C(O, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = R[k], L = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * P * D / Math.max(G, 1) + L, at = Ce(Math.atan(it));
2244
2244
  E.set(k, at);
2245
2245
  const xt = j !== E[k];
2246
2246
  if (xt && S === "y") {
@@ -2250,14 +2250,14 @@ function Sh(a, t, e, s, i) {
2250
2250
  return xt;
2251
2251
  })(a, v, new C(y, _)))))(t, w(w({}, e), {}, { [o]: p, skewingSide: g }), s, i);
2252
2252
  }
2253
- const Vc = (a, t, e, s) => Sh("x", a, t, e, s), Xc = (a, t, e, s) => Sh("y", a, t, e, s);
2253
+ const Xc = (a, t, e, s) => Sh("x", a, t, e, s), Wc = (a, t, e, s) => Sh("y", a, t, e, s);
2254
2254
  function kn(a, t) {
2255
2255
  return a[t.canvas.altActionKey];
2256
2256
  }
2257
2257
  const Si = (a, t, e) => {
2258
2258
  const s = kn(a, e);
2259
2259
  return t.x === 0 ? s ? Is : Kt : t.y === 0 ? s ? Ns : Ht : "";
2260
- }, ws = (a, t, e) => kn(a, e) ? Gc(0, t, e) : $s(a, t, e), Jo = (a, t, e, s) => kn(a, t.target) ? Xc(a, t, e, s) : jc(a, t, e, s), Zo = (a, t, e, s) => kn(a, t.target) ? Vc(a, t, e, s) : Bc(a, t, e, s), Ch = () => ({ ml: new ne({ x: -0.5, y: 0, cursorStyleHandler: ws, actionHandler: Jo, getActionName: Si }), mr: new ne({ x: 0.5, y: 0, cursorStyleHandler: ws, actionHandler: Jo, getActionName: Si }), mb: new ne({ x: 0, y: 0.5, cursorStyleHandler: ws, actionHandler: Zo, getActionName: Si }), mt: new ne({ x: 0, y: -0.5, cursorStyleHandler: ws, actionHandler: Zo, getActionName: Si }), tl: new ne({ x: -0.5, y: -0.5, cursorStyleHandler: $s, actionHandler: xi }), tr: new ne({ x: 0.5, y: -0.5, cursorStyleHandler: $s, actionHandler: xi }), bl: new ne({ x: -0.5, y: 0.5, cursorStyleHandler: $s, actionHandler: xi }), br: new ne({ x: 0.5, y: 0.5, cursorStyleHandler: $s, actionHandler: xi }), mtr: new ne({ x: 0, y: -0.5, actionHandler: Ic, cursorStyleHandler: Fc, offsetY: -40, withConnection: !0, actionName: Vr }) }), Wc = () => ({ mr: new ne({ x: 0.5, y: 0, actionHandler: Ko, cursorStyleHandler: ws, actionName: oi }), ml: new ne({ x: -0.5, y: 0, actionHandler: Ko, cursorStyleHandler: ws, actionName: oi }) }), Uc = () => w(w({}, Ch()), Wc());
2260
+ }, ws = (a, t, e) => kn(a, e) ? Vc(0, t, e) : $s(a, t, e), Jo = (a, t, e, s) => kn(a, t.target) ? Wc(a, t, e, s) : Bc(a, t, e, s), Zo = (a, t, e, s) => kn(a, t.target) ? Xc(a, t, e, s) : Hc(a, t, e, s), Ch = () => ({ ml: new ne({ x: -0.5, y: 0, cursorStyleHandler: ws, actionHandler: Jo, getActionName: Si }), mr: new ne({ x: 0.5, y: 0, cursorStyleHandler: ws, actionHandler: Jo, getActionName: Si }), mb: new ne({ x: 0, y: 0.5, cursorStyleHandler: ws, actionHandler: Zo, getActionName: Si }), mt: new ne({ x: 0, y: -0.5, cursorStyleHandler: ws, actionHandler: Zo, getActionName: Si }), tl: new ne({ x: -0.5, y: -0.5, cursorStyleHandler: $s, actionHandler: xi }), tr: new ne({ x: 0.5, y: -0.5, cursorStyleHandler: $s, actionHandler: xi }), bl: new ne({ x: -0.5, y: 0.5, cursorStyleHandler: $s, actionHandler: xi }), br: new ne({ x: 0.5, y: 0.5, cursorStyleHandler: $s, actionHandler: xi }), mtr: new ne({ x: 0, y: -0.5, actionHandler: Nc, cursorStyleHandler: Ic, offsetY: -40, withConnection: !0, actionName: Vr }) }), Uc = () => ({ mr: new ne({ x: 0.5, y: 0, actionHandler: Ko, cursorStyleHandler: ws, actionName: oi }), ml: new ne({ x: -0.5, y: 0, actionHandler: Ko, cursorStyleHandler: ws, actionName: oi }) }), Yc = () => w(w({}, Ch()), Uc());
2261
2261
  class hi extends Te {
2262
2262
  static getDefaults() {
2263
2263
  return w(w({}, super.getDefaults()), hi.ownDefaults);
@@ -2434,14 +2434,14 @@ class Eh {
2434
2434
  return t.multiply(this.strokeUniformScalar).scalarMultiply(e);
2435
2435
  }
2436
2436
  }
2437
- const Yc = new C();
2437
+ const $c = new C();
2438
2438
  class Ts extends Eh {
2439
2439
  static getOrthogonalRotationFactor(t, e) {
2440
2440
  const s = e ? un(t, e) : bh(t);
2441
2441
  return Math.abs(s) < Ve ? -1 : 1;
2442
2442
  }
2443
2443
  constructor(t, e, s, i) {
2444
- super(i), x(this, "AB", void 0), x(this, "AC", void 0), x(this, "alpha", void 0), x(this, "bisector", void 0), this.A = new C(t), this.B = new C(e), this.C = new C(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = un(this.AB, this.AC), this.bisector = En(Qr(this.AB.eq(Yc) ? this.AC : this.AB, this.alpha / 2));
2444
+ super(i), x(this, "AB", void 0), x(this, "AC", void 0), x(this, "alpha", void 0), x(this, "bisector", void 0), this.A = new C(t), this.B = new C(e), this.C = new C(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = un(this.AB, this.AC), this.bisector = En(Qr(this.AB.eq($c) ? this.AC : this.AB, this.alpha / 2));
2445
2445
  }
2446
2446
  calcOrthogonalProjection(t, e) {
2447
2447
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.strokeProjectionMagnitude;
@@ -2569,12 +2569,12 @@ const Mn = (a) => {
2569
2569
  return s;
2570
2570
  }));
2571
2571
  }
2572
- return $c(a);
2573
- }, $c = (a) => {
2572
+ return qc(a);
2573
+ }, qc = (a) => {
2574
2574
  const t = [];
2575
- for (let e, s = 0; s < a.length; s++) (e = qc(a, s)) !== !1 && t.push(e);
2575
+ for (let e, s = 0; s < a.length; s++) (e = Kc(a, s)) !== !1 && t.push(e);
2576
2576
  return t;
2577
- }, qc = (a, t) => {
2577
+ }, Kc = (a, t) => {
2578
2578
  const e = a.charCodeAt(t);
2579
2579
  if (isNaN(e)) return "";
2580
2580
  if (e < 55296 || e > 57343) return a.charAt(t);
@@ -2589,7 +2589,7 @@ const Mn = (a) => {
2589
2589
  if (55296 > s || s > 56319) throw "Low surrogate without preceding high surrogate";
2590
2590
  return !1;
2591
2591
  };
2592
- var Kc = Object.freeze({ __proto__: null, capitalize: function(a) {
2592
+ var Jc = Object.freeze({ __proto__: null, capitalize: function(a) {
2593
2593
  let t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2594
2594
  return "".concat(a.charAt(0).toUpperCase()).concat(t ? a.slice(1) : a.slice(1).toLowerCase());
2595
2595
  }, escapeXml: Mh, graphemeSplit: Mn });
@@ -2630,7 +2630,7 @@ function ta(a, t) {
2630
2630
  }
2631
2631
  return t.length === 0;
2632
2632
  }
2633
- function Jc(a, t) {
2633
+ function Zc(a, t) {
2634
2634
  let e = !0;
2635
2635
  const s = ta(a, t.pop());
2636
2636
  return s && t.length && (e = (function(i, n) {
@@ -2639,17 +2639,17 @@ function Jc(a, t) {
2639
2639
  return n.length === 0;
2640
2640
  })(a, t)), s && e && t.length === 0;
2641
2641
  }
2642
- const Zc = (a) => {
2642
+ const Qc = (a) => {
2643
2643
  var t;
2644
- return (t = pc[a]) !== null && t !== void 0 ? t : a;
2645
- }, Qc = new RegExp("(".concat(he, ")"), "gi"), tu = (a) => an(a.replace(Qc, " $1 ").replace(/,/gi, " "));
2644
+ return (t = mc[a]) !== null && t !== void 0 ? t : a;
2645
+ }, tu = new RegExp("(".concat(he, ")"), "gi"), eu = (a) => an(a.replace(tu, " $1 ").replace(/,/gi, " "));
2646
2646
  var ea, sa, ia, na, ra, oa, aa;
2647
- const Lt = "(".concat(he, ")"), eu = String.raw(ea || (ea = Ae(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Lt), su = String.raw(sa || (sa = Ae(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Lt), iu = String.raw(ia || (ia = Ae(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Lt, Lt, Lt), nu = String.raw(na || (na = Ae(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Lt, Lt), ru = String.raw(ra || (ra = Ae(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Lt, Lt), ou = String.raw(oa || (oa = Ae(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Lt, Lt, Lt, Lt, Lt, Lt), ro = "(?:".concat(ou, "|").concat(ru, "|").concat(iu, "|").concat(nu, "|").concat(eu, "|").concat(su, ")"), au = "(?:".concat(ro, "*)"), hu = String.raw(aa || (aa = Ae(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), au), lu = new RegExp(hu), cu = new RegExp(ro), uu = new RegExp(ro, "g");
2647
+ const Rt = "(".concat(he, ")"), su = String.raw(ea || (ea = Ae(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Rt), iu = String.raw(sa || (sa = Ae(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Rt), nu = String.raw(ia || (ia = Ae(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Rt, Rt, Rt), ru = String.raw(na || (na = Ae(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Rt, Rt), ou = String.raw(ra || (ra = Ae(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Rt, Rt), au = String.raw(oa || (oa = Ae(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Rt, Rt, Rt, Rt, Rt, Rt), ro = "(?:".concat(au, "|").concat(ou, "|").concat(nu, "|").concat(ru, "|").concat(su, "|").concat(iu, ")"), hu = "(?:".concat(ro, "*)"), lu = String.raw(aa || (aa = Ae(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), hu), cu = new RegExp(lu), uu = new RegExp(ro), du = new RegExp(ro, "g");
2648
2648
  function dn(a) {
2649
2649
  const t = [];
2650
- if (!(a = tu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !lu.test(a)) return [...Bt];
2651
- for (const e of a.matchAll(uu)) {
2652
- const s = cu.exec(e[0]);
2650
+ if (!(a = eu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !cu.test(a)) return [...Bt];
2651
+ for (const e of a.matchAll(du)) {
2652
+ const s = uu.exec(e[0]);
2653
2653
  if (!s) continue;
2654
2654
  let i = Bt;
2655
2655
  const n = s.filter(((g) => !!g)), [, r, ...o] = n, [h, l, c, u, d, f] = o.map(((g) => parseFloat(g)));
@@ -2676,7 +2676,7 @@ function dn(a) {
2676
2676
  }
2677
2677
  return Sn(t);
2678
2678
  }
2679
- function du(a, t, e, s) {
2679
+ function fu(a, t, e, s) {
2680
2680
  const i = Array.isArray(t);
2681
2681
  let n, r = t;
2682
2682
  if (a !== vt && a !== Nt || t !== It) {
@@ -2686,23 +2686,23 @@ function du(a, t, e, s) {
2686
2686
  else if (a === "visible") r = t !== It && t !== "hidden", e && e.visible === !1 && (r = !1);
2687
2687
  else if (a === "opacity") r = parseFloat(t), e && e.opacity !== void 0 && (r *= e.opacity);
2688
2688
  else if (a === "textAnchor") r = t === "start" ? J : t === "end" ? ut : X;
2689
- else if (a === "charSpacing" || a === hs) n = Rt(t, s) / s * 1e3;
2689
+ else if (a === "charSpacing" || a === hs) n = Lt(t, s) / s * 1e3;
2690
2690
  else if (a === "paintFirst") {
2691
2691
  const o = t.indexOf(vt), h = t.indexOf(Nt);
2692
2692
  r = vt, (o > -1 && h > -1 && h < o || o === -1 && h > -1) && (r = Nt);
2693
2693
  } else {
2694
2694
  if (a === "href" || a === "xlink:href" || a === "font" || a === "id") return t;
2695
2695
  if (a === "imageSmoothing") return t === "optimizeQuality";
2696
- n = i ? t.map(Rt) : Rt(t, s);
2696
+ n = i ? t.map(Lt) : Lt(t, s);
2697
2697
  }
2698
2698
  } else r = "";
2699
2699
  return !i && isNaN(n) ? r : n;
2700
2700
  }
2701
- function fu(a, t) {
2702
- const e = a.match(gc);
2701
+ function gu(a, t) {
2702
+ const e = a.match(pc);
2703
2703
  if (!e) return;
2704
2704
  const s = e[1], i = e[3], n = e[4], r = e[5], o = e[6];
2705
- s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = Rt(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
2705
+ s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = Lt(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
2706
2706
  }
2707
2707
  function Sr(a, t) {
2708
2708
  a.replace(/;\s*$/, "").split(";").forEach(((e) => {
@@ -2711,7 +2711,7 @@ function Sr(a, t) {
2711
2711
  t[s.trim().toLowerCase()] = i.trim();
2712
2712
  }));
2713
2713
  }
2714
- function gu(a) {
2714
+ function pu(a) {
2715
2715
  const t = {}, e = a.getAttribute("style");
2716
2716
  return e && (typeof e == "string" ? Sr(e, t) : (function(s, i) {
2717
2717
  Object.entries(s).forEach(((n) => {
@@ -2720,30 +2720,30 @@ function gu(a) {
2720
2720
  }));
2721
2721
  })(e, t)), t;
2722
2722
  }
2723
- const pu = { stroke: "strokeOpacity", fill: "fillOpacity" };
2723
+ const mu = { stroke: "strokeOpacity", fill: "fillOpacity" };
2724
2724
  function Ne(a, t, e) {
2725
2725
  if (!a) return {};
2726
2726
  let s, i = {}, n = zr;
2727
- a.parentNode && Xo.test(a.parentNode.nodeName) && (i = Ne(a.parentElement, t, e), i.fontSize && (s = n = Rt(i.fontSize)));
2727
+ a.parentNode && Xo.test(a.parentNode.nodeName) && (i = Ne(a.parentElement, t, e), i.fontSize && (s = n = Lt(i.fontSize)));
2728
2728
  const r = w(w(w({}, t.reduce(((l, c) => {
2729
2729
  const u = a.getAttribute(c);
2730
2730
  return u && (l[c] = u), l;
2731
2731
  }), {})), (function(l) {
2732
2732
  let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = {};
2733
- for (const d in c) Jc(l, d.split(" ")) && (u = w(w({}, u), c[d]));
2733
+ for (const d in c) Zc(l, d.split(" ")) && (u = w(w({}, u), c[d]));
2734
2734
  return u;
2735
- })(a, e)), gu(a));
2736
- r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s = Rt(r[Kn], n), r[Kn] = "".concat(s));
2735
+ })(a, e)), pu(a));
2736
+ r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s = Lt(r[Kn], n), r[Kn] = "".concat(s));
2737
2737
  const o = {};
2738
2738
  for (const l in r) {
2739
- const c = Zc(l), u = du(c, r[l], i, s);
2739
+ const c = Qc(l), u = fu(c, r[l], i, s);
2740
2740
  o[c] = u;
2741
2741
  }
2742
- o && o.font && fu(o.font, o);
2742
+ o && o.font && gu(o.font, o);
2743
2743
  const h = w(w({}, i), o);
2744
2744
  return Xo.test(a.nodeName) ? h : (function(l) {
2745
2745
  const c = Mt.getDefaults();
2746
- return Object.entries(pu).forEach(((u) => {
2746
+ return Object.entries(mu).forEach(((u) => {
2747
2747
  let [d, f] = u;
2748
2748
  if (l[f] === void 0 || l[d] === "") return;
2749
2749
  if (l[d] === void 0) {
@@ -2756,7 +2756,7 @@ function Ne(a, t, e) {
2756
2756
  })), l;
2757
2757
  })(h);
2758
2758
  }
2759
- const mu = ["left", "top", "width", "height", "visible"], Dh = ["rx", "ry"];
2759
+ const bu = ["left", "top", "width", "height", "visible"], Dh = ["rx", "ry"];
2760
2760
  class ve extends Mt {
2761
2761
  static getDefaults() {
2762
2762
  return w(w({}, super.getDefaults()), ve.ownDefaults);
@@ -2782,12 +2782,12 @@ class ve extends Mt {
2782
2782
  `)];
2783
2783
  }
2784
2784
  static async fromElement(t, e, s) {
2785
- const i = Ne(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c = st(i, mu);
2785
+ const i = Ne(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c = st(i, bu);
2786
2786
  return new this(w(w(w({}, e), c), {}, { left: n, top: r, width: o, height: h, visible: !!(l && o && h) }));
2787
2787
  }
2788
2788
  }
2789
2789
  x(ve, "type", "Rect"), x(ve, "cacheProperties", [...Ie, ...Dh]), x(ve, "ownDefaults", { rx: 0, ry: 0 }), x(ve, "ATTRIBUTE_NAMES", [...Ye, "x", "y", "rx", "ry", "width", "height"]), F.setClass(ve), F.setSVGClass(ve);
2790
- const Oe = "initialization", fn = "added", oo = "removed", gn = "imperative", Rh = (a, t) => {
2790
+ const Oe = "initialization", fn = "added", oo = "removed", gn = "imperative", Lh = (a, t) => {
2791
2791
  const { strokeUniform: e, strokeWidth: s, width: i, height: n, group: r } = t, o = r && r !== a ? mi(r.calcTransformMatrix(), a.calcTransformMatrix()) : null, h = o ? t.getRelativeCenterPoint().transform(o) : t.getRelativeCenterPoint(), l = !t.isStrokeAccountedForInDimensions(), c = e && l ? oh(new C(s, s), void 0, a.calcTransformMatrix()) : Xr, u = !e && l ? s : 0, d = An(i + u, n + u, Sn([o, t.calcOwnMatrix()], !0)).add(c).scalarDivide(2);
2792
2792
  return [h.subtract(d), h.add(d)];
2793
2793
  };
@@ -2810,7 +2810,7 @@ class On {
2810
2810
  const { type: s, target: i } = e;
2811
2811
  if (s === gn && e.overrides) return e.overrides;
2812
2812
  if (t.length === 0) return;
2813
- const { left: n, top: r, width: o, height: h } = we(t.map(((u) => Rh(i, u))).reduce(((u, d) => u.concat(d)), [])), l = new C(o, h), c = new C(n, r).add(l.scalarDivide(2));
2813
+ const { left: n, top: r, width: o, height: h } = we(t.map(((u) => Lh(i, u))).reduce(((u, d) => u.concat(d)), [])), l = new C(o, h), c = new C(n, r).add(l.scalarDivide(2));
2814
2814
  if (s === Oe) {
2815
2815
  const u = this.getInitialSize(e, { size: l, center: c });
2816
2816
  return { center: c, relativeCorrection: new C(0, 0), size: u };
@@ -2825,7 +2825,7 @@ class Cr extends On {
2825
2825
  }
2826
2826
  }
2827
2827
  x(Cr, "type", "fit-content"), F.setClass(Cr);
2828
- const bu = ["strategy"], vu = ["target", "strategy", "bubbles", "prevStrategy"], Lh = "layoutManager";
2828
+ const vu = ["strategy"], yu = ["target", "strategy", "bubbles", "prevStrategy"], Rh = "layoutManager";
2829
2829
  class li {
2830
2830
  constructor() {
2831
2831
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Cr();
@@ -2841,7 +2841,7 @@ class li {
2841
2841
  }
2842
2842
  attachHandlers(t, e) {
2843
2843
  const { target: s } = e;
2844
- return [sn, Ga, oi, Va, wn, Xa, en, sc, ic].map(((i) => t.on(i, ((n) => this.performLayout(i === sn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })))));
2844
+ return [sn, Ga, oi, Va, wn, Xa, en, ic, nc].map(((i) => t.on(i, ((n) => this.performLayout(i === sn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })))));
2845
2845
  }
2846
2846
  subscribe(t, e) {
2847
2847
  this.unsubscribe(t, e);
@@ -2860,7 +2860,7 @@ class li {
2860
2860
  onBeforeLayout(t) {
2861
2861
  const { target: e, type: s } = t, { canvas: i } = e;
2862
2862
  if (s === Oe || s === fn ? this.subscribeTargets(t) : s === oo && this.unsubscribeTargets(t), e.fire("layout:before", { context: t }), i && i.fire("object:layout:before", { target: e, context: t }), s === gn && t.deep) {
2863
- const n = st(t, bu);
2863
+ const n = st(t, vu);
2864
2864
  e.forEachObject(((r) => r.layoutManager && r.layoutManager.performLayout(w(w({}, n), {}, { bubbles: !1, target: r }))));
2865
2865
  }
2866
2866
  }
@@ -2886,7 +2886,7 @@ class li {
2886
2886
  s.set({ left: s.left + i.x, top: s.top + i.y });
2887
2887
  }
2888
2888
  onAfterLayout(t, e) {
2889
- const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = st(t, vu), { canvas: h } = s;
2889
+ const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = st(t, yu), { canvas: h } = s;
2890
2890
  s.fire("layout:after", { context: t, result: e }), h && h.fire("object:layout:after", { context: t, result: e, target: s });
2891
2891
  const l = s.parent;
2892
2892
  n && l != null && l.layoutManager && ((o.path || (o.path = [])).push(s), l.layoutManager.performLayout(w(w({}, o), {}, { target: l }))), s.set("dirty", !0);
@@ -2896,15 +2896,15 @@ class li {
2896
2896
  t.forEach(((e) => e.forEach(((s) => s())))), t.clear();
2897
2897
  }
2898
2898
  toObject() {
2899
- return { type: Lh, strategy: this.strategy.constructor.type };
2899
+ return { type: Rh, strategy: this.strategy.constructor.type };
2900
2900
  }
2901
2901
  toJSON() {
2902
2902
  return this.toObject();
2903
2903
  }
2904
2904
  }
2905
- F.setClass(li, Lh);
2906
- const yu = ["type", "objects", "layoutManager"];
2907
- class _u extends li {
2905
+ F.setClass(li, Rh);
2906
+ const _u = ["type", "objects", "layoutManager"];
2907
+ class wu extends li {
2908
2908
  performLayout() {
2909
2909
  }
2910
2910
  }
@@ -2923,7 +2923,7 @@ class qt extends Wa(Mt) {
2923
2923
  })), this.layoutManager = (s = e.layoutManager) !== null && s !== void 0 ? s : new li(), this.layoutManager.performLayout({ type: Oe, target: this, targets: [...t], x: e.left, y: e.top });
2924
2924
  }
2925
2925
  canEnterGroup(t) {
2926
- return t === this || this.isDescendantOf(t) ? (Le("error", "Group: circular object trees are not supported, this call has no effect"), !1) : this._objects.indexOf(t) === -1 || (Le("error", "Group: duplicate objects are not supported inside group, this call has no effect"), !1);
2926
+ return t === this || this.isDescendantOf(t) ? (Re("error", "Group: circular object trees are not supported, this call has no effect"), !1) : this._objects.indexOf(t) === -1 || (Re("error", "Group: duplicate objects are not supported inside group, this call has no effect"), !1);
2927
2927
  }
2928
2928
  _filterObjectsBeforeEnteringGroup(t) {
2929
2929
  return t.filter(((e, s, i) => this.canEnterGroup(e) && i.indexOf(e) === s));
@@ -2982,7 +2982,7 @@ class qt extends Wa(Mt) {
2982
2982
  t.group && t.group.remove(t), t._set("parent", this), this._enterGroup(t, e);
2983
2983
  }
2984
2984
  _enterGroup(t, e) {
2985
- e && Rs(t, dt(Xt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2985
+ e && Ls(t, dt(Xt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2986
2986
  const s = this.canvas && this.canvas.getActiveObject && this.canvas.getActiveObject();
2987
2987
  s && (s === t || t.isDescendantOf(s)) && this._activeObjects.push(t);
2988
2988
  }
@@ -2990,7 +2990,7 @@ class qt extends Wa(Mt) {
2990
2990
  this._exitGroup(t, e), t._set("parent", void 0), t._set("canvas", void 0);
2991
2991
  }
2992
2992
  _exitGroup(t, e) {
2993
- t._set("group", void 0), e || (Rs(t, dt(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2993
+ t._set("group", void 0), e || (Ls(t, dt(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2994
2994
  const s = this._activeObjects.length > 0 ? this._activeObjects.indexOf(t) : -1;
2995
2995
  s > -1 && this._activeObjects.splice(s, 1);
2996
2996
  }
@@ -3078,10 +3078,10 @@ class qt extends Wa(Mt) {
3078
3078
  return this._createBaseClipPathSVGMarkup(e, { reviver: t });
3079
3079
  }
3080
3080
  static fromObject(t, e) {
3081
- let { type: s, objects: i = [], layoutManager: n } = t, r = st(t, yu);
3081
+ let { type: s, objects: i = [], layoutManager: n } = t, r = st(t, _u);
3082
3082
  return Promise.all([Os(i, e), gi(r, e)]).then(((o) => {
3083
3083
  let [h, l] = o;
3084
- const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new _u() }));
3084
+ const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new wu() }));
3085
3085
  if (n) {
3086
3086
  const u = F.getClass(n.type), d = F.getClass(n.strategy);
3087
3087
  c.layoutManager = new u(new d());
@@ -3091,7 +3091,7 @@ class qt extends Wa(Mt) {
3091
3091
  }
3092
3092
  }
3093
3093
  x(qt, "type", "Group"), x(qt, "ownDefaults", { strokeWidth: 0, subTargetCheck: !1, interactive: !1 }), F.setClass(qt);
3094
- const Fh = (a, t) => Math.min(t.width / a.width, t.height / a.height), Ih = (a, t) => Math.max(t.width / a.width, t.height / a.height), Ar = "\\s*,?\\s*", Vs = "".concat(Ar, "(").concat(he, ")"), wu = "".concat(Vs).concat(Vs).concat(Vs).concat(Ar, "([01])").concat(Ar, "([01])").concat(Vs).concat(Vs), xu = { m: "l", M: "L" }, Su = (a, t, e, s, i, n, r, o, h, l, c) => {
3094
+ const Fh = (a, t) => Math.min(t.width / a.width, t.height / a.height), Ih = (a, t) => Math.max(t.width / a.width, t.height / a.height), Ar = "\\s*,?\\s*", Vs = "".concat(Ar, "(").concat(he, ")"), xu = "".concat(Vs).concat(Vs).concat(Vs).concat(Ar, "([01])").concat(Ar, "([01])").concat(Vs).concat(Vs), Su = { m: "l", M: "L" }, Cu = (a, t, e, s, i, n, r, o, h, l, c) => {
3095
3095
  const u = ce(a), d = ue(a), f = ce(t), g = ue(t), p = e * i * f - s * n * g + r, b = s * i * f + e * n * g + o;
3096
3096
  return ["C", l + h * (-e * i * d - s * n * u), c + h * (-s * i * d + e * n * u), p + h * (e * i * g + s * n * f), b + h * (s * i * g - e * n * f), p, b];
3097
3097
  }, ha = (a, t, e, s) => {
@@ -3127,23 +3127,23 @@ function Tr(a, t, e, s, i, n, r, o) {
3127
3127
  const y = [new C(Math.min(...d[0]), Math.min(...d[1])), new C(Math.max(...d[0]), Math.max(...d[1]))];
3128
3128
  return q.cachesBoundsOfCurve && (Zs.boundsOfCurveCache[h] = y), y;
3129
3129
  }
3130
- const Cu = (a, t, e) => {
3130
+ const Au = (a, t, e) => {
3131
3131
  let [s, i, n, r, o, h, l, c] = e;
3132
3132
  const u = ((d, f, g, p, b, m, v) => {
3133
3133
  if (g === 0 || p === 0) return [];
3134
3134
  let y = 0, _ = 0, S = 0;
3135
- const A = Math.PI, T = v * Hr, E = ue(T), O = ce(T), N = 0.5 * (-O * d - E * f), D = 0.5 * (-O * f + E * d), L = g ** 2, k = p ** 2, P = D ** 2, j = N ** 2, M = L * k - L * P - k * j;
3136
- let R = Math.abs(g), G = Math.abs(p);
3135
+ const A = Math.PI, T = v * Hr, E = ue(T), O = ce(T), N = 0.5 * (-O * d - E * f), D = 0.5 * (-O * f + E * d), R = g ** 2, k = p ** 2, P = D ** 2, j = N ** 2, M = R * k - R * P - k * j;
3136
+ let L = Math.abs(g), G = Math.abs(p);
3137
3137
  if (M < 0) {
3138
- const ge = Math.sqrt(1 - M / (L * k));
3139
- R *= ge, G *= ge;
3140
- } else S = (b === m ? -1 : 1) * Math.sqrt(M / (L * P + k * j));
3141
- const it = S * R * D / G, at = -S * G * N / R, xt = O * it - E * at + 0.5 * d, gt = E * it + O * at + 0.5 * f;
3142
- let et = ha(1, 0, (N - it) / R, (D - at) / G), Pt = ha((N - it) / R, (D - at) / G, (-N - it) / R, (-D - at) / G);
3138
+ const ge = Math.sqrt(1 - M / (R * k));
3139
+ L *= ge, G *= ge;
3140
+ } else S = (b === m ? -1 : 1) * Math.sqrt(M / (R * P + k * j));
3141
+ const it = S * L * D / G, at = -S * G * N / L, xt = O * it - E * at + 0.5 * d, gt = E * it + O * at + 0.5 * f;
3142
+ let et = ha(1, 0, (N - it) / L, (D - at) / G), Pt = ha((N - it) / L, (D - at) / G, (-N - it) / L, (-D - at) / G);
3143
3143
  m === 0 && Pt > 0 ? Pt -= 2 * A : m === 1 && Pt < 0 && (Pt += 2 * A);
3144
3144
  const fe = Math.ceil(Math.abs(Pt / A * 2)), ht = [], K = Pt / fe, je = 8 / 3 * Math.sin(K / 4) * Math.sin(K / 4) / Math.sin(K / 2);
3145
3145
  let ms = et + K;
3146
- for (let ge = 0; ge < fe; ge++) ht[ge] = Su(et, ms, O, E, R, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3146
+ for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, O, E, L, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3147
3147
  return ht;
3148
3148
  })(l - a, c - t, i, n, o, h, r);
3149
3149
  for (let d = 0, f = u.length; d < f; d++) u[d][1] += a, u[d][2] += t, u[d][3] += a, u[d][4] += t, u[d][5] += a, u[d][6] += t;
@@ -3199,7 +3199,7 @@ const Cu = (a, t, e) => {
3199
3199
  case "a":
3200
3200
  c[6] += t, c[7] += e;
3201
3201
  case "A":
3202
- Cu(t, e, c).forEach(((d) => n.push(d))), t = c[6], e = c[7];
3202
+ Au(t, e, c).forEach(((d) => n.push(d))), t = c[6], e = c[7];
3203
3203
  break;
3204
3204
  case "z":
3205
3205
  case "Z":
@@ -3211,13 +3211,13 @@ const Cu = (a, t, e) => {
3211
3211
  }, pn = (a, t, e, s) => Math.sqrt((e - a) ** 2 + (s - t) ** 2), jh = (a, t, e, s, i, n, r, o) => (h) => {
3212
3212
  const l = h ** 3, c = ((f) => 3 * f ** 2 * (1 - f))(h), u = ((f) => 3 * f * (1 - f) ** 2)(h), d = ((f) => (1 - f) ** 3)(h);
3213
3213
  return new C(r * l + i * c + e * u + a * d, o * l + n * c + s * u + t * d);
3214
- }, Bh = (a) => a ** 2, Hh = (a) => 2 * a * (1 - a), zh = (a) => (1 - a) ** 2, Au = (a, t, e, s, i, n, r, o) => (h) => {
3214
+ }, Bh = (a) => a ** 2, Hh = (a) => 2 * a * (1 - a), zh = (a) => (1 - a) ** 2, Tu = (a, t, e, s, i, n, r, o) => (h) => {
3215
3215
  const l = Bh(h), c = Hh(h), u = zh(h), d = 3 * (u * (e - a) + c * (i - e) + l * (r - i)), f = 3 * (u * (s - t) + c * (n - s) + l * (o - n));
3216
3216
  return Math.atan2(f, d);
3217
- }, Tu = (a, t, e, s, i, n) => (r) => {
3217
+ }, Eu = (a, t, e, s, i, n) => (r) => {
3218
3218
  const o = Bh(r), h = Hh(r), l = zh(r);
3219
3219
  return new C(i * o + e * h + a * l, n * o + s * h + t * l);
3220
- }, Eu = (a, t, e, s, i, n) => (r) => {
3220
+ }, ku = (a, t, e, s, i, n) => (r) => {
3221
3221
  const o = 1 - r, h = 2 * (o * (e - a) + r * (i - e)), l = 2 * (o * (s - t) + r * (n - s));
3222
3222
  return Math.atan2(l, h);
3223
3223
  }, la = (a, t, e) => {
@@ -3227,7 +3227,7 @@ const Cu = (a, t, e) => {
3227
3227
  i += pn(s.x, s.y, r.x, r.y), s = r;
3228
3228
  }
3229
3229
  return i;
3230
- }, ku = (a, t) => {
3230
+ }, Mu = (a, t) => {
3231
3231
  let e, s = 0, i = 0, n = { x: a.x, y: a.y }, r = w({}, n), o = 0.01, h = 0;
3232
3232
  const l = a.iterator, c = a.angleFinder;
3233
3233
  for (; i < t && o > 1e-4; ) r = l(s), h = s, e = pn(n.x, n.y, r.x, r.y), e + i > t ? (s -= o, o /= 2) : (n = r, s += o, i += e);
@@ -3245,10 +3245,10 @@ const Cu = (a, t, e) => {
3245
3245
  e = c, e.length = pn(i, n, l[1], l[2]), i = l[1], n = l[2];
3246
3246
  break;
3247
3247
  case "C":
3248
- t = jh(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e = c, e.iterator = t, e.angleFinder = Au(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e.length = la(t, i, n), i = l[5], n = l[6];
3248
+ t = jh(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e = c, e.iterator = t, e.angleFinder = Tu(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e.length = la(t, i, n), i = l[5], n = l[6];
3249
3249
  break;
3250
3250
  case "Q":
3251
- t = Tu(i, n, l[1], l[2], l[3], l[4]), e = c, e.iterator = t, e.angleFinder = Eu(i, n, l[1], l[2], l[3], l[4]), e.length = la(t, i, n), i = l[3], n = l[4];
3251
+ t = Eu(i, n, l[1], l[2], l[3], l[4]), e = c, e.iterator = t, e.angleFinder = ku(i, n, l[1], l[2], l[3], l[4]), e.length = la(t, i, n), i = l[3], n = l[4];
3252
3252
  break;
3253
3253
  case "Z":
3254
3254
  e = c, e.destX = r, e.destY = o, e.length = pn(i, n, r, o), i = r, n = o;
@@ -3269,32 +3269,32 @@ const Cu = (a, t, e) => {
3269
3269
  return w(w({}, new C(i.x, i.y).lerp(new C(r[1], r[2]), n)), {}, { angle: Math.atan2(r[2] - i.y, r[1] - i.x) });
3270
3270
  case "C":
3271
3271
  case "Q":
3272
- return ku(i, t);
3272
+ return Mu(i, t);
3273
3273
  }
3274
- }, Mu = new RegExp("[mzlhvcsqta][^mzlhvcsqta]*", "gi"), ca = new RegExp(wu, "g"), Pu = new RegExp(he, "gi"), Ou = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7 }, Vh = (a) => {
3274
+ }, Pu = new RegExp("[mzlhvcsqta][^mzlhvcsqta]*", "gi"), ca = new RegExp(xu, "g"), Ou = new RegExp(he, "gi"), Du = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7 }, Vh = (a) => {
3275
3275
  var t;
3276
- const e = [], s = (t = a.match(Mu)) !== null && t !== void 0 ? t : [];
3276
+ const e = [], s = (t = a.match(Pu)) !== null && t !== void 0 ? t : [];
3277
3277
  for (const i of s) {
3278
3278
  const n = i[0];
3279
3279
  if (n === "z" || n === "Z") {
3280
3280
  e.push([n]);
3281
3281
  continue;
3282
3282
  }
3283
- const r = Ou[n.toLowerCase()];
3283
+ const r = Du[n.toLowerCase()];
3284
3284
  let o = [];
3285
3285
  if (n === "a" || n === "A") {
3286
3286
  ca.lastIndex = 0;
3287
3287
  for (let h = null; h = ca.exec(i); ) o.push(...h.slice(1));
3288
- } else o = i.match(Pu) || [];
3288
+ } else o = i.match(Ou) || [];
3289
3289
  for (let h = 0; h < o.length; h += r) {
3290
- const l = new Array(r), c = xu[n];
3290
+ const l = new Array(r), c = Su[n];
3291
3291
  l[0] = h > 0 && c ? c : n;
3292
3292
  for (let u = 0; u < r; u++) l[u + 1] = parseFloat(o[h + u]);
3293
3293
  e.push(l);
3294
3294
  }
3295
3295
  }
3296
3296
  return e;
3297
- }, Du = function(a) {
3297
+ }, Lu = function(a) {
3298
3298
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, e = new C(a[0]), s = new C(a[1]), i = 1, n = 0;
3299
3299
  const r = [], o = a.length, h = o > 2;
3300
3300
  let l;
@@ -3336,11 +3336,11 @@ const Ji = (a, t) => {
3336
3336
  }
3337
3337
  })(a), e = e.transform(a.transformMatrix)), delete a.transformMatrix, t && (a.scaleX *= t.scaleX, a.scaleY *= t.scaleY, a.cropX = t.cropX, a.cropY = t.cropY, e.x += t.offsetLeft, e.y += t.offsetTop, a.width = t.width, a.height = t.height), a.setPositionByOrigin(e, X, X);
3338
3338
  };
3339
- var Lu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so, animateColor: _h, applyTransformToObject: Rs, calcAngleBetweenVectors: un, calcDimensionsMatrix: fi, calcPlaneChangeMatrix: mi, calcVectorRotation: bh, cancelAnimFrame: Ya, capValue: ls, composeMatrix: Za, copyCanvasElement: (a) => {
3339
+ var Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so, animateColor: _h, applyTransformToObject: Ls, calcAngleBetweenVectors: un, calcDimensionsMatrix: fi, calcPlaneChangeMatrix: mi, calcVectorRotation: bh, cancelAnimFrame: Ya, capValue: ls, composeMatrix: Za, copyCanvasElement: (a) => {
3340
3340
  var t;
3341
3341
  const e = Jt(a);
3342
3342
  return (t = e.getContext("2d")) === null || t === void 0 || t.drawImage(a, 0, 0), e;
3343
- }, cos: ce, createCanvasElement: Se, createImage: $a, createRotateMatrix: ds, createScaleMatrix: Cn, createSkewXMatrix: Yr, createSkewYMatrix: $r, createTranslateMatrix: js, createVector: ln, crossProduct: As, degreesToRadians: lt, dotProduct: vh, ease: wc, enlivenObjectEnlivables: gi, enlivenObjects: Os, findScaleToCover: Ih, findScaleToFit: Fh, getBoundsOfCurve: Tr, getOrthonormalVector: to, getPathSegmentsInfo: ao, getPointOnPath: Gh, getPointer: ih, getRandomInt: Ru, getRegularPolygonPath: (a, t) => {
3343
+ }, cos: ce, createCanvasElement: Se, createImage: $a, createRotateMatrix: ds, createScaleMatrix: Cn, createSkewXMatrix: Yr, createSkewYMatrix: $r, createTranslateMatrix: js, createVector: ln, crossProduct: As, degreesToRadians: lt, dotProduct: vh, ease: xc, enlivenObjectEnlivables: gi, enlivenObjects: Os, findScaleToCover: Ih, findScaleToFit: Fh, getBoundsOfCurve: Tr, getOrthonormalVector: to, getPathSegmentsInfo: ao, getPointOnPath: Gh, getPointer: ih, getRandomInt: Ru, getRegularPolygonPath: (a, t) => {
3344
3344
  const e = 2 * Math.PI / a;
3345
3345
  let s = -Ve;
3346
3346
  a % 2 == 0 && (s += e / 2);
@@ -3350,7 +3350,7 @@ var Lu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
3350
3350
  i[n] = [n === 0 ? "M" : "L", o, h];
3351
3351
  }
3352
3352
  return i[a] = ["Z"], i;
3353
- }, getSmoothPathFromPoints: Du, getSvgAttributes: (a) => {
3353
+ }, getSmoothPathFromPoints: Lu, getSvgAttributes: (a) => {
3354
3354
  const t = ["instantiated_by_use", "style", "id", "class"];
3355
3355
  switch (a) {
3356
3356
  case "linearGradient":
@@ -3367,10 +3367,10 @@ var Lu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
3367
3367
  s.inverted && !i.inverted && (s = t, i = a), yr(i, (e = i.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
3368
3368
  const n = s.inverted && i.inverted;
3369
3369
  return n && (s.inverted = i.inverted = !1), new qt([s], { clipPath: i, inverted: n });
3370
- }, multiplyTransformMatrices: dt, multiplyTransformMatrixArray: Sn, parsePath: Vh, parsePreserveAspectRatioAttribute: Zr, parseUnit: Rt, pick: fs, projectStrokeOnPoints: kh, qrDecompose: as, radiansToDegrees: Ce, removeFromArray: qe, removeTransformFromObject: (a, t) => {
3370
+ }, multiplyTransformMatrices: dt, multiplyTransformMatrixArray: Sn, parsePath: Vh, parsePreserveAspectRatioAttribute: Zr, parseUnit: Lt, pick: fs, projectStrokeOnPoints: kh, qrDecompose: as, radiansToDegrees: Ce, removeFromArray: qe, removeTransformFromObject: (a, t) => {
3371
3371
  const e = Xt(t), s = dt(e, a.calcOwnMatrix());
3372
- Rs(a, s);
3373
- }, removeTransformMatrixForSvgParsing: Ji, request: Wh, requestAnimFrame: Qs, resetObjectTransform: rh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: Qr, saveObjectTransform: Kr, sendObjectToPlane: yr, sendPointToPlane: os, sendVectorToPlane: oh, setStyle: mn, sin: ue, sizeAfterTransform: An, string: Kc, stylesFromArray: Oh, stylesToArray: Ph, toBlob: Ur, toDataURL: Wr, toFixed: Q, transformPath: (a, t, e) => (e && (t = dt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
3372
+ Ls(a, s);
3373
+ }, removeTransformMatrixForSvgParsing: Ji, request: Wh, requestAnimFrame: Qs, resetObjectTransform: rh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: Qr, saveObjectTransform: Kr, sendObjectToPlane: yr, sendPointToPlane: os, sendVectorToPlane: oh, setStyle: mn, sin: ue, sizeAfterTransform: An, string: Jc, stylesFromArray: Oh, stylesToArray: Ph, toBlob: Ur, toDataURL: Wr, toFixed: Q, transformPath: (a, t, e) => (e && (t = dt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
3374
3374
  const i = [...s];
3375
3375
  for (let n = 1; n < s.length - 1; n += 2) {
3376
3376
  const { x: r, y: o } = At({ x: s[n], y: s[n + 1] }, t);
@@ -3378,7 +3378,7 @@ var Lu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
3378
3378
  }
3379
3379
  return i;
3380
3380
  }))), transformPoint: At });
3381
- class Fu extends sh {
3381
+ class Iu extends sh {
3382
3382
  constructor(t) {
3383
3383
  let { allowTouchScrolling: e = !1, containerClass: s = "" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3384
3384
  super(t), x(this, "upper", void 0), x(this, "container", void 0);
@@ -3393,11 +3393,11 @@ class Fu extends sh {
3393
3393
  }
3394
3394
  createContainerElement() {
3395
3395
  const t = Fs().createElement("div");
3396
- return t.setAttribute("data-fabric", "wrapper"), mn(t, { position: "relative" }), Lo(t), t;
3396
+ return t.setAttribute("data-fabric", "wrapper"), mn(t, { position: "relative" }), Ro(t), t;
3397
3397
  }
3398
3398
  applyCanvasStyle(t, e) {
3399
3399
  const { styles: s, allowTouchScrolling: i } = e;
3400
- mn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : It })), Lo(t);
3400
+ mn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : It })), Ro(t);
3401
3401
  }
3402
3402
  setDimensions(t, e) {
3403
3403
  super.setDimensions(t, e);
@@ -3434,7 +3434,7 @@ class Dn extends pi {
3434
3434
  return this.elements.container;
3435
3435
  }
3436
3436
  initElements(t) {
3437
- this.elements = new Fu(t, { allowTouchScrolling: this.allowTouchScrolling, containerClass: this.containerClass }), this._createCacheCanvas();
3437
+ this.elements = new Iu(t, { allowTouchScrolling: this.allowTouchScrolling, containerClass: this.containerClass }), this._createCacheCanvas();
3438
3438
  }
3439
3439
  _onObjectAdded(t) {
3440
3440
  this._objectsToRender = void 0, super._onObjectAdded(t);
@@ -3491,7 +3491,7 @@ class Dn extends pi {
3491
3491
  }
3492
3492
  _setupCurrentTransform(t, e, s) {
3493
3493
  var i;
3494
- const n = e.group ? os(this.getScenePoint(t), void 0, e.group.calcTransformMatrix()) : this.getScenePoint(t), { key: r = "", control: o } = e.getActiveControl() || {}, h = s && o ? (i = o.getActionHandler(t, e, o)) === null || i === void 0 ? void 0 : i.bind(o) : uc, l = ((f, g, p, b) => {
3494
+ const n = e.group ? os(this.getScenePoint(t), void 0, e.group.calcTransformMatrix()) : this.getScenePoint(t), { key: r = "", control: o } = e.getActiveControl() || {}, h = s && o ? (i = o.getActionHandler(t, e, o)) === null || i === void 0 ? void 0 : i.bind(o) : dc, l = ((f, g, p, b) => {
3495
3495
  if (!g || !f) return "drag";
3496
3496
  const m = b.controls[g];
3497
3497
  return m.getActionName(p, m, b);
@@ -3667,7 +3667,7 @@ class Dn extends pi {
3667
3667
  }
3668
3668
  }
3669
3669
  x(Dn, "ownDefaults", { uniformScaling: !0, uniScaleKey: "shiftKey", centeredScaling: !1, centeredRotation: !1, centeredKey: "altKey", altActionKey: "shiftKey", selection: !0, selectionKey: "shiftKey", selectionColor: "rgba(100, 100, 255, 0.3)", selectionDashArray: [], selectionBorderColor: "rgba(255, 255, 255, 0.3)", selectionLineWidth: 1, selectionFullyContained: !1, hoverCursor: "move", moveCursor: "move", defaultCursor: "default", freeDrawingCursor: "crosshair", notAllowedCursor: "not-allowed", perPixelTargetFind: !1, targetFindTolerance: 0, skipTargetFind: !1, stopContextMenu: !1, fireRightClick: !1, fireMiddleClick: !1, enablePointerEvents: !1, containerClass: "canvas-container", preserveObjectStacking: !1 });
3670
- class Iu {
3670
+ class Nu {
3671
3671
  constructor(t) {
3672
3672
  x(this, "targets", []), x(this, "__disposer", void 0);
3673
3673
  const e = () => {
@@ -3704,7 +3704,7 @@ class Iu {
3704
3704
  this.clear(), this.__disposer(), delete this.__disposer;
3705
3705
  }
3706
3706
  }
3707
- const Nu = ["target", "oldTarget", "fireCanvas", "e"], Ut = { passive: !1 }, ys = (a, t) => {
3707
+ const ju = ["target", "oldTarget", "fireCanvas", "e"], Ut = { passive: !1 }, ys = (a, t) => {
3708
3708
  const e = a.getViewportPoint(t), s = a.getScenePoint(t);
3709
3709
  return { viewportPoint: e, scenePoint: s, pointer: e, absolutePointer: s };
3710
3710
  }, He = function(a) {
@@ -3713,10 +3713,10 @@ const Nu = ["target", "oldTarget", "fireCanvas", "e"], Ut = { passive: !1 }, ys
3713
3713
  }, Zt = function(a) {
3714
3714
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) e[s - 1] = arguments[s];
3715
3715
  return a.removeEventListener(...e);
3716
- }, ju = { mouse: { in: "over", out: "out", targetIn: "mouseover", targetOut: "mouseout", canvasIn: "mouse:over", canvasOut: "mouse:out" }, drag: { in: "enter", out: "leave", targetIn: "dragenter", targetOut: "dragleave", canvasIn: "drag:enter", canvasOut: "drag:leave" } };
3716
+ }, Bu = { mouse: { in: "over", out: "out", targetIn: "mouseover", targetOut: "mouseout", canvasIn: "mouse:over", canvasOut: "mouse:out" }, drag: { in: "enter", out: "leave", targetIn: "dragenter", targetOut: "dragleave", canvasIn: "drag:enter", canvasOut: "drag:leave" } };
3717
3717
  class Er extends Dn {
3718
3718
  constructor(t) {
3719
- super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), x(this, "_isClick", void 0), x(this, "textEditingManager", new Iu(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach(((e) => {
3719
+ super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), x(this, "_isClick", void 0), x(this, "textEditingManager", new Nu(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach(((e) => {
3720
3720
  this[e] = this[e].bind(this);
3721
3721
  })), this.addOrRemove(He, "add");
3722
3722
  }
@@ -3960,8 +3960,8 @@ class Er extends Dn {
3960
3960
  this._draggedoverTarget = t;
3961
3961
  }
3962
3962
  fireSyntheticInOutEvents(t, e) {
3963
- let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = st(e, Nu);
3964
- const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = ju[t], d = i !== s;
3963
+ let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = st(e, ju);
3964
+ const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = Bu[t], d = i !== s;
3965
3965
  if (i && d) {
3966
3966
  const f = w(w({}, o), {}, { e: r, target: i, nextTarget: s }, ys(this, r));
3967
3967
  n && this.fire(u, f), i.fire(l, f);
@@ -4029,7 +4029,7 @@ class Er extends Dn {
4029
4029
  this.removeListeners(), this.textEditingManager.dispose(), super.destroy();
4030
4030
  }
4031
4031
  }
4032
- const Uh = { x1: 0, y1: 0, x2: 0, y2: 0 }, Bu = w(w({}, Uh), {}, { r1: 0, r2: 0 }), xs = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4032
+ const Uh = { x1: 0, y1: 0, x2: 0, y2: 0 }, Hu = w(w({}, Uh), {}, { r1: 0, r2: 0 }), xs = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4033
4033
  function Yh(a) {
4034
4034
  return a && /%$/.test(a) && Number.isFinite(parseFloat(a));
4035
4035
  }
@@ -4037,24 +4037,24 @@ function $h(a, t) {
4037
4037
  const e = typeof a == "number" ? a : typeof a == "string" ? parseFloat(a) / (Yh(a) ? 100 : 1) : NaN;
4038
4038
  return ls(0, xs(e, t), 1);
4039
4039
  }
4040
- const Hu = /\s*;\s*/, zu = /\s*:\s*/;
4041
- function Gu(a, t) {
4040
+ const zu = /\s*;\s*/, Gu = /\s*:\s*/;
4041
+ function Vu(a, t) {
4042
4042
  let e, s;
4043
4043
  const i = a.getAttribute("style");
4044
4044
  if (i) {
4045
- const r = i.split(Hu);
4045
+ const r = i.split(zu);
4046
4046
  r[r.length - 1] === "" && r.pop();
4047
4047
  for (let o = r.length; o--; ) {
4048
- const [h, l] = r[o].split(zu).map(((c) => c.trim()));
4048
+ const [h, l] = r[o].split(Gu).map(((c) => c.trim()));
4049
4049
  h === "stop-color" ? e = l : h === "stop-opacity" && (s = l);
4050
4050
  }
4051
4051
  }
4052
4052
  const n = new Z(e || a.getAttribute("stop-color") || "rgb(0,0,0)");
4053
4053
  return { offset: $h(a.getAttribute("offset"), 0), color: n.toRgb(), opacity: xs(parseFloat(s || a.getAttribute("stop-opacity") || ""), 1) * n.getAlpha() * t };
4054
4054
  }
4055
- function Vu(a, t) {
4055
+ function Xu(a, t) {
4056
4056
  const e = [], s = a.getElementsByTagName("stop"), i = $h(t, 1);
4057
- for (let n = s.length; n--; ) e.push(Gu(s[n], i));
4057
+ for (let n = s.length; n--; ) e.push(Vu(s[n], i));
4058
4058
  return e;
4059
4059
  }
4060
4060
  function qh(a) {
@@ -4066,7 +4066,7 @@ function Kh(a) {
4066
4066
  function ie(a, t) {
4067
4067
  return a.getAttribute(t);
4068
4068
  }
4069
- function Xu(a, t) {
4069
+ function Wu(a, t) {
4070
4070
  return (function(e, s) {
4071
4071
  let i, { width: n, height: r, gradientUnits: o } = s;
4072
4072
  return Object.entries(e).reduce(((h, l) => {
@@ -4088,7 +4088,7 @@ function Xu(a, t) {
4088
4088
  class qs {
4089
4089
  constructor(t) {
4090
4090
  const { type: e = "linear", gradientUnits: s = "pixels", coords: i = {}, colorStops: n = [], offsetX: r = 0, offsetY: o = 0, gradientTransform: h, id: l } = t || {};
4091
- Object.assign(this, { type: e, gradientUnits: s, coords: w(w({}, e === "radial" ? Bu : Uh), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: l ? "".concat(l, "_").concat(Xe()) : Xe() });
4091
+ Object.assign(this, { type: e, gradientUnits: s, coords: w(w({}, e === "radial" ? Hu : Uh), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: l ? "".concat(l, "_").concat(Xe()) : Xe() });
4092
4092
  }
4093
4093
  addColorStop(t) {
4094
4094
  for (const e in t) {
@@ -4145,17 +4145,17 @@ class qs {
4145
4145
  }
4146
4146
  static fromElement(t, e, s) {
4147
4147
  const i = Kh(t), n = e._findCenterFromElement();
4148
- return new this(w({ id: t.getAttribute("id") || void 0, type: qh(t), coords: Xu(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: Vu(t, s.opacity), gradientUnits: i, gradientTransform: dn(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4148
+ return new this(w({ id: t.getAttribute("id") || void 0, type: qh(t), coords: Wu(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: Xu(t, s.opacity), gradientUnits: i, gradientTransform: dn(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4149
4149
  }
4150
4150
  }
4151
4151
  x(qs, "type", "Gradient"), F.setClass(qs, "gradient"), F.setClass(qs, "linear"), F.setClass(qs, "radial");
4152
- const Wu = ["type", "source", "patternTransform"];
4152
+ const Uu = ["type", "source", "patternTransform"];
4153
4153
  class er {
4154
4154
  get type() {
4155
4155
  return "pattern";
4156
4156
  }
4157
4157
  set type(t) {
4158
- Le("warn", "Setting type has no effect", t);
4158
+ Re("warn", "Setting type has no effect", t);
4159
4159
  }
4160
4160
  constructor(t) {
4161
4161
  x(this, "repeat", "repeat"), x(this, "offsetX", 0), x(this, "offsetY", 0), x(this, "crossOrigin", ""), this.id = Xe(), Object.assign(this, t);
@@ -4184,16 +4184,16 @@ class er {
4184
4184
  `);
4185
4185
  }
4186
4186
  static async fromObject(t, e) {
4187
- let { type: s, source: i, patternTransform: n } = t, r = st(t, Wu);
4187
+ let { type: s, source: i, patternTransform: n } = t, r = st(t, Uu);
4188
4188
  const o = await ti(i, w(w({}, e), {}, { crossOrigin: r.crossOrigin }));
4189
4189
  return new this(w(w({}, r), {}, { patternTransform: n && n.slice(0), source: o }));
4190
4190
  }
4191
4191
  }
4192
4192
  x(er, "type", "Pattern"), F.setClass(er), F.setClass(er, "pattern");
4193
- const Uu = ["path", "left", "top"], Yu = ["d"];
4193
+ const Yu = ["path", "left", "top"], $u = ["d"];
4194
4194
  class Je extends Mt {
4195
4195
  constructor(t) {
4196
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = st(e, Uu);
4196
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = st(e, Yu);
4197
4197
  super(), Object.assign(this, Je.ownDefaults), this.setOptions(r), this._setPath(t || [], !0), typeof i == "number" && this.set(J, i), typeof n == "number" && this.set(Wt, n);
4198
4198
  }
4199
4199
  _setPath(t, e) {
@@ -4295,11 +4295,11 @@ class Je extends Mt {
4295
4295
  }
4296
4296
  static async fromElement(t, e, s) {
4297
4297
  const i = Ne(t, this.ATTRIBUTE_NAMES, s), { d: n } = i;
4298
- return new this(n, w(w(w({}, st(i, Yu)), e), {}, { left: void 0, top: void 0 }));
4298
+ return new this(n, w(w(w({}, st(i, $u)), e), {}, { left: void 0, top: void 0 }));
4299
4299
  }
4300
4300
  }
4301
4301
  x(Je, "type", "Path"), x(Je, "cacheProperties", [...Ie, "path", "fillRule"]), x(Je, "ATTRIBUTE_NAMES", [...Ye, "d"]), F.setClass(Je), F.setSVGClass(Je);
4302
- const $u = ["left", "top", "radius"], Jh = ["radius", "startAngle", "endAngle", "counterClockwise"];
4302
+ const qu = ["left", "top", "radius"], Jh = ["radius", "startAngle", "endAngle", "counterClockwise"];
4303
4303
  class Me extends Mt {
4304
4304
  static getDefaults() {
4305
4305
  return w(w({}, super.getDefaults()), Me.ownDefaults);
@@ -4338,14 +4338,14 @@ class Me extends Mt {
4338
4338
  }
4339
4339
  static async fromElement(t, e, s) {
4340
4340
  const i = Ne(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, radius: o = 0 } = i;
4341
- return new this(w(w({}, st(i, $u)), {}, { radius: o, left: n - o, top: r - o }));
4341
+ return new this(w(w({}, st(i, qu)), {}, { radius: o, left: n - o, top: r - o }));
4342
4342
  }
4343
4343
  static fromObject(t) {
4344
4344
  return super._fromObject(t);
4345
4345
  }
4346
4346
  }
4347
4347
  x(Me, "type", "Circle"), x(Me, "cacheProperties", [...Ie, ...Jh]), x(Me, "ownDefaults", { radius: 0, startAngle: 0, endAngle: 360, counterClockwise: !1 }), x(Me, "ATTRIBUTE_NAMES", ["cx", "cy", "r", ...Ye]), F.setClass(Me), F.setSVGClass(Me);
4348
- const qu = ["x1", "y1", "x2", "y2"], Ku = ["x1", "y1", "x2", "y2"], kr = ["x1", "x2", "y1", "y2"];
4348
+ const Ku = ["x1", "y1", "x2", "y2"], Ju = ["x1", "y1", "x2", "y2"], kr = ["x1", "x2", "y1", "y2"];
4349
4349
  class Ze extends Mt {
4350
4350
  constructor() {
4351
4351
  let [t, e, s, i] = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [0, 0, 0, 0], n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -4392,10 +4392,10 @@ class Ze extends Mt {
4392
4392
  }
4393
4393
  static async fromElement(t, e, s) {
4394
4394
  const i = Ne(t, this.ATTRIBUTE_NAMES, s), { x1: n = 0, y1: r = 0, x2: o = 0, y2: h = 0 } = i;
4395
- return new this([n, r, o, h], st(i, qu));
4395
+ return new this([n, r, o, h], st(i, Ku));
4396
4396
  }
4397
4397
  static fromObject(t) {
4398
- let { x1: e, y1: s, x2: i, y2: n } = t, r = st(t, Ku);
4398
+ let { x1: e, y1: s, x2: i, y2: n } = t, r = st(t, Ju);
4399
4399
  return this._fromObject(w(w({}, r), {}, { points: [e, s, i, n] }), { extraParam: "points" });
4400
4400
  }
4401
4401
  }
@@ -4457,14 +4457,14 @@ class Pe extends Mt {
4457
4457
  return i.left = (i.left || 0) - i.rx, i.top = (i.top || 0) - i.ry, new this(i);
4458
4458
  }
4459
4459
  }
4460
- function Ju(a) {
4460
+ function Zu(a) {
4461
4461
  if (!a) return [];
4462
4462
  const t = a.replace(/,/g, " ").trim().split(/\s+/), e = [];
4463
4463
  for (let s = 0; s < t.length; s += 2) e.push({ x: parseFloat(t[s]), y: parseFloat(t[s + 1]) });
4464
4464
  return e;
4465
4465
  }
4466
4466
  x(Pe, "type", "Ellipse"), x(Pe, "cacheProperties", [...Ie, ...Zh]), x(Pe, "ownDefaults", { rx: 0, ry: 0 }), x(Pe, "ATTRIBUTE_NAMES", [...Ye, "cx", "cy", "rx", "ry"]), F.setClass(Pe), F.setSVGClass(Pe);
4467
- const Zu = ["left", "top"], Qh = { exactBoundingBox: !1 };
4467
+ const Qu = ["left", "top"], Qh = { exactBoundingBox: !1 };
4468
4468
  class oe extends Mt {
4469
4469
  static getDefaults() {
4470
4470
  return w(w({}, super.getDefaults()), oe.ownDefaults);
@@ -4554,7 +4554,7 @@ class oe extends Mt {
4554
4554
  return this.points.length;
4555
4555
  }
4556
4556
  static async fromElement(t, e, s) {
4557
- return new this(Ju(t.getAttribute("points")), w(w({}, st(Ne(t, this.ATTRIBUTE_NAMES, s), Zu)), e));
4557
+ return new this(Zu(t.getAttribute("points")), w(w({}, st(Ne(t, this.ATTRIBUTE_NAMES, s), Qu)), e));
4558
4558
  }
4559
4559
  static fromObject(t) {
4560
4560
  return this._fromObject(t, { extraParam: "points" });
@@ -4647,8 +4647,8 @@ class tl extends Mt {
4647
4647
  delete this.styles[t];
4648
4648
  }
4649
4649
  }
4650
- x(tl, "_styleProperties", dc);
4651
- const Qu = / +/g, td = /"/g;
4650
+ x(tl, "_styleProperties", fc);
4651
+ const td = / +/g, ed = /"/g;
4652
4652
  function sr(a, t, e, s, i) {
4653
4653
  return " ".concat((function(n, r) {
4654
4654
  let { left: o, top: h, width: l, height: c } = r, u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : q.NUM_FRACTION_DIGITS;
@@ -4657,7 +4657,7 @@ function sr(a, t, e, s, i) {
4657
4657
  })(a, { left: t, top: e, width: s, height: i }), `
4658
4658
  `);
4659
4659
  }
4660
- const ed = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
4660
+ const sd = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
4661
4661
  let ir;
4662
4662
  class Ct extends tl {
4663
4663
  static getDefaults() {
@@ -4932,17 +4932,17 @@ class Ct extends tl {
4932
4932
  let p = 0, b = 0, m = this.getValueOfPropertyAt(l, 0, e), v = this.getValueOfPropertyAt(l, 0, vt), y = this.getValueOfPropertyAt(l, 0, hs), _ = m, S = v, A = y;
4933
4933
  const T = s + f * (1 - this._fontSizeFraction);
4934
4934
  let E = this.getHeightOfChar(l, 0), O = this.getValueOfPropertyAt(l, 0, "deltaY");
4935
- for (let L = 0, k = d.length; L < k; L++) {
4936
- const P = this.__charBounds[l][L];
4937
- _ = this.getValueOfPropertyAt(l, L, e), S = this.getValueOfPropertyAt(l, L, vt), A = this.getValueOfPropertyAt(l, L, hs);
4938
- const j = this.getHeightOfChar(l, L), M = this.getValueOfPropertyAt(l, L, "deltaY");
4935
+ for (let R = 0, k = d.length; R < k; R++) {
4936
+ const P = this.__charBounds[l][R];
4937
+ _ = this.getValueOfPropertyAt(l, R, e), S = this.getValueOfPropertyAt(l, R, vt), A = this.getValueOfPropertyAt(l, R, hs);
4938
+ const j = this.getHeightOfChar(l, R), M = this.getValueOfPropertyAt(l, R, "deltaY");
4939
4939
  if (n && _ && S) {
4940
- const R = this.fontSize * A / 1e3;
4941
- t.save(), t.fillStyle = v, t.translate(P.renderLeft, P.renderTop), t.rotate(P.angle), t.fillRect(-P.kernedWidth / 2, h * j + M - o * R, P.kernedWidth, R), t.restore();
4940
+ const L = this.fontSize * A / 1e3;
4941
+ t.save(), t.fillStyle = v, t.translate(P.renderLeft, P.renderTop), t.rotate(P.angle), t.fillRect(-P.kernedWidth / 2, h * j + M - o * L, P.kernedWidth, L), t.restore();
4942
4942
  } else if ((_ !== m || S !== v || j !== E || A !== y || M !== O) && b > 0) {
4943
- const R = this.fontSize * y / 1e3;
4943
+ const L = this.fontSize * y / 1e3;
4944
4944
  let G = i + g + p;
4945
- this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + O - o * R, b, R)), p = P.left, b = P.width, m = _, y = A, v = S, E = j, O = M;
4945
+ this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + O - o * L, b, L)), p = P.left, b = P.width, m = _, y = A, v = S, E = j, O = M;
4946
4946
  } else b += P.kernedWidth;
4947
4947
  }
4948
4948
  let N = i + g + p;
@@ -4986,7 +4986,7 @@ class Ct extends tl {
4986
4986
  return 1;
4987
4987
  }
4988
4988
  static async fromElement(t, e, s) {
4989
- const i = Ne(t, Ct.ATTRIBUTE_NAMES, s), n = w(w({}, e), i), { textAnchor: r = J, textDecoration: o = "", dx: h = 0, dy: l = 0, top: c = 0, left: u = 0, fontSize: d = zr, strokeWidth: f = 1 } = n, g = st(n, ed), p = new this(an(t.textContent || "").trim(), w({ left: u + h, top: c + l, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: d }, g)), b = p.getScaledHeight() / p.height, m = ((p.height + p.strokeWidth) * p.lineHeight - p.height) * b, v = p.getScaledHeight() + m;
4989
+ const i = Ne(t, Ct.ATTRIBUTE_NAMES, s), n = w(w({}, e), i), { textAnchor: r = J, textDecoration: o = "", dx: h = 0, dy: l = 0, top: c = 0, left: u = 0, fontSize: d = zr, strokeWidth: f = 1 } = n, g = st(n, sd), p = new this(an(t.textContent || "").trim(), w({ left: u + h, top: c + l, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: d }, g)), b = p.getScaledHeight() / p.height, m = ((p.height + p.strokeWidth) * p.lineHeight - p.height) * b, v = p.getScaledHeight() + m;
4990
4990
  let y = 0;
4991
4991
  return r === X && (y = p.getScaledWidth() / 2), r === ut && (y = p.getScaledWidth()), p.set({ left: p.left - y, top: p.top - (v - p.fontSize * (0.07 + p._fontSizeFraction)) / p.lineHeight, strokeWidth: f }), p;
4992
4992
  }
@@ -4994,7 +4994,7 @@ class Ct extends tl {
4994
4994
  return this._fromObject(w(w({}, t), {}, { styles: Oh(t.styles || {}, t.text) }), { extraParam: "text" });
4995
4995
  }
4996
4996
  }
4997
- x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(Ct, "ownDefaults", fc), x(Ct, "type", "Text"), x(Ct, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), x(Ct, "ATTRIBUTE_NAMES", Ye.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), Ah(Ct, [class extends uh {
4997
+ x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(Ct, "ownDefaults", gc), x(Ct, "type", "Text"), x(Ct, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), x(Ct, "ATTRIBUTE_NAMES", Ye.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), Ah(Ct, [class extends uh {
4998
4998
  _toSVG() {
4999
4999
  const a = this._getSVGLeftTopOffsets(), t = this._getSVGTextAndBg(a.textTop, a.textLeft);
5000
5000
  return this._wrapSVGTextAndBg(t);
@@ -5009,7 +5009,7 @@ x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(C
5009
5009
  _wrapSVGTextAndBg(a) {
5010
5010
  let { textBgRects: t, textSpans: e } = a;
5011
5011
  const s = this.getSvgTextDecoration(this);
5012
- return [t.join(""), ' <text xml:space="preserve" ', 'font-family="'.concat(this.fontFamily.replace(td, "'"), '" '), 'font-size="'.concat(this.fontSize, '" '), this.fontStyle ? 'font-style="'.concat(this.fontStyle, '" ') : "", this.fontWeight ? 'font-weight="'.concat(this.fontWeight, '" ') : "", s ? 'text-decoration="'.concat(s, '" ') : "", this.direction === "rtl" ? 'direction="'.concat(this.direction, '" ') : "", 'style="', this.getSvgStyles(!0), '"', this.addPaintOrder(), " >", e.join(""), `</text>
5012
+ return [t.join(""), ' <text xml:space="preserve" ', 'font-family="'.concat(this.fontFamily.replace(ed, "'"), '" '), 'font-size="'.concat(this.fontSize, '" '), this.fontStyle ? 'font-style="'.concat(this.fontStyle, '" ') : "", this.fontWeight ? 'font-weight="'.concat(this.fontWeight, '" ') : "", s ? 'text-decoration="'.concat(s, '" ') : "", this.direction === "rtl" ? 'direction="'.concat(this.direction, '" ') : "", 'style="', this.getSvgStyles(!0), '"', this.addPaintOrder(), " >", e.join(""), `</text>
5013
5013
  `];
5014
5014
  }
5015
5015
  _getSVGTextAndBg(a, t) {
@@ -5020,7 +5020,7 @@ x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(C
5020
5020
  return { textSpans: e, textBgRects: s };
5021
5021
  }
5022
5022
  _createTextCharSpan(a, t, e, s, i) {
5023
- const n = q.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(Qu)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(Q(h, n), '" ') : "", { angle: c, renderLeft: u, renderTop: d, width: f } = i;
5023
+ const n = q.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(td)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(Q(h, n), '" ') : "", { angle: c, renderLeft: u, renderTop: d, width: f } = i;
5024
5024
  let g = "";
5025
5025
  if (u !== void 0) {
5026
5026
  const p = f / 2;
@@ -5064,7 +5064,7 @@ x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(C
5064
5064
  return ["overline", "underline", "line-through"].filter(((t) => a[t.replace("-", "")])).join(" ");
5065
5065
  }
5066
5066
  }]), F.setClass(Ct), F.setSVGClass(Ct);
5067
- class sd {
5067
+ class id {
5068
5068
  constructor(t) {
5069
5069
  x(this, "target", void 0), x(this, "__mouseDownInPlace", !1), x(this, "__dragStartFired", !1), x(this, "__isDraggingOver", !1), x(this, "__dragStartSelection", void 0), x(this, "__dragImageDisposer", void 0), x(this, "_dispose", void 0), this.target = t;
5070
5070
  const e = [this.target.on("dragenter", this.dragEnterHandler.bind(this)), this.target.on("dragover", this.dragOverHandler.bind(this)), this.target.on("dragleave", this.dragLeaveHandler.bind(this)), this.target.on("dragend", this.dragEndHandler.bind(this)), this.target.on("drop", this.dropHandler.bind(this))];
@@ -5165,7 +5165,7 @@ class sd {
5165
5165
  }
5166
5166
  }
5167
5167
  const ua = /[ \n\.,;!\?\-]/;
5168
- class id extends Ct {
5168
+ class nd extends Ct {
5169
5169
  constructor() {
5170
5170
  super(...arguments), x(this, "_currentCursorOpacity", 1);
5171
5171
  }
@@ -5400,7 +5400,7 @@ class id extends Ct {
5400
5400
  s <= t ? (e === t ? this._selectionDirection = J : this._selectionDirection === ut && (this._selectionDirection = J, this.selectionEnd = t), this.selectionStart = s) : s > t && s < e ? this._selectionDirection === ut ? this.selectionEnd = s : this.selectionStart = s : (e === t ? this._selectionDirection = ut : this._selectionDirection === J && (this._selectionDirection = ut, this.selectionStart = e), this.selectionEnd = s);
5401
5401
  }
5402
5402
  }
5403
- class nd extends id {
5403
+ class rd extends nd {
5404
5404
  initHiddenTextarea() {
5405
5405
  const t = this.canvas && ae(this.canvas.getElement()) || Fs(), e = t.createElement("textarea");
5406
5406
  Object.entries({ autocapitalize: "off", autocorrect: "off", autocomplete: "off", spellcheck: "false", "data-fabric": "textarea", wrap: "off", name: "fabricTextarea" }).map(((r) => {
@@ -5557,12 +5557,12 @@ class nd extends id {
5557
5557
  }
5558
5558
  }
5559
5559
  const da = (a) => !!a.button;
5560
- class rd extends nd {
5560
+ class od extends rd {
5561
5561
  constructor() {
5562
5562
  super(...arguments), x(this, "draggableTextDelegate", void 0);
5563
5563
  }
5564
5564
  initBehavior() {
5565
- this.on("mousedown", this._mouseDownHandler), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("mousetripleclick", this.tripleClickHandler), this.draggableTextDelegate = new sd(this), super.initBehavior();
5565
+ this.on("mousedown", this._mouseDownHandler), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("mousetripleclick", this.tripleClickHandler), this.draggableTextDelegate = new id(this), super.initBehavior();
5566
5566
  }
5567
5567
  shouldStartDragging() {
5568
5568
  return this.draggableTextDelegate.isActive();
@@ -5619,8 +5619,8 @@ const Ai = "moveCursorUp", Ti = "moveCursorDown", Ei = "moveCursorLeft", ki = "m
5619
5619
  a.setTransform(e, 0, 0, e, 0, 0);
5620
5620
  const s = t.viewportTransform;
5621
5621
  a.transform(s[0], s[1], s[2], s[3], s[4], s[5]);
5622
- }, od = w({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Mi, 27: Mi, 33: Ai, 34: Ti, 35: ki, 36: Ei, 37: Ei, 38: Ai, 39: ki, 40: Ti }, keysMapRtl: { 9: Mi, 27: Mi, 33: Ai, 34: Ti, 35: Ei, 36: ki, 37: ki, 38: Ai, 39: Ei, 40: Ti }, ctrlKeysMapDown: { 65: "cmdAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5623
- class De extends rd {
5622
+ }, ad = w({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Mi, 27: Mi, 33: Ai, 34: Ti, 35: ki, 36: Ei, 37: Ei, 38: Ai, 39: ki, 40: Ti }, keysMapRtl: { 9: Mi, 27: Mi, 33: Ai, 34: Ti, 35: Ei, 36: ki, 37: ki, 38: Ai, 39: Ei, 40: Ti }, ctrlKeysMapDown: { 65: "cmdAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5623
+ class De extends od {
5624
5624
  static getDefaults() {
5625
5625
  return w(w({}, super.getDefaults()), De.ownDefaults);
5626
5626
  }
@@ -5774,7 +5774,7 @@ class De extends rd {
5774
5774
  this.exitEditingImpl(), this.draggableTextDelegate.dispose(), super.dispose();
5775
5775
  }
5776
5776
  }
5777
- x(De, "ownDefaults", od), x(De, "type", "IText"), F.setClass(De), F.setClass(De, "i-text");
5777
+ x(De, "ownDefaults", ad), x(De, "type", "IText"), F.setClass(De), F.setClass(De, "i-text");
5778
5778
  class ts extends De {
5779
5779
  static getDefaults() {
5780
5780
  return w(w({}, super.getDefaults()), ts.ownDefaults);
@@ -5783,7 +5783,7 @@ class ts extends De {
5783
5783
  super(t, w(w({}, ts.ownDefaults), e));
5784
5784
  }
5785
5785
  static createControls() {
5786
- return { controls: Uc() };
5786
+ return { controls: Yc() };
5787
5787
  }
5788
5788
  initDimensions() {
5789
5789
  this.initialized && (this.isEditing && this.initDelayedCursor(), this._clearCache(), this.dynamicMinWidth = 0, this._styleMap = this._generateStyleMap(this._splitText()), this.dynamicMinWidth > this.width && this._set("width", this.dynamicMinWidth), this.textAlign.includes(ye) && this.enlargeSpaces(), this.height = this.calcTextHeight());
@@ -5919,7 +5919,7 @@ class ga extends On {
5919
5919
  calcLayoutResult(t, e) {
5920
5920
  const { target: s } = t, { clipPath: i, group: n } = s;
5921
5921
  if (!i || !this.shouldPerformLayout(t)) return;
5922
- const { width: r, height: o } = we(Rh(s, i)), h = new C(r, o);
5922
+ const { width: r, height: o } = we(Lh(s, i)), h = new C(r, o);
5923
5923
  if (i.absolutePositioned)
5924
5924
  return { center: os(i.getRelativeCenterPoint(), void 0, n ? n.calcTransformMatrix() : void 0), size: h };
5925
5925
  {
@@ -5940,7 +5940,7 @@ class pa extends On {
5940
5940
  }
5941
5941
  }
5942
5942
  x(pa, "type", "fixed"), F.setClass(pa);
5943
- class ad extends li {
5943
+ class hd extends li {
5944
5944
  subscribeTargets(t) {
5945
5945
  const e = t.target;
5946
5946
  t.targets.reduce(((s, i) => (i.parent && s.add(i.parent), s)), /* @__PURE__ */ new Set()).forEach(((s) => {
@@ -5962,7 +5962,7 @@ class es extends qt {
5962
5962
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5963
5963
  super(), Object.assign(this, es.ownDefaults), this.setOptions(e);
5964
5964
  const { left: s, top: i, layoutManager: n } = e;
5965
- this.groupInit(t, { left: s, top: i, layoutManager: n ?? new ad() });
5965
+ this.groupInit(t, { left: s, top: i, layoutManager: n ?? new hd() });
5966
5966
  }
5967
5967
  _shouldSetNestedCoords() {
5968
5968
  return !0;
@@ -5977,7 +5977,7 @@ class es extends qt {
5977
5977
  }));
5978
5978
  }
5979
5979
  canEnterGroup(t) {
5980
- return this.getObjects().some(((e) => e.isDescendantOf(t) || t.isDescendantOf(e))) ? (Le("error", "ActiveSelection: circular object trees are not supported, this call has no effect"), !1) : super.canEnterGroup(t);
5980
+ return this.getObjects().some(((e) => e.isDescendantOf(t) || t.isDescendantOf(e))) ? (Re("error", "ActiveSelection: circular object trees are not supported, this call has no effect"), !1) : super.canEnterGroup(t);
5981
5981
  }
5982
5982
  enterGroup(t, e) {
5983
5983
  t.parent && t.parent === t.group ? t.parent._exitGroup(t) : t.group && t.parent !== t.group && t.group.remove(t), this._enterGroup(t, e);
@@ -6017,7 +6017,7 @@ class es extends qt {
6017
6017
  }
6018
6018
  }
6019
6019
  x(es, "type", "ActiveSelection"), x(es, "ownDefaults", { multiSelectionStacking: "canvas-stacking" }), F.setClass(es), F.setClass(es, "activeSelection");
6020
- class hd {
6020
+ class ld {
6021
6021
  constructor() {
6022
6022
  x(this, "resources", {});
6023
6023
  }
@@ -6107,14 +6107,14 @@ class el {
6107
6107
  }
6108
6108
  }
6109
6109
  let nr;
6110
- function ld() {
6110
+ function cd() {
6111
6111
  const { WebGLProbe: a } = xe();
6112
- return a.queryWebGL(Se()), q.enableGLFiltering && a.isSupported(q.textureSize) ? new el({ tileSize: q.textureSize }) : new hd();
6112
+ return a.queryWebGL(Se()), q.enableGLFiltering && a.isSupported(q.textureSize) ? new el({ tileSize: q.textureSize }) : new ld();
6113
6113
  }
6114
6114
  function rr() {
6115
- return !nr && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (nr = ld()), nr;
6115
+ return !nr && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (nr = cd()), nr;
6116
6116
  }
6117
- const cd = ["filters", "resizeFilter", "src", "crossOrigin", "type"], sl = ["cropX", "cropY"];
6117
+ const ud = ["filters", "resizeFilter", "src", "crossOrigin", "type"], sl = ["cropX", "cropY"];
6118
6118
  class Tt extends Mt {
6119
6119
  static getDefaults() {
6120
6120
  return w(w({}, super.getDefaults()), Tt.ownDefaults);
@@ -6246,7 +6246,7 @@ class Tt extends Mt {
6246
6246
  return !t || t.alignX === It && t.alignY === It ? (h = e / r, l = s / o) : (t.meetOrSlice === "meet" && (h = l = Fh(this._element, i), n = (e - r * h) / 2, t.alignX === "Min" && (c = -n), t.alignX === "Max" && (c = n), n = (s - o * l) / 2, t.alignY === "Min" && (u = -n), t.alignY === "Max" && (u = n)), t.meetOrSlice === "slice" && (h = l = Ih(this._element, i), n = r - e / h, t.alignX === "Mid" && (d = n / 2), t.alignX === "Max" && (d = n), n = o - s / l, t.alignY === "Mid" && (f = n / 2), t.alignY === "Max" && (f = n), r = e / h, o = s / l)), { width: r, height: o, scaleX: h, scaleY: l, offsetLeft: c, offsetTop: u, cropX: d, cropY: f };
6247
6247
  }
6248
6248
  static fromObject(t, e) {
6249
- let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = st(t, cd);
6249
+ let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = st(t, ud);
6250
6250
  return Promise.all([ti(n, w(w({}, e), {}, { crossOrigin: r })), s && Os(s, e), i && Os([i], e), gi(h, e)]).then(((l) => {
6251
6251
  let [c, u = [], [d] = [], f = {}] = l;
6252
6252
  return new this(c, w(w({}, h), {}, { src: n, filters: u, resizeFilter: d }, f));
@@ -6259,42 +6259,42 @@ class Tt extends Mt {
6259
6259
  static async fromElement(t) {
6260
6260
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0;
6261
6261
  const i = Ne(t, this.ATTRIBUTE_NAMES, s);
6262
- return this.fromURL(i["xlink:href"] || i.href, e, i).catch(((n) => (Le("log", "Unable to parse Image", n), null)));
6262
+ return this.fromURL(i["xlink:href"] || i.href, e, i).catch(((n) => (Re("log", "Unable to parse Image", n), null)));
6263
6263
  }
6264
6264
  }
6265
6265
  function or(a) {
6266
- if (!bc.test(a.nodeName)) return {};
6266
+ if (!vc.test(a.nodeName)) return {};
6267
6267
  const t = a.getAttribute("viewBox");
6268
6268
  let e, s, i = 1, n = 1, r = 0, o = 0;
6269
6269
  const h = a.getAttribute("width"), l = a.getAttribute("height"), c = a.getAttribute("x") || 0, u = a.getAttribute("y") || 0, d = !(t && Wo.test(t)), f = !h || !l || h === "100%" || l === "100%";
6270
6270
  let g = "", p = 0, b = 0;
6271
- if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" + Rt(c || "0") + " " + Rt(u || "0") + ") ", e = (a.getAttribute("transform") || "") + g, a.setAttribute("transform", e), a.removeAttribute("x"), a.removeAttribute("y")), d && f) return { width: 0, height: 0 };
6271
+ if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" + Lt(c || "0") + " " + Lt(u || "0") + ") ", e = (a.getAttribute("transform") || "") + g, a.setAttribute("transform", e), a.removeAttribute("x"), a.removeAttribute("y")), d && f) return { width: 0, height: 0 };
6272
6272
  const m = { width: 0, height: 0 };
6273
- if (d) return m.width = Rt(h), m.height = Rt(l), m;
6273
+ if (d) return m.width = Lt(h), m.height = Lt(l), m;
6274
6274
  const v = t.match(Wo);
6275
6275
  r = -parseFloat(v[1]), o = -parseFloat(v[2]);
6276
6276
  const y = parseFloat(v[3]), _ = parseFloat(v[4]);
6277
- m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width = Rt(h), m.height = Rt(l), i = m.width / y, n = m.height / _);
6277
+ m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width = Lt(h), m.height = Lt(l), i = m.width / y, n = m.height / _);
6278
6278
  const S = Zr(a.getAttribute("preserveAspectRatio") || "");
6279
6279
  if (S.alignX !== It && (S.meetOrSlice === "meet" && (n = i = i > n ? n : i), S.meetOrSlice === "slice" && (n = i = i > n ? i : n), p = m.width - y * i, b = m.height - _ * i, S.alignX === "Mid" && (p /= 2), S.alignY === "Mid" && (b /= 2), S.alignX === "Min" && (p = 0), S.alignY === "Min" && (b = 0)), i === 1 && n === 1 && r === 0 && o === 0 && c === 0 && u === 0) return m;
6280
- if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" + Rt(c || "0") + " " + Rt(u || "0") + ") "), e = g + " matrix(" + i + " 0 0 " + n + " " + (r * i + p) + " " + (o * n + b) + ") ", a.nodeName === "svg") {
6280
+ if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" + Lt(c || "0") + " " + Lt(u || "0") + ") "), e = g + " matrix(" + i + " 0 0 " + n + " " + (r * i + p) + " " + (o * n + b) + ") ", a.nodeName === "svg") {
6281
6281
  for (s = a.ownerDocument.createElementNS(_r, "g"); a.firstChild; ) s.appendChild(a.firstChild);
6282
6282
  a.appendChild(s);
6283
6283
  } else s = a, s.removeAttribute("x"), s.removeAttribute("y"), e = s.getAttribute("transform") + e;
6284
6284
  return s.setAttribute("transform", e), m;
6285
6285
  }
6286
6286
  x(Tt, "type", "Image"), x(Tt, "cacheProperties", [...Ie, ...sl]), x(Tt, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), x(Tt, "CSS_CANVAS", "canvas-img"), x(Tt, "ATTRIBUTE_NAMES", [...Ye, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "href", "crossOrigin", "image-rendering"]), F.setClass(Tt), F.setSVGClass(Tt);
6287
- const bn = (a) => a.tagName.replace("svg:", ""), ud = Tn(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6287
+ const bn = (a) => a.tagName.replace("svg:", ""), dd = Tn(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6288
6288
  function il(a, t) {
6289
6289
  let e, s, i, n, r = [];
6290
6290
  for (i = 0, n = t.length; i < n; i++) e = t[i], s = a.getElementsByTagNameNS("http://www.w3.org/2000/svg", e), r = r.concat(Array.from(s));
6291
6291
  return r;
6292
6292
  }
6293
- const dd = ["gradientTransform", "x1", "x2", "y1", "y2", "gradientUnits", "cx", "cy", "r", "fx", "fy"], ar = "xlink:href";
6293
+ const fd = ["gradientTransform", "x1", "x2", "y1", "y2", "gradientUnits", "cx", "cy", "r", "fx", "fy"], ar = "xlink:href";
6294
6294
  function nl(a, t) {
6295
6295
  var e;
6296
6296
  const s = ((e = t.getAttribute(ar)) === null || e === void 0 ? void 0 : e.slice(1)) || "", i = a.getElementById(s);
6297
- if (i && i.getAttribute(ar) && nl(a, i), i && (dd.forEach(((n) => {
6297
+ if (i && i.getAttribute(ar) && nl(a, i), i && (fd.forEach(((n) => {
6298
6298
  const r = i.getAttribute(n);
6299
6299
  !t.hasAttribute(n) && r && t.setAttribute(n, r);
6300
6300
  })), !t.children.length)) {
@@ -6303,8 +6303,8 @@ function nl(a, t) {
6303
6303
  }
6304
6304
  t.removeAttribute(ar);
6305
6305
  }
6306
- const fd = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"];
6307
- function gd(a) {
6306
+ const gd = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"];
6307
+ function pd(a) {
6308
6308
  const t = a.getElementsByTagName("style"), e = {};
6309
6309
  for (let s = 0; s < t.length; s++) {
6310
6310
  const i = (t[s].textContent || "").replace(/\/\*[\s\S]*?\*\//g, "");
@@ -6325,10 +6325,10 @@ function gd(a) {
6325
6325
  return e;
6326
6326
  }
6327
6327
  const ma = (a) => F.getSVGClass(bn(a).toLowerCase());
6328
- class pd {
6328
+ class md {
6329
6329
  constructor(t, e, s, i, n) {
6330
6330
  this.elements = t, this.options = e, this.reviver = s, this.regexUrl = /^url\(['"]?#([^'"]+)['"]?\)/g, this.doc = i, this.clipPaths = n, this.gradientDefs = (function(r) {
6331
- const o = il(r, fd), h = {};
6331
+ const o = il(r, gd), h = {};
6332
6332
  let l = o.length;
6333
6333
  for (; l--; ) {
6334
6334
  const c = o[l];
@@ -6337,7 +6337,7 @@ class pd {
6337
6337
  u && (h[u] = c);
6338
6338
  }
6339
6339
  return h;
6340
- })(i), this.cssRules = gd(i);
6340
+ })(i), this.cssRules = pd(i);
6341
6341
  }
6342
6342
  parse() {
6343
6343
  return Promise.all(this.elements.map(((t) => this.createObject(t))));
@@ -6380,10 +6380,10 @@ class pd {
6380
6380
  } else delete t.clipPath;
6381
6381
  }
6382
6382
  }
6383
- const ba = (a) => mc.test(bn(a)), Mr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
6384
- async function md(a, t) {
6383
+ const ba = (a) => bc.test(bn(a)), Mr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
6384
+ async function bd(a, t) {
6385
6385
  let { crossOrigin: e, signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6386
- if (s && s.aborted) return Le("log", new Br("parseSVGDocument")), Mr();
6386
+ if (s && s.aborted) return Re("log", new Br("parseSVGDocument")), Mr();
6387
6387
  const i = a.documentElement;
6388
6388
  (function(c) {
6389
6389
  const u = il(c, ["use", "svg:use"]), d = ["x", "y", "xlink:href", "href", "transform"];
@@ -6401,20 +6401,20 @@ async function md(a, t) {
6401
6401
  if (or(v), /^svg$/i.test(v.nodeName)) {
6402
6402
  const O = v.ownerDocument.createElementNS(_r, "g");
6403
6403
  Object.entries(_).forEach(((N) => {
6404
- let [D, L] = N;
6405
- return O.setAttributeNS(_r, D, L);
6404
+ let [D, R] = N;
6405
+ return O.setAttributeNS(_r, D, R);
6406
6406
  })), O.append(...v.childNodes), v = O;
6407
6407
  }
6408
6408
  for (const O of g) {
6409
6409
  if (!O) continue;
6410
6410
  const { name: N, value: D } = O;
6411
6411
  if (!d.includes(N)) if (N === "style") {
6412
- const L = {};
6413
- Sr(D, L), Object.entries(_).forEach(((P) => {
6412
+ const R = {};
6413
+ Sr(D, R), Object.entries(_).forEach(((P) => {
6414
6414
  let [j, M] = P;
6415
- L[j] = M;
6416
- })), Sr(_.style || "", L);
6417
- const k = Object.entries(L).map(((P) => P.join(":"))).join(";");
6415
+ R[j] = M;
6416
+ })), Sr(_.style || "", R);
6417
+ const k = Object.entries(R).map(((P) => P.join(":"))).join(";");
6418
6418
  v.setAttribute(N, k);
6419
6419
  } else !_[N] && v.setAttribute(N, D);
6420
6420
  }
@@ -6423,7 +6423,7 @@ async function md(a, t) {
6423
6423
  })(a);
6424
6424
  const n = Array.from(i.getElementsByTagName("*")), r = w(w({}, or(i)), {}, { crossOrigin: e, signal: s }), o = n.filter(((c) => (or(c), ba(c) && !(function(u) {
6425
6425
  let d = u;
6426
- for (; d && (d = d.parentElement); ) if (d && d.nodeName && ud.test(bn(d)) && !d.getAttribute("instantiated_by_use")) return !0;
6426
+ for (; d && (d = d.parentElement); ) if (d && d.nodeName && dd.test(bn(d)) && !d.getAttribute("instantiated_by_use")) return !0;
6427
6427
  return !1;
6428
6428
  })(c))));
6429
6429
  if (!o || o && !o.length) return w(w({}, Mr()), {}, { options: r, allElements: n });
@@ -6432,34 +6432,34 @@ async function md(a, t) {
6432
6432
  c.setAttribute("originalTransform", c.getAttribute("transform") || "");
6433
6433
  const u = c.getAttribute("id");
6434
6434
  h[u] = Array.from(c.getElementsByTagName("*")).filter(((d) => ba(d)));
6435
- })), { objects: await new pd(o, r, t, a, h).parse(), elements: o, options: r, allElements: n };
6435
+ })), { objects: await new md(o, r, t, a, h).parse(), elements: o, options: r, allElements: n };
6436
6436
  }
6437
- function bd(a, t) {
6437
+ function vd(a, t) {
6438
6438
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6439
6439
  return new Promise(((s, i) => {
6440
6440
  Wh(a.replace(/^\n\s*/, "").trim(), { onComplete: (n) => {
6441
6441
  const r = n.responseXML;
6442
6442
  r && s(r), i();
6443
6443
  }, signal: e.signal });
6444
- })).then(((s) => md(s, t, e))).catch((() => Mr()));
6444
+ })).then(((s) => bd(s, t, e))).catch((() => Mr()));
6445
6445
  }
6446
- const Rn = (a) => a.webgl !== void 0, ho = "precision highp float", vd = `
6446
+ const Ln = (a) => a.webgl !== void 0, ho = "precision highp float", yd = `
6447
6447
  `.concat(ho, `;
6448
6448
  varying vec2 vTexCoord;
6449
6449
  uniform sampler2D uTexture;
6450
6450
  void main() {
6451
6451
  gl_FragColor = texture2D(uTexture, vTexCoord);
6452
- }`), yd = ["type"], _d = ["type"], wd = new RegExp(ho, "g");
6452
+ }`), _d = ["type"], wd = ["type"], xd = new RegExp(ho, "g");
6453
6453
  class wt {
6454
6454
  get type() {
6455
6455
  return this.constructor.type;
6456
6456
  }
6457
6457
  constructor() {
6458
- let t = st(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, yd);
6458
+ let t = st(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _d);
6459
6459
  Object.assign(this, this.constructor.defaults, t);
6460
6460
  }
6461
6461
  getFragmentSource() {
6462
- return vd;
6462
+ return yd;
6463
6463
  }
6464
6464
  getVertexSource() {
6465
6465
  return `
@@ -6473,7 +6473,7 @@ class wt {
6473
6473
  createProgram(t) {
6474
6474
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getFragmentSource(), s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.getVertexSource();
6475
6475
  const { WebGLProbe: { GLPrecision: i = "highp" } } = xe();
6476
- i !== "highp" && (e = e.replace(wd, ho.replace("highp", i)));
6476
+ i !== "highp" && (e = e.replace(xd, ho.replace("highp", i)));
6477
6477
  const n = t.createShader(t.VERTEX_SHADER), r = t.createShader(t.FRAGMENT_SHADER), o = t.createProgram();
6478
6478
  if (!n || !r || !o) throw new _e("Vertex, fragment shader or program creation error");
6479
6479
  if (t.shaderSource(n, s), t.compileShader(n), !t.getShaderParameter(n, t.COMPILE_STATUS)) throw new _e("Vertex shader compile error for ".concat(this.type, ": ").concat(t.getShaderInfoLog(n)));
@@ -6510,7 +6510,7 @@ class wt {
6510
6510
  return !1;
6511
6511
  }
6512
6512
  applyTo(t) {
6513
- Rn(t) ? (this._setupFrameBuffer(t), this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6513
+ Ln(t) ? (this._setupFrameBuffer(t), this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6514
6514
  }
6515
6515
  applyTo2d(t) {
6516
6516
  }
@@ -6547,11 +6547,11 @@ class wt {
6547
6547
  return this.toObject();
6548
6548
  }
6549
6549
  static async fromObject(t, e) {
6550
- return new this(st(t, _d));
6550
+ return new this(st(t, wd));
6551
6551
  }
6552
6552
  }
6553
6553
  x(wt, "type", "BaseFilter"), x(wt, "uniformLocations", []);
6554
- const xd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
6554
+ const Sd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
6555
6555
  `, screen: `gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
6556
6556
  `, add: `gl_FragColor.rgb += uColor.rgb;
6557
6557
  `, difference: `gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
@@ -6593,7 +6593,7 @@ class Pi extends wt {
6593
6593
  vec4 color = texture2D(uTexture, vTexCoord);
6594
6594
  gl_FragColor = color;
6595
6595
  if (color.a > 0.0) {
6596
- `.concat(xd[this.mode], `
6596
+ `.concat(Sd[this.mode], `
6597
6597
  }
6598
6598
  }
6599
6599
  `);
@@ -6644,7 +6644,7 @@ class Pi extends wt {
6644
6644
  }
6645
6645
  }
6646
6646
  x(Pi, "defaults", { color: "#F95C63", mode: "multiply", alpha: 1 }), x(Pi, "type", "BlendColor"), x(Pi, "uniformLocations", ["uColor"]), F.setClass(Pi);
6647
- const Sd = { multiply: `
6647
+ const Cd = { multiply: `
6648
6648
  precision highp float;
6649
6649
  uniform sampler2D uTexture;
6650
6650
  uniform sampler2D uImage;
@@ -6670,13 +6670,13 @@ const Sd = { multiply: `
6670
6670
  color.a = color2.a;
6671
6671
  gl_FragColor = color;
6672
6672
  }
6673
- ` }, Cd = ["type", "image"];
6673
+ ` }, Ad = ["type", "image"];
6674
6674
  class Oi extends wt {
6675
6675
  getCacheKey() {
6676
6676
  return "".concat(this.type, "_").concat(this.mode);
6677
6677
  }
6678
6678
  getFragmentSource() {
6679
- return Sd[this.mode];
6679
+ return Cd[this.mode];
6680
6680
  }
6681
6681
  getVertexSource() {
6682
6682
  return `
@@ -6728,7 +6728,7 @@ class Oi extends wt {
6728
6728
  return w(w({}, super.toObject()), {}, { image: this.image && this.image.toObject() });
6729
6729
  }
6730
6730
  static async fromObject(t, e) {
6731
- let { type: s, image: i } = t, n = st(t, Cd);
6731
+ let { type: s, image: i } = t, n = st(t, Ad);
6732
6732
  return Tt.fromObject(i, e).then(((r) => new this(w(w({}, n), {}, { image: r }))));
6733
6733
  }
6734
6734
  }
@@ -6767,7 +6767,7 @@ class Di extends wt {
6767
6767
  `;
6768
6768
  }
6769
6769
  applyTo(t) {
6770
- Rn(t) ? (this.aspectRatio = t.sourceWidth / t.sourceHeight, t.passes++, this._setupFrameBuffer(t), this.horizontal = !0, this.applyToWebGL(t), this._swapTextures(t), this._setupFrameBuffer(t), this.horizontal = !1, this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6770
+ Ln(t) ? (this.aspectRatio = t.sourceWidth / t.sourceHeight, t.passes++, this._setupFrameBuffer(t), this.horizontal = !0, this.applyToWebGL(t), this._swapTextures(t), this._setupFrameBuffer(t), this.horizontal = !1, this.applyToWebGL(t), this._swapTextures(t)) : this.applyTo2d(t);
6771
6771
  }
6772
6772
  applyTo2d(t) {
6773
6773
  let { imageData: { data: e, width: s, height: i } } = t;
@@ -6818,7 +6818,7 @@ class Di extends wt {
6818
6818
  }
6819
6819
  }
6820
6820
  x(Di, "type", "Blur"), x(Di, "defaults", { blur: 0 }), x(Di, "uniformLocations", ["uDelta"]), F.setClass(Di);
6821
- class Ri extends wt {
6821
+ class Li extends wt {
6822
6822
  getFragmentSource() {
6823
6823
  return `
6824
6824
  precision highp float;
@@ -6844,7 +6844,7 @@ class Ri extends wt {
6844
6844
  t.uniform1f(e.uBrightness, this.brightness);
6845
6845
  }
6846
6846
  }
6847
- x(Ri, "type", "Brightness"), x(Ri, "defaults", { brightness: 0 }), x(Ri, "uniformLocations", ["uBrightness"]), F.setClass(Ri);
6847
+ x(Li, "type", "Brightness"), x(Li, "defaults", { brightness: 0 }), x(Li, "uniformLocations", ["uBrightness"]), F.setClass(Li);
6848
6848
  const rl = { matrix: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], colorsOnly: !0 };
6849
6849
  class Ss extends wt {
6850
6850
  getFragmentSource() {
@@ -6902,7 +6902,7 @@ class va extends wt {
6902
6902
  super(t), this.subFilters = t.subFilters || [];
6903
6903
  }
6904
6904
  applyTo(t) {
6905
- Rn(t) && (t.passes += this.subFilters.length - 1), this.subFilters.forEach(((e) => {
6905
+ Ln(t) && (t.passes += this.subFilters.length - 1), this.subFilters.forEach(((e) => {
6906
6906
  e.applyTo(t);
6907
6907
  }));
6908
6908
  }
@@ -6917,7 +6917,7 @@ class va extends wt {
6917
6917
  }
6918
6918
  }
6919
6919
  x(va, "type", "Composed"), F.setClass(va);
6920
- class Li extends wt {
6920
+ class Ri extends wt {
6921
6921
  getFragmentSource() {
6922
6922
  return `
6923
6923
  precision highp float;
@@ -6943,8 +6943,8 @@ class Li extends wt {
6943
6943
  t.uniform1f(e.uContrast, this.contrast);
6944
6944
  }
6945
6945
  }
6946
- x(Li, "type", "Contrast"), x(Li, "defaults", { contrast: 0 }), x(Li, "uniformLocations", ["uContrast"]), F.setClass(Li);
6947
- const Ad = { Convolute_3_1: `
6946
+ x(Ri, "type", "Contrast"), x(Ri, "defaults", { contrast: 0 }), x(Ri, "uniformLocations", ["uContrast"]), F.setClass(Ri);
6947
+ const Td = { Convolute_3_1: `
6948
6948
  precision highp float;
6949
6949
  uniform sampler2D uTexture;
6950
6950
  uniform float uMatrix[9];
@@ -7094,7 +7094,7 @@ class Fi extends wt {
7094
7094
  return "".concat(this.type, "_").concat(Math.sqrt(this.matrix.length), "_").concat(this.opaque ? 1 : 0);
7095
7095
  }
7096
7096
  getFragmentSource() {
7097
- return Ad[this.getCacheKey()];
7097
+ return Td[this.getCacheKey()];
7098
7098
  }
7099
7099
  applyTo2d(t) {
7100
7100
  const e = t.imageData, s = e.data, i = this.matrix, n = Math.round(Math.sqrt(i.length)), r = Math.floor(n / 2), o = e.width, h = e.height, l = t.ctx.createImageData(o, h), c = l.data, u = this.opaque ? 1 : 0;
@@ -7156,7 +7156,7 @@ class Ii extends wt {
7156
7156
  }
7157
7157
  }
7158
7158
  x(Ii, "type", ol), x(Ii, "defaults", { gamma: [1, 1, 1] }), x(Ii, "uniformLocations", ["uGamma"]), F.setClass(Ii);
7159
- const Td = { average: `
7159
+ const Ed = { average: `
7160
7160
  precision highp float;
7161
7161
  uniform sampler2D uTexture;
7162
7162
  varying vec2 vTexCoord;
@@ -7208,7 +7208,7 @@ class Ni extends wt {
7208
7208
  return "".concat(this.type, "_").concat(this.mode);
7209
7209
  }
7210
7210
  getFragmentSource() {
7211
- return Td[this.mode];
7211
+ return Ed[this.mode];
7212
7212
  }
7213
7213
  sendUniformData(t, e) {
7214
7214
  t.uniform1i(e.uMode, 1);
@@ -7218,7 +7218,7 @@ class Ni extends wt {
7218
7218
  }
7219
7219
  }
7220
7220
  x(Ni, "type", "Grayscale"), x(Ni, "defaults", { mode: "average" }), x(Ni, "uniformLocations", ["uMode"]), F.setClass(Ni);
7221
- const Ed = w(w({}, rl), {}, { rotation: 0 });
7221
+ const kd = w(w({}, rl), {}, { rotation: 0 });
7222
7222
  class hr extends Ss {
7223
7223
  calculateMatrix() {
7224
7224
  const t = this.rotation * Math.PI, e = ce(t), s = ue(t), i = 1 / 3, n = Math.sqrt(i) * s, r = 1 - e;
@@ -7234,7 +7234,7 @@ class hr extends Ss {
7234
7234
  return { type: this.type, rotation: this.rotation };
7235
7235
  }
7236
7236
  }
7237
- x(hr, "type", "HueRotation"), x(hr, "defaults", Ed), F.setClass(hr);
7237
+ x(hr, "type", "HueRotation"), x(hr, "defaults", kd), F.setClass(hr);
7238
7238
  class ji extends wt {
7239
7239
  applyTo2d(t) {
7240
7240
  let { imageData: { data: e } } = t;
@@ -7420,7 +7420,7 @@ class Gi extends wt {
7420
7420
  t.passes++, this.width = t.sourceWidth, this.horizontal = !0, this.dW = Math.round(this.width * this.scaleX), this.dH = t.sourceHeight, this.tempScale = this.dW / this.width, this.taps = this.getTaps(), t.destinationWidth = this.dW, super.applyTo(t), t.sourceWidth = t.destinationWidth, this.height = t.sourceHeight, this.horizontal = !1, this.dH = Math.round(this.height * this.scaleY), this.tempScale = this.dH / this.height, this.taps = this.getTaps(), t.destinationHeight = this.dH, super.applyTo(t), t.sourceHeight = t.destinationHeight;
7421
7421
  }
7422
7422
  applyTo(t) {
7423
- Rn(t) ? this.applyToForWebgl(t) : this.applyTo2d(t);
7423
+ Ln(t) ? this.applyToForWebgl(t) : this.applyTo2d(t);
7424
7424
  }
7425
7425
  isNeutralState() {
7426
7426
  return this.scaleX === 1 && this.scaleY === 1;
@@ -7457,13 +7457,13 @@ class Gi extends wt {
7457
7457
  lanczosResize(t, e, s, i, n) {
7458
7458
  const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, l = this.lanczosCreate(this.lanczosLobes), c = this.rcpScaleX, u = this.rcpScaleY, d = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, g = Math.ceil(c * this.lanczosLobes / 2), p = Math.ceil(u * this.lanczosLobes / 2), b = {}, m = { x: 0, y: 0 }, v = { x: 0, y: 0 };
7459
7459
  return (function y(_) {
7460
- let S, A, T, E, O, N, D, L, k, P, j;
7460
+ let S, A, T, E, O, N, D, R, k, P, j;
7461
7461
  for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
7462
- for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), O = 0, N = 0, D = 0, L = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7462
+ for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), O = 0, N = 0, D = 0, R = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7463
7463
  P = Math.floor(1e3 * Math.abs(A - m.x)), b[P] || (b[P] = {});
7464
- for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[P][j] || (b[P][j] = l(Math.sqrt(Math.pow(P * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[P][j], T > 0 && (E = 4 * (M * e + A), O += T, N += T * r[E], D += T * r[E + 1], L += T * r[E + 2], k += T * r[E + 3]));
7464
+ for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[P][j] || (b[P][j] = l(Math.sqrt(Math.pow(P * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[P][j], T > 0 && (E = 4 * (M * e + A), O += T, N += T * r[E], D += T * r[E + 1], R += T * r[E + 2], k += T * r[E + 3]));
7465
7465
  }
7466
- E = 4 * (S * i + _), h[E] = N / O, h[E + 1] = D / O, h[E + 2] = L / O, h[E + 3] = k / O;
7466
+ E = 4 * (S * i + _), h[E] = N / O, h[E + 1] = D / O, h[E + 2] = R / O, h[E + 3] = k / O;
7467
7467
  }
7468
7468
  return ++_ < i ? y(_) : o;
7469
7469
  })(0);
@@ -7482,10 +7482,10 @@ class Gi extends wt {
7482
7482
  const T = (f + 0.5) * o;
7483
7483
  for (let E = Math.floor(f * o); E < (f + 1) * o; E++) {
7484
7484
  const O = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = O * O;
7485
- for (let L = Math.floor(g * r); L < (g + 1) * r; L++) {
7486
- let k = Math.abs(N - (L + 0.5)) / h;
7485
+ for (let R = Math.floor(g * r); R < (g + 1) * r; R++) {
7486
+ let k = Math.abs(N - (R + 0.5)) / h;
7487
7487
  const P = Math.sqrt(D + k * k);
7488
- P > 1 && P < -1 || (b = 2 * P * P * P - 3 * P * P + 1, b > 0 && (k = 4 * (L + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7488
+ P > 1 && P < -1 || (b = 2 * P * P * P - 3 * P * P + 1, b > 0 && (k = 4 * (R + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7489
7489
  }
7490
7490
  }
7491
7491
  d[p] = y / m, d[p + 1] = _ / m, d[p + 2] = S / m, d[p + 3] = A / v;
@@ -7563,37 +7563,17 @@ class Xi extends wt {
7563
7563
  }
7564
7564
  }
7565
7565
  x(Xi, "type", "Vibrance"), x(Xi, "defaults", { vibrance: 0 }), x(Xi, "uniformLocations", ["uVibrance"]), F.setClass(Xi);
7566
- let ya = null;
7567
- function kd() {
7568
- const a = document.createElement("div");
7569
- a.style.width = "1in", document.body.append(a);
7570
- const t = a.offsetWidth;
7571
- return a.remove(), t;
7572
- }
7573
- function Md() {
7574
- const a = ya ?? kd();
7575
- return ya = a, a / 72;
7576
- }
7577
- function Pd(a, t = 500) {
7578
- if (typeof a != "function") throw new TypeError("The first argument is not a function.");
7579
- let e = null;
7580
- return function(...s) {
7581
- e && clearTimeout(e), e = setTimeout(() => {
7582
- e = null, a.apply(this, s);
7583
- }, t);
7584
- };
7585
- }
7586
- function Od(a) {
7566
+ function Md(a) {
7587
7567
  return new Promise((t, e) => {
7588
7568
  const s = globalThis.URL.createObjectURL(a), i = new Image();
7589
7569
  i.src = s, i.addEventListener("load", async () => {
7590
- globalThis.URL.revokeObjectURL(s), t(await Dd(i));
7570
+ globalThis.URL.revokeObjectURL(s), t(await Pd(i));
7591
7571
  }), i.addEventListener("error", (n) => {
7592
7572
  globalThis.URL.revokeObjectURL(s), e(n);
7593
7573
  });
7594
7574
  });
7595
7575
  }
7596
- function Dd(a) {
7576
+ function Pd(a) {
7597
7577
  return new Promise((t) => {
7598
7578
  const e = document.createElement("canvas"), s = e.getContext("2d"), { naturalWidth: i, naturalHeight: n } = a;
7599
7579
  e.width = i, e.height = n, s?.drawImage(a, 0, 0, i, n), t(e.toDataURL("image/jpeg", 0.8));
@@ -7629,7 +7609,7 @@ ii.d(V, {
7629
7609
  ),
7630
7610
  AnnotationLayer: () => (
7631
7611
  /* reexport */
7632
- kg
7612
+ Tg
7633
7613
  ),
7634
7614
  AnnotationMode: () => (
7635
7615
  /* reexport */
@@ -7689,15 +7669,15 @@ ii.d(V, {
7689
7669
  ),
7690
7670
  PasswordResponses: () => (
7691
7671
  /* reexport */
7692
- Id
7672
+ Rd
7693
7673
  ),
7694
7674
  PermissionFlag: () => (
7695
7675
  /* reexport */
7696
- Fd
7676
+ Ld
7697
7677
  ),
7698
7678
  PixelsPerInch: () => (
7699
7679
  /* reexport */
7700
- Ls
7680
+ Rs
7701
7681
  ),
7702
7682
  RenderingCancelledException: () => (
7703
7683
  /* reexport */
@@ -7721,7 +7701,7 @@ ii.d(V, {
7721
7701
  ),
7722
7702
  VerbosityLevel: () => (
7723
7703
  /* reexport */
7724
- Ln
7704
+ Rn
7725
7705
  ),
7726
7706
  XfaLayer: () => (
7727
7707
  /* reexport */
@@ -7729,11 +7709,11 @@ ii.d(V, {
7729
7709
  ),
7730
7710
  build: () => (
7731
7711
  /* reexport */
7732
- hg
7712
+ og
7733
7713
  ),
7734
7714
  createValidAbsoluteUrl: () => (
7735
7715
  /* reexport */
7736
- Hd
7716
+ jd
7737
7717
  ),
7738
7718
  fetchData: () => (
7739
7719
  /* reexport */
@@ -7741,19 +7721,19 @@ ii.d(V, {
7741
7721
  ),
7742
7722
  getDocument: () => (
7743
7723
  /* reexport */
7744
- Qf
7724
+ Jf
7745
7725
  ),
7746
7726
  getFilenameFromUrl: () => (
7747
7727
  /* reexport */
7748
- qd
7728
+ Yd
7749
7729
  ),
7750
7730
  getPdfFilenameFromUrl: () => (
7751
7731
  /* reexport */
7752
- Kd
7732
+ $d
7753
7733
  ),
7754
7734
  getXfaPageViewport: () => (
7755
7735
  /* reexport */
7756
- Jd
7736
+ qd
7757
7737
  ),
7758
7738
  isDataScheme: () => (
7759
7739
  /* reexport */
@@ -7769,7 +7749,7 @@ ii.d(V, {
7769
7749
  ),
7770
7750
  normalizeUnicode: () => (
7771
7751
  /* reexport */
7772
- Ud
7752
+ Xd
7773
7753
  ),
7774
7754
  setLayerDimensions: () => (
7775
7755
  /* reexport */
@@ -7785,10 +7765,10 @@ ii.d(V, {
7785
7765
  ),
7786
7766
  version: () => (
7787
7767
  /* reexport */
7788
- ag
7768
+ rg
7789
7769
  )
7790
7770
  });
7791
- const kt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), al = [1, 0, 0, 1, 0, 0], Pr = [1e-3, 0, 0, 1e-3, 0, 0], Rd = 1e7, lr = 1.35, Yt = {
7771
+ const kt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), al = [1, 0, 0, 1, 0, 0], Pr = [1e-3, 0, 0, 1e-3, 0, 0], Od = 1e7, lr = 1.35, Yt = {
7792
7772
  ANY: 1,
7793
7773
  DISPLAY: 2,
7794
7774
  PRINT: 4,
@@ -7802,7 +7782,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7802
7782
  ENABLE: 1,
7803
7783
  ENABLE_FORMS: 2,
7804
7784
  ENABLE_STORAGE: 3
7805
- }, Ld = "pdfjs_internal_editor_", W = {
7785
+ }, Dd = "pdfjs_internal_editor_", W = {
7806
7786
  DISABLE: -1,
7807
7787
  NONE: 0,
7808
7788
  FREETEXT: 3,
@@ -7824,7 +7804,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7824
7804
  HIGHLIGHT_FREE: 34,
7825
7805
  HIGHLIGHT_SHOW_ALL: 35,
7826
7806
  DRAW_STEP: 41
7827
- }, Fd = {
7807
+ }, Ld = {
7828
7808
  PRINT: 4,
7829
7809
  MODIFY_CONTENTS: 8,
7830
7810
  COPY: 16,
@@ -7869,7 +7849,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7869
7849
  BEVELED: 3,
7870
7850
  INSET: 4,
7871
7851
  UNDERLINE: 5
7872
- }, Ln = {
7852
+ }, Rn = {
7873
7853
  ERRORS: 0,
7874
7854
  WARNINGS: 1,
7875
7855
  INFOS: 5
@@ -7964,22 +7944,22 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
7964
7944
  constructPath: 91,
7965
7945
  setStrokeTransparent: 92,
7966
7946
  setFillTransparent: 93
7967
- }, Id = {
7947
+ }, Rd = {
7968
7948
  NEED_PASSWORD: 1,
7969
7949
  INCORRECT_PASSWORD: 2
7970
7950
  };
7971
- let Fn = Ln.WARNINGS;
7972
- function Nd(a) {
7951
+ let Fn = Rn.WARNINGS;
7952
+ function Fd(a) {
7973
7953
  Number.isInteger(a) && (Fn = a);
7974
7954
  }
7975
- function jd() {
7955
+ function Id() {
7976
7956
  return Fn;
7977
7957
  }
7978
7958
  function In(a) {
7979
- Fn >= Ln.INFOS && console.log(`Info: ${a}`);
7959
+ Fn >= Rn.INFOS && console.log(`Info: ${a}`);
7980
7960
  }
7981
7961
  function U(a) {
7982
- Fn >= Ln.WARNINGS && console.log(`Warning: ${a}`);
7962
+ Fn >= Rn.WARNINGS && console.log(`Warning: ${a}`);
7983
7963
  }
7984
7964
  function tt(a) {
7985
7965
  throw new Error(a);
@@ -7987,7 +7967,7 @@ function tt(a) {
7987
7967
  function bt(a, t) {
7988
7968
  a || tt(t);
7989
7969
  }
7990
- function Bd(a) {
7970
+ function Nd(a) {
7991
7971
  switch (a?.protocol) {
7992
7972
  case "http:":
7993
7973
  case "https:":
@@ -7999,17 +7979,17 @@ function Bd(a) {
7999
7979
  return !1;
8000
7980
  }
8001
7981
  }
8002
- function Hd(a, t = null, e = null) {
7982
+ function jd(a, t = null, e = null) {
8003
7983
  if (!a)
8004
7984
  return null;
8005
7985
  try {
8006
7986
  if (e && typeof a == "string" && (e.addDefaultProtocol && a.startsWith("www.") && a.match(/\./g)?.length >= 2 && (a = `http://${a}`), e.tryConvertEncoding))
8007
7987
  try {
8008
- a = Wd(a);
7988
+ a = Vd(a);
8009
7989
  } catch {
8010
7990
  }
8011
7991
  const s = t ? new URL(a, t) : new URL(a);
8012
- if (Bd(s))
7992
+ if (Nd(s))
8013
7993
  return s;
8014
7994
  } catch {
8015
7995
  }
@@ -8029,7 +8009,7 @@ const $e = (function() {
8029
8009
  }
8030
8010
  return t.prototype = new Error(), t.constructor = t, t;
8031
8011
  })();
8032
- class _a extends $e {
8012
+ class ya extends $e {
8033
8013
  constructor(t, e) {
8034
8014
  super(t, "PasswordException"), this.code = e;
8035
8015
  }
@@ -8054,7 +8034,7 @@ class vn extends $e {
8054
8034
  super(t, "UnexpectedResponseException"), this.status = e;
8055
8035
  }
8056
8036
  }
8057
- class zd extends $e {
8037
+ class Bd extends $e {
8058
8038
  constructor(t) {
8059
8039
  super(t, "FormatError");
8060
8040
  }
@@ -8083,7 +8063,7 @@ function Nn(a) {
8083
8063
  e[s] = a.charCodeAt(s) & 255;
8084
8064
  return e;
8085
8065
  }
8086
- function Gd(a) {
8066
+ function Hd(a) {
8087
8067
  return String.fromCharCode(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, a & 255);
8088
8068
  }
8089
8069
  function lo(a) {
@@ -8092,11 +8072,11 @@ function lo(a) {
8092
8072
  t[e] = s;
8093
8073
  return t;
8094
8074
  }
8095
- function Vd() {
8075
+ function zd() {
8096
8076
  const a = new Uint8Array(4);
8097
8077
  return a[0] = 1, new Uint32Array(a.buffer, 0, 1)[0] === 1;
8098
8078
  }
8099
- function Xd() {
8079
+ function Gd() {
8100
8080
  try {
8101
8081
  return new Function(""), !0;
8102
8082
  } catch {
@@ -8105,10 +8085,10 @@ function Xd() {
8105
8085
  }
8106
8086
  class jt {
8107
8087
  static get isLittleEndian() {
8108
- return Y(this, "isLittleEndian", Vd());
8088
+ return Y(this, "isLittleEndian", zd());
8109
8089
  }
8110
8090
  static get isEvalSupported() {
8111
- return Y(this, "isEvalSupported", Xd());
8091
+ return Y(this, "isEvalSupported", Gd());
8112
8092
  }
8113
8093
  static get isOffscreenCanvasSupported() {
8114
8094
  return Y(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
@@ -8195,21 +8175,21 @@ class B {
8195
8175
  return l ? (l[0] = Math.min(l[0], t, o), l[1] = Math.min(l[1], e, h), l[2] = Math.max(l[2], t, o), l[3] = Math.max(l[3], e, h)) : l = [Math.min(t, o), Math.min(e, h), Math.max(t, o), Math.max(e, h)], this.#e(t, s, n, o, e, i, r, h, 3 * (-t + 3 * (s - n) + o), 6 * (t - 2 * s + n), 3 * (s - t), l), this.#e(t, s, n, o, e, i, r, h, 3 * (-e + 3 * (i - r) + h), 6 * (e - 2 * i + r), 3 * (i - e), l), l;
8196
8176
  }
8197
8177
  }
8198
- function Wd(a) {
8178
+ function Vd(a) {
8199
8179
  return decodeURIComponent(escape(a));
8200
8180
  }
8201
- let dr = null, wa = null;
8202
- function Ud(a) {
8203
- return dr || (dr = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, wa = /* @__PURE__ */ new Map([["ſt", "ſt"]])), a.replaceAll(dr, (t, e, s) => e ? e.normalize("NFKC") : wa.get(s));
8181
+ let dr = null, _a = null;
8182
+ function Xd(a) {
8183
+ return dr || (dr = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, _a = /* @__PURE__ */ new Map([["ſt", "ſt"]])), a.replaceAll(dr, (t, e, s) => e ? e.normalize("NFKC") : _a.get(s));
8204
8184
  }
8205
- function Yd() {
8185
+ function Wd() {
8206
8186
  if (typeof crypto.randomUUID == "function")
8207
8187
  return crypto.randomUUID();
8208
8188
  const a = new Uint8Array(32);
8209
8189
  return crypto.getRandomValues(a), hl(a);
8210
8190
  }
8211
8191
  const co = "pdfjs_internal_id_";
8212
- function $d(a) {
8192
+ function Ud(a) {
8213
8193
  return Uint8Array.prototype.toBase64 ? a.toBase64() : btoa(hl(a));
8214
8194
  }
8215
8195
  typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
@@ -8218,7 +8198,7 @@ typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
8218
8198
  });
8219
8199
  });
8220
8200
  const Ee = "http://www.w3.org/2000/svg";
8221
- class Ls {
8201
+ class Rs {
8222
8202
  static CSS = 96;
8223
8203
  static PDF = 72;
8224
8204
  static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
@@ -8346,10 +8326,10 @@ function Bn(a) {
8346
8326
  function fo(a) {
8347
8327
  return typeof a == "string" && /\.pdf$/i.test(a);
8348
8328
  }
8349
- function qd(a) {
8329
+ function Yd(a) {
8350
8330
  return [a] = a.split(/[#?]/, 1), a.substring(a.lastIndexOf("/") + 1);
8351
8331
  }
8352
- function Kd(a, t = "document.pdf") {
8332
+ function $d(a, t = "document.pdf") {
8353
8333
  if (typeof a != "string")
8354
8334
  return t;
8355
8335
  if (Bn(a))
@@ -8363,7 +8343,7 @@ function Kd(a, t = "document.pdf") {
8363
8343
  }
8364
8344
  return n || t;
8365
8345
  }
8366
- class xa {
8346
+ class wa {
8367
8347
  started = /* @__PURE__ */ Object.create(null);
8368
8348
  times = [];
8369
8349
  time(t) {
@@ -8436,7 +8416,7 @@ class ll {
8436
8416
  return u = u >= 0 && u <= 59 ? u : 0, l === "-" ? (r += c, o += u) : l === "+" && (r -= c, o -= u), new Date(Date.UTC(s, i, n, r, o, h));
8437
8417
  }
8438
8418
  }
8439
- function Jd(a, {
8419
+ function qd(a, {
8440
8420
  scale: t = 1,
8441
8421
  rotation: e = 0
8442
8422
  }) {
@@ -8458,7 +8438,7 @@ function go(a) {
8458
8438
  }
8459
8439
  return a.startsWith("rgb(") ? a.slice(4, -1).split(",").map((t) => parseInt(t)) : a.startsWith("rgba(") ? a.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (U(`Not a valid color format: "${a}"`), [0, 0, 0]);
8460
8440
  }
8461
- function Zd(a) {
8441
+ function Kd(a) {
8462
8442
  const t = document.createElement("span");
8463
8443
  t.style.visibility = "hidden", document.body.append(t);
8464
8444
  for (const e of a.keys()) {
@@ -8607,7 +8587,7 @@ class ni {
8607
8587
  this.#t.remove(), this.#e?.destroy(), this.#e = null;
8608
8588
  }
8609
8589
  }
8610
- class Qd {
8590
+ class Jd {
8611
8591
  #t = null;
8612
8592
  #e = null;
8613
8593
  #s;
@@ -8665,14 +8645,14 @@ function yn(a, t, e) {
8665
8645
  for (const s of e)
8666
8646
  t.addEventListener(s, a[s].bind(a));
8667
8647
  }
8668
- class tf {
8648
+ class Zd {
8669
8649
  #t = 0;
8670
8650
  get id() {
8671
- return `${Ld}${this.#t++}`;
8651
+ return `${Dd}${this.#t++}`;
8672
8652
  }
8673
8653
  }
8674
8654
  class po {
8675
- #t = Yd();
8655
+ #t = Wd();
8676
8656
  #e = 0;
8677
8657
  #s = null;
8678
8658
  static get _isSVGFittingCanvas() {
@@ -8784,7 +8764,7 @@ class po {
8784
8764
  return t.startsWith(`image_${this.#t}_`);
8785
8765
  }
8786
8766
  }
8787
- class ef {
8767
+ class Qd {
8788
8768
  #t = [];
8789
8769
  #e = !1;
8790
8770
  #s;
@@ -8904,7 +8884,7 @@ class mo {
8904
8884
  static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
8905
8885
  get _colors() {
8906
8886
  const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
8907
- return Zd(t), Y(this, "_colors", t);
8887
+ return Kd(t), Y(this, "_colors", t);
8908
8888
  }
8909
8889
  convert(t) {
8910
8890
  const e = go(t);
@@ -8928,7 +8908,7 @@ class Ue {
8928
8908
  #r = null;
8929
8909
  #n = null;
8930
8910
  #h = null;
8931
- #a = new ef();
8911
+ #a = new Qd();
8932
8912
  #c = null;
8933
8913
  #l = null;
8934
8914
  #d = 0;
@@ -8946,16 +8926,16 @@ class Ue {
8946
8926
  #S = null;
8947
8927
  #A = !1;
8948
8928
  #E = null;
8949
- #M = new tf();
8929
+ #M = new Zd();
8950
8930
  #x = !1;
8951
8931
  #k = !1;
8952
8932
  #T = null;
8953
8933
  #O = null;
8954
- #L = null;
8934
+ #R = null;
8955
8935
  #I = null;
8956
8936
  #C = W.NONE;
8957
8937
  #y = /* @__PURE__ */ new Set();
8958
- #R = null;
8938
+ #L = null;
8959
8939
  #z = null;
8960
8940
  #G = null;
8961
8941
  #V = {
@@ -9042,7 +9022,7 @@ class Ue {
9042
9022
  }), i._on("switchannotationeditorparams", (p) => this.updateParams(p.type, p.value), {
9043
9023
  signal: g
9044
9024
  }), this.#et(), this.#rt(), this.#$(), this.#n = n.annotationStorage, this.#_ = n.filterFactory, this.#z = r, this.#S = o || null, this.#m = h, this.#p = l, this.#b = c, this.#I = u || null, this.viewParameters = {
9045
- realScale: Ls.PDF_TO_CSS_UNITS,
9025
+ realScale: Rs.PDF_TO_CSS_UNITS,
9046
9026
  rotation: 0
9047
9027
  }, this.isShiftKeyDown = !1, this._editorUndoBar = d || null, this._supportsPinchToZoom = f !== !1;
9048
9028
  }
@@ -9080,7 +9060,7 @@ class Ue {
9080
9060
  t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), this.#l = t;
9081
9061
  }
9082
9062
  setMainHighlightColorPicker(t) {
9083
- this.#L = t;
9063
+ this.#R = t;
9084
9064
  }
9085
9065
  editAltText(t, e = !1) {
9086
9066
  this.#r?.editAltText(this, t, e);
@@ -9144,7 +9124,7 @@ class Ue {
9144
9124
  onScaleChanging({
9145
9125
  scale: t
9146
9126
  }) {
9147
- this.commitOrRemove(), this.viewParameters.realScale = t * Ls.PDF_TO_CSS_UNITS;
9127
+ this.commitOrRemove(), this.viewParameters.realScale = t * Rs.PDF_TO_CSS_UNITS;
9148
9128
  for (const e of this.#g)
9149
9129
  e.onScaleChanging();
9150
9130
  this.#l?.onScaleChanging();
@@ -9208,7 +9188,7 @@ class Ue {
9208
9188
  if (!t || t.isCollapsed)
9209
9189
  return;
9210
9190
  const s = this.#B(t).closest(".textLayer"), i = this.getSelectionBoxes(s);
9211
- i && (this.#E ||= new Qd(this), this.#E.show(s, i, this.direction === "ltr"));
9191
+ i && (this.#E ||= new Jd(this), this.#E.show(s, i, this.direction === "ltr"));
9212
9192
  }
9213
9193
  addToAnnotationStorage(t) {
9214
9194
  !t.isEmpty() && this.#n && !this.#n.has(t.id) && this.#n.setValue(t.id, t);
@@ -9216,7 +9196,7 @@ class Ue {
9216
9196
  #tt() {
9217
9197
  const t = document.getSelection();
9218
9198
  if (!t || t.isCollapsed) {
9219
- this.#R && (this.#E?.hide(), this.#R = null, this.#P({
9199
+ this.#L && (this.#E?.hide(), this.#L = null, this.#P({
9220
9200
  hasSelectedText: !1
9221
9201
  }));
9222
9202
  return;
@@ -9224,16 +9204,16 @@ class Ue {
9224
9204
  const {
9225
9205
  anchorNode: e
9226
9206
  } = t;
9227
- if (e === this.#R)
9207
+ if (e === this.#L)
9228
9208
  return;
9229
9209
  const i = this.#B(t).closest(".textLayer");
9230
9210
  if (!i) {
9231
- this.#R && (this.#E?.hide(), this.#R = null, this.#P({
9211
+ this.#L && (this.#E?.hide(), this.#L = null, this.#P({
9232
9212
  hasSelectedText: !1
9233
9213
  }));
9234
9214
  return;
9235
9215
  }
9236
- if (this.#E?.hide(), this.#R = e, this.#P({
9216
+ if (this.#E?.hide(), this.#L = e, this.#P({
9237
9217
  hasSelectedText: !0
9238
9218
  }), !(this.#C !== W.HIGHLIGHT && this.#C !== W.NONE) && (this.#C === W.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#A = this.isShiftKeyDown, !this.isShiftKeyDown)) {
9239
9219
  const n = this.#C === W.HIGHLIGHT ? this.#Y(i) : null;
@@ -9520,7 +9500,7 @@ class Ue {
9520
9500
  this.currentLayer.addNewEditor();
9521
9501
  return;
9522
9502
  case $.HIGHLIGHT_DEFAULT_COLOR:
9523
- this.#L?.updateColor(e);
9503
+ this.#R?.updateColor(e);
9524
9504
  break;
9525
9505
  case $.HIGHLIGHT_SHOW_ALL:
9526
9506
  this._eventBus.dispatch("reporttelemetry", {
@@ -10254,7 +10234,7 @@ class z {
10254
10234
  return Y(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
10255
10235
  }
10256
10236
  static deleteAnnotationElement(t) {
10257
- const e = new sf({
10237
+ const e = new tf({
10258
10238
  id: t.parent.getNextId(),
10259
10239
  parent: t.parent,
10260
10240
  uiManager: t._uiManager
@@ -10568,7 +10548,7 @@ class z {
10568
10548
  signal: r
10569
10549
  });
10570
10550
  }
10571
- #L(t, e, s, i) {
10551
+ #R(t, e, s, i) {
10572
10552
  this.width = s, this.height = i, this.x = t, this.y = e;
10573
10553
  const [n, r] = this.parentDimensions;
10574
10554
  this.setDims(n * s, r * i), this.fixAndSetPosition(), this._onResized();
@@ -10587,8 +10567,8 @@ class z {
10587
10567
  this.#l = null;
10588
10568
  const n = this.x, r = this.y, o = this.width, h = this.height;
10589
10569
  n === t && r === e && o === s && h === i || this.addCommands({
10590
- cmd: this.#L.bind(this, n, r, o, h),
10591
- undo: this.#L.bind(this, t, e, s, i),
10570
+ cmd: this.#R.bind(this, n, r, o, h),
10571
+ undo: this.#R.bind(this, t, e, s, i),
10592
10572
  mustExec: !0
10593
10573
  });
10594
10574
  }
@@ -10596,32 +10576,32 @@ class z {
10596
10576
  return Math.round(t * 1e4) / 1e4;
10597
10577
  }
10598
10578
  #C(t, e) {
10599
- const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, R) => [u[0] * M + u[2] * R, u[1] * M + u[3] * R], f = this.#k(360 - this.rotation), g = (M, R) => [f[0] * M + f[2] * R, f[1] * M + f[3] * R];
10579
+ const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, L) => [u[0] * M + u[2] * L, u[1] * M + u[3] * L], f = this.#k(360 - this.rotation), g = (M, L) => [f[0] * M + f[2] * L, f[1] * M + f[3] * L];
10600
10580
  let p, b, m = !1, v = !1;
10601
10581
  switch (t) {
10602
10582
  case "topLeft":
10603
- m = !0, p = (M, R) => [0, 0], b = (M, R) => [M, R];
10583
+ m = !0, p = (M, L) => [0, 0], b = (M, L) => [M, L];
10604
10584
  break;
10605
10585
  case "topMiddle":
10606
- p = (M, R) => [M / 2, 0], b = (M, R) => [M / 2, R];
10586
+ p = (M, L) => [M / 2, 0], b = (M, L) => [M / 2, L];
10607
10587
  break;
10608
10588
  case "topRight":
10609
- m = !0, p = (M, R) => [M, 0], b = (M, R) => [0, R];
10589
+ m = !0, p = (M, L) => [M, 0], b = (M, L) => [0, L];
10610
10590
  break;
10611
10591
  case "middleRight":
10612
- v = !0, p = (M, R) => [M, R / 2], b = (M, R) => [0, R / 2];
10592
+ v = !0, p = (M, L) => [M, L / 2], b = (M, L) => [0, L / 2];
10613
10593
  break;
10614
10594
  case "bottomRight":
10615
- m = !0, p = (M, R) => [M, R], b = (M, R) => [0, 0];
10595
+ m = !0, p = (M, L) => [M, L], b = (M, L) => [0, 0];
10616
10596
  break;
10617
10597
  case "bottomMiddle":
10618
- p = (M, R) => [M / 2, R], b = (M, R) => [M / 2, 0];
10598
+ p = (M, L) => [M / 2, L], b = (M, L) => [M / 2, 0];
10619
10599
  break;
10620
10600
  case "bottomLeft":
10621
- m = !0, p = (M, R) => [0, R], b = (M, R) => [M, 0];
10601
+ m = !0, p = (M, L) => [0, L], b = (M, L) => [M, 0];
10622
10602
  break;
10623
10603
  case "middleLeft":
10624
- v = !0, p = (M, R) => [0, R / 2], b = (M, R) => [M, R / 2];
10604
+ v = !0, p = (M, L) => [0, L / 2], b = (M, L) => [M, L / 2];
10625
10605
  break;
10626
10606
  }
10627
10607
  const y = p(o, h), _ = b(o, h);
@@ -10636,18 +10616,18 @@ class z {
10636
10616
  else {
10637
10617
  const {
10638
10618
  screenX: M,
10639
- screenY: R
10619
+ screenY: L
10640
10620
  } = e, [G, it] = this.#c;
10641
- [N, D] = this.screenToPageTranslation(M - G, R - it), this.#c[0] = M, this.#c[1] = R;
10621
+ [N, D] = this.screenToPageTranslation(M - G, L - it), this.#c[0] = M, this.#c[1] = L;
10642
10622
  }
10643
10623
  if ([N, D] = g(N / s, D / i), m) {
10644
10624
  const M = Math.hypot(o, h);
10645
10625
  E = O = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
10646
10626
  } else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : O = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
10647
- const L = z._round(o * E), k = z._round(h * O);
10648
- S = d(...b(L, k));
10627
+ const R = z._round(o * E), k = z._round(h * O);
10628
+ S = d(...b(R, k));
10649
10629
  const P = A - S[0], j = T - S[1];
10650
- this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x = P, this.y = j, this.setDims(s * L, i * k), this.fixAndSetPosition(), this._onResizing();
10630
+ this.#o ||= [this.x, this.y, this.width, this.height], this.width = R, this.height = k, this.x = P, this.y = j, this.setDims(s * R, i * k), this.fixAndSetPosition(), this._onResizing();
10651
10631
  }
10652
10632
  _onResizing() {
10653
10633
  }
@@ -10700,7 +10680,7 @@ class z {
10700
10680
  container: this.div,
10701
10681
  isPinchingDisabled: () => !this.isSelected,
10702
10682
  onPinchStart: this.#y.bind(this),
10703
- onPinching: this.#R.bind(this),
10683
+ onPinching: this.#L.bind(this),
10704
10684
  onPinchEnd: this.#z.bind(this),
10705
10685
  signal: this._uiManager._signal
10706
10686
  })), this._uiManager._editorUndoBar?.hide(), this.div;
@@ -10713,7 +10693,7 @@ class z {
10713
10693
  savedHeight: this.height
10714
10694
  }, this.#s?.toggle(!1), this.parent.togglePointerEvents(!1);
10715
10695
  }
10716
- #R(t, e, s) {
10696
+ #L(t, e, s) {
10717
10697
  let n = 0.7 * (s / e) + 1 - 0.7;
10718
10698
  if (n === 1)
10719
10699
  return;
@@ -11104,7 +11084,7 @@ class z {
11104
11084
  e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
11105
11085
  }
11106
11086
  }
11107
- class sf extends z {
11087
+ class tf extends z {
11108
11088
  constructor(t) {
11109
11089
  super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
11110
11090
  }
@@ -11112,10 +11092,10 @@ class sf extends z {
11112
11092
  return this.serializeDeleted();
11113
11093
  }
11114
11094
  }
11115
- const Sa = 3285377520, Qt = 4294901760, me = 65535;
11095
+ const xa = 3285377520, Qt = 4294901760, me = 65535;
11116
11096
  class cl {
11117
11097
  constructor(t) {
11118
- this.h1 = t ? t & 4294967295 : Sa, this.h2 = t ? t & 4294967295 : Sa;
11098
+ this.h1 = t ? t & 4294967295 : xa, this.h2 = t ? t & 4294967295 : xa;
11119
11099
  }
11120
11100
  update(t) {
11121
11101
  let e, s;
@@ -11149,7 +11129,7 @@ class cl {
11149
11129
  return t ^= e >>> 1, t = t * 3981806797 & Qt | t * 36045 & me, e = e * 4283543511 & Qt | ((e << 16 | t >>> 16) * 2950163797 & Qt) >>> 16, t ^= e >>> 1, t = t * 444984403 & Qt | t * 60499 & me, e = e * 3301882366 & Qt | ((e << 16 | t >>> 16) * 3120437893 & Qt) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
11150
11130
  }
11151
11131
  }
11152
- const Rr = Object.freeze({
11132
+ const Lr = Object.freeze({
11153
11133
  map: null,
11154
11134
  hash: "",
11155
11135
  transfer: void 0
@@ -11210,7 +11190,7 @@ class bo {
11210
11190
  }
11211
11191
  get serializable() {
11212
11192
  if (this.#s.size === 0)
11213
- return Rr;
11193
+ return Lr;
11214
11194
  const t = /* @__PURE__ */ new Map(), e = new cl(), s = [], i = /* @__PURE__ */ Object.create(null);
11215
11195
  let n = !1;
11216
11196
  for (const [r, o] of this.#s) {
@@ -11224,7 +11204,7 @@ class bo {
11224
11204
  map: t,
11225
11205
  hash: e.hexdigest(),
11226
11206
  transfer: s
11227
- } : Rr;
11207
+ } : Lr;
11228
11208
  }
11229
11209
  get editorStats() {
11230
11210
  let t = null;
@@ -11298,7 +11278,7 @@ class ul extends bo {
11298
11278
  });
11299
11279
  }
11300
11280
  }
11301
- class nf {
11281
+ class ef {
11302
11282
  #t = /* @__PURE__ */ new Set();
11303
11283
  constructor({
11304
11284
  ownerDocument: t = globalThis.document,
@@ -11432,7 +11412,7 @@ class nf {
11432
11412
  let b = s(d, g);
11433
11413
  for (n = 0, r = u.length - 3; n < r; n += 4)
11434
11414
  b = b - p + s(u, n) | 0;
11435
- n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, Gd(b));
11415
+ n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, Hd(b));
11436
11416
  const m = `url(data:font/opentype;base64,${btoa(d)});`, v = `@font-face {font-family:"${u}";src:${m}}`;
11437
11417
  this.insertRule(v);
11438
11418
  const y = this._document.createElement("div");
@@ -11446,7 +11426,7 @@ class nf {
11446
11426
  });
11447
11427
  }
11448
11428
  }
11449
- class rf {
11429
+ class sf {
11450
11430
  constructor(t, {
11451
11431
  disableFontFace: e = !1,
11452
11432
  fontExtraProperties: s = !1,
@@ -11474,7 +11454,7 @@ class rf {
11474
11454
  createFontFaceRule() {
11475
11455
  if (!this.data || this.disableFontFace)
11476
11456
  return null;
11477
- const t = `url(data:${this.mimetype};base64,${$d(this.data)});`;
11457
+ const t = `url(data:${this.mimetype};base64,${Ud(this.data)});`;
11478
11458
  let e;
11479
11459
  if (!this.cssFontInfo)
11480
11460
  e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
@@ -11511,10 +11491,10 @@ const Wi = {
11511
11491
  PULL_COMPLETE: 7,
11512
11492
  START_COMPLETE: 8
11513
11493
  };
11514
- function Ca() {
11494
+ function Sa() {
11515
11495
  }
11516
11496
  function Gt(a) {
11517
- if (a instanceof We || a instanceof Or || a instanceof ci || a instanceof _a || a instanceof vn || a instanceof cr)
11497
+ if (a instanceof We || a instanceof Or || a instanceof ci || a instanceof ya || a instanceof vn || a instanceof cr)
11518
11498
  return a;
11519
11499
  switch (a instanceof Error || typeof a == "object" && a !== null || tt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), a.name) {
11520
11500
  case "AbortException":
@@ -11524,7 +11504,7 @@ function Gt(a) {
11524
11504
  case "MissingPDFException":
11525
11505
  return new ci(a.message);
11526
11506
  case "PasswordException":
11527
- return new _a(a.message, a.code);
11507
+ return new ya(a.message, a.code);
11528
11508
  case "UnexpectedResponseException":
11529
11509
  return new vn(a.message, a.status);
11530
11510
  case "UnknownErrorException":
@@ -11739,7 +11719,7 @@ class Js {
11739
11719
  });
11740
11720
  break;
11741
11721
  }
11742
- o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || Ca).then(function() {
11722
+ o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || Sa).then(function() {
11743
11723
  n.postMessage({
11744
11724
  sourceName: s,
11745
11725
  targetName: i,
@@ -11777,7 +11757,7 @@ class Js {
11777
11757
  if (!o)
11778
11758
  break;
11779
11759
  const h = Gt(t.reason);
11780
- Promise.try(o.onCancel || Ca, h).then(function() {
11760
+ Promise.try(o.onCancel || Sa, h).then(function() {
11781
11761
  n.postMessage({
11782
11762
  sourceName: s,
11783
11763
  targetName: i,
@@ -11840,7 +11820,7 @@ class dl {
11840
11820
  tt("Abstract method `_createCanvas` called.");
11841
11821
  }
11842
11822
  }
11843
- class of extends dl {
11823
+ class nf extends dl {
11844
11824
  constructor({
11845
11825
  ownerDocument: t = globalThis.document,
11846
11826
  enableHWA: e = !1
@@ -11905,7 +11885,7 @@ class pl {
11905
11885
  destroy(t = !1) {
11906
11886
  }
11907
11887
  }
11908
- class af extends pl {
11888
+ class rf extends pl {
11909
11889
  #t;
11910
11890
  #e;
11911
11891
  #s;
@@ -12041,8 +12021,8 @@ class af extends pl {
12041
12021
  let E = 0;
12042
12022
  for (let O = 0; O <= y; O++) {
12043
12023
  const N = Math.round(c + O * S), D = A + O * T;
12044
- for (let L = E; L <= N; L++)
12045
- _[L] = D;
12024
+ for (let R = E; R <= N; R++)
12025
+ _[R] = D;
12046
12026
  E = N + 1;
12047
12027
  }
12048
12028
  for (let O = E; O < 256; O++)
@@ -12115,19 +12095,19 @@ async function vl(a) {
12115
12095
  const e = await process.getBuiltinModule("fs").promises.readFile(a);
12116
12096
  return new Uint8Array(e);
12117
12097
  }
12118
- class hf extends pl {
12098
+ class of extends pl {
12119
12099
  }
12120
- class lf extends dl {
12100
+ class af extends dl {
12121
12101
  _createCanvas(t, e) {
12122
12102
  return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
12123
12103
  }
12124
12104
  }
12125
- class cf extends fl {
12105
+ class hf extends fl {
12126
12106
  async _fetch(t) {
12127
12107
  return vl(t);
12128
12108
  }
12129
12109
  }
12130
- class uf extends ml {
12110
+ class lf extends ml {
12131
12111
  async _fetch(t) {
12132
12112
  return vl(t);
12133
12113
  }
@@ -12137,7 +12117,7 @@ const Et = {
12137
12117
  STROKE: "Stroke",
12138
12118
  SHADING: "Shading"
12139
12119
  };
12140
- function Lr(a, t) {
12120
+ function Rr(a, t) {
12141
12121
  if (!t)
12142
12122
  return;
12143
12123
  const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
@@ -12148,7 +12128,7 @@ class vo {
12148
12128
  tt("Abstract method `getPattern` called.");
12149
12129
  }
12150
12130
  }
12151
- class df extends vo {
12131
+ class cf extends vo {
12152
12132
  constructor(t) {
12153
12133
  super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
12154
12134
  }
@@ -12163,11 +12143,11 @@ class df extends vo {
12163
12143
  let n;
12164
12144
  if (i === Et.STROKE || i === Et.FILL) {
12165
12145
  const r = e.current.getClippedPathBoundingBox(i, rt(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, h = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", o, h), c = l.context;
12166
- c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = B.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Lr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
12146
+ c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = B.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Rr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
12167
12147
  const u = new DOMMatrix(s);
12168
12148
  n.setTransform(u);
12169
12149
  } else
12170
- Lr(t, this._bbox), n = this._createGradient(t);
12150
+ Rr(t, this._bbox), n = this._createGradient(t);
12171
12151
  return n;
12172
12152
  }
12173
12153
  }
@@ -12178,25 +12158,25 @@ function fr(a, t, e, s, i, n, r, o) {
12178
12158
  const f = (h[e] + t.offsetX) * t.scaleX, g = (h[e + 1] + t.offsetY) * t.scaleY, p = (h[s] + t.offsetX) * t.scaleX, b = (h[s + 1] + t.offsetY) * t.scaleY, m = (h[i] + t.offsetX) * t.scaleX, v = (h[i + 1] + t.offsetY) * t.scaleY;
12179
12159
  if (g >= v)
12180
12160
  return;
12181
- const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], O = l[o], N = l[o + 1], D = l[o + 2], L = Math.round(g), k = Math.round(v);
12182
- let P, j, M, R, G, it, at, xt;
12183
- for (let gt = L; gt <= k; gt++) {
12161
+ const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], O = l[o], N = l[o + 1], D = l[o + 2], R = Math.round(g), k = Math.round(v);
12162
+ let P, j, M, L, G, it, at, xt;
12163
+ for (let gt = R; gt <= k; gt++) {
12184
12164
  if (gt < b) {
12185
12165
  const K = gt < g ? 0 : (g - gt) / (g - b);
12186
- P = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, R = S - (S - E) * K;
12166
+ P = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, L = S - (S - E) * K;
12187
12167
  } else {
12188
12168
  let K;
12189
- gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), P = p - (p - m) * K, j = A - (A - O) * K, M = T - (T - N) * K, R = E - (E - D) * K;
12169
+ gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), P = p - (p - m) * K, j = A - (A - O) * K, M = T - (T - N) * K, L = E - (E - D) * K;
12190
12170
  }
12191
12171
  let et;
12192
12172
  gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - O) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
12193
12173
  const Pt = Math.round(Math.min(P, G)), fe = Math.round(Math.max(P, G));
12194
12174
  let ht = u * gt + Pt * 4;
12195
12175
  for (let K = Pt; K <= fe; K++)
12196
- et = (P - K) / (P - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = R - (R - xt) * et | 0, c[ht++] = 255;
12176
+ et = (P - K) / (P - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = L - (L - xt) * et | 0, c[ht++] = 255;
12197
12177
  }
12198
12178
  }
12199
- function ff(a, t, e) {
12179
+ function uf(a, t, e) {
12200
12180
  const s = t.coords, i = t.colors;
12201
12181
  let n, r;
12202
12182
  switch (t.type) {
@@ -12216,7 +12196,7 @@ function ff(a, t, e) {
12216
12196
  throw new Error("illegal figure");
12217
12197
  }
12218
12198
  }
12219
- class gf extends vo {
12199
+ class df extends vo {
12220
12200
  constructor(t) {
12221
12201
  super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[7], this._background = t[8], this.matrix = null;
12222
12202
  }
@@ -12235,7 +12215,7 @@ class gf extends vo {
12235
12215
  A[T] = e[0], A[T + 1] = e[1], A[T + 2] = e[2], A[T + 3] = 255;
12236
12216
  }
12237
12217
  for (const A of this._figures)
12238
- ff(_, A, p);
12218
+ uf(_, A, p);
12239
12219
  return y.putImageData(_, 2, 2), {
12240
12220
  canvas: v.canvas,
12241
12221
  offsetX: o - 2 * f,
@@ -12245,7 +12225,7 @@ class gf extends vo {
12245
12225
  };
12246
12226
  }
12247
12227
  getPattern(t, e, s, i) {
12248
- Lr(t, this._bbox);
12228
+ Rr(t, this._bbox);
12249
12229
  let n;
12250
12230
  if (i === Et.SHADING)
12251
12231
  n = B.singularValueDecompose2dScale(rt(t));
@@ -12257,23 +12237,23 @@ class gf extends vo {
12257
12237
  return i !== Et.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(r.offsetX, r.offsetY), t.scale(r.scaleX, r.scaleY), t.createPattern(r.canvas, "no-repeat");
12258
12238
  }
12259
12239
  }
12260
- class pf extends vo {
12240
+ class ff extends vo {
12261
12241
  getPattern() {
12262
12242
  return "hotpink";
12263
12243
  }
12264
12244
  }
12265
- function mf(a) {
12245
+ function gf(a) {
12266
12246
  switch (a[0]) {
12267
12247
  case "RadialAxial":
12268
- return new df(a);
12248
+ return new cf(a);
12269
12249
  case "Mesh":
12270
- return new gf(a);
12250
+ return new df(a);
12271
12251
  case "Dummy":
12272
- return new pf();
12252
+ return new ff();
12273
12253
  }
12274
12254
  throw new Error(`Unknown IR type: ${a[0]}`);
12275
12255
  }
12276
- const Aa = {
12256
+ const Ca = {
12277
12257
  COLORED: 1,
12278
12258
  UNCOLORED: 2
12279
12259
  };
@@ -12300,14 +12280,14 @@ class yo {
12300
12280
  let _ = g, S = p, A = !1, T = !1;
12301
12281
  const E = Math.ceil(h * v), O = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
12302
12282
  E >= N ? _ = h : A = !0, O >= D ? S = l : T = !0;
12303
- const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), P = t.cachedCanvases.getCanvas("pattern", L.size, k.size), j = P.context, M = o.createCanvasGraphics(j);
12304
- if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-L.scale * c, -k.scale * u), M.transform(L.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
12305
- const R = P.canvas;
12283
+ const R = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), P = t.cachedCanvases.getCanvas("pattern", R.size, k.size), j = P.context, M = o.createCanvasGraphics(j);
12284
+ if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-R.scale * c, -k.scale * u), M.transform(R.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
12285
+ const L = P.canvas;
12306
12286
  A && (_ = h), T && (S = l);
12307
12287
  const G = this.getSizeAndScale(_, this.ctx.canvas.width, v), it = this.getSizeAndScale(S, this.ctx.canvas.height, y), at = G.size, xt = it.size, gt = t.cachedCanvases.getCanvas("pattern-workaround", at, xt), et = gt.context, Pt = A ? Math.floor(g / h) : 0, fe = T ? Math.floor(p / l) : 0;
12308
12288
  for (let ht = 0; ht <= Pt; ht++)
12309
12289
  for (let K = 0; K <= fe; K++)
12310
- et.drawImage(R, at * ht, xt * K, at, xt, 0, 0, at, xt);
12290
+ et.drawImage(L, at * ht, xt * K, at, xt, 0, 0, at, xt);
12311
12291
  return {
12312
12292
  canvas: gt.canvas,
12313
12293
  scaleX: G.scale,
@@ -12318,7 +12298,7 @@ class yo {
12318
12298
  }
12319
12299
  return {
12320
12300
  canvas: P.canvas,
12321
- scaleX: L.scale,
12301
+ scaleX: R.scale,
12322
12302
  scaleY: k.scale,
12323
12303
  offsetX: c,
12324
12304
  offsetY: u
@@ -12339,16 +12319,16 @@ class yo {
12339
12319
  setFillAndStrokeStyleToContext(t, e, s) {
12340
12320
  const i = t.ctx, n = t.current;
12341
12321
  switch (e) {
12342
- case Aa.COLORED:
12322
+ case Ca.COLORED:
12343
12323
  const r = this.ctx;
12344
12324
  i.fillStyle = r.fillStyle, i.strokeStyle = r.strokeStyle, n.fillColor = r.fillStyle, n.strokeColor = r.strokeStyle;
12345
12325
  break;
12346
- case Aa.UNCOLORED:
12326
+ case Ca.UNCOLORED:
12347
12327
  const o = B.makeHexColor(s[0], s[1], s[2]);
12348
12328
  i.fillStyle = o, i.strokeStyle = o, n.fillColor = o, n.strokeColor = o;
12349
12329
  break;
12350
12330
  default:
12351
- throw new zd(`Unsupported paint type: ${e}`);
12331
+ throw new Bd(`Unsupported paint type: ${e}`);
12352
12332
  }
12353
12333
  }
12354
12334
  getPattern(t, e, s, i) {
@@ -12361,7 +12341,7 @@ class yo {
12361
12341
  return h.setTransform(o), h;
12362
12342
  }
12363
12343
  }
12364
- function bf({
12344
+ function pf({
12365
12345
  src: a,
12366
12346
  srcPos: t = 0,
12367
12347
  dest: e,
@@ -12389,8 +12369,8 @@ function bf({
12389
12369
  destPos: f
12390
12370
  };
12391
12371
  }
12392
- const Ta = 16, Ea = 100, vf = 15, ka = 10, Ma = 1e3, Vt = 16;
12393
- function yf(a, t) {
12372
+ const Aa = 16, Ta = 100, mf = 15, Ea = 10, ka = 1e3, Vt = 16;
12373
+ function bf(a, t) {
12394
12374
  if (a._removeMirroring)
12395
12375
  throw new Error("Context is already forwarding operations.");
12396
12376
  a.__originalSave = a.save, a.__originalRestore = a.restore, a.__originalRotate = a.rotate, a.__originalScale = a.scale, a.__originalTranslate = a.translate, a.__originalTransform = a.transform, a.__originalSetTransform = a.setTransform, a.__originalResetTransform = a.resetTransform, a.__originalClip = a.clip, a.__originalMoveTo = a.moveTo, a.__originalLineTo = a.lineTo, a.__originalBezierCurveTo = a.bezierCurveTo, a.__originalRect = a.rect, a.__originalClosePath = a.closePath, a.__originalBeginPath = a.beginPath, a._removeMirroring = () => {
@@ -12427,7 +12407,7 @@ function yf(a, t) {
12427
12407
  t.beginPath(), this.__originalBeginPath();
12428
12408
  };
12429
12409
  }
12430
- class _f {
12410
+ class vf {
12431
12411
  constructor(t) {
12432
12412
  this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
12433
12413
  }
@@ -12459,12 +12439,12 @@ function Ui(a, t, e, s, i, n, r, o, h, l) {
12459
12439
  const b = Math.hypot(c, u), m = Math.hypot(d, f);
12460
12440
  return [b * h, m * l];
12461
12441
  }
12462
- function wf(a) {
12442
+ function yf(a) {
12463
12443
  const {
12464
12444
  width: t,
12465
12445
  height: e
12466
12446
  } = a;
12467
- if (t > Ma || e > Ma)
12447
+ if (t > ka || e > ka)
12468
12448
  return null;
12469
12449
  const s = 1e3, i = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), n = t + 1;
12470
12450
  let r = new Uint8Array(n * (e + 1)), o, h, l;
@@ -12515,7 +12495,7 @@ function wf(a) {
12515
12495
  m.save(), m.scale(1 / t, -1 / e), m.translate(0, -e), m.fill(p), m.beginPath(), m.restore();
12516
12496
  };
12517
12497
  }
12518
- class Pa {
12498
+ class Ma {
12519
12499
  constructor(t, e) {
12520
12500
  this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = al, this.textMatrixScale = 1, this.fontMatrix = Pr, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = St.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.patternStroke = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, t, e]);
12521
12501
  }
@@ -12563,7 +12543,7 @@ class Pa {
12563
12543
  return B.intersect(this.clipBox, this.getPathBoundingBox(t, e));
12564
12544
  }
12565
12545
  }
12566
- function Oa(a, t) {
12546
+ function Pa(a, t) {
12567
12547
  if (t instanceof ImageData) {
12568
12548
  a.putImageData(t, 0, 0);
12569
12549
  return;
@@ -12602,7 +12582,7 @@ function Oa(a, t) {
12602
12582
  else
12603
12583
  throw new Error(`bad image kind: ${t.kind}`);
12604
12584
  }
12605
- function Da(a, t) {
12585
+ function Oa(a, t) {
12606
12586
  if (t.bitmap) {
12607
12587
  a.drawImage(t.bitmap, 0, 0);
12608
12588
  return;
@@ -12614,7 +12594,7 @@ function Da(a, t) {
12614
12594
  const d = u < n ? Vt : i;
12615
12595
  ({
12616
12596
  srcPos: h
12617
- } = bf({
12597
+ } = pf({
12618
12598
  src: l,
12619
12599
  srcPos: h,
12620
12600
  dest: c,
@@ -12638,21 +12618,21 @@ function Yi(a) {
12638
12618
  t !== "none" && t !== "" && (a.filter = "none");
12639
12619
  }
12640
12620
  }
12641
- function Ra(a, t) {
12621
+ function Da(a, t) {
12642
12622
  if (t)
12643
12623
  return !0;
12644
12624
  const e = B.singularValueDecompose2dScale(a);
12645
12625
  e[0] = Math.fround(e[0]), e[1] = Math.fround(e[1]);
12646
- const s = Math.fround((globalThis.devicePixelRatio || 1) * Ls.PDF_TO_CSS_UNITS);
12626
+ const s = Math.fround((globalThis.devicePixelRatio || 1) * Rs.PDF_TO_CSS_UNITS);
12647
12627
  return e[0] <= s && e[1] <= s;
12648
12628
  }
12649
- const xf = ["butt", "round", "square"], Sf = ["miter", "round", "bevel"], Cf = {}, La = {};
12629
+ const _f = ["butt", "round", "square"], wf = ["miter", "round", "bevel"], xf = {}, La = {};
12650
12630
  class Es {
12651
12631
  constructor(t, e, s, i, n, {
12652
12632
  optionalContentConfig: r,
12653
12633
  markedContentStack: o = null
12654
12634
  }, h, l) {
12655
- this.ctx = t, this.current = new Pa(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new _f(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12635
+ this.ctx = t, this.current = new Ma(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new vf(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12656
12636
  }
12657
12637
  getObject(t, e = null) {
12658
12638
  return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
@@ -12676,7 +12656,7 @@ class Es {
12676
12656
  const h = n.length;
12677
12657
  if (h === o)
12678
12658
  return o;
12679
- const l = h - o > ka && typeof s == "function", c = l ? Date.now() + vf : 0;
12659
+ const l = h - o > Ea && typeof s == "function", c = l ? Date.now() + mf : 0;
12680
12660
  let u = 0;
12681
12661
  const d = this.commonObjs, f = this.objs;
12682
12662
  let g;
@@ -12693,7 +12673,7 @@ class Es {
12693
12673
  }
12694
12674
  if (o++, o === h)
12695
12675
  return o;
12696
- if (l && ++u > ka) {
12676
+ if (l && ++u > Ea) {
12697
12677
  if (Date.now() > c)
12698
12678
  return s(), o;
12699
12679
  u = 0;
@@ -12756,11 +12736,11 @@ class Es {
12756
12736
  }
12757
12737
  c = O;
12758
12738
  }
12759
- c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Da(u.context, t));
12739
+ c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Oa(u.context, t));
12760
12740
  let d = B.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
12761
12741
  d = B.transform(d, [1, 0, 0, 1, 0, -i]);
12762
12742
  const [f, g, p, b] = B.getAxialAlignedBoundingBox([0, 0, s, i], d), m = Math.round(p - f) || 1, v = Math.round(b - g) || 1, y = this.cachedCanvases.getCanvas("fillCanvas", m, v), _ = y.context, S = f, A = g;
12763
- _.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, pe(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Ra(rt(_), t.interpolate), Ui(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
12743
+ _.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, pe(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Da(rt(_), t.interpolate), Ui(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
12764
12744
  const T = B.transform(pe(_), [1, 0, 0, 1, -S, -A]);
12765
12745
  return _.fillStyle = r ? n.getPattern(e, this, T, Et.FILL) : n, _.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(l, y.canvas)), {
12766
12746
  canvas: y.canvas,
@@ -12772,10 +12752,10 @@ class Es {
12772
12752
  t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
12773
12753
  }
12774
12754
  setLineCap(t) {
12775
- this.ctx.lineCap = xf[t];
12755
+ this.ctx.lineCap = _f[t];
12776
12756
  }
12777
12757
  setLineJoin(t) {
12778
- this.ctx.lineJoin = Sf[t];
12758
+ this.ctx.lineJoin = wf[t];
12779
12759
  }
12780
12760
  setMiterLimit(t) {
12781
12761
  this.ctx.miterLimit = t;
@@ -12845,7 +12825,7 @@ class Es {
12845
12825
  const t = this.ctx.canvas.width, e = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(s, t, e);
12846
12826
  this.suspendedCtx = this.ctx, this.ctx = i.context;
12847
12827
  const n = this.ctx;
12848
- n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n), yf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
12828
+ n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n), bf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
12849
12829
  }
12850
12830
  endSMaskMode() {
12851
12831
  if (!this.inSMaskMode)
@@ -12959,7 +12939,7 @@ class Es {
12959
12939
  this.consumePath();
12960
12940
  }
12961
12941
  clip() {
12962
- this.pendingClip = Cf;
12942
+ this.pendingClip = xf;
12963
12943
  }
12964
12944
  eoClip() {
12965
12945
  this.pendingClip = La;
@@ -13007,7 +12987,7 @@ class Es {
13007
12987
  s.black ? o = "900" : s.bold && (o = "bold");
13008
12988
  const h = s.italic ? "italic" : "normal";
13009
12989
  let l = e;
13010
- e < Ta ? l = Ta : e > Ea && (l = Ea), this.current.fontSizeScale = e / l, this.ctx.font = `${h} ${o} ${l}px ${r}`;
12990
+ e < Aa ? l = Aa : e > Ta && (l = Ta), this.current.fontSizeScale = e / l, this.ctx.font = `${h} ${o} ${l}px ${r}`;
13011
12991
  }
13012
12992
  setTextRenderingMode(t) {
13013
12993
  this.current.textRenderingMode = t;
@@ -13116,25 +13096,25 @@ class Es {
13116
13096
  }
13117
13097
  let E = !1;
13118
13098
  const O = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
13119
- let L, k, P = T.width;
13099
+ let R, k, P = T.width;
13120
13100
  if (d) {
13121
- const M = T.vmetric || g, R = -(T.vmetric ? M[1] : P * 0.5) * p, G = M[2] * p;
13122
- P = M ? -M[0] : P, L = R / r, k = (S + G) / r;
13101
+ const M = T.vmetric || g, L = -(T.vmetric ? M[1] : P * 0.5) * p, G = M[2] * p;
13102
+ P = M ? -M[0] : P, R = L / r, k = (S + G) / r;
13123
13103
  } else
13124
- L = S / r, k = 0;
13104
+ R = S / r, k = 0;
13125
13105
  if (s.remeasure && P > 0) {
13126
13106
  const M = n.measureText(N).width * 1e3 / i * r;
13127
13107
  if (P < M && this.isFontSubpixelAAEnabled) {
13128
- const R = P / M;
13129
- E = !0, n.save(), n.scale(R, 1), L /= R;
13130
- } else P !== M && (L += (P - M) / 2e3 * i / r);
13108
+ const L = P / M;
13109
+ E = !0, n.save(), n.scale(L, 1), R /= L;
13110
+ } else P !== M && (R += (P - M) / 2e3 * i / r);
13131
13111
  }
13132
13112
  if (this.contentVisible && (T.isInFont || s.missingFile)) {
13133
13113
  if (b && !D)
13134
- n.fillText(N, L, k);
13135
- else if (this.paintChar(N, L, k, m, v), D) {
13136
- const M = L + i * D.offset.x / r, R = k - i * D.offset.y / r;
13137
- this.paintChar(D.fontChar, M, R, m, v);
13114
+ n.fillText(N, R, k);
13115
+ else if (this.paintChar(N, R, k, m, v), D) {
13116
+ const M = R + i * D.offset.x / r, L = k - i * D.offset.y / r;
13117
+ this.paintChar(D.fontChar, M, L, m, v);
13138
13118
  }
13139
13119
  }
13140
13120
  const j = d ? P * p - O * l : P * p + O * l;
@@ -13200,7 +13180,7 @@ class Es {
13200
13180
  }
13201
13181
  _getPattern(t, e = null) {
13202
13182
  let s;
13203
- return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = mf(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13183
+ return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = gf(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13204
13184
  }
13205
13185
  shadingFill(t) {
13206
13186
  if (!this.contentVisible)
@@ -13295,7 +13275,7 @@ class Es {
13295
13275
  } else
13296
13276
  Yi(this.ctx), this.endPath(), this.ctx.rect(e[0], e[1], r, o), this.ctx.clip(), this.ctx.beginPath();
13297
13277
  }
13298
- this.current = new Pa(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...s), this.transform(...i);
13278
+ this.current = new Ma(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...s), this.transform(...i);
13299
13279
  }
13300
13280
  endAnnotation() {
13301
13281
  this.annotationCanvas && (this.ctx.restore(), this.#e(), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
@@ -13306,7 +13286,7 @@ class Es {
13306
13286
  const e = t.count;
13307
13287
  t = this.getObject(t.data, t), t.count = e;
13308
13288
  const s = this.ctx, i = this.processingType3;
13309
- if (i && (i.compiled === void 0 && (i.compiled = wf(t)), i.compiled)) {
13289
+ if (i && (i.compiled === void 0 && (i.compiled = yf(t)), i.compiled)) {
13310
13290
  i.compiled(s);
13311
13291
  return;
13312
13292
  }
@@ -13342,7 +13322,7 @@ class Es {
13342
13322
  } = n, c = this.cachedCanvases.getCanvas("maskCanvas", o, h), u = c.context;
13343
13323
  u.save();
13344
13324
  const d = this.getObject(r, n);
13345
- Da(u, d), u.globalCompositeOperation = "source-in", u.fillStyle = i ? s.getPattern(u, this, pe(e), Et.FILL) : s, u.fillRect(0, 0, o, h), u.restore(), e.save(), e.transform(...l), e.scale(1, -1), Ui(e, c.canvas, 0, 0, o, h, 0, -1, 1, 1), e.restore();
13325
+ Oa(u, d), u.globalCompositeOperation = "source-in", u.fillStyle = i ? s.getPattern(u, this, pe(e), Et.FILL) : s, u.fillRect(0, 0, o, h), u.restore(), e.save(), e.transform(...l), e.scale(1, -1), Ui(e, c.canvas, 0, 0, o, h, 0, -1, 1, 1), e.restore();
13346
13326
  }
13347
13327
  this.compose();
13348
13328
  }
@@ -13406,10 +13386,10 @@ class Es {
13406
13386
  n = t;
13407
13387
  else {
13408
13388
  const h = this.cachedCanvases.getCanvas("inlineImage", e, s).context;
13409
- Oa(h, t), n = this.applyTransferMapsToCanvas(h);
13389
+ Pa(h, t), n = this.applyTransferMapsToCanvas(h);
13410
13390
  }
13411
13391
  const r = this._scaleImage(n, pe(i));
13412
- i.imageSmoothingEnabled = Ra(rt(i), t.interpolate), Ui(i, r.img, 0, 0, r.paintWidth, r.paintHeight, 0, -s, e, s), this.compose(), this.restore();
13392
+ i.imageSmoothingEnabled = Da(rt(i), t.interpolate), Ui(i, r.img, 0, 0, r.paintWidth, r.paintHeight, 0, -s, e, s), this.compose(), this.restore();
13413
13393
  }
13414
13394
  paintInlineImageXObjectGroup(t, e) {
13415
13395
  if (!this.contentVisible)
@@ -13420,7 +13400,7 @@ class Es {
13420
13400
  i = t.bitmap;
13421
13401
  else {
13422
13402
  const n = t.width, r = t.height, h = this.cachedCanvases.getCanvas("inlineImage", n, r).context;
13423
- Oa(h, t), i = this.applyTransferMapsToCanvas(h);
13403
+ Pa(h, t), i = this.applyTransferMapsToCanvas(h);
13424
13404
  }
13425
13405
  for (const n of e)
13426
13406
  s.save(), s.transform(...n.transform), s.scale(1, -1), Ui(s, i, n.x, n.y, n.w, n.h, 0, -1, 1, 1), s.restore();
@@ -13555,7 +13535,7 @@ class ri {
13555
13535
  this.#e = t;
13556
13536
  }
13557
13537
  }
13558
- class Af {
13538
+ class Sf {
13559
13539
  #t;
13560
13540
  #e;
13561
13541
  constructor({
@@ -13578,7 +13558,7 @@ class Af {
13578
13558
  }
13579
13559
  }
13580
13560
  const _s = Symbol("INTERNAL");
13581
- class Tf {
13561
+ class Cf {
13582
13562
  #t = !1;
13583
13563
  #e = !1;
13584
13564
  #s = !1;
@@ -13606,7 +13586,7 @@ class Tf {
13606
13586
  t !== _s && tt("Internal method `_setVisible` called."), this.#s = s, this.#i = e;
13607
13587
  }
13608
13588
  }
13609
- class Ef {
13589
+ class Af {
13610
13590
  #t = null;
13611
13591
  #e = /* @__PURE__ */ new Map();
13612
13592
  #s = null;
@@ -13615,7 +13595,7 @@ class Ef {
13615
13595
  if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
13616
13596
  this.name = t.name, this.creator = t.creator, this.#i = t.order;
13617
13597
  for (const s of t.groups)
13618
- this.#e.set(s.id, new Tf(e, s));
13598
+ this.#e.set(s.id, new Cf(e, s));
13619
13599
  if (t.baseState === "OFF")
13620
13600
  for (const s of this.#e.values())
13621
13601
  s._setVisible(_s, !1);
@@ -13766,7 +13746,7 @@ class Ef {
13766
13746
  return this.#t = t.hexdigest();
13767
13747
  }
13768
13748
  }
13769
- class kf {
13749
+ class Tf {
13770
13750
  constructor(t, {
13771
13751
  disableRange: e = !1,
13772
13752
  disableStream: s = !1
@@ -13835,12 +13815,12 @@ class kf {
13835
13815
  getFullReader() {
13836
13816
  bt(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
13837
13817
  const t = this._queuedChunks;
13838
- return this._queuedChunks = null, new Mf(this, t, this._progressiveDone, this._contentDispositionFilename);
13818
+ return this._queuedChunks = null, new Ef(this, t, this._progressiveDone, this._contentDispositionFilename);
13839
13819
  }
13840
13820
  getRangeReader(t, e) {
13841
13821
  if (e <= this._progressiveDataLength)
13842
13822
  return null;
13843
- const s = new Pf(this, t, e);
13823
+ const s = new kf(this, t, e);
13844
13824
  return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(s), s;
13845
13825
  }
13846
13826
  cancelAllRequests(t) {
@@ -13850,7 +13830,7 @@ class kf {
13850
13830
  this._pdfDataRangeTransport.abort();
13851
13831
  }
13852
13832
  }
13853
- class Mf {
13833
+ class Ef {
13854
13834
  constructor(t, e, s = !1, i = null) {
13855
13835
  this._stream = t, this._done = s || !1, this._filename = fo(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
13856
13836
  for (const n of this._queuedChunks)
@@ -13905,7 +13885,7 @@ class Mf {
13905
13885
  this._done || (this._done = !0);
13906
13886
  }
13907
13887
  }
13908
- class Pf {
13888
+ class kf {
13909
13889
  constructor(t, e, s) {
13910
13890
  this._stream = t, this._begin = e, this._end = s, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
13911
13891
  }
@@ -13957,7 +13937,7 @@ class Pf {
13957
13937
  this._requests.length = 0, this._stream._removeRangeReader(this);
13958
13938
  }
13959
13939
  }
13960
- function Of(a) {
13940
+ function Mf(a) {
13961
13941
  let t = !0, e = s("filename\\*", "i").exec(a);
13962
13942
  if (e) {
13963
13943
  e = e[1];
@@ -14078,7 +14058,7 @@ function _l({
14078
14058
  function wl(a) {
14079
14059
  const t = a.get("Content-Disposition");
14080
14060
  if (t) {
14081
- let e = Of(t);
14061
+ let e = Mf(t);
14082
14062
  if (e.includes("%"))
14083
14063
  try {
14084
14064
  e = decodeURIComponent(e);
@@ -14108,7 +14088,7 @@ function Sl(a, t, e) {
14108
14088
  function Cl(a) {
14109
14089
  return a instanceof Uint8Array ? a.buffer : a instanceof ArrayBuffer ? a : (U(`getArrayBuffer - unexpected data format: ${a}`), new Uint8Array(a).buffer);
14110
14090
  }
14111
- class Fa {
14091
+ class Ra {
14112
14092
  _responseOrigin = null;
14113
14093
  constructor(t) {
14114
14094
  this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = yl(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
@@ -14117,12 +14097,12 @@ class Fa {
14117
14097
  return this._fullRequestReader?._loaded ?? 0;
14118
14098
  }
14119
14099
  getFullReader() {
14120
- return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Df(this), this._fullRequestReader;
14100
+ return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Pf(this), this._fullRequestReader;
14121
14101
  }
14122
14102
  getRangeReader(t, e) {
14123
14103
  if (e <= this._progressiveDataLength)
14124
14104
  return null;
14125
- const s = new Rf(this, t, e);
14105
+ const s = new Of(this, t, e);
14126
14106
  return this._rangeRequestReaders.push(s), s;
14127
14107
  }
14128
14108
  cancelAllRequests(t) {
@@ -14131,7 +14111,7 @@ class Fa {
14131
14111
  e.cancel(t);
14132
14112
  }
14133
14113
  }
14134
- class Df {
14114
+ class Pf {
14135
14115
  constructor(t) {
14136
14116
  this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
14137
14117
  const e = t.source;
@@ -14189,7 +14169,7 @@ class Df {
14189
14169
  this._reader?.cancel(t), this._abortController.abort();
14190
14170
  }
14191
14171
  }
14192
- class Rf {
14172
+ class Of {
14193
14173
  constructor(t, e, s) {
14194
14174
  this._stream = t, this._reader = null, this._loaded = 0;
14195
14175
  const i = t.source;
@@ -14230,11 +14210,11 @@ class Rf {
14230
14210
  }
14231
14211
  }
14232
14212
  const gr = 200, pr = 206;
14233
- function Lf(a) {
14213
+ function Df(a) {
14234
14214
  const t = a.response;
14235
14215
  return typeof t != "string" ? t : Nn(t).buffer;
14236
14216
  }
14237
- class Ff {
14217
+ class Lf {
14238
14218
  _responseOrigin = null;
14239
14219
  constructor({
14240
14220
  url: t,
@@ -14274,7 +14254,7 @@ class Ff {
14274
14254
  s.onError(i.status);
14275
14255
  return;
14276
14256
  }
14277
- const o = Lf(i);
14257
+ const o = Df(i);
14278
14258
  if (n === pr) {
14279
14259
  const h = i.getResponseHeader("Content-Range"), l = /bytes (\d+)-(\d+)\/(\d+)/.exec(h);
14280
14260
  l ? s.onDone({
@@ -14297,19 +14277,19 @@ class Ff {
14297
14277
  delete this.pendingRequests[t], e.abort();
14298
14278
  }
14299
14279
  }
14300
- class If {
14280
+ class Rf {
14301
14281
  constructor(t) {
14302
- this._source = t, this._manager = new Ff(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14282
+ this._source = t, this._manager = new Lf(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14303
14283
  }
14304
14284
  _onRangeRequestReaderClosed(t) {
14305
14285
  const e = this._rangeRequestReaders.indexOf(t);
14306
14286
  e >= 0 && this._rangeRequestReaders.splice(e, 1);
14307
14287
  }
14308
14288
  getFullReader() {
14309
- return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Nf(this._manager, this._source), this._fullRequestReader;
14289
+ return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Ff(this._manager, this._source), this._fullRequestReader;
14310
14290
  }
14311
14291
  getRangeReader(t, e) {
14312
- const s = new jf(this._manager, t, e);
14292
+ const s = new If(this._manager, t, e);
14313
14293
  return s.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(s), s;
14314
14294
  }
14315
14295
  cancelAllRequests(t) {
@@ -14318,7 +14298,7 @@ class If {
14318
14298
  e.cancel(t);
14319
14299
  }
14320
14300
  }
14321
- class Nf {
14301
+ class Ff {
14322
14302
  constructor(t, e) {
14323
14303
  this._manager = t, this._url = e.url, this._fullRequestId = t.request({
14324
14304
  onHeadersReceived: this._onHeadersReceived.bind(this),
@@ -14410,7 +14390,7 @@ class Nf {
14410
14390
  this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
14411
14391
  }
14412
14392
  }
14413
- class jf {
14393
+ class If {
14414
14394
  constructor(t, e, s) {
14415
14395
  this._manager = t, this._url = t.url, this._requestId = t.request({
14416
14396
  begin: e,
@@ -14483,27 +14463,27 @@ class jf {
14483
14463
  this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
14484
14464
  }
14485
14465
  }
14486
- const Bf = /^[a-z][a-z0-9\-+.]+:/i;
14487
- function Hf(a) {
14488
- if (Bf.test(a))
14466
+ const Nf = /^[a-z][a-z0-9\-+.]+:/i;
14467
+ function jf(a) {
14468
+ if (Nf.test(a))
14489
14469
  return new URL(a);
14490
14470
  const t = process.getBuiltinModule("url");
14491
14471
  return new URL(t.pathToFileURL(a));
14492
14472
  }
14493
- class zf {
14473
+ class Bf {
14494
14474
  constructor(t) {
14495
- this.source = t, this.url = Hf(t.url), bt(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14475
+ this.source = t, this.url = jf(t.url), bt(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14496
14476
  }
14497
14477
  get _progressiveDataLength() {
14498
14478
  return this._fullRequestReader?._loaded ?? 0;
14499
14479
  }
14500
14480
  getFullReader() {
14501
- return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Gf(this), this._fullRequestReader;
14481
+ return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Hf(this), this._fullRequestReader;
14502
14482
  }
14503
14483
  getRangeReader(t, e) {
14504
14484
  if (e <= this._progressiveDataLength)
14505
14485
  return null;
14506
- const s = new Vf(this, t, e);
14486
+ const s = new zf(this, t, e);
14507
14487
  return this._rangeRequestReaders.push(s), s;
14508
14488
  }
14509
14489
  cancelAllRequests(t) {
@@ -14512,7 +14492,7 @@ class zf {
14512
14492
  e.cancel(t);
14513
14493
  }
14514
14494
  }
14515
- class Gf {
14495
+ class Hf {
14516
14496
  constructor(t) {
14517
14497
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
14518
14498
  const e = t.source;
@@ -14576,7 +14556,7 @@ class Gf {
14576
14556
  }), !this._isStreamingSupported && this._isRangeSupported && this._error(new We("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
14577
14557
  }
14578
14558
  }
14579
- class Vf {
14559
+ class zf {
14580
14560
  constructor(t, e, s) {
14581
14561
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
14582
14562
  const i = t.source;
@@ -14626,7 +14606,7 @@ class Vf {
14626
14606
  }), this._storedError && this._readableStream.destroy(this._storedError);
14627
14607
  }
14628
14608
  }
14629
- const Xf = 1e5, zt = 30, Wf = 0.8;
14609
+ const Gf = 1e5, zt = 30, Vf = 0.8;
14630
14610
  class Dt {
14631
14611
  #t = Promise.withResolvers();
14632
14612
  #e = null;
@@ -14739,7 +14719,7 @@ class Dt {
14739
14719
  this.#n.ctx ??= Dt.#k(this.#r);
14740
14720
  const e = this.#m, s = this.#o;
14741
14721
  for (const i of t) {
14742
- if (e.length > Xf) {
14722
+ if (e.length > Gf) {
14743
14723
  U("Ignoring additional textDivs for performance reasons."), this.#s = !0;
14744
14724
  return;
14745
14725
  }
@@ -14768,7 +14748,7 @@ class Dt {
14768
14748
  r.vertical && (n += Math.PI / 2);
14769
14749
  let o = this.#i && r.fontSubstitution || r.fontFamily;
14770
14750
  o = Dt.fontFamilyMap.get(o) || o;
14771
- const h = Math.hypot(i[2], i[3]), l = h * Dt.#L(o, this.#r);
14751
+ const h = Math.hypot(i[2], i[3]), l = h * Dt.#R(o, this.#r);
14772
14752
  let c, u;
14773
14753
  n === 0 ? (c = i[4], u = i[5] - l) : (c = i[4] + l * Math.sin(n), u = i[5] - l * Math.cos(n));
14774
14754
  const d = "calc(var(--scale-factor)*", f = e.style;
@@ -14843,7 +14823,7 @@ class Dt {
14843
14823
  const t = document.createElement("div");
14844
14824
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#S = t.getBoundingClientRect().height, t.remove();
14845
14825
  }
14846
- static #L(t, e) {
14826
+ static #R(t, e) {
14847
14827
  const s = this.#_.get(t);
14848
14828
  if (s)
14849
14829
  return s;
@@ -14870,7 +14850,7 @@ class Dt {
14870
14850
  break;
14871
14851
  }
14872
14852
  i.canvas.width = i.canvas.height = 0;
14873
- const l = r ? r / (r + o) : Wf;
14853
+ const l = r ? r / (r + o) : Vf;
14874
14854
  return this.#_.set(t, l), l;
14875
14855
  }
14876
14856
  }
@@ -14902,8 +14882,8 @@ class ui {
14902
14882
  return !(t === "textarea" || t === "input" || t === "option" || t === "select");
14903
14883
  }
14904
14884
  }
14905
- const Uf = 65536, Yf = 100, $f = 5e3, qf = kt ? lf : of, Kf = kt ? cf : gl, Jf = kt ? hf : af, Zf = kt ? uf : bl;
14906
- function Qf(a = {}) {
14885
+ const Xf = 65536, Wf = 100, Uf = 5e3, Yf = kt ? af : nf, $f = kt ? hf : gl, qf = kt ? of : rf, Kf = kt ? lf : bl;
14886
+ function Jf(a = {}) {
14907
14887
  typeof a == "string" || a instanceof URL ? a = {
14908
14888
  url: a
14909
14889
  } : (a instanceof ArrayBuffer || ArrayBuffer.isView(a)) && (a = {
@@ -14911,16 +14891,16 @@ function Qf(a = {}) {
14911
14891
  });
14912
14892
  const t = new _o(), {
14913
14893
  docId: e
14914
- } = t, s = a.url ? tg(a.url) : null, i = a.data ? eg(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Uf;
14894
+ } = t, s = a.url ? Zf(a.url) : null, i = a.data ? Qf(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Xf;
14915
14895
  let c = a.worker instanceof ks ? a.worker : null;
14916
- const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || Kf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || Zf, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, O = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, L = a.disableRange === !0, k = a.disableStream === !0, P = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || qf, R = a.FilterFactory || Jf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14917
- Nd(u);
14896
+ const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || $f, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || Kf, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, O = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, R = a.disableRange === !0, k = a.disableStream === !0, P = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Yf, L = a.FilterFactory || qf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14897
+ Fd(u);
14918
14898
  const et = {
14919
14899
  canvasFactory: new M({
14920
14900
  ownerDocument: D,
14921
14901
  enableHWA: G
14922
14902
  }),
14923
- filterFactory: new R({
14903
+ filterFactory: new L({
14924
14904
  docId: e,
14925
14905
  ownerDocument: D
14926
14906
  }),
@@ -14981,8 +14961,8 @@ function Qf(a = {}) {
14981
14961
  const ht = c.messageHandler.sendWithPromise("GetDocRequest", Pt, i ? [i.buffer] : null);
14982
14962
  let K;
14983
14963
  if (h)
14984
- K = new kf(h, {
14985
- disableRange: L,
14964
+ K = new Tf(h, {
14965
+ disableRange: R,
14986
14966
  disableStream: k
14987
14967
  });
14988
14968
  else if (!i) {
@@ -14993,18 +14973,18 @@ function Qf(a = {}) {
14993
14973
  if (Ks(s)) {
14994
14974
  if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
14995
14975
  throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
14996
- je = Fa;
14976
+ je = Ra;
14997
14977
  } else
14998
- je = zf;
14978
+ je = Bf;
14999
14979
  else
15000
- je = Ks(s) ? Fa : If;
14980
+ je = Ks(s) ? Ra : Rf;
15001
14981
  K = new je({
15002
14982
  url: s,
15003
14983
  length: it,
15004
14984
  httpHeaders: n,
15005
14985
  withCredentials: r,
15006
14986
  rangeChunkSize: l,
15007
- disableRange: L,
14987
+ disableRange: R,
15008
14988
  disableStream: k
15009
14989
  });
15010
14990
  }
@@ -15013,12 +14993,12 @@ function Qf(a = {}) {
15013
14993
  throw new Error("Loading aborted");
15014
14994
  if (c.destroyed)
15015
14995
  throw new Error("Worker was destroyed");
15016
- const ms = new Js(e, je, c.port), ge = new rg(ms, t, K, fe, et);
14996
+ const ms = new Js(e, je, c.port), ge = new ig(ms, t, K, fe, et);
15017
14997
  t._transport = ge, ms.send("Ready", null);
15018
14998
  });
15019
14999
  }).catch(t._capability.reject), t;
15020
15000
  }
15021
- function tg(a) {
15001
+ function Zf(a) {
15022
15002
  if (a instanceof URL)
15023
15003
  return a.href;
15024
15004
  try {
@@ -15029,7 +15009,7 @@ function tg(a) {
15029
15009
  }
15030
15010
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
15031
15011
  }
15032
- function eg(a) {
15012
+ function Qf(a) {
15033
15013
  if (kt && typeof Buffer < "u" && a instanceof Buffer)
15034
15014
  throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
15035
15015
  if (a instanceof Uint8Array && a.byteLength === a.buffer.byteLength)
@@ -15040,7 +15020,7 @@ function eg(a) {
15040
15020
  return new Uint8Array(a);
15041
15021
  throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
15042
15022
  }
15043
- function Ia(a) {
15023
+ function Fa(a) {
15044
15024
  return typeof a == "object" && Number.isInteger(a?.num) && a.num >= 0 && Number.isInteger(a?.gen) && a.gen >= 0;
15045
15025
  }
15046
15026
  class _o {
@@ -15108,7 +15088,7 @@ class Al {
15108
15088
  abort() {
15109
15089
  }
15110
15090
  }
15111
- class sg {
15091
+ class tg {
15112
15092
  constructor(t, e) {
15113
15093
  this._pdfInfo = t, this._transport = e;
15114
15094
  }
@@ -15220,11 +15200,11 @@ class sg {
15220
15200
  return this._transport.getCalculationOrderIds();
15221
15201
  }
15222
15202
  }
15223
- class ig {
15203
+ class eg {
15224
15204
  #t = null;
15225
15205
  #e = !1;
15226
15206
  constructor(t, e, s, i = !1) {
15227
- this._pageIndex = t, this._pageInfo = e, this._transport = s, this._stats = i ? new xa() : null, this._pdfBug = i, this.commonObjs = s.commonObjs, this.objs = new Tl(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
15207
+ this._pageIndex = t, this._pageInfo = e, this._transport = s, this._stats = i ? new wa() : null, this._pdfBug = i, this.commonObjs = s.commonObjs, this.objs = new Tl(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
15228
15208
  }
15229
15209
  get pageNumber() {
15230
15210
  return this._pageIndex + 1;
@@ -15424,7 +15404,7 @@ class ig {
15424
15404
  cleanup(t = !1) {
15425
15405
  this.#e = !0;
15426
15406
  const e = this.#s(!1);
15427
- return t && e && (this._stats &&= new xa()), e;
15407
+ return t && e && (this._stats &&= new wa()), e;
15428
15408
  }
15429
15409
  #s(t = !1) {
15430
15410
  if (this.#i(), !this.#e || this.destroyed)
@@ -15432,7 +15412,7 @@ class ig {
15432
15412
  if (t)
15433
15413
  return this.#t = setTimeout(() => {
15434
15414
  this.#t = null, this.#s(!1);
15435
- }, $f), !1;
15415
+ }, Uf), !1;
15436
15416
  for (const {
15437
15417
  renderTasks: e,
15438
15418
  operatorList: s
@@ -15512,7 +15492,7 @@ class ig {
15512
15492
  if (t.renderTasks.size > 0)
15513
15493
  return;
15514
15494
  if (e instanceof uo) {
15515
- let i = Yf;
15495
+ let i = Wf;
15516
15496
  e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
15517
15497
  t.streamReaderCancelTimeout = null, this._abortOperatorList({
15518
15498
  intentState: t,
@@ -15538,7 +15518,7 @@ class ig {
15538
15518
  return this._stats;
15539
15519
  }
15540
15520
  }
15541
- class ng {
15521
+ class sg {
15542
15522
  #t = /* @__PURE__ */ new Map();
15543
15523
  #e = Promise.resolve();
15544
15524
  postMessage(t, e) {
@@ -15581,7 +15561,7 @@ const nt = class nt {
15581
15561
  constructor({
15582
15562
  name: t = null,
15583
15563
  port: e = null,
15584
- verbosity: s = jd()
15564
+ verbosity: s = Id()
15585
15565
  } = {}) {
15586
15566
  bs(this, Ms);
15587
15567
  if (this.name = t, this.destroyed = !1, this.verbosity = s, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, e) {
@@ -15658,7 +15638,7 @@ const nt = class nt {
15658
15638
  this._readyCapability.reject(new Error("Worker was destroyed"));
15659
15639
  return;
15660
15640
  }
15661
- const e = new ng();
15641
+ const e = new sg();
15662
15642
  this._port = e;
15663
15643
  const s = `fake${Eo(nt, _n)._++}`, i = new Js(s + "_worker", s, e);
15664
15644
  t.setup(i, e), this._messageHandler = new Js(s, s + "_worker", e), _i(this, Ms, Qi).call(this);
@@ -15719,14 +15699,14 @@ _n = new WeakMap(), is = new WeakMap(), ns = new WeakMap(), Ms = new WeakSet(),
15719
15699
  }));
15720
15700
  };
15721
15701
  let ks = nt;
15722
- class rg {
15702
+ class ig {
15723
15703
  #t = /* @__PURE__ */ new Map();
15724
15704
  #e = /* @__PURE__ */ new Map();
15725
15705
  #s = /* @__PURE__ */ new Map();
15726
15706
  #i = /* @__PURE__ */ new Map();
15727
15707
  #r = null;
15728
15708
  constructor(t, e, s, i, n) {
15729
- this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new nf({
15709
+ this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new ef({
15730
15710
  ownerDocument: i.ownerDocument,
15731
15711
  styleElement: i.styleElement
15732
15712
  }), this.loadingParams = i.loadingParams, this._params = i, this.canvasFactory = n.canvasFactory, this.filterFactory = n.filterFactory, this.cMapReaderFactory = n.cMapReaderFactory, this.standardFontDataFactory = n.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = s, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
@@ -15742,7 +15722,7 @@ class rg {
15742
15722
  return Y(this, "annotationStorage", new bo());
15743
15723
  }
15744
15724
  getRenderingIntent(t, e = ze.ENABLE, s = null, i = !1, n = !1) {
15745
- let r = Yt.DISPLAY, o = Rr;
15725
+ let r = Yt.DISPLAY, o = Lr;
15746
15726
  switch (t) {
15747
15727
  case "any":
15748
15728
  r = Yt.ANY;
@@ -15872,7 +15852,7 @@ class rg {
15872
15852
  }), t.on("GetDoc", ({
15873
15853
  pdfInfo: s
15874
15854
  }) => {
15875
- this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new sg(s, this));
15855
+ this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new tg(s, this));
15876
15856
  }), t.on("DocException", (s) => {
15877
15857
  e._capability.reject(Gt(s));
15878
15858
  }), t.on("PasswordRequest", (s) => {
@@ -15914,7 +15894,7 @@ class rg {
15914
15894
  U(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
15915
15895
  break;
15916
15896
  }
15917
- const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new rf(n, {
15897
+ const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new sf(n, {
15918
15898
  disableFontFace: r,
15919
15899
  fontExtraProperties: o,
15920
15900
  inspectFont: l
@@ -15955,7 +15935,7 @@ class rg {
15955
15935
  }
15956
15936
  switch (n) {
15957
15937
  case "Image":
15958
- o.objs.resolve(s, r), r?.dataLen > Rd && (o._maybeCleanupAfterRender = !0);
15938
+ o.objs.resolve(s, r), r?.dataLen > Od && (o._maybeCleanupAfterRender = !0);
15959
15939
  break;
15960
15940
  case "Pattern":
15961
15941
  o.objs.resolve(s, r);
@@ -16013,13 +15993,13 @@ class rg {
16013
15993
  if (this.destroyed)
16014
15994
  throw new Error("Transport destroyed");
16015
15995
  n.refStr && this.#i.set(n.refStr, t);
16016
- const r = new ig(e, n, this, this._params.pdfBug);
15996
+ const r = new eg(e, n, this, this._params.pdfBug);
16017
15997
  return this.#e.set(e, r), r;
16018
15998
  });
16019
15999
  return this.#s.set(e, i), i;
16020
16000
  }
16021
16001
  getPageIndex(t) {
16022
- return Ia(t) ? this.messageHandler.sendWithPromise("GetPageIndex", {
16002
+ return Fa(t) ? this.messageHandler.sendWithPromise("GetPageIndex", {
16023
16003
  num: t.num,
16024
16004
  gen: t.gen
16025
16005
  }) : Promise.reject(new Error("Invalid pageIndex request."));
@@ -16082,7 +16062,7 @@ class rg {
16082
16062
  return this.messageHandler.sendWithPromise("GetOutline", null);
16083
16063
  }
16084
16064
  getOptionalContentConfig(t) {
16085
- return this.#n("GetOptionalContentConfig").then((e) => new Ef(e, t));
16065
+ return this.#n("GetOptionalContentConfig").then((e) => new Af(e, t));
16086
16066
  }
16087
16067
  getPermissions() {
16088
16068
  return this.messageHandler.sendWithPromise("GetPermissions", null);
@@ -16093,7 +16073,7 @@ class rg {
16093
16073
  return e;
16094
16074
  const s = this.messageHandler.sendWithPromise(t, null).then((i) => ({
16095
16075
  info: i[0],
16096
- metadata: i[1] ? new Af(i[1]) : null,
16076
+ metadata: i[1] ? new Sf(i[1]) : null,
16097
16077
  contentDispositionFilename: this._fullReader?.filename ?? null,
16098
16078
  contentLength: this._fullReader?.contentLength ?? null
16099
16079
  }));
@@ -16112,7 +16092,7 @@ class rg {
16112
16092
  }
16113
16093
  }
16114
16094
  cachedPageNumber(t) {
16115
- if (!Ia(t))
16095
+ if (!Fa(t))
16116
16096
  return null;
16117
16097
  const e = t.gen === 0 ? `${t.num}R` : `${t.num}R${t.gen}`;
16118
16098
  return this.#i.get(e) ?? null;
@@ -16167,7 +16147,7 @@ class Tl {
16167
16147
  }
16168
16148
  }
16169
16149
  }
16170
- class og {
16150
+ class ng {
16171
16151
  #t = null;
16172
16152
  constructor(t) {
16173
16153
  this.#t = t, this.onContinue = null;
@@ -16207,7 +16187,7 @@ class Cs {
16207
16187
  pdfBug: u = !1,
16208
16188
  pageColors: d = null
16209
16189
  }) {
16210
- this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new og(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 = e.canvasContext.canvas;
16190
+ this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new ng(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 = e.canvasContext.canvas;
16211
16191
  }
16212
16192
  get completed() {
16213
16193
  return this.capability.promise.catch(function() {
@@ -16262,14 +16242,14 @@ class Cs {
16262
16242
  this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), Cs.#e.delete(this._canvas), this.callback())));
16263
16243
  }
16264
16244
  }
16265
- const ag = "4.10.38", hg = "f9bea397f";
16266
- function Na(a) {
16245
+ const rg = "4.10.38", og = "f9bea397f";
16246
+ function Ia(a) {
16267
16247
  return Math.floor(Math.max(0, Math.min(1, a)) * 255).toString(16).padStart(2, "0");
16268
16248
  }
16269
16249
  function Ys(a) {
16270
16250
  return Math.max(0, Math.min(255, 255 * a));
16271
16251
  }
16272
- class ja {
16252
+ class Na {
16273
16253
  static CMYK_G([t, e, s, i]) {
16274
16254
  return ["G", 1 - Math.min(1, 0.3 * t + 0.59 * s + 0.11 * e + i)];
16275
16255
  }
@@ -16283,7 +16263,7 @@ class ja {
16283
16263
  return t = Ys(t), [t, t, t];
16284
16264
  }
16285
16265
  static G_HTML([t]) {
16286
- const e = Na(t);
16266
+ const e = Ia(t);
16287
16267
  return `#${e}${e}${e}`;
16288
16268
  }
16289
16269
  static RGB_G([t, e, s]) {
@@ -16293,7 +16273,7 @@ class ja {
16293
16273
  return t.map(Ys);
16294
16274
  }
16295
16275
  static RGB_HTML(t) {
16296
- return `#${t.map(Na).join("")}`;
16276
+ return `#${t.map(Ia).join("")}`;
16297
16277
  }
16298
16278
  static T_HTML() {
16299
16279
  return "#00000000";
@@ -16316,7 +16296,7 @@ class ja {
16316
16296
  return ["CMYK", i, n, r, o];
16317
16297
  }
16318
16298
  }
16319
- class lg {
16299
+ class ag {
16320
16300
  create(t, e, s = !1) {
16321
16301
  if (t <= 0 || e <= 0)
16322
16302
  throw new Error("Invalid SVG dimensions");
@@ -16332,7 +16312,7 @@ class lg {
16332
16312
  tt("Abstract method `_createSVG` called.");
16333
16313
  }
16334
16314
  }
16335
- class wo extends lg {
16315
+ class wo extends ag {
16336
16316
  _createSVG(t) {
16337
16317
  return document.createElementNS(Ee, t);
16338
16318
  }
@@ -16486,30 +16466,30 @@ class El {
16486
16466
  t.div.style.transform = e, t.div.hidden = !1;
16487
16467
  }
16488
16468
  }
16489
- const yi = 1e3, cg = 9, us = /* @__PURE__ */ new WeakSet();
16469
+ const yi = 1e3, hg = 9, us = /* @__PURE__ */ new WeakSet();
16490
16470
  function Ge(a) {
16491
16471
  return {
16492
16472
  width: a[2] - a[0],
16493
16473
  height: a[3] - a[1]
16494
16474
  };
16495
16475
  }
16496
- class ug {
16476
+ class lg {
16497
16477
  static create(t) {
16498
16478
  switch (t.data.annotationType) {
16499
16479
  case yt.LINK:
16500
16480
  return new kl(t);
16501
16481
  case yt.TEXT:
16502
- return new dg(t);
16482
+ return new cg(t);
16503
16483
  case yt.WIDGET:
16504
16484
  switch (t.data.fieldType) {
16505
16485
  case "Tx":
16506
- return new fg(t);
16486
+ return new ug(t);
16507
16487
  case "Btn":
16508
- return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new pg(t) : new mg(t);
16488
+ return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new fg(t) : new gg(t);
16509
16489
  case "Ch":
16510
- return new bg(t);
16490
+ return new pg(t);
16511
16491
  case "Sig":
16512
- return new gg(t);
16492
+ return new dg(t);
16513
16493
  }
16514
16494
  return new ps(t);
16515
16495
  case yt.POPUP:
@@ -16517,31 +16497,31 @@ class ug {
16517
16497
  case yt.FREETEXT:
16518
16498
  return new Pl(t);
16519
16499
  case yt.LINE:
16520
- return new yg(t);
16500
+ return new bg(t);
16521
16501
  case yt.SQUARE:
16522
- return new _g(t);
16502
+ return new vg(t);
16523
16503
  case yt.CIRCLE:
16524
- return new wg(t);
16504
+ return new yg(t);
16525
16505
  case yt.POLYLINE:
16526
16506
  return new Ol(t);
16527
16507
  case yt.CARET:
16528
- return new Sg(t);
16508
+ return new wg(t);
16529
16509
  case yt.INK:
16530
16510
  return new xo(t);
16531
16511
  case yt.POLYGON:
16532
- return new xg(t);
16512
+ return new _g(t);
16533
16513
  case yt.HIGHLIGHT:
16534
16514
  return new Dl(t);
16535
16515
  case yt.UNDERLINE:
16536
- return new Cg(t);
16516
+ return new xg(t);
16537
16517
  case yt.SQUIGGLY:
16538
- return new Ag(t);
16518
+ return new Sg(t);
16539
16519
  case yt.STRIKEOUT:
16540
- return new Tg(t);
16520
+ return new Cg(t);
16541
16521
  case yt.STAMP:
16542
- return new Rl(t);
16522
+ return new Ll(t);
16543
16523
  case yt.FILEATTACHMENT:
16544
- return new Eg(t);
16524
+ return new Ag(t);
16545
16525
  default:
16546
16526
  return new ft(t);
16547
16527
  }
@@ -16692,8 +16672,8 @@ class ft {
16692
16672
  get _commonActions() {
16693
16673
  const t = (e, s, i) => {
16694
16674
  const n = i.detail[e], r = n[0], o = n.slice(1);
16695
- i.target.style[s] = ja[`${r}_HTML`](o), this.annotationStorage.setValue(this.data.id, {
16696
- [s]: ja[`${r}_rgb`](o)
16675
+ i.target.style[s] = Na[`${r}_HTML`](o), this.annotationStorage.setValue(this.data.id, {
16676
+ [s]: Na[`${r}_rgb`](o)
16697
16677
  });
16698
16678
  };
16699
16679
  return Y(this, "_commonActions", {
@@ -17046,7 +17026,7 @@ class kl extends ft {
17046
17026
  };
17047
17027
  }
17048
17028
  }
17049
- class dg extends ft {
17029
+ class cg extends ft {
17050
17030
  constructor(t) {
17051
17031
  super(t, {
17052
17032
  isRenderable: !0
@@ -17115,7 +17095,7 @@ class ps extends ft {
17115
17095
  _setTextStyle(t) {
17116
17096
  const e = ["left", "center", "right"], {
17117
17097
  fontColor: s
17118
- } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || cg, n = t.style;
17098
+ } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || hg, n = t.style;
17119
17099
  let r;
17120
17100
  const o = 2, h = (l) => Math.round(10 * l) / 10;
17121
17101
  if (this.data.multiLine) {
@@ -17131,7 +17111,7 @@ class ps extends ft {
17131
17111
  e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
17132
17112
  }
17133
17113
  }
17134
- class fg extends ps {
17114
+ class ug extends ps {
17135
17115
  constructor(t) {
17136
17116
  const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
17137
17117
  super(t, {
@@ -17331,14 +17311,14 @@ class fg extends ps {
17331
17311
  return this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
17332
17312
  }
17333
17313
  }
17334
- class gg extends ps {
17314
+ class dg extends ps {
17335
17315
  constructor(t) {
17336
17316
  super(t, {
17337
17317
  isRenderable: !!t.data.hasOwnCanvas
17338
17318
  });
17339
17319
  }
17340
17320
  }
17341
- class pg extends ps {
17321
+ class fg extends ps {
17342
17322
  constructor(t) {
17343
17323
  super(t, {
17344
17324
  isRenderable: t.renderForms
@@ -17437,7 +17417,7 @@ class Ml extends ps {
17437
17417
  return this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
17438
17418
  }
17439
17419
  }
17440
- class mg extends kl {
17420
+ class gg extends kl {
17441
17421
  constructor(t) {
17442
17422
  super(t, {
17443
17423
  ignoreBorder: t.data.hasAppearance
@@ -17452,7 +17432,7 @@ class mg extends kl {
17452
17432
  })), t;
17453
17433
  }
17454
17434
  }
17455
- class bg extends ps {
17435
+ class pg extends ps {
17456
17436
  constructor(t) {
17457
17437
  super(t, {
17458
17438
  isRenderable: t.renderForms
@@ -17603,7 +17583,7 @@ class Fr extends ft {
17603
17583
  }
17604
17584
  render() {
17605
17585
  this.container.classList.add("popupAnnotation");
17606
- const t = this.popup = new vg({
17586
+ const t = this.popup = new mg({
17607
17587
  container: this.container,
17608
17588
  color: this.data.color,
17609
17589
  titleObj: this.data.titleObj,
@@ -17621,7 +17601,7 @@ class Fr extends ft {
17621
17601
  return this.container.setAttribute("aria-controls", e.map((s) => `${co}${s}`).join(",")), this.container;
17622
17602
  }
17623
17603
  }
17624
- class vg {
17604
+ class mg {
17625
17605
  #t = this.#E.bind(this);
17626
17606
  #e = this.#T.bind(this);
17627
17607
  #s = this.#k.bind(this);
@@ -17831,7 +17811,7 @@ class Pl extends ft {
17831
17811
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
17832
17812
  }
17833
17813
  }
17834
- class yg extends ft {
17814
+ class bg extends ft {
17835
17815
  #t = null;
17836
17816
  constructor(t) {
17837
17817
  super(t, {
@@ -17854,7 +17834,7 @@ class yg extends ft {
17854
17834
  this.container.classList.add("highlightArea");
17855
17835
  }
17856
17836
  }
17857
- class _g extends ft {
17837
+ class vg extends ft {
17858
17838
  #t = null;
17859
17839
  constructor(t) {
17860
17840
  super(t, {
@@ -17877,7 +17857,7 @@ class _g extends ft {
17877
17857
  this.container.classList.add("highlightArea");
17878
17858
  }
17879
17859
  }
17880
- class wg extends ft {
17860
+ class yg extends ft {
17881
17861
  #t = null;
17882
17862
  constructor(t) {
17883
17863
  super(t, {
@@ -17940,12 +17920,12 @@ class Ol extends ft {
17940
17920
  this.container.classList.add("highlightArea");
17941
17921
  }
17942
17922
  }
17943
- class xg extends Ol {
17923
+ class _g extends Ol {
17944
17924
  constructor(t) {
17945
17925
  super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
17946
17926
  }
17947
17927
  }
17948
- class Sg extends ft {
17928
+ class wg extends ft {
17949
17929
  constructor(t) {
17950
17930
  super(t, {
17951
17931
  isRenderable: !0,
@@ -18053,7 +18033,7 @@ class Dl extends ft {
18053
18033
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
18054
18034
  }
18055
18035
  }
18056
- class Cg extends ft {
18036
+ class xg extends ft {
18057
18037
  constructor(t) {
18058
18038
  super(t, {
18059
18039
  isRenderable: !0,
@@ -18065,7 +18045,7 @@ class Cg extends ft {
18065
18045
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
18066
18046
  }
18067
18047
  }
18068
- class Ag extends ft {
18048
+ class Sg extends ft {
18069
18049
  constructor(t) {
18070
18050
  super(t, {
18071
18051
  isRenderable: !0,
@@ -18077,7 +18057,7 @@ class Ag extends ft {
18077
18057
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
18078
18058
  }
18079
18059
  }
18080
- class Tg extends ft {
18060
+ class Cg extends ft {
18081
18061
  constructor(t) {
18082
18062
  super(t, {
18083
18063
  isRenderable: !0,
@@ -18089,7 +18069,7 @@ class Tg extends ft {
18089
18069
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
18090
18070
  }
18091
18071
  }
18092
- class Rl extends ft {
18072
+ class Ll extends ft {
18093
18073
  constructor(t) {
18094
18074
  super(t, {
18095
18075
  isRenderable: !0,
@@ -18100,7 +18080,7 @@ class Rl extends ft {
18100
18080
  return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
18101
18081
  }
18102
18082
  }
18103
- class Eg extends ft {
18083
+ class Ag extends ft {
18104
18084
  #t = null;
18105
18085
  constructor(t) {
18106
18086
  super(t, {
@@ -18139,7 +18119,7 @@ class Eg extends ft {
18139
18119
  this.downloadManager?.openOrDownloadData(this.content, this.filename);
18140
18120
  }
18141
18121
  }
18142
- class kg {
18122
+ class Tg {
18143
18123
  #t = null;
18144
18124
  #e = null;
18145
18125
  #s = /* @__PURE__ */ new Map();
@@ -18203,7 +18183,7 @@ class kg {
18203
18183
  continue;
18204
18184
  }
18205
18185
  n.data = r;
18206
- const h = ug.create(n);
18186
+ const h = lg.create(n);
18207
18187
  if (!h.isRenderable)
18208
18188
  continue;
18209
18189
  if (!o && r.popupRef) {
@@ -18821,7 +18801,7 @@ class ss {
18821
18801
  t.push(`L${(r[0] - e) / i} ${(r[1] - s) / n} L${h} ${l} L${c} ${u} L${(o[0] - e) / i} ${(o[1] - s) / n}`);
18822
18802
  }
18823
18803
  newFreeDrawOutline(t, e, s, i, n, r) {
18824
- return new Ll(t, e, s, i, n, r);
18804
+ return new Rl(t, e, s, i, n, r);
18825
18805
  }
18826
18806
  getOutlines() {
18827
18807
  const t = this.#r, e = this.#e, s = this.#n, [i, n, r, o] = this.#t, h = new Float32Array((this.#f?.length ?? 0) + 2);
@@ -18862,7 +18842,7 @@ class ss {
18862
18842
  return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / o, (s[1] - r) / h, NaN, NaN, NaN, NaN, l, c, NaN, NaN, NaN, NaN, u, d, NaN, NaN, NaN, NaN, (i[0] - n) / o, (i[1] - r) / h], e), e += 24;
18863
18843
  }
18864
18844
  }
18865
- class Ll extends I {
18845
+ class Rl extends I {
18866
18846
  #t;
18867
18847
  #e = new Float32Array(4);
18868
18848
  #s;
@@ -19007,7 +18987,7 @@ class Ir {
19007
18987
  }
19008
18988
  n.push(d, f);
19009
18989
  }
19010
- return new Mg(i, this.#t, this.#e);
18990
+ return new Eg(i, this.#t, this.#e);
19011
18991
  }
19012
18992
  #n(t) {
19013
18993
  const e = this.#i;
@@ -19069,7 +19049,7 @@ class Ir {
19069
19049
  return n;
19070
19050
  }
19071
19051
  }
19072
- class Mg extends I {
19052
+ class Eg extends I {
19073
19053
  #t;
19074
19054
  #e;
19075
19055
  constructor(t, e, s) {
@@ -19107,10 +19087,10 @@ class Mg extends I {
19107
19087
  }
19108
19088
  class Nr extends ss {
19109
19089
  newFreeDrawOutline(t, e, s, i, n, r) {
19110
- return new Pg(t, e, s, i, n, r);
19090
+ return new kg(t, e, s, i, n, r);
19111
19091
  }
19112
19092
  }
19113
- class Pg extends Ll {
19093
+ class kg extends Rl {
19114
19094
  newOutliner(t, e, s, i, n, r = 0) {
19115
19095
  return new Nr(t, e, s, i, n, r);
19116
19096
  }
@@ -19665,7 +19645,7 @@ class ct extends z {
19665
19645
  #O() {
19666
19646
  return this.#u ? this.rotation : 0;
19667
19647
  }
19668
- #L() {
19648
+ #R() {
19669
19649
  if (this.#u)
19670
19650
  return null;
19671
19651
  const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#s, r = new Float32Array(n.length * 8);
@@ -19873,16 +19853,16 @@ class ct extends z {
19873
19853
  color: s,
19874
19854
  opacity: this.#o,
19875
19855
  thickness: this.#p,
19876
- quadPoints: this.#L(),
19856
+ quadPoints: this.#R(),
19877
19857
  outlines: this.#I(e),
19878
19858
  pageIndex: this.pageIndex,
19879
19859
  rect: e,
19880
19860
  rotation: this.#O(),
19881
19861
  structTreeParentId: this._structTreeParentId
19882
19862
  };
19883
- return this.annotationElementId && !this.#R(i) ? null : (i.id = this.annotationElementId, i);
19863
+ return this.annotationElementId && !this.#L(i) ? null : (i.id = this.annotationElementId, i);
19884
19864
  }
19885
- #R(t) {
19865
+ #L(t) {
19886
19866
  const {
19887
19867
  color: e
19888
19868
  } = this._initialData;
@@ -19897,7 +19877,7 @@ class ct extends z {
19897
19877
  return !1;
19898
19878
  }
19899
19879
  }
19900
- class Og {
19880
+ class Mg {
19901
19881
  #t = /* @__PURE__ */ Object.create(null);
19902
19882
  updateProperty(t, e) {
19903
19883
  this[t] = e, this.updateSVGProperty(t, e);
@@ -20337,7 +20317,7 @@ class H extends z {
20337
20317
  return !1;
20338
20318
  }
20339
20319
  }
20340
- class Dg {
20320
+ class Pg {
20341
20321
  #t = new Float64Array(6);
20342
20322
  #e;
20343
20323
  #s;
@@ -20781,7 +20761,7 @@ class Vn extends I {
20781
20761
  };
20782
20762
  }
20783
20763
  }
20784
- class So extends Og {
20764
+ class So extends Mg {
20785
20765
  #t;
20786
20766
  constructor(t) {
20787
20767
  super(), this.#t = t, super.updateProperties({
@@ -20826,7 +20806,7 @@ class Co extends H {
20826
20806
  return Y(this, "typesMap", /* @__PURE__ */ new Map([[$.INK_THICKNESS, "stroke-width"], [$.INK_COLOR, "stroke"], [$.INK_OPACITY, "stroke-opacity"]]));
20827
20807
  }
20828
20808
  static createDrawerInstance(t, e, s, i, n) {
20829
- return new Dg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
20809
+ return new Pg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
20830
20810
  }
20831
20811
  static deserializeDraw(t, e, s, i, n, r) {
20832
20812
  return Vn.deserialize(t, e, s, i, n, r);
@@ -21263,14 +21243,14 @@ class Ao extends z {
21263
21243
  } = this.#t, e.getContext("2d").drawImage(this.#t, 0, 0), e.toDataURL();
21264
21244
  }
21265
21245
  if (this.#c) {
21266
- const [e, s] = this.pageDimensions, i = Math.round(this.width * e * Ls.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * Ls.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
21246
+ const [e, s] = this.pageDimensions, i = Math.round(this.width * e * Rs.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * Rs.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
21267
21247
  return r.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, i, n), r.transferToImageBitmap();
21268
21248
  }
21269
21249
  return structuredClone(this.#t);
21270
21250
  }
21271
21251
  static async deserialize(t, e, s) {
21272
21252
  let i = null;
21273
- if (t instanceof Rl) {
21253
+ if (t instanceof Ll) {
21274
21254
  const {
21275
21255
  data: {
21276
21256
  rect: g,
@@ -21956,7 +21936,7 @@ V.ColorPicker;
21956
21936
  V.DOMSVGFactory;
21957
21937
  V.DrawLayer;
21958
21938
  V.FeatureTest;
21959
- var Rg = V.GlobalWorkerOptions;
21939
+ var Og = V.GlobalWorkerOptions;
21960
21940
  V.ImageKind;
21961
21941
  V.InvalidPDFException;
21962
21942
  V.MissingPDFException;
@@ -21978,7 +21958,7 @@ V.XfaLayer;
21978
21958
  V.build;
21979
21959
  V.createValidAbsoluteUrl;
21980
21960
  V.fetchData;
21981
- var Lg = V.getDocument;
21961
+ var Dg = V.getDocument;
21982
21962
  V.getFilenameFromUrl;
21983
21963
  V.getPdfFilenameFromUrl;
21984
21964
  V.getXfaPageViewport;
@@ -21989,23 +21969,76 @@ V.normalizeUnicode;
21989
21969
  V.setLayerDimensions;
21990
21970
  V.shadow;
21991
21971
  V.stopEvent;
21992
- V.version;
21993
- const Fg = { "pdfjs-dist": "4.10.38" };
21994
- function Ig(a) {
21972
+ var Lg = V.version;
21973
+ let ja = null;
21974
+ function Rg() {
21975
+ const a = document.createElement("div");
21976
+ a.style.width = "1in", document.body.append(a);
21977
+ const t = a.offsetWidth;
21978
+ return a.remove(), t;
21979
+ }
21980
+ function Fg() {
21981
+ const a = ja ?? Rg();
21982
+ return ja = a, a / 72;
21983
+ }
21984
+ function Ig(a, t = 500) {
21985
+ if (typeof a != "function") throw new TypeError("The first argument is not a function.");
21986
+ let e = null;
21987
+ return function(...s) {
21988
+ e && clearTimeout(e), e = setTimeout(() => {
21989
+ e = null, a.apply(this, s);
21990
+ }, t);
21991
+ };
21992
+ }
21993
+ function Ng(a) {
21995
21994
  return new Promise((t, e) => {
21996
21995
  const s = new FileReader();
21997
21996
  s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsDataURL(a);
21998
21997
  });
21999
21998
  }
22000
- const Ng = Fg["pdfjs-dist"].replace("^", "");
22001
- Rg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Ng}/pdf.worker.min.mjs`;
21999
+ Fl() || (Og.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Lg}/pdf.worker.min.mjs`);
22002
22000
  async function jg(a) {
22003
- const t = "data:application/pdf;base64,", e = await Ig(a);
22001
+ const t = "data:application/pdf;base64,", e = await Ng(a);
22004
22002
  if (typeof e == "string")
22005
22003
  return globalThis.atob(e.slice(t.length));
22006
22004
  }
22007
- function Bg(a, t) {
22008
- return Lg({ data: a, password: t }).promise;
22005
+ function Fl() {
22006
+ try {
22007
+ return typeof OffscreenCanvas < "u" && typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.prototype.transferControlToOffscreen == "function";
22008
+ } catch {
22009
+ return !1;
22010
+ }
22011
+ }
22012
+ async function Bg({ page: a, PDFBase64: t, scale: e, password: s }, i) {
22013
+ const n = Fg() / window.devicePixelRatio;
22014
+ if (Fl()) {
22015
+ const r = new Worker(new URL(
22016
+ /* @vite-ignore */
22017
+ "" + new URL("assets/pdfjs.worker-DawqtvLM.js", import.meta.url).href,
22018
+ import.meta.url
22019
+ ), { type: "module" });
22020
+ return r.postMessage({ data: t, password: s, id: i, page: a, units: n, scale: e }), await new Promise((h) => {
22021
+ r.addEventListener("message", ({ data: l }) => {
22022
+ if (l.status === "success") {
22023
+ if (l.bitmap) {
22024
+ const c = document.createElement("canvas"), u = c.getContext("bitmaprenderer");
22025
+ c.width = l.width, c.height = l.height, u?.transferFromImageBitmap(l.bitmap), h({ pages: l.pages, canvas: c });
22026
+ } else
22027
+ h({ pages: l.pages, canvas: null });
22028
+ r.terminate();
22029
+ }
22030
+ });
22031
+ });
22032
+ } else {
22033
+ const r = await Dg({ data: t, password: s }).promise, o = r.numPages;
22034
+ if (!i) return { canvas: null, pages: o };
22035
+ const h = await r.getPage(a), l = h.getViewport({ scale: e }), c = document.createElement("canvas"), d = {
22036
+ canvasContext: c.getContext("2d"),
22037
+ viewport: l,
22038
+ transform: [n, 0, 0, n, 0, 0]
22039
+ };
22040
+ return c.width = Math.floor(l.width * n), c.height = Math.floor(l.height * n), h.render(d).promise.then(() => ({ canvas: c, pages: o }));
22041
+ }
22009
22042
  }
22010
22043
  const Ft = /* @__PURE__ */ new Map();
22011
22044
  function Hg(a) {
@@ -22021,70 +22054,60 @@ function zg(a, t) {
22021
22054
  PDFBase64: t
22022
22055
  };
22023
22056
  }
22024
- function Gg(a, t) {
22025
- const e = a.getViewport({ scale: t }), s = document.createElement("canvas"), i = s.getContext("2d"), n = Md() / window.devicePixelRatio;
22026
- s.width = Math.floor(e.width * n), s.height = Math.floor(e.height * n);
22027
- const r = {
22028
- canvasContext: i,
22029
- viewport: e,
22030
- transform: [n, 0, 0, n, 0, 0]
22031
- }, o = a.render(r);
22032
- return { canvas: s, renderTask: o };
22033
- }
22034
- async function Vg({ src: a }, t, e) {
22057
+ async function Gg({ src: a }, t, e) {
22035
22058
  if (!a || !e) return null;
22036
- const { objects: s, options: i } = await bd(a), n = s.filter((o) => o !== null), r = Lu.groupSVGElements(n, i);
22059
+ const { objects: s, options: i } = await vd(a), n = s.filter((o) => o !== null), r = Fu.groupSVGElements(n, i);
22037
22060
  return n.forEach((o) => {
22038
22061
  o.stroke = e;
22039
22062
  }), r.hoverCursor = "pointer", r.stroke = `${e}-${t}`, r;
22040
22063
  }
22041
- function Xg(a, t) {
22064
+ function Vg(a, t) {
22042
22065
  if (!Ft.get(a)) return;
22043
- const s = 1 / 3, i = Jg(t, s);
22044
- Il(a, i, s);
22066
+ const s = 1 / 3, i = Kg(t, s);
22067
+ Nl(a, i, s);
22045
22068
  }
22046
- async function Wg(a, t) {
22047
- const e = await Od(t), s = Date.now(), n = {
22048
- PDFId: `${t.name}${s}`,
22049
- name: t.name.replace(/.png|.jpg|.jpeg/, ""),
22069
+ async function Xg(a, t) {
22070
+ const e = await Md(a), s = Date.now(), n = {
22071
+ PDFId: `${a.name}${s}`,
22072
+ name: a.name.replace(/.png|.jpg|.jpeg/, ""),
22050
22073
  updateDate: s,
22051
22074
  PDFBase64: e
22052
22075
  };
22053
- return Fl(a, { url: e }), { ...n, pages: 1 };
22076
+ return t && Il(t, { url: e }), { ...n, pages: 1 };
22054
22077
  }
22055
- async function Fl(a, { url: t, scale: e = 0.5 }) {
22078
+ async function Il(a, { url: t, scale: e = 0.5 }) {
22056
22079
  if (!Ft.get(a)) return;
22057
22080
  const i = await Tt.fromURL(t);
22058
- i.scale(e), Il(a, i, e);
22081
+ i.scale(e), Nl(a, i, e);
22059
22082
  }
22060
- function Il(a, t, e) {
22083
+ function Nl(a, t, e) {
22061
22084
  const s = Ft.get(a);
22062
22085
  s && (s.setWidth(t.width * e), s.setHeight(t.height * e), s.backgroundImage = t, s.renderAll());
22063
22086
  }
22064
- function Ug(a, t) {
22087
+ function Wg(a, t) {
22065
22088
  if (!t) return;
22066
22089
  const { oCoords: e } = a;
22067
22090
  if (!e) return;
22068
22091
  const { x: s, y: i } = e.tl.touchCorner.tl, { height: n, width: r, scaleY: o, scaleX: h } = t;
22069
22092
  t.top = i - n * o / 2, t.left = s - r * h / 2, t.setCoords();
22070
22093
  }
22071
- function Yg(a, t, e) {
22072
- !e || !a || (e.scale(1 / t), Ug(a, e));
22094
+ function Ug(a, t, e) {
22095
+ !e || !a || (e.scale(1 / t), Wg(a, e));
22073
22096
  }
22074
- function $g(a, t) {
22097
+ function Yg(a, t) {
22075
22098
  if (!a) return;
22076
22099
  const e = a._cornerSize || 6;
22077
22100
  a.borderScaleFactor = 1 / t, a.cornerSize = e * (1 / t), a.touchCornerSize = e * 4 * (1 / t), a.setCoords();
22078
22101
  }
22079
- function qg(a) {
22102
+ function $g(a) {
22080
22103
  const t = Ft.get(a);
22081
22104
  t && (t.discardActiveObject(), t.renderAll());
22082
22105
  }
22083
- function Kg(a) {
22106
+ function qg(a) {
22084
22107
  const t = Ft.get(a);
22085
22108
  t && (t.clear(), Ft.delete(a));
22086
22109
  }
22087
- function Jg(a, t) {
22110
+ function Kg(a, t) {
22088
22111
  return new Tt(a, { scaleX: t, scaleY: t });
22089
22112
  }
22090
22113
  function jr(a, t) {
@@ -22092,29 +22115,27 @@ function jr(a, t) {
22092
22115
  const { left: e, top: s, scaleX: i, scaleY: n, width: r, height: o } = a, h = t.x * r * i, l = t.y * o * n;
22093
22116
  a.set({ left: e - h, top: s - l });
22094
22117
  }
22095
- function Zg(a, t, e) {
22118
+ function Jg(a, t, e) {
22096
22119
  const s = a.type;
22097
22120
  return {
22098
- "application/pdf": Qg,
22121
+ "application/pdf": Zg,
22099
22122
  "image/png": Ba,
22100
22123
  "image/jpeg": Ba
22101
22124
  }[s]?.(a, t, e) ?? Promise.reject(new Error(`Unsupported ${s} file type.`));
22102
22125
  }
22103
- async function Qg(a, t, e) {
22126
+ async function Zg(a, t, e) {
22104
22127
  const s = await jg(a);
22105
22128
  if (!s) return;
22106
- const i = zg(a, s), n = await Nl({ page: 1, PDFBase64: s, scale: 0.8, password: t }, e);
22129
+ const i = zg(a, s), n = await jl({ page: 1, PDFBase64: s, scale: 0.8, password: t }, e);
22107
22130
  return { ...i, pages: n };
22108
22131
  }
22109
- async function Nl({ page: a, PDFBase64: t, scale: e, password: s }, i) {
22110
- const n = await Bg(t, s), r = await n.getPage(a), { renderTask: o, canvas: h } = Gg(r, e);
22111
- return o.promise.then(() => (i && Xg(i, h), n.numPages));
22132
+ function jl(a, t) {
22133
+ return Bg(a, t).then(({ canvas: e, pages: s }) => (e && t && Vg(t, e), s));
22112
22134
  }
22113
22135
  async function Ba(a, t, e) {
22114
- if (e)
22115
- return await Wg(e, a);
22136
+ return await Xg(a, e);
22116
22137
  }
22117
- function tp(a, t) {
22138
+ function Qg(a, t) {
22118
22139
  const e = Ft.get(a);
22119
22140
  if (!e) return;
22120
22141
  const s = e.getActiveObject();
@@ -22122,17 +22143,17 @@ function tp(a, t) {
22122
22143
  i.set(t);
22123
22144
  }) : s.set(t), e.renderAll());
22124
22145
  }
22125
- async function ep(a, t) {
22146
+ async function tp(a, t) {
22126
22147
  const e = Ft.get(a);
22127
22148
  if (!e) return;
22128
22149
  const s = e?.getActiveObject();
22129
22150
  if (!s) return;
22130
- const i = await s.clone(Zl);
22151
+ const i = await s.clone(Ql);
22131
22152
  i instanceof qt ? i.forEachObject((n) => {
22132
22153
  e.add(n), t(e, n);
22133
22154
  }) : (e.add(i), t(e, i)), jr(i, { x: -0.1, y: -0.1 }), e.setActiveObject(i);
22134
22155
  }
22135
- function sp(a) {
22156
+ function ep(a) {
22136
22157
  const t = Ft.get(a);
22137
22158
  if (!t) return;
22138
22159
  const e = t.getActiveObject();
@@ -22140,7 +22161,7 @@ function sp(a) {
22140
22161
  t.remove(s);
22141
22162
  }), t.discardActiveObject()) : t.remove(e));
22142
22163
  }
22143
- function ip(a) {
22164
+ function sp(a) {
22144
22165
  const {
22145
22166
  id: t = "",
22146
22167
  selectionOptions: e,
@@ -22150,7 +22171,7 @@ function ip(a) {
22150
22171
  selectionCreated: r,
22151
22172
  selectionCleared: o
22152
22173
  } = a || {};
22153
- let h = null, l = null, c = 1, u = { ...Jl };
22174
+ let h = null, l = null, c = 1, u = { ...Zl };
22154
22175
  function d() {
22155
22176
  if (!t || Ft.has(t)) return;
22156
22177
  const k = Hg(t);
@@ -22163,28 +22184,28 @@ function ip(a) {
22163
22184
  }), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
22164
22185
  }
22165
22186
  function f(k, P) {
22166
- return Zg(k, P, t);
22187
+ return Jg(k, P, t);
22167
22188
  }
22168
22189
  function g(k) {
22169
- return Nl(k, t);
22190
+ return jl(k, t);
22170
22191
  }
22171
22192
  function p({ url: k, scale: P = 0.5 }) {
22172
- return Fl(t, { url: k, scale: P });
22193
+ return Il(t, { url: k, scale: P });
22173
22194
  }
22174
22195
  async function b(k, P, j) {
22175
22196
  const M = Ft.get(t);
22176
22197
  if (!M) return;
22177
- const R = await Tt.fromURL(k, {}, { ...$l, ...P });
22178
- jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
22198
+ const L = await Tt.fromURL(k, {}, { ...ql, ...P });
22199
+ jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22179
22200
  }
22180
22201
  function m(k, P, j) {
22181
22202
  const M = Ft.get(t);
22182
22203
  if (!M) return;
22183
- const R = new Ct(k, {
22184
- ...ql,
22204
+ const L = new Ct(k, {
22205
+ ...Kl,
22185
22206
  ...P
22186
22207
  });
22187
- jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
22208
+ jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22188
22209
  }
22189
22210
  function v(k, P) {
22190
22211
  P.on("selected", (j) => y({ canvas: k, target: j.target })), P.on("modified", (j) => y({ canvas: k, target: j.target })), P.on("scaling", () => T(k)), P.on("moving", () => T(k)), P.on("rotating", () => T(k)), P._cornerSize = P._cornerSize ?? P.cornerSize;
@@ -22196,7 +22217,7 @@ function ip(a) {
22196
22217
  uuid: M = Date.now()
22197
22218
  }) {
22198
22219
  if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
22199
- const G = await Vg(u, M, j);
22220
+ const G = await Gg(u, M, j);
22200
22221
  T(k), h = G, l = P, _(k, P, M), S(c, !0), G && k.add(G);
22201
22222
  }
22202
22223
  function _(k, P, j) {
@@ -22215,7 +22236,7 @@ function ip(a) {
22215
22236
  }
22216
22237
  function S(k, P = !1) {
22217
22238
  const j = Ft.get(t);
22218
- c = k, j && ($g(l, k), Yg(l, k, h), !P && j.renderAll());
22239
+ c = k, j && (Yg(l, k), Ug(l, k, h), !P && j.renderAll());
22219
22240
  }
22220
22241
  function A(k) {
22221
22242
  if (!k) return;
@@ -22227,19 +22248,19 @@ function ip(a) {
22227
22248
  l = null, h && (k.remove(h), h = null);
22228
22249
  }
22229
22250
  function E() {
22230
- qg(t);
22251
+ $g(t);
22231
22252
  }
22232
22253
  function O() {
22233
- Kg(t);
22254
+ qg(t);
22234
22255
  }
22235
22256
  function N(k) {
22236
- tp(t, k);
22257
+ Qg(t, k);
22237
22258
  }
22238
22259
  function D() {
22239
- return ep(t, v);
22260
+ return tp(t, v);
22240
22261
  }
22241
- function L() {
22242
- sp(t);
22262
+ function R() {
22263
+ ep(t);
22243
22264
  }
22244
22265
  return {
22245
22266
  createCanvas: d,
@@ -22254,21 +22275,21 @@ function ip(a) {
22254
22275
  setCloseSvgOptions: A,
22255
22276
  setActiveFabric: N,
22256
22277
  copyActiveFabric: D,
22257
- deleteActiveFabric: L
22278
+ deleteActiveFabric: R
22258
22279
  };
22259
22280
  }
22260
- function np(a) {
22281
+ function ip(a) {
22261
22282
  let t = 0;
22262
- const e = Pd(() => {
22283
+ const e = Ig(() => {
22263
22284
  t !== window.innerWidth && (t = window.innerWidth, a());
22264
22285
  });
22265
- jl(() => {
22286
+ Bl(() => {
22266
22287
  window.addEventListener("resize", e);
22267
22288
  }), Ha(() => {
22268
22289
  window.removeEventListener("resize", e);
22269
22290
  });
22270
22291
  }
22271
- const ap = /* @__PURE__ */ Bl({
22292
+ const op = /* @__PURE__ */ Hl({
22272
22293
  __name: "pdf-canvas",
22273
22294
  props: {
22274
22295
  file: {},
@@ -22289,7 +22310,7 @@ const ap = /* @__PURE__ */ Bl({
22289
22310
  },
22290
22311
  emits: ["loaded", "reload", "pointerDown", "pointerMove", "pointerUp", "selectionCreated", "selectionCleared"],
22291
22312
  setup(a, { expose: t, emit: e }) {
22292
- const s = a, i = e, { onDestroy: n } = s, r = Hl(null), o = `${s.canvasId}-${s.page - 1}`, h = ko(() => s.fileZoom * s.canvasScale), l = ko(() => ({ ...Kl, ...s.selectionOptions })), {
22313
+ const s = a, i = e, { onDestroy: n } = s, r = zl(null), o = `${s.canvasId}-${s.page - 1}`, h = ko(() => s.fileZoom * s.canvasScale), l = ko(() => ({ ...Jl, ...s.selectionOptions })), {
22293
22314
  createCanvas: c,
22294
22315
  specifyPage: u,
22295
22316
  addFabric: d,
@@ -22302,7 +22323,7 @@ const ap = /* @__PURE__ */ Bl({
22302
22323
  setCloseSvgOptions: y,
22303
22324
  copyActiveFabric: _,
22304
22325
  deleteActiveFabric: S
22305
- } = ip({
22326
+ } = sp({
22306
22327
  id: o,
22307
22328
  selectionOptions: l,
22308
22329
  pointerDown: (D) => i("pointerDown", D),
@@ -22311,17 +22332,17 @@ const ap = /* @__PURE__ */ Bl({
22311
22332
  selectionCreated: (D) => i("selectionCreated", D),
22312
22333
  selectionCleared: (D) => i("selectionCleared", D)
22313
22334
  });
22314
- A(), np(N);
22335
+ A(), ip(N);
22315
22336
  async function A() {
22316
- const { file: D, page: L, fileScale: k } = s;
22337
+ const { file: D, page: R, fileScale: k } = s;
22317
22338
  globalThis.requestAnimationFrame(async () => {
22318
- if (await zl(), c(), D.PDFBase64.startsWith("data:image") || D.canvas) {
22319
- const { canvas: P } = D, j = P ? 7 : 3, M = P?.length ? P[L - 1] : D.PDFBase64;
22339
+ if (await Gl(), c(), D.PDFBase64.startsWith("data:image") || D.canvas) {
22340
+ const { canvas: P } = D, j = P ? 7 : 3, M = P?.length ? P[R - 1] : D.PDFBase64;
22320
22341
  g({ url: M, scale: k / j }), i("loaded");
22321
22342
  return;
22322
22343
  }
22323
22344
  await u({
22324
- page: L,
22345
+ page: R,
22325
22346
  PDFBase64: D.PDFBase64,
22326
22347
  scale: k,
22327
22348
  password: s.password
@@ -22330,14 +22351,14 @@ const ap = /* @__PURE__ */ Bl({
22330
22351
  }
22331
22352
  function T(D) {
22332
22353
  if (!s.isDrop || !D.dataTransfer) return;
22333
- const { dataTransfer: L, offsetX: k, offsetY: P } = D, j = L.getData("text/plain"), M = L.getData("text/uri-list"), R = L.getData("custom/offset"), G = R ? JSON.parse(R) : null, it = { top: P, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22354
+ const { dataTransfer: R, offsetX: k, offsetY: P } = D, j = R.getData("text/plain"), M = R.getData("text/uri-list"), L = R.getData("custom/offset"), G = L ? JSON.parse(L) : null, it = { top: P, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22334
22355
  M ? E(M, it, at) : j && O(j, it, at);
22335
22356
  }
22336
- function E(D, L, k) {
22337
- d(D, { ...s.dropImageOptions, ...L }, k);
22357
+ function E(D, R, k) {
22358
+ d(D, { ...s.dropImageOptions, ...R }, k);
22338
22359
  }
22339
- function O(D, L, k) {
22340
- f(D, { ...s.dropTextOptions, ...L }, k);
22360
+ function O(D, R, k) {
22361
+ f(D, { ...s.dropTextOptions, ...R }, k);
22341
22362
  }
22342
22363
  function N() {
22343
22364
  s.manualReload || A(), i("reload");
@@ -22352,25 +22373,25 @@ const ap = /* @__PURE__ */ Bl({
22352
22373
  copyActiveFabric: _,
22353
22374
  deleteActiveFabric: S,
22354
22375
  canvasRef: r
22355
- }), (D, L) => (Vl(), Gl("div", {
22356
- style: Xl({ transform: `scale(${h.value})` }),
22357
- onDragover: L[0] || (L[0] = Un(() => {
22376
+ }), (D, R) => (Xl(), Vl("div", {
22377
+ style: Wl({ transform: `scale(${h.value})` }),
22378
+ onDragover: R[0] || (R[0] = Un(() => {
22358
22379
  }, ["prevent"])),
22359
- onDragenter: L[1] || (L[1] = Un(() => {
22380
+ onDragenter: R[1] || (R[1] = Un(() => {
22360
22381
  }, ["prevent"])),
22361
22382
  onDrop: Un(T, ["stop", "prevent"])
22362
22383
  }, [
22363
- Wl("canvas", {
22384
+ Ul("canvas", {
22364
22385
  id: o,
22365
22386
  ref_key: "canvasRef",
22366
22387
  ref: r,
22367
- class: Ul(a.canvasClass)
22388
+ class: Yl(a.canvasClass)
22368
22389
  }, null, 2)
22369
22390
  ], 36));
22370
22391
  }
22371
22392
  });
22372
22393
  export {
22373
- ap as default,
22374
- Zg as loadFile,
22375
- ip as useFabric
22394
+ op as default,
22395
+ Jg as loadFile,
22396
+ sp as useFabric
22376
22397
  };