@codingfactory/mediables-vue 2.18.1 → 2.18.3

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.
@@ -2,7 +2,7 @@ var nt = Object.defineProperty;
2
2
  var ot = (a, e, t) => e in a ? nt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var ve = (a, e, t) => ot(a, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as v from "pixi-filters";
5
- import * as D from "pixi.js";
5
+ import * as I from "pixi.js";
6
6
  class de {
7
7
  constructor() {
8
8
  this._events = /* @__PURE__ */ new Map();
@@ -41,7 +41,7 @@ const lt = Object.freeze([
41
41
  "Times New Roman",
42
42
  "Courier New",
43
43
  "Verdana"
44
- ]), Te = Object.freeze(["normal", "multiply", "screen", "overlay"]), he = Object.freeze({ x: 0.2, y: 0.2, width: 0.6, height: 0.18 }), H = Object.freeze({
44
+ ]), ze = Object.freeze(["normal", "multiply", "screen", "overlay"]), he = Object.freeze({ x: 0.2, y: 0.2, width: 0.6, height: 0.18 }), H = Object.freeze({
45
45
  fontFamily: "Inter",
46
46
  fontSize: 64,
47
47
  fontWeight: 700,
@@ -50,7 +50,7 @@ const lt = Object.freeze([
50
50
  align: "center",
51
51
  lineHeight: 1.2,
52
52
  letterSpacing: 0
53
- }), E = Object.freeze({
53
+ }), B = Object.freeze({
54
54
  stroke: Object.freeze({ enabled: !1, color: "#000000", width: 0 }),
55
55
  shadow: Object.freeze({ enabled: !1, color: "#000000", alpha: 0.5, blur: 0, distance: 0, angle: 45 }),
56
56
  glow: Object.freeze({ enabled: !1, color: "#ffffff", alpha: 0.5, blur: 0 }),
@@ -405,7 +405,7 @@ class ct extends de {
405
405
  * @returns {string}
406
406
  */
407
407
  _normalizeBlendMode(e, t = "normal") {
408
- return Te.includes(e) ? e : Te.includes(t) ? t : "normal";
408
+ return ze.includes(e) ? e : ze.includes(t) ? t : "normal";
409
409
  }
410
410
  /**
411
411
  * @param {*} value
@@ -468,38 +468,38 @@ class ct extends de {
468
468
  */
469
469
  _normalizeTextEffects(e, t = null) {
470
470
  const r = e && typeof e == "object" ? e : {}, i = t && typeof t == "object" ? t : {}, s = {
471
- stroke: { ...E.stroke, ...i.stroke && typeof i.stroke == "object" ? i.stroke : {} },
472
- shadow: { ...E.shadow, ...i.shadow && typeof i.shadow == "object" ? i.shadow : {} },
473
- glow: { ...E.glow, ...i.glow && typeof i.glow == "object" ? i.glow : {} },
474
- backdrop: { ...E.backdrop, ...i.backdrop && typeof i.backdrop == "object" ? i.backdrop : {} }
471
+ stroke: { ...B.stroke, ...i.stroke && typeof i.stroke == "object" ? i.stroke : {} },
472
+ shadow: { ...B.shadow, ...i.shadow && typeof i.shadow == "object" ? i.shadow : {} },
473
+ glow: { ...B.glow, ...i.glow && typeof i.glow == "object" ? i.glow : {} },
474
+ backdrop: { ...B.backdrop, ...i.backdrop && typeof i.backdrop == "object" ? i.backdrop : {} }
475
475
  }, n = r.stroke && typeof r.stroke == "object" ? r.stroke : {}, o = r.shadow && typeof r.shadow == "object" ? r.shadow : {}, l = r.glow && typeof r.glow == "object" ? r.glow : {}, c = r.backdrop && typeof r.backdrop == "object" ? r.backdrop : {};
476
476
  return {
477
477
  stroke: {
478
478
  enabled: this._normalizeBoolean(n.enabled, s.stroke.enabled),
479
479
  color: this._normalizeTextColor(n.color, s.stroke.color),
480
- width: this._clampNumber(n.width, 0, 80, this._clampNumber(s.stroke.width, 0, 80, E.stroke.width))
480
+ width: this._clampNumber(n.width, 0, 80, this._clampNumber(s.stroke.width, 0, 80, B.stroke.width))
481
481
  },
482
482
  shadow: {
483
483
  enabled: this._normalizeBoolean(o.enabled, s.shadow.enabled),
484
484
  color: this._normalizeTextColor(o.color, s.shadow.color),
485
- alpha: this._clampNumber(o.alpha, 0, 1, this._clampNumber(s.shadow.alpha, 0, 1, E.shadow.alpha)),
486
- blur: this._clampNumber(o.blur, 0, 120, this._clampNumber(s.shadow.blur, 0, 120, E.shadow.blur)),
487
- distance: this._clampNumber(o.distance, 0, 200, this._clampNumber(s.shadow.distance, 0, 200, E.shadow.distance)),
488
- angle: this._normalizeDegrees(o.angle ?? s.shadow.angle ?? E.shadow.angle)
485
+ alpha: this._clampNumber(o.alpha, 0, 1, this._clampNumber(s.shadow.alpha, 0, 1, B.shadow.alpha)),
486
+ blur: this._clampNumber(o.blur, 0, 120, this._clampNumber(s.shadow.blur, 0, 120, B.shadow.blur)),
487
+ distance: this._clampNumber(o.distance, 0, 200, this._clampNumber(s.shadow.distance, 0, 200, B.shadow.distance)),
488
+ angle: this._normalizeDegrees(o.angle ?? s.shadow.angle ?? B.shadow.angle)
489
489
  },
490
490
  glow: {
491
491
  enabled: this._normalizeBoolean(l.enabled, s.glow.enabled),
492
492
  color: this._normalizeTextColor(l.color, s.glow.color),
493
- alpha: this._clampNumber(l.alpha, 0, 1, this._clampNumber(s.glow.alpha, 0, 1, E.glow.alpha)),
494
- blur: this._clampNumber(l.blur, 0, 120, this._clampNumber(s.glow.blur, 0, 120, E.glow.blur))
493
+ alpha: this._clampNumber(l.alpha, 0, 1, this._clampNumber(s.glow.alpha, 0, 1, B.glow.alpha)),
494
+ blur: this._clampNumber(l.blur, 0, 120, this._clampNumber(s.glow.blur, 0, 120, B.glow.blur))
495
495
  },
496
496
  backdrop: {
497
497
  enabled: this._normalizeBoolean(c.enabled, s.backdrop.enabled),
498
498
  color: this._normalizeTextColor(c.color, s.backdrop.color),
499
- opacity: this._clampNumber(c.opacity, 0, 1, this._clampNumber(s.backdrop.opacity, 0, 1, E.backdrop.opacity)),
500
- padding: this._clampNumber(c.padding, 0, 200, this._clampNumber(s.backdrop.padding, 0, 200, E.backdrop.padding)),
501
- radius: this._clampNumber(c.radius, 0, 200, this._clampNumber(s.backdrop.radius, 0, 200, E.backdrop.radius)),
502
- blur: this._clampNumber(c.blur, 0, 80, this._clampNumber(s.backdrop.blur, 0, 80, E.backdrop.blur))
499
+ opacity: this._clampNumber(c.opacity, 0, 1, this._clampNumber(s.backdrop.opacity, 0, 1, B.backdrop.opacity)),
500
+ padding: this._clampNumber(c.padding, 0, 200, this._clampNumber(s.backdrop.padding, 0, 200, B.backdrop.padding)),
501
+ radius: this._clampNumber(c.radius, 0, 200, this._clampNumber(s.backdrop.radius, 0, 200, B.backdrop.radius)),
502
+ blur: this._clampNumber(c.blur, 0, 80, this._clampNumber(s.backdrop.blur, 0, 80, B.backdrop.blur))
503
503
  }
504
504
  };
505
505
  }
@@ -998,7 +998,7 @@ class ct extends de {
998
998
  function ht() {
999
999
  return new ct();
1000
1000
  }
1001
- const dt = Object.freeze(["normal", "multiply", "screen", "overlay"]), I = Object.freeze({
1001
+ const dt = Object.freeze(["normal", "multiply", "screen", "overlay"]), E = Object.freeze({
1002
1002
  stroke: Object.freeze({ enabled: !1, color: "#000000", width: 0 }),
1003
1003
  shadow: Object.freeze({ enabled: !1, color: "#000000", alpha: 0.5, blur: 0, distance: 0, angle: 45 }),
1004
1004
  glow: Object.freeze({ enabled: !1, color: "#ffffff", alpha: 0.5, blur: 0 }),
@@ -1349,30 +1349,30 @@ class ut extends de {
1349
1349
  return {
1350
1350
  stroke: {
1351
1351
  enabled: r.enabled === !0,
1352
- color: this._supportedTextColor(r.color, I.stroke.color),
1353
- width: this._clampNumber(r.width, 0, 80, I.stroke.width)
1352
+ color: this._supportedTextColor(r.color, E.stroke.color),
1353
+ width: this._clampNumber(r.width, 0, 80, E.stroke.width)
1354
1354
  },
1355
1355
  shadow: {
1356
1356
  enabled: i.enabled === !0,
1357
- color: this._supportedTextColor(i.color, I.shadow.color),
1358
- alpha: this._clampNumber(i.alpha, 0, 1, I.shadow.alpha),
1359
- blur: this._clampNumber(i.blur, 0, 120, I.shadow.blur),
1360
- distance: this._clampNumber(i.distance, 0, 200, I.shadow.distance),
1361
- angle: this._normalizeDegrees(i.angle ?? I.shadow.angle)
1357
+ color: this._supportedTextColor(i.color, E.shadow.color),
1358
+ alpha: this._clampNumber(i.alpha, 0, 1, E.shadow.alpha),
1359
+ blur: this._clampNumber(i.blur, 0, 120, E.shadow.blur),
1360
+ distance: this._clampNumber(i.distance, 0, 200, E.shadow.distance),
1361
+ angle: this._normalizeDegrees(i.angle ?? E.shadow.angle)
1362
1362
  },
1363
1363
  glow: {
1364
1364
  enabled: s.enabled === !0,
1365
- color: this._supportedTextColor(s.color, I.glow.color),
1366
- alpha: this._clampNumber(s.alpha, 0, 1, I.glow.alpha),
1367
- blur: this._clampNumber(s.blur, 0, 120, I.glow.blur)
1365
+ color: this._supportedTextColor(s.color, E.glow.color),
1366
+ alpha: this._clampNumber(s.alpha, 0, 1, E.glow.alpha),
1367
+ blur: this._clampNumber(s.blur, 0, 120, E.glow.blur)
1368
1368
  },
1369
1369
  backdrop: {
1370
1370
  enabled: n.enabled === !0,
1371
- color: this._supportedTextColor(n.color, I.backdrop.color),
1372
- opacity: this._clampNumber(n.opacity, 0, 1, I.backdrop.opacity),
1373
- padding: this._clampNumber(n.padding, 0, 200, I.backdrop.padding),
1374
- radius: this._clampNumber(n.radius, 0, 200, I.backdrop.radius),
1375
- blur: this._clampNumber(n.blur, 0, 80, I.backdrop.blur)
1371
+ color: this._supportedTextColor(n.color, E.backdrop.color),
1372
+ opacity: this._clampNumber(n.opacity, 0, 1, E.backdrop.opacity),
1373
+ padding: this._clampNumber(n.padding, 0, 200, E.backdrop.padding),
1374
+ radius: this._clampNumber(n.radius, 0, 200, E.backdrop.radius),
1375
+ blur: this._clampNumber(n.blur, 0, 80, E.backdrop.blur)
1376
1376
  }
1377
1377
  };
1378
1378
  }
@@ -1750,50 +1750,50 @@ class ut extends de {
1750
1750
  S > 0 && (_ += S);
1751
1751
  }
1752
1752
  const C = Math.max(Math.ceil(_), 64), k = (x) => {
1753
- var pe, fe, O, me;
1754
- const S = Math.ceil(o + 2 * x), z = Math.ceil(l + 2 * x), F = new n.Container(), B = [], V = (b = null) => {
1753
+ var pe, fe, D, me;
1754
+ const S = Math.ceil(o + 2 * x), T = Math.ceil(l + 2 * x), F = new n.Container(), L = [], V = (b = null) => {
1755
1755
  const w = new n.Sprite(this.originalTexture);
1756
1756
  w.x = x, w.y = x, w.scale.set(1, 1), w.alpha = b ? this._layerOpacity(b) : 1, b && this._applyLayerFilterInstances(w, b, {
1757
1757
  forExport: !0,
1758
1758
  previewToNativeScale: u,
1759
1759
  sourceWidth: o,
1760
1760
  sourceHeight: l
1761
- }), g.length > 0 && (w.filters = g, w.filterArea = new n.Rectangle(0, 0, o, l)), F.addChild(w), B.push(w);
1761
+ }), g.length > 0 && (w.filters = g, w.filterArea = new n.Rectangle(0, 0, o, l)), F.addChild(w), L.push(w);
1762
1762
  }, M = (b) => {
1763
- var T, le, ce;
1764
- const w = (T = this._layerDisplayObjects.get(b.id)) == null ? void 0 : T.displayObject, G = (w == null ? void 0 : w.texture) || (this._isSubjectLayer(b) ? this.originalTexture : null);
1763
+ var z, le, ce;
1764
+ const w = (z = this._layerDisplayObjects.get(b.id)) == null ? void 0 : z.displayObject, G = (w == null ? void 0 : w.texture) || (this._isSubjectLayer(b) ? this.originalTexture : null);
1765
1765
  if (!G || typeof n.Sprite != "function") return !1;
1766
- const j = new n.Sprite(G);
1767
- return j.__sourceWidth = Number(((le = b.source) == null ? void 0 : le.originalWidth) || (w == null ? void 0 : w.__sourceWidth) || G.width || o), j.__sourceHeight = Number(((ce = b.source) == null ? void 0 : ce.originalHeight) || (w == null ? void 0 : w.__sourceHeight) || G.height || l), this._fitDisplayObjectToRect(j, b, { x, y: x, width: o, height: l }), j.alpha = this._layerOpacity(b), !m && this._isSubjectLayer(b) && g.length > 0 && (j.filters = g, j.filterArea = new n.Rectangle(0, 0, o, l)), this._applyLayerEffects(n, j, b), this._applyLayerFilterInstances(j, b, {
1766
+ const O = new n.Sprite(G);
1767
+ return O.__sourceWidth = Number(((le = b.source) == null ? void 0 : le.originalWidth) || (w == null ? void 0 : w.__sourceWidth) || G.width || o), O.__sourceHeight = Number(((ce = b.source) == null ? void 0 : ce.originalHeight) || (w == null ? void 0 : w.__sourceHeight) || G.height || l), this._fitDisplayObjectToRect(O, b, { x, y: x, width: o, height: l }), O.alpha = this._layerOpacity(b), !m && this._isSubjectLayer(b) && g.length > 0 && (O.filters = g, O.filterArea = new n.Rectangle(0, 0, o, l)), this._applyLayerEffects(n, O, b), this._applyLayerFilterInstances(O, b, {
1768
1768
  forExport: !0,
1769
1769
  previewToNativeScale: u,
1770
1770
  sourceWidth: o,
1771
1771
  sourceHeight: l
1772
- }), F.addChild(j), B.push(j), !0;
1773
- }, L = (b) => {
1774
- var le, ce, ze;
1775
- const w = this._backgroundFillForLayer(b), G = this._backgroundColorForLayer(b), j = { x, y: x, width: o, height: l };
1776
- let T = null;
1772
+ }), F.addChild(O), L.push(O), !0;
1773
+ }, R = (b) => {
1774
+ var le, ce, Te;
1775
+ const w = this._backgroundFillForLayer(b), G = this._backgroundColorForLayer(b), O = { x, y: x, width: o, height: l };
1776
+ let z = null;
1777
1777
  if (G && typeof n.Graphics == "function")
1778
- T = new n.Graphics(), T.rect(x, x, o, l).fill(G);
1778
+ z = new n.Graphics(), z.rect(x, x, o, l).fill(G);
1779
1779
  else if ((w == null ? void 0 : w.kind) === "gradient" && typeof n.Sprite == "function") {
1780
1780
  const $ = this._createGradientTexture(n, w, o, l);
1781
1781
  if (!$) return !1;
1782
- T = new n.Sprite($), T.__ownsTexture = !0, T.__sourceWidth = o, T.__sourceHeight = l, this._fitDisplayObjectToRect(T, b, j);
1782
+ z = new n.Sprite($), z.__ownsTexture = !0, z.__sourceWidth = o, z.__sourceHeight = l, this._fitDisplayObjectToRect(z, b, O);
1783
1783
  } else if ((w == null ? void 0 : w.kind) === "media") {
1784
1784
  const $ = (le = this._layerDisplayObjects.get(b.id)) == null ? void 0 : le.displayObject, ge = $ == null ? void 0 : $.texture;
1785
1785
  if (!ge) return !1;
1786
- T = this._createBackgroundSprite(n, ge, w.fit), T.__sourceWidth = Number(((ce = w.source) == null ? void 0 : ce.originalWidth) || $.__sourceWidth || ge.width || 1), T.__sourceHeight = Number(((ze = w.source) == null ? void 0 : ze.originalHeight) || $.__sourceHeight || ge.height || 1), this._fitDisplayObjectToRect(T, b, j);
1786
+ z = this._createBackgroundSprite(n, ge, w.fit), z.__sourceWidth = Number(((ce = w.source) == null ? void 0 : ce.originalWidth) || $.__sourceWidth || ge.width || 1), z.__sourceHeight = Number(((Te = w.source) == null ? void 0 : Te.originalHeight) || $.__sourceHeight || ge.height || 1), this._fitDisplayObjectToRect(z, b, O);
1787
1787
  }
1788
- return T ? (T.alpha = this._layerOpacity(b), this._applyLayerEffects(n, T, b), this._applyLayerFilterInstances(T, b, {
1788
+ return z ? (z.alpha = this._layerOpacity(b), this._applyLayerEffects(n, z, b), this._applyLayerFilterInstances(z, b, {
1789
1789
  forExport: !0,
1790
1790
  previewToNativeScale: u,
1791
1791
  sourceWidth: o,
1792
1792
  sourceHeight: l
1793
- }), F.addChild(T), B.push(T), !0) : !1;
1793
+ }), F.addChild(z), L.push(z), !0) : !1;
1794
1794
  }, X = (b) => {
1795
1795
  const w = this._createTextDisplayObjectForLayer(n, b);
1796
- return w ? (this._fitTextDisplayObjectToRect(w, b, { x, y: x, width: o, height: l }), w.alpha = this._layerOpacity(b), F.addChild(w), B.push(w), !0) : !1;
1796
+ return w ? (this._fitTextDisplayObjectToRect(w, b, { x, y: x, width: o, height: l }), w.alpha = this._layerOpacity(b), F.addChild(w), L.push(w), !0) : !1;
1797
1797
  }, ee = p, ne = m;
1798
1798
  if (ne) {
1799
1799
  for (const b of ee.layers)
@@ -1810,14 +1810,14 @@ class ut extends de {
1810
1810
  M(b) || V(b);
1811
1811
  continue;
1812
1812
  }
1813
- L(b);
1813
+ R(b);
1814
1814
  }
1815
1815
  } else
1816
1816
  V();
1817
1817
  !ne && ((pe = F.children) == null ? void 0 : pe.length) === 0 && V();
1818
1818
  const oe = n.RenderTexture.create({
1819
1819
  width: S,
1820
- height: z,
1820
+ height: T,
1821
1821
  resolution: 1
1822
1822
  }), we = ((fe = F.children) == null ? void 0 : fe.length) ?? 0;
1823
1823
  try {
@@ -1827,45 +1827,45 @@ class ut extends de {
1827
1827
  clear: !0,
1828
1828
  clearColor: [0, 0, 0, 0]
1829
1829
  });
1830
- const b = (me = (O = this.app.renderer.extract) == null ? void 0 : O.canvas) == null ? void 0 : me.call(O, oe);
1831
- return b ? { canvas: b, width: S, height: z, margin: x, childCount: we } : null;
1830
+ const b = (me = (D = this.app.renderer.extract) == null ? void 0 : D.canvas) == null ? void 0 : me.call(D, oe);
1831
+ return b ? { canvas: b, width: S, height: T, margin: x, childCount: we } : null;
1832
1832
  } finally {
1833
- for (const b of B)
1833
+ for (const b of L)
1834
1834
  b.filters = null;
1835
1835
  F.removeChildren();
1836
- for (const b of B) {
1836
+ for (const b of L) {
1837
1837
  const w = (b == null ? void 0 : b.__ownsTexture) === !0;
1838
1838
  b.destroy({ children: !1, texture: w, textureSource: w });
1839
1839
  }
1840
1840
  F.destroy({ children: !1 }), oe.destroy(!0);
1841
1841
  }
1842
- }, A = (x, S, z) => {
1842
+ }, P = (x, S, T) => {
1843
1843
  const F = typeof x.getContext == "function" ? x.getContext("2d") : null;
1844
1844
  if (!F) return null;
1845
- let B;
1845
+ let L;
1846
1846
  try {
1847
- B = F.getImageData(0, 0, S, z).data;
1847
+ L = F.getImageData(0, 0, S, T).data;
1848
1848
  } catch {
1849
1849
  return null;
1850
1850
  }
1851
1851
  const V = 1;
1852
- let M = S, L = z, X = -1, ee = -1;
1852
+ let M = S, R = T, X = -1, ee = -1;
1853
1853
  const ne = 4, oe = S * ne;
1854
- for (let O = 0; O < z; O++) {
1855
- const me = O * oe;
1854
+ for (let D = 0; D < T; D++) {
1855
+ const me = D * oe;
1856
1856
  for (let b = 0; b < S; b++)
1857
- B[me + b * ne + 3] >= V && (b < M && (M = b), b > X && (X = b), O < L && (L = O), O > ee && (ee = O));
1857
+ L[me + b * ne + 3] >= V && (b < M && (M = b), b > X && (X = b), D < R && (R = D), D > ee && (ee = D));
1858
1858
  }
1859
1859
  if (X < 0) return null;
1860
- const we = X - M + 1, pe = ee - L + 1, fe = M === 0 || L === 0 || X === S - 1 || ee === z - 1;
1861
- return { x: M, y: L, width: we, height: pe, touchesEdge: fe };
1860
+ const we = X - M + 1, pe = ee - R + 1, fe = M === 0 || R === 0 || X === S - 1 || ee === T - 1;
1861
+ return { x: M, y: R, width: we, height: pe, touchesEdge: fe };
1862
1862
  };
1863
- let P = null;
1863
+ let A = null;
1864
1864
  try {
1865
1865
  let x = k(C);
1866
1866
  if (!x)
1867
1867
  return null;
1868
- let S = A(x.canvas, x.width, x.height);
1868
+ let S = P(x.canvas, x.width, x.height);
1869
1869
  if (!S)
1870
1870
  if (m && x.childCount === 0)
1871
1871
  S = {
@@ -1878,25 +1878,25 @@ class ut extends de {
1878
1878
  else
1879
1879
  return null;
1880
1880
  if (S.touchesEdge && C < o && C < l) {
1881
- const M = Math.max(C * 4, 256), L = k(M);
1882
- if (L) {
1883
- const X = A(L.canvas, L.width, L.height);
1884
- X && !X.touchesEdge ? (x = L, S = X) : (x = L, S = X ?? S);
1881
+ const M = Math.max(C * 4, 256), R = k(M);
1882
+ if (R) {
1883
+ const X = P(R.canvas, R.width, R.height);
1884
+ X && !X.touchesEdge ? (x = R, S = X) : (x = R, S = X ?? S);
1885
1885
  }
1886
1886
  }
1887
- let z = S.width, F = S.height;
1887
+ let T = S.width, F = S.height;
1888
1888
  if (r > 0) {
1889
- const M = Math.max(z, F);
1890
- let L = r / M;
1891
- i && (L = Math.min(1, L)), z = Math.max(1, Math.round(z * L)), F = Math.max(1, Math.round(F * L));
1889
+ const M = Math.max(T, F);
1890
+ let R = r / M;
1891
+ i && (R = Math.min(1, R)), T = Math.max(1, Math.round(T * R)), F = Math.max(1, Math.round(F * R));
1892
1892
  }
1893
- if (s > 0 && z * F > s) {
1894
- const M = Math.sqrt(s / (z * F));
1895
- z = Math.max(1, Math.floor(z * M)), F = Math.max(1, Math.floor(F * M));
1893
+ if (s > 0 && T * F > s) {
1894
+ const M = Math.sqrt(s / (T * F));
1895
+ T = Math.max(1, Math.floor(T * M)), F = Math.max(1, Math.floor(F * M));
1896
1896
  }
1897
- const B = document.createElement("canvas");
1898
- B.width = z, B.height = F;
1899
- const V = B.getContext("2d");
1897
+ const L = document.createElement("canvas");
1898
+ L.width = T, L.height = F;
1899
+ const V = L.getContext("2d");
1900
1900
  return V ? (V.drawImage(
1901
1901
  x.canvas,
1902
1902
  S.x,
@@ -1905,9 +1905,9 @@ class ut extends de {
1905
1905
  S.height,
1906
1906
  0,
1907
1907
  0,
1908
- z,
1908
+ T,
1909
1909
  F
1910
- ), P = B.toDataURL(`image/${e}`, t), this._lastExportDimensions = { width: z, height: F }, P || null) : null;
1910
+ ), A = L.toDataURL(`image/${e}`, t), this._lastExportDimensions = { width: T, height: F }, A || null) : null;
1911
1911
  } catch {
1912
1912
  return null;
1913
1913
  }
@@ -2011,79 +2011,79 @@ class ut extends de {
2011
2011
  this.sprite = null, this.originalTexture = null, this.baseTexture = null, this._container = null, this.removeAllListeners();
2012
2012
  }
2013
2013
  }
2014
- const $e = '<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>', Ge = '<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>', pt = '<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>', ft = '<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>', mt = '<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>', gt = '<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>', bt = '<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>', _t = '<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>', yt = '<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>', xt = '<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>', wt = '<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="M452.37 59.63h0a40.49 40.49 0 00-57.26 0L184 294.74c23.08 4.7 46.12 27.29 49.26 49.26l219.11-227.11a40.49 40.49 0 000-57.26z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M138 336c-29.88 0-54 24.5-54 54.86 0 23.95-20.67 36.57-34 44.78 15.08 8.08 32.23 12.36 50 12.36 48.49 0 88-38.89 88-88 0-30.36-24.12-54-50-54z"/></svg>', vt = '<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>', Ze = '<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>', Ct = '<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>', 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="M368 368L144 144M368 144L144 368"/></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="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>', kt = '<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 112l-64 64 64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 176h176a112 112 0 110 224H160"/></svg>', St = '<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="M336 112l64 64-64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 176H224a112 112 0 100 224h128"/></svg>', Ft = '<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>', Mt = '<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>', 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="M416 128L192 384l-96-96"/></svg>', Pt = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256l208 112 208-112-208-112L48 256z"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 336l208 112 208-112M48 176L256 64l208 112"/></svg>', Kr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256s80-144 208-144 208 144 208 144-80 144-208 144S48 256 48 256z"/><circle cx="256" cy="256" r="64" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Jr = '<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 448L80 64M160 160c-67.2 36.8-112 96-112 96s80 144 208 144c35.8 0 68.4-11.3 96-28.1M224.4 113.8A199.6 199.6 0 01256 112c128 0 208 144 208 144a334.2 334.2 0 01-65.1 78.6"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M213.3 213.3A64 64 0 10298.7 298.7"/></svg>', Qr = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01192 0v64"/></svg>', ei = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01168-63.7"/></svg>', ti = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M96 352l-32 96 96-32L421.5 154.5a45.3 45.3 0 000-64h0a45.3 45.3 0 00-64 0L96 352z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 128l64 64"/></svg>', ri = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="144" y="144" width="288" height="288" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M80 368V112a32 32 0 0132-32h256"/></svg>', At = '<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="M96 112V80h320v32M256 80v352M184 432h144"/></svg>', Nt = '<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>', zt = '<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>', Tt = '<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>', Le = '<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>', 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="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>', Lt = '<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>', Rt = '<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="M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z"/><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z"/></svg>', Ne = [
2014
+ const $e = '<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>', Ge = '<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>', $r = '<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>', Gr = '<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>', Zr = '<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>', pt = '<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>', ft = '<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>', mt = '<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>', gt = '<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>', bt = '<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>', _t = '<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="M452.37 59.63h0a40.49 40.49 0 00-57.26 0L184 294.74c23.08 4.7 46.12 27.29 49.26 49.26l219.11-227.11a40.49 40.49 0 000-57.26z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M138 336c-29.88 0-54 24.5-54 54.86 0 23.95-20.67 36.57-34 44.78 15.08 8.08 32.23 12.36 50 12.36 48.49 0 88-38.89 88-88 0-30.36-24.12-54-50-54z"/></svg>', yt = '<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>', Ze = '<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>', xt = '<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>', 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="M368 368L144 144M368 144L144 368"/></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="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>', wt = '<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 112l-64 64 64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M112 176h176a112 112 0 110 224H160"/></svg>', vt = '<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="M336 112l64 64-64 64"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M400 176H224a112 112 0 100 224h128"/></svg>', Ct = '<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>', kt = '<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>', 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="M416 128L192 384l-96-96"/></svg>', St = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256l208 112 208-112-208-112L48 256z"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 336l208 112 208-112M48 176L256 64l208 112"/></svg>', Kr = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M48 256s80-144 208-144 208 144 208 144-80 144-208 144S48 256 48 256z"/><circle cx="256" cy="256" r="64" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/></svg>', Jr = '<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 448L80 64M160 160c-67.2 36.8-112 96-112 96s80 144 208 144c35.8 0 68.4-11.3 96-28.1M224.4 113.8A199.6 199.6 0 01256 112c128 0 208 144 208 144a334.2 334.2 0 01-65.1 78.6"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M213.3 213.3A64 64 0 10298.7 298.7"/></svg>', Qr = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01192 0v64"/></svg>', ei = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="96" y="208" width="320" height="240" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 208v-64a96 96 0 01168-63.7"/></svg>', ti = '<svg viewBox="0 0 512 512" width="20" height="20"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M96 352l-32 96 96-32L421.5 154.5a45.3 45.3 0 000-64h0a45.3 45.3 0 00-64 0L96 352z"/><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 128l64 64"/></svg>', ri = '<svg viewBox="0 0 512 512" width="20" height="20"><rect x="144" y="144" width="288" height="288" rx="32" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32"/><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M80 368V112a32 32 0 0132-32h256"/></svg>', Ft = '<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="M96 112V80h320v32M256 80v352M184 432h144"/></svg>', Mt = '<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>', At = '<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>', Pt = '<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>', Re = '<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>', 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="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>', Nt = '<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>', Tt = '<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="M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z"/><path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32" d="M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z"/></svg>', Ne = [
2015
2015
  {
2016
2016
  id: "adjust",
2017
2017
  name: "Adjust",
2018
- icon: gt,
2018
+ icon: pt,
2019
2019
  registryCategories: ["adjust", "advanced"]
2020
2020
  // adjustment, adjustmentAdvanced, alpha, colorMatrix
2021
2021
  },
2022
2022
  {
2023
2023
  id: "blur",
2024
2024
  name: "Blur",
2025
- icon: bt,
2025
+ icon: ft,
2026
2026
  registryCategories: ["blur"]
2027
2027
  },
2028
2028
  {
2029
2029
  id: "color",
2030
2030
  name: "Color",
2031
- icon: _t,
2031
+ icon: mt,
2032
2032
  registryCategories: ["color"]
2033
2033
  },
2034
2034
  {
2035
2035
  id: "effects",
2036
2036
  name: "Effects",
2037
- icon: yt,
2037
+ icon: gt,
2038
2038
  registryCategories: ["effects"]
2039
2039
  },
2040
2040
  {
2041
2041
  id: "distortion",
2042
2042
  name: "Distortion",
2043
- icon: xt,
2043
+ icon: bt,
2044
2044
  registryCategories: ["distortion"]
2045
2045
  },
2046
2046
  {
2047
2047
  id: "light",
2048
2048
  name: "Light",
2049
- icon: vt,
2049
+ icon: yt,
2050
2050
  registryCategories: ["light"]
2051
2051
  },
2052
2052
  {
2053
2053
  id: "stylize",
2054
2054
  name: "Stylize",
2055
- icon: Lt,
2055
+ icon: Nt,
2056
2056
  registryCategories: ["stylize"]
2057
2057
  },
2058
2058
  {
2059
2059
  id: "text",
2060
2060
  name: "Text",
2061
- icon: At
2061
+ icon: Ft
2062
2062
  },
2063
2063
  {
2064
2064
  id: "background",
2065
2065
  name: "Background",
2066
- icon: wt
2066
+ icon: _t
2067
2067
  },
2068
2068
  {
2069
2069
  id: "layers",
2070
2070
  name: "Layers",
2071
- icon: Pt
2071
+ icon: St
2072
2072
  },
2073
2073
  {
2074
2074
  id: "crop",
2075
2075
  name: "Crop",
2076
2076
  icon: Ze
2077
2077
  }
2078
- ], Bt = Object.fromEntries(
2078
+ ], zt = Object.fromEntries(
2079
2079
  Ne.filter((a) => Array.isArray(a.registryCategories) && a.registryCategories.length > 0).map((a) => [a.id, a.registryCategories])
2080
- ), Et = Object.fromEntries(
2080
+ ), Rt = Object.fromEntries(
2081
2081
  Ne.filter((a) => Array.isArray(a.registryCategories)).flatMap((a) => a.registryCategories.map((e) => [e, a.id]))
2082
2082
  );
2083
- function It(a) {
2084
- return Bt[a] || [a];
2083
+ function Lt(a) {
2084
+ return zt[a] || [a];
2085
2085
  }
2086
- class Dt extends de {
2086
+ class Bt extends de {
2087
2087
  constructor(e, t) {
2088
2088
  super(), this.state = e, this.renderer = t, this.instances = {}, this._filterRegistry = null;
2089
2089
  }
@@ -2119,7 +2119,7 @@ class Dt extends de {
2119
2119
  */
2120
2120
  getFiltersByCategory(e) {
2121
2121
  if (!this._filterRegistry) return [];
2122
- const t = It(e), r = [], i = /* @__PURE__ */ new Set();
2122
+ const t = Lt(e), r = [], i = /* @__PURE__ */ new Set();
2123
2123
  for (const s of t) {
2124
2124
  const n = this._filterRegistry.getFiltersByCategory(s) || [];
2125
2125
  for (const o of n)
@@ -2366,10 +2366,10 @@ class Dt extends de {
2366
2366
  const C = new Set((m.controls || []).map((N) => N.id));
2367
2367
  for (const [N, ue] of Object.entries(g))
2368
2368
  C.has(N) || (_[N] = ue);
2369
- const k = this.renderer.sprite, A = this.renderer.originalTexture;
2370
- _._sourceWidth = Math.round((A == null ? void 0 : A.width) || (k == null ? void 0 : k.width) || 0), _._sourceHeight = Math.round((A == null ? void 0 : A.height) || (k == null ? void 0 : k.height) || 0);
2371
- const P = m.createFilter(_);
2372
- P && (r.push(P), this.instances[p] = P);
2369
+ const k = this.renderer.sprite, P = this.renderer.originalTexture;
2370
+ _._sourceWidth = Math.round((P == null ? void 0 : P.width) || (k == null ? void 0 : k.width) || 0), _._sourceHeight = Math.round((P == null ? void 0 : P.height) || (k == null ? void 0 : k.height) || 0);
2371
+ const A = m.createFilter(_);
2372
+ A && (r.push(A), this.instances[p] = A);
2373
2373
  } catch {
2374
2374
  i.push(p);
2375
2375
  }
@@ -2440,15 +2440,28 @@ const J = class J extends de {
2440
2440
  return null;
2441
2441
  }
2442
2442
  /**
2443
- * Apply aspect ratio constraint to crop rect
2443
+ * Return the numeric aspect ratio that the crop rect must obey, accounting
2444
+ * for both the shape (circle/square force 1:1) and the explicit aspect
2445
+ * setting. Returns null when the crop is free-form.
2446
+ */
2447
+ _getEffectiveTargetAspect() {
2448
+ const e = this.state.get("crop.shape");
2449
+ if (e === "circle" || e === "square") return 1;
2450
+ const t = this.state.get("crop.aspect");
2451
+ return !t || t === "free" ? null : this._getAspectRatio(t);
2452
+ }
2453
+ /**
2454
+ * Apply aspect ratio constraint to crop rect. Honours shape (circle/square
2455
+ * force 1:1) so the post-drag correction agrees with the effective ratio
2456
+ * the edge-handle drag code targets.
2444
2457
  */
2445
2458
  applyAspectRatio() {
2446
- const e = this.state.get("crop.rect"), t = this.state.get("crop.aspect");
2447
- if (!e || t === "free") return;
2448
- const r = this._getAspectRatio(t);
2449
- if (!r) return;
2450
- const i = e.width / e.height;
2451
- Math.abs(i - r) < 0.01 || (i > r ? e.width = e.height * r : e.height = e.width / r, this.state.set("crop.rect", e));
2459
+ const e = this.state.get("crop.rect");
2460
+ if (!e) return;
2461
+ const t = this._getEffectiveTargetAspect();
2462
+ if (!t) return;
2463
+ const r = e.width / e.height;
2464
+ Math.abs(r - t) < 0.01 || (r > t ? e.width = e.height * t : e.height = e.width / t, this.state.set("crop.rect", e));
2452
2465
  }
2453
2466
  /**
2454
2467
  * Constrain crop rect to bounds
@@ -2588,33 +2601,53 @@ const J = class J extends de {
2588
2601
  * Handle pointer move event
2589
2602
  */
2590
2603
  _handlePointerMove(e) {
2591
- var l, c, d, h;
2604
+ var c, d, h, u;
2592
2605
  const t = this.renderer.app;
2593
2606
  if (!t) return;
2594
2607
  const r = e.global;
2595
2608
  if (!this._isDragging || !this._dragStart || !this._startRect) {
2596
- this._hoverMode = this._hitHandle(r.x, r.y), t.stage.cursor = this._hoverMode === "move" ? "move" : this._hoverMode === "n" || this._hoverMode === "s" ? "ns-resize" : this._hoverMode === "e" || this._hoverMode === "w" ? "ew-resize" : (l = this._hoverMode) != null && l.endsWith("nw") || (c = this._hoverMode) != null && c.endsWith("se") ? "nwse-resize" : (d = this._hoverMode) != null && d.endsWith("ne") || (h = this._hoverMode) != null && h.endsWith("sw") ? "nesw-resize" : "crosshair", this.drawOverlay();
2609
+ this._hoverMode = this._hitHandle(r.x, r.y), t.stage.cursor = this._hoverMode === "move" ? "move" : this._hoverMode === "n" || this._hoverMode === "s" ? "ns-resize" : this._hoverMode === "e" || this._hoverMode === "w" ? "ew-resize" : (c = this._hoverMode) != null && c.endsWith("nw") || (d = this._hoverMode) != null && d.endsWith("se") ? "nwse-resize" : (h = this._hoverMode) != null && h.endsWith("ne") || (u = this._hoverMode) != null && u.endsWith("sw") ? "nesw-resize" : "crosshair", this.drawOverlay();
2597
2610
  return;
2598
2611
  }
2599
2612
  const i = this.state.get("crop.rect");
2600
2613
  if (!i) return;
2601
- const s = r.x - this._dragStart.x, n = r.y - this._dragStart.y;
2614
+ const s = r.x - this._dragStart.x, n = r.y - this._dragStart.y, o = this._getEffectiveTargetAspect();
2602
2615
  switch (this._dragMode) {
2603
2616
  case "move":
2604
2617
  i.x = this._startRect.x + s, i.y = this._startRect.y + n;
2605
2618
  break;
2606
- case "n":
2607
- i.y = this._startRect.y + n, i.height = this._startRect.height - n;
2619
+ case "n": {
2620
+ const p = this._startRect.height - n;
2621
+ if (i.y = this._startRect.y + n, i.height = p, o) {
2622
+ const m = p * o;
2623
+ i.x = this._startRect.x + (this._startRect.width - m) / 2, i.width = m;
2624
+ }
2608
2625
  break;
2609
- case "s":
2610
- i.height = this._startRect.height + n;
2626
+ }
2627
+ case "s": {
2628
+ const p = this._startRect.height + n;
2629
+ if (i.height = p, o) {
2630
+ const m = p * o;
2631
+ i.x = this._startRect.x + (this._startRect.width - m) / 2, i.width = m;
2632
+ }
2611
2633
  break;
2612
- case "w":
2613
- i.x = this._startRect.x + s, i.width = this._startRect.width - s;
2634
+ }
2635
+ case "w": {
2636
+ const p = this._startRect.width - s;
2637
+ if (i.x = this._startRect.x + s, i.width = p, o) {
2638
+ const m = p / o;
2639
+ i.y = this._startRect.y + (this._startRect.height - m) / 2, i.height = m;
2640
+ }
2614
2641
  break;
2615
- case "e":
2616
- i.width = this._startRect.width + s;
2642
+ }
2643
+ case "e": {
2644
+ const p = this._startRect.width + s;
2645
+ if (i.width = p, o) {
2646
+ const m = p / o;
2647
+ i.y = this._startRect.y + (this._startRect.height - m) / 2, i.height = m;
2648
+ }
2617
2649
  break;
2650
+ }
2618
2651
  case "resize-nw":
2619
2652
  i.x = this._startRect.x + s, i.y = this._startRect.y + n, i.width = this._startRect.width - s, i.height = this._startRect.height - n;
2620
2653
  break;
@@ -2686,8 +2719,8 @@ const J = class J extends de {
2686
2719
  if (h <= 0 || u <= 0) return null;
2687
2720
  const g = new s.Container(), _ = new s.Sprite(r);
2688
2721
  if (this.state.get("crop.shape") === "circle") {
2689
- const F = Math.round(Math.max(h, u)), B = p + h / 2, V = m + u / 2;
2690
- p = Math.round(B - F / 2), m = Math.round(V - F / 2), h = u = F;
2722
+ const F = Math.round(Math.max(h, u)), L = p + h / 2, V = m + u / 2;
2723
+ p = Math.round(L - F / 2), m = Math.round(V - F / 2), h = u = F;
2691
2724
  const M = new s.Graphics();
2692
2725
  typeof M.circle == "function" && typeof M.fill == "function" ? M.circle(h / 2, u / 2, h / 2).fill(16777215) : (M.beginFill(16777215, 1), M.drawCircle(h / 2, u / 2, h / 2), M.endFill()), _.mask = M, g.addChild(M);
2693
2726
  }
@@ -2698,17 +2731,17 @@ const J = class J extends de {
2698
2731
  target: k,
2699
2732
  clear: !0
2700
2733
  }), g.destroy({ children: !0 });
2701
- const A = this.renderer.originalTexture;
2702
- A && A !== this.renderer.baseTexture && A.destroy(!0), this.renderer.originalTexture = k, e.stage.removeChild(t), t.destroy();
2703
- const P = new s.Sprite(k);
2704
- e.stage.addChild(P), this.renderer.sprite = P, this.renderer.fitScale = this.renderer.getFitScaleFor(k), this.renderer.setZoom(n, { keepCenter: !1 }), this.renderer.applyViewTransform(), this.renderer.render();
2734
+ const P = this.renderer.originalTexture;
2735
+ P && P !== this.renderer.baseTexture && P.destroy(!0), this.renderer.originalTexture = k, e.stage.removeChild(t), t.destroy();
2736
+ const A = new s.Sprite(k);
2737
+ e.stage.addChild(A), this.renderer.sprite = A, this.renderer.fitScale = this.renderer.getFitScaleFor(k), this.renderer.setZoom(n, { keepCenter: !1 }), this.renderer.applyViewTransform(), this.renderer.render();
2705
2738
  const N = this.state.get("crop.appliedRect"), x = N && Number.isFinite(N.x) && Number.isFinite(N.y) && Number.isFinite(N.width) && Number.isFinite(N.height) ? {
2706
2739
  x: Math.round(N.x + p),
2707
2740
  y: Math.round(N.y + m),
2708
2741
  width: h,
2709
2742
  height: u
2710
- } : { x: p, y: m, width: h, height: u }, S = this.state.get("crop.shape") || "free", z = this.state.get("crop.aspect") || "free";
2711
- return this.disable(), this.state.set("crop.appliedRect", x), this.state.set("crop.appliedShape", S), this.state.set("crop.appliedAspect", z), this.state.set("crop.dirty", !1), this.emit("applied", { width: h, height: u }), { texture: k, preservedZoom: n };
2743
+ } : { x: p, y: m, width: h, height: u }, S = this.state.get("crop.shape") || "free", T = this.state.get("crop.aspect") || "free";
2744
+ return this.disable(), this.state.set("crop.appliedRect", x), this.state.set("crop.appliedShape", S), this.state.set("crop.appliedAspect", T), this.state.set("crop.dirty", !1), this.emit("applied", { width: h, height: u }), { texture: k, preservedZoom: n };
2712
2745
  }
2713
2746
  /**
2714
2747
  * Apply a crop from saved texture-pixel coordinates (for state rehydration).
@@ -2725,10 +2758,10 @@ const J = class J extends de {
2725
2758
  if (l <= 0 || c <= 0) return null;
2726
2759
  const u = new n.Container(), p = new n.Sprite(s);
2727
2760
  if (t === "circle") {
2728
- const C = Math.round(Math.max(l, c)), k = d + l / 2, A = h + c / 2;
2729
- d = Math.round(k - C / 2), h = Math.round(A - C / 2), l = c = C;
2730
- const P = new n.Graphics();
2731
- typeof P.circle == "function" && typeof P.fill == "function" ? P.circle(l / 2, c / 2, l / 2).fill(16777215) : (P.beginFill(16777215, 1), P.drawCircle(l / 2, c / 2, l / 2), P.endFill()), p.mask = P, u.addChild(P);
2761
+ const C = Math.round(Math.max(l, c)), k = d + l / 2, P = h + c / 2;
2762
+ d = Math.round(k - C / 2), h = Math.round(P - C / 2), l = c = C;
2763
+ const A = new n.Graphics();
2764
+ typeof A.circle == "function" && typeof A.fill == "function" ? A.circle(l / 2, c / 2, l / 2).fill(16777215) : (A.beginFill(16777215, 1), A.drawCircle(l / 2, c / 2, l / 2), A.endFill()), p.mask = A, u.addChild(A);
2732
2765
  }
2733
2766
  p.x = -d, p.y = -h, u.addChild(p);
2734
2767
  const m = n.RenderTexture.create({ width: l, height: c });
@@ -2772,8 +2805,8 @@ ve(J, "AUTO_ZOOM_PADDING", 1.1), /**
2772
2805
  * Minimum interval (ms) between auto-zoom adjustments during drag.
2773
2806
  */
2774
2807
  ve(J, "AUTO_ZOOM_THROTTLE_MS", 100);
2775
- let Pe = J;
2776
- class Ot {
2808
+ let Ae = J;
2809
+ class Et {
2777
2810
  /**
2778
2811
  * Create a new RemoveBgManager
2779
2812
  * @param {Object} options
@@ -3133,7 +3166,7 @@ function rt({ id: a, label: e, options: t = [], value: r, onChange: i }) {
3133
3166
  o.value = l;
3134
3167
  }, s;
3135
3168
  }
3136
- function Y({ label: a, className: e = "", onClick: t, icon: r = null, disabled: i = !1 }) {
3169
+ function j({ label: a, className: e = "", onClick: t, icon: r = null, disabled: i = !1 }) {
3137
3170
  const s = f("button", {
3138
3171
  type: "button",
3139
3172
  className: `btn ${e}`.trim(),
@@ -3148,7 +3181,7 @@ function Y({ label: a, className: e = "", onClick: t, icon: r = null, disabled:
3148
3181
  }
3149
3182
  return a && s.appendChild(document.createTextNode(a)), s;
3150
3183
  }
3151
- function R({ icon: a, title: e, className: t = "", onClick: r, disabled: i = !1, testId: s = null, ariaLabel: n = null }) {
3184
+ function Y({ icon: a, title: e, className: t = "", onClick: r, disabled: i = !1, testId: s = null, ariaLabel: n = null }) {
3152
3185
  const o = {
3153
3186
  type: "button",
3154
3187
  className: `icon-btn ${t}`.trim(),
@@ -3179,7 +3212,7 @@ function ye({ label: a, icon: e, active: t = !1, onClick: r }) {
3179
3212
  i.classList.toggle("active", s);
3180
3213
  }, i;
3181
3214
  }
3182
- class jt {
3215
+ class It {
3183
3216
  constructor(e, t) {
3184
3217
  this.state = e, this.editor = t, this.element = null, this._removeBgBtn = null, this._removeBgTierSelect = null, this._removeBgStatus = null, this._removeBgTier = "balanced", this._unsubscribers = [];
3185
3218
  }
@@ -3189,8 +3222,8 @@ class jt {
3189
3222
  */
3190
3223
  render() {
3191
3224
  this.element = f("div", { className: "editor-toolbar" });
3192
- const e = f("div", { className: "toolbar-section toolbar-left" }), t = R({
3193
- icon: Mt,
3225
+ const e = f("div", { className: "toolbar-section toolbar-left" }), t = Y({
3226
+ icon: kt,
3194
3227
  title: "Open Image",
3195
3228
  className: "toolbar-btn",
3196
3229
  testId: "btn-open-image",
@@ -3198,51 +3231,15 @@ class jt {
3198
3231
  onClick: () => this.editor.openFilePicker()
3199
3232
  });
3200
3233
  e.appendChild(t);
3201
- const r = f("div", { className: "toolbar-section toolbar-center" }), i = R({
3202
- icon: ft,
3203
- title: "Zoom Out",
3204
- className: "toolbar-btn",
3205
- testId: "btn-zoom-out",
3206
- ariaLabel: "Zoom out",
3207
- onClick: () => {
3208
- const u = this.state.get("zoom");
3209
- this.editor.setZoom(u - 0.25);
3210
- }
3211
- });
3212
- this._zoomLabel = f("span", {
3213
- className: "zoom-label",
3214
- "aria-live": "polite",
3215
- "aria-atomic": "true",
3216
- role: "status"
3217
- }, "100%");
3218
- const s = R({
3219
- icon: pt,
3220
- title: "Zoom In",
3221
- className: "toolbar-btn",
3222
- testId: "btn-zoom-in",
3223
- ariaLabel: "Zoom in",
3224
- onClick: () => {
3225
- const u = this.state.get("zoom");
3226
- this.editor.setZoom(u + 0.25);
3227
- }
3228
- }), n = R({
3229
- icon: mt,
3230
- title: "Fit to Screen",
3231
- className: "toolbar-btn",
3232
- testId: "btn-fit-screen",
3233
- ariaLabel: "Fit to screen",
3234
- onClick: () => this.editor.fitToScreen()
3235
- });
3236
- r.appendChild(i), r.appendChild(this._zoomLabel), r.appendChild(s), r.appendChild(n);
3237
- const o = f("div", { className: "toolbar-section toolbar-right" });
3238
- this._themeBtn = R({
3239
- icon: this.state.get("isDarkMode") ? Le : Re,
3234
+ const r = f("div", { className: "toolbar-section toolbar-right" });
3235
+ this._themeBtn = Y({
3236
+ icon: this.state.get("isDarkMode") ? Re : Le,
3240
3237
  title: "Toggle Theme",
3241
3238
  className: "toolbar-btn toolbar-btn-theme",
3242
3239
  testId: "btn-toggle-theme",
3243
3240
  ariaLabel: "Toggle theme",
3244
3241
  onClick: () => this.editor.toggleTheme()
3245
- }), this._cropBtn = R({
3242
+ }), this._cropBtn = Y({
3246
3243
  icon: Ze,
3247
3244
  title: "Crop",
3248
3245
  className: "toolbar-btn toolbar-btn-crop",
@@ -3252,26 +3249,26 @@ class jt {
3252
3249
  this.state.get("mode") === "crop" ? this.editor.setMode("filters") : this.editor.setMode("crop");
3253
3250
  }
3254
3251
  });
3255
- const l = f("div", { className: "remove-bg-control" });
3252
+ const i = f("div", { className: "remove-bg-control" });
3256
3253
  this._removeBgTierSelect = f("select", {
3257
3254
  className: "remove-bg-tier-select",
3258
3255
  title: "Background removal quality",
3259
3256
  "aria-label": "Background removal quality",
3260
3257
  dataset: { testid: "select-remove-background-tier" },
3261
- onChange: (u) => {
3262
- this._removeBgTier = u.target.value;
3258
+ onChange: (d) => {
3259
+ this._removeBgTier = d.target.value;
3263
3260
  }
3264
3261
  });
3265
- for (const u of [
3262
+ for (const d of [
3266
3263
  ["fast", "Fast"],
3267
3264
  ["balanced", "Balanced"],
3268
3265
  ["best", "Best"]
3269
3266
  ]) {
3270
- const p = f("option", { value: u[0] }, u[1]);
3271
- u[0] === this._removeBgTier && (p.selected = !0), this._removeBgTierSelect.appendChild(p);
3267
+ const h = f("option", { value: d[0] }, d[1]);
3268
+ d[0] === this._removeBgTier && (h.selected = !0), this._removeBgTierSelect.appendChild(h);
3272
3269
  }
3273
- this._removeBgBtn = R({
3274
- icon: Rt,
3270
+ this._removeBgBtn = Y({
3271
+ icon: Tt,
3275
3272
  title: "Remove Background",
3276
3273
  className: "toolbar-btn toolbar-btn-remove-bg",
3277
3274
  testId: "btn-remove-background",
@@ -3294,59 +3291,59 @@ class jt {
3294
3291
  role: "status",
3295
3292
  "aria-live": "polite",
3296
3293
  "aria-atomic": "true"
3297
- }), l.appendChild(this._removeBgTierSelect), l.appendChild(this._removeBgBtn), l.appendChild(this._removeBgStatus);
3298
- const c = R({
3294
+ }), i.appendChild(this._removeBgTierSelect), i.appendChild(this._removeBgBtn), i.appendChild(this._removeBgStatus);
3295
+ const s = Y({
3299
3296
  icon: Ke,
3300
3297
  title: "Reset All",
3301
3298
  className: "toolbar-btn",
3302
3299
  testId: "btn-reset-all",
3303
3300
  ariaLabel: "Reset all changes",
3304
3301
  onClick: () => this.editor.resetAll()
3305
- }), d = R({
3306
- icon: Ct,
3302
+ }), n = f("button", {
3303
+ type: "button",
3304
+ className: "icon-btn toolbar-btn toolbar-btn-primary toolbar-save-labeled",
3307
3305
  title: "Save Image",
3308
- className: "toolbar-btn toolbar-btn-primary",
3309
- testId: "btn-save-edit",
3310
- ariaLabel: "Save image",
3306
+ "aria-label": "Save image",
3307
+ dataset: { testid: "btn-save-edit" },
3311
3308
  onClick: () => this.editor.save()
3312
- }), h = R({
3313
- icon: Ae,
3309
+ }), o = f("span", { className: "btn-icon" });
3310
+ o.innerHTML = xt;
3311
+ const l = o.querySelector("svg");
3312
+ l && l.setAttribute("aria-hidden", "true"), n.appendChild(o), n.appendChild(f("span", { className: "toolbar-save-label" }, "Save"));
3313
+ const c = Y({
3314
+ icon: Pe,
3314
3315
  title: "Close",
3315
3316
  className: "toolbar-btn",
3316
3317
  testId: "btn-cancel-edit",
3317
3318
  ariaLabel: "Close editor",
3318
3319
  onClick: () => this.editor.close()
3319
3320
  });
3320
- return o.appendChild(this._themeBtn), o.appendChild(this._cropBtn), o.appendChild(l), o.appendChild(c), o.appendChild(d), o.appendChild(h), this.element.appendChild(e), this.element.appendChild(r), this.element.appendChild(o), this._subscribeToState(), this.element;
3321
+ return r.appendChild(this._themeBtn), r.appendChild(this._cropBtn), r.appendChild(i), r.appendChild(s), r.appendChild(n), r.appendChild(c), this.element.appendChild(e), this.element.appendChild(r), this._subscribeToState(), this.element;
3321
3322
  }
3322
3323
  /**
3323
3324
  * Subscribe to state changes
3324
3325
  */
3325
3326
  _subscribeToState() {
3326
- const e = this.state.on("change:zoom", ({ value: d }) => {
3327
- this._zoomLabel.textContent = `${Math.round(d * 100)}%`;
3327
+ const e = this.state.on("change:isDarkMode", ({ value: c }) => {
3328
+ this._themeBtn.innerHTML = c ? Re : Le;
3328
3329
  });
3329
3330
  this._unsubscribers.push(e);
3330
- const t = this.state.on("change:isDarkMode", ({ value: d }) => {
3331
- this._themeBtn.innerHTML = d ? Le : Re;
3331
+ const t = this.state.on("change:mode", ({ value: c }) => {
3332
+ this._cropBtn && this._cropBtn.classList.toggle("toolbar-btn-primary", c === "crop");
3332
3333
  });
3333
3334
  this._unsubscribers.push(t);
3334
- const r = this.state.on("change:mode", ({ value: d }) => {
3335
- this._cropBtn && this._cropBtn.classList.toggle("toolbar-btn-primary", d === "crop");
3336
- });
3335
+ const r = this.state.on("change:hasImage", () => this._updateRemoveBgButton());
3337
3336
  this._unsubscribers.push(r);
3338
- const i = this.state.on("change:hasImage", () => this._updateRemoveBgButton());
3337
+ const i = this.state.on("change:isProcessing", () => this._updateRemoveBgButton());
3339
3338
  this._unsubscribers.push(i);
3340
- const s = this.state.on("change:isProcessing", () => this._updateRemoveBgButton());
3339
+ const s = this.state.on("change:backgroundRemovalAvailable", () => this._updateRemoveBgButton());
3341
3340
  this._unsubscribers.push(s);
3342
- const n = this.state.on("change:backgroundRemovalAvailable", () => this._updateRemoveBgButton());
3341
+ const n = this.state.on("change:editorDocument", () => this._updateRemoveBgButton());
3343
3342
  this._unsubscribers.push(n);
3344
- const o = this.state.on("change:editorDocument", () => this._updateRemoveBgButton());
3343
+ const o = this.state.on("change:layers", () => this._updateRemoveBgButton());
3345
3344
  this._unsubscribers.push(o);
3346
- const l = this.state.on("change:layers", () => this._updateRemoveBgButton());
3345
+ const l = this.state.on("change:activeLayerId", () => this._updateRemoveBgButton());
3347
3346
  this._unsubscribers.push(l);
3348
- const c = this.state.on("change:activeLayerId", () => this._updateRemoveBgButton());
3349
- this._unsubscribers.push(c);
3350
3347
  }
3351
3348
  _canRemoveBackground() {
3352
3349
  return typeof this.editor.canRemoveBackground == "function" ? this.editor.canRemoveBackground() : !!this.state.get("hasImage") && typeof this.editor.removeBackground == "function";
@@ -3359,13 +3356,6 @@ class jt {
3359
3356
  _setRemoveBgStatus(e) {
3360
3357
  this._removeBgStatus && (this._removeBgStatus.textContent = e);
3361
3358
  }
3362
- /**
3363
- * Update zoom display
3364
- * @param {number} zoom
3365
- */
3366
- updateZoom(e) {
3367
- this._zoomLabel && (this._zoomLabel.textContent = `${Math.round(e * 100)}%`);
3368
- }
3369
3359
  /**
3370
3360
  * Clean up
3371
3361
  */
@@ -3375,7 +3365,7 @@ class jt {
3375
3365
  }
3376
3366
  }
3377
3367
  const be = Ne;
3378
- class Yt {
3368
+ class Dt {
3379
3369
  constructor(e, t) {
3380
3370
  this.state = e, this.editor = t, this.element = null, this._chips = /* @__PURE__ */ new Map(), this._scrollIndex = 0, this._unsubscribers = [];
3381
3371
  }
@@ -3388,7 +3378,7 @@ class Yt {
3388
3378
  this._onSelect = e, this.element = f("div", {
3389
3379
  className: "category-carousel-container",
3390
3380
  "data-testid": "category-carousel"
3391
- }), this._leftBtn = R({
3381
+ }), this._leftBtn = Y({
3392
3382
  icon: $e,
3393
3383
  title: "Previous categories",
3394
3384
  className: "carousel-nav carousel-nav-left",
@@ -3401,7 +3391,7 @@ class Yt {
3401
3391
  onClick: () => this._selectCategory(r.id)
3402
3392
  });
3403
3393
  i.dataset.categoryId = r.id, i.dataset.category = r.id, i.dataset.testid = `category-${r.id}`, this._chips.set(r.id, i), this._carousel.appendChild(i);
3404
- }), this._rightBtn = R({
3394
+ }), this._rightBtn = Y({
3405
3395
  icon: Ge,
3406
3396
  title: "Next categories",
3407
3397
  className: "carousel-nav carousel-nav-right",
@@ -3514,7 +3504,7 @@ class Yt {
3514
3504
  this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
3515
3505
  }
3516
3506
  }
3517
- class Ut {
3507
+ class Ot {
3518
3508
  constructor(e, t) {
3519
3509
  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;
3520
3510
  }
@@ -3524,12 +3514,12 @@ class Ut {
3524
3514
  * @returns {HTMLElement}
3525
3515
  */
3526
3516
  render({ onToggle: e, onSelect: t }) {
3527
- return this._onToggle = e, this._onSelect = t, this.element = f("div", { className: "filter-carousel-container" }), this._leftBtn = R({
3517
+ return this._onToggle = e, this._onSelect = t, this.element = f("div", { className: "filter-carousel-container" }), this._leftBtn = Y({
3528
3518
  icon: $e,
3529
3519
  title: "Previous filters",
3530
3520
  className: "carousel-nav carousel-nav-left",
3531
3521
  onClick: () => this._scrollLeft()
3532
- }), this._carousel = f("div", { className: "filter-carousel" }), this._rightBtn = R({
3522
+ }), this._carousel = f("div", { className: "filter-carousel" }), this._rightBtn = Y({
3533
3523
  icon: Ge,
3534
3524
  title: "Next filters",
3535
3525
  className: "carousel-nav carousel-nav-right",
@@ -3671,7 +3661,7 @@ class Ut {
3671
3661
  this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._filterCards.clear(), (e = this.element) == null || e.remove(), this.element = null;
3672
3662
  }
3673
3663
  }
3674
- class Xt {
3664
+ class jt {
3675
3665
  constructor(e, t) {
3676
3666
  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 = [];
3677
3667
  }
@@ -3720,7 +3710,7 @@ class Xt {
3720
3710
  return;
3721
3711
  }
3722
3712
  const r = f("div", { className: "adjustments-header" });
3723
- r.appendChild(f("span", { className: "adjustments-title" }, t.name)), r.appendChild(Y({
3713
+ r.appendChild(f("span", { className: "adjustments-title" }, t.name)), r.appendChild(j({
3724
3714
  label: "Reset",
3725
3715
  className: "btn-text",
3726
3716
  onClick: () => this._handleReset(e)
@@ -3805,7 +3795,7 @@ class Xt {
3805
3795
  });
3806
3796
  case "button":
3807
3797
  const l = f("div", { className: "button-control" });
3808
- return l.appendChild(Y({
3798
+ return l.appendChild(j({
3809
3799
  label: i,
3810
3800
  className: "btn-secondary",
3811
3801
  onClick: () => this._handleAction(e, t.action || t.id)
@@ -3905,7 +3895,7 @@ class Xt {
3905
3895
  this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._controls.clear(), (e = this.element) == null || e.remove(), this.element = null;
3906
3896
  }
3907
3897
  }
3908
- class Vt {
3898
+ class Yt {
3909
3899
  constructor(e, t) {
3910
3900
  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;
3911
3901
  }
@@ -3918,22 +3908,22 @@ class Vt {
3918
3908
  this._onChange = t, this._onReset = r, this._onRemove = i, this._onAction = s, this._container = e, this._drawer = f("div", { className: "mobile-filter-drawer" });
3919
3909
  const n = f("div", { className: "drawer-header" });
3920
3910
  this._titleEl = f("span", { className: "drawer-title" }, "Filter");
3921
- const o = f("div", { className: "drawer-header-actions" }), l = Y({
3911
+ const o = f("div", { className: "drawer-header-actions" }), l = j({
3922
3912
  label: "Reset",
3923
3913
  className: "btn-text",
3924
3914
  onClick: () => {
3925
3915
  var h;
3926
3916
  this._currentFilterId && ((h = this._onReset) == null || h.call(this, this._currentFilterId), this._renderControls());
3927
3917
  }
3928
- }), c = Y({
3918
+ }), c = j({
3929
3919
  label: "Remove",
3930
3920
  className: "btn-text btn-danger",
3931
3921
  onClick: () => {
3932
3922
  var h;
3933
3923
  this._currentFilterId && ((h = this._onRemove) == null || h.call(this, this._currentFilterId), this.close());
3934
3924
  }
3935
- }), d = R({
3936
- icon: Ae,
3925
+ }), d = Y({
3926
+ icon: Pe,
3937
3927
  title: "Close",
3938
3928
  className: "btn-icon-sm",
3939
3929
  ariaLabel: "Close drawer",
@@ -4082,7 +4072,7 @@ class Vt {
4082
4072
  });
4083
4073
  case "button": {
4084
4074
  const o = f("div", { className: "button-control" });
4085
- return o.appendChild(Y({
4075
+ return o.appendChild(j({
4086
4076
  label: i,
4087
4077
  className: "btn-secondary",
4088
4078
  onClick: () => {
@@ -4129,7 +4119,7 @@ class Vt {
4129
4119
  this._controls.clear(), (e = this._drawer) == null || e.remove(), this._drawer = null, this._isOpen = !1, this._currentFilterId = null, this._container = null;
4130
4120
  }
4131
4121
  }
4132
- class Ht {
4122
+ class Ut {
4133
4123
  constructor(e, t) {
4134
4124
  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;
4135
4125
  }
@@ -4202,18 +4192,18 @@ class Ht {
4202
4192
  this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._chips.clear(), (e = this.element) == null || e.remove(), this.element = null;
4203
4193
  }
4204
4194
  }
4205
- const Wt = [
4206
- { id: "free", name: "Free", icon: Tt },
4207
- { id: "square", name: "Square", icon: Nt },
4208
- { id: "circle", name: "Circle", icon: zt }
4209
- ], qt = [
4195
+ const Xt = [
4196
+ { id: "free", name: "Free", icon: Pt },
4197
+ { id: "square", name: "Square", icon: Mt },
4198
+ { id: "circle", name: "Circle", icon: At }
4199
+ ], Vt = [
4210
4200
  { id: "free", name: "Free" },
4211
4201
  { id: "1:1", name: "1:1" },
4212
4202
  { id: "4:3", name: "4:3" },
4213
4203
  { id: "16:9", name: "16:9" },
4214
4204
  { id: "3:2", name: "3:2" },
4215
4205
  { id: "2:3", name: "2:3" }
4216
- ], $t = [
4206
+ ], Ht = [
4217
4207
  { id: "0", label: "0°", angle: 0 },
4218
4208
  { id: "90", label: "90°", angle: 90 },
4219
4209
  { id: "180", label: "180°", angle: 180 },
@@ -4224,7 +4214,7 @@ function te(a) {
4224
4214
  const e = Number(a) % 360;
4225
4215
  return e < 0 ? e + 360 : e;
4226
4216
  }
4227
- class Gt {
4217
+ class Wt {
4228
4218
  constructor(e, t, r = null) {
4229
4219
  this.state = e, this.cropManager = t, this.editor = r, this.element = null, this._shapeChips = /* @__PURE__ */ new Map(), this._aspectChips = /* @__PURE__ */ new Map(), this._rotationPresetChips = /* @__PURE__ */ new Map(), this._rotationRange = null, this._rotationNumber = null, this._rotationValue = null, this._unsubscribers = [];
4230
4220
  }
@@ -4248,7 +4238,7 @@ class Gt {
4248
4238
  const e = f("div", { className: "crop-section" });
4249
4239
  e.appendChild(f("label", { className: "section-label" }, "Shape"));
4250
4240
  const t = f("div", { className: "chip-row" }), r = this.state.get("crop.shape");
4251
- Wt.forEach((c) => {
4241
+ Xt.forEach((c) => {
4252
4242
  const d = ye({
4253
4243
  label: c.name,
4254
4244
  icon: c.icon,
@@ -4258,7 +4248,7 @@ class Gt {
4258
4248
  d.dataset.shape = c.id, d.dataset.testid = `crop-shape-${c.id}`, this._shapeChips.set(c.id, d), t.appendChild(d);
4259
4249
  }), e.appendChild(t), this.element.appendChild(e), this.state.get("lockCropShape") && (e.style.display = "none"), this._shapeSection = e, this._aspectSection = f("div", { className: "crop-section" }), this._aspectSection.appendChild(f("label", { className: "section-label" }, "Aspect Ratio"));
4260
4250
  const i = f("div", { className: "chip-row aspect-row" }), s = this.state.get("crop.aspect");
4261
- qt.forEach((c) => {
4251
+ Vt.forEach((c) => {
4262
4252
  const d = ye({
4263
4253
  label: c.name,
4264
4254
  active: s === c.id,
@@ -4266,14 +4256,14 @@ class Gt {
4266
4256
  });
4267
4257
  d.dataset.ratio = c.id, d.dataset.testid = `crop-ratio-${c.id}`, this._aspectChips.set(c.id, d), i.appendChild(d);
4268
4258
  }), this._aspectSection.appendChild(i), this.element.appendChild(this._aspectSection), this._updateAspectVisibility();
4269
- const n = f("div", { className: "crop-actions" }), o = Y({
4259
+ const n = f("div", { className: "crop-actions" }), o = j({
4270
4260
  label: "Cancel",
4271
4261
  className: "btn-secondary crop-cancel-btn",
4272
- icon: Ae,
4262
+ icon: Pe,
4273
4263
  onClick: () => this.cropManager.cancel()
4274
4264
  });
4275
4265
  o.dataset.testid = "cancel-crop";
4276
- const l = Y({
4266
+ const l = j({
4277
4267
  label: "Apply Crop",
4278
4268
  className: "btn-primary crop-apply-btn",
4279
4269
  icon: Me,
@@ -4284,34 +4274,34 @@ class Gt {
4284
4274
  _renderRotationSection() {
4285
4275
  const e = f("div", { className: "crop-section rotation-section" });
4286
4276
  e.appendChild(f("label", { className: "section-label" }, "Rotate"));
4287
- const t = f("div", { className: "rotation-action-row" }), r = Y({
4277
+ const t = f("div", { className: "rotation-action-row" }), r = j({
4288
4278
  label: "Left 90°",
4289
4279
  className: "btn-secondary rotation-action-btn",
4290
- icon: kt,
4280
+ icon: wt,
4291
4281
  onClick: () => this._rotateBy(-90)
4292
4282
  });
4293
4283
  r.dataset.testid = "rotate-left-90";
4294
- const i = Y({
4284
+ const i = j({
4295
4285
  label: "Right 90°",
4296
4286
  className: "btn-secondary rotation-action-btn",
4297
- icon: St,
4287
+ icon: vt,
4298
4288
  onClick: () => this._rotateBy(90)
4299
4289
  });
4300
4290
  i.dataset.testid = "rotate-right-90";
4301
- const s = Y({
4291
+ const s = j({
4302
4292
  label: "Rotate 180°",
4303
4293
  className: "btn-secondary rotation-action-btn",
4304
4294
  onClick: () => this._rotateBy(180)
4305
4295
  });
4306
4296
  s.dataset.testid = "rotate-180";
4307
- const n = Y({
4297
+ const n = j({
4308
4298
  label: "Rotate 270°",
4309
4299
  className: "btn-secondary rotation-action-btn",
4310
4300
  onClick: () => this._rotateBy(270)
4311
4301
  });
4312
4302
  n.dataset.testid = "rotate-270", t.appendChild(r), t.appendChild(i), t.appendChild(s), t.appendChild(n), e.appendChild(t);
4313
4303
  const o = f("div", { className: "chip-row rotation-preset-row" }), l = te(this.state.get("transform.rotation") ?? 0);
4314
- $t.forEach((p) => {
4304
+ Ht.forEach((p) => {
4315
4305
  const m = ye({
4316
4306
  label: p.label,
4317
4307
  active: Math.round(l) === p.angle,
@@ -4356,7 +4346,7 @@ class Gt {
4356
4346
  this._rotationNumber
4357
4347
  );
4358
4348
  c.appendChild(d), c.appendChild(h);
4359
- const u = Y({
4349
+ const u = j({
4360
4350
  label: "Reset rotation",
4361
4351
  className: "btn-text rotation-reset-btn",
4362
4352
  onClick: () => this._setRotation(0)
@@ -4459,7 +4449,7 @@ class Gt {
4459
4449
  this._unsubscribers.forEach((t) => t()), this._unsubscribers = [], this._shapeChips.clear(), this._aspectChips.clear(), this._rotationPresetChips.clear(), (e = this.element) == null || e.remove(), this.element = null;
4460
4450
  }
4461
4451
  }
4462
- class Zt {
4452
+ class qt {
4463
4453
  constructor(e, t) {
4464
4454
  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;
4465
4455
  }
@@ -4475,7 +4465,7 @@ class Zt {
4475
4465
  });
4476
4466
  const n = f("div", { className: "panel-header" });
4477
4467
  n.appendChild(f("h3", { className: "panel-title" }, "Active Filters"));
4478
- const o = Y({
4468
+ const o = j({
4479
4469
  label: "Clear All",
4480
4470
  className: "btn-text btn-danger",
4481
4471
  onClick: () => this._handleClearAll()
@@ -4541,13 +4531,13 @@ class Zt {
4541
4531
  onClick: (p) => {
4542
4532
  p.target.closest(".filter-item-actions") || this._handleSelect(e);
4543
4533
  }
4544
- }), n = f("div", { className: "filter-item-header" }), o = f("span", { className: "filter-item-name" }, t.name), l = f("div", { className: "filter-item-actions" }), c = R({
4534
+ }), n = f("div", { className: "filter-item-header" }), o = f("span", { className: "filter-item-name" }, t.name), l = f("div", { className: "filter-item-actions" }), c = Y({
4545
4535
  icon: Ke,
4546
4536
  title: "Reset filter",
4547
4537
  className: "btn-icon-sm",
4548
4538
  onClick: () => this._handleReset(e)
4549
- }), d = R({
4550
- icon: Ft,
4539
+ }), d = Y({
4540
+ icon: Ct,
4551
4541
  title: "Remove filter",
4552
4542
  className: "btn-icon-sm btn-danger",
4553
4543
  onClick: () => this._handleRemove(e)
@@ -4717,7 +4707,7 @@ const ie = {
4717
4707
  lockAspectRatio: !1
4718
4708
  }
4719
4709
  };
4720
- function Kt(a) {
4710
+ function $t(a) {
4721
4711
  if (!a)
4722
4712
  return { ...ke.free };
4723
4713
  if (typeof a == "object" && a !== null)
@@ -4730,7 +4720,7 @@ function ae(a) {
4730
4720
  const e = Number(a) % 360;
4731
4721
  return e < 0 ? e + 360 : e;
4732
4722
  }
4733
- function Jt(a, e) {
4723
+ function Gt(a, e) {
4734
4724
  const t = ae(a);
4735
4725
  return (ae(e) - t + 540) % 360 - 180;
4736
4726
  }
@@ -4745,7 +4735,7 @@ class ii extends de {
4745
4735
  if (super(), !e)
4746
4736
  throw new Error("VanillaImageEditor: container element is required");
4747
4737
  this._container = e, this._destroyed = !1, this._loadVersion = 0, this._objectUrls = /* @__PURE__ */ new Set(), this._activeObjectUrl = null;
4748
- const r = t.preset ? Kt(t.preset) : null, i = r ? {
4738
+ const r = t.preset ? $t(t.preset) : null, i = r ? {
4749
4739
  initialMode: r.initialMode === "crop" ? "crop" : "adjust",
4750
4740
  cropShape: r.cropShape,
4751
4741
  initialAspectRatio: r.aspectRatio
@@ -4764,7 +4754,7 @@ class ii extends de {
4764
4754
  },
4765
4755
  ...i,
4766
4756
  ...t
4767
- }, this._preset = r, this._state = ht(), 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 ut(), this._filterManager = new Dt(this._state, this._renderer), this._cropManager = new Pe(this._state, this._renderer), this._removeBgManager = null, this._backgroundRemovalAvailable = !1, ((s = this._options.backgroundRemoval) == null ? void 0 : s.enabled) !== !1 && (this._removeBgManager = new Ot({
4757
+ }, this._preset = r, this._state = ht(), 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 ut(), this._filterManager = new Bt(this._state, this._renderer), this._cropManager = new Ae(this._state, this._renderer), this._removeBgManager = null, this._backgroundRemovalAvailable = !1, ((s = this._options.backgroundRemoval) == null ? void 0 : s.enabled) !== !1 && (this._removeBgManager = new Et({
4768
4758
  endpoint: (n = this._options.backgroundRemoval) == null ? void 0 : n.endpoint,
4769
4759
  optionsEndpoint: (o = this._options.backgroundRemoval) == null ? void 0 : o.optionsEndpoint,
4770
4760
  fallbackEndpoint: (l = this._options.backgroundRemoval) == null ? void 0 : l.fallbackEndpoint
@@ -4803,31 +4793,31 @@ class ii extends de {
4803
4793
  * Initialize UI components
4804
4794
  */
4805
4795
  _initUI() {
4806
- this._toolbar = new jt(this._state, this), this._toolbarContainer.appendChild(this._toolbar.render()), this._filterControlsEl = f("div", { className: "filter-controls-container" }), this._categoryCarousel = new Yt(this._state, this), this._filterControlsEl.appendChild(this._categoryCarousel.render((i) => {
4796
+ this._toolbar = new It(this._state, this), this._toolbarContainer.appendChild(this._toolbar.render()), this._filterControlsEl = f("div", { className: "filter-controls-container" }), this._categoryCarousel = new Dt(this._state, this), this._filterControlsEl.appendChild(this._categoryCarousel.render((i) => {
4807
4797
  }));
4808
4798
  const e = f("div", { className: "filter-layout" }), t = f("div", { className: "filter-left-column" });
4809
- this._filterCarousel = new Ut(this._state, this._filterManager), t.appendChild(this._filterCarousel.render({
4799
+ this._filterCarousel = new Ot(this._state, this._filterManager), t.appendChild(this._filterCarousel.render({
4810
4800
  onToggle: (i, s) => this._handleFilterToggle(i, s),
4811
4801
  onSelect: (i) => {
4812
4802
  this._handleFilterSelect(i), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(i);
4813
4803
  }
4814
- })), this._filterAdjustments = new Xt(this._state, this._filterManager), t.appendChild(this._filterAdjustments.render({
4804
+ })), this._filterAdjustments = new jt(this._state, this._filterManager), t.appendChild(this._filterAdjustments.render({
4815
4805
  onChange: (i, s, n) => this._handleFilterChange(i, s, n),
4816
4806
  onReset: (i) => this._handleFilterReset(i),
4817
4807
  onAction: (i, s) => this._handleFilterAction(i, s)
4818
4808
  })), e.appendChild(t);
4819
4809
  const r = f("div", { className: "filter-right-column" });
4820
- this._activeFiltersPanel = new Zt(this._state, this._filterManager), r.appendChild(this._activeFiltersPanel.render({
4810
+ this._activeFiltersPanel = new qt(this._state, this._filterManager), r.appendChild(this._activeFiltersPanel.render({
4821
4811
  onRemove: (i) => this._handleFilterToggle(i, !1),
4822
4812
  onReset: (i) => this._handleFilterReset(i),
4823
4813
  onClearAll: () => this.resetAll(),
4824
4814
  onSelect: (i) => this._handleFilterSelect(i)
4825
- })), e.appendChild(r), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new Ht(this._state, this._filterManager), this._filterControlsEl.appendChild(this._mobileActiveFilters.render({
4815
+ })), e.appendChild(r), this._filterControlsEl.appendChild(e), this._mobileActiveFilters = new Ut(this._state, this._filterManager), this._filterControlsEl.appendChild(this._mobileActiveFilters.render({
4826
4816
  onToggle: (i, s) => this._handleFilterToggle(i, s),
4827
4817
  onSelect: (i) => {
4828
4818
  this._handleFilterSelect(i), this._isMobile && this._mobileFilterDrawer && this._mobileFilterDrawer.open(i);
4829
4819
  }
4830
- })), this._cropControls = new Gt(this._state, this._cropManager, this), this._cropControlsEl = this._cropControls.render(), this._cropControlsEl.style.display = "none", this._controlsSection.appendChild(this._filterControlsEl), this._controlsSection.appendChild(this._cropControlsEl), this._mobileFilterDrawer = new Vt(this._state, this._filterManager), this._mobileFilterDrawer.build(this._controlsSection, {
4820
+ })), this._cropControls = new Wt(this._state, this._cropManager, this), this._cropControlsEl = this._cropControls.render(), this._cropControlsEl.style.display = "none", this._controlsSection.appendChild(this._filterControlsEl), this._controlsSection.appendChild(this._cropControlsEl), this._mobileFilterDrawer = new Yt(this._state, this._filterManager), this._mobileFilterDrawer.build(this._controlsSection, {
4831
4821
  onChange: (i, s, n) => this._handleFilterChange(i, s, n),
4832
4822
  onReset: (i) => this._handleFilterReset(i),
4833
4823
  onRemove: (i) => {
@@ -5007,7 +4997,7 @@ class ii extends de {
5007
4997
  this._state.set("selectedFilter", i);
5008
4998
  const s = this._filterManager.getFilterDef(i);
5009
4999
  if (typeof (s == null ? void 0 : s.category) == "string") {
5010
- const n = Et[s.category] ?? s.category;
5000
+ const n = Rt[s.category] ?? s.category;
5011
5001
  this._state.set("selectedCategory", n);
5012
5002
  }
5013
5003
  }
@@ -5138,7 +5128,7 @@ class ii extends de {
5138
5128
  }
5139
5129
  setRotationAngle(e) {
5140
5130
  if (!this._state.get("hasImage")) return !1;
5141
- const t = ae(this._state.get("transform.rotation") ?? 0), r = ae(e), i = Jt(t, r), s = this._state.get("mode") === "crop";
5131
+ const t = ae(this._state.get("transform.rotation") ?? 0), r = ae(e), i = Gt(t, r), s = this._state.get("mode") === "crop";
5142
5132
  if (Math.abs(i) > 1e-3) {
5143
5133
  if (s && this._cropManager.disable(), !this._renderer.rotateBy(i))
5144
5134
  return s && this._cropManager.enable(), !1;
@@ -5289,20 +5279,20 @@ class ii extends de {
5289
5279
  }
5290
5280
  }
5291
5281
  const U = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map();
5292
- function Qt(a, e) {
5282
+ function Zt(a, e) {
5293
5283
  return !Array.isArray(a.mediaTargets) || a.mediaTargets.length === 0 ? !0 : a.mediaTargets.includes(e);
5294
5284
  }
5295
5285
  function y(a) {
5296
5286
  var e;
5297
5287
  return U.has(a.id), U.set(a.id, a), Q.has(a.category) || Q.set(a.category, []), (e = Q.get(a.category)) == null || e.push(a.id), a;
5298
5288
  }
5299
- function er(a) {
5289
+ function Kt(a) {
5300
5290
  return U.get(a);
5301
5291
  }
5302
5292
  function xe() {
5303
5293
  return Array.from(U.values());
5304
5294
  }
5305
- function tr() {
5295
+ function Jt() {
5306
5296
  xe().map((t) => t.id), Object.entries(v).filter(
5307
5297
  (t) => /Filter$/.test(t[0]) && typeof t[1] == "function"
5308
5298
  ).forEach(([t, r]) => {
@@ -5326,16 +5316,16 @@ function tr() {
5326
5316
  });
5327
5317
  });
5328
5318
  }
5329
- function rr(a) {
5319
+ function Qt(a) {
5330
5320
  return (Q.get(a) || []).map((t) => U.get(t)).filter(Boolean);
5331
5321
  }
5332
- function ir() {
5322
+ function er() {
5333
5323
  return Array.from(Q.keys());
5334
5324
  }
5335
5325
  function si(a) {
5336
5326
  return U.has(a);
5337
5327
  }
5338
- function sr(a) {
5328
+ function tr(a) {
5339
5329
  const e = U.get(a);
5340
5330
  if (!e)
5341
5331
  return !1;
@@ -5349,9 +5339,9 @@ function sr(a) {
5349
5339
  }
5350
5340
  function ai(a, e) {
5351
5341
  const t = U.get(a);
5352
- return t ? Qt(t, e) : !1;
5342
+ return t ? Zt(t, e) : !1;
5353
5343
  }
5354
- function ar() {
5344
+ function rr() {
5355
5345
  return Array.from(U.values()).map((a) => ({
5356
5346
  id: a.id,
5357
5347
  name: a.name,
@@ -5360,7 +5350,7 @@ function ar() {
5360
5350
  }));
5361
5351
  }
5362
5352
  if (typeof window < "u") {
5363
- window.__DEBUG_FILTERS_LIST = Array.from(U.keys()), window.getAllFilters = xe, window.getFilter = er, window.getFiltersByCategory = rr, window.getRegisteredFilters = ar;
5353
+ window.__DEBUG_FILTERS_LIST = Array.from(U.keys()), window.getAllFilters = xe, window.getFilter = Kt, window.getFiltersByCategory = Qt, window.getRegisteredFilters = rr;
5364
5354
  const a = y;
5365
5355
  window.registerFilter = (e) => {
5366
5356
  const t = a(e);
@@ -5370,7 +5360,7 @@ if (typeof window < "u") {
5370
5360
  typeof window < "u" && (window.initializeFilterRegistry = window.initializeFilterRegistry || function() {
5371
5361
  return [];
5372
5362
  });
5373
- const { AdjustmentFilter: nr } = v, { ColorMatrixFilter: or } = D, W = {
5363
+ const { AdjustmentFilter: ir } = v, { ColorMatrixFilter: sr } = I, W = {
5374
5364
  gamma: 1,
5375
5365
  saturation: 1,
5376
5366
  contrast: 1,
@@ -5379,7 +5369,7 @@ const { AdjustmentFilter: nr } = v, { ColorMatrixFilter: or } = D, W = {
5379
5369
  green: 1,
5380
5370
  blue: 1,
5381
5371
  alpha: 1
5382
- }, lr = /* @__PURE__ */ new Set([
5372
+ }, ar = /* @__PURE__ */ new Set([
5383
5373
  "gamma",
5384
5374
  "saturation",
5385
5375
  "contrast",
@@ -5400,9 +5390,9 @@ function q(a, e) {
5400
5390
  return e;
5401
5391
  }
5402
5392
  function Be(a) {
5403
- return lr.has(a);
5393
+ return ar.has(a);
5404
5394
  }
5405
- function cr(a) {
5395
+ function nr(a) {
5406
5396
  return {
5407
5397
  gamma: q(a.gamma, W.gamma),
5408
5398
  saturation: q(a.saturation, W.saturation),
@@ -5425,9 +5415,9 @@ y({
5425
5415
  // Create an instance of the AdjustmentFilter with the provided parameters
5426
5416
  createFilter: (a) => {
5427
5417
  try {
5428
- const e = cr(a ?? {}), t = { ...e };
5418
+ const e = nr(a ?? {}), t = { ...e };
5429
5419
  try {
5430
- const r = new nr(t), i = r;
5420
+ const r = new ir(t), i = r;
5431
5421
  return i._customParams = { ...e }, i.updateUIParam = function(n, o) {
5432
5422
  try {
5433
5423
  if (!Be(n))
@@ -5440,7 +5430,7 @@ y({
5440
5430
  }
5441
5431
  }, r;
5442
5432
  } catch {
5443
- const i = new or(), s = i;
5433
+ const i = new sr(), s = i;
5444
5434
  return s._customParams = { ...e }, Ee(i, e), s.updateUIParam = function(o, l) {
5445
5435
  try {
5446
5436
  if (!Be(o))
@@ -5550,14 +5540,14 @@ y({
5550
5540
  }
5551
5541
  ]
5552
5542
  });
5553
- const { ColorMatrixFilter: hr } = D, K = {
5543
+ const { ColorMatrixFilter: or } = I, K = {
5554
5544
  brightness: 1,
5555
5545
  contrast: 1,
5556
5546
  saturation: 1,
5557
5547
  hue: 0,
5558
5548
  sepia: 0,
5559
5549
  negative: !1
5560
- }, dr = /* @__PURE__ */ new Set([
5550
+ }, lr = /* @__PURE__ */ new Set([
5561
5551
  "brightness",
5562
5552
  "contrast",
5563
5553
  "saturation",
@@ -5565,8 +5555,8 @@ const { ColorMatrixFilter: hr } = D, K = {
5565
5555
  "sepia",
5566
5556
  "negative"
5567
5557
  ]);
5568
- function ur(a) {
5569
- return dr.has(a);
5558
+ function cr(a) {
5559
+ return lr.has(a);
5570
5560
  }
5571
5561
  function se(a, e) {
5572
5562
  if (typeof a == "number" && Number.isFinite(a))
@@ -5589,7 +5579,7 @@ function it(a, e) {
5589
5579
  }
5590
5580
  return e;
5591
5581
  }
5592
- function pr(a) {
5582
+ function hr(a) {
5593
5583
  return {
5594
5584
  brightness: se(a.brightness, K.brightness),
5595
5585
  contrast: se(a.contrast, K.contrast),
@@ -5610,10 +5600,10 @@ y({
5610
5600
  // Create an instance of the ColorMatrixFilter with the provided parameters
5611
5601
  createFilter: (a) => {
5612
5602
  try {
5613
- const e = pr(a ?? {}), t = new hr(), r = t;
5603
+ const e = hr(a ?? {}), t = new or(), r = t;
5614
5604
  return r._customParams = { ...e }, Ie(t, e), r.updateUIParam = function(s, n) {
5615
5605
  try {
5616
- if (!ur(s))
5606
+ if (!cr(s))
5617
5607
  return;
5618
5608
  const o = this._customParams ?? { ...K };
5619
5609
  if (s === "negative")
@@ -5707,7 +5697,7 @@ y({
5707
5697
  category: "adjust",
5708
5698
  description: "Adjust the opacity of the image",
5709
5699
  createFilter: (a) => {
5710
- const e = De(a.alpha !== void 0 ? Number(a.alpha) : 1), t = new D.AlphaFilter(e);
5700
+ const e = De(a.alpha !== void 0 ? Number(a.alpha) : 1), t = new I.AlphaFilter(e);
5711
5701
  return t.updateUIParam = function(r, i) {
5712
5702
  r === "alpha" && (this.alpha = De(Number(i)));
5713
5703
  }, t;
@@ -5739,7 +5729,7 @@ y({
5739
5729
  */
5740
5730
  createFilter: (a) => {
5741
5731
  try {
5742
- const e = new D.BlurFilter({
5732
+ const e = new I.BlurFilter({
5743
5733
  strength: a.blur || 8,
5744
5734
  quality: a.quality || 4
5745
5735
  });
@@ -5810,7 +5800,7 @@ y({
5810
5800
  category: "advanced",
5811
5801
  description: "Advanced color adjustments including sepia, hue rotation, and negative",
5812
5802
  createFilter: (a) => {
5813
- const e = D.ColorMatrixFilter;
5803
+ const e = I.ColorMatrixFilter;
5814
5804
  if (!e) return null;
5815
5805
  const t = new e(), r = je(a);
5816
5806
  return t._customParams = { ...r }, Oe(t, r), t.updateUIParam = function(i, s) {
@@ -5899,7 +5889,7 @@ y({
5899
5889
  }
5900
5890
  ]
5901
5891
  });
5902
- const { ColorOverlayFilter: fr } = v;
5892
+ const { ColorOverlayFilter: dr } = v;
5903
5893
  y({
5904
5894
  id: "colorOverlay",
5905
5895
  name: "Color Overlay",
@@ -5914,7 +5904,7 @@ y({
5914
5904
  try {
5915
5905
  let e = 16711680;
5916
5906
  a.color && (typeof a.color == "string" ? e = parseInt(a.color.replace("#", "0x"), 16) : typeof a.color == "number" && (e = a.color));
5917
- const t = new fr({
5907
+ const t = new dr({
5918
5908
  color: e,
5919
5909
  alpha: a.alpha || 0.5
5920
5910
  });
@@ -6004,7 +5994,7 @@ y({
6004
5994
  const p = Number(h._distance ?? h.distance ?? 5) * u, m = Number(h._angle ?? h.angle ?? 90), g = Number(h.blur ?? 2) * u, _ = Number(h.quality ?? 3), C = {
6005
5995
  x: p * Math.cos(m * Math.PI / 180),
6006
5996
  y: p * Math.sin(m * Math.PI / 180)
6007
- }, k = h.color ? String(h.color).replace("#", "0x") : "0x000000", A = new v.DropShadowFilter({
5997
+ }, k = h.color ? String(h.color).replace("#", "0x") : "0x000000", P = new v.DropShadowFilter({
6008
5998
  offset: C,
6009
5999
  color: parseInt(k, 16),
6010
6000
  alpha: h.alpha !== void 0 ? Number(h.alpha) : 0.5,
@@ -6015,8 +6005,8 @@ y({
6015
6005
  x: h.pixelSizeX !== void 0 ? Number(h.pixelSizeX) : 1,
6016
6006
  y: h.pixelSizeY !== void 0 ? Number(h.pixelSizeY) : 1
6017
6007
  }
6018
- }), P = l(g, _, C.x, C.y);
6019
- return A._exportPadding = P, A.padding = Math.max(A.padding ?? 0, P), A;
6008
+ }), A = l(g, _, C.x, C.y);
6009
+ return P._exportPadding = A, P.padding = Math.max(P.padding ?? 0, A), P;
6020
6010
  };
6021
6011
  o.createExportFilter = function(h = {}) {
6022
6012
  const u = Number.isFinite(h.previewToNativeScale) ? Math.max(1, Number(h.previewToNativeScale)) : 1, p = this._customParams || a;
@@ -6177,7 +6167,7 @@ y({
6177
6167
  }
6178
6168
  ]
6179
6169
  });
6180
- const { ColorMatrixFilter: mr } = D;
6170
+ const { ColorMatrixFilter: ur } = I;
6181
6171
  y({
6182
6172
  id: "grayscale",
6183
6173
  name: "Grayscale",
@@ -6190,7 +6180,7 @@ y({
6190
6180
  */
6191
6181
  createFilter: (a) => {
6192
6182
  try {
6193
- const e = new mr();
6183
+ const e = new ur();
6194
6184
  e._customParams = { ...a };
6195
6185
  const t = a.intensity !== void 0 ? a.intensity : 1;
6196
6186
  return Ye(e, t), e.updateUIParam = function(r, i) {
@@ -6230,7 +6220,7 @@ y({
6230
6220
  function Ye(a, e) {
6231
6221
  a.reset(), a.greyscale(e);
6232
6222
  }
6233
- const { HslAdjustmentFilter: gr } = v;
6223
+ const { HslAdjustmentFilter: pr } = v;
6234
6224
  y({
6235
6225
  id: "hsl-adjustment",
6236
6226
  name: "HSL Adjustment",
@@ -6242,7 +6232,7 @@ y({
6242
6232
  */
6243
6233
  createFilter: (a) => {
6244
6234
  try {
6245
- const e = new gr({
6235
+ const e = new pr({
6246
6236
  hue: a.hue !== void 0 ? a.hue : 0,
6247
6237
  saturation: a.saturation !== void 0 ? a.saturation : 0,
6248
6238
  lightness: a.lightness !== void 0 ? a.lightness : 0,
@@ -6340,7 +6330,7 @@ y({
6340
6330
  }
6341
6331
  ]
6342
6332
  });
6343
- const { KawaseBlurFilter: br } = v;
6333
+ const { KawaseBlurFilter: fr } = v;
6344
6334
  y({
6345
6335
  id: "kawase-blur",
6346
6336
  name: "Kawase Blur",
@@ -6353,7 +6343,7 @@ y({
6353
6343
  */
6354
6344
  createFilter: (a) => {
6355
6345
  try {
6356
- const e = new br({
6346
+ const e = new fr({
6357
6347
  strength: a.strength || 4,
6358
6348
  quality: a.quality || 3,
6359
6349
  clamp: a.clamp || !1,
@@ -6458,7 +6448,7 @@ y({
6458
6448
  }
6459
6449
  ]
6460
6450
  });
6461
- const { MotionBlurFilter: _r } = v;
6451
+ const { MotionBlurFilter: mr } = v;
6462
6452
  y({
6463
6453
  id: "motion-blur",
6464
6454
  name: "Motion Blur",
@@ -6471,7 +6461,7 @@ y({
6471
6461
  */
6472
6462
  createFilter: (a) => {
6473
6463
  try {
6474
- const e = new _r({
6464
+ const e = new mr({
6475
6465
  velocity: {
6476
6466
  x: a.velocityX !== void 0 ? a.velocityX : 0,
6477
6467
  y: a.velocityY !== void 0 ? a.velocityY : 0
@@ -6566,7 +6556,7 @@ y({
6566
6556
  }
6567
6557
  ]
6568
6558
  });
6569
- const { RadialBlurFilter: yr } = v;
6559
+ const { RadialBlurFilter: gr } = v;
6570
6560
  y({
6571
6561
  id: "radial-blur",
6572
6562
  name: "Radial Blur",
@@ -6575,7 +6565,7 @@ y({
6575
6565
  // Create an instance of the RadialBlurFilter with the provided parameters
6576
6566
  createFilter: (a) => {
6577
6567
  try {
6578
- const e = new yr({
6568
+ const e = new gr({
6579
6569
  angle: a.angle ?? 20,
6580
6570
  center: { x: a.centerX ?? 0, y: a.centerY ?? 0 },
6581
6571
  kernelSize: a.kernelSize ?? 15,
@@ -6690,7 +6680,7 @@ y({
6690
6680
  }
6691
6681
  ]
6692
6682
  });
6693
- const { TiltShiftFilter: xr } = v;
6683
+ const { TiltShiftFilter: br } = v;
6694
6684
  y({
6695
6685
  id: "tilt-shift",
6696
6686
  name: "Tilt Shift",
@@ -6699,7 +6689,7 @@ y({
6699
6689
  // Create an instance of the TiltShiftFilter with the provided parameters
6700
6690
  createFilter: (a) => {
6701
6691
  try {
6702
- const e = typeof a.blur == "number" ? a.blur : 100, t = typeof a.gradientBlur == "number" ? a.gradientBlur : 600, r = typeof a.startX == "number" ? a.startX : 0, i = typeof a.startY == "number" ? a.startY : 0.5, s = typeof a.endX == "number" ? a.endX : 1, n = typeof a.endY == "number" ? a.endY : 0.5, o = new xr({
6692
+ const e = typeof a.blur == "number" ? a.blur : 100, t = typeof a.gradientBlur == "number" ? a.gradientBlur : 600, r = typeof a.startX == "number" ? a.startX : 0, i = typeof a.startY == "number" ? a.startY : 0.5, s = typeof a.endX == "number" ? a.endX : 1, n = typeof a.endY == "number" ? a.endY : 0.5, o = new br({
6703
6693
  blur: Number(e),
6704
6694
  gradientBlur: Number(t),
6705
6695
  start: { x: Number(r), y: Number(i) },
@@ -6818,7 +6808,7 @@ y({
6818
6808
  }
6819
6809
  ]
6820
6810
  });
6821
- const { ZoomBlurFilter: wr } = v;
6811
+ const { ZoomBlurFilter: _r } = v;
6822
6812
  y({
6823
6813
  id: "zoom-blur",
6824
6814
  name: "Zoom Blur",
@@ -6831,7 +6821,7 @@ y({
6831
6821
  */
6832
6822
  createFilter: (a) => {
6833
6823
  try {
6834
- const e = new wr({
6824
+ const e = new _r({
6835
6825
  strength: a.strength || 0.1,
6836
6826
  center: {
6837
6827
  x: a.centerX !== void 0 ? a.centerX : 0.5,
@@ -6949,7 +6939,7 @@ const { ColorGradientFilter: Ue } = v;
6949
6939
  function st(a) {
6950
6940
  return parseInt(a.replace("#", "0x"), 16);
6951
6941
  }
6952
- function vr(a) {
6942
+ function yr(a) {
6953
6943
  return "#" + a.toString(16).padStart(6, "0");
6954
6944
  }
6955
6945
  function Xe(a) {
@@ -6962,7 +6952,7 @@ function Xe(a) {
6962
6952
  function Ve(a) {
6963
6953
  return {
6964
6954
  offset: a.offset,
6965
- color: typeof a.color == "number" ? vr(a.color) : a.color,
6955
+ color: typeof a.color == "number" ? yr(a.color) : a.color,
6966
6956
  alpha: a.alpha
6967
6957
  };
6968
6958
  }
@@ -7185,7 +7175,7 @@ y({
7185
7175
  if (!e)
7186
7176
  return null;
7187
7177
  let t = null;
7188
- a.texturePath ? t = D.Texture.from(a.texturePath) : t = D.Texture.from("/examples/filters-main/examples/images/colormap.png");
7178
+ a.texturePath ? t = I.Texture.from(a.texturePath) : t = I.Texture.from("/examples/filters-main/examples/images/colormap.png");
7189
7179
  const r = new e({
7190
7180
  colorMap: t,
7191
7181
  nearest: a.nearest,
@@ -7195,7 +7185,7 @@ y({
7195
7185
  const n = this._customParams || {};
7196
7186
  switch (this._customParams = n, n[i] = s, i) {
7197
7187
  case "texturePath":
7198
- s && (this.colorMap = D.Texture.from(s));
7188
+ s && (this.colorMap = I.Texture.from(s));
7199
7189
  break;
7200
7190
  case "mix":
7201
7191
  this.mix = s;
@@ -7256,7 +7246,7 @@ y({
7256
7246
  }
7257
7247
  ]
7258
7248
  });
7259
- const Cr = v.ColorReplaceFilter;
7249
+ const xr = v.ColorReplaceFilter;
7260
7250
  y({
7261
7251
  id: "color-replace",
7262
7252
  name: "Color Replace",
@@ -7273,7 +7263,7 @@ y({
7273
7263
  a.originalColor && (typeof a.originalColor == "string" ? e = parseInt(a.originalColor.replace("#", "0x"), 16) : typeof a.originalColor == "number" && (e = a.originalColor));
7274
7264
  let t = 255;
7275
7265
  a.targetColor && (typeof a.targetColor == "string" ? t = parseInt(a.targetColor.replace("#", "0x"), 16) : typeof a.targetColor == "number" && (t = a.targetColor));
7276
- const r = new Cr({
7266
+ const r = new xr({
7277
7267
  originalColor: e,
7278
7268
  targetColor: t,
7279
7269
  tolerance: a.tolerance || 0.4
@@ -7337,7 +7327,7 @@ y({
7337
7327
  }
7338
7328
  ]
7339
7329
  });
7340
- const kr = v.MultiColorReplaceFilter;
7330
+ const wr = v.MultiColorReplaceFilter;
7341
7331
  y({
7342
7332
  id: "multi-color-replace",
7343
7333
  name: "Multi-Color Replace",
@@ -7363,7 +7353,7 @@ y({
7363
7353
  const r = typeof a.originalColor3 == "string" ? parseInt(a.originalColor3.replace("#", "0x"), 16) : a.originalColor3, i = typeof a.targetColor3 == "string" ? parseInt(a.targetColor3.replace("#", "0x"), 16) : a.targetColor3;
7364
7354
  e.push([r, i]);
7365
7355
  }
7366
- const t = new kr(
7356
+ const t = new wr(
7367
7357
  e,
7368
7358
  a.tolerance || 0.05,
7369
7359
  3
@@ -7474,7 +7464,7 @@ y({
7474
7464
  }
7475
7465
  ]
7476
7466
  });
7477
- const { RGBSplitFilter: Sr } = v;
7467
+ const { RGBSplitFilter: vr } = v;
7478
7468
  y({
7479
7469
  id: "rgb-split",
7480
7470
  name: "RGB Split",
@@ -7495,7 +7485,7 @@ y({
7495
7485
  }, r = {
7496
7486
  x: a.blueX !== void 0 ? a.blueX : 0,
7497
7487
  y: a.blueY !== void 0 ? a.blueY : 0
7498
- }, i = new Sr({
7488
+ }, i = new vr({
7499
7489
  red: e,
7500
7490
  green: t,
7501
7491
  blue: r
@@ -7608,7 +7598,7 @@ y({
7608
7598
  }
7609
7599
  ]
7610
7600
  });
7611
- const { AdvancedBloomFilter: Fr } = v;
7601
+ const { AdvancedBloomFilter: Cr } = v;
7612
7602
  y({
7613
7603
  id: "advanced-bloom",
7614
7604
  name: "Advanced Bloom",
@@ -7617,7 +7607,7 @@ y({
7617
7607
  // Create an instance of the AdvancedBloomFilter with the provided parameters
7618
7608
  createFilter: (a) => {
7619
7609
  try {
7620
- const e = new Fr({
7610
+ const e = new Cr({
7621
7611
  threshold: a.threshold || 0.5,
7622
7612
  bloomScale: a.bloomScale || 1,
7623
7613
  brightness: a.brightness || 1,
@@ -7764,7 +7754,7 @@ y({
7764
7754
  }
7765
7755
  ]
7766
7756
  });
7767
- const Mr = v.AsciiFilter;
7757
+ const kr = v.AsciiFilter;
7768
7758
  y({
7769
7759
  id: "ascii",
7770
7760
  name: "ASCII",
@@ -7776,7 +7766,7 @@ y({
7776
7766
  const e = typeof a.size == "number" ? a.size : 8;
7777
7767
  let t = a.color;
7778
7768
  typeof t == "string" && t.startsWith("#") && (t = parseInt(t.replace("#", "0x"), 16));
7779
- const r = a.replaceColor === !0, i = new Mr({
7769
+ const r = a.replaceColor === !0, i = new kr({
7780
7770
  size: e,
7781
7771
  color: t,
7782
7772
  replaceColor: r
@@ -7843,7 +7833,7 @@ y({
7843
7833
  }
7844
7834
  ]
7845
7835
  });
7846
- const Pr = v.BackdropBlurFilter;
7836
+ const Sr = v.BackdropBlurFilter;
7847
7837
  y({
7848
7838
  id: "backdrop-blur",
7849
7839
  name: "Backdrop Blur",
@@ -7852,7 +7842,7 @@ y({
7852
7842
  // Create an instance of the BackdropBlurFilter with the provided parameters
7853
7843
  createFilter: (a) => {
7854
7844
  try {
7855
- const e = new Pr({
7845
+ const e = new Sr({
7856
7846
  // Higher strength values (20-50) make the effect more noticeable
7857
7847
  strength: a.strength || 20,
7858
7848
  quality: a.quality || 4,
@@ -7950,7 +7940,7 @@ y({
7950
7940
  }
7951
7941
  ]
7952
7942
  });
7953
- const { BevelFilter: Ar } = v;
7943
+ const { BevelFilter: Fr } = v;
7954
7944
  y({
7955
7945
  id: "bevel",
7956
7946
  name: "Bevel",
@@ -7962,7 +7952,7 @@ y({
7962
7952
  */
7963
7953
  createFilter: (a) => {
7964
7954
  try {
7965
- const e = a.lightColor ? a.lightColor.replace("#", "0x") : "0xffffff", t = a.shadowColor ? a.shadowColor.replace("#", "0x") : "0x000000", r = new Ar({
7955
+ const e = a.lightColor ? a.lightColor.replace("#", "0x") : "0xffffff", t = a.shadowColor ? a.shadowColor.replace("#", "0x") : "0x000000", r = new Fr({
7966
7956
  rotation: a.rotation !== void 0 ? a.rotation : 45,
7967
7957
  thickness: a.thickness !== void 0 ? a.thickness : 2,
7968
7958
  lightColor: parseInt(e, 16),
@@ -8078,7 +8068,7 @@ y({
8078
8068
  }
8079
8069
  ]
8080
8070
  });
8081
- const { BloomFilter: Nr } = v;
8071
+ const { BloomFilter: Mr } = v;
8082
8072
  y({
8083
8073
  id: "bloom",
8084
8074
  name: "Bloom/Glow",
@@ -8087,7 +8077,7 @@ y({
8087
8077
  // Create an instance of the BloomFilter with the provided parameters
8088
8078
  createFilter: (a) => {
8089
8079
  try {
8090
- const e = typeof a.strengthX == "number" ? a.strengthX : 2, t = typeof a.strengthY == "number" ? a.strengthY : 2, r = typeof a.quality == "number" ? a.quality : 4, i = typeof a.resolution == "number" ? a.resolution : 1, s = typeof a.kernelSize == "number" ? a.kernelSize : 5, n = new Nr({
8080
+ const e = typeof a.strengthX == "number" ? a.strengthX : 2, t = typeof a.strengthY == "number" ? a.strengthY : 2, r = typeof a.quality == "number" ? a.quality : 4, i = typeof a.resolution == "number" ? a.resolution : 1, s = typeof a.kernelSize == "number" ? a.kernelSize : 5, n = new Mr({
8091
8081
  strength: {
8092
8082
  x: Number(e),
8093
8083
  y: Number(t)
@@ -8298,7 +8288,7 @@ y({
8298
8288
  }
8299
8289
  ]
8300
8290
  });
8301
- const { ConvolutionFilter: zr } = v, re = {
8291
+ const { ConvolutionFilter: Ar } = v, re = {
8302
8292
  normal: [0, 0, 0, 0, 1, 0, 0, 0, 0],
8303
8293
  gaussianBlur: [0.045, 0.122, 0.045, 0.122, 0.332, 0.122, 0.045, 0.122, 0.045],
8304
8294
  boxBlur: [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9],
@@ -8333,7 +8323,7 @@ y({
8333
8323
  const r = a.preset;
8334
8324
  e = re[r] || re.normal;
8335
8325
  }
8336
- const t = new zr(e, a.width || 200, a.height || 200);
8326
+ const t = new Ar(e, a.width || 200, a.height || 200);
8337
8327
  return t._customParams = { ...a }, t.updateUIParam = function(r, i) {
8338
8328
  const s = this._customParams || {};
8339
8329
  switch (this._customParams = s, s[r] = i, r) {
@@ -8544,7 +8534,7 @@ y({
8544
8534
  }
8545
8535
  ]
8546
8536
  });
8547
- const { CrossHatchFilter: Tr } = v;
8537
+ const { CrossHatchFilter: Pr } = v;
8548
8538
  y({
8549
8539
  id: "cross-hatch",
8550
8540
  name: "Cross Hatch",
@@ -8554,7 +8544,7 @@ y({
8554
8544
  // Note: CrossHatchFilter has NO parameters according to PixiJS examples
8555
8545
  createFilter: (a) => {
8556
8546
  try {
8557
- const e = new Tr();
8547
+ const e = new Pr();
8558
8548
  return e.updateUIParam = function(t, r) {
8559
8549
  return !0;
8560
8550
  }, e;
@@ -8751,7 +8741,7 @@ y({
8751
8741
  }
8752
8742
  ]
8753
8743
  });
8754
- const Lr = D.DisplacementFilter, Rr = D.Sprite, Fe = D.Texture;
8744
+ const Nr = I.DisplacementFilter, Tr = I.Sprite, Fe = I.Texture;
8755
8745
  y({
8756
8746
  id: "displacement",
8757
8747
  // ID must match what the application expects
@@ -8777,7 +8767,7 @@ y({
8777
8767
  }
8778
8768
  t = Fe.from(n);
8779
8769
  }
8780
- const r = new Rr(t), i = new Lr(r, a.scale || 50);
8770
+ const r = new Tr(t), i = new Nr(r, a.scale || 50);
8781
8771
  return i.scale.x = a.scaleX || 50, i.scale.y = a.scaleY || 50, i._customParams = { ...a }, i._displacementSprite = r, i.updateUIParam = function(s, n) {
8782
8772
  const o = this._customParams || {};
8783
8773
  switch (this._customParams = o, o[s] = n, s) {
@@ -8924,7 +8914,7 @@ y({
8924
8914
  }
8925
8915
  ]
8926
8916
  });
8927
- const { EmbossFilter: Br } = v;
8917
+ const { EmbossFilter: zr } = v;
8928
8918
  y({
8929
8919
  id: "emboss",
8930
8920
  name: "Emboss",
@@ -8933,7 +8923,7 @@ y({
8933
8923
  // Create an instance of the Emboss filter with the provided parameters
8934
8924
  createFilter: (a) => {
8935
8925
  try {
8936
- const e = typeof a.strength == "number" ? a.strength : 5, t = new Br(e);
8926
+ const e = typeof a.strength == "number" ? a.strength : 5, t = new zr(e);
8937
8927
  return t._customParams = {
8938
8928
  strength: e
8939
8929
  }, t.updateUIParam = function(r, i) {
@@ -8973,7 +8963,7 @@ y({
8973
8963
  }
8974
8964
  ]
8975
8965
  });
8976
- const { GlitchFilter: Er } = v, Z = {
8966
+ const { GlitchFilter: Rr } = v, Z = {
8977
8967
  TRANSPARENT: 0,
8978
8968
  ORIGINAL: 1,
8979
8969
  LOOP: 2,
@@ -8987,7 +8977,7 @@ y({
8987
8977
  description: "Apply digital distortion and glitch effects",
8988
8978
  createFilter: (a) => {
8989
8979
  try {
8990
- const e = { x: a.redX, y: a.redY }, t = { x: a.greenX, y: a.greenY }, r = { x: a.blueX, y: a.blueY }, i = new Er({
8980
+ const e = { x: a.redX, y: a.redY }, t = { x: a.greenX, y: a.greenY }, r = { x: a.blueX, y: a.blueY }, i = new Rr({
8991
8981
  slices: a.slices,
8992
8982
  offset: a.offset,
8993
8983
  direction: a.direction,
@@ -9228,7 +9218,7 @@ y({
9228
9218
  }
9229
9219
  ]
9230
9220
  });
9231
- const { GlowFilter: Ir } = v;
9221
+ const { GlowFilter: Lr } = v;
9232
9222
  y({
9233
9223
  id: "glow",
9234
9224
  name: "Glow",
@@ -9237,7 +9227,7 @@ y({
9237
9227
  // Create an instance of the GlowFilter with the provided parameters
9238
9228
  createFilter: (a) => {
9239
9229
  try {
9240
- const e = parseInt(a.color.replace("#", "0x"), 16), t = new Ir({
9230
+ const e = parseInt(a.color.replace("#", "0x"), 16), t = new Lr({
9241
9231
  distance: a.distance || 10,
9242
9232
  outerStrength: a.outerStrength || 4,
9243
9233
  innerStrength: a.innerStrength || 0,
@@ -9363,7 +9353,7 @@ y({
9363
9353
  }
9364
9354
  ]
9365
9355
  });
9366
- const { GodrayFilter: Dr } = v;
9356
+ const { GodrayFilter: Br } = v;
9367
9357
  y({
9368
9358
  id: "godray",
9369
9359
  name: "Godray",
@@ -9372,7 +9362,7 @@ y({
9372
9362
  // Create an instance of the GodrayFilter with the provided parameters
9373
9363
  createFilter: (a) => {
9374
9364
  try {
9375
- const e = new Dr({
9365
+ const e = new Br({
9376
9366
  angle: a.angle || 30,
9377
9367
  parallel: a.parallel ?? !0,
9378
9368
  center: {
@@ -9525,7 +9515,7 @@ y({
9525
9515
  }
9526
9516
  ]
9527
9517
  });
9528
- const Or = v.SimpleLightmapFilter, We = D.Texture;
9518
+ const Er = v.SimpleLightmapFilter, We = I.Texture;
9529
9519
  y({
9530
9520
  id: "lightmap",
9531
9521
  name: "Lightmap",
@@ -9557,7 +9547,7 @@ y({
9557
9547
  } catch {
9558
9548
  o = 0;
9559
9549
  }
9560
- const l = new Or(n, o, r);
9550
+ const l = new Er(n, o, r);
9561
9551
  return l._customParams = {
9562
9552
  textureType: e,
9563
9553
  color: t,
@@ -9656,7 +9646,7 @@ y({
9656
9646
  }
9657
9647
  ]
9658
9648
  });
9659
- const { NoiseFilter: jr } = D;
9649
+ const { NoiseFilter: Ir } = I;
9660
9650
  y({
9661
9651
  id: "noise",
9662
9652
  name: "Noise",
@@ -9664,7 +9654,7 @@ y({
9664
9654
  description: "Add random noise to the image",
9665
9655
  createFilter: (a) => {
9666
9656
  try {
9667
- const e = new jr({
9657
+ const e = new Ir({
9668
9658
  noise: a.noise || 0.5,
9669
9659
  seed: a.seed || Math.random()
9670
9660
  });
@@ -9741,7 +9731,7 @@ y({
9741
9731
  }
9742
9732
  ]
9743
9733
  });
9744
- const { OldFilmFilter: Yr } = v;
9734
+ const { OldFilmFilter: Dr } = v;
9745
9735
  y({
9746
9736
  id: "old-film",
9747
9737
  name: "Old Film",
@@ -9749,7 +9739,7 @@ y({
9749
9739
  description: "Apply a vintage film effect with scratches and grain",
9750
9740
  createFilter: (a) => {
9751
9741
  try {
9752
- const e = new Yr({
9742
+ const e = new Dr({
9753
9743
  sepia: a.sepia,
9754
9744
  noise: a.noise,
9755
9745
  noiseSize: a.noiseSize,
@@ -9930,7 +9920,7 @@ y({
9930
9920
  }
9931
9921
  ]
9932
9922
  });
9933
- const { OutlineFilter: Ur } = v;
9923
+ const { OutlineFilter: Or } = v;
9934
9924
  y({
9935
9925
  id: "outline",
9936
9926
  name: "Outline",
@@ -9940,7 +9930,7 @@ y({
9940
9930
  try {
9941
9931
  let e = a.color;
9942
9932
  typeof e == "string" && (e = parseInt(e.replace("#", "0x"), 16));
9943
- const t = new Ur({
9933
+ const t = new Or({
9944
9934
  thickness: a.thickness || 4,
9945
9935
  color: e,
9946
9936
  alpha: a.alpha || 1,
@@ -10030,7 +10020,7 @@ y({
10030
10020
  }
10031
10021
  ]
10032
10022
  });
10033
- const { PixelateFilter: Xr } = v;
10023
+ const { PixelateFilter: jr } = v;
10034
10024
  y({
10035
10025
  id: "pixelate",
10036
10026
  name: "Pixelate",
@@ -10038,7 +10028,7 @@ y({
10038
10028
  description: "Create a pixelated or mosaic effect",
10039
10029
  createFilter: (a) => {
10040
10030
  try {
10041
- const e = new Xr(
10031
+ const e = new jr(
10042
10032
  a.useUniform ? Math.max(4, a.size || 10) : [Math.max(4, a.sizeX || 10), Math.max(4, a.sizeY || 10)]
10043
10033
  );
10044
10034
  return e._customParams = { ...a }, e.updateUIParam = function(t, r) {
@@ -10121,7 +10111,7 @@ y({
10121
10111
  }
10122
10112
  ]
10123
10113
  });
10124
- const { ReflectionFilter: Vr } = v;
10114
+ const { ReflectionFilter: Yr } = v;
10125
10115
  y({
10126
10116
  id: "reflection",
10127
10117
  // ID must match what the application expects
@@ -10138,7 +10128,7 @@ y({
10138
10128
  waveLength: new Float32Array([a.wavelengthStart ?? 30, a.wavelengthEnd ?? 100]),
10139
10129
  alpha: new Float32Array([a.alphaStart ?? 1, a.alphaEnd ?? 1]),
10140
10130
  time: a.time ?? 0
10141
- }, t = new Vr(e);
10131
+ }, t = new Yr(e);
10142
10132
  return t._customParams = { ...a }, t.animating = a.animating ?? !1, t.updateUIParam = function(r, i) {
10143
10133
  const s = this._customParams || {};
10144
10134
  switch (this._customParams = s, s[r] = i, r) {
@@ -10289,7 +10279,7 @@ y({
10289
10279
  }
10290
10280
  ]
10291
10281
  });
10292
- const { ShockwaveFilter: Hr } = v;
10282
+ const { ShockwaveFilter: Ur } = v;
10293
10283
  y({
10294
10284
  id: "shockwave",
10295
10285
  // ID must match what the application expects
@@ -10299,7 +10289,7 @@ y({
10299
10289
  // Create an instance of the ShockwaveFilter with the provided parameters
10300
10290
  createFilter: (a) => {
10301
10291
  try {
10302
- const e = a.centerX ?? 0.5, t = a.centerY ?? 0.5, r = { x: e, y: t }, i = a.amplitude ?? 30, s = a.wavelength ?? 160, n = a.speed ?? 500, o = a.brightness ?? 1, l = a.radius ?? -1, c = a.time ?? 0, d = new Hr({
10292
+ const e = a.centerX ?? 0.5, t = a.centerY ?? 0.5, r = { x: e, y: t }, i = a.amplitude ?? 30, s = a.wavelength ?? 160, n = a.speed ?? 500, o = a.brightness ?? 1, l = a.radius ?? -1, c = a.time ?? 0, d = new Ur({
10303
10293
  center: r,
10304
10294
  amplitude: i,
10305
10295
  wavelength: s,
@@ -10441,7 +10431,7 @@ y({
10441
10431
  }
10442
10432
  ]
10443
10433
  });
10444
- const { SimplexNoiseFilter: Wr } = v;
10434
+ const { SimplexNoiseFilter: Xr } = v;
10445
10435
  y({
10446
10436
  id: "simplex-noise",
10447
10437
  name: "Simplex Noise",
@@ -10449,7 +10439,7 @@ y({
10449
10439
  description: "Apply procedural noise to create texture effects",
10450
10440
  createFilter: (a) => {
10451
10441
  try {
10452
- const e = a.animating ? 0 : a.offsetZ || 0, t = new Wr({
10442
+ const e = a.animating ? 0 : a.offsetZ || 0, t = new Xr({
10453
10443
  strength: a.strength,
10454
10444
  noiseScale: a.noiseScale,
10455
10445
  offsetX: a.offsetX,
@@ -10596,8 +10586,8 @@ y({
10596
10586
  }
10597
10587
  ]
10598
10588
  });
10599
- const { TwistFilter: qr } = v, at = (a) => Math.ceil(Math.max(0, Number(a) || 0) + 2), qe = (a, e = 1) => {
10600
- const t = Math.max(1, Number(a._sourceWidth ?? 0)), r = Math.max(1, Number(a._sourceHeight ?? 0)), i = Math.min(t, r), s = Number(a.centerX ?? 0.5), n = Number(a.centerY ?? 0.5), o = Number(a.radius ?? 0.25), l = Number(a.angle ?? 4), c = s * t * e, d = n * r * e, h = o * i * e, u = new qr({
10589
+ const { TwistFilter: Vr } = v, at = (a) => Math.ceil(Math.max(0, Number(a) || 0) + 2), qe = (a, e = 1) => {
10590
+ const t = Math.max(1, Number(a._sourceWidth ?? 0)), r = Math.max(1, Number(a._sourceHeight ?? 0)), i = Math.min(t, r), s = Number(a.centerX ?? 0.5), n = Number(a.centerY ?? 0.5), o = Number(a.radius ?? 0.25), l = Number(a.angle ?? 4), c = s * t * e, d = n * r * e, h = o * i * e, u = new Vr({
10601
10591
  offset: { x: c, y: d },
10602
10592
  radius: h,
10603
10593
  angle: l
@@ -10690,7 +10680,7 @@ y({
10690
10680
  }
10691
10681
  ]
10692
10682
  });
10693
- const { AdjustmentFilter: $r } = v;
10683
+ const { AdjustmentFilter: Hr } = v;
10694
10684
  function _e(a) {
10695
10685
  const e = typeof a == "string" ? parseInt(a.replace("#", "0x"), 16) : a;
10696
10686
  return [
@@ -10699,7 +10689,7 @@ function _e(a) {
10699
10689
  (e & 255) / 255
10700
10690
  ];
10701
10691
  }
10702
- class Gr extends $r {
10692
+ class Wr extends Hr {
10703
10693
  constructor(e = {}) {
10704
10694
  super({
10705
10695
  brightness: 1,
@@ -10742,7 +10732,7 @@ y({
10742
10732
  description: "Add a classic darkened border effect to the image",
10743
10733
  createFilter: (a) => {
10744
10734
  try {
10745
- const e = new Gr({
10735
+ const e = new Wr({
10746
10736
  radius: a.radius || 0.8,
10747
10737
  strength: a.strength || 1,
10748
10738
  color: a.color || "#000000"
@@ -10810,18 +10800,18 @@ function ni(a) {
10810
10800
  try {
10811
10801
  let e = [], t = [];
10812
10802
  try {
10813
- e = xe(), e.length === 0 && tr();
10803
+ e = xe(), e.length === 0 && Jt();
10814
10804
  } catch {
10815
10805
  }
10816
10806
  const r = a == null ? void 0 : a.disabled;
10817
10807
  if (Array.isArray(r) && r.length > 0) {
10818
10808
  let i = 0;
10819
10809
  for (const s of r)
10820
- sr(s) && i++;
10810
+ tr(s) && i++;
10821
10811
  i > 0;
10822
10812
  }
10823
10813
  try {
10824
- e = xe(), t = ir();
10814
+ e = xe(), t = er();
10825
10815
  } catch {
10826
10816
  e || (e = []), t || (t = []);
10827
10817
  }
@@ -10831,39 +10821,44 @@ function ni(a) {
10831
10821
  }
10832
10822
  }
10833
10823
  export {
10834
- xt as A,
10835
- de as B,
10836
- Kt as C,
10837
- ht as D,
10824
+ bt as A,
10825
+ Y as B,
10826
+ Gr as C,
10827
+ $r as D,
10838
10828
  Ne as E,
10839
- Dt as F,
10840
- Pe as G,
10841
- jt as H,
10842
- Gt as I,
10843
- Et as J,
10844
- tr as K,
10845
- ai as L,
10846
- ar as M,
10829
+ Zr as F,
10830
+ de as G,
10831
+ $t as H,
10832
+ ht as I,
10833
+ Bt as J,
10834
+ Ae as K,
10835
+ It as L,
10836
+ Wt as M,
10837
+ Rt as N,
10838
+ xt as O,
10847
10839
  ut as P,
10848
- Ot as R,
10840
+ Jt as Q,
10841
+ Et as R,
10842
+ ai as S,
10849
10843
  lt as T,
10844
+ rr as U,
10850
10845
  ii as V,
10851
- er as a,
10852
- rr as b,
10853
- ir as c,
10846
+ Kt as a,
10847
+ Qt as b,
10848
+ er as c,
10854
10849
  Me as d,
10855
10850
  f as e,
10856
10851
  Ge as f,
10857
10852
  xe as g,
10858
10853
  si as h,
10859
10854
  ni as i,
10860
- Y as j,
10855
+ j,
10861
10856
  tt as k,
10862
10857
  rt as l,
10863
10858
  et as m,
10864
10859
  Qe as n,
10865
10860
  Je as o,
10866
- Ae as p,
10861
+ Pe as p,
10867
10862
  Kr as q,
10868
10863
  y as r,
10869
10864
  Jr as s,
@@ -10872,7 +10867,7 @@ export {
10872
10867
  $e as v,
10873
10868
  ti as w,
10874
10869
  ri as x,
10875
- Ft as y,
10876
- Pt as z
10870
+ Ct as y,
10871
+ St as z
10877
10872
  };
10878
- //# sourceMappingURL=editor-OIsQEaJg.js.map
10873
+ //# sourceMappingURL=editor-DAJxTvzM.js.map