@codingfactory/mediables-vue 2.3.3 → 2.3.4
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/{PixiFrameExporter-w_UZwFZG.js → PixiFrameExporter-B6w9IirP.js} +2 -2
- package/dist/{PixiFrameExporter-w_UZwFZG.js.map → PixiFrameExporter-B6w9IirP.js.map} +1 -1
- package/dist/{PixiFrameExporter-BKFYai9I.cjs → PixiFrameExporter-BRm0MI7V.cjs} +2 -2
- package/dist/{PixiFrameExporter-BKFYai9I.cjs.map → PixiFrameExporter-BRm0MI7V.cjs.map} +1 -1
- package/dist/editor-DhRuADQT.cjs +42 -0
- package/dist/editor-DhRuADQT.cjs.map +1 -0
- package/dist/{editor-DJXRx8vN.js → editor-DrTmgu3R.js} +359 -365
- package/dist/editor-DrTmgu3R.js.map +1 -0
- package/dist/{index-BSiVRjOF.cjs → index-BBpOpdLI.cjs} +3 -3
- package/dist/{index-BSiVRjOF.cjs.map → index-BBpOpdLI.cjs.map} +1 -1
- package/dist/{index-j6fnH8-G.js → index-CPwV2mtc.js} +3 -3
- package/dist/{index-j6fnH8-G.js.map → index-CPwV2mtc.js.map} +1 -1
- package/dist/mediables-vanilla.cjs +1 -1
- package/dist/mediables-vanilla.mjs +1 -1
- package/dist/mediables-vue.cjs +1 -1
- package/dist/mediables-vue.mjs +2 -2
- package/package.json +1 -1
- package/dist/editor-DAx1zj7y.cjs +0 -42
- package/dist/editor-DAx1zj7y.cjs.map +0 -1
- package/dist/editor-DJXRx8vN.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var be = (s, e, t) => e in s ? ge(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var V = (s, e, t) => be(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as g from "pixi-filters";
|
|
5
5
|
import * as w from "pixi.js";
|
|
6
|
-
import { GlProgram as
|
|
7
|
-
class
|
|
6
|
+
import { GlProgram as ye } from "pixi.js";
|
|
7
|
+
class O {
|
|
8
8
|
constructor() {
|
|
9
9
|
this._events = /* @__PURE__ */ new Map();
|
|
10
10
|
}
|
|
@@ -34,7 +34,7 @@ class B {
|
|
|
34
34
|
e ? this._events.delete(e) : this._events.clear();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class _e extends O {
|
|
38
38
|
constructor() {
|
|
39
39
|
super(), this._state = {
|
|
40
40
|
// Image state
|
|
@@ -160,10 +160,10 @@ class ye extends B {
|
|
|
160
160
|
this.set("isDarkMode", this._state.theme === "dark");
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return new
|
|
163
|
+
function xe() {
|
|
164
|
+
return new _e();
|
|
165
165
|
}
|
|
166
|
-
class
|
|
166
|
+
class Ce extends O {
|
|
167
167
|
constructor() {
|
|
168
168
|
super(), this.app = null, this.sprite = null, this.originalTexture = null, this.baseTexture = null, this.fitScale = 1, this.zoom = 1, this._container = null, this._mountPromise = null;
|
|
169
169
|
}
|
|
@@ -284,47 +284,41 @@ class xe extends B {
|
|
|
284
284
|
* @returns {string|null} Data URL
|
|
285
285
|
*/
|
|
286
286
|
exportImage(e = "png", t = 0.92, i = 0, r = !0) {
|
|
287
|
-
var
|
|
288
|
-
if (!((
|
|
287
|
+
var _;
|
|
288
|
+
if (!((_ = this.app) != null && _.renderer) || !this.originalTexture || !this.sprite)
|
|
289
289
|
return null;
|
|
290
290
|
const a = window.PIXI, o = Math.round(this.originalTexture.width), n = Math.round(this.originalTexture.height);
|
|
291
291
|
if (o <= 0 || n <= 0)
|
|
292
292
|
return null;
|
|
293
293
|
let l = o, c = n;
|
|
294
294
|
if (i > 0) {
|
|
295
|
-
const
|
|
296
|
-
let
|
|
297
|
-
r && (
|
|
298
|
-
}
|
|
299
|
-
const d = new a.Container(), h = new a.Sprite(this.originalTexture);
|
|
300
|
-
if (h.scale.set(l / o, c / n), (_ = (b = this.sprite) == null ? void 0 : b.filters) != null && _.length) {
|
|
301
|
-
const x = this.sprite.filters.map(
|
|
302
|
-
(y) => typeof (y == null ? void 0 : y.clone) == "function" ? y.clone() : y
|
|
303
|
-
);
|
|
304
|
-
h.filters = x;
|
|
295
|
+
const A = Math.max(o, n);
|
|
296
|
+
let S = i / A;
|
|
297
|
+
r && (S = Math.min(1, S)), l = Math.round(o * S), c = Math.round(n * S);
|
|
305
298
|
}
|
|
306
|
-
d.
|
|
307
|
-
let
|
|
299
|
+
const d = this.sprite, h = d.parent, p = h ? h.getChildIndex(d) : 0, m = d.x, C = d.y, b = d.scale.x, y = d.scale.y;
|
|
300
|
+
let v = null;
|
|
308
301
|
try {
|
|
309
|
-
|
|
302
|
+
const A = new a.Container();
|
|
303
|
+
if (A.addChild(d), d.x = 0, d.y = 0, d.scale.set(l / o, c / n), v = a.RenderTexture.create({ width: l, height: c }), this.app.renderer.render({ container: A, target: v }), !this.app.renderer.extract)
|
|
310
304
|
return null;
|
|
311
|
-
const
|
|
312
|
-
if (!
|
|
305
|
+
const S = this.app.renderer.extract.canvas(v);
|
|
306
|
+
if (!S)
|
|
313
307
|
return null;
|
|
314
|
-
let
|
|
315
|
-
if (typeof
|
|
316
|
-
|
|
317
|
-
else if (typeof
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
|
|
308
|
+
let Y = null;
|
|
309
|
+
if (typeof S.toDataURL == "function")
|
|
310
|
+
Y = S.toDataURL(`image/${e}`, t);
|
|
311
|
+
else if (typeof S.getContext == "function") {
|
|
312
|
+
const k = document.createElement("canvas");
|
|
313
|
+
k.width = S.width, k.height = S.height;
|
|
314
|
+
const Q = k.getContext("2d");
|
|
315
|
+
Q && (Q.drawImage(S, 0, 0), Y = k.toDataURL(`image/${e}`, t));
|
|
322
316
|
}
|
|
323
|
-
return
|
|
317
|
+
return Y || null;
|
|
324
318
|
} catch {
|
|
325
319
|
return null;
|
|
326
320
|
} finally {
|
|
327
|
-
|
|
321
|
+
h && h.addChildAt(d, Math.min(p, h.children.length)), d.x = m, d.y = C, d.scale.set(b, y), v && v.destroy(!0);
|
|
328
322
|
}
|
|
329
323
|
}
|
|
330
324
|
/**
|
|
@@ -379,7 +373,7 @@ class xe extends B {
|
|
|
379
373
|
this.sprite = null, this.originalTexture = null, this.baseTexture = null, this._container = null, this.removeAllListeners();
|
|
380
374
|
}
|
|
381
375
|
}
|
|
382
|
-
const
|
|
376
|
+
const we = {
|
|
383
377
|
adjust: ["adjust", "advanced"],
|
|
384
378
|
// adjustment, adjustmentAdvanced, alpha, colorMatrix
|
|
385
379
|
blur: ["blur"],
|
|
@@ -395,7 +389,7 @@ const Ce = {
|
|
|
395
389
|
stylize: ["stylize"]
|
|
396
390
|
// ascii, crt, crossHatch, dot, emboss
|
|
397
391
|
};
|
|
398
|
-
class
|
|
392
|
+
class Se extends O {
|
|
399
393
|
constructor(e, t) {
|
|
400
394
|
super(), this.state = e, this.renderer = t, this.instances = {}, this._filterRegistry = null;
|
|
401
395
|
}
|
|
@@ -430,7 +424,7 @@ class we extends B {
|
|
|
430
424
|
*/
|
|
431
425
|
getFiltersByCategory(e) {
|
|
432
426
|
if (!this._filterRegistry) return [];
|
|
433
|
-
const t =
|
|
427
|
+
const t = we[e] || [e], i = [], r = /* @__PURE__ */ new Set();
|
|
434
428
|
for (const a of t) {
|
|
435
429
|
const o = this._filterRegistry.getFiltersByCategory(a) || [];
|
|
436
430
|
for (const n of o)
|
|
@@ -575,7 +569,7 @@ class we extends B {
|
|
|
575
569
|
return this.instances[e] || null;
|
|
576
570
|
}
|
|
577
571
|
}
|
|
578
|
-
const
|
|
572
|
+
const T = class T extends O {
|
|
579
573
|
constructor(e, t) {
|
|
580
574
|
super(), this.state = e, this.renderer = t, this._overlayCanvas = null, this._isDragging = !1, this._dragStart = null, this._dragMode = null, this._startRect = null, this._hoverMode = null, this._lastAutoZoomCheck = 0, this.HANDLE_SIZE = 14, this.EDGE_HIT_PAD = 10, this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this);
|
|
581
575
|
}
|
|
@@ -652,7 +646,7 @@ const R = class R extends B {
|
|
|
652
646
|
if (!e || !r || !a || !o) return null;
|
|
653
647
|
const l = e.width > t, c = e.height > i;
|
|
654
648
|
if (!l && !c) return null;
|
|
655
|
-
const d =
|
|
649
|
+
const d = T.AUTO_ZOOM_PADDING;
|
|
656
650
|
let h = n;
|
|
657
651
|
if (l) {
|
|
658
652
|
const p = e.width / (d * r * o);
|
|
@@ -671,11 +665,11 @@ const R = class R extends B {
|
|
|
671
665
|
_checkAutoZoom() {
|
|
672
666
|
if (!this.state.get("autoZoomOnCropOverflow")) return;
|
|
673
667
|
const e = Date.now();
|
|
674
|
-
if (e - this._lastAutoZoomCheck <
|
|
668
|
+
if (e - this._lastAutoZoomCheck < T.AUTO_ZOOM_THROTTLE_MS) return;
|
|
675
669
|
this._lastAutoZoomCheck = e;
|
|
676
670
|
const t = this.state.get("crop.rect"), i = this.renderer.sprite, r = this.renderer.originalTexture;
|
|
677
671
|
if (!t || !i || !r) return;
|
|
678
|
-
const a =
|
|
672
|
+
const a = T.calcAutoZoom(
|
|
679
673
|
t,
|
|
680
674
|
i.width,
|
|
681
675
|
i.height,
|
|
@@ -703,8 +697,8 @@ const R = class R extends B {
|
|
|
703
697
|
if (!l) return;
|
|
704
698
|
const c = this.state.get("crop.shape");
|
|
705
699
|
if (n.save(), c === "circle") {
|
|
706
|
-
const
|
|
707
|
-
n.beginPath(), n.arc(
|
|
700
|
+
const y = l.x + l.width / 2, v = l.y + l.height / 2, _ = Math.min(l.width, l.height) / 2;
|
|
701
|
+
n.beginPath(), n.arc(y, v, _, 0, Math.PI * 2), n.clip();
|
|
708
702
|
} else
|
|
709
703
|
n.beginPath(), n.rect(l.x, l.y, l.width, l.height), n.clip();
|
|
710
704
|
n.clearRect(l.x, l.y, l.width, l.height), n.restore(), n.strokeStyle = "#ffffff", n.lineWidth = 2, n.setLineDash([5, 5]), c === "circle" ? (n.beginPath(), n.arc(
|
|
@@ -715,22 +709,22 @@ const R = class R extends B {
|
|
|
715
709
|
Math.PI * 2
|
|
716
710
|
), n.stroke()) : n.strokeRect(l.x, l.y, l.width, l.height), n.setLineDash([]), n.strokeStyle = "rgba(255,255,255,0.3)", n.lineWidth = 1;
|
|
717
711
|
const d = l.width / 3, h = l.height / 3;
|
|
718
|
-
for (let
|
|
719
|
-
n.beginPath(), n.moveTo(l.x + d *
|
|
712
|
+
for (let y = 1; y <= 2; y++)
|
|
713
|
+
n.beginPath(), n.moveTo(l.x + d * y, l.y), n.lineTo(l.x + d * y, l.y + l.height), n.stroke(), n.beginPath(), n.moveTo(l.x, l.y + h * y), n.lineTo(l.x + l.width, l.y + h * y), n.stroke();
|
|
720
714
|
const p = this.HANDLE_SIZE, m = [
|
|
721
715
|
{ x: l.x, y: l.y, m: "resize-nw" },
|
|
722
716
|
{ x: l.x + l.width, y: l.y, m: "resize-ne" },
|
|
723
717
|
{ x: l.x, y: l.y + l.height, m: "resize-sw" },
|
|
724
718
|
{ x: l.x + l.width, y: l.y + l.height, m: "resize-se" }
|
|
725
|
-
],
|
|
719
|
+
], C = [
|
|
726
720
|
{ x: l.x + l.width / 2, y: l.y, m: "n" },
|
|
727
721
|
{ x: l.x + l.width / 2, y: l.y + l.height, m: "s" },
|
|
728
722
|
{ x: l.x, y: l.y + l.height / 2, m: "w" },
|
|
729
723
|
{ x: l.x + l.width, y: l.y + l.height / 2, m: "e" }
|
|
730
|
-
], b = [...m, ...
|
|
731
|
-
for (const
|
|
732
|
-
const
|
|
733
|
-
n.beginPath(), n.rect(
|
|
724
|
+
], b = [...m, ...C];
|
|
725
|
+
for (const y of b) {
|
|
726
|
+
const v = this._hoverMode === y.m, _ = v ? p + 4 : p;
|
|
727
|
+
n.beginPath(), n.rect(y.x - _ / 2, y.y - _ / 2, _, _), n.fillStyle = v ? "#4da3ff" : "#ffffff", n.strokeStyle = "rgba(0,0,0,0.6)", n.lineWidth = 1, n.fill(), n.stroke();
|
|
734
728
|
}
|
|
735
729
|
}
|
|
736
730
|
/**
|
|
@@ -841,24 +835,24 @@ const R = class R extends B {
|
|
|
841
835
|
const e = this.renderer.app, t = this.renderer.sprite, i = this.renderer.originalTexture, r = this.state.get("crop.rect");
|
|
842
836
|
if (!r || !t || !e || !i) return null;
|
|
843
837
|
const a = window.PIXI, o = this.renderer.zoom, n = i.width / t.width, l = i.height / t.height, c = (r.x - t.x) * n, d = (r.y - t.y) * l;
|
|
844
|
-
let h = Math.round(Math.max(1, r.width * n)), p = Math.round(Math.max(1, r.height * l)), m = Math.round(c),
|
|
838
|
+
let h = Math.round(Math.max(1, r.width * n)), p = Math.round(Math.max(1, r.height * l)), m = Math.round(c), C = Math.round(d);
|
|
845
839
|
if (h <= 0 || p <= 0) return null;
|
|
846
|
-
const b = new a.Container(),
|
|
840
|
+
const b = new a.Container(), y = new a.Sprite(i);
|
|
847
841
|
if (this.state.get("crop.shape") === "circle") {
|
|
848
|
-
const
|
|
849
|
-
m = Math.round(
|
|
850
|
-
const
|
|
851
|
-
typeof
|
|
842
|
+
const A = Math.round(Math.max(h, p)), S = m + h / 2, Y = C + p / 2;
|
|
843
|
+
m = Math.round(S - A / 2), C = Math.round(Y - A / 2), h = p = A;
|
|
844
|
+
const k = new a.Graphics();
|
|
845
|
+
typeof k.circle == "function" && typeof k.fill == "function" ? k.circle(h / 2, p / 2, h / 2).fill(16777215) : (k.beginFill(16777215, 1), k.drawCircle(h / 2, p / 2, h / 2), k.endFill()), y.mask = k, b.addChild(k);
|
|
852
846
|
}
|
|
853
|
-
|
|
854
|
-
const
|
|
847
|
+
y.x = -m, y.y = -C, b.addChild(y);
|
|
848
|
+
const _ = a.RenderTexture.create({ width: h, height: p });
|
|
855
849
|
e.renderer.render({
|
|
856
850
|
container: b,
|
|
857
|
-
target:
|
|
851
|
+
target: _,
|
|
858
852
|
clear: !0
|
|
859
|
-
}), b.destroy({ children: !0 }), this.renderer.originalTexture =
|
|
860
|
-
const
|
|
861
|
-
return e.stage.addChild(
|
|
853
|
+
}), b.destroy({ children: !0 }), this.renderer.originalTexture = _, e.stage.removeChild(t), t.destroy();
|
|
854
|
+
const K = new a.Sprite(_);
|
|
855
|
+
return e.stage.addChild(K), this.renderer.sprite = K, this.renderer.fitScale = this.renderer.getFitScaleFor(_), this.renderer.setZoom(o, { keepCenter: !1 }), this.renderer.applyViewTransform(), this.renderer.render(), this.disable(), this.emit("applied", { width: h, height: p }), { texture: _, preservedZoom: o };
|
|
862
856
|
}
|
|
863
857
|
/**
|
|
864
858
|
* Cancel crop
|
|
@@ -885,12 +879,12 @@ const R = class R extends B {
|
|
|
885
879
|
* Padding factor for auto-zoom: image will be ~91% of crop size (1/1.1).
|
|
886
880
|
* Higher values = more aggressive zoom-out, more padding around image.
|
|
887
881
|
*/
|
|
888
|
-
|
|
882
|
+
V(T, "AUTO_ZOOM_PADDING", 1.1), /**
|
|
889
883
|
* Minimum interval (ms) between auto-zoom adjustments during drag.
|
|
890
884
|
*/
|
|
891
|
-
|
|
892
|
-
let
|
|
893
|
-
class
|
|
885
|
+
V(T, "AUTO_ZOOM_THROTTLE_MS", 100);
|
|
886
|
+
let $ = T;
|
|
887
|
+
class ve {
|
|
894
888
|
/**
|
|
895
889
|
* Create a new RemoveBgManager
|
|
896
890
|
* @param {Object} options
|
|
@@ -1016,7 +1010,7 @@ function u(s, e = {}, ...t) {
|
|
|
1016
1010
|
typeof r == "string" ? i.appendChild(document.createTextNode(r)) : r instanceof HTMLElement && i.appendChild(r);
|
|
1017
1011
|
return i;
|
|
1018
1012
|
}
|
|
1019
|
-
function
|
|
1013
|
+
function ne({ id: s, label: e, min: t = 0, max: i = 1, step: r = 0.01, value: a = 0.5, onChange: o }) {
|
|
1020
1014
|
const n = s.includes("-") ? s.split("-").slice(1).join("-") : s, l = u("div", {
|
|
1021
1015
|
className: "slider-control slider-wrapper",
|
|
1022
1016
|
"data-control": n,
|
|
@@ -1025,7 +1019,7 @@ function se({ id: s, label: e, min: t = 0, max: i = 1, step: r = 0.01, value: a
|
|
|
1025
1019
|
"div",
|
|
1026
1020
|
{ className: "slider-header" },
|
|
1027
1021
|
u("label", { for: s, className: "slider-label" }, e),
|
|
1028
|
-
u("span", { className: "slider-value", id: `${s}-value` },
|
|
1022
|
+
u("span", { className: "slider-value", id: `${s}-value` }, j(a))
|
|
1029
1023
|
), d = u("input", {
|
|
1030
1024
|
type: "range",
|
|
1031
1025
|
id: s,
|
|
@@ -1036,19 +1030,19 @@ function se({ id: s, label: e, min: t = 0, max: i = 1, step: r = 0.01, value: a
|
|
|
1036
1030
|
value: String(a),
|
|
1037
1031
|
onInput: (h) => {
|
|
1038
1032
|
const p = parseFloat(h.target.value), m = l.querySelector(".slider-value");
|
|
1039
|
-
m && (m.textContent =
|
|
1033
|
+
m && (m.textContent = j(p)), o == null || o(p);
|
|
1040
1034
|
}
|
|
1041
1035
|
});
|
|
1042
1036
|
return l.appendChild(c), l.appendChild(d), l.setValue = (h) => {
|
|
1043
1037
|
d.value = String(h);
|
|
1044
1038
|
const p = l.querySelector(".slider-value");
|
|
1045
|
-
p && (p.textContent =
|
|
1039
|
+
p && (p.textContent = j(h));
|
|
1046
1040
|
}, l;
|
|
1047
1041
|
}
|
|
1048
|
-
function
|
|
1042
|
+
function j(s) {
|
|
1049
1043
|
return Number.isInteger(s) ? String(s) : s.toFixed(2);
|
|
1050
1044
|
}
|
|
1051
|
-
function
|
|
1045
|
+
function le({ id: s, label: e, checked: t = !1, onChange: i }) {
|
|
1052
1046
|
const r = u("div", { className: "toggle-control" }), a = u("label", { className: "toggle-label", for: s }, e), o = u("input", {
|
|
1053
1047
|
type: "checkbox",
|
|
1054
1048
|
id: s,
|
|
@@ -1065,7 +1059,7 @@ function ae({ id: s, label: e, checked: t = !1, onChange: i }) {
|
|
|
1065
1059
|
o.checked = c;
|
|
1066
1060
|
}, r;
|
|
1067
1061
|
}
|
|
1068
|
-
function
|
|
1062
|
+
function ce({ id: s, label: e, value: t = "#000000", onChange: i }) {
|
|
1069
1063
|
const r = u("div", { className: "color-control" }), a = u("label", { className: "color-label", for: s }, e), o = u("input", {
|
|
1070
1064
|
type: "color",
|
|
1071
1065
|
id: s,
|
|
@@ -1077,7 +1071,7 @@ function oe({ id: s, label: e, value: t = "#000000", onChange: i }) {
|
|
|
1077
1071
|
o.value = n;
|
|
1078
1072
|
}, r;
|
|
1079
1073
|
}
|
|
1080
|
-
function
|
|
1074
|
+
function he({ id: s, label: e, options: t = [], value: i, onChange: r }) {
|
|
1081
1075
|
const a = u("div", { className: "select-control" }), o = u("label", { className: "select-label", for: s }, e), n = u("select", {
|
|
1082
1076
|
id: s,
|
|
1083
1077
|
className: "select-input",
|
|
@@ -1091,7 +1085,7 @@ function ne({ id: s, label: e, options: t = [], value: i, onChange: r }) {
|
|
|
1091
1085
|
n.value = l;
|
|
1092
1086
|
}, a;
|
|
1093
1087
|
}
|
|
1094
|
-
function
|
|
1088
|
+
function z({ label: s, className: e = "", onClick: t, icon: i = null, disabled: r = !1 }) {
|
|
1095
1089
|
const a = u("button", {
|
|
1096
1090
|
type: "button",
|
|
1097
1091
|
className: `btn ${e}`.trim(),
|
|
@@ -1106,7 +1100,7 @@ function F({ label: s, className: e = "", onClick: t, icon: i = null, disabled:
|
|
|
1106
1100
|
}
|
|
1107
1101
|
return s && a.appendChild(document.createTextNode(s)), a;
|
|
1108
1102
|
}
|
|
1109
|
-
function
|
|
1103
|
+
function x({ icon: s, title: e, className: t = "", onClick: i, disabled: r = !1, testId: a = null, ariaLabel: o = null }) {
|
|
1110
1104
|
const n = {
|
|
1111
1105
|
type: "button",
|
|
1112
1106
|
className: `icon-btn ${t}`.trim(),
|
|
@@ -1121,7 +1115,7 @@ function C({ icon: s, title: e, className: t = "", onClick: i, disabled: r = !1,
|
|
|
1121
1115
|
const c = l.querySelector("svg");
|
|
1122
1116
|
return c && c.setAttribute("aria-hidden", "true"), l;
|
|
1123
1117
|
}
|
|
1124
|
-
function
|
|
1118
|
+
function W({ label: s, icon: e, active: t = !1, onClick: i }) {
|
|
1125
1119
|
const r = u("button", {
|
|
1126
1120
|
type: "button",
|
|
1127
1121
|
className: `chip ${t ? "active" : ""}`.trim(),
|
|
@@ -1137,8 +1131,8 @@ function $({ label: s, icon: e, active: t = !1, onClick: i }) {
|
|
|
1137
1131
|
r.classList.toggle("active", a);
|
|
1138
1132
|
}, r;
|
|
1139
1133
|
}
|
|
1140
|
-
const
|
|
1141
|
-
class
|
|
1134
|
+
const de = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"/></svg>', ue = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M184 112l144 144-144 144"/></svg>', ke = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M256 184v74m-37-37h74"/></svg>', Pe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M338.29 338.29L448 448M184 221h74"/></svg>', Me = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M432 320v112H320M80 192V80h112M320 80h112v112M192 432H80V320"/></svg>', Fe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M262.29 192.31a64 64 0 1057.4 57.4 64.13 64.13 0 00-57.4-57.4z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416.39 256a154.34 154.34 0 01-1.53 20.79l45.21 35.46a10.81 10.81 0 012.45 13.75l-42.77 74a10.81 10.81 0 01-13.14 4.59l-44.9-18.08a16.11 16.11 0 00-15.17 1.75A164.48 164.48 0 01325 400.8a15.94 15.94 0 00-8.82 12.14l-6.73 47.89a11.08 11.08 0 01-10.68 9.17h-85.54a11.11 11.11 0 01-10.69-8.87l-6.72-47.82a16.07 16.07 0 00-9-12.22 155.3 155.3 0 01-21.46-12.57 16 16 0 00-15.11-1.71l-44.89 18.07a10.81 10.81 0 01-13.14-4.58l-42.77-74a10.8 10.8 0 012.45-13.75l38.21-30a16.05 16.05 0 006-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 00-6.07-13.94l-38.19-30A10.81 10.81 0 0149.48 186l42.77-74a10.81 10.81 0 0113.14-4.59l44.9 18.08a16.11 16.11 0 0015.17-1.75A164.48 164.48 0 01187 111.2a15.94 15.94 0 008.82-12.14l6.73-47.89A11.08 11.08 0 01213.23 42h85.54a11.11 11.11 0 0110.69 8.87l6.72 47.82a16.07 16.07 0 009 12.22 155.3 155.3 0 0121.46 12.57 16 16 0 0015.11 1.71l44.89-18.07a10.81 10.81 0 0113.14 4.58l42.77 74a10.8 10.8 0 01-2.45 13.75l-38.21 30a16.05 16.05 0 00-6.05 14.08c.33 4.14.55 8.3.55 12.47z"/></svg>', Ae = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 320c0 88.37-55.63 144-144 144s-144-55.63-144-144c0-94.83 103.23-222.85 134.89-259.88a12 12 0 0118.23 0C296.77 97.15 400 225.17 400 320z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M344 328a72 72 0 01-72 72"/></svg>', ze = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M430.11 347.9c-6.6-6.1-16.3-7.6-24.6-9-11.5-1.9-15.9-4-22.6-10-14.3-12.7-14.3-31.1 0-43.8l30.3-26.9c46.4-41 46.4-108.2 0-149.2-34.2-30.1-80.1-45-127.8-45-55.7 0-113.9 20.3-158.8 60.1-83.5 73.8-83.5 194.7 0 268.5 41.5 36.7 97.5 55 152.9 55.4h1.7c55.4 0 110-17.9 148.8-52.4 14.4-12.7 11.99-36.6.1-47.7z"/><circle cx="144" cy="208" r="32"/><circle cx="152" cy="311" r="32"/><circle cx="224" cy="144" r="32"/><circle cx="256" cy="367" r="32"/><circle cx="328" cy="144" r="32"/></svg>', Ne = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M259.92 262.91L216.4 149.77a9 9 0 00-16.8 0l-43.52 113.14a9 9 0 01-5.17 5.17L37.77 311.6a9 9 0 000 16.8l113.14 43.52a9 9 0 015.17 5.17l43.52 113.14a9 9 0 0016.8 0l43.52-113.14a9 9 0 015.17-5.17l113.14-43.52a9 9 0 000-16.8l-113.14-43.52a9 9 0 01-5.17-5.17zM108 68L88 16 68 68 16 88l52 20 20 52 20-52 52-20-52-20zM426.67 117.33L400 48l-26.67 69.33L304 144l69.33 26.67L400 240l26.67-69.33L496 144l-69.33-26.67z"/></svg>', Re = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M176 112l80-80 80 80M255.98 32l.02 448M176 400l80 80 80-80M400 176l80 80-80 80M112 176l-80 80 80 80M32 256h448"/></svg>', Te = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z"/></svg>', pe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M144 48v272a48 48 0 0048 48h272"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 464V192a48 48 0 00-48-48H48"/></svg>', Ie = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M380.93 57.37A32 32 0 00358.3 48H94.22A46.21 46.21 0 0048 94.22v323.56A46.21 46.21 0 0094.22 464h323.56A46.36 46.36 0 00464 417.78V153.7a32 32 0 00-9.37-22.63zM256 416a64 64 0 1164-64 63.92 63.92 0 01-64 64zm48-224H112a16 16 0 01-16-16v-64a16 16 0 0116-16h192a16 16 0 0116 16v64a16 16 0 01-16 16z"/></svg>', G = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"/></svg>', fe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 146s24.36-12-64-12a160 160 0 10160 160"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M256 58l80 80-80 80"/></svg>', Ee = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224"/></svg>', Xe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M64 192v-72a40 40 0 0140-40h75.89a40 40 0 0122.19 6.72l27.84 18.56a40 40 0 0022.19 6.72H408a40 40 0 0140 40v40"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M479.9 226.55L463.68 392a40 40 0 01-39.93 40H88.25a40 40 0 01-39.93-40L32.1 226.55A32 32 0 0164 192h384.1a32 32 0 0131.8 34.55z"/></svg>', Z = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M416 128L192 384l-96-96"/></svg>', Ye = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="64" y="64" width="384" height="384" rx="48" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Be = '<svg viewBox="0 0 512 512" width="20" height="20"><circle cx="256" cy="256" r="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg>', Oe = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M80 96h64l64 320h64l64-160h96"/></svg>', J = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M256 48v48M256 416v48M403.08 108.92l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48M96 256H48M403.08 403.08l-33.94-33.94M142.86 142.86l-33.94-33.94"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32"/></svg>', ee = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z"/></svg>', Le = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M436 80H76a44.05 44.05 0 00-44 44v264a44.05 44.05 0 0044 44h360a44.05 44.05 0 0044-44V124a44.05 44.05 0 00-44-44z"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M220 80v56M292 80v56M220 376v56M292 376v56M80 144h56M80 224h56M80 304h56M376 144h56M376 224h56M376 304h56"/></svg>';
|
|
1135
|
+
class De {
|
|
1142
1136
|
constructor(e, t) {
|
|
1143
1137
|
this.state = e, this.editor = t, this.element = null, this._unsubscribers = [];
|
|
1144
1138
|
}
|
|
@@ -1148,8 +1142,8 @@ class Le {
|
|
|
1148
1142
|
*/
|
|
1149
1143
|
render() {
|
|
1150
1144
|
this.element = u("div", { className: "editor-toolbar" });
|
|
1151
|
-
const e = u("div", { className: "toolbar-section toolbar-left" }), t =
|
|
1152
|
-
icon:
|
|
1145
|
+
const e = u("div", { className: "toolbar-section toolbar-left" }), t = x({
|
|
1146
|
+
icon: Xe,
|
|
1153
1147
|
title: "Open Image",
|
|
1154
1148
|
className: "toolbar-btn",
|
|
1155
1149
|
testId: "btn-open-image",
|
|
@@ -1157,8 +1151,8 @@ class Le {
|
|
|
1157
1151
|
onClick: () => this.editor.openFilePicker()
|
|
1158
1152
|
});
|
|
1159
1153
|
e.appendChild(t);
|
|
1160
|
-
const i = u("div", { className: "toolbar-section toolbar-center" }), r =
|
|
1161
|
-
icon:
|
|
1154
|
+
const i = u("div", { className: "toolbar-section toolbar-center" }), r = x({
|
|
1155
|
+
icon: Pe,
|
|
1162
1156
|
title: "Zoom Out",
|
|
1163
1157
|
className: "toolbar-btn",
|
|
1164
1158
|
testId: "btn-zoom-out",
|
|
@@ -1174,8 +1168,8 @@ class Le {
|
|
|
1174
1168
|
"aria-atomic": "true",
|
|
1175
1169
|
role: "status"
|
|
1176
1170
|
}, "100%");
|
|
1177
|
-
const a =
|
|
1178
|
-
icon:
|
|
1171
|
+
const a = x({
|
|
1172
|
+
icon: ke,
|
|
1179
1173
|
title: "Zoom In",
|
|
1180
1174
|
className: "toolbar-btn",
|
|
1181
1175
|
testId: "btn-zoom-in",
|
|
@@ -1184,8 +1178,8 @@ class Le {
|
|
|
1184
1178
|
const h = this.state.get("zoom");
|
|
1185
1179
|
this.editor.setZoom(h + 0.25);
|
|
1186
1180
|
}
|
|
1187
|
-
}), o =
|
|
1188
|
-
icon:
|
|
1181
|
+
}), o = x({
|
|
1182
|
+
icon: Me,
|
|
1189
1183
|
title: "Fit to Screen",
|
|
1190
1184
|
className: "toolbar-btn",
|
|
1191
1185
|
testId: "btn-fit-screen",
|
|
@@ -1194,15 +1188,15 @@ class Le {
|
|
|
1194
1188
|
});
|
|
1195
1189
|
i.appendChild(r), i.appendChild(this._zoomLabel), i.appendChild(a), i.appendChild(o);
|
|
1196
1190
|
const n = u("div", { className: "toolbar-section toolbar-right" });
|
|
1197
|
-
this._themeBtn =
|
|
1198
|
-
icon: this.state.get("isDarkMode") ?
|
|
1191
|
+
this._themeBtn = x({
|
|
1192
|
+
icon: this.state.get("isDarkMode") ? J : ee,
|
|
1199
1193
|
title: "Toggle Theme",
|
|
1200
1194
|
className: "toolbar-btn toolbar-btn-theme",
|
|
1201
1195
|
testId: "btn-toggle-theme",
|
|
1202
1196
|
ariaLabel: "Toggle theme",
|
|
1203
1197
|
onClick: () => this.editor.toggleTheme()
|
|
1204
|
-
}), this._cropBtn =
|
|
1205
|
-
icon:
|
|
1198
|
+
}), this._cropBtn = x({
|
|
1199
|
+
icon: pe,
|
|
1206
1200
|
title: "Crop",
|
|
1207
1201
|
className: "toolbar-btn toolbar-btn-crop",
|
|
1208
1202
|
testId: "btn-crop",
|
|
@@ -1211,22 +1205,22 @@ class Le {
|
|
|
1211
1205
|
this.state.get("mode") === "crop" ? this.editor.setMode("filters") : this.editor.setMode("crop");
|
|
1212
1206
|
}
|
|
1213
1207
|
});
|
|
1214
|
-
const l =
|
|
1215
|
-
icon:
|
|
1208
|
+
const l = x({
|
|
1209
|
+
icon: fe,
|
|
1216
1210
|
title: "Reset All",
|
|
1217
1211
|
className: "toolbar-btn",
|
|
1218
1212
|
testId: "btn-reset-all",
|
|
1219
1213
|
ariaLabel: "Reset all changes",
|
|
1220
1214
|
onClick: () => this.editor.resetAll()
|
|
1221
|
-
}), c =
|
|
1222
|
-
icon:
|
|
1215
|
+
}), c = x({
|
|
1216
|
+
icon: Ie,
|
|
1223
1217
|
title: "Save Image",
|
|
1224
1218
|
className: "toolbar-btn toolbar-btn-primary",
|
|
1225
1219
|
testId: "btn-save-edit",
|
|
1226
1220
|
ariaLabel: "Save image",
|
|
1227
1221
|
onClick: () => this.editor.save()
|
|
1228
|
-
}), d =
|
|
1229
|
-
icon:
|
|
1222
|
+
}), d = x({
|
|
1223
|
+
icon: G,
|
|
1230
1224
|
title: "Close",
|
|
1231
1225
|
className: "toolbar-btn",
|
|
1232
1226
|
testId: "btn-cancel-edit",
|
|
@@ -1244,7 +1238,7 @@ class Le {
|
|
|
1244
1238
|
});
|
|
1245
1239
|
this._unsubscribers.push(e);
|
|
1246
1240
|
const t = this.state.on("change:isDarkMode", ({ value: r }) => {
|
|
1247
|
-
this._themeBtn.innerHTML = r ?
|
|
1241
|
+
this._themeBtn.innerHTML = r ? J : ee;
|
|
1248
1242
|
});
|
|
1249
1243
|
this._unsubscribers.push(t);
|
|
1250
1244
|
const i = this.state.on("change:mode", ({ value: r }) => {
|
|
@@ -1267,24 +1261,24 @@ class Le {
|
|
|
1267
1261
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], (e = this.element) == null || e.remove(), this.element = null;
|
|
1268
1262
|
}
|
|
1269
1263
|
}
|
|
1270
|
-
const
|
|
1271
|
-
{ id: "adjust", name: "Adjust", icon:
|
|
1264
|
+
const L = [
|
|
1265
|
+
{ id: "adjust", name: "Adjust", icon: Fe },
|
|
1272
1266
|
// adjustment, adjustmentAdvanced, alpha
|
|
1273
|
-
{ id: "blur", name: "Blur", icon:
|
|
1267
|
+
{ id: "blur", name: "Blur", icon: Ae },
|
|
1274
1268
|
// blur, kawaseBlur, motionBlur, radialBlur, etc.
|
|
1275
|
-
{ id: "color", name: "Color", icon:
|
|
1269
|
+
{ id: "color", name: "Color", icon: ze },
|
|
1276
1270
|
// colorOverlay, grayscale, hslAdjustment, etc.
|
|
1277
|
-
{ id: "effects", name: "Effects", icon:
|
|
1271
|
+
{ id: "effects", name: "Effects", icon: Ne },
|
|
1278
1272
|
// noise, vignette, pixelate, dropShadow, etc.
|
|
1279
|
-
{ id: "distortion", name: "Distortion", icon:
|
|
1273
|
+
{ id: "distortion", name: "Distortion", icon: Re },
|
|
1280
1274
|
// twist, bulgePinch, displacement, etc.
|
|
1281
|
-
{ id: "light", name: "Light", icon:
|
|
1275
|
+
{ id: "light", name: "Light", icon: Te },
|
|
1282
1276
|
// bloom, glow, godray, advancedBloom
|
|
1283
|
-
{ id: "stylize", name: "Stylize", icon:
|
|
1277
|
+
{ id: "stylize", name: "Stylize", icon: Le },
|
|
1284
1278
|
// ascii, crt, crossHatch, dot, emboss
|
|
1285
|
-
{ id: "crop", name: "Crop", icon:
|
|
1279
|
+
{ id: "crop", name: "Crop", icon: pe }
|
|
1286
1280
|
];
|
|
1287
|
-
class
|
|
1281
|
+
class Ue {
|
|
1288
1282
|
constructor(e, t) {
|
|
1289
1283
|
this.state = e, this.editor = t, this.element = null, this._chips = /* @__PURE__ */ new Map(), this._scrollIndex = 0, this._unsubscribers = [];
|
|
1290
1284
|
}
|
|
@@ -1297,21 +1291,21 @@ class De {
|
|
|
1297
1291
|
this._onSelect = e, this.element = u("div", {
|
|
1298
1292
|
className: "category-carousel-container",
|
|
1299
1293
|
"data-testid": "category-carousel"
|
|
1300
|
-
}), this._leftBtn =
|
|
1301
|
-
icon:
|
|
1294
|
+
}), this._leftBtn = x({
|
|
1295
|
+
icon: de,
|
|
1302
1296
|
title: "Previous categories",
|
|
1303
1297
|
className: "carousel-nav carousel-nav-left",
|
|
1304
1298
|
onClick: () => this._scrollLeft()
|
|
1305
|
-
}), this._carousel = u("div", { className: "category-carousel" }),
|
|
1306
|
-
const r =
|
|
1299
|
+
}), this._carousel = u("div", { className: "category-carousel" }), L.forEach((i) => {
|
|
1300
|
+
const r = W({
|
|
1307
1301
|
label: i.name,
|
|
1308
1302
|
icon: i.icon,
|
|
1309
1303
|
active: this.state.get("selectedCategory") === i.id,
|
|
1310
1304
|
onClick: () => this._selectCategory(i.id)
|
|
1311
1305
|
});
|
|
1312
1306
|
r.dataset.categoryId = i.id, r.dataset.category = i.id, r.dataset.testid = `category-${i.id}`, this._chips.set(i.id, r), this._carousel.appendChild(r);
|
|
1313
|
-
}), this._rightBtn =
|
|
1314
|
-
icon:
|
|
1307
|
+
}), this._rightBtn = x({
|
|
1308
|
+
icon: ue,
|
|
1315
1309
|
title: "Next categories",
|
|
1316
1310
|
className: "carousel-nav carousel-nav-right",
|
|
1317
1311
|
onClick: () => this._scrollRight()
|
|
@@ -1320,7 +1314,7 @@ class De {
|
|
|
1320
1314
|
role: "tablist",
|
|
1321
1315
|
"aria-label": "Category pages"
|
|
1322
1316
|
});
|
|
1323
|
-
const t = Math.ceil(
|
|
1317
|
+
const t = Math.ceil(L.length / 3);
|
|
1324
1318
|
for (let i = 0; i < t; i++) {
|
|
1325
1319
|
const r = u("button", {
|
|
1326
1320
|
type: "button",
|
|
@@ -1363,7 +1357,7 @@ class De {
|
|
|
1363
1357
|
* Scroll carousel right
|
|
1364
1358
|
*/
|
|
1365
1359
|
_scrollRight() {
|
|
1366
|
-
this._scrollIndex <
|
|
1360
|
+
this._scrollIndex < L.length - 3 && (this._scrollIndex++, this._scrollCarousel());
|
|
1367
1361
|
}
|
|
1368
1362
|
/**
|
|
1369
1363
|
* Scroll to a specific page
|
|
@@ -1390,7 +1384,7 @@ class De {
|
|
|
1390
1384
|
* Update navigation button states
|
|
1391
1385
|
*/
|
|
1392
1386
|
_updateNavButtons() {
|
|
1393
|
-
this._leftBtn && (this._leftBtn.disabled = this._scrollIndex === 0), this._rightBtn && (this._rightBtn.disabled = this._scrollIndex >=
|
|
1387
|
+
this._leftBtn && (this._leftBtn.disabled = this._scrollIndex === 0), this._rightBtn && (this._rightBtn.disabled = this._scrollIndex >= L.length - 3);
|
|
1394
1388
|
}
|
|
1395
1389
|
/**
|
|
1396
1390
|
* Update pagination dot states
|
|
@@ -1419,7 +1413,7 @@ class De {
|
|
|
1419
1413
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
1420
1414
|
}
|
|
1421
1415
|
}
|
|
1422
|
-
class
|
|
1416
|
+
class Ve {
|
|
1423
1417
|
constructor(e, t) {
|
|
1424
1418
|
this.state = e, this.filterManager = t, this.element = null, this._filterCards = /* @__PURE__ */ new Map(), this._scrollIndex = 0, this._unsubscribers = [], this._onToggle = null, this._onSelect = null;
|
|
1425
1419
|
}
|
|
@@ -1429,13 +1423,13 @@ class Ue {
|
|
|
1429
1423
|
* @returns {HTMLElement}
|
|
1430
1424
|
*/
|
|
1431
1425
|
render({ onToggle: e, onSelect: t }) {
|
|
1432
|
-
return this._onToggle = e, this._onSelect = t, this.element = u("div", { className: "filter-carousel-container" }), this._leftBtn =
|
|
1433
|
-
icon:
|
|
1426
|
+
return this._onToggle = e, this._onSelect = t, this.element = u("div", { className: "filter-carousel-container" }), this._leftBtn = x({
|
|
1427
|
+
icon: de,
|
|
1434
1428
|
title: "Previous filters",
|
|
1435
1429
|
className: "carousel-nav carousel-nav-left",
|
|
1436
1430
|
onClick: () => this._scrollLeft()
|
|
1437
|
-
}), this._carousel = u("div", { className: "filter-carousel" }), this._rightBtn =
|
|
1438
|
-
icon:
|
|
1431
|
+
}), this._carousel = u("div", { className: "filter-carousel" }), this._rightBtn = x({
|
|
1432
|
+
icon: ue,
|
|
1439
1433
|
title: "Next filters",
|
|
1440
1434
|
className: "carousel-nav carousel-nav-right",
|
|
1441
1435
|
onClick: () => this._scrollRight()
|
|
@@ -1497,7 +1491,7 @@ class Ue {
|
|
|
1497
1491
|
this._handleToggle(e.id, h), h && (this.state.set("selectedFilter", e.id), (p = this._onSelect) == null || p.call(this, e.id));
|
|
1498
1492
|
}
|
|
1499
1493
|
});
|
|
1500
|
-
return l.innerHTML = t ?
|
|
1494
|
+
return l.innerHTML = t ? Z : "", r.appendChild(a), r.appendChild(n), r.appendChild(l), r._toggle = l, r._isActive = t, r;
|
|
1501
1495
|
}
|
|
1502
1496
|
/**
|
|
1503
1497
|
* Handle filter card click (select)
|
|
@@ -1523,7 +1517,7 @@ class Ue {
|
|
|
1523
1517
|
const e = this.state.get("activeFilters");
|
|
1524
1518
|
this._filterCards.forEach((t, i) => {
|
|
1525
1519
|
const r = e.has(i);
|
|
1526
|
-
t.classList.toggle("active", r), t._toggle.classList.toggle("active", r), t._toggle.innerHTML = r ?
|
|
1520
|
+
t.classList.toggle("active", r), t._toggle.classList.toggle("active", r), t._toggle.innerHTML = r ? Z : "", t._isActive = r;
|
|
1527
1521
|
});
|
|
1528
1522
|
}
|
|
1529
1523
|
/**
|
|
@@ -1576,7 +1570,7 @@ class Ue {
|
|
|
1576
1570
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._filterCards.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
1577
1571
|
}
|
|
1578
1572
|
}
|
|
1579
|
-
class
|
|
1573
|
+
class je {
|
|
1580
1574
|
constructor(e, t) {
|
|
1581
1575
|
this.state = e, this.filterManager = t, this.element = null, this._controls = /* @__PURE__ */ new Map(), this._onChange = null, this._onReset = null, this._onAction = null, this._unsubscribers = [];
|
|
1582
1576
|
}
|
|
@@ -1621,7 +1615,7 @@ class Ve {
|
|
|
1621
1615
|
return;
|
|
1622
1616
|
}
|
|
1623
1617
|
const i = u("div", { className: "adjustments-header" });
|
|
1624
|
-
i.appendChild(u("span", { className: "adjustments-title" }, t.name)), i.appendChild(
|
|
1618
|
+
i.appendChild(u("span", { className: "adjustments-title" }, t.name)), i.appendChild(z({
|
|
1625
1619
|
label: "Reset",
|
|
1626
1620
|
className: "btn-text",
|
|
1627
1621
|
onClick: () => this._handleReset(e)
|
|
@@ -1644,7 +1638,7 @@ class Ve {
|
|
|
1644
1638
|
const r = t.label || t.id;
|
|
1645
1639
|
switch (this._normalizeControlType(t.type)) {
|
|
1646
1640
|
case "slider":
|
|
1647
|
-
return
|
|
1641
|
+
return ne({
|
|
1648
1642
|
id: `${e}-${t.id}`,
|
|
1649
1643
|
label: r,
|
|
1650
1644
|
min: t.min ?? 0,
|
|
@@ -1654,14 +1648,14 @@ class Ve {
|
|
|
1654
1648
|
onChange: (l) => this._handleChange(e, t.id, l)
|
|
1655
1649
|
});
|
|
1656
1650
|
case "toggle":
|
|
1657
|
-
return
|
|
1651
|
+
return le({
|
|
1658
1652
|
id: `${e}-${t.id}`,
|
|
1659
1653
|
label: r,
|
|
1660
1654
|
checked: !!i,
|
|
1661
1655
|
onChange: (l) => this._handleChange(e, t.id, l)
|
|
1662
1656
|
});
|
|
1663
1657
|
case "color":
|
|
1664
|
-
return
|
|
1658
|
+
return ce({
|
|
1665
1659
|
id: `${e}-${t.id}`,
|
|
1666
1660
|
label: r,
|
|
1667
1661
|
value: typeof i == "string" && i.startsWith("#") ? i : t.default || "#000000",
|
|
@@ -1669,7 +1663,7 @@ class Ve {
|
|
|
1669
1663
|
});
|
|
1670
1664
|
case "select":
|
|
1671
1665
|
const o = this._normalizeOptions(t.options);
|
|
1672
|
-
return
|
|
1666
|
+
return he({
|
|
1673
1667
|
id: `${e}-${t.id}`,
|
|
1674
1668
|
label: r,
|
|
1675
1669
|
options: o,
|
|
@@ -1678,7 +1672,7 @@ class Ve {
|
|
|
1678
1672
|
});
|
|
1679
1673
|
case "button":
|
|
1680
1674
|
const n = u("div", { className: "button-control" });
|
|
1681
|
-
return n.appendChild(
|
|
1675
|
+
return n.appendChild(z({
|
|
1682
1676
|
label: r,
|
|
1683
1677
|
className: "btn-secondary",
|
|
1684
1678
|
onClick: () => this._handleAction(e, t.action || t.id)
|
|
@@ -1779,7 +1773,7 @@ class Ve {
|
|
|
1779
1773
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._controls.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
1780
1774
|
}
|
|
1781
1775
|
}
|
|
1782
|
-
class
|
|
1776
|
+
class qe {
|
|
1783
1777
|
constructor(e, t) {
|
|
1784
1778
|
this.state = e, this.filterManager = t, this._drawer = null, this._body = null, this._titleEl = null, this._isOpen = !1, this._currentFilterId = null, this._controls = /* @__PURE__ */ new Map(), this._onChange = null, this._onReset = null, this._onRemove = null, this._onAction = null, this._container = null;
|
|
1785
1779
|
}
|
|
@@ -1792,22 +1786,22 @@ class je {
|
|
|
1792
1786
|
this._onChange = t, this._onReset = i, this._onRemove = r, this._onAction = a, this._container = e, this._drawer = u("div", { className: "mobile-filter-drawer" });
|
|
1793
1787
|
const o = u("div", { className: "drawer-header" });
|
|
1794
1788
|
this._titleEl = u("span", { className: "drawer-title" }, "Filter");
|
|
1795
|
-
const n = u("div", { className: "drawer-header-actions" }), l =
|
|
1789
|
+
const n = u("div", { className: "drawer-header-actions" }), l = z({
|
|
1796
1790
|
label: "Reset",
|
|
1797
1791
|
className: "btn-text",
|
|
1798
1792
|
onClick: () => {
|
|
1799
1793
|
var h;
|
|
1800
1794
|
this._currentFilterId && ((h = this._onReset) == null || h.call(this, this._currentFilterId), this._renderControls());
|
|
1801
1795
|
}
|
|
1802
|
-
}), c =
|
|
1796
|
+
}), c = z({
|
|
1803
1797
|
label: "Remove",
|
|
1804
1798
|
className: "btn-text btn-danger",
|
|
1805
1799
|
onClick: () => {
|
|
1806
1800
|
var h;
|
|
1807
1801
|
this._currentFilterId && ((h = this._onRemove) == null || h.call(this, this._currentFilterId), this.close());
|
|
1808
1802
|
}
|
|
1809
|
-
}), d =
|
|
1810
|
-
icon:
|
|
1803
|
+
}), d = x({
|
|
1804
|
+
icon: G,
|
|
1811
1805
|
title: "Close",
|
|
1812
1806
|
className: "btn-icon-sm",
|
|
1813
1807
|
ariaLabel: "Close drawer",
|
|
@@ -1881,7 +1875,7 @@ class je {
|
|
|
1881
1875
|
const r = t.label || t.id;
|
|
1882
1876
|
switch (this._normalizeControlType(t.type)) {
|
|
1883
1877
|
case "slider":
|
|
1884
|
-
return
|
|
1878
|
+
return ne({
|
|
1885
1879
|
id: `drawer-${e}-${t.id}`,
|
|
1886
1880
|
label: r,
|
|
1887
1881
|
min: t.min ?? 0,
|
|
@@ -1894,7 +1888,7 @@ class je {
|
|
|
1894
1888
|
}
|
|
1895
1889
|
});
|
|
1896
1890
|
case "toggle":
|
|
1897
|
-
return
|
|
1891
|
+
return le({
|
|
1898
1892
|
id: `drawer-${e}-${t.id}`,
|
|
1899
1893
|
label: r,
|
|
1900
1894
|
checked: !!i,
|
|
@@ -1904,7 +1898,7 @@ class je {
|
|
|
1904
1898
|
}
|
|
1905
1899
|
});
|
|
1906
1900
|
case "color":
|
|
1907
|
-
return
|
|
1901
|
+
return ce({
|
|
1908
1902
|
id: `drawer-${e}-${t.id}`,
|
|
1909
1903
|
label: r,
|
|
1910
1904
|
value: typeof i == "string" && i.startsWith("#") ? i : t.default || "#000000",
|
|
@@ -1915,7 +1909,7 @@ class je {
|
|
|
1915
1909
|
});
|
|
1916
1910
|
case "select": {
|
|
1917
1911
|
const o = this._normalizeOptions(t.options);
|
|
1918
|
-
return
|
|
1912
|
+
return he({
|
|
1919
1913
|
id: `drawer-${e}-${t.id}`,
|
|
1920
1914
|
label: r,
|
|
1921
1915
|
options: o,
|
|
@@ -1928,7 +1922,7 @@ class je {
|
|
|
1928
1922
|
}
|
|
1929
1923
|
case "button": {
|
|
1930
1924
|
const o = u("div", { className: "button-control" });
|
|
1931
|
-
return o.appendChild(
|
|
1925
|
+
return o.appendChild(z({
|
|
1932
1926
|
label: r,
|
|
1933
1927
|
className: "btn-secondary",
|
|
1934
1928
|
onClick: () => {
|
|
@@ -1975,7 +1969,7 @@ class je {
|
|
|
1975
1969
|
this._controls.clear(), (e = this._drawer) == null || e.remove(), this._drawer = null, this._isOpen = !1, this._currentFilterId = null, this._container = null;
|
|
1976
1970
|
}
|
|
1977
1971
|
}
|
|
1978
|
-
class
|
|
1972
|
+
class He {
|
|
1979
1973
|
constructor(e, t) {
|
|
1980
1974
|
this.state = e, this.filterManager = t, this.element = null, this._scrollContainer = null, this._chips = /* @__PURE__ */ new Map(), this._unsubscribers = [], this._onToggle = null, this._onSelect = null;
|
|
1981
1975
|
}
|
|
@@ -2048,11 +2042,11 @@ class qe {
|
|
|
2048
2042
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
2049
2043
|
}
|
|
2050
2044
|
}
|
|
2051
|
-
const
|
|
2052
|
-
{ id: "free", name: "Free", icon:
|
|
2053
|
-
{ id: "square", name: "Square", icon:
|
|
2054
|
-
{ id: "circle", name: "Circle", icon:
|
|
2055
|
-
],
|
|
2045
|
+
const $e = [
|
|
2046
|
+
{ id: "free", name: "Free", icon: Oe },
|
|
2047
|
+
{ id: "square", name: "Square", icon: Ye },
|
|
2048
|
+
{ id: "circle", name: "Circle", icon: Be }
|
|
2049
|
+
], We = [
|
|
2056
2050
|
{ id: "free", name: "Free" },
|
|
2057
2051
|
{ id: "1:1", name: "1:1" },
|
|
2058
2052
|
{ id: "4:3", name: "4:3" },
|
|
@@ -2060,7 +2054,7 @@ const He = [
|
|
|
2060
2054
|
{ id: "3:2", name: "3:2" },
|
|
2061
2055
|
{ id: "2:3", name: "2:3" }
|
|
2062
2056
|
];
|
|
2063
|
-
class
|
|
2057
|
+
class Ze {
|
|
2064
2058
|
constructor(e, t) {
|
|
2065
2059
|
this.state = e, this.cropManager = t, this.element = null, this._shapeChips = /* @__PURE__ */ new Map(), this._aspectChips = /* @__PURE__ */ new Map(), this._unsubscribers = [];
|
|
2066
2060
|
}
|
|
@@ -2076,8 +2070,8 @@ class We {
|
|
|
2076
2070
|
const e = u("div", { className: "crop-section" });
|
|
2077
2071
|
e.appendChild(u("label", { className: "section-label" }, "Shape"));
|
|
2078
2072
|
const t = u("div", { className: "chip-row" }), i = this.state.get("crop.shape");
|
|
2079
|
-
|
|
2080
|
-
const d =
|
|
2073
|
+
$e.forEach((c) => {
|
|
2074
|
+
const d = W({
|
|
2081
2075
|
label: c.name,
|
|
2082
2076
|
icon: c.icon,
|
|
2083
2077
|
active: i === c.id,
|
|
@@ -2086,25 +2080,25 @@ class We {
|
|
|
2086
2080
|
d.dataset.shape = c.id, d.dataset.testid = `crop-shape-${c.id}`, this._shapeChips.set(c.id, d), t.appendChild(d);
|
|
2087
2081
|
}), e.appendChild(t), this.element.appendChild(e), this.state.get("lockCropShape") && (e.style.display = "none"), this._shapeSection = e, this._aspectSection = u("div", { className: "crop-section" }), this._aspectSection.appendChild(u("label", { className: "section-label" }, "Aspect Ratio"));
|
|
2088
2082
|
const r = u("div", { className: "chip-row aspect-row" }), a = this.state.get("crop.aspect");
|
|
2089
|
-
|
|
2090
|
-
const d =
|
|
2083
|
+
We.forEach((c) => {
|
|
2084
|
+
const d = W({
|
|
2091
2085
|
label: c.name,
|
|
2092
2086
|
active: a === c.id,
|
|
2093
2087
|
onClick: () => this._selectAspect(c.id)
|
|
2094
2088
|
});
|
|
2095
2089
|
d.dataset.ratio = c.id, d.dataset.testid = `crop-ratio-${c.id}`, this._aspectChips.set(c.id, d), r.appendChild(d);
|
|
2096
2090
|
}), this._aspectSection.appendChild(r), this.element.appendChild(this._aspectSection), this._updateAspectVisibility();
|
|
2097
|
-
const o = u("div", { className: "crop-actions" }), n =
|
|
2091
|
+
const o = u("div", { className: "crop-actions" }), n = z({
|
|
2098
2092
|
label: "Cancel",
|
|
2099
2093
|
className: "btn-secondary crop-cancel-btn",
|
|
2100
|
-
icon:
|
|
2094
|
+
icon: G,
|
|
2101
2095
|
onClick: () => this.cropManager.cancel()
|
|
2102
2096
|
});
|
|
2103
2097
|
n.dataset.testid = "cancel-crop";
|
|
2104
|
-
const l =
|
|
2098
|
+
const l = z({
|
|
2105
2099
|
label: "Apply Crop",
|
|
2106
2100
|
className: "btn-primary crop-apply-btn",
|
|
2107
|
-
icon:
|
|
2101
|
+
icon: Z,
|
|
2108
2102
|
onClick: () => this.cropManager.apply()
|
|
2109
2103
|
});
|
|
2110
2104
|
return l.dataset.testid = "apply-crop", o.appendChild(n), o.appendChild(l), this.element.appendChild(o), this._subscribeToState(), this.element;
|
|
@@ -2167,7 +2161,7 @@ class We {
|
|
|
2167
2161
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._shapeChips.clear(), this._aspectChips.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
2168
2162
|
}
|
|
2169
2163
|
}
|
|
2170
|
-
class
|
|
2164
|
+
class Ge {
|
|
2171
2165
|
constructor(e, t) {
|
|
2172
2166
|
this.state = e, this.filterManager = t, this.element = null, this._filterItems = /* @__PURE__ */ new Map(), this._unsubscribers = [], this._onRemove = null, this._onReset = null, this._onClearAll = null, this._onUpdateValue = null, this._onSelect = null;
|
|
2173
2167
|
}
|
|
@@ -2183,7 +2177,7 @@ class Ze {
|
|
|
2183
2177
|
});
|
|
2184
2178
|
const o = u("div", { className: "panel-header" });
|
|
2185
2179
|
o.appendChild(u("h3", { className: "panel-title" }, "Active Filters"));
|
|
2186
|
-
const n =
|
|
2180
|
+
const n = z({
|
|
2187
2181
|
label: "Clear All",
|
|
2188
2182
|
className: "btn-text btn-danger",
|
|
2189
2183
|
onClick: () => this._handleClearAll()
|
|
@@ -2249,13 +2243,13 @@ class Ze {
|
|
|
2249
2243
|
onClick: (m) => {
|
|
2250
2244
|
m.target.closest(".filter-item-actions") || this._handleSelect(e);
|
|
2251
2245
|
}
|
|
2252
|
-
}), o = u("div", { className: "filter-item-header" }), n = u("span", { className: "filter-item-name" }, t.name), l = u("div", { className: "filter-item-actions" }), c =
|
|
2253
|
-
icon:
|
|
2246
|
+
}), o = u("div", { className: "filter-item-header" }), n = u("span", { className: "filter-item-name" }, t.name), l = u("div", { className: "filter-item-actions" }), c = x({
|
|
2247
|
+
icon: fe,
|
|
2254
2248
|
title: "Reset filter",
|
|
2255
2249
|
className: "btn-icon-sm",
|
|
2256
2250
|
onClick: () => this._handleReset(e)
|
|
2257
|
-
}), d =
|
|
2258
|
-
icon:
|
|
2251
|
+
}), d = x({
|
|
2252
|
+
icon: Ee,
|
|
2259
2253
|
title: "Remove filter",
|
|
2260
2254
|
className: "btn-icon-sm btn-danger",
|
|
2261
2255
|
onClick: () => this._handleRemove(e)
|
|
@@ -2368,7 +2362,7 @@ class Ze {
|
|
|
2368
2362
|
this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._filterItems.clear(), (e = this.element) == null || e.remove(), this.element = null;
|
|
2369
2363
|
}
|
|
2370
2364
|
}
|
|
2371
|
-
const
|
|
2365
|
+
const B = {
|
|
2372
2366
|
name: "free",
|
|
2373
2367
|
initialMode: "filters",
|
|
2374
2368
|
cropShape: "free",
|
|
@@ -2380,12 +2374,12 @@ const Y = {
|
|
|
2380
2374
|
showCropControls: !0,
|
|
2381
2375
|
maxExportWidth: void 0,
|
|
2382
2376
|
maxExportHeight: void 0
|
|
2383
|
-
},
|
|
2377
|
+
}, q = {
|
|
2384
2378
|
free: {
|
|
2385
|
-
...
|
|
2379
|
+
...B
|
|
2386
2380
|
},
|
|
2387
2381
|
avatar: {
|
|
2388
|
-
...
|
|
2382
|
+
...B,
|
|
2389
2383
|
name: "avatar",
|
|
2390
2384
|
initialMode: "crop",
|
|
2391
2385
|
cropShape: "circle",
|
|
@@ -2395,7 +2389,7 @@ const Y = {
|
|
|
2395
2389
|
lockAspectRatio: !0
|
|
2396
2390
|
},
|
|
2397
2391
|
banner: {
|
|
2398
|
-
...
|
|
2392
|
+
...B,
|
|
2399
2393
|
name: "banner",
|
|
2400
2394
|
initialMode: "crop",
|
|
2401
2395
|
cropShape: "square",
|
|
@@ -2405,7 +2399,7 @@ const Y = {
|
|
|
2405
2399
|
lockAspectRatio: !0
|
|
2406
2400
|
},
|
|
2407
2401
|
product: {
|
|
2408
|
-
...
|
|
2402
|
+
...B,
|
|
2409
2403
|
name: "product",
|
|
2410
2404
|
initialMode: "filters",
|
|
2411
2405
|
cropShape: "square",
|
|
@@ -2415,15 +2409,15 @@ const Y = {
|
|
|
2415
2409
|
lockAspectRatio: !1
|
|
2416
2410
|
}
|
|
2417
2411
|
};
|
|
2418
|
-
function
|
|
2412
|
+
function Ke(s) {
|
|
2419
2413
|
if (!s)
|
|
2420
|
-
return { ...
|
|
2414
|
+
return { ...q.free };
|
|
2421
2415
|
if (typeof s == "object" && s !== null)
|
|
2422
|
-
return { ...
|
|
2423
|
-
const e =
|
|
2424
|
-
return e ? { ...e } : { ...
|
|
2416
|
+
return { ...B, ...s };
|
|
2417
|
+
const e = q[s];
|
|
2418
|
+
return e ? { ...e } : { ...q.free };
|
|
2425
2419
|
}
|
|
2426
|
-
class
|
|
2420
|
+
class Kt extends O {
|
|
2427
2421
|
/**
|
|
2428
2422
|
* Create a new VanillaImageEditor
|
|
2429
2423
|
* @param {HTMLElement} container - Container element to mount the editor
|
|
@@ -2434,7 +2428,7 @@ class Gt extends B {
|
|
|
2434
2428
|
if (super(), !e)
|
|
2435
2429
|
throw new Error("VanillaImageEditor: container element is required");
|
|
2436
2430
|
this._container = e;
|
|
2437
|
-
const i = t.preset ?
|
|
2431
|
+
const i = t.preset ? Ke(t.preset) : null, r = i ? {
|
|
2438
2432
|
initialMode: i.initialMode === "crop" ? "crop" : "adjust",
|
|
2439
2433
|
cropShape: i.cropShape,
|
|
2440
2434
|
initialAspectRatio: i.aspectRatio
|
|
@@ -2452,7 +2446,7 @@ class Gt extends B {
|
|
|
2452
2446
|
},
|
|
2453
2447
|
...r,
|
|
2454
2448
|
...t
|
|
2455
|
-
}, this._preset = i, this._state =
|
|
2449
|
+
}, this._preset = i, this._state = xe(), this._state.set("theme", this._options.theme), this._state.set("crop.shape", this._options.cropShape), this._state.set("crop.aspect", this._options.initialAspectRatio), this._preset && (this._state.set("lockCropShape", !!this._preset.lockCropShape), this._state.set("lockAspectRatio", !!this._preset.lockAspectRatio), this._state.set("showFilters", this._preset.showFilters !== !1), this._state.set("showCropControls", this._preset.showCropControls !== !1), this._state.set("autoZoomOnCropOverflow", !!this._preset.autoZoomOnCropOverflow)), this._renderer = new Ce(), this._filterManager = new Se(this._state, this._renderer), this._cropManager = new $(this._state, this._renderer), this._removeBgManager = null, ((a = this._options.backgroundRemoval) == null ? void 0 : a.enabled) !== !1 && (this._removeBgManager = new ve({
|
|
2456
2450
|
endpoint: (o = this._options.backgroundRemoval) == null ? void 0 : o.endpoint,
|
|
2457
2451
|
fallbackEndpoint: (n = this._options.backgroundRemoval) == null ? void 0 : n.fallbackEndpoint
|
|
2458
2452
|
})), this._loadingOverlay = null, this._isMobile = typeof window < "u" ? window.innerWidth <= 768 : !1, this._toolbar = null, this._categoryCarousel = null, this._filterCarousel = null, this._filterAdjustments = null, this._mobileFilterDrawer = null, this._mobileActiveFilters = null, this._cropControls = null, this._activeFiltersPanel = null, this._editorEl = null, this._canvasContainer = null, this._cropOverlay = null, this._controlsSection = null, this._filterControlsEl = null, this._fileInput = null, this._resizeObserver = null, this._init();
|
|
@@ -2488,31 +2482,31 @@ class Gt extends B {
|
|
|
2488
2482
|
* Initialize UI components
|
|
2489
2483
|
*/
|
|
2490
2484
|
_initUI() {
|
|
2491
|
-
this._toolbar = new
|
|
2485
|
+
this._toolbar = new De(this._state, this), this._toolbarContainer.appendChild(this._toolbar.render()), this._filterControlsEl = u("div", { className: "filter-controls-container" }), this._categoryCarousel = new Ue(this._state, this), this._filterControlsEl.appendChild(this._categoryCarousel.render((r) => {
|
|
2492
2486
|
}));
|
|
2493
2487
|
const e = u("div", { className: "filter-layout" }), t = u("div", { className: "filter-left-column" });
|
|
2494
|
-
this._filterCarousel = new
|
|
2488
|
+
this._filterCarousel = new Ve(this._state, this._filterManager), t.appendChild(this._filterCarousel.render({
|
|
2495
2489
|
onToggle: (r, a) => this._handleFilterToggle(r, a),
|
|
2496
2490
|
onSelect: (r) => {
|
|
2497
2491
|
this._handleFilterSelect(r), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(r);
|
|
2498
2492
|
}
|
|
2499
|
-
})), this._filterAdjustments = new
|
|
2493
|
+
})), this._filterAdjustments = new je(this._state, this._filterManager), t.appendChild(this._filterAdjustments.render({
|
|
2500
2494
|
onChange: (r, a, o) => this._handleFilterChange(r, a, o),
|
|
2501
2495
|
onReset: (r) => this._handleFilterReset(r),
|
|
2502
2496
|
onAction: (r, a) => this._handleFilterAction(r, a)
|
|
2503
2497
|
})), e.appendChild(t);
|
|
2504
2498
|
const i = u("div", { className: "filter-right-column" });
|
|
2505
|
-
this._activeFiltersPanel = new
|
|
2499
|
+
this._activeFiltersPanel = new Ge(this._state, this._filterManager), i.appendChild(this._activeFiltersPanel.render({
|
|
2506
2500
|
onRemove: (r) => this._handleFilterToggle(r, !1),
|
|
2507
2501
|
onReset: (r) => this._handleFilterReset(r),
|
|
2508
2502
|
onClearAll: () => this.resetAll(),
|
|
2509
2503
|
onSelect: (r) => this._handleFilterSelect(r)
|
|
2510
|
-
})), e.appendChild(i), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new
|
|
2504
|
+
})), e.appendChild(i), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new He(this._state, this._filterManager), this._filterControlsEl.appendChild(this._mobileActiveFilters.render({
|
|
2511
2505
|
onToggle: (r, a) => this._handleFilterToggle(r, a),
|
|
2512
2506
|
onSelect: (r) => {
|
|
2513
2507
|
this._handleFilterSelect(r), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(r);
|
|
2514
2508
|
}
|
|
2515
|
-
})), this._cropControls = new
|
|
2509
|
+
})), this._cropControls = new Ze(this._state, this._cropManager), this._cropControlsEl = this._cropControls.render(), this._cropControlsEl.style.display = "none", this._controlsSection.appendChild(this._filterControlsEl), this._controlsSection.appendChild(this._cropControlsEl), this._mobileFilterDrawer = new qe(this._state, this._filterManager), this._mobileFilterDrawer.build(this._controlsSection, {
|
|
2516
2510
|
onChange: (r, a, o) => this._handleFilterChange(r, a, o),
|
|
2517
2511
|
onReset: (r) => this._handleFilterReset(r),
|
|
2518
2512
|
onRemove: (r) => {
|
|
@@ -2808,26 +2802,26 @@ class Gt extends B {
|
|
|
2808
2802
|
(e = this._resizeObserver) == null || e.disconnect(), this._renderer.destroy(), this._cropManager.disable(), this._handleWindowResize && window.removeEventListener("resize", this._handleWindowResize), (t = this._toolbar) == null || t.destroy(), (i = this._categoryCarousel) == null || i.destroy(), (r = this._filterCarousel) == null || r.destroy(), (a = this._filterAdjustments) == null || a.destroy(), (o = this._mobileFilterDrawer) == null || o.destroy(), (n = this._mobileActiveFilters) == null || n.destroy(), (l = this._cropControls) == null || l.destroy(), (c = this._activeFiltersPanel) == null || c.destroy(), (d = this._editorEl) == null || d.remove(), this._container = null, this._state = null, this.emit("destroyed"), this.removeAllListeners();
|
|
2809
2803
|
}
|
|
2810
2804
|
}
|
|
2811
|
-
const
|
|
2812
|
-
function
|
|
2805
|
+
const P = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
|
|
2806
|
+
function Qe(s, e) {
|
|
2813
2807
|
return !Array.isArray(s.mediaTargets) || s.mediaTargets.length === 0 ? !0 : s.mediaTargets.includes(e);
|
|
2814
2808
|
}
|
|
2815
2809
|
function f(s) {
|
|
2816
2810
|
var e;
|
|
2817
|
-
return
|
|
2811
|
+
return P.has(s.id), P.set(s.id, s), I.has(s.category) || I.set(s.category, []), (e = I.get(s.category)) == null || e.push(s.id), s;
|
|
2818
2812
|
}
|
|
2819
|
-
function
|
|
2820
|
-
return
|
|
2813
|
+
function Je(s) {
|
|
2814
|
+
return P.get(s);
|
|
2821
2815
|
}
|
|
2822
|
-
function
|
|
2823
|
-
return Array.from(
|
|
2816
|
+
function U() {
|
|
2817
|
+
return Array.from(P.values());
|
|
2824
2818
|
}
|
|
2825
|
-
function
|
|
2826
|
-
|
|
2819
|
+
function et() {
|
|
2820
|
+
U().map((t) => t.id), Object.entries(g).filter(
|
|
2827
2821
|
(t) => /Filter$/.test(t[0]) && typeof t[1] == "function"
|
|
2828
2822
|
).forEach(([t, i]) => {
|
|
2829
2823
|
const r = t.replace(/Filter$/, "").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2830
|
-
|
|
2824
|
+
P.has(r) || f({
|
|
2831
2825
|
id: r,
|
|
2832
2826
|
name: t.replace(/Filter$/, ""),
|
|
2833
2827
|
category: "unlisted",
|
|
@@ -2846,33 +2840,33 @@ function Je() {
|
|
|
2846
2840
|
});
|
|
2847
2841
|
});
|
|
2848
2842
|
}
|
|
2849
|
-
function
|
|
2850
|
-
return (
|
|
2843
|
+
function tt(s) {
|
|
2844
|
+
return (I.get(s) || []).map((t) => P.get(t)).filter(Boolean);
|
|
2851
2845
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return Array.from(
|
|
2846
|
+
function it() {
|
|
2847
|
+
return Array.from(I.keys());
|
|
2854
2848
|
}
|
|
2855
|
-
function
|
|
2856
|
-
return
|
|
2849
|
+
function Qt(s) {
|
|
2850
|
+
return P.has(s);
|
|
2857
2851
|
}
|
|
2858
|
-
function
|
|
2859
|
-
const e =
|
|
2852
|
+
function rt(s) {
|
|
2853
|
+
const e = P.get(s);
|
|
2860
2854
|
if (!e)
|
|
2861
2855
|
return !1;
|
|
2862
|
-
|
|
2863
|
-
const t =
|
|
2856
|
+
P.delete(s);
|
|
2857
|
+
const t = I.get(e.category);
|
|
2864
2858
|
if (t) {
|
|
2865
2859
|
const i = t.indexOf(s);
|
|
2866
|
-
i !== -1 && t.splice(i, 1), t.length === 0 &&
|
|
2860
|
+
i !== -1 && t.splice(i, 1), t.length === 0 && I.delete(e.category);
|
|
2867
2861
|
}
|
|
2868
2862
|
return !0;
|
|
2869
2863
|
}
|
|
2870
|
-
function
|
|
2871
|
-
const t =
|
|
2872
|
-
return t ?
|
|
2864
|
+
function Jt(s, e) {
|
|
2865
|
+
const t = P.get(s);
|
|
2866
|
+
return t ? Qe(t, e) : !1;
|
|
2873
2867
|
}
|
|
2874
|
-
function
|
|
2875
|
-
return Array.from(
|
|
2868
|
+
function st() {
|
|
2869
|
+
return Array.from(P.values()).map((s) => ({
|
|
2876
2870
|
id: s.id,
|
|
2877
2871
|
name: s.name,
|
|
2878
2872
|
category: s.category,
|
|
@@ -2880,17 +2874,17 @@ function rt() {
|
|
|
2880
2874
|
}));
|
|
2881
2875
|
}
|
|
2882
2876
|
if (typeof window < "u") {
|
|
2883
|
-
window.__DEBUG_FILTERS_LIST = Array.from(
|
|
2877
|
+
window.__DEBUG_FILTERS_LIST = Array.from(P.keys()), window.getAllFilters = U, window.getFilter = Je, window.getFiltersByCategory = tt, window.getRegisteredFilters = st;
|
|
2884
2878
|
const s = f;
|
|
2885
2879
|
window.registerFilter = (e) => {
|
|
2886
2880
|
const t = s(e);
|
|
2887
|
-
return window.__DEBUG_FILTERS_LIST = Array.from(
|
|
2881
|
+
return window.__DEBUG_FILTERS_LIST = Array.from(P.keys()), t;
|
|
2888
2882
|
};
|
|
2889
2883
|
}
|
|
2890
2884
|
typeof window < "u" && (window.initializeFilterRegistry = window.initializeFilterRegistry || function() {
|
|
2891
2885
|
return [];
|
|
2892
2886
|
});
|
|
2893
|
-
const { AdjustmentFilter:
|
|
2887
|
+
const { AdjustmentFilter: at } = g, { ColorMatrixFilter: ot } = w, M = {
|
|
2894
2888
|
gamma: 1,
|
|
2895
2889
|
saturation: 1,
|
|
2896
2890
|
contrast: 1,
|
|
@@ -2899,7 +2893,7 @@ const { AdjustmentFilter: st } = g, { ColorMatrixFilter: at } = w, k = {
|
|
|
2899
2893
|
green: 1,
|
|
2900
2894
|
blue: 1,
|
|
2901
2895
|
alpha: 1
|
|
2902
|
-
},
|
|
2896
|
+
}, nt = /* @__PURE__ */ new Set([
|
|
2903
2897
|
"gamma",
|
|
2904
2898
|
"saturation",
|
|
2905
2899
|
"contrast",
|
|
@@ -2909,7 +2903,7 @@ const { AdjustmentFilter: st } = g, { ColorMatrixFilter: at } = w, k = {
|
|
|
2909
2903
|
"blue",
|
|
2910
2904
|
"alpha"
|
|
2911
2905
|
]);
|
|
2912
|
-
function
|
|
2906
|
+
function F(s, e) {
|
|
2913
2907
|
if (typeof s == "number" && Number.isFinite(s))
|
|
2914
2908
|
return s;
|
|
2915
2909
|
if (typeof s == "string") {
|
|
@@ -2919,22 +2913,22 @@ function P(s, e) {
|
|
|
2919
2913
|
}
|
|
2920
2914
|
return e;
|
|
2921
2915
|
}
|
|
2922
|
-
function
|
|
2923
|
-
return
|
|
2916
|
+
function te(s) {
|
|
2917
|
+
return nt.has(s);
|
|
2924
2918
|
}
|
|
2925
|
-
function
|
|
2919
|
+
function lt(s) {
|
|
2926
2920
|
return {
|
|
2927
|
-
gamma:
|
|
2928
|
-
saturation:
|
|
2929
|
-
contrast:
|
|
2930
|
-
brightness:
|
|
2931
|
-
red:
|
|
2932
|
-
green:
|
|
2933
|
-
blue:
|
|
2934
|
-
alpha:
|
|
2921
|
+
gamma: F(s.gamma, M.gamma),
|
|
2922
|
+
saturation: F(s.saturation, M.saturation),
|
|
2923
|
+
contrast: F(s.contrast, M.contrast),
|
|
2924
|
+
brightness: F(s.brightness, M.brightness),
|
|
2925
|
+
red: F(s.red, M.red),
|
|
2926
|
+
green: F(s.green, M.green),
|
|
2927
|
+
blue: F(s.blue, M.blue),
|
|
2928
|
+
alpha: F(s.alpha, M.alpha)
|
|
2935
2929
|
};
|
|
2936
2930
|
}
|
|
2937
|
-
function
|
|
2931
|
+
function ie(s, e) {
|
|
2938
2932
|
s.reset(), s.brightness(e.brightness, !0), s.contrast(e.contrast, !0), s.saturate(e.saturation, !0);
|
|
2939
2933
|
}
|
|
2940
2934
|
f({
|
|
@@ -2945,14 +2939,14 @@ f({
|
|
|
2945
2939
|
// Create an instance of the AdjustmentFilter with the provided parameters
|
|
2946
2940
|
createFilter: (s) => {
|
|
2947
2941
|
try {
|
|
2948
|
-
const e =
|
|
2942
|
+
const e = lt(s ?? {}), t = { ...e };
|
|
2949
2943
|
try {
|
|
2950
|
-
const i = new
|
|
2944
|
+
const i = new at(t), r = i;
|
|
2951
2945
|
return r._customParams = { ...e }, r.updateUIParam = function(o, n) {
|
|
2952
2946
|
try {
|
|
2953
|
-
if (!
|
|
2947
|
+
if (!te(o))
|
|
2954
2948
|
return;
|
|
2955
|
-
const l = this._customParams ?? { ...
|
|
2949
|
+
const l = this._customParams ?? { ...M }, c = F(n, l[o]);
|
|
2956
2950
|
l[o] = c, this._customParams = l;
|
|
2957
2951
|
const d = this;
|
|
2958
2952
|
o in d && (d[o] = c);
|
|
@@ -2960,13 +2954,13 @@ f({
|
|
|
2960
2954
|
}
|
|
2961
2955
|
}, i;
|
|
2962
2956
|
} catch {
|
|
2963
|
-
const r = new
|
|
2964
|
-
return a._customParams = { ...e },
|
|
2957
|
+
const r = new ot(), a = r;
|
|
2958
|
+
return a._customParams = { ...e }, ie(r, e), a.updateUIParam = function(n, l) {
|
|
2965
2959
|
try {
|
|
2966
|
-
if (!
|
|
2960
|
+
if (!te(n))
|
|
2967
2961
|
return;
|
|
2968
|
-
const c = this._customParams ?? { ...
|
|
2969
|
-
c[n] = d, this._customParams = c,
|
|
2962
|
+
const c = this._customParams ?? { ...M }, d = F(l, c[n]);
|
|
2963
|
+
c[n] = d, this._customParams = c, ie(this, c);
|
|
2970
2964
|
} catch {
|
|
2971
2965
|
}
|
|
2972
2966
|
}, r;
|
|
@@ -3070,14 +3064,14 @@ f({
|
|
|
3070
3064
|
}
|
|
3071
3065
|
]
|
|
3072
3066
|
});
|
|
3073
|
-
const { ColorMatrixFilter:
|
|
3067
|
+
const { ColorMatrixFilter: ct } = w, R = {
|
|
3074
3068
|
brightness: 1,
|
|
3075
3069
|
contrast: 1,
|
|
3076
3070
|
saturation: 1,
|
|
3077
3071
|
hue: 0,
|
|
3078
3072
|
sepia: 0,
|
|
3079
3073
|
negative: !1
|
|
3080
|
-
},
|
|
3074
|
+
}, ht = /* @__PURE__ */ new Set([
|
|
3081
3075
|
"brightness",
|
|
3082
3076
|
"contrast",
|
|
3083
3077
|
"saturation",
|
|
@@ -3085,8 +3079,8 @@ const { ColorMatrixFilter: lt } = w, N = {
|
|
|
3085
3079
|
"sepia",
|
|
3086
3080
|
"negative"
|
|
3087
3081
|
]);
|
|
3088
|
-
function
|
|
3089
|
-
return
|
|
3082
|
+
function dt(s) {
|
|
3083
|
+
return ht.has(s);
|
|
3090
3084
|
}
|
|
3091
3085
|
function X(s, e) {
|
|
3092
3086
|
if (typeof s == "number" && Number.isFinite(s))
|
|
@@ -3098,7 +3092,7 @@ function X(s, e) {
|
|
|
3098
3092
|
}
|
|
3099
3093
|
return e;
|
|
3100
3094
|
}
|
|
3101
|
-
function
|
|
3095
|
+
function me(s, e) {
|
|
3102
3096
|
if (typeof s == "boolean")
|
|
3103
3097
|
return s;
|
|
3104
3098
|
if (typeof s == "string") {
|
|
@@ -3109,17 +3103,17 @@ function ue(s, e) {
|
|
|
3109
3103
|
}
|
|
3110
3104
|
return e;
|
|
3111
3105
|
}
|
|
3112
|
-
function
|
|
3106
|
+
function ut(s) {
|
|
3113
3107
|
return {
|
|
3114
|
-
brightness: X(s.brightness,
|
|
3115
|
-
contrast: X(s.contrast,
|
|
3116
|
-
saturation: X(s.saturation,
|
|
3117
|
-
hue: X(s.hue,
|
|
3118
|
-
sepia: X(s.sepia,
|
|
3119
|
-
negative:
|
|
3108
|
+
brightness: X(s.brightness, R.brightness),
|
|
3109
|
+
contrast: X(s.contrast, R.contrast),
|
|
3110
|
+
saturation: X(s.saturation, R.saturation),
|
|
3111
|
+
hue: X(s.hue, R.hue),
|
|
3112
|
+
sepia: X(s.sepia, R.sepia),
|
|
3113
|
+
negative: me(s.negative, R.negative)
|
|
3120
3114
|
};
|
|
3121
3115
|
}
|
|
3122
|
-
function
|
|
3116
|
+
function re(s, e) {
|
|
3123
3117
|
s.reset(), e.brightness !== 1 && s.brightness(e.brightness, !0), e.contrast !== 1 && s.contrast(e.contrast, !0), e.saturation !== 1 && s.saturate(e.saturation, !0), e.hue !== 0 && s.hue(e.hue, !0), e.sepia > 0 && s.sepia(!0), e.negative && s.negative(!0);
|
|
3124
3118
|
}
|
|
3125
3119
|
f({
|
|
@@ -3130,19 +3124,19 @@ f({
|
|
|
3130
3124
|
// Create an instance of the ColorMatrixFilter with the provided parameters
|
|
3131
3125
|
createFilter: (s) => {
|
|
3132
3126
|
try {
|
|
3133
|
-
const e =
|
|
3134
|
-
return i._customParams = { ...e },
|
|
3127
|
+
const e = ut(s ?? {}), t = new ct(), i = t;
|
|
3128
|
+
return i._customParams = { ...e }, re(t, e), i.updateUIParam = function(a, o) {
|
|
3135
3129
|
try {
|
|
3136
|
-
if (!
|
|
3130
|
+
if (!dt(a))
|
|
3137
3131
|
return;
|
|
3138
|
-
const n = this._customParams ?? { ...
|
|
3132
|
+
const n = this._customParams ?? { ...R };
|
|
3139
3133
|
if (a === "negative")
|
|
3140
|
-
n.negative =
|
|
3134
|
+
n.negative = me(o, n.negative);
|
|
3141
3135
|
else {
|
|
3142
3136
|
const l = a;
|
|
3143
3137
|
n[l] = X(o, n[l]);
|
|
3144
3138
|
}
|
|
3145
|
-
this._customParams = n,
|
|
3139
|
+
this._customParams = n, re(this, n);
|
|
3146
3140
|
} catch {
|
|
3147
3141
|
}
|
|
3148
3142
|
}, t;
|
|
@@ -3414,7 +3408,7 @@ f({
|
|
|
3414
3408
|
}
|
|
3415
3409
|
]
|
|
3416
3410
|
});
|
|
3417
|
-
const { ColorOverlayFilter:
|
|
3411
|
+
const { ColorOverlayFilter: pt } = g;
|
|
3418
3412
|
f({
|
|
3419
3413
|
id: "colorOverlay",
|
|
3420
3414
|
name: "Color Overlay",
|
|
@@ -3429,7 +3423,7 @@ f({
|
|
|
3429
3423
|
try {
|
|
3430
3424
|
let e = 16711680;
|
|
3431
3425
|
s.color && (typeof s.color == "string" ? e = parseInt(s.color.replace("#", "0x"), 16) : typeof s.color == "number" && (e = s.color));
|
|
3432
|
-
const t = new
|
|
3426
|
+
const t = new pt({
|
|
3433
3427
|
color: e,
|
|
3434
3428
|
alpha: s.alpha || 0.5
|
|
3435
3429
|
});
|
|
@@ -3661,7 +3655,7 @@ f({
|
|
|
3661
3655
|
}
|
|
3662
3656
|
]
|
|
3663
3657
|
});
|
|
3664
|
-
const { ColorMatrixFilter:
|
|
3658
|
+
const { ColorMatrixFilter: ft } = w;
|
|
3665
3659
|
f({
|
|
3666
3660
|
id: "grayscale",
|
|
3667
3661
|
name: "Grayscale",
|
|
@@ -3674,14 +3668,14 @@ f({
|
|
|
3674
3668
|
*/
|
|
3675
3669
|
createFilter: (s) => {
|
|
3676
3670
|
try {
|
|
3677
|
-
const e = new
|
|
3671
|
+
const e = new ft();
|
|
3678
3672
|
e._customParams = { ...s };
|
|
3679
3673
|
const t = s.intensity !== void 0 ? s.intensity : 1;
|
|
3680
|
-
return
|
|
3674
|
+
return se(e, t), e.updateUIParam = function(i, r) {
|
|
3681
3675
|
const a = this._customParams || {};
|
|
3682
3676
|
switch (this._customParams = a, a[i] = r, i) {
|
|
3683
3677
|
case "intensity":
|
|
3684
|
-
|
|
3678
|
+
se(this, r);
|
|
3685
3679
|
break;
|
|
3686
3680
|
default:
|
|
3687
3681
|
i in this && (this[i] = r);
|
|
@@ -3711,10 +3705,10 @@ f({
|
|
|
3711
3705
|
}
|
|
3712
3706
|
]
|
|
3713
3707
|
});
|
|
3714
|
-
function
|
|
3708
|
+
function se(s, e) {
|
|
3715
3709
|
s.reset(), s.greyscale(e);
|
|
3716
3710
|
}
|
|
3717
|
-
const { HslAdjustmentFilter:
|
|
3711
|
+
const { HslAdjustmentFilter: mt } = g;
|
|
3718
3712
|
f({
|
|
3719
3713
|
id: "hsl-adjustment",
|
|
3720
3714
|
name: "HSL Adjustment",
|
|
@@ -3726,7 +3720,7 @@ f({
|
|
|
3726
3720
|
*/
|
|
3727
3721
|
createFilter: (s) => {
|
|
3728
3722
|
try {
|
|
3729
|
-
const e = new
|
|
3723
|
+
const e = new mt({
|
|
3730
3724
|
hue: s.hue !== void 0 ? s.hue : 0,
|
|
3731
3725
|
saturation: s.saturation !== void 0 ? s.saturation : 0,
|
|
3732
3726
|
lightness: s.lightness !== void 0 ? s.lightness : 0,
|
|
@@ -3824,7 +3818,7 @@ f({
|
|
|
3824
3818
|
}
|
|
3825
3819
|
]
|
|
3826
3820
|
});
|
|
3827
|
-
const { KawaseBlurFilter:
|
|
3821
|
+
const { KawaseBlurFilter: gt } = g;
|
|
3828
3822
|
f({
|
|
3829
3823
|
id: "kawase-blur",
|
|
3830
3824
|
name: "Kawase Blur",
|
|
@@ -3837,7 +3831,7 @@ f({
|
|
|
3837
3831
|
*/
|
|
3838
3832
|
createFilter: (s) => {
|
|
3839
3833
|
try {
|
|
3840
|
-
const e = new
|
|
3834
|
+
const e = new gt({
|
|
3841
3835
|
strength: s.strength || 4,
|
|
3842
3836
|
quality: s.quality || 3,
|
|
3843
3837
|
clamp: s.clamp || !1,
|
|
@@ -3942,7 +3936,7 @@ f({
|
|
|
3942
3936
|
}
|
|
3943
3937
|
]
|
|
3944
3938
|
});
|
|
3945
|
-
const { MotionBlurFilter:
|
|
3939
|
+
const { MotionBlurFilter: bt } = g;
|
|
3946
3940
|
f({
|
|
3947
3941
|
id: "motion-blur",
|
|
3948
3942
|
name: "Motion Blur",
|
|
@@ -3955,7 +3949,7 @@ f({
|
|
|
3955
3949
|
*/
|
|
3956
3950
|
createFilter: (s) => {
|
|
3957
3951
|
try {
|
|
3958
|
-
const e = new
|
|
3952
|
+
const e = new bt({
|
|
3959
3953
|
velocity: {
|
|
3960
3954
|
x: s.velocityX !== void 0 ? s.velocityX : 0,
|
|
3961
3955
|
y: s.velocityY !== void 0 ? s.velocityY : 0
|
|
@@ -4050,7 +4044,7 @@ f({
|
|
|
4050
4044
|
}
|
|
4051
4045
|
]
|
|
4052
4046
|
});
|
|
4053
|
-
const { RadialBlurFilter:
|
|
4047
|
+
const { RadialBlurFilter: yt } = g;
|
|
4054
4048
|
f({
|
|
4055
4049
|
id: "radial-blur",
|
|
4056
4050
|
name: "Radial Blur",
|
|
@@ -4059,7 +4053,7 @@ f({
|
|
|
4059
4053
|
// Create an instance of the RadialBlurFilter with the provided parameters
|
|
4060
4054
|
createFilter: (s) => {
|
|
4061
4055
|
try {
|
|
4062
|
-
const e = new
|
|
4056
|
+
const e = new yt({
|
|
4063
4057
|
angle: s.angle ?? 20,
|
|
4064
4058
|
center: { x: s.centerX ?? 0, y: s.centerY ?? 0 },
|
|
4065
4059
|
kernelSize: s.kernelSize ?? 15,
|
|
@@ -4174,7 +4168,7 @@ f({
|
|
|
4174
4168
|
}
|
|
4175
4169
|
]
|
|
4176
4170
|
});
|
|
4177
|
-
const { TiltShiftFilter:
|
|
4171
|
+
const { TiltShiftFilter: _t } = g;
|
|
4178
4172
|
f({
|
|
4179
4173
|
id: "tilt-shift",
|
|
4180
4174
|
name: "Tilt Shift",
|
|
@@ -4183,7 +4177,7 @@ f({
|
|
|
4183
4177
|
// Create an instance of the TiltShiftFilter with the provided parameters
|
|
4184
4178
|
createFilter: (s) => {
|
|
4185
4179
|
try {
|
|
4186
|
-
const e = typeof s.blur == "number" ? s.blur : 100, t = typeof s.gradientBlur == "number" ? s.gradientBlur : 600, i = typeof s.startX == "number" ? s.startX : 0, r = typeof s.startY == "number" ? s.startY : 0.5, a = typeof s.endX == "number" ? s.endX : 1, o = typeof s.endY == "number" ? s.endY : 0.5, n = new
|
|
4180
|
+
const e = typeof s.blur == "number" ? s.blur : 100, t = typeof s.gradientBlur == "number" ? s.gradientBlur : 600, i = typeof s.startX == "number" ? s.startX : 0, r = typeof s.startY == "number" ? s.startY : 0.5, a = typeof s.endX == "number" ? s.endX : 1, o = typeof s.endY == "number" ? s.endY : 0.5, n = new _t({
|
|
4187
4181
|
blur: Number(e),
|
|
4188
4182
|
gradientBlur: Number(t),
|
|
4189
4183
|
start: { x: Number(i), y: Number(r) },
|
|
@@ -4302,7 +4296,7 @@ f({
|
|
|
4302
4296
|
}
|
|
4303
4297
|
]
|
|
4304
4298
|
});
|
|
4305
|
-
const { ZoomBlurFilter:
|
|
4299
|
+
const { ZoomBlurFilter: xt } = g;
|
|
4306
4300
|
f({
|
|
4307
4301
|
id: "zoom-blur",
|
|
4308
4302
|
name: "Zoom Blur",
|
|
@@ -4315,7 +4309,7 @@ f({
|
|
|
4315
4309
|
*/
|
|
4316
4310
|
createFilter: (s) => {
|
|
4317
4311
|
try {
|
|
4318
|
-
const e = new
|
|
4312
|
+
const e = new xt({
|
|
4319
4313
|
strength: s.strength || 0.1,
|
|
4320
4314
|
center: {
|
|
4321
4315
|
x: s.centerX !== void 0 ? s.centerX : 0.5,
|
|
@@ -4429,7 +4423,7 @@ f({
|
|
|
4429
4423
|
}
|
|
4430
4424
|
]
|
|
4431
4425
|
});
|
|
4432
|
-
const { ColorGradientFilter:
|
|
4426
|
+
const { ColorGradientFilter: ae } = g;
|
|
4433
4427
|
f({
|
|
4434
4428
|
id: "color-gradient",
|
|
4435
4429
|
name: "Color Gradient",
|
|
@@ -4453,7 +4447,7 @@ f({
|
|
|
4453
4447
|
{ offset: 0, color: 16711680, alpha: 1 },
|
|
4454
4448
|
{ offset: 1, color: 255, alpha: 1 }
|
|
4455
4449
|
]), e.sort((i, r) => i.offset - r.offset);
|
|
4456
|
-
const t = new
|
|
4450
|
+
const t = new ae({
|
|
4457
4451
|
type: s.gradientType,
|
|
4458
4452
|
// 0: linear, 1: radial, 2: conic
|
|
4459
4453
|
stops: e,
|
|
@@ -4543,7 +4537,7 @@ f({
|
|
|
4543
4537
|
case "cssGradient":
|
|
4544
4538
|
if (r && typeof r == "string" && r.trim() !== "")
|
|
4545
4539
|
try {
|
|
4546
|
-
const h = new
|
|
4540
|
+
const h = new ae({ css: r });
|
|
4547
4541
|
this.type = h.type, this.angle = h.angle, this.stops = [...h.stops], a.colorStops = this.stops.map((p) => ({
|
|
4548
4542
|
offset: p.offset,
|
|
4549
4543
|
color: typeof p.color == "number" ? "#" + p.color.toString(16).padStart(6, "0") : p.color,
|
|
@@ -4566,9 +4560,9 @@ f({
|
|
|
4566
4560
|
if (/colorStops\[\d+\]\..*/.test(i)) {
|
|
4567
4561
|
const h = i.match(/colorStops\[(\d+)\]\.(.*)/);
|
|
4568
4562
|
if (h) {
|
|
4569
|
-
const [p, m,
|
|
4570
|
-
if (b >= 0 && b <
|
|
4571
|
-
return
|
|
4563
|
+
const [p, m, C] = h, b = parseInt(m), y = [...this.stops];
|
|
4564
|
+
if (b >= 0 && b < y.length)
|
|
4565
|
+
return C === "color" && typeof r == "string" ? y[b].color = parseInt(r.replace("#", "0x")) : (C === "offset" || C === "alpha") && (y[b][C] = r), this.stops = y, this.stops.sort((v, _) => v.offset - _.offset), a.colorStops = this.getColorStopsForUI(), !0;
|
|
4572
4566
|
}
|
|
4573
4567
|
} else i in this && (this[i] = r);
|
|
4574
4568
|
break;
|
|
@@ -4756,7 +4750,7 @@ f({
|
|
|
4756
4750
|
}
|
|
4757
4751
|
]
|
|
4758
4752
|
});
|
|
4759
|
-
const
|
|
4753
|
+
const Ct = g.ColorReplaceFilter;
|
|
4760
4754
|
f({
|
|
4761
4755
|
id: "color-replace",
|
|
4762
4756
|
name: "Color Replace",
|
|
@@ -4773,7 +4767,7 @@ f({
|
|
|
4773
4767
|
s.originalColor && (typeof s.originalColor == "string" ? e = parseInt(s.originalColor.replace("#", "0x"), 16) : typeof s.originalColor == "number" && (e = s.originalColor));
|
|
4774
4768
|
let t = 255;
|
|
4775
4769
|
s.targetColor && (typeof s.targetColor == "string" ? t = parseInt(s.targetColor.replace("#", "0x"), 16) : typeof s.targetColor == "number" && (t = s.targetColor));
|
|
4776
|
-
const i = new
|
|
4770
|
+
const i = new Ct({
|
|
4777
4771
|
originalColor: e,
|
|
4778
4772
|
targetColor: t,
|
|
4779
4773
|
tolerance: s.tolerance || 0.4
|
|
@@ -4837,7 +4831,7 @@ f({
|
|
|
4837
4831
|
}
|
|
4838
4832
|
]
|
|
4839
4833
|
});
|
|
4840
|
-
const
|
|
4834
|
+
const wt = g.MultiColorReplaceFilter;
|
|
4841
4835
|
f({
|
|
4842
4836
|
id: "multi-color-replace",
|
|
4843
4837
|
name: "Multi-Color Replace",
|
|
@@ -4863,7 +4857,7 @@ f({
|
|
|
4863
4857
|
const i = typeof s.originalColor3 == "string" ? parseInt(s.originalColor3.replace("#", "0x"), 16) : s.originalColor3, r = typeof s.targetColor3 == "string" ? parseInt(s.targetColor3.replace("#", "0x"), 16) : s.targetColor3;
|
|
4864
4858
|
e.push([i, r]);
|
|
4865
4859
|
}
|
|
4866
|
-
const t = new
|
|
4860
|
+
const t = new wt(
|
|
4867
4861
|
e,
|
|
4868
4862
|
s.tolerance || 0.05,
|
|
4869
4863
|
3
|
|
@@ -4974,7 +4968,7 @@ f({
|
|
|
4974
4968
|
}
|
|
4975
4969
|
]
|
|
4976
4970
|
});
|
|
4977
|
-
const { RGBSplitFilter:
|
|
4971
|
+
const { RGBSplitFilter: St } = g;
|
|
4978
4972
|
f({
|
|
4979
4973
|
id: "rgb-split",
|
|
4980
4974
|
name: "RGB Split",
|
|
@@ -4995,7 +4989,7 @@ f({
|
|
|
4995
4989
|
}, i = {
|
|
4996
4990
|
x: s.blueX !== void 0 ? s.blueX : 0,
|
|
4997
4991
|
y: s.blueY !== void 0 ? s.blueY : 0
|
|
4998
|
-
}, r = new
|
|
4992
|
+
}, r = new St({
|
|
4999
4993
|
red: e,
|
|
5000
4994
|
green: t,
|
|
5001
4995
|
blue: i
|
|
@@ -5108,7 +5102,7 @@ f({
|
|
|
5108
5102
|
}
|
|
5109
5103
|
]
|
|
5110
5104
|
});
|
|
5111
|
-
const { AdvancedBloomFilter:
|
|
5105
|
+
const { AdvancedBloomFilter: vt } = g;
|
|
5112
5106
|
f({
|
|
5113
5107
|
id: "advanced-bloom",
|
|
5114
5108
|
name: "Advanced Bloom",
|
|
@@ -5117,7 +5111,7 @@ f({
|
|
|
5117
5111
|
// Create an instance of the AdvancedBloomFilter with the provided parameters
|
|
5118
5112
|
createFilter: (s) => {
|
|
5119
5113
|
try {
|
|
5120
|
-
const e = new
|
|
5114
|
+
const e = new vt({
|
|
5121
5115
|
threshold: s.threshold || 0.5,
|
|
5122
5116
|
bloomScale: s.bloomScale || 1,
|
|
5123
5117
|
brightness: s.brightness || 1,
|
|
@@ -5264,7 +5258,7 @@ f({
|
|
|
5264
5258
|
}
|
|
5265
5259
|
]
|
|
5266
5260
|
});
|
|
5267
|
-
const
|
|
5261
|
+
const kt = g.AsciiFilter;
|
|
5268
5262
|
f({
|
|
5269
5263
|
id: "ascii",
|
|
5270
5264
|
name: "ASCII",
|
|
@@ -5276,7 +5270,7 @@ f({
|
|
|
5276
5270
|
const e = typeof s.size == "number" ? s.size : 8;
|
|
5277
5271
|
let t = s.color;
|
|
5278
5272
|
typeof t == "string" && t.startsWith("#") && (t = parseInt(t.replace("#", "0x"), 16));
|
|
5279
|
-
const i = s.replaceColor === !0, r = new
|
|
5273
|
+
const i = s.replaceColor === !0, r = new kt({
|
|
5280
5274
|
size: e,
|
|
5281
5275
|
color: t,
|
|
5282
5276
|
replaceColor: i
|
|
@@ -5343,7 +5337,7 @@ f({
|
|
|
5343
5337
|
}
|
|
5344
5338
|
]
|
|
5345
5339
|
});
|
|
5346
|
-
const
|
|
5340
|
+
const Pt = g.BackdropBlurFilter;
|
|
5347
5341
|
f({
|
|
5348
5342
|
id: "backdrop-blur",
|
|
5349
5343
|
name: "Backdrop Blur",
|
|
@@ -5352,7 +5346,7 @@ f({
|
|
|
5352
5346
|
// Create an instance of the BackdropBlurFilter with the provided parameters
|
|
5353
5347
|
createFilter: (s) => {
|
|
5354
5348
|
try {
|
|
5355
|
-
const e = new
|
|
5349
|
+
const e = new Pt({
|
|
5356
5350
|
// Higher strength values (20-50) make the effect more noticeable
|
|
5357
5351
|
strength: s.strength || 20,
|
|
5358
5352
|
quality: s.quality || 4,
|
|
@@ -5450,7 +5444,7 @@ f({
|
|
|
5450
5444
|
}
|
|
5451
5445
|
]
|
|
5452
5446
|
});
|
|
5453
|
-
const { BevelFilter:
|
|
5447
|
+
const { BevelFilter: Mt } = g;
|
|
5454
5448
|
f({
|
|
5455
5449
|
id: "bevel",
|
|
5456
5450
|
name: "Bevel",
|
|
@@ -5462,7 +5456,7 @@ f({
|
|
|
5462
5456
|
*/
|
|
5463
5457
|
createFilter: (s) => {
|
|
5464
5458
|
try {
|
|
5465
|
-
const e = s.lightColor ? s.lightColor.replace("#", "0x") : "0xffffff", t = s.shadowColor ? s.shadowColor.replace("#", "0x") : "0x000000", i = new
|
|
5459
|
+
const e = s.lightColor ? s.lightColor.replace("#", "0x") : "0xffffff", t = s.shadowColor ? s.shadowColor.replace("#", "0x") : "0x000000", i = new Mt({
|
|
5466
5460
|
rotation: s.rotation !== void 0 ? s.rotation : 45,
|
|
5467
5461
|
thickness: s.thickness !== void 0 ? s.thickness : 2,
|
|
5468
5462
|
lightColor: parseInt(e, 16),
|
|
@@ -5578,7 +5572,7 @@ f({
|
|
|
5578
5572
|
}
|
|
5579
5573
|
]
|
|
5580
5574
|
});
|
|
5581
|
-
const { BloomFilter:
|
|
5575
|
+
const { BloomFilter: Ft } = g;
|
|
5582
5576
|
f({
|
|
5583
5577
|
id: "bloom",
|
|
5584
5578
|
name: "Bloom/Glow",
|
|
@@ -5587,7 +5581,7 @@ f({
|
|
|
5587
5581
|
// Create an instance of the BloomFilter with the provided parameters
|
|
5588
5582
|
createFilter: (s) => {
|
|
5589
5583
|
try {
|
|
5590
|
-
const e = typeof s.strengthX == "number" ? s.strengthX : 2, t = typeof s.strengthY == "number" ? s.strengthY : 2, i = typeof s.quality == "number" ? s.quality : 4, r = typeof s.resolution == "number" ? s.resolution : 1, a = typeof s.kernelSize == "number" ? s.kernelSize : 5, o = new
|
|
5584
|
+
const e = typeof s.strengthX == "number" ? s.strengthX : 2, t = typeof s.strengthY == "number" ? s.strengthY : 2, i = typeof s.quality == "number" ? s.quality : 4, r = typeof s.resolution == "number" ? s.resolution : 1, a = typeof s.kernelSize == "number" ? s.kernelSize : 5, o = new Ft({
|
|
5591
5585
|
strength: {
|
|
5592
5586
|
x: Number(e),
|
|
5593
5587
|
y: Number(t)
|
|
@@ -5690,7 +5684,7 @@ f({
|
|
|
5690
5684
|
}
|
|
5691
5685
|
]
|
|
5692
5686
|
});
|
|
5693
|
-
const { BulgePinchFilter:
|
|
5687
|
+
const { BulgePinchFilter: At } = g;
|
|
5694
5688
|
f({
|
|
5695
5689
|
id: "bulge-pinch",
|
|
5696
5690
|
// ID must match what the application expects
|
|
@@ -5700,7 +5694,7 @@ f({
|
|
|
5700
5694
|
// Create an instance of the BulgePinchFilter with the provided parameters
|
|
5701
5695
|
createFilter: (s) => {
|
|
5702
5696
|
try {
|
|
5703
|
-
const e = s.centerX ?? 0.5, t = s.centerY ?? 0.5, i = s.radius ?? 100, r = s.strength ?? 1, a = new
|
|
5697
|
+
const e = s.centerX ?? 0.5, t = s.centerY ?? 0.5, i = s.radius ?? 100, r = s.strength ?? 1, a = new At({
|
|
5704
5698
|
center: {
|
|
5705
5699
|
x: e,
|
|
5706
5700
|
y: t
|
|
@@ -5782,7 +5776,7 @@ f({
|
|
|
5782
5776
|
}
|
|
5783
5777
|
]
|
|
5784
5778
|
});
|
|
5785
|
-
const { ConvolutionFilter:
|
|
5779
|
+
const { ConvolutionFilter: zt } = g, E = {
|
|
5786
5780
|
normal: [0, 0, 0, 0, 1, 0, 0, 0, 0],
|
|
5787
5781
|
gaussianBlur: [0.045, 0.122, 0.045, 0.122, 0.332, 0.122, 0.045, 0.122, 0.045],
|
|
5788
5782
|
boxBlur: [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9],
|
|
@@ -5817,7 +5811,7 @@ f({
|
|
|
5817
5811
|
const i = s.preset;
|
|
5818
5812
|
e = E[i] || E.normal;
|
|
5819
5813
|
}
|
|
5820
|
-
const t = new
|
|
5814
|
+
const t = new zt(e, s.width || 200, s.height || 200);
|
|
5821
5815
|
return t._customParams = { ...s }, t.updateUIParam = function(i, r) {
|
|
5822
5816
|
const a = this._customParams || {};
|
|
5823
5817
|
switch (this._customParams = a, a[i] = r, i) {
|
|
@@ -6028,7 +6022,7 @@ f({
|
|
|
6028
6022
|
}
|
|
6029
6023
|
]
|
|
6030
6024
|
});
|
|
6031
|
-
const { CrossHatchFilter:
|
|
6025
|
+
const { CrossHatchFilter: Nt } = g;
|
|
6032
6026
|
f({
|
|
6033
6027
|
id: "cross-hatch",
|
|
6034
6028
|
name: "Cross Hatch",
|
|
@@ -6038,7 +6032,7 @@ f({
|
|
|
6038
6032
|
// Note: CrossHatchFilter has NO parameters according to PixiJS examples
|
|
6039
6033
|
createFilter: (s) => {
|
|
6040
6034
|
try {
|
|
6041
|
-
const e = new
|
|
6035
|
+
const e = new Nt();
|
|
6042
6036
|
return e.updateUIParam = function(t, i) {
|
|
6043
6037
|
return !0;
|
|
6044
6038
|
}, e;
|
|
@@ -6235,7 +6229,7 @@ f({
|
|
|
6235
6229
|
}
|
|
6236
6230
|
]
|
|
6237
6231
|
});
|
|
6238
|
-
const
|
|
6232
|
+
const Rt = w.DisplacementFilter, Tt = w.Sprite, H = w.Texture;
|
|
6239
6233
|
f({
|
|
6240
6234
|
id: "displacement",
|
|
6241
6235
|
// ID must match what the application expects
|
|
@@ -6248,7 +6242,7 @@ f({
|
|
|
6248
6242
|
const e = s.mapTexture || "/assets/images/displacement_map.png";
|
|
6249
6243
|
let t;
|
|
6250
6244
|
try {
|
|
6251
|
-
t =
|
|
6245
|
+
t = H.from(e), t.source.addressMode = "repeat";
|
|
6252
6246
|
} catch {
|
|
6253
6247
|
const o = document.createElement("canvas");
|
|
6254
6248
|
o.width = 256, o.height = 256;
|
|
@@ -6259,9 +6253,9 @@ f({
|
|
|
6259
6253
|
for (let c = 0; c < 10; c++)
|
|
6260
6254
|
(l + c) % 2 === 0 && n.fillRect(l * 25, c * 25, 25, 25);
|
|
6261
6255
|
}
|
|
6262
|
-
t =
|
|
6256
|
+
t = H.from(o);
|
|
6263
6257
|
}
|
|
6264
|
-
const i = new
|
|
6258
|
+
const i = new Tt(t), r = new Rt(i, s.scale || 50);
|
|
6265
6259
|
return r.scale.x = s.scaleX || 50, r.scale.y = s.scaleY || 50, r._customParams = { ...s }, r._displacementSprite = i, r.updateUIParam = function(a, o) {
|
|
6266
6260
|
const n = this._customParams || {};
|
|
6267
6261
|
switch (this._customParams = n, n[a] = o, a) {
|
|
@@ -6275,7 +6269,7 @@ f({
|
|
|
6275
6269
|
try {
|
|
6276
6270
|
const l = this._displacementSprite;
|
|
6277
6271
|
if (l) {
|
|
6278
|
-
const c =
|
|
6272
|
+
const c = H.from(o);
|
|
6279
6273
|
c.source.addressMode = "repeat", l.texture = c;
|
|
6280
6274
|
}
|
|
6281
6275
|
} catch {
|
|
@@ -6408,7 +6402,7 @@ f({
|
|
|
6408
6402
|
}
|
|
6409
6403
|
]
|
|
6410
6404
|
});
|
|
6411
|
-
const { EmbossFilter:
|
|
6405
|
+
const { EmbossFilter: It } = g;
|
|
6412
6406
|
f({
|
|
6413
6407
|
id: "emboss",
|
|
6414
6408
|
name: "Emboss",
|
|
@@ -6417,7 +6411,7 @@ f({
|
|
|
6417
6411
|
// Create an instance of the Emboss filter with the provided parameters
|
|
6418
6412
|
createFilter: (s) => {
|
|
6419
6413
|
try {
|
|
6420
|
-
const e = typeof s.strength == "number" ? s.strength : 5, t = new
|
|
6414
|
+
const e = typeof s.strength == "number" ? s.strength : 5, t = new It(e);
|
|
6421
6415
|
return t._customParams = {
|
|
6422
6416
|
strength: e
|
|
6423
6417
|
}, t.updateUIParam = function(i, r) {
|
|
@@ -6457,7 +6451,7 @@ f({
|
|
|
6457
6451
|
}
|
|
6458
6452
|
]
|
|
6459
6453
|
});
|
|
6460
|
-
const { GlitchFilter:
|
|
6454
|
+
const { GlitchFilter: Et } = g, N = {
|
|
6461
6455
|
TRANSPARENT: 0,
|
|
6462
6456
|
ORIGINAL: 1,
|
|
6463
6457
|
LOOP: 2,
|
|
@@ -6471,7 +6465,7 @@ f({
|
|
|
6471
6465
|
description: "Apply digital distortion and glitch effects",
|
|
6472
6466
|
createFilter: (s) => {
|
|
6473
6467
|
try {
|
|
6474
|
-
const e = { x: s.redX, y: s.redY }, t = { x: s.greenX, y: s.greenY }, i = { x: s.blueX, y: s.blueY }, r = new
|
|
6468
|
+
const e = { x: s.redX, y: s.redY }, t = { x: s.greenX, y: s.greenY }, i = { x: s.blueX, y: s.blueY }, r = new Et({
|
|
6475
6469
|
slices: s.slices,
|
|
6476
6470
|
offset: s.offset,
|
|
6477
6471
|
direction: s.direction,
|
|
@@ -6549,7 +6543,7 @@ f({
|
|
|
6549
6543
|
slices: 10,
|
|
6550
6544
|
offset: 100,
|
|
6551
6545
|
direction: 0,
|
|
6552
|
-
fillMode:
|
|
6546
|
+
fillMode: N.LOOP,
|
|
6553
6547
|
// LOOP mode looks better for the demo
|
|
6554
6548
|
seed: 0.5,
|
|
6555
6549
|
average: !1,
|
|
@@ -6612,13 +6606,13 @@ f({
|
|
|
6612
6606
|
label: "Fill Mode",
|
|
6613
6607
|
property: "fillMode",
|
|
6614
6608
|
options: [
|
|
6615
|
-
{ value:
|
|
6616
|
-
{ value:
|
|
6617
|
-
{ value:
|
|
6618
|
-
{ value:
|
|
6619
|
-
{ value:
|
|
6609
|
+
{ value: N.TRANSPARENT, label: "Transparent" },
|
|
6610
|
+
{ value: N.ORIGINAL, label: "Original" },
|
|
6611
|
+
{ value: N.LOOP, label: "Loop" },
|
|
6612
|
+
{ value: N.CLAMP, label: "Clamp" },
|
|
6613
|
+
{ value: N.MIRROR, label: "Mirror" }
|
|
6620
6614
|
],
|
|
6621
|
-
default:
|
|
6615
|
+
default: N.LOOP
|
|
6622
6616
|
},
|
|
6623
6617
|
{
|
|
6624
6618
|
id: "seed",
|
|
@@ -6712,7 +6706,7 @@ f({
|
|
|
6712
6706
|
}
|
|
6713
6707
|
]
|
|
6714
6708
|
});
|
|
6715
|
-
const { GlowFilter:
|
|
6709
|
+
const { GlowFilter: Xt } = g;
|
|
6716
6710
|
f({
|
|
6717
6711
|
id: "glow",
|
|
6718
6712
|
name: "Glow",
|
|
@@ -6721,7 +6715,7 @@ f({
|
|
|
6721
6715
|
// Create an instance of the GlowFilter with the provided parameters
|
|
6722
6716
|
createFilter: (s) => {
|
|
6723
6717
|
try {
|
|
6724
|
-
const e = parseInt(s.color.replace("#", "0x"), 16), t = new
|
|
6718
|
+
const e = parseInt(s.color.replace("#", "0x"), 16), t = new Xt({
|
|
6725
6719
|
distance: s.distance || 10,
|
|
6726
6720
|
outerStrength: s.outerStrength || 4,
|
|
6727
6721
|
innerStrength: s.innerStrength || 0,
|
|
@@ -6847,7 +6841,7 @@ f({
|
|
|
6847
6841
|
}
|
|
6848
6842
|
]
|
|
6849
6843
|
});
|
|
6850
|
-
const { GodrayFilter:
|
|
6844
|
+
const { GodrayFilter: Yt } = g;
|
|
6851
6845
|
f({
|
|
6852
6846
|
id: "godray",
|
|
6853
6847
|
name: "Godray",
|
|
@@ -6856,7 +6850,7 @@ f({
|
|
|
6856
6850
|
// Create an instance of the GodrayFilter with the provided parameters
|
|
6857
6851
|
createFilter: (s) => {
|
|
6858
6852
|
try {
|
|
6859
|
-
const e = new
|
|
6853
|
+
const e = new Yt({
|
|
6860
6854
|
angle: s.angle || 30,
|
|
6861
6855
|
parallel: s.parallel ?? !0,
|
|
6862
6856
|
center: {
|
|
@@ -7009,7 +7003,7 @@ f({
|
|
|
7009
7003
|
}
|
|
7010
7004
|
]
|
|
7011
7005
|
});
|
|
7012
|
-
const
|
|
7006
|
+
const Bt = g.SimpleLightmapFilter, oe = w.Texture;
|
|
7013
7007
|
f({
|
|
7014
7008
|
id: "lightmap",
|
|
7015
7009
|
name: "Lightmap",
|
|
@@ -7034,14 +7028,14 @@ f({
|
|
|
7034
7028
|
const c = a.createRadialGradient(128, 128, 10, 128, 128, 160);
|
|
7035
7029
|
c.addColorStop(0, "white"), c.addColorStop(0.3, "rgba(220, 220, 220, 1)"), c.addColorStop(0.6, "rgba(150, 150, 150, 1)"), c.addColorStop(1, "black"), a.fillStyle = c, a.fillRect(0, 0, 256, 256);
|
|
7036
7030
|
}
|
|
7037
|
-
const o =
|
|
7031
|
+
const o = oe.from(r);
|
|
7038
7032
|
let n;
|
|
7039
7033
|
try {
|
|
7040
7034
|
typeof t == "string" && t.startsWith("#") ? n = parseInt(t.replace("#", "0x"), 16) : n = 0;
|
|
7041
7035
|
} catch {
|
|
7042
7036
|
n = 0;
|
|
7043
7037
|
}
|
|
7044
|
-
const l = new
|
|
7038
|
+
const l = new Bt(o, n, i);
|
|
7045
7039
|
return l._customParams = {
|
|
7046
7040
|
textureType: e,
|
|
7047
7041
|
color: t,
|
|
@@ -7067,8 +7061,8 @@ f({
|
|
|
7067
7061
|
const b = m.createRadialGradient(128, 128, 10, 128, 128, 160);
|
|
7068
7062
|
b.addColorStop(0, "white"), b.addColorStop(0.3, "rgba(220, 220, 220, 1)"), b.addColorStop(0.6, "rgba(150, 150, 150, 1)"), b.addColorStop(1, "black"), m.fillStyle = b, m.fillRect(0, 0, 256, 256);
|
|
7069
7063
|
}
|
|
7070
|
-
const
|
|
7071
|
-
if (this.lightMap =
|
|
7064
|
+
const C = oe.from(p);
|
|
7065
|
+
if (this.lightMap = C, this.enabled !== void 0) {
|
|
7072
7066
|
const b = this.enabled;
|
|
7073
7067
|
this.enabled = !1, setTimeout(() => {
|
|
7074
7068
|
this.enabled = b;
|
|
@@ -7140,7 +7134,7 @@ f({
|
|
|
7140
7134
|
}
|
|
7141
7135
|
]
|
|
7142
7136
|
});
|
|
7143
|
-
const { NoiseFilter:
|
|
7137
|
+
const { NoiseFilter: Ot } = w;
|
|
7144
7138
|
f({
|
|
7145
7139
|
id: "noise",
|
|
7146
7140
|
name: "Noise",
|
|
@@ -7148,7 +7142,7 @@ f({
|
|
|
7148
7142
|
description: "Add random noise to the image",
|
|
7149
7143
|
createFilter: (s) => {
|
|
7150
7144
|
try {
|
|
7151
|
-
const e = new
|
|
7145
|
+
const e = new Ot({
|
|
7152
7146
|
noise: s.noise || 0.5,
|
|
7153
7147
|
seed: s.seed || Math.random()
|
|
7154
7148
|
});
|
|
@@ -7225,7 +7219,7 @@ f({
|
|
|
7225
7219
|
}
|
|
7226
7220
|
]
|
|
7227
7221
|
});
|
|
7228
|
-
const { OldFilmFilter:
|
|
7222
|
+
const { OldFilmFilter: Lt } = g;
|
|
7229
7223
|
f({
|
|
7230
7224
|
id: "old-film",
|
|
7231
7225
|
name: "Old Film",
|
|
@@ -7233,7 +7227,7 @@ f({
|
|
|
7233
7227
|
description: "Apply a vintage film effect with scratches and grain",
|
|
7234
7228
|
createFilter: (s) => {
|
|
7235
7229
|
try {
|
|
7236
|
-
const e = new
|
|
7230
|
+
const e = new Lt({
|
|
7237
7231
|
sepia: s.sepia,
|
|
7238
7232
|
noise: s.noise,
|
|
7239
7233
|
noiseSize: s.noiseSize,
|
|
@@ -7414,7 +7408,7 @@ f({
|
|
|
7414
7408
|
}
|
|
7415
7409
|
]
|
|
7416
7410
|
});
|
|
7417
|
-
const { OutlineFilter:
|
|
7411
|
+
const { OutlineFilter: Dt } = g;
|
|
7418
7412
|
f({
|
|
7419
7413
|
id: "outline",
|
|
7420
7414
|
name: "Outline",
|
|
@@ -7424,7 +7418,7 @@ f({
|
|
|
7424
7418
|
try {
|
|
7425
7419
|
let e = s.color;
|
|
7426
7420
|
typeof e == "string" && (e = parseInt(e.replace("#", "0x"), 16));
|
|
7427
|
-
const t = new
|
|
7421
|
+
const t = new Dt({
|
|
7428
7422
|
thickness: s.thickness || 4,
|
|
7429
7423
|
color: e,
|
|
7430
7424
|
alpha: s.alpha || 1,
|
|
@@ -7514,7 +7508,7 @@ f({
|
|
|
7514
7508
|
}
|
|
7515
7509
|
]
|
|
7516
7510
|
});
|
|
7517
|
-
const { PixelateFilter:
|
|
7511
|
+
const { PixelateFilter: Ut } = g;
|
|
7518
7512
|
f({
|
|
7519
7513
|
id: "pixelate",
|
|
7520
7514
|
name: "Pixelate",
|
|
@@ -7522,7 +7516,7 @@ f({
|
|
|
7522
7516
|
description: "Create a pixelated or mosaic effect",
|
|
7523
7517
|
createFilter: (s) => {
|
|
7524
7518
|
try {
|
|
7525
|
-
const e = new
|
|
7519
|
+
const e = new Ut(
|
|
7526
7520
|
s.useUniform ? Math.max(4, s.size || 10) : [Math.max(4, s.sizeX || 10), Math.max(4, s.sizeY || 10)]
|
|
7527
7521
|
);
|
|
7528
7522
|
return e._customParams = { ...s }, e.updateUIParam = function(t, i) {
|
|
@@ -7605,7 +7599,7 @@ f({
|
|
|
7605
7599
|
}
|
|
7606
7600
|
]
|
|
7607
7601
|
});
|
|
7608
|
-
const { ReflectionFilter:
|
|
7602
|
+
const { ReflectionFilter: Vt } = g;
|
|
7609
7603
|
f({
|
|
7610
7604
|
id: "reflection",
|
|
7611
7605
|
// ID must match what the application expects
|
|
@@ -7622,7 +7616,7 @@ f({
|
|
|
7622
7616
|
waveLength: new Float32Array([s.wavelengthStart ?? 30, s.wavelengthEnd ?? 100]),
|
|
7623
7617
|
alpha: new Float32Array([s.alphaStart ?? 1, s.alphaEnd ?? 1]),
|
|
7624
7618
|
time: s.time ?? 0
|
|
7625
|
-
}, t = new
|
|
7619
|
+
}, t = new Vt(e);
|
|
7626
7620
|
return t._customParams = { ...s }, t.animating = s.animating ?? !1, t.updateUIParam = function(i, r) {
|
|
7627
7621
|
const a = this._customParams || {};
|
|
7628
7622
|
switch (this._customParams = a, a[i] = r, i) {
|
|
@@ -7773,7 +7767,7 @@ f({
|
|
|
7773
7767
|
}
|
|
7774
7768
|
]
|
|
7775
7769
|
});
|
|
7776
|
-
const { ShockwaveFilter:
|
|
7770
|
+
const { ShockwaveFilter: jt } = g;
|
|
7777
7771
|
f({
|
|
7778
7772
|
id: "shockwave",
|
|
7779
7773
|
// ID must match what the application expects
|
|
@@ -7783,7 +7777,7 @@ f({
|
|
|
7783
7777
|
// Create an instance of the ShockwaveFilter with the provided parameters
|
|
7784
7778
|
createFilter: (s) => {
|
|
7785
7779
|
try {
|
|
7786
|
-
const e = s.centerX ?? 0.5, t = s.centerY ?? 0.5, i = { x: e, y: t }, r = s.amplitude ?? 30, a = s.wavelength ?? 160, o = s.speed ?? 500, n = s.brightness ?? 1, l = s.radius ?? -1, c = s.time ?? 0, d = new
|
|
7780
|
+
const e = s.centerX ?? 0.5, t = s.centerY ?? 0.5, i = { x: e, y: t }, r = s.amplitude ?? 30, a = s.wavelength ?? 160, o = s.speed ?? 500, n = s.brightness ?? 1, l = s.radius ?? -1, c = s.time ?? 0, d = new jt({
|
|
7787
7781
|
center: i,
|
|
7788
7782
|
amplitude: r,
|
|
7789
7783
|
wavelength: a,
|
|
@@ -7925,7 +7919,7 @@ f({
|
|
|
7925
7919
|
}
|
|
7926
7920
|
]
|
|
7927
7921
|
});
|
|
7928
|
-
const { SimplexNoiseFilter:
|
|
7922
|
+
const { SimplexNoiseFilter: qt } = g;
|
|
7929
7923
|
f({
|
|
7930
7924
|
id: "simplex-noise",
|
|
7931
7925
|
name: "Simplex Noise",
|
|
@@ -7933,7 +7927,7 @@ f({
|
|
|
7933
7927
|
description: "Apply procedural noise to create texture effects",
|
|
7934
7928
|
createFilter: (s) => {
|
|
7935
7929
|
try {
|
|
7936
|
-
const e = s.animating ? 0 : s.offsetZ || 0, t = new
|
|
7930
|
+
const e = s.animating ? 0 : s.offsetZ || 0, t = new qt({
|
|
7937
7931
|
strength: s.strength,
|
|
7938
7932
|
noiseScale: s.noiseScale,
|
|
7939
7933
|
offsetX: s.offsetX,
|
|
@@ -8080,9 +8074,9 @@ f({
|
|
|
8080
8074
|
}
|
|
8081
8075
|
]
|
|
8082
8076
|
});
|
|
8083
|
-
class
|
|
8077
|
+
class Ht extends w.Filter {
|
|
8084
8078
|
constructor(e) {
|
|
8085
|
-
const t =
|
|
8079
|
+
const t = ye.from({
|
|
8086
8080
|
vertex: `
|
|
8087
8081
|
attribute vec2 aPosition;
|
|
8088
8082
|
varying vec2 vTextureCoord;
|
|
@@ -8191,7 +8185,7 @@ f({
|
|
|
8191
8185
|
description: "Creates a twisting distortion effect around a central point",
|
|
8192
8186
|
createFilter: (s) => {
|
|
8193
8187
|
try {
|
|
8194
|
-
const e = new
|
|
8188
|
+
const e = new Ht({
|
|
8195
8189
|
centerX: s.centerX ?? 0.5,
|
|
8196
8190
|
centerY: s.centerY ?? 0.5,
|
|
8197
8191
|
radius: s.radius ?? 0.25,
|
|
@@ -8261,8 +8255,8 @@ f({
|
|
|
8261
8255
|
}
|
|
8262
8256
|
]
|
|
8263
8257
|
});
|
|
8264
|
-
const { AdjustmentFilter:
|
|
8265
|
-
function
|
|
8258
|
+
const { AdjustmentFilter: $t } = g;
|
|
8259
|
+
function D(s) {
|
|
8266
8260
|
const e = typeof s == "string" ? parseInt(s.replace("#", "0x"), 16) : s;
|
|
8267
8261
|
return [
|
|
8268
8262
|
(e >> 16 & 255) / 255,
|
|
@@ -8270,14 +8264,14 @@ function L(s) {
|
|
|
8270
8264
|
(e & 255) / 255
|
|
8271
8265
|
];
|
|
8272
8266
|
}
|
|
8273
|
-
class
|
|
8267
|
+
class Wt extends $t {
|
|
8274
8268
|
constructor(e = {}) {
|
|
8275
8269
|
super({
|
|
8276
8270
|
brightness: 1,
|
|
8277
8271
|
contrast: 1,
|
|
8278
8272
|
saturation: 1,
|
|
8279
8273
|
alpha: 1
|
|
8280
|
-
}), this._radius = 0.8, this._strength = 1, this._colorRgb = [0, 0, 0], this._colorValue = "#000000", this._radius = e.radius ?? 0.8, this._strength = e.strength ?? 1, e.color !== void 0 && (typeof e.color == "string" ? (this._colorValue = e.color, this._colorRgb =
|
|
8274
|
+
}), this._radius = 0.8, this._strength = 1, this._colorRgb = [0, 0, 0], this._colorValue = "#000000", this._radius = e.radius ?? 0.8, this._strength = e.strength ?? 1, e.color !== void 0 && (typeof e.color == "string" ? (this._colorValue = e.color, this._colorRgb = D(e.color)) : (this._colorValue = "#" + e.color.toString(16).padStart(6, "0"), this._colorRgb = D(e.color))), this.updateVignette();
|
|
8281
8275
|
}
|
|
8282
8276
|
/**
|
|
8283
8277
|
* Updates the filter parameters to simulate a vignette effect
|
|
@@ -8303,7 +8297,7 @@ class $t extends Ht {
|
|
|
8303
8297
|
return this._colorValue;
|
|
8304
8298
|
}
|
|
8305
8299
|
set color(e) {
|
|
8306
|
-
typeof e == "string" ? (this._colorValue = e, this._colorRgb =
|
|
8300
|
+
typeof e == "string" ? (this._colorValue = e, this._colorRgb = D(e)) : (this._colorValue = "#" + e.toString(16).padStart(6, "0"), this._colorRgb = D(e)), this.updateVignette();
|
|
8307
8301
|
}
|
|
8308
8302
|
}
|
|
8309
8303
|
f({
|
|
@@ -8313,7 +8307,7 @@ f({
|
|
|
8313
8307
|
description: "Add a classic darkened border effect to the image",
|
|
8314
8308
|
createFilter: (s) => {
|
|
8315
8309
|
try {
|
|
8316
|
-
const e = new
|
|
8310
|
+
const e = new Wt({
|
|
8317
8311
|
radius: s.radius || 0.8,
|
|
8318
8312
|
strength: s.strength || 1,
|
|
8319
8313
|
color: s.color || "#000000"
|
|
@@ -8377,22 +8371,22 @@ f({
|
|
|
8377
8371
|
}
|
|
8378
8372
|
]
|
|
8379
8373
|
});
|
|
8380
|
-
function
|
|
8374
|
+
function ei(s) {
|
|
8381
8375
|
try {
|
|
8382
8376
|
let e = [], t = [];
|
|
8383
8377
|
try {
|
|
8384
|
-
e =
|
|
8378
|
+
e = U(), e.length === 0 && et();
|
|
8385
8379
|
} catch {
|
|
8386
8380
|
}
|
|
8387
8381
|
const i = s == null ? void 0 : s.disabled;
|
|
8388
8382
|
if (Array.isArray(i) && i.length > 0) {
|
|
8389
8383
|
let r = 0;
|
|
8390
8384
|
for (const a of i)
|
|
8391
|
-
|
|
8385
|
+
rt(a) && r++;
|
|
8392
8386
|
r > 0;
|
|
8393
8387
|
}
|
|
8394
8388
|
try {
|
|
8395
|
-
e =
|
|
8389
|
+
e = U(), t = it();
|
|
8396
8390
|
} catch {
|
|
8397
8391
|
e || (e = []), t || (t = []);
|
|
8398
8392
|
}
|
|
@@ -8402,16 +8396,16 @@ function Jt(s) {
|
|
|
8402
8396
|
}
|
|
8403
8397
|
}
|
|
8404
8398
|
export {
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8399
|
+
Kt as V,
|
|
8400
|
+
Je as a,
|
|
8401
|
+
tt as b,
|
|
8402
|
+
it as c,
|
|
8403
|
+
et as d,
|
|
8404
|
+
Jt as e,
|
|
8405
|
+
st as f,
|
|
8406
|
+
U as g,
|
|
8407
|
+
Qt as h,
|
|
8408
|
+
ei as i,
|
|
8415
8409
|
f as r
|
|
8416
8410
|
};
|
|
8417
|
-
//# sourceMappingURL=editor-
|
|
8411
|
+
//# sourceMappingURL=editor-DrTmgu3R.js.map
|