builder-settings-types 0.0.329 → 0.0.331

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.
@@ -1,22 +1,22 @@
1
1
  const xt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
- let ft = (p = 21) => {
3
- let t = "", e = crypto.getRandomValues(new Uint8Array(p |= 0));
4
- for (; p--; )
5
- t += xt[e[p] & 63];
2
+ let ft = (d = 21) => {
3
+ let t = "", e = crypto.getRandomValues(new Uint8Array(d |= 0));
4
+ for (; d--; )
5
+ t += xt[e[d] & 63];
6
6
  return t;
7
7
  };
8
- function Lt(p) {
9
- let t = 0, e = p.parentElement;
8
+ function Lt(d) {
9
+ let t = 0, e = d.parentElement;
10
10
  for (; e; )
11
- e.classList.contains("setting-group") && e !== p && t++, e = e.parentElement;
11
+ e.classList.contains("setting-group") && e !== d && t++, e = e.parentElement;
12
12
  return t;
13
13
  }
14
- function _(p, t) {
14
+ function _(d, t) {
15
15
  const e = Math.min(Math.max(t, 0), 5);
16
- p.setAttribute("data-nesting-level", e.toString()), e > 0 ? p.style.setProperty("--visual-indent", `${e * 2}px`) : (p.style.removeProperty("--visual-indent"), p.style.marginLeft = "");
16
+ d.setAttribute("data-nesting-level", e.toString()), e > 0 ? d.style.setProperty("--visual-indent", `${e * 2}px`) : (d.style.removeProperty("--visual-indent"), d.style.marginLeft = "");
17
17
  }
18
- function et(p, t = 0) {
19
- p.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
18
+ function et(d, t = 0) {
19
+ d.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
20
20
  const s = i, n = t + 1;
21
21
  _(s, n), et(s, n);
22
22
  });
@@ -112,20 +112,20 @@ class Mt {
112
112
  }
113
113
  }
114
114
  const rt = new Mt();
115
- function Y(p) {
116
- if (p === null || typeof p != "object") return p;
117
- if (p instanceof Date) return new Date(p.getTime());
118
- if (p instanceof Array) return p.map((t) => Y(t));
119
- if (typeof p == "object") {
115
+ function Y(d) {
116
+ if (d === null || typeof d != "object") return d;
117
+ if (d instanceof Date) return new Date(d.getTime());
118
+ if (d instanceof Array) return d.map((t) => Y(t));
119
+ if (typeof d == "object") {
120
120
  const t = {};
121
- for (const e in p)
122
- Object.prototype.hasOwnProperty.call(p, e) && (t[e] = Y(p[e]));
121
+ for (const e in d)
122
+ Object.prototype.hasOwnProperty.call(d, e) && (t[e] = Y(d[e]));
123
123
  return t;
124
124
  }
125
- return p;
125
+ return d;
126
126
  }
127
- function It(p) {
128
- switch (p) {
127
+ function Nt(d) {
128
+ switch (d) {
129
129
  case "number":
130
130
  return 0;
131
131
  case "text":
@@ -206,7 +206,7 @@ const M = class M {
206
206
  const i = document.createElement("div");
207
207
  i.className = t.wrapperClassName || "";
208
208
  const s = document.createElement("input");
209
- this.inputEl = s, s.value = String(t.value || It(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
209
+ this.inputEl = s, s.value = String(t.value || Nt(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
210
210
  const n = (a) => {
211
211
  const l = a.target;
212
212
  let r = l.value;
@@ -262,79 +262,79 @@ M.currentLanguageExplicitlySet = !1, M.languageChangeCallbacks = /* @__PURE__ */
262
262
  { title: "Text Color", keys: ["text-dark", "text-light"] }
263
263
  ];
264
264
  let w = M;
265
- function F(p) {
266
- return p instanceof w;
265
+ function F(d) {
266
+ return d instanceof w;
267
267
  }
268
- function L(p) {
269
- return p instanceof H;
268
+ function L(d) {
269
+ return d instanceof H;
270
270
  }
271
- function ct(p) {
272
- return F(p) || L(p);
271
+ function ct(d) {
272
+ return F(d) || L(d);
273
273
  }
274
- const ot = (p, t, e) => {
274
+ const ot = (d, t, e) => {
275
275
  let i = !1, s = 0, n = 0, o = 0, a = 0;
276
- const l = (d) => {
277
- if (d.target.closest("button")) return;
278
- i = !0, s = d.clientX, n = d.clientY;
279
- const h = t.getBoundingClientRect();
280
- o = h.left, a = h.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
281
- }, r = (d) => {
276
+ const l = (h) => {
277
+ if (h.target.closest("button")) return;
278
+ i = !0, s = h.clientX, n = h.clientY;
279
+ const p = t.getBoundingClientRect();
280
+ o = p.left, a = p.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", c), document.body.style.userSelect = "none";
281
+ }, r = (h) => {
282
282
  if (!i) return;
283
- const h = d.clientX - s, g = d.clientY - n, f = window.innerWidth, m = window.innerHeight, u = t.offsetWidth, C = t.offsetHeight;
284
- let v = o + h, y = a + g;
285
- v = Math.max(8, Math.min(f - u - 8, v)), y = Math.max(8, Math.min(m - C - 8, y)), t.style.left = `${v}px`, t.style.top = `${y}px`, e == null || e(v, y);
283
+ const p = h.clientX - s, g = h.clientY - n, C = window.innerWidth, m = window.innerHeight, u = t.offsetWidth, f = t.offsetHeight;
284
+ let v = o + p, y = a + g;
285
+ v = Math.max(8, Math.min(C - u - 8, v)), y = Math.max(8, Math.min(m - f - 8, y)), t.style.left = `${v}px`, t.style.top = `${y}px`, e == null || e(v, y);
286
286
  }, c = () => {
287
287
  i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", c), document.body.style.userSelect = "";
288
288
  };
289
- p.addEventListener("mousedown", l);
290
- }, G = (p) => {
291
- if (!p) return null;
292
- let t = p.trim();
289
+ d.addEventListener("mousedown", l);
290
+ }, G = (d) => {
291
+ if (!d) return null;
292
+ let t = d.trim();
293
293
  return !t.startsWith("#") || (t = t.slice(1), t.length === 3 && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-fA-F]{6}$/.test(t)) ? null : `#${t.toUpperCase()}`;
294
- }, X = (p, t, e) => `#${[p, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, P = (p) => {
295
- const t = p.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
294
+ }, X = (d, t, e) => `#${[d, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, P = (d) => {
295
+ const t = d.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
296
296
  return {
297
297
  r: parseInt(e.slice(0, 2), 16),
298
298
  g: parseInt(e.slice(2, 4), 16),
299
299
  b: parseInt(e.slice(4, 6), 16)
300
300
  };
301
- }, U = (p) => {
302
- const { r: t, g: e, b: i } = P(p), s = t / 255, n = e / 255, o = i / 255, a = Math.max(s, n, o), l = Math.min(s, n, o), r = a - l;
301
+ }, U = (d) => {
302
+ const { r: t, g: e, b: i } = P(d), s = t / 255, n = e / 255, o = i / 255, a = Math.max(s, n, o), l = Math.min(s, n, o), r = a - l;
303
303
  let c = 0;
304
304
  r !== 0 && (a === s ? c = (n - o) / r % 6 : a === n ? c = (o - s) / r + 2 : c = (s - n) / r + 4), c < 0 && (c += 6);
305
- const d = a === 0 ? 0 : r / a, h = a;
306
- return { h: c * 60, s: d, v: h };
307
- }, W = (p, t, e) => {
308
- const i = (p % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
305
+ const h = a === 0 ? 0 : r / a, p = a;
306
+ return { h: c * 60, s: h, v: p };
307
+ }, W = (d, t, e) => {
308
+ const i = (d % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
309
309
  let a = 0, l = 0, r = 0;
310
310
  return i < 60 ? (a = s, l = n, r = 0) : i < 120 ? (a = n, l = s, r = 0) : i < 180 ? (a = 0, l = s, r = n) : i < 240 ? (a = 0, l = n, r = s) : i < 300 ? (a = n, l = 0, r = s) : (a = s, l = 0, r = n), X(
311
311
  Math.round((a + o) * 255),
312
312
  Math.round((l + o) * 255),
313
313
  Math.round((r + o) * 255)
314
314
  );
315
- }, Ct = (p, t, e) => {
315
+ }, Ct = (d, t, e) => {
316
316
  const i = e * (1 - t / 2), s = i === 0 || i === 1 ? 0 : (e - i) / Math.min(i, 1 - i);
317
- return { hue: p, sat: s, lightness: i };
318
- }, it = (p, t, e) => {
319
- const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(p / 60 % 2 - 1)), n = e - i / 2;
317
+ return { hue: d, sat: s, lightness: i };
318
+ }, it = (d, t, e) => {
319
+ const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(d / 60 % 2 - 1)), n = e - i / 2;
320
320
  let o = 0, a = 0, l = 0;
321
- return p < 60 ? (o = i, a = s, l = 0) : p < 120 ? (o = s, a = i, l = 0) : p < 180 ? (o = 0, a = i, l = s) : p < 240 ? (o = 0, a = s, l = i) : p < 300 ? (o = s, a = 0, l = i) : (o = i, a = 0, l = s), {
321
+ return d < 60 ? (o = i, a = s, l = 0) : d < 120 ? (o = s, a = i, l = 0) : d < 180 ? (o = 0, a = i, l = s) : d < 240 ? (o = 0, a = s, l = i) : d < 300 ? (o = s, a = 0, l = i) : (o = i, a = 0, l = s), {
322
322
  r: Math.round((o + n) * 255),
323
323
  g: Math.round((a + n) * 255),
324
324
  b: Math.round((l + n) * 255)
325
325
  };
326
- }, st = (p, t) => {
326
+ }, st = (d, t) => {
327
327
  const e = Math.max(0, Math.min(100, t)) / 100;
328
- if (p.startsWith("#")) {
329
- const { r: s, g: n, b: o } = P(p);
328
+ if (d.startsWith("#")) {
329
+ const { r: s, g: n, b: o } = P(d);
330
330
  return `rgba(${s}, ${n}, ${o}, ${e})`;
331
331
  }
332
- if (p.startsWith("rgba("))
333
- return p.replace(/,\s*[\d.]+\)$/, `, ${e})`);
334
- if (p.startsWith("rgb("))
335
- return p.replace("rgb(", "rgba(").replace(")", `, ${e})`);
336
- if (p.startsWith("hsl(")) {
337
- const s = p.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
332
+ if (d.startsWith("rgba("))
333
+ return d.replace(/,\s*[\d.]+\)$/, `, ${e})`);
334
+ if (d.startsWith("rgb("))
335
+ return d.replace("rgb(", "rgba(").replace(")", `, ${e})`);
336
+ if (d.startsWith("hsl(")) {
337
+ const s = d.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
338
338
  if (s) {
339
339
  const { r: n, g: o, b: a } = it(
340
340
  parseInt(s[1]),
@@ -344,8 +344,8 @@ const ot = (p, t, e) => {
344
344
  return `rgba(${n}, ${o}, ${a}, ${e})`;
345
345
  }
346
346
  }
347
- if (p.startsWith("hsla(")) {
348
- const s = p.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
347
+ if (d.startsWith("hsla(")) {
348
+ const s = d.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
349
349
  if (s) {
350
350
  const { r: n, g: o, b: a } = it(
351
351
  parseInt(s[1]),
@@ -355,13 +355,13 @@ const ot = (p, t, e) => {
355
355
  return `rgba(${n}, ${o}, ${a}, ${e})`;
356
356
  }
357
357
  }
358
- const i = G(p);
358
+ const i = G(d);
359
359
  if (i) {
360
360
  const { r: s, g: n, b: o } = P(i);
361
361
  return `rgba(${s}, ${n}, ${o}, ${e})`;
362
362
  }
363
- return p;
364
- }, Nt = (p) => [
363
+ return d;
364
+ }, It = (d) => [
365
365
  "red",
366
366
  "green",
367
367
  "blue",
@@ -385,18 +385,18 @@ const ot = (p, t, e) => {
385
385
  "teal",
386
386
  "fuchsia",
387
387
  "transparent"
388
- ].includes(p.toLowerCase()), yt = (p) => [
388
+ ].includes(d.toLowerCase()), yt = (d) => [
389
389
  /^#[0-9a-fA-F]{3,8}$/,
390
390
  /^rgba?\s*\([^)]+\)$/,
391
391
  /^hsla?\s*\([^)]+\)$/,
392
392
  /^[a-zA-Z]+$/
393
- ].some((e) => e.test(p.trim())), St = (p) => {
393
+ ].some((e) => e.test(d.trim())), St = (d) => {
394
394
  if (typeof document > "u")
395
- return yt(p) || !!G(p);
395
+ return yt(d) || !!G(d);
396
396
  const t = document.createElement("div");
397
- return t.style.color = p, t.style.color !== "";
398
- }, Et = (p) => {
399
- const t = p.trim();
397
+ return t.style.color = d, t.style.color !== "";
398
+ }, Et = (d) => {
399
+ const t = d.trim();
400
400
  if (/^#[0-9A-Fa-f]{8}$/.test(t)) {
401
401
  const n = t.slice(1), o = parseInt(n.slice(0, 2), 16), a = parseInt(n.slice(2, 4), 16), l = parseInt(n.slice(4, 6), 16), r = parseInt(n.slice(6, 8), 16);
402
402
  return {
@@ -432,11 +432,11 @@ const ot = (p, t, e) => {
432
432
  };
433
433
  }
434
434
  return { color: G(t) || t, position: 0, opacity: 100 };
435
- }, ht = (p) => {
435
+ }, ht = (d) => {
436
436
  const t = [];
437
437
  let e = "", i = 0;
438
- for (let s = 0; s < p.length; s++) {
439
- const n = p[s];
438
+ for (let s = 0; s < d.length; s++) {
439
+ const n = d[s];
440
440
  if (n === "(") i++;
441
441
  else if (n === ")") i--;
442
442
  else if (n === "," && i === 0) {
@@ -446,16 +446,16 @@ const ot = (p, t, e) => {
446
446
  e += n;
447
447
  }
448
448
  return e.trim() && t.push(e.trim()), t;
449
- }, dt = (p, t) => {
450
- const e = new RegExp(`${t}\\s*\\(`, "i"), i = p.match(e);
449
+ }, dt = (d, t) => {
450
+ const e = new RegExp(`${t}\\s*\\(`, "i"), i = d.match(e);
451
451
  if (!i) return null;
452
452
  const s = i.index + i[0].length;
453
453
  let n = 1, o = s;
454
- for (let a = s; a < p.length && n > 0; a++)
455
- p[a] === "(" ? n++ : p[a] === ")" && n--, o = a;
456
- return n === 0 ? p.substring(s, o) : null;
457
- }, Vt = (p) => {
458
- const t = p.split(" ")[0].toLowerCase();
454
+ for (let a = s; a < d.length && n > 0; a++)
455
+ d[a] === "(" ? n++ : d[a] === ")" && n--, o = a;
456
+ return n === 0 ? d.substring(s, o) : null;
457
+ }, Vt = (d) => {
458
+ const t = d.split(" ")[0].toLowerCase();
459
459
  return [
460
460
  "circle",
461
461
  "ellipse",
@@ -466,31 +466,31 @@ const ot = (p, t, e) => {
466
466
  "at",
467
467
  "contain",
468
468
  "cover"
469
- ].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(p) || /^hsl/i.test(p) || Nt(t);
470
- }, pt = (p) => {
469
+ ].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(d) || /^hsl/i.test(d) || It(t);
470
+ }, pt = (d) => {
471
471
  const t = [];
472
- return p.forEach((e, i) => {
472
+ return d.forEach((e, i) => {
473
473
  const s = e.trim();
474
474
  if (!s) return;
475
475
  let n = "", o = 0;
476
476
  const a = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
477
- a && yt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = p.length === 1 ? 0 : i / (p.length - 1) * 100);
477
+ a && yt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = d.length === 1 ? 0 : i / (d.length - 1) * 100);
478
478
  const l = Et(n);
479
479
  l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
480
480
  }), t;
481
- }, A = (p) => {
482
- const t = p.stops && p.stops.length ? p.stops : [{ color: "#000000", position: 0, opacity: 100 }];
481
+ }, A = (d) => {
482
+ const t = d.stops && d.stops.length ? d.stops : [{ color: "#000000", position: 0, opacity: 100 }];
483
483
  return {
484
- type: p.type && ["linear", "radial", "solid"].includes(p.type) ? p.type : "linear",
485
- angle: typeof p.angle == "number" ? p.angle : 90,
484
+ type: d.type && ["linear", "radial", "solid"].includes(d.type) ? d.type : "linear",
485
+ angle: typeof d.angle == "number" ? d.angle : 90,
486
486
  stops: t.map((e, i) => ({
487
487
  color: e.color || "#000000",
488
488
  position: typeof e.position == "number" ? e.position : t.length === 1 ? 0 : Math.round(i / (t.length - 1) * 100),
489
489
  opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
490
490
  }))
491
491
  };
492
- }, T = (p) => {
493
- const t = p.replace(/;$/, "").trim();
492
+ }, T = (d) => {
493
+ const t = d.replace(/;$/, "").trim();
494
494
  if (St(t)) {
495
495
  const s = Et(t);
496
496
  return A({ type: "solid", angle: 0, stops: [s] });
@@ -522,21 +522,21 @@ const ot = (p, t, e) => {
522
522
  return o.length ? A({ type: "radial", angle: 0, stops: o }) : null;
523
523
  }
524
524
  return null;
525
- }, S = (p) => {
526
- if (p.type === "solid") {
527
- const e = p.stops[0], i = e.color;
525
+ }, S = (d) => {
526
+ if (d.type === "solid") {
527
+ const e = d.stops[0], i = e.color;
528
528
  if (i.startsWith("var(--"))
529
529
  return i;
530
530
  const s = e.opacity ?? 100, n = i.replace("#", ""), o = Math.round(s / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
531
531
  return `#${n}${o}`;
532
532
  }
533
- const t = p.stops.map(
533
+ const t = d.stops.map(
534
534
  (e) => `${st(e.color, e.opacity ?? 100)} ${e.position}%`
535
535
  ).join(", ");
536
- return p.type === "radial" ? `radial-gradient(circle, ${t})` : `linear-gradient(${p.angle}deg, ${t})`;
537
- }, Tt = (p) => Math.round(p / 100 * 255).toString(16).toUpperCase().padStart(2, "0"), K = (p) => {
538
- if (p.type === "solid") {
539
- const t = p.stops[0];
536
+ return d.type === "radial" ? `radial-gradient(circle, ${t})` : `linear-gradient(${d.angle}deg, ${t})`;
537
+ }, Tt = (d) => Math.round(d / 100 * 255).toString(16).toUpperCase().padStart(2, "0"), K = (d) => {
538
+ if (d.type === "solid") {
539
+ const t = d.stops[0];
540
540
  if (t) {
541
541
  const e = t.color;
542
542
  if (e.startsWith("var(--"))
@@ -552,7 +552,7 @@ const ot = (p, t, e) => {
552
552
  }
553
553
  return "#000000";
554
554
  }
555
- return p.type === "linear" ? `Linear ${p.angle}°` : "Radial Gradient";
555
+ return d.type === "linear" ? `Linear ${d.angle}°` : "Radial Gradient";
556
556
  }, q = class q {
557
557
  static defaults() {
558
558
  return {
@@ -623,7 +623,7 @@ const ot = (p, t, e) => {
623
623
  };
624
624
  q.STORAGE_KEY = "settingsLib_recentColors", q.MAX_COLORS = 12, q.colors = null;
625
625
  let R = q;
626
- const at = (p, t) => {
626
+ const at = (d, t) => {
627
627
  const e = document.createElement("div");
628
628
  e.className = "color-picker-recent-section";
629
629
  const i = document.createElement("div");
@@ -632,9 +632,9 @@ const at = (p, t) => {
632
632
  s.className = "color-picker-tooltip", s.style.display = "none", e.appendChild(s);
633
633
  const n = () => {
634
634
  s.style.display = "none";
635
- }, o = (c, d) => {
636
- const h = c.getBoundingClientRect();
637
- s.textContent = d, s.style.left = `${h.left + h.width / 2}px`, s.style.top = `${h.bottom + 8}px`, s.style.display = "block";
635
+ }, o = (c, h) => {
636
+ const p = c.getBoundingClientRect();
637
+ s.textContent = h, s.style.left = `${p.left + p.width / 2}px`, s.style.top = `${p.bottom + 8}px`, s.style.display = "block";
638
638
  }, a = document.createElement("div");
639
639
  a.className = "color-picker-recent-grid";
640
640
  const l = document.createElement("div");
@@ -646,40 +646,40 @@ const at = (p, t) => {
646
646
  a.style.display = "none", l.style.display = "block";
647
647
  return;
648
648
  }
649
- a.style.display = "grid", l.style.display = "none", c.forEach((d) => {
650
- const h = document.createElement("button");
651
- h.type = "button", h.className = "color-picker-recent-swatch";
652
- const g = Pt(d);
653
- if (h.title = g, h.setAttribute("aria-label", `Use color: ${g}`), d.includes("gradient(")) {
654
- h.style.backgroundImage = d, h.style.backgroundColor = "transparent";
655
- const m = T(d);
656
- m && m.stops && m.stops.length > 0 && (h.style.borderColor = m.stops[0].color);
649
+ a.style.display = "grid", l.style.display = "none", c.forEach((h) => {
650
+ const p = document.createElement("button");
651
+ p.type = "button", p.className = "color-picker-recent-swatch";
652
+ const g = Pt(h);
653
+ if (p.title = g, p.setAttribute("aria-label", `Use color: ${g}`), h.includes("gradient(")) {
654
+ p.style.backgroundImage = h, p.style.backgroundColor = "transparent";
655
+ const m = T(h);
656
+ m && m.stops && m.stops.length > 0 && (p.style.borderColor = m.stops[0].color);
657
657
  } else
658
- h.style.backgroundColor = d, h.style.borderColor = d;
659
- h.addEventListener("mouseenter", () => o(h, g)), h.addEventListener("mouseleave", () => {
660
- n(), h.style.boxShadow = "";
661
- }), h.addEventListener("mousedown", () => {
662
- h.style.boxShadow = "0px 0px 0px 2px var(--grey40)";
663
- }), h.addEventListener("mouseup", () => {
658
+ p.style.backgroundColor = h, p.style.borderColor = h;
659
+ p.addEventListener("mouseenter", () => o(p, g)), p.addEventListener("mouseleave", () => {
660
+ n(), p.style.boxShadow = "";
661
+ }), p.addEventListener("mousedown", () => {
662
+ p.style.boxShadow = "0px 0px 0px 2px var(--grey40)";
663
+ }), p.addEventListener("mouseup", () => {
664
664
  setTimeout(() => {
665
- h.style.boxShadow = "";
665
+ p.style.boxShadow = "";
666
666
  }, 150);
667
- }), h.addEventListener("click", () => {
668
- n(), p(d);
669
- }), a.appendChild(h);
667
+ }), p.addEventListener("click", () => {
668
+ n(), d(h);
669
+ }), a.appendChild(p);
670
670
  });
671
671
  };
672
672
  return r(), { container: e, refresh: r };
673
- }, Pt = (p) => {
674
- const t = T(p);
673
+ }, Pt = (d) => {
674
+ const t = T(d);
675
675
  if (t)
676
676
  return K(t);
677
- const e = G(p);
677
+ const e = G(d);
678
678
  if (e) {
679
679
  const i = P(e);
680
680
  return `${e} (RGB: ${i.r}, ${i.g}, ${i.b})`;
681
681
  }
682
- return p;
682
+ return d;
683
683
  }, bt = `<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
684
684
  <path fill-rule="evenodd" clip-rule="evenodd"
685
685
  d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
@@ -760,77 +760,77 @@ class ut {
760
760
  r.className = "color-picker-sliders-group";
761
761
  const c = document.createElement("div");
762
762
  c.className = "color-picker-hue", this.hueSlider = c;
763
- const d = document.createElement("div");
764
- d.className = "color-picker-hue-marker", this.hueMarker = d, c.appendChild(d);
765
763
  const h = document.createElement("div");
766
- h.className = "color-picker-opacity", this.opacitySlider = h;
764
+ h.className = "color-picker-hue-marker", this.hueMarker = h, c.appendChild(h);
765
+ const p = document.createElement("div");
766
+ p.className = "color-picker-opacity", this.opacitySlider = p;
767
767
  const g = document.createElement("div");
768
- g.className = "color-picker-opacity-marker", this.opacityMarker = g, h.appendChild(g), r.appendChild(c), r.appendChild(h), a.appendChild(l), a.appendChild(r);
769
- const f = at((E) => {
768
+ g.className = "color-picker-opacity-marker", this.opacityMarker = g, p.appendChild(g), r.appendChild(c), r.appendChild(p), a.appendChild(l), a.appendChild(r);
769
+ const C = at((E) => {
770
770
  var b;
771
771
  this.setColor(E), (b = this.onChange) == null || b.call(this, E, this.currentOpacity);
772
772
  }, this.recentScope);
773
- this.recentSectionRefresh = f.refresh;
773
+ this.recentSectionRefresh = C.refresh;
774
774
  const m = document.createElement("div");
775
775
  m.className = "color-picker-format-section";
776
776
  const u = document.createElement("select");
777
777
  u.className = "color-picker-format-select", this.select = u;
778
- const C = document.createElement("option");
779
- C.value = "hex", C.textContent = "HEX";
778
+ const f = document.createElement("option");
779
+ f.value = "hex", f.textContent = "HEX";
780
780
  const v = document.createElement("option");
781
781
  v.value = "rgb", v.textContent = "RGB";
782
782
  const y = document.createElement("option");
783
- y.value = "hsl", y.textContent = "HSL", u.appendChild(C), u.appendChild(v), u.appendChild(y);
783
+ y.value = "hsl", y.textContent = "HSL", u.appendChild(f), u.appendChild(v), u.appendChild(y);
784
784
  const x = document.createElement("input");
785
785
  x.type = "text", x.className = "color-picker-color-input", x.value = this.currentColor, this.input = x;
786
786
  const k = document.createElement("div");
787
787
  k.className = "color-picker-input-container";
788
- const N = document.createElement("button");
789
- return N.className = "color-picker-copy-inside", N.textContent = "Copy", k.appendChild(x), k.appendChild(N), m.appendChild(u), m.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(f.container), t.appendChild(m), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, c, h, x, u, N, l), t;
788
+ const I = document.createElement("button");
789
+ return I.className = "color-picker-copy-inside", I.textContent = "Copy", k.appendChild(x), k.appendChild(I), m.appendChild(u), m.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(C.container), t.appendChild(m), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, c, p, x, u, I, l), t;
790
790
  }
791
791
  createBackdrop() {
792
792
  const t = document.createElement("div");
793
793
  return t.className = "color-picker-backdrop", t.style.display = "none", t.style.pointerEvents = "none", t;
794
794
  }
795
795
  bind(t, e, i, s, n, o, a) {
796
- const l = (d) => {
796
+ const l = (h) => {
797
797
  var v;
798
- const h = t.getBoundingClientRect(), g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width)), f = Math.max(0, Math.min(1, (d.clientY - h.top) / h.height));
799
- this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${f * 100}%`;
800
- const u = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, C = W(u, g, 1 - f);
801
- this.currentColor = C, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, C, this.currentOpacity);
802
- }, r = (d) => {
798
+ const p = t.getBoundingClientRect(), g = Math.max(0, Math.min(1, (h.clientX - p.left) / p.width)), C = Math.max(0, Math.min(1, (h.clientY - p.top) / p.height));
799
+ this.colorMarker.style.left = `${g * 100}%`, this.colorMarker.style.top = `${C * 100}%`;
800
+ const u = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, f = W(u, g, 1 - C);
801
+ this.currentColor = f, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, f, this.currentOpacity);
802
+ }, r = (h) => {
803
803
  var v;
804
- const h = e.getBoundingClientRect();
805
- let g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width));
804
+ const p = e.getBoundingClientRect();
805
+ let g = Math.max(0, Math.min(1, (h.clientX - p.left) / p.width));
806
806
  this.hueMarker.style.left = `${g * 100}%`;
807
- const f = g * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), u = this.parsePercentage(this.colorMarker.style.top || "0%"), C = W(f, m, 1 - u);
808
- this.currentColor = C, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${f}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, C, this.currentOpacity);
809
- }, c = (d) => {
810
- var f;
811
- const h = i.getBoundingClientRect(), g = Math.max(0, Math.min(1, (d.clientX - h.left) / h.width));
812
- this.opacityMarker.style.left = `${g * 100}%`, this.currentOpacity = Math.round(g * 100), (f = this.onChange) == null || f.call(this, this.currentColor, this.currentOpacity);
807
+ const C = g * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), u = this.parsePercentage(this.colorMarker.style.top || "0%"), f = W(C, m, 1 - u);
808
+ this.currentColor = f, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${C}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (v = this.onChange) == null || v.call(this, f, this.currentOpacity);
809
+ }, c = (h) => {
810
+ var C;
811
+ const p = i.getBoundingClientRect(), g = Math.max(0, Math.min(1, (h.clientX - p.left) / p.width));
812
+ this.opacityMarker.style.left = `${g * 100}%`, this.currentOpacity = Math.round(g * 100), (C = this.onChange) == null || C.call(this, this.currentColor, this.currentOpacity);
813
813
  };
814
- t.addEventListener("mousedown", (d) => {
815
- d.preventDefault(), l(d);
816
- const h = (f) => l(f), g = () => {
817
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
814
+ t.addEventListener("mousedown", (h) => {
815
+ h.preventDefault(), l(h);
816
+ const p = (C) => l(C), g = () => {
817
+ document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
818
818
  };
819
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
820
- }), e.addEventListener("mousedown", (d) => {
821
- d.preventDefault(), r(d);
822
- const h = (f) => r(f), g = () => {
823
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
819
+ document.addEventListener("mousemove", p), document.addEventListener("mouseup", g);
820
+ }), e.addEventListener("mousedown", (h) => {
821
+ h.preventDefault(), r(h);
822
+ const p = (C) => r(C), g = () => {
823
+ document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
824
824
  };
825
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
826
- }), i.addEventListener("mousedown", (d) => {
827
- d.preventDefault(), c(d);
828
- const h = (f) => c(f), g = () => {
829
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
825
+ document.addEventListener("mousemove", p), document.addEventListener("mouseup", g);
826
+ }), i.addEventListener("mousedown", (h) => {
827
+ h.preventDefault(), c(h);
828
+ const p = (C) => c(C), g = () => {
829
+ document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", g);
830
830
  };
831
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
832
- }), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (d) => {
833
- d.key === "Enter" && (d.preventDefault(), this.syncInput(), s.blur());
831
+ document.addEventListener("mousemove", p), document.addEventListener("mouseup", g);
832
+ }), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (h) => {
833
+ h.key === "Enter" && (h.preventDefault(), this.syncInput(), s.blur());
834
834
  }), o.addEventListener("click", async () => {
835
835
  try {
836
836
  await navigator.clipboard.writeText(s.value);
@@ -838,14 +838,14 @@ class ut {
838
838
  s.select(), document.execCommand("copy");
839
839
  }
840
840
  }), a.addEventListener("click", async () => {
841
- var d;
841
+ var h;
842
842
  if (!("EyeDropper" in window)) {
843
843
  alert("EyeDropper API is not supported in this browser.");
844
844
  return;
845
845
  }
846
846
  try {
847
- const h = new window.EyeDropper(), { sRGBHex: g } = await h.open();
848
- this.setColor(g), (d = this.onChange) == null || d.call(this, g, this.currentOpacity);
847
+ const p = new window.EyeDropper(), { sRGBHex: g } = await p.open();
848
+ this.setColor(g), (h = this.onChange) == null || h.call(this, g, this.currentOpacity);
849
849
  } catch {
850
850
  }
851
851
  }), document.addEventListener("keydown", this.keyDown, !0), setTimeout(
@@ -903,12 +903,12 @@ class ut {
903
903
  this.currentColor = t, this.currentOpacity = i ?? 100, this.syncInput();
904
904
  const { h: s, s: n, v: o } = U(t);
905
905
  this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - o) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`, this.updateOpacityBg(), this.opacityMarker.style.left = `${this.currentOpacity}%`, (y = this.recentSectionRefresh) == null || y.call(this), this.isOpen = !0, this.backdrop.style.display = "block", this.backdrop.parentElement || document.body.appendChild(this.backdrop), this.element.style.display = "block", this.element.style.position = "fixed", this.element.style.zIndex = "10002", this.element.style.left = "-9999px", this.element.style.top = "0px", this.element.parentElement || document.body.appendChild(this.element);
906
- const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), c = window.innerWidth, d = window.innerHeight, h = 16;
907
- let g = r.right + 8, f = r.top;
906
+ const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), c = window.innerWidth, h = window.innerHeight, p = 16;
907
+ let g = r.right + 8, C = r.top;
908
908
  const m = c - r.right, u = r.left;
909
- m >= a + h ? g = r.right + 8 : u >= a + h ? g = r.left - a - 8 : g = Math.max(h, (c - a) / 2);
910
- const C = d - r.bottom, v = r.top;
911
- C >= l + h ? f = r.bottom + 8 : v >= l + h ? f = r.top - l - 8 : C > v ? (f = r.bottom + 8, f + l > d - h && (f = d - l - h)) : (f = r.top - l - 8, f < h && (f = h)), this.element.style.left = `${g}px`, this.element.style.top = `${f}px`;
909
+ m >= a + p ? g = r.right + 8 : u >= a + p ? g = r.left - a - 8 : g = Math.max(p, (c - a) / 2);
910
+ const f = h - r.bottom, v = r.top;
911
+ f >= l + p ? C = r.bottom + 8 : v >= l + p ? C = r.top - l - 8 : f > v ? (C = r.bottom + 8, C + l > h - p && (C = h - l - p)) : (C = r.top - l - 8, C < p && (C = p)), this.element.style.left = `${g}px`, this.element.style.top = `${C}px`;
912
912
  }
913
913
  close(t) {
914
914
  var e;
@@ -954,47 +954,47 @@ class Dt {
954
954
  r.className = "color-picker-opacity embedded", this.opacitySlider = r;
955
955
  const c = document.createElement("div");
956
956
  c.className = "color-picker-opacity-marker", this.opacityMarker = c, r.appendChild(c), o.appendChild(a), o.appendChild(r), s.appendChild(n), s.appendChild(o);
957
- const d = at((x) => {
957
+ const h = at((x) => {
958
958
  const k = T(x);
959
959
  k && k.type !== "solid" ? this.onColorChange(x, this.currentOpacity) : (this.setColor(x), this.onColorChange(this.currentColor, this.currentOpacity));
960
960
  }, "all");
961
- this.recentSectionRefresh = d.refresh;
962
- const h = document.createElement("div");
963
- h.className = "color-picker-format-section embedded";
961
+ this.recentSectionRefresh = h.refresh;
962
+ const p = document.createElement("div");
963
+ p.className = "color-picker-format-section embedded";
964
964
  const g = document.createElement("select");
965
965
  g.className = "color-picker-format-select", this.select = g;
966
- const f = document.createElement("option");
967
- f.value = "hex", f.textContent = "HEX";
966
+ const C = document.createElement("option");
967
+ C.value = "hex", C.textContent = "HEX";
968
968
  const m = document.createElement("option");
969
969
  m.value = "rgb", m.textContent = "RGB";
970
970
  const u = document.createElement("option");
971
- u.value = "hsl", u.textContent = "HSL", g.appendChild(f), g.appendChild(m), g.appendChild(u);
972
- const C = document.createElement("input");
973
- C.type = "text", C.className = "color-picker-color-input", this.input = C;
971
+ u.value = "hsl", u.textContent = "HSL", g.appendChild(C), g.appendChild(m), g.appendChild(u);
972
+ const f = document.createElement("input");
973
+ f.type = "text", f.className = "color-picker-color-input", this.input = f;
974
974
  const v = document.createElement("div");
975
975
  v.className = "color-picker-input-container";
976
976
  const y = document.createElement("button");
977
- return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(C), v.appendChild(y), h.appendChild(g), h.appendChild(v), t.appendChild(e), t.appendChild(s), t.appendChild(h), t.appendChild(d.container), this.bind(e, a, r, C, g, y, n), t;
977
+ return y.className = "color-picker-copy-inside", y.textContent = "Copy", v.appendChild(f), v.appendChild(y), p.appendChild(g), p.appendChild(v), t.appendChild(e), t.appendChild(s), t.appendChild(p), t.appendChild(h.container), this.bind(e, a, r, f, g, y, n), t;
978
978
  }
979
979
  bind(t, e, i, s, n, o, a) {
980
- const l = (h, g) => {
981
- const f = g || t.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width)), u = Math.max(0, Math.min(1, (h.clientY - f.top) / f.height));
980
+ const l = (p, g) => {
981
+ const C = g || t.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width)), u = Math.max(0, Math.min(1, (p.clientY - C.top) / C.height));
982
982
  this.colorMarker.style.left = `${m * 100}%`, this.colorMarker.style.top = `${u * 100}%`;
983
983
  const v = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, y = W(v, m, 1 - u);
984
984
  this.currentColor = y, this.syncInput(), this.updateOpacityBg(), this.queueChange();
985
- }, r = (h, g) => {
986
- const f = g || e.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width));
985
+ }, r = (p, g) => {
986
+ const C = g || e.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
987
987
  this.hueMarker.style.left = `${m * 100}%`;
988
- const u = m * 360, C = this.parsePercentage(this.colorMarker.style.left || "0%"), v = this.parsePercentage(this.colorMarker.style.top || "0%"), y = W(u, C, 1 - v);
988
+ const u = m * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), v = this.parsePercentage(this.colorMarker.style.top || "0%"), y = W(u, f, 1 - v);
989
989
  this.currentColor = y, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
990
990
  linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
991
- }, c = (h, g) => {
992
- const f = g || i.getBoundingClientRect(), m = Math.max(0, Math.min(1, (h.clientX - f.left) / f.width));
991
+ }, c = (p, g) => {
992
+ const C = g || i.getBoundingClientRect(), m = Math.max(0, Math.min(1, (p.clientX - C.left) / C.width));
993
993
  this.opacityMarker.style.left = `${m * 100}%`, this.currentOpacity = this.clampOpacity(m * 100), this.queueChange();
994
- }, d = (h, g, f) => {
995
- h.preventDefault(), this.isDragging = !0, this.cachedRect = f.getBoundingClientRect(), g(h, this.cachedRect);
994
+ }, h = (p, g, C) => {
995
+ p.preventDefault(), this.isDragging = !0, this.cachedRect = C.getBoundingClientRect(), g(p, this.cachedRect);
996
996
  let m = null, u;
997
- const C = () => {
997
+ const f = () => {
998
998
  this.dragRafId === void 0 && (this.dragRafId = window.requestAnimationFrame(() => {
999
999
  this.dragRafId = void 0, m && this.cachedRect && g(m, this.cachedRect);
1000
1000
  }));
@@ -1006,23 +1006,23 @@ class Dt {
1006
1006
  v();
1007
1007
  return;
1008
1008
  }
1009
- m = y, C();
1009
+ m = y, f();
1010
1010
  }, document.addEventListener("mousemove", u), document.addEventListener("mouseup", v), window.addEventListener("blur", v);
1011
1011
  };
1012
- t.addEventListener("mousedown", (h) => {
1013
- d(h, l, t);
1014
- }), e.addEventListener("mousedown", (h) => {
1015
- d(h, r, e);
1016
- }), i.addEventListener("mousedown", (h) => {
1017
- d(h, c, i);
1012
+ t.addEventListener("mousedown", (p) => {
1013
+ h(p, l, t);
1014
+ }), e.addEventListener("mousedown", (p) => {
1015
+ h(p, r, e);
1016
+ }), i.addEventListener("mousedown", (p) => {
1017
+ h(p, c, i);
1018
1018
  }), n.addEventListener("change", () => {
1019
1019
  this.syncInput();
1020
1020
  }), s.addEventListener("input", () => {
1021
1021
  this.applyFromInput();
1022
1022
  }), s.addEventListener("blur", () => {
1023
1023
  this.syncInput();
1024
- }), s.addEventListener("keydown", (h) => {
1025
- h.key === "Enter" && (h.preventDefault(), this.syncInput(), s.blur());
1024
+ }), s.addEventListener("keydown", (p) => {
1025
+ p.key === "Enter" && (p.preventDefault(), this.syncInput(), s.blur());
1026
1026
  }), o.addEventListener("click", async () => {
1027
1027
  try {
1028
1028
  await navigator.clipboard.writeText(s.value);
@@ -1035,7 +1035,7 @@ class Dt {
1035
1035
  return;
1036
1036
  }
1037
1037
  try {
1038
- const h = new window.EyeDropper(), { sRGBHex: g } = await h.open();
1038
+ const p = new window.EyeDropper(), { sRGBHex: g } = await p.open();
1039
1039
  this.setColor(g), this.onColorChange(this.currentColor, this.currentOpacity);
1040
1040
  } catch {
1041
1041
  }
@@ -1137,10 +1137,10 @@ const V = class V extends w {
1137
1137
  angle: "number",
1138
1138
  stops: "text"
1139
1139
  }, this.element = null, this.previewEl = null, this.inputEl = void 0, this.popoverEl = null, this.backdropEl = null, this.isPopoverOpen = !1, this.isEditing = !1, this.popoverPosition = null, this.previewUpdateTimeout = null, this.changeDebounceTimeout = null, this.solidPicker = null, this.pendingSolidColor = null, this.variant = "default", this.globalLayoutMode = "list", this.globalSearchQuery = "", this.currentMode = "custom", this.linkedGlobalVariable = null, this.unlinkButton = null, this.onBackgroundClick = (i) => {
1140
- var h;
1140
+ var p;
1141
1141
  if (!this.popoverEl || !this.isPopoverOpen) return;
1142
- const s = i.target, n = this.popoverEl.contains(s), o = (h = this.element) == null ? void 0 : h.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((g) => g.contains(s)), r = s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"), c = s.classList.contains("color-picker-backdrop"), d = s.classList.contains("gradient-popover-backdrop");
1143
- !n && !o && !l && !r && !c && !d && this.closePopover();
1142
+ const s = i.target, n = this.popoverEl.contains(s), o = (p = this.element) == null ? void 0 : p.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((g) => g.contains(s)), r = s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"), c = s.classList.contains("color-picker-backdrop"), h = s.classList.contains("gradient-popover-backdrop");
1143
+ !n && !o && !l && !r && !c && !h && this.closePopover();
1144
1144
  }, this.handlePopoverKeydown = (i) => {
1145
1145
  if (this.isPopoverOpen) {
1146
1146
  if (i.key === "Escape") {
@@ -1322,8 +1322,8 @@ const V = class V extends w {
1322
1322
  n.appendChild(o), s.appendChild(n);
1323
1323
  const a = document.createElement("div");
1324
1324
  if (a.className = "gradient-editor-content", this.updatePopoverContent(a), s.appendChild(a), this.variant !== "global" && e) {
1325
- const l = e.children[0], r = e.children[1], c = (d) => {
1326
- this.currentMode = d, d === "custom" ? (l.classList.add("active"), r.classList.remove("active"), n.style.display = "block") : (r.classList.add("active"), l.classList.remove("active"), n.style.display = "none"), this.updatePopoverContent(a);
1325
+ const l = e.children[0], r = e.children[1], c = (h) => {
1326
+ this.currentMode = h, h === "custom" ? (l.classList.add("active"), r.classList.remove("active"), n.style.display = "block") : (r.classList.add("active"), l.classList.remove("active"), n.style.display = "none"), this.updatePopoverContent(a);
1327
1327
  };
1328
1328
  l.addEventListener("click", () => c("custom")), r.addEventListener("click", () => c("global")), this.isBoundToGlobal() ? (this.currentMode = "global", c("global")) : (this.currentMode = "custom", c("custom"));
1329
1329
  }
@@ -1390,39 +1390,39 @@ const V = class V extends w {
1390
1390
  }
1391
1391
  renderGlobalColors(t) {
1392
1392
  (!this.value || !this.value.stops || !this.value.stops.length) && (this.value || (this.value = this.defaultValue()), this.value.stops = [{ color: "#000000", position: 0, opacity: 100 }]);
1393
- const e = this.value.stops[0], i = (d) => {
1394
- d.innerHTML = "";
1395
- let h = {};
1393
+ const e = this.value.stops[0], i = (h) => {
1394
+ h.innerHTML = "";
1395
+ let p = {};
1396
1396
  try {
1397
- h = w.GlobalVariables || {};
1397
+ p = w.GlobalVariables || {};
1398
1398
  } catch (u) {
1399
1399
  console.warn("Could not access Setting.GlobalVariables", u);
1400
1400
  }
1401
- if (!h || Object.keys(h).length === 0) {
1401
+ if (!p || Object.keys(p).length === 0) {
1402
1402
  const u = document.createElement("div");
1403
- u.textContent = "No global colors defined", u.style.fontSize = "12px", u.style.color = "#666", u.style.padding = "8px", d.appendChild(u);
1403
+ u.textContent = "No global colors defined", u.style.fontSize = "12px", u.style.color = "#666", u.style.padding = "8px", h.appendChild(u);
1404
1404
  return;
1405
1405
  }
1406
1406
  const g = w.GlobalVariableGroups || [
1407
1407
  { title: "Global Colors", keys: ["primary", "secondary", "tertiary", "accent"] },
1408
1408
  { title: "Text Color", keys: ["text-dark", "text-light"] }
1409
- ], f = this.globalSearchQuery.toLowerCase();
1409
+ ], C = this.globalSearchQuery.toLowerCase();
1410
1410
  let m;
1411
- this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"), d.appendChild(m), g.forEach((u) => {
1412
- const C = Object.entries(h).filter(([v]) => !u.keys.includes(v) && u.title !== "Global Colors" ? !1 : u.keys.includes(v) && v.toLowerCase().includes(f));
1413
- C.length !== 0 && C.forEach(([v, y]) => {
1411
+ this.globalLayoutMode === "list" ? (m = document.createElement("div"), m.className = "global-colors-list") : (m = document.createElement("div"), m.className = "global-colors-grid"), h.appendChild(m), g.forEach((u) => {
1412
+ const f = Object.entries(p).filter(([v]) => !u.keys.includes(v) && u.title !== "Global Colors" ? !1 : u.keys.includes(v) && v.toLowerCase().includes(C));
1413
+ f.length !== 0 && f.forEach(([v, y]) => {
1414
1414
  if (this.globalLayoutMode === "list") {
1415
1415
  const x = document.createElement("div");
1416
1416
  x.className = "global-color-row";
1417
1417
  const k = document.createElement("div");
1418
1418
  k.className = "global-color-circle";
1419
- const N = this.resolveGlobalVarColor(y);
1420
- k.style.background = N, (this.linkedGlobalVariable === `var(--${v})` || e.color === `var(--${v})`) && k.classList.add("selected");
1419
+ const I = this.resolveGlobalVarColor(y);
1420
+ k.style.background = I, (this.linkedGlobalVariable === `var(--${v})` || e.color === `var(--${v})`) && k.classList.add("selected");
1421
1421
  const b = document.createElement("span");
1422
- b.className = "global-color-label", b.textContent = v.split("-").map((I) => I.charAt(0).toUpperCase() + I.slice(1)).join(" "), x.appendChild(k), x.appendChild(b), x.addEventListener("click", (I) => {
1423
- I.preventDefault();
1422
+ b.className = "global-color-label", b.textContent = v.split("-").map((N) => N.charAt(0).toUpperCase() + N.slice(1)).join(" "), x.appendChild(k), x.appendChild(b), x.addEventListener("click", (N) => {
1423
+ N.preventDefault();
1424
1424
  const D = `var(--${v})`;
1425
- this.setValue(D), this.pendingSolidColor = D, i(d);
1425
+ this.setValue(D), this.pendingSolidColor = D, i(h);
1426
1426
  }), m.appendChild(x);
1427
1427
  } else {
1428
1428
  const x = document.createElement("div");
@@ -1431,7 +1431,7 @@ const V = class V extends w {
1431
1431
  x.style.background = k, x.title = v.split("-").map((E) => E.charAt(0).toUpperCase() + E.slice(1)).join(" "), (this.linkedGlobalVariable === `var(--${v})` || e.color === `var(--${v})`) && x.classList.add("selected"), x.addEventListener("click", (E) => {
1432
1432
  E.preventDefault();
1433
1433
  const b = `var(--${v})`;
1434
- this.setValue(b), this.pendingSolidColor = b, i(d);
1434
+ this.setValue(b), this.pendingSolidColor = b, i(h);
1435
1435
  }), m.appendChild(x);
1436
1436
  }
1437
1437
  });
@@ -1445,8 +1445,8 @@ const V = class V extends w {
1445
1445
  const a = document.createElement("input");
1446
1446
  a.type = "text", a.className = "global-search-input", a.placeholder = "Search", a.value = this.globalSearchQuery;
1447
1447
  const l = document.createElement("div");
1448
- a.addEventListener("input", (d) => {
1449
- this.globalSearchQuery = d.target.value, i(l);
1448
+ a.addEventListener("input", (h) => {
1449
+ this.globalSearchQuery = h.target.value, i(l);
1450
1450
  }), n.appendChild(o), n.appendChild(a);
1451
1451
  const r = document.createElement("button");
1452
1452
  r.className = "global-layout-toggle", r.type = "button";
@@ -1481,15 +1481,15 @@ const V = class V extends w {
1481
1481
  {
1482
1482
  const c = document.createElement("div");
1483
1483
  c.className = "gradient-subtype-inline";
1484
- const d = document.createElement("select");
1485
- d.className = "gradient-subtype-select";
1486
- const h = document.createElement("option");
1487
- h.value = "linear", h.textContent = "Linear";
1484
+ const h = document.createElement("select");
1485
+ h.className = "gradient-subtype-select";
1486
+ const p = document.createElement("option");
1487
+ p.value = "linear", p.textContent = "Linear";
1488
1488
  const g = document.createElement("option");
1489
- g.value = "radial", g.textContent = "Radial", d.appendChild(h), d.appendChild(g), d.value = this.value.type === "radial" ? "radial" : "linear", e = document.createElement("input"), e.type = "text", e.inputMode = "numeric", e.className = "gradient-degree-input", e.value = `${this.value.angle ?? 90}°`, e.style.width = "75px", e.style.textAlign = "center", (!this.value.angle || this.value.stops.length < 2) && (this.value.angle = 90, e.value = "90°");
1490
- const f = document.createElement("button");
1491
- f.type = "button", f.className = "gradient-flip-btn", f.innerHTML = Ot, d.addEventListener("change", () => {
1492
- this.clearGlobalBindingForCustomChange(), this.switchType(d.value === "radial" ? "radial" : "linear", !0), e && this.updateDegreeVisibility(e);
1489
+ g.value = "radial", g.textContent = "Radial", h.appendChild(p), h.appendChild(g), h.value = this.value.type === "radial" ? "radial" : "linear", e = document.createElement("input"), e.type = "text", e.inputMode = "numeric", e.className = "gradient-degree-input", e.value = `${this.value.angle ?? 90}°`, e.style.width = "75px", e.style.textAlign = "center", (!this.value.angle || this.value.stops.length < 2) && (this.value.angle = 90, e.value = "90°");
1490
+ const C = document.createElement("button");
1491
+ C.type = "button", C.className = "gradient-flip-btn", C.innerHTML = Ot, h.addEventListener("change", () => {
1492
+ this.clearGlobalBindingForCustomChange(), this.switchType(h.value === "radial" ? "radial" : "linear", !0), e && this.updateDegreeVisibility(e);
1493
1493
  }), e.addEventListener("focus", (m) => {
1494
1494
  const u = m.target;
1495
1495
  u.value = u.value.replace(/[^0-9-]/g, ""), setTimeout(() => u.select(), 0);
@@ -1501,13 +1501,13 @@ const V = class V extends w {
1501
1501
  var v;
1502
1502
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
1503
1503
  const u = m.target;
1504
- let C = parseInt(u.value);
1505
- Number.isNaN(C) && (C = ((v = this.value) == null ? void 0 : v.angle) ?? 0), C = Math.max(0, Math.min(360, C)), this.value && (this.value.angle = C), u.value = `${C}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
1506
- }), f.addEventListener("click", () => {
1504
+ let f = parseInt(u.value);
1505
+ Number.isNaN(f) && (f = ((v = this.value) == null ? void 0 : v.angle) ?? 0), f = Math.max(0, Math.min(360, f)), this.value && (this.value.angle = f), u.value = `${f}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
1506
+ }), C.addEventListener("click", () => {
1507
1507
  this.clearGlobalBindingForCustomChange(), !(!this.value || !this.value.stops) && (this.value.stops.forEach((m) => {
1508
1508
  m.position = 100 - m.position;
1509
1509
  }), this.value.stops.sort((m, u) => m.position - u.position), this.updateGradientPreview(i), this.createHandles(s, i), this.updateStopsList(l), this.updateUI(), this.triggerChange());
1510
- }), c.appendChild(d), c.appendChild(e), c.appendChild(f), t.appendChild(c), this.updateDegreeVisibility(e);
1510
+ }), c.appendChild(h), c.appendChild(e), c.appendChild(C), t.appendChild(c), this.updateDegreeVisibility(e);
1511
1511
  }
1512
1512
  const i = document.createElement("div");
1513
1513
  i.className = "gradient-preview", this.updateGradientPreview(i);
@@ -1522,8 +1522,8 @@ const V = class V extends w {
1522
1522
  const l = document.createElement("div");
1523
1523
  l.className = "gradient-stops", t.appendChild(n), t.appendChild(l), this.updateStopsList(l);
1524
1524
  const r = at((c) => {
1525
- const d = T(c);
1526
- d && (this.clearGlobalBindingForCustomChange(), this.value = d, this.switchType(d.type, !0), this.updateUI(), this.triggerChange());
1525
+ const h = T(c);
1526
+ h && (this.clearGlobalBindingForCustomChange(), this.value = h, this.switchType(h.type, !0), this.updateUI(), this.triggerChange());
1527
1527
  }, "all");
1528
1528
  this.recentGradientRefresh = r.refresh, t.appendChild(r.container), a.addEventListener("click", () => {
1529
1529
  var c;
@@ -1558,29 +1558,29 @@ const V = class V extends w {
1558
1558
  o.className = "gstop-chip";
1559
1559
  const a = this.resolveGlobalVarColor(i.color);
1560
1560
  o.style.backgroundColor = a, n.appendChild(o);
1561
- const l = new ut((u, C) => {
1562
- this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = u, C !== void 0 && (this.value.stops[s].opacity = C), o.style.backgroundColor = u, this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
1561
+ const l = new ut((u, f) => {
1562
+ this.clearGlobalBindingForCustomChange(), this.value && this.value.stops[s] && (this.value.stops[s].color = u, f !== void 0 && (this.value.stops[s].opacity = f), o.style.backgroundColor = u, this.updateGradientPreview(), this.updateStopsList(), this.updateUI(), this.triggerChange());
1563
1563
  }, "solid");
1564
- let r = !1, c = !1, d = 0, h = 0;
1564
+ let r = !1, c = !1, h = 0, p = 0;
1565
1565
  const g = (u) => {
1566
- r = !0, c = !1, d = u.clientX, h = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", f), document.addEventListener("mouseup", m), u.preventDefault(), u.stopPropagation();
1567
- }, f = (u) => {
1566
+ r = !0, c = !1, h = u.clientX, p = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", C), document.addEventListener("mouseup", m), u.preventDefault(), u.stopPropagation();
1567
+ }, C = (u) => {
1568
1568
  if (!r || !this.value) return;
1569
- const C = u.clientX - d;
1570
- if (Math.abs(C) > 3 && (c = !0), c) {
1569
+ const f = u.clientX - h;
1570
+ if (Math.abs(f) > 3 && (c = !0), c) {
1571
1571
  this.clearGlobalBindingForCustomChange();
1572
1572
  const v = e.getBoundingClientRect();
1573
- let y = h + C / v.width * 100;
1573
+ let y = p + f / v.width * 100;
1574
1574
  y = Math.max(0, Math.min(100, y)), this.value.stops[s].position = Math.round(y), n.style.left = `${y}%`, this.updateGradientPreview();
1575
1575
  }
1576
1576
  }, m = (u) => {
1577
- var C;
1577
+ var f;
1578
1578
  if (r)
1579
- if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", m), c)
1579
+ if (r = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", m), c)
1580
1580
  this.value && (this.value.stops.sort((v, y) => v.position - y.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange();
1581
1581
  else {
1582
1582
  u.stopPropagation();
1583
- const v = (C = this.value) == null ? void 0 : C.stops[s];
1583
+ const v = (f = this.value) == null ? void 0 : f.stops[s];
1584
1584
  v && setTimeout(() => {
1585
1585
  const y = this.resolveGlobalVarColor(v.color);
1586
1586
  l.open(y, o, v.opacity ?? 100);
@@ -1594,7 +1594,7 @@ const V = class V extends w {
1594
1594
  var i;
1595
1595
  const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
1596
1596
  !e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
1597
- var k, N;
1597
+ var k, I;
1598
1598
  const o = document.createElement("div");
1599
1599
  o.className = "gstop-row";
1600
1600
  const a = document.createElement("div");
@@ -1603,50 +1603,50 @@ const V = class V extends w {
1603
1603
  l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", a.appendChild(l);
1604
1604
  const r = document.createElement("div");
1605
1605
  r.className = "gstop-color-container";
1606
- const c = this.resolveGlobalVarColor(s.color), d = document.createElement("div");
1607
- d.className = "gstop-color-preview", d.style.backgroundColor = c;
1608
- const h = document.createElement("input");
1609
- h.type = "text", h.className = "gstop-color-input", h.value = c.replace("#", "").toUpperCase();
1606
+ const c = this.resolveGlobalVarColor(s.color), h = document.createElement("div");
1607
+ h.className = "gstop-color-preview", h.style.backgroundColor = c;
1608
+ const p = document.createElement("input");
1609
+ p.type = "text", p.className = "gstop-color-input", p.value = c.replace("#", "").toUpperCase();
1610
1610
  const g = document.createElement("button");
1611
- g.type = "button", g.className = "gstop-color-copy", g.textContent = "Copy", r.appendChild(d), r.appendChild(h), r.appendChild(g);
1612
- const f = document.createElement("button");
1613
- f.type = "button", f.className = "gstop-del", f.innerHTML = Ht, f.disabled = (((N = (k = this.value) == null ? void 0 : k.stops) == null ? void 0 : N.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(f), e.appendChild(o);
1611
+ g.type = "button", g.className = "gstop-color-copy", g.textContent = "Copy", r.appendChild(h), r.appendChild(p), r.appendChild(g);
1612
+ const C = document.createElement("button");
1613
+ C.type = "button", C.className = "gstop-del", C.innerHTML = Ht, C.disabled = (((I = (k = this.value) == null ? void 0 : k.stops) == null ? void 0 : I.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(C), e.appendChild(o);
1614
1614
  const m = document.createElement("span");
1615
1615
  m.className = "gstop-opacity-label", m.textContent = "Opacity";
1616
1616
  const u = document.createElement("div");
1617
1617
  u.className = "gstop-opacity-group";
1618
- const C = document.createElement("input");
1619
- C.type = "range", C.className = "gstop-opacity-slider", C.min = "0", C.max = "100", C.value = String(s.opacity ?? 100);
1618
+ const f = document.createElement("input");
1619
+ f.type = "range", f.className = "gstop-opacity-slider", f.min = "0", f.max = "100", f.value = String(s.opacity ?? 100);
1620
1620
  const v = P(c);
1621
- C.style.setProperty("--slider-color", `rgb(${v.r}, ${v.g}, ${v.b})`);
1621
+ f.style.setProperty("--slider-color", `rgb(${v.r}, ${v.g}, ${v.b})`);
1622
1622
  const y = document.createElement("span");
1623
- y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, u.appendChild(C), u.appendChild(y);
1623
+ y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, u.appendChild(f), u.appendChild(y);
1624
1624
  const x = new ut((E, b) => {
1625
- this.clearGlobalBindingForCustomChange(), h.value = E.replace("#", "").toUpperCase(), d.style.backgroundColor = E, this.value.stops[n].color = E, b !== void 0 && (this.value.stops[n].opacity = b, C.value = String(b), y.textContent = `${b}%`);
1626
- const I = P(E);
1627
- C.style.setProperty("--slider-color", `rgb(${I.r}, ${I.g}, ${I.b})`), this.updateGradientPreview(), this.createHandles(
1625
+ this.clearGlobalBindingForCustomChange(), p.value = E.replace("#", "").toUpperCase(), h.style.backgroundColor = E, this.value.stops[n].color = E, b !== void 0 && (this.value.stops[n].opacity = b, f.value = String(b), y.textContent = `${b}%`);
1626
+ const N = P(E);
1627
+ f.style.setProperty("--slider-color", `rgb(${N.r}, ${N.g}, ${N.b})`), this.updateGradientPreview(), this.createHandles(
1628
1628
  this.popoverEl.querySelector(".gradient-handles"),
1629
1629
  this.popoverEl.querySelector(".gradient-preview")
1630
1630
  ), this.updateUI(), this.triggerChange();
1631
1631
  }, "solid");
1632
- h.addEventListener("click", (E) => {
1632
+ p.addEventListener("click", (E) => {
1633
1633
  E.preventDefault(), E.stopPropagation();
1634
1634
  const b = this.resolveGlobalVarColor(s.color);
1635
- x.open(b, h, s.opacity ?? 100);
1636
- }), h.addEventListener("input", () => {
1635
+ x.open(b, p, s.opacity ?? 100);
1636
+ }), p.addEventListener("input", () => {
1637
1637
  this.clearGlobalBindingForCustomChange();
1638
- const E = h.value.trim(), b = E.startsWith("#") ? E : `#${E}`;
1638
+ const E = p.value.trim(), b = E.startsWith("#") ? E : `#${E}`;
1639
1639
  if (/^#[0-9A-Fa-f]{6}$/.test(b)) {
1640
- this.value.stops[n].color = b, d.style.backgroundColor = b;
1641
- const I = P(b);
1642
- C.style.setProperty("--slider-color", `rgb(${I.r}, ${I.g}, ${I.b})`), this.debouncedPreviewUpdate();
1640
+ this.value.stops[n].color = b, h.style.backgroundColor = b;
1641
+ const N = P(b);
1642
+ f.style.setProperty("--slider-color", `rgb(${N.r}, ${N.g}, ${N.b})`), this.debouncedPreviewUpdate();
1643
1643
  }
1644
- }), h.addEventListener("blur", () => {
1644
+ }), p.addEventListener("blur", () => {
1645
1645
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
1646
1646
  }), g.addEventListener("click", async (E) => {
1647
1647
  E.stopPropagation();
1648
1648
  try {
1649
- await navigator.clipboard.writeText(`#${h.value}`);
1649
+ await navigator.clipboard.writeText(`#${p.value}`);
1650
1650
  } catch {
1651
1651
  }
1652
1652
  }), l.addEventListener("focus", (E) => {
@@ -1654,35 +1654,35 @@ const V = class V extends w {
1654
1654
  b.value = b.value.replace("%", ""), b.select();
1655
1655
  }), l.addEventListener("input", (E) => {
1656
1656
  this.clearGlobalBindingForCustomChange();
1657
- const b = E.target, I = parseInt(b.value.replace(/[^\d]/g, ""), 10);
1658
- if (!Number.isNaN(I)) {
1659
- const D = Math.max(0, Math.min(100, I));
1657
+ const b = E.target, N = parseInt(b.value.replace(/[^\d]/g, ""), 10);
1658
+ if (!Number.isNaN(N)) {
1659
+ const D = Math.max(0, Math.min(100, N));
1660
1660
  this.value.stops[n].position = D, b.value = `${D}%`, this.debouncedPreviewUpdate();
1661
1661
  }
1662
1662
  }), l.addEventListener("blur", (E) => {
1663
1663
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
1664
- const b = E.target, I = parseInt(b.value.replace(/[^\d]/g, ""), 10);
1665
- if (Number.isNaN(I))
1664
+ const b = E.target, N = parseInt(b.value.replace(/[^\d]/g, ""), 10);
1665
+ if (Number.isNaN(N))
1666
1666
  b.value = `${this.value.stops[n].position}%`;
1667
1667
  else {
1668
- const D = Math.max(0, Math.min(100, I));
1668
+ const D = Math.max(0, Math.min(100, N));
1669
1669
  this.value.stops[n].position = D, b.value = `${D}%`;
1670
1670
  }
1671
1671
  this.updateGradientPreview(), this.createHandles(
1672
1672
  this.popoverEl.querySelector(".gradient-handles"),
1673
1673
  this.popoverEl.querySelector(".gradient-preview")
1674
1674
  ), this.updateStopsList(), this.updateUI(), this.triggerChange();
1675
- }), f.addEventListener("click", () => {
1675
+ }), C.addEventListener("click", () => {
1676
1676
  var E;
1677
1677
  (this.value.stops.length || 0) <= 2 || (this.clearGlobalBindingForCustomChange(), this.value.stops.splice(n, 1), this.createHandles(
1678
1678
  this.popoverEl.querySelector(".gradient-handles"),
1679
1679
  this.popoverEl.querySelector(".gradient-preview")
1680
1680
  ), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((E = document.activeElement) == null ? void 0 : E.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
1681
- }), C.addEventListener("input", () => {
1681
+ }), f.addEventListener("input", () => {
1682
1682
  this.clearGlobalBindingForCustomChange();
1683
- const E = parseInt(C.value, 10);
1683
+ const E = parseInt(f.value, 10);
1684
1684
  this.value.stops[n].opacity = Math.max(0, Math.min(100, E)), y.textContent = `${this.value.stops[n].opacity}%`, this.debouncedPreviewUpdate();
1685
- }), C.addEventListener("change", () => {
1685
+ }), f.addEventListener("change", () => {
1686
1686
  this.clearGlobalBindingForCustomChange(), this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
1687
1687
  });
1688
1688
  }));
@@ -1711,10 +1711,10 @@ const V = class V extends w {
1711
1711
  this.popoverEl.style.position = "fixed", this.popoverEl.style.zIndex = "10000", this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
1712
1712
  const o = this.popoverEl.offsetHeight;
1713
1713
  let a = t.right + 8, l = t.top;
1714
- const r = i - t.right, c = t.left, d = e + n;
1715
- r < d && c > r + 100 && (a = t.left - e - 8);
1716
- const h = s - t.bottom, g = t.top;
1717
- g >= o + n ? l = t.top - o - 8 : h >= o + n ? l = t.bottom + 8 : g > h ? (l = t.top - o - 8, l < n && (l = n)) : (l = t.bottom + 8, l + o > s - n && (l = s - o - n)), this.popoverEl.style.left = `${a}px`, this.popoverEl.style.top = `${l}px`, this.popoverPosition = { left: a, top: l };
1714
+ const r = i - t.right, c = t.left, h = e + n;
1715
+ r < h && c > r + 100 && (a = t.left - e - 8);
1716
+ const p = s - t.bottom, g = t.top;
1717
+ g >= o + n ? l = t.top - o - 8 : p >= o + n ? l = t.bottom + 8 : g > p ? (l = t.top - o - 8, l < n && (l = n)) : (l = t.bottom + 8, l + o > s - n && (l = s - o - n)), this.popoverEl.style.left = `${a}px`, this.popoverEl.style.top = `${l}px`, this.popoverPosition = { left: a, top: l };
1718
1718
  }
1719
1719
  setTimeout(() => document.addEventListener("click", this.onBackgroundClick, !0), 200), document.addEventListener("keydown", this.handlePopoverKeydown, !0);
1720
1720
  }
@@ -1732,10 +1732,10 @@ const V = class V extends w {
1732
1732
  this.popoverEl.style.left, this.popoverEl.style.top, this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
1733
1733
  const a = this.popoverEl.offsetHeight;
1734
1734
  let l = e.right + 8, r = e.top;
1735
- const c = s - e.right, d = e.left, h = i + o;
1736
- c < h && d > c + 100 && (l = e.left - i - 8);
1737
- const g = n - e.bottom, f = e.top;
1738
- f >= a + o ? r = e.top - a - 8 : g >= a + o ? r = e.bottom + 8 : f > g ? (r = e.top - a - 8, r < o && (r = o)) : (r = e.bottom + 8, r + a > n - o && (r = n - a - o)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
1735
+ const c = s - e.right, h = e.left, p = i + o;
1736
+ c < p && h > c + 100 && (l = e.left - i - 8);
1737
+ const g = n - e.bottom, C = e.top;
1738
+ C >= a + o ? r = e.top - a - 8 : g >= a + o ? r = e.bottom + 8 : C > g ? (r = e.top - a - 8, r < o && (r = o)) : (r = e.bottom + 8, r + a > n - o && (r = n - a - o)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
1739
1739
  });
1740
1740
  }
1741
1741
  }
@@ -1810,10 +1810,10 @@ const V = class V extends w {
1810
1810
  };
1811
1811
  V.openInstance = null, V.CHANGE_DEBOUNCE_DELAY = 150;
1812
1812
  let j = V;
1813
- function J(p, t) {
1814
- for (const e in p)
1815
- if (Object.prototype.hasOwnProperty.call(p, e)) {
1816
- const i = p[e];
1813
+ function J(d, t) {
1814
+ for (const e in d)
1815
+ if (Object.prototype.hasOwnProperty.call(d, e)) {
1816
+ const i = d[e];
1817
1817
  t(e, i);
1818
1818
  }
1819
1819
  }
@@ -1919,16 +1919,16 @@ const Q = class Q {
1919
1919
  }), s.forEach((r) => {
1920
1920
  n.includes(r) || this.removeSetting(r);
1921
1921
  }), n.forEach((r) => {
1922
- var h;
1923
- const c = t[r], d = this.settings[r];
1924
- if (d !== c && (d && this.removeSetting(r), this.addSetting(r, c), i && r in o)) {
1922
+ var p;
1923
+ const c = t[r], h = this.settings[r];
1924
+ if (h !== c && (h && this.removeSetting(r), this.addSetting(r, c), i && r in o)) {
1925
1925
  const g = o[r];
1926
1926
  try {
1927
1927
  L(c) ? c.setValue(
1928
1928
  g
1929
- ) : F(c) ? (h = c.setValue) == null || h.call(c, g) : c.setValue && c.setValue(g);
1930
- } catch (f) {
1931
- console.warn(`Could not preserve value for setting ${r}:`, f);
1929
+ ) : F(c) ? (p = c.setValue) == null || p.call(c, g) : c.setValue && c.setValue(g);
1930
+ } catch (C) {
1931
+ console.warn(`Could not preserve value for setting ${r}:`, C);
1932
1932
  }
1933
1933
  }
1934
1934
  }), this.settings = t, this.propagateNestingLevel(), this.propagateDataPropsPath();
@@ -2059,8 +2059,8 @@ const Q = class Q {
2059
2059
  L(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
2060
2060
  const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
2061
2061
  if (l) {
2062
- const d = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
2063
- d && t.startsWith(d) && this.addDeleteButtonToElement(a, t);
2062
+ const h = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
2063
+ h && t.startsWith(h) && this.addDeleteButtonToElement(a, t);
2064
2064
  }
2065
2065
  const r = o.querySelector(".sg-add-button-bottom");
2066
2066
  r ? o.insertBefore(a, r) : o.appendChild(a), rt.trackElement(a), _(a, this.nestingLevel + 1), et(a, this.nestingLevel + 1);
@@ -2212,11 +2212,11 @@ const Q = class Q {
2212
2212
  r(), t(!1);
2213
2213
  }), l.addEventListener("click", () => {
2214
2214
  r(), t(!0);
2215
- }), e.addEventListener("click", (d) => {
2216
- d.target === e && (r(), t(!1));
2215
+ }), e.addEventListener("click", (h) => {
2216
+ h.target === e && (r(), t(!1));
2217
2217
  });
2218
- const c = (d) => {
2219
- d.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
2218
+ const c = (h) => {
2219
+ h.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", c));
2220
2220
  };
2221
2221
  document.addEventListener("keydown", c), o.appendChild(a), o.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(o), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
2222
2222
  e.style.opacity = "1", i.style.transform = "scale(1)";
@@ -2360,14 +2360,14 @@ const Q = class Q {
2360
2360
  }, Object.keys(this.settings).length > 0) {
2361
2361
  for (const c in this.settings)
2362
2362
  if (Object.prototype.hasOwnProperty.call(this.settings, c)) {
2363
- const d = this.settings[c];
2364
- L(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.nestingLevel + 1);
2365
- const h = d.draw();
2366
- L(d) && d.deleteItemCfg && this.addDeleteButtonToElement(
2367
- h,
2363
+ const h = this.settings[c];
2364
+ L(h) && typeof h.setNestingLevel == "function" && h.setNestingLevel(this.nestingLevel + 1);
2365
+ const p = h.draw();
2366
+ L(h) && h.deleteItemCfg && this.addDeleteButtonToElement(
2367
+ p,
2368
2368
  c,
2369
- d
2370
- ), a.appendChild(h);
2369
+ h
2370
+ ), a.appendChild(p);
2371
2371
  }
2372
2372
  } else {
2373
2373
  const c = document.createElement("div");
@@ -2376,18 +2376,18 @@ const Q = class Q {
2376
2376
  if (this.addItemCfg) {
2377
2377
  const c = document.createElement("button");
2378
2378
  c.type = "button", c.className = "sg-add-button-bottom", c.style.marginTop = "8px";
2379
- const d = `
2379
+ const h = `
2380
2380
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none"
2381
2381
  xmlns="http://www.w3.org/2000/svg">
2382
2382
  <path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
2383
2383
  stroke-width="1.5" stroke-linecap="round"/>
2384
2384
  </svg>`;
2385
- c.innerHTML = `${d}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (h) => {
2386
- h.stopPropagation(), h.preventDefault();
2387
- const g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), f = this.addItemCfg.createItem(g);
2388
- if (ct(f)) {
2385
+ c.innerHTML = `${h}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, c.addEventListener("click", (p) => {
2386
+ p.stopPropagation(), p.preventDefault();
2387
+ const g = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), C = this.addItemCfg.createItem(g);
2388
+ if (ct(C)) {
2389
2389
  const m = `${this.addItemCfg.keyPrefix}${g}`;
2390
- this.addSetting(m, f);
2390
+ this.addSetting(m, C);
2391
2391
  }
2392
2392
  }), a.appendChild(c);
2393
2393
  }
@@ -2435,8 +2435,8 @@ const Q = class Q {
2435
2435
  };
2436
2436
  Q.hiddenElements = /* @__PURE__ */ new Set();
2437
2437
  let H = Q;
2438
- function Me(p) {
2439
- return new Ft(p);
2438
+ function Me(d) {
2439
+ return new Ft(d);
2440
2440
  }
2441
2441
  class Ft extends H {
2442
2442
  constructor(t) {
@@ -2488,9 +2488,9 @@ class Ft extends H {
2488
2488
  r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", a), r.textContent = a, r.addEventListener("click", () => this.switchToTab(a)), n.appendChild(r);
2489
2489
  const c = document.createElement("div");
2490
2490
  c.className = "tab-panel", this.contentContainers[a] = c;
2491
- const d = this.settings[a];
2492
- d && (L(d) && typeof d.setNestingLevel == "function" && d.setNestingLevel(this.getNestingLevel() + 1), c.appendChild(
2493
- d.draw()
2491
+ const h = this.settings[a];
2492
+ h && (L(h) && typeof h.setNestingLevel == "function" && h.setNestingLevel(this.getNestingLevel() + 1), c.appendChild(
2493
+ h.draw()
2494
2494
  )), o.appendChild(c), l === 0 && !this.activeTabId && (this.activeTabId = a);
2495
2495
  }), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
2496
2496
  const a = Object.keys(this.settings)[0];
@@ -2499,11 +2499,11 @@ class Ft extends H {
2499
2499
  return this.updateTabUI(), t;
2500
2500
  }
2501
2501
  }
2502
- function Gt(p) {
2503
- return new H(p);
2502
+ function Gt(d) {
2503
+ return new H(d);
2504
2504
  }
2505
- function Ie(p) {
2506
- return p;
2505
+ function Ne(d) {
2506
+ return d;
2507
2507
  }
2508
2508
  class Rt extends w {
2509
2509
  constructor(t = {}) {
@@ -2546,8 +2546,8 @@ class O extends Rt {
2546
2546
  if (e.length !== 3 || e.some(isNaN))
2547
2547
  return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
2548
2548
  const [i, s, n] = e, o = Math.max(0, Math.min(255, i)), a = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (c) => {
2549
- const d = c.toString(16);
2550
- return d.length === 1 ? "0" + d : d;
2549
+ const h = c.toString(16);
2550
+ return h.length === 1 ? "0" + h : h;
2551
2551
  };
2552
2552
  return `#${r(o)}${r(a)}${r(l)}`;
2553
2553
  }
@@ -2607,15 +2607,15 @@ class O extends Rt {
2607
2607
  u.textContent = "No global colors defined", u.style.gridColumn = "1 / -1", u.style.fontSize = "12px", u.style.color = "#666", a.appendChild(u);
2608
2608
  return;
2609
2609
  }
2610
- Object.entries(m).forEach(([u, C]) => {
2610
+ Object.entries(m).forEach(([u, f]) => {
2611
2611
  const v = document.createElement("button");
2612
- v.className = "global-color-btn", v.title = u, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor = C, v.style.cursor = "pointer", this.value === `var(--${u})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (y) => {
2613
- var k, N;
2612
+ v.className = "global-color-btn", v.title = u, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor = f, v.style.cursor = "pointer", this.value === `var(--${u})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (y) => {
2613
+ var k, I;
2614
2614
  y.preventDefault();
2615
2615
  const x = `var(--${u})`;
2616
- this.value = x, (k = this.onChange) == null || k.call(this, x), (N = this.detectChange) == null || N.call(this, x), Array.from(a.children).forEach((E) => {
2616
+ this.value = x, (k = this.onChange) == null || k.call(this, x), (I = this.detectChange) == null || I.call(this, x), Array.from(a.children).forEach((E) => {
2617
2617
  E.style.border = "1px solid #ddd";
2618
- }), v.style.border = "2px solid #2196f3", d.style.backgroundColor = C;
2618
+ }), v.style.border = "2px solid #2196f3", h.style.backgroundColor = f;
2619
2619
  }), a.appendChild(v);
2620
2620
  });
2621
2621
  } catch (m) {
@@ -2635,44 +2635,44 @@ class O extends Rt {
2635
2635
  return v ? e.classList.remove("error") : e.classList.add("error"), v;
2636
2636
  }, c = document.createElement("input");
2637
2637
  c.type = "color", c.className = "color-picker", c.value = this.value && !this.value.startsWith("var(--") ? this.value : "#000000", c.setAttribute("aria-label", "Choose color"), c.setAttribute("title", "Click to open color picker"), this.getDataPropsPath() && c.setAttribute("data-test-id", this.getDataPropsPath()), this.colorInputEl = c;
2638
- const d = document.createElement("div");
2639
- d.className = "color-preview";
2640
- let h = this.value || "#000000";
2641
- if (h.startsWith("var(--")) {
2642
- const m = h.replace("var(--", "").replace(")", "");
2643
- h = (w.GlobalVariables || {})[m] || "#000000";
2638
+ const h = document.createElement("div");
2639
+ h.className = "color-preview";
2640
+ let p = this.value || "#000000";
2641
+ if (p.startsWith("var(--")) {
2642
+ const m = p.replace("var(--", "").replace(")", "");
2643
+ p = (w.GlobalVariables || {})[m] || "#000000";
2644
2644
  }
2645
- d.style.backgroundColor = h;
2645
+ h.style.backgroundColor = p;
2646
2646
  const g = document.createElement("input");
2647
2647
  g.type = "text", g.className = "color-text-input", g.value = this.value || "", g.placeholder = "#000000", g.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), g.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), g.setAttribute("aria-label", "Hex color value"), g.setAttribute("maxlength", "7"), this.getDataPropsPath() && g.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = g;
2648
- const f = (m) => {
2649
- var C, v;
2648
+ const C = (m) => {
2649
+ var f, v;
2650
2650
  let u = m.trim();
2651
2651
  if (u && !u.startsWith("#") && !u.startsWith("var(") && /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(u) && (u = "#" + u, this.textInputEl && (this.textInputEl.value = u)), this.textInputEl && r(this.textInputEl)) {
2652
2652
  const y = O.normalizeColorValue(u);
2653
- this.value = y, (C = this.onChange) == null || C.call(this, y), (v = this.detectChange) == null || v.call(this, y), this.colorInputEl && (this.colorInputEl.value = y), d.style.backgroundColor = y;
2653
+ this.value = y, (f = this.onChange) == null || f.call(this, y), (v = this.detectChange) == null || v.call(this, y), this.colorInputEl && (this.colorInputEl.value = y), h.style.backgroundColor = y;
2654
2654
  }
2655
2655
  };
2656
2656
  return this.textInputEl.addEventListener("input", (m) => {
2657
2657
  const u = m.target.value;
2658
- f(u);
2658
+ C(u);
2659
2659
  }), this.textInputEl.addEventListener("paste", (m) => {
2660
- var C;
2660
+ var f;
2661
2661
  m.preventDefault();
2662
- const u = ((C = m.clipboardData) == null ? void 0 : C.getData("text")) || "";
2663
- this.textInputEl && (this.textInputEl.value = u.trim(), f(u));
2662
+ const u = ((f = m.clipboardData) == null ? void 0 : f.getData("text")) || "";
2663
+ this.textInputEl && (this.textInputEl.value = u.trim(), C(u));
2664
2664
  }), this.textInputEl.addEventListener("keydown", (m) => {
2665
- var u, C, v;
2666
- m.key === "Enter" && (m.preventDefault(), f(((u = this.textInputEl) == null ? void 0 : u.value) || ""), (C = this.textInputEl) == null || C.blur()), m.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (v = this.textInputEl) == null || v.blur(), e.classList.remove("error"));
2665
+ var u, f, v;
2666
+ m.key === "Enter" && (m.preventDefault(), C(((u = this.textInputEl) == null ? void 0 : u.value) || ""), (f = this.textInputEl) == null || f.blur()), m.key === "Escape" && (this.textInputEl && this.value && (this.textInputEl.value = this.value), (v = this.textInputEl) == null || v.blur(), e.classList.remove("error"));
2667
2667
  }), this.colorInputEl.addEventListener("input", (m) => {
2668
2668
  var v, y;
2669
- const u = m.target.value, C = O.normalizeColorValue(u);
2670
- this.value = C, (v = this.onChange) == null || v.call(this, C), (y = this.detectChange) == null || y.call(this, C), this.textInputEl && (this.textInputEl.value = C), d.style.backgroundColor = C, e.classList.remove("error");
2669
+ const u = m.target.value, f = O.normalizeColorValue(u);
2670
+ this.value = f, (v = this.onChange) == null || v.call(this, f), (y = this.detectChange) == null || y.call(this, f), this.textInputEl && (this.textInputEl.value = f), h.style.backgroundColor = f, e.classList.remove("error");
2671
2671
  }), this.colorInputEl.addEventListener("change", (m) => {
2672
2672
  var v, y;
2673
- const u = m.target.value, C = O.normalizeColorValue(u);
2674
- this.value = C, (v = this.onChange) == null || v.call(this, C), (y = this.detectChange) == null || y.call(this, C), this.textInputEl && (this.textInputEl.value = C), d.style.backgroundColor = C;
2675
- }), o.appendChild(c), o.appendChild(d), o.appendChild(g), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
2673
+ const u = m.target.value, f = O.normalizeColorValue(u);
2674
+ this.value = f, (v = this.onChange) == null || v.call(this, f), (y = this.detectChange) == null || y.call(this, f), this.textInputEl && (this.textInputEl.value = f), h.style.backgroundColor = f;
2675
+ }), o.appendChild(c), o.appendChild(h), o.appendChild(g), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
2676
2676
  }
2677
2677
  getElement() {
2678
2678
  return this.element;
@@ -2833,7 +2833,7 @@ class z extends w {
2833
2833
  };
2834
2834
  }
2835
2835
  }
2836
- class Ne extends w {
2836
+ class Ie extends w {
2837
2837
  constructor(t = {}) {
2838
2838
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
2839
2839
  }
@@ -3530,12 +3530,12 @@ const gt = `
3530
3530
  if (t.className = "image-map-setting-wrapper", this.props.title || this.props.icon) {
3531
3531
  const h = document.createElement("div");
3532
3532
  if (h.className = "icon-container", this.props.icon) {
3533
- const g = this.createIcon(this.props.icon);
3534
- h.appendChild(g);
3533
+ const p = this.createIcon(this.props.icon);
3534
+ h.appendChild(p);
3535
3535
  }
3536
3536
  if (this.props.title) {
3537
- const g = this.createLabel(this.props.title);
3538
- h.appendChild(g);
3537
+ const p = this.createLabel(this.props.title);
3538
+ h.appendChild(p);
3539
3539
  }
3540
3540
  t.appendChild(h);
3541
3541
  }
@@ -3553,25 +3553,27 @@ const gt = `
3553
3553
  a.type = "button", a.className = "image-map-delete-btn", a.innerHTML = ie, a.addEventListener("click", (h) => {
3554
3554
  h.stopPropagation(), this.value = { imageUrl: "", markers: [] }, this.updateMainDisplay(), this.triggerChange();
3555
3555
  }), o.appendChild(a), n.appendChild(o);
3556
- const l = document.createElement("label");
3557
- l.className = "image-map-upload-label", l.innerHTML = `
3556
+ const l = document.createElement("button");
3557
+ l.type = "button", l.className = "image-map-upload-label", l.innerHTML = `
3558
3558
  <div class="upload-icon upload-icon-default">${gt}</div>
3559
3559
  <div class="upload-icon upload-icon-replace">${Qt}</div>
3560
3560
  <span class="upload-text">Upload Image</span>
3561
- `;
3562
- const r = document.createElement("input");
3563
- r.type = "file", r.accept = "image/jpeg,image/jpg,image/png,image/gif,image/webp", r.style.display = "none", r.addEventListener("change", (h) => {
3564
- var f;
3565
- const g = (f = h.target.files) == null ? void 0 : f[0];
3566
- g && this.handleImageUpload(g);
3567
- }), l.appendChild(r), n.appendChild(l), i.appendChild(n), e.appendChild(i);
3568
- const c = document.createElement("div");
3569
- c.className = "image-map-section";
3570
- const d = document.createElement("h4");
3571
- return d.className = "image-map-section-title", d.textContent = "Map Setup", c.appendChild(d), this.mainButton = document.createElement("button"), this.mainButton.type = "button", this.mainButton.className = "image-map-button", this.mapIconEl = document.createElement("span"), this.mapIconEl.className = "image-map-icon", this.mapIconEl.innerHTML = mt, this.mainButton.appendChild(this.mapIconEl), this.markerCountEl = document.createElement("span"), this.markerCountEl.className = "image-map-marker-count", this.mainButton.appendChild(this.markerCountEl), this.mainButton.addEventListener("click", () => {
3561
+ `, l.addEventListener("click", () => {
3562
+ window.postMessage(
3563
+ {
3564
+ type: "OPEN_FILE_MANAGER_MODAL",
3565
+ settingId: this.id
3566
+ },
3567
+ "*"
3568
+ );
3569
+ }), n.appendChild(l), i.appendChild(n), e.appendChild(i);
3570
+ const r = document.createElement("div");
3571
+ r.className = "image-map-section";
3572
+ const c = document.createElement("h4");
3573
+ return c.className = "image-map-section-title", c.textContent = "Map Setup", r.appendChild(c), this.mainButton = document.createElement("button"), this.mainButton.type = "button", this.mainButton.className = "image-map-button", this.mapIconEl = document.createElement("span"), this.mapIconEl.className = "image-map-icon", this.mapIconEl.innerHTML = mt, this.mainButton.appendChild(this.mapIconEl), this.markerCountEl = document.createElement("span"), this.markerCountEl.className = "image-map-marker-count", this.mainButton.appendChild(this.markerCountEl), this.mainButton.addEventListener("click", () => {
3572
3574
  var h;
3573
3575
  (h = this.mainButton) != null && h.disabled || this.openPopover();
3574
- }), c.appendChild(this.mainButton), e.appendChild(c), t.appendChild(e), this.createPopover(), this.updateMainDisplay(), t;
3576
+ }), r.appendChild(this.mainButton), e.appendChild(r), t.appendChild(e), this.createPopover(), this.updateMainDisplay(), t;
3575
3577
  }
3576
3578
  updateMainDisplay() {
3577
3579
  var s;
@@ -3651,14 +3653,14 @@ const gt = `
3651
3653
  r.className = "image-map-image-section", this.renderImageMapSection(r);
3652
3654
  const c = document.createElement("div");
3653
3655
  c.className = "prize-list-section", this.renderPrizeList(c), l.appendChild(r), l.appendChild(c), t.appendChild(l);
3654
- const d = this.renderBottomButtons();
3655
- t.appendChild(d);
3656
- const h = r.querySelector(
3656
+ const h = this.renderBottomButtons();
3657
+ t.appendChild(h);
3658
+ const p = r.querySelector(
3657
3659
  ".image-map-container"
3658
3660
  ), g = c.querySelector(
3659
3661
  ".simple-prize-list"
3660
3662
  );
3661
- h && (h.scrollTop = s), g && (g.scrollTop = n);
3663
+ p && (p.scrollTop = s), g && (g.scrollTop = n);
3662
3664
  } else
3663
3665
  this.renderUploadSection(t);
3664
3666
  }
@@ -3692,9 +3694,9 @@ const gt = `
3692
3694
  `;
3693
3695
  const o = document.createElement("input");
3694
3696
  o.type = "file", o.accept = "image/jpeg,image/jpg,image/png,image/gif,image/webp", o.style.display = "none", o.addEventListener("change", (c) => {
3695
- var h;
3696
- const d = (h = c.target.files) == null ? void 0 : h[0];
3697
- d && this.handleImageUpload(d);
3697
+ var p;
3698
+ const h = (p = c.target.files) == null ? void 0 : p[0];
3699
+ h && this.handleImageUpload(h);
3698
3700
  }), n.appendChild(o), s.appendChild(n), e.appendChild(s);
3699
3701
  const a = document.createElement("h4");
3700
3702
  a.className = "upload-section-title", a.textContent = "Map Setup", e.appendChild(a);
@@ -3771,8 +3773,8 @@ const gt = `
3771
3773
  r.className = "done-btn-tooltip";
3772
3774
  const c = document.createElement("div");
3773
3775
  c.className = "done-btn-tooltip-content", c.textContent = "Map all prizes";
3774
- const d = document.createElement("div");
3775
- d.className = "done-btn-tooltip-tail", d.innerHTML = re, r.appendChild(c), r.appendChild(d), o.appendChild(r);
3776
+ const h = document.createElement("div");
3777
+ h.className = "done-btn-tooltip-tail", h.innerHTML = re, r.appendChild(c), r.appendChild(h), o.appendChild(r);
3776
3778
  }
3777
3779
  return s.appendChild(o), s;
3778
3780
  }
@@ -3783,16 +3785,16 @@ const gt = `
3783
3785
  const n = document.createElement("div");
3784
3786
  n.className = "simple-prize-list";
3785
3787
  for (let a = e; a >= 1; a--) {
3786
- const l = s.get(a), r = !!l, c = (l == null ? void 0 : l.prizeName) || this.props.prizeMap && this.props.prizeMap[a - 1] || "Prize Name", d = document.createElement("div");
3787
- d.className = `simple-prize-item ${r ? "placed" : ""}`;
3788
- const h = document.createElement("div");
3789
- h.className = "simple-prize-number", h.textContent = `#${a}`, d.appendChild(h);
3788
+ const l = s.get(a), r = !!l, c = (l == null ? void 0 : l.prizeName) || this.props.prizeMap && this.props.prizeMap[a - 1] || "Prize Name", h = document.createElement("div");
3789
+ h.className = `simple-prize-item ${r ? "placed" : ""}`;
3790
+ const p = document.createElement("div");
3791
+ p.className = "simple-prize-number", p.textContent = `#${a}`, h.appendChild(p);
3790
3792
  const g = document.createElement("div");
3791
- if (g.className = "simple-prize-text", g.textContent = `${c}`, d.appendChild(g), r) {
3792
- const f = document.createElement("div");
3793
- f.className = "simple-prize-check", f.innerHTML = oe, d.appendChild(f);
3793
+ if (g.className = "simple-prize-text", g.textContent = `${c}`, h.appendChild(g), r) {
3794
+ const C = document.createElement("div");
3795
+ C.className = "simple-prize-check", C.innerHTML = oe, h.appendChild(C);
3794
3796
  }
3795
- n.appendChild(d);
3797
+ n.appendChild(h);
3796
3798
  }
3797
3799
  t.appendChild(n);
3798
3800
  }
@@ -3839,20 +3841,20 @@ const gt = `
3839
3841
  if (typeof a == "string") {
3840
3842
  const r = new Image();
3841
3843
  r.onload = () => {
3842
- var h;
3844
+ var p;
3843
3845
  const c = {
3844
3846
  width: r.naturalWidth || 0,
3845
3847
  height: r.naturalHeight || 0
3846
- }, d = this.scaleMarkersForNewImage(
3847
- ((h = this.value) == null ? void 0 : h.markers) || [],
3848
+ }, h = this.scaleMarkersForNewImage(
3849
+ ((p = this.value) == null ? void 0 : p.markers) || [],
3848
3850
  e,
3849
3851
  c
3850
3852
  );
3851
3853
  this.value = {
3852
3854
  imageUrl: a,
3853
- markers: d
3855
+ markers: h
3854
3856
  }, this.lastImageNaturalSize = c, this.history = [
3855
- JSON.parse(JSON.stringify(d))
3857
+ JSON.parse(JSON.stringify(h))
3856
3858
  ], this.historyIndex = 0, this.updateUndoRedoButtons(), this.updateMainDisplay(), this.isPopoverOpen && this.refreshPopoverContent(), this.triggerChange();
3857
3859
  }, r.onerror = () => {
3858
3860
  this.showError("Failed to read image file.");
@@ -3870,7 +3872,7 @@ const gt = `
3870
3872
  );
3871
3873
  return;
3872
3874
  }
3873
- const e = this.imageElement.getBoundingClientRect(), i = (t.clientX - e.left) / e.width * 100, s = (t.clientY - e.top) / e.height * 100, n = this.value.markers.map((c) => c.index).sort((c, d) => c - d);
3875
+ const e = this.imageElement.getBoundingClientRect(), i = (t.clientX - e.left) / e.width * 100, s = (t.clientY - e.top) / e.height * 100, n = this.value.markers.map((c) => c.index).sort((c, h) => c - h);
3874
3876
  let o = 1;
3875
3877
  for (const c of n)
3876
3878
  if (c === o)
@@ -4078,11 +4080,11 @@ const gt = `
4078
4080
  r.type = "button", r.className = "confirm-btn ghost", r.textContent = "Cancel";
4079
4081
  const c = document.createElement("button");
4080
4082
  c.type = "button", c.className = "confirm-btn danger", c.textContent = "Discard";
4081
- const d = (h) => {
4082
- s.remove(), this.confirmOverlayEl = null, this.confirmPromise = null, i(h);
4083
+ const h = (p) => {
4084
+ s.remove(), this.confirmOverlayEl = null, this.confirmPromise = null, i(p);
4083
4085
  };
4084
- r.addEventListener("click", () => d(!1)), c.addEventListener("click", () => d(!0)), s.addEventListener("click", (h) => {
4085
- h.target === s && d(!1);
4086
+ r.addEventListener("click", () => h(!1)), c.addEventListener("click", () => h(!0)), s.addEventListener("click", (p) => {
4087
+ p.target === s && h(!1);
4086
4088
  }), l.appendChild(r), l.appendChild(c), n.appendChild(o), n.appendChild(a), n.appendChild(l), s.appendChild(n), document.body.appendChild(s), setTimeout(() => {
4087
4089
  n.classList.add("visible");
4088
4090
  }, 10);
@@ -4317,7 +4319,7 @@ class Pe extends w {
4317
4319
  const s = document.createElement("input");
4318
4320
  s.type = "checkbox", s.checked = ((a = (o = this.props.options) == null ? void 0 : o.find((l) => l.value === this.value)) == null ? void 0 : a.status) ?? !1, this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), s.addEventListener("change", () => {
4319
4321
  var r, c;
4320
- const l = ((c = (r = this.props.options) == null ? void 0 : r.find((d) => d.status === s.checked)) == null ? void 0 : c.value) ?? "";
4322
+ const l = ((c = (r = this.props.options) == null ? void 0 : r.find((h) => h.status === s.checked)) == null ? void 0 : c.value) ?? "";
4321
4323
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
4322
4324
  });
4323
4325
  const n = document.createElement("span");
@@ -4468,13 +4470,13 @@ class $e extends w {
4468
4470
  return;
4469
4471
  }
4470
4472
  const c = "...";
4471
- let d = 0, h = e.length, g = 0;
4472
- for (; d <= h; ) {
4473
- const m = Math.floor((d + h) / 2), u = e.slice(0, m).trimEnd() + c;
4474
- this.measureTextWidth(u, i) <= l ? (g = m, d = m + 1) : h = m - 1;
4473
+ let h = 0, p = e.length, g = 0;
4474
+ for (; h <= p; ) {
4475
+ const m = Math.floor((h + p) / 2), u = e.slice(0, m).trimEnd() + c;
4476
+ this.measureTextWidth(u, i) <= l ? (g = m, h = m + 1) : p = m - 1;
4475
4477
  }
4476
- const f = e.slice(0, g).trimEnd() + c;
4477
- t.placeholder = f;
4478
+ const C = e.slice(0, g).trimEnd() + c;
4479
+ t.placeholder = C;
4478
4480
  }
4479
4481
  autosizeTextarea(t, e = 3) {
4480
4482
  t.style.height = "auto";
@@ -5044,7 +5046,7 @@ export {
5044
5046
  j as GradientSetting,
5045
5047
  Fe as HeaderTypographySettingSet,
5046
5048
  ce as HeightSetting,
5047
- Ne as HtmlSetting,
5049
+ Ie as HtmlSetting,
5048
5050
  vt as ImageMapSetting,
5049
5051
  ze as ImageSettingSet,
5050
5052
  He as MarginBottomSetting,
@@ -5063,7 +5065,7 @@ export {
5063
5065
  Pe as Toggle,
5064
5066
  lt as UploadSetting,
5065
5067
  de as WidthSetting,
5066
- Ie as asSettingGroupWithSettings,
5068
+ Ne as asSettingGroupWithSettings,
5067
5069
  Gt as createSettingGroup,
5068
5070
  Me as createTabSettingGroup,
5069
5071
  F as isSetting,