@component-hook/pdf-canvas 1.3.1-alpha.4 → 1.3.1-alpha.5
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 +0 -1
- package/dist/react/pdf-canvas.es.js +392 -392
- package/dist/react/pdf-canvas.umd.js +30 -30
- package/dist/vue/pdf-canvas.es.d.ts +0 -1
- package/dist/vue/pdf-canvas.es.js +190 -190
- package/dist/vue/pdf-canvas.umd.js +7 -7
- package/package.json +4 -4
|
@@ -145,7 +145,7 @@ function sc() {
|
|
|
145
145
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
146
146
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
147
147
|
}
|
|
148
|
-
function l(E, H, V, J,
|
|
148
|
+
function l(E, H, V, J, Tt, st) {
|
|
149
149
|
var N = V.ref;
|
|
150
150
|
return E = {
|
|
151
151
|
$$typeof: g,
|
|
@@ -170,7 +170,7 @@ function sc() {
|
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
|
-
value:
|
|
173
|
+
value: Tt
|
|
174
174
|
}), Object.defineProperty(E, "_debugTask", {
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
@@ -178,7 +178,7 @@ function sc() {
|
|
|
178
178
|
value: st
|
|
179
179
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
180
180
|
}
|
|
181
|
-
function c(E, H, V, J,
|
|
181
|
+
function c(E, H, V, J, Tt, st) {
|
|
182
182
|
var N = H.children;
|
|
183
183
|
if (N !== void 0)
|
|
184
184
|
if (J)
|
|
@@ -193,10 +193,10 @@ function sc() {
|
|
|
193
193
|
else u(N);
|
|
194
194
|
if (O.call(H, "key")) {
|
|
195
195
|
N = a(E);
|
|
196
|
-
var
|
|
197
|
-
return
|
|
196
|
+
var lt = Object.keys(H).filter(function(Wt) {
|
|
197
|
+
return Wt !== "key";
|
|
198
198
|
});
|
|
199
|
-
J = 0 <
|
|
199
|
+
J = 0 < lt.length ? "{key: someKey, " + lt.join(": ..., ") + ": ...}" : "{key: someKey}", ht[N + J] || (lt = 0 < lt.length ? "{" + lt.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
200
200
|
`A props object containing a "key" prop is being spread into JSX:
|
|
201
201
|
let props = %s;
|
|
202
202
|
<%s {...props} />
|
|
@@ -205,14 +205,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
205
205
|
<%s key={someKey} {...props} />`,
|
|
206
206
|
J,
|
|
207
207
|
N,
|
|
208
|
-
|
|
208
|
+
lt,
|
|
209
209
|
N
|
|
210
|
-
),
|
|
210
|
+
), ht[N + J] = !0);
|
|
211
211
|
}
|
|
212
212
|
if (N = null, V !== void 0 && (e(V), N = "" + V), r(H) && (e(H.key), N = "" + H.key), "key" in H) {
|
|
213
213
|
V = {};
|
|
214
|
-
for (var
|
|
215
|
-
|
|
214
|
+
for (var xt in H)
|
|
215
|
+
xt !== "key" && (V[xt] = H[xt]);
|
|
216
216
|
} else V = H;
|
|
217
217
|
return N && o(
|
|
218
218
|
V,
|
|
@@ -222,7 +222,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
222
222
|
N,
|
|
223
223
|
V,
|
|
224
224
|
i(),
|
|
225
|
-
|
|
225
|
+
Tt,
|
|
226
226
|
st
|
|
227
227
|
);
|
|
228
228
|
}
|
|
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
var M, R = {}, W = f.react_stack_bottom_frame.bind(
|
|
244
244
|
f,
|
|
245
245
|
n
|
|
246
|
-
)(),
|
|
246
|
+
)(), ot = z(s(n)), ht = {};
|
|
247
247
|
Ws.Fragment = b, Ws.jsx = function(E, H, V) {
|
|
248
248
|
var J = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
249
249
|
return c(
|
|
@@ -252,7 +252,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
252
252
|
V,
|
|
253
253
|
!1,
|
|
254
254
|
J ? Error("react-stack-top-frame") : W,
|
|
255
|
-
J ? z(s(E)) :
|
|
255
|
+
J ? z(s(E)) : ot
|
|
256
256
|
);
|
|
257
257
|
}, Ws.jsxs = function(E, H, V) {
|
|
258
258
|
var J = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
@@ -262,7 +262,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
262
262
|
V,
|
|
263
263
|
!0,
|
|
264
264
|
J ? Error("react-stack-top-frame") : W,
|
|
265
|
-
J ? z(s(E)) :
|
|
265
|
+
J ? z(s(E)) : ot
|
|
266
266
|
);
|
|
267
267
|
};
|
|
268
268
|
})()), Ws;
|
|
@@ -343,7 +343,7 @@ function w(a) {
|
|
|
343
343
|
}
|
|
344
344
|
return a;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function at(a, t) {
|
|
347
347
|
if (a == null) return {};
|
|
348
348
|
var e, s, i = (function(r, o) {
|
|
349
349
|
if (r == null) return {};
|
|
@@ -450,7 +450,7 @@ const Ce = () => Wo || (Wo = { document, window, isTouchSupported: "ontouchstart
|
|
|
450
450
|
}(), yr = "6.9.0";
|
|
451
451
|
function os() {
|
|
452
452
|
}
|
|
453
|
-
const We = Math.PI / 2, Ne = 2 * Math.PI, Vr = Math.PI / 180,
|
|
453
|
+
const We = Math.PI / 2, Ne = 2 * Math.PI, Vr = Math.PI / 180, Gt = Object.freeze([1, 0, 0, 1, 0, 0]), Wr = 16, He = 0.4477152502, $ = "center", et = "left", qt = "top", _r = "bottom", pt = "right", Bt = "none", Xr = /\r?\n/, th = "moving", Tn = "scaling", eh = "rotating", Ur = "rotate", sh = "skewing", ci = "resizing", fc = "modifyPoly", gc = "modifyPath", an = "changed", En = "scale", Vt = "scaleX", te = "scaleY", Ns = "skewX", js = "skewY", wt = "fill", Ht = "stroke", hn = "modified", vs = "json", Kn = "svg", L = new class {
|
|
454
454
|
constructor() {
|
|
455
455
|
this[vs] = /* @__PURE__ */ new Map(), this[Kn] = /* @__PURE__ */ new Map();
|
|
456
456
|
}
|
|
@@ -833,10 +833,10 @@ const Xe = () => mc++, Ae = () => {
|
|
|
833
833
|
return t.width = a.width, t.height = a.height, t;
|
|
834
834
|
}, $r = (a, t, e) => a.toDataURL("image/".concat(t), e), qr = (a, t, e) => new Promise(((s, i) => {
|
|
835
835
|
a.toBlob(s, "image/".concat(t), e);
|
|
836
|
-
})), ft = (a) => a * Vr, Te = (a) => a / Vr, ah = (a) => a.every(((t, e) => t ===
|
|
836
|
+
})), ft = (a) => a * Vr, Te = (a) => a / Vr, ah = (a) => a.every(((t, e) => t === Gt[e])), Mt = (a, t, e) => new C(a).transform(t, e), $t = (a) => {
|
|
837
837
|
const t = 1 / (a[0] * a[3] - a[1] * a[2]), e = [t * a[3], -t * a[1], -t * a[2], t * a[0], 0, 0], { x: s, y: i } = new C(a[4], a[5]).transform(e, !0);
|
|
838
838
|
return e[4] = -s, e[5] = -i, e;
|
|
839
|
-
}, mt = (a, t, e) => [a[0] * t[0] + a[2] * t[1], a[1] * t[0] + a[3] * t[1], a[0] * t[2] + a[2] * t[3], a[1] * t[2] + a[3] * t[3], e ? 0 : a[0] * t[4] + a[2] * t[5] + a[4], e ? 0 : a[1] * t[4] + a[3] * t[5] + a[5]], kn = (a, t) => a.reduceRight(((e, s) => s && e ? mt(s, e, t) : s || e), void 0) ||
|
|
839
|
+
}, mt = (a, t, e) => [a[0] * t[0] + a[2] * t[1], a[1] * t[0] + a[3] * t[1], a[0] * t[2] + a[2] * t[3], a[1] * t[2] + a[3] * t[3], e ? 0 : a[0] * t[4] + a[2] * t[5] + a[4], e ? 0 : a[1] * t[4] + a[3] * t[5] + a[5]], kn = (a, t) => a.reduceRight(((e, s) => s && e ? mt(s, e, t) : s || e), void 0) || Gt.concat(), hh = (a) => {
|
|
840
840
|
let [t, e] = a;
|
|
841
841
|
return Math.atan2(e, t);
|
|
842
842
|
}, hs = (a) => {
|
|
@@ -908,7 +908,7 @@ const Mn = function(a) {
|
|
|
908
908
|
}));
|
|
909
909
|
}, gs = function(a) {
|
|
910
910
|
return (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []).reduce(((t, e) => (e in a && (t[e] = a[e]), t)), {});
|
|
911
|
-
}, Zr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}),
|
|
911
|
+
}, Zr = (a, t) => Object.keys(a).reduce(((e, s) => (t(a[s], s, a) && (e[s] = a[s]), e)), {}), nt = (a, t) => parseFloat(Number(a).toFixed(t)), Rs = (a) => "matrix(" + a.map(((t) => nt(t, tt.NUM_FRACTION_DIGITS))).join(" ") + ")", re = (a) => !!a && a.toLive !== void 0, Xo = (a) => !!a && typeof a.toObject == "function", Uo = (a) => !!a && a.offsetX !== void 0 && "source" in a, Je = (a) => !!a && "multiSelectionStacking" in a;
|
|
912
912
|
function uh(a) {
|
|
913
913
|
const t = a && ue(a);
|
|
914
914
|
let e = 0, s = 0;
|
|
@@ -929,7 +929,7 @@ const ue = (a) => a.ownerDocument || null, dh = (a) => {
|
|
|
929
929
|
e && (a.style.width = typeof e == "number" ? "".concat(e, "px") : e), s && (a.style.height = typeof s == "number" ? "".concat(s, "px") : s);
|
|
930
930
|
};
|
|
931
931
|
function Yo(a) {
|
|
932
|
-
return a.onselectstart !== void 0 && (a.onselectstart = () => !1), a.style.userSelect =
|
|
932
|
+
return a.onselectstart !== void 0 && (a.onselectstart = () => !1), a.style.userSelect = Bt, a;
|
|
933
933
|
}
|
|
934
934
|
class gh {
|
|
935
935
|
constructor(t) {
|
|
@@ -973,7 +973,7 @@ class gh {
|
|
|
973
973
|
Ce().dispose(this.lower.el), delete this.lower;
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
const bc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...
|
|
976
|
+
const bc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Gt] }, vc = ["objects"];
|
|
977
977
|
class yi extends ih(nh) {
|
|
978
978
|
get lowerCanvasEl() {
|
|
979
979
|
var t;
|
|
@@ -1052,9 +1052,9 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1052
1052
|
this.viewportTransform = t, this.calcViewportBoundaries(), this.renderOnAddRemove && this.requestRenderAll();
|
|
1053
1053
|
}
|
|
1054
1054
|
zoomToPoint(t, e) {
|
|
1055
|
-
const s = t, i = [...this.viewportTransform], n =
|
|
1055
|
+
const s = t, i = [...this.viewportTransform], n = Mt(t, $t(i));
|
|
1056
1056
|
i[0] = e, i[3] = e;
|
|
1057
|
-
const r =
|
|
1057
|
+
const r = Mt(n, i);
|
|
1058
1058
|
i[4] += s.x - r.x, i[5] += s.y - r.y, this.setViewportTransform(i);
|
|
1059
1059
|
}
|
|
1060
1060
|
setZoom(t) {
|
|
@@ -1089,7 +1089,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1089
1089
|
this.nextRenderHandle || this.disposed || this.destroyed || (this.nextRenderHandle = ii((() => this.renderAndReset())));
|
|
1090
1090
|
}
|
|
1091
1091
|
calcViewportBoundaries() {
|
|
1092
|
-
const t = this.width, e = this.height, s = $t(this.viewportTransform), i =
|
|
1092
|
+
const t = this.width, e = this.height, s = $t(this.viewportTransform), i = Mt({ x: 0, y: 0 }, s), n = Mt({ x: t, y: e }, s), r = i.min(n), o = i.max(n);
|
|
1093
1093
|
return this.vptCoords = { tl: r, tr: new C(o.x, r.y), bl: new C(r.x, o.y), br: o };
|
|
1094
1094
|
}
|
|
1095
1095
|
cancelRequestedRender() {
|
|
@@ -1158,7 +1158,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1158
1158
|
return this._centerObject(t, new C(t.getCenterPoint().x, this.getVpCenter().y));
|
|
1159
1159
|
}
|
|
1160
1160
|
getVpCenter() {
|
|
1161
|
-
return
|
|
1161
|
+
return Mt(this.getCenterPoint(), $t(this.viewportTransform));
|
|
1162
1162
|
}
|
|
1163
1163
|
_centerObject(t, e) {
|
|
1164
1164
|
t.setXY(e, $, $), t.setCoords(), this.renderOnAddRemove && this.requestRenderAll();
|
|
@@ -1208,7 +1208,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1208
1208
|
if (r) o = 'viewBox="'.concat(r.x, " ").concat(r.y, " ").concat(r.width, " ").concat(r.height, '" ');
|
|
1209
1209
|
else if (this.svgViewportTransformation) {
|
|
1210
1210
|
const h = this.viewportTransform;
|
|
1211
|
-
o = 'viewBox="'.concat(
|
|
1211
|
+
o = 'viewBox="'.concat(nt(-h[4] / h[0], n), " ").concat(nt(-h[5] / h[3], n), " ").concat(nt(this.width / h[0], n), " ").concat(nt(this.height / h[3], n), '" ');
|
|
1212
1212
|
} else o = 'viewBox="0 0 '.concat(this.width, " ").concat(this.height, '" ');
|
|
1213
1213
|
t.push("<svg ", 'xmlns="http://www.w3.org/2000/svg" ', 'xmlns:xlink="http://www.w3.org/1999/xlink" ', 'version="1.1" ', 'width="', s, '" ', 'height="', i, '" ', o, `xml:space="preserve">
|
|
1214
1214
|
`, "<desc>Created with Fabric.js ", yr, `</desc>
|
|
@@ -1279,7 +1279,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1279
1279
|
loadFromJSON(t, e) {
|
|
1280
1280
|
let { signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1281
1281
|
if (!t) return Promise.reject(new xe("`json` is undefined"));
|
|
1282
|
-
const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r =
|
|
1282
|
+
const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = at(i, vc), { backgroundImage: o, background: h, overlayImage: l, overlay: c, clipPath: u } = r, d = this.renderOnAddRemove;
|
|
1283
1283
|
return this.renderOnAddRemove = !1, Promise.all([Ds(n, { reviver: e, signal: s }), vi({ backgroundImage: o, backgroundColor: h, overlayImage: l, overlayColor: c, clipPath: u }, { signal: s })]).then(((f) => {
|
|
1284
1284
|
let [g, p] = f;
|
|
1285
1285
|
return this.clear(), this.add(...g), this.set(r), this.set(p), this.renderOnAddRemove = d, this;
|
|
@@ -1340,7 +1340,7 @@ const yc = ["touchstart", "touchmove", "touchend"], ph = (a) => {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
return { left: t, top: e, width: s - t, height: i - e };
|
|
1342
1342
|
}, _c = ["translateX", "translateY", "scaleX", "scaleY"], mh = (a, t) => Ls(a, mt(t, a.calcOwnMatrix())), Ls = (a, t) => {
|
|
1343
|
-
const e = hs(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o =
|
|
1343
|
+
const e = hs(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = at(e, _c), h = new C(s, i);
|
|
1344
1344
|
a.flipX = !1, a.flipY = !1, Object.assign(a, o), a.set({ scaleX: n, scaleY: r }), a.setPositionByOrigin(h, $, $);
|
|
1345
1345
|
}, bh = (a) => {
|
|
1346
1346
|
a.scaleX = 1, a.scaleY = 1, a.skewX = 0, a.skewY = 0, a.flipX = !1, a.flipY = !1, a.rotate(0);
|
|
@@ -1348,13 +1348,13 @@ const yc = ["touchstart", "touchmove", "touchend"], ph = (a) => {
|
|
|
1348
1348
|
const s = a / 2, i = t / 2, n = [new C(-s, -i), new C(s, -i), new C(-s, i), new C(s, i)].map(((o) => o.transform(e))), r = Se(n);
|
|
1349
1349
|
return new C(r.width, r.height);
|
|
1350
1350
|
}, _i = function() {
|
|
1351
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1352
|
-
return mt($t(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1351
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Gt;
|
|
1352
|
+
return mt($t(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Gt), a);
|
|
1353
1353
|
}, as = function(a) {
|
|
1354
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1354
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Gt, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Gt;
|
|
1355
1355
|
return a.transform(_i(t, e));
|
|
1356
1356
|
}, vh = function(a) {
|
|
1357
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1357
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Gt, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Gt;
|
|
1358
1358
|
return a.transform(_i(t, e), !0);
|
|
1359
1359
|
}, xr = (a, t, e) => {
|
|
1360
1360
|
const s = _i(t, e);
|
|
@@ -1525,7 +1525,7 @@ class it {
|
|
|
1525
1525
|
return e.includes("rad") ? Te(s) : e.includes("turn") ? 360 * s : s;
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
const
|
|
1528
|
+
const It = function(a) {
|
|
1529
1529
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Wr;
|
|
1530
1530
|
const e = /\D{0,2}$/.exec(a), s = parseFloat(a), i = tt.DPI;
|
|
1531
1531
|
switch (e?.[0]) {
|
|
@@ -1545,7 +1545,7 @@ const Nt = function(a) {
|
|
|
1545
1545
|
return s;
|
|
1546
1546
|
}
|
|
1547
1547
|
}, eo = (a) => {
|
|
1548
|
-
const [t, e] = a.trim().split(" "), [s, i] = (n = t) && n !==
|
|
1548
|
+
const [t, e] = a.trim().split(" "), [s, i] = (n = t) && n !== Bt ? [n.slice(1, 4), n.slice(5, 8)] : n === Bt ? [n, n] : ["Mid", "Mid"];
|
|
1549
1549
|
var n;
|
|
1550
1550
|
return { meetOrSlice: e || "meet", alignX: s, alignY: i };
|
|
1551
1551
|
}, ui = function(a, t) {
|
|
@@ -1560,8 +1560,8 @@ const Nt = function(a) {
|
|
|
1560
1560
|
};
|
|
1561
1561
|
class Sh {
|
|
1562
1562
|
getSvgStyles(t) {
|
|
1563
|
-
const e = this.fillRule ? this.fillRule : "nonzero", s = this.strokeWidth ? this.strokeWidth : "0", i = this.strokeDashArray ? this.strokeDashArray.join(" ") :
|
|
1564
|
-
return [ui(
|
|
1563
|
+
const e = this.fillRule ? this.fillRule : "nonzero", s = this.strokeWidth ? this.strokeWidth : "0", i = this.strokeDashArray ? this.strokeDashArray.join(" ") : Bt, n = this.strokeDashOffset ? this.strokeDashOffset : "0", r = this.strokeLineCap ? this.strokeLineCap : "butt", o = this.strokeLineJoin ? this.strokeLineJoin : "miter", h = this.strokeMiterLimit ? this.strokeMiterLimit : "4", l = this.opacity !== void 0 ? this.opacity : "1", c = this.visible ? "" : " visibility: hidden;", u = t ? "" : this.getSvgFilter(), d = ui(wt, this.fill);
|
|
1564
|
+
return [ui(Ht, this.stroke), "stroke-width: ", s, "; ", "stroke-dasharray: ", i, "; ", "stroke-linecap: ", r, "; ", "stroke-dashoffset: ", n, "; ", "stroke-linejoin: ", o, "; ", "stroke-miterlimit: ", h, "; ", d, "fill-rule: ", e, "; ", "opacity: ", l, ";", u, c].join("");
|
|
1565
1565
|
}
|
|
1566
1566
|
getSvgFilter() {
|
|
1567
1567
|
return this.shadow ? "filter: url(#SVGID_".concat(this.shadow.id, ");") : "";
|
|
@@ -1609,7 +1609,7 @@ class Sh {
|
|
|
1609
1609
|
function On(a) {
|
|
1610
1610
|
return new RegExp("^(" + a.join("|") + ")\\b", "i");
|
|
1611
1611
|
}
|
|
1612
|
-
const ls = "textDecorationThickness", Ch = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], Ah = ["underline", "overline", "linethrough"], Th = [...Ch, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], Eh = [...Th, ...Ah, "textBackgroundColor", "direction", ls], Sc = [...Ch, ...Ah,
|
|
1612
|
+
const ls = "textDecorationThickness", Ch = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], Ah = ["underline", "overline", "linethrough"], Th = [...Ch, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], Eh = [...Th, ...Ah, "textBackgroundColor", "direction", ls], Sc = [...Ch, ...Ah, Ht, "strokeWidth", wt, "deltaY", "textBackgroundColor", ls], Cc = { _reNewline: Xr, _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: et, fontStyle: "normal", lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: et, 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, [ls]: 66.667 }, we = "justify", fn = "justify-left", ri = "justify-right", oi = "justify-center";
|
|
1613
1613
|
var ta, ea, sa;
|
|
1614
1614
|
const de = String.raw(ta || (ta = Ee(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))), Zn = String.raw(ea || (ea = Ee(["(?:s*,?s+|s*,s*)"], ["(?:\\s*,?\\s+|\\s*,\\s*)"]))), Sr = "http://www.w3.org/2000/svg", Ac = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + de + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + de + "))?\\s+(.*)"), Tc = { cx: et, x: et, r: "radius", cy: qt, y: qt, 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": ls }, Qn = "font-size", tr = "clip-path", Ec = On(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), kc = On(["symbol", "image", "marker", "pattern", "view", "svg"]), ia = On(["symbol", "g", "a", "svg", "clipPath", "defs"]), na = new RegExp(String.raw(sa || (sa = Ee(["^s*(", ")", "(", ")", "(", ")", "(", ")s*$"], ["^\\s*(", ")", "(", ")", "(", ")", "(", ")\\s*$"])), de, Zn, de, Zn, de, Zn, de)), Mc = new C(1, 0), kh = new C(), so = (a, t) => a.rotate(t), gn = (a, t) => new C(t).subtract(a), pn = (a) => a.distanceFrom(kh), mn = (a, t) => Math.atan2(Ts(a, t), Ph(a, t)), Mh = (a) => mn(Mc, a), Dn = (a) => a.eq(kh) ? a : a.scalarDivide(pn(a)), io = function(a) {
|
|
1615
1615
|
let t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
|
|
@@ -1634,9 +1634,9 @@ class Fe {
|
|
|
1634
1634
|
toSVG(t) {
|
|
1635
1635
|
const e = so(new C(this.offsetX, this.offsetY), ft(-t.angle)), s = new it(this.color);
|
|
1636
1636
|
let i = 40, n = 40;
|
|
1637
|
-
return t.width && t.height && (i = 100 *
|
|
1638
|
-
<feGaussianBlur in="SourceAlpha" stdDeviation="`).concat(
|
|
1639
|
-
<feOffset dx="`).concat(
|
|
1637
|
+
return t.width && t.height && (i = 100 * nt((Math.abs(e.x) + this.blur) / t.width, tt.NUM_FRACTION_DIGITS) + 20, n = 100 * nt((Math.abs(e.y) + this.blur) / t.height, tt.NUM_FRACTION_DIGITS) + 20), t.flipX && (e.x *= -1), t.flipY && (e.y *= -1), '<filter id="SVGID_'.concat(this.id, '" y="-').concat(n, '%" height="').concat(100 + 2 * n, '%" x="-').concat(i, '%" width="').concat(100 + 2 * i, `%" >
|
|
1638
|
+
<feGaussianBlur in="SourceAlpha" stdDeviation="`).concat(nt(this.blur ? this.blur / 2 : 0, tt.NUM_FRACTION_DIGITS), `"></feGaussianBlur>
|
|
1639
|
+
<feOffset dx="`).concat(nt(e.x, tt.NUM_FRACTION_DIGITS), '" dy="').concat(nt(e.y, tt.NUM_FRACTION_DIGITS), `" result="oBlur" ></feOffset>
|
|
1640
1640
|
<feFlood flood-color="`).concat(s.toRgb(), '" flood-opacity="').concat(s.getAlpha(), `"/>
|
|
1641
1641
|
<feComposite in2="oBlur" operator="in" />
|
|
1642
1642
|
<feMerge>
|
|
@@ -1655,7 +1655,7 @@ class Fe {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
1657
|
x(Fe, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Fe, "type", "shadow"), L.setClass(Fe, "shadow");
|
|
1658
|
-
const cs = (a, t, e) => Math.max(a, Math.min(t, e)), Pc = [qt, et,
|
|
1658
|
+
const cs = (a, t, e) => Math.max(a, Math.min(t, e)), Pc = [qt, et, Vt, te, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Ns, js], je = [wt, Ht, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], Oc = { 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: et, originY: qt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: wt, 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 }, er = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Ne * Math.asin(1) : e / Ne * Math.asin(t / a), { a, c: t, p: e, s }), aa = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Ne / e), Oh = (a, t, e, s) => -e * Math.cos(a / s * We) + e + t, Ar = (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, ha = (a, t, e, s) => e - Ar(s - a, 0, e, s) + t;
|
|
1659
1659
|
var Dc = Object.freeze({ __proto__: null, defaultEasing: Oh, easeInBack: function(a, t, e, s) {
|
|
1660
1660
|
let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1.70158;
|
|
1661
1661
|
return e * (a /= s) * a * ((i + 1) * a - i) + t;
|
|
@@ -1728,7 +1728,7 @@ const Lc = ["startValue", "endValue"];
|
|
|
1728
1728
|
class Fc extends no {
|
|
1729
1729
|
constructor(t) {
|
|
1730
1730
|
let { startValue: e = 0, endValue: s = 100 } = t;
|
|
1731
|
-
super(w(w({},
|
|
1731
|
+
super(w(w({}, at(t, Lc)), {}, { startValue: e, byValue: s - e }));
|
|
1732
1732
|
}
|
|
1733
1733
|
calculate(t) {
|
|
1734
1734
|
const e = this.easing(t, this.startValue, this.byValue, this.duration);
|
|
@@ -1739,7 +1739,7 @@ const Ic = ["startValue", "endValue"];
|
|
|
1739
1739
|
class Nc extends no {
|
|
1740
1740
|
constructor(t) {
|
|
1741
1741
|
let { startValue: e = [0], endValue: s = [100] } = t;
|
|
1742
|
-
super(w(w({},
|
|
1742
|
+
super(w(w({}, at(t, Ic)), {}, { startValue: e, byValue: s.map(((i, n) => i - e[n])) }));
|
|
1743
1743
|
}
|
|
1744
1744
|
calculate(t) {
|
|
1745
1745
|
const e = this.startValue.map(((s, i) => this.easing(t, s, this.byValue[i], this.duration, i)));
|
|
@@ -1749,7 +1749,7 @@ class Nc extends no {
|
|
|
1749
1749
|
const jc = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], Bc = (a, t, e, s) => t + e * (1 - Math.cos(a / s * We)), sr = (a) => a && ((t, e, s) => a(new it(t).toRgba(), e, s));
|
|
1750
1750
|
class Hc extends no {
|
|
1751
1751
|
constructor(t) {
|
|
1752
|
-
let { startValue: e, endValue: s, easing: i = Bc, onChange: n, onComplete: r, abort: o } = t, h =
|
|
1752
|
+
let { startValue: e, endValue: s, easing: i = Bc, onChange: n, onComplete: r, abort: o } = t, h = at(t, jc);
|
|
1753
1753
|
const l = new it(e).getSource(), c = new it(s).getSource();
|
|
1754
1754
|
super(w(w({}, h), {}, { startValue: l, byValue: c.map(((u, d) => u - l[d])), easing: i, onChange: sr(n), onComplete: sr(r), abort: sr(o) }));
|
|
1755
1755
|
}
|
|
@@ -1868,10 +1868,10 @@ class zc extends nh {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
getXY() {
|
|
1870
1870
|
const t = this.getRelativeXY();
|
|
1871
|
-
return this.group ?
|
|
1871
|
+
return this.group ? Mt(t, this.group.calcTransformMatrix()) : t;
|
|
1872
1872
|
}
|
|
1873
1873
|
setXY(t, e, s) {
|
|
1874
|
-
this.group && (t =
|
|
1874
|
+
this.group && (t = Mt(t, $t(this.group.calcTransformMatrix()))), this.setRelativeXY(t, e, s);
|
|
1875
1875
|
}
|
|
1876
1876
|
getRelativeXY() {
|
|
1877
1877
|
return new C(this.left, this.top);
|
|
@@ -1887,7 +1887,7 @@ class zc extends nh {
|
|
|
1887
1887
|
const { tl: t, tr: e, br: s, bl: i } = this.aCoords || (this.aCoords = this.calcACoords()), n = [t, e, s, i];
|
|
1888
1888
|
if (this.group) {
|
|
1889
1889
|
const r = this.group.calcTransformMatrix();
|
|
1890
|
-
return n.map(((o) =>
|
|
1890
|
+
return n.map(((o) => Mt(o, r)));
|
|
1891
1891
|
}
|
|
1892
1892
|
return n;
|
|
1893
1893
|
}
|
|
@@ -1931,7 +1931,7 @@ class zc extends nh {
|
|
|
1931
1931
|
return this._getTransformedDimensions().y;
|
|
1932
1932
|
}
|
|
1933
1933
|
scale(t) {
|
|
1934
|
-
this._set(
|
|
1934
|
+
this._set(Vt, t), this._set(te, t), this.setCoords();
|
|
1935
1935
|
}
|
|
1936
1936
|
scaleToWidth(t) {
|
|
1937
1937
|
const e = this.getBoundingRect().width / this.getScaledWidth();
|
|
@@ -1950,11 +1950,11 @@ class zc extends nh {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
getViewportTransform() {
|
|
1952
1952
|
var t;
|
|
1953
|
-
return ((t = this.canvas) === null || t === void 0 ? void 0 : t.viewportTransform) ||
|
|
1953
|
+
return ((t = this.canvas) === null || t === void 0 ? void 0 : t.viewportTransform) || Gt.concat();
|
|
1954
1954
|
}
|
|
1955
1955
|
calcACoords() {
|
|
1956
1956
|
const t = fs({ angle: this.angle }), { x: e, y: s } = this.getRelativeCenterPoint(), i = Bs(e, s), n = mt(i, t), r = this._getTransformedDimensions(), o = r.x / 2, h = r.y / 2;
|
|
1957
|
-
return { tl:
|
|
1957
|
+
return { tl: Mt({ x: -o, y: -h }, n), tr: Mt({ x: o, y: -h }, n), bl: Mt({ x: -o, y: h }, n), br: Mt({ x: o, y: h }, n) };
|
|
1958
1958
|
}
|
|
1959
1959
|
setCoords() {
|
|
1960
1960
|
this.aCoords = this.calcACoords();
|
|
@@ -2010,7 +2010,7 @@ class zc extends nh {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
getCenterPoint() {
|
|
2012
2012
|
const t = this.getRelativeCenterPoint();
|
|
2013
|
-
return this.group ?
|
|
2013
|
+
return this.group ? Mt(t, this.group.calcTransformMatrix()) : t;
|
|
2014
2014
|
}
|
|
2015
2015
|
getRelativeCenterPoint() {
|
|
2016
2016
|
return this.translateToCenterPoint(new C(this.left, this.top), this.originX, this.originY);
|
|
@@ -2093,7 +2093,7 @@ let ke = class en extends zc {
|
|
|
2093
2093
|
return Math.abs(t) < this.minScaleLimit ? t < 0 ? -this.minScaleLimit : this.minScaleLimit : t === 0 ? 1e-4 : t;
|
|
2094
2094
|
}
|
|
2095
2095
|
_set(t, e) {
|
|
2096
|
-
t !==
|
|
2096
|
+
t !== Vt && t !== te || (e = this._constrainScale(e)), t === Vt && e < 0 ? (this.flipX = !this.flipX, e *= -1) : t === "scaleY" && e < 0 ? (this.flipY = !this.flipY, e *= -1) : t !== "shadow" || !e || e instanceof Fe || (e = new Fe(e));
|
|
2097
2097
|
const s = this[t] !== e;
|
|
2098
2098
|
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;
|
|
2099
2099
|
}
|
|
@@ -2121,7 +2121,7 @@ let ke = class en extends zc {
|
|
|
2121
2121
|
return this.fill && this.fill !== "transparent";
|
|
2122
2122
|
}
|
|
2123
2123
|
needsItsOwnCache() {
|
|
2124
|
-
return !!(this.paintFirst ===
|
|
2124
|
+
return !!(this.paintFirst === Ht && this.hasFill() && this.hasStroke() && this.shadow) || !!this.clipPath;
|
|
2125
2125
|
}
|
|
2126
2126
|
shouldCache() {
|
|
2127
2127
|
return this.ownCaching = this.objectCaching && (!this.parent || !this.parent.isOnACache()) || this.needsItsOwnCache(), this.ownCaching;
|
|
@@ -2185,7 +2185,7 @@ let ke = class en extends zc {
|
|
|
2185
2185
|
}
|
|
2186
2186
|
_setShadow(t) {
|
|
2187
2187
|
if (!this.shadow) return;
|
|
2188
|
-
const e = this.shadow, s = this.canvas, i = this.getCanvasRetinaScaling(), [n, , , r] = s?.viewportTransform ||
|
|
2188
|
+
const e = this.shadow, s = this.canvas, i = this.getCanvasRetinaScaling(), [n, , , r] = s?.viewportTransform || Gt, o = n * i, h = r * i, l = e.nonScaling ? new C(1, 1) : this.getObjectScaling();
|
|
2189
2189
|
t.shadowColor = e.color, t.shadowBlur = e.blur * tt.browserShadowBlurConstant * (o + h) * (l.x + l.y) / 4, t.shadowOffsetX = e.offsetX * o * l.x, t.shadowOffsetY = e.offsetY * h * l.y;
|
|
2190
2190
|
}
|
|
2191
2191
|
_removeShadow(t) {
|
|
@@ -2197,7 +2197,7 @@ let ke = class en extends zc {
|
|
|
2197
2197
|
return e.gradientUnits === "percentage" ? t.transform(this.width, 0, 0, this.height, i, n) : t.transform(1, 0, 0, 1, i, n), s && t.transform(s[0], s[1], s[2], s[3], s[4], s[5]), { offsetX: i, offsetY: n };
|
|
2198
2198
|
}
|
|
2199
2199
|
_renderPaintInOrder(t) {
|
|
2200
|
-
this.paintFirst ===
|
|
2200
|
+
this.paintFirst === Ht ? (this._renderStroke(t), this._renderFill(t)) : (this._renderFill(t), this._renderStroke(t));
|
|
2201
2201
|
}
|
|
2202
2202
|
_render(t) {
|
|
2203
2203
|
}
|
|
@@ -2343,8 +2343,8 @@ let ke = class en extends zc {
|
|
|
2343
2343
|
let e;
|
|
2344
2344
|
const s = tt.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: k, flipY: P, opacity: j, visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: M, skewY: R } = this;
|
|
2345
2345
|
i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
|
|
2346
|
-
const W = (
|
|
2347
|
-
return this.includeDefaultValues ?
|
|
2346
|
+
const W = (ht) => nt(ht, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(j), shadow: o && o.toObject(), visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: W(M), skewY: W(R) }, e ? { clipPath: e } : null);
|
|
2347
|
+
return this.includeDefaultValues ? ot : this._removeDefaultValues(ot);
|
|
2348
2348
|
}
|
|
2349
2349
|
toDatalessObject(t) {
|
|
2350
2350
|
return this.toObject(t);
|
|
@@ -2361,14 +2361,14 @@ let ke = class en extends zc {
|
|
|
2361
2361
|
return "#<".concat(this.constructor.type, ">");
|
|
2362
2362
|
}
|
|
2363
2363
|
static _fromObject(t) {
|
|
2364
|
-
let e =
|
|
2364
|
+
let e = at(t, Gc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = at(s, Vc);
|
|
2365
2365
|
return vi(e, n).then(((r) => i ? (delete r[i], new this(e[i], r)) : new this(r)));
|
|
2366
2366
|
}
|
|
2367
2367
|
static fromObject(t, e) {
|
|
2368
2368
|
return this._fromObject(t, e);
|
|
2369
2369
|
}
|
|
2370
2370
|
};
|
|
2371
|
-
x(ke, "stateProperties", Pc), x(ke, "cacheProperties", je), x(ke, "ownDefaults", Oc), x(ke, "type", "FabricObject"), x(ke, "colorProperties", [wt,
|
|
2371
|
+
x(ke, "stateProperties", Pc), x(ke, "cacheProperties", je), x(ke, "ownDefaults", Oc), x(ke, "type", "FabricObject"), x(ke, "colorProperties", [wt, Ht, "backgroundColor"]), x(ke, "customProperties", []), L.setClass(ke), L.setClass(ke, "object");
|
|
2372
2372
|
const Hs = (a, t, e) => (s, i, n, r) => {
|
|
2373
2373
|
const o = t(s, i, n, r);
|
|
2374
2374
|
return o && yh(a, w(w({}, wh(s, i, n, r)), e)), o;
|
|
@@ -2389,13 +2389,13 @@ const la = Hs(ci, zs(((a, t, e, s) => {
|
|
|
2389
2389
|
})));
|
|
2390
2390
|
function Wc(a, t, e, s, i) {
|
|
2391
2391
|
s = s || {};
|
|
2392
|
-
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 ?
|
|
2392
|
+
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 ? Ht : wt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor);
|
|
2393
2393
|
let c, u = t, d = e;
|
|
2394
2394
|
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, Ne, !1), a[h](), l && a.stroke(), a.restore();
|
|
2395
2395
|
}
|
|
2396
2396
|
function Xc(a, t, e, s, i) {
|
|
2397
2397
|
s = s || {};
|
|
2398
|
-
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 ?
|
|
2398
|
+
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 ? Ht : wt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor), c = n / 2, u = r / 2;
|
|
2399
2399
|
a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", a.translate(t, e);
|
|
2400
2400
|
const d = i.getTotalAngle();
|
|
2401
2401
|
a.rotate(ft(d)), a["".concat(h, "Rect")](-c, -u, n, r), l && a.strokeRect(-c, -u, n, r), a.restore();
|
|
@@ -2487,9 +2487,9 @@ function oo(a, t, e, s) {
|
|
|
2487
2487
|
_h(t) && (l *= 2, c *= 2), t.signX !== d && r !== "y" && (t.originX = qo(t.originX), l *= -1, t.signX = d), t.signY !== f && r !== "x" && (t.originY = qo(t.originY), c *= -1, t.signY = f);
|
|
2488
2488
|
}
|
|
2489
2489
|
const g = n.scaleX, p = n.scaleY;
|
|
2490
|
-
return r ? (r === "x" && n.set(
|
|
2490
|
+
return r ? (r === "x" && n.set(Vt, l), r === "y" && n.set(te, c)) : (!fe(n, "lockScalingX") && n.set(Vt, l), !fe(n, "lockScalingY") && n.set(te, c)), g !== n.scaleX || p !== n.scaleY;
|
|
2491
2491
|
}
|
|
2492
|
-
const Ei = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s)))), qc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "x" })))), Kc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "y" })))), Jc = ["target", "ex", "ey", "skewingSide"], ir = { x: { counterAxis: "y", scale:
|
|
2492
|
+
const Ei = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s)))), qc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "x" })))), Kc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "y" })))), Jc = ["target", "ex", "ey", "skewingSide"], ir = { x: { counterAxis: "y", scale: Vt, skew: Ns, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: te, skew: js, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, Zc = ["ns", "nesw", "ew", "nwse"], Qc = (a, t, e) => {
|
|
2493
2493
|
if (t.x !== 0 && fe(e, "lockSkewingY") || t.y !== 0 && fe(e, "lockSkewingX")) return un;
|
|
2494
2494
|
const s = xh(e, t) % 4;
|
|
2495
2495
|
return "".concat(Zc[s], "-resize");
|
|
@@ -2499,13 +2499,13 @@ function Fh(a, t, e, s, i) {
|
|
|
2499
2499
|
if (fe(n, h)) return !1;
|
|
2500
2500
|
const { origin: u, flip: d } = ir[r], f = yt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && to(e, $, $, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
|
|
2501
2501
|
return Hs(sh, zs(((m, v, y, _) => (function(S, A, T) {
|
|
2502
|
-
let { target: k, ex: P, ey: j, skewingSide: F } = A, I =
|
|
2503
|
-
const { skew: O } = ir[S], D = T.subtract(new C(P, j)).divide(new C(k.scaleX, k.scaleY))[S], z = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y,
|
|
2504
|
-
k.set(O,
|
|
2502
|
+
let { target: k, ex: P, ey: j, skewingSide: F } = A, I = at(A, Jc);
|
|
2503
|
+
const { skew: O } = ir[S], D = T.subtract(new C(P, j)).divide(new C(k.scaleX, k.scaleY))[S], z = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, ot = 2 * D * F / Math.max(W, 1) + R, ht = Te(Math.atan(ot));
|
|
2504
|
+
k.set(O, ht);
|
|
2505
2505
|
const E = z !== k[O];
|
|
2506
2506
|
if (E && S === "y") {
|
|
2507
|
-
const { skewX: H, scaleX: V } = k, J = k._getTransformedDimensions({ skewY: z }),
|
|
2508
|
-
st !== 1 && k.set(
|
|
2507
|
+
const { skewX: H, scaleX: V } = k, J = k._getTransformedDimensions({ skewY: z }), Tt = k._getTransformedDimensions(), st = H !== 0 ? J.x / Tt.x : 1;
|
|
2508
|
+
st !== 1 && k.set(Vt, st * V);
|
|
2509
2509
|
}
|
|
2510
2510
|
return E;
|
|
2511
2511
|
})(a, v, new C(y, _)))))(t, w(w({}, e), {}, { [o]: p, skewingSide: g }), s, i);
|
|
@@ -2516,7 +2516,7 @@ function Rn(a, t) {
|
|
|
2516
2516
|
}
|
|
2517
2517
|
const ki = (a, t, e) => {
|
|
2518
2518
|
const s = Rn(a, e);
|
|
2519
|
-
return t.x === 0 ? s ? Ns : te : t.y === 0 ? s ? js :
|
|
2519
|
+
return t.x === 0 ? s ? Ns : te : t.y === 0 ? s ? js : Vt : "";
|
|
2520
2520
|
}, xs = (a, t, e) => Rn(a, e) ? Qc(0, t, e) : Zs(a, t, e), ca = (a, t, e, s) => Rn(a, t.target) ? eu(a, t, e, s) : qc(a, t, e, s), ua = (a, t, e, s) => Rn(a, t.target) ? tu(a, t, e, s) : Kc(a, t, e, s), Ih = () => ({ ml: new he({ x: -0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mr: new he({ x: 0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mb: new he({ x: 0, y: 0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), mt: new he({ x: 0, y: -0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), tl: new he({ x: -0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), tr: new he({ x: 0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), bl: new he({ x: -0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), br: new he({ x: 0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), mtr: new he({ x: 0, y: -0.5, actionHandler: Yc, cursorStyleHandler: Uc, offsetY: -40, withConnection: !0, actionName: Ur }) }), su = () => ({ mr: new he({ x: 0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }), ml: new he({ x: -0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }) }), iu = () => w(w({}, Ih()), su());
|
|
2521
2521
|
class di extends ke {
|
|
2522
2522
|
static getDefaults() {
|
|
@@ -2663,9 +2663,9 @@ function Nh(a, t) {
|
|
|
2663
2663
|
})), a;
|
|
2664
2664
|
}
|
|
2665
2665
|
x(di, "ownDefaults", { noScaleCache: !0, lockMovementX: !1, lockMovementY: !1, lockRotation: !1, lockScalingX: !1, lockScalingY: !1, lockSkewingX: !1, lockSkewingY: !1, lockScalingFlip: !1, cornerSize: 13, touchCornerSize: 24, transparentCorners: !0, cornerColor: "rgb(178,204,255)", cornerStrokeColor: "", cornerStyle: "rect", cornerDashArray: null, hasControls: !0, borderColor: "rgb(178,204,255)", borderDashArray: null, borderOpacityWhenMoving: 0.4, borderScaleFactor: 1, hasBorders: !0, selectionBackgroundColor: "", selectable: !0, evented: !0, perPixelTargetFind: !1, activeOn: "down", hoverCursor: null, moveCursor: null });
|
|
2666
|
-
class
|
|
2666
|
+
class Rt extends di {
|
|
2667
2667
|
}
|
|
2668
|
-
Nh(
|
|
2668
|
+
Nh(Rt, [Sh]), L.setClass(Rt), L.setClass(Rt, "object");
|
|
2669
2669
|
const jh = (a, t, e, s) => {
|
|
2670
2670
|
const i = 2 * (s = Math.round(s)) + 1, { data: n } = a.getImageData(t - s, e - s, i, i);
|
|
2671
2671
|
for (let r = 3; r < n.length; r += 4)
|
|
@@ -2880,7 +2880,7 @@ const Fn = function(a, t) {
|
|
|
2880
2880
|
for (let h = 0; h < o.length; h++) i++, a[n] && a[n].start <= i && i < a[n].end && (s[r] = s[r] || {}, s[r][h] = w({}, a[n].style), i === a[n].end - 1 && n++);
|
|
2881
2881
|
}
|
|
2882
2882
|
return s;
|
|
2883
|
-
}, $e = ["display", "transform", wt, "fill-opacity", "fill-rule", "opacity",
|
|
2883
|
+
}, $e = ["display", "transform", wt, "fill-opacity", "fill-rule", "opacity", Ht, "stroke-dasharray", "stroke-linecap", "stroke-dashoffset", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "id", "paint-order", "vector-effect", "instantiated_by_use", "clip-path"];
|
|
2884
2884
|
function fa(a, t) {
|
|
2885
2885
|
const e = a.nodeName, s = a.getAttribute("class"), i = a.getAttribute("id"), n = "(?![a-zA-Z\\-]+)";
|
|
2886
2886
|
let r;
|
|
@@ -2904,14 +2904,14 @@ const lu = (a) => {
|
|
|
2904
2904
|
return (t = Tc[a]) !== null && t !== void 0 ? t : a;
|
|
2905
2905
|
}, cu = new RegExp("(".concat(de, ")"), "gi"), uu = (a) => dn(a.replace(cu, " $1 ").replace(/,/gi, " "));
|
|
2906
2906
|
var ga, pa, ma, ba, va, ya, _a;
|
|
2907
|
-
const
|
|
2907
|
+
const Nt = "(".concat(de, ")"), du = String.raw(ga || (ga = Ee(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Nt), fu = String.raw(pa || (pa = Ee(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Nt), gu = String.raw(ma || (ma = Ee(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Nt, Nt, Nt), pu = String.raw(ba || (ba = Ee(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Nt, Nt), mu = String.raw(va || (va = Ee(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Nt, Nt), bu = String.raw(ya || (ya = Ee(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Nt, Nt, Nt, Nt, Nt, Nt), ho = "(?:".concat(bu, "|").concat(mu, "|").concat(gu, "|").concat(pu, "|").concat(du, "|").concat(fu, ")"), vu = "(?:".concat(ho, "*)"), yu = String.raw(_a || (_a = Ee(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), vu), _u = new RegExp(yu), wu = new RegExp(ho), xu = new RegExp(ho, "g");
|
|
2908
2908
|
function bn(a) {
|
|
2909
2909
|
const t = [];
|
|
2910
|
-
if (!(a = uu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !_u.test(a)) return [...
|
|
2910
|
+
if (!(a = uu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !_u.test(a)) return [...Gt];
|
|
2911
2911
|
for (const e of a.matchAll(xu)) {
|
|
2912
2912
|
const s = wu.exec(e[0]);
|
|
2913
2913
|
if (!s) continue;
|
|
2914
|
-
let i =
|
|
2914
|
+
let i = Gt;
|
|
2915
2915
|
const n = s.filter(((g) => !!g)), [, r, ...o] = n, [h, l, c, u, d, f] = o.map(((g) => parseFloat(g)));
|
|
2916
2916
|
switch (r) {
|
|
2917
2917
|
case "translate":
|
|
@@ -2939,21 +2939,21 @@ function bn(a) {
|
|
|
2939
2939
|
function Su(a, t, e, s) {
|
|
2940
2940
|
const i = Array.isArray(t);
|
|
2941
2941
|
let n, r = t;
|
|
2942
|
-
if (a !== wt && a !==
|
|
2942
|
+
if (a !== wt && a !== Ht || t !== Bt) {
|
|
2943
2943
|
if (a === "strokeUniform") return t === "non-scaling-stroke";
|
|
2944
|
-
if (a === "strokeDashArray") r = t ===
|
|
2944
|
+
if (a === "strokeDashArray") r = t === Bt ? null : t.replace(/,/g, " ").split(/\s+/).map(parseFloat);
|
|
2945
2945
|
else if (a === "transformMatrix") r = e && e.transformMatrix ? mt(e.transformMatrix, bn(t)) : bn(t);
|
|
2946
|
-
else if (a === "visible") r = t !==
|
|
2946
|
+
else if (a === "visible") r = t !== Bt && t !== "hidden", e && e.visible === !1 && (r = !1);
|
|
2947
2947
|
else if (a === "opacity") r = parseFloat(t), e && e.opacity !== void 0 && (r *= e.opacity);
|
|
2948
2948
|
else if (a === "textAnchor") r = t === "start" ? et : t === "end" ? pt : $;
|
|
2949
|
-
else if (a === "charSpacing" || a === ls) n =
|
|
2949
|
+
else if (a === "charSpacing" || a === ls) n = It(t, s) / s * 1e3;
|
|
2950
2950
|
else if (a === "paintFirst") {
|
|
2951
|
-
const o = t.indexOf(wt), h = t.indexOf(
|
|
2952
|
-
r = wt, (o > -1 && h > -1 && h < o || o === -1 && h > -1) && (r =
|
|
2951
|
+
const o = t.indexOf(wt), h = t.indexOf(Ht);
|
|
2952
|
+
r = wt, (o > -1 && h > -1 && h < o || o === -1 && h > -1) && (r = Ht);
|
|
2953
2953
|
} else {
|
|
2954
2954
|
if (a === "href" || a === "xlink:href" || a === "font" || a === "id") return t;
|
|
2955
2955
|
if (a === "imageSmoothing") return t === "optimizeQuality";
|
|
2956
|
-
n = i ? t.map(
|
|
2956
|
+
n = i ? t.map(It) : It(t, s);
|
|
2957
2957
|
}
|
|
2958
2958
|
} else r = "";
|
|
2959
2959
|
return !i && isNaN(n) ? r : n;
|
|
@@ -2962,7 +2962,7 @@ function Cu(a, t) {
|
|
|
2962
2962
|
const e = a.match(Ac);
|
|
2963
2963
|
if (!e) return;
|
|
2964
2964
|
const s = e[1], i = e[3], n = e[4], r = e[5], o = e[6];
|
|
2965
|
-
s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize =
|
|
2965
|
+
s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = It(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
|
|
2966
2966
|
}
|
|
2967
2967
|
function Tr(a, t) {
|
|
2968
2968
|
a.replace(/;\s*$/, "").split(";").forEach(((e) => {
|
|
@@ -2984,7 +2984,7 @@ const Tu = { stroke: "strokeOpacity", fill: "fillOpacity" };
|
|
|
2984
2984
|
function Be(a, t, e) {
|
|
2985
2985
|
if (!a) return {};
|
|
2986
2986
|
let s, i = {}, n = Wr;
|
|
2987
|
-
a.parentNode && ia.test(a.parentNode.nodeName) && (i = Be(a.parentElement, t, e), i.fontSize && (s = n =
|
|
2987
|
+
a.parentNode && ia.test(a.parentNode.nodeName) && (i = Be(a.parentElement, t, e), i.fontSize && (s = n = It(i.fontSize)));
|
|
2988
2988
|
const r = w(w(w({}, t.reduce(((l, c) => {
|
|
2989
2989
|
const u = a.getAttribute(c);
|
|
2990
2990
|
return u && (l[c] = u), l;
|
|
@@ -2993,7 +2993,7 @@ function Be(a, t, e) {
|
|
|
2993
2993
|
for (const d in c) hu(l, d.split(" ")) && (u = w(w({}, u), c[d]));
|
|
2994
2994
|
return u;
|
|
2995
2995
|
})(a, e)), Au(a));
|
|
2996
|
-
r[tr] && a.setAttribute(tr, r[tr]), r[Qn] && (s =
|
|
2996
|
+
r[tr] && a.setAttribute(tr, r[tr]), r[Qn] && (s = It(r[Qn], n), r[Qn] = "".concat(s));
|
|
2997
2997
|
const o = {};
|
|
2998
2998
|
for (const l in r) {
|
|
2999
2999
|
const c = lu(l), u = Su(c, r[l], i, s);
|
|
@@ -3002,7 +3002,7 @@ function Be(a, t, e) {
|
|
|
3002
3002
|
o && o.font && Cu(o.font, o);
|
|
3003
3003
|
const h = w(w({}, i), o);
|
|
3004
3004
|
return ia.test(a.nodeName) ? h : (function(l) {
|
|
3005
|
-
const c =
|
|
3005
|
+
const c = Rt.getDefaults();
|
|
3006
3006
|
return Object.entries(Tu).forEach(((u) => {
|
|
3007
3007
|
let [d, f] = u;
|
|
3008
3008
|
if (l[f] === void 0 || l[d] === "") return;
|
|
@@ -3012,12 +3012,12 @@ function Be(a, t, e) {
|
|
|
3012
3012
|
}
|
|
3013
3013
|
if (l[d].indexOf("url(") === 0) return;
|
|
3014
3014
|
const g = new it(l[d]);
|
|
3015
|
-
l[d] = g.setAlpha(
|
|
3015
|
+
l[d] = g.setAlpha(nt(g.getAlpha() * l[f], 2)).toRgba();
|
|
3016
3016
|
})), l;
|
|
3017
3017
|
})(h);
|
|
3018
3018
|
}
|
|
3019
3019
|
const Eu = ["left", "top", "width", "height", "visible"], Wh = ["rx", "ry"];
|
|
3020
|
-
class _e extends
|
|
3020
|
+
class _e extends Rt {
|
|
3021
3021
|
static getDefaults() {
|
|
3022
3022
|
return w(w({}, super.getDefaults()), _e.ownDefaults);
|
|
3023
3023
|
}
|
|
@@ -3042,7 +3042,7 @@ class _e extends Lt {
|
|
|
3042
3042
|
`)];
|
|
3043
3043
|
}
|
|
3044
3044
|
static async fromElement(t, e, s) {
|
|
3045
|
-
const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c =
|
|
3045
|
+
const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c = at(i, Eu);
|
|
3046
3046
|
return new this(w(w(w({}, e), c), {}, { left: n, top: r, width: o, height: h, visible: !!(l && o && h) }));
|
|
3047
3047
|
}
|
|
3048
3048
|
}
|
|
@@ -3120,14 +3120,14 @@ class fi {
|
|
|
3120
3120
|
onBeforeLayout(t) {
|
|
3121
3121
|
const { target: e, type: s } = t, { canvas: i } = e;
|
|
3122
3122
|
if (s === Re || s === vn ? this.subscribeTargets(t) : s === lo && this.unsubscribeTargets(t), e.fire("layout:before", { context: t }), i && i.fire("object:layout:before", { target: e, context: t }), s === yn && t.deep) {
|
|
3123
|
-
const n =
|
|
3123
|
+
const n = at(t, ku);
|
|
3124
3124
|
e.forEachObject(((r) => r.layoutManager && r.layoutManager.performLayout(w(w({}, n), {}, { bubbles: !1, target: r }))));
|
|
3125
3125
|
}
|
|
3126
3126
|
}
|
|
3127
3127
|
getLayoutResult(t) {
|
|
3128
3128
|
const { target: e, strategy: s, type: i } = t, n = s.calcLayoutResult(t, e.getObjects());
|
|
3129
3129
|
if (!n) return;
|
|
3130
|
-
const r = i === Re ? new C() : e.getRelativeCenterPoint(), { center: o, correction: h = new C(), relativeCorrection: l = new C() } = n, c = r.subtract(o).add(h).transform(i === Re ?
|
|
3130
|
+
const r = i === Re ? new C() : e.getRelativeCenterPoint(), { center: o, correction: h = new C(), relativeCorrection: l = new C() } = n, c = r.subtract(o).add(h).transform(i === Re ? Gt : $t(e.calcOwnMatrix()), !0).add(l);
|
|
3131
3131
|
return { result: n, prevCenter: r, nextCenter: o, offset: c };
|
|
3132
3132
|
}
|
|
3133
3133
|
commitLayout(t, e) {
|
|
@@ -3146,7 +3146,7 @@ class fi {
|
|
|
3146
3146
|
s.set({ left: s.left + i.x, top: s.top + i.y });
|
|
3147
3147
|
}
|
|
3148
3148
|
onAfterLayout(t, e) {
|
|
3149
|
-
const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o =
|
|
3149
|
+
const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = at(t, Mu), { canvas: h } = s;
|
|
3150
3150
|
s.fire("layout:after", { context: t, result: e }), h && h.fire("object:layout:after", { context: t, result: e, target: s });
|
|
3151
3151
|
const l = s.parent;
|
|
3152
3152
|
n && l != null && l.layoutManager && ((o.path || (o.path = [])).push(s), l.layoutManager.performLayout(w(w({}, o), {}, { target: l }))), s.set("dirty", !0);
|
|
@@ -3168,7 +3168,7 @@ class Ou extends fi {
|
|
|
3168
3168
|
performLayout() {
|
|
3169
3169
|
}
|
|
3170
3170
|
}
|
|
3171
|
-
class Qt extends ih(
|
|
3171
|
+
class Qt extends ih(Rt) {
|
|
3172
3172
|
static getDefaults() {
|
|
3173
3173
|
return w(w({}, super.getDefaults()), Qt.ownDefaults);
|
|
3174
3174
|
}
|
|
@@ -3255,7 +3255,7 @@ class Qt extends ih(Lt) {
|
|
|
3255
3255
|
s > -1 && this._activeObjects.splice(s, 1);
|
|
3256
3256
|
}
|
|
3257
3257
|
shouldCache() {
|
|
3258
|
-
const t =
|
|
3258
|
+
const t = Rt.prototype.shouldCache.call(this);
|
|
3259
3259
|
if (t) {
|
|
3260
3260
|
for (let e = 0; e < this._objects.length; e++) if (this._objects[e].willDrawShadow()) return this.ownCaching = !1, !1;
|
|
3261
3261
|
}
|
|
@@ -3338,7 +3338,7 @@ class Qt extends ih(Lt) {
|
|
|
3338
3338
|
return this._createBaseClipPathSVGMarkup(e, { reviver: t });
|
|
3339
3339
|
}
|
|
3340
3340
|
static fromObject(t, e) {
|
|
3341
|
-
let { type: s, objects: i = [], layoutManager: n } = t, r =
|
|
3341
|
+
let { type: s, objects: i = [], layoutManager: n } = t, r = at(t, Pu);
|
|
3342
3342
|
return Promise.all([Ds(i, e), vi(r, e)]).then(((o) => {
|
|
3343
3343
|
let [h, l] = o;
|
|
3344
3344
|
const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new Ou() }));
|
|
@@ -3395,15 +3395,15 @@ const Fu = (a, t, e) => {
|
|
|
3395
3395
|
const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T), j = 0.5 * (-P * d - k * f), F = 0.5 * (-P * f + k * d), I = g ** 2, O = p ** 2, D = F ** 2, z = j ** 2, M = I * O - I * D - O * z;
|
|
3396
3396
|
let R = Math.abs(g), W = Math.abs(p);
|
|
3397
3397
|
if (M < 0) {
|
|
3398
|
-
const
|
|
3399
|
-
R *=
|
|
3398
|
+
const Wt = Math.sqrt(1 - M / (I * O));
|
|
3399
|
+
R *= Wt, W *= Wt;
|
|
3400
3400
|
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (I * D + O * z));
|
|
3401
|
-
const
|
|
3402
|
-
let V = wa(1, 0, (j -
|
|
3401
|
+
const ot = S * R * F / W, ht = -S * W * j / R, E = P * ot - k * ht + 0.5 * d, H = k * ot + P * ht + 0.5 * f;
|
|
3402
|
+
let V = wa(1, 0, (j - ot) / R, (F - ht) / W), J = wa((j - ot) / R, (F - ht) / W, (-j - ot) / R, (-F - ht) / W);
|
|
3403
3403
|
m === 0 && J > 0 ? J -= 2 * A : m === 1 && J < 0 && (J += 2 * A);
|
|
3404
|
-
const
|
|
3405
|
-
let
|
|
3406
|
-
for (let
|
|
3404
|
+
const Tt = Math.ceil(Math.abs(J / A * 2)), st = [], N = J / Tt, lt = 8 / 3 * Math.sin(N / 4) * Math.sin(N / 4) / Math.sin(N / 2);
|
|
3405
|
+
let xt = V + N;
|
|
3406
|
+
for (let Wt = 0; Wt < Tt; Wt++) st[Wt] = Lu(V, xt, P, k, R, W, E, H, lt, y, _), y = st[Wt][5], _ = st[Wt][6], V = xt, xt += N;
|
|
3407
3407
|
return st;
|
|
3408
3408
|
})(l - a, c - t, i, n, o, h, r);
|
|
3409
3409
|
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;
|
|
@@ -3566,7 +3566,7 @@ const Fu = (a, t, e) => {
|
|
|
3566
3566
|
e = a[l], l + 1 < a.length && (s = a[l + 1]);
|
|
3567
3567
|
}
|
|
3568
3568
|
return h && (i = e.x > a[l - 2].x ? 1 : e.x === a[l - 2].x ? 0 : -1, n = e.y > a[l - 2].y ? 1 : e.y === a[l - 2].y ? 0 : -1), r.push(["L", e.x + i * t, e.y + n * t]), r;
|
|
3569
|
-
}, sl = (a, t) => a.map(((e) => e.map(((s, i) => i === 0 || t === void 0 ? s :
|
|
3569
|
+
}, sl = (a, t) => a.map(((e) => e.map(((s, i) => i === 0 || t === void 0 ? s : nt(s, t))).join(" "))).join(" ");
|
|
3570
3570
|
function wn(a, t) {
|
|
3571
3571
|
const e = a.style;
|
|
3572
3572
|
e && t && (typeof t == "string" ? e.cssText += ";" + t : Object.entries(t).forEach(((s) => {
|
|
@@ -3592,7 +3592,7 @@ const sn = (a, t) => {
|
|
|
3592
3592
|
a.transformMatrix && (((s) => {
|
|
3593
3593
|
if (s.transformMatrix) {
|
|
3594
3594
|
const { scaleX: i, scaleY: n, angle: r, skewX: o } = hs(s.transformMatrix);
|
|
3595
|
-
s.flipX = !1, s.flipY = !1, s.set(
|
|
3595
|
+
s.flipX = !1, s.flipY = !1, s.set(Vt, i), s.set(te, n), s.angle = r, s.skewX = o, s.skewY = 0;
|
|
3596
3596
|
}
|
|
3597
3597
|
})(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, $, $);
|
|
3598
3598
|
};
|
|
@@ -3627,17 +3627,17 @@ var Xu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro,
|
|
|
3627
3627
|
s.inverted && !i.inverted && (s = t, i = a), xr(i, (e = i.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
|
|
3628
3628
|
const n = s.inverted && i.inverted;
|
|
3629
3629
|
return n && (s.inverted = i.inverted = !1), new Qt([s], { clipPath: i, inverted: n });
|
|
3630
|
-
}, multiplyTransformMatrices: mt, multiplyTransformMatrixArray: kn, parsePath: el, parsePreserveAspectRatioAttribute: eo, parseUnit:
|
|
3630
|
+
}, multiplyTransformMatrices: mt, multiplyTransformMatrixArray: kn, parsePath: el, parsePreserveAspectRatioAttribute: eo, parseUnit: It, pick: gs, projectStrokeOnPoints: Hh, qrDecompose: hs, radiansToDegrees: Te, removeFromArray: Ke, removeTransformFromObject: (a, t) => {
|
|
3631
3631
|
const e = $t(t), s = mt(e, a.calcOwnMatrix());
|
|
3632
3632
|
Ls(a, s);
|
|
3633
|
-
}, removeTransformMatrixForSvgParsing: sn, request: il, requestAnimFrame: ii, resetObjectTransform: bh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: so, saveObjectTransform: Qr, sendObjectToPlane: xr, sendPointToPlane: as, sendVectorToPlane: vh, setStyle: wn, sin: pe, sizeAfterTransform: Pn, string: au, stylesFromArray: Vh, stylesToArray: Gh, toBlob: qr, toDataURL: $r, toFixed:
|
|
3633
|
+
}, removeTransformMatrixForSvgParsing: sn, request: il, requestAnimFrame: ii, resetObjectTransform: bh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: so, saveObjectTransform: Qr, sendObjectToPlane: xr, sendPointToPlane: as, sendVectorToPlane: vh, setStyle: wn, sin: pe, sizeAfterTransform: Pn, string: au, stylesFromArray: Vh, stylesToArray: Gh, toBlob: qr, toDataURL: $r, toFixed: nt, transformPath: (a, t, e) => (e && (t = mt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
|
|
3634
3634
|
const i = [...s];
|
|
3635
3635
|
for (let n = 1; n < s.length - 1; n += 2) {
|
|
3636
|
-
const { x: r, y: o } =
|
|
3636
|
+
const { x: r, y: o } = Mt({ x: s[n], y: s[n + 1] }, t);
|
|
3637
3637
|
i[n] = r, i[n + 1] = o;
|
|
3638
3638
|
}
|
|
3639
3639
|
return i;
|
|
3640
|
-
}))), transformPoint:
|
|
3640
|
+
}))), transformPoint: Mt });
|
|
3641
3641
|
class Uu extends gh {
|
|
3642
3642
|
constructor(t) {
|
|
3643
3643
|
let { allowTouchScrolling: e = !1, containerClass: s = "" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -3657,7 +3657,7 @@ class Uu extends gh {
|
|
|
3657
3657
|
}
|
|
3658
3658
|
applyCanvasStyle(t, e) {
|
|
3659
3659
|
const { styles: s, allowTouchScrolling: i } = e;
|
|
3660
|
-
wn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" :
|
|
3660
|
+
wn(t, w(w({}, s), {}, { "touch-action": i ? "manipulation" : Bt })), Yo(t);
|
|
3661
3661
|
}
|
|
3662
3662
|
setDimensions(t, e) {
|
|
3663
3663
|
super.setDimensions(t, e);
|
|
@@ -3743,7 +3743,7 @@ class Nn extends yi {
|
|
|
3743
3743
|
_shouldCenterTransform(t, e, s) {
|
|
3744
3744
|
if (!t) return;
|
|
3745
3745
|
let i;
|
|
3746
|
-
return e === En || e ===
|
|
3746
|
+
return e === En || e === Vt || e === te || e === ci ? i = this.centeredScaling || t.centeredScaling : e === Ur && (i = this.centeredRotation || t.centeredRotation), i ? !s : s;
|
|
3747
3747
|
}
|
|
3748
3748
|
_getOriginFromCorner(t, e) {
|
|
3749
3749
|
const s = { x: t.originX, y: t.originY };
|
|
@@ -3764,7 +3764,7 @@ class Nn extends yi {
|
|
|
3764
3764
|
_drawSelection(t) {
|
|
3765
3765
|
const { x: e, y: s, deltaX: i, deltaY: n } = this._groupSelector, r = new C(e, s).transform(this.viewportTransform), o = new C(e + i, s + n).transform(this.viewportTransform), h = this.selectionLineWidth / 2;
|
|
3766
3766
|
let l = Math.min(r.x, o.x), c = Math.min(r.y, o.y), u = Math.max(r.x, o.x), d = Math.max(r.y, o.y);
|
|
3767
|
-
this.selectionColor && (t.fillStyle = this.selectionColor, t.fillRect(l, c, u - l, d - c)), this.selectionLineWidth && this.selectionBorderColor && (t.lineWidth = this.selectionLineWidth, t.strokeStyle = this.selectionBorderColor, l += h, c += h, u -= h, d -= h,
|
|
3767
|
+
this.selectionColor && (t.fillStyle = this.selectionColor, t.fillRect(l, c, u - l, d - c)), this.selectionLineWidth && this.selectionBorderColor && (t.lineWidth = this.selectionLineWidth, t.strokeStyle = this.selectionBorderColor, l += h, c += h, u -= h, d -= h, Rt.prototype._setLineDash.call(this, t, this.selectionDashArray), t.strokeRect(l, c, u - l, d - c));
|
|
3768
3768
|
}
|
|
3769
3769
|
findTarget(t) {
|
|
3770
3770
|
if (this.skipTargetFind) return;
|
|
@@ -3916,7 +3916,7 @@ class Nn extends yi {
|
|
|
3916
3916
|
_realizeGroupTransformOnObject(t) {
|
|
3917
3917
|
const { group: e } = t;
|
|
3918
3918
|
if (e && Je(e) && this._activeObject === e) {
|
|
3919
|
-
const s = gs(t, ["angle", "flipX", "flipY", et,
|
|
3919
|
+
const s = gs(t, ["angle", "flipX", "flipY", et, Vt, te, Ns, js, qt]);
|
|
3920
3920
|
return mh(t, e.calcOwnMatrix()), s;
|
|
3921
3921
|
}
|
|
3922
3922
|
return {};
|
|
@@ -4022,7 +4022,7 @@ class Pr extends Nn {
|
|
|
4022
4022
|
r.save(), r.transform(...this.viewportTransform), e && (r.save(), e.transform(r), e.renderDragSourceEffect(t), r.restore(), i = !0), s && (r.save(), s.transform(r), s.renderDropTargetEffect(t), r.restore(), i = !0), r.restore(), i && (this.contextTopDirty = !0);
|
|
4023
4023
|
}
|
|
4024
4024
|
_onDragEnd(t) {
|
|
4025
|
-
const e = !!t.dataTransfer && t.dataTransfer.dropEffect !==
|
|
4025
|
+
const e = !!t.dataTransfer && t.dataTransfer.dropEffect !== Bt, s = e ? this._activeObject : void 0, i = { e: t, target: this._dragSource, subTargets: this.targets, dragSource: this._dragSource, didDrop: e, dropTarget: s };
|
|
4026
4026
|
se(this.upperCanvasEl, "drag", this._onDragProgress), this.fire("dragend", i), this._dragSource && this._dragSource.fire("dragend", i), delete this._dragSource, this._onMouseUp(t);
|
|
4027
4027
|
}
|
|
4028
4028
|
_onDragProgress(t) {
|
|
@@ -4220,7 +4220,7 @@ class Pr extends Nn {
|
|
|
4220
4220
|
this._draggedoverTarget = t;
|
|
4221
4221
|
}
|
|
4222
4222
|
fireSyntheticInOutEvents(t, e) {
|
|
4223
|
-
let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o =
|
|
4223
|
+
let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = at(e, $u);
|
|
4224
4224
|
const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = qu[t], d = i !== s;
|
|
4225
4225
|
if (i && d) {
|
|
4226
4226
|
const f = w(w({}, o), {}, { e: r, target: i, nextTarget: s }, ys(this, r));
|
|
@@ -4362,7 +4362,7 @@ class Qs {
|
|
|
4362
4362
|
}
|
|
4363
4363
|
toSVG(t) {
|
|
4364
4364
|
let { additionalTransform: e } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4365
|
-
const s = [], i = this.gradientTransform ? this.gradientTransform.concat() :
|
|
4365
|
+
const s = [], i = this.gradientTransform ? this.gradientTransform.concat() : Gt.concat(), n = this.gradientUnits === "pixels" ? "userSpaceOnUse" : "objectBoundingBox", r = this.colorStops.map(((u) => w({}, u))).sort(((u, d) => u.offset - d.offset));
|
|
4366
4366
|
let o = -this.offsetX, h = -this.offsetY;
|
|
4367
4367
|
var l;
|
|
4368
4368
|
n === "objectBoundingBox" ? (o /= t.width, h /= t.height) : (o += t.width / 2, h += t.height / 2), (l = t) && typeof l._renderPathCommands == "function" && this.gradientUnits !== "percentage" && (o -= t.pathOffset.x, h -= t.pathOffset.y), i[4] -= o, i[5] -= h;
|
|
@@ -4435,7 +4435,7 @@ class nr {
|
|
|
4435
4435
|
toObject() {
|
|
4436
4436
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
4437
4437
|
const { repeat: e, crossOrigin: s } = this;
|
|
4438
|
-
return w(w({}, gs(this, t)), {}, { type: "pattern", source: this.sourceToString(), repeat: e, crossOrigin: s, offsetX:
|
|
4438
|
+
return w(w({}, gs(this, t)), {}, { type: "pattern", source: this.sourceToString(), repeat: e, crossOrigin: s, offsetX: nt(this.offsetX, tt.NUM_FRACTION_DIGITS), offsetY: nt(this.offsetY, tt.NUM_FRACTION_DIGITS), patternTransform: this.patternTransform ? [...this.patternTransform] : null });
|
|
4439
4439
|
}
|
|
4440
4440
|
toSVG(t) {
|
|
4441
4441
|
let { width: e, height: s } = t;
|
|
@@ -4444,16 +4444,16 @@ class nr {
|
|
|
4444
4444
|
`);
|
|
4445
4445
|
}
|
|
4446
4446
|
static async fromObject(t, e) {
|
|
4447
|
-
let { type: s, source: i, patternTransform: n } = t, r =
|
|
4447
|
+
let { type: s, source: i, patternTransform: n } = t, r = at(t, sd);
|
|
4448
4448
|
const o = await ni(i, w(w({}, e), {}, { crossOrigin: r.crossOrigin }));
|
|
4449
4449
|
return new this(w(w({}, r), {}, { patternTransform: n && n.slice(0), source: o }));
|
|
4450
4450
|
}
|
|
4451
4451
|
}
|
|
4452
4452
|
x(nr, "type", "Pattern"), L.setClass(nr), L.setClass(nr, "pattern");
|
|
4453
4453
|
const id = ["path", "left", "top"], nd = ["d"];
|
|
4454
|
-
class Ze extends
|
|
4454
|
+
class Ze extends Rt {
|
|
4455
4455
|
constructor(t) {
|
|
4456
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r =
|
|
4456
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = at(e, id);
|
|
4457
4457
|
super(), Object.assign(this, Ze.ownDefaults), this.setOptions(r), this._setPath(t || [], !0), typeof i == "number" && this.set(et, i), typeof n == "number" && this.set(qt, n);
|
|
4458
4458
|
}
|
|
4459
4459
|
_setPath(t, e) {
|
|
@@ -4505,7 +4505,7 @@ class Ze extends Lt {
|
|
|
4505
4505
|
}
|
|
4506
4506
|
_getOffsetTransform() {
|
|
4507
4507
|
const t = tt.NUM_FRACTION_DIGITS;
|
|
4508
|
-
return " translate(".concat(
|
|
4508
|
+
return " translate(".concat(nt(-this.pathOffset.x, t), ", ").concat(nt(-this.pathOffset.y, t), ")");
|
|
4509
4509
|
}
|
|
4510
4510
|
toClipPathSVG(t) {
|
|
4511
4511
|
const e = this._getOffsetTransform();
|
|
@@ -4555,12 +4555,12 @@ class Ze extends Lt {
|
|
|
4555
4555
|
}
|
|
4556
4556
|
static async fromElement(t, e, s) {
|
|
4557
4557
|
const i = Be(t, this.ATTRIBUTE_NAMES, s), { d: n } = i;
|
|
4558
|
-
return new this(n, w(w(w({},
|
|
4558
|
+
return new this(n, w(w(w({}, at(i, nd)), e), {}, { left: void 0, top: void 0 }));
|
|
4559
4559
|
}
|
|
4560
4560
|
}
|
|
4561
4561
|
x(Ze, "type", "Path"), x(Ze, "cacheProperties", [...je, "path", "fillRule"]), x(Ze, "ATTRIBUTE_NAMES", [...$e, "d"]), L.setClass(Ze), L.setSVGClass(Ze);
|
|
4562
4562
|
const rd = ["left", "top", "radius"], ll = ["radius", "startAngle", "endAngle", "counterClockwise"];
|
|
4563
|
-
class Oe extends
|
|
4563
|
+
class Oe extends Rt {
|
|
4564
4564
|
static getDefaults() {
|
|
4565
4565
|
return w(w({}, super.getDefaults()), Oe.ownDefaults);
|
|
4566
4566
|
}
|
|
@@ -4574,7 +4574,7 @@ class Oe extends Lt {
|
|
|
4574
4574
|
t.beginPath(), t.arc(0, 0, this.radius, ft(this.startAngle), ft(this.endAngle), this.counterClockwise), this._renderPaintInOrder(t);
|
|
4575
4575
|
}
|
|
4576
4576
|
getRadiusX() {
|
|
4577
|
-
return this.get("radius") * this.get(
|
|
4577
|
+
return this.get("radius") * this.get(Vt);
|
|
4578
4578
|
}
|
|
4579
4579
|
getRadiusY() {
|
|
4580
4580
|
return this.get("radius") * this.get(te);
|
|
@@ -4598,7 +4598,7 @@ class Oe extends Lt {
|
|
|
4598
4598
|
}
|
|
4599
4599
|
static async fromElement(t, e, s) {
|
|
4600
4600
|
const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, radius: o = 0 } = i;
|
|
4601
|
-
return new this(w(w({},
|
|
4601
|
+
return new this(w(w({}, at(i, rd)), {}, { radius: o, left: n - o, top: r - o }));
|
|
4602
4602
|
}
|
|
4603
4603
|
static fromObject(t) {
|
|
4604
4604
|
return super._fromObject(t);
|
|
@@ -4606,7 +4606,7 @@ class Oe extends Lt {
|
|
|
4606
4606
|
}
|
|
4607
4607
|
x(Oe, "type", "Circle"), x(Oe, "cacheProperties", [...je, ...ll]), x(Oe, "ownDefaults", { radius: 0, startAngle: 0, endAngle: 360, counterClockwise: !1 }), x(Oe, "ATTRIBUTE_NAMES", ["cx", "cy", "r", ...$e]), L.setClass(Oe), L.setSVGClass(Oe);
|
|
4608
4608
|
const od = ["x1", "y1", "x2", "y2"], ad = ["x1", "y1", "x2", "y2"], Or = ["x1", "x2", "y1", "y2"];
|
|
4609
|
-
class Qe extends
|
|
4609
|
+
class Qe extends Rt {
|
|
4610
4610
|
constructor() {
|
|
4611
4611
|
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] : {};
|
|
4612
4612
|
super(), Object.assign(this, Qe.ownDefaults), this.setOptions(n), this.x1 = t, this.x2 = s, this.y1 = e, this.y2 = i, this._setWidthHeight();
|
|
@@ -4652,15 +4652,15 @@ class Qe extends Lt {
|
|
|
4652
4652
|
}
|
|
4653
4653
|
static async fromElement(t, e, s) {
|
|
4654
4654
|
const i = Be(t, this.ATTRIBUTE_NAMES, s), { x1: n = 0, y1: r = 0, x2: o = 0, y2: h = 0 } = i;
|
|
4655
|
-
return new this([n, r, o, h],
|
|
4655
|
+
return new this([n, r, o, h], at(i, od));
|
|
4656
4656
|
}
|
|
4657
4657
|
static fromObject(t) {
|
|
4658
|
-
let { x1: e, y1: s, x2: i, y2: n } = t, r =
|
|
4658
|
+
let { x1: e, y1: s, x2: i, y2: n } = t, r = at(t, ad);
|
|
4659
4659
|
return this._fromObject(w(w({}, r), {}, { points: [e, s, i, n] }), { extraParam: "points" });
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
4662
|
x(Qe, "type", "Line"), x(Qe, "cacheProperties", [...je, ...Or]), x(Qe, "ATTRIBUTE_NAMES", $e.concat(Or)), L.setClass(Qe), L.setSVGClass(Qe);
|
|
4663
|
-
class ts extends
|
|
4663
|
+
class ts extends Rt {
|
|
4664
4664
|
static getDefaults() {
|
|
4665
4665
|
return w(w({}, super.getDefaults()), ts.ownDefaults);
|
|
4666
4666
|
}
|
|
@@ -4678,7 +4678,7 @@ class ts extends Lt {
|
|
|
4678
4678
|
}
|
|
4679
4679
|
x(ts, "type", "Triangle"), x(ts, "ownDefaults", { width: 100, height: 100 }), L.setClass(ts), L.setSVGClass(ts);
|
|
4680
4680
|
const cl = ["rx", "ry"];
|
|
4681
|
-
class De extends
|
|
4681
|
+
class De extends Rt {
|
|
4682
4682
|
static getDefaults() {
|
|
4683
4683
|
return w(w({}, super.getDefaults()), De.ownDefaults);
|
|
4684
4684
|
}
|
|
@@ -4696,7 +4696,7 @@ class De extends Lt {
|
|
|
4696
4696
|
return this;
|
|
4697
4697
|
}
|
|
4698
4698
|
getRx() {
|
|
4699
|
-
return this.get("rx") * this.get(
|
|
4699
|
+
return this.get("rx") * this.get(Vt);
|
|
4700
4700
|
}
|
|
4701
4701
|
getRy() {
|
|
4702
4702
|
return this.get("ry") * this.get(te);
|
|
@@ -4725,7 +4725,7 @@ function hd(a) {
|
|
|
4725
4725
|
}
|
|
4726
4726
|
x(De, "type", "Ellipse"), x(De, "cacheProperties", [...je, ...cl]), x(De, "ownDefaults", { rx: 0, ry: 0 }), x(De, "ATTRIBUTE_NAMES", [...$e, "cx", "cy", "rx", "ry"]), L.setClass(De), L.setSVGClass(De);
|
|
4727
4727
|
const ld = ["left", "top"], ul = { exactBoundingBox: !1 };
|
|
4728
|
-
class ce extends
|
|
4728
|
+
class ce extends Rt {
|
|
4729
4729
|
static getDefaults() {
|
|
4730
4730
|
return w(w({}, super.getDefaults()), ce.ownDefaults);
|
|
4731
4731
|
}
|
|
@@ -4745,7 +4745,7 @@ class ce extends Lt {
|
|
|
4745
4745
|
t = w({ scaleX: this.scaleX, scaleY: this.scaleY, skewX: this.skewX, skewY: this.skewY, strokeLineCap: this.strokeLineCap, strokeLineJoin: this.strokeLineJoin, strokeMiterLimit: this.strokeMiterLimit, strokeUniform: this.strokeUniform, strokeWidth: this.strokeWidth }, t || {});
|
|
4746
4746
|
const e = this.exactBoundingBox ? this._projectStrokeOnPoints(t).map(((l) => l.projectedPoint)) : this.points;
|
|
4747
4747
|
if (e.length === 0) return { left: 0, top: 0, width: 0, height: 0, pathOffset: new C(), strokeOffset: new C(), strokeDiff: new C() };
|
|
4748
|
-
const s = Se(e), i = bi(w(w({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Se(this.points.map(((l) =>
|
|
4748
|
+
const s = Se(e), i = bi(w(w({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Se(this.points.map(((l) => Mt(l, i, !0)))), r = new C(this.scaleX, this.scaleY);
|
|
4749
4749
|
let o = s.left + s.width / 2, h = s.top + s.height / 2;
|
|
4750
4750
|
return this.exactBoundingBox && (o -= h * Math.tan(ft(this.skewX)), h -= o * Math.tan(ft(this.skewY))), w(w({}, s), {}, { pathOffset: new C(o, h), strokeOffset: new C(n.left, n.top).subtract(new C(s.left, s.top)).multiply(r), strokeDiff: new C(s.width, s.height).subtract(new C(n.width, n.height)).multiply(r) });
|
|
4751
4751
|
}
|
|
@@ -4784,7 +4784,7 @@ class ce extends Lt {
|
|
|
4784
4784
|
}
|
|
4785
4785
|
_set(t, e) {
|
|
4786
4786
|
const s = this.initialized && this[t] !== e, i = super._set(t, e);
|
|
4787
|
-
return this.exactBoundingBox && s && ((t ===
|
|
4787
|
+
return this.exactBoundingBox && s && ((t === Vt || t === te) && this.strokeUniform && this.constructor.layoutProperties.includes("strokeUniform") || this.constructor.layoutProperties.includes(t)) && this.setDimensions(), i;
|
|
4788
4788
|
}
|
|
4789
4789
|
toObject() {
|
|
4790
4790
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
@@ -4795,7 +4795,7 @@ class ce extends Lt {
|
|
|
4795
4795
|
}
|
|
4796
4796
|
_toSVG() {
|
|
4797
4797
|
const t = [], e = this.pathOffset.x, s = this.pathOffset.y, i = tt.NUM_FRACTION_DIGITS;
|
|
4798
|
-
for (let n = 0, r = this.points.length; n < r; n++) t.push(
|
|
4798
|
+
for (let n = 0, r = this.points.length; n < r; n++) t.push(nt(this.points[n].x - e, i), ",", nt(this.points[n].y - s, i), " ");
|
|
4799
4799
|
return ["<".concat(this.constructor.type.toLowerCase(), " "), "COMMON_PARTS", 'points="'.concat(t.join(""), `" />
|
|
4800
4800
|
`)];
|
|
4801
4801
|
}
|
|
@@ -4814,7 +4814,7 @@ class ce extends Lt {
|
|
|
4814
4814
|
return this.points.length;
|
|
4815
4815
|
}
|
|
4816
4816
|
static async fromElement(t, e, s) {
|
|
4817
|
-
return new this(hd(t.getAttribute("points")), w(w({},
|
|
4817
|
+
return new this(hd(t.getAttribute("points")), w(w({}, at(Be(t, this.ATTRIBUTE_NAMES, s), ld)), e));
|
|
4818
4818
|
}
|
|
4819
4819
|
static fromObject(t) {
|
|
4820
4820
|
return this._fromObject(t, { extraParam: "points" });
|
|
@@ -4827,7 +4827,7 @@ class Mi extends ce {
|
|
|
4827
4827
|
}
|
|
4828
4828
|
}
|
|
4829
4829
|
x(Mi, "ownDefaults", ul), x(Mi, "type", "Polygon"), L.setClass(Mi), L.setSVGClass(Mi);
|
|
4830
|
-
class dl extends
|
|
4830
|
+
class dl extends Rt {
|
|
4831
4831
|
isEmptyStyles(t) {
|
|
4832
4832
|
if (!this.styles || t !== void 0 && !this.styles[t]) return !0;
|
|
4833
4833
|
const e = t === void 0 ? this.styles : { line: this.styles[t] };
|
|
@@ -4912,19 +4912,19 @@ const cd = / +/g, ud = /"/g;
|
|
|
4912
4912
|
function rr(a, t, e, s, i) {
|
|
4913
4913
|
return " ".concat((function(n, r) {
|
|
4914
4914
|
let { left: o, top: h, width: l, height: c } = r, u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : tt.NUM_FRACTION_DIGITS;
|
|
4915
|
-
const d = ui(wt, n, !1), [f, g, p, b] = [o, h, l, c].map(((m) =>
|
|
4915
|
+
const d = ui(wt, n, !1), [f, g, p, b] = [o, h, l, c].map(((m) => nt(m, u)));
|
|
4916
4916
|
return "<rect ".concat(d, ' x="').concat(f, '" y="').concat(g, '" width="').concat(p, '" height="').concat(b, '"></rect>');
|
|
4917
4917
|
})(a, { left: t, top: e, width: s, height: i }), `
|
|
4918
4918
|
`);
|
|
4919
4919
|
}
|
|
4920
4920
|
const dd = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
|
|
4921
4921
|
let or;
|
|
4922
|
-
class
|
|
4922
|
+
class kt extends dl {
|
|
4923
4923
|
static getDefaults() {
|
|
4924
|
-
return w(w({}, super.getDefaults()),
|
|
4924
|
+
return w(w({}, super.getDefaults()), kt.ownDefaults);
|
|
4925
4925
|
}
|
|
4926
4926
|
constructor(t, e) {
|
|
4927
|
-
super(), x(this, "__charBounds", []), Object.assign(this,
|
|
4927
|
+
super(), x(this, "__charBounds", []), Object.assign(this, kt.ownDefaults), this.setOptions(e), this.styles || (this.styles = {}), this.text = t, this.initialized = !0, this.path && this.setPathInfo(), this.initDimensions(), this.setCoords();
|
|
4928
4928
|
}
|
|
4929
4929
|
setPathInfo() {
|
|
4930
4930
|
const t = this.path;
|
|
@@ -4971,7 +4971,7 @@ class Mt extends dl {
|
|
|
4971
4971
|
e && !e.isNotVisible() && e._render(t), this._setTextStyles(t), this._renderTextLinesBackground(t), this._renderTextDecoration(t, "underline"), this._renderText(t), this._renderTextDecoration(t, "overline"), this._renderTextDecoration(t, "linethrough");
|
|
4972
4972
|
}
|
|
4973
4973
|
_renderText(t) {
|
|
4974
|
-
this.paintFirst ===
|
|
4974
|
+
this.paintFirst === Ht ? (this._renderTextStroke(t), this._renderTextFill(t)) : (this._renderTextFill(t), this._renderTextStroke(t));
|
|
4975
4975
|
}
|
|
4976
4976
|
_setTextStyles(t, e, s) {
|
|
4977
4977
|
if (t.textBaseline = "alphabetic", this.path) switch (this.pathAlign) {
|
|
@@ -5214,7 +5214,7 @@ class Mt extends dl {
|
|
|
5214
5214
|
}
|
|
5215
5215
|
_getFontDeclaration() {
|
|
5216
5216
|
let { fontFamily: t = this.fontFamily, fontStyle: e = this.fontStyle, fontWeight: s = this.fontWeight, fontSize: i = this.fontSize } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
|
|
5217
|
-
const r = t.includes("'") || t.includes('"') || t.includes(",") ||
|
|
5217
|
+
const r = t.includes("'") || t.includes('"') || t.includes(",") || kt.genericFonts.includes(t.toLowerCase()) ? t : '"'.concat(t, '"');
|
|
5218
5218
|
return [e, s, "".concat(n ? this.CACHE_FONT_SIZE : i, "px"), r].join(" ");
|
|
5219
5219
|
}
|
|
5220
5220
|
render(t) {
|
|
@@ -5246,7 +5246,7 @@ class Mt extends dl {
|
|
|
5246
5246
|
return 1;
|
|
5247
5247
|
}
|
|
5248
5248
|
static async fromElement(t, e, s) {
|
|
5249
|
-
const i = Be(t,
|
|
5249
|
+
const i = Be(t, kt.ATTRIBUTE_NAMES, s), n = w(w({}, e), i), { textAnchor: r = et, textDecoration: o = "", dx: h = 0, dy: l = 0, top: c = 0, left: u = 0, fontSize: d = Wr, strokeWidth: f = 1 } = n, g = at(n, dd), p = new this(dn(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;
|
|
5250
5250
|
let y = 0;
|
|
5251
5251
|
return r === $ && (y = p.getScaledWidth() / 2), r === pt && (y = p.getScaledWidth()), p.set({ left: p.left - y, top: p.top - (v - p.fontSize * (0.07 + p._fontSizeFraction)) / p.lineHeight, strokeWidth: f }), p;
|
|
5252
5252
|
}
|
|
@@ -5254,7 +5254,7 @@ class Mt extends dl {
|
|
|
5254
5254
|
return this._fromObject(w(w({}, t), {}, { styles: Vh(t.styles || {}, t.text) }), { extraParam: "text" });
|
|
5255
5255
|
}
|
|
5256
5256
|
}
|
|
5257
|
-
x(
|
|
5257
|
+
x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(kt, "ownDefaults", Cc), x(kt, "type", "Text"), x(kt, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), x(kt, "ATTRIBUTE_NAMES", $e.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), Nh(kt, [class extends Sh {
|
|
5258
5258
|
_toSVG() {
|
|
5259
5259
|
const a = this._getSVGLeftTopOffsets(), t = this._getSVGTextAndBg(a.textTop, a.textLeft);
|
|
5260
5260
|
return this._wrapSVGTextAndBg(t);
|
|
@@ -5280,17 +5280,17 @@ x(Mt, "textLayoutProperties", Th), x(Mt, "cacheProperties", [...je, ...Eh]), x(M
|
|
|
5280
5280
|
return { textSpans: e, textBgRects: s };
|
|
5281
5281
|
}
|
|
5282
5282
|
_createTextCharSpan(a, t, e, s, i) {
|
|
5283
|
-
const n = tt.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(cd)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(
|
|
5283
|
+
const n = tt.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(cd)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(nt(h, n), '" ') : "", { angle: c, renderLeft: u, renderTop: d, width: f } = i;
|
|
5284
5284
|
let g = "";
|
|
5285
5285
|
if (u !== void 0) {
|
|
5286
5286
|
const p = f / 2;
|
|
5287
|
-
c && (g = ' rotate="'.concat(
|
|
5287
|
+
c && (g = ' rotate="'.concat(nt(Te(c), n), '"'));
|
|
5288
5288
|
const b = fs({ angle: Te(c) });
|
|
5289
5289
|
b[4] = u, b[5] = d;
|
|
5290
5290
|
const m = new C(-p, 0).transform(b);
|
|
5291
5291
|
e = m.x, s = m.y;
|
|
5292
5292
|
}
|
|
5293
|
-
return '<tspan x="'.concat(
|
|
5293
|
+
return '<tspan x="'.concat(nt(e, n), '" y="').concat(nt(s, n), '" ').concat(l).concat(g).concat(o, ">").concat(zh(a), "</tspan>");
|
|
5294
5294
|
}
|
|
5295
5295
|
_setSVGTextLineText(a, t, e, s) {
|
|
5296
5296
|
const i = this.getHeightOfLine(t), n = this.textAlign.includes(we), r = this._textLines[t];
|
|
@@ -5314,16 +5314,16 @@ x(Mt, "textLayoutProperties", Th), x(Mt, "cacheProperties", [...je, ...Eh]), x(M
|
|
|
5314
5314
|
return { lineTop: e, offset: (this._fontSizeMult - this._fontSizeFraction) * s / (this.lineHeight * this._fontSizeMult) };
|
|
5315
5315
|
}
|
|
5316
5316
|
getSvgStyles(a) {
|
|
5317
|
-
return "".concat(super.getSvgStyles(a), " text-decoration-thickness: ").concat(
|
|
5317
|
+
return "".concat(super.getSvgStyles(a), " text-decoration-thickness: ").concat(nt(this.textDecorationThickness * this.getObjectScaling().y / 10, tt.NUM_FRACTION_DIGITS), "%; white-space: pre;");
|
|
5318
5318
|
}
|
|
5319
5319
|
getSvgSpanStyles(a, t) {
|
|
5320
5320
|
const { fontFamily: e, strokeWidth: s, stroke: i, fill: n, fontSize: r, fontStyle: o, fontWeight: h, deltaY: l, textDecorationThickness: c, linethrough: u, overline: d, underline: f } = a, g = this.getSvgTextDecoration({ underline: f ?? this.underline, overline: d ?? this.overline, linethrough: u ?? this.linethrough }), p = c || this.textDecorationThickness;
|
|
5321
|
-
return [i ? ui(
|
|
5321
|
+
return [i ? ui(Ht, i) : "", s ? "stroke-width: ".concat(s, "; ") : "", e ? "font-family: ".concat(e.includes("'") || e.includes('"') ? e : "'".concat(e, "'"), "; ") : "", r ? "font-size: ".concat(r, "px; ") : "", o ? "font-style: ".concat(o, "; ") : "", h ? "font-weight: ".concat(h, "; ") : "", g ? "text-decoration: ".concat(g, "; text-decoration-thickness: ").concat(nt(p * this.getObjectScaling().y / 10, tt.NUM_FRACTION_DIGITS), "%; ") : "", n ? ui(wt, n) : "", l ? "baseline-shift: ".concat(-l, "; ") : "", t ? "white-space: pre; " : ""].join("");
|
|
5322
5322
|
}
|
|
5323
5323
|
getSvgTextDecoration(a) {
|
|
5324
5324
|
return ["overline", "underline", "line-through"].filter(((t) => a[t.replace("-", "")])).join(" ");
|
|
5325
5325
|
}
|
|
5326
|
-
}]), L.setClass(
|
|
5326
|
+
}]), L.setClass(kt), L.setSVGClass(kt);
|
|
5327
5327
|
class fd {
|
|
5328
5328
|
constructor(t) {
|
|
5329
5329
|
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;
|
|
@@ -5357,7 +5357,7 @@ class fd {
|
|
|
5357
5357
|
const y = { stroke: "transparent", fill: "transparent", textBackgroundColor: "transparent" };
|
|
5358
5358
|
r.setSelectionStyles(y, 0, i), r.setSelectionStyles(y, n, r.text.length), r.dirty = !0;
|
|
5359
5359
|
const _ = r.toCanvasElement({ enableRetinaScaling: o.enableRetinaScaling, viewportTransform: !0 });
|
|
5360
|
-
r.backgroundColor = m, r.styles = v, r.dirty = !0, wn(_, { position: "fixed", left: "".concat(-_.width, "px"), border:
|
|
5360
|
+
r.backgroundColor = m, r.styles = v, r.dirty = !0, wn(_, { position: "fixed", left: "".concat(-_.width, "px"), border: Bt, width: "".concat(_.width / d, "px"), height: "".concat(_.height / d, "px") }), this.__dragImageDisposer && this.__dragImageDisposer(), this.__dragImageDisposer = () => {
|
|
5361
5361
|
_.remove();
|
|
5362
5362
|
}, ue(t.target || this.target.hiddenTextarea).body.appendChild(_), (s = t.dataTransfer) === null || s === void 0 || s.setDragImage(_, b.x, b.y);
|
|
5363
5363
|
}
|
|
@@ -5415,8 +5415,8 @@ class fd {
|
|
|
5415
5415
|
let { e } = t;
|
|
5416
5416
|
if (this.isActive() && this.__dragStartFired && this.__dragStartSelection) {
|
|
5417
5417
|
var s;
|
|
5418
|
-
const i = this.target, n = this.target.canvas, { selectionStart: r, selectionEnd: o } = this.__dragStartSelection, h = ((s = e.dataTransfer) === null || s === void 0 ? void 0 : s.dropEffect) ||
|
|
5419
|
-
h ===
|
|
5418
|
+
const i = this.target, n = this.target.canvas, { selectionStart: r, selectionEnd: o } = this.__dragStartSelection, h = ((s = e.dataTransfer) === null || s === void 0 ? void 0 : s.dropEffect) || Bt;
|
|
5419
|
+
h === Bt ? (i.selectionStart = r, i.selectionEnd = o, i._updateTextarea(), i.hiddenTextarea.focus()) : (i.clearContextTop(), h === "move" && (i.removeChars(r, o), i.selectionStart = i.selectionEnd = r, i.hiddenTextarea && (i.hiddenTextarea.value = i.text), i._updateTextarea(), i.fire(an, { index: r, action: "dragend" }), n.fire("text:changed", { target: i }), n.requestRenderAll()), i.exitEditing());
|
|
5420
5420
|
}
|
|
5421
5421
|
this.__dragImageDisposer && this.__dragImageDisposer(), delete this.__dragImageDisposer, delete this.__dragStartSelection, this.__isDraggingOver = !1;
|
|
5422
5422
|
}
|
|
@@ -5425,7 +5425,7 @@ class fd {
|
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
const Ca = /[ \n\.,;!\?\-]/;
|
|
5428
|
-
class gd extends
|
|
5428
|
+
class gd extends kt {
|
|
5429
5429
|
constructor() {
|
|
5430
5430
|
super(...arguments), x(this, "_currentCursorOpacity", 1);
|
|
5431
5431
|
}
|
|
@@ -6375,12 +6375,12 @@ function hr() {
|
|
|
6375
6375
|
return !ar && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (ar = _d()), ar;
|
|
6376
6376
|
}
|
|
6377
6377
|
const wd = ["filters", "resizeFilter", "src", "crossOrigin", "type"], gl = ["cropX", "cropY"];
|
|
6378
|
-
class
|
|
6378
|
+
class Pt extends Rt {
|
|
6379
6379
|
static getDefaults() {
|
|
6380
|
-
return w(w({}, super.getDefaults()),
|
|
6380
|
+
return w(w({}, super.getDefaults()), Pt.ownDefaults);
|
|
6381
6381
|
}
|
|
6382
6382
|
constructor(t, e) {
|
|
6383
|
-
super(), x(this, "_lastScaleX", 1), x(this, "_lastScaleY", 1), x(this, "_filterScalingX", 1), x(this, "_filterScalingY", 1), this.filters = [], Object.assign(this,
|
|
6383
|
+
super(), x(this, "_lastScaleX", 1), x(this, "_lastScaleY", 1), x(this, "_filterScalingX", 1), x(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, Pt.ownDefaults), this.setOptions(e), this.cacheKey = "texture".concat(Xe()), this.setElement(typeof t == "string" ? (this.canvas && ue(this.canvas.getElement()) || Is()).getElementById(t) : t, e);
|
|
6384
6384
|
}
|
|
6385
6385
|
getElement() {
|
|
6386
6386
|
return this._element;
|
|
@@ -6388,7 +6388,7 @@ class Ot extends Lt {
|
|
|
6388
6388
|
setElement(t) {
|
|
6389
6389
|
var e;
|
|
6390
6390
|
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6391
|
-
this.removeTexture(this.cacheKey), this.removeTexture("".concat(this.cacheKey, "_filtered")), this._element = t, this._originalElement = t, this._setWidthHeight(s), (e = t.classList) === null || e === void 0 || e.add(
|
|
6391
|
+
this.removeTexture(this.cacheKey), this.removeTexture("".concat(this.cacheKey, "_filtered")), this._element = t, this._originalElement = t, this._setWidthHeight(s), (e = t.classList) === null || e === void 0 || e.add(Pt.CSS_CANVAS), this.filters.length !== 0 && this.applyFilters(), this.resizeFilter && this.applyResizeFilters();
|
|
6392
6392
|
}
|
|
6393
6393
|
removeTexture(t) {
|
|
6394
6394
|
const e = hr(!1);
|
|
@@ -6503,10 +6503,10 @@ class Ot extends Lt {
|
|
|
6503
6503
|
parsePreserveAspectRatioAttribute() {
|
|
6504
6504
|
const t = eo(this.preserveAspectRatio || ""), e = this.width, s = this.height, i = { width: e, height: s };
|
|
6505
6505
|
let n, r = this._element.width, o = this._element.height, h = 1, l = 1, c = 0, u = 0, d = 0, f = 0;
|
|
6506
|
-
return !t || t.alignX ===
|
|
6506
|
+
return !t || t.alignX === Bt && t.alignY === Bt ? (h = e / r, l = s / o) : (t.meetOrSlice === "meet" && (h = l = Yh(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 = $h(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 };
|
|
6507
6507
|
}
|
|
6508
6508
|
static fromObject(t, e) {
|
|
6509
|
-
let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h =
|
|
6509
|
+
let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = at(t, wd);
|
|
6510
6510
|
return Promise.all([ni(n, w(w({}, e), {}, { crossOrigin: r })), s && Ds(s, e), i && Ds([i], e), vi(h, e)]).then(((l) => {
|
|
6511
6511
|
let [c, u = [], [d] = [], f = {}] = l;
|
|
6512
6512
|
return new this(c, w(w({}, h), {}, { src: n, filters: u, resizeFilter: d }, f));
|
|
@@ -6528,22 +6528,22 @@ function lr(a) {
|
|
|
6528
6528
|
let e, s, i = 1, n = 1, r = 0, o = 0;
|
|
6529
6529
|
const h = a.getAttribute("width"), l = a.getAttribute("height"), c = a.getAttribute("x") || 0, u = a.getAttribute("y") || 0, d = !(t && na.test(t)), f = !h || !l || h === "100%" || l === "100%";
|
|
6530
6530
|
let g = "", p = 0, b = 0;
|
|
6531
|
-
if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" +
|
|
6531
|
+
if (d && (c || u) && a.parentNode && a.parentNode.nodeName !== "#document" && (g = " translate(" + It(c || "0") + " " + It(u || "0") + ") ", e = (a.getAttribute("transform") || "") + g, a.setAttribute("transform", e), a.removeAttribute("x"), a.removeAttribute("y")), d && f) return { width: 0, height: 0 };
|
|
6532
6532
|
const m = { width: 0, height: 0 };
|
|
6533
|
-
if (d) return m.width =
|
|
6533
|
+
if (d) return m.width = It(h), m.height = It(l), m;
|
|
6534
6534
|
const v = t.match(na);
|
|
6535
6535
|
r = -parseFloat(v[1]), o = -parseFloat(v[2]);
|
|
6536
6536
|
const y = parseFloat(v[3]), _ = parseFloat(v[4]);
|
|
6537
|
-
m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width =
|
|
6537
|
+
m.minX = r, m.minY = o, m.viewBoxWidth = y, m.viewBoxHeight = _, f ? (m.width = y, m.height = _) : (m.width = It(h), m.height = It(l), i = m.width / y, n = m.height / _);
|
|
6538
6538
|
const S = eo(a.getAttribute("preserveAspectRatio") || "");
|
|
6539
|
-
if (S.alignX !==
|
|
6540
|
-
if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" +
|
|
6539
|
+
if (S.alignX !== Bt && (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;
|
|
6540
|
+
if ((c || u) && a.parentNode.nodeName !== "#document" && (g = " translate(" + It(c || "0") + " " + It(u || "0") + ") "), e = g + " matrix(" + i + " 0 0 " + n + " " + (r * i + p) + " " + (o * n + b) + ") ", a.nodeName === "svg") {
|
|
6541
6541
|
for (s = a.ownerDocument.createElementNS(Sr, "g"); a.firstChild; ) s.appendChild(a.firstChild);
|
|
6542
6542
|
a.appendChild(s);
|
|
6543
6543
|
} else s = a, s.removeAttribute("x"), s.removeAttribute("y"), e = s.getAttribute("transform") + e;
|
|
6544
6544
|
return s.setAttribute("transform", e), m;
|
|
6545
6545
|
}
|
|
6546
|
-
x(
|
|
6546
|
+
x(Pt, "type", "Image"), x(Pt, "cacheProperties", [...je, ...gl]), x(Pt, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), x(Pt, "CSS_CANVAS", "canvas-img"), x(Pt, "ATTRIBUTE_NAMES", [...$e, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "href", "crossOrigin", "image-rendering"]), L.setClass(Pt), L.setSVGClass(Pt);
|
|
6547
6547
|
const xn = (a) => a.tagName.replace("svg:", ""), xd = On(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
|
|
6548
6548
|
function pl(a, t) {
|
|
6549
6549
|
let e, s, i, n, r = [];
|
|
@@ -6606,7 +6606,7 @@ class Td {
|
|
|
6606
6606
|
const e = Ma(t);
|
|
6607
6607
|
if (e) {
|
|
6608
6608
|
const s = await e.fromElement(t, this.options, this.cssRules);
|
|
6609
|
-
return this.resolveGradient(s, t, wt), this.resolveGradient(s, t,
|
|
6609
|
+
return this.resolveGradient(s, t, wt), this.resolveGradient(s, t, Ht), s instanceof Pt && s._originalElement ? sn(s, s.parsePreserveAspectRatioAttribute()) : sn(s), await this.resolveClipPath(s, t), this.reviver && this.reviver(t, s), s;
|
|
6610
6610
|
}
|
|
6611
6611
|
return null;
|
|
6612
6612
|
}
|
|
@@ -6710,12 +6710,12 @@ const jn = (a) => a.webgl !== void 0, uo = "precision highp float", Md = `
|
|
|
6710
6710
|
void main() {
|
|
6711
6711
|
gl_FragColor = texture2D(uTexture, vTexCoord);
|
|
6712
6712
|
}`), Pd = ["type"], Od = ["type"], Dd = new RegExp(uo, "g");
|
|
6713
|
-
class
|
|
6713
|
+
class At {
|
|
6714
6714
|
get type() {
|
|
6715
6715
|
return this.constructor.type;
|
|
6716
6716
|
}
|
|
6717
6717
|
constructor() {
|
|
6718
|
-
let t =
|
|
6718
|
+
let t = at(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Pd);
|
|
6719
6719
|
Object.assign(this, this.constructor.defaults, t);
|
|
6720
6720
|
}
|
|
6721
6721
|
getFragmentSource() {
|
|
@@ -6807,10 +6807,10 @@ class Ct {
|
|
|
6807
6807
|
return this.toObject();
|
|
6808
6808
|
}
|
|
6809
6809
|
static async fromObject(t, e) {
|
|
6810
|
-
return new this(
|
|
6810
|
+
return new this(at(t, Od));
|
|
6811
6811
|
}
|
|
6812
6812
|
}
|
|
6813
|
-
x(
|
|
6813
|
+
x(At, "type", "BaseFilter"), x(At, "uniformLocations", []);
|
|
6814
6814
|
const Rd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
|
|
6815
6815
|
`, screen: `gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
|
|
6816
6816
|
`, add: `gl_FragColor.rgb += uColor.rgb;
|
|
@@ -6839,7 +6839,7 @@ const Rd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
|
|
|
6839
6839
|
gl_FragColor.rgb *= (1.0 - uColor.a);
|
|
6840
6840
|
gl_FragColor.rgb += uColor.rgb;
|
|
6841
6841
|
` };
|
|
6842
|
-
class Fi extends
|
|
6842
|
+
class Fi extends At {
|
|
6843
6843
|
getCacheKey() {
|
|
6844
6844
|
return "".concat(this.type, "_").concat(this.mode);
|
|
6845
6845
|
}
|
|
@@ -6931,7 +6931,7 @@ const Ld = { multiply: `
|
|
|
6931
6931
|
gl_FragColor = color;
|
|
6932
6932
|
}
|
|
6933
6933
|
` }, Fd = ["type", "image"];
|
|
6934
|
-
class Ii extends
|
|
6934
|
+
class Ii extends At {
|
|
6935
6935
|
getCacheKey() {
|
|
6936
6936
|
return "".concat(this.type, "_").concat(this.mode);
|
|
6937
6937
|
}
|
|
@@ -6988,12 +6988,12 @@ class Ii extends Ct {
|
|
|
6988
6988
|
return w(w({}, super.toObject()), {}, { image: this.image && this.image.toObject() });
|
|
6989
6989
|
}
|
|
6990
6990
|
static async fromObject(t, e) {
|
|
6991
|
-
let { type: s, image: i } = t, n =
|
|
6992
|
-
return
|
|
6991
|
+
let { type: s, image: i } = t, n = at(t, Fd);
|
|
6992
|
+
return Pt.fromObject(i, e).then(((r) => new this(w(w({}, n), {}, { image: r }))));
|
|
6993
6993
|
}
|
|
6994
6994
|
}
|
|
6995
6995
|
x(Ii, "type", "BlendImage"), x(Ii, "defaults", { mode: "multiply", alpha: 1 }), x(Ii, "uniformLocations", ["uTransformMatrix", "uImage"]), L.setClass(Ii);
|
|
6996
|
-
class Ni extends
|
|
6996
|
+
class Ni extends At {
|
|
6997
6997
|
getFragmentSource() {
|
|
6998
6998
|
return `
|
|
6999
6999
|
precision highp float;
|
|
@@ -7078,7 +7078,7 @@ class Ni extends Ct {
|
|
|
7078
7078
|
}
|
|
7079
7079
|
}
|
|
7080
7080
|
x(Ni, "type", "Blur"), x(Ni, "defaults", { blur: 0 }), x(Ni, "uniformLocations", ["uDelta"]), L.setClass(Ni);
|
|
7081
|
-
class ji extends
|
|
7081
|
+
class ji extends At {
|
|
7082
7082
|
getFragmentSource() {
|
|
7083
7083
|
return `
|
|
7084
7084
|
precision highp float;
|
|
@@ -7106,7 +7106,7 @@ class ji extends Ct {
|
|
|
7106
7106
|
}
|
|
7107
7107
|
x(ji, "type", "Brightness"), x(ji, "defaults", { brightness: 0 }), x(ji, "uniformLocations", ["uBrightness"]), L.setClass(ji);
|
|
7108
7108
|
const bl = { matrix: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], colorsOnly: !0 };
|
|
7109
|
-
class Cs extends
|
|
7109
|
+
class Cs extends At {
|
|
7110
7110
|
getFragmentSource() {
|
|
7111
7111
|
return `
|
|
7112
7112
|
precision highp float;
|
|
@@ -7156,7 +7156,7 @@ ps("Technicolor", [1.91252, -0.85453, -0.09155, 0, 0.04624, -0.30878, 1.76589, -
|
|
|
7156
7156
|
ps("Polaroid", [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0]);
|
|
7157
7157
|
ps("Sepia", [0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0]);
|
|
7158
7158
|
ps("BlackWhite", [1.5, 1.5, 1.5, 0, -1, 1.5, 1.5, 1.5, 0, -1, 1.5, 1.5, 1.5, 0, -1, 0, 0, 0, 1, 0]);
|
|
7159
|
-
class Oa extends
|
|
7159
|
+
class Oa extends At {
|
|
7160
7160
|
constructor() {
|
|
7161
7161
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7162
7162
|
super(t), this.subFilters = t.subFilters || [];
|
|
@@ -7177,7 +7177,7 @@ class Oa extends Ct {
|
|
|
7177
7177
|
}
|
|
7178
7178
|
}
|
|
7179
7179
|
x(Oa, "type", "Composed"), L.setClass(Oa);
|
|
7180
|
-
class Bi extends
|
|
7180
|
+
class Bi extends At {
|
|
7181
7181
|
getFragmentSource() {
|
|
7182
7182
|
return `
|
|
7183
7183
|
precision highp float;
|
|
@@ -7349,7 +7349,7 @@ const Id = { Convolute_3_1: `
|
|
|
7349
7349
|
gl_FragColor.a = alpha;
|
|
7350
7350
|
}
|
|
7351
7351
|
` };
|
|
7352
|
-
class Hi extends
|
|
7352
|
+
class Hi extends At {
|
|
7353
7353
|
getCacheKey() {
|
|
7354
7354
|
return "".concat(this.type, "_").concat(Math.sqrt(this.matrix.length), "_").concat(this.opaque ? 1 : 0);
|
|
7355
7355
|
}
|
|
@@ -7374,7 +7374,7 @@ class Hi extends Ct {
|
|
|
7374
7374
|
}
|
|
7375
7375
|
x(Hi, "type", "Convolute"), x(Hi, "defaults", { opaque: !1, matrix: [0, 0, 0, 0, 1, 0, 0, 0, 0] }), x(Hi, "uniformLocations", ["uMatrix", "uOpaque", "uHalfSize", "uSize"]), L.setClass(Hi);
|
|
7376
7376
|
const vl = "Gamma";
|
|
7377
|
-
class zi extends
|
|
7377
|
+
class zi extends At {
|
|
7378
7378
|
getFragmentSource() {
|
|
7379
7379
|
return `
|
|
7380
7380
|
precision highp float;
|
|
@@ -7446,7 +7446,7 @@ const Nd = { average: `
|
|
|
7446
7446
|
gl_FragColor = vec4(average, average, average, col.a);
|
|
7447
7447
|
}
|
|
7448
7448
|
` };
|
|
7449
|
-
class Gi extends
|
|
7449
|
+
class Gi extends At {
|
|
7450
7450
|
applyTo2d(t) {
|
|
7451
7451
|
let { imageData: { data: e } } = t;
|
|
7452
7452
|
for (let s, i = 0; i < e.length; i += 4) {
|
|
@@ -7495,7 +7495,7 @@ class ur extends Cs {
|
|
|
7495
7495
|
}
|
|
7496
7496
|
}
|
|
7497
7497
|
x(ur, "type", "HueRotation"), x(ur, "defaults", jd), L.setClass(ur);
|
|
7498
|
-
class Vi extends
|
|
7498
|
+
class Vi extends At {
|
|
7499
7499
|
applyTo2d(t) {
|
|
7500
7500
|
let { imageData: { data: e } } = t;
|
|
7501
7501
|
for (let s = 0; s < e.length; s += 4) e[s] = 255 - e[s], e[s + 1] = 255 - e[s + 1], e[s + 2] = 255 - e[s + 2], this.alpha && (e[s + 3] = 255 - e[s + 3]);
|
|
@@ -7529,7 +7529,7 @@ class Vi extends Ct {
|
|
|
7529
7529
|
}
|
|
7530
7530
|
}
|
|
7531
7531
|
x(Vi, "type", "Invert"), x(Vi, "defaults", { alpha: !1, invert: !0 }), x(Vi, "uniformLocations", ["uInvert", "uAlpha"]), L.setClass(Vi);
|
|
7532
|
-
class Wi extends
|
|
7532
|
+
class Wi extends At {
|
|
7533
7533
|
getFragmentSource() {
|
|
7534
7534
|
return `
|
|
7535
7535
|
precision highp float;
|
|
@@ -7564,7 +7564,7 @@ class Wi extends Ct {
|
|
|
7564
7564
|
}
|
|
7565
7565
|
}
|
|
7566
7566
|
x(Wi, "type", "Noise"), x(Wi, "defaults", { noise: 0 }), x(Wi, "uniformLocations", ["uNoise", "uSeed"]), L.setClass(Wi);
|
|
7567
|
-
class Xi extends
|
|
7567
|
+
class Xi extends At {
|
|
7568
7568
|
applyTo2d(t) {
|
|
7569
7569
|
let { imageData: { data: e, width: s, height: i } } = t;
|
|
7570
7570
|
for (let n = 0; n < i; n += this.blocksize) for (let r = 0; r < s; r += this.blocksize) {
|
|
@@ -7604,7 +7604,7 @@ class Xi extends Ct {
|
|
|
7604
7604
|
}
|
|
7605
7605
|
}
|
|
7606
7606
|
x(Xi, "type", "Pixelate"), x(Xi, "defaults", { blocksize: 4 }), x(Xi, "uniformLocations", ["uBlocksize"]), L.setClass(Xi);
|
|
7607
|
-
class Ui extends
|
|
7607
|
+
class Ui extends At {
|
|
7608
7608
|
getFragmentSource() {
|
|
7609
7609
|
return `
|
|
7610
7610
|
precision highp float;
|
|
@@ -7634,7 +7634,7 @@ void main() {
|
|
|
7634
7634
|
}
|
|
7635
7635
|
}
|
|
7636
7636
|
x(Ui, "type", "RemoveColor"), x(Ui, "defaults", { color: "#FFFFFF", distance: 0.02, useAlpha: !1 }), x(Ui, "uniformLocations", ["uLow", "uHigh"]), L.setClass(Ui);
|
|
7637
|
-
class Yi extends
|
|
7637
|
+
class Yi extends At {
|
|
7638
7638
|
sendUniformData(t, e) {
|
|
7639
7639
|
t.uniform2fv(e.uDelta, this.horizontal ? [1 / this.width, 0] : [0, 1 / this.height]), t.uniform1fv(e.uTaps, this.taps);
|
|
7640
7640
|
}
|
|
@@ -7754,7 +7754,7 @@ class Yi extends Ct {
|
|
|
7754
7754
|
}
|
|
7755
7755
|
}
|
|
7756
7756
|
x(Yi, "type", "Resize"), x(Yi, "defaults", { resizeType: "hermite", scaleX: 1, scaleY: 1, lanczosLobes: 3 }), x(Yi, "uniformLocations", ["uDelta", "uTaps"]), L.setClass(Yi);
|
|
7757
|
-
class $i extends
|
|
7757
|
+
class $i extends At {
|
|
7758
7758
|
getFragmentSource() {
|
|
7759
7759
|
return `
|
|
7760
7760
|
precision highp float;
|
|
@@ -7788,7 +7788,7 @@ class $i extends Ct {
|
|
|
7788
7788
|
}
|
|
7789
7789
|
}
|
|
7790
7790
|
x($i, "type", "Saturation"), x($i, "defaults", { saturation: 0 }), x($i, "uniformLocations", ["uSaturation"]), L.setClass($i);
|
|
7791
|
-
class qi extends
|
|
7791
|
+
class qi extends At {
|
|
7792
7792
|
getFragmentSource() {
|
|
7793
7793
|
return `
|
|
7794
7794
|
precision highp float;
|
|
@@ -7869,11 +7869,11 @@ ai.d(Y, {
|
|
|
7869
7869
|
),
|
|
7870
7870
|
DrawLayer: () => (
|
|
7871
7871
|
/* reexport */
|
|
7872
|
-
|
|
7872
|
+
Lt
|
|
7873
7873
|
),
|
|
7874
7874
|
FeatureTest: () => (
|
|
7875
7875
|
/* reexport */
|
|
7876
|
-
|
|
7876
|
+
zt
|
|
7877
7877
|
),
|
|
7878
7878
|
GlobalWorkerOptions: () => (
|
|
7879
7879
|
/* reexport */
|
|
@@ -7929,7 +7929,7 @@ ai.d(Y, {
|
|
|
7929
7929
|
),
|
|
7930
7930
|
TextLayer: () => (
|
|
7931
7931
|
/* reexport */
|
|
7932
|
-
|
|
7932
|
+
Ft
|
|
7933
7933
|
),
|
|
7934
7934
|
TouchManager: () => (
|
|
7935
7935
|
/* reexport */
|
|
@@ -8012,7 +8012,7 @@ ai.d(Y, {
|
|
|
8012
8012
|
fg
|
|
8013
8013
|
)
|
|
8014
8014
|
});
|
|
8015
|
-
const
|
|
8015
|
+
const Dt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), yl = [1, 0, 0, 1, 0, 0], Rr = [1e-3, 0, 0, 1e-3, 0, 0], Bd = 1e7, dr = 1.35, Jt = {
|
|
8016
8016
|
ANY: 1,
|
|
8017
8017
|
DISPLAY: 2,
|
|
8018
8018
|
PRINT: 4,
|
|
@@ -8057,7 +8057,7 @@ const Rt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
8057
8057
|
COPY_FOR_ACCESSIBILITY: 512,
|
|
8058
8058
|
ASSEMBLE: 1024,
|
|
8059
8059
|
PRINT_HIGH_QUALITY: 2048
|
|
8060
|
-
},
|
|
8060
|
+
}, Et = {
|
|
8061
8061
|
FILL: 0,
|
|
8062
8062
|
STROKE: 1,
|
|
8063
8063
|
FILL_STROKE: 2,
|
|
@@ -8068,7 +8068,7 @@ const Rt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
8068
8068
|
GRAYSCALE_1BPP: 1,
|
|
8069
8069
|
RGB_24BPP: 2,
|
|
8070
8070
|
RGBA_32BPP: 3
|
|
8071
|
-
},
|
|
8071
|
+
}, St = {
|
|
8072
8072
|
TEXT: 1,
|
|
8073
8073
|
LINK: 2,
|
|
8074
8074
|
FREETEXT: 3,
|
|
@@ -8205,11 +8205,11 @@ function zn(a) {
|
|
|
8205
8205
|
function K(a) {
|
|
8206
8206
|
Hn >= Bn.WARNINGS && console.log(`Warning: ${a}`);
|
|
8207
8207
|
}
|
|
8208
|
-
function
|
|
8208
|
+
function rt(a) {
|
|
8209
8209
|
throw new Error(a);
|
|
8210
8210
|
}
|
|
8211
8211
|
function _t(a, t) {
|
|
8212
|
-
a ||
|
|
8212
|
+
a || rt(t);
|
|
8213
8213
|
}
|
|
8214
8214
|
function Xd(a) {
|
|
8215
8215
|
switch (a?.protocol) {
|
|
@@ -8289,7 +8289,7 @@ class Ue extends qe {
|
|
|
8289
8289
|
}
|
|
8290
8290
|
}
|
|
8291
8291
|
function _l(a) {
|
|
8292
|
-
(typeof a != "object" || a?.length === void 0) &&
|
|
8292
|
+
(typeof a != "object" || a?.length === void 0) && rt("Invalid argument for bytesToString");
|
|
8293
8293
|
const t = a.length, e = 8192;
|
|
8294
8294
|
if (t < e)
|
|
8295
8295
|
return String.fromCharCode.apply(null, a);
|
|
@@ -8301,7 +8301,7 @@ function _l(a) {
|
|
|
8301
8301
|
return s.join("");
|
|
8302
8302
|
}
|
|
8303
8303
|
function Gn(a) {
|
|
8304
|
-
typeof a != "string" &&
|
|
8304
|
+
typeof a != "string" && rt("Invalid argument for stringToBytes");
|
|
8305
8305
|
const t = a.length, e = new Uint8Array(t);
|
|
8306
8306
|
for (let s = 0; s < t; ++s)
|
|
8307
8307
|
e[s] = a.charCodeAt(s) & 255;
|
|
@@ -8327,7 +8327,7 @@ function Kd() {
|
|
|
8327
8327
|
return !1;
|
|
8328
8328
|
}
|
|
8329
8329
|
}
|
|
8330
|
-
class
|
|
8330
|
+
class zt {
|
|
8331
8331
|
static get isLittleEndian() {
|
|
8332
8332
|
return Z(this, "isLittleEndian", qd());
|
|
8333
8333
|
}
|
|
@@ -8721,7 +8721,7 @@ function us(a, t, e = !1, s = !0) {
|
|
|
8721
8721
|
pageHeight: n
|
|
8722
8722
|
} = t.rawDims, {
|
|
8723
8723
|
style: r
|
|
8724
|
-
} = a, o =
|
|
8724
|
+
} = a, o = zt.isCSSRoundSupported, h = `var(--scale-factor) * ${i}px`, l = `var(--scale-factor) * ${n}px`, c = o ? `round(down, ${h}, var(--scale-round-x, 1px))` : `calc(${h})`, u = o ? `round(down, ${l}, var(--scale-round-y, 1px))` : `calc(${l})`;
|
|
8725
8725
|
!e || t.rotation % 180 === 0 ? (r.width = c, r.height = u) : (r.width = u, r.height = c);
|
|
8726
8726
|
}
|
|
8727
8727
|
s && a.setAttribute("data-main-rotation", t.rotation);
|
|
@@ -9089,7 +9089,7 @@ class xi {
|
|
|
9089
9089
|
this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
|
|
9090
9090
|
const {
|
|
9091
9091
|
isMac: e
|
|
9092
|
-
} =
|
|
9092
|
+
} = zt.platform;
|
|
9093
9093
|
for (const [s, i, n = {}] of t)
|
|
9094
9094
|
for (const r of s) {
|
|
9095
9095
|
const o = r.startsWith("mac+");
|
|
@@ -10509,7 +10509,7 @@ class U {
|
|
|
10509
10509
|
return !1;
|
|
10510
10510
|
}
|
|
10511
10511
|
static paste(t, e) {
|
|
10512
|
-
|
|
10512
|
+
rt("Not implemented");
|
|
10513
10513
|
}
|
|
10514
10514
|
get propertiesToUpdate() {
|
|
10515
10515
|
return [];
|
|
@@ -10759,7 +10759,7 @@ class U {
|
|
|
10759
10759
|
e.preventDefault();
|
|
10760
10760
|
const {
|
|
10761
10761
|
isMac: s
|
|
10762
|
-
} =
|
|
10762
|
+
} = zt.platform;
|
|
10763
10763
|
if (e.button !== 0 || e.ctrlKey && s)
|
|
10764
10764
|
return;
|
|
10765
10765
|
this.#s?.toggle(!1);
|
|
@@ -10861,8 +10861,8 @@ class U {
|
|
|
10861
10861
|
const {
|
|
10862
10862
|
screenX: M,
|
|
10863
10863
|
screenY: R
|
|
10864
|
-
} = e, [W,
|
|
10865
|
-
[j, F] = this.screenToPageTranslation(M - W, R -
|
|
10864
|
+
} = e, [W, ot] = this.#c;
|
|
10865
|
+
[j, F] = this.screenToPageTranslation(M - W, R - ot), this.#c[0] = M, this.#c[1] = R;
|
|
10866
10866
|
}
|
|
10867
10867
|
if ([j, F] = g(j / s, F / i), m) {
|
|
10868
10868
|
const M = Math.hypot(o, h);
|
|
@@ -10956,7 +10956,7 @@ class U {
|
|
|
10956
10956
|
pointerdown(t) {
|
|
10957
10957
|
const {
|
|
10958
10958
|
isMac: e
|
|
10959
|
-
} =
|
|
10959
|
+
} = zt.platform;
|
|
10960
10960
|
if (t.button !== 0 || t.ctrlKey && e) {
|
|
10961
10961
|
t.preventDefault();
|
|
10962
10962
|
return;
|
|
@@ -10973,7 +10973,7 @@ class U {
|
|
|
10973
10973
|
#G(t) {
|
|
10974
10974
|
const {
|
|
10975
10975
|
isMac: e
|
|
10976
|
-
} =
|
|
10976
|
+
} = zt.platform;
|
|
10977
10977
|
t.ctrlKey && !e || t.shiftKey || t.metaKey && e ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
|
|
10978
10978
|
}
|
|
10979
10979
|
#V(t) {
|
|
@@ -11119,7 +11119,7 @@ class U {
|
|
|
11119
11119
|
};
|
|
11120
11120
|
}
|
|
11121
11121
|
serialize(t = !1, e = null) {
|
|
11122
|
-
|
|
11122
|
+
rt("An editor must be serializable");
|
|
11123
11123
|
}
|
|
11124
11124
|
static async deserialize(t, e, s) {
|
|
11125
11125
|
const i = new this.prototype.constructor({
|
|
@@ -11510,7 +11510,7 @@ class Sl extends _o {
|
|
|
11510
11510
|
};
|
|
11511
11511
|
}
|
|
11512
11512
|
get print() {
|
|
11513
|
-
|
|
11513
|
+
rt("Should not call PrintAnnotationStorage.print");
|
|
11514
11514
|
}
|
|
11515
11515
|
get serializable() {
|
|
11516
11516
|
return this.#t;
|
|
@@ -11565,7 +11565,7 @@ class cf {
|
|
|
11565
11565
|
}
|
|
11566
11566
|
return;
|
|
11567
11567
|
}
|
|
11568
|
-
|
|
11568
|
+
rt("Not implemented: loadSystemFont without the Font Loading API.");
|
|
11569
11569
|
}
|
|
11570
11570
|
}
|
|
11571
11571
|
async bind(t) {
|
|
@@ -11603,7 +11603,7 @@ class cf {
|
|
|
11603
11603
|
}
|
|
11604
11604
|
get isSyncFontLoadingSupported() {
|
|
11605
11605
|
let t = !1;
|
|
11606
|
-
return (
|
|
11606
|
+
return (Dt || typeof navigator < "u" && typeof navigator?.userAgent == "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (t = !0), Z(this, "isSyncFontLoadingSupported", t);
|
|
11607
11607
|
}
|
|
11608
11608
|
_queueLoadingCallback(t) {
|
|
11609
11609
|
function e() {
|
|
@@ -11740,7 +11740,7 @@ function Ia() {
|
|
|
11740
11740
|
function Ut(a) {
|
|
11741
11741
|
if (a instanceof Ue || a instanceof Lr || a instanceof gi || a instanceof Da || a instanceof Sn || a instanceof fr)
|
|
11742
11742
|
return a;
|
|
11743
|
-
switch (a instanceof Error || typeof a == "object" && a !== null ||
|
|
11743
|
+
switch (a instanceof Error || typeof a == "object" && a !== null || rt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), a.name) {
|
|
11744
11744
|
case "AbortException":
|
|
11745
11745
|
return new Ue(a.message);
|
|
11746
11746
|
case "InvalidPDFException":
|
|
@@ -12061,7 +12061,7 @@ class Cl {
|
|
|
12061
12061
|
t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
|
|
12062
12062
|
}
|
|
12063
12063
|
_createCanvas(t, e) {
|
|
12064
|
-
|
|
12064
|
+
rt("Abstract method `_createCanvas` called.");
|
|
12065
12065
|
}
|
|
12066
12066
|
}
|
|
12067
12067
|
class df extends Cl {
|
|
@@ -12101,7 +12101,7 @@ class Al {
|
|
|
12101
12101
|
});
|
|
12102
12102
|
}
|
|
12103
12103
|
async _fetch(t) {
|
|
12104
|
-
|
|
12104
|
+
rt("Abstract method `_fetch` called.");
|
|
12105
12105
|
}
|
|
12106
12106
|
}
|
|
12107
12107
|
class Tl extends Al {
|
|
@@ -12325,7 +12325,7 @@ class kl {
|
|
|
12325
12325
|
});
|
|
12326
12326
|
}
|
|
12327
12327
|
async _fetch(t) {
|
|
12328
|
-
|
|
12328
|
+
rt("Abstract method `_fetch` called.");
|
|
12329
12329
|
}
|
|
12330
12330
|
}
|
|
12331
12331
|
class Ml extends kl {
|
|
@@ -12334,7 +12334,7 @@ class Ml extends kl {
|
|
|
12334
12334
|
return new Uint8Array(e);
|
|
12335
12335
|
}
|
|
12336
12336
|
}
|
|
12337
|
-
|
|
12337
|
+
Dt && K("Please use the `legacy` build in Node.js environments.");
|
|
12338
12338
|
async function Pl(a) {
|
|
12339
12339
|
const e = await process.getBuiltinModule("fs").promises.readFile(a);
|
|
12340
12340
|
return new Uint8Array(e);
|
|
@@ -12356,7 +12356,7 @@ class bf extends kl {
|
|
|
12356
12356
|
return Pl(t);
|
|
12357
12357
|
}
|
|
12358
12358
|
}
|
|
12359
|
-
const
|
|
12359
|
+
const Ot = {
|
|
12360
12360
|
FILL: "Fill",
|
|
12361
12361
|
STROKE: "Stroke",
|
|
12362
12362
|
SHADING: "Shading"
|
|
@@ -12369,7 +12369,7 @@ function Nr(a, t) {
|
|
|
12369
12369
|
}
|
|
12370
12370
|
class wo {
|
|
12371
12371
|
getPattern() {
|
|
12372
|
-
|
|
12372
|
+
rt("Abstract method `getPattern` called.");
|
|
12373
12373
|
}
|
|
12374
12374
|
}
|
|
12375
12375
|
class vf extends wo {
|
|
@@ -12385,7 +12385,7 @@ class vf extends wo {
|
|
|
12385
12385
|
}
|
|
12386
12386
|
getPattern(t, e, s, i) {
|
|
12387
12387
|
let n;
|
|
12388
|
-
if (i ===
|
|
12388
|
+
if (i === Ot.STROKE || i === Ot.FILL) {
|
|
12389
12389
|
const r = e.current.getClippedPathBoundingBox(i, ut(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;
|
|
12390
12390
|
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 = G.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Nr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
|
|
12391
12391
|
const u = new DOMMatrix(s);
|
|
@@ -12403,7 +12403,7 @@ function mr(a, t, e, s, i, n, r, o) {
|
|
|
12403
12403
|
if (g >= v)
|
|
12404
12404
|
return;
|
|
12405
12405
|
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o], j = l[o + 1], F = l[o + 2], I = Math.round(g), O = Math.round(v);
|
|
12406
|
-
let D, z, M, R, W,
|
|
12406
|
+
let D, z, M, R, W, ot, ht, E;
|
|
12407
12407
|
for (let H = I; H <= O; H++) {
|
|
12408
12408
|
if (H < b) {
|
|
12409
12409
|
const N = H < g ? 0 : (g - H) / (g - b);
|
|
@@ -12413,11 +12413,11 @@ function mr(a, t, e, s, i, n, r, o) {
|
|
|
12413
12413
|
H > v ? N = 1 : b === v ? N = 0 : N = (b - H) / (b - v), D = p - (p - m) * N, z = A - (A - P) * N, M = T - (T - j) * N, R = k - (k - F) * N;
|
|
12414
12414
|
}
|
|
12415
12415
|
let V;
|
|
12416
|
-
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V,
|
|
12417
|
-
const J = Math.round(Math.min(D, W)),
|
|
12416
|
+
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, ht = _ - (_ - j) * V, E = S - (S - F) * V;
|
|
12417
|
+
const J = Math.round(Math.min(D, W)), Tt = Math.round(Math.max(D, W));
|
|
12418
12418
|
let st = u * H + J * 4;
|
|
12419
|
-
for (let N = J; N <=
|
|
12420
|
-
V = (D - N) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = z - (z -
|
|
12419
|
+
for (let N = J; N <= Tt; N++)
|
|
12420
|
+
V = (D - N) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = z - (z - ot) * V | 0, c[st++] = M - (M - ht) * V | 0, c[st++] = R - (R - E) * V | 0, c[st++] = 255;
|
|
12421
12421
|
}
|
|
12422
12422
|
}
|
|
12423
12423
|
function yf(a, t, e) {
|
|
@@ -12471,14 +12471,14 @@ class _f extends wo {
|
|
|
12471
12471
|
getPattern(t, e, s, i) {
|
|
12472
12472
|
Nr(t, this._bbox);
|
|
12473
12473
|
let n;
|
|
12474
|
-
if (i ===
|
|
12474
|
+
if (i === Ot.SHADING)
|
|
12475
12475
|
n = G.singularValueDecompose2dScale(ut(t));
|
|
12476
12476
|
else if (n = G.singularValueDecompose2dScale(e.baseTransform), this.matrix) {
|
|
12477
12477
|
const o = G.singularValueDecompose2dScale(this.matrix);
|
|
12478
12478
|
n = [n[0] * o[0], n[1] * o[1]];
|
|
12479
12479
|
}
|
|
12480
|
-
const r = this._createMeshCanvas(n, i ===
|
|
12481
|
-
return i !==
|
|
12480
|
+
const r = this._createMeshCanvas(n, i === Ot.SHADING ? null : this._background, e.cachedCanvases);
|
|
12481
|
+
return i !== Ot.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");
|
|
12482
12482
|
}
|
|
12483
12483
|
}
|
|
12484
12484
|
class wf extends wo {
|
|
@@ -12528,14 +12528,14 @@ class xo {
|
|
|
12528
12528
|
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), z.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), z.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = ut(M.ctx), M.executeOperatorList(s), M.endDrawing(), z.restore(), A || T) {
|
|
12529
12529
|
const R = D.canvas;
|
|
12530
12530
|
A && (_ = h), T && (S = l);
|
|
12531
|
-
const W = this.getSizeAndScale(_, this.ctx.canvas.width, v),
|
|
12531
|
+
const W = this.getSizeAndScale(_, this.ctx.canvas.width, v), ot = this.getSizeAndScale(S, this.ctx.canvas.height, y), ht = W.size, E = ot.size, H = t.cachedCanvases.getCanvas("pattern-workaround", ht, E), V = H.context, J = A ? Math.floor(g / h) : 0, Tt = T ? Math.floor(p / l) : 0;
|
|
12532
12532
|
for (let st = 0; st <= J; st++)
|
|
12533
|
-
for (let N = 0; N <=
|
|
12534
|
-
V.drawImage(R,
|
|
12533
|
+
for (let N = 0; N <= Tt; N++)
|
|
12534
|
+
V.drawImage(R, ht * st, E * N, ht, E, 0, 0, ht, E);
|
|
12535
12535
|
return {
|
|
12536
12536
|
canvas: H.canvas,
|
|
12537
12537
|
scaleX: W.scale,
|
|
12538
|
-
scaleY:
|
|
12538
|
+
scaleY: ot.scale,
|
|
12539
12539
|
offsetX: c,
|
|
12540
12540
|
offsetY: u
|
|
12541
12541
|
};
|
|
@@ -12577,7 +12577,7 @@ class xo {
|
|
|
12577
12577
|
}
|
|
12578
12578
|
getPattern(t, e, s, i) {
|
|
12579
12579
|
let n = s;
|
|
12580
|
-
i !==
|
|
12580
|
+
i !== Ot.SHADING && (n = G.transform(n, e.baseTransform), this.matrix && (n = G.transform(n, this.matrix)));
|
|
12581
12581
|
const r = this.createPatternCanvas(e);
|
|
12582
12582
|
let o = new DOMMatrix(n);
|
|
12583
12583
|
o = o.translate(r.offsetX, r.offsetY), o = o.scale(1 / r.scaleX, 1 / r.scaleY);
|
|
@@ -12594,7 +12594,7 @@ function Sf({
|
|
|
12594
12594
|
nonBlackColor: n = 4294967295,
|
|
12595
12595
|
inverseDecode: r = !1
|
|
12596
12596
|
}) {
|
|
12597
|
-
const o =
|
|
12597
|
+
const o = zt.isLittleEndian ? 4278190080 : 255, [h, l] = r ? [n, o] : [o, n], c = s >> 3, u = s & 7, d = a.length;
|
|
12598
12598
|
e = new Uint32Array(e.buffer);
|
|
12599
12599
|
let f = 0;
|
|
12600
12600
|
for (let g = 0; g < i; g++) {
|
|
@@ -12741,7 +12741,7 @@ function Ef(a) {
|
|
|
12741
12741
|
}
|
|
12742
12742
|
class Ga {
|
|
12743
12743
|
constructor(t, e) {
|
|
12744
|
-
this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = yl, this.textMatrixScale = 1, this.fontMatrix = Rr, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode =
|
|
12744
|
+
this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = yl, this.textMatrixScale = 1, this.fontMatrix = Rr, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = Et.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.patternStroke = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, t, e]);
|
|
12745
12745
|
}
|
|
12746
12746
|
clone() {
|
|
12747
12747
|
const t = Object.create(this);
|
|
@@ -12764,10 +12764,10 @@ class Ga {
|
|
|
12764
12764
|
const u = G.bezierBoundingBox(e, s, i, n, r, o, h, l, c);
|
|
12765
12765
|
c || this.updateRectMinMax(t, u);
|
|
12766
12766
|
}
|
|
12767
|
-
getPathBoundingBox(t =
|
|
12767
|
+
getPathBoundingBox(t = Ot.FILL, e = null) {
|
|
12768
12768
|
const s = [this.minX, this.minY, this.maxX, this.maxY];
|
|
12769
|
-
if (t ===
|
|
12770
|
-
e ||
|
|
12769
|
+
if (t === Ot.STROKE) {
|
|
12770
|
+
e || rt("Stroke bounding box must include transform.");
|
|
12771
12771
|
const i = G.singularValueDecompose2dScale(e), n = i[0] * this.lineWidth / 2, r = i[1] * this.lineWidth / 2;
|
|
12772
12772
|
s[0] -= n, s[1] -= r, s[2] += n, s[3] += r;
|
|
12773
12773
|
}
|
|
@@ -12783,7 +12783,7 @@ class Ga {
|
|
|
12783
12783
|
startNewPathAndClipBox(t) {
|
|
12784
12784
|
this.clipBox = t, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
|
|
12785
12785
|
}
|
|
12786
|
-
getClippedPathBoundingBox(t =
|
|
12786
|
+
getClippedPathBoundingBox(t = Ot.FILL, e = null) {
|
|
12787
12787
|
return G.intersect(this.clipBox, this.getPathBoundingBox(t, e));
|
|
12788
12788
|
}
|
|
12789
12789
|
}
|
|
@@ -12797,7 +12797,7 @@ function Va(a, t) {
|
|
|
12797
12797
|
const c = t.data, u = o.data;
|
|
12798
12798
|
let d, f, g, p;
|
|
12799
12799
|
if (t.kind === nn.GRAYSCALE_1BPP) {
|
|
12800
|
-
const b = c.byteLength, m = new Uint32Array(u.buffer, 0, u.byteLength >> 2), v = m.length, y = s + 7 >> 3, _ = 4294967295, S =
|
|
12800
|
+
const b = c.byteLength, m = new Uint32Array(u.buffer, 0, u.byteLength >> 2), v = m.length, y = s + 7 >> 3, _ = 4294967295, S = zt.isLittleEndian ? 4278190080 : 255;
|
|
12801
12801
|
for (d = 0; d < r; d++) {
|
|
12802
12802
|
for (g = d < n ? Yt : i, l = 0, f = 0; f < g; f++) {
|
|
12803
12803
|
const A = b - h;
|
|
@@ -12855,7 +12855,7 @@ function $s(a, t) {
|
|
|
12855
12855
|
a.setLineDash !== void 0 && (t.setLineDash(a.getLineDash()), t.lineDashOffset = a.lineDashOffset);
|
|
12856
12856
|
}
|
|
12857
12857
|
function Zi(a) {
|
|
12858
|
-
if (a.strokeStyle = a.fillStyle = "#000000", a.fillRule = "nonzero", a.globalAlpha = 1, a.lineWidth = 1, a.lineCap = "butt", a.lineJoin = "miter", a.miterLimit = 10, a.globalCompositeOperation = "source-over", a.font = "10px sans-serif", a.setLineDash !== void 0 && (a.setLineDash([]), a.lineDashOffset = 0), !
|
|
12858
|
+
if (a.strokeStyle = a.fillStyle = "#000000", a.fillRule = "nonzero", a.globalAlpha = 1, a.lineWidth = 1, a.lineCap = "butt", a.lineJoin = "miter", a.miterLimit = 10, a.globalCompositeOperation = "source-over", a.font = "10px sans-serif", a.setLineDash !== void 0 && (a.setLineDash([]), a.lineDashOffset = 0), !Dt) {
|
|
12859
12859
|
const {
|
|
12860
12860
|
filter: t
|
|
12861
12861
|
} = a;
|
|
@@ -12986,7 +12986,7 @@ class ks {
|
|
|
12986
12986
|
const [f, g, p, b] = G.getAxialAlignedBoundingBox([0, 0, s, i], d), m = Math.round(p - f) || 1, v = Math.round(b - g) || 1, y = this.cachedCanvases.getCanvas("fillCanvas", m, v), _ = y.context, S = f, A = g;
|
|
12987
12987
|
_.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, be(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Xa(ut(_), t.interpolate), Ji(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
|
|
12988
12988
|
const T = G.transform(be(_), [1, 0, 0, 1, -S, -A]);
|
|
12989
|
-
return _.fillStyle = r ? n.getPattern(e, this, T,
|
|
12989
|
+
return _.fillStyle = r ? n.getPattern(e, this, T, Ot.FILL) : n, _.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(l, y.canvas)), {
|
|
12990
12990
|
canvas: y.canvas,
|
|
12991
12991
|
offsetX: Math.round(S),
|
|
12992
12992
|
offsetY: Math.round(A)
|
|
@@ -13152,7 +13152,7 @@ class ks {
|
|
|
13152
13152
|
}
|
|
13153
13153
|
stroke(t = !0) {
|
|
13154
13154
|
const e = this.ctx, s = this.current.strokeColor;
|
|
13155
|
-
e.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof s == "object" && s?.getPattern ? (e.save(), e.strokeStyle = s.getPattern(e, this, be(e),
|
|
13155
|
+
e.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof s == "object" && s?.getPattern ? (e.save(), e.strokeStyle = s.getPattern(e, this, be(e), Ot.STROKE), this.rescaleAndStroke(!1), e.restore()) : this.rescaleAndStroke(!0)), t && this.consumePath(this.current.getClippedPathBoundingBox()), e.globalAlpha = this.current.fillAlpha;
|
|
13156
13156
|
}
|
|
13157
13157
|
closeStroke() {
|
|
13158
13158
|
this.closePath(), this.stroke();
|
|
@@ -13160,7 +13160,7 @@ class ks {
|
|
|
13160
13160
|
fill(t = !0) {
|
|
13161
13161
|
const e = this.ctx, s = this.current.fillColor, i = this.current.patternFill;
|
|
13162
13162
|
let n = !1;
|
|
13163
|
-
i && (e.save(), e.fillStyle = s.getPattern(e, this, be(e),
|
|
13163
|
+
i && (e.save(), e.fillStyle = s.getPattern(e, this, be(e), Ot.FILL), n = !0);
|
|
13164
13164
|
const r = this.current.getClippedPathBoundingBox();
|
|
13165
13165
|
this.contentVisible && r !== null && (this.pendingEOFill ? (e.fill("evenodd"), this.pendingEOFill = !1) : e.fill()), n && e.restore(), t && this.consumePath(r);
|
|
13166
13166
|
}
|
|
@@ -13256,16 +13256,16 @@ class ks {
|
|
|
13256
13256
|
return i.addPath(t, new DOMMatrix(s).invertSelf().multiplySelf(e)), i;
|
|
13257
13257
|
}
|
|
13258
13258
|
paintChar(t, e, s, i, n) {
|
|
13259
|
-
const r = this.ctx, o = this.current, h = o.font, l = o.textRenderingMode, c = o.fontSize / o.fontSizeScale, u = l &
|
|
13259
|
+
const r = this.ctx, o = this.current, h = o.font, l = o.textRenderingMode, c = o.fontSize / o.fontSizeScale, u = l & Et.FILL_STROKE_MASK, d = !!(l & Et.ADD_TO_PATH_FLAG), f = o.patternFill && !h.missingFile, g = o.patternStroke && !h.missingFile;
|
|
13260
13260
|
let p;
|
|
13261
13261
|
if ((h.disableFontFace || d || f || g) && (p = h.getPathGenerator(this.commonObjs, t)), h.disableFontFace || f || g) {
|
|
13262
|
-
if (r.save(), r.translate(e, s), r.scale(c, -c), u ===
|
|
13262
|
+
if (r.save(), r.translate(e, s), r.scale(c, -c), u === Et.FILL || u === Et.FILL_STROKE)
|
|
13263
13263
|
if (i) {
|
|
13264
13264
|
const b = r.getTransform();
|
|
13265
13265
|
r.setTransform(...i), r.fill(this.#s(p, b, i));
|
|
13266
13266
|
} else
|
|
13267
13267
|
r.fill(p);
|
|
13268
|
-
if (u ===
|
|
13268
|
+
if (u === Et.STROKE || u === Et.FILL_STROKE)
|
|
13269
13269
|
if (n) {
|
|
13270
13270
|
const b = r.getTransform();
|
|
13271
13271
|
r.setTransform(...n), r.stroke(this.#s(p, b, n));
|
|
@@ -13273,7 +13273,7 @@ class ks {
|
|
|
13273
13273
|
r.lineWidth /= c, r.stroke(p);
|
|
13274
13274
|
r.restore();
|
|
13275
13275
|
} else
|
|
13276
|
-
(u ===
|
|
13276
|
+
(u === Et.FILL || u === Et.FILL_STROKE) && r.fillText(t, e, s), (u === Et.STROKE || u === Et.FILL_STROKE) && r.strokeText(t, e, s);
|
|
13277
13277
|
d && (this.pendingTextPaths ||= []).push({
|
|
13278
13278
|
transform: ut(r),
|
|
13279
13279
|
x: e,
|
|
@@ -13303,24 +13303,24 @@ class ks {
|
|
|
13303
13303
|
const i = e.fontSize;
|
|
13304
13304
|
if (i === 0)
|
|
13305
13305
|
return;
|
|
13306
|
-
const n = this.ctx, r = e.fontSizeScale, o = e.charSpacing, h = e.wordSpacing, l = e.fontDirection, c = e.textHScale * l, u = t.length, d = s.vertical, f = d ? 1 : -1, g = s.defaultVMetrics, p = i * e.fontMatrix[0], b = e.textRenderingMode ===
|
|
13306
|
+
const n = this.ctx, r = e.fontSizeScale, o = e.charSpacing, h = e.wordSpacing, l = e.fontDirection, c = e.textHScale * l, u = t.length, d = s.vertical, f = d ? 1 : -1, g = s.defaultVMetrics, p = i * e.fontMatrix[0], b = e.textRenderingMode === Et.FILL && !s.disableFontFace && !e.patternFill;
|
|
13307
13307
|
n.save(), n.transform(...e.textMatrix), n.translate(e.x, e.y + e.textRise), l > 0 ? n.scale(c, -1) : n.scale(c, 1);
|
|
13308
13308
|
let m, v;
|
|
13309
13309
|
if (e.patternFill) {
|
|
13310
13310
|
n.save();
|
|
13311
|
-
const T = e.fillColor.getPattern(n, this, be(n),
|
|
13311
|
+
const T = e.fillColor.getPattern(n, this, be(n), Ot.FILL);
|
|
13312
13312
|
m = ut(n), n.restore(), n.fillStyle = T;
|
|
13313
13313
|
}
|
|
13314
13314
|
if (e.patternStroke) {
|
|
13315
13315
|
n.save();
|
|
13316
|
-
const T = e.strokeColor.getPattern(n, this, be(n),
|
|
13316
|
+
const T = e.strokeColor.getPattern(n, this, be(n), Ot.STROKE);
|
|
13317
13317
|
v = ut(n), n.restore(), n.strokeStyle = T;
|
|
13318
13318
|
}
|
|
13319
13319
|
let y = e.lineWidth;
|
|
13320
13320
|
const _ = e.textMatrixScale;
|
|
13321
13321
|
if (_ === 0 || y === 0) {
|
|
13322
|
-
const T = e.textRenderingMode &
|
|
13323
|
-
(T ===
|
|
13322
|
+
const T = e.textRenderingMode & Et.FILL_STROKE_MASK;
|
|
13323
|
+
(T === Et.STROKE || T === Et.FILL_STROKE) && (y = this.getSinglePixelWidth());
|
|
13324
13324
|
} else
|
|
13325
13325
|
y /= _;
|
|
13326
13326
|
if (r !== 1 && (n.scale(r, r), y /= r), n.lineWidth = y, s.isInvalidPDFjsFont) {
|
|
@@ -13367,7 +13367,7 @@ class ks {
|
|
|
13367
13367
|
d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
|
|
13368
13368
|
}
|
|
13369
13369
|
showType3Text(t) {
|
|
13370
|
-
const e = this.ctx, s = this.current, i = s.font, n = s.fontSize, r = s.fontDirection, o = i.vertical ? 1 : -1, h = s.charSpacing, l = s.wordSpacing, c = s.textHScale * r, u = s.fontMatrix || Rr, d = t.length, f = s.textRenderingMode ===
|
|
13370
|
+
const e = this.ctx, s = this.current, i = s.font, n = s.fontSize, r = s.fontDirection, o = i.vertical ? 1 : -1, h = s.charSpacing, l = s.wordSpacing, c = s.textHScale * r, u = s.fontMatrix || Rr, d = t.length, f = s.textRenderingMode === Et.INVISIBLE;
|
|
13371
13371
|
let g, p, b, m;
|
|
13372
13372
|
if (!(f || n === 0)) {
|
|
13373
13373
|
for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, e.save(), e.transform(...s.textMatrix), e.translate(s.x, s.y), e.scale(c, r), g = 0; g < d; ++g) {
|
|
@@ -13432,7 +13432,7 @@ class ks {
|
|
|
13432
13432
|
const e = this.ctx;
|
|
13433
13433
|
this.save();
|
|
13434
13434
|
const s = this._getPattern(t);
|
|
13435
|
-
e.fillStyle = s.getPattern(e, this, be(e),
|
|
13435
|
+
e.fillStyle = s.getPattern(e, this, be(e), Ot.SHADING);
|
|
13436
13436
|
const i = be(e);
|
|
13437
13437
|
if (i) {
|
|
13438
13438
|
const {
|
|
@@ -13445,10 +13445,10 @@ class ks {
|
|
|
13445
13445
|
this.compose(this.current.getClippedPathBoundingBox()), this.restore();
|
|
13446
13446
|
}
|
|
13447
13447
|
beginInlineImage() {
|
|
13448
|
-
|
|
13448
|
+
rt("Should not call beginInlineImage");
|
|
13449
13449
|
}
|
|
13450
13450
|
beginImageData() {
|
|
13451
|
-
|
|
13451
|
+
rt("Should not call beginImageData");
|
|
13452
13452
|
}
|
|
13453
13453
|
paintFormXObjectBegin(t, e) {
|
|
13454
13454
|
if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = ut(this.ctx), e)) {
|
|
@@ -13566,7 +13566,7 @@ class ks {
|
|
|
13566
13566
|
} = n, c = this.cachedCanvases.getCanvas("maskCanvas", o, h), u = c.context;
|
|
13567
13567
|
u.save();
|
|
13568
13568
|
const d = this.getObject(r, n);
|
|
13569
|
-
Wa(u, d), u.globalCompositeOperation = "source-in", u.fillStyle = i ? s.getPattern(u, this, be(e),
|
|
13569
|
+
Wa(u, d), u.globalCompositeOperation = "source-in", u.fillStyle = i ? s.getPattern(u, this, be(e), Ot.FILL) : s, u.fillRect(0, 0, o, h), u.restore(), e.save(), e.transform(...l), e.scale(1, -1), Ji(e, c.canvas, 0, 0, o, h, 0, -1, 1, 1), e.restore();
|
|
13570
13570
|
}
|
|
13571
13571
|
this.compose();
|
|
13572
13572
|
}
|
|
@@ -13616,7 +13616,7 @@ class ks {
|
|
|
13616
13616
|
if (!this.contentVisible)
|
|
13617
13617
|
return;
|
|
13618
13618
|
const e = t.width, s = t.height, i = this.ctx;
|
|
13619
|
-
if (this.save(), !
|
|
13619
|
+
if (this.save(), !Dt) {
|
|
13620
13620
|
const {
|
|
13621
13621
|
filter: o
|
|
13622
13622
|
} = i;
|
|
@@ -13827,7 +13827,7 @@ class Df {
|
|
|
13827
13827
|
return this.#t ? e?.viewState !== "OFF" : this.#e ? t?.printState !== "OFF" : !0;
|
|
13828
13828
|
}
|
|
13829
13829
|
_setVisible(t, e, s = !1) {
|
|
13830
|
-
t !== _s &&
|
|
13830
|
+
t !== _s && rt("Internal method `_setVisible` called."), this.#s = s, this.#i = e;
|
|
13831
13831
|
}
|
|
13832
13832
|
}
|
|
13833
13833
|
class Rf {
|
|
@@ -14851,7 +14851,7 @@ class qf {
|
|
|
14851
14851
|
}
|
|
14852
14852
|
}
|
|
14853
14853
|
const Kf = 1e5, Xt = 30, Jf = 0.8;
|
|
14854
|
-
class
|
|
14854
|
+
class Ft {
|
|
14855
14855
|
#t = Promise.withResolvers();
|
|
14856
14856
|
#e = null;
|
|
14857
14857
|
#s = !1;
|
|
@@ -14901,8 +14901,8 @@ class It {
|
|
|
14901
14901
|
pageX: r,
|
|
14902
14902
|
pageY: o
|
|
14903
14903
|
} = s.rawDims;
|
|
14904
|
-
this.#b = [1, 0, 0, -1, -r, o + n], this.#a = i, this.#h = n,
|
|
14905
|
-
|
|
14904
|
+
this.#b = [1, 0, 0, -1, -r, o + n], this.#a = i, this.#h = n, Ft.#O(), us(e, s), this.#t.promise.finally(() => {
|
|
14905
|
+
Ft.#A.delete(this), this.#n = null, this.#f = null;
|
|
14906
14906
|
}).catch(() => {
|
|
14907
14907
|
});
|
|
14908
14908
|
}
|
|
@@ -14910,7 +14910,7 @@ class It {
|
|
|
14910
14910
|
const {
|
|
14911
14911
|
isWindows: t,
|
|
14912
14912
|
isFirefox: e
|
|
14913
|
-
} =
|
|
14913
|
+
} = zt.platform;
|
|
14914
14914
|
return Z(this, "fontFamilyMap", /* @__PURE__ */ new Map([["sans-serif", `${t && e ? "Calibri, " : ""}sans-serif`], ["monospace", `${t && e ? "Lucida Console, " : ""}monospace`]]));
|
|
14915
14915
|
}
|
|
14916
14916
|
render() {
|
|
@@ -14926,7 +14926,7 @@ class It {
|
|
|
14926
14926
|
this.#r ??= e.lang, Object.assign(this.#f, e.styles), this.#E(e.items), t();
|
|
14927
14927
|
}, this.#t.reject);
|
|
14928
14928
|
};
|
|
14929
|
-
return this.#c = this.#g.getReader(),
|
|
14929
|
+
return this.#c = this.#g.getReader(), Ft.#A.add(this), t(), this.#t.promise;
|
|
14930
14930
|
}
|
|
14931
14931
|
update({
|
|
14932
14932
|
viewport: t,
|
|
@@ -14940,7 +14940,7 @@ class It {
|
|
|
14940
14940
|
const n = {
|
|
14941
14941
|
div: null,
|
|
14942
14942
|
properties: null,
|
|
14943
|
-
ctx:
|
|
14943
|
+
ctx: Ft.#k(this.#r)
|
|
14944
14944
|
};
|
|
14945
14945
|
for (const r of this.#m)
|
|
14946
14946
|
n.properties = this.#p.get(r), n.div = r, this.#x(n);
|
|
@@ -14960,7 +14960,7 @@ class It {
|
|
|
14960
14960
|
#E(t) {
|
|
14961
14961
|
if (this.#s)
|
|
14962
14962
|
return;
|
|
14963
|
-
this.#n.ctx ??=
|
|
14963
|
+
this.#n.ctx ??= Ft.#k(this.#r);
|
|
14964
14964
|
const e = this.#m, s = this.#o;
|
|
14965
14965
|
for (const i of t) {
|
|
14966
14966
|
if (e.length > Kf) {
|
|
@@ -14991,12 +14991,12 @@ class It {
|
|
|
14991
14991
|
const r = this.#f[t.fontName];
|
|
14992
14992
|
r.vertical && (n += Math.PI / 2);
|
|
14993
14993
|
let o = this.#i && r.fontSubstitution || r.fontFamily;
|
|
14994
|
-
o =
|
|
14995
|
-
const h = Math.hypot(i[2], i[3]), l = h *
|
|
14994
|
+
o = Ft.fontFamilyMap.get(o) || o;
|
|
14995
|
+
const h = Math.hypot(i[2], i[3]), l = h * Ft.#L(o, this.#r);
|
|
14996
14996
|
let c, u;
|
|
14997
14997
|
n === 0 ? (c = i[4], u = i[5] - l) : (c = i[4] + l * Math.sin(n), u = i[5] - l * Math.cos(n));
|
|
14998
14998
|
const d = "calc(var(--scale-factor)*", f = e.style;
|
|
14999
|
-
this.#e === this.#l ? (f.left = `${(100 * c / this.#a).toFixed(2)}%`, f.top = `${(100 * u / this.#h).toFixed(2)}%`) : (f.left = `${d}${c.toFixed(2)}px)`, f.top = `${d}${u.toFixed(2)}px)`), f.fontSize = `${d}${(
|
|
14999
|
+
this.#e === this.#l ? (f.left = `${(100 * c / this.#a).toFixed(2)}%`, f.top = `${(100 * u / this.#h).toFixed(2)}%`) : (f.left = `${d}${c.toFixed(2)}px)`, f.top = `${d}${u.toFixed(2)}px)`), f.fontSize = `${d}${(Ft.#S * h).toFixed(2)}px)`, f.fontFamily = o, s.fontSize = h, e.setAttribute("role", "presentation"), e.textContent = t.str, e.dir = t.dir, this.#i && (e.dataset.fontName = r.fontSubstitutionLoadedName || t.fontName), n !== 0 && (s.angle = n * (180 / Math.PI));
|
|
15000
15000
|
let g = !1;
|
|
15001
15001
|
if (t.str.length > 1)
|
|
15002
15002
|
g = !0;
|
|
@@ -15018,14 +15018,14 @@ class It {
|
|
|
15018
15018
|
style: n
|
|
15019
15019
|
} = e;
|
|
15020
15020
|
let r = "";
|
|
15021
|
-
if (
|
|
15021
|
+
if (Ft.#S > 1 && (r = `scale(${1 / Ft.#S})`), s.canvasWidth !== 0 && s.hasText) {
|
|
15022
15022
|
const {
|
|
15023
15023
|
fontFamily: o
|
|
15024
15024
|
} = n, {
|
|
15025
15025
|
canvasWidth: h,
|
|
15026
15026
|
fontSize: l
|
|
15027
15027
|
} = s;
|
|
15028
|
-
|
|
15028
|
+
Ft.#T(i, l * this.#u, o);
|
|
15029
15029
|
const {
|
|
15030
15030
|
width: c
|
|
15031
15031
|
} = i.measureText(e.textContent);
|
|
@@ -15126,7 +15126,7 @@ class pi {
|
|
|
15126
15126
|
return !(t === "textarea" || t === "input" || t === "option" || t === "select");
|
|
15127
15127
|
}
|
|
15128
15128
|
}
|
|
15129
|
-
const Zf = 65536, Qf = 100, tg = 5e3, eg =
|
|
15129
|
+
const Zf = 65536, Qf = 100, tg = 5e3, eg = Dt ? pf : df, sg = Dt ? mf : Tl, ig = Dt ? gf : ff, ng = Dt ? bf : Ml;
|
|
15130
15130
|
function rg(a = {}) {
|
|
15131
15131
|
typeof a == "string" || a instanceof URL ? a = {
|
|
15132
15132
|
url: a
|
|
@@ -15137,7 +15137,7 @@ function rg(a = {}) {
|
|
|
15137
15137
|
docId: e
|
|
15138
15138
|
} = t, s = a.url ? og(a.url) : null, i = a.data ? ag(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Nl ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Zf;
|
|
15139
15139
|
let c = a.worker instanceof Ms ? a.worker : null;
|
|
15140
|
-
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || sg, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || ng, 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 : !
|
|
15140
|
+
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || sg, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || ng, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0, j = a.enableXfa === !0, F = a.ownerDocument || globalThis.document, I = a.disableRange === !0, O = a.disableStream === !0, D = a.disableAutoFetch === !0, z = a.pdfBug === !0, M = a.CanvasFactory || eg, R = a.FilterFactory || ig, W = a.enableHWA === !0, ot = h ? h.length : a.length ?? NaN, ht = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !Dt && !k, E = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === Tl && m === Ml && f && b && ti(f, document.baseURI) && ti(b, document.baseURI), H = null;
|
|
15141
15141
|
Vd(u);
|
|
15142
15142
|
const V = {
|
|
15143
15143
|
canvasFactory: new M({
|
|
@@ -15170,7 +15170,7 @@ function rg(a = {}) {
|
|
|
15170
15170
|
password: o,
|
|
15171
15171
|
disableAutoFetch: D,
|
|
15172
15172
|
rangeChunkSize: l,
|
|
15173
|
-
length:
|
|
15173
|
+
length: ot,
|
|
15174
15174
|
docBaseUrl: d,
|
|
15175
15175
|
enableXfa: j,
|
|
15176
15176
|
evaluatorOptions: {
|
|
@@ -15182,11 +15182,11 @@ function rg(a = {}) {
|
|
|
15182
15182
|
isImageDecoderSupported: A,
|
|
15183
15183
|
canvasMaxAreaInBytes: T,
|
|
15184
15184
|
fontExtraProperties: P,
|
|
15185
|
-
useSystemFonts:
|
|
15185
|
+
useSystemFonts: ht,
|
|
15186
15186
|
cMapUrl: E ? f : null,
|
|
15187
15187
|
standardFontDataUrl: E ? b : null
|
|
15188
15188
|
}
|
|
15189
|
-
},
|
|
15189
|
+
}, Tt = {
|
|
15190
15190
|
disableFontFace: k,
|
|
15191
15191
|
fontExtraProperties: P,
|
|
15192
15192
|
ownerDocument: F,
|
|
@@ -15212,19 +15212,19 @@ function rg(a = {}) {
|
|
|
15212
15212
|
else if (!i) {
|
|
15213
15213
|
if (!s)
|
|
15214
15214
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
15215
|
-
let
|
|
15216
|
-
if (
|
|
15215
|
+
let lt;
|
|
15216
|
+
if (Dt)
|
|
15217
15217
|
if (ti(s)) {
|
|
15218
15218
|
if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
|
|
15219
15219
|
throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
|
|
15220
|
-
|
|
15220
|
+
lt = Ya;
|
|
15221
15221
|
} else
|
|
15222
|
-
|
|
15222
|
+
lt = Yf;
|
|
15223
15223
|
else
|
|
15224
|
-
|
|
15225
|
-
N = new
|
|
15224
|
+
lt = ti(s) ? Ya : Gf;
|
|
15225
|
+
N = new lt({
|
|
15226
15226
|
url: s,
|
|
15227
|
-
length:
|
|
15227
|
+
length: ot,
|
|
15228
15228
|
httpHeaders: n,
|
|
15229
15229
|
withCredentials: r,
|
|
15230
15230
|
rangeChunkSize: l,
|
|
@@ -15232,13 +15232,13 @@ function rg(a = {}) {
|
|
|
15232
15232
|
disableStream: O
|
|
15233
15233
|
});
|
|
15234
15234
|
}
|
|
15235
|
-
return st.then((
|
|
15235
|
+
return st.then((lt) => {
|
|
15236
15236
|
if (t.destroyed)
|
|
15237
15237
|
throw new Error("Loading aborted");
|
|
15238
15238
|
if (c.destroyed)
|
|
15239
15239
|
throw new Error("Worker was destroyed");
|
|
15240
|
-
const
|
|
15241
|
-
t._transport =
|
|
15240
|
+
const xt = new ei(e, lt, c.port), Wt = new ug(xt, t, N, Tt, V);
|
|
15241
|
+
t._transport = Wt, xt.send("Ready", null);
|
|
15242
15242
|
});
|
|
15243
15243
|
}).catch(t._capability.reject), t;
|
|
15244
15244
|
}
|
|
@@ -15248,13 +15248,13 @@ function og(a) {
|
|
|
15248
15248
|
try {
|
|
15249
15249
|
return new URL(a, window.location).href;
|
|
15250
15250
|
} catch {
|
|
15251
|
-
if (
|
|
15251
|
+
if (Dt && typeof a == "string")
|
|
15252
15252
|
return a;
|
|
15253
15253
|
}
|
|
15254
15254
|
throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
|
|
15255
15255
|
}
|
|
15256
15256
|
function ag(a) {
|
|
15257
|
-
if (
|
|
15257
|
+
if (Dt && typeof Buffer < "u" && a instanceof Buffer)
|
|
15258
15258
|
throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
|
|
15259
15259
|
if (a instanceof Uint8Array && a.byteLength === a.buffer.byteLength)
|
|
15260
15260
|
return a;
|
|
@@ -15327,7 +15327,7 @@ class Nl {
|
|
|
15327
15327
|
this._readyCapability.resolve();
|
|
15328
15328
|
}
|
|
15329
15329
|
requestDataRange(t, e) {
|
|
15330
|
-
|
|
15330
|
+
rt("Abstract method PDFDataRangeTransport.requestDataRange");
|
|
15331
15331
|
}
|
|
15332
15332
|
abort() {
|
|
15333
15333
|
}
|
|
@@ -15926,7 +15926,7 @@ An = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), Ps = new WeakSet(),
|
|
|
15926
15926
|
} catch {
|
|
15927
15927
|
return null;
|
|
15928
15928
|
}
|
|
15929
|
-
}, bs(ct, Os), bs(ct, An, 0), bs(ct, ns, !1), bs(ct, rs),
|
|
15929
|
+
}, bs(ct, Os), bs(ct, An, 0), bs(ct, ns, !1), bs(ct, rs), Dt && (Gs(ct, ns, !0), li.workerSrc ||= "./pdf.worker.mjs"), ct._isSameOrigin = (t, e) => {
|
|
15930
15930
|
let s;
|
|
15931
15931
|
try {
|
|
15932
15932
|
if (s = new URL(t), !s.origin || s.origin === "null")
|
|
@@ -16017,7 +16017,7 @@ class ug {
|
|
|
16017
16017
|
this.#e.clear(), this.#s.clear(), this.#i.clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
|
|
16018
16018
|
const e = this.messageHandler.sendWithPromise("Terminate", null);
|
|
16019
16019
|
return t.push(e), Promise.all(t).then(() => {
|
|
16020
|
-
this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(),
|
|
16020
|
+
this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(), Ft.cleanup(), this._networkStream?.cancelAllRequests(new Ue("Worker was terminated.")), this.messageHandler?.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
|
|
16021
16021
|
}, this.destroyCapability.reject), this.destroyCapability.promise;
|
|
16022
16022
|
}
|
|
16023
16023
|
setupMessageHandler() {
|
|
@@ -16332,7 +16332,7 @@ class ug {
|
|
|
16332
16332
|
for (const e of this.#e.values())
|
|
16333
16333
|
if (!e.cleanup())
|
|
16334
16334
|
throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);
|
|
16335
|
-
this.commonObjs.clear(), t || this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(!0),
|
|
16335
|
+
this.commonObjs.clear(), t || this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(!0), Ft.cleanup();
|
|
16336
16336
|
}
|
|
16337
16337
|
}
|
|
16338
16338
|
cachedPageNumber(t) {
|
|
@@ -16553,7 +16553,7 @@ class pg {
|
|
|
16553
16553
|
return this._createSVG(t);
|
|
16554
16554
|
}
|
|
16555
16555
|
_createSVG(t) {
|
|
16556
|
-
|
|
16556
|
+
rt("Abstract method `_createSVG` called.");
|
|
16557
16557
|
}
|
|
16558
16558
|
}
|
|
16559
16559
|
class Co extends pg {
|
|
@@ -16720,11 +16720,11 @@ function Ve(a) {
|
|
|
16720
16720
|
class bg {
|
|
16721
16721
|
static create(t) {
|
|
16722
16722
|
switch (t.data.annotationType) {
|
|
16723
|
-
case
|
|
16723
|
+
case St.LINK:
|
|
16724
16724
|
return new Hl(t);
|
|
16725
|
-
case
|
|
16725
|
+
case St.TEXT:
|
|
16726
16726
|
return new vg(t);
|
|
16727
|
-
case
|
|
16727
|
+
case St.WIDGET:
|
|
16728
16728
|
switch (t.data.fieldType) {
|
|
16729
16729
|
case "Tx":
|
|
16730
16730
|
return new yg(t);
|
|
@@ -16736,35 +16736,35 @@ class bg {
|
|
|
16736
16736
|
return new _g(t);
|
|
16737
16737
|
}
|
|
16738
16738
|
return new ms(t);
|
|
16739
|
-
case
|
|
16739
|
+
case St.POPUP:
|
|
16740
16740
|
return new jr(t);
|
|
16741
|
-
case
|
|
16741
|
+
case St.FREETEXT:
|
|
16742
16742
|
return new Gl(t);
|
|
16743
|
-
case
|
|
16743
|
+
case St.LINE:
|
|
16744
16744
|
return new Ag(t);
|
|
16745
|
-
case
|
|
16745
|
+
case St.SQUARE:
|
|
16746
16746
|
return new Tg(t);
|
|
16747
|
-
case
|
|
16747
|
+
case St.CIRCLE:
|
|
16748
16748
|
return new Eg(t);
|
|
16749
|
-
case
|
|
16749
|
+
case St.POLYLINE:
|
|
16750
16750
|
return new Vl(t);
|
|
16751
|
-
case
|
|
16751
|
+
case St.CARET:
|
|
16752
16752
|
return new Mg(t);
|
|
16753
|
-
case
|
|
16753
|
+
case St.INK:
|
|
16754
16754
|
return new Ao(t);
|
|
16755
|
-
case
|
|
16755
|
+
case St.POLYGON:
|
|
16756
16756
|
return new kg(t);
|
|
16757
|
-
case
|
|
16757
|
+
case St.HIGHLIGHT:
|
|
16758
16758
|
return new Wl(t);
|
|
16759
|
-
case
|
|
16759
|
+
case St.UNDERLINE:
|
|
16760
16760
|
return new Pg(t);
|
|
16761
|
-
case
|
|
16761
|
+
case St.SQUIGGLY:
|
|
16762
16762
|
return new Og(t);
|
|
16763
|
-
case
|
|
16763
|
+
case St.STRIKEOUT:
|
|
16764
16764
|
return new Dg(t);
|
|
16765
|
-
case
|
|
16765
|
+
case St.STAMP:
|
|
16766
16766
|
return new Xl(t);
|
|
16767
|
-
case
|
|
16767
|
+
case St.FILEATTACHMENT:
|
|
16768
16768
|
return new Rg(t);
|
|
16769
16769
|
default:
|
|
16770
16770
|
return new bt(t);
|
|
@@ -17069,7 +17069,7 @@ class bt {
|
|
|
17069
17069
|
this.parent.div.append(e.render());
|
|
17070
17070
|
}
|
|
17071
17071
|
render() {
|
|
17072
|
-
|
|
17072
|
+
rt("Abstract method `AnnotationElement.render` called");
|
|
17073
17073
|
}
|
|
17074
17074
|
_getElementsByName(t, e = null) {
|
|
17075
17075
|
const s = [];
|
|
@@ -17292,7 +17292,7 @@ class ms extends bt {
|
|
|
17292
17292
|
this.data.hasOwnCanvas && (t.previousSibling?.nodeName === "CANVAS" && (t.previousSibling.hidden = !0), t.hidden = !1);
|
|
17293
17293
|
}
|
|
17294
17294
|
_getKeyModifier(t) {
|
|
17295
|
-
return
|
|
17295
|
+
return zt.platform.isMac ? t.metaKey : t.ctrlKey;
|
|
17296
17296
|
}
|
|
17297
17297
|
_setEventListener(t, e, s, i, n) {
|
|
17298
17298
|
s.includes("mouse") ? t.addEventListener(s, (r) => {
|
|
@@ -18348,7 +18348,7 @@ class Rg extends bt {
|
|
|
18348
18348
|
e.hasAppearance || e.fillAlpha === 0 ? s = document.createElement("div") : (s = document.createElement("img"), s.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name) ? "paperclip" : "pushpin"}.svg`, e.fillAlpha && e.fillAlpha < 1 && (s.style = `filter: opacity(${Math.round(e.fillAlpha * 100)}%);`)), s.addEventListener("dblclick", this.#e.bind(this)), this.#t = s;
|
|
18349
18349
|
const {
|
|
18350
18350
|
isMac: i
|
|
18351
|
-
} =
|
|
18351
|
+
} = zt.platform;
|
|
18352
18352
|
return t.addEventListener("keydown", (n) => {
|
|
18353
18353
|
n.key === "Enter" && (i ? n.metaKey : n.ctrlKey) && this.#e();
|
|
18354
18354
|
}), !e.popupRef && this.hasPopupData ? this._createPopup() : s.classList.add("popupTriggerArea"), t.append(s), t;
|
|
@@ -18412,7 +18412,7 @@ class Lg {
|
|
|
18412
18412
|
for (const r of e) {
|
|
18413
18413
|
if (r.noHTML)
|
|
18414
18414
|
continue;
|
|
18415
|
-
const o = r.annotationType ===
|
|
18415
|
+
const o = r.annotationType === St.POPUP;
|
|
18416
18416
|
if (o) {
|
|
18417
18417
|
const c = i.get(r.id);
|
|
18418
18418
|
if (!c)
|
|
@@ -18471,7 +18471,7 @@ class Lg {
|
|
|
18471
18471
|
}
|
|
18472
18472
|
}
|
|
18473
18473
|
const Qi = /\r\n?|\n/g;
|
|
18474
|
-
class
|
|
18474
|
+
class Ct extends U {
|
|
18475
18475
|
#t;
|
|
18476
18476
|
#e = "";
|
|
18477
18477
|
#s = `${this.id}-editor`;
|
|
@@ -18482,7 +18482,7 @@ class St extends U {
|
|
|
18482
18482
|
static _defaultColor = null;
|
|
18483
18483
|
static _defaultFontSize = 10;
|
|
18484
18484
|
static get _keyboardManager() {
|
|
18485
|
-
const t =
|
|
18485
|
+
const t = Ct.prototype, e = (n) => n.isEmpty(), s = Ye.TRANSLATE_SMALL, i = Ye.TRANSLATE_BIG;
|
|
18486
18486
|
return Z(this, "_keyboardManager", new xi([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], t.commitOrRemove, {
|
|
18487
18487
|
bubbles: !0
|
|
18488
18488
|
}], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], t.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], t._translateEmpty, {
|
|
@@ -18517,7 +18517,7 @@ class St extends U {
|
|
|
18517
18517
|
super({
|
|
18518
18518
|
...t,
|
|
18519
18519
|
name: "freeTextEditor"
|
|
18520
|
-
}), this.#t = t.color ||
|
|
18520
|
+
}), this.#t = t.color || Ct._defaultColor || U._defaultLineColor, this.#r = t.fontSize || Ct._defaultFontSize;
|
|
18521
18521
|
}
|
|
18522
18522
|
static initialize(t, e) {
|
|
18523
18523
|
U.initialize(t, e);
|
|
@@ -18527,10 +18527,10 @@ class St extends U {
|
|
|
18527
18527
|
static updateDefaultParams(t, e) {
|
|
18528
18528
|
switch (t) {
|
|
18529
18529
|
case Q.FREETEXT_SIZE:
|
|
18530
|
-
|
|
18530
|
+
Ct._defaultFontSize = e;
|
|
18531
18531
|
break;
|
|
18532
18532
|
case Q.FREETEXT_COLOR:
|
|
18533
|
-
|
|
18533
|
+
Ct._defaultColor = e;
|
|
18534
18534
|
break;
|
|
18535
18535
|
}
|
|
18536
18536
|
}
|
|
@@ -18545,7 +18545,7 @@ class St extends U {
|
|
|
18545
18545
|
}
|
|
18546
18546
|
}
|
|
18547
18547
|
static get defaultPropertiesToUpdate() {
|
|
18548
|
-
return [[Q.FREETEXT_SIZE,
|
|
18548
|
+
return [[Q.FREETEXT_SIZE, Ct._defaultFontSize], [Q.FREETEXT_COLOR, Ct._defaultColor || U._defaultLineColor]];
|
|
18549
18549
|
}
|
|
18550
18550
|
get propertiesToUpdate() {
|
|
18551
18551
|
return [[Q.FREETEXT_SIZE, this.#r], [Q.FREETEXT_COLOR, this.#t]];
|
|
@@ -18583,7 +18583,7 @@ class St extends U {
|
|
|
18583
18583
|
}
|
|
18584
18584
|
getInitialTranslation() {
|
|
18585
18585
|
const t = this.parentScale;
|
|
18586
|
-
return [-
|
|
18586
|
+
return [-Ct._internalPadding * t, -(Ct._internalPadding + this.#r) * t];
|
|
18587
18587
|
}
|
|
18588
18588
|
rebuild() {
|
|
18589
18589
|
this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
|
|
@@ -18627,7 +18627,7 @@ class St extends U {
|
|
|
18627
18627
|
this.editorDiv.normalize();
|
|
18628
18628
|
let e = null;
|
|
18629
18629
|
for (const s of this.editorDiv.childNodes)
|
|
18630
|
-
e?.nodeType === Node.TEXT_NODE && s.nodeName === "BR" || (t.push(
|
|
18630
|
+
e?.nodeType === Node.TEXT_NODE && s.nodeName === "BR" || (t.push(Ct.#l(s)), e = s);
|
|
18631
18631
|
return t.join(`
|
|
18632
18632
|
`);
|
|
18633
18633
|
}
|
|
@@ -18682,7 +18682,7 @@ class St extends U {
|
|
|
18682
18682
|
t.target === this.div && t.key === "Enter" && (this.enterInEditMode(), t.preventDefault());
|
|
18683
18683
|
}
|
|
18684
18684
|
editorDivKeydown(t) {
|
|
18685
|
-
|
|
18685
|
+
Ct._keyboardManager.exec(this, t);
|
|
18686
18686
|
}
|
|
18687
18687
|
editorDivFocus(t) {
|
|
18688
18688
|
this.isEditing = !0;
|
|
@@ -18749,7 +18749,7 @@ class St extends U {
|
|
|
18749
18749
|
if (s.length === 1 && s[0] === "text/plain")
|
|
18750
18750
|
return;
|
|
18751
18751
|
t.preventDefault();
|
|
18752
|
-
const i =
|
|
18752
|
+
const i = Ct.#f(e.getData("text") || "").replaceAll(Qi, `
|
|
18753
18753
|
`);
|
|
18754
18754
|
if (!i)
|
|
18755
18755
|
return;
|
|
@@ -18776,14 +18776,14 @@ class St extends U {
|
|
|
18776
18776
|
g = c;
|
|
18777
18777
|
continue;
|
|
18778
18778
|
}
|
|
18779
|
-
g.push(
|
|
18779
|
+
g.push(Ct.#l(p));
|
|
18780
18780
|
}
|
|
18781
18781
|
}
|
|
18782
18782
|
l.push(o.nodeValue.slice(0, h).replaceAll(Qi, ""));
|
|
18783
18783
|
} else if (o === this.editorDiv) {
|
|
18784
18784
|
let f = l, g = 0;
|
|
18785
18785
|
for (const p of this.editorDiv.childNodes)
|
|
18786
|
-
g++ === h && (f = c), f.push(
|
|
18786
|
+
g++ === h && (f = c), f.push(Ct.#l(p));
|
|
18787
18787
|
}
|
|
18788
18788
|
this.#e = `${l.join(`
|
|
18789
18789
|
`)}${i}${c.join(`
|
|
@@ -18860,14 +18860,14 @@ class St extends U {
|
|
|
18860
18860
|
};
|
|
18861
18861
|
}
|
|
18862
18862
|
const n = await super.deserialize(t, e, s);
|
|
18863
|
-
return n.#r = t.fontSize, n.#t = G.makeHexColor(...t.color), n.#e =
|
|
18863
|
+
return n.#r = t.fontSize, n.#t = G.makeHexColor(...t.color), n.#e = Ct.#f(t.value), n.annotationElementId = t.id || null, n._initialData = i, n;
|
|
18864
18864
|
}
|
|
18865
18865
|
serialize(t = !1) {
|
|
18866
18866
|
if (this.isEmpty())
|
|
18867
18867
|
return null;
|
|
18868
18868
|
if (this.deleted)
|
|
18869
18869
|
return this.serializeDeleted();
|
|
18870
|
-
const e =
|
|
18870
|
+
const e = Ct._internalPadding * this.parentScale, s = this.getRect(e, e), i = U._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#t), n = {
|
|
18871
18871
|
annotationType: q.FREETEXT,
|
|
18872
18872
|
color: i,
|
|
18873
18873
|
fontSize: this.#r,
|
|
@@ -18901,7 +18901,7 @@ class St extends U {
|
|
|
18901
18901
|
const r = document.createElement("div");
|
|
18902
18902
|
r.append(n ? document.createTextNode(n) : document.createElement("br")), e.append(r);
|
|
18903
18903
|
}
|
|
18904
|
-
const i =
|
|
18904
|
+
const i = Ct._internalPadding * this.parentScale;
|
|
18905
18905
|
return t.updateEdited({
|
|
18906
18906
|
rect: this.getRect(i, i),
|
|
18907
18907
|
popupContent: this.#e
|
|
@@ -18914,13 +18914,13 @@ class St extends U {
|
|
|
18914
18914
|
class B {
|
|
18915
18915
|
static PRECISION = 1e-4;
|
|
18916
18916
|
toSVGPath() {
|
|
18917
|
-
|
|
18917
|
+
rt("Abstract method `toSVGPath` must be implemented.");
|
|
18918
18918
|
}
|
|
18919
18919
|
get box() {
|
|
18920
|
-
|
|
18920
|
+
rt("Abstract getter `box` must be implemented.");
|
|
18921
18921
|
}
|
|
18922
18922
|
serialize(t, e) {
|
|
18923
|
-
|
|
18923
|
+
rt("Abstract method `serialize` must be implemented.");
|
|
18924
18924
|
}
|
|
18925
18925
|
static _rescale(t, e, s, i, n, r) {
|
|
18926
18926
|
r ||= new Float32Array(t.length);
|
|
@@ -20147,7 +20147,7 @@ class Ng {
|
|
|
20147
20147
|
this.updateProperties(t);
|
|
20148
20148
|
}
|
|
20149
20149
|
clone() {
|
|
20150
|
-
|
|
20150
|
+
rt("Not implemented");
|
|
20151
20151
|
}
|
|
20152
20152
|
}
|
|
20153
20153
|
class X extends U {
|
|
@@ -20187,10 +20187,10 @@ class X extends U {
|
|
|
20187
20187
|
return t;
|
|
20188
20188
|
}
|
|
20189
20189
|
static getDefaultDrawingOptions(t) {
|
|
20190
|
-
|
|
20190
|
+
rt("Not implemented");
|
|
20191
20191
|
}
|
|
20192
20192
|
static get typesMap() {
|
|
20193
|
-
|
|
20193
|
+
rt("Not implemented");
|
|
20194
20194
|
}
|
|
20195
20195
|
static get isDrawer() {
|
|
20196
20196
|
return !0;
|
|
@@ -20420,7 +20420,7 @@ class X extends U {
|
|
|
20420
20420
|
return this.setDims(this.width * s, this.height * i), this._uiManager.addShouldRescale(this), this.disableEditing(), t;
|
|
20421
20421
|
}
|
|
20422
20422
|
static createDrawerInstance(t, e, s, i, n) {
|
|
20423
|
-
|
|
20423
|
+
rt("Not implemented");
|
|
20424
20424
|
}
|
|
20425
20425
|
static startDrawing(t, e, s, i) {
|
|
20426
20426
|
const {
|
|
@@ -20533,7 +20533,7 @@ class X extends U {
|
|
|
20533
20533
|
createDrawingOptions(t) {
|
|
20534
20534
|
}
|
|
20535
20535
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
20536
|
-
|
|
20536
|
+
rt("Not implemented");
|
|
20537
20537
|
}
|
|
20538
20538
|
static async deserialize(t, e, s) {
|
|
20539
20539
|
const {
|
|
@@ -21620,7 +21620,7 @@ class Pe {
|
|
|
21620
21620
|
#f = null;
|
|
21621
21621
|
#o;
|
|
21622
21622
|
static _initialized = !1;
|
|
21623
|
-
static #g = new Map([
|
|
21623
|
+
static #g = new Map([Ct, Eo, ko, gt].map((t) => [t._editorType, t]));
|
|
21624
21624
|
constructor({
|
|
21625
21625
|
uiManager: t,
|
|
21626
21626
|
pageIndex: e,
|
|
@@ -21773,7 +21773,7 @@ class Pe {
|
|
|
21773
21773
|
if (e === this.#u.div || (e.getAttribute("role") === "img" || e.classList.contains("endOfContent")) && this.#u.div.contains(e)) {
|
|
21774
21774
|
const {
|
|
21775
21775
|
isMac: s
|
|
21776
|
-
} =
|
|
21776
|
+
} = zt.platform;
|
|
21777
21777
|
if (t.button !== 0 || t.ctrlKey && s)
|
|
21778
21778
|
return;
|
|
21779
21779
|
this.#o.showAllEditors("highlight", !0, !0), this.#u.div.classList.add("free"), this.toggleDrawing(), gt.startHighlighting(this, this.#o.direction === "ltr", {
|
|
@@ -21933,7 +21933,7 @@ class Pe {
|
|
|
21933
21933
|
pointerup(t) {
|
|
21934
21934
|
const {
|
|
21935
21935
|
isMac: e
|
|
21936
|
-
} =
|
|
21936
|
+
} = zt.platform;
|
|
21937
21937
|
if (!(t.button !== 0 || t.ctrlKey && e) && t.target === this.div && this.#h && (this.#h = !1, !(this.#p?.isDrawer && this.#p.supportMultipleDrawings))) {
|
|
21938
21938
|
if (!this.#e) {
|
|
21939
21939
|
this.#e = !0;
|
|
@@ -21953,7 +21953,7 @@ class Pe {
|
|
|
21953
21953
|
}
|
|
21954
21954
|
const {
|
|
21955
21955
|
isMac: e
|
|
21956
|
-
} =
|
|
21956
|
+
} = zt.platform;
|
|
21957
21957
|
if (t.button !== 0 || t.ctrlKey && e || t.target !== this.div)
|
|
21958
21958
|
return;
|
|
21959
21959
|
if (this.#h = !0, this.#p?.isDrawer) {
|
|
@@ -22043,7 +22043,7 @@ class Pe {
|
|
|
22043
22043
|
return this.#o.viewParameters.realScale;
|
|
22044
22044
|
}
|
|
22045
22045
|
}
|
|
22046
|
-
class
|
|
22046
|
+
class Lt {
|
|
22047
22047
|
#t = null;
|
|
22048
22048
|
#e = 0;
|
|
22049
22049
|
#s = /* @__PURE__ */ new Map();
|
|
@@ -22075,15 +22075,15 @@ class Ft {
|
|
|
22075
22075
|
r.top = `${100 * s}%`, r.left = `${100 * e}%`, r.width = `${100 * i}%`, r.height = `${100 * n}%`;
|
|
22076
22076
|
}
|
|
22077
22077
|
#n() {
|
|
22078
|
-
const t =
|
|
22078
|
+
const t = Lt._svgFactory.create(1, 1, !0);
|
|
22079
22079
|
return this.#t.append(t), t.setAttribute("aria-hidden", !0), t;
|
|
22080
22080
|
}
|
|
22081
22081
|
#h(t, e) {
|
|
22082
|
-
const s =
|
|
22082
|
+
const s = Lt._svgFactory.createElement("clipPath");
|
|
22083
22083
|
t.append(s);
|
|
22084
22084
|
const i = `clip_${e}`;
|
|
22085
22085
|
s.setAttribute("id", i), s.setAttribute("clipPathUnits", "objectBoundingBox");
|
|
22086
|
-
const n =
|
|
22086
|
+
const n = Lt._svgFactory.createElement("use");
|
|
22087
22087
|
return s.append(n), n.setAttribute("href", `#${e}`), n.classList.add("clip"), i;
|
|
22088
22088
|
}
|
|
22089
22089
|
#a(t, e) {
|
|
@@ -22091,35 +22091,35 @@ class Ft {
|
|
|
22091
22091
|
i === null ? t.removeAttribute(s) : t.setAttribute(s, i);
|
|
22092
22092
|
}
|
|
22093
22093
|
draw(t, e = !1, s = !1) {
|
|
22094
|
-
const i = this.#e++, n = this.#n(), r =
|
|
22094
|
+
const i = this.#e++, n = this.#n(), r = Lt._svgFactory.createElement("defs");
|
|
22095
22095
|
n.append(r);
|
|
22096
|
-
const o =
|
|
22096
|
+
const o = Lt._svgFactory.createElement("path");
|
|
22097
22097
|
r.append(o);
|
|
22098
22098
|
const h = `path_p${this.pageIndex}_${i}`;
|
|
22099
22099
|
o.setAttribute("id", h), o.setAttribute("vector-effect", "non-scaling-stroke"), e && this.#i.set(i, o);
|
|
22100
|
-
const l = s ? this.#h(r, h) : null, c =
|
|
22100
|
+
const l = s ? this.#h(r, h) : null, c = Lt._svgFactory.createElement("use");
|
|
22101
22101
|
return n.append(c), c.setAttribute("href", `#${h}`), this.updateProperties(n, t), this.#s.set(i, n), {
|
|
22102
22102
|
id: i,
|
|
22103
22103
|
clipPathId: `url(#${l})`
|
|
22104
22104
|
};
|
|
22105
22105
|
}
|
|
22106
22106
|
drawOutline(t, e) {
|
|
22107
|
-
const s = this.#e++, i = this.#n(), n =
|
|
22107
|
+
const s = this.#e++, i = this.#n(), n = Lt._svgFactory.createElement("defs");
|
|
22108
22108
|
i.append(n);
|
|
22109
|
-
const r =
|
|
22109
|
+
const r = Lt._svgFactory.createElement("path");
|
|
22110
22110
|
n.append(r);
|
|
22111
22111
|
const o = `path_p${this.pageIndex}_${s}`;
|
|
22112
22112
|
r.setAttribute("id", o), r.setAttribute("vector-effect", "non-scaling-stroke");
|
|
22113
22113
|
let h;
|
|
22114
22114
|
if (e) {
|
|
22115
|
-
const u =
|
|
22115
|
+
const u = Lt._svgFactory.createElement("mask");
|
|
22116
22116
|
n.append(u), h = `mask_p${this.pageIndex}_${s}`, u.setAttribute("id", h), u.setAttribute("maskUnits", "objectBoundingBox");
|
|
22117
|
-
const d =
|
|
22117
|
+
const d = Lt._svgFactory.createElement("rect");
|
|
22118
22118
|
u.append(d), d.setAttribute("width", "1"), d.setAttribute("height", "1"), d.setAttribute("fill", "white");
|
|
22119
|
-
const f =
|
|
22119
|
+
const f = Lt._svgFactory.createElement("use");
|
|
22120
22120
|
u.append(f), f.setAttribute("href", `#${o}`), f.setAttribute("stroke", "none"), f.setAttribute("fill", "black"), f.setAttribute("fill-rule", "nonzero"), f.classList.add("mask");
|
|
22121
22121
|
}
|
|
22122
|
-
const l =
|
|
22122
|
+
const l = Lt._svgFactory.createElement("use");
|
|
22123
22123
|
i.append(l), l.setAttribute("href", `#${o}`), h && l.setAttribute("mask", `url(#${h})`);
|
|
22124
22124
|
const c = l.cloneNode();
|
|
22125
22125
|
return i.append(c), l.classList.add("mainOutline"), c.classList.add("secondaryOutline"), this.updateProperties(i, t), this.#s.set(s, i), s;
|
|
@@ -22137,7 +22137,7 @@ class Ft {
|
|
|
22137
22137
|
path: r
|
|
22138
22138
|
} = e, o = typeof t == "number" ? this.#s.get(t) : t;
|
|
22139
22139
|
if (o) {
|
|
22140
|
-
if (s && this.#a(o, s), i &&
|
|
22140
|
+
if (s && this.#a(o, s), i && Lt.#r(o, i), n) {
|
|
22141
22141
|
const {
|
|
22142
22142
|
classList: h
|
|
22143
22143
|
} = o;
|
|
@@ -22285,10 +22285,10 @@ async function Ug({ page: a, data: t, scale: e, password: s }, i) {
|
|
|
22285
22285
|
return u.width = Math.floor(c.width * n), u.height = Math.floor(c.height * n), l.render(f).promise.then(() => ({ canvas: u, pages: h }));
|
|
22286
22286
|
}
|
|
22287
22287
|
}
|
|
22288
|
-
const
|
|
22288
|
+
const jt = /* @__PURE__ */ new Map();
|
|
22289
22289
|
function Yg(a) {
|
|
22290
22290
|
const t = new Pr(a);
|
|
22291
|
-
return
|
|
22291
|
+
return jt.set(a, t), t;
|
|
22292
22292
|
}
|
|
22293
22293
|
function $g(a) {
|
|
22294
22294
|
const t = Date.now();
|
|
@@ -22307,7 +22307,7 @@ async function qg({ src: a }, t, e) {
|
|
|
22307
22307
|
}), r.hoverCursor = "pointer", r.stroke = `${e}-${t}`, r;
|
|
22308
22308
|
}
|
|
22309
22309
|
function Kg(a, t) {
|
|
22310
|
-
if (!
|
|
22310
|
+
if (!jt.get(a)) return;
|
|
22311
22311
|
const s = 1 / 3, i = ip(t, s);
|
|
22312
22312
|
ql(a, i, s);
|
|
22313
22313
|
}
|
|
@@ -22321,12 +22321,12 @@ async function Jg(a, t) {
|
|
|
22321
22321
|
return t && $l(t, { data: a }), { ...i, pages: 1 };
|
|
22322
22322
|
}
|
|
22323
22323
|
async function $l(a, { data: t, scale: e = 0.5 }) {
|
|
22324
|
-
if (!
|
|
22325
|
-
const i = URL.createObjectURL(t), n = await
|
|
22324
|
+
if (!jt.get(a)) return;
|
|
22325
|
+
const i = URL.createObjectURL(t), n = await Pt.fromURL(i);
|
|
22326
22326
|
n.scale(e), ql(a, n, e), URL.revokeObjectURL(i);
|
|
22327
22327
|
}
|
|
22328
22328
|
function ql(a, t, e) {
|
|
22329
|
-
const s =
|
|
22329
|
+
const s = jt.get(a);
|
|
22330
22330
|
s && (s.setWidth(t.width * e), s.setHeight(t.height * e), s.backgroundImage = t, s.renderAll());
|
|
22331
22331
|
}
|
|
22332
22332
|
function Zg(a, t) {
|
|
@@ -22345,15 +22345,15 @@ function tp(a, t) {
|
|
|
22345
22345
|
a.borderScaleFactor = 1 / t, a.cornerSize = e * (1 / t), a.touchCornerSize = e * 4 * (1 / t), a.setCoords();
|
|
22346
22346
|
}
|
|
22347
22347
|
function ep(a) {
|
|
22348
|
-
const t =
|
|
22348
|
+
const t = jt.get(a);
|
|
22349
22349
|
t && (t.discardActiveObject(), t.renderAll());
|
|
22350
22350
|
}
|
|
22351
22351
|
function sp(a) {
|
|
22352
|
-
const t =
|
|
22353
|
-
t && (t.clear(),
|
|
22352
|
+
const t = jt.get(a);
|
|
22353
|
+
t && (t.clear(), jt.delete(a));
|
|
22354
22354
|
}
|
|
22355
22355
|
function ip(a, t) {
|
|
22356
|
-
return new
|
|
22356
|
+
return new Pt(a, { scaleX: t, scaleY: t });
|
|
22357
22357
|
}
|
|
22358
22358
|
function zr(a, t) {
|
|
22359
22359
|
if (!t) return;
|
|
@@ -22379,7 +22379,7 @@ async function Za(a, t, e) {
|
|
|
22379
22379
|
return await Jg(a, e);
|
|
22380
22380
|
}
|
|
22381
22381
|
function op(a, t) {
|
|
22382
|
-
const e =
|
|
22382
|
+
const e = jt.get(a);
|
|
22383
22383
|
if (!e) return;
|
|
22384
22384
|
const s = e.getActiveObject();
|
|
22385
22385
|
s && (s instanceof Qt ? s.forEachObject((i) => {
|
|
@@ -22387,7 +22387,7 @@ function op(a, t) {
|
|
|
22387
22387
|
}) : s.set(t), e.renderAll());
|
|
22388
22388
|
}
|
|
22389
22389
|
async function ap(a, t) {
|
|
22390
|
-
const e =
|
|
22390
|
+
const e = jt.get(a);
|
|
22391
22391
|
if (!e) return;
|
|
22392
22392
|
const s = e?.getActiveObject();
|
|
22393
22393
|
if (!s) return;
|
|
@@ -22397,7 +22397,7 @@ async function ap(a, t) {
|
|
|
22397
22397
|
}) : (e.add(i), t(e, i)), zr(i, { x: -0.1, y: -0.1 }), e.setActiveObject(i);
|
|
22398
22398
|
}
|
|
22399
22399
|
function hp(a) {
|
|
22400
|
-
const t =
|
|
22400
|
+
const t = jt.get(a);
|
|
22401
22401
|
if (!t) return;
|
|
22402
22402
|
const e = t.getActiveObject();
|
|
22403
22403
|
e && (e instanceof Qt ? (e.forEachObject((s) => {
|
|
@@ -22415,7 +22415,7 @@ function lp(a) {
|
|
|
22415
22415
|
selectionCleared: o
|
|
22416
22416
|
} = a || {}, h = ws(null), l = ws(null), c = ws(1), u = ws({ ...hc });
|
|
22417
22417
|
function d() {
|
|
22418
|
-
if (!t ||
|
|
22418
|
+
if (!t || jt.has(t)) return;
|
|
22419
22419
|
const O = Yg(t);
|
|
22420
22420
|
return O.on("selection:created", (D) => {
|
|
22421
22421
|
if (r?.(D), D.selected.length <= 1) return;
|
|
@@ -22435,15 +22435,15 @@ function lp(a) {
|
|
|
22435
22435
|
return $l(t, { data: O, scale: D });
|
|
22436
22436
|
}
|
|
22437
22437
|
async function b(O, D, z) {
|
|
22438
|
-
const M =
|
|
22438
|
+
const M = jt.get(t);
|
|
22439
22439
|
if (!M) return;
|
|
22440
|
-
const R = await
|
|
22440
|
+
const R = await Pt.fromURL(O, {}, { ...rc, ...D });
|
|
22441
22441
|
zr(R, z), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22442
22442
|
}
|
|
22443
22443
|
function m(O, D, z) {
|
|
22444
|
-
const M =
|
|
22444
|
+
const M = jt.get(t);
|
|
22445
22445
|
if (!M) return;
|
|
22446
|
-
const R = new
|
|
22446
|
+
const R = new kt(O, {
|
|
22447
22447
|
...oc,
|
|
22448
22448
|
...D
|
|
22449
22449
|
});
|
|
@@ -22477,13 +22477,13 @@ function lp(a) {
|
|
|
22477
22477
|
}));
|
|
22478
22478
|
}
|
|
22479
22479
|
function S(O, D = !1) {
|
|
22480
|
-
const z =
|
|
22480
|
+
const z = jt.get(t);
|
|
22481
22481
|
c.current = O, z && (tp(l.current, O), Qg(l.current, O, h.current), !D && z.renderAll());
|
|
22482
22482
|
}
|
|
22483
22483
|
function A(O) {
|
|
22484
22484
|
if (!O) return;
|
|
22485
22485
|
u.current = { ...u.current, ...O };
|
|
22486
|
-
const D =
|
|
22486
|
+
const D = jt.get(t);
|
|
22487
22487
|
!h || !l.current || !D || y({ target: l.current, canvas: D });
|
|
22488
22488
|
}
|
|
22489
22489
|
function T(O) {
|
|
@@ -22560,8 +22560,8 @@ function up({
|
|
|
22560
22560
|
deleteCanvas: M,
|
|
22561
22561
|
scaleFabric: R,
|
|
22562
22562
|
setActiveFabric: W,
|
|
22563
|
-
setCloseSvgOptions:
|
|
22564
|
-
copyActiveFabric:
|
|
22563
|
+
setCloseSvgOptions: ot,
|
|
22564
|
+
copyActiveFabric: ht,
|
|
22565
22565
|
deleteActiveFabric: E
|
|
22566
22566
|
} = lp({
|
|
22567
22567
|
id: T,
|
|
@@ -22575,9 +22575,9 @@ function up({
|
|
|
22575
22575
|
cp(st);
|
|
22576
22576
|
async function H() {
|
|
22577
22577
|
globalThis.requestAnimationFrame(async () => {
|
|
22578
|
-
if (j(), a.data?.type.startsWith("image/")
|
|
22579
|
-
const
|
|
22580
|
-
|
|
22578
|
+
if (j(), a.data?.type.startsWith("image/")) {
|
|
22579
|
+
const xt = a.data;
|
|
22580
|
+
xt && D({ data: xt, scale: i / 3 }), g?.();
|
|
22581
22581
|
return;
|
|
22582
22582
|
}
|
|
22583
22583
|
const N = a.data;
|
|
@@ -22591,14 +22591,14 @@ function up({
|
|
|
22591
22591
|
}
|
|
22592
22592
|
function V(N) {
|
|
22593
22593
|
if (N.preventDefault(), N.stopPropagation(), !o || !N.dataTransfer) return;
|
|
22594
|
-
const { dataTransfer:
|
|
22595
|
-
Po ? J(Po, Ro, Lo) : Mo &&
|
|
22594
|
+
const { dataTransfer: lt, nativeEvent: xt } = N, { offsetX: Wt, offsetY: Jl } = xt, Mo = lt.getData("text/plain"), Po = lt.getData("text/uri-list"), Oo = lt.getData("custom/offset"), Do = Oo ? JSON.parse(Oo) : null, Ro = { top: Jl, left: Wt }, Lo = { x: Do?.offsetX ?? 0, y: Do?.offsetY ?? 0 };
|
|
22595
|
+
Po ? J(Po, Ro, Lo) : Mo && Tt(Mo, Ro, Lo);
|
|
22596
22596
|
}
|
|
22597
|
-
function J(N,
|
|
22598
|
-
I(N, { ...c, ...
|
|
22597
|
+
function J(N, lt, xt) {
|
|
22598
|
+
I(N, { ...c, ...lt }, xt);
|
|
22599
22599
|
}
|
|
22600
|
-
function
|
|
22601
|
-
O(N, { ...l, ...
|
|
22600
|
+
function Tt(N, lt, xt) {
|
|
22601
|
+
O(N, { ...l, ...lt }, xt);
|
|
22602
22602
|
}
|
|
22603
22603
|
function st() {
|
|
22604
22604
|
f || H(), p?.();
|
|
@@ -22606,11 +22606,11 @@ function up({
|
|
|
22606
22606
|
return tc(S, () => ({
|
|
22607
22607
|
reload: H,
|
|
22608
22608
|
addImage: J,
|
|
22609
|
-
addText:
|
|
22609
|
+
addText: Tt,
|
|
22610
22610
|
clearActive: z,
|
|
22611
22611
|
deleteCanvas: M,
|
|
22612
22612
|
setActiveFabric: W,
|
|
22613
|
-
copyActiveFabric:
|
|
22613
|
+
copyActiveFabric: ht,
|
|
22614
22614
|
deleteActiveFabric: E,
|
|
22615
22615
|
canvasRef: A
|
|
22616
22616
|
})), Js(() => {
|
|
@@ -22618,7 +22618,7 @@ function up({
|
|
|
22618
22618
|
}, [i, t, a, h]), Js(() => {
|
|
22619
22619
|
R(k);
|
|
22620
22620
|
}, [k]), Js(() => {
|
|
22621
|
-
|
|
22621
|
+
ot(u);
|
|
22622
22622
|
}, [u]), Js(() => () => M(), []), /* @__PURE__ */ zo.jsx(
|
|
22623
22623
|
"div",
|
|
22624
22624
|
{
|