@cliquify.me/timeline 3.1.16 → 3.1.18
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/index.es.js +465 -456
- package/dist/index.umd.js +39 -39
- package/dist/objects/illustration.d.ts +3 -0
- package/dist/objects/index.d.ts +3 -0
- package/dist/objects/shape.d.ts +3 -0
- package/dist/utils/load-object.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -120,10 +120,10 @@ void main(){}`), r = t.createShader(t.FRAGMENT_SHADER);
|
|
|
120
120
|
const zl = {};
|
|
121
121
|
let fo;
|
|
122
122
|
const Gt = () => fo || (fo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new Xl(), dispose() {
|
|
123
|
-
}, copyPasteData: zl }),
|
|
123
|
+
}, copyPasteData: zl }), ks = () => Gt().document, ui = () => Gt().window, La = () => {
|
|
124
124
|
var i;
|
|
125
125
|
return Math.max((i = A.devicePixelRatio) !== null && i !== void 0 ? i : ui().devicePixelRatio, 1);
|
|
126
|
-
},
|
|
126
|
+
}, Hs = new class {
|
|
127
127
|
constructor() {
|
|
128
128
|
y(this, "charWidthsCache", {}), y(this, "boundsOfCurveCache", {});
|
|
129
129
|
}
|
|
@@ -143,7 +143,7 @@ const Gt = () => fo || (fo = { document, window, isTouchSupported: "ontouchstart
|
|
|
143
143
|
}(), tn = "6.3.0";
|
|
144
144
|
function Be() {
|
|
145
145
|
}
|
|
146
|
-
const Se = Math.PI / 2, ce = 2 * Math.PI, Dn = Math.PI / 180, ut = Object.freeze([1, 0, 0, 1, 0, 0]), In = 16, me = 0.4477152502, j = "center", F = "left", gt = "top", en = "bottom", Z = "right", pt = "none", jn = /\r?\n/, Fa = "moving", di = "scaling", Ra = "rotating", En = "rotate", Ba = "skewing",
|
|
146
|
+
const Se = Math.PI / 2, ce = 2 * Math.PI, Dn = Math.PI / 180, ut = Object.freeze([1, 0, 0, 1, 0, 0]), In = 16, me = 0.4477152502, j = "center", F = "left", gt = "top", en = "bottom", Z = "right", pt = "none", jn = /\r?\n/, Fa = "moving", di = "scaling", Ra = "rotating", En = "rotate", Ba = "skewing", Ks = "resizing", Wa = "modifyPoly", Hl = "modifyPath", $r = "changed", fi = "scale", dt = "scaleX", St = "scaleY", Ms = "skewX", Ds = "skewY", rt = "fill", mt = "stroke", qr = "modified", $e = "json", Ai = "svg", C = new class {
|
|
147
147
|
constructor() {
|
|
148
148
|
this[$e] = /* @__PURE__ */ new Map(), this[Ai] = /* @__PURE__ */ new Map();
|
|
149
149
|
}
|
|
@@ -164,7 +164,7 @@ const Se = Math.PI / 2, ce = 2 * Math.PI, Dn = Math.PI / 180, ut = Object.freeze
|
|
|
164
164
|
setSVGClass(i, t) {
|
|
165
165
|
this[Ai].set(t ?? i.type.toLowerCase(), i);
|
|
166
166
|
}
|
|
167
|
-
}(),
|
|
167
|
+
}(), Kr = new class extends Array {
|
|
168
168
|
remove(i) {
|
|
169
169
|
const t = this.indexOf(i);
|
|
170
170
|
t > -1 && this.splice(t, 1);
|
|
@@ -376,7 +376,7 @@ class _ {
|
|
|
376
376
|
return new _(t[0] * this.x + t[2] * this.y + (e ? 0 : t[4]), t[1] * this.x + t[3] * this.y + (e ? 0 : t[5]));
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
const Pn = new _(0, 0),
|
|
379
|
+
const Pn = new _(0, 0), Nr = (i) => !!i && Array.isArray(i._objects);
|
|
380
380
|
function Xa(i) {
|
|
381
381
|
class t extends i {
|
|
382
382
|
constructor() {
|
|
@@ -510,7 +510,7 @@ class za extends Yl {
|
|
|
510
510
|
return this[t];
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Ys(i) {
|
|
514
514
|
return ui().requestAnimationFrame(i);
|
|
515
515
|
}
|
|
516
516
|
function Ha(i) {
|
|
@@ -518,10 +518,10 @@ function Ha(i) {
|
|
|
518
518
|
}
|
|
519
519
|
let Vl = 0;
|
|
520
520
|
const Te = () => Vl++, J = () => {
|
|
521
|
-
const i =
|
|
521
|
+
const i = ks().createElement("canvas");
|
|
522
522
|
if (!i || i.getContext === void 0) throw new Xt("Failed to create `canvas` element");
|
|
523
523
|
return i;
|
|
524
|
-
}, Ya = () =>
|
|
524
|
+
}, Ya = () => ks().createElement("img"), An = (i, t, e) => i.toDataURL("image/".concat(t), e), q = (i) => i * Dn, xe = (i) => i / Dn, Va = (i) => i.every((t, e) => t === ut[e]), at = (i, t, e) => new _(i).transform(t, e), _t = (i) => {
|
|
525
525
|
const t = 1 / (i[0] * i[3] - i[1] * i[2]), e = [t * i[3], -t * i[1], -t * i[2], t * i[0], 0, 0], { x: s, y: r } = new _(i[4], i[5]).transform(e, !0);
|
|
526
526
|
return e[4] = -s, e[5] = -r, e;
|
|
527
527
|
}, K = (i, t, e) => [i[0] * t[0] + i[2] * t[1], i[1] * t[0] + i[3] * t[1], i[0] * t[2] + i[2] * t[3], i[1] * t[2] + i[3] * t[3], e ? 0 : i[0] * t[4] + i[2] * t[5] + i[4], e ? 0 : i[1] * t[4] + i[3] * t[5] + i[5]], gi = (i, t) => i.reduceRight((e, s) => s && e ? K(s, e, t) : s || e, void 0) || ut.concat(), Ga = (i) => {
|
|
@@ -530,26 +530,26 @@ const Te = () => Vl++, J = () => {
|
|
|
530
530
|
}, vs = (i) => {
|
|
531
531
|
const t = Ga(i), e = Math.pow(i[0], 2) + Math.pow(i[1], 2), s = Math.sqrt(e), r = (i[0] * i[3] - i[2] * i[1]) / s, n = Math.atan2(i[0] * i[2] + i[1] * i[3], e);
|
|
532
532
|
return { angle: xe(t), scaleX: s, scaleY: r, skewX: xe(n), skewY: 0, translateX: i[4] || 0, translateY: i[5] || 0 };
|
|
533
|
-
},
|
|
533
|
+
}, Is = function(i) {
|
|
534
534
|
return [1, 0, 0, 1, i, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0];
|
|
535
535
|
};
|
|
536
|
-
function
|
|
536
|
+
function js() {
|
|
537
537
|
let { angle: i = 0 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, { x: t = 0, y: e = 0 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
538
538
|
const s = q(i), r = Ft(s), n = Rt(s);
|
|
539
539
|
return [r, n, -n, r, t ? t - (r * t - n * e) : 0, e ? e - (n * t + r * e) : 0];
|
|
540
540
|
}
|
|
541
541
|
const pi = function(i) {
|
|
542
542
|
return [i, 0, 0, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : i, 0, 0];
|
|
543
|
-
}, Na = (i) => Math.tan(q(i)), Ln = (i) => [1, 0, Na(i), 1, 0, 0], Fn = (i) => [1, Na(i), 0, 1, 0, 0],
|
|
543
|
+
}, Na = (i) => Math.tan(q(i)), Ln = (i) => [1, 0, Na(i), 1, 0, 0], Fn = (i) => [1, Na(i), 0, 1, 0, 0], hr = (i) => {
|
|
544
544
|
let { scaleX: t = 1, scaleY: e = 1, flipX: s = !1, flipY: r = !1, skewX: n = 0, skewY: o = 0 } = i, a = pi(s ? -t : t, r ? -e : e);
|
|
545
545
|
return n && (a = K(a, Ln(n), !0)), o && (a = K(a, Fn(o), !0)), a;
|
|
546
546
|
}, Ua = (i) => {
|
|
547
547
|
const { translateX: t = 0, translateY: e = 0, angle: s = 0 } = i;
|
|
548
|
-
let r =
|
|
549
|
-
s && (r = K(r,
|
|
550
|
-
const n =
|
|
548
|
+
let r = Is(t, e);
|
|
549
|
+
s && (r = K(r, js({ angle: s })));
|
|
550
|
+
const n = hr(i);
|
|
551
551
|
return Va(n) || (r = K(r, n)), r;
|
|
552
|
-
},
|
|
552
|
+
}, Vs = function(i) {
|
|
553
553
|
let { signal: t, crossOrigin: e = null } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
554
554
|
return new Promise(function(s, r) {
|
|
555
555
|
if (t && t.aborted) return r(new Aa("loadImage"));
|
|
@@ -577,7 +577,7 @@ const pi = function(i) {
|
|
|
577
577
|
t && t.removeEventListener("abort", r);
|
|
578
578
|
});
|
|
579
579
|
});
|
|
580
|
-
},
|
|
580
|
+
}, lr = function(i) {
|
|
581
581
|
let { signal: t } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
582
582
|
return new Promise((e, s) => {
|
|
583
583
|
const r = [];
|
|
@@ -620,7 +620,7 @@ const pi = function(i) {
|
|
|
620
620
|
}, mo = function() {
|
|
621
621
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "1";
|
|
622
622
|
return parseFloat(i) / (i.endsWith("%") ? 100 : 1);
|
|
623
|
-
},
|
|
623
|
+
}, br = (i) => Math.min(Math.round(i), 255).toString(16).toUpperCase().padStart(2, "0"), vo = (i) => {
|
|
624
624
|
let [t, e, s, r = 1] = i;
|
|
625
625
|
const n = Math.round(0.3 * t + 0.59 * e + 0.11 * s);
|
|
626
626
|
return [n, n, n, r];
|
|
@@ -663,7 +663,7 @@ class B {
|
|
|
663
663
|
}
|
|
664
664
|
toHexa() {
|
|
665
665
|
const [t, e, s, r] = this.getSource();
|
|
666
|
-
return "".concat(
|
|
666
|
+
return "".concat(br(t)).concat(br(e)).concat(br(s)).concat(br(Math.round(255 * r)));
|
|
667
667
|
}
|
|
668
668
|
getAlpha() {
|
|
669
669
|
return this.getSource()[3];
|
|
@@ -757,7 +757,7 @@ const E = (i, t) => parseFloat(Number(i).toFixed(t)), We = function(i) {
|
|
|
757
757
|
const [t, e] = i.trim().split(" "), [s, r] = (n = t) && n !== pt ? [n.slice(1, 4), n.slice(5, 8)] : n === pt ? [n, n] : ["Mid", "Mid"];
|
|
758
758
|
var n;
|
|
759
759
|
return { meetOrSlice: e || "meet", alignX: s, alignY: r };
|
|
760
|
-
},
|
|
760
|
+
}, Zs = (i) => "matrix(" + i.map((t) => E(t, A.NUM_FRACTION_DIGITS)).join(" ") + ")", Js = function(i, t) {
|
|
761
761
|
let e, s, r = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2];
|
|
762
762
|
if (t) if (t.toLive) e = "url(#SVGID_".concat(t.id, ")");
|
|
763
763
|
else {
|
|
@@ -780,7 +780,7 @@ const Pt = (i) => i.ownerDocument || null, Za = (i) => {
|
|
|
780
780
|
var t;
|
|
781
781
|
return ((t = i.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView) || null;
|
|
782
782
|
};
|
|
783
|
-
function
|
|
783
|
+
function Gs(i, t) {
|
|
784
784
|
const e = i.style;
|
|
785
785
|
e && (typeof t == "string" ? i.style.cssText += ";" + t : Object.entries(t).forEach((s) => {
|
|
786
786
|
let [r, n] = s;
|
|
@@ -804,7 +804,7 @@ class Qa {
|
|
|
804
804
|
this.lower = { el: e, ctx: e.getContext("2d") };
|
|
805
805
|
}
|
|
806
806
|
createLowerCanvas(t) {
|
|
807
|
-
const e = (s = t) && s.getContext !== void 0 ? t : t &&
|
|
807
|
+
const e = (s = t) && s.getContext !== void 0 ? t : t && ks().getElementById(t) || J();
|
|
808
808
|
var s;
|
|
809
809
|
if (e.hasAttribute("data-fabric")) throw new Xt("Trying to initialize a canvas that has already been initialized. Did you forget to dispose the canvas?");
|
|
810
810
|
return this._originalCanvasStyle = e.style.cssText, e.setAttribute("data-fabric", "main"), e.classList.add("lower-canvas"), e;
|
|
@@ -840,7 +840,7 @@ class Qa {
|
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
const Gl = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...ut] };
|
|
843
|
-
class
|
|
843
|
+
class ur extends Xa(za) {
|
|
844
844
|
get lowerCanvasEl() {
|
|
845
845
|
var t;
|
|
846
846
|
return (t = this.elements.lower) === null || t === void 0 ? void 0 : t.el;
|
|
@@ -850,7 +850,7 @@ class hr extends Xa(za) {
|
|
|
850
850
|
return (t = this.elements.lower) === null || t === void 0 ? void 0 : t.ctx;
|
|
851
851
|
}
|
|
852
852
|
static getDefaults() {
|
|
853
|
-
return
|
|
853
|
+
return ur.ownDefaults;
|
|
854
854
|
}
|
|
855
855
|
constructor(t) {
|
|
856
856
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -952,7 +952,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
952
952
|
this.nextRenderHandle = 0, this.renderAll();
|
|
953
953
|
}
|
|
954
954
|
requestRenderAll() {
|
|
955
|
-
this.nextRenderHandle || this.disposed || this.destroyed || (this.nextRenderHandle =
|
|
955
|
+
this.nextRenderHandle || this.disposed || this.destroyed || (this.nextRenderHandle = Ys(() => this.renderAndReset()));
|
|
956
956
|
}
|
|
957
957
|
calcViewportBoundaries() {
|
|
958
958
|
const t = this.width, e = this.height, s = _t(this.viewportTransform), r = at({ x: 0, y: 0 }, s), n = at({ x: t, y: e }, s), o = r.min(n), a = r.max(n);
|
|
@@ -1093,14 +1093,14 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1093
1093
|
const e = this["".concat(t, "Color")];
|
|
1094
1094
|
if (Ct(e)) {
|
|
1095
1095
|
const s = this["".concat(t, "Vpt")], r = this.viewportTransform, n = { isType: () => !1, width: this.width / (s ? r[0] : 1), height: this.height / (s ? r[3] : 1) };
|
|
1096
|
-
return e.toSVG(n, { additionalTransform: s ?
|
|
1096
|
+
return e.toSVG(n, { additionalTransform: s ? Zs(r) : "" });
|
|
1097
1097
|
}
|
|
1098
1098
|
}).join("");
|
|
1099
1099
|
}
|
|
1100
1100
|
createSVGFontFacesMarkup() {
|
|
1101
1101
|
const t = [], e = {}, s = A.fontPaths;
|
|
1102
1102
|
this._objects.forEach(function n(o) {
|
|
1103
|
-
t.push(o),
|
|
1103
|
+
t.push(o), Nr(o) && o._objects.forEach(n);
|
|
1104
1104
|
}), t.forEach((n) => {
|
|
1105
1105
|
if (!qa(n)) return;
|
|
1106
1106
|
const { styles: o, fontFamily: a } = n;
|
|
@@ -1135,7 +1135,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1135
1135
|
_setSVGBgOverlayColor(t, e) {
|
|
1136
1136
|
const s = this["".concat(e, "Color")];
|
|
1137
1137
|
if (s) if (Ct(s)) {
|
|
1138
|
-
const r = s.repeat || "", n = this.width, o = this.height, a = this["".concat(e, "Vpt")] ?
|
|
1138
|
+
const r = s.repeat || "", n = this.width, o = this.height, a = this["".concat(e, "Vpt")] ? Zs(_t(this.viewportTransform)) : "";
|
|
1139
1139
|
t.push('<rect transform="'.concat(a, " translate(").concat(n / 2, ",").concat(o / 2, ')" x="').concat(s.offsetX - n / 2, '" y="').concat(s.offsetY - o / 2, '" width="').concat(r !== "repeat-y" && r !== "no-repeat" || !bo(s) ? n : s.source.width, '" height="').concat(r !== "repeat-x" && r !== "no-repeat" || !bo(s) ? o : s.source.height, '" fill="url(#SVGID_').concat(s.id, `)"></rect>
|
|
1140
1140
|
`));
|
|
1141
1141
|
} else t.push('<rect x="0" y="0" width="100%" height="100%" ', 'fill="', s, '"', `></rect>
|
|
@@ -1145,7 +1145,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1145
1145
|
let { signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
1146
1146
|
if (!t) return Promise.reject(new Xt("`json` is undefined"));
|
|
1147
1147
|
const r = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [], backgroundImage: o, background: a, overlayImage: c, overlay: h, clipPath: l } = r, u = this.renderOnAddRemove;
|
|
1148
|
-
return this.renderOnAddRemove = !1, Promise.all([ys(n, { reviver: e, signal: s }),
|
|
1148
|
+
return this.renderOnAddRemove = !1, Promise.all([ys(n, { reviver: e, signal: s }), lr({ backgroundImage: o, backgroundColor: a, overlayImage: c, overlayColor: h, clipPath: l }, { signal: s })]).then((d) => {
|
|
1149
1149
|
let [f, g] = d;
|
|
1150
1150
|
return this.clear(), this.add(...f), this.set(r), this.set(g), this.renderOnAddRemove = u, this;
|
|
1151
1151
|
});
|
|
@@ -1169,7 +1169,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1169
1169
|
return b.width = a, b.height = c, this.enableRetinaScaling = !1, this.viewportTransform = p, this.width = a, this.height = c, this.skipControlsDrawing = !0, this.calcViewportBoundaries(), this.renderCanvas(b.getContext("2d"), S), this.viewportTransform = g, this.width = l, this.height = u, this.calcViewportBoundaries(), this.enableRetinaScaling = m, this.skipControlsDrawing = d, b;
|
|
1170
1170
|
}
|
|
1171
1171
|
dispose() {
|
|
1172
|
-
return !this.disposed && this.elements.cleanupDOM({ width: this.width, height: this.height }),
|
|
1172
|
+
return !this.disposed && this.elements.cleanupDOM({ width: this.width, height: this.height }), Kr.cancelByCanvas(this), this.disposed = !0, new Promise((t, e) => {
|
|
1173
1173
|
const s = () => {
|
|
1174
1174
|
this.destroy(), t(!0);
|
|
1175
1175
|
};
|
|
@@ -1183,14 +1183,14 @@ Resulting to default behavior: removing object from previous canvas and adding t
|
|
|
1183
1183
|
return "#<Canvas (".concat(this.complexity(), "): { objects: ").concat(this._objects.length, " }>");
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
|
-
y(
|
|
1186
|
+
y(ur, "ownDefaults", Gl);
|
|
1187
1187
|
const Nl = ["touchstart", "touchmove", "touchend"], tc = (i) => {
|
|
1188
1188
|
const t = Ka(i.target), e = function(s) {
|
|
1189
1189
|
const r = s.changedTouches;
|
|
1190
1190
|
return r && r[0] ? r[0] : s;
|
|
1191
1191
|
}(i);
|
|
1192
1192
|
return new _(e.clientX + t.left, e.clientY + t.top);
|
|
1193
|
-
},
|
|
1193
|
+
}, Zr = (i) => Nl.includes(i.type) || i.pointerType === "touch", rn = (i) => {
|
|
1194
1194
|
i.preventDefault(), i.stopPropagation();
|
|
1195
1195
|
}, Ht = (i) => {
|
|
1196
1196
|
if (i.length === 0) return { left: 0, top: 0, width: 0, height: 0 };
|
|
@@ -1207,23 +1207,23 @@ const Nl = ["touchstart", "touchmove", "touchend"], tc = (i) => {
|
|
|
1207
1207
|
}, Bn = (i) => ({ scaleX: i.scaleX, scaleY: i.scaleY, skewX: i.skewX, skewY: i.skewY, angle: i.angle, left: i.left, flipX: i.flipX, flipY: i.flipY, top: i.top }), mi = (i, t, e) => {
|
|
1208
1208
|
const s = i / 2, r = t / 2, n = [new _(-s, -r), new _(s, -r), new _(-s, r), new _(s, r)].map((a) => a.transform(e)), o = Ht(n);
|
|
1209
1209
|
return new _(o.width, o.height);
|
|
1210
|
-
},
|
|
1210
|
+
}, dr = function() {
|
|
1211
1211
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ut;
|
|
1212
1212
|
return K(_t(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ut), i);
|
|
1213
1213
|
}, ne = function(i) {
|
|
1214
1214
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ut, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ut;
|
|
1215
|
-
return i.transform(
|
|
1215
|
+
return i.transform(dr(t, e));
|
|
1216
1216
|
}, rc = function(i) {
|
|
1217
1217
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ut, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ut;
|
|
1218
|
-
return i.transform(
|
|
1218
|
+
return i.transform(dr(t, e), !0);
|
|
1219
1219
|
}, nn = (i, t, e) => {
|
|
1220
|
-
const s =
|
|
1220
|
+
const s = dr(t, e);
|
|
1221
1221
|
return bs(i, K(s, i.calcOwnMatrix())), s;
|
|
1222
1222
|
}, Wn = (i, t) => {
|
|
1223
1223
|
var e;
|
|
1224
1224
|
const { transform: { target: s } } = t;
|
|
1225
1225
|
(e = s.canvas) === null || e === void 0 || e.fire("object:".concat(i), v(v({}, t), {}, { target: s })), s.fire(i, t);
|
|
1226
|
-
}, $l = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, st = (i) => typeof i == "string" ? $l[i] : i - 0.5,
|
|
1226
|
+
}, $l = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, st = (i) => typeof i == "string" ? $l[i] : i - 0.5, Jr = "not-allowed";
|
|
1227
1227
|
function ic(i) {
|
|
1228
1228
|
return st(i.originX) === st(j) && st(i.originY) === st(j);
|
|
1229
1229
|
}
|
|
@@ -1250,8 +1250,8 @@ const oc = (i, t, e, s) => {
|
|
|
1250
1250
|
};
|
|
1251
1251
|
class ac {
|
|
1252
1252
|
getSvgStyles(t) {
|
|
1253
|
-
const e = this.fillRule ? this.fillRule : "nonzero", s = this.strokeWidth ? this.strokeWidth : "0", r = this.strokeDashArray ? this.strokeDashArray.join(" ") : pt, n = this.strokeDashOffset ? this.strokeDashOffset : "0", o = this.strokeLineCap ? this.strokeLineCap : "butt", a = this.strokeLineJoin ? this.strokeLineJoin : "miter", c = this.strokeMiterLimit ? this.strokeMiterLimit : "4", h = this.opacity !== void 0 ? this.opacity : "1", l = this.visible ? "" : " visibility: hidden;", u = t ? "" : this.getSvgFilter(), d =
|
|
1254
|
-
return [
|
|
1253
|
+
const e = this.fillRule ? this.fillRule : "nonzero", s = this.strokeWidth ? this.strokeWidth : "0", r = this.strokeDashArray ? this.strokeDashArray.join(" ") : pt, n = this.strokeDashOffset ? this.strokeDashOffset : "0", o = this.strokeLineCap ? this.strokeLineCap : "butt", a = this.strokeLineJoin ? this.strokeLineJoin : "miter", c = this.strokeMiterLimit ? this.strokeMiterLimit : "4", h = this.opacity !== void 0 ? this.opacity : "1", l = this.visible ? "" : " visibility: hidden;", u = t ? "" : this.getSvgFilter(), d = Js(rt, this.fill);
|
|
1254
|
+
return [Js(mt, this.stroke), "stroke-width: ", s, "; ", "stroke-dasharray: ", r, "; ", "stroke-linecap: ", o, "; ", "stroke-dashoffset: ", n, "; ", "stroke-linejoin: ", a, "; ", "stroke-miterlimit: ", c, "; ", d, "fill-rule: ", e, "; ", "opacity: ", h, ";", u, l].join("");
|
|
1255
1255
|
}
|
|
1256
1256
|
getSvgFilter() {
|
|
1257
1257
|
return this.shadow ? "filter: url(#SVGID_".concat(this.shadow.id, ");") : "";
|
|
@@ -1261,7 +1261,7 @@ class ac {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
getSvgTransform(t) {
|
|
1263
1263
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1264
|
-
const s = t ? this.calcTransformMatrix() : this.calcOwnMatrix(), r = 'transform="'.concat(
|
|
1264
|
+
const s = t ? this.calcTransformMatrix() : this.calcOwnMatrix(), r = 'transform="'.concat(Zs(s));
|
|
1265
1265
|
return "".concat(r).concat(e, '" ');
|
|
1266
1266
|
}
|
|
1267
1267
|
_toSVG(t) {
|
|
@@ -1347,19 +1347,19 @@ class zn {
|
|
|
1347
1347
|
const t = (e) => {
|
|
1348
1348
|
this._state === "pending" && (this.startTime = e || +/* @__PURE__ */ new Date(), this._state = "running", this._onStart(), this.tick(this.startTime));
|
|
1349
1349
|
};
|
|
1350
|
-
this.register(), this.delay > 0 ? setTimeout(() =>
|
|
1350
|
+
this.register(), this.delay > 0 ? setTimeout(() => Ys(t), this.delay) : Ys(t);
|
|
1351
1351
|
}
|
|
1352
1352
|
tick(t) {
|
|
1353
1353
|
const e = (t || +/* @__PURE__ */ new Date()) - this.startTime, s = Math.min(e, this.duration);
|
|
1354
1354
|
this.durationProgress = s / this.duration;
|
|
1355
1355
|
const { value: r, valueProgress: n } = this.calculate(s);
|
|
1356
|
-
this.value = Object.freeze(r), this.valueProgress = n, this._state !== "aborted" && (this._abort(this.value, this.valueProgress, this.durationProgress) ? (this._state = "aborted", this.unregister()) : e >= this.duration ? (this.durationProgress = this.valueProgress = 1, this._onChange(this.endValue, this.valueProgress, this.durationProgress), this._state = "completed", this._onComplete(this.endValue, this.valueProgress, this.durationProgress), this.unregister()) : (this._onChange(this.value, this.valueProgress, this.durationProgress),
|
|
1356
|
+
this.value = Object.freeze(r), this.valueProgress = n, this._state !== "aborted" && (this._abort(this.value, this.valueProgress, this.durationProgress) ? (this._state = "aborted", this.unregister()) : e >= this.duration ? (this.durationProgress = this.valueProgress = 1, this._onChange(this.endValue, this.valueProgress, this.durationProgress), this._state = "completed", this._onComplete(this.endValue, this.valueProgress, this.durationProgress), this.unregister()) : (this._onChange(this.value, this.valueProgress, this.durationProgress), Ys(this.tick)));
|
|
1357
1357
|
}
|
|
1358
1358
|
register() {
|
|
1359
|
-
|
|
1359
|
+
Kr.push(this);
|
|
1360
1360
|
}
|
|
1361
1361
|
unregister() {
|
|
1362
|
-
|
|
1362
|
+
Kr.remove(this);
|
|
1363
1363
|
}
|
|
1364
1364
|
abort() {
|
|
1365
1365
|
this._state = "aborted", this.unregister();
|
|
@@ -1407,7 +1407,7 @@ function hc(i) {
|
|
|
1407
1407
|
const t = new ru(i);
|
|
1408
1408
|
return t.start(), t;
|
|
1409
1409
|
}
|
|
1410
|
-
const iu = new _(1, 0), lc = new _(), Yn = (i, t) => i.rotate(t),
|
|
1410
|
+
const iu = new _(1, 0), lc = new _(), Yn = (i, t) => i.rotate(t), Qr = (i, t) => new _(t).subtract(i), ti = (i) => i.distanceFrom(lc), ei = (i, t) => Math.atan2(gs(i, t), dc(i, t)), uc = (i) => ei(iu, i), yi = (i) => i.eq(lc) ? i : i.scalarDivide(ti(i)), Vn = function(i) {
|
|
1411
1411
|
let t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
|
|
1412
1412
|
return yi(new _(-i.y, i.x).scalarMultiply(t ? 1 : -1));
|
|
1413
1413
|
}, gs = (i, t) => i.x * t.y - i.y * t.x, dc = (i, t) => i.x * t.x + i.y * t.y, an = (i, t, e) => {
|
|
@@ -1432,7 +1432,7 @@ class U {
|
|
|
1432
1432
|
if (e.x === s.x) return t.x === e.x && (r || t.y >= Math.min(e.y, s.y) && t.y <= Math.max(e.y, s.y));
|
|
1433
1433
|
if (e.y === s.y) return t.y === e.y && (r || t.x >= Math.min(e.x, s.x) && t.x <= Math.max(e.x, s.x));
|
|
1434
1434
|
{
|
|
1435
|
-
const n =
|
|
1435
|
+
const n = Qr(e, s), o = Qr(e, t).divide(n);
|
|
1436
1436
|
return r ? Math.abs(o.x) === Math.abs(o.y) : o.x === o.y && o.x >= 0 && o.x <= 1;
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
@@ -1498,7 +1498,7 @@ class nu extends za {
|
|
|
1498
1498
|
this.strokeUniform && (r = 0, n = s);
|
|
1499
1499
|
const o = e.width + r, a = e.height + r;
|
|
1500
1500
|
let c;
|
|
1501
|
-
return c = e.skewX === 0 && e.skewY === 0 ? new _(o * e.scaleX, a * e.scaleY) : mi(o, a,
|
|
1501
|
+
return c = e.skewX === 0 && e.skewY === 0 ? new _(o * e.scaleX, a * e.scaleY) : mi(o, a, hr(e)), c.scalarAdd(n);
|
|
1502
1502
|
}
|
|
1503
1503
|
translateToGivenOrigin(t, e, s, r, n) {
|
|
1504
1504
|
let o = t.x, a = t.y;
|
|
@@ -1647,7 +1647,7 @@ class ou extends nu {
|
|
|
1647
1647
|
return ((t = this.canvas) === null || t === void 0 ? void 0 : t.viewportTransform) || ut.concat();
|
|
1648
1648
|
}
|
|
1649
1649
|
calcACoords() {
|
|
1650
|
-
const t =
|
|
1650
|
+
const t = js({ angle: this.angle }), { x: e, y: s } = this.getRelativeCenterPoint(), r = Is(e, s), n = K(r, t), o = this._getTransformedDimensions(), a = o.x / 2, c = o.y / 2;
|
|
1651
1651
|
return { tl: at({ x: -a, y: -c }, n), tr: at({ x: a, y: -c }, n), bl: at({ x: -a, y: c }, n), br: at({ x: a, y: c }, n) };
|
|
1652
1652
|
}
|
|
1653
1653
|
setCoords() {
|
|
@@ -1781,7 +1781,7 @@ class oe {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
1783
|
y(oe, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), y(oe, "type", "shadow"), C.setClass(oe, "shadow");
|
|
1784
|
-
const hu = [gt, F, dt, St, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible",
|
|
1784
|
+
const hu = [gt, F, dt, St, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Ms, Ds], le = [rt, mt, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], lu = { 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: F, originY: gt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: rt, 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 }, uu = ["type"], du = ["extraParam"];
|
|
1785
1785
|
let je = class cn extends fc {
|
|
1786
1786
|
static getDefaults() {
|
|
1787
1787
|
return cn.ownDefaults;
|
|
@@ -1802,7 +1802,7 @@ let je = class cn extends fc {
|
|
|
1802
1802
|
_limitCacheSize(t) {
|
|
1803
1803
|
const e = t.width, s = t.height, r = A.maxCacheSideLimit, n = A.minCacheSideLimit;
|
|
1804
1804
|
if (e <= r && s <= r && e * s <= A.perfLimitSizeTotal) return e < n && (t.width = n), s < n && (t.height = n), t;
|
|
1805
|
-
const o = e / s, [a, c] =
|
|
1805
|
+
const o = e / s, [a, c] = Hs.limitDimsByArea(o), h = Xe(n, a, r), l = Xe(n, c, r);
|
|
1806
1806
|
return e > h && (t.zoomX /= e / h, t.width = h, t.capped = !0), s > l && (t.zoomY /= s / l, t.height = l, t.capped = !0), t;
|
|
1807
1807
|
}
|
|
1808
1808
|
_getCacheCanvasDimensions() {
|
|
@@ -1995,7 +1995,7 @@ let je = class cn extends fc {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
toCanvasElement() {
|
|
1997
1997
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1998
|
-
const e = Bn(this), s = this.group, r = this.shadow, n = Math.abs, o = t.enableRetinaScaling ? La() : 1, a = (t.multiplier || 1) * o, c = t.canvasProvider || ((S) => new
|
|
1998
|
+
const e = Bn(this), s = this.group, r = this.shadow, n = Math.abs, o = t.enableRetinaScaling ? La() : 1, a = (t.multiplier || 1) * o, c = t.canvasProvider || ((S) => new ur(S, { enableRetinaScaling: !1, renderOnAddRemove: !1, skipOffscreen: !1 }));
|
|
1999
1999
|
delete this.group, t.withoutTransform && sc(this), t.withoutShadow && (this.shadow = null), t.viewportTransform && nn(this, this.getViewportTransform()), this.setCoords();
|
|
2000
2000
|
const h = J(), l = this.getBoundingRect(), u = this.shadow, d = new _();
|
|
2001
2001
|
if (u) {
|
|
@@ -2042,11 +2042,11 @@ let je = class cn extends fc {
|
|
|
2042
2042
|
this.globalCompositeOperation && (t.globalCompositeOperation = this.globalCompositeOperation);
|
|
2043
2043
|
}
|
|
2044
2044
|
dispose() {
|
|
2045
|
-
|
|
2045
|
+
Kr.cancelByTarget(this), this.off(), this._set("canvas", void 0), this._cacheCanvas && Gt().dispose(this._cacheCanvas), this._cacheCanvas = void 0, this._cacheContext = null;
|
|
2046
2046
|
}
|
|
2047
2047
|
static _fromObject(t) {
|
|
2048
2048
|
let e = N(t, uu), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: r } = s, n = N(s, du);
|
|
2049
|
-
return
|
|
2049
|
+
return lr(e, n).then((o) => r ? (delete o[r], new this(e[r], o)) : new this(o));
|
|
2050
2050
|
}
|
|
2051
2051
|
static fromObject(t, e) {
|
|
2052
2052
|
return this._fromObject(t, e);
|
|
@@ -2063,7 +2063,7 @@ function Ve(i) {
|
|
|
2063
2063
|
return n.setPositionByOrigin(h, e.originX, e.originY), l;
|
|
2064
2064
|
};
|
|
2065
2065
|
}
|
|
2066
|
-
const hn = Oe(
|
|
2066
|
+
const hn = Oe(Ks, Ve((i, t, e, s) => {
|
|
2067
2067
|
const r = vi(t, t.originX, t.originY, e, s);
|
|
2068
2068
|
if (st(t.originX) === st(j) || st(t.originX) === st(Z) && r.x < 0 || st(t.originX) === st(F) && r.x > 0) {
|
|
2069
2069
|
const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = ic(t) ? 2 : 1, c = n.width, h = Math.ceil(Math.abs(r.x * a / n.scaleX) - o);
|
|
@@ -2119,14 +2119,14 @@ class $ {
|
|
|
2119
2119
|
return new _(this.x * t.x + this.offsetX, this.y * t.y + this.offsetY).transform(e);
|
|
2120
2120
|
}
|
|
2121
2121
|
calcCornerCoords(t, e, s, r, n, o) {
|
|
2122
|
-
const a = gi([
|
|
2122
|
+
const a = gi([Is(s, r), js({ angle: t }), pi((n ? this.touchSizeX : this.sizeX) || e, (n ? this.touchSizeY : this.sizeY) || e)]);
|
|
2123
2123
|
return { tl: new _(-0.5, -0.5).transform(a), tr: new _(0.5, -0.5).transform(a), br: new _(0.5, 0.5).transform(a), bl: new _(-0.5, 0.5).transform(a) };
|
|
2124
2124
|
}
|
|
2125
2125
|
render(t, e, s, r, n) {
|
|
2126
2126
|
((r = r || {}).cornerStyle || n.cornerStyle) === "circle" ? gc.call(this, t, e, s, r, n) : pc.call(this, t, e, s, r, n);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
const mc = (i, t, e) => e.lockRotation ?
|
|
2129
|
+
const mc = (i, t, e) => e.lockRotation ? Jr : t.cursorStyle, vc = Oe(Ra, Ve((i, t, e, s) => {
|
|
2130
2130
|
let { target: r, ex: n, ey: o, theta: a, originX: c, originY: h } = t;
|
|
2131
2131
|
const l = r.translateToOriginPoint(r.getRelativeCenterPoint(), c, h);
|
|
2132
2132
|
if (Lt(r, "lockRotation")) return !1;
|
|
@@ -2152,7 +2152,7 @@ function bc(i, t, e) {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
const fu = ["e", "se", "s", "sw", "w", "nw", "n", "ne", "e"], Ze = (i, t, e) => {
|
|
2154
2154
|
const s = yc(i, e);
|
|
2155
|
-
if (bc(e, t.x !== 0 && t.y === 0 ? "x" : t.x === 0 && t.y !== 0 ? "y" : "", s)) return
|
|
2155
|
+
if (bc(e, t.x !== 0 && t.y === 0 ? "x" : t.x === 0 && t.y !== 0 ? "y" : "", s)) return Jr;
|
|
2156
2156
|
const r = nc(e, t);
|
|
2157
2157
|
return "".concat(fu[r], "-resize");
|
|
2158
2158
|
};
|
|
@@ -2173,8 +2173,8 @@ function Nn(i, t, e, s) {
|
|
|
2173
2173
|
const g = n.scaleX, p = n.scaleY;
|
|
2174
2174
|
return o ? (o === "x" && n.set(dt, h), o === "y" && n.set(St, l)) : (!Lt(n, "lockScalingX") && n.set(dt, h), !Lt(n, "lockScalingY") && n.set(St, l)), g !== n.scaleX || p !== n.scaleY;
|
|
2175
2175
|
}
|
|
2176
|
-
const
|
|
2177
|
-
if (t.x !== 0 && Lt(e, "lockSkewingY") || t.y !== 0 && Lt(e, "lockSkewingX")) return
|
|
2176
|
+
const Bs = Oe(di, Ve((i, t, e, s) => Nn(i, t, e, s))), _c = Oe(di, Ve((i, t, e, s) => Nn(i, t, e, s, { by: "x" }))), Sc = Oe(di, Ve((i, t, e, s) => Nn(i, t, e, s, { by: "y" }))), gu = ["target", "ex", "ey", "skewingSide"], Xi = { x: { counterAxis: "y", scale: dt, skew: Ms, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: St, skew: Ds, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, pu = ["ns", "nesw", "ew", "nwse"], Tc = (i, t, e) => {
|
|
2177
|
+
if (t.x !== 0 && Lt(e, "lockSkewingY") || t.y !== 0 && Lt(e, "lockSkewingX")) return Jr;
|
|
2178
2178
|
const s = nc(e, t) % 4;
|
|
2179
2179
|
return "".concat(pu[s], "-resize");
|
|
2180
2180
|
};
|
|
@@ -2186,28 +2186,28 @@ function xc(i, t, e, s, r) {
|
|
|
2186
2186
|
let { target: M, ex: P, ey: W, skewingSide: nt } = x, R = N(x, gu);
|
|
2187
2187
|
const { skew: X } = Xi[O], tt = D.subtract(new _(P, W)).divide(new _(M.scaleX, M.scaleY))[O], Dt = M[X], Tt = R[X], Jt = Math.tan(q(Tt)), Qt = O === "y" ? M._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : M._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Me = 2 * tt * nt / Math.max(Qt, 1) + Jt, De = xe(Math.atan(Me));
|
|
2188
2188
|
M.set(X, De);
|
|
2189
|
-
const
|
|
2190
|
-
if (
|
|
2191
|
-
const { skewX: Ei, scaleX:
|
|
2192
|
-
Ie !== 1 && M.set(dt, Ie *
|
|
2189
|
+
const vr = Dt !== M[X];
|
|
2190
|
+
if (vr && O === "y") {
|
|
2191
|
+
const { skewX: Ei, scaleX: Ls } = M, ge = M._getTransformedDimensions({ skewY: Dt }), yr = M._getTransformedDimensions(), Ie = Ei !== 0 ? ge.x / yr.x : 1;
|
|
2192
|
+
Ie !== 1 && M.set(dt, Ie * Ls);
|
|
2193
2193
|
}
|
|
2194
|
-
return
|
|
2194
|
+
return vr;
|
|
2195
2195
|
}(i, S, new _(w, k))))(t, v(v({}, e), {}, { [a]: p, skewingSide: g }), s, r);
|
|
2196
2196
|
}
|
|
2197
2197
|
const wc = (i, t, e, s) => xc("x", i, t, e, s), Cc = (i, t, e, s) => xc("y", i, t, e, s);
|
|
2198
2198
|
function _i(i, t) {
|
|
2199
2199
|
return i[t.canvas.altActionKey];
|
|
2200
2200
|
}
|
|
2201
|
-
const
|
|
2201
|
+
const Ws = (i, t, e) => {
|
|
2202
2202
|
const s = _i(i, e);
|
|
2203
|
-
return t.x === 0 ? s ?
|
|
2204
|
-
}, Le = (i, t, e) => _i(i, e) ? Tc(0, t, e) : Ze(i, t, e), ln = (i, t, e, s) => _i(i, t.target) ? Cc(i, t, e, s) : _c(i, t, e, s), un = (i, t, e, s) => _i(i, t.target) ? wc(i, t, e, s) : Sc(i, t, e, s), Un = () => ({ ml: new $({ x: -0.5, y: 0, cursorStyleHandler: Le, actionHandler: ln, getActionName:
|
|
2205
|
-
class
|
|
2203
|
+
return t.x === 0 ? s ? Ms : St : t.y === 0 ? s ? Ds : dt : "";
|
|
2204
|
+
}, Le = (i, t, e) => _i(i, e) ? Tc(0, t, e) : Ze(i, t, e), ln = (i, t, e, s) => _i(i, t.target) ? Cc(i, t, e, s) : _c(i, t, e, s), un = (i, t, e, s) => _i(i, t.target) ? wc(i, t, e, s) : Sc(i, t, e, s), Un = () => ({ ml: new $({ x: -0.5, y: 0, cursorStyleHandler: Le, actionHandler: ln, getActionName: Ws }), mr: new $({ x: 0.5, y: 0, cursorStyleHandler: Le, actionHandler: ln, getActionName: Ws }), mb: new $({ x: 0, y: 0.5, cursorStyleHandler: Le, actionHandler: un, getActionName: Ws }), mt: new $({ x: 0, y: -0.5, cursorStyleHandler: Le, actionHandler: un, getActionName: Ws }), tl: new $({ x: -0.5, y: -0.5, cursorStyleHandler: Ze, actionHandler: Bs }), tr: new $({ x: 0.5, y: -0.5, cursorStyleHandler: Ze, actionHandler: Bs }), bl: new $({ x: -0.5, y: 0.5, cursorStyleHandler: Ze, actionHandler: Bs }), br: new $({ x: 0.5, y: 0.5, cursorStyleHandler: Ze, actionHandler: Bs }), mtr: new $({ x: 0, y: -0.5, actionHandler: vc, cursorStyleHandler: mc, offsetY: -40, withConnection: !0, actionName: En }) }), Oc = () => ({ mr: new $({ x: 0.5, y: 0, actionHandler: hn, cursorStyleHandler: Le, actionName: Ks }), ml: new $({ x: -0.5, y: 0, actionHandler: hn, cursorStyleHandler: Le, actionName: Ks }) }), kc = () => v(v({}, Un()), Oc());
|
|
2205
|
+
class Qs extends je {
|
|
2206
2206
|
static getDefaults() {
|
|
2207
|
-
return v(v({}, super.getDefaults()),
|
|
2207
|
+
return v(v({}, super.getDefaults()), Qs.ownDefaults);
|
|
2208
2208
|
}
|
|
2209
2209
|
constructor(t) {
|
|
2210
|
-
super(), Object.assign(this, this.constructor.createControls(),
|
|
2210
|
+
super(), Object.assign(this, this.constructor.createControls(), Qs.ownDefaults), this.setOptions(t);
|
|
2211
2211
|
}
|
|
2212
2212
|
static createControls() {
|
|
2213
2213
|
return { controls: Un() };
|
|
@@ -2235,7 +2235,7 @@ class Zs extends je {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
2237
|
calcOCoords() {
|
|
2238
|
-
const t = this.getViewportTransform(), e = this.getCenterPoint(), s =
|
|
2238
|
+
const t = this.getViewportTransform(), e = this.getCenterPoint(), s = Is(e.x, e.y), r = js({ angle: this.getTotalAngle() - (this.group && this.flipX ? 180 : 0) }), n = K(s, r), o = K(t, n), a = K(o, [1 / t[0], 0, 0, 1 / t[3], 0, 0]), c = this.group ? vs(this.calcTransformMatrix()) : void 0;
|
|
2239
2239
|
c && (c.scaleX = Math.abs(c.scaleX), c.scaleY = Math.abs(c.scaleY));
|
|
2240
2240
|
const h = this._calculateCurrentDimensions(c), l = {};
|
|
2241
2241
|
return this.forEachControl((u, d) => {
|
|
@@ -2275,7 +2275,7 @@ class Zs extends je {
|
|
|
2275
2275
|
drawBorders(t, e, s) {
|
|
2276
2276
|
let r;
|
|
2277
2277
|
if (s && s.forActiveSelection || this.group) {
|
|
2278
|
-
const n = mi(this.width, this.height,
|
|
2278
|
+
const n = mi(this.width, this.height, hr(e)), o = this.isStrokeAccountedForInDimensions() ? Pn : (this.strokeUniform ? new _().scalarAdd(this.canvas ? this.canvas.getZoom() : 1) : new _(e.scaleX, e.scaleY)).scalarMultiply(this.strokeWidth);
|
|
2279
2279
|
r = n.add(o).scalarAdd(this.borderScaleFactor).scalarAdd(2 * this.padding);
|
|
2280
2280
|
} else r = this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);
|
|
2281
2281
|
this._drawBorders(t, r, s);
|
|
@@ -2346,8 +2346,8 @@ function Mc(i, t) {
|
|
|
2346
2346
|
});
|
|
2347
2347
|
}), i;
|
|
2348
2348
|
}
|
|
2349
|
-
y(
|
|
2350
|
-
class ot extends
|
|
2349
|
+
y(Qs, "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 });
|
|
2350
|
+
class ot extends Qs {
|
|
2351
2351
|
}
|
|
2352
2352
|
Mc(ot, [ac]), C.setClass(ot), C.setClass(ot, "object");
|
|
2353
2353
|
const Dc = (i, t, e, s) => {
|
|
@@ -2361,7 +2361,7 @@ class Ic {
|
|
|
2361
2361
|
this.options = t, this.strokeProjectionMagnitude = this.options.strokeWidth / 2, this.scale = new _(this.options.scaleX, this.options.scaleY), this.strokeUniformScalar = this.options.strokeUniform ? new _(1 / this.options.scaleX, 1 / this.options.scaleY) : new _(1, 1);
|
|
2362
2362
|
}
|
|
2363
2363
|
createSideVector(t, e) {
|
|
2364
|
-
const s =
|
|
2364
|
+
const s = Qr(t, e);
|
|
2365
2365
|
return this.options.strokeUniform ? s.multiply(this.scale) : s;
|
|
2366
2366
|
}
|
|
2367
2367
|
projectOrthogonally(t, e, s) {
|
|
@@ -2381,11 +2381,11 @@ class Ic {
|
|
|
2381
2381
|
const mu = new _();
|
|
2382
2382
|
class ps extends Ic {
|
|
2383
2383
|
static getOrthogonalRotationFactor(t, e) {
|
|
2384
|
-
const s = e ?
|
|
2384
|
+
const s = e ? ei(t, e) : uc(t);
|
|
2385
2385
|
return Math.abs(s) < Se ? -1 : 1;
|
|
2386
2386
|
}
|
|
2387
2387
|
constructor(t, e, s, r) {
|
|
2388
|
-
super(r), y(this, "AB", void 0), y(this, "AC", void 0), y(this, "alpha", void 0), y(this, "bisector", void 0), this.A = new _(t), this.B = new _(e), this.C = new _(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha =
|
|
2388
|
+
super(r), y(this, "AB", void 0), y(this, "AC", void 0), y(this, "alpha", void 0), y(this, "bisector", void 0), this.A = new _(t), this.B = new _(e), this.C = new _(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = ei(this.AB, this.AC), this.bisector = yi(Yn(this.AB.eq(mu) ? this.AC : this.AB, this.alpha / 2));
|
|
2389
2389
|
}
|
|
2390
2390
|
calcOrthogonalProjection(t, e) {
|
|
2391
2391
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.strokeProjectionMagnitude;
|
|
@@ -2399,8 +2399,8 @@ class ps extends Ic {
|
|
|
2399
2399
|
}), t;
|
|
2400
2400
|
}
|
|
2401
2401
|
projectMiter() {
|
|
2402
|
-
const t = [], e = Math.abs(this.alpha), s = 1 / Math.sin(e / 2), r = this.scaleUnitVector(this.bisector, -this.strokeProjectionMagnitude * s), n = this.options.strokeUniform ?
|
|
2403
|
-
return
|
|
2402
|
+
const t = [], e = Math.abs(this.alpha), s = 1 / Math.sin(e / 2), r = this.scaleUnitVector(this.bisector, -this.strokeProjectionMagnitude * s), n = this.options.strokeUniform ? ti(this.scaleUnitVector(this.bisector, this.options.strokeMiterLimit)) : this.options.strokeMiterLimit;
|
|
2403
|
+
return ti(r) / this.strokeProjectionMagnitude <= n && t.push(this.applySkew(this.A.add(r))), t.push(...this.projectBevel()), t;
|
|
2404
2404
|
}
|
|
2405
2405
|
projectRoundNoSkew(t, e) {
|
|
2406
2406
|
const s = [], r = new _(ps.getOrthogonalRotationFactor(this.bisector), ps.getOrthogonalRotationFactor(new _(this.bisector.y, this.bisector.x)));
|
|
@@ -2588,18 +2588,18 @@ function dn(i) {
|
|
|
2588
2588
|
const n = s.filter((g) => !!g), [, o, ...a] = n, [c, h, l, u, d, f] = a.map((g) => parseFloat(g));
|
|
2589
2589
|
switch (o) {
|
|
2590
2590
|
case "translate":
|
|
2591
|
-
r =
|
|
2591
|
+
r = Is(c, h);
|
|
2592
2592
|
break;
|
|
2593
2593
|
case En:
|
|
2594
|
-
r =
|
|
2594
|
+
r = js({ angle: c }, { x: h, y: l });
|
|
2595
2595
|
break;
|
|
2596
2596
|
case fi:
|
|
2597
2597
|
r = pi(c, h);
|
|
2598
2598
|
break;
|
|
2599
|
-
case
|
|
2599
|
+
case Ms:
|
|
2600
2600
|
r = Ln(c);
|
|
2601
2601
|
break;
|
|
2602
|
-
case
|
|
2602
|
+
case Ds:
|
|
2603
2603
|
r = Fn(c);
|
|
2604
2604
|
break;
|
|
2605
2605
|
case "matrix":
|
|
@@ -2720,8 +2720,8 @@ class z extends ot {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
}
|
|
2722
2722
|
y(z, "type", "Rect"), y(z, "cacheProperties", [...le, ...Fc]), y(z, "ownDefaults", { rx: 0, ry: 0 }), y(z, "ATTRIBUTE_NAMES", [...ke, "x", "y", "rx", "ry", "width", "height"]), C.setClass(z), C.setSVGClass(z);
|
|
2723
|
-
const re = "initialization",
|
|
2724
|
-
const { strokeUniform: e, strokeWidth: s, width: r, height: n, group: o } = t, a = o && o !== i ?
|
|
2723
|
+
const re = "initialization", si = "added", Kn = "removed", ri = "imperative", Rc = (i, t) => {
|
|
2724
|
+
const { strokeUniform: e, strokeWidth: s, width: r, height: n, group: o } = t, a = o && o !== i ? dr(o.calcTransformMatrix(), i.calcTransformMatrix()) : null, c = a ? t.getRelativeCenterPoint().transform(a) : t.getRelativeCenterPoint(), h = !t.isStrokeAccountedForInDimensions(), l = e && h ? rc(new _(s, s), void 0, i.calcTransformMatrix()) : Pn, u = !e && h ? s : 0, d = mi(r + u, n + u, gi([a, t.calcOwnMatrix()], !0)).add(l).scalarDivide(2);
|
|
2725
2725
|
return [c.subtract(d), c.add(d)];
|
|
2726
2726
|
};
|
|
2727
2727
|
class xi {
|
|
@@ -2730,7 +2730,7 @@ class xi {
|
|
|
2730
2730
|
}
|
|
2731
2731
|
shouldPerformLayout(t) {
|
|
2732
2732
|
let { type: e, prevStrategy: s, strategy: r } = t;
|
|
2733
|
-
return e === re || e ===
|
|
2733
|
+
return e === re || e === ri || !!s && r !== s;
|
|
2734
2734
|
}
|
|
2735
2735
|
shouldLayoutClipPath(t) {
|
|
2736
2736
|
let { type: e, target: { clipPath: s } } = t;
|
|
@@ -2741,7 +2741,7 @@ class xi {
|
|
|
2741
2741
|
}
|
|
2742
2742
|
calcBoundingBox(t, e) {
|
|
2743
2743
|
const { type: s, target: r } = e;
|
|
2744
|
-
if (s ===
|
|
2744
|
+
if (s === ri && e.overrides) return e.overrides;
|
|
2745
2745
|
if (t.length === 0) return;
|
|
2746
2746
|
const { left: n, top: o, width: a, height: c } = Ht(t.map((u) => Rc(r, u)).reduce((u, d) => u.concat(d), [])), h = new _(a, c), l = new _(n, o).add(h.scalarDivide(2));
|
|
2747
2747
|
if (s === re) {
|
|
@@ -2759,7 +2759,7 @@ class fn extends xi {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
y(fn, "type", "fit-content"), C.setClass(fn);
|
|
2761
2761
|
const Wu = ["strategy"], Xu = ["target", "strategy", "bubbles", "prevStrategy"], Bc = "layoutManager";
|
|
2762
|
-
class
|
|
2762
|
+
class tr {
|
|
2763
2763
|
constructor() {
|
|
2764
2764
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new fn();
|
|
2765
2765
|
y(this, "strategy", void 0), this.strategy = t, this._subscriptions = /* @__PURE__ */ new Map();
|
|
@@ -2774,7 +2774,7 @@ class Js {
|
|
|
2774
2774
|
}
|
|
2775
2775
|
attachHandlers(t, e) {
|
|
2776
2776
|
const { target: s } = e;
|
|
2777
|
-
return [
|
|
2777
|
+
return [qr, Fa, Ks, Ra, di, Ba, $r, Wa, Hl].map((r) => t.on(r, (n) => this.performLayout(r === qr ? { type: "object_modified", trigger: r, e: n, target: s } : { type: "object_modifying", trigger: r, e: n, target: s })));
|
|
2778
2778
|
}
|
|
2779
2779
|
subscribe(t, e) {
|
|
2780
2780
|
this.unsubscribe(t, e);
|
|
@@ -2792,7 +2792,7 @@ class Js {
|
|
|
2792
2792
|
}
|
|
2793
2793
|
onBeforeLayout(t) {
|
|
2794
2794
|
const { target: e, type: s } = t, { canvas: r } = e;
|
|
2795
|
-
if (s === re || s ===
|
|
2795
|
+
if (s === re || s === si ? this.subscribeTargets(t) : s === Kn && this.unsubscribeTargets(t), e.fire("layout:before", { context: t }), r && r.fire("object:layout:before", { target: e, context: t }), s === ri && t.deep) {
|
|
2796
2796
|
const n = N(t, Wu);
|
|
2797
2797
|
e.forEachObject((o) => o.layoutManager && o.layoutManager.performLayout(v(v({}, n), {}, { bubbles: !1, target: o })));
|
|
2798
2798
|
}
|
|
@@ -2835,9 +2835,9 @@ class Js {
|
|
|
2835
2835
|
return this.toObject();
|
|
2836
2836
|
}
|
|
2837
2837
|
}
|
|
2838
|
-
C.setClass(
|
|
2838
|
+
C.setClass(tr, Bc);
|
|
2839
2839
|
const zu = ["type", "objects", "layoutManager"];
|
|
2840
|
-
class Hu extends
|
|
2840
|
+
class Hu extends tr {
|
|
2841
2841
|
performLayout() {
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
@@ -2853,7 +2853,7 @@ class Yt extends Xa(ot) {
|
|
|
2853
2853
|
var s;
|
|
2854
2854
|
this._objects = [...t], this.__objectSelectionTracker = this.__objectSelectionMonitor.bind(this, !0), this.__objectSelectionDisposer = this.__objectSelectionMonitor.bind(this, !1), this.forEachObject((r) => {
|
|
2855
2855
|
this.enterGroup(r, !1);
|
|
2856
|
-
}), this.layoutManager = (s = e.layoutManager) !== null && s !== void 0 ? s : new
|
|
2856
|
+
}), this.layoutManager = (s = e.layoutManager) !== null && s !== void 0 ? s : new tr(), this.layoutManager.performLayout({ type: re, target: this, targets: [...t], x: e.left, y: e.top });
|
|
2857
2857
|
}
|
|
2858
2858
|
canEnterGroup(t) {
|
|
2859
2859
|
return t === this || this.isDescendantOf(t) ? (_e("error", "Group: circular object trees are not supported, this call has no effect"), !1) : this._objects.indexOf(t) === -1 || (_e("error", "Group: duplicate objects are not supported inside group, this call has no effect"), !1);
|
|
@@ -2864,12 +2864,12 @@ class Yt extends Xa(ot) {
|
|
|
2864
2864
|
add() {
|
|
2865
2865
|
for (var t = arguments.length, e = new Array(t), s = 0; s < t; s++) e[s] = arguments[s];
|
|
2866
2866
|
const r = this._filterObjectsBeforeEnteringGroup(e), n = super.add(...r);
|
|
2867
|
-
return this._onAfterObjectsChange(
|
|
2867
|
+
return this._onAfterObjectsChange(si, r), n;
|
|
2868
2868
|
}
|
|
2869
2869
|
insertAt(t) {
|
|
2870
2870
|
for (var e = arguments.length, s = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++) s[r - 1] = arguments[r];
|
|
2871
2871
|
const n = this._filterObjectsBeforeEnteringGroup(s), o = super.insertAt(t, ...n);
|
|
2872
|
-
return this._onAfterObjectsChange(
|
|
2872
|
+
return this._onAfterObjectsChange(si, n), o;
|
|
2873
2873
|
}
|
|
2874
2874
|
remove() {
|
|
2875
2875
|
const t = super.remove(...arguments);
|
|
@@ -2955,7 +2955,7 @@ class Yt extends Xa(ot) {
|
|
|
2955
2955
|
}
|
|
2956
2956
|
triggerLayout() {
|
|
2957
2957
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2958
|
-
this.layoutManager.performLayout(v({ target: this, type:
|
|
2958
|
+
this.layoutManager.performLayout(v({ target: this, type: ri }, t));
|
|
2959
2959
|
}
|
|
2960
2960
|
render(t) {
|
|
2961
2961
|
this._transformDone = !0, super.render(t), this._transformDone = !1;
|
|
@@ -3011,13 +3011,13 @@ class Yt extends Xa(ot) {
|
|
|
3011
3011
|
}
|
|
3012
3012
|
static fromObject(t, e) {
|
|
3013
3013
|
let { type: s, objects: r = [], layoutManager: n } = t, o = N(t, zu);
|
|
3014
|
-
return Promise.all([ys(r, e),
|
|
3014
|
+
return Promise.all([ys(r, e), lr(o, e)]).then((a) => {
|
|
3015
3015
|
let [c, h] = a;
|
|
3016
3016
|
const l = new this(c, v(v(v({}, o), h), {}, { layoutManager: new Hu() }));
|
|
3017
3017
|
if (n) {
|
|
3018
3018
|
const u = C.getClass(n.type), d = C.getClass(n.strategy);
|
|
3019
3019
|
l.layoutManager = new u(new d());
|
|
3020
|
-
} else l.layoutManager = new
|
|
3020
|
+
} else l.layoutManager = new tr();
|
|
3021
3021
|
return l.layoutManager.subscribeTargets({ type: re, target: l, targets: l.getObjects() }), l.setCoords(), l;
|
|
3022
3022
|
});
|
|
3023
3023
|
}
|
|
@@ -3034,7 +3034,7 @@ const H = "(".concat(_s, ")"), Yu = "(M) (?:".concat(H, " ").concat(H, " ?)+"),
|
|
|
3034
3034
|
};
|
|
3035
3035
|
function gn(i, t, e, s, r, n, o, a) {
|
|
3036
3036
|
let c;
|
|
3037
|
-
if (A.cachesBoundsOfCurve && (c = [...arguments].join(),
|
|
3037
|
+
if (A.cachesBoundsOfCurve && (c = [...arguments].join(), Hs.boundsOfCurveCache[c])) return Hs.boundsOfCurveCache[c];
|
|
3038
3038
|
const h = Math.sqrt, l = Math.abs, u = [], d = [[0, 0], [0, 0]];
|
|
3039
3039
|
let f = 6 * i - 12 * e + 6 * r, g = -3 * i + 9 * e - 9 * r + 3 * o, p = 3 * e - 3 * i;
|
|
3040
3040
|
for (let k = 0; k < 2; ++k) {
|
|
@@ -3059,7 +3059,7 @@ function gn(i, t, e, s, r, n, o, a) {
|
|
|
3059
3059
|
}
|
|
3060
3060
|
d[0][b] = i, d[1][b] = t, d[0][b + 1] = o, d[1][b + 1] = a;
|
|
3061
3061
|
const w = [new _(Math.min(...d[0]), Math.min(...d[1])), new _(Math.max(...d[0]), Math.max(...d[1]))];
|
|
3062
|
-
return A.cachesBoundsOfCurve && (
|
|
3062
|
+
return A.cachesBoundsOfCurve && (Hs.boundsOfCurveCache[c] = w), w;
|
|
3063
3063
|
}
|
|
3064
3064
|
const ed = (i, t, e) => {
|
|
3065
3065
|
let [s, r, n, o, a, c, h, l] = e;
|
|
@@ -3072,12 +3072,12 @@ const ed = (i, t, e) => {
|
|
|
3072
3072
|
const pe = Math.sqrt(1 - Tt / (R * X));
|
|
3073
3073
|
Jt *= pe, Qt *= pe;
|
|
3074
3074
|
} else O = (m === b ? -1 : 1) * Math.sqrt(Tt / (R * tt + X * Dt));
|
|
3075
|
-
const Me = O * Jt * nt / Qt, De = -O * Qt * W / Jt,
|
|
3076
|
-
let
|
|
3075
|
+
const Me = O * Jt * nt / Qt, De = -O * Qt * W / Jt, vr = P * Me - M * De + 0.5 * d, Ei = M * Me + P * De + 0.5 * f;
|
|
3076
|
+
let Ls = Wo(1, 0, (W - Me) / Jt, (nt - De) / Qt), ge = Wo((W - Me) / Jt, (nt - De) / Qt, (-W - Me) / Jt, (-nt - De) / Qt);
|
|
3077
3077
|
b === 0 && ge > 0 ? ge -= 2 * x : b === 1 && ge < 0 && (ge += 2 * x);
|
|
3078
|
-
const
|
|
3079
|
-
let Pi =
|
|
3080
|
-
for (let pe = 0; pe <
|
|
3078
|
+
const yr = Math.ceil(Math.abs(ge / x * 2)), Ie = [], Fs = ge / yr, Fl = 8 / 3 * Math.sin(Fs / 4) * Math.sin(Fs / 4) / Math.sin(Fs / 2);
|
|
3079
|
+
let Pi = Ls + Fs;
|
|
3080
|
+
for (let pe = 0; pe < yr; pe++) Ie[pe] = td(Ls, Pi, P, M, Jt, Qt, vr, Ei, Fl, w, k), w = Ie[pe][5], k = Ie[pe][6], Ls = Pi, Pi += Fs;
|
|
3081
3081
|
return Ie;
|
|
3082
3082
|
})(h - i, l - t, r, n, a, c, o);
|
|
3083
3083
|
for (let d = 0, f = u.length; d < f; d++) u[d][1] += i, u[d][2] += t, u[d][3] += i, u[d][4] += t, u[d][5] += i, u[d][6] += t;
|
|
@@ -3142,7 +3142,7 @@ const ed = (i, t, e) => {
|
|
|
3142
3142
|
u ? (n.push(u), o = u[0]) : o = "";
|
|
3143
3143
|
}
|
|
3144
3144
|
return n;
|
|
3145
|
-
},
|
|
3145
|
+
}, ii = (i, t, e, s) => Math.sqrt((e - i) ** 2 + (s - t) ** 2), Yc = (i, t, e, s, r, n, o, a) => (c) => {
|
|
3146
3146
|
const h = c ** 3, l = ((f) => 3 * f ** 2 * (1 - f))(c), u = ((f) => 3 * f * (1 - f) ** 2)(c), d = ((f) => (1 - f) ** 3)(c);
|
|
3147
3147
|
return new _(o * h + r * l + e * u + i * d, a * h + n * l + s * u + t * d);
|
|
3148
3148
|
}, Vc = (i) => i ** 2, Gc = (i) => 2 * i * (1 - i), Nc = (i) => (1 - i) ** 2, sd = (i, t, e, s, r, n, o, a) => (c) => {
|
|
@@ -3158,13 +3158,13 @@ const ed = (i, t, e) => {
|
|
|
3158
3158
|
let s = new _(t, e), r = 0;
|
|
3159
3159
|
for (let n = 1; n <= 100; n += 1) {
|
|
3160
3160
|
const o = i(n / 100);
|
|
3161
|
-
r +=
|
|
3161
|
+
r += ii(s.x, s.y, o.x, o.y), s = o;
|
|
3162
3162
|
}
|
|
3163
3163
|
return r;
|
|
3164
3164
|
}, nd = (i, t) => {
|
|
3165
3165
|
let e, s = 0, r = 0, n = { x: i.x, y: i.y }, o = v({}, n), a = 0.01, c = 0;
|
|
3166
3166
|
const h = i.iterator, l = i.angleFinder;
|
|
3167
|
-
for (; r < t && a > 1e-4; ) o = h(s), c = s, e =
|
|
3167
|
+
for (; r < t && a > 1e-4; ) o = h(s), c = s, e = ii(n.x, n.y, o.x, o.y), e + r > t ? (s -= a, a /= 2) : (n = o, s += a, r += e);
|
|
3168
3168
|
return v(v({}, o), {}, { angle: l(c) });
|
|
3169
3169
|
}, Zn = (i) => {
|
|
3170
3170
|
let t, e, s = 0, r = 0, n = 0, o = 0, a = 0;
|
|
@@ -3176,7 +3176,7 @@ const ed = (i, t, e) => {
|
|
|
3176
3176
|
e = l, e.x = o = r = h[1], e.y = a = n = h[2];
|
|
3177
3177
|
break;
|
|
3178
3178
|
case "L":
|
|
3179
|
-
e = l, e.length =
|
|
3179
|
+
e = l, e.length = ii(r, n, h[1], h[2]), r = h[1], n = h[2];
|
|
3180
3180
|
break;
|
|
3181
3181
|
case "C":
|
|
3182
3182
|
t = Yc(r, n, h[1], h[2], h[3], h[4], h[5], h[6]), e = l, e.iterator = t, e.angleFinder = sd(r, n, h[1], h[2], h[3], h[4], h[5], h[6]), e.length = Xo(t, r, n), r = h[5], n = h[6];
|
|
@@ -3185,7 +3185,7 @@ const ed = (i, t, e) => {
|
|
|
3185
3185
|
t = rd(r, n, h[1], h[2], h[3], h[4]), e = l, e.iterator = t, e.angleFinder = id(r, n, h[1], h[2], h[3], h[4]), e.length = Xo(t, r, n), r = h[3], n = h[4];
|
|
3186
3186
|
break;
|
|
3187
3187
|
case "Z":
|
|
3188
|
-
e = l, e.destX = o, e.destY = a, e.length =
|
|
3188
|
+
e = l, e.destX = o, e.destY = a, e.length = ii(r, n, o, a), r = o, n = a;
|
|
3189
3189
|
}
|
|
3190
3190
|
s += e.length, c.push(e);
|
|
3191
3191
|
}
|
|
@@ -3262,11 +3262,11 @@ const ud = (i, t) => {
|
|
|
3262
3262
|
}
|
|
3263
3263
|
})(i), e = e.transform(i.transformMatrix)), delete i.transformMatrix, t && (i.scaleX *= t.scaleX, i.scaleY *= t.scaleY, i.cropX = t.cropX, i.cropY = t.cropY, e.x += t.offsetLeft, e.y += t.offsetTop, i.width = t.width, i.height = t.height), i.setPositionByOrigin(e, j, j);
|
|
3264
3264
|
};
|
|
3265
|
-
var dd = Object.freeze({ __proto__: null, addTransformToObject: ec, animate: Hn, animateColor: hc, applyTransformToObject: bs, calcAngleBetweenVectors:
|
|
3265
|
+
var dd = Object.freeze({ __proto__: null, addTransformToObject: ec, animate: Hn, animateColor: hc, applyTransformToObject: bs, calcAngleBetweenVectors: ei, calcDimensionsMatrix: hr, calcPlaneChangeMatrix: dr, calcVectorRotation: uc, cancelAnimFrame: Ha, capValue: Xe, composeMatrix: Ua, copyCanvasElement: (i) => {
|
|
3266
3266
|
var t;
|
|
3267
3267
|
const e = J();
|
|
3268
3268
|
return e.width = i.width, e.height = i.height, (t = e.getContext("2d")) === null || t === void 0 || t.drawImage(i, 0, 0), e;
|
|
3269
|
-
}, cos: Ft, createCanvasElement: J, createImage: Ya, createRotateMatrix:
|
|
3269
|
+
}, cos: Ft, createCanvasElement: J, createImage: Ya, createRotateMatrix: js, createScaleMatrix: pi, createSkewXMatrix: Ln, createSkewYMatrix: Fn, createTranslateMatrix: Is, createVector: Qr, crossProduct: gs, degreesToRadians: q, dotProduct: dc, ease: ql, enlivenObjectEnlivables: lr, enlivenObjects: ys, findScaleToCover: Xc, findScaleToFit: Wc, getBoundsOfCurve: gn, getOrthonormalVector: Vn, getPathSegmentsInfo: Zn, getPointOnPath: Uc, getPointer: tc, getRandomInt: hd, getRegularPolygonPath: (i, t) => {
|
|
3270
3270
|
const e = 2 * Math.PI / i;
|
|
3271
3271
|
let s = -Se;
|
|
3272
3272
|
i % 2 == 0 && (s += e / 2);
|
|
@@ -3287,7 +3287,7 @@ var dd = Object.freeze({ __proto__: null, addTransformToObject: ec, animate: Hn,
|
|
|
3287
3287
|
return t.concat(["offset", "stop-color", "stop-opacity"]);
|
|
3288
3288
|
}
|
|
3289
3289
|
return t;
|
|
3290
|
-
}, getUnitVector: yi, groupSVGElements: (i, t) => i && i.length === 1 ? i[0] : new Yt(i, t), hasStyleChanged: Ti, invertTransform: _t, isBetweenVectors: an, isIdentityMatrix: Va, isTouchEvent:
|
|
3290
|
+
}, getUnitVector: yi, groupSVGElements: (i, t) => i && i.length === 1 ? i[0] : new Yt(i, t), hasStyleChanged: Ti, invertTransform: _t, isBetweenVectors: an, isIdentityMatrix: Va, isTouchEvent: Zr, isTransparent: Dc, joinPath: qc, loadImage: Vs, magnitude: ti, makeBoundingBoxFromPoints: Ht, makePathSimpler: Hc, matrixToSVG: Zs, mergeClipPaths: (i, t) => {
|
|
3291
3291
|
var e;
|
|
3292
3292
|
let s = i, r = t;
|
|
3293
3293
|
s.inverted && !r.inverted && (s = t, r = i), nn(r, (e = r.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
|
|
@@ -3296,7 +3296,7 @@ var dd = Object.freeze({ __proto__: null, addTransformToObject: ec, animate: Hn,
|
|
|
3296
3296
|
}, multiplyTransformMatrices: K, multiplyTransformMatrixArray: gi, parsePath: $c, parsePreserveAspectRatioAttribute: $a, parseUnit: We, pick: Ye, projectStrokeOnPoints: jc, qrDecompose: vs, radiansToDegrees: xe, removeFromArray: Ee, removeTransformFromObject: (i, t) => {
|
|
3297
3297
|
const e = _t(t), s = K(e, i.calcOwnMatrix());
|
|
3298
3298
|
bs(i, s);
|
|
3299
|
-
}, removeTransformMatrixForSvgParsing: ud, request: ld, requestAnimFrame:
|
|
3299
|
+
}, removeTransformMatrixForSvgParsing: ud, request: ld, requestAnimFrame: Ys, resetObjectTransform: sc, rotatePoint: (i, t, e) => i.rotate(e, t), rotateVector: Yn, saveObjectTransform: Bn, sendObjectToPlane: nn, sendPointToPlane: ne, sendVectorToPlane: rc, setStyle: Gs, sin: Rt, sizeAfterTransform: mi, string: yu, stylesFromArray: Ac, stylesToArray: Pc, toDataURL: An, toFixed: E, transformPath: (i, t, e) => (e && (t = K(t, [1, 0, 0, 1, -e.x, -e.y])), i.map((s) => {
|
|
3300
3300
|
const r = [...s];
|
|
3301
3301
|
for (let n = 1; n < s.length - 1; n += 2) {
|
|
3302
3302
|
const { x: o, y: a } = at({ x: s[n], y: s[n + 1] }, t);
|
|
@@ -3318,14 +3318,14 @@ class fd extends Qa {
|
|
|
3318
3318
|
return e.className = t.className, e.classList.remove("lower-canvas"), e.classList.add("upper-canvas"), e.setAttribute("data-fabric", "top"), e.style.cssText = t.style.cssText, e.setAttribute("draggable", "true"), e;
|
|
3319
3319
|
}
|
|
3320
3320
|
createContainerElement() {
|
|
3321
|
-
const t =
|
|
3322
|
-
return t.setAttribute("data-fabric", "wrapper"),
|
|
3321
|
+
const t = ks().createElement("div");
|
|
3322
|
+
return t.setAttribute("data-fabric", "wrapper"), Gs(t, { position: "relative" }), _o(t), t;
|
|
3323
3323
|
}
|
|
3324
3324
|
applyCanvasStyle(t, e) {
|
|
3325
3325
|
let { allowTouchScrolling: s } = e;
|
|
3326
|
-
|
|
3326
|
+
Gs(t, { position: "absolute", left: "0", top: "0" }), function(r, n) {
|
|
3327
3327
|
const o = n ? "manipulation" : pt;
|
|
3328
|
-
|
|
3328
|
+
Gs(r, { "touch-action": o, "-ms-touch-action": o });
|
|
3329
3329
|
}(t, s), _o(t);
|
|
3330
3330
|
}
|
|
3331
3331
|
setDimensions(t, e) {
|
|
@@ -3344,7 +3344,7 @@ class fd extends Qa {
|
|
|
3344
3344
|
super.dispose(), Gt().dispose(this.upper.el), delete this.upper, delete this.container;
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|
|
3347
|
-
class wi extends
|
|
3347
|
+
class wi extends ur {
|
|
3348
3348
|
constructor() {
|
|
3349
3349
|
super(...arguments), y(this, "targets", []), y(this, "_hoveredTargets", []), y(this, "_objectsToRender", void 0), y(this, "_currentTransform", null), y(this, "_groupSelector", null), y(this, "contextTopDirty", !1);
|
|
3350
3350
|
}
|
|
@@ -3412,7 +3412,7 @@ class wi extends hr {
|
|
|
3412
3412
|
_shouldCenterTransform(t, e, s) {
|
|
3413
3413
|
if (!t) return;
|
|
3414
3414
|
let r;
|
|
3415
|
-
return e === fi || e === dt || e === St || e ===
|
|
3415
|
+
return e === fi || e === dt || e === St || e === Ks ? r = this.centeredScaling || t.centeredScaling : e === En && (r = this.centeredRotation || t.centeredRotation), r ? !s : s;
|
|
3416
3416
|
}
|
|
3417
3417
|
_getOriginFromCorner(t, e) {
|
|
3418
3418
|
const s = { x: t.originX, y: t.originY };
|
|
@@ -3439,7 +3439,7 @@ class wi extends hr {
|
|
|
3439
3439
|
if (this.skipTargetFind) return;
|
|
3440
3440
|
const e = this.getViewportPoint(t), s = this._activeObject, r = this.getActiveObjects();
|
|
3441
3441
|
if (this.targets = [], s && r.length >= 1) {
|
|
3442
|
-
if (s.findControl(e,
|
|
3442
|
+
if (s.findControl(e, Zr(t)) || r.length > 1 && this.searchPossibleTargets([s], e)) return s;
|
|
3443
3443
|
if (s === this.searchPossibleTargets([s], e)) {
|
|
3444
3444
|
if (this.preserveObjectStacking) {
|
|
3445
3445
|
const n = this.targets;
|
|
@@ -3469,7 +3469,7 @@ class wi extends hr {
|
|
|
3469
3469
|
for (; s--; ) {
|
|
3470
3470
|
const r = t[s];
|
|
3471
3471
|
if (this._checkTarget(r, e)) {
|
|
3472
|
-
if (
|
|
3472
|
+
if (Nr(r) && r.subTargetCheck) {
|
|
3473
3473
|
const n = this._searchPossibleTargets(r._objects, e);
|
|
3474
3474
|
n && this.targets.push(n);
|
|
3475
3475
|
}
|
|
@@ -3479,11 +3479,11 @@ class wi extends hr {
|
|
|
3479
3479
|
}
|
|
3480
3480
|
searchPossibleTargets(t, e) {
|
|
3481
3481
|
const s = this._searchPossibleTargets(t, e);
|
|
3482
|
-
if (s &&
|
|
3482
|
+
if (s && Nr(s) && s.interactive && this.targets[0]) {
|
|
3483
3483
|
const r = this.targets;
|
|
3484
3484
|
for (let n = r.length - 1; n > 0; n--) {
|
|
3485
3485
|
const o = r[n];
|
|
3486
|
-
if (!
|
|
3486
|
+
if (!Nr(o) || !o.interactive) return o;
|
|
3487
3487
|
}
|
|
3488
3488
|
return r[0];
|
|
3489
3489
|
}
|
|
@@ -3560,7 +3560,7 @@ class wi extends hr {
|
|
|
3560
3560
|
}
|
|
3561
3561
|
_finalizeCurrentTransform(t) {
|
|
3562
3562
|
const e = this._currentTransform, s = e.target, r = { e: t, target: s, transform: e, action: e.action };
|
|
3563
|
-
s._scaling && (s._scaling = !1), s.setCoords(), e.actionPerformed && (this.fire("object:modified", r), s.fire(
|
|
3563
|
+
s._scaling && (s._scaling = !1), s.setCoords(), e.actionPerformed && (this.fire("object:modified", r), s.fire(qr, r));
|
|
3564
3564
|
}
|
|
3565
3565
|
setViewportTransform(t) {
|
|
3566
3566
|
super.setViewportTransform(t);
|
|
@@ -3585,7 +3585,7 @@ class wi extends hr {
|
|
|
3585
3585
|
_realizeGroupTransformOnObject(t) {
|
|
3586
3586
|
const { group: e } = t;
|
|
3587
3587
|
if (e && Pe(e) && this._activeObject === e) {
|
|
3588
|
-
const s = Ye(t, ["angle", "flipX", "flipY", F, dt, St,
|
|
3588
|
+
const s = Ye(t, ["angle", "flipX", "flipY", F, dt, St, Ms, Ds, gt]);
|
|
3589
3589
|
return ec(t, e.calcOwnMatrix()), s;
|
|
3590
3590
|
}
|
|
3591
3591
|
return {};
|
|
@@ -3789,7 +3789,7 @@ class pn extends wi {
|
|
|
3789
3789
|
this.handleSelection(t), h || (h = this._shouldRender(n) || !l && n === this._activeObject);
|
|
3790
3790
|
}
|
|
3791
3791
|
if (n) {
|
|
3792
|
-
const l = n.findControl(this.getViewportPoint(t),
|
|
3792
|
+
const l = n.findControl(this.getViewportPoint(t), Zr(t)), { key: u, control: d } = l || {};
|
|
3793
3793
|
if (c = u, n.selectable && n !== this._activeObject && n.activeOn === "up") this.setActiveObject(n, t), h = !0;
|
|
3794
3794
|
else if (d) {
|
|
3795
3795
|
const f = d.getMouseUpHandler(t, n, d);
|
|
@@ -3845,7 +3845,7 @@ class pn extends wi {
|
|
|
3845
3845
|
if (e) {
|
|
3846
3846
|
const o = e === this._activeObject;
|
|
3847
3847
|
e.selectable && e.activeOn === "down" && this.setActiveObject(e, t);
|
|
3848
|
-
const a = e.findControl(this.getViewportPoint(t),
|
|
3848
|
+
const a = e.findControl(this.getViewportPoint(t), Zr(t));
|
|
3849
3849
|
if (e === this._activeObject && (a || !n)) {
|
|
3850
3850
|
this._setupCurrentTransform(t, e, o);
|
|
3851
3851
|
const c = a ? a.control : void 0, h = this.getScenePoint(t), l = c && c.getMouseDownHandler(t, e, c);
|
|
@@ -4006,7 +4006,7 @@ function xd(i, t) {
|
|
|
4006
4006
|
return { x1: It(e, "fx") || It(e, "cx") || "50%", y1: It(e, "fy") || It(e, "cy") || "50%", r1: 0, x2: It(e, "cx") || "50%", y2: It(e, "cy") || "50%", r2: It(e, "r") || "50%" };
|
|
4007
4007
|
}(i), v(v({}, t), {}, { gradientUnits: th(i) }));
|
|
4008
4008
|
}
|
|
4009
|
-
class
|
|
4009
|
+
class _r {
|
|
4010
4010
|
constructor(t) {
|
|
4011
4011
|
const { type: e = "linear", gradientUnits: s = "pixels", coords: r = {}, colorStops: n = [], offsetX: o = 0, offsetY: a = 0, gradientTransform: c, id: h } = t || {};
|
|
4012
4012
|
Object.assign(this, { type: e, gradientUnits: s, coords: v(v({}, e === "radial" ? vd : Kc), r), colorStops: n, offsetX: o, offsetY: a, gradientTransform: c, id: h ? "".concat(h, "_").concat(Te()) : Te() });
|
|
@@ -4027,7 +4027,7 @@ class yr {
|
|
|
4027
4027
|
let a = -this.offsetX, c = -this.offsetY;
|
|
4028
4028
|
var h;
|
|
4029
4029
|
n === "objectBoundingBox" ? (a /= t.width, c /= t.height) : (a += t.width / 2, c += t.height / 2), (h = t) && typeof h._renderPathCommands == "function" && this.gradientUnits !== "percentage" && (a -= t.pathOffset.x, c -= t.pathOffset.y), r[4] -= a, r[5] -= c;
|
|
4030
|
-
const l = ['id="SVGID_'.concat(this.id, '"'), 'gradientUnits="'.concat(n, '"'), 'gradientTransform="'.concat(e ? e + " " : "").concat(
|
|
4030
|
+
const l = ['id="SVGID_'.concat(this.id, '"'), 'gradientUnits="'.concat(n, '"'), 'gradientTransform="'.concat(e ? e + " " : "").concat(Zs(r), '"'), ""].join(" ");
|
|
4031
4031
|
if (this.type === "linear") {
|
|
4032
4032
|
const { x1: u, y1: d, x2: f, y2: g } = this.coords;
|
|
4033
4033
|
s.push("<linearGradient ", l, ' x1="', u, '" y1="', d, '" x2="', f, '" y2="', g, `">
|
|
@@ -4069,7 +4069,7 @@ class yr {
|
|
|
4069
4069
|
return new this(v({ id: t.getAttribute("id") || void 0, type: Qc(t), coords: xd(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: Td(t, s.opacity), gradientUnits: r, gradientTransform: dn(t.getAttribute("gradientTransform") || "") }, r === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
|
|
4070
4070
|
}
|
|
4071
4071
|
}
|
|
4072
|
-
y(
|
|
4072
|
+
y(_r, "type", "Gradient"), C.setClass(_r, "gradient"), C.setClass(_r, "linear"), C.setClass(_r, "radial");
|
|
4073
4073
|
const wd = ["type", "source", "patternTransform"];
|
|
4074
4074
|
class zi {
|
|
4075
4075
|
get type() {
|
|
@@ -4106,7 +4106,7 @@ class zi {
|
|
|
4106
4106
|
}
|
|
4107
4107
|
static async fromObject(t, e) {
|
|
4108
4108
|
let { type: s, source: r, patternTransform: n } = t, o = N(t, wd);
|
|
4109
|
-
const a = await
|
|
4109
|
+
const a = await Vs(r, v(v({}, e), {}, { crossOrigin: o.crossOrigin }));
|
|
4110
4110
|
return new this(v(v({}, o), {}, { patternTransform: n && n.slice(0), source: a }));
|
|
4111
4111
|
}
|
|
4112
4112
|
}
|
|
@@ -4406,7 +4406,7 @@ class jt extends ot {
|
|
|
4406
4406
|
t = v({ 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 || {});
|
|
4407
4407
|
const e = this.exactBoundingBox ? this._projectStrokeOnPoints(t).map((h) => h.projectedPoint) : this.points;
|
|
4408
4408
|
if (e.length === 0) return { left: 0, top: 0, width: 0, height: 0, pathOffset: new _(), strokeOffset: new _(), strokeDiff: new _() };
|
|
4409
|
-
const s = Ht(e), r =
|
|
4409
|
+
const s = Ht(e), r = hr(v(v({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Ht(this.points.map((h) => at(h, r, !0))), o = new _(this.scaleX, this.scaleY);
|
|
4410
4410
|
let a = s.left + s.width / 2, c = s.top + s.height / 2;
|
|
4411
4411
|
return this.exactBoundingBox && (a -= c * Math.tan(q(this.skewX)), c -= a * Math.tan(q(this.skewY))), v(v({}, s), {}, { pathOffset: new _(a, c), strokeOffset: new _(n.left, n.top).subtract(new _(s.left, s.top)).multiply(o), strokeDiff: new _(s.width, s.height).subtract(new _(n.width, n.height)).multiply(o) });
|
|
4412
4412
|
}
|
|
@@ -4481,14 +4481,14 @@ class jt extends ot {
|
|
|
4481
4481
|
return this._fromObject(t, { extraParam: "points" });
|
|
4482
4482
|
}
|
|
4483
4483
|
}
|
|
4484
|
-
y(jt, "ownDefaults", rh), y(jt, "type", "Polyline"), y(jt, "layoutProperties", [
|
|
4485
|
-
class
|
|
4484
|
+
y(jt, "ownDefaults", rh), y(jt, "type", "Polyline"), y(jt, "layoutProperties", [Ms, Ds, "strokeLineCap", "strokeLineJoin", "strokeMiterLimit", "strokeWidth", "strokeUniform", "points"]), y(jt, "cacheProperties", [...le, "points"]), y(jt, "ATTRIBUTE_NAMES", [...ke]), C.setClass(jt), C.setSVGClass(jt);
|
|
4485
|
+
class Sr extends jt {
|
|
4486
4486
|
isOpen() {
|
|
4487
4487
|
return !1;
|
|
4488
4488
|
}
|
|
4489
4489
|
}
|
|
4490
|
-
y(
|
|
4491
|
-
const ih = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], nh = ["underline", "overline", "linethrough"], oh = [...ih, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], ah = [...oh, ...nh, "textBackgroundColor", "direction"], Ed = [...ih, ...nh, mt, "strokeWidth", rt, "deltaY", "textBackgroundColor"], Pd = { _reNewline: jn, _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: F, fontStyle: "normal", lineHeight: 1.16, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: F, pathAlign: "baseline", _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.315, overline: -0.88 }, _fontSizeMult: 1.13, charSpacing: 0, deltaY: 0, direction: "ltr", CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2 }, Wt = "justify",
|
|
4490
|
+
y(Sr, "ownDefaults", rh), y(Sr, "type", "Polygon"), C.setClass(Sr), C.setSVGClass(Sr);
|
|
4491
|
+
const ih = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], nh = ["underline", "overline", "linethrough"], oh = [...ih, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], ah = [...oh, ...nh, "textBackgroundColor", "direction"], Ed = [...ih, ...nh, mt, "strokeWidth", rt, "deltaY", "textBackgroundColor"], Pd = { _reNewline: jn, _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: F, fontStyle: "normal", lineHeight: 1.16, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: F, pathAlign: "baseline", _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.315, overline: -0.88 }, _fontSizeMult: 1.13, charSpacing: 0, deltaY: 0, direction: "ltr", CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2 }, Wt = "justify", ni = "justify-left", Ns = "justify-right", Us = "justify-center";
|
|
4492
4492
|
class ch extends ot {
|
|
4493
4493
|
isEmptyStyles(t) {
|
|
4494
4494
|
if (!this.styles || t !== void 0 && !this.styles[t]) return !0;
|
|
@@ -4574,7 +4574,7 @@ const Ad = / +/g, Ld = /"/g;
|
|
|
4574
4574
|
function Hi(i, t, e, s, r) {
|
|
4575
4575
|
return " ".concat(function(n, o) {
|
|
4576
4576
|
let { left: a, top: c, width: h, height: l } = o, u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : A.NUM_FRACTION_DIGITS;
|
|
4577
|
-
const d =
|
|
4577
|
+
const d = Js(rt, n, !1), [f, g, p, m] = [a, c, h, l].map((b) => E(b, u));
|
|
4578
4578
|
return "<rect ".concat(d, ' x="').concat(f, '" y="').concat(g, '" width="').concat(p, '" height="').concat(m, '"></rect>');
|
|
4579
4579
|
}(i, { left: t, top: e, width: s, height: r }), `
|
|
4580
4580
|
`);
|
|
@@ -4680,7 +4680,7 @@ class ht extends ch {
|
|
|
4680
4680
|
t.fillStyle = e, this._removeShadow(t);
|
|
4681
4681
|
}
|
|
4682
4682
|
_measureChar(t, e, s, r) {
|
|
4683
|
-
const n =
|
|
4683
|
+
const n = Hs.getFontCache(e), o = this._getFontDeclaration(e), a = s + t, c = s && o === this._getFontDeclaration(r), h = e.fontSize / this.CACHE_FONT_SIZE;
|
|
4684
4684
|
let l, u, d, f;
|
|
4685
4685
|
if (s && n[s] !== void 0 && (d = n[s]), n[t] !== void 0 && (f = l = n[t]), c && n[a] !== void 0 && (u = n[a], f = u - d), l === void 0 || d === void 0 || u === void 0) {
|
|
4686
4686
|
const g = function() {
|
|
@@ -4825,7 +4825,7 @@ class ht extends ch {
|
|
|
4825
4825
|
_getLineLeftOffset(t) {
|
|
4826
4826
|
const e = this.getLineWidth(t), s = this.width - e, r = this.textAlign, n = this.direction, o = this.isEndOfWrapping(t);
|
|
4827
4827
|
let a = 0;
|
|
4828
|
-
return r === Wt || r ===
|
|
4828
|
+
return r === Wt || r === Us && !o || r === Ns && !o || r === ni && !o ? 0 : (r === j && (a = s / 2), r === Z && (a = s), r === Us && (a = s / 2), r === Ns && (a = s), n === "rtl" && (r === Z || r === Wt || r === Ns ? a = 0 : r === F || r === ni ? a = -s : r !== j && r !== Us || (a = -s / 2)), a);
|
|
4829
4829
|
}
|
|
4830
4830
|
_clearCache() {
|
|
4831
4831
|
this._forceClearCache = !1, this.__lineWidths = [], this.__lineHeights = [], this.__charBounds = [];
|
|
@@ -4967,7 +4967,7 @@ y(ht, "textLayoutProperties", oh), y(ht, "cacheProperties", [...le, ...ah]), y(h
|
|
|
4967
4967
|
}
|
|
4968
4968
|
getSvgSpanStyles(i, t) {
|
|
4969
4969
|
const { fontFamily: e, strokeWidth: s, stroke: r, fill: n, fontSize: o, fontStyle: a, fontWeight: c, deltaY: h } = i, l = this.getSvgTextDecoration(i);
|
|
4970
|
-
return [r ?
|
|
4970
|
+
return [r ? Js(mt, r) : "", s ? "stroke-width: ".concat(s, "; ") : "", e ? "font-family: ".concat(e.includes("'") || e.includes('"') ? e : "'".concat(e, "'"), "; ") : "", o ? "font-size: ".concat(o, "px; ") : "", a ? "font-style: ".concat(a, "; ") : "", c ? "font-weight: ".concat(c, "; ") : "", l && "text-decoration: ".concat(l, "; "), n ? Js(rt, n) : "", h ? "baseline-shift: ".concat(-h, "; ") : "", t ? "white-space: pre; " : ""].join("");
|
|
4971
4971
|
}
|
|
4972
4972
|
getSvgTextDecoration(i) {
|
|
4973
4973
|
return ["overline", "underline", "line-through"].filter((t) => i[t.replace("-", "")]).join(" ");
|
|
@@ -5006,7 +5006,7 @@ class Rd {
|
|
|
5006
5006
|
const w = { stroke: "transparent", fill: "transparent", textBackgroundColor: "transparent" };
|
|
5007
5007
|
o.setSelectionStyles(w, 0, r), o.setSelectionStyles(w, n, o.text.length), o.dirty = !0;
|
|
5008
5008
|
const k = o.toCanvasElement({ enableRetinaScaling: a.enableRetinaScaling, viewportTransform: !0 });
|
|
5009
|
-
o.backgroundColor = b, o.styles = S, o.dirty = !0,
|
|
5009
|
+
o.backgroundColor = b, o.styles = S, o.dirty = !0, Gs(k, { position: "fixed", left: "".concat(-k.width, "px"), border: pt, width: "".concat(k.width / d, "px"), height: "".concat(k.height / d, "px") }), this.__dragImageDisposer && this.__dragImageDisposer(), this.__dragImageDisposer = () => {
|
|
5010
5010
|
k.remove();
|
|
5011
5011
|
}, Pt(t.target || this.target.hiddenTextarea).body.appendChild(k), (s = t.dataTransfer) === null || s === void 0 || s.setDragImage(k, m.x, m.y);
|
|
5012
5012
|
}
|
|
@@ -5057,7 +5057,7 @@ class Rd {
|
|
|
5057
5057
|
const d = this.__dragStartSelection.selectionStart, f = this.__dragStartSelection.selectionEnd;
|
|
5058
5058
|
c > d && c <= f ? c = d : c > f && (c -= f - d), o.removeChars(d, f), delete this.__dragStartSelection;
|
|
5059
5059
|
}
|
|
5060
|
-
o._reNewline.test(l) && (o._reNewline.test(o._text[c]) || c === o._text.length) && (n = n.trimEnd()), t.didDrop = !0, t.dropTarget = o, o.insertChars(n, h, c), a.setActiveObject(o), o.enterEditing(s), o.selectionStart = Math.min(c + u, o._text.length), o.selectionEnd = Math.min(o.selectionStart + n.length, o._text.length), o.hiddenTextarea.value = o.text, o._updateTextarea(), o.hiddenTextarea.focus(), o.fire(
|
|
5060
|
+
o._reNewline.test(l) && (o._reNewline.test(o._text[c]) || c === o._text.length) && (n = n.trimEnd()), t.didDrop = !0, t.dropTarget = o, o.insertChars(n, h, c), a.setActiveObject(o), o.enterEditing(s), o.selectionStart = Math.min(c + u, o._text.length), o.selectionEnd = Math.min(o.selectionStart + n.length, o._text.length), o.hiddenTextarea.value = o.text, o._updateTextarea(), o.hiddenTextarea.focus(), o.fire($r, { index: c + u, action: "drop" }), a.fire("text:changed", { target: o }), a.contextTopDirty = !0, a.requestRenderAll();
|
|
5061
5061
|
}
|
|
5062
5062
|
}
|
|
5063
5063
|
dragEndHandler(t) {
|
|
@@ -5065,7 +5065,7 @@ class Rd {
|
|
|
5065
5065
|
if (this.isActive() && this.__dragStartFired && this.__dragStartSelection) {
|
|
5066
5066
|
var s;
|
|
5067
5067
|
const r = this.target, n = this.target.canvas, { selectionStart: o, selectionEnd: a } = this.__dragStartSelection, c = ((s = e.dataTransfer) === null || s === void 0 ? void 0 : s.dropEffect) || pt;
|
|
5068
|
-
c === pt ? (r.selectionStart = o, r.selectionEnd = a, r._updateTextarea(), r.hiddenTextarea.focus()) : (r.clearContextTop(), c === "move" && (r.removeChars(o, a), r.selectionStart = r.selectionEnd = o, r.hiddenTextarea && (r.hiddenTextarea.value = r.text), r._updateTextarea(), r.fire(
|
|
5068
|
+
c === pt ? (r.selectionStart = o, r.selectionEnd = a, r._updateTextarea(), r.hiddenTextarea.focus()) : (r.clearContextTop(), c === "move" && (r.removeChars(o, a), r.selectionStart = r.selectionEnd = o, r.hiddenTextarea && (r.hiddenTextarea.value = r.text), r._updateTextarea(), r.fire($r, { index: o, action: "dragend" }), n.fire("text:changed", { target: r }), n.requestRenderAll()), r.exitEditing());
|
|
5069
5069
|
}
|
|
5070
5070
|
this.__dragImageDisposer && this.__dragImageDisposer(), delete this.__dragImageDisposer, delete this.__dragStartSelection, this.__isDraggingOver = !1;
|
|
5071
5071
|
}
|
|
@@ -5216,7 +5216,7 @@ class Bd extends ht {
|
|
|
5216
5216
|
}
|
|
5217
5217
|
exitEditing() {
|
|
5218
5218
|
const t = this._textBeforeEdit !== this.text;
|
|
5219
|
-
return this._exitEditing(), this.selectionEnd = this.selectionStart, this._restoreEditingProps(), this._forceClearCache && (this.initDimensions(), this.setCoords()), this.fire("editing:exited"), t && this.fire(
|
|
5219
|
+
return this._exitEditing(), this.selectionEnd = this.selectionStart, this._restoreEditingProps(), this._forceClearCache && (this.initDimensions(), this.setCoords()), this.fire("editing:exited"), t && this.fire(qr), this.canvas && (this.canvas.fire("text:editing:exited", { target: this }), t && this.canvas.fire("object:modified", { target: this })), this;
|
|
5220
5220
|
}
|
|
5221
5221
|
_removeExtraneousStyles() {
|
|
5222
5222
|
for (const t in this.styles) this._textLines[t] || delete this.styles[t];
|
|
@@ -5300,7 +5300,7 @@ class Bd extends ht {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
class Wd extends Bd {
|
|
5302
5302
|
initHiddenTextarea() {
|
|
5303
|
-
const t = this.canvas && Pt(this.canvas.getElement()) ||
|
|
5303
|
+
const t = this.canvas && Pt(this.canvas.getElement()) || ks(), e = t.createElement("textarea");
|
|
5304
5304
|
Object.entries({ autocapitalize: "off", autocorrect: "off", autocomplete: "off", spellcheck: "false", "data-fabric": "textarea", wrap: "off" }).map((o) => {
|
|
5305
5305
|
let [a, c] = o;
|
|
5306
5306
|
return e.setAttribute(a, c);
|
|
@@ -5331,7 +5331,7 @@ class Wd extends Bd {
|
|
|
5331
5331
|
const e = this.fromPaste;
|
|
5332
5332
|
if (this.fromPaste = !1, t && t.stopPropagation(), !this.isEditing) return;
|
|
5333
5333
|
const s = () => {
|
|
5334
|
-
this.updateFromTextArea(), this.fire(
|
|
5334
|
+
this.updateFromTextArea(), this.fire($r), this.canvas && (this.canvas.fire("text:changed", { target: this }), this.canvas.requestRenderAll());
|
|
5335
5335
|
};
|
|
5336
5336
|
if (this.hiddenTextarea.value === "") return this.styles = {}, void s();
|
|
5337
5337
|
const r = this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText, n = this._text.length, o = r.length, a = this.selectionStart, c = this.selectionEnd, h = a !== c;
|
|
@@ -5525,7 +5525,7 @@ class Xd extends Wd {
|
|
|
5525
5525
|
return Math.min(this.flipX ? a - r : r, this._text.length);
|
|
5526
5526
|
}
|
|
5527
5527
|
}
|
|
5528
|
-
const
|
|
5528
|
+
const Tr = "moveCursorUp", xr = "moveCursorDown", wr = "moveCursorLeft", Cr = "moveCursorRight", Or = "exitEditing", zd = v({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Or, 27: Or, 33: Tr, 34: xr, 35: Cr, 36: wr, 37: wr, 38: Tr, 39: Cr, 40: xr }, keysMapRtl: { 9: Or, 27: Or, 33: Tr, 34: xr, 35: wr, 36: Cr, 37: Cr, 38: Tr, 39: wr, 40: xr }, ctrlKeysMapDown: { 65: "selectAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
|
|
5529
5529
|
class ie extends Xd {
|
|
5530
5530
|
static getDefaults() {
|
|
5531
5531
|
return v(v({}, super.getDefaults()), ie.ownDefaults);
|
|
@@ -5598,7 +5598,7 @@ class ie extends Xd {
|
|
|
5598
5598
|
const o = this._getLineLeftOffset(n), a = this.__charBounds[n][r];
|
|
5599
5599
|
a && (s = a.left), this.charSpacing !== 0 && r === this._textLines[n].length && (s -= this._getWidthOfCharSpacing());
|
|
5600
5600
|
const c = { top: e, left: o + (s > 0 ? s : 0) };
|
|
5601
|
-
return this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Wt || this.textAlign ===
|
|
5601
|
+
return this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Wt || this.textAlign === Ns ? c.left *= -1 : this.textAlign === F || this.textAlign === ni ? c.left = o - (s > 0 ? s : 0) : this.textAlign !== j && this.textAlign !== Us || (c.left = o - (s > 0 ? s : 0))), c;
|
|
5602
5602
|
}
|
|
5603
5603
|
renderCursorAt(t) {
|
|
5604
5604
|
const e = this._getCursorBoundaries(t, !0);
|
|
@@ -5637,7 +5637,7 @@ class ie extends Xd {
|
|
|
5637
5637
|
m = p, (this.lineHeight < 1 || f === l && this.lineHeight > 1) && (p /= this.lineHeight);
|
|
5638
5638
|
let w = s.left + g + b, k = p, O = 0;
|
|
5639
5639
|
const x = S - b;
|
|
5640
|
-
this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", k = 1, O = p) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Wt || this.textAlign ===
|
|
5640
|
+
this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", k = 1, O = p) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Wt || this.textAlign === Ns ? w = this.width - w - x : this.textAlign === F || this.textAlign === ni ? w = s.left + g - S : this.textAlign !== j && this.textAlign !== Us || (w = s.left + g - S)), t.fillRect(w, s.top + s.topOffset + O, x, k), s.topOffset += m;
|
|
5641
5641
|
}
|
|
5642
5642
|
}
|
|
5643
5643
|
getCurrentCharFontSize() {
|
|
@@ -5822,7 +5822,7 @@ class Yo extends xi {
|
|
|
5822
5822
|
}
|
|
5823
5823
|
}
|
|
5824
5824
|
y(Yo, "type", "fixed"), C.setClass(Yo);
|
|
5825
|
-
class Hd extends
|
|
5825
|
+
class Hd extends tr {
|
|
5826
5826
|
subscribeTargets(t) {
|
|
5827
5827
|
const e = t.target;
|
|
5828
5828
|
t.targets.reduce((s, r) => (r.parent && s.add(r.parent), s), /* @__PURE__ */ new Set()).forEach((s) => {
|
|
@@ -5874,7 +5874,7 @@ class Ot extends Yt {
|
|
|
5874
5874
|
const { parent: n } = r;
|
|
5875
5875
|
n && s.add(n);
|
|
5876
5876
|
}), t === Kn ? s.forEach((r) => {
|
|
5877
|
-
r._onAfterObjectsChange(
|
|
5877
|
+
r._onAfterObjectsChange(si, e);
|
|
5878
5878
|
}) : s.forEach((r) => {
|
|
5879
5879
|
r._set("dirty", !0);
|
|
5880
5880
|
});
|
|
@@ -6004,7 +6004,7 @@ class wt extends ot {
|
|
|
6004
6004
|
return v(v({}, super.getDefaults()), wt.ownDefaults);
|
|
6005
6005
|
}
|
|
6006
6006
|
constructor(t, e) {
|
|
6007
|
-
super(), y(this, "_lastScaleX", 1), y(this, "_lastScaleY", 1), y(this, "_filterScalingX", 1), y(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, wt.ownDefaults), this.setOptions(e), this.cacheKey = "texture".concat(Te()), this.setElement(typeof t == "string" ? (this.canvas && Pt(this.canvas.getElement()) ||
|
|
6007
|
+
super(), y(this, "_lastScaleX", 1), y(this, "_lastScaleY", 1), y(this, "_filterScalingX", 1), y(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, wt.ownDefaults), this.setOptions(e), this.cacheKey = "texture".concat(Te()), this.setElement(typeof t == "string" ? (this.canvas && Pt(this.canvas.getElement()) || ks()).getElementById(t) : t, e);
|
|
6008
6008
|
}
|
|
6009
6009
|
getElement() {
|
|
6010
6010
|
return this._element;
|
|
@@ -6073,7 +6073,7 @@ class wt extends ot {
|
|
|
6073
6073
|
}
|
|
6074
6074
|
setSrc(t) {
|
|
6075
6075
|
let { crossOrigin: e, signal: s } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6076
|
-
return
|
|
6076
|
+
return Vs(t, { crossOrigin: e, signal: s }).then((r) => {
|
|
6077
6077
|
e !== void 0 && this.set({ crossOrigin: e }), this.setElement(r);
|
|
6078
6078
|
});
|
|
6079
6079
|
}
|
|
@@ -6130,14 +6130,14 @@ class wt extends ot {
|
|
|
6130
6130
|
}
|
|
6131
6131
|
static fromObject(t, e) {
|
|
6132
6132
|
let { filters: s, resizeFilter: r, src: n, crossOrigin: o, type: a } = t, c = N(t, Gd);
|
|
6133
|
-
return Promise.all([
|
|
6133
|
+
return Promise.all([Vs(n, v(v({}, e), {}, { crossOrigin: o })), s && ys(s, e), r && ys([r], e), lr(c, e)]).then((h) => {
|
|
6134
6134
|
let [l, u = [], [d] = [], f = {}] = h;
|
|
6135
6135
|
return new this(l, v(v({}, c), {}, { src: n, filters: u, resizeFilter: d }, f));
|
|
6136
6136
|
});
|
|
6137
6137
|
}
|
|
6138
6138
|
static fromURL(t) {
|
|
6139
6139
|
let { crossOrigin: e = null, signal: s } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 ? arguments[2] : void 0;
|
|
6140
|
-
return
|
|
6140
|
+
return Vs(t, { crossOrigin: e, signal: s }).then((n) => new this(n, r));
|
|
6141
6141
|
}
|
|
6142
6142
|
static async fromElement(t) {
|
|
6143
6143
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0;
|
|
@@ -6197,19 +6197,19 @@ class $d extends gh {
|
|
|
6197
6197
|
t.lineTo(d.x, d.y), t.stroke(), t.restore(), super.render(t, e, s, r, n);
|
|
6198
6198
|
}
|
|
6199
6199
|
}
|
|
6200
|
-
const
|
|
6201
|
-
var
|
|
6200
|
+
const kr = (i, t, e, s, r, n) => new (e ? $d : gh)(v(v({ commandIndex: i, pointIndex: t, actionName: "modifyPath", positionHandler: Nd, actionHandler: Ud, connectToCommandIndex: r, connectToPointIndex: n }, s), e ? s.controlPointStyle : s.pointStyle));
|
|
6201
|
+
var Es = Object.freeze({ __proto__: null, changeWidth: hn, createObjectDefaultControls: Un, createPathControls: function(i) {
|
|
6202
6202
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6203
6203
|
const e = {};
|
|
6204
6204
|
let s = "M";
|
|
6205
6205
|
return i.path.forEach((r, n) => {
|
|
6206
6206
|
const o = r[0];
|
|
6207
|
-
switch (o !== "Z" && (e["c_".concat(n, "_").concat(o)] =
|
|
6207
|
+
switch (o !== "Z" && (e["c_".concat(n, "_").concat(o)] = kr(n, r.length - 2, !1, t)), o) {
|
|
6208
6208
|
case "C":
|
|
6209
|
-
e["c_".concat(n, "_C_CP_1")] =
|
|
6209
|
+
e["c_".concat(n, "_C_CP_1")] = kr(n, 1, !0, t, n - 1, /* @__PURE__ */ ((a) => a === "C" ? 5 : a === "Q" ? 3 : 1)(s)), e["c_".concat(n, "_C_CP_2")] = kr(n, 3, !0, t, n, 5);
|
|
6210
6210
|
break;
|
|
6211
6211
|
case "Q":
|
|
6212
|
-
e["c_".concat(n, "_Q_CP_1")] =
|
|
6212
|
+
e["c_".concat(n, "_Q_CP_1")] = kr(n, 1, !0, t, n, 3);
|
|
6213
6213
|
}
|
|
6214
6214
|
s = o;
|
|
6215
6215
|
}), e;
|
|
@@ -6218,7 +6218,7 @@ var Is = Object.freeze({ __proto__: null, changeWidth: hn, createObjectDefaultCo
|
|
|
6218
6218
|
const e = {};
|
|
6219
6219
|
for (let s = 0; s < (typeof i == "number" ? i : i.points.length); s++) e["p".concat(s)] = new $(v({ actionName: uh, positionHandler: Vo(s), actionHandler: Go(s) }, t));
|
|
6220
6220
|
return e;
|
|
6221
|
-
}, createPolyPositionHandler: Vo, createResizeControls: Oc, createTextboxDefaultControls: kc, dragHandler: oc, factoryPolyActionHandler: fh, getLocalPoint: vi, polyActionHandler: dh, renderCircleControl: gc, renderSquareControl: pc, rotationStyleHandler: mc, rotationWithSnapping: vc, scaleCursorStyleHandler: Ze, scaleOrSkewActionName:
|
|
6221
|
+
}, createPolyPositionHandler: Vo, createResizeControls: Oc, createTextboxDefaultControls: kc, dragHandler: oc, factoryPolyActionHandler: fh, getLocalPoint: vi, polyActionHandler: dh, renderCircleControl: gc, renderSquareControl: pc, rotationStyleHandler: mc, rotationWithSnapping: vc, scaleCursorStyleHandler: Ze, scaleOrSkewActionName: Ws, scaleSkewCursorStyleHandler: Le, scalingEqually: Bs, scalingX: _c, scalingXOrSkewingY: ln, scalingY: Sc, scalingYOrSkewingX: un, skewCursorStyleHandler: Tc, skewHandlerX: wc, skewHandlerY: Cc, wrapWithFireEvent: Oe, wrapWithFixedAnchor: Ve });
|
|
6222
6222
|
const Ci = (i) => i.webgl !== void 0, Jn = "precision highp float", qd = `
|
|
6223
6223
|
`.concat(Jn, `;
|
|
6224
6224
|
varying vec2 vTexCoord;
|
|
@@ -6355,7 +6355,7 @@ const Qd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
|
|
|
6355
6355
|
gl_FragColor.rgb *= (1.0 - uColor.a);
|
|
6356
6356
|
gl_FragColor.rgb += uColor.rgb;
|
|
6357
6357
|
` };
|
|
6358
|
-
class
|
|
6358
|
+
class Mr extends it {
|
|
6359
6359
|
getCacheKey() {
|
|
6360
6360
|
return "".concat(this.type, "_").concat(this.mode);
|
|
6361
6361
|
}
|
|
@@ -6417,7 +6417,7 @@ class Or extends it {
|
|
|
6417
6417
|
s[0] = this.alpha * s[0] / 255, s[1] = this.alpha * s[1] / 255, s[2] = this.alpha * s[2] / 255, s[3] = this.alpha, t.uniform4fv(e.uColor, s);
|
|
6418
6418
|
}
|
|
6419
6419
|
}
|
|
6420
|
-
y(
|
|
6420
|
+
y(Mr, "defaults", { color: "#F95C63", mode: "multiply", alpha: 1 }), y(Mr, "type", "BlendColor"), y(Mr, "uniformLocations", ["uColor"]), C.setClass(Mr);
|
|
6421
6421
|
const tf = { multiply: `
|
|
6422
6422
|
precision highp float;
|
|
6423
6423
|
uniform sampler2D uTexture;
|
|
@@ -6445,7 +6445,7 @@ const tf = { multiply: `
|
|
|
6445
6445
|
gl_FragColor = color;
|
|
6446
6446
|
}
|
|
6447
6447
|
` }, ef = ["type", "image"];
|
|
6448
|
-
class
|
|
6448
|
+
class Dr extends it {
|
|
6449
6449
|
getCacheKey() {
|
|
6450
6450
|
return "".concat(this.type, "_").concat(this.mode);
|
|
6451
6451
|
}
|
|
@@ -6506,8 +6506,8 @@ class kr extends it {
|
|
|
6506
6506
|
return wt.fromObject(r, e).then((o) => new this(v(v({}, n), {}, { image: o })));
|
|
6507
6507
|
}
|
|
6508
6508
|
}
|
|
6509
|
-
y(
|
|
6510
|
-
class
|
|
6509
|
+
y(Dr, "type", "BlendImage"), y(Dr, "defaults", { mode: "multiply", alpha: 1 }), y(Dr, "uniformLocations", ["uTransformMatrix", "uImage"]), C.setClass(Dr);
|
|
6510
|
+
class Ir extends it {
|
|
6511
6511
|
getFragmentSource() {
|
|
6512
6512
|
return `
|
|
6513
6513
|
precision highp float;
|
|
@@ -6569,8 +6569,8 @@ class Mr extends it {
|
|
|
6569
6569
|
return this.horizontal ? e[0] = s : e[1] = s, e;
|
|
6570
6570
|
}
|
|
6571
6571
|
}
|
|
6572
|
-
y(
|
|
6573
|
-
class
|
|
6572
|
+
y(Ir, "type", "Blur"), y(Ir, "defaults", { blur: 0 }), y(Ir, "uniformLocations", ["uDelta"]), C.setClass(Ir);
|
|
6573
|
+
class jr extends it {
|
|
6574
6574
|
getFragmentSource() {
|
|
6575
6575
|
return `
|
|
6576
6576
|
precision highp float;
|
|
@@ -6596,7 +6596,7 @@ class Dr extends it {
|
|
|
6596
6596
|
t.uniform1f(e.uBrightness, this.brightness);
|
|
6597
6597
|
}
|
|
6598
6598
|
}
|
|
6599
|
-
y(
|
|
6599
|
+
y(jr, "type", "Brightness"), y(jr, "defaults", { brightness: 0 }), y(jr, "uniformLocations", ["uBrightness"]), C.setClass(jr);
|
|
6600
6600
|
class Qe extends it {
|
|
6601
6601
|
getFragmentSource() {
|
|
6602
6602
|
return `
|
|
@@ -6669,7 +6669,7 @@ class No extends it {
|
|
|
6669
6669
|
}
|
|
6670
6670
|
}
|
|
6671
6671
|
y(No, "type", "Composed"), C.setClass(No);
|
|
6672
|
-
class
|
|
6672
|
+
class Er extends it {
|
|
6673
6673
|
getFragmentSource() {
|
|
6674
6674
|
return `
|
|
6675
6675
|
precision highp float;
|
|
@@ -6695,7 +6695,7 @@ class Ir extends it {
|
|
|
6695
6695
|
t.uniform1f(e.uContrast, this.contrast);
|
|
6696
6696
|
}
|
|
6697
6697
|
}
|
|
6698
|
-
y(
|
|
6698
|
+
y(Er, "type", "Contrast"), y(Er, "defaults", { contrast: 0 }), y(Er, "uniformLocations", ["uContrast"]), C.setClass(Er);
|
|
6699
6699
|
const sf = { Convolute_3_1: `
|
|
6700
6700
|
precision highp float;
|
|
6701
6701
|
uniform sampler2D uTexture;
|
|
@@ -6841,7 +6841,7 @@ const sf = { Convolute_3_1: `
|
|
|
6841
6841
|
gl_FragColor.a = alpha;
|
|
6842
6842
|
}
|
|
6843
6843
|
` };
|
|
6844
|
-
class
|
|
6844
|
+
class Pr extends it {
|
|
6845
6845
|
getCacheKey() {
|
|
6846
6846
|
return "".concat(this.type, "_").concat(Math.sqrt(this.matrix.length), "_").concat(this.opaque ? 1 : 0);
|
|
6847
6847
|
}
|
|
@@ -6864,9 +6864,9 @@ class jr extends it {
|
|
|
6864
6864
|
return v(v({}, super.toObject()), {}, { opaque: this.opaque, matrix: [...this.matrix] });
|
|
6865
6865
|
}
|
|
6866
6866
|
}
|
|
6867
|
-
y(
|
|
6867
|
+
y(Pr, "type", "Convolute"), y(Pr, "defaults", { opaque: !1, matrix: [0, 0, 0, 0, 1, 0, 0, 0, 0] }), y(Pr, "uniformLocations", ["uMatrix", "uOpaque", "uHalfSize", "uSize"]), C.setClass(Pr);
|
|
6868
6868
|
const ph = "Gamma";
|
|
6869
|
-
class
|
|
6869
|
+
class Ar extends it {
|
|
6870
6870
|
getFragmentSource() {
|
|
6871
6871
|
return `
|
|
6872
6872
|
precision highp float;
|
|
@@ -6907,7 +6907,7 @@ class Er extends it {
|
|
|
6907
6907
|
return { type: ph, gamma: this.gamma.concat() };
|
|
6908
6908
|
}
|
|
6909
6909
|
}
|
|
6910
|
-
y(
|
|
6910
|
+
y(Ar, "type", ph), y(Ar, "defaults", { gamma: [1, 1, 1] }), y(Ar, "uniformLocations", ["uGamma"]), C.setClass(Ar);
|
|
6911
6911
|
const rf = { average: `
|
|
6912
6912
|
precision highp float;
|
|
6913
6913
|
uniform sampler2D uTexture;
|
|
@@ -6938,7 +6938,7 @@ const rf = { average: `
|
|
|
6938
6938
|
gl_FragColor = vec4(average, average, average, col.a);
|
|
6939
6939
|
}
|
|
6940
6940
|
` };
|
|
6941
|
-
class
|
|
6941
|
+
class Lr extends it {
|
|
6942
6942
|
applyTo2d(t) {
|
|
6943
6943
|
let { imageData: { data: e } } = t;
|
|
6944
6944
|
for (let s, r = 0; r < e.length; r += 4) {
|
|
@@ -6968,7 +6968,7 @@ class Pr extends it {
|
|
|
6968
6968
|
return !1;
|
|
6969
6969
|
}
|
|
6970
6970
|
}
|
|
6971
|
-
y(
|
|
6971
|
+
y(Lr, "type", "Grayscale"), y(Lr, "defaults", { mode: "average" }), y(Lr, "uniformLocations", ["uMode"]), C.setClass(Lr);
|
|
6972
6972
|
class Ui extends Qe {
|
|
6973
6973
|
calculateMatrix() {
|
|
6974
6974
|
const t = this.rotation * Math.PI, e = Ft(t), s = Rt(t), r = 1 / 3, n = Math.sqrt(r) * s, o = 1 - e;
|
|
@@ -6985,7 +6985,7 @@ class Ui extends Qe {
|
|
|
6985
6985
|
}
|
|
6986
6986
|
}
|
|
6987
6987
|
y(Ui, "type", "HueRotation"), y(Ui, "defaults", { rotation: 0 }), C.setClass(Ui);
|
|
6988
|
-
class
|
|
6988
|
+
class Fr extends it {
|
|
6989
6989
|
applyTo2d(t) {
|
|
6990
6990
|
let { imageData: { data: e } } = t;
|
|
6991
6991
|
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]);
|
|
@@ -7018,8 +7018,8 @@ class Ar extends it {
|
|
|
7018
7018
|
t.uniform1i(e.uInvert, Number(this.invert)), t.uniform1i(e.uAlpha, Number(this.alpha));
|
|
7019
7019
|
}
|
|
7020
7020
|
}
|
|
7021
|
-
y(
|
|
7022
|
-
class
|
|
7021
|
+
y(Fr, "type", "Invert"), y(Fr, "defaults", { alpha: !1, invert: !0 }), y(Fr, "uniformLocations", ["uInvert", "uAlpha"]), C.setClass(Fr);
|
|
7022
|
+
class Rr extends it {
|
|
7023
7023
|
getFragmentSource() {
|
|
7024
7024
|
return `
|
|
7025
7025
|
precision highp float;
|
|
@@ -7053,8 +7053,8 @@ class Lr extends it {
|
|
|
7053
7053
|
return this.noise === 0;
|
|
7054
7054
|
}
|
|
7055
7055
|
}
|
|
7056
|
-
y(
|
|
7057
|
-
class
|
|
7056
|
+
y(Rr, "type", "Noise"), y(Rr, "defaults", { noise: 0 }), y(Rr, "uniformLocations", ["uNoise", "uSeed"]), C.setClass(Rr);
|
|
7057
|
+
class Br extends it {
|
|
7058
7058
|
applyTo2d(t) {
|
|
7059
7059
|
let { imageData: { data: e, width: s, height: r } } = t;
|
|
7060
7060
|
for (let n = 0; n < r; n += this.blocksize) for (let o = 0; o < s; o += this.blocksize) {
|
|
@@ -7093,8 +7093,8 @@ class Fr extends it {
|
|
|
7093
7093
|
t.uniform1f(e.uBlocksize, this.blocksize);
|
|
7094
7094
|
}
|
|
7095
7095
|
}
|
|
7096
|
-
y(
|
|
7097
|
-
class
|
|
7096
|
+
y(Br, "type", "Pixelate"), y(Br, "defaults", { blocksize: 4 }), y(Br, "uniformLocations", ["uBlocksize"]), C.setClass(Br);
|
|
7097
|
+
class Wr extends it {
|
|
7098
7098
|
getFragmentSource() {
|
|
7099
7099
|
return `
|
|
7100
7100
|
precision highp float;
|
|
@@ -7123,8 +7123,8 @@ void main() {
|
|
|
7123
7123
|
t.uniform4fv(e.uLow, n), t.uniform4fv(e.uHigh, o);
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
|
-
y(
|
|
7127
|
-
class
|
|
7126
|
+
y(Wr, "type", "RemoveColor"), y(Wr, "defaults", { color: "#FFFFFF", distance: 0.02, useAlpha: !1 }), y(Wr, "uniformLocations", ["uLow", "uHigh"]), C.setClass(Wr);
|
|
7127
|
+
class Xr extends it {
|
|
7128
7128
|
sendUniformData(t, e) {
|
|
7129
7129
|
t.uniform2fv(e.uDelta, this.horizontal ? [1 / this.width, 0] : [0, 1 / this.height]), t.uniform1fv(e.uTaps, this.taps);
|
|
7130
7130
|
}
|
|
@@ -7243,8 +7243,8 @@ class Br extends it {
|
|
|
7243
7243
|
return u;
|
|
7244
7244
|
}
|
|
7245
7245
|
}
|
|
7246
|
-
y(
|
|
7247
|
-
class
|
|
7246
|
+
y(Xr, "type", "Resize"), y(Xr, "defaults", { resizeType: "hermite", scaleX: 1, scaleY: 1, lanczosLobes: 3 }), y(Xr, "uniformLocations", ["uDelta", "uTaps"]), C.setClass(Xr);
|
|
7247
|
+
class zr extends it {
|
|
7248
7248
|
getFragmentSource() {
|
|
7249
7249
|
return `
|
|
7250
7250
|
precision highp float;
|
|
@@ -7277,8 +7277,8 @@ class Wr extends it {
|
|
|
7277
7277
|
return this.saturation === 0;
|
|
7278
7278
|
}
|
|
7279
7279
|
}
|
|
7280
|
-
y(
|
|
7281
|
-
class
|
|
7280
|
+
y(zr, "type", "Saturation"), y(zr, "defaults", { saturation: 0 }), y(zr, "uniformLocations", ["uSaturation"]), C.setClass(zr);
|
|
7281
|
+
class Hr extends it {
|
|
7282
7282
|
getFragmentSource() {
|
|
7283
7283
|
return `
|
|
7284
7284
|
precision highp float;
|
|
@@ -7312,7 +7312,7 @@ class Xr extends it {
|
|
|
7312
7312
|
return this.vibrance === 0;
|
|
7313
7313
|
}
|
|
7314
7314
|
}
|
|
7315
|
-
y(
|
|
7315
|
+
y(Hr, "type", "Vibrance"), y(Hr, "defaults", { vibrance: 0 }), y(Hr, "uniformLocations", ["uVibrance"]), C.setClass(Hr);
|
|
7316
7316
|
function Nt(i, t, e, s, r) {
|
|
7317
7317
|
const c = r.canvas.viewportTransform;
|
|
7318
7318
|
i.save(), this.controlOrientation === "left" ? i.translate(
|
|
@@ -7349,8 +7349,8 @@ const Mt = 1, vt = "rgba(255, 255, 255,1.0)", Uo = [
|
|
|
7349
7349
|
center: 0,
|
|
7350
7350
|
bottom: 0.5,
|
|
7351
7351
|
right: 0.5
|
|
7352
|
-
}, L = (i) => typeof i == "string" ? of[i] : i - 0.5, ze = "center",
|
|
7353
|
-
function
|
|
7352
|
+
}, L = (i) => typeof i == "string" ? of[i] : i - 0.5, ze = "center", fr = "left", cb = "top", hb = "bottom", gr = "right", lb = "none";
|
|
7353
|
+
function pr(i) {
|
|
7354
7354
|
return L(i.originX) === L(ze) && L(i.originY) === L(ze);
|
|
7355
7355
|
}
|
|
7356
7356
|
function Oi(i) {
|
|
@@ -7378,7 +7378,7 @@ function ub(i, t = 1) {
|
|
|
7378
7378
|
const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
7379
7379
|
const { display: s, playbackRate: r } = i[e];
|
|
7380
7380
|
return Math.max(t, s.to / (r || 1));
|
|
7381
|
-
}, 0), { wrapWithFireEvent: lf, getLocalPoint: uf } =
|
|
7381
|
+
}, 0), { wrapWithFireEvent: lf, getLocalPoint: uf } = Es, df = (i, t, e, s) => {
|
|
7382
7382
|
const r = uf(
|
|
7383
7383
|
t,
|
|
7384
7384
|
t.originX,
|
|
@@ -7386,8 +7386,8 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7386
7386
|
e,
|
|
7387
7387
|
s
|
|
7388
7388
|
);
|
|
7389
|
-
if (L(t.originX) === L(ze) || L(t.originX) === L(
|
|
7390
|
-
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a =
|
|
7389
|
+
if (L(t.originX) === L(ze) || L(t.originX) === L(gr) && r.x < 0 || L(t.originX) === L(fr) && r.x > 0) {
|
|
7390
|
+
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = pr(t) ? 2 : 1, c = n.width, h = Math.ceil(
|
|
7391
7391
|
Math.abs(r.x * a / n.scaleX) - o
|
|
7392
7392
|
);
|
|
7393
7393
|
if (t.corner === "mr") {
|
|
@@ -7432,7 +7432,7 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7432
7432
|
}, yn = lf(
|
|
7433
7433
|
"resizing",
|
|
7434
7434
|
Oi(df)
|
|
7435
|
-
), { wrapWithFireEvent: ff, getLocalPoint: gf, wrapWithFixedAnchor: pf } =
|
|
7435
|
+
), { wrapWithFireEvent: ff, getLocalPoint: gf, wrapWithFixedAnchor: pf } = Es, mf = (i, t, e, s) => {
|
|
7436
7436
|
const r = gf(
|
|
7437
7437
|
t,
|
|
7438
7438
|
t.originX,
|
|
@@ -7440,8 +7440,8 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7440
7440
|
e,
|
|
7441
7441
|
s
|
|
7442
7442
|
);
|
|
7443
|
-
if (L(t.originX) === L(ze) || L(t.originX) === L(
|
|
7444
|
-
const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a =
|
|
7443
|
+
if (L(t.originX) === L(ze) || L(t.originX) === L(gr) && r.x < 0 || L(t.originX) === L(fr) && r.x > 0) {
|
|
7444
|
+
const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = pr(t) ? 2 : 1, c = n.width, h = Math.ceil(
|
|
7445
7445
|
Math.abs(r.x * a / n.scaleX) - o
|
|
7446
7446
|
), l = t.corner === "ml";
|
|
7447
7447
|
if (n.left < 0) return !1;
|
|
@@ -7456,7 +7456,7 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7456
7456
|
}, bn = ff(
|
|
7457
7457
|
"resizing",
|
|
7458
7458
|
pf(mf)
|
|
7459
|
-
), { wrapWithFireEvent: vf, getLocalPoint: yf } =
|
|
7459
|
+
), { wrapWithFireEvent: vf, getLocalPoint: yf } = Es, bf = (i, t, e, s) => {
|
|
7460
7460
|
const r = yf(
|
|
7461
7461
|
t,
|
|
7462
7462
|
t.originX,
|
|
@@ -7464,8 +7464,8 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7464
7464
|
e,
|
|
7465
7465
|
s
|
|
7466
7466
|
);
|
|
7467
|
-
if (L(t.originX) === L(ze) || L(t.originX) === L(
|
|
7468
|
-
const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a =
|
|
7467
|
+
if (L(t.originX) === L(ze) || L(t.originX) === L(gr) && r.x < 0 || L(t.originX) === L(fr) && r.x > 0) {
|
|
7468
|
+
const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = pr(t) ? 2 : 1, c = n.width, h = Math.ceil(
|
|
7469
7469
|
Math.abs(r.x * a / n.scaleX) - o
|
|
7470
7470
|
), l = G(
|
|
7471
7471
|
h,
|
|
@@ -7478,7 +7478,7 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7478
7478
|
}, _n = vf(
|
|
7479
7479
|
"resizing",
|
|
7480
7480
|
Oi(bf)
|
|
7481
|
-
), { wrapWithFireEvent: _f, getLocalPoint: Sf } =
|
|
7481
|
+
), { wrapWithFireEvent: _f, getLocalPoint: Sf } = Es, Tf = (i, t, e, s) => {
|
|
7482
7482
|
const r = Sf(
|
|
7483
7483
|
t,
|
|
7484
7484
|
t.originX,
|
|
@@ -7486,8 +7486,8 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7486
7486
|
e,
|
|
7487
7487
|
s
|
|
7488
7488
|
);
|
|
7489
|
-
if (L(t.originX) === L(ze) || L(t.originX) === L(
|
|
7490
|
-
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a =
|
|
7489
|
+
if (L(t.originX) === L(ze) || L(t.originX) === L(gr) && r.x < 0 || L(t.originX) === L(fr) && r.x > 0) {
|
|
7490
|
+
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = pr(t) ? 2 : 1, c = n.width, h = Math.ceil(
|
|
7491
7491
|
Math.abs(r.x * a / n.scaleX) - o
|
|
7492
7492
|
);
|
|
7493
7493
|
if (t.corner === "mr") {
|
|
@@ -7516,7 +7516,7 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7516
7516
|
}, qo = _f(
|
|
7517
7517
|
"resizing",
|
|
7518
7518
|
Oi(Tf)
|
|
7519
|
-
), { scaleSkewCursorStyleHandler: Ut } =
|
|
7519
|
+
), { scaleSkewCursorStyleHandler: Ut } = Es, Ps = () => ({
|
|
7520
7520
|
mr: new $({
|
|
7521
7521
|
x: 0.5,
|
|
7522
7522
|
y: 0,
|
|
@@ -7612,18 +7612,18 @@ const vh = (i) => Object.keys(i).reduce((t, e) => {
|
|
|
7612
7612
|
controlOrientation: "left"
|
|
7613
7613
|
})
|
|
7614
7614
|
}), Of = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
7615
|
-
let
|
|
7615
|
+
let mr = (i = 21) => {
|
|
7616
7616
|
let t = "", e = crypto.getRandomValues(new Uint8Array(i |= 0));
|
|
7617
7617
|
for (; i--; )
|
|
7618
7618
|
t += Of[e[i] & 63];
|
|
7619
7619
|
return t;
|
|
7620
7620
|
};
|
|
7621
|
-
function
|
|
7621
|
+
function Xs(i = 16) {
|
|
7622
7622
|
const t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", e = t.charAt(Math.floor(Math.random() * t.length));
|
|
7623
|
-
let s =
|
|
7623
|
+
let s = mr(i - 1);
|
|
7624
7624
|
return s = s.replace(/[^a-zA-Z0-9]/g, "").slice(0, i - 1), e + s;
|
|
7625
7625
|
}
|
|
7626
|
-
const { wrapWithFireEvent: kf, getLocalPoint: Mf } =
|
|
7626
|
+
const { wrapWithFireEvent: kf, getLocalPoint: Mf } = Es, Df = (i, t, e, s) => {
|
|
7627
7627
|
const r = Mf(
|
|
7628
7628
|
t,
|
|
7629
7629
|
t.originX,
|
|
@@ -7631,8 +7631,8 @@ const { wrapWithFireEvent: kf, getLocalPoint: Mf } = Is, Df = (i, t, e, s) => {
|
|
|
7631
7631
|
e,
|
|
7632
7632
|
s
|
|
7633
7633
|
);
|
|
7634
|
-
if (L(t.originX) === L(ze) || L(t.originX) === L(
|
|
7635
|
-
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a =
|
|
7634
|
+
if (L(t.originX) === L(ze) || L(t.originX) === L(gr) && r.x < 0 || L(t.originX) === L(fr) && r.x > 0) {
|
|
7635
|
+
let { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = pr(t) ? 2 : 1, c = n.width, h = Math.ceil(
|
|
7636
7636
|
Math.abs(r.x * a / n.scaleX) - o
|
|
7637
7637
|
);
|
|
7638
7638
|
if (t.corner === "mr") {
|
|
@@ -7686,7 +7686,7 @@ const { wrapWithFireEvent: kf, getLocalPoint: Mf } = Is, Df = (i, t, e, s) => {
|
|
|
7686
7686
|
Object.assign(this, ts.ownDefaults), this.id = e.id, this.src = e.src, this.display = e.display, this.tScale = e.tScale;
|
|
7687
7687
|
}
|
|
7688
7688
|
static createControls() {
|
|
7689
|
-
return { controls:
|
|
7689
|
+
return { controls: Ps() };
|
|
7690
7690
|
}
|
|
7691
7691
|
static getDefaults() {
|
|
7692
7692
|
return {
|
|
@@ -7725,8 +7725,8 @@ T(ts, "type", "Image"), T(ts, "ownDefaults", {
|
|
|
7725
7725
|
hoverCursor: "default",
|
|
7726
7726
|
fill: "#27272a"
|
|
7727
7727
|
});
|
|
7728
|
-
let
|
|
7729
|
-
C.setClass(
|
|
7728
|
+
let er = ts;
|
|
7729
|
+
C.setClass(er, "Image");
|
|
7730
7730
|
class bt extends z {
|
|
7731
7731
|
constructor(e) {
|
|
7732
7732
|
super(e);
|
|
@@ -7827,7 +7827,7 @@ const ss = class ss extends z {
|
|
|
7827
7827
|
Object.assign(this, ss.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display, this.text = e.text;
|
|
7828
7828
|
}
|
|
7829
7829
|
static createControls() {
|
|
7830
|
-
return { controls:
|
|
7830
|
+
return { controls: Ps() };
|
|
7831
7831
|
}
|
|
7832
7832
|
static getDefaults() {
|
|
7833
7833
|
return {
|
|
@@ -7863,8 +7863,8 @@ T(ss, "type", "Text"), T(ss, "ownDefaults", {
|
|
|
7863
7863
|
borderOpacityWhenMoving: 1,
|
|
7864
7864
|
hoverCursor: "default"
|
|
7865
7865
|
});
|
|
7866
|
-
let
|
|
7867
|
-
C.setClass(
|
|
7866
|
+
let sr = ss;
|
|
7867
|
+
C.setClass(sr, "Text");
|
|
7868
7868
|
const If = {
|
|
7869
7869
|
selectable: !1,
|
|
7870
7870
|
evented: !1,
|
|
@@ -8032,8 +8032,8 @@ T(ns, "type", "Placeholder"), T(ns, "ownDefaults", {
|
|
|
8032
8032
|
strokeDashArray: [5, 1],
|
|
8033
8033
|
evented: !1
|
|
8034
8034
|
});
|
|
8035
|
-
let
|
|
8036
|
-
C.setClass(
|
|
8035
|
+
let rr = ns;
|
|
8036
|
+
C.setClass(rr, "Placeholder");
|
|
8037
8037
|
const os = class os extends z {
|
|
8038
8038
|
constructor(e) {
|
|
8039
8039
|
super(e);
|
|
@@ -8097,7 +8097,7 @@ const as = class as extends z {
|
|
|
8097
8097
|
Object.assign(this, as.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display, this.text = e.text;
|
|
8098
8098
|
}
|
|
8099
8099
|
static createControls() {
|
|
8100
|
-
return { controls:
|
|
8100
|
+
return { controls: Ps() };
|
|
8101
8101
|
}
|
|
8102
8102
|
static getDefaults() {
|
|
8103
8103
|
return {
|
|
@@ -8133,8 +8133,8 @@ T(as, "type", "Caption"), T(as, "ownDefaults", {
|
|
|
8133
8133
|
borderOpacityWhenMoving: 1,
|
|
8134
8134
|
hoverCursor: "default"
|
|
8135
8135
|
});
|
|
8136
|
-
let
|
|
8137
|
-
C.setClass(
|
|
8136
|
+
let ir = as;
|
|
8137
|
+
C.setClass(ir, "Caption");
|
|
8138
8138
|
const cs = class cs extends z {
|
|
8139
8139
|
constructor(e) {
|
|
8140
8140
|
super(e);
|
|
@@ -8182,21 +8182,17 @@ T(cs, "type", "Template"), T(cs, "ownDefaults", {
|
|
|
8182
8182
|
});
|
|
8183
8183
|
let zt = cs;
|
|
8184
8184
|
C.setClass(zt, "Template");
|
|
8185
|
-
function Pf(i) {
|
|
8186
|
-
const t = Math.floor(i / 1e3), e = Math.floor(t / 60), s = t % 60, r = String(e).padStart(2, "0"), n = String(s).padStart(2, "0");
|
|
8187
|
-
return `${r}:${n}`;
|
|
8188
|
-
}
|
|
8189
8185
|
const hs = class hs extends z {
|
|
8190
8186
|
constructor(e) {
|
|
8191
8187
|
super(e);
|
|
8192
|
-
T(this, "
|
|
8193
|
-
T(this, "
|
|
8194
|
-
T(this, "toId");
|
|
8188
|
+
T(this, "itemType", "illustration");
|
|
8189
|
+
T(this, "src");
|
|
8195
8190
|
T(this, "isSelected", !1);
|
|
8196
|
-
T(this, "
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8191
|
+
T(this, "svgString", "");
|
|
8192
|
+
Object.assign(this, hs.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display, this.src = e.src, this.svgString = e.svgString;
|
|
8193
|
+
}
|
|
8194
|
+
static createControls() {
|
|
8195
|
+
return { controls: Ps() };
|
|
8200
8196
|
}
|
|
8201
8197
|
static getDefaults() {
|
|
8202
8198
|
return {
|
|
@@ -8204,96 +8200,51 @@ const hs = class hs extends z {
|
|
|
8204
8200
|
...hs.ownDefaults
|
|
8205
8201
|
};
|
|
8206
8202
|
}
|
|
8203
|
+
setSelected(e) {
|
|
8204
|
+
this.isSelected = e, this.set({ dirty: !0 });
|
|
8205
|
+
}
|
|
8206
|
+
// add custom text to the track item
|
|
8207
8207
|
_render(e) {
|
|
8208
|
-
|
|
8208
|
+
super._render(e), this.updateSelected(e);
|
|
8209
8209
|
}
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
c,
|
|
8219
|
-
h
|
|
8220
|
-
), e.fillStyle = "#f4f4f5", e.fillText(this.name, l + n, a + 14);
|
|
8221
|
-
const d = l + u + o, f = r + n * 2;
|
|
8222
|
-
this.drawRoundedRect(
|
|
8223
|
-
e,
|
|
8224
|
-
d,
|
|
8225
|
-
a,
|
|
8226
|
-
f,
|
|
8227
|
-
c,
|
|
8228
|
-
h
|
|
8229
|
-
), e.fillStyle = "#f4f4f5", e.fillText(this.durationString, d + n, a + 14);
|
|
8210
|
+
updateSelected(e) {
|
|
8211
|
+
this.isSelected && (e.save(), e.beginPath(), e.roundRect(
|
|
8212
|
+
-this.width / 2,
|
|
8213
|
+
-this.height / 2,
|
|
8214
|
+
this.width,
|
|
8215
|
+
this.height,
|
|
8216
|
+
6
|
|
8217
|
+
), e.lineWidth = Mt, e.strokeStyle = vt, e.stroke(), e.restore());
|
|
8230
8218
|
}
|
|
8231
|
-
|
|
8232
|
-
|
|
8219
|
+
setSrc(e) {
|
|
8220
|
+
this.src = e, this.set({ dirty: !0 });
|
|
8233
8221
|
}
|
|
8234
8222
|
};
|
|
8235
|
-
T(hs, "type", "
|
|
8223
|
+
T(hs, "type", "Illustration"), T(hs, "ownDefaults", {
|
|
8224
|
+
rx: 6,
|
|
8225
|
+
ry: 6,
|
|
8236
8226
|
objectCaching: !1,
|
|
8237
8227
|
borderColor: "transparent",
|
|
8238
8228
|
stroke: "transparent",
|
|
8239
8229
|
strokeWidth: 0,
|
|
8230
|
+
fill: "#27272a",
|
|
8240
8231
|
borderOpacityWhenMoving: 1,
|
|
8241
8232
|
hoverCursor: "default",
|
|
8242
|
-
|
|
8243
|
-
ry: 4
|
|
8233
|
+
svgString: ""
|
|
8244
8234
|
});
|
|
8245
|
-
let
|
|
8246
|
-
C.setClass(
|
|
8247
|
-
class Af {
|
|
8248
|
-
constructor() {
|
|
8249
|
-
T(this, "___eventListeners", {});
|
|
8250
|
-
T(this, "___activeObjects", []);
|
|
8251
|
-
}
|
|
8252
|
-
resize(t, { force: e } = { force: !1 }) {
|
|
8253
|
-
var s;
|
|
8254
|
-
this.lowerCanvasEl && (this.setDimensions(t), e && this.renderTracks(), (s = this.onResizeCanvas) == null || s.call(this, {
|
|
8255
|
-
width: this.width,
|
|
8256
|
-
height: this.height
|
|
8257
|
-
}));
|
|
8258
|
-
}
|
|
8259
|
-
pauseEventListeners() {
|
|
8260
|
-
this.___eventListeners = this.__eventListeners, this.__eventListeners = {};
|
|
8261
|
-
const t = this.getActiveObjects();
|
|
8262
|
-
this.discardActiveObject(), this.___activeObjects = t;
|
|
8263
|
-
}
|
|
8264
|
-
resumeEventListeners() {
|
|
8265
|
-
this.__eventListeners = this.___eventListeners, this.___eventListeners = {};
|
|
8266
|
-
const t = this.___activeObjects;
|
|
8267
|
-
if (!t.length)
|
|
8268
|
-
return this.requestRenderAll(), !1;
|
|
8269
|
-
if (t.length === 1)
|
|
8270
|
-
this.setActiveObject(t[0]);
|
|
8271
|
-
else {
|
|
8272
|
-
const e = new Ot(t);
|
|
8273
|
-
this.setActiveObject(e);
|
|
8274
|
-
}
|
|
8275
|
-
this.requestRenderAll();
|
|
8276
|
-
}
|
|
8277
|
-
updateCachingActiveObjects(t) {
|
|
8278
|
-
const e = this.___activeObjects;
|
|
8279
|
-
this.___activeObjects = e.map((s) => {
|
|
8280
|
-
const r = t.find((n) => n.id === s.id);
|
|
8281
|
-
return r || s;
|
|
8282
|
-
});
|
|
8283
|
-
}
|
|
8284
|
-
}
|
|
8285
|
-
function rr(i, t) {
|
|
8286
|
-
return i.map((e) => ({
|
|
8287
|
-
...e,
|
|
8288
|
-
items: e.items.filter((s) => !t.includes(s))
|
|
8289
|
-
}));
|
|
8290
|
-
}
|
|
8235
|
+
let Ts = hs;
|
|
8236
|
+
C.setClass(Ts, "Illustration");
|
|
8291
8237
|
const ls = class ls extends z {
|
|
8292
8238
|
constructor(e) {
|
|
8293
8239
|
super(e);
|
|
8294
|
-
T(this, "itemType", "
|
|
8240
|
+
T(this, "itemType", "shape");
|
|
8241
|
+
T(this, "src");
|
|
8295
8242
|
T(this, "isSelected", !1);
|
|
8296
|
-
|
|
8243
|
+
T(this, "backgroundColorDiv", "#808080");
|
|
8244
|
+
Object.assign(this, ls.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display, this.src = e.src, this.backgroundColorDiv = e.backgroundColorDiv || "#808080";
|
|
8245
|
+
}
|
|
8246
|
+
static createControls() {
|
|
8247
|
+
return { controls: Ps() };
|
|
8297
8248
|
}
|
|
8298
8249
|
static getDefaults() {
|
|
8299
8250
|
return {
|
|
@@ -8301,9 +8252,6 @@ const ls = class ls extends z {
|
|
|
8301
8252
|
...ls.ownDefaults
|
|
8302
8253
|
};
|
|
8303
8254
|
}
|
|
8304
|
-
static createControls() {
|
|
8305
|
-
return { controls: js() };
|
|
8306
|
-
}
|
|
8307
8255
|
setSelected(e) {
|
|
8308
8256
|
this.isSelected = e, this.set({ dirty: !0 });
|
|
8309
8257
|
}
|
|
@@ -8320,8 +8268,11 @@ const ls = class ls extends z {
|
|
|
8320
8268
|
6
|
|
8321
8269
|
), e.lineWidth = Mt, e.strokeStyle = vt, e.stroke(), e.restore());
|
|
8322
8270
|
}
|
|
8271
|
+
setSrc(e) {
|
|
8272
|
+
this.src = e, this.set({ dirty: !0 });
|
|
8273
|
+
}
|
|
8323
8274
|
};
|
|
8324
|
-
T(ls, "type", "
|
|
8275
|
+
T(ls, "type", "Shape"), T(ls, "ownDefaults", {
|
|
8325
8276
|
rx: 6,
|
|
8326
8277
|
ry: 6,
|
|
8327
8278
|
objectCaching: !1,
|
|
@@ -8330,20 +8281,17 @@ T(ls, "type", "Composition"), T(ls, "ownDefaults", {
|
|
|
8330
8281
|
strokeWidth: 0,
|
|
8331
8282
|
fill: "#27272a",
|
|
8332
8283
|
borderOpacityWhenMoving: 1,
|
|
8333
|
-
hoverCursor: "default"
|
|
8284
|
+
hoverCursor: "default",
|
|
8285
|
+
backgroundColordDiv: "#808080"
|
|
8334
8286
|
});
|
|
8335
|
-
let
|
|
8336
|
-
C.setClass(
|
|
8287
|
+
let xs = ls;
|
|
8288
|
+
C.setClass(xs, "Shape");
|
|
8337
8289
|
const us = class us extends z {
|
|
8338
8290
|
constructor(e) {
|
|
8339
8291
|
super(e);
|
|
8340
|
-
T(this, "itemType", "
|
|
8341
|
-
T(this, "src");
|
|
8292
|
+
T(this, "itemType", "composition");
|
|
8342
8293
|
T(this, "isSelected", !1);
|
|
8343
|
-
Object.assign(this, us.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display
|
|
8344
|
-
}
|
|
8345
|
-
static createControls() {
|
|
8346
|
-
return { controls: js() };
|
|
8294
|
+
Object.assign(this, us.ownDefaults), this.id = e.id, this.borderColor = "transparent", this.stroke = "transparent", this.strokeWidth = 0, this.tScale = e.tScale, this.display = e.display;
|
|
8347
8295
|
}
|
|
8348
8296
|
static getDefaults() {
|
|
8349
8297
|
return {
|
|
@@ -8351,6 +8299,9 @@ const us = class us extends z {
|
|
|
8351
8299
|
...us.ownDefaults
|
|
8352
8300
|
};
|
|
8353
8301
|
}
|
|
8302
|
+
static createControls() {
|
|
8303
|
+
return { controls: Ps() };
|
|
8304
|
+
}
|
|
8354
8305
|
setSelected(e) {
|
|
8355
8306
|
this.isSelected = e, this.set({ dirty: !0 });
|
|
8356
8307
|
}
|
|
@@ -8367,11 +8318,8 @@ const us = class us extends z {
|
|
|
8367
8318
|
6
|
|
8368
8319
|
), e.lineWidth = Mt, e.strokeStyle = vt, e.stroke(), e.restore());
|
|
8369
8320
|
}
|
|
8370
|
-
setSrc(e) {
|
|
8371
|
-
this.src = e, this.set({ dirty: !0 });
|
|
8372
|
-
}
|
|
8373
8321
|
};
|
|
8374
|
-
T(us, "type", "
|
|
8322
|
+
T(us, "type", "Composition"), T(us, "ownDefaults", {
|
|
8375
8323
|
rx: 6,
|
|
8376
8324
|
ry: 6,
|
|
8377
8325
|
objectCaching: !1,
|
|
@@ -8382,18 +8330,23 @@ T(us, "type", "Illustration"), T(us, "ownDefaults", {
|
|
|
8382
8330
|
borderOpacityWhenMoving: 1,
|
|
8383
8331
|
hoverCursor: "default"
|
|
8384
8332
|
});
|
|
8385
|
-
let
|
|
8386
|
-
C.setClass(
|
|
8333
|
+
let oi = us;
|
|
8334
|
+
C.setClass(oi, "Composition");
|
|
8335
|
+
function Pf(i) {
|
|
8336
|
+
const t = Math.floor(i / 1e3), e = Math.floor(t / 60), s = t % 60, r = String(e).padStart(2, "0"), n = String(s).padStart(2, "0");
|
|
8337
|
+
return `${r}:${n}`;
|
|
8338
|
+
}
|
|
8387
8339
|
const ds = class ds extends z {
|
|
8388
8340
|
constructor(e) {
|
|
8389
8341
|
super(e);
|
|
8390
|
-
T(this, "
|
|
8391
|
-
T(this, "
|
|
8342
|
+
T(this, "duration");
|
|
8343
|
+
T(this, "fromId");
|
|
8344
|
+
T(this, "toId");
|
|
8392
8345
|
T(this, "isSelected", !1);
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8346
|
+
T(this, "name");
|
|
8347
|
+
T(this, "durationString");
|
|
8348
|
+
T(this, "itemType");
|
|
8349
|
+
Object.assign(this, ds.ownDefaults), this.id = e.id, this.fill = "#27272a", this.name = e.type.toUpperCase(), this.durationString = Pf(e.duration), this.itemType = e.type;
|
|
8397
8350
|
}
|
|
8398
8351
|
static getDefaults() {
|
|
8399
8352
|
return {
|
|
@@ -8401,39 +8354,90 @@ const ds = class ds extends z {
|
|
|
8401
8354
|
...ds.ownDefaults
|
|
8402
8355
|
};
|
|
8403
8356
|
}
|
|
8404
|
-
setSelected(e) {
|
|
8405
|
-
this.isSelected = e, this.set({ dirty: !0 });
|
|
8406
|
-
}
|
|
8407
|
-
// add custom text to the track item
|
|
8408
8357
|
_render(e) {
|
|
8409
|
-
super._render(e), this.
|
|
8358
|
+
e.save(), super._render(e), e.beginPath(), e.rect(-this.width / 2, -this.height / 2, this.width, this.height), e.clip(), this.drawTextIdentity(e), e.restore();
|
|
8410
8359
|
}
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8360
|
+
drawTextIdentity(e) {
|
|
8361
|
+
e.font = "600 12px 'Geist variable'", e.textAlign = "left";
|
|
8362
|
+
const s = e.measureText(this.name).width, r = e.measureText(this.durationString).width, n = 8, o = 4, a = 4 - this.height / 2, c = 20, h = 4, l = 4 - this.width / 2, u = s + n * 2;
|
|
8363
|
+
this.drawRoundedRect(
|
|
8364
|
+
e,
|
|
8365
|
+
l,
|
|
8366
|
+
a,
|
|
8367
|
+
u,
|
|
8368
|
+
c,
|
|
8369
|
+
h
|
|
8370
|
+
), e.fillStyle = "#f4f4f5", e.fillText(this.name, l + n, a + 14);
|
|
8371
|
+
const d = l + u + o, f = r + n * 2;
|
|
8372
|
+
this.drawRoundedRect(
|
|
8373
|
+
e,
|
|
8374
|
+
d,
|
|
8375
|
+
a,
|
|
8376
|
+
f,
|
|
8377
|
+
c,
|
|
8378
|
+
h
|
|
8379
|
+
), e.fillStyle = "#f4f4f5", e.fillText(this.durationString, d + n, a + 14);
|
|
8419
8380
|
}
|
|
8420
|
-
|
|
8421
|
-
|
|
8381
|
+
drawRoundedRect(e, s, r, n, o, a) {
|
|
8382
|
+
e.fillStyle = "rgba(0, 0, 0, 0.5)", e.roundRect ? (e.beginPath(), e.roundRect(s, r, n, o, a), e.fill()) : e.fillRect(s, r, n, o);
|
|
8422
8383
|
}
|
|
8423
8384
|
};
|
|
8424
|
-
T(ds, "type", "
|
|
8425
|
-
rx: 6,
|
|
8426
|
-
ry: 6,
|
|
8385
|
+
T(ds, "type", "PreviewTrackItem"), T(ds, "ownDefaults", {
|
|
8427
8386
|
objectCaching: !1,
|
|
8428
8387
|
borderColor: "transparent",
|
|
8429
8388
|
stroke: "transparent",
|
|
8430
8389
|
strokeWidth: 0,
|
|
8431
|
-
fill: "#27272a",
|
|
8432
8390
|
borderOpacityWhenMoving: 1,
|
|
8433
|
-
hoverCursor: "default"
|
|
8391
|
+
hoverCursor: "default",
|
|
8392
|
+
rx: 4,
|
|
8393
|
+
ry: 4
|
|
8434
8394
|
});
|
|
8435
|
-
let
|
|
8436
|
-
C.setClass(
|
|
8395
|
+
let we = ds;
|
|
8396
|
+
C.setClass(we, "PreviewTrackItem");
|
|
8397
|
+
class Af {
|
|
8398
|
+
constructor() {
|
|
8399
|
+
T(this, "___eventListeners", {});
|
|
8400
|
+
T(this, "___activeObjects", []);
|
|
8401
|
+
}
|
|
8402
|
+
resize(t, { force: e } = { force: !1 }) {
|
|
8403
|
+
var s;
|
|
8404
|
+
this.lowerCanvasEl && (this.setDimensions(t), e && this.renderTracks(), (s = this.onResizeCanvas) == null || s.call(this, {
|
|
8405
|
+
width: this.width,
|
|
8406
|
+
height: this.height
|
|
8407
|
+
}));
|
|
8408
|
+
}
|
|
8409
|
+
pauseEventListeners() {
|
|
8410
|
+
this.___eventListeners = this.__eventListeners, this.__eventListeners = {};
|
|
8411
|
+
const t = this.getActiveObjects();
|
|
8412
|
+
this.discardActiveObject(), this.___activeObjects = t;
|
|
8413
|
+
}
|
|
8414
|
+
resumeEventListeners() {
|
|
8415
|
+
this.__eventListeners = this.___eventListeners, this.___eventListeners = {};
|
|
8416
|
+
const t = this.___activeObjects;
|
|
8417
|
+
if (!t.length)
|
|
8418
|
+
return this.requestRenderAll(), !1;
|
|
8419
|
+
if (t.length === 1)
|
|
8420
|
+
this.setActiveObject(t[0]);
|
|
8421
|
+
else {
|
|
8422
|
+
const e = new Ot(t);
|
|
8423
|
+
this.setActiveObject(e);
|
|
8424
|
+
}
|
|
8425
|
+
this.requestRenderAll();
|
|
8426
|
+
}
|
|
8427
|
+
updateCachingActiveObjects(t) {
|
|
8428
|
+
const e = this.___activeObjects;
|
|
8429
|
+
this.___activeObjects = e.map((s) => {
|
|
8430
|
+
const r = t.find((n) => n.id === s.id);
|
|
8431
|
+
return r || s;
|
|
8432
|
+
});
|
|
8433
|
+
}
|
|
8434
|
+
}
|
|
8435
|
+
function nr(i, t) {
|
|
8436
|
+
return i.map((e) => ({
|
|
8437
|
+
...e,
|
|
8438
|
+
items: e.items.filter((s) => !t.includes(s))
|
|
8439
|
+
}));
|
|
8440
|
+
}
|
|
8437
8441
|
const Lf = (i, t) => {
|
|
8438
8442
|
var a;
|
|
8439
8443
|
const e = I(i.display.from, t.tScale), s = I(
|
|
@@ -8457,7 +8461,7 @@ const Lf = (i, t) => {
|
|
|
8457
8461
|
metadata: i.metadata
|
|
8458
8462
|
});
|
|
8459
8463
|
}, Ff = (i, t) => {
|
|
8460
|
-
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = t.sizesMap.text, o = C.getClass("Text") ||
|
|
8464
|
+
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = t.sizesMap.text, o = C.getClass("Text") || sr;
|
|
8461
8465
|
return new o({
|
|
8462
8466
|
width: r,
|
|
8463
8467
|
height: n,
|
|
@@ -8469,7 +8473,7 @@ const Lf = (i, t) => {
|
|
|
8469
8473
|
tScale: t.tScale
|
|
8470
8474
|
});
|
|
8471
8475
|
}, Rf = (i, t) => {
|
|
8472
|
-
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = t.sizesMap.caption, o = C.getClass("Caption") ||
|
|
8476
|
+
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = t.sizesMap.caption, o = C.getClass("Caption") || ir;
|
|
8473
8477
|
return new o({
|
|
8474
8478
|
width: r,
|
|
8475
8479
|
height: n,
|
|
@@ -8484,7 +8488,7 @@ const Lf = (i, t) => {
|
|
|
8484
8488
|
const e = I(i.display.from, t.tScale), s = I(
|
|
8485
8489
|
i.display.to - (i.display.from || 5e3),
|
|
8486
8490
|
t.tScale
|
|
8487
|
-
), r = t.sizesMap.image, n = C.getClass("Image") ||
|
|
8491
|
+
), r = t.sizesMap.image, n = C.getClass("Image") || er;
|
|
8488
8492
|
return new n({
|
|
8489
8493
|
width: s,
|
|
8490
8494
|
height: r,
|
|
@@ -8527,7 +8531,7 @@ const Lf = (i, t) => {
|
|
|
8527
8531
|
trim: i.trim || i.display
|
|
8528
8532
|
});
|
|
8529
8533
|
}, zf = (i, t) => {
|
|
8530
|
-
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = 32, o = C.getClass("Composition") ||
|
|
8534
|
+
const e = i.display, s = I(e.from, t.tScale), r = I(e.to - e.from, t.tScale), n = 32, o = C.getClass("Composition") || oi;
|
|
8531
8535
|
return new o({
|
|
8532
8536
|
width: r,
|
|
8533
8537
|
height: n,
|
|
@@ -8542,7 +8546,7 @@ const Lf = (i, t) => {
|
|
|
8542
8546
|
const e = I(i.display.from, t.tScale), s = I(
|
|
8543
8547
|
i.display.to - (i.display.from || 5e3),
|
|
8544
8548
|
t.tScale
|
|
8545
|
-
), r = t.sizesMap.illustration, n = C.getClass("Illustration") ||
|
|
8549
|
+
), r = t.sizesMap.illustration, n = C.getClass("Illustration") || Ts;
|
|
8546
8550
|
return new n({
|
|
8547
8551
|
width: s,
|
|
8548
8552
|
height: r,
|
|
@@ -8551,13 +8555,14 @@ const Lf = (i, t) => {
|
|
|
8551
8555
|
tScale: t.tScale,
|
|
8552
8556
|
top: 10,
|
|
8553
8557
|
left: e,
|
|
8554
|
-
display: i.display
|
|
8558
|
+
display: i.display,
|
|
8559
|
+
svgString: i.details.svgString
|
|
8555
8560
|
});
|
|
8556
8561
|
}, Yf = (i, t) => {
|
|
8557
8562
|
const e = I(i.display.from, t.tScale), s = I(
|
|
8558
8563
|
i.display.to - (i.display.from || 5e3),
|
|
8559
8564
|
t.tScale
|
|
8560
|
-
), r = t.sizesMap.shape, n = C.getClass("Shape") ||
|
|
8565
|
+
), r = t.sizesMap.shape, n = C.getClass("Shape") || xs;
|
|
8561
8566
|
return new n({
|
|
8562
8567
|
width: s,
|
|
8563
8568
|
height: r,
|
|
@@ -8566,7 +8571,8 @@ const Lf = (i, t) => {
|
|
|
8566
8571
|
tScale: t.tScale,
|
|
8567
8572
|
top: 10,
|
|
8568
8573
|
left: e,
|
|
8569
|
-
display: i.display
|
|
8574
|
+
display: i.display,
|
|
8575
|
+
backgroundColorDiv: i.details.backgroundColor
|
|
8570
8576
|
});
|
|
8571
8577
|
}, Vf = (i, t) => {
|
|
8572
8578
|
if (i.type === "caption") return Rf(i, t);
|
|
@@ -8581,23 +8587,23 @@ const Lf = (i, t) => {
|
|
|
8581
8587
|
if (i.type === "composition")
|
|
8582
8588
|
return zf(i, t);
|
|
8583
8589
|
};
|
|
8584
|
-
var bh = typeof global == "object" && global && global.Object === Object && global, Gf = typeof self == "object" && self && self.Object === Object && self, Bt = bh || Gf || Function("return this")(), kt = Bt.Symbol, _h = Object.prototype, Nf = _h.hasOwnProperty, Uf = _h.toString,
|
|
8590
|
+
var bh = typeof global == "object" && global && global.Object === Object && global, Gf = typeof self == "object" && self && self.Object === Object && self, Bt = bh || Gf || Function("return this")(), kt = Bt.Symbol, _h = Object.prototype, Nf = _h.hasOwnProperty, Uf = _h.toString, Rs = kt ? kt.toStringTag : void 0;
|
|
8585
8591
|
function $f(i) {
|
|
8586
|
-
var t = Nf.call(i,
|
|
8592
|
+
var t = Nf.call(i, Rs), e = i[Rs];
|
|
8587
8593
|
try {
|
|
8588
|
-
i[
|
|
8594
|
+
i[Rs] = void 0;
|
|
8589
8595
|
var s = !0;
|
|
8590
8596
|
} catch {
|
|
8591
8597
|
}
|
|
8592
8598
|
var r = Uf.call(i);
|
|
8593
|
-
return s && (t ? i[
|
|
8599
|
+
return s && (t ? i[Rs] = e : delete i[Rs]), r;
|
|
8594
8600
|
}
|
|
8595
8601
|
var qf = Object.prototype, Kf = qf.toString;
|
|
8596
8602
|
function Zf(i) {
|
|
8597
8603
|
return Kf.call(i);
|
|
8598
8604
|
}
|
|
8599
8605
|
var Jf = "[object Null]", Qf = "[object Undefined]", Ko = kt ? kt.toStringTag : void 0;
|
|
8600
|
-
function
|
|
8606
|
+
function As(i) {
|
|
8601
8607
|
return i == null ? i === void 0 ? Qf : Jf : Ko && Ko in Object(i) ? $f(i) : Zf(i);
|
|
8602
8608
|
}
|
|
8603
8609
|
function Ce(i) {
|
|
@@ -8605,7 +8611,7 @@ function Ce(i) {
|
|
|
8605
8611
|
}
|
|
8606
8612
|
var tg = "[object Symbol]";
|
|
8607
8613
|
function ki(i) {
|
|
8608
|
-
return typeof i == "symbol" || Ce(i) &&
|
|
8614
|
+
return typeof i == "symbol" || Ce(i) && As(i) == tg;
|
|
8609
8615
|
}
|
|
8610
8616
|
function eg(i, t) {
|
|
8611
8617
|
for (var e = -1, s = i == null ? 0 : i.length, r = Array(s); ++e < s; )
|
|
@@ -8660,7 +8666,7 @@ var ug = "[object AsyncFunction]", dg = "[object Function]", fg = "[object Gener
|
|
|
8660
8666
|
function Th(i) {
|
|
8661
8667
|
if (!Kt(i))
|
|
8662
8668
|
return !1;
|
|
8663
|
-
var t =
|
|
8669
|
+
var t = As(i);
|
|
8664
8670
|
return t == dg || t == fg || t == ug || t == gg;
|
|
8665
8671
|
}
|
|
8666
8672
|
var $i = Bt["__core-js_shared__"], ea = function() {
|
|
@@ -8814,7 +8820,7 @@ function Ng(i, t) {
|
|
|
8814
8820
|
}
|
|
8815
8821
|
var Ug = "[object Arguments]";
|
|
8816
8822
|
function ia(i) {
|
|
8817
|
-
return Ce(i) &&
|
|
8823
|
+
return Ce(i) && As(i) == Ug;
|
|
8818
8824
|
}
|
|
8819
8825
|
var Ch = Object.prototype, $g = Ch.hasOwnProperty, qg = Ch.propertyIsEnumerable, so = ia(/* @__PURE__ */ function() {
|
|
8820
8826
|
return arguments;
|
|
@@ -8828,20 +8834,20 @@ var Oh = typeof exports == "object" && exports && !exports.nodeType && exports,
|
|
|
8828
8834
|
V[gp] = V[pp] = V[mp] = V[vp] = V[yp] = V[bp] = V[_p] = V[Sp] = V[Tp] = !0;
|
|
8829
8835
|
V[Qg] = V[tp] = V[dp] = V[ep] = V[fp] = V[sp] = V[rp] = V[ip] = V[np] = V[op] = V[ap] = V[cp] = V[hp] = V[lp] = V[up] = !1;
|
|
8830
8836
|
function xp(i) {
|
|
8831
|
-
return Ce(i) && eo(i.length) && !!V[
|
|
8837
|
+
return Ce(i) && eo(i.length) && !!V[As(i)];
|
|
8832
8838
|
}
|
|
8833
8839
|
function ro(i) {
|
|
8834
8840
|
return function(t) {
|
|
8835
8841
|
return i(t);
|
|
8836
8842
|
};
|
|
8837
8843
|
}
|
|
8838
|
-
var kh = typeof exports == "object" && exports && !exports.nodeType && exports,
|
|
8844
|
+
var kh = typeof exports == "object" && exports && !exports.nodeType && exports, $s = kh && typeof module == "object" && module && !module.nodeType && module, wp = $s && $s.exports === kh, qi = wp && bh.process, ws = function() {
|
|
8839
8845
|
try {
|
|
8840
|
-
var i =
|
|
8846
|
+
var i = $s && $s.require && $s.require("util").types;
|
|
8841
8847
|
return i || qi && qi.binding && qi.binding("util");
|
|
8842
8848
|
} catch {
|
|
8843
8849
|
}
|
|
8844
|
-
}(), aa =
|
|
8850
|
+
}(), aa = ws && ws.isTypedArray, Mh = aa ? ro(aa) : xp, Cp = Object.prototype, Op = Cp.hasOwnProperty;
|
|
8845
8851
|
function kp(i, t) {
|
|
8846
8852
|
var e = qt(i), s = !e && so(i), r = !e && !s && ci(i), n = !e && !s && !r && Mh(i), o = e || s || r || n, a = o ? Ng(i.length, String) : [], c = a.length;
|
|
8847
8853
|
for (var h in i)
|
|
@@ -8876,9 +8882,9 @@ function Lp(i, t) {
|
|
|
8876
8882
|
var e = typeof i;
|
|
8877
8883
|
return e == "number" || e == "symbol" || e == "boolean" || i == null || ki(i) ? !0 : Ap.test(i) || !Pp.test(i) || t != null && i in Object(t);
|
|
8878
8884
|
}
|
|
8879
|
-
var
|
|
8885
|
+
var or = Ue(Object, "create");
|
|
8880
8886
|
function Fp() {
|
|
8881
|
-
this.__data__ =
|
|
8887
|
+
this.__data__ = or ? or(null) : {}, this.size = 0;
|
|
8882
8888
|
}
|
|
8883
8889
|
function Rp(i) {
|
|
8884
8890
|
var t = this.has(i) && delete this.__data__[i];
|
|
@@ -8887,7 +8893,7 @@ function Rp(i) {
|
|
|
8887
8893
|
var Bp = "__lodash_hash_undefined__", Wp = Object.prototype, Xp = Wp.hasOwnProperty;
|
|
8888
8894
|
function zp(i) {
|
|
8889
8895
|
var t = this.__data__;
|
|
8890
|
-
if (
|
|
8896
|
+
if (or) {
|
|
8891
8897
|
var e = t[i];
|
|
8892
8898
|
return e === Bp ? void 0 : e;
|
|
8893
8899
|
}
|
|
@@ -8896,12 +8902,12 @@ function zp(i) {
|
|
|
8896
8902
|
var Hp = Object.prototype, Yp = Hp.hasOwnProperty;
|
|
8897
8903
|
function Vp(i) {
|
|
8898
8904
|
var t = this.__data__;
|
|
8899
|
-
return
|
|
8905
|
+
return or ? t[i] !== void 0 : Yp.call(t, i);
|
|
8900
8906
|
}
|
|
8901
8907
|
var Gp = "__lodash_hash_undefined__";
|
|
8902
8908
|
function Np(i, t) {
|
|
8903
8909
|
var e = this.__data__;
|
|
8904
|
-
return this.size += this.has(i) ? 0 : 1, e[i] =
|
|
8910
|
+
return this.size += this.has(i) ? 0 : 1, e[i] = or && t === void 0 ? Gp : t, this;
|
|
8905
8911
|
}
|
|
8906
8912
|
function He(i) {
|
|
8907
8913
|
var t = -1, e = i == null ? 0 : i.length;
|
|
@@ -8955,11 +8961,11 @@ de.prototype.delete = Kp;
|
|
|
8955
8961
|
de.prototype.get = Zp;
|
|
8956
8962
|
de.prototype.has = Jp;
|
|
8957
8963
|
de.prototype.set = Qp;
|
|
8958
|
-
var
|
|
8964
|
+
var ar = Ue(Bt, "Map");
|
|
8959
8965
|
function tm() {
|
|
8960
8966
|
this.size = 0, this.__data__ = {
|
|
8961
8967
|
hash: new He(),
|
|
8962
|
-
map: new (
|
|
8968
|
+
map: new (ar || de)(),
|
|
8963
8969
|
string: new He()
|
|
8964
8970
|
};
|
|
8965
8971
|
}
|
|
@@ -9085,7 +9091,7 @@ function xm(i, t) {
|
|
|
9085
9091
|
var e = this.__data__;
|
|
9086
9092
|
if (e instanceof de) {
|
|
9087
9093
|
var s = e.__data__;
|
|
9088
|
-
if (!
|
|
9094
|
+
if (!ar || s.length < Tm - 1)
|
|
9089
9095
|
return s.push([i, t]), this.size = ++e.size, this;
|
|
9090
9096
|
e = this.__data__ = new fe(s);
|
|
9091
9097
|
}
|
|
@@ -9127,9 +9133,9 @@ function jm(i, t, e) {
|
|
|
9127
9133
|
function xn(i) {
|
|
9128
9134
|
return jm(i, Ep, Im);
|
|
9129
9135
|
}
|
|
9130
|
-
var wn = Ue(Bt, "DataView"), Cn = Ue(Bt, "Promise"), On = Ue(Bt, "Set"), da = "[object Map]", Em = "[object Object]", fa = "[object Promise]", ga = "[object Set]", pa = "[object WeakMap]", ma = "[object DataView]", Pm = Ne(wn), Am = Ne(
|
|
9131
|
-
(wn && Et(new wn(new ArrayBuffer(1))) != ma ||
|
|
9132
|
-
var t =
|
|
9136
|
+
var wn = Ue(Bt, "DataView"), Cn = Ue(Bt, "Promise"), On = Ue(Bt, "Set"), da = "[object Map]", Em = "[object Object]", fa = "[object Promise]", ga = "[object Set]", pa = "[object WeakMap]", ma = "[object DataView]", Pm = Ne(wn), Am = Ne(ar), Lm = Ne(Cn), Fm = Ne(On), Rm = Ne(Tn), Et = As;
|
|
9137
|
+
(wn && Et(new wn(new ArrayBuffer(1))) != ma || ar && Et(new ar()) != da || Cn && Et(Cn.resolve()) != fa || On && Et(new On()) != ga || Tn && Et(new Tn()) != pa) && (Et = function(i) {
|
|
9138
|
+
var t = As(i), e = t == Em ? i.constructor : void 0, s = e ? Ne(e) : "";
|
|
9133
9139
|
if (s)
|
|
9134
9140
|
switch (s) {
|
|
9135
9141
|
case Pm:
|
|
@@ -9213,14 +9219,14 @@ var fv = "[object Map]";
|
|
|
9213
9219
|
function gv(i) {
|
|
9214
9220
|
return Ce(i) && Et(i) == fv;
|
|
9215
9221
|
}
|
|
9216
|
-
var ba =
|
|
9222
|
+
var ba = ws && ws.isMap, pv = ba ? ro(ba) : gv, mv = "[object Set]";
|
|
9217
9223
|
function vv(i) {
|
|
9218
9224
|
return Ce(i) && Et(i) == mv;
|
|
9219
9225
|
}
|
|
9220
|
-
var _a =
|
|
9226
|
+
var _a = ws && ws.isSet, yv = _a ? ro(_a) : vv, Eh = "[object Arguments]", bv = "[object Array]", _v = "[object Boolean]", Sv = "[object Date]", Tv = "[object Error]", Ph = "[object Function]", xv = "[object GeneratorFunction]", wv = "[object Map]", Cv = "[object Number]", Ah = "[object Object]", Ov = "[object RegExp]", kv = "[object Set]", Mv = "[object String]", Dv = "[object Symbol]", Iv = "[object WeakMap]", jv = "[object ArrayBuffer]", Ev = "[object DataView]", Pv = "[object Float32Array]", Av = "[object Float64Array]", Lv = "[object Int8Array]", Fv = "[object Int16Array]", Rv = "[object Int32Array]", Bv = "[object Uint8Array]", Wv = "[object Uint8ClampedArray]", Xv = "[object Uint16Array]", zv = "[object Uint32Array]", Y = {};
|
|
9221
9227
|
Y[Eh] = Y[bv] = Y[jv] = Y[Ev] = Y[_v] = Y[Sv] = Y[Pv] = Y[Av] = Y[Lv] = Y[Fv] = Y[Rv] = Y[wv] = Y[Cv] = Y[Ah] = Y[Ov] = Y[kv] = Y[Mv] = Y[Dv] = Y[Bv] = Y[Wv] = Y[Xv] = Y[zv] = !0;
|
|
9222
9228
|
Y[Tv] = Y[Ph] = Y[Iv] = !1;
|
|
9223
|
-
function
|
|
9229
|
+
function Ur(i, t, e, s, r, n) {
|
|
9224
9230
|
var o;
|
|
9225
9231
|
if (o !== void 0)
|
|
9226
9232
|
return o;
|
|
@@ -9246,18 +9252,18 @@ function Gr(i, t, e, s, r, n) {
|
|
|
9246
9252
|
if (l)
|
|
9247
9253
|
return l;
|
|
9248
9254
|
n.set(i, o), yv(i) ? i.forEach(function(f) {
|
|
9249
|
-
o.add(
|
|
9255
|
+
o.add(Ur(f, t, e, f, i, n));
|
|
9250
9256
|
}) : pv(i) && i.forEach(function(f, g) {
|
|
9251
|
-
o.set(g,
|
|
9257
|
+
o.set(g, Ur(f, t, e, g, i, n));
|
|
9252
9258
|
});
|
|
9253
9259
|
var u = xn, d = a ? void 0 : u(i);
|
|
9254
9260
|
return Fg(d || i, function(f, g) {
|
|
9255
|
-
d && (g = f, f = i[g]), xh(o, g,
|
|
9261
|
+
d && (g = f, f = i[g]), xh(o, g, Ur(f, t, e, g, i, n));
|
|
9256
9262
|
}), o;
|
|
9257
9263
|
}
|
|
9258
9264
|
var Hv = 1, Yv = 4;
|
|
9259
9265
|
function Vt(i) {
|
|
9260
|
-
return
|
|
9266
|
+
return Ur(i, Hv | Yv);
|
|
9261
9267
|
}
|
|
9262
9268
|
var Vv = "__lodash_hash_undefined__";
|
|
9263
9269
|
function Gv(i) {
|
|
@@ -9396,11 +9402,11 @@ function my(i, t, e, s, r, n) {
|
|
|
9396
9402
|
}
|
|
9397
9403
|
return n.delete(i), n.delete(t), p;
|
|
9398
9404
|
}
|
|
9399
|
-
var vy = 1, Ta = "[object Arguments]", xa = "[object Array]",
|
|
9405
|
+
var vy = 1, Ta = "[object Arguments]", xa = "[object Array]", Yr = "[object Object]", yy = Object.prototype, wa = yy.hasOwnProperty;
|
|
9400
9406
|
function by(i, t, e, s, r, n) {
|
|
9401
9407
|
var o = qt(i), a = qt(t), c = o ? xa : Et(i), h = a ? xa : Et(t);
|
|
9402
|
-
c = c == Ta ?
|
|
9403
|
-
var l = c ==
|
|
9408
|
+
c = c == Ta ? Yr : c, h = h == Ta ? Yr : h;
|
|
9409
|
+
var l = c == Yr, u = h == Yr, d = c == h;
|
|
9404
9410
|
if (d && ci(i)) {
|
|
9405
9411
|
if (!ci(t))
|
|
9406
9412
|
return !1;
|
|
@@ -9540,7 +9546,7 @@ const Ay = (i, t) => {
|
|
|
9540
9546
|
if (!s.has(r))
|
|
9541
9547
|
return !1;
|
|
9542
9548
|
return !0;
|
|
9543
|
-
},
|
|
9549
|
+
}, Cs = (i) => {
|
|
9544
9550
|
const { trackItemIds: t, transitionsMap: e, trackItemsMap: s } = i, r = /* @__PURE__ */ new Map();
|
|
9545
9551
|
Object.values(e).forEach((c) => {
|
|
9546
9552
|
var u, d;
|
|
@@ -9799,7 +9805,7 @@ class Fy {
|
|
|
9799
9805
|
deleteTrackItemById(t) {
|
|
9800
9806
|
const e = t, s = this.getObjects().filter(
|
|
9801
9807
|
(a) => t.includes(a.id)
|
|
9802
|
-
), r =
|
|
9808
|
+
), r = nr(this.tracks, e), n = {};
|
|
9803
9809
|
Object.keys(this.trackItemsMap).forEach((a) => {
|
|
9804
9810
|
e.includes(a) || (n[a] = this.trackItemsMap[a]);
|
|
9805
9811
|
});
|
|
@@ -9811,7 +9817,7 @@ class Fy {
|
|
|
9811
9817
|
deleteActiveTrackItem() {
|
|
9812
9818
|
const t = this.getActiveObjects();
|
|
9813
9819
|
if (!t.length) return !1;
|
|
9814
|
-
const e = t.map((o) => o.id), s =
|
|
9820
|
+
const e = t.map((o) => o.id), s = nr(this.tracks, e), r = {};
|
|
9815
9821
|
Object.keys(this.trackItemsMap).forEach((o) => {
|
|
9816
9822
|
e.includes(o) || (r[o] = this.trackItemsMap[o]);
|
|
9817
9823
|
});
|
|
@@ -9904,7 +9910,7 @@ class Fy {
|
|
|
9904
9910
|
this.transitionsMap,
|
|
9905
9911
|
this.positionAfterTransform,
|
|
9906
9912
|
t
|
|
9907
|
-
), c =
|
|
9913
|
+
), c = Cs({
|
|
9908
9914
|
trackItemIds: this.trackItemIds,
|
|
9909
9915
|
transitionsMap: a,
|
|
9910
9916
|
trackItemsMap: this.trackItemsMap
|
|
@@ -10015,7 +10021,7 @@ class Ry {
|
|
|
10015
10021
|
return n.items.push(t.id), e;
|
|
10016
10022
|
}
|
|
10017
10023
|
const r = {
|
|
10018
|
-
id:
|
|
10024
|
+
id: mr(),
|
|
10019
10025
|
items: [t.id],
|
|
10020
10026
|
type: t.type,
|
|
10021
10027
|
accepts: this.acceptsMap[t.type],
|
|
@@ -10207,11 +10213,11 @@ function By(i) {
|
|
|
10207
10213
|
function Wy(i) {
|
|
10208
10214
|
i.off("object:resizing", Rh.bind(i));
|
|
10209
10215
|
}
|
|
10210
|
-
const
|
|
10216
|
+
const qs = 100, Ji = 0, Vr = 5, Oa = 3, Xy = 25, ms = {
|
|
10211
10217
|
scrollInterval: null
|
|
10212
10218
|
};
|
|
10213
10219
|
function ka(i) {
|
|
10214
|
-
const t = Xy - Oa, e = (
|
|
10220
|
+
const t = Xy - Oa, e = (qs - i) / qs;
|
|
10215
10221
|
return Oa + t * e;
|
|
10216
10222
|
}
|
|
10217
10223
|
function zy(i, t) {
|
|
@@ -10219,15 +10225,15 @@ function zy(i, t) {
|
|
|
10219
10225
|
const e = t.target, s = e.getBoundingRect();
|
|
10220
10226
|
ms.scrollInterval = setInterval(() => {
|
|
10221
10227
|
const r = i.viewportTransform, n = i.getViewportPoint(t.e);
|
|
10222
|
-
if (n.x > i.width -
|
|
10228
|
+
if (n.x > i.width - qs && e.left + s.width < i.bounding.width) {
|
|
10223
10229
|
const o = ka(i.width - n.x);
|
|
10224
10230
|
e.set("left", e.left + o), i.setViewportPos(r[4] - o, r[5]);
|
|
10225
10231
|
}
|
|
10226
|
-
if (n.x <
|
|
10232
|
+
if (n.x < qs && e.left > 0 && r[4] < qs) {
|
|
10227
10233
|
const o = ka(n.x);
|
|
10228
10234
|
e.set("left", e.left - o), i.setViewportPos(r[4] + o, r[5]);
|
|
10229
10235
|
}
|
|
10230
|
-
n.y > i.height - Ji && e.top + s.height < i.bounding.height + 80 && (e.set("top", e.top +
|
|
10236
|
+
n.y > i.height - Ji && e.top + s.height < i.bounding.height + 80 && (e.set("top", e.top + Vr), i.setViewportPos(r[4], r[5] - Vr)), n.y < Ji && e.top > -80 && -r[5] > Ji && (e.set("top", e.top - Vr), i.setViewportPos(r[4], r[5] + Vr)), e.setCoords(), i.requestRenderAll();
|
|
10231
10237
|
}, 16);
|
|
10232
10238
|
}
|
|
10233
10239
|
function Hy() {
|
|
@@ -10576,7 +10582,7 @@ function Jh(i) {
|
|
|
10576
10582
|
top: d.top,
|
|
10577
10583
|
left: d.left
|
|
10578
10584
|
};
|
|
10579
|
-
const f = new
|
|
10585
|
+
const f = new rr({
|
|
10580
10586
|
id: `${u.id}-placeholder`,
|
|
10581
10587
|
left: d.left,
|
|
10582
10588
|
top: d.top,
|
|
@@ -10659,7 +10665,7 @@ T(fs, "type", "TransitionGuide"), T(fs, "ownDefaults", {
|
|
|
10659
10665
|
rx: 8,
|
|
10660
10666
|
ry: 8
|
|
10661
10667
|
});
|
|
10662
|
-
let
|
|
10668
|
+
let cr = fs;
|
|
10663
10669
|
const e0 = [
|
|
10664
10670
|
"text",
|
|
10665
10671
|
"image",
|
|
@@ -10804,7 +10810,7 @@ const h0 = (i, t) => {
|
|
|
10804
10810
|
c.push(g);
|
|
10805
10811
|
}), e.placeholderMovingObjects.forEach((d, f) => {
|
|
10806
10812
|
const g = d.draggedObject;
|
|
10807
|
-
if (g instanceof
|
|
10813
|
+
if (g instanceof cr) {
|
|
10808
10814
|
d.visible = !1;
|
|
10809
10815
|
return;
|
|
10810
10816
|
}
|
|
@@ -11040,7 +11046,7 @@ const S0 = (i) => {
|
|
|
11040
11046
|
"caption",
|
|
11041
11047
|
"text"
|
|
11042
11048
|
];
|
|
11043
|
-
let et,
|
|
11049
|
+
let et, zs, Os = [];
|
|
11044
11050
|
function j0(i, t) {
|
|
11045
11051
|
let e = 1 / 0, s = null;
|
|
11046
11052
|
const r = new _(i.x, i.y);
|
|
@@ -11061,7 +11067,7 @@ const E0 = ({
|
|
|
11061
11067
|
duration: o
|
|
11062
11068
|
}) => {
|
|
11063
11069
|
if (n === "transition")
|
|
11064
|
-
return new
|
|
11070
|
+
return new cr({
|
|
11065
11071
|
top: 0,
|
|
11066
11072
|
left: 0,
|
|
11067
11073
|
height: 48,
|
|
@@ -11096,7 +11102,7 @@ function cl(i) {
|
|
|
11096
11102
|
top: 0,
|
|
11097
11103
|
type: s,
|
|
11098
11104
|
duration: r
|
|
11099
|
-
}), et.visible = !1, s === "transition" && (
|
|
11105
|
+
}), et.visible = !1, s === "transition" && (Os = n.getObjects("Transition"), Os.forEach((g) => {
|
|
11100
11106
|
g.visible = !0;
|
|
11101
11107
|
}));
|
|
11102
11108
|
const c = Q();
|
|
@@ -11127,7 +11133,7 @@ function cl(i) {
|
|
|
11127
11133
|
top: p.top,
|
|
11128
11134
|
left: p.left
|
|
11129
11135
|
};
|
|
11130
|
-
const m = new
|
|
11136
|
+
const m = new rr({
|
|
11131
11137
|
id: `${g.id}-placeholder`,
|
|
11132
11138
|
left: p.left,
|
|
11133
11139
|
top: p.top,
|
|
@@ -11145,7 +11151,7 @@ function ll() {
|
|
|
11145
11151
|
if (hl(this), ct({ draggingOverTrack: null, isPointerOverHelperTrack: !1 }), !et) return;
|
|
11146
11152
|
se(ol);
|
|
11147
11153
|
const i = this;
|
|
11148
|
-
|
|
11154
|
+
Os.forEach((t) => {
|
|
11149
11155
|
t.strokeDashArray = [], t.setSelected(!1), t.kind === "none" && (t.visible = !1);
|
|
11150
11156
|
}), i.getObjects("Helper", "Track").forEach((t) => {
|
|
11151
11157
|
t.setSelected && t.setSelected(!1);
|
|
@@ -11153,15 +11159,15 @@ function ll() {
|
|
|
11153
11159
|
}
|
|
11154
11160
|
function ul(i) {
|
|
11155
11161
|
const t = Q(), e = t.placeholderMovingObjects[0];
|
|
11156
|
-
if (e.visible || (et.visible = !0, e.visible = !0), t.activeObjects[0] instanceof
|
|
11162
|
+
if (e.visible || (et.visible = !0, e.visible = !0), t.activeObjects[0] instanceof cr && (e.visible = !1), !et) return !1;
|
|
11157
11163
|
i.e.preventDefault();
|
|
11158
11164
|
const s = this, r = s.getViewportPoint(i.e), n = [...this.viewportTransform];
|
|
11159
11165
|
et.set({
|
|
11160
11166
|
left: r.x - 16 - n[4],
|
|
11161
11167
|
top: r.y - n[5] - et.height / 2
|
|
11162
11168
|
});
|
|
11163
|
-
const o = j0(r,
|
|
11164
|
-
o && (
|
|
11169
|
+
const o = j0(r, Os);
|
|
11170
|
+
o && (zs = o, o.strokeDashArray = [5, 1], o.setSelected(!0)), Os.forEach((c) => {
|
|
11165
11171
|
c !== o && c.setSelected(!1);
|
|
11166
11172
|
}), ct({ isDragOver: !0 }), et.setCoords();
|
|
11167
11173
|
const a = {
|
|
@@ -11195,36 +11201,36 @@ function dl(i) {
|
|
|
11195
11201
|
const l = Qi(s, this.getObjects("Track"));
|
|
11196
11202
|
if (s.magnetic) {
|
|
11197
11203
|
const u = e.initialTrackPoints[e.initialTrackPoints.length - 1], d = G(u, t.tScale);
|
|
11198
|
-
|
|
11199
|
-
} else
|
|
11204
|
+
Gr(n, l, d);
|
|
11205
|
+
} else Gr(n, l, c);
|
|
11200
11206
|
} else {
|
|
11201
11207
|
const l = i.viewportPoint, u = [...t.viewportTransform], d = l.y - u[5], g = t.getObjects("Helper").reduce(
|
|
11202
11208
|
(m, b) => Math.abs(b.top - d) < Math.abs(m.top - d) ? b : m
|
|
11203
11209
|
), p = Qi(g, this.getObjects("Track"));
|
|
11204
|
-
|
|
11210
|
+
Gr(n, p, c, !0);
|
|
11205
11211
|
}
|
|
11206
11212
|
else {
|
|
11207
11213
|
const h = Qi(
|
|
11208
11214
|
s,
|
|
11209
11215
|
this.getObjects("Track")
|
|
11210
11216
|
);
|
|
11211
|
-
|
|
11217
|
+
Gr(n, h, c, !0);
|
|
11212
11218
|
}
|
|
11213
11219
|
this.remove(a), this.requestRenderAll();
|
|
11214
11220
|
return;
|
|
11215
11221
|
}
|
|
11216
11222
|
if (et) {
|
|
11217
|
-
if (
|
|
11218
|
-
const a =
|
|
11223
|
+
if (zs) {
|
|
11224
|
+
const a = zs.id, c = jy(n, ["kind", "direction"]);
|
|
11219
11225
|
Object.keys(c).forEach((S) => {
|
|
11220
|
-
S === "kind" ?
|
|
11226
|
+
S === "kind" ? zs.kind = c[S] : zs[S] = c[S];
|
|
11221
11227
|
});
|
|
11222
11228
|
const h = Vt(this.trackItemIds), l = Vt(this.transitionsMap), u = Vt(this.trackItemsMap);
|
|
11223
11229
|
l[a] = {
|
|
11224
11230
|
...l[a],
|
|
11225
11231
|
...c
|
|
11226
11232
|
};
|
|
11227
|
-
const d =
|
|
11233
|
+
const d = Cs({
|
|
11228
11234
|
trackItemIds: h,
|
|
11229
11235
|
transitionsMap: l,
|
|
11230
11236
|
trackItemsMap: u
|
|
@@ -11237,13 +11243,13 @@ function dl(i) {
|
|
|
11237
11243
|
this.trackItemsMap = b, this.transitionsMap[a] = {
|
|
11238
11244
|
...this.transitionsMap[a],
|
|
11239
11245
|
...c
|
|
11240
|
-
}, this.transitionGroups =
|
|
11246
|
+
}, this.transitionGroups = Cs({
|
|
11241
11247
|
trackItemIds: this.trackItemIds,
|
|
11242
11248
|
transitionsMap: this.transitionsMap,
|
|
11243
11249
|
trackItemsMap: this.trackItemsMap
|
|
11244
11250
|
}), this.updateTrackItemCoords(), this.adjustMagneticTrack(), this.calcBounding(), this.updateTransitions(), this.refreshTrackLayout(), this.updateState({ kind: "add:transition", updateHistory: !0 });
|
|
11245
11251
|
}
|
|
11246
|
-
|
|
11252
|
+
Os.forEach((a) => {
|
|
11247
11253
|
a.strokeDashArray = [], a.setSelected(!1), a.kind === "none" && (a.visible = !1);
|
|
11248
11254
|
}), t.remove(et), t.requestRenderAll(), se(ol);
|
|
11249
11255
|
}
|
|
@@ -11279,32 +11285,32 @@ const P0 = (i) => {
|
|
|
11279
11285
|
const h = Math.abs(a.top - r), l = Math.abs(e[o].top - r);
|
|
11280
11286
|
return h < l ? c : o;
|
|
11281
11287
|
}, 0);
|
|
11282
|
-
},
|
|
11288
|
+
}, Gr = (i, t, e, s) => {
|
|
11283
11289
|
i.type === "image" ? se(M0, {
|
|
11284
11290
|
payload: {
|
|
11285
11291
|
...i,
|
|
11286
|
-
id:
|
|
11292
|
+
id: Xs(),
|
|
11287
11293
|
display: { from: e }
|
|
11288
11294
|
},
|
|
11289
11295
|
options: { trackIndex: t, isNewTrack: s }
|
|
11290
11296
|
}) : i.type === "video" ? se(k0, {
|
|
11291
11297
|
payload: {
|
|
11292
11298
|
...i,
|
|
11293
|
-
id:
|
|
11299
|
+
id: Xs(),
|
|
11294
11300
|
display: { from: e }
|
|
11295
11301
|
},
|
|
11296
11302
|
options: { trackIndex: t, isNewTrack: s }
|
|
11297
11303
|
}) : i.type === "audio" ? se(O0, {
|
|
11298
11304
|
payload: {
|
|
11299
11305
|
...i,
|
|
11300
|
-
id:
|
|
11306
|
+
id: Xs(),
|
|
11301
11307
|
display: { from: e }
|
|
11302
11308
|
},
|
|
11303
11309
|
options: { trackIndex: t, isNewTrack: s }
|
|
11304
11310
|
}) : i.type === "text" && se(D0, {
|
|
11305
11311
|
payload: {
|
|
11306
11312
|
...i,
|
|
11307
|
-
id:
|
|
11313
|
+
id: Xs(),
|
|
11308
11314
|
display: { from: e }
|
|
11309
11315
|
},
|
|
11310
11316
|
options: { trackIndex: t, isNewTrack: s }
|
|
@@ -11539,7 +11545,7 @@ class N0 {
|
|
|
11539
11545
|
}
|
|
11540
11546
|
}), this.transitionIds = n, this.transitionsMap = r, this.renderTransitions();
|
|
11541
11547
|
const o = this.getObjects("Transition");
|
|
11542
|
-
this.updateCachingActiveObjects(o), this.transitionGroups =
|
|
11548
|
+
this.updateCachingActiveObjects(o), this.transitionGroups = Cs({
|
|
11543
11549
|
trackItemIds: this.trackItemIds,
|
|
11544
11550
|
transitionsMap: this.transitionsMap,
|
|
11545
11551
|
trackItemsMap: this.trackItemsMap
|
|
@@ -11550,14 +11556,14 @@ function wl(i) {
|
|
|
11550
11556
|
const { secondaryTracks: t, primaryTracks: e, primaryPositions: s } = i, { positions: r, trackIndex: n } = s, o = n === -1 ? this.tracks.length : n, [a] = Object.keys(e), c = this.tracks.find(
|
|
11551
11557
|
(p) => p.id === a
|
|
11552
11558
|
), h = e[a], l = {
|
|
11553
|
-
id:
|
|
11559
|
+
id: Xs(),
|
|
11554
11560
|
items: h.objects.map((p) => p.id),
|
|
11555
11561
|
type: c.type,
|
|
11556
11562
|
accepts: c.accepts
|
|
11557
11563
|
}, u = oo(
|
|
11558
11564
|
Object.keys(t).map((p) => t[p].objects.map((m) => m.id))
|
|
11559
11565
|
);
|
|
11560
|
-
let d =
|
|
11566
|
+
let d = nr(this.tracks, [
|
|
11561
11567
|
...Object.keys(r),
|
|
11562
11568
|
...u
|
|
11563
11569
|
]);
|
|
@@ -11566,7 +11572,7 @@ function wl(i) {
|
|
|
11566
11572
|
const { objects: m, index: b } = t[p], S = this.tracks.find(
|
|
11567
11573
|
(O) => O.id === p
|
|
11568
11574
|
), w = m.map((O) => O.id).filter((O) => !this.transitionIds.includes(O)), k = {
|
|
11569
|
-
id:
|
|
11575
|
+
id: mr(),
|
|
11570
11576
|
items: w,
|
|
11571
11577
|
type: S.type,
|
|
11572
11578
|
accepts: S.accepts,
|
|
@@ -11590,7 +11596,7 @@ function Cl(i) {
|
|
|
11590
11596
|
const u = this.tracks.findIndex((b) => b.id === n), d = oo(
|
|
11591
11597
|
Object.keys(e).map((b) => e[b].objects.map((S) => S.id))
|
|
11592
11598
|
);
|
|
11593
|
-
let f =
|
|
11599
|
+
let f = nr(this.tracks, [
|
|
11594
11600
|
...Object.keys(o),
|
|
11595
11601
|
...d
|
|
11596
11602
|
]);
|
|
@@ -11610,7 +11616,7 @@ function Cl(i) {
|
|
|
11610
11616
|
const { objects: S, index: w } = e[b], k = S.filter((D) => D.type !== "transition").map((D) => D.id), [O] = k, x = this.trackItemsMap[O];
|
|
11611
11617
|
if (t && x) {
|
|
11612
11618
|
const D = {
|
|
11613
|
-
id:
|
|
11619
|
+
id: mr(),
|
|
11614
11620
|
items: k,
|
|
11615
11621
|
type: x.type,
|
|
11616
11622
|
accepts: this.acceptsMap[x.type],
|
|
@@ -11638,8 +11644,8 @@ function Ol({
|
|
|
11638
11644
|
(n) => n.items.includes(e)
|
|
11639
11645
|
);
|
|
11640
11646
|
if (t) {
|
|
11641
|
-
const n =
|
|
11642
|
-
id:
|
|
11647
|
+
const n = nr(this.tracks, i), o = {
|
|
11648
|
+
id: mr(),
|
|
11643
11649
|
items: [e],
|
|
11644
11650
|
type: r.type,
|
|
11645
11651
|
accepts: r.accepts
|
|
@@ -11788,10 +11794,10 @@ const sb = (i) => {
|
|
|
11788
11794
|
e.forEach((o) => {
|
|
11789
11795
|
const a = r[o.id];
|
|
11790
11796
|
if (a)
|
|
11791
|
-
if (o instanceof bt || o instanceof
|
|
11792
|
-
if (a.type === "video" || a.type === "image" || a.type === "audio") {
|
|
11797
|
+
if (o instanceof bt || o instanceof er || o instanceof ft || o instanceof xs || o instanceof Ts) {
|
|
11798
|
+
if (a.type === "video" || a.type === "image" || a.type === "audio" || a.type === "shape" || a.type === "illustration") {
|
|
11793
11799
|
const c = n[o.id];
|
|
11794
|
-
if (o.src !== a.details.src && o.setSrc && o.setSrc(a.details.src), a.type === "video" || a.type === "audio") {
|
|
11800
|
+
if (o.src !== a.details.src && o.setSrc && o.setSrc(a.details.src), o instanceof xs && a.type === "shape" && o.backgroundColorDiv !== a.details.backgroundColor && (o.backgroundColorDiv = a.details.backgroundColor, o.setSrc(a.details.src)), o instanceof Ts && a.type === "illustration" && (o.svgString = a.details.svgString, o.setSrc(a.details.src)), a.type === "video" || a.type === "audio") {
|
|
11795
11801
|
const l = c.display.to - c.display.from, u = I(
|
|
11796
11802
|
l,
|
|
11797
11803
|
i.scale.zoom,
|
|
@@ -11805,10 +11811,10 @@ const sb = (i) => {
|
|
|
11805
11811
|
}), o.setCoords();
|
|
11806
11812
|
}
|
|
11807
11813
|
}
|
|
11808
|
-
} else (o instanceof
|
|
11814
|
+
} else (o instanceof sr || o instanceof ir) && (a.type === "text" || a.type === "caption") && o.set({ text: a.details.text });
|
|
11809
11815
|
}), i.requestRenderAll();
|
|
11810
11816
|
}), Il = i.state.subscribeToHistory((t) => {
|
|
11811
|
-
i.tracks = t.tracks, i.trackItemsMap = t.trackItemsMap, i.trackItemIds = t.trackItemIds, i.trackItemDetailsMap = t.trackItemDetailsMap, i.transitionIds = t.transitionIds, i.transitionsMap = t.transitionsMap, i.transitionGroups =
|
|
11817
|
+
i.tracks = t.tracks, i.trackItemsMap = t.trackItemsMap, i.trackItemIds = t.trackItemIds, i.trackItemDetailsMap = t.trackItemDetailsMap, i.transitionIds = t.transitionIds, i.transitionsMap = t.transitionsMap, i.transitionGroups = Cs({
|
|
11812
11818
|
trackItemIds: i.trackItemIds,
|
|
11813
11819
|
transitionsMap: i.transitionsMap,
|
|
11814
11820
|
trackItemsMap: i.trackItemsMap
|
|
@@ -11827,7 +11833,7 @@ const sb = (i) => {
|
|
|
11827
11833
|
};
|
|
11828
11834
|
i.addTrackItem(a);
|
|
11829
11835
|
}
|
|
11830
|
-
}), i.trackItemIds = e.trackItemIds, i.activeIds = e.activeIds, i.transitionGroups =
|
|
11836
|
+
}), i.trackItemIds = e.trackItemIds, i.activeIds = e.activeIds, i.transitionGroups = Cs({
|
|
11831
11837
|
trackItemIds: i.trackItemIds,
|
|
11832
11838
|
transitionsMap: i.transitionsMap,
|
|
11833
11839
|
trackItemsMap: i.trackItemsMap
|
|
@@ -12181,45 +12187,48 @@ export {
|
|
|
12181
12187
|
ft as Audio,
|
|
12182
12188
|
hb as BOTTOM,
|
|
12183
12189
|
ze as CENTER,
|
|
12184
|
-
|
|
12190
|
+
ir as Caption,
|
|
12191
|
+
oi as Composition,
|
|
12185
12192
|
$ as Control,
|
|
12186
12193
|
ol as DRAG_END,
|
|
12187
12194
|
nl as DRAG_PREFIX,
|
|
12188
12195
|
x0 as DRAG_START,
|
|
12189
12196
|
ot as FabricObject,
|
|
12190
12197
|
Ss as Helper,
|
|
12191
|
-
|
|
12192
|
-
|
|
12198
|
+
Ts as Illustration,
|
|
12199
|
+
er as Image,
|
|
12200
|
+
fr as LEFT,
|
|
12193
12201
|
lb as NONE,
|
|
12194
12202
|
zi as Pattern,
|
|
12195
|
-
|
|
12203
|
+
rr as Placeholder,
|
|
12196
12204
|
we as PreviewTrackItem,
|
|
12197
|
-
|
|
12205
|
+
gr as RIGHT,
|
|
12198
12206
|
z as Rect,
|
|
12199
12207
|
J0 as SIZES_MAP,
|
|
12208
|
+
xs as Shape,
|
|
12200
12209
|
w0 as TIMELINE_BOUNDING_CHANGED,
|
|
12201
12210
|
al as TIMELINE_PREFIX,
|
|
12202
12211
|
C0 as TIMELINE_SEEK,
|
|
12203
12212
|
cb as TOP,
|
|
12204
12213
|
zt as Template,
|
|
12205
|
-
|
|
12214
|
+
sr as Text,
|
|
12206
12215
|
he as Track,
|
|
12207
12216
|
$t as Transition,
|
|
12208
12217
|
bt as Video,
|
|
12209
12218
|
ub as calculateTimelineWidth,
|
|
12210
12219
|
bn as changeWidth,
|
|
12211
12220
|
C as classRegistry,
|
|
12212
|
-
|
|
12221
|
+
Es as controlsUtils,
|
|
12213
12222
|
wf as createAudioControls,
|
|
12214
12223
|
Cf as createMediaControls,
|
|
12215
|
-
|
|
12224
|
+
Ps as createResizeControls,
|
|
12216
12225
|
xf as createTemplateControls,
|
|
12217
12226
|
yh as createTransitionControls,
|
|
12218
12227
|
nb as default,
|
|
12219
12228
|
Nt as drawVerticalLine,
|
|
12220
|
-
|
|
12229
|
+
Xs as generateId,
|
|
12221
12230
|
vh as getDuration,
|
|
12222
|
-
|
|
12231
|
+
pr as isTransformCentered,
|
|
12223
12232
|
db as resize,
|
|
12224
12233
|
L as resolveOrigin,
|
|
12225
12234
|
I as timeMsToUnits,
|