@component-hook/pdf-canvas 1.2.2 → 1.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/pdf-canvas.es.d.ts +11 -7
- package/dist/react/pdf-canvas.es.js +737 -750
- package/dist/react/pdf-canvas.umd.js +39 -39
- package/dist/vue/pdf-canvas.es.d.ts +11 -7
- package/dist/vue/pdf-canvas.es.js +747 -760
- package/dist/vue/pdf-canvas.umd.js +37 -37
- package/package.json +1 -1
|
@@ -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
|
|
15
|
-
const
|
|
14
|
+
import { onMounted as Hl, onBeforeUnmount as Ha, defineComponent as zl, ref as Gl, computed as ko, nextTick as Vl, watch as Wn, createElementBlock as Xl, openBlock as Wl, withModifiers as Un, normalizeStyle as Ul, createElementVNode as Yl, normalizeClass as $l } from "vue";
|
|
15
|
+
const ql = "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", Kl = {
|
|
16
16
|
top: 100,
|
|
17
17
|
left: 50,
|
|
18
18
|
scaleX: 0.5,
|
|
@@ -21,7 +21,7 @@ const $l = "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
|
-
},
|
|
24
|
+
}, Jl = {
|
|
25
25
|
top: 100,
|
|
26
26
|
left: 50,
|
|
27
27
|
fontFamily: "helvetica",
|
|
@@ -31,16 +31,16 @@ const $l = "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
|
-
},
|
|
34
|
+
}, Zl = {
|
|
35
35
|
borderColor: "black",
|
|
36
36
|
cornerStrokeColor: "black",
|
|
37
37
|
cornerSize: 8,
|
|
38
38
|
selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
|
|
39
|
-
},
|
|
39
|
+
}, Ql = {
|
|
40
40
|
stroke: "#000",
|
|
41
41
|
hoverStroke: "#B7EC5D",
|
|
42
|
-
src:
|
|
43
|
-
},
|
|
42
|
+
src: ql
|
|
43
|
+
}, tc = [
|
|
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
|
-
}(),
|
|
135
|
+
}(), Le = 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
|
|
149
|
+
class ec {
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class sc extends ec {
|
|
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(),
|
|
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)));
|
|
160
160
|
}
|
|
161
161
|
isSupported(t) {
|
|
162
162
|
return !!this.maxTextureSize && this.maxTextureSize >= t;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
const
|
|
165
|
+
const ic = {};
|
|
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
|
|
168
|
-
}, copyPasteData:
|
|
167
|
+
const xe = () => Oo || (Oo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new sc(), dispose() {
|
|
168
|
+
}, copyPasteData: ic }), 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",
|
|
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", nc = "modifyPoly", rc = "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
|
|
237
|
+
class oc {
|
|
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
|
|
538
|
+
class Ua extends oc {
|
|
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
|
|
567
|
-
const Xe = () =>
|
|
566
|
+
let ac = 0;
|
|
567
|
+
const Xe = () => ac++, 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",
|
|
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;
|
|
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
|
|
671
|
+
function Lo(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
|
|
716
|
+
const hc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Bt] }, lc = ["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 && (
|
|
750
|
+
t.canvas && t.canvas !== this && (Le("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" || !
|
|
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>
|
|
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,
|
|
1022
|
+
const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = st(i, lc), { 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",
|
|
1067
|
-
const
|
|
1066
|
+
x(pi, "ownDefaults", hc);
|
|
1067
|
+
const cc = ["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) =>
|
|
1073
|
+
}, rn = (a) => cc.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 lc = ["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
|
-
},
|
|
1083
|
-
const e = as(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = st(e,
|
|
1082
|
+
}, uc = ["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, uc), 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 lc = ["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
|
|
1101
|
+
return Rs(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
|
-
},
|
|
1106
|
+
}, dc = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, mt = (a) => typeof a == "string" ? dc[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
|
|
1127
|
+
const fc = (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
|
|
1268
|
+
const Rt = 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],
|
|
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], gc = [...dh, ...fh, Nt, "strokeWidth", vt, "deltaY", "textBackgroundColor", hs], pc = { _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",
|
|
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", mc = 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+(.*)"), bc = { 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", vc = Tn(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), yc = 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)), _c = 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(_c, 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
|
|
1362
|
+
class Re {
|
|
1363
1363
|
constructor(t) {
|
|
1364
|
-
const e = typeof t == "string" ?
|
|
1365
|
-
Object.assign(this,
|
|
1364
|
+
const e = typeof t == "string" ? Re.parseShadow(t) : t;
|
|
1365
|
+
Object.assign(this, Re.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 Le {
|
|
|
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 =
|
|
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;
|
|
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(
|
|
1398
|
-
const ls = (a, t, e) => Math.max(a, Math.min(t, e)),
|
|
1399
|
-
var
|
|
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)), wc = [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"], xc = { 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 Sc = 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 xc = 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
|
|
1433
|
+
const Cc = () => !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 =
|
|
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 = Cc, 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
|
|
1468
|
-
class
|
|
1467
|
+
const Ac = ["startValue", "endValue"];
|
|
1468
|
+
class Tc extends eo {
|
|
1469
1469
|
constructor(t) {
|
|
1470
1470
|
let { startValue: e = 0, endValue: s = 100 } = t;
|
|
1471
|
-
super(w(w({}, st(t,
|
|
1471
|
+
super(w(w({}, st(t, Ac)), {}, { 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
|
|
1479
|
-
class
|
|
1478
|
+
const Ec = ["startValue", "endValue"];
|
|
1479
|
+
class kc extends eo {
|
|
1480
1480
|
constructor(t) {
|
|
1481
1481
|
let { startValue: e = [0], endValue: s = [100] } = t;
|
|
1482
|
-
super(w(w({}, st(t,
|
|
1482
|
+
super(w(w({}, st(t, Ec)), {}, { 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
|
|
1490
|
-
class
|
|
1489
|
+
const Mc = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], Pc = (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 Oc extends eo {
|
|
1491
1491
|
constructor(t) {
|
|
1492
|
-
let { startValue: e, endValue: s, easing: i =
|
|
1492
|
+
let { startValue: e, endValue: s, easing: i = Pc, onChange: n, onComplete: r, abort: o } = t, h = st(t, Mc);
|
|
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 Pc 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
|
|
1502
|
+
const t = ((e) => Array.isArray(e.startValue) || Array.isArray(e.endValue))(a) ? new kc(a) : new Tc(a);
|
|
1503
1503
|
return t.start(), t;
|
|
1504
1504
|
}
|
|
1505
1505
|
function _h(a) {
|
|
1506
|
-
const t = new
|
|
1506
|
+
const t = new Oc(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
|
|
1584
|
+
class Dc extends Ua {
|
|
1585
1585
|
getX() {
|
|
1586
1586
|
return this.getXY().x;
|
|
1587
1587
|
}
|
|
@@ -1766,8 +1766,8 @@ class Oc extends Ua {
|
|
|
1766
1766
|
return this.translateToOriginPoint(this.getRelativeCenterPoint(), J, Wt);
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
|
-
const
|
|
1770
|
-
let Te = class Ki extends
|
|
1769
|
+
const Rc = ["type"], Lc = ["extraParam"];
|
|
1770
|
+
let Te = class Ki extends Dc {
|
|
1771
1771
|
static getDefaults() {
|
|
1772
1772
|
return Ki.ownDefaults;
|
|
1773
1773
|
}
|
|
@@ -1776,7 +1776,7 @@ let Te = class Ki extends Oc {
|
|
|
1776
1776
|
return t === "FabricObject" ? "object" : t.toLowerCase();
|
|
1777
1777
|
}
|
|
1778
1778
|
set type(t) {
|
|
1779
|
-
|
|
1779
|
+
Le("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 Oc {
|
|
|
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
|
|
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));
|
|
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 Oc {
|
|
|
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:
|
|
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: P, opacity: N, visible: D, backgroundColor: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: M, skewY: R } = 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:
|
|
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: P, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: G(M), skewY: G(R) }, 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 Oc {
|
|
|
2101
2101
|
return "#<".concat(this.constructor.type, ">");
|
|
2102
2102
|
}
|
|
2103
2103
|
static _fromObject(t) {
|
|
2104
|
-
let e = st(t,
|
|
2104
|
+
let e = st(t, Rc), 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",
|
|
2111
|
+
x(Te, "stateProperties", wc), x(Te, "cacheProperties", Ie), x(Te, "ownDefaults", xc), 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;
|
|
@@ -2127,13 +2127,13 @@ const Ko = Bs(oi, Hs(((a, t, e, s) => {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
return !1;
|
|
2129
2129
|
})));
|
|
2130
|
-
function
|
|
2130
|
+
function Fc(a, t, e, s, i) {
|
|
2131
2131
|
s = s || {};
|
|
2132
2132
|
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);
|
|
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
|
|
2136
|
+
function Ic(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" ?
|
|
2182
|
+
((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Fc.call(this, t, e, s, i, n) : Ic.call(this, t, e, s, i, n);
|
|
2183
2183
|
}
|
|
2184
2184
|
}
|
|
2185
|
-
const
|
|
2185
|
+
const Nc = (a, t, e) => e.lockRotation ? on : t.cursorStyle, jc = 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
|
|
2209
|
+
const Bc = ["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(
|
|
2213
|
+
return "".concat(Bc[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)))),
|
|
2232
|
+
const xi = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s)))), Hc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "x" })))), zc = Bs(wn, Hs(((a, t, e, s) => io(a, t, e, s, { by: "y" })))), Gc = ["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" } }, Vc = ["ns", "nesw", "ew", "nwse"], Xc = (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(
|
|
2235
|
+
return "".concat(Vc[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:
|
|
2243
|
-
const { skew: k } = tr[S],
|
|
2242
|
+
let { target: E, ex: P, ey: N, skewingSide: D } = A, L = st(A, Gc);
|
|
2243
|
+
const { skew: k } = tr[S], O = T.subtract(new C(P, 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 * O * D / Math.max(G, 1) + R, 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
|
|
2253
|
+
const Wc = (a, t, e, s) => Sh("x", a, t, e, s), Uc = (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) ?
|
|
2260
|
+
}, ws = (a, t, e) => kn(a, e) ? Xc(0, t, e) : $s(a, t, e), Jo = (a, t, e, s) => kn(a, t.target) ? Uc(a, t, e, s) : Hc(a, t, e, s), Zo = (a, t, e, s) => kn(a, t.target) ? Wc(a, t, e, s) : zc(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: jc, cursorStyleHandler: Nc, offsetY: -40, withConnection: !0, actionName: Vr }) }), Yc = () => ({ 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 }) }), $c = () => w(w({}, Ch()), Yc());
|
|
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
|
|
2437
|
+
const qc = 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(
|
|
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(qc) ? 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
|
|
2573
|
-
},
|
|
2572
|
+
return Kc(a);
|
|
2573
|
+
}, Kc = (a) => {
|
|
2574
2574
|
const t = [];
|
|
2575
|
-
for (let e, s = 0; s < a.length; s++) (e =
|
|
2575
|
+
for (let e, s = 0; s < a.length; s++) (e = Jc(a, s)) !== !1 && t.push(e);
|
|
2576
2576
|
return t;
|
|
2577
|
-
},
|
|
2577
|
+
}, Jc = (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
|
|
2592
|
+
var Zc = 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
|
|
2633
|
+
function Qc(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 Zc(a, t) {
|
|
|
2639
2639
|
return n.length === 0;
|
|
2640
2640
|
})(a, t)), s && e && t.length === 0;
|
|
2641
2641
|
}
|
|
2642
|
-
const
|
|
2642
|
+
const tu = (a) => {
|
|
2643
2643
|
var t;
|
|
2644
|
-
return (t =
|
|
2645
|
-
},
|
|
2644
|
+
return (t = bc[a]) !== null && t !== void 0 ? t : a;
|
|
2645
|
+
}, eu = new RegExp("(".concat(he, ")"), "gi"), su = (a) => an(a.replace(eu, " $1 ").replace(/,/gi, " "));
|
|
2646
2646
|
var ea, sa, ia, na, ra, oa, aa;
|
|
2647
|
-
const
|
|
2647
|
+
const Lt = "(".concat(he, ")"), iu = String.raw(ea || (ea = Ae(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Lt), nu = String.raw(sa || (sa = Ae(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Lt), ru = String.raw(ia || (ia = Ae(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Lt, Lt, Lt), ou = String.raw(na || (na = Ae(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Lt, Lt), au = String.raw(ra || (ra = Ae(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Lt, Lt), hu = String.raw(oa || (oa = Ae(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Lt, Lt, Lt, Lt, Lt, Lt), ro = "(?:".concat(hu, "|").concat(au, "|").concat(ru, "|").concat(ou, "|").concat(iu, "|").concat(nu, ")"), lu = "(?:".concat(ro, "*)"), cu = String.raw(aa || (aa = Ae(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), lu), uu = new RegExp(cu), du = new RegExp(ro), fu = new RegExp(ro, "g");
|
|
2648
2648
|
function dn(a) {
|
|
2649
2649
|
const t = [];
|
|
2650
|
-
if (!(a =
|
|
2651
|
-
for (const e of a.matchAll(
|
|
2652
|
-
const s =
|
|
2650
|
+
if (!(a = su(a).replace(/\s*([()])\s*/gi, "$1")) || a && !uu.test(a)) return [...Bt];
|
|
2651
|
+
for (const e of a.matchAll(fu)) {
|
|
2652
|
+
const s = du.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
|
|
2679
|
+
function gu(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 fu(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 =
|
|
2689
|
+
else if (a === "charSpacing" || a === hs) n = Rt(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(
|
|
2696
|
+
n = i ? t.map(Rt) : Rt(t, s);
|
|
2697
2697
|
}
|
|
2698
2698
|
} else r = "";
|
|
2699
2699
|
return !i && isNaN(n) ? r : n;
|
|
2700
2700
|
}
|
|
2701
|
-
function
|
|
2702
|
-
const e = a.match(
|
|
2701
|
+
function pu(a, t) {
|
|
2702
|
+
const e = a.match(mc);
|
|
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 =
|
|
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);
|
|
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
|
|
2714
|
+
function mu(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 pu(a) {
|
|
|
2720
2720
|
}));
|
|
2721
2721
|
})(e, t)), t;
|
|
2722
2722
|
}
|
|
2723
|
-
const
|
|
2723
|
+
const bu = { 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 =
|
|
2727
|
+
a.parentNode && Xo.test(a.parentNode.nodeName) && (i = Ne(a.parentElement, t, e), i.fontSize && (s = n = Rt(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)
|
|
2733
|
+
for (const d in c) Qc(l, d.split(" ")) && (u = w(w({}, u), c[d]));
|
|
2734
2734
|
return u;
|
|
2735
|
-
})(a, e)),
|
|
2736
|
-
r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s =
|
|
2735
|
+
})(a, e)), mu(a));
|
|
2736
|
+
r[Jn] && a.setAttribute(Jn, r[Jn]), r[Kn] && (s = Rt(r[Kn], n), r[Kn] = "".concat(s));
|
|
2737
2737
|
const o = {};
|
|
2738
2738
|
for (const l in r) {
|
|
2739
|
-
const c =
|
|
2739
|
+
const c = tu(l), u = gu(c, r[l], i, s);
|
|
2740
2740
|
o[c] = u;
|
|
2741
2741
|
}
|
|
2742
|
-
o && o.font &&
|
|
2742
|
+
o && o.font && pu(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(
|
|
2746
|
+
return Object.entries(bu).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
|
|
2759
|
+
const vu = ["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,
|
|
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, vu);
|
|
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",
|
|
2790
|
+
const Oe = "initialization", fn = "added", oo = "removed", gn = "imperative", Rh = (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) =>
|
|
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));
|
|
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
|
|
2828
|
+
const yu = ["strategy"], _u = ["target", "strategy", "bubbles", "prevStrategy"], Lh = "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,
|
|
2844
|
+
return [sn, Ga, oi, Va, wn, Xa, en, nc, rc].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,
|
|
2863
|
+
const n = st(t, yu);
|
|
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,
|
|
2889
|
+
const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = st(t, _u), { 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:
|
|
2899
|
+
return { type: Lh, strategy: this.strategy.constructor.type };
|
|
2900
2900
|
}
|
|
2901
2901
|
toJSON() {
|
|
2902
2902
|
return this.toObject();
|
|
2903
2903
|
}
|
|
2904
2904
|
}
|
|
2905
|
-
F.setClass(li,
|
|
2906
|
-
const
|
|
2907
|
-
class
|
|
2905
|
+
F.setClass(li, Lh);
|
|
2906
|
+
const wu = ["type", "objects", "layoutManager"];
|
|
2907
|
+
class xu 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) ? (
|
|
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);
|
|
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 &&
|
|
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);
|
|
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 || (
|
|
2993
|
+
t._set("group", void 0), e || (Rs(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,
|
|
3081
|
+
let { type: s, objects: i = [], layoutManager: n } = t, r = st(t, wu);
|
|
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
|
|
3084
|
+
const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new xu() }));
|
|
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, ")"),
|
|
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, ")"), Su = "".concat(Vs).concat(Vs).concat(Vs).concat(Ar, "([01])").concat(Ar, "([01])").concat(Vs).concat(Vs), Cu = { m: "l", M: "L" }, Au = (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) => {
|
|
@@ -3106,8 +3106,8 @@ function Tr(a, t, e, s, i, n, r, o) {
|
|
|
3106
3106
|
for (let _ = 0; _ < 2; ++_) {
|
|
3107
3107
|
if (_ > 0 && (f = 6 * t - 12 * s + 6 * n, g = -3 * t + 9 * s - 9 * n + 3 * o, p = 3 * s - 3 * t), c(g) < 1e-12) {
|
|
3108
3108
|
if (c(f) < 1e-12) continue;
|
|
3109
|
-
const
|
|
3110
|
-
0 <
|
|
3109
|
+
const P = -p / f;
|
|
3110
|
+
0 < P && P < 1 && u.push(P);
|
|
3111
3111
|
continue;
|
|
3112
3112
|
}
|
|
3113
3113
|
const S = f * f - 4 * p * g;
|
|
@@ -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
|
|
3130
|
+
const Tu = (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),
|
|
3136
|
-
let
|
|
3135
|
+
const A = Math.PI, T = v * Hr, E = ue(T), P = ce(T), N = 0.5 * (-P * d - E * f), D = 0.5 * (-P * f + E * d), L = g ** 2, k = p ** 2, O = D ** 2, j = N ** 2, M = L * k - L * O - k * j;
|
|
3136
|
+
let R = Math.abs(g), G = Math.abs(p);
|
|
3137
3137
|
if (M < 0) {
|
|
3138
|
-
const ge = Math.sqrt(1 - M / (
|
|
3139
|
-
|
|
3140
|
-
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (
|
|
3141
|
-
const it = S *
|
|
3142
|
-
let et = ha(1, 0, (N - it) /
|
|
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 * O + k * j));
|
|
3141
|
+
const it = S * R * D / G, at = -S * G * N / R, xt = P * it - E * at + 0.5 * d, gt = E * it + P * 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);
|
|
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] =
|
|
3146
|
+
for (let ge = 0; ge < fe; ge++) ht[ge] = Au(et, ms, P, E, R, 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 Au = (a, t, e) => {
|
|
|
3199
3199
|
case "a":
|
|
3200
3200
|
c[6] += t, c[7] += e;
|
|
3201
3201
|
case "A":
|
|
3202
|
-
|
|
3202
|
+
Tu(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 Au = (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,
|
|
3214
|
+
}, Bh = (a) => a ** 2, Hh = (a) => 2 * a * (1 - a), zh = (a) => (1 - a) ** 2, Eu = (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
|
-
},
|
|
3217
|
+
}, ku = (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
|
-
},
|
|
3220
|
+
}, Mu = (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 Au = (a, t, e) => {
|
|
|
3227
3227
|
i += pn(s.x, s.y, r.x, r.y), s = r;
|
|
3228
3228
|
}
|
|
3229
3229
|
return i;
|
|
3230
|
-
},
|
|
3230
|
+
}, Pu = (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 Au = (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 =
|
|
3248
|
+
t = jh(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e = c, e.iterator = t, e.angleFinder = Eu(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 =
|
|
3251
|
+
t = ku(i, n, l[1], l[2], l[3], l[4]), e = c, e.iterator = t, e.angleFinder = Mu(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,25 +3269,25 @@ const Au = (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
|
|
3272
|
+
return Pu(i, t);
|
|
3273
3273
|
}
|
|
3274
|
-
},
|
|
3274
|
+
}, Ou = new RegExp("[mzlhvcsqta][^mzlhvcsqta]*", "gi"), ca = new RegExp(Su, "g"), Du = new RegExp(he, "gi"), Ru = { 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(
|
|
3276
|
+
const e = [], s = (t = a.match(Ou)) !== 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 =
|
|
3283
|
+
const r = Ru[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(
|
|
3288
|
+
} else o = i.match(Du) || [];
|
|
3289
3289
|
for (let h = 0; h < o.length; h += r) {
|
|
3290
|
-
const l = new Array(r), c =
|
|
3290
|
+
const l = new Array(r), c = Cu[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);
|
|
@@ -3314,7 +3314,7 @@ function mn(a, t) {
|
|
|
3314
3314
|
return e.setProperty(i, n);
|
|
3315
3315
|
})));
|
|
3316
3316
|
}
|
|
3317
|
-
const
|
|
3317
|
+
const Fu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a;
|
|
3318
3318
|
function Wh(a) {
|
|
3319
3319
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3320
3320
|
const e = t.onComplete || rs, s = new (di()).XMLHttpRequest(), i = t.signal, n = function() {
|
|
@@ -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
|
|
3339
|
+
var Iu = 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) => {
|
|
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:
|
|
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: Sc, enlivenObjectEnlivables: gi, enlivenObjects: Os, findScaleToCover: Ih, findScaleToFit: Fh, getBoundsOfCurve: Tr, getOrthonormalVector: to, getPathSegmentsInfo: ao, getPointOnPath: Gh, getPointer: ih, getRandomInt: Fu, getRegularPolygonPath: (a, t) => {
|
|
3344
3344
|
const e = 2 * Math.PI / a;
|
|
3345
3345
|
let s = -Ve;
|
|
3346
3346
|
a % 2 == 0 && (s += e / 2);
|
|
@@ -3367,10 +3367,10 @@ var Fu = 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:
|
|
3370
|
+
}, multiplyTransformMatrices: dt, multiplyTransformMatrixArray: Sn, parsePath: Vh, parsePreserveAspectRatioAttribute: Zr, parseUnit: Rt, 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
|
-
|
|
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:
|
|
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: Zc, 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 Fu = Object.freeze({ __proto__: null, addTransformToObject: nh, animate: so,
|
|
|
3378
3378
|
}
|
|
3379
3379
|
return i;
|
|
3380
3380
|
}))), transformPoint: At });
|
|
3381
|
-
class
|
|
3381
|
+
class Nu 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 Iu 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" }),
|
|
3396
|
+
return t.setAttribute("data-fabric", "wrapper"), mn(t, { position: "relative" }), Lo(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 })),
|
|
3400
|
+
mn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : It })), Lo(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
|
|
3437
|
+
this.elements = new Nu(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) :
|
|
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) : fc, 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
|
|
3670
|
+
class ju {
|
|
3671
3671
|
constructor(t) {
|
|
3672
3672
|
x(this, "targets", []), x(this, "__disposer", void 0);
|
|
3673
3673
|
const e = () => {
|
|
@@ -3704,7 +3704,7 @@ class Nu {
|
|
|
3704
3704
|
this.clear(), this.__disposer(), delete this.__disposer;
|
|
3705
3705
|
}
|
|
3706
3706
|
}
|
|
3707
|
-
const
|
|
3707
|
+
const Bu = ["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 ju = ["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
|
-
},
|
|
3716
|
+
}, Hu = { 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
|
|
3719
|
+
super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), x(this, "_isClick", void 0), x(this, "textEditingManager", new ju(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,
|
|
3964
|
-
const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } =
|
|
3963
|
+
let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = st(e, Bu);
|
|
3964
|
+
const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = Hu[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 },
|
|
4032
|
+
const Uh = { x1: 0, y1: 0, x2: 0, y2: 0 }, zu = 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
|
|
4041
|
-
function
|
|
4040
|
+
const Gu = /\s*;\s*/, Vu = /\s*:\s*/;
|
|
4041
|
+
function Xu(a, t) {
|
|
4042
4042
|
let e, s;
|
|
4043
4043
|
const i = a.getAttribute("style");
|
|
4044
4044
|
if (i) {
|
|
4045
|
-
const r = i.split(
|
|
4045
|
+
const r = i.split(Gu);
|
|
4046
4046
|
r[r.length - 1] === "" && r.pop();
|
|
4047
4047
|
for (let o = r.length; o--; ) {
|
|
4048
|
-
const [h, l] = r[o].split(
|
|
4048
|
+
const [h, l] = r[o].split(Vu).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
|
|
4055
|
+
function Wu(a, t) {
|
|
4056
4056
|
const e = [], s = a.getElementsByTagName("stop"), i = $h(t, 1);
|
|
4057
|
-
for (let n = s.length; n--; ) e.push(
|
|
4057
|
+
for (let n = s.length; n--; ) e.push(Xu(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
|
|
4069
|
+
function Uu(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 Wu(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" ?
|
|
4091
|
+
Object.assign(this, { type: e, gradientUnits: s, coords: w(w({}, e === "radial" ? zu : 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:
|
|
4148
|
+
return new this(w({ id: t.getAttribute("id") || void 0, type: qh(t), coords: Uu(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: Wu(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
|
|
4152
|
+
const Yu = ["type", "source", "patternTransform"];
|
|
4153
4153
|
class er {
|
|
4154
4154
|
get type() {
|
|
4155
4155
|
return "pattern";
|
|
4156
4156
|
}
|
|
4157
4157
|
set type(t) {
|
|
4158
|
-
|
|
4158
|
+
Le("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,
|
|
4187
|
+
let { type: s, source: i, patternTransform: n } = t, r = st(t, Yu);
|
|
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
|
|
4193
|
+
const $u = ["path", "left", "top"], qu = ["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,
|
|
4196
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = st(e, $u);
|
|
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,
|
|
4298
|
+
return new this(n, w(w(w({}, st(i, qu)), 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
|
|
4302
|
+
const Ku = ["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,
|
|
4341
|
+
return new this(w(w({}, st(i, Ku)), {}, { 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
|
|
4348
|
+
const Ju = ["x1", "y1", "x2", "y2"], Zu = ["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,
|
|
4395
|
+
return new this([n, r, o, h], st(i, Ju));
|
|
4396
4396
|
}
|
|
4397
4397
|
static fromObject(t) {
|
|
4398
|
-
let { x1: e, y1: s, x2: i, y2: n } = t, r = st(t,
|
|
4398
|
+
let { x1: e, y1: s, x2: i, y2: n } = t, r = st(t, Zu);
|
|
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
|
|
4460
|
+
function Qu(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
|
|
4467
|
+
const td = ["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(
|
|
4557
|
+
return new this(Qu(t.getAttribute("points")), w(w({}, st(Ne(t, this.ATTRIBUTE_NAMES, s), td)), 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",
|
|
4651
|
-
const
|
|
4650
|
+
x(tl, "_styleProperties", gc);
|
|
4651
|
+
const ed = / +/g, sd = /"/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
|
|
4660
|
+
const id = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
|
|
4661
4661
|
let ir;
|
|
4662
4662
|
class Ct extends tl {
|
|
4663
4663
|
static getDefaults() {
|
|
@@ -4931,24 +4931,24 @@ class Ct extends tl {
|
|
|
4931
4931
|
const d = this._textLines[l], f = u / this.lineHeight, g = this._getLineLeftOffset(l);
|
|
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
|
-
let E = this.getHeightOfChar(l, 0),
|
|
4935
|
-
for (let
|
|
4936
|
-
const
|
|
4937
|
-
_ = this.getValueOfPropertyAt(l,
|
|
4938
|
-
const j = this.getHeightOfChar(l,
|
|
4934
|
+
let E = this.getHeightOfChar(l, 0), P = this.getValueOfPropertyAt(l, 0, "deltaY");
|
|
4935
|
+
for (let L = 0, k = d.length; L < k; L++) {
|
|
4936
|
+
const O = 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");
|
|
4939
4939
|
if (n && _ && S) {
|
|
4940
|
-
const
|
|
4941
|
-
t.save(), t.fillStyle = v, t.translate(
|
|
4942
|
-
} else if ((_ !== m || S !== v || j !== E || A !== y || M !==
|
|
4943
|
-
const
|
|
4940
|
+
const R = this.fontSize * A / 1e3;
|
|
4941
|
+
t.save(), t.fillStyle = v, t.translate(O.renderLeft, O.renderTop), t.rotate(O.angle), t.fillRect(-O.kernedWidth / 2, h * j + M - o * R, O.kernedWidth, R), t.restore();
|
|
4942
|
+
} else if ((_ !== m || S !== v || j !== E || A !== y || M !== P) && b > 0) {
|
|
4943
|
+
const R = 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 +
|
|
4946
|
-
} else b +=
|
|
4945
|
+
this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + P - o * R, b, R)), p = O.left, b = O.width, m = _, y = A, v = S, E = j, P = M;
|
|
4946
|
+
} else b += O.kernedWidth;
|
|
4947
4947
|
}
|
|
4948
4948
|
let N = i + g + p;
|
|
4949
4949
|
this.direction === "rtl" && (N = this.width - N - b), t.fillStyle = S;
|
|
4950
4950
|
const D = this.fontSize * A / 1e3;
|
|
4951
|
-
_ && S && A && t.fillRect(N, T + h * E +
|
|
4951
|
+
_ && S && A && t.fillRect(N, T + h * E + P - o * D, b - r, D), s += u;
|
|
4952
4952
|
}
|
|
4953
4953
|
this._removeShadow(t);
|
|
4954
4954
|
}
|
|
@@ -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,
|
|
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, id), 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",
|
|
4997
|
+
x(Ct, "textLayoutProperties", gh), x(Ct, "cacheProperties", [...Ie, ...ph]), x(Ct, "ownDefaults", pc), 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(
|
|
5012
|
+
return [t.join(""), ' <text xml:space="preserve" ', 'font-family="'.concat(this.fontFamily.replace(sd, "'"), '" '), '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(
|
|
5023
|
+
const n = q.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(ed)), 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
|
|
5067
|
+
class nd {
|
|
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 id {
|
|
|
5165
5165
|
}
|
|
5166
5166
|
}
|
|
5167
5167
|
const ua = /[ \n\.,;!\?\-]/;
|
|
5168
|
-
class
|
|
5168
|
+
class rd extends Ct {
|
|
5169
5169
|
constructor() {
|
|
5170
5170
|
super(...arguments), x(this, "_currentCursorOpacity", 1);
|
|
5171
5171
|
}
|
|
@@ -5400,7 +5400,7 @@ class nd 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
|
|
5403
|
+
class od extends rd {
|
|
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 rd extends nd {
|
|
|
5557
5557
|
}
|
|
5558
5558
|
}
|
|
5559
5559
|
const da = (a) => !!a.button;
|
|
5560
|
-
class
|
|
5560
|
+
class ad extends od {
|
|
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
|
|
5565
|
+
this.on("mousedown", this._mouseDownHandler), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("mousetripleclick", this.tripleClickHandler), this.draggableTextDelegate = new nd(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
|
-
},
|
|
5623
|
-
class De extends
|
|
5622
|
+
}, hd = 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 ad {
|
|
5624
5624
|
static getDefaults() {
|
|
5625
5625
|
return w(w({}, super.getDefaults()), De.ownDefaults);
|
|
5626
5626
|
}
|
|
@@ -5774,7 +5774,7 @@ class De extends od {
|
|
|
5774
5774
|
this.exitEditingImpl(), this.draggableTextDelegate.dispose(), super.dispose();
|
|
5775
5775
|
}
|
|
5776
5776
|
}
|
|
5777
|
-
x(De, "ownDefaults",
|
|
5777
|
+
x(De, "ownDefaults", hd), 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:
|
|
5786
|
+
return { controls: $c() };
|
|
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(
|
|
5922
|
+
const { width: r, height: o } = we(Rh(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
|
|
5943
|
+
class ld 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
|
|
5965
|
+
this.groupInit(t, { left: s, top: i, layoutManager: n ?? new ld() });
|
|
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))) ? (
|
|
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);
|
|
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
|
|
6020
|
+
class cd {
|
|
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
|
|
6110
|
+
function ud() {
|
|
6111
6111
|
const { WebGLProbe: a } = xe();
|
|
6112
|
-
return a.queryWebGL(Se()), q.enableGLFiltering && a.isSupported(q.textureSize) ? new el({ tileSize: q.textureSize }) : new
|
|
6112
|
+
return a.queryWebGL(Se()), q.enableGLFiltering && a.isSupported(q.textureSize) ? new el({ tileSize: q.textureSize }) : new cd();
|
|
6113
6113
|
}
|
|
6114
6114
|
function rr() {
|
|
6115
|
-
return !nr && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (nr =
|
|
6115
|
+
return !nr && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (nr = ud()), nr;
|
|
6116
6116
|
}
|
|
6117
|
-
const
|
|
6117
|
+
const dd = ["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,
|
|
6249
|
+
let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = st(t, dd);
|
|
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) => (
|
|
6262
|
+
return this.fromURL(i["xlink:href"] || i.href, e, i).catch(((n) => (Le("log", "Unable to parse Image", n), null)));
|
|
6263
6263
|
}
|
|
6264
6264
|
}
|
|
6265
6265
|
function or(a) {
|
|
6266
|
-
if (!
|
|
6266
|
+
if (!yc.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(" +
|
|
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 };
|
|
6272
6272
|
const m = { width: 0, height: 0 };
|
|
6273
|
-
if (d) return m.width =
|
|
6273
|
+
if (d) return m.width = Rt(h), m.height = Rt(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 =
|
|
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 / _);
|
|
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(" +
|
|
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") {
|
|
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:", ""),
|
|
6287
|
+
const bn = (a) => a.tagName.replace("svg:", ""), fd = 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
|
|
6293
|
+
const gd = ["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 && (
|
|
6297
|
+
if (i && i.getAttribute(ar) && nl(a, i), i && (gd.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
|
|
6307
|
-
function
|
|
6306
|
+
const pd = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"];
|
|
6307
|
+
function md(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 pd(a) {
|
|
|
6325
6325
|
return e;
|
|
6326
6326
|
}
|
|
6327
6327
|
const ma = (a) => F.getSVGClass(bn(a).toLowerCase());
|
|
6328
|
-
class
|
|
6328
|
+
class bd {
|
|
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,
|
|
6331
|
+
const o = il(r, pd), h = {};
|
|
6332
6332
|
let l = o.length;
|
|
6333
6333
|
for (; l--; ) {
|
|
6334
6334
|
const c = o[l];
|
|
@@ -6337,7 +6337,7 @@ class md {
|
|
|
6337
6337
|
u && (h[u] = c);
|
|
6338
6338
|
}
|
|
6339
6339
|
return h;
|
|
6340
|
-
})(i), this.cssRules =
|
|
6340
|
+
})(i), this.cssRules = md(i);
|
|
6341
6341
|
}
|
|
6342
6342
|
parse() {
|
|
6343
6343
|
return Promise.all(this.elements.map(((t) => this.createObject(t))));
|
|
@@ -6380,41 +6380,41 @@ class md {
|
|
|
6380
6380
|
} else delete t.clipPath;
|
|
6381
6381
|
}
|
|
6382
6382
|
}
|
|
6383
|
-
const ba = (a) =>
|
|
6384
|
-
async function
|
|
6383
|
+
const ba = (a) => vc.test(bn(a)), Mr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
|
|
6384
|
+
async function vd(a, t) {
|
|
6385
6385
|
let { crossOrigin: e, signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6386
|
-
if (s && s.aborted) return
|
|
6386
|
+
if (s && s.aborted) return Le("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"];
|
|
6390
6390
|
for (const f of u) {
|
|
6391
6391
|
const g = f.attributes, p = {};
|
|
6392
|
-
for (const
|
|
6392
|
+
for (const P of g) P.value && (p[P.name] = P.value);
|
|
6393
6393
|
const b = (p["xlink:href"] || p.href || "").slice(1);
|
|
6394
6394
|
if (b === "") return;
|
|
6395
6395
|
const m = c.getElementById(b);
|
|
6396
6396
|
if (m === null) return;
|
|
6397
6397
|
let v = m.cloneNode(!0);
|
|
6398
6398
|
const y = v.attributes, _ = {};
|
|
6399
|
-
for (const
|
|
6399
|
+
for (const P of y) P.value && (_[P.name] = P.value);
|
|
6400
6400
|
const { x: S = 0, y: A = 0, transform: T = "" } = p, E = "".concat(T, " ").concat(_.transform || "", " translate(").concat(S, ", ").concat(A, ")");
|
|
6401
6401
|
if (or(v), /^svg$/i.test(v.nodeName)) {
|
|
6402
|
-
const
|
|
6402
|
+
const P = v.ownerDocument.createElementNS(_r, "g");
|
|
6403
6403
|
Object.entries(_).forEach(((N) => {
|
|
6404
|
-
let [D,
|
|
6405
|
-
return
|
|
6406
|
-
})),
|
|
6404
|
+
let [D, L] = N;
|
|
6405
|
+
return P.setAttributeNS(_r, D, L);
|
|
6406
|
+
})), P.append(...v.childNodes), v = P;
|
|
6407
6407
|
}
|
|
6408
|
-
for (const
|
|
6409
|
-
if (!
|
|
6410
|
-
const { name: N, value: D } =
|
|
6408
|
+
for (const P of g) {
|
|
6409
|
+
if (!P) continue;
|
|
6410
|
+
const { name: N, value: D } = P;
|
|
6411
6411
|
if (!d.includes(N)) if (N === "style") {
|
|
6412
|
-
const
|
|
6413
|
-
Sr(D,
|
|
6414
|
-
let [j, M] =
|
|
6415
|
-
|
|
6416
|
-
})), Sr(_.style || "",
|
|
6417
|
-
const k = Object.entries(
|
|
6412
|
+
const L = {};
|
|
6413
|
+
Sr(D, L), Object.entries(_).forEach(((O) => {
|
|
6414
|
+
let [j, M] = O;
|
|
6415
|
+
L[j] = M;
|
|
6416
|
+
})), Sr(_.style || "", L);
|
|
6417
|
+
const k = Object.entries(L).map(((O) => O.join(":"))).join(";");
|
|
6418
6418
|
v.setAttribute(N, k);
|
|
6419
6419
|
} else !_[N] && v.setAttribute(N, D);
|
|
6420
6420
|
}
|
|
@@ -6423,7 +6423,7 @@ async function bd(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 &&
|
|
6426
|
+
for (; d && (d = d.parentElement); ) if (d && d.nodeName && fd.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 bd(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
|
|
6435
|
+
})), { objects: await new bd(o, r, t, a, h).parse(), elements: o, options: r, allElements: n };
|
|
6436
6436
|
}
|
|
6437
|
-
function
|
|
6437
|
+
function yd(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) =>
|
|
6444
|
+
})).then(((s) => vd(s, t, e))).catch((() => Mr()));
|
|
6445
6445
|
}
|
|
6446
|
-
const
|
|
6446
|
+
const Rn = (a) => a.webgl !== void 0, ho = "precision highp float", _d = `
|
|
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
|
-
}`),
|
|
6452
|
+
}`), wd = ["type"], xd = ["type"], Sd = 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] : {},
|
|
6458
|
+
let t = st(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, wd);
|
|
6459
6459
|
Object.assign(this, this.constructor.defaults, t);
|
|
6460
6460
|
}
|
|
6461
6461
|
getFragmentSource() {
|
|
6462
|
-
return
|
|
6462
|
+
return _d;
|
|
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(
|
|
6476
|
+
i !== "highp" && (e = e.replace(Sd, 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
|
-
|
|
6513
|
+
Rn(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,
|
|
6550
|
+
return new this(st(t, xd));
|
|
6551
6551
|
}
|
|
6552
6552
|
}
|
|
6553
6553
|
x(wt, "type", "BaseFilter"), x(wt, "uniformLocations", []);
|
|
6554
|
-
const
|
|
6554
|
+
const Cd = { 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(
|
|
6596
|
+
`.concat(Cd[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
|
|
6647
|
+
const Ad = { multiply: `
|
|
6648
6648
|
precision highp float;
|
|
6649
6649
|
uniform sampler2D uTexture;
|
|
6650
6650
|
uniform sampler2D uImage;
|
|
@@ -6670,13 +6670,13 @@ const Cd = { multiply: `
|
|
|
6670
6670
|
color.a = color2.a;
|
|
6671
6671
|
gl_FragColor = color;
|
|
6672
6672
|
}
|
|
6673
|
-
` },
|
|
6673
|
+
` }, Td = ["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
|
|
6679
|
+
return Ad[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,
|
|
6731
|
+
let { type: s, image: i } = t, n = st(t, Td);
|
|
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
|
-
|
|
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);
|
|
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
|
|
6821
|
+
class Ri extends wt {
|
|
6822
6822
|
getFragmentSource() {
|
|
6823
6823
|
return `
|
|
6824
6824
|
precision highp float;
|
|
@@ -6844,7 +6844,7 @@ class Li extends wt {
|
|
|
6844
6844
|
t.uniform1f(e.uBrightness, this.brightness);
|
|
6845
6845
|
}
|
|
6846
6846
|
}
|
|
6847
|
-
x(
|
|
6847
|
+
x(Ri, "type", "Brightness"), x(Ri, "defaults", { brightness: 0 }), x(Ri, "uniformLocations", ["uBrightness"]), F.setClass(Ri);
|
|
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
|
-
|
|
6905
|
+
Rn(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
|
|
6920
|
+
class Li extends wt {
|
|
6921
6921
|
getFragmentSource() {
|
|
6922
6922
|
return `
|
|
6923
6923
|
precision highp float;
|
|
@@ -6943,8 +6943,8 @@ class Ri extends wt {
|
|
|
6943
6943
|
t.uniform1f(e.uContrast, this.contrast);
|
|
6944
6944
|
}
|
|
6945
6945
|
}
|
|
6946
|
-
x(
|
|
6947
|
-
const
|
|
6946
|
+
x(Li, "type", "Contrast"), x(Li, "defaults", { contrast: 0 }), x(Li, "uniformLocations", ["uContrast"]), F.setClass(Li);
|
|
6947
|
+
const Ed = { 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
|
|
7097
|
+
return Ed[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
|
|
7159
|
+
const kd = { 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
|
|
7211
|
+
return kd[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
|
|
7221
|
+
const Md = 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",
|
|
7237
|
+
x(hr, "type", "HueRotation"), x(hr, "defaults", Md), 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
|
-
|
|
7423
|
+
Rn(t) ? this.applyToForWebgl(t) : this.applyTo2d(t);
|
|
7424
7424
|
}
|
|
7425
7425
|
isNeutralState() {
|
|
7426
7426
|
return this.scaleX === 1 && this.scaleY === 1;
|
|
@@ -7457,21 +7457,21 @@ 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,
|
|
7460
|
+
let S, A, T, E, P, N, D, L, k, O, 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),
|
|
7463
|
-
|
|
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[
|
|
7462
|
+
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, D = 0, L = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
|
|
7463
|
+
O = Math.floor(1e3 * Math.abs(A - m.x)), b[O] || (b[O] = {});
|
|
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[O][j] || (b[O][j] = l(Math.sqrt(Math.pow(O * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[O][j], T > 0 && (E = 4 * (M * e + A), P += T, N += T * r[E], D += T * r[E + 1], L += T * r[E + 2], k += T * r[E + 3]));
|
|
7465
7465
|
}
|
|
7466
|
-
E = 4 * (S * i + _), h[E] = N /
|
|
7466
|
+
E = 4 * (S * i + _), h[E] = N / P, h[E + 1] = D / P, h[E + 2] = L / P, h[E + 3] = k / P;
|
|
7467
7467
|
}
|
|
7468
7468
|
return ++_ < i ? y(_) : o;
|
|
7469
7469
|
})(0);
|
|
7470
7470
|
}
|
|
7471
7471
|
bilinearFiltering(t, e, s, i, n) {
|
|
7472
7472
|
let r, o, h, l, c, u, d, f, g, p, b, m, v, y = 0;
|
|
7473
|
-
const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n),
|
|
7474
|
-
for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p,
|
|
7473
|
+
const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n), P = E.data;
|
|
7474
|
+
for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p, P[y++] = m;
|
|
7475
7475
|
return E;
|
|
7476
7476
|
}
|
|
7477
7477
|
hermiteFastResize(t, e, s, i, n) {
|
|
@@ -7481,11 +7481,11 @@ class Gi extends wt {
|
|
|
7481
7481
|
let b = 0, m = 0, v = 0, y = 0, _ = 0, S = 0, A = 0;
|
|
7482
7482
|
const T = (f + 0.5) * o;
|
|
7483
7483
|
for (let E = Math.floor(f * o); E < (f + 1) * o; E++) {
|
|
7484
|
-
const
|
|
7485
|
-
for (let
|
|
7486
|
-
let k = Math.abs(N - (
|
|
7487
|
-
const
|
|
7488
|
-
|
|
7484
|
+
const P = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = P * P;
|
|
7485
|
+
for (let L = Math.floor(g * r); L < (g + 1) * r; L++) {
|
|
7486
|
+
let k = Math.abs(N - (L + 0.5)) / h;
|
|
7487
|
+
const O = Math.sqrt(D + k * k);
|
|
7488
|
+
O > 1 && O < -1 || (b = 2 * O * O * O - 3 * O * O + 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));
|
|
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,22 +7563,6 @@ 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
|
-
function Md(a) {
|
|
7567
|
-
return new Promise((t, e) => {
|
|
7568
|
-
const s = globalThis.URL.createObjectURL(a), i = new Image();
|
|
7569
|
-
i.src = s, i.addEventListener("load", async () => {
|
|
7570
|
-
globalThis.URL.revokeObjectURL(s), t(await Pd(i));
|
|
7571
|
-
}), i.addEventListener("error", (n) => {
|
|
7572
|
-
globalThis.URL.revokeObjectURL(s), e(n);
|
|
7573
|
-
});
|
|
7574
|
-
});
|
|
7575
|
-
}
|
|
7576
|
-
function Pd(a) {
|
|
7577
|
-
return new Promise((t) => {
|
|
7578
|
-
const e = document.createElement("canvas"), s = e.getContext("2d"), { naturalWidth: i, naturalHeight: n } = a;
|
|
7579
|
-
e.width = i, e.height = n, s?.drawImage(a, 0, 0, i, n), t(e.toDataURL("image/jpeg", 0.8));
|
|
7580
|
-
});
|
|
7581
|
-
}
|
|
7582
7566
|
var ii = {};
|
|
7583
7567
|
ii.d = (a, t) => {
|
|
7584
7568
|
for (var e in t)
|
|
@@ -7609,7 +7593,7 @@ ii.d(V, {
|
|
|
7609
7593
|
),
|
|
7610
7594
|
AnnotationLayer: () => (
|
|
7611
7595
|
/* reexport */
|
|
7612
|
-
|
|
7596
|
+
Ag
|
|
7613
7597
|
),
|
|
7614
7598
|
AnnotationMode: () => (
|
|
7615
7599
|
/* reexport */
|
|
@@ -7673,11 +7657,11 @@ ii.d(V, {
|
|
|
7673
7657
|
),
|
|
7674
7658
|
PermissionFlag: () => (
|
|
7675
7659
|
/* reexport */
|
|
7676
|
-
|
|
7660
|
+
Dd
|
|
7677
7661
|
),
|
|
7678
7662
|
PixelsPerInch: () => (
|
|
7679
7663
|
/* reexport */
|
|
7680
|
-
|
|
7664
|
+
Ls
|
|
7681
7665
|
),
|
|
7682
7666
|
RenderingCancelledException: () => (
|
|
7683
7667
|
/* reexport */
|
|
@@ -7701,7 +7685,7 @@ ii.d(V, {
|
|
|
7701
7685
|
),
|
|
7702
7686
|
VerbosityLevel: () => (
|
|
7703
7687
|
/* reexport */
|
|
7704
|
-
|
|
7688
|
+
Ln
|
|
7705
7689
|
),
|
|
7706
7690
|
XfaLayer: () => (
|
|
7707
7691
|
/* reexport */
|
|
@@ -7709,11 +7693,11 @@ ii.d(V, {
|
|
|
7709
7693
|
),
|
|
7710
7694
|
build: () => (
|
|
7711
7695
|
/* reexport */
|
|
7712
|
-
|
|
7696
|
+
rg
|
|
7713
7697
|
),
|
|
7714
7698
|
createValidAbsoluteUrl: () => (
|
|
7715
7699
|
/* reexport */
|
|
7716
|
-
|
|
7700
|
+
Nd
|
|
7717
7701
|
),
|
|
7718
7702
|
fetchData: () => (
|
|
7719
7703
|
/* reexport */
|
|
@@ -7721,19 +7705,19 @@ ii.d(V, {
|
|
|
7721
7705
|
),
|
|
7722
7706
|
getDocument: () => (
|
|
7723
7707
|
/* reexport */
|
|
7724
|
-
|
|
7708
|
+
Kf
|
|
7725
7709
|
),
|
|
7726
7710
|
getFilenameFromUrl: () => (
|
|
7727
7711
|
/* reexport */
|
|
7728
|
-
|
|
7712
|
+
Ud
|
|
7729
7713
|
),
|
|
7730
7714
|
getPdfFilenameFromUrl: () => (
|
|
7731
7715
|
/* reexport */
|
|
7732
|
-
|
|
7716
|
+
Yd
|
|
7733
7717
|
),
|
|
7734
7718
|
getXfaPageViewport: () => (
|
|
7735
7719
|
/* reexport */
|
|
7736
|
-
|
|
7720
|
+
$d
|
|
7737
7721
|
),
|
|
7738
7722
|
isDataScheme: () => (
|
|
7739
7723
|
/* reexport */
|
|
@@ -7749,7 +7733,7 @@ ii.d(V, {
|
|
|
7749
7733
|
),
|
|
7750
7734
|
normalizeUnicode: () => (
|
|
7751
7735
|
/* reexport */
|
|
7752
|
-
|
|
7736
|
+
Vd
|
|
7753
7737
|
),
|
|
7754
7738
|
setLayerDimensions: () => (
|
|
7755
7739
|
/* reexport */
|
|
@@ -7765,10 +7749,10 @@ ii.d(V, {
|
|
|
7765
7749
|
),
|
|
7766
7750
|
version: () => (
|
|
7767
7751
|
/* reexport */
|
|
7768
|
-
|
|
7752
|
+
ng
|
|
7769
7753
|
)
|
|
7770
7754
|
});
|
|
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],
|
|
7755
|
+
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], Pd = 1e7, lr = 1.35, Yt = {
|
|
7772
7756
|
ANY: 1,
|
|
7773
7757
|
DISPLAY: 2,
|
|
7774
7758
|
PRINT: 4,
|
|
@@ -7782,7 +7766,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
7782
7766
|
ENABLE: 1,
|
|
7783
7767
|
ENABLE_FORMS: 2,
|
|
7784
7768
|
ENABLE_STORAGE: 3
|
|
7785
|
-
},
|
|
7769
|
+
}, Od = "pdfjs_internal_editor_", W = {
|
|
7786
7770
|
DISABLE: -1,
|
|
7787
7771
|
NONE: 0,
|
|
7788
7772
|
FREETEXT: 3,
|
|
@@ -7804,7 +7788,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
7804
7788
|
HIGHLIGHT_FREE: 34,
|
|
7805
7789
|
HIGHLIGHT_SHOW_ALL: 35,
|
|
7806
7790
|
DRAW_STEP: 41
|
|
7807
|
-
},
|
|
7791
|
+
}, Dd = {
|
|
7808
7792
|
PRINT: 4,
|
|
7809
7793
|
MODIFY_CONTENTS: 8,
|
|
7810
7794
|
COPY: 16,
|
|
@@ -7849,7 +7833,7 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
7849
7833
|
BEVELED: 3,
|
|
7850
7834
|
INSET: 4,
|
|
7851
7835
|
UNDERLINE: 5
|
|
7852
|
-
},
|
|
7836
|
+
}, Ln = {
|
|
7853
7837
|
ERRORS: 0,
|
|
7854
7838
|
WARNINGS: 1,
|
|
7855
7839
|
INFOS: 5
|
|
@@ -7948,18 +7932,18 @@ const kt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
7948
7932
|
NEED_PASSWORD: 1,
|
|
7949
7933
|
INCORRECT_PASSWORD: 2
|
|
7950
7934
|
};
|
|
7951
|
-
let Fn =
|
|
7952
|
-
function
|
|
7935
|
+
let Fn = Ln.WARNINGS;
|
|
7936
|
+
function Ld(a) {
|
|
7953
7937
|
Number.isInteger(a) && (Fn = a);
|
|
7954
7938
|
}
|
|
7955
|
-
function
|
|
7939
|
+
function Fd() {
|
|
7956
7940
|
return Fn;
|
|
7957
7941
|
}
|
|
7958
7942
|
function In(a) {
|
|
7959
|
-
Fn >=
|
|
7943
|
+
Fn >= Ln.INFOS && console.log(`Info: ${a}`);
|
|
7960
7944
|
}
|
|
7961
7945
|
function U(a) {
|
|
7962
|
-
Fn >=
|
|
7946
|
+
Fn >= Ln.WARNINGS && console.log(`Warning: ${a}`);
|
|
7963
7947
|
}
|
|
7964
7948
|
function tt(a) {
|
|
7965
7949
|
throw new Error(a);
|
|
@@ -7967,7 +7951,7 @@ function tt(a) {
|
|
|
7967
7951
|
function bt(a, t) {
|
|
7968
7952
|
a || tt(t);
|
|
7969
7953
|
}
|
|
7970
|
-
function
|
|
7954
|
+
function Id(a) {
|
|
7971
7955
|
switch (a?.protocol) {
|
|
7972
7956
|
case "http:":
|
|
7973
7957
|
case "https:":
|
|
@@ -7979,17 +7963,17 @@ function Nd(a) {
|
|
|
7979
7963
|
return !1;
|
|
7980
7964
|
}
|
|
7981
7965
|
}
|
|
7982
|
-
function
|
|
7966
|
+
function Nd(a, t = null, e = null) {
|
|
7983
7967
|
if (!a)
|
|
7984
7968
|
return null;
|
|
7985
7969
|
try {
|
|
7986
7970
|
if (e && typeof a == "string" && (e.addDefaultProtocol && a.startsWith("www.") && a.match(/\./g)?.length >= 2 && (a = `http://${a}`), e.tryConvertEncoding))
|
|
7987
7971
|
try {
|
|
7988
|
-
a =
|
|
7972
|
+
a = Gd(a);
|
|
7989
7973
|
} catch {
|
|
7990
7974
|
}
|
|
7991
7975
|
const s = t ? new URL(a, t) : new URL(a);
|
|
7992
|
-
if (
|
|
7976
|
+
if (Id(s))
|
|
7993
7977
|
return s;
|
|
7994
7978
|
} catch {
|
|
7995
7979
|
}
|
|
@@ -8034,7 +8018,7 @@ class vn extends $e {
|
|
|
8034
8018
|
super(t, "UnexpectedResponseException"), this.status = e;
|
|
8035
8019
|
}
|
|
8036
8020
|
}
|
|
8037
|
-
class
|
|
8021
|
+
class jd extends $e {
|
|
8038
8022
|
constructor(t) {
|
|
8039
8023
|
super(t, "FormatError");
|
|
8040
8024
|
}
|
|
@@ -8063,7 +8047,7 @@ function Nn(a) {
|
|
|
8063
8047
|
e[s] = a.charCodeAt(s) & 255;
|
|
8064
8048
|
return e;
|
|
8065
8049
|
}
|
|
8066
|
-
function
|
|
8050
|
+
function Bd(a) {
|
|
8067
8051
|
return String.fromCharCode(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, a & 255);
|
|
8068
8052
|
}
|
|
8069
8053
|
function lo(a) {
|
|
@@ -8072,11 +8056,11 @@ function lo(a) {
|
|
|
8072
8056
|
t[e] = s;
|
|
8073
8057
|
return t;
|
|
8074
8058
|
}
|
|
8075
|
-
function
|
|
8059
|
+
function Hd() {
|
|
8076
8060
|
const a = new Uint8Array(4);
|
|
8077
8061
|
return a[0] = 1, new Uint32Array(a.buffer, 0, 1)[0] === 1;
|
|
8078
8062
|
}
|
|
8079
|
-
function
|
|
8063
|
+
function zd() {
|
|
8080
8064
|
try {
|
|
8081
8065
|
return new Function(""), !0;
|
|
8082
8066
|
} catch {
|
|
@@ -8085,10 +8069,10 @@ function Gd() {
|
|
|
8085
8069
|
}
|
|
8086
8070
|
class jt {
|
|
8087
8071
|
static get isLittleEndian() {
|
|
8088
|
-
return Y(this, "isLittleEndian",
|
|
8072
|
+
return Y(this, "isLittleEndian", Hd());
|
|
8089
8073
|
}
|
|
8090
8074
|
static get isEvalSupported() {
|
|
8091
|
-
return Y(this, "isEvalSupported",
|
|
8075
|
+
return Y(this, "isEvalSupported", zd());
|
|
8092
8076
|
}
|
|
8093
8077
|
static get isOffscreenCanvasSupported() {
|
|
8094
8078
|
return Y(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
|
|
@@ -8175,21 +8159,21 @@ class B {
|
|
|
8175
8159
|
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;
|
|
8176
8160
|
}
|
|
8177
8161
|
}
|
|
8178
|
-
function
|
|
8162
|
+
function Gd(a) {
|
|
8179
8163
|
return decodeURIComponent(escape(a));
|
|
8180
8164
|
}
|
|
8181
8165
|
let dr = null, _a = null;
|
|
8182
|
-
function
|
|
8166
|
+
function Vd(a) {
|
|
8183
8167
|
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));
|
|
8184
8168
|
}
|
|
8185
|
-
function
|
|
8169
|
+
function Xd() {
|
|
8186
8170
|
if (typeof crypto.randomUUID == "function")
|
|
8187
8171
|
return crypto.randomUUID();
|
|
8188
8172
|
const a = new Uint8Array(32);
|
|
8189
8173
|
return crypto.getRandomValues(a), hl(a);
|
|
8190
8174
|
}
|
|
8191
8175
|
const co = "pdfjs_internal_id_";
|
|
8192
|
-
function
|
|
8176
|
+
function Wd(a) {
|
|
8193
8177
|
return Uint8Array.prototype.toBase64 ? a.toBase64() : btoa(hl(a));
|
|
8194
8178
|
}
|
|
8195
8179
|
typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
|
|
@@ -8198,7 +8182,7 @@ typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
|
|
|
8198
8182
|
});
|
|
8199
8183
|
});
|
|
8200
8184
|
const Ee = "http://www.w3.org/2000/svg";
|
|
8201
|
-
class
|
|
8185
|
+
class Ls {
|
|
8202
8186
|
static CSS = 96;
|
|
8203
8187
|
static PDF = 72;
|
|
8204
8188
|
static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
|
|
@@ -8326,10 +8310,10 @@ function Bn(a) {
|
|
|
8326
8310
|
function fo(a) {
|
|
8327
8311
|
return typeof a == "string" && /\.pdf$/i.test(a);
|
|
8328
8312
|
}
|
|
8329
|
-
function
|
|
8313
|
+
function Ud(a) {
|
|
8330
8314
|
return [a] = a.split(/[#?]/, 1), a.substring(a.lastIndexOf("/") + 1);
|
|
8331
8315
|
}
|
|
8332
|
-
function
|
|
8316
|
+
function Yd(a, t = "document.pdf") {
|
|
8333
8317
|
if (typeof a != "string")
|
|
8334
8318
|
return t;
|
|
8335
8319
|
if (Bn(a))
|
|
@@ -8416,7 +8400,7 @@ class ll {
|
|
|
8416
8400
|
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));
|
|
8417
8401
|
}
|
|
8418
8402
|
}
|
|
8419
|
-
function
|
|
8403
|
+
function $d(a, {
|
|
8420
8404
|
scale: t = 1,
|
|
8421
8405
|
rotation: e = 0
|
|
8422
8406
|
}) {
|
|
@@ -8438,7 +8422,7 @@ function go(a) {
|
|
|
8438
8422
|
}
|
|
8439
8423
|
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]);
|
|
8440
8424
|
}
|
|
8441
|
-
function
|
|
8425
|
+
function qd(a) {
|
|
8442
8426
|
const t = document.createElement("span");
|
|
8443
8427
|
t.style.visibility = "hidden", document.body.append(t);
|
|
8444
8428
|
for (const e of a.keys()) {
|
|
@@ -8587,7 +8571,7 @@ class ni {
|
|
|
8587
8571
|
this.#t.remove(), this.#e?.destroy(), this.#e = null;
|
|
8588
8572
|
}
|
|
8589
8573
|
}
|
|
8590
|
-
class
|
|
8574
|
+
class Kd {
|
|
8591
8575
|
#t = null;
|
|
8592
8576
|
#e = null;
|
|
8593
8577
|
#s;
|
|
@@ -8645,14 +8629,14 @@ function yn(a, t, e) {
|
|
|
8645
8629
|
for (const s of e)
|
|
8646
8630
|
t.addEventListener(s, a[s].bind(a));
|
|
8647
8631
|
}
|
|
8648
|
-
class
|
|
8632
|
+
class Jd {
|
|
8649
8633
|
#t = 0;
|
|
8650
8634
|
get id() {
|
|
8651
|
-
return `${
|
|
8635
|
+
return `${Od}${this.#t++}`;
|
|
8652
8636
|
}
|
|
8653
8637
|
}
|
|
8654
8638
|
class po {
|
|
8655
|
-
#t =
|
|
8639
|
+
#t = Xd();
|
|
8656
8640
|
#e = 0;
|
|
8657
8641
|
#s = null;
|
|
8658
8642
|
static get _isSVGFittingCanvas() {
|
|
@@ -8764,7 +8748,7 @@ class po {
|
|
|
8764
8748
|
return t.startsWith(`image_${this.#t}_`);
|
|
8765
8749
|
}
|
|
8766
8750
|
}
|
|
8767
|
-
class
|
|
8751
|
+
class Zd {
|
|
8768
8752
|
#t = [];
|
|
8769
8753
|
#e = !1;
|
|
8770
8754
|
#s;
|
|
@@ -8884,7 +8868,7 @@ class mo {
|
|
|
8884
8868
|
static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
|
|
8885
8869
|
get _colors() {
|
|
8886
8870
|
const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
|
|
8887
|
-
return
|
|
8871
|
+
return qd(t), Y(this, "_colors", t);
|
|
8888
8872
|
}
|
|
8889
8873
|
convert(t) {
|
|
8890
8874
|
const e = go(t);
|
|
@@ -8908,7 +8892,7 @@ class Ue {
|
|
|
8908
8892
|
#r = null;
|
|
8909
8893
|
#n = null;
|
|
8910
8894
|
#h = null;
|
|
8911
|
-
#a = new
|
|
8895
|
+
#a = new Zd();
|
|
8912
8896
|
#c = null;
|
|
8913
8897
|
#l = null;
|
|
8914
8898
|
#d = 0;
|
|
@@ -8926,16 +8910,16 @@ class Ue {
|
|
|
8926
8910
|
#S = null;
|
|
8927
8911
|
#A = !1;
|
|
8928
8912
|
#E = null;
|
|
8929
|
-
#M = new
|
|
8913
|
+
#M = new Jd();
|
|
8930
8914
|
#x = !1;
|
|
8931
8915
|
#k = !1;
|
|
8932
8916
|
#T = null;
|
|
8933
8917
|
#O = null;
|
|
8934
|
-
#
|
|
8918
|
+
#L = null;
|
|
8935
8919
|
#I = null;
|
|
8936
8920
|
#C = W.NONE;
|
|
8937
8921
|
#y = /* @__PURE__ */ new Set();
|
|
8938
|
-
#
|
|
8922
|
+
#R = null;
|
|
8939
8923
|
#z = null;
|
|
8940
8924
|
#G = null;
|
|
8941
8925
|
#V = {
|
|
@@ -9022,7 +9006,7 @@ class Ue {
|
|
|
9022
9006
|
}), i._on("switchannotationeditorparams", (p) => this.updateParams(p.type, p.value), {
|
|
9023
9007
|
signal: g
|
|
9024
9008
|
}), 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 = {
|
|
9025
|
-
realScale:
|
|
9009
|
+
realScale: Ls.PDF_TO_CSS_UNITS,
|
|
9026
9010
|
rotation: 0
|
|
9027
9011
|
}, this.isShiftKeyDown = !1, this._editorUndoBar = d || null, this._supportsPinchToZoom = f !== !1;
|
|
9028
9012
|
}
|
|
@@ -9060,7 +9044,7 @@ class Ue {
|
|
|
9060
9044
|
t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), this.#l = t;
|
|
9061
9045
|
}
|
|
9062
9046
|
setMainHighlightColorPicker(t) {
|
|
9063
|
-
this.#
|
|
9047
|
+
this.#L = t;
|
|
9064
9048
|
}
|
|
9065
9049
|
editAltText(t, e = !1) {
|
|
9066
9050
|
this.#r?.editAltText(this, t, e);
|
|
@@ -9124,7 +9108,7 @@ class Ue {
|
|
|
9124
9108
|
onScaleChanging({
|
|
9125
9109
|
scale: t
|
|
9126
9110
|
}) {
|
|
9127
|
-
this.commitOrRemove(), this.viewParameters.realScale = t *
|
|
9111
|
+
this.commitOrRemove(), this.viewParameters.realScale = t * Ls.PDF_TO_CSS_UNITS;
|
|
9128
9112
|
for (const e of this.#g)
|
|
9129
9113
|
e.onScaleChanging();
|
|
9130
9114
|
this.#l?.onScaleChanging();
|
|
@@ -9188,7 +9172,7 @@ class Ue {
|
|
|
9188
9172
|
if (!t || t.isCollapsed)
|
|
9189
9173
|
return;
|
|
9190
9174
|
const s = this.#B(t).closest(".textLayer"), i = this.getSelectionBoxes(s);
|
|
9191
|
-
i && (this.#E ||= new
|
|
9175
|
+
i && (this.#E ||= new Kd(this), this.#E.show(s, i, this.direction === "ltr"));
|
|
9192
9176
|
}
|
|
9193
9177
|
addToAnnotationStorage(t) {
|
|
9194
9178
|
!t.isEmpty() && this.#n && !this.#n.has(t.id) && this.#n.setValue(t.id, t);
|
|
@@ -9196,7 +9180,7 @@ class Ue {
|
|
|
9196
9180
|
#tt() {
|
|
9197
9181
|
const t = document.getSelection();
|
|
9198
9182
|
if (!t || t.isCollapsed) {
|
|
9199
|
-
this.#
|
|
9183
|
+
this.#R && (this.#E?.hide(), this.#R = null, this.#P({
|
|
9200
9184
|
hasSelectedText: !1
|
|
9201
9185
|
}));
|
|
9202
9186
|
return;
|
|
@@ -9204,16 +9188,16 @@ class Ue {
|
|
|
9204
9188
|
const {
|
|
9205
9189
|
anchorNode: e
|
|
9206
9190
|
} = t;
|
|
9207
|
-
if (e === this.#
|
|
9191
|
+
if (e === this.#R)
|
|
9208
9192
|
return;
|
|
9209
9193
|
const i = this.#B(t).closest(".textLayer");
|
|
9210
9194
|
if (!i) {
|
|
9211
|
-
this.#
|
|
9195
|
+
this.#R && (this.#E?.hide(), this.#R = null, this.#P({
|
|
9212
9196
|
hasSelectedText: !1
|
|
9213
9197
|
}));
|
|
9214
9198
|
return;
|
|
9215
9199
|
}
|
|
9216
|
-
if (this.#E?.hide(), this.#
|
|
9200
|
+
if (this.#E?.hide(), this.#R = e, this.#P({
|
|
9217
9201
|
hasSelectedText: !0
|
|
9218
9202
|
}), !(this.#C !== W.HIGHLIGHT && this.#C !== W.NONE) && (this.#C === W.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#A = this.isShiftKeyDown, !this.isShiftKeyDown)) {
|
|
9219
9203
|
const n = this.#C === W.HIGHLIGHT ? this.#Y(i) : null;
|
|
@@ -9500,7 +9484,7 @@ class Ue {
|
|
|
9500
9484
|
this.currentLayer.addNewEditor();
|
|
9501
9485
|
return;
|
|
9502
9486
|
case $.HIGHLIGHT_DEFAULT_COLOR:
|
|
9503
|
-
this.#
|
|
9487
|
+
this.#L?.updateColor(e);
|
|
9504
9488
|
break;
|
|
9505
9489
|
case $.HIGHLIGHT_SHOW_ALL:
|
|
9506
9490
|
this._eventBus.dispatch("reporttelemetry", {
|
|
@@ -10234,7 +10218,7 @@ class z {
|
|
|
10234
10218
|
return Y(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
|
|
10235
10219
|
}
|
|
10236
10220
|
static deleteAnnotationElement(t) {
|
|
10237
|
-
const e = new
|
|
10221
|
+
const e = new Qd({
|
|
10238
10222
|
id: t.parent.getNextId(),
|
|
10239
10223
|
parent: t.parent,
|
|
10240
10224
|
uiManager: t._uiManager
|
|
@@ -10548,7 +10532,7 @@ class z {
|
|
|
10548
10532
|
signal: r
|
|
10549
10533
|
});
|
|
10550
10534
|
}
|
|
10551
|
-
#
|
|
10535
|
+
#L(t, e, s, i) {
|
|
10552
10536
|
this.width = s, this.height = i, this.x = t, this.y = e;
|
|
10553
10537
|
const [n, r] = this.parentDimensions;
|
|
10554
10538
|
this.setDims(n * s, r * i), this.fixAndSetPosition(), this._onResized();
|
|
@@ -10567,8 +10551,8 @@ class z {
|
|
|
10567
10551
|
this.#l = null;
|
|
10568
10552
|
const n = this.x, r = this.y, o = this.width, h = this.height;
|
|
10569
10553
|
n === t && r === e && o === s && h === i || this.addCommands({
|
|
10570
|
-
cmd: this.#
|
|
10571
|
-
undo: this.#
|
|
10554
|
+
cmd: this.#L.bind(this, n, r, o, h),
|
|
10555
|
+
undo: this.#L.bind(this, t, e, s, i),
|
|
10572
10556
|
mustExec: !0
|
|
10573
10557
|
});
|
|
10574
10558
|
}
|
|
@@ -10576,38 +10560,38 @@ class z {
|
|
|
10576
10560
|
return Math.round(t * 1e4) / 1e4;
|
|
10577
10561
|
}
|
|
10578
10562
|
#C(t, e) {
|
|
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,
|
|
10563
|
+
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];
|
|
10580
10564
|
let p, b, m = !1, v = !1;
|
|
10581
10565
|
switch (t) {
|
|
10582
10566
|
case "topLeft":
|
|
10583
|
-
m = !0, p = (M,
|
|
10567
|
+
m = !0, p = (M, R) => [0, 0], b = (M, R) => [M, R];
|
|
10584
10568
|
break;
|
|
10585
10569
|
case "topMiddle":
|
|
10586
|
-
p = (M,
|
|
10570
|
+
p = (M, R) => [M / 2, 0], b = (M, R) => [M / 2, R];
|
|
10587
10571
|
break;
|
|
10588
10572
|
case "topRight":
|
|
10589
|
-
m = !0, p = (M,
|
|
10573
|
+
m = !0, p = (M, R) => [M, 0], b = (M, R) => [0, R];
|
|
10590
10574
|
break;
|
|
10591
10575
|
case "middleRight":
|
|
10592
|
-
v = !0, p = (M,
|
|
10576
|
+
v = !0, p = (M, R) => [M, R / 2], b = (M, R) => [0, R / 2];
|
|
10593
10577
|
break;
|
|
10594
10578
|
case "bottomRight":
|
|
10595
|
-
m = !0, p = (M,
|
|
10579
|
+
m = !0, p = (M, R) => [M, R], b = (M, R) => [0, 0];
|
|
10596
10580
|
break;
|
|
10597
10581
|
case "bottomMiddle":
|
|
10598
|
-
p = (M,
|
|
10582
|
+
p = (M, R) => [M / 2, R], b = (M, R) => [M / 2, 0];
|
|
10599
10583
|
break;
|
|
10600
10584
|
case "bottomLeft":
|
|
10601
|
-
m = !0, p = (M,
|
|
10585
|
+
m = !0, p = (M, R) => [0, R], b = (M, R) => [M, 0];
|
|
10602
10586
|
break;
|
|
10603
10587
|
case "middleLeft":
|
|
10604
|
-
v = !0, p = (M,
|
|
10588
|
+
v = !0, p = (M, R) => [0, R / 2], b = (M, R) => [M, R / 2];
|
|
10605
10589
|
break;
|
|
10606
10590
|
}
|
|
10607
10591
|
const y = p(o, h), _ = b(o, h);
|
|
10608
10592
|
let S = d(..._);
|
|
10609
10593
|
const A = z._round(n + S[0]), T = z._round(r + S[1]);
|
|
10610
|
-
let E = 1,
|
|
10594
|
+
let E = 1, P = 1, N, D;
|
|
10611
10595
|
if (e.fromKeyboard)
|
|
10612
10596
|
({
|
|
10613
10597
|
deltaX: N,
|
|
@@ -10616,18 +10600,18 @@ class z {
|
|
|
10616
10600
|
else {
|
|
10617
10601
|
const {
|
|
10618
10602
|
screenX: M,
|
|
10619
|
-
screenY:
|
|
10603
|
+
screenY: R
|
|
10620
10604
|
} = e, [G, it] = this.#c;
|
|
10621
|
-
[N, D] = this.screenToPageTranslation(M - G,
|
|
10605
|
+
[N, D] = this.screenToPageTranslation(M - G, R - it), this.#c[0] = M, this.#c[1] = R;
|
|
10622
10606
|
}
|
|
10623
10607
|
if ([N, D] = g(N / s, D / i), m) {
|
|
10624
10608
|
const M = Math.hypot(o, h);
|
|
10625
|
-
E =
|
|
10626
|
-
} else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o :
|
|
10627
|
-
const
|
|
10628
|
-
S = d(...b(
|
|
10629
|
-
const
|
|
10630
|
-
this.#o ||= [this.x, this.y, this.width, this.height], this.width =
|
|
10609
|
+
E = P = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
|
|
10610
|
+
} else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : P = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
|
|
10611
|
+
const L = z._round(o * E), k = z._round(h * P);
|
|
10612
|
+
S = d(...b(L, k));
|
|
10613
|
+
const O = A - S[0], j = T - S[1];
|
|
10614
|
+
this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x = O, this.y = j, this.setDims(s * L, i * k), this.fixAndSetPosition(), this._onResizing();
|
|
10631
10615
|
}
|
|
10632
10616
|
_onResizing() {
|
|
10633
10617
|
}
|
|
@@ -10680,7 +10664,7 @@ class z {
|
|
|
10680
10664
|
container: this.div,
|
|
10681
10665
|
isPinchingDisabled: () => !this.isSelected,
|
|
10682
10666
|
onPinchStart: this.#y.bind(this),
|
|
10683
|
-
onPinching: this.#
|
|
10667
|
+
onPinching: this.#R.bind(this),
|
|
10684
10668
|
onPinchEnd: this.#z.bind(this),
|
|
10685
10669
|
signal: this._uiManager._signal
|
|
10686
10670
|
})), this._uiManager._editorUndoBar?.hide(), this.div;
|
|
@@ -10693,7 +10677,7 @@ class z {
|
|
|
10693
10677
|
savedHeight: this.height
|
|
10694
10678
|
}, this.#s?.toggle(!1), this.parent.togglePointerEvents(!1);
|
|
10695
10679
|
}
|
|
10696
|
-
#
|
|
10680
|
+
#R(t, e, s) {
|
|
10697
10681
|
let n = 0.7 * (s / e) + 1 - 0.7;
|
|
10698
10682
|
if (n === 1)
|
|
10699
10683
|
return;
|
|
@@ -11084,7 +11068,7 @@ class z {
|
|
|
11084
11068
|
e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
|
|
11085
11069
|
}
|
|
11086
11070
|
}
|
|
11087
|
-
class
|
|
11071
|
+
class Qd extends z {
|
|
11088
11072
|
constructor(t) {
|
|
11089
11073
|
super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
|
|
11090
11074
|
}
|
|
@@ -11129,7 +11113,7 @@ class cl {
|
|
|
11129
11113
|
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");
|
|
11130
11114
|
}
|
|
11131
11115
|
}
|
|
11132
|
-
const
|
|
11116
|
+
const Rr = Object.freeze({
|
|
11133
11117
|
map: null,
|
|
11134
11118
|
hash: "",
|
|
11135
11119
|
transfer: void 0
|
|
@@ -11190,7 +11174,7 @@ class bo {
|
|
|
11190
11174
|
}
|
|
11191
11175
|
get serializable() {
|
|
11192
11176
|
if (this.#s.size === 0)
|
|
11193
|
-
return
|
|
11177
|
+
return Rr;
|
|
11194
11178
|
const t = /* @__PURE__ */ new Map(), e = new cl(), s = [], i = /* @__PURE__ */ Object.create(null);
|
|
11195
11179
|
let n = !1;
|
|
11196
11180
|
for (const [r, o] of this.#s) {
|
|
@@ -11204,7 +11188,7 @@ class bo {
|
|
|
11204
11188
|
map: t,
|
|
11205
11189
|
hash: e.hexdigest(),
|
|
11206
11190
|
transfer: s
|
|
11207
|
-
} :
|
|
11191
|
+
} : Rr;
|
|
11208
11192
|
}
|
|
11209
11193
|
get editorStats() {
|
|
11210
11194
|
let t = null;
|
|
@@ -11278,7 +11262,7 @@ class ul extends bo {
|
|
|
11278
11262
|
});
|
|
11279
11263
|
}
|
|
11280
11264
|
}
|
|
11281
|
-
class
|
|
11265
|
+
class tf {
|
|
11282
11266
|
#t = /* @__PURE__ */ new Set();
|
|
11283
11267
|
constructor({
|
|
11284
11268
|
ownerDocument: t = globalThis.document,
|
|
@@ -11386,8 +11370,8 @@ class ef {
|
|
|
11386
11370
|
return _.charCodeAt(S) << 24 | _.charCodeAt(S + 1) << 16 | _.charCodeAt(S + 2) << 8 | _.charCodeAt(S + 3) & 255;
|
|
11387
11371
|
}
|
|
11388
11372
|
function i(_, S, A, T) {
|
|
11389
|
-
const E = _.substring(0, S),
|
|
11390
|
-
return E + T +
|
|
11373
|
+
const E = _.substring(0, S), P = _.substring(S + A);
|
|
11374
|
+
return E + T + P;
|
|
11391
11375
|
}
|
|
11392
11376
|
let n, r;
|
|
11393
11377
|
const o = this._document.createElement("canvas");
|
|
@@ -11412,7 +11396,7 @@ class ef {
|
|
|
11412
11396
|
let b = s(d, g);
|
|
11413
11397
|
for (n = 0, r = u.length - 3; n < r; n += 4)
|
|
11414
11398
|
b = b - p + s(u, n) | 0;
|
|
11415
|
-
n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4,
|
|
11399
|
+
n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, Bd(b));
|
|
11416
11400
|
const m = `url(data:font/opentype;base64,${btoa(d)});`, v = `@font-face {font-family:"${u}";src:${m}}`;
|
|
11417
11401
|
this.insertRule(v);
|
|
11418
11402
|
const y = this._document.createElement("div");
|
|
@@ -11426,7 +11410,7 @@ class ef {
|
|
|
11426
11410
|
});
|
|
11427
11411
|
}
|
|
11428
11412
|
}
|
|
11429
|
-
class
|
|
11413
|
+
class ef {
|
|
11430
11414
|
constructor(t, {
|
|
11431
11415
|
disableFontFace: e = !1,
|
|
11432
11416
|
fontExtraProperties: s = !1,
|
|
@@ -11454,7 +11438,7 @@ class sf {
|
|
|
11454
11438
|
createFontFaceRule() {
|
|
11455
11439
|
if (!this.data || this.disableFontFace)
|
|
11456
11440
|
return null;
|
|
11457
|
-
const t = `url(data:${this.mimetype};base64,${
|
|
11441
|
+
const t = `url(data:${this.mimetype};base64,${Wd(this.data)});`;
|
|
11458
11442
|
let e;
|
|
11459
11443
|
if (!this.cssFontInfo)
|
|
11460
11444
|
e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
|
|
@@ -11820,7 +11804,7 @@ class dl {
|
|
|
11820
11804
|
tt("Abstract method `_createCanvas` called.");
|
|
11821
11805
|
}
|
|
11822
11806
|
}
|
|
11823
|
-
class
|
|
11807
|
+
class sf extends dl {
|
|
11824
11808
|
constructor({
|
|
11825
11809
|
ownerDocument: t = globalThis.document,
|
|
11826
11810
|
enableHWA: e = !1
|
|
@@ -11885,7 +11869,7 @@ class pl {
|
|
|
11885
11869
|
destroy(t = !1) {
|
|
11886
11870
|
}
|
|
11887
11871
|
}
|
|
11888
|
-
class
|
|
11872
|
+
class nf extends pl {
|
|
11889
11873
|
#t;
|
|
11890
11874
|
#e;
|
|
11891
11875
|
#s;
|
|
@@ -12019,14 +12003,14 @@ class rf extends pl {
|
|
|
12019
12003
|
const g = (m, v, y) => {
|
|
12020
12004
|
const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
|
|
12021
12005
|
let E = 0;
|
|
12022
|
-
for (let
|
|
12023
|
-
const N = Math.round(c +
|
|
12024
|
-
for (let
|
|
12025
|
-
_[
|
|
12006
|
+
for (let P = 0; P <= y; P++) {
|
|
12007
|
+
const N = Math.round(c + P * S), D = A + P * T;
|
|
12008
|
+
for (let L = E; L <= N; L++)
|
|
12009
|
+
_[L] = D;
|
|
12026
12010
|
E = N + 1;
|
|
12027
12011
|
}
|
|
12028
|
-
for (let
|
|
12029
|
-
_[
|
|
12012
|
+
for (let P = E; P < 256; P++)
|
|
12013
|
+
_[P] = _[E - 1];
|
|
12030
12014
|
return _.join(",");
|
|
12031
12015
|
}, p = `g_${this.#i}_hcm_${t}_filter`, b = o.filter = this.#g(p);
|
|
12032
12016
|
return this.#o(b), this.#p(g(d[0], f[0], 5), g(d[1], f[1], 5), g(d[2], f[2], 5), b), o.url = this.#u(p), o.url;
|
|
@@ -12095,19 +12079,19 @@ async function vl(a) {
|
|
|
12095
12079
|
const e = await process.getBuiltinModule("fs").promises.readFile(a);
|
|
12096
12080
|
return new Uint8Array(e);
|
|
12097
12081
|
}
|
|
12098
|
-
class
|
|
12082
|
+
class rf extends pl {
|
|
12099
12083
|
}
|
|
12100
|
-
class
|
|
12084
|
+
class of extends dl {
|
|
12101
12085
|
_createCanvas(t, e) {
|
|
12102
12086
|
return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
|
|
12103
12087
|
}
|
|
12104
12088
|
}
|
|
12105
|
-
class
|
|
12089
|
+
class af extends fl {
|
|
12106
12090
|
async _fetch(t) {
|
|
12107
12091
|
return vl(t);
|
|
12108
12092
|
}
|
|
12109
12093
|
}
|
|
12110
|
-
class
|
|
12094
|
+
class hf extends ml {
|
|
12111
12095
|
async _fetch(t) {
|
|
12112
12096
|
return vl(t);
|
|
12113
12097
|
}
|
|
@@ -12117,7 +12101,7 @@ const Et = {
|
|
|
12117
12101
|
STROKE: "Stroke",
|
|
12118
12102
|
SHADING: "Shading"
|
|
12119
12103
|
};
|
|
12120
|
-
function
|
|
12104
|
+
function Lr(a, t) {
|
|
12121
12105
|
if (!t)
|
|
12122
12106
|
return;
|
|
12123
12107
|
const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
|
|
@@ -12128,7 +12112,7 @@ class vo {
|
|
|
12128
12112
|
tt("Abstract method `getPattern` called.");
|
|
12129
12113
|
}
|
|
12130
12114
|
}
|
|
12131
|
-
class
|
|
12115
|
+
class lf extends vo {
|
|
12132
12116
|
constructor(t) {
|
|
12133
12117
|
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;
|
|
12134
12118
|
}
|
|
@@ -12143,11 +12127,11 @@ class cf extends vo {
|
|
|
12143
12127
|
let n;
|
|
12144
12128
|
if (i === Et.STROKE || i === Et.FILL) {
|
|
12145
12129
|
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;
|
|
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),
|
|
12130
|
+
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");
|
|
12147
12131
|
const u = new DOMMatrix(s);
|
|
12148
12132
|
n.setTransform(u);
|
|
12149
12133
|
} else
|
|
12150
|
-
|
|
12134
|
+
Lr(t, this._bbox), n = this._createGradient(t);
|
|
12151
12135
|
return n;
|
|
12152
12136
|
}
|
|
12153
12137
|
}
|
|
@@ -12158,25 +12142,25 @@ function fr(a, t, e, s, i, n, r, o) {
|
|
|
12158
12142
|
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;
|
|
12159
12143
|
if (g >= v)
|
|
12160
12144
|
return;
|
|
12161
|
-
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2],
|
|
12162
|
-
let
|
|
12163
|
-
for (let gt =
|
|
12145
|
+
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], P = l[o], N = l[o + 1], D = l[o + 2], L = Math.round(g), k = Math.round(v);
|
|
12146
|
+
let O, j, M, R, G, it, at, xt;
|
|
12147
|
+
for (let gt = L; gt <= k; gt++) {
|
|
12164
12148
|
if (gt < b) {
|
|
12165
12149
|
const K = gt < g ? 0 : (g - gt) / (g - b);
|
|
12166
|
-
|
|
12150
|
+
O = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, R = S - (S - E) * K;
|
|
12167
12151
|
} else {
|
|
12168
12152
|
let K;
|
|
12169
|
-
gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v),
|
|
12153
|
+
gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), O = p - (p - m) * K, j = A - (A - P) * K, M = T - (T - N) * K, R = E - (E - D) * K;
|
|
12170
12154
|
}
|
|
12171
12155
|
let et;
|
|
12172
|
-
gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y -
|
|
12173
|
-
const Pt = Math.round(Math.min(
|
|
12156
|
+
gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - P) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
|
|
12157
|
+
const Pt = Math.round(Math.min(O, G)), fe = Math.round(Math.max(O, G));
|
|
12174
12158
|
let ht = u * gt + Pt * 4;
|
|
12175
12159
|
for (let K = Pt; K <= fe; K++)
|
|
12176
|
-
et = (
|
|
12160
|
+
et = (O - K) / (O - 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;
|
|
12177
12161
|
}
|
|
12178
12162
|
}
|
|
12179
|
-
function
|
|
12163
|
+
function cf(a, t, e) {
|
|
12180
12164
|
const s = t.coords, i = t.colors;
|
|
12181
12165
|
let n, r;
|
|
12182
12166
|
switch (t.type) {
|
|
@@ -12196,7 +12180,7 @@ function uf(a, t, e) {
|
|
|
12196
12180
|
throw new Error("illegal figure");
|
|
12197
12181
|
}
|
|
12198
12182
|
}
|
|
12199
|
-
class
|
|
12183
|
+
class uf extends vo {
|
|
12200
12184
|
constructor(t) {
|
|
12201
12185
|
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;
|
|
12202
12186
|
}
|
|
@@ -12215,7 +12199,7 @@ class df extends vo {
|
|
|
12215
12199
|
A[T] = e[0], A[T + 1] = e[1], A[T + 2] = e[2], A[T + 3] = 255;
|
|
12216
12200
|
}
|
|
12217
12201
|
for (const A of this._figures)
|
|
12218
|
-
|
|
12202
|
+
cf(_, A, p);
|
|
12219
12203
|
return y.putImageData(_, 2, 2), {
|
|
12220
12204
|
canvas: v.canvas,
|
|
12221
12205
|
offsetX: o - 2 * f,
|
|
@@ -12225,7 +12209,7 @@ class df extends vo {
|
|
|
12225
12209
|
};
|
|
12226
12210
|
}
|
|
12227
12211
|
getPattern(t, e, s, i) {
|
|
12228
|
-
|
|
12212
|
+
Lr(t, this._bbox);
|
|
12229
12213
|
let n;
|
|
12230
12214
|
if (i === Et.SHADING)
|
|
12231
12215
|
n = B.singularValueDecompose2dScale(rt(t));
|
|
@@ -12237,19 +12221,19 @@ class df extends vo {
|
|
|
12237
12221
|
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");
|
|
12238
12222
|
}
|
|
12239
12223
|
}
|
|
12240
|
-
class
|
|
12224
|
+
class df extends vo {
|
|
12241
12225
|
getPattern() {
|
|
12242
12226
|
return "hotpink";
|
|
12243
12227
|
}
|
|
12244
12228
|
}
|
|
12245
|
-
function
|
|
12229
|
+
function ff(a) {
|
|
12246
12230
|
switch (a[0]) {
|
|
12247
12231
|
case "RadialAxial":
|
|
12248
|
-
return new
|
|
12232
|
+
return new lf(a);
|
|
12249
12233
|
case "Mesh":
|
|
12250
|
-
return new
|
|
12234
|
+
return new uf(a);
|
|
12251
12235
|
case "Dummy":
|
|
12252
|
-
return new
|
|
12236
|
+
return new df();
|
|
12253
12237
|
}
|
|
12254
12238
|
throw new Error(`Unknown IR type: ${a[0]}`);
|
|
12255
12239
|
}
|
|
@@ -12278,16 +12262,16 @@ class yo {
|
|
|
12278
12262
|
h = Math.abs(h), l = Math.abs(l), In("TilingType: " + n);
|
|
12279
12263
|
const c = e[0], u = e[1], d = e[2], f = e[3], g = d - c, p = f - u, b = B.singularValueDecompose2dScale(this.matrix), m = B.singularValueDecompose2dScale(this.baseTransform), v = b[0] * m[0], y = b[1] * m[1];
|
|
12280
12264
|
let _ = g, S = p, A = !1, T = !1;
|
|
12281
|
-
const E = Math.ceil(h * v),
|
|
12282
|
-
E >= N ? _ = h : A = !0,
|
|
12283
|
-
const
|
|
12284
|
-
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-
|
|
12285
|
-
const
|
|
12265
|
+
const E = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
|
|
12266
|
+
E >= N ? _ = h : A = !0, P >= D ? S = l : T = !0;
|
|
12267
|
+
const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), O = t.cachedCanvases.getCanvas("pattern", L.size, k.size), j = O.context, M = o.createCanvasGraphics(j);
|
|
12268
|
+
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) {
|
|
12269
|
+
const R = O.canvas;
|
|
12286
12270
|
A && (_ = h), T && (S = l);
|
|
12287
12271
|
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;
|
|
12288
12272
|
for (let ht = 0; ht <= Pt; ht++)
|
|
12289
12273
|
for (let K = 0; K <= fe; K++)
|
|
12290
|
-
et.drawImage(
|
|
12274
|
+
et.drawImage(R, at * ht, xt * K, at, xt, 0, 0, at, xt);
|
|
12291
12275
|
return {
|
|
12292
12276
|
canvas: gt.canvas,
|
|
12293
12277
|
scaleX: G.scale,
|
|
@@ -12297,8 +12281,8 @@ class yo {
|
|
|
12297
12281
|
};
|
|
12298
12282
|
}
|
|
12299
12283
|
return {
|
|
12300
|
-
canvas:
|
|
12301
|
-
scaleX:
|
|
12284
|
+
canvas: O.canvas,
|
|
12285
|
+
scaleX: L.scale,
|
|
12302
12286
|
scaleY: k.scale,
|
|
12303
12287
|
offsetX: c,
|
|
12304
12288
|
offsetY: u
|
|
@@ -12328,7 +12312,7 @@ class yo {
|
|
|
12328
12312
|
i.fillStyle = o, i.strokeStyle = o, n.fillColor = o, n.strokeColor = o;
|
|
12329
12313
|
break;
|
|
12330
12314
|
default:
|
|
12331
|
-
throw new
|
|
12315
|
+
throw new jd(`Unsupported paint type: ${e}`);
|
|
12332
12316
|
}
|
|
12333
12317
|
}
|
|
12334
12318
|
getPattern(t, e, s, i) {
|
|
@@ -12341,7 +12325,7 @@ class yo {
|
|
|
12341
12325
|
return h.setTransform(o), h;
|
|
12342
12326
|
}
|
|
12343
12327
|
}
|
|
12344
|
-
function
|
|
12328
|
+
function gf({
|
|
12345
12329
|
src: a,
|
|
12346
12330
|
srcPos: t = 0,
|
|
12347
12331
|
dest: e,
|
|
@@ -12369,8 +12353,8 @@ function pf({
|
|
|
12369
12353
|
destPos: f
|
|
12370
12354
|
};
|
|
12371
12355
|
}
|
|
12372
|
-
const Aa = 16, Ta = 100,
|
|
12373
|
-
function
|
|
12356
|
+
const Aa = 16, Ta = 100, pf = 15, Ea = 10, ka = 1e3, Vt = 16;
|
|
12357
|
+
function mf(a, t) {
|
|
12374
12358
|
if (a._removeMirroring)
|
|
12375
12359
|
throw new Error("Context is already forwarding operations.");
|
|
12376
12360
|
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 = () => {
|
|
@@ -12407,7 +12391,7 @@ function bf(a, t) {
|
|
|
12407
12391
|
t.beginPath(), this.__originalBeginPath();
|
|
12408
12392
|
};
|
|
12409
12393
|
}
|
|
12410
|
-
class
|
|
12394
|
+
class bf {
|
|
12411
12395
|
constructor(t) {
|
|
12412
12396
|
this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
|
|
12413
12397
|
}
|
|
@@ -12428,18 +12412,18 @@ class vf {
|
|
|
12428
12412
|
function Ui(a, t, e, s, i, n, r, o, h, l) {
|
|
12429
12413
|
const [c, u, d, f, g, p] = rt(a);
|
|
12430
12414
|
if (u === 0 && d === 0) {
|
|
12431
|
-
const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p,
|
|
12432
|
-
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T,
|
|
12415
|
+
const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p, P = Math.abs(Math.round(E) - S) || 1;
|
|
12416
|
+
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T, P), a.setTransform(c, u, d, f, g, p), [T, P];
|
|
12433
12417
|
}
|
|
12434
12418
|
if (c === 0 && f === 0) {
|
|
12435
|
-
const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p,
|
|
12436
|
-
return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0,
|
|
12419
|
+
const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p, P = Math.abs(Math.round(E) - S) || 1;
|
|
12420
|
+
return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0, P, T), a.setTransform(c, u, d, f, g, p), [P, T];
|
|
12437
12421
|
}
|
|
12438
12422
|
a.drawImage(t, e, s, i, n, r, o, h, l);
|
|
12439
12423
|
const b = Math.hypot(c, u), m = Math.hypot(d, f);
|
|
12440
12424
|
return [b * h, m * l];
|
|
12441
12425
|
}
|
|
12442
|
-
function
|
|
12426
|
+
function vf(a) {
|
|
12443
12427
|
const {
|
|
12444
12428
|
width: t,
|
|
12445
12429
|
height: e
|
|
@@ -12558,9 +12542,9 @@ function Pa(a, t) {
|
|
|
12558
12542
|
for (g = d < n ? Vt : i, l = 0, f = 0; f < g; f++) {
|
|
12559
12543
|
const A = b - h;
|
|
12560
12544
|
let T = 0;
|
|
12561
|
-
const E = A > y ? s : A * 8 - 7,
|
|
12545
|
+
const E = A > y ? s : A * 8 - 7, P = E & -8;
|
|
12562
12546
|
let N = 0, D = 0;
|
|
12563
|
-
for (; T <
|
|
12547
|
+
for (; T < P; T += 8)
|
|
12564
12548
|
D = c[h++], m[l++] = D & 128 ? _ : S, m[l++] = D & 64 ? _ : S, m[l++] = D & 32 ? _ : S, m[l++] = D & 16 ? _ : S, m[l++] = D & 8 ? _ : S, m[l++] = D & 4 ? _ : S, m[l++] = D & 2 ? _ : S, m[l++] = D & 1 ? _ : S;
|
|
12565
12549
|
for (; T < E; T++)
|
|
12566
12550
|
N === 0 && (D = c[h++], N = 128), m[l++] = D & N ? _ : S, N >>= 1;
|
|
@@ -12594,7 +12578,7 @@ function Oa(a, t) {
|
|
|
12594
12578
|
const d = u < n ? Vt : i;
|
|
12595
12579
|
({
|
|
12596
12580
|
srcPos: h
|
|
12597
|
-
} =
|
|
12581
|
+
} = gf({
|
|
12598
12582
|
src: l,
|
|
12599
12583
|
srcPos: h,
|
|
12600
12584
|
dest: c,
|
|
@@ -12623,16 +12607,16 @@ function Da(a, t) {
|
|
|
12623
12607
|
return !0;
|
|
12624
12608
|
const e = B.singularValueDecompose2dScale(a);
|
|
12625
12609
|
e[0] = Math.fround(e[0]), e[1] = Math.fround(e[1]);
|
|
12626
|
-
const s = Math.fround((globalThis.devicePixelRatio || 1) *
|
|
12610
|
+
const s = Math.fround((globalThis.devicePixelRatio || 1) * Ls.PDF_TO_CSS_UNITS);
|
|
12627
12611
|
return e[0] <= s && e[1] <= s;
|
|
12628
12612
|
}
|
|
12629
|
-
const
|
|
12613
|
+
const yf = ["butt", "round", "square"], _f = ["miter", "round", "bevel"], wf = {}, Ra = {};
|
|
12630
12614
|
class Es {
|
|
12631
12615
|
constructor(t, e, s, i, n, {
|
|
12632
12616
|
optionalContentConfig: r,
|
|
12633
12617
|
markedContentStack: o = null
|
|
12634
12618
|
}, h, l) {
|
|
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
|
|
12619
|
+
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 bf(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();
|
|
12636
12620
|
}
|
|
12637
12621
|
getObject(t, e = null) {
|
|
12638
12622
|
return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
|
|
@@ -12656,7 +12640,7 @@ class Es {
|
|
|
12656
12640
|
const h = n.length;
|
|
12657
12641
|
if (h === o)
|
|
12658
12642
|
return o;
|
|
12659
|
-
const l = h - o > Ea && typeof s == "function", c = l ? Date.now() +
|
|
12643
|
+
const l = h - o > Ea && typeof s == "function", c = l ? Date.now() + pf : 0;
|
|
12660
12644
|
let u = 0;
|
|
12661
12645
|
const d = this.commonObjs, f = this.objs;
|
|
12662
12646
|
let g;
|
|
@@ -12725,16 +12709,16 @@ class Es {
|
|
|
12725
12709
|
if ((t.bitmap || t.data) && t.count > 1) {
|
|
12726
12710
|
const E = t.bitmap || t.data.buffer;
|
|
12727
12711
|
l = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(E), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(E, h));
|
|
12728
|
-
const
|
|
12729
|
-
if (
|
|
12712
|
+
const P = h.get(l);
|
|
12713
|
+
if (P && !r) {
|
|
12730
12714
|
const N = Math.round(Math.min(o[0], o[2]) + o[4]), D = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
12731
12715
|
return {
|
|
12732
|
-
canvas:
|
|
12716
|
+
canvas: P,
|
|
12733
12717
|
offsetX: N,
|
|
12734
12718
|
offsetY: D
|
|
12735
12719
|
};
|
|
12736
12720
|
}
|
|
12737
|
-
c =
|
|
12721
|
+
c = P;
|
|
12738
12722
|
}
|
|
12739
12723
|
c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Oa(u.context, t));
|
|
12740
12724
|
let d = B.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
|
|
@@ -12752,10 +12736,10 @@ class Es {
|
|
|
12752
12736
|
t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
|
|
12753
12737
|
}
|
|
12754
12738
|
setLineCap(t) {
|
|
12755
|
-
this.ctx.lineCap =
|
|
12739
|
+
this.ctx.lineCap = yf[t];
|
|
12756
12740
|
}
|
|
12757
12741
|
setLineJoin(t) {
|
|
12758
|
-
this.ctx.lineJoin =
|
|
12742
|
+
this.ctx.lineJoin = _f[t];
|
|
12759
12743
|
}
|
|
12760
12744
|
setMiterLimit(t) {
|
|
12761
12745
|
this.ctx.miterLimit = t;
|
|
@@ -12825,7 +12809,7 @@ class Es {
|
|
|
12825
12809
|
const t = this.ctx.canvas.width, e = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(s, t, e);
|
|
12826
12810
|
this.suspendedCtx = this.ctx, this.ctx = i.context;
|
|
12827
12811
|
const n = this.ctx;
|
|
12828
|
-
n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n),
|
|
12812
|
+
n.setTransform(...rt(this.suspendedCtx)), Ws(this.suspendedCtx, n), mf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
|
|
12829
12813
|
}
|
|
12830
12814
|
endSMaskMode() {
|
|
12831
12815
|
if (!this.inSMaskMode)
|
|
@@ -12939,10 +12923,10 @@ class Es {
|
|
|
12939
12923
|
this.consumePath();
|
|
12940
12924
|
}
|
|
12941
12925
|
clip() {
|
|
12942
|
-
this.pendingClip =
|
|
12926
|
+
this.pendingClip = wf;
|
|
12943
12927
|
}
|
|
12944
12928
|
eoClip() {
|
|
12945
|
-
this.pendingClip =
|
|
12929
|
+
this.pendingClip = Ra;
|
|
12946
12930
|
}
|
|
12947
12931
|
beginText() {
|
|
12948
12932
|
this.current.textMatrix = al, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
|
|
@@ -13082,8 +13066,8 @@ class Es {
|
|
|
13082
13066
|
if (r !== 1 && (n.scale(r, r), y /= r), n.lineWidth = y, s.isInvalidPDFjsFont) {
|
|
13083
13067
|
const T = [];
|
|
13084
13068
|
let E = 0;
|
|
13085
|
-
for (const
|
|
13086
|
-
T.push(
|
|
13069
|
+
for (const P of t)
|
|
13070
|
+
T.push(P.unicode), E += P.width;
|
|
13087
13071
|
n.fillText(T.join(""), 0, 0), e.x += E * p * c, n.restore(), this.compose();
|
|
13088
13072
|
return;
|
|
13089
13073
|
}
|
|
@@ -13095,29 +13079,29 @@ class Es {
|
|
|
13095
13079
|
continue;
|
|
13096
13080
|
}
|
|
13097
13081
|
let E = !1;
|
|
13098
|
-
const
|
|
13099
|
-
let
|
|
13082
|
+
const P = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
|
|
13083
|
+
let L, k, O = T.width;
|
|
13100
13084
|
if (d) {
|
|
13101
|
-
const M = T.vmetric || g,
|
|
13102
|
-
|
|
13085
|
+
const M = T.vmetric || g, R = -(T.vmetric ? M[1] : O * 0.5) * p, G = M[2] * p;
|
|
13086
|
+
O = M ? -M[0] : O, L = R / r, k = (S + G) / r;
|
|
13103
13087
|
} else
|
|
13104
|
-
|
|
13105
|
-
if (s.remeasure &&
|
|
13088
|
+
L = S / r, k = 0;
|
|
13089
|
+
if (s.remeasure && O > 0) {
|
|
13106
13090
|
const M = n.measureText(N).width * 1e3 / i * r;
|
|
13107
|
-
if (
|
|
13108
|
-
const
|
|
13109
|
-
E = !0, n.save(), n.scale(
|
|
13110
|
-
} else
|
|
13091
|
+
if (O < M && this.isFontSubpixelAAEnabled) {
|
|
13092
|
+
const R = O / M;
|
|
13093
|
+
E = !0, n.save(), n.scale(R, 1), L /= R;
|
|
13094
|
+
} else O !== M && (L += (O - M) / 2e3 * i / r);
|
|
13111
13095
|
}
|
|
13112
13096
|
if (this.contentVisible && (T.isInFont || s.missingFile)) {
|
|
13113
13097
|
if (b && !D)
|
|
13114
|
-
n.fillText(N,
|
|
13115
|
-
else if (this.paintChar(N,
|
|
13116
|
-
const M =
|
|
13117
|
-
this.paintChar(D.fontChar, M,
|
|
13098
|
+
n.fillText(N, L, k);
|
|
13099
|
+
else if (this.paintChar(N, L, k, m, v), D) {
|
|
13100
|
+
const M = L + i * D.offset.x / r, R = k - i * D.offset.y / r;
|
|
13101
|
+
this.paintChar(D.fontChar, M, R, m, v);
|
|
13118
13102
|
}
|
|
13119
13103
|
}
|
|
13120
|
-
const j = d ?
|
|
13104
|
+
const j = d ? O * p - P * l : O * p + P * l;
|
|
13121
13105
|
S += j, E && n.restore();
|
|
13122
13106
|
}
|
|
13123
13107
|
d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
|
|
@@ -13180,7 +13164,7 @@ class Es {
|
|
|
13180
13164
|
}
|
|
13181
13165
|
_getPattern(t, e = null) {
|
|
13182
13166
|
let s;
|
|
13183
|
-
return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s =
|
|
13167
|
+
return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = ff(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
|
|
13184
13168
|
}
|
|
13185
13169
|
shadingFill(t) {
|
|
13186
13170
|
if (!this.contentVisible)
|
|
@@ -13286,7 +13270,7 @@ class Es {
|
|
|
13286
13270
|
const e = t.count;
|
|
13287
13271
|
t = this.getObject(t.data, t), t.count = e;
|
|
13288
13272
|
const s = this.ctx, i = this.processingType3;
|
|
13289
|
-
if (i && (i.compiled === void 0 && (i.compiled =
|
|
13273
|
+
if (i && (i.compiled === void 0 && (i.compiled = vf(t)), i.compiled)) {
|
|
13290
13274
|
i.compiled(s);
|
|
13291
13275
|
return;
|
|
13292
13276
|
}
|
|
@@ -13436,7 +13420,7 @@ class Es {
|
|
|
13436
13420
|
const e = this.current.isEmptyClip();
|
|
13437
13421
|
this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(t);
|
|
13438
13422
|
const s = this.ctx;
|
|
13439
|
-
this.pendingClip && (e || (this.pendingClip ===
|
|
13423
|
+
this.pendingClip && (e || (this.pendingClip === Ra ? s.clip("evenodd") : s.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), s.beginPath();
|
|
13440
13424
|
}
|
|
13441
13425
|
getSinglePixelWidth() {
|
|
13442
13426
|
if (!this._cachedGetSinglePixelWidth) {
|
|
@@ -13535,7 +13519,7 @@ class ri {
|
|
|
13535
13519
|
this.#e = t;
|
|
13536
13520
|
}
|
|
13537
13521
|
}
|
|
13538
|
-
class
|
|
13522
|
+
class xf {
|
|
13539
13523
|
#t;
|
|
13540
13524
|
#e;
|
|
13541
13525
|
constructor({
|
|
@@ -13558,7 +13542,7 @@ class Sf {
|
|
|
13558
13542
|
}
|
|
13559
13543
|
}
|
|
13560
13544
|
const _s = Symbol("INTERNAL");
|
|
13561
|
-
class
|
|
13545
|
+
class Sf {
|
|
13562
13546
|
#t = !1;
|
|
13563
13547
|
#e = !1;
|
|
13564
13548
|
#s = !1;
|
|
@@ -13586,7 +13570,7 @@ class Cf {
|
|
|
13586
13570
|
t !== _s && tt("Internal method `_setVisible` called."), this.#s = s, this.#i = e;
|
|
13587
13571
|
}
|
|
13588
13572
|
}
|
|
13589
|
-
class
|
|
13573
|
+
class Cf {
|
|
13590
13574
|
#t = null;
|
|
13591
13575
|
#e = /* @__PURE__ */ new Map();
|
|
13592
13576
|
#s = null;
|
|
@@ -13595,7 +13579,7 @@ class Af {
|
|
|
13595
13579
|
if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
|
|
13596
13580
|
this.name = t.name, this.creator = t.creator, this.#i = t.order;
|
|
13597
13581
|
for (const s of t.groups)
|
|
13598
|
-
this.#e.set(s.id, new
|
|
13582
|
+
this.#e.set(s.id, new Sf(e, s));
|
|
13599
13583
|
if (t.baseState === "OFF")
|
|
13600
13584
|
for (const s of this.#e.values())
|
|
13601
13585
|
s._setVisible(_s, !1);
|
|
@@ -13746,7 +13730,7 @@ class Af {
|
|
|
13746
13730
|
return this.#t = t.hexdigest();
|
|
13747
13731
|
}
|
|
13748
13732
|
}
|
|
13749
|
-
class
|
|
13733
|
+
class Af {
|
|
13750
13734
|
constructor(t, {
|
|
13751
13735
|
disableRange: e = !1,
|
|
13752
13736
|
disableStream: s = !1
|
|
@@ -13815,12 +13799,12 @@ class Tf {
|
|
|
13815
13799
|
getFullReader() {
|
|
13816
13800
|
bt(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
|
|
13817
13801
|
const t = this._queuedChunks;
|
|
13818
|
-
return this._queuedChunks = null, new
|
|
13802
|
+
return this._queuedChunks = null, new Tf(this, t, this._progressiveDone, this._contentDispositionFilename);
|
|
13819
13803
|
}
|
|
13820
13804
|
getRangeReader(t, e) {
|
|
13821
13805
|
if (e <= this._progressiveDataLength)
|
|
13822
13806
|
return null;
|
|
13823
|
-
const s = new
|
|
13807
|
+
const s = new Ef(this, t, e);
|
|
13824
13808
|
return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(s), s;
|
|
13825
13809
|
}
|
|
13826
13810
|
cancelAllRequests(t) {
|
|
@@ -13830,7 +13814,7 @@ class Tf {
|
|
|
13830
13814
|
this._pdfDataRangeTransport.abort();
|
|
13831
13815
|
}
|
|
13832
13816
|
}
|
|
13833
|
-
class
|
|
13817
|
+
class Tf {
|
|
13834
13818
|
constructor(t, e, s = !1, i = null) {
|
|
13835
13819
|
this._stream = t, this._done = s || !1, this._filename = fo(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
|
|
13836
13820
|
for (const n of this._queuedChunks)
|
|
@@ -13885,7 +13869,7 @@ class Ef {
|
|
|
13885
13869
|
this._done || (this._done = !0);
|
|
13886
13870
|
}
|
|
13887
13871
|
}
|
|
13888
|
-
class
|
|
13872
|
+
class Ef {
|
|
13889
13873
|
constructor(t, e, s) {
|
|
13890
13874
|
this._stream = t, this._begin = e, this._end = s, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
|
|
13891
13875
|
}
|
|
@@ -13937,7 +13921,7 @@ class kf {
|
|
|
13937
13921
|
this._requests.length = 0, this._stream._removeRangeReader(this);
|
|
13938
13922
|
}
|
|
13939
13923
|
}
|
|
13940
|
-
function
|
|
13924
|
+
function kf(a) {
|
|
13941
13925
|
let t = !0, e = s("filename\\*", "i").exec(a);
|
|
13942
13926
|
if (e) {
|
|
13943
13927
|
e = e[1];
|
|
@@ -14058,7 +14042,7 @@ function _l({
|
|
|
14058
14042
|
function wl(a) {
|
|
14059
14043
|
const t = a.get("Content-Disposition");
|
|
14060
14044
|
if (t) {
|
|
14061
|
-
let e =
|
|
14045
|
+
let e = kf(t);
|
|
14062
14046
|
if (e.includes("%"))
|
|
14063
14047
|
try {
|
|
14064
14048
|
e = decodeURIComponent(e);
|
|
@@ -14088,7 +14072,7 @@ function Sl(a, t, e) {
|
|
|
14088
14072
|
function Cl(a) {
|
|
14089
14073
|
return a instanceof Uint8Array ? a.buffer : a instanceof ArrayBuffer ? a : (U(`getArrayBuffer - unexpected data format: ${a}`), new Uint8Array(a).buffer);
|
|
14090
14074
|
}
|
|
14091
|
-
class
|
|
14075
|
+
class La {
|
|
14092
14076
|
_responseOrigin = null;
|
|
14093
14077
|
constructor(t) {
|
|
14094
14078
|
this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = yl(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
@@ -14097,12 +14081,12 @@ class Ra {
|
|
|
14097
14081
|
return this._fullRequestReader?._loaded ?? 0;
|
|
14098
14082
|
}
|
|
14099
14083
|
getFullReader() {
|
|
14100
|
-
return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new
|
|
14084
|
+
return bt(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Mf(this), this._fullRequestReader;
|
|
14101
14085
|
}
|
|
14102
14086
|
getRangeReader(t, e) {
|
|
14103
14087
|
if (e <= this._progressiveDataLength)
|
|
14104
14088
|
return null;
|
|
14105
|
-
const s = new
|
|
14089
|
+
const s = new Pf(this, t, e);
|
|
14106
14090
|
return this._rangeRequestReaders.push(s), s;
|
|
14107
14091
|
}
|
|
14108
14092
|
cancelAllRequests(t) {
|
|
@@ -14111,7 +14095,7 @@ class Ra {
|
|
|
14111
14095
|
e.cancel(t);
|
|
14112
14096
|
}
|
|
14113
14097
|
}
|
|
14114
|
-
class
|
|
14098
|
+
class Mf {
|
|
14115
14099
|
constructor(t) {
|
|
14116
14100
|
this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
|
|
14117
14101
|
const e = t.source;
|
|
@@ -14169,7 +14153,7 @@ class Pf {
|
|
|
14169
14153
|
this._reader?.cancel(t), this._abortController.abort();
|
|
14170
14154
|
}
|
|
14171
14155
|
}
|
|
14172
|
-
class
|
|
14156
|
+
class Pf {
|
|
14173
14157
|
constructor(t, e, s) {
|
|
14174
14158
|
this._stream = t, this._reader = null, this._loaded = 0;
|
|
14175
14159
|
const i = t.source;
|
|
@@ -14210,11 +14194,11 @@ class Of {
|
|
|
14210
14194
|
}
|
|
14211
14195
|
}
|
|
14212
14196
|
const gr = 200, pr = 206;
|
|
14213
|
-
function
|
|
14197
|
+
function Of(a) {
|
|
14214
14198
|
const t = a.response;
|
|
14215
14199
|
return typeof t != "string" ? t : Nn(t).buffer;
|
|
14216
14200
|
}
|
|
14217
|
-
class
|
|
14201
|
+
class Df {
|
|
14218
14202
|
_responseOrigin = null;
|
|
14219
14203
|
constructor({
|
|
14220
14204
|
url: t,
|
|
@@ -14254,7 +14238,7 @@ class Lf {
|
|
|
14254
14238
|
s.onError(i.status);
|
|
14255
14239
|
return;
|
|
14256
14240
|
}
|
|
14257
|
-
const o =
|
|
14241
|
+
const o = Of(i);
|
|
14258
14242
|
if (n === pr) {
|
|
14259
14243
|
const h = i.getResponseHeader("Content-Range"), l = /bytes (\d+)-(\d+)\/(\d+)/.exec(h);
|
|
14260
14244
|
l ? s.onDone({
|
|
@@ -14279,17 +14263,17 @@ class Lf {
|
|
|
14279
14263
|
}
|
|
14280
14264
|
class Rf {
|
|
14281
14265
|
constructor(t) {
|
|
14282
|
-
this._source = t, this._manager = new
|
|
14266
|
+
this._source = t, this._manager = new Df(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
14283
14267
|
}
|
|
14284
14268
|
_onRangeRequestReaderClosed(t) {
|
|
14285
14269
|
const e = this._rangeRequestReaders.indexOf(t);
|
|
14286
14270
|
e >= 0 && this._rangeRequestReaders.splice(e, 1);
|
|
14287
14271
|
}
|
|
14288
14272
|
getFullReader() {
|
|
14289
|
-
return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new
|
|
14273
|
+
return bt(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Lf(this._manager, this._source), this._fullRequestReader;
|
|
14290
14274
|
}
|
|
14291
14275
|
getRangeReader(t, e) {
|
|
14292
|
-
const s = new
|
|
14276
|
+
const s = new Ff(this._manager, t, e);
|
|
14293
14277
|
return s.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(s), s;
|
|
14294
14278
|
}
|
|
14295
14279
|
cancelAllRequests(t) {
|
|
@@ -14298,7 +14282,7 @@ class Rf {
|
|
|
14298
14282
|
e.cancel(t);
|
|
14299
14283
|
}
|
|
14300
14284
|
}
|
|
14301
|
-
class
|
|
14285
|
+
class Lf {
|
|
14302
14286
|
constructor(t, e) {
|
|
14303
14287
|
this._manager = t, this._url = e.url, this._fullRequestId = t.request({
|
|
14304
14288
|
onHeadersReceived: this._onHeadersReceived.bind(this),
|
|
@@ -14390,7 +14374,7 @@ class Ff {
|
|
|
14390
14374
|
this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
|
|
14391
14375
|
}
|
|
14392
14376
|
}
|
|
14393
|
-
class
|
|
14377
|
+
class Ff {
|
|
14394
14378
|
constructor(t, e, s) {
|
|
14395
14379
|
this._manager = t, this._url = t.url, this._requestId = t.request({
|
|
14396
14380
|
begin: e,
|
|
@@ -14463,27 +14447,27 @@ class If {
|
|
|
14463
14447
|
this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
|
|
14464
14448
|
}
|
|
14465
14449
|
}
|
|
14466
|
-
const
|
|
14467
|
-
function
|
|
14468
|
-
if (
|
|
14450
|
+
const If = /^[a-z][a-z0-9\-+.]+:/i;
|
|
14451
|
+
function Nf(a) {
|
|
14452
|
+
if (If.test(a))
|
|
14469
14453
|
return new URL(a);
|
|
14470
14454
|
const t = process.getBuiltinModule("url");
|
|
14471
14455
|
return new URL(t.pathToFileURL(a));
|
|
14472
14456
|
}
|
|
14473
|
-
class
|
|
14457
|
+
class jf {
|
|
14474
14458
|
constructor(t) {
|
|
14475
|
-
this.source = t, this.url =
|
|
14459
|
+
this.source = t, this.url = Nf(t.url), bt(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
14476
14460
|
}
|
|
14477
14461
|
get _progressiveDataLength() {
|
|
14478
14462
|
return this._fullRequestReader?._loaded ?? 0;
|
|
14479
14463
|
}
|
|
14480
14464
|
getFullReader() {
|
|
14481
|
-
return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new
|
|
14465
|
+
return bt(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Bf(this), this._fullRequestReader;
|
|
14482
14466
|
}
|
|
14483
14467
|
getRangeReader(t, e) {
|
|
14484
14468
|
if (e <= this._progressiveDataLength)
|
|
14485
14469
|
return null;
|
|
14486
|
-
const s = new
|
|
14470
|
+
const s = new Hf(this, t, e);
|
|
14487
14471
|
return this._rangeRequestReaders.push(s), s;
|
|
14488
14472
|
}
|
|
14489
14473
|
cancelAllRequests(t) {
|
|
@@ -14492,7 +14476,7 @@ class Bf {
|
|
|
14492
14476
|
e.cancel(t);
|
|
14493
14477
|
}
|
|
14494
14478
|
}
|
|
14495
|
-
class
|
|
14479
|
+
class Bf {
|
|
14496
14480
|
constructor(t) {
|
|
14497
14481
|
this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
|
|
14498
14482
|
const e = t.source;
|
|
@@ -14556,7 +14540,7 @@ class Hf {
|
|
|
14556
14540
|
}), !this._isStreamingSupported && this._isRangeSupported && this._error(new We("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
|
|
14557
14541
|
}
|
|
14558
14542
|
}
|
|
14559
|
-
class
|
|
14543
|
+
class Hf {
|
|
14560
14544
|
constructor(t, e, s) {
|
|
14561
14545
|
this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
|
|
14562
14546
|
const i = t.source;
|
|
@@ -14606,7 +14590,7 @@ class zf {
|
|
|
14606
14590
|
}), this._storedError && this._readableStream.destroy(this._storedError);
|
|
14607
14591
|
}
|
|
14608
14592
|
}
|
|
14609
|
-
const
|
|
14593
|
+
const zf = 1e5, zt = 30, Gf = 0.8;
|
|
14610
14594
|
class Dt {
|
|
14611
14595
|
#t = Promise.withResolvers();
|
|
14612
14596
|
#e = null;
|
|
@@ -14719,7 +14703,7 @@ class Dt {
|
|
|
14719
14703
|
this.#n.ctx ??= Dt.#k(this.#r);
|
|
14720
14704
|
const e = this.#m, s = this.#o;
|
|
14721
14705
|
for (const i of t) {
|
|
14722
|
-
if (e.length >
|
|
14706
|
+
if (e.length > zf) {
|
|
14723
14707
|
U("Ignoring additional textDivs for performance reasons."), this.#s = !0;
|
|
14724
14708
|
return;
|
|
14725
14709
|
}
|
|
@@ -14748,7 +14732,7 @@ class Dt {
|
|
|
14748
14732
|
r.vertical && (n += Math.PI / 2);
|
|
14749
14733
|
let o = this.#i && r.fontSubstitution || r.fontFamily;
|
|
14750
14734
|
o = Dt.fontFamilyMap.get(o) || o;
|
|
14751
|
-
const h = Math.hypot(i[2], i[3]), l = h * Dt.#
|
|
14735
|
+
const h = Math.hypot(i[2], i[3]), l = h * Dt.#L(o, this.#r);
|
|
14752
14736
|
let c, u;
|
|
14753
14737
|
n === 0 ? (c = i[4], u = i[5] - l) : (c = i[4] + l * Math.sin(n), u = i[5] - l * Math.cos(n));
|
|
14754
14738
|
const d = "calc(var(--scale-factor)*", f = e.style;
|
|
@@ -14823,7 +14807,7 @@ class Dt {
|
|
|
14823
14807
|
const t = document.createElement("div");
|
|
14824
14808
|
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();
|
|
14825
14809
|
}
|
|
14826
|
-
static #
|
|
14810
|
+
static #L(t, e) {
|
|
14827
14811
|
const s = this.#_.get(t);
|
|
14828
14812
|
if (s)
|
|
14829
14813
|
return s;
|
|
@@ -14850,7 +14834,7 @@ class Dt {
|
|
|
14850
14834
|
break;
|
|
14851
14835
|
}
|
|
14852
14836
|
i.canvas.width = i.canvas.height = 0;
|
|
14853
|
-
const l = r ? r / (r + o) :
|
|
14837
|
+
const l = r ? r / (r + o) : Gf;
|
|
14854
14838
|
return this.#_.set(t, l), l;
|
|
14855
14839
|
}
|
|
14856
14840
|
}
|
|
@@ -14882,8 +14866,8 @@ class ui {
|
|
|
14882
14866
|
return !(t === "textarea" || t === "input" || t === "option" || t === "select");
|
|
14883
14867
|
}
|
|
14884
14868
|
}
|
|
14885
|
-
const
|
|
14886
|
-
function
|
|
14869
|
+
const Vf = 65536, Xf = 100, Wf = 5e3, Uf = kt ? of : sf, Yf = kt ? af : gl, $f = kt ? rf : nf, qf = kt ? hf : bl;
|
|
14870
|
+
function Kf(a = {}) {
|
|
14887
14871
|
typeof a == "string" || a instanceof URL ? a = {
|
|
14888
14872
|
url: a
|
|
14889
14873
|
} : (a instanceof ArrayBuffer || ArrayBuffer.isView(a)) && (a = {
|
|
@@ -14891,16 +14875,16 @@ function Jf(a = {}) {
|
|
|
14891
14875
|
});
|
|
14892
14876
|
const t = new _o(), {
|
|
14893
14877
|
docId: e
|
|
14894
|
-
} = t, s = a.url ?
|
|
14878
|
+
} = t, s = a.url ? Jf(a.url) : null, i = a.data ? Zf(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 : Vf;
|
|
14895
14879
|
let c = a.worker instanceof ks ? a.worker : null;
|
|
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 ||
|
|
14897
|
-
|
|
14880
|
+
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 || Yf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || qf, 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, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, L = a.disableRange === !0, k = a.disableStream === !0, O = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Uf, R = a.FilterFactory || $f, 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;
|
|
14881
|
+
Ld(u);
|
|
14898
14882
|
const et = {
|
|
14899
14883
|
canvasFactory: new M({
|
|
14900
14884
|
ownerDocument: D,
|
|
14901
14885
|
enableHWA: G
|
|
14902
14886
|
}),
|
|
14903
|
-
filterFactory: new
|
|
14887
|
+
filterFactory: new R({
|
|
14904
14888
|
docId: e,
|
|
14905
14889
|
ownerDocument: D
|
|
14906
14890
|
}),
|
|
@@ -14924,7 +14908,7 @@ function Jf(a = {}) {
|
|
|
14924
14908
|
apiVersion: "4.10.38",
|
|
14925
14909
|
data: i,
|
|
14926
14910
|
password: o,
|
|
14927
|
-
disableAutoFetch:
|
|
14911
|
+
disableAutoFetch: O,
|
|
14928
14912
|
rangeChunkSize: l,
|
|
14929
14913
|
length: it,
|
|
14930
14914
|
docBaseUrl: d,
|
|
@@ -14937,19 +14921,19 @@ function Jf(a = {}) {
|
|
|
14937
14921
|
isOffscreenCanvasSupported: S,
|
|
14938
14922
|
isImageDecoderSupported: A,
|
|
14939
14923
|
canvasMaxAreaInBytes: T,
|
|
14940
|
-
fontExtraProperties:
|
|
14924
|
+
fontExtraProperties: P,
|
|
14941
14925
|
useSystemFonts: at,
|
|
14942
14926
|
cMapUrl: xt ? f : null,
|
|
14943
14927
|
standardFontDataUrl: xt ? b : null
|
|
14944
14928
|
}
|
|
14945
14929
|
}, fe = {
|
|
14946
14930
|
disableFontFace: E,
|
|
14947
|
-
fontExtraProperties:
|
|
14931
|
+
fontExtraProperties: P,
|
|
14948
14932
|
ownerDocument: D,
|
|
14949
14933
|
pdfBug: j,
|
|
14950
14934
|
styleElement: gt,
|
|
14951
14935
|
loadingParams: {
|
|
14952
|
-
disableAutoFetch:
|
|
14936
|
+
disableAutoFetch: O,
|
|
14953
14937
|
enableXfa: N
|
|
14954
14938
|
}
|
|
14955
14939
|
};
|
|
@@ -14961,8 +14945,8 @@ function Jf(a = {}) {
|
|
|
14961
14945
|
const ht = c.messageHandler.sendWithPromise("GetDocRequest", Pt, i ? [i.buffer] : null);
|
|
14962
14946
|
let K;
|
|
14963
14947
|
if (h)
|
|
14964
|
-
K = new
|
|
14965
|
-
disableRange:
|
|
14948
|
+
K = new Af(h, {
|
|
14949
|
+
disableRange: L,
|
|
14966
14950
|
disableStream: k
|
|
14967
14951
|
});
|
|
14968
14952
|
else if (!i) {
|
|
@@ -14973,18 +14957,18 @@ function Jf(a = {}) {
|
|
|
14973
14957
|
if (Ks(s)) {
|
|
14974
14958
|
if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
|
|
14975
14959
|
throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
|
|
14976
|
-
je =
|
|
14960
|
+
je = La;
|
|
14977
14961
|
} else
|
|
14978
|
-
je =
|
|
14962
|
+
je = jf;
|
|
14979
14963
|
else
|
|
14980
|
-
je = Ks(s) ?
|
|
14964
|
+
je = Ks(s) ? La : Rf;
|
|
14981
14965
|
K = new je({
|
|
14982
14966
|
url: s,
|
|
14983
14967
|
length: it,
|
|
14984
14968
|
httpHeaders: n,
|
|
14985
14969
|
withCredentials: r,
|
|
14986
14970
|
rangeChunkSize: l,
|
|
14987
|
-
disableRange:
|
|
14971
|
+
disableRange: L,
|
|
14988
14972
|
disableStream: k
|
|
14989
14973
|
});
|
|
14990
14974
|
}
|
|
@@ -14993,12 +14977,12 @@ function Jf(a = {}) {
|
|
|
14993
14977
|
throw new Error("Loading aborted");
|
|
14994
14978
|
if (c.destroyed)
|
|
14995
14979
|
throw new Error("Worker was destroyed");
|
|
14996
|
-
const ms = new Js(e, je, c.port), ge = new
|
|
14980
|
+
const ms = new Js(e, je, c.port), ge = new sg(ms, t, K, fe, et);
|
|
14997
14981
|
t._transport = ge, ms.send("Ready", null);
|
|
14998
14982
|
});
|
|
14999
14983
|
}).catch(t._capability.reject), t;
|
|
15000
14984
|
}
|
|
15001
|
-
function
|
|
14985
|
+
function Jf(a) {
|
|
15002
14986
|
if (a instanceof URL)
|
|
15003
14987
|
return a.href;
|
|
15004
14988
|
try {
|
|
@@ -15009,7 +14993,7 @@ function Zf(a) {
|
|
|
15009
14993
|
}
|
|
15010
14994
|
throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
|
|
15011
14995
|
}
|
|
15012
|
-
function
|
|
14996
|
+
function Zf(a) {
|
|
15013
14997
|
if (kt && typeof Buffer < "u" && a instanceof Buffer)
|
|
15014
14998
|
throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
|
|
15015
14999
|
if (a instanceof Uint8Array && a.byteLength === a.buffer.byteLength)
|
|
@@ -15088,7 +15072,7 @@ class Al {
|
|
|
15088
15072
|
abort() {
|
|
15089
15073
|
}
|
|
15090
15074
|
}
|
|
15091
|
-
class
|
|
15075
|
+
class Qf {
|
|
15092
15076
|
constructor(t, e) {
|
|
15093
15077
|
this._pdfInfo = t, this._transport = e;
|
|
15094
15078
|
}
|
|
@@ -15200,7 +15184,7 @@ class tg {
|
|
|
15200
15184
|
return this._transport.getCalculationOrderIds();
|
|
15201
15185
|
}
|
|
15202
15186
|
}
|
|
15203
|
-
class
|
|
15187
|
+
class tg {
|
|
15204
15188
|
#t = null;
|
|
15205
15189
|
#e = !1;
|
|
15206
15190
|
constructor(t, e, s, i = !1) {
|
|
@@ -15412,7 +15396,7 @@ class eg {
|
|
|
15412
15396
|
if (t)
|
|
15413
15397
|
return this.#t = setTimeout(() => {
|
|
15414
15398
|
this.#t = null, this.#s(!1);
|
|
15415
|
-
},
|
|
15399
|
+
}, Wf), !1;
|
|
15416
15400
|
for (const {
|
|
15417
15401
|
renderTasks: e,
|
|
15418
15402
|
operatorList: s
|
|
@@ -15492,7 +15476,7 @@ class eg {
|
|
|
15492
15476
|
if (t.renderTasks.size > 0)
|
|
15493
15477
|
return;
|
|
15494
15478
|
if (e instanceof uo) {
|
|
15495
|
-
let i =
|
|
15479
|
+
let i = Xf;
|
|
15496
15480
|
e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
|
|
15497
15481
|
t.streamReaderCancelTimeout = null, this._abortOperatorList({
|
|
15498
15482
|
intentState: t,
|
|
@@ -15518,7 +15502,7 @@ class eg {
|
|
|
15518
15502
|
return this._stats;
|
|
15519
15503
|
}
|
|
15520
15504
|
}
|
|
15521
|
-
class
|
|
15505
|
+
class eg {
|
|
15522
15506
|
#t = /* @__PURE__ */ new Map();
|
|
15523
15507
|
#e = Promise.resolve();
|
|
15524
15508
|
postMessage(t, e) {
|
|
@@ -15561,7 +15545,7 @@ const nt = class nt {
|
|
|
15561
15545
|
constructor({
|
|
15562
15546
|
name: t = null,
|
|
15563
15547
|
port: e = null,
|
|
15564
|
-
verbosity: s =
|
|
15548
|
+
verbosity: s = Fd()
|
|
15565
15549
|
} = {}) {
|
|
15566
15550
|
bs(this, Ms);
|
|
15567
15551
|
if (this.name = t, this.destroyed = !1, this.verbosity = s, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, e) {
|
|
@@ -15638,7 +15622,7 @@ const nt = class nt {
|
|
|
15638
15622
|
this._readyCapability.reject(new Error("Worker was destroyed"));
|
|
15639
15623
|
return;
|
|
15640
15624
|
}
|
|
15641
|
-
const e = new
|
|
15625
|
+
const e = new eg();
|
|
15642
15626
|
this._port = e;
|
|
15643
15627
|
const s = `fake${Eo(nt, _n)._++}`, i = new Js(s + "_worker", s, e);
|
|
15644
15628
|
t.setup(i, e), this._messageHandler = new Js(s, s + "_worker", e), _i(this, Ms, Qi).call(this);
|
|
@@ -15699,14 +15683,14 @@ _n = new WeakMap(), is = new WeakMap(), ns = new WeakMap(), Ms = new WeakSet(),
|
|
|
15699
15683
|
}));
|
|
15700
15684
|
};
|
|
15701
15685
|
let ks = nt;
|
|
15702
|
-
class
|
|
15686
|
+
class sg {
|
|
15703
15687
|
#t = /* @__PURE__ */ new Map();
|
|
15704
15688
|
#e = /* @__PURE__ */ new Map();
|
|
15705
15689
|
#s = /* @__PURE__ */ new Map();
|
|
15706
15690
|
#i = /* @__PURE__ */ new Map();
|
|
15707
15691
|
#r = null;
|
|
15708
15692
|
constructor(t, e, s, i, n) {
|
|
15709
|
-
this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new
|
|
15693
|
+
this.messageHandler = t, this.loadingTask = e, this.commonObjs = new Tl(), this.fontLoader = new tf({
|
|
15710
15694
|
ownerDocument: i.ownerDocument,
|
|
15711
15695
|
styleElement: i.styleElement
|
|
15712
15696
|
}), 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();
|
|
@@ -15722,7 +15706,7 @@ class ig {
|
|
|
15722
15706
|
return Y(this, "annotationStorage", new bo());
|
|
15723
15707
|
}
|
|
15724
15708
|
getRenderingIntent(t, e = ze.ENABLE, s = null, i = !1, n = !1) {
|
|
15725
|
-
let r = Yt.DISPLAY, o =
|
|
15709
|
+
let r = Yt.DISPLAY, o = Rr;
|
|
15726
15710
|
switch (t) {
|
|
15727
15711
|
case "any":
|
|
15728
15712
|
r = Yt.ANY;
|
|
@@ -15852,7 +15836,7 @@ class ig {
|
|
|
15852
15836
|
}), t.on("GetDoc", ({
|
|
15853
15837
|
pdfInfo: s
|
|
15854
15838
|
}) => {
|
|
15855
|
-
this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new
|
|
15839
|
+
this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new Qf(s, this));
|
|
15856
15840
|
}), t.on("DocException", (s) => {
|
|
15857
15841
|
e._capability.reject(Gt(s));
|
|
15858
15842
|
}), t.on("PasswordRequest", (s) => {
|
|
@@ -15894,7 +15878,7 @@ class ig {
|
|
|
15894
15878
|
U(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
|
|
15895
15879
|
break;
|
|
15896
15880
|
}
|
|
15897
|
-
const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new
|
|
15881
|
+
const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new ef(n, {
|
|
15898
15882
|
disableFontFace: r,
|
|
15899
15883
|
fontExtraProperties: o,
|
|
15900
15884
|
inspectFont: l
|
|
@@ -15935,7 +15919,7 @@ class ig {
|
|
|
15935
15919
|
}
|
|
15936
15920
|
switch (n) {
|
|
15937
15921
|
case "Image":
|
|
15938
|
-
o.objs.resolve(s, r), r?.dataLen >
|
|
15922
|
+
o.objs.resolve(s, r), r?.dataLen > Pd && (o._maybeCleanupAfterRender = !0);
|
|
15939
15923
|
break;
|
|
15940
15924
|
case "Pattern":
|
|
15941
15925
|
o.objs.resolve(s, r);
|
|
@@ -15993,7 +15977,7 @@ class ig {
|
|
|
15993
15977
|
if (this.destroyed)
|
|
15994
15978
|
throw new Error("Transport destroyed");
|
|
15995
15979
|
n.refStr && this.#i.set(n.refStr, t);
|
|
15996
|
-
const r = new
|
|
15980
|
+
const r = new tg(e, n, this, this._params.pdfBug);
|
|
15997
15981
|
return this.#e.set(e, r), r;
|
|
15998
15982
|
});
|
|
15999
15983
|
return this.#s.set(e, i), i;
|
|
@@ -16062,7 +16046,7 @@ class ig {
|
|
|
16062
16046
|
return this.messageHandler.sendWithPromise("GetOutline", null);
|
|
16063
16047
|
}
|
|
16064
16048
|
getOptionalContentConfig(t) {
|
|
16065
|
-
return this.#n("GetOptionalContentConfig").then((e) => new
|
|
16049
|
+
return this.#n("GetOptionalContentConfig").then((e) => new Cf(e, t));
|
|
16066
16050
|
}
|
|
16067
16051
|
getPermissions() {
|
|
16068
16052
|
return this.messageHandler.sendWithPromise("GetPermissions", null);
|
|
@@ -16073,7 +16057,7 @@ class ig {
|
|
|
16073
16057
|
return e;
|
|
16074
16058
|
const s = this.messageHandler.sendWithPromise(t, null).then((i) => ({
|
|
16075
16059
|
info: i[0],
|
|
16076
|
-
metadata: i[1] ? new
|
|
16060
|
+
metadata: i[1] ? new xf(i[1]) : null,
|
|
16077
16061
|
contentDispositionFilename: this._fullReader?.filename ?? null,
|
|
16078
16062
|
contentLength: this._fullReader?.contentLength ?? null
|
|
16079
16063
|
}));
|
|
@@ -16147,7 +16131,7 @@ class Tl {
|
|
|
16147
16131
|
}
|
|
16148
16132
|
}
|
|
16149
16133
|
}
|
|
16150
|
-
class
|
|
16134
|
+
class ig {
|
|
16151
16135
|
#t = null;
|
|
16152
16136
|
constructor(t) {
|
|
16153
16137
|
this.#t = t, this.onContinue = null;
|
|
@@ -16187,7 +16171,7 @@ class Cs {
|
|
|
16187
16171
|
pdfBug: u = !1,
|
|
16188
16172
|
pageColors: d = null
|
|
16189
16173
|
}) {
|
|
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
|
|
16174
|
+
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 ig(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;
|
|
16191
16175
|
}
|
|
16192
16176
|
get completed() {
|
|
16193
16177
|
return this.capability.promise.catch(function() {
|
|
@@ -16242,7 +16226,7 @@ class Cs {
|
|
|
16242
16226
|
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())));
|
|
16243
16227
|
}
|
|
16244
16228
|
}
|
|
16245
|
-
const
|
|
16229
|
+
const ng = "4.10.38", rg = "f9bea397f";
|
|
16246
16230
|
function Ia(a) {
|
|
16247
16231
|
return Math.floor(Math.max(0, Math.min(1, a)) * 255).toString(16).padStart(2, "0");
|
|
16248
16232
|
}
|
|
@@ -16296,7 +16280,7 @@ class Na {
|
|
|
16296
16280
|
return ["CMYK", i, n, r, o];
|
|
16297
16281
|
}
|
|
16298
16282
|
}
|
|
16299
|
-
class
|
|
16283
|
+
class og {
|
|
16300
16284
|
create(t, e, s = !1) {
|
|
16301
16285
|
if (t <= 0 || e <= 0)
|
|
16302
16286
|
throw new Error("Invalid SVG dimensions");
|
|
@@ -16312,7 +16296,7 @@ class ag {
|
|
|
16312
16296
|
tt("Abstract method `_createSVG` called.");
|
|
16313
16297
|
}
|
|
16314
16298
|
}
|
|
16315
|
-
class wo extends
|
|
16299
|
+
class wo extends og {
|
|
16316
16300
|
_createSVG(t) {
|
|
16317
16301
|
return document.createElementNS(Ee, t);
|
|
16318
16302
|
}
|
|
@@ -16466,30 +16450,30 @@ class El {
|
|
|
16466
16450
|
t.div.style.transform = e, t.div.hidden = !1;
|
|
16467
16451
|
}
|
|
16468
16452
|
}
|
|
16469
|
-
const yi = 1e3,
|
|
16453
|
+
const yi = 1e3, ag = 9, us = /* @__PURE__ */ new WeakSet();
|
|
16470
16454
|
function Ge(a) {
|
|
16471
16455
|
return {
|
|
16472
16456
|
width: a[2] - a[0],
|
|
16473
16457
|
height: a[3] - a[1]
|
|
16474
16458
|
};
|
|
16475
16459
|
}
|
|
16476
|
-
class
|
|
16460
|
+
class hg {
|
|
16477
16461
|
static create(t) {
|
|
16478
16462
|
switch (t.data.annotationType) {
|
|
16479
16463
|
case yt.LINK:
|
|
16480
16464
|
return new kl(t);
|
|
16481
16465
|
case yt.TEXT:
|
|
16482
|
-
return new
|
|
16466
|
+
return new lg(t);
|
|
16483
16467
|
case yt.WIDGET:
|
|
16484
16468
|
switch (t.data.fieldType) {
|
|
16485
16469
|
case "Tx":
|
|
16486
|
-
return new
|
|
16470
|
+
return new cg(t);
|
|
16487
16471
|
case "Btn":
|
|
16488
|
-
return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new
|
|
16472
|
+
return t.data.radioButton ? new Ml(t) : t.data.checkBox ? new dg(t) : new fg(t);
|
|
16489
16473
|
case "Ch":
|
|
16490
|
-
return new
|
|
16474
|
+
return new gg(t);
|
|
16491
16475
|
case "Sig":
|
|
16492
|
-
return new
|
|
16476
|
+
return new ug(t);
|
|
16493
16477
|
}
|
|
16494
16478
|
return new ps(t);
|
|
16495
16479
|
case yt.POPUP:
|
|
@@ -16497,31 +16481,31 @@ class lg {
|
|
|
16497
16481
|
case yt.FREETEXT:
|
|
16498
16482
|
return new Pl(t);
|
|
16499
16483
|
case yt.LINE:
|
|
16500
|
-
return new
|
|
16484
|
+
return new mg(t);
|
|
16501
16485
|
case yt.SQUARE:
|
|
16502
|
-
return new
|
|
16486
|
+
return new bg(t);
|
|
16503
16487
|
case yt.CIRCLE:
|
|
16504
|
-
return new
|
|
16488
|
+
return new vg(t);
|
|
16505
16489
|
case yt.POLYLINE:
|
|
16506
16490
|
return new Ol(t);
|
|
16507
16491
|
case yt.CARET:
|
|
16508
|
-
return new
|
|
16492
|
+
return new _g(t);
|
|
16509
16493
|
case yt.INK:
|
|
16510
16494
|
return new xo(t);
|
|
16511
16495
|
case yt.POLYGON:
|
|
16512
|
-
return new
|
|
16496
|
+
return new yg(t);
|
|
16513
16497
|
case yt.HIGHLIGHT:
|
|
16514
16498
|
return new Dl(t);
|
|
16515
16499
|
case yt.UNDERLINE:
|
|
16516
|
-
return new
|
|
16500
|
+
return new wg(t);
|
|
16517
16501
|
case yt.SQUIGGLY:
|
|
16518
|
-
return new
|
|
16502
|
+
return new xg(t);
|
|
16519
16503
|
case yt.STRIKEOUT:
|
|
16520
|
-
return new
|
|
16504
|
+
return new Sg(t);
|
|
16521
16505
|
case yt.STAMP:
|
|
16522
|
-
return new
|
|
16506
|
+
return new Rl(t);
|
|
16523
16507
|
case yt.FILEATTACHMENT:
|
|
16524
|
-
return new
|
|
16508
|
+
return new Cg(t);
|
|
16525
16509
|
default:
|
|
16526
16510
|
return new ft(t);
|
|
16527
16511
|
}
|
|
@@ -16799,8 +16783,8 @@ class ft {
|
|
|
16799
16783
|
const f = c.createElement("clipPath"), g = `clippath_${this.data.id}`;
|
|
16800
16784
|
f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), d.append(f);
|
|
16801
16785
|
for (let p = 2, b = t.length; p < b; p += 8) {
|
|
16802
|
-
const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h,
|
|
16803
|
-
S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height",
|
|
16786
|
+
const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h, P = (v - _) / l;
|
|
16787
|
+
S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height", P), f.append(S), o?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${T}" width="${E}" height="${P}"/>`);
|
|
16804
16788
|
}
|
|
16805
16789
|
this.#e && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${g})`;
|
|
16806
16790
|
}
|
|
@@ -17026,7 +17010,7 @@ class kl extends ft {
|
|
|
17026
17010
|
};
|
|
17027
17011
|
}
|
|
17028
17012
|
}
|
|
17029
|
-
class
|
|
17013
|
+
class lg extends ft {
|
|
17030
17014
|
constructor(t) {
|
|
17031
17015
|
super(t, {
|
|
17032
17016
|
isRenderable: !0
|
|
@@ -17095,7 +17079,7 @@ class ps extends ft {
|
|
|
17095
17079
|
_setTextStyle(t) {
|
|
17096
17080
|
const e = ["left", "center", "right"], {
|
|
17097
17081
|
fontColor: s
|
|
17098
|
-
} = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize ||
|
|
17082
|
+
} = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || ag, n = t.style;
|
|
17099
17083
|
let r;
|
|
17100
17084
|
const o = 2, h = (l) => Math.round(10 * l) / 10;
|
|
17101
17085
|
if (this.data.multiLine) {
|
|
@@ -17111,7 +17095,7 @@ class ps extends ft {
|
|
|
17111
17095
|
e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
|
|
17112
17096
|
}
|
|
17113
17097
|
}
|
|
17114
|
-
class
|
|
17098
|
+
class cg extends ps {
|
|
17115
17099
|
constructor(t) {
|
|
17116
17100
|
const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
|
|
17117
17101
|
super(t, {
|
|
@@ -17311,14 +17295,14 @@ class ug extends ps {
|
|
|
17311
17295
|
return this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
|
|
17312
17296
|
}
|
|
17313
17297
|
}
|
|
17314
|
-
class
|
|
17298
|
+
class ug extends ps {
|
|
17315
17299
|
constructor(t) {
|
|
17316
17300
|
super(t, {
|
|
17317
17301
|
isRenderable: !!t.data.hasOwnCanvas
|
|
17318
17302
|
});
|
|
17319
17303
|
}
|
|
17320
17304
|
}
|
|
17321
|
-
class
|
|
17305
|
+
class dg extends ps {
|
|
17322
17306
|
constructor(t) {
|
|
17323
17307
|
super(t, {
|
|
17324
17308
|
isRenderable: t.renderForms
|
|
@@ -17417,7 +17401,7 @@ class Ml extends ps {
|
|
|
17417
17401
|
return this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
|
|
17418
17402
|
}
|
|
17419
17403
|
}
|
|
17420
|
-
class
|
|
17404
|
+
class fg extends kl {
|
|
17421
17405
|
constructor(t) {
|
|
17422
17406
|
super(t, {
|
|
17423
17407
|
ignoreBorder: t.data.hasAppearance
|
|
@@ -17432,7 +17416,7 @@ class gg extends kl {
|
|
|
17432
17416
|
})), t;
|
|
17433
17417
|
}
|
|
17434
17418
|
}
|
|
17435
|
-
class
|
|
17419
|
+
class gg extends ps {
|
|
17436
17420
|
constructor(t) {
|
|
17437
17421
|
super(t, {
|
|
17438
17422
|
isRenderable: t.renderForms
|
|
@@ -17583,7 +17567,7 @@ class Fr extends ft {
|
|
|
17583
17567
|
}
|
|
17584
17568
|
render() {
|
|
17585
17569
|
this.container.classList.add("popupAnnotation");
|
|
17586
|
-
const t = this.popup = new
|
|
17570
|
+
const t = this.popup = new pg({
|
|
17587
17571
|
container: this.container,
|
|
17588
17572
|
color: this.data.color,
|
|
17589
17573
|
titleObj: this.data.titleObj,
|
|
@@ -17601,7 +17585,7 @@ class Fr extends ft {
|
|
|
17601
17585
|
return this.container.setAttribute("aria-controls", e.map((s) => `${co}${s}`).join(",")), this.container;
|
|
17602
17586
|
}
|
|
17603
17587
|
}
|
|
17604
|
-
class
|
|
17588
|
+
class pg {
|
|
17605
17589
|
#t = this.#E.bind(this);
|
|
17606
17590
|
#e = this.#T.bind(this);
|
|
17607
17591
|
#s = this.#k.bind(this);
|
|
@@ -17811,7 +17795,7 @@ class Pl extends ft {
|
|
|
17811
17795
|
return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
|
|
17812
17796
|
}
|
|
17813
17797
|
}
|
|
17814
|
-
class
|
|
17798
|
+
class mg extends ft {
|
|
17815
17799
|
#t = null;
|
|
17816
17800
|
constructor(t) {
|
|
17817
17801
|
super(t, {
|
|
@@ -17834,7 +17818,7 @@ class bg extends ft {
|
|
|
17834
17818
|
this.container.classList.add("highlightArea");
|
|
17835
17819
|
}
|
|
17836
17820
|
}
|
|
17837
|
-
class
|
|
17821
|
+
class bg extends ft {
|
|
17838
17822
|
#t = null;
|
|
17839
17823
|
constructor(t) {
|
|
17840
17824
|
super(t, {
|
|
@@ -17857,7 +17841,7 @@ class vg extends ft {
|
|
|
17857
17841
|
this.container.classList.add("highlightArea");
|
|
17858
17842
|
}
|
|
17859
17843
|
}
|
|
17860
|
-
class
|
|
17844
|
+
class vg extends ft {
|
|
17861
17845
|
#t = null;
|
|
17862
17846
|
constructor(t) {
|
|
17863
17847
|
super(t, {
|
|
@@ -17920,12 +17904,12 @@ class Ol extends ft {
|
|
|
17920
17904
|
this.container.classList.add("highlightArea");
|
|
17921
17905
|
}
|
|
17922
17906
|
}
|
|
17923
|
-
class
|
|
17907
|
+
class yg extends Ol {
|
|
17924
17908
|
constructor(t) {
|
|
17925
17909
|
super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
|
|
17926
17910
|
}
|
|
17927
17911
|
}
|
|
17928
|
-
class
|
|
17912
|
+
class _g extends ft {
|
|
17929
17913
|
constructor(t) {
|
|
17930
17914
|
super(t, {
|
|
17931
17915
|
isRenderable: !0,
|
|
@@ -18033,7 +18017,7 @@ class Dl extends ft {
|
|
|
18033
18017
|
return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
|
|
18034
18018
|
}
|
|
18035
18019
|
}
|
|
18036
|
-
class
|
|
18020
|
+
class wg extends ft {
|
|
18037
18021
|
constructor(t) {
|
|
18038
18022
|
super(t, {
|
|
18039
18023
|
isRenderable: !0,
|
|
@@ -18045,7 +18029,7 @@ class xg extends ft {
|
|
|
18045
18029
|
return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
|
|
18046
18030
|
}
|
|
18047
18031
|
}
|
|
18048
|
-
class
|
|
18032
|
+
class xg extends ft {
|
|
18049
18033
|
constructor(t) {
|
|
18050
18034
|
super(t, {
|
|
18051
18035
|
isRenderable: !0,
|
|
@@ -18057,7 +18041,7 @@ class Sg extends ft {
|
|
|
18057
18041
|
return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
|
|
18058
18042
|
}
|
|
18059
18043
|
}
|
|
18060
|
-
class
|
|
18044
|
+
class Sg extends ft {
|
|
18061
18045
|
constructor(t) {
|
|
18062
18046
|
super(t, {
|
|
18063
18047
|
isRenderable: !0,
|
|
@@ -18069,7 +18053,7 @@ class Cg extends ft {
|
|
|
18069
18053
|
return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
|
|
18070
18054
|
}
|
|
18071
18055
|
}
|
|
18072
|
-
class
|
|
18056
|
+
class Rl extends ft {
|
|
18073
18057
|
constructor(t) {
|
|
18074
18058
|
super(t, {
|
|
18075
18059
|
isRenderable: !0,
|
|
@@ -18080,7 +18064,7 @@ class Ll extends ft {
|
|
|
18080
18064
|
return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
|
|
18081
18065
|
}
|
|
18082
18066
|
}
|
|
18083
|
-
class
|
|
18067
|
+
class Cg extends ft {
|
|
18084
18068
|
#t = null;
|
|
18085
18069
|
constructor(t) {
|
|
18086
18070
|
super(t, {
|
|
@@ -18119,7 +18103,7 @@ class Ag extends ft {
|
|
|
18119
18103
|
this.downloadManager?.openOrDownloadData(this.content, this.filename);
|
|
18120
18104
|
}
|
|
18121
18105
|
}
|
|
18122
|
-
class
|
|
18106
|
+
class Ag {
|
|
18123
18107
|
#t = null;
|
|
18124
18108
|
#e = null;
|
|
18125
18109
|
#s = /* @__PURE__ */ new Map();
|
|
@@ -18183,7 +18167,7 @@ class Tg {
|
|
|
18183
18167
|
continue;
|
|
18184
18168
|
}
|
|
18185
18169
|
n.data = r;
|
|
18186
|
-
const h =
|
|
18170
|
+
const h = hg.create(n);
|
|
18187
18171
|
if (!h.isRenderable)
|
|
18188
18172
|
continue;
|
|
18189
18173
|
if (!o && r.popupRef) {
|
|
@@ -18801,7 +18785,7 @@ class ss {
|
|
|
18801
18785
|
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}`);
|
|
18802
18786
|
}
|
|
18803
18787
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
18804
|
-
return new
|
|
18788
|
+
return new Ll(t, e, s, i, n, r);
|
|
18805
18789
|
}
|
|
18806
18790
|
getOutlines() {
|
|
18807
18791
|
const t = this.#r, e = this.#e, s = this.#n, [i, n, r, o] = this.#t, h = new Float32Array((this.#f?.length ?? 0) + 2);
|
|
@@ -18842,7 +18826,7 @@ class ss {
|
|
|
18842
18826
|
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;
|
|
18843
18827
|
}
|
|
18844
18828
|
}
|
|
18845
|
-
class
|
|
18829
|
+
class Ll extends I {
|
|
18846
18830
|
#t;
|
|
18847
18831
|
#e = new Float32Array(4);
|
|
18848
18832
|
#s;
|
|
@@ -18940,8 +18924,8 @@ class Ir {
|
|
|
18940
18924
|
width: v,
|
|
18941
18925
|
height: y
|
|
18942
18926
|
} of t) {
|
|
18943
|
-
const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0],
|
|
18944
|
-
this.#s.push(E,
|
|
18927
|
+
const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0], P = [S, A, T, !1];
|
|
18928
|
+
this.#s.push(E, P), n = Math.min(n, _), r = Math.max(r, S), o = Math.min(o, A), h = Math.max(h, T);
|
|
18945
18929
|
}
|
|
18946
18930
|
const c = r - n + 2 * s, u = h - o + 2 * s, d = n - s, f = o - s, g = this.#s.at(i ? -1 : -2), p = [g[0], g[2]];
|
|
18947
18931
|
for (const b of this.#s) {
|
|
@@ -18987,7 +18971,7 @@ class Ir {
|
|
|
18987
18971
|
}
|
|
18988
18972
|
n.push(d, f);
|
|
18989
18973
|
}
|
|
18990
|
-
return new
|
|
18974
|
+
return new Tg(i, this.#t, this.#e);
|
|
18991
18975
|
}
|
|
18992
18976
|
#n(t) {
|
|
18993
18977
|
const e = this.#i;
|
|
@@ -19049,7 +19033,7 @@ class Ir {
|
|
|
19049
19033
|
return n;
|
|
19050
19034
|
}
|
|
19051
19035
|
}
|
|
19052
|
-
class
|
|
19036
|
+
class Tg extends I {
|
|
19053
19037
|
#t;
|
|
19054
19038
|
#e;
|
|
19055
19039
|
constructor(t, e, s) {
|
|
@@ -19087,10 +19071,10 @@ class Eg extends I {
|
|
|
19087
19071
|
}
|
|
19088
19072
|
class Nr extends ss {
|
|
19089
19073
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
19090
|
-
return new
|
|
19074
|
+
return new Eg(t, e, s, i, n, r);
|
|
19091
19075
|
}
|
|
19092
19076
|
}
|
|
19093
|
-
class
|
|
19077
|
+
class Eg extends Ll {
|
|
19094
19078
|
newOutliner(t, e, s, i, n, r = 0) {
|
|
19095
19079
|
return new Nr(t, e, s, i, n, r);
|
|
19096
19080
|
}
|
|
@@ -19645,7 +19629,7 @@ class ct extends z {
|
|
|
19645
19629
|
#O() {
|
|
19646
19630
|
return this.#u ? this.rotation : 0;
|
|
19647
19631
|
}
|
|
19648
|
-
#
|
|
19632
|
+
#L() {
|
|
19649
19633
|
if (this.#u)
|
|
19650
19634
|
return null;
|
|
19651
19635
|
const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#s, r = new Float32Array(n.length * 8);
|
|
@@ -19853,16 +19837,16 @@ class ct extends z {
|
|
|
19853
19837
|
color: s,
|
|
19854
19838
|
opacity: this.#o,
|
|
19855
19839
|
thickness: this.#p,
|
|
19856
|
-
quadPoints: this.#
|
|
19840
|
+
quadPoints: this.#L(),
|
|
19857
19841
|
outlines: this.#I(e),
|
|
19858
19842
|
pageIndex: this.pageIndex,
|
|
19859
19843
|
rect: e,
|
|
19860
19844
|
rotation: this.#O(),
|
|
19861
19845
|
structTreeParentId: this._structTreeParentId
|
|
19862
19846
|
};
|
|
19863
|
-
return this.annotationElementId && !this.#
|
|
19847
|
+
return this.annotationElementId && !this.#R(i) ? null : (i.id = this.annotationElementId, i);
|
|
19864
19848
|
}
|
|
19865
|
-
#
|
|
19849
|
+
#R(t) {
|
|
19866
19850
|
const {
|
|
19867
19851
|
color: e
|
|
19868
19852
|
} = this._initialData;
|
|
@@ -19877,7 +19861,7 @@ class ct extends z {
|
|
|
19877
19861
|
return !1;
|
|
19878
19862
|
}
|
|
19879
19863
|
}
|
|
19880
|
-
class
|
|
19864
|
+
class kg {
|
|
19881
19865
|
#t = /* @__PURE__ */ Object.create(null);
|
|
19882
19866
|
updateProperty(t, e) {
|
|
19883
19867
|
this[t] = e, this.updateSVGProperty(t, e);
|
|
@@ -20317,7 +20301,7 @@ class H extends z {
|
|
|
20317
20301
|
return !1;
|
|
20318
20302
|
}
|
|
20319
20303
|
}
|
|
20320
|
-
class
|
|
20304
|
+
class Mg {
|
|
20321
20305
|
#t = new Float64Array(6);
|
|
20322
20306
|
#e;
|
|
20323
20307
|
#s;
|
|
@@ -20559,8 +20543,8 @@ class Vn extends I {
|
|
|
20559
20543
|
let [_, S, A, T] = m.subarray(0, 4);
|
|
20560
20544
|
y.set([NaN, NaN, NaN, NaN, _, S], 0);
|
|
20561
20545
|
for (let E = 4; E < v; E += 2) {
|
|
20562
|
-
const
|
|
20563
|
-
y.set(I.createBezierPoints(_, S, A, T,
|
|
20546
|
+
const P = m[E], N = m[E + 1];
|
|
20547
|
+
y.set(I.createBezierPoints(_, S, A, T, P, N), (E - 2) * 3), [_, S, A, T] = [A, T, P, N];
|
|
20564
20548
|
}
|
|
20565
20549
|
}
|
|
20566
20550
|
}
|
|
@@ -20761,7 +20745,7 @@ class Vn extends I {
|
|
|
20761
20745
|
};
|
|
20762
20746
|
}
|
|
20763
20747
|
}
|
|
20764
|
-
class So extends
|
|
20748
|
+
class So extends kg {
|
|
20765
20749
|
#t;
|
|
20766
20750
|
constructor(t) {
|
|
20767
20751
|
super(), this.#t = t, super.updateProperties({
|
|
@@ -20806,7 +20790,7 @@ class Co extends H {
|
|
|
20806
20790
|
return Y(this, "typesMap", /* @__PURE__ */ new Map([[$.INK_THICKNESS, "stroke-width"], [$.INK_COLOR, "stroke"], [$.INK_OPACITY, "stroke-opacity"]]));
|
|
20807
20791
|
}
|
|
20808
20792
|
static createDrawerInstance(t, e, s, i, n) {
|
|
20809
|
-
return new
|
|
20793
|
+
return new Mg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
|
|
20810
20794
|
}
|
|
20811
20795
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
20812
20796
|
return Vn.deserialize(t, e, s, i, n, r);
|
|
@@ -21243,14 +21227,14 @@ class Ao extends z {
|
|
|
21243
21227
|
} = this.#t, e.getContext("2d").drawImage(this.#t, 0, 0), e.toDataURL();
|
|
21244
21228
|
}
|
|
21245
21229
|
if (this.#c) {
|
|
21246
|
-
const [e, s] = this.pageDimensions, i = Math.round(this.width * e *
|
|
21230
|
+
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);
|
|
21247
21231
|
return r.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, i, n), r.transferToImageBitmap();
|
|
21248
21232
|
}
|
|
21249
21233
|
return structuredClone(this.#t);
|
|
21250
21234
|
}
|
|
21251
21235
|
static async deserialize(t, e, s) {
|
|
21252
21236
|
let i = null;
|
|
21253
|
-
if (t instanceof
|
|
21237
|
+
if (t instanceof Rl) {
|
|
21254
21238
|
const {
|
|
21255
21239
|
data: {
|
|
21256
21240
|
rect: g,
|
|
@@ -21936,7 +21920,7 @@ V.ColorPicker;
|
|
|
21936
21920
|
V.DOMSVGFactory;
|
|
21937
21921
|
V.DrawLayer;
|
|
21938
21922
|
V.FeatureTest;
|
|
21939
|
-
var
|
|
21923
|
+
var Pg = V.GlobalWorkerOptions;
|
|
21940
21924
|
V.ImageKind;
|
|
21941
21925
|
V.InvalidPDFException;
|
|
21942
21926
|
V.MissingPDFException;
|
|
@@ -21958,7 +21942,7 @@ V.XfaLayer;
|
|
|
21958
21942
|
V.build;
|
|
21959
21943
|
V.createValidAbsoluteUrl;
|
|
21960
21944
|
V.fetchData;
|
|
21961
|
-
var
|
|
21945
|
+
var Og = V.getDocument;
|
|
21962
21946
|
V.getFilenameFromUrl;
|
|
21963
21947
|
V.getPdfFilenameFromUrl;
|
|
21964
21948
|
V.getXfaPageViewport;
|
|
@@ -21969,7 +21953,7 @@ V.normalizeUnicode;
|
|
|
21969
21953
|
V.setLayerDimensions;
|
|
21970
21954
|
V.shadow;
|
|
21971
21955
|
V.stopEvent;
|
|
21972
|
-
var
|
|
21956
|
+
var Dg = V.version;
|
|
21973
21957
|
let ja = null;
|
|
21974
21958
|
function Rg() {
|
|
21975
21959
|
const a = document.createElement("div");
|
|
@@ -21977,11 +21961,11 @@ function Rg() {
|
|
|
21977
21961
|
const t = a.offsetWidth;
|
|
21978
21962
|
return a.remove(), t;
|
|
21979
21963
|
}
|
|
21980
|
-
function
|
|
21964
|
+
function Lg() {
|
|
21981
21965
|
const a = ja ?? Rg();
|
|
21982
21966
|
return ja = a, a / 72;
|
|
21983
21967
|
}
|
|
21984
|
-
function
|
|
21968
|
+
function Fg(a, t = 500) {
|
|
21985
21969
|
if (typeof a != "function") throw new TypeError("The first argument is not a function.");
|
|
21986
21970
|
let e = null;
|
|
21987
21971
|
return function(...s) {
|
|
@@ -21990,28 +21974,28 @@ function Ig(a, t = 500) {
|
|
|
21990
21974
|
}, t);
|
|
21991
21975
|
};
|
|
21992
21976
|
}
|
|
21993
|
-
function
|
|
21977
|
+
function Ig(a) {
|
|
21994
21978
|
return new Promise((t, e) => {
|
|
21995
21979
|
const s = new FileReader();
|
|
21996
|
-
s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.
|
|
21980
|
+
s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsArrayBuffer(a);
|
|
21997
21981
|
});
|
|
21998
21982
|
}
|
|
21999
|
-
|
|
22000
|
-
async function
|
|
22001
|
-
const t =
|
|
22002
|
-
if (
|
|
22003
|
-
return
|
|
21983
|
+
Il() || (Pg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Dg}/pdf.worker.min.mjs`);
|
|
21984
|
+
async function Fl(a) {
|
|
21985
|
+
const t = await Ig(a);
|
|
21986
|
+
if (t instanceof ArrayBuffer)
|
|
21987
|
+
return t;
|
|
22004
21988
|
}
|
|
22005
|
-
function
|
|
21989
|
+
function Il() {
|
|
22006
21990
|
try {
|
|
22007
21991
|
return typeof OffscreenCanvas < "u" && typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.prototype.transferControlToOffscreen == "function";
|
|
22008
21992
|
} catch {
|
|
22009
21993
|
return !1;
|
|
22010
21994
|
}
|
|
22011
21995
|
}
|
|
22012
|
-
async function
|
|
22013
|
-
const n =
|
|
22014
|
-
if (
|
|
21996
|
+
async function Ng({ page: a, data: t, scale: e, password: s }, i) {
|
|
21997
|
+
const n = Lg() / window.devicePixelRatio;
|
|
21998
|
+
if (Il()) {
|
|
22015
21999
|
const r = new Worker(new URL(
|
|
22016
22000
|
/* @vite-ignore */
|
|
22017
22001
|
"" + new URL("assets/pdfjs.worker-DawqtvLM.js", import.meta.url).href,
|
|
@@ -22028,7 +22012,7 @@ async function Bg({ page: a, PDFBase64: t, scale: e, password: s }, i) {
|
|
|
22028
22012
|
});
|
|
22029
22013
|
});
|
|
22030
22014
|
} else {
|
|
22031
|
-
const r = await
|
|
22015
|
+
const r = await Og({ data: t, password: s }).promise, o = r.numPages;
|
|
22032
22016
|
if (!i) return { canvas: null, pages: o };
|
|
22033
22017
|
const h = await r.getPage(a), l = h.getViewport({ scale: e }), c = document.createElement("canvas"), d = {
|
|
22034
22018
|
canvasContext: c.getContext("2d"),
|
|
@@ -22039,73 +22023,77 @@ async function Bg({ page: a, PDFBase64: t, scale: e, password: s }, i) {
|
|
|
22039
22023
|
}
|
|
22040
22024
|
}
|
|
22041
22025
|
const Ft = /* @__PURE__ */ new Map();
|
|
22042
|
-
function
|
|
22026
|
+
function jg(a) {
|
|
22043
22027
|
const t = new Er(a);
|
|
22044
22028
|
return Ft.set(a, t), t;
|
|
22045
22029
|
}
|
|
22046
|
-
function
|
|
22030
|
+
function Bg(a, t) {
|
|
22047
22031
|
const e = Date.now();
|
|
22048
22032
|
return {
|
|
22049
22033
|
PDFId: `${a.name}-${e}`,
|
|
22050
22034
|
name: a.name.replace(/.pdf/, ""),
|
|
22051
22035
|
updateDate: e,
|
|
22052
|
-
|
|
22036
|
+
data: t,
|
|
22037
|
+
type: a.type
|
|
22053
22038
|
};
|
|
22054
22039
|
}
|
|
22055
|
-
async function
|
|
22040
|
+
async function Hg({ src: a }, t, e) {
|
|
22056
22041
|
if (!a || !e) return null;
|
|
22057
|
-
const { objects: s, options: i } = await
|
|
22042
|
+
const { objects: s, options: i } = await yd(a), n = s.filter((o) => o !== null), r = Iu.groupSVGElements(n, i);
|
|
22058
22043
|
return n.forEach((o) => {
|
|
22059
22044
|
o.stroke = e;
|
|
22060
22045
|
}), r.hoverCursor = "pointer", r.stroke = `${e}-${t}`, r;
|
|
22061
22046
|
}
|
|
22062
|
-
function
|
|
22047
|
+
function zg(a, t) {
|
|
22063
22048
|
if (!Ft.get(a)) return;
|
|
22064
|
-
const s = 1 / 3, i =
|
|
22065
|
-
|
|
22049
|
+
const s = 1 / 3, i = $g(t, s);
|
|
22050
|
+
jl(a, i, s);
|
|
22066
22051
|
}
|
|
22067
|
-
async function
|
|
22068
|
-
const e = await
|
|
22069
|
-
|
|
22052
|
+
async function Gg(a, t) {
|
|
22053
|
+
const e = await Fl(a);
|
|
22054
|
+
if (!e) return;
|
|
22055
|
+
const s = Date.now(), n = {
|
|
22056
|
+
PDFId: `${a.name}-${s}`,
|
|
22070
22057
|
name: a.name.replace(/.png|.jpg|.jpeg/, ""),
|
|
22071
22058
|
updateDate: s,
|
|
22072
|
-
|
|
22059
|
+
data: e,
|
|
22060
|
+
type: a.type
|
|
22073
22061
|
};
|
|
22074
|
-
return t &&
|
|
22062
|
+
return t && Nl(t, { data: e, type: a.type }), { ...n, pages: 1 };
|
|
22075
22063
|
}
|
|
22076
|
-
async function
|
|
22064
|
+
async function Nl(a, { data: t, type: e, scale: s = 0.5 }) {
|
|
22077
22065
|
if (!Ft.get(a)) return;
|
|
22078
|
-
const
|
|
22079
|
-
|
|
22066
|
+
const n = new Blob([t], { type: e }), r = URL.createObjectURL(n), o = await Tt.fromURL(r);
|
|
22067
|
+
o.scale(s), jl(a, o, s), URL.revokeObjectURL(r);
|
|
22080
22068
|
}
|
|
22081
|
-
function
|
|
22069
|
+
function jl(a, t, e) {
|
|
22082
22070
|
const s = Ft.get(a);
|
|
22083
22071
|
s && (s.setWidth(t.width * e), s.setHeight(t.height * e), s.backgroundImage = t, s.renderAll());
|
|
22084
22072
|
}
|
|
22085
|
-
function
|
|
22073
|
+
function Vg(a, t) {
|
|
22086
22074
|
if (!t) return;
|
|
22087
22075
|
const { oCoords: e } = a;
|
|
22088
22076
|
if (!e) return;
|
|
22089
22077
|
const { x: s, y: i } = e.tl.touchCorner.tl, { height: n, width: r, scaleY: o, scaleX: h } = t;
|
|
22090
22078
|
t.top = i - n * o / 2, t.left = s - r * h / 2, t.setCoords();
|
|
22091
22079
|
}
|
|
22092
|
-
function
|
|
22093
|
-
!e || !a || (e.scale(1 / t),
|
|
22080
|
+
function Xg(a, t, e) {
|
|
22081
|
+
!e || !a || (e.scale(1 / t), Vg(a, e));
|
|
22094
22082
|
}
|
|
22095
|
-
function
|
|
22083
|
+
function Wg(a, t) {
|
|
22096
22084
|
if (!a) return;
|
|
22097
22085
|
const e = a._cornerSize || 6;
|
|
22098
22086
|
a.borderScaleFactor = 1 / t, a.cornerSize = e * (1 / t), a.touchCornerSize = e * 4 * (1 / t), a.setCoords();
|
|
22099
22087
|
}
|
|
22100
|
-
function
|
|
22088
|
+
function Ug(a) {
|
|
22101
22089
|
const t = Ft.get(a);
|
|
22102
22090
|
t && (t.discardActiveObject(), t.renderAll());
|
|
22103
22091
|
}
|
|
22104
|
-
function
|
|
22092
|
+
function Yg(a) {
|
|
22105
22093
|
const t = Ft.get(a);
|
|
22106
22094
|
t && (t.clear(), Ft.delete(a));
|
|
22107
22095
|
}
|
|
22108
|
-
function
|
|
22096
|
+
function $g(a, t) {
|
|
22109
22097
|
return new Tt(a, { scaleX: t, scaleY: t });
|
|
22110
22098
|
}
|
|
22111
22099
|
function jr(a, t) {
|
|
@@ -22113,27 +22101,27 @@ function jr(a, t) {
|
|
|
22113
22101
|
const { left: e, top: s, scaleX: i, scaleY: n, width: r, height: o } = a, h = t.x * r * i, l = t.y * o * n;
|
|
22114
22102
|
a.set({ left: e - h, top: s - l });
|
|
22115
22103
|
}
|
|
22116
|
-
function
|
|
22104
|
+
function qg(a, t, e) {
|
|
22117
22105
|
const s = a.type;
|
|
22118
22106
|
return {
|
|
22119
|
-
"application/pdf":
|
|
22107
|
+
"application/pdf": Kg,
|
|
22120
22108
|
"image/png": Ba,
|
|
22121
22109
|
"image/jpeg": Ba
|
|
22122
22110
|
}[s]?.(a, t, e) ?? Promise.reject(new Error(`Unsupported ${s} file type.`));
|
|
22123
22111
|
}
|
|
22124
|
-
async function
|
|
22125
|
-
const s = await
|
|
22112
|
+
async function Kg(a, t, e) {
|
|
22113
|
+
const s = await Fl(a);
|
|
22126
22114
|
if (!s) return;
|
|
22127
|
-
const i =
|
|
22115
|
+
const i = Bg(a, s), n = await Bl({ page: 1, data: s, scale: 0.8, password: t }, e);
|
|
22128
22116
|
return { ...i, pages: n };
|
|
22129
22117
|
}
|
|
22130
|
-
function
|
|
22131
|
-
return
|
|
22118
|
+
function Bl(a, t) {
|
|
22119
|
+
return Ng(a, t).then(({ canvas: e, pages: s }) => (e && t && zg(t, e), s));
|
|
22132
22120
|
}
|
|
22133
22121
|
async function Ba(a, t, e) {
|
|
22134
|
-
return await
|
|
22122
|
+
return await Gg(a, e);
|
|
22135
22123
|
}
|
|
22136
|
-
function
|
|
22124
|
+
function Jg(a, t) {
|
|
22137
22125
|
const e = Ft.get(a);
|
|
22138
22126
|
if (!e) return;
|
|
22139
22127
|
const s = e.getActiveObject();
|
|
@@ -22141,17 +22129,17 @@ function Qg(a, t) {
|
|
|
22141
22129
|
i.set(t);
|
|
22142
22130
|
}) : s.set(t), e.renderAll());
|
|
22143
22131
|
}
|
|
22144
|
-
async function
|
|
22132
|
+
async function Zg(a, t) {
|
|
22145
22133
|
const e = Ft.get(a);
|
|
22146
22134
|
if (!e) return;
|
|
22147
22135
|
const s = e?.getActiveObject();
|
|
22148
22136
|
if (!s) return;
|
|
22149
|
-
const i = await s.clone(
|
|
22137
|
+
const i = await s.clone(tc);
|
|
22150
22138
|
i instanceof qt ? i.forEachObject((n) => {
|
|
22151
22139
|
e.add(n), t(e, n);
|
|
22152
22140
|
}) : (e.add(i), t(e, i)), jr(i, { x: -0.1, y: -0.1 }), e.setActiveObject(i);
|
|
22153
22141
|
}
|
|
22154
|
-
function
|
|
22142
|
+
function Qg(a) {
|
|
22155
22143
|
const t = Ft.get(a);
|
|
22156
22144
|
if (!t) return;
|
|
22157
22145
|
const e = t.getActiveObject();
|
|
@@ -22159,7 +22147,7 @@ function ep(a) {
|
|
|
22159
22147
|
t.remove(s);
|
|
22160
22148
|
}), t.discardActiveObject()) : t.remove(e));
|
|
22161
22149
|
}
|
|
22162
|
-
function
|
|
22150
|
+
function tp(a) {
|
|
22163
22151
|
const {
|
|
22164
22152
|
id: t = "",
|
|
22165
22153
|
selectionOptions: e,
|
|
@@ -22169,96 +22157,96 @@ function sp(a) {
|
|
|
22169
22157
|
selectionCreated: r,
|
|
22170
22158
|
selectionCleared: o
|
|
22171
22159
|
} = a || {};
|
|
22172
|
-
let h = null, l = null, c = 1, u = { ...
|
|
22160
|
+
let h = null, l = null, c = 1, u = { ...Ql };
|
|
22173
22161
|
function d() {
|
|
22174
22162
|
if (!t || Ft.has(t)) return;
|
|
22175
|
-
const k =
|
|
22176
|
-
return k.on("selection:created", (
|
|
22177
|
-
if (r?.(
|
|
22163
|
+
const k = jg(t);
|
|
22164
|
+
return k.on("selection:created", (O) => {
|
|
22165
|
+
if (r?.(O), O.selected.length <= 1) return;
|
|
22178
22166
|
const j = k.getActiveObject();
|
|
22179
22167
|
j && (l = j, e?.value && l.set(e.value), l._cornerSize = l.cornerSize, S(c));
|
|
22180
|
-
}), k.on("selection:cleared", (
|
|
22181
|
-
o?.(
|
|
22168
|
+
}), k.on("selection:cleared", (O) => {
|
|
22169
|
+
o?.(O), T(k);
|
|
22182
22170
|
}), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
|
|
22183
22171
|
}
|
|
22184
|
-
function f(k,
|
|
22185
|
-
return
|
|
22172
|
+
function f(k, O) {
|
|
22173
|
+
return qg(k, O, t);
|
|
22186
22174
|
}
|
|
22187
22175
|
function g(k) {
|
|
22188
|
-
return
|
|
22176
|
+
return Bl(k, t);
|
|
22189
22177
|
}
|
|
22190
|
-
function p({
|
|
22191
|
-
return
|
|
22178
|
+
function p({ data: k, type: O, scale: j = 0.5 }) {
|
|
22179
|
+
return Nl(t, { data: k, type: O, scale: j });
|
|
22192
22180
|
}
|
|
22193
|
-
async function b(k,
|
|
22181
|
+
async function b(k, O, j) {
|
|
22194
22182
|
const M = Ft.get(t);
|
|
22195
22183
|
if (!M) return;
|
|
22196
|
-
const
|
|
22197
|
-
jr(
|
|
22184
|
+
const R = await Tt.fromURL(k, {}, { ...Kl, ...O });
|
|
22185
|
+
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22198
22186
|
}
|
|
22199
|
-
function m(k,
|
|
22187
|
+
function m(k, O, j) {
|
|
22200
22188
|
const M = Ft.get(t);
|
|
22201
22189
|
if (!M) return;
|
|
22202
|
-
const
|
|
22203
|
-
...
|
|
22204
|
-
...
|
|
22190
|
+
const R = new Ct(k, {
|
|
22191
|
+
...Jl,
|
|
22192
|
+
...O
|
|
22205
22193
|
});
|
|
22206
|
-
jr(
|
|
22194
|
+
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22207
22195
|
}
|
|
22208
|
-
function v(k,
|
|
22209
|
-
|
|
22196
|
+
function v(k, O) {
|
|
22197
|
+
O.on("selected", (j) => y({ canvas: k, target: j.target })), O.on("modified", (j) => y({ canvas: k, target: j.target })), O.on("scaling", () => T(k)), O.on("moving", () => T(k)), O.on("rotating", () => T(k)), O._cornerSize = O._cornerSize ?? O.cornerSize;
|
|
22210
22198
|
}
|
|
22211
22199
|
async function y({
|
|
22212
22200
|
canvas: k,
|
|
22213
|
-
target:
|
|
22201
|
+
target: O,
|
|
22214
22202
|
stroke: j = u.stroke,
|
|
22215
22203
|
uuid: M = Date.now()
|
|
22216
22204
|
}) {
|
|
22217
22205
|
if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
|
|
22218
|
-
const G = await
|
|
22219
|
-
T(k), h = G, l =
|
|
22206
|
+
const G = await Hg(u, M, j);
|
|
22207
|
+
T(k), h = G, l = O, _(k, O, M), S(c, !0), G && k.add(G);
|
|
22220
22208
|
}
|
|
22221
|
-
function _(k,
|
|
22209
|
+
function _(k, O, j) {
|
|
22222
22210
|
h && (h.on("selected", () => {
|
|
22223
|
-
k.remove(
|
|
22211
|
+
k.remove(O), T(k);
|
|
22224
22212
|
}), h.on("mouseover", () => {
|
|
22225
22213
|
y({
|
|
22226
22214
|
canvas: k,
|
|
22227
|
-
target:
|
|
22215
|
+
target: O,
|
|
22228
22216
|
stroke: u.hoverStroke,
|
|
22229
22217
|
uuid: j
|
|
22230
22218
|
});
|
|
22231
22219
|
}), h.on("mouseout", () => {
|
|
22232
|
-
y({ canvas: k, target:
|
|
22220
|
+
y({ canvas: k, target: O, stroke: u.stroke, uuid: j });
|
|
22233
22221
|
}));
|
|
22234
22222
|
}
|
|
22235
|
-
function S(k,
|
|
22223
|
+
function S(k, O = !1) {
|
|
22236
22224
|
const j = Ft.get(t);
|
|
22237
|
-
c = k, j && (
|
|
22225
|
+
c = k, j && (Wg(l, k), Xg(l, k, h), !O && j.renderAll());
|
|
22238
22226
|
}
|
|
22239
22227
|
function A(k) {
|
|
22240
22228
|
if (!k) return;
|
|
22241
22229
|
u = { ...u, ...k };
|
|
22242
|
-
const
|
|
22243
|
-
!h || !l || !
|
|
22230
|
+
const O = Ft.get(t);
|
|
22231
|
+
!h || !l || !O || y({ target: l, canvas: O });
|
|
22244
22232
|
}
|
|
22245
22233
|
function T(k) {
|
|
22246
22234
|
l = null, h && (k.remove(h), h = null);
|
|
22247
22235
|
}
|
|
22248
22236
|
function E() {
|
|
22249
|
-
|
|
22237
|
+
Ug(t);
|
|
22250
22238
|
}
|
|
22251
|
-
function
|
|
22252
|
-
|
|
22239
|
+
function P() {
|
|
22240
|
+
Yg(t);
|
|
22253
22241
|
}
|
|
22254
22242
|
function N(k) {
|
|
22255
|
-
|
|
22243
|
+
Jg(t, k);
|
|
22256
22244
|
}
|
|
22257
22245
|
function D() {
|
|
22258
|
-
return
|
|
22246
|
+
return Zg(t, v);
|
|
22259
22247
|
}
|
|
22260
|
-
function
|
|
22261
|
-
|
|
22248
|
+
function L() {
|
|
22249
|
+
Qg(t);
|
|
22262
22250
|
}
|
|
22263
22251
|
return {
|
|
22264
22252
|
createCanvas: d,
|
|
@@ -22268,26 +22256,26 @@ function sp(a) {
|
|
|
22268
22256
|
addFabric: b,
|
|
22269
22257
|
addTextFabric: m,
|
|
22270
22258
|
clearActive: E,
|
|
22271
|
-
deleteCanvas:
|
|
22259
|
+
deleteCanvas: P,
|
|
22272
22260
|
scaleFabric: S,
|
|
22273
22261
|
setCloseSvgOptions: A,
|
|
22274
22262
|
setActiveFabric: N,
|
|
22275
22263
|
copyActiveFabric: D,
|
|
22276
|
-
deleteActiveFabric:
|
|
22264
|
+
deleteActiveFabric: L
|
|
22277
22265
|
};
|
|
22278
22266
|
}
|
|
22279
|
-
function
|
|
22267
|
+
function ep(a) {
|
|
22280
22268
|
let t = 0;
|
|
22281
|
-
const e =
|
|
22269
|
+
const e = Fg(() => {
|
|
22282
22270
|
t !== window.innerWidth && (t = window.innerWidth, a());
|
|
22283
22271
|
});
|
|
22284
|
-
|
|
22272
|
+
Hl(() => {
|
|
22285
22273
|
window.addEventListener("resize", e);
|
|
22286
22274
|
}), Ha(() => {
|
|
22287
22275
|
window.removeEventListener("resize", e);
|
|
22288
22276
|
});
|
|
22289
22277
|
}
|
|
22290
|
-
const
|
|
22278
|
+
const np = /* @__PURE__ */ zl({
|
|
22291
22279
|
__name: "pdf-canvas",
|
|
22292
22280
|
props: {
|
|
22293
22281
|
file: {},
|
|
@@ -22308,7 +22296,7 @@ const op = /* @__PURE__ */ Hl({
|
|
|
22308
22296
|
},
|
|
22309
22297
|
emits: ["loaded", "reload", "pointerDown", "pointerMove", "pointerUp", "selectionCreated", "selectionCleared"],
|
|
22310
22298
|
setup(a, { expose: t, emit: e }) {
|
|
22311
|
-
const s = a, i = e, { onDestroy: n } = s, r =
|
|
22299
|
+
const s = a, i = e, { onDestroy: n } = s, r = Gl(null), o = `${s.canvasId}-${s.page - 1}`, h = ko(() => s.fileZoom * s.canvasScale), l = ko(() => ({ ...Zl, ...s.selectionOptions })), {
|
|
22312
22300
|
createCanvas: c,
|
|
22313
22301
|
specifyPage: u,
|
|
22314
22302
|
addFabric: d,
|
|
@@ -22321,7 +22309,7 @@ const op = /* @__PURE__ */ Hl({
|
|
|
22321
22309
|
setCloseSvgOptions: y,
|
|
22322
22310
|
copyActiveFabric: _,
|
|
22323
22311
|
deleteActiveFabric: S
|
|
22324
|
-
} =
|
|
22312
|
+
} = tp({
|
|
22325
22313
|
id: o,
|
|
22326
22314
|
selectionOptions: l,
|
|
22327
22315
|
pointerDown: (D) => i("pointerDown", D),
|
|
@@ -22330,18 +22318,17 @@ const op = /* @__PURE__ */ Hl({
|
|
|
22330
22318
|
selectionCreated: (D) => i("selectionCreated", D),
|
|
22331
22319
|
selectionCleared: (D) => i("selectionCleared", D)
|
|
22332
22320
|
});
|
|
22333
|
-
A(),
|
|
22321
|
+
A(), ep(N);
|
|
22334
22322
|
async function A() {
|
|
22335
|
-
const { file: D, page:
|
|
22323
|
+
const { file: D, page: L, fileScale: k } = s;
|
|
22336
22324
|
globalThis.requestAnimationFrame(async () => {
|
|
22337
|
-
if (await
|
|
22338
|
-
|
|
22339
|
-
g({ url: M, scale: k / j }), i("loaded");
|
|
22325
|
+
if (await Vl(), c(), D.type.startsWith("image/")) {
|
|
22326
|
+
g({ data: D.data, scale: k / 3, type: D.type }), i("loaded");
|
|
22340
22327
|
return;
|
|
22341
22328
|
}
|
|
22342
22329
|
await u({
|
|
22343
|
-
page:
|
|
22344
|
-
|
|
22330
|
+
page: L,
|
|
22331
|
+
data: D.canvas?.[L - 1] ?? D.data,
|
|
22345
22332
|
scale: k,
|
|
22346
22333
|
password: s.password
|
|
22347
22334
|
}), i("loaded");
|
|
@@ -22349,14 +22336,14 @@ const op = /* @__PURE__ */ Hl({
|
|
|
22349
22336
|
}
|
|
22350
22337
|
function T(D) {
|
|
22351
22338
|
if (!s.isDrop || !D.dataTransfer) return;
|
|
22352
|
-
const { dataTransfer:
|
|
22353
|
-
M ? E(M, it, at) : j &&
|
|
22339
|
+
const { dataTransfer: L, offsetX: k, offsetY: O } = 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: O, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
|
|
22340
|
+
M ? E(M, it, at) : j && P(j, it, at);
|
|
22354
22341
|
}
|
|
22355
|
-
function E(D,
|
|
22356
|
-
d(D, { ...s.dropImageOptions, ...
|
|
22342
|
+
function E(D, L, k) {
|
|
22343
|
+
d(D, { ...s.dropImageOptions, ...L }, k);
|
|
22357
22344
|
}
|
|
22358
|
-
function
|
|
22359
|
-
f(D, { ...s.dropTextOptions, ...
|
|
22345
|
+
function P(D, L, k) {
|
|
22346
|
+
f(D, { ...s.dropTextOptions, ...L }, k);
|
|
22360
22347
|
}
|
|
22361
22348
|
function N() {
|
|
22362
22349
|
s.manualReload || A(), i("reload");
|
|
@@ -22364,32 +22351,32 @@ const op = /* @__PURE__ */ Hl({
|
|
|
22364
22351
|
return Wn([() => s.fileScale, () => s.page, () => s.file, () => s.password], N), Wn(h, (D) => m(D), { immediate: !0 }), Wn(() => s.closeSvgOptions, y, { immediate: !0 }), n(b), t({
|
|
22365
22352
|
reload: A,
|
|
22366
22353
|
addImage: E,
|
|
22367
|
-
addText:
|
|
22354
|
+
addText: P,
|
|
22368
22355
|
clearActive: p,
|
|
22369
22356
|
deleteCanvas: b,
|
|
22370
22357
|
setActiveFabric: v,
|
|
22371
22358
|
copyActiveFabric: _,
|
|
22372
22359
|
deleteActiveFabric: S,
|
|
22373
22360
|
canvasRef: r
|
|
22374
|
-
}), (D,
|
|
22375
|
-
style:
|
|
22376
|
-
onDragover:
|
|
22361
|
+
}), (D, L) => (Wl(), Xl("div", {
|
|
22362
|
+
style: Ul({ transform: `scale(${h.value})` }),
|
|
22363
|
+
onDragover: L[0] || (L[0] = Un(() => {
|
|
22377
22364
|
}, ["prevent"])),
|
|
22378
|
-
onDragenter:
|
|
22365
|
+
onDragenter: L[1] || (L[1] = Un(() => {
|
|
22379
22366
|
}, ["prevent"])),
|
|
22380
22367
|
onDrop: Un(T, ["stop", "prevent"])
|
|
22381
22368
|
}, [
|
|
22382
|
-
|
|
22369
|
+
Yl("canvas", {
|
|
22383
22370
|
id: o,
|
|
22384
22371
|
ref_key: "canvasRef",
|
|
22385
22372
|
ref: r,
|
|
22386
|
-
class:
|
|
22373
|
+
class: $l(a.canvasClass)
|
|
22387
22374
|
}, null, 2)
|
|
22388
22375
|
], 36));
|
|
22389
22376
|
}
|
|
22390
22377
|
});
|
|
22391
22378
|
export {
|
|
22392
|
-
|
|
22393
|
-
|
|
22394
|
-
|
|
22379
|
+
np as default,
|
|
22380
|
+
qg as loadFile,
|
|
22381
|
+
tp as useFabric
|
|
22395
22382
|
};
|