builder-settings-types 0.0.307 → 0.0.309

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,8 +1,8 @@
1
- const ft = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1
+ const vt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
2
  let rt = (h = 21) => {
3
3
  let t = "", e = crypto.getRandomValues(new Uint8Array(h |= 0));
4
4
  for (; h--; )
5
- t += ft[e[h] & 63];
5
+ t += vt[e[h] & 63];
6
6
  return t;
7
7
  };
8
8
  function Ct(h) {
@@ -142,18 +142,18 @@ function Et(h) {
142
142
  return "";
143
143
  }
144
144
  }
145
- const A = class A {
145
+ const B = class B {
146
146
  constructor(t = {}) {
147
147
  this.props = t, this.dataPropsPath = "", this.id = t.id || rt(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
148
148
  }
149
149
  static SetUploadUrl(t) {
150
- globalThis.DefaultUploadUrl = t, A.DefaultUploadUrl = t;
150
+ globalThis.DefaultUploadUrl = t, B.DefaultUploadUrl = t;
151
151
  }
152
152
  static SetDefaultLanguage(t) {
153
- globalThis.DefaultLanguage = t, A.DefaultLanguage = t;
153
+ globalThis.DefaultLanguage = t, B.DefaultLanguage = t;
154
154
  }
155
155
  static SetGlobalVariables(t) {
156
- A.GlobalVariables = { ...A.GlobalVariables, ...t };
156
+ B.GlobalVariables = { ...B.GlobalVariables, ...t };
157
157
  }
158
158
  destroy() {
159
159
  throw new Error("Method not implemented.");
@@ -181,23 +181,23 @@ const A = class A {
181
181
  t = { ...this.props.inputProps, ...t };
182
182
  const e = document.createElement("div");
183
183
  if (e.className = t.wrapperClassName || "", t.title || t.icon) {
184
- const a = document.createElement("div");
185
- if (a.className = "icon-container", t.icon) {
184
+ const o = document.createElement("div");
185
+ if (o.className = "icon-container", t.icon) {
186
186
  const l = this.createIcon(t.icon, t.iconClassName);
187
- a.appendChild(l);
187
+ o.appendChild(l);
188
188
  }
189
189
  if (t.title) {
190
190
  const l = this.createLabel(t.title, t.labelClassName);
191
- a.appendChild(l);
191
+ o.appendChild(l);
192
192
  }
193
- e.appendChild(a);
193
+ e.appendChild(o);
194
194
  }
195
195
  const i = document.createElement("div");
196
196
  i.className = t.wrapperClassName || "";
197
197
  const s = document.createElement("input");
198
198
  this.inputEl = s, s.value = String(t.value || Et(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
199
- const n = (a) => {
200
- const l = a.target;
199
+ const n = (o) => {
200
+ const l = o.target;
201
201
  let r = l.value;
202
202
  switch (t.inputType) {
203
203
  case "number":
@@ -222,10 +222,10 @@ const A = class A {
222
222
  r = l.value;
223
223
  }
224
224
  this.value = r, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
225
- }, o = (a) => {
226
- a.target, this.onBlur && this.onBlur(this.value);
225
+ }, a = (o) => {
226
+ o.target, this.onBlur && this.onBlur(this.value);
227
227
  };
228
- return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", o), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
228
+ return s.addEventListener("input", n), s.addEventListener("change", n), s.addEventListener("blur", a), t.inputCustomizer && t.inputCustomizer(s), i.appendChild(s), e.appendChild(i), e;
229
229
  }
230
230
  createLabel(t, e) {
231
231
  const i = document.createElement("span");
@@ -236,7 +236,7 @@ const A = class A {
236
236
  return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
237
237
  }
238
238
  };
239
- A.GlobalVariables = {
239
+ B.GlobalVariables = {
240
240
  // Global Colors (each supports solid OR gradient)
241
241
  primary: "#00141E",
242
242
  secondary: "#00141E",
@@ -246,15 +246,15 @@ A.GlobalVariables = {
246
246
  "text-dark": "#00141E",
247
247
  "text-light": "#00141E"
248
248
  };
249
- let x = A;
250
- function D(h) {
249
+ let x = B;
250
+ function A(h) {
251
251
  return h instanceof x;
252
252
  }
253
- function M(h) {
253
+ function L(h) {
254
254
  return h instanceof H;
255
255
  }
256
256
  function nt(h) {
257
- return D(h) || M(h);
257
+ return A(h) || L(h);
258
258
  }
259
259
  function z(h, t) {
260
260
  for (const e in h)
@@ -271,7 +271,7 @@ const K = class K {
271
271
  propagateNestingLevel() {
272
272
  const t = this.nestingLevel + 1;
273
273
  z(this.settings, (e, i) => {
274
- M(i) && (i.nestingLevel = t, i.propagateNestingLevel());
274
+ L(i) && (i.nestingLevel = t, i.propagateNestingLevel());
275
275
  });
276
276
  }
277
277
  getNestingLevel() {
@@ -289,7 +289,7 @@ const K = class K {
289
289
  propagateDataPropsPath() {
290
290
  z(this.settings, (t, e) => {
291
291
  const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
292
- (M(e) || D(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
292
+ (L(e) || A(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
293
293
  });
294
294
  }
295
295
  updateNestingStyles() {
@@ -298,7 +298,7 @@ const K = class K {
298
298
  forceChildUIRefresh() {
299
299
  Object.entries(this.settings).forEach(([t, e]) => {
300
300
  try {
301
- if (M(e)) {
301
+ if (L(e)) {
302
302
  const i = e.getValues();
303
303
  e.setValue(i);
304
304
  } else if (typeof e.setValue == "function") {
@@ -321,13 +321,21 @@ const K = class K {
321
321
  ".setting-group-content"
322
322
  );
323
323
  if (n) {
324
- const o = Array.from(
325
- n.querySelectorAll(".setting-group, .setting")
324
+ const a = Array.from(
325
+ n.querySelectorAll(
326
+ ".setting-group, .setting, [data-setting-id]"
327
+ )
326
328
  );
327
- for (const a of o) {
328
- const l = a.id;
329
+ for (const o of a) {
330
+ const l = o.id, r = o.getAttribute(
331
+ "data-setting-id"
332
+ );
329
333
  if (l && "id" in e && typeof e.id == "string" && l.includes(e.id)) {
330
- a.remove();
334
+ o.remove();
335
+ break;
336
+ }
337
+ if (r && "id" in e && typeof e.id == "string" && r === e.id) {
338
+ o.remove();
331
339
  break;
332
340
  }
333
341
  }
@@ -340,13 +348,38 @@ const K = class K {
340
348
  updateVisibility() {
341
349
  this.elementRef;
342
350
  }
351
+ updateSettings(t) {
352
+ var a;
353
+ const e = new Set(Object.keys(this.settings)), i = Object.keys(t), s = {};
354
+ i.forEach((o) => {
355
+ const l = this.settings[o];
356
+ l && (L(l) ? s[o] = l.getValues() : A(l) ? s[o] = l.value : typeof l.getValues == "function" ? s[o] = l.getValues() : l.value !== void 0 && (s[o] = l.value));
357
+ }), e.forEach((o) => {
358
+ i.includes(o) || this.removeSetting(o);
359
+ }), i.forEach((o) => {
360
+ var p;
361
+ const l = t[o], r = this.settings[o];
362
+ if (r !== l && (r && this.removeSetting(o), this.addSetting(o, l), o in s)) {
363
+ const c = s[o];
364
+ try {
365
+ L(l) ? l.setValue(
366
+ c
367
+ ) : A(l) ? (p = l.setValue) == null || p.call(l, c) : l.setValue && l.setValue(c);
368
+ } catch (d) {
369
+ console.warn(`Could not preserve value for setting ${o}:`, d);
370
+ }
371
+ }
372
+ }), this.settings = t, this.propagateNestingLevel(), this.propagateDataPropsPath();
373
+ const n = this.getValues();
374
+ this.initialValues = n, (a = this.onChange) == null || a.call(this, n);
375
+ }
343
376
  clone() {
344
377
  const t = {};
345
378
  z(this.settings, (s, n) => {
346
- const o = String(s);
347
- typeof n.clone == "function" ? t[o] = n.clone() : (console.warn(
348
- `Setting with key '${o}' does not have a clone method. Copying reference.`
349
- ), t[o] = n);
379
+ const a = String(s);
380
+ typeof n.clone == "function" ? t[a] = n.clone() : (console.warn(
381
+ `Setting with key '${a}' does not have a clone method. Copying reference.`
382
+ ), t[a] = n);
350
383
  });
351
384
  const e = {
352
385
  title: this.title,
@@ -369,7 +402,7 @@ const K = class K {
369
402
  setMobileValues(t) {
370
403
  !t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
371
404
  const s = this.settings[e];
372
- s && (M(s) || D(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
405
+ s && (L(s) || A(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
373
406
  }), this.setValue(t), this.onChange && this.onChange(this.getValues()));
374
407
  }
375
408
  getMobileValues(t) {
@@ -378,7 +411,7 @@ const K = class K {
378
411
  for (const i in this.settings)
379
412
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
380
413
  const s = this.settings[i];
381
- if (M(s))
414
+ if (L(s))
382
415
  e[i] = s.getMobileValues();
383
416
  else {
384
417
  const n = s;
@@ -389,7 +422,7 @@ const K = class K {
389
422
  } else {
390
423
  const e = this.settings[t];
391
424
  if (!e) return;
392
- if (M(e)) return e.getMobileValues();
425
+ if (L(e)) return e.getMobileValues();
393
426
  const i = e;
394
427
  return i.mobileValue !== void 0 ? i.mobileValue : i.value;
395
428
  }
@@ -407,17 +440,17 @@ const K = class K {
407
440
  };
408
441
  return this.changeHandlers.clear(), z(this.settings, (i, s) => {
409
442
  var n;
410
- if (M(s))
443
+ if (L(s))
411
444
  s.setOnChange(() => {
412
- const o = this.getValues();
413
- this.initialValues = o, t(o);
445
+ const a = this.getValues();
446
+ this.initialValues = a, t(a);
414
447
  }), this.changeHandlers.add(() => t(this.getValues()));
415
- else if (D(s)) {
416
- const o = () => e();
417
- this.changeHandlers.add(o), s.setOnChange(o);
448
+ else if (A(s)) {
449
+ const a = () => e();
450
+ this.changeHandlers.add(a), s.setOnChange(a);
418
451
  } else {
419
- const o = () => e();
420
- this.changeHandlers.add(o), (n = s.setOnChange) == null || n.call(s, o);
452
+ const a = () => e();
453
+ this.changeHandlers.add(a), (n = s.setOnChange) == null || n.call(s, a);
421
454
  }
422
455
  }), this;
423
456
  }
@@ -432,13 +465,13 @@ const K = class K {
432
465
  Object.entries(t).forEach(([i, s]) => {
433
466
  let n = this.settings[i];
434
467
  if (!n && this.addItemCfg && i.startsWith(this.addItemCfg.keyPrefix)) {
435
- const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
436
- if (Number.isFinite(a)) {
437
- const l = this.addItemCfg.createItem(a);
468
+ const a = i.slice(this.addItemCfg.keyPrefix.length), o = Number(a);
469
+ if (Number.isFinite(o)) {
470
+ const l = this.addItemCfg.createItem(o);
438
471
  nt(l) && (this.addSetting(i, l), n = l);
439
472
  }
440
473
  }
441
- n && (M(n) || D(n)) && typeof n.setValue == "function" && n.setValue(s);
474
+ n && (L(n) || A(n)) && typeof n.setValue == "function" && n.setValue(s);
442
475
  }), setTimeout(() => {
443
476
  this.forceChildUIRefresh();
444
477
  }, 0);
@@ -452,25 +485,25 @@ const K = class K {
452
485
  const s = this.getValues();
453
486
  this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
454
487
  };
455
- M(t) ? t.setOnChange(() => e()) : D(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
488
+ L(t) ? t.setOnChange(() => e()) : A(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
456
489
  }
457
490
  addSetting(t, e) {
458
491
  var s, n;
459
492
  if (this.settings[t] = e, this.wireChild(e), this.elementRef) {
460
- const o = this.elementRef.querySelector(
493
+ const a = this.elementRef.querySelector(
461
494
  ".setting-group-content"
462
495
  );
463
- if (o) {
464
- M(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
465
- const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
496
+ if (a) {
497
+ L(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
498
+ const o = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
466
499
  if (l) {
467
500
  const c = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
468
- c && t.startsWith(c) && this.addDeleteButtonToElement(a, t);
501
+ c && t.startsWith(c) && this.addDeleteButtonToElement(o, t);
469
502
  }
470
- const r = o.querySelector(".sg-add-button-bottom");
471
- r ? o.insertBefore(a, r) : o.appendChild(a), st.trackElement(a), q(a, this.nestingLevel + 1), Q(a, this.nestingLevel + 1);
472
- const p = a.style.display;
473
- a.style.display = "none", a.offsetHeight, a.style.display = p, this.updateNestingStyles();
503
+ const r = a.querySelector(".sg-add-button-bottom");
504
+ r ? a.insertBefore(o, r) : a.appendChild(o), st.trackElement(o), q(o, this.nestingLevel + 1), Q(o, this.nestingLevel + 1);
505
+ const p = o.style.display;
506
+ o.style.display = "none", o.offsetHeight, o.style.display = p, this.updateNestingStyles();
474
507
  }
475
508
  }
476
509
  const i = this.getValues();
@@ -497,8 +530,8 @@ const K = class K {
497
530
  if (!s) return;
498
531
  const n = s.querySelector(".actions-section");
499
532
  if (!n) return;
500
- const o = document.createElement("button");
501
- o.type = "button", o.className = "sg-delete-button", i ? i.deleteItemCfg : this.deleteItemCfg ?? this.addItemCfg, o.title = "Delete", o.style.cssText = `
533
+ const a = document.createElement("button");
534
+ a.type = "button", a.className = "sg-delete-button", i ? i.deleteItemCfg : this.deleteItemCfg ?? this.addItemCfg, a.title = "Delete", a.style.cssText = `
502
535
  background: none;
503
536
  border: none;
504
537
  cursor: pointer;
@@ -511,23 +544,23 @@ const K = class K {
511
544
  border-radius: 4px;
512
545
  transition: background-color 0.2s;
513
546
  `;
514
- const a = `
547
+ const o = `
515
548
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
516
549
  <path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
517
550
  <path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
518
551
  </svg>
519
552
  `;
520
- o.innerHTML = a, o.addEventListener("mouseenter", () => {
521
- o.style.backgroundColor = "#fef2f2";
522
- }), o.addEventListener("mouseleave", () => {
523
- o.style.backgroundColor = "transparent";
524
- }), o.addEventListener("click", (r) => {
553
+ a.innerHTML = o, a.addEventListener("mouseenter", () => {
554
+ a.style.backgroundColor = "#fef2f2";
555
+ }), a.addEventListener("mouseleave", () => {
556
+ a.style.backgroundColor = "transparent";
557
+ }), a.addEventListener("click", (r) => {
525
558
  r.stopPropagation(), r.preventDefault(), this.showDeleteConfirmation().then((p) => {
526
559
  p && (i && i.deleteItemCfg ? this.removeSetting(e) : this.removeSetting(e));
527
560
  });
528
561
  });
529
562
  const l = n.querySelector(".setting-group-arrow");
530
- l ? n.insertBefore(o, l) : n.appendChild(o);
563
+ l ? n.insertBefore(a, l) : n.appendChild(a);
531
564
  }
532
565
  showDeleteConfirmation() {
533
566
  return new Promise((t) => {
@@ -570,14 +603,14 @@ const K = class K {
570
603
  font-size: 14px;
571
604
  line-height: 1.5;
572
605
  `;
573
- const o = document.createElement("div");
574
- o.style.cssText = `
606
+ const a = document.createElement("div");
607
+ a.style.cssText = `
575
608
  display: flex;
576
609
  gap: 12px;
577
610
  justify-content: flex-end;
578
611
  `;
579
- const a = document.createElement("button");
580
- a.textContent = "Cancel", a.type = "button", a.style.cssText = `
612
+ const o = document.createElement("button");
613
+ o.textContent = "Cancel", o.type = "button", o.style.cssText = `
581
614
  padding: 8px 16px;
582
615
  border: 1px solid #d1d5db;
583
616
  background: white;
@@ -599,10 +632,10 @@ const K = class K {
599
632
  font-weight: 500;
600
633
  cursor: pointer;
601
634
  transition: all 0.2s;
602
- `, a.addEventListener("mouseenter", () => {
603
- a.style.backgroundColor = "#f9fafb", a.style.borderColor = "#9ca3af";
604
- }), a.addEventListener("mouseleave", () => {
605
- a.style.backgroundColor = "white", a.style.borderColor = "#d1d5db";
635
+ `, o.addEventListener("mouseenter", () => {
636
+ o.style.backgroundColor = "#f9fafb", o.style.borderColor = "#9ca3af";
637
+ }), o.addEventListener("mouseleave", () => {
638
+ o.style.backgroundColor = "white", o.style.borderColor = "#d1d5db";
606
639
  }), l.addEventListener("mouseenter", () => {
607
640
  l.style.backgroundColor = "#dc2626";
608
641
  }), l.addEventListener("mouseleave", () => {
@@ -613,7 +646,7 @@ const K = class K {
613
646
  e.parentNode && e.parentNode.removeChild(e);
614
647
  }, 200);
615
648
  };
616
- a.addEventListener("click", () => {
649
+ o.addEventListener("click", () => {
617
650
  r(), t(!1);
618
651
  }), l.addEventListener("click", () => {
619
652
  r(), t(!0);
@@ -623,7 +656,7 @@ const K = class K {
623
656
  const p = (c) => {
624
657
  c.key === "Escape" && (r(), t(!1), document.removeEventListener("keydown", p));
625
658
  };
626
- document.addEventListener("keydown", p), o.appendChild(a), o.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(o), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
659
+ document.addEventListener("keydown", p), a.appendChild(o), a.appendChild(l), i.appendChild(s), i.appendChild(n), i.appendChild(a), e.appendChild(i), document.body.appendChild(e), requestAnimationFrame(() => {
627
660
  e.style.opacity = "1", i.style.transform = "scale(1)";
628
661
  }), setTimeout(() => l.focus(), 100);
629
662
  });
@@ -641,8 +674,8 @@ const K = class K {
641
674
  ...Object.keys(t),
642
675
  ...Object.keys(e)
643
676
  ])).forEach((n) => {
644
- const o = t[n], a = e[n];
645
- JSON.stringify(o) !== JSON.stringify(a) && (i[n] = { from: o, to: a });
677
+ const a = t[n], o = e[n];
678
+ JSON.stringify(a) !== JSON.stringify(o) && (i[n] = { from: a, to: o });
646
679
  }), i;
647
680
  }
648
681
  getValues(t) {
@@ -651,7 +684,7 @@ const K = class K {
651
684
  for (const i in this.settings)
652
685
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
653
686
  const s = this.settings[i];
654
- if (M(s))
687
+ if (L(s))
655
688
  e[i] = s.getValues();
656
689
  else {
657
690
  const n = s;
@@ -662,7 +695,7 @@ const K = class K {
662
695
  } else {
663
696
  const e = this.settings[t];
664
697
  if (!e) return;
665
- if (M(e)) return e.getValues();
698
+ if (L(e)) return e.getValues();
666
699
  const i = e;
667
700
  return i.getValue ? i.getValue() : i.value;
668
701
  }
@@ -675,19 +708,19 @@ const K = class K {
675
708
  for (const s in this.settings)
676
709
  if (Object.prototype.hasOwnProperty.call(this.settings, s)) {
677
710
  const n = this.settings[s];
678
- if (M(n)) {
679
- const o = n.getValuesForJson();
680
- o !== null && (i[s] = o);
711
+ if (L(n)) {
712
+ const a = n.getValuesForJson();
713
+ a !== null && (i[s] = a);
681
714
  } else {
682
- const o = n;
683
- o.includeGetJson !== !1 && (i[s] = o.value);
715
+ const a = n;
716
+ a.includeGetJson !== !1 && (i[s] = a.value);
684
717
  }
685
718
  }
686
719
  return (this.hide === !0 || ((e = this == null ? void 0 : this.groupProps) == null ? void 0 : e.hide) === !0) && (i.hide = !0), i;
687
720
  } else {
688
721
  const i = this.settings[t];
689
722
  if (!i) return;
690
- if (M(i))
723
+ if (L(i))
691
724
  return i.includeGetJson === !1 ? null : i.getValuesForJson();
692
725
  {
693
726
  const s = i;
@@ -701,7 +734,7 @@ const K = class K {
701
734
  for (const i in this.settings)
702
735
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
703
736
  const s = this.settings[i];
704
- if (M(s))
737
+ if (L(s))
705
738
  e[i] = s.getDefaultValues();
706
739
  else {
707
740
  const n = s;
@@ -712,7 +745,7 @@ const K = class K {
712
745
  } else {
713
746
  const e = this.settings[t];
714
747
  if (!e) return;
715
- if (M(e)) return e.getDefaultValues();
748
+ if (L(e)) return e.getDefaultValues();
716
749
  const i = e;
717
750
  return i.default !== void 0 ? i.default : i.value;
718
751
  }
@@ -731,16 +764,16 @@ const K = class K {
731
764
  s.textContent = this.title, i.appendChild(s);
732
765
  const n = document.createElement("div");
733
766
  n.className = "actions-section";
734
- const o = document.createElement("span");
735
- o.className = "setting-group-arrow", o.innerHTML = `
767
+ const a = document.createElement("span");
768
+ a.className = "setting-group-arrow", a.innerHTML = `
736
769
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
737
770
  <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
738
771
  </svg>
739
- `, this.isCollapsed && o.classList.add("rotated"), n.appendChild(o);
740
- const a = document.createElement("div");
741
- a.className = "setting-group-content", this.isCollapsed && (a.classList.add("collapsed"), e.classList.add("collapsed-view"), o.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && a.classList.add("main-content");
772
+ `, this.isCollapsed && a.classList.add("rotated"), n.appendChild(a);
773
+ const o = document.createElement("div");
774
+ o.className = "setting-group-content", this.isCollapsed && (o.classList.add("collapsed"), e.classList.add("collapsed-view"), a.classList.add("rotated"), t.classList.add("collapsed")), this.isMain && o.classList.add("main-content");
742
775
  const l = () => {
743
- this.isCollapsed = !this.isCollapsed, a.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), o.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
776
+ this.isCollapsed = !this.isCollapsed, o.classList.toggle("collapsed"), e.classList.toggle("collapsed-view"), a.classList.toggle("rotated"), t.classList.toggle("collapsed", this.isCollapsed), e.setAttribute(
744
777
  "aria-expanded",
745
778
  (!this.isCollapsed).toString()
746
779
  );
@@ -751,17 +784,17 @@ const K = class K {
751
784
  for (const p in this.settings)
752
785
  if (Object.prototype.hasOwnProperty.call(this.settings, p)) {
753
786
  const c = this.settings[p];
754
- M(c) && typeof c.setNestingLevel == "function" && c.setNestingLevel(this.nestingLevel + 1);
787
+ L(c) && typeof c.setNestingLevel == "function" && c.setNestingLevel(this.nestingLevel + 1);
755
788
  const d = c.draw();
756
- M(c) && c.deleteItemCfg && this.addDeleteButtonToElement(
789
+ L(c) && c.deleteItemCfg && this.addDeleteButtonToElement(
757
790
  d,
758
791
  p,
759
792
  c
760
- ), a.appendChild(d);
793
+ ), o.appendChild(d);
761
794
  }
762
795
  } else {
763
796
  const p = document.createElement("div");
764
- p.className = "setting-group-empty", p.textContent = "No settings in this group", a.appendChild(p);
797
+ p.className = "setting-group-empty", p.textContent = "No settings in this group", o.appendChild(p);
765
798
  }
766
799
  if (this.addItemCfg) {
767
800
  const p = document.createElement("button");
@@ -776,12 +809,12 @@ const K = class K {
776
809
  d.stopPropagation(), d.preventDefault();
777
810
  const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), g = this.addItemCfg.createItem(u);
778
811
  if (nt(g)) {
779
- const v = `${this.addItemCfg.keyPrefix}${u}`;
780
- this.addSetting(v, g);
812
+ const f = `${this.addItemCfg.keyPrefix}${u}`;
813
+ this.addSetting(f, g);
781
814
  }
782
- }), a.appendChild(p);
815
+ }), o.appendChild(p);
783
816
  }
784
- return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, st.trackElement(t), setTimeout(() => {
817
+ return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(o), this.elementRef = t, st.trackElement(t), setTimeout(() => {
785
818
  this.updateNestingStyles();
786
819
  }, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
787
820
  }
@@ -812,10 +845,10 @@ const K = class K {
812
845
  let i = e;
813
846
  const s = Object.keys(this.settings), n = Object.keys(e);
814
847
  if (!s.some(
815
- (a) => n.includes(a)
848
+ (o) => n.includes(o)
816
849
  ) && n.length === 1) {
817
- const a = n[0];
818
- i = e[a];
850
+ const o = n[0];
851
+ i = e[o];
819
852
  }
820
853
  this.setValue(i);
821
854
  } catch (e) {
@@ -862,19 +895,19 @@ class wt extends H {
862
895
  s.textContent = this.title, i.appendChild(s);
863
896
  const n = document.createElement("div");
864
897
  n.className = "tabs-header", this.tabsContainer = n;
865
- const o = document.createElement("div");
866
- if (o.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((a, l) => {
898
+ const a = document.createElement("div");
899
+ if (a.className = "tab-content", this.contentContainers = {}, Object.keys(this.settings).forEach((o, l) => {
867
900
  const r = document.createElement("button");
868
- 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);
901
+ r.className = "tab-button", r.type = "button", r.setAttribute("data-tab-id", o), r.textContent = o, r.addEventListener("click", () => this.switchToTab(o)), n.appendChild(r);
869
902
  const p = document.createElement("div");
870
- p.className = "tab-panel", this.contentContainers[a] = p;
871
- const c = this.settings[a];
872
- c && (M(c) && typeof c.setNestingLevel == "function" && c.setNestingLevel(this.getNestingLevel() + 1), p.appendChild(
903
+ p.className = "tab-panel", this.contentContainers[o] = p;
904
+ const c = this.settings[o];
905
+ c && (L(c) && typeof c.setNestingLevel == "function" && c.setNestingLevel(this.getNestingLevel() + 1), p.appendChild(
873
906
  c.draw()
874
- )), o.appendChild(p), l === 0 && !this.activeTabId && (this.activeTabId = a);
875
- }), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
876
- const a = Object.keys(this.settings)[0];
877
- this.activeTabId = a || "";
907
+ )), a.appendChild(p), l === 0 && !this.activeTabId && (this.activeTabId = o);
908
+ }), e.appendChild(i), e.appendChild(n), e.appendChild(a), !this.activeTabId) {
909
+ const o = Object.keys(this.settings)[0];
910
+ this.activeTabId = o || "";
878
911
  }
879
912
  return this.updateTabUI(), t;
880
913
  }
@@ -925,11 +958,11 @@ class N extends Lt {
925
958
  const e = t.split(",").map((p) => parseInt(p.trim()));
926
959
  if (e.length !== 3 || e.some(isNaN))
927
960
  return console.warn(`Invalid RGB value "${t}", using default "#000000"`), "#000000";
928
- 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 = (p) => {
961
+ const [i, s, n] = e, a = Math.max(0, Math.min(255, i)), o = Math.max(0, Math.min(255, s)), l = Math.max(0, Math.min(255, n)), r = (p) => {
929
962
  const c = p.toString(16);
930
963
  return c.length === 1 ? "0" + c : c;
931
964
  };
932
- return `#${r(o)}${r(a)}${r(l)}`;
965
+ return `#${r(a)}${r(o)}${r(l)}`;
933
966
  }
934
967
  setValue(t) {
935
968
  if (t === void 0) {
@@ -952,12 +985,12 @@ class N extends Lt {
952
985
  if (t.className = "color-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
953
986
  const g = document.createElement("div");
954
987
  if (g.className = "icon-container", this.props.icon) {
955
- const v = document.createElement("span");
956
- v.className = "input-icon", v.innerHTML = this.props.icon, g.appendChild(v);
988
+ const f = document.createElement("span");
989
+ f.className = "input-icon", f.innerHTML = this.props.icon, g.appendChild(f);
957
990
  }
958
991
  if (this.props.title) {
959
- const v = document.createElement("span");
960
- v.className = "input-label", v.textContent = this.props.title, g.appendChild(v);
992
+ const f = document.createElement("span");
993
+ f.className = "input-label", f.textContent = this.props.title, g.appendChild(f);
961
994
  }
962
995
  t.appendChild(g);
963
996
  }
@@ -969,50 +1002,50 @@ class N extends Lt {
969
1002
  s.className = "color-tab active", s.textContent = "Solid";
970
1003
  const n = document.createElement("button");
971
1004
  n.className = "color-tab", n.textContent = "Global", i.appendChild(s), i.appendChild(n);
972
- const o = document.createElement("div");
973
- o.className = "color-content-solid";
974
1005
  const a = document.createElement("div");
975
- a.className = "color-content-global", a.style.display = "none", a.style.display = "grid", a.style.gridTemplateColumns = "repeat(auto-fill, minmax(30px, 1fr))", a.style.gap = "8px";
1006
+ a.className = "color-content-solid";
1007
+ const o = document.createElement("div");
1008
+ o.className = "color-content-global", o.style.display = "none", o.style.display = "grid", o.style.gridTemplateColumns = "repeat(auto-fill, minmax(30px, 1fr))", o.style.gap = "8px";
976
1009
  const l = () => {
977
1010
  try {
978
- if (console.log("ColorSetting: renderGlobalOptions called"), a.innerHTML = "", !x) {
1011
+ if (console.log("ColorSetting: renderGlobalOptions called"), o.innerHTML = "", !x) {
979
1012
  console.error("ColorSetting: Setting class is undefined");
980
- const v = document.createElement("div");
981
- v.textContent = "Error: System error (Setting undefined)", a.appendChild(v);
1013
+ const f = document.createElement("div");
1014
+ f.textContent = "Error: System error (Setting undefined)", o.appendChild(f);
982
1015
  return;
983
1016
  }
984
1017
  const g = x.GlobalVariables || {};
985
1018
  if (console.log("ColorSetting: GlobalVariables:", g), !g || Object.keys(g).length === 0) {
986
- const v = document.createElement("div");
987
- v.textContent = "No global colors defined", v.style.gridColumn = "1 / -1", v.style.fontSize = "12px", v.style.color = "#666", a.appendChild(v);
1019
+ const f = document.createElement("div");
1020
+ f.textContent = "No global colors defined", f.style.gridColumn = "1 / -1", f.style.fontSize = "12px", f.style.color = "#666", o.appendChild(f);
988
1021
  return;
989
1022
  }
990
- Object.entries(g).forEach(([v, m]) => {
991
- const f = document.createElement("button");
992
- f.className = "global-color-btn", f.title = v, f.style.width = "30px", f.style.height = "30px", f.style.borderRadius = "50%", f.style.border = "1px solid #ddd", f.style.backgroundColor = m, f.style.cursor = "pointer", this.value === `var(--${v})` && (f.style.border = "2px solid #2196f3"), f.addEventListener("click", (C) => {
993
- var E, k;
1023
+ Object.entries(g).forEach(([f, m]) => {
1024
+ const v = document.createElement("button");
1025
+ v.className = "global-color-btn", v.title = f, v.style.width = "30px", v.style.height = "30px", v.style.borderRadius = "50%", v.style.border = "1px solid #ddd", v.style.backgroundColor = m, v.style.cursor = "pointer", this.value === `var(--${f})` && (v.style.border = "2px solid #2196f3"), v.addEventListener("click", (C) => {
1026
+ var E, M;
994
1027
  C.preventDefault();
995
- const w = `var(--${v})`;
996
- this.value = w, (E = this.onChange) == null || E.call(this, w), (k = this.detectChange) == null || k.call(this, w), Array.from(a.children).forEach((y) => {
1028
+ const w = `var(--${f})`;
1029
+ this.value = w, (E = this.onChange) == null || E.call(this, w), (M = this.detectChange) == null || M.call(this, w), Array.from(o.children).forEach((y) => {
997
1030
  y.style.border = "1px solid #ddd";
998
- }), f.style.border = "2px solid #2196f3", c.style.backgroundColor = m;
999
- }), a.appendChild(f);
1031
+ }), v.style.border = "2px solid #2196f3", c.style.backgroundColor = m;
1032
+ }), o.appendChild(v);
1000
1033
  });
1001
1034
  } catch (g) {
1002
- console.error("ColorSetting: Error in renderGlobalOptions", g), a.innerHTML = "Error loading global options";
1035
+ console.error("ColorSetting: Error in renderGlobalOptions", g), o.innerHTML = "Error loading global options";
1003
1036
  }
1004
1037
  };
1005
1038
  l(), s.addEventListener("click", (g) => {
1006
- g.preventDefault(), s.classList.add("active"), n.classList.remove("active"), o.style.display = "flex", a.style.display = "none", this.value && this.value.startsWith("var(--");
1039
+ g.preventDefault(), s.classList.add("active"), n.classList.remove("active"), a.style.display = "flex", o.style.display = "none", this.value && this.value.startsWith("var(--");
1007
1040
  }), n.addEventListener("click", (g) => {
1008
- g.preventDefault(), n.classList.add("active"), s.classList.remove("active"), o.style.display = "none", a.style.display = "grid", l();
1041
+ g.preventDefault(), n.classList.add("active"), s.classList.remove("active"), a.style.display = "none", o.style.display = "grid", l();
1009
1042
  }), this.value && this.value.startsWith("var(--") ? n.click() : s.click();
1010
1043
  const r = (g) => {
1011
- const v = g.value.trim();
1012
- if (!v)
1044
+ const f = g.value.trim();
1045
+ if (!f)
1013
1046
  return e.classList.remove("error"), !0;
1014
- const f = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(v);
1015
- return f ? e.classList.remove("error") : e.classList.add("error"), f;
1047
+ const v = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(f);
1048
+ return v ? e.classList.remove("error") : e.classList.add("error"), v;
1016
1049
  }, p = document.createElement("input");
1017
1050
  p.type = "color", p.className = "color-picker", p.value = this.value && !this.value.startsWith("var(--") ? this.value : "#000000", p.setAttribute("aria-label", "Choose color"), p.setAttribute("title", "Click to open color picker"), this.getDataPropsPath() && p.setAttribute("data-test-id", this.getDataPropsPath()), this.colorInputEl = p;
1018
1051
  const c = document.createElement("div");
@@ -1025,21 +1058,21 @@ class N extends Lt {
1025
1058
  c.style.backgroundColor = d;
1026
1059
  const u = document.createElement("input");
1027
1060
  return u.type = "text", u.className = "color-text-input", u.value = this.value || "", u.placeholder = "#000000", u.setAttribute("pattern", "#[0-9A-Fa-f]{6}"), u.setAttribute("title", "Enter a hex color value (e.g., #ff0000)"), u.setAttribute("aria-label", "Hex color value"), u.setAttribute("maxlength", "7"), this.getDataPropsPath() && u.setAttribute("data-test-id", `${this.getDataPropsPath()}_text`), this.textInputEl = u, this.textInputEl.addEventListener("input", (g) => {
1028
- var m, f;
1029
- let v = g.target.value.trim();
1061
+ var m, v;
1062
+ let f = g.target.value.trim();
1030
1063
  if (this.textInputEl && r(this.textInputEl)) {
1031
- const C = N.normalizeColorValue(v);
1032
- this.value = C, (m = this.onChange) == null || m.call(this, C), (f = this.detectChange) == null || f.call(this, C), this.colorInputEl && (this.colorInputEl.value = C), c.style.backgroundColor = C;
1064
+ const C = N.normalizeColorValue(f);
1065
+ this.value = C, (m = this.onChange) == null || m.call(this, C), (v = this.detectChange) == null || v.call(this, C), this.colorInputEl && (this.colorInputEl.value = C), c.style.backgroundColor = C;
1033
1066
  }
1034
1067
  }), this.colorInputEl.addEventListener("input", (g) => {
1035
- var f, C;
1036
- const v = g.target.value, m = N.normalizeColorValue(v);
1037
- this.value = m, (f = this.onChange) == null || f.call(this, m), (C = this.detectChange) == null || C.call(this, m), this.textInputEl && (this.textInputEl.value = m), c.style.backgroundColor = m, e.classList.remove("error");
1068
+ var v, C;
1069
+ const f = g.target.value, m = N.normalizeColorValue(f);
1070
+ this.value = m, (v = this.onChange) == null || v.call(this, m), (C = this.detectChange) == null || C.call(this, m), this.textInputEl && (this.textInputEl.value = m), c.style.backgroundColor = m, e.classList.remove("error");
1038
1071
  }), this.colorInputEl.addEventListener("change", (g) => {
1039
- var f, C;
1040
- const v = g.target.value, m = N.normalizeColorValue(v);
1041
- this.value = m, (f = this.onChange) == null || f.call(this, m), (C = this.detectChange) == null || C.call(this, m), this.textInputEl && (this.textInputEl.value = m), c.style.backgroundColor = m;
1042
- }), o.appendChild(p), o.appendChild(c), o.appendChild(u), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.element = t, t;
1072
+ var v, C;
1073
+ const f = g.target.value, m = N.normalizeColorValue(f);
1074
+ this.value = m, (v = this.onChange) == null || v.call(this, m), (C = this.detectChange) == null || C.call(this, m), this.textInputEl && (this.textInputEl.value = m), c.style.backgroundColor = m;
1075
+ }), a.appendChild(p), a.appendChild(c), a.appendChild(u), e.appendChild(i), e.appendChild(a), e.appendChild(o), t.appendChild(e), this.element = t, t;
1043
1076
  }
1044
1077
  getElement() {
1045
1078
  return this.element;
@@ -1095,8 +1128,8 @@ class R extends x {
1095
1128
  }
1096
1129
  updateColorPreview() {
1097
1130
  if (!this.colorPreviewEl || !this.value) return;
1098
- const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
1099
- this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${o}, ${e})`;
1131
+ const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
1132
+ this.colorPreviewEl.style.backgroundColor = `rgba(${s}, ${n}, ${a}, ${e})`;
1100
1133
  }
1101
1134
  handleColorChange(t) {
1102
1135
  const e = this.getOpacityPercent(), i = R.combineColorOpacity(
@@ -1119,16 +1152,16 @@ class R extends x {
1119
1152
  draw() {
1120
1153
  const t = document.createElement("div");
1121
1154
  if (t.className = "color-with-opacity-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
1122
- const o = document.createElement("div");
1123
- if (o.className = "icon-container", this.props.icon) {
1124
- const a = document.createElement("span");
1125
- a.className = "input-icon", a.innerHTML = this.props.icon, o.appendChild(a);
1155
+ const a = document.createElement("div");
1156
+ if (a.className = "icon-container", this.props.icon) {
1157
+ const o = document.createElement("span");
1158
+ o.className = "input-icon", o.innerHTML = this.props.icon, a.appendChild(o);
1126
1159
  }
1127
1160
  if (this.props.title) {
1128
- const a = document.createElement("span");
1129
- a.className = "input-label", a.textContent = this.props.title, o.appendChild(a);
1161
+ const o = document.createElement("span");
1162
+ o.className = "input-label", o.textContent = this.props.title, a.appendChild(o);
1130
1163
  }
1131
- t.appendChild(o);
1164
+ t.appendChild(a);
1132
1165
  }
1133
1166
  const e = document.createElement("div");
1134
1167
  e.className = "color-with-opacity-input-wrapper", this.colorInputEl = document.createElement("input"), this.colorInputEl.type = "color", this.colorInputEl.className = "color-with-opacity-picker", this.getDataPropsPath() && this.colorInputEl.setAttribute(
@@ -1137,18 +1170,18 @@ class R extends x {
1137
1170
  ), this.colorPreviewEl = document.createElement("div"), this.colorPreviewEl.className = "color-with-opacity-preview", this.textInputEl = document.createElement("input"), this.textInputEl.type = "text", this.textInputEl.className = "color-with-opacity-text-input", this.textInputEl.placeholder = "#000000FF", this.getDataPropsPath() && this.textInputEl.setAttribute(
1138
1171
  "data-test-id",
1139
1172
  `${this.getDataPropsPath()}_text`
1140
- ), this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (o) => {
1141
- const a = o.target;
1142
- this.handleColorChange(a.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1143
- }), this.textInputEl.addEventListener("input", (o) => {
1144
- const a = o.target;
1145
- this.handleTextInput(a.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : a.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
1146
- }), this.textInputEl.addEventListener("blur", (o) => {
1147
- const a = o.target;
1148
- a.value.trim() === "" && (a.value = this.value || "#000000FF", e.classList.remove("error"));
1173
+ ), this.updateInputElements(), this.updateColorPreview(), this.colorInputEl.addEventListener("input", (a) => {
1174
+ const o = a.target;
1175
+ this.handleColorChange(o.value), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1176
+ }), this.textInputEl.addEventListener("input", (a) => {
1177
+ const o = a.target;
1178
+ this.handleTextInput(o.value) ? (this.colorInputEl && (this.colorInputEl.value = this.getRgbColor()), this.updateColorPreview(), e.classList.remove("error")) : o.value.trim() === "" ? e.classList.remove("error") : e.classList.add("error");
1179
+ }), this.textInputEl.addEventListener("blur", (a) => {
1180
+ const o = a.target;
1181
+ o.value.trim() === "" && (o.value = this.value || "#000000FF", e.classList.remove("error"));
1149
1182
  }), this.colorPreviewEl.addEventListener("click", () => {
1150
- var o;
1151
- (o = this.colorInputEl) == null || o.click();
1183
+ var a;
1184
+ (a = this.colorInputEl) == null || a.click();
1152
1185
  }), e.appendChild(this.colorInputEl), e.appendChild(this.colorPreviewEl), e.appendChild(this.textInputEl);
1153
1186
  const i = document.createElement("div");
1154
1187
  i.className = "color-with-opacity-opacity-wrapper", this.opacityInputEl = document.createElement("input"), this.opacityInputEl.type = "number", this.opacityInputEl.className = "color-with-opacity-opacity-input", this.opacityInputEl.value = this.getOpacityPercent().toString(), this.opacityInputEl.min = "0", this.opacityInputEl.max = "100", this.opacityInputEl.step = "1", this.opacityInputEl.placeholder = "100", this.getDataPropsPath() && this.opacityInputEl.setAttribute(
@@ -1156,13 +1189,13 @@ class R extends x {
1156
1189
  `${this.getDataPropsPath()}_opacity`
1157
1190
  );
1158
1191
  const s = document.createElement("span");
1159
- s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (o) => {
1160
- const a = o.target, l = parseFloat(a.value);
1192
+ s.className = "color-with-opacity-opacity-suffix", s.textContent = "%", this.opacityInputEl.addEventListener("input", (a) => {
1193
+ const o = a.target, l = parseFloat(o.value);
1161
1194
  isNaN(l) || (this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview());
1162
- }), this.opacityInputEl.addEventListener("blur", (o) => {
1163
- const a = o.target;
1164
- let l = parseFloat(a.value);
1165
- isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), a.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1195
+ }), this.opacityInputEl.addEventListener("blur", (a) => {
1196
+ const o = a.target;
1197
+ let l = parseFloat(o.value);
1198
+ isNaN(l) && (l = this.getOpacityPercent()), l = Math.max(0, Math.min(100, l)), o.value = l.toString(), this.handleOpacityChange(l), this.textInputEl && (this.textInputEl.value = this.value || "#000000FF"), this.updateColorPreview();
1166
1199
  }), i.appendChild(this.opacityInputEl), i.appendChild(s);
1167
1200
  const n = document.createElement("div");
1168
1201
  return n.className = "color-with-opacity-controls-wrapper", n.appendChild(e), n.appendChild(i), t.appendChild(n), this.element = t, this.updateInputElements(), this.updateColorPreview(), t;
@@ -1175,8 +1208,8 @@ class R extends x {
1175
1208
  }
1176
1209
  getRgbaValue() {
1177
1210
  if (!this.value) return "rgba(0, 0, 0, 1)";
1178
- const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), o = parseInt(i.substring(4, 6), 16);
1179
- return `rgba(${s}, ${n}, ${o}, ${e})`;
1211
+ const t = this.getRgbColor(), e = this.getOpacityPercent() / 100, i = t.replace("#", ""), s = parseInt(i.substring(0, 2), 16), n = parseInt(i.substring(2, 4), 16), a = parseInt(i.substring(4, 6), 16);
1212
+ return `rgba(${s}, ${n}, ${a}, ${e})`;
1180
1213
  }
1181
1214
  getColorAndOpacity() {
1182
1215
  return {
@@ -1197,20 +1230,20 @@ class de extends x {
1197
1230
  if (t.className = "html-setting-wrapper " + (this.props.wrapperClassName || ""), this.props.title || this.props.icon) {
1198
1231
  const n = document.createElement("div");
1199
1232
  if (n.className = "icon-container", this.props.icon) {
1200
- const o = this.createIcon(this.props.icon);
1201
- n.appendChild(o);
1233
+ const a = this.createIcon(this.props.icon);
1234
+ n.appendChild(a);
1202
1235
  }
1203
1236
  if (this.props.title) {
1204
- const o = this.createLabel(this.props.title);
1205
- n.appendChild(o);
1237
+ const a = this.createLabel(this.props.title);
1238
+ n.appendChild(a);
1206
1239
  }
1207
1240
  t.appendChild(n);
1208
1241
  }
1209
1242
  const e = document.createElement("textarea");
1210
1243
  this.textareaEl = e, e.value = this.value || "", e.placeholder = this.props.placeholder || "Paste your HTML here...", e.className = "html-setting-textarea " + (this.props.textareaClassName || ""), e.rows = this.props.rows || 6, this.getDataPropsPath() && e.setAttribute("data-test-id", this.getDataPropsPath()), this.props.maxLength !== void 0 && (e.maxLength = this.props.maxLength), this.props.className && e.classList.add(this.props.className);
1211
1244
  const i = (n) => {
1212
- const a = n.target.value;
1213
- this.value = a, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
1245
+ const o = n.target.value;
1246
+ this.value = o, this.onChange && this.onChange(this.value), this.props.detectChange && this.props.detectChange(this.value);
1214
1247
  }, s = (n) => {
1215
1248
  this.onBlur && this.value !== void 0 && this.onBlur(this.value);
1216
1249
  };
@@ -1240,12 +1273,12 @@ class V extends x {
1240
1273
  const i = document.createElement("input");
1241
1274
  if (i.type = "number", i.className = "number-setting-input " + (this.props.inputClassName || ""), i.value = String(this.value ?? ""), i.placeholder = this.props.placeholder || "", this.getDataPropsPath() && i.setAttribute("data-test-id", this.getDataPropsPath()), this.props.minValue !== void 0 && (i.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (i.max = String(this.props.maxValue)), this.props.step !== void 0 && (i.step = String(this.props.step)), i.addEventListener("input", () => {
1242
1275
  const s = this.props.minValue ?? Number.MIN_SAFE_INTEGER, n = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
1243
- let o = Number(i.value);
1244
- o < s && (o = s), o > n && (o = n), String(o) !== i.value && (i.value = String(o)), this.setValue(o);
1276
+ let a = Number(i.value);
1277
+ a < s && (a = s), a > n && (a = n), String(a) !== i.value && (i.value = String(a)), this.setValue(a);
1245
1278
  }), i.addEventListener("blur", () => {
1246
- var n, o;
1279
+ var n, a;
1247
1280
  const s = this.validateValue(Number(i.value));
1248
- s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (o = (n = this.props).onBlur) == null || o.call(n);
1281
+ s !== Number(i.value) && (i.value = String(s), this.setValue(s)), (a = (n = this.props).onBlur) == null || a.call(n);
1249
1282
  }), e.appendChild(i), this.props.suffix && this.props.suffix !== "none") {
1250
1283
  const s = document.createElement("span");
1251
1284
  s.className = "suffix-label", s.textContent = this.props.suffix, e.appendChild(s);
@@ -1328,12 +1361,12 @@ class tt extends x {
1328
1361
  if (t.classList.add("select-container"), this.container = t, this.props.icon || this.props.title) {
1329
1362
  const n = document.createElement("div");
1330
1363
  if (n.className = "icon-container", this.props.icon) {
1331
- const o = this.createIcon(this.props.icon);
1332
- n.appendChild(o);
1364
+ const a = this.createIcon(this.props.icon);
1365
+ n.appendChild(a);
1333
1366
  }
1334
1367
  if (this.props.title) {
1335
- const o = this.createLabel(this.props.title);
1336
- n.appendChild(o);
1368
+ const a = this.createLabel(this.props.title);
1369
+ n.appendChild(a);
1337
1370
  }
1338
1371
  t.appendChild(n);
1339
1372
  } else {
@@ -1342,13 +1375,13 @@ class tt extends x {
1342
1375
  }
1343
1376
  const e = document.createElement("div");
1344
1377
  e.classList.add("select-button"), this.getDataPropsPath() && e.setAttribute("data-test-id", this.getDataPropsPath()), this.isLoading ? e.classList.add("loading") : e.textContent = this.selectedOptionIndex !== null ? this._options[this.selectedOptionIndex].name : this.props.placeholder || "Select an option", e.onclick = () => {
1345
- var n, o;
1346
- this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1378
+ var n, a;
1379
+ this.isLoading || (this.isOpen = !this.isOpen, this.isOpen ? this.checkDropdownPosition() : this.cleanupDropdownPosition(), (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1347
1380
  }, t.appendChild(e), this.buttonEl = e;
1348
1381
  const i = document.createElement("ul");
1349
- i.classList.add("select-options"), this._options.forEach((n, o) => {
1350
- const a = this.createOption(n, o);
1351
- a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
1382
+ i.classList.add("select-options"), this._options.forEach((n, a) => {
1383
+ const o = this.createOption(n, a);
1384
+ o.onclick = (l) => this.selectOption(l, a, e), i.appendChild(o);
1352
1385
  }), document.body.appendChild(i);
1353
1386
  const s = document.createElement("div");
1354
1387
  return s.classList.add("svg-container"), s.innerHTML = It, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
@@ -1356,8 +1389,8 @@ class tt extends x {
1356
1389
  }).catch((n) => {
1357
1390
  console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
1358
1391
  })), this.clickOutsideListener && document.removeEventListener("click", this.clickOutsideListener), this.clickOutsideListener = (n) => {
1359
- var o, a;
1360
- this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (o = this.optionsListEl) == null || o.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition());
1392
+ var a, o;
1393
+ this.isOpen && !t.contains(n.target) && (this.isOpen = !1, (a = this.optionsListEl) == null || a.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition());
1361
1394
  }, document.addEventListener("click", this.clickOutsideListener), this.resizeListener && window.removeEventListener("resize", this.resizeListener), this.resizeListener = () => {
1362
1395
  this.isOpen && this.checkDropdownPosition();
1363
1396
  }, window.addEventListener("resize", this.resizeListener), t;
@@ -1376,9 +1409,9 @@ class tt extends x {
1376
1409
  }
1377
1410
  }
1378
1411
  selectOption(t, e, i) {
1379
- var n, o;
1412
+ var n, a;
1380
1413
  const s = this._options[e];
1381
- s && (this.setValue(s.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (n = this.optionsListEl) == null || n.classList.remove("open"), (o = this.svgContainer) == null || o.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((l, r) => {
1414
+ s && (this.setValue(s.value), this.selectedOptionIndex = e, this.isOpen = !1, i.textContent = s.name, (n = this.optionsListEl) == null || n.classList.remove("open"), (a = this.svgContainer) == null || a.classList.remove("open"), this.cleanupDropdownPosition(), this.optionsListEl && this.optionsListEl.querySelectorAll(".select-option").forEach((l, r) => {
1382
1415
  r === e ? l.classList.add("selected") : l.classList.remove("selected");
1383
1416
  }));
1384
1417
  }
@@ -1459,14 +1492,14 @@ class Vt extends x {
1459
1492
  `
1460
1493
  }
1461
1494
  ].forEach((n) => {
1462
- const o = document.createElement("button");
1463
- o.className = "align-option-button", o.innerHTML = n.icon, this.getDataPropsPath() && o.setAttribute(
1495
+ const a = document.createElement("button");
1496
+ a.className = "align-option-button", a.innerHTML = n.icon, this.getDataPropsPath() && a.setAttribute(
1464
1497
  "data-test-id",
1465
1498
  `${this.getDataPropsPath()}_${n.name}`
1466
- ), this.value === n.name && o.classList.add("selected"), o.addEventListener("click", () => {
1467
- var a;
1468
- i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), o.classList.add("selected"), this.value = n.name, (a = this.onChange) == null || a.call(this, this.value);
1469
- }), i.appendChild(o);
1499
+ ), this.value === n.name && a.classList.add("selected"), a.addEventListener("click", () => {
1500
+ var o;
1501
+ i.querySelectorAll(".align-option-button").forEach((l) => l.classList.remove("selected")), a.classList.add("selected"), this.value = n.name, (o = this.onChange) == null || o.call(this, this.value);
1502
+ }), i.appendChild(a);
1470
1503
  }), t.appendChild(i), t;
1471
1504
  }
1472
1505
  }
@@ -1484,19 +1517,19 @@ class pe extends x {
1484
1517
  /^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i
1485
1518
  );
1486
1519
  if (n) {
1487
- let a = +n[1], l = +n[2], r = +n[3], p = +n[4];
1488
- p >= 1 ? (a = Math.round(a * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : p = Math.min(1, p + 0.12), s = `rgba(${a},${l},${r},${p})`;
1520
+ let o = +n[1], l = +n[2], r = +n[3], p = +n[4];
1521
+ p >= 1 ? (o = Math.round(o * 0.9), l = Math.round(l * 0.9), r = Math.round(r * 0.9)) : p = Math.min(1, p + 0.12), s = `rgba(${o},${l},${r},${p})`;
1489
1522
  }
1490
1523
  t.addEventListener("mouseenter", () => {
1491
1524
  console.log("hoverBg", s), t.style.setProperty("background-color", s, "important");
1492
1525
  }), t.addEventListener("mouseleave", () => {
1493
1526
  t.style.setProperty("background-color", e, "important");
1494
1527
  }), t.addEventListener("click", () => {
1495
- var a, l;
1496
- return (l = (a = this.props).onClick) == null ? void 0 : l.call(a);
1528
+ var o, l;
1529
+ return (l = (o = this.props).onClick) == null ? void 0 : l.call(o);
1497
1530
  });
1498
- const o = document.createElement("div");
1499
- return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
1531
+ const a = document.createElement("div");
1532
+ return a.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), a.appendChild(t), a;
1500
1533
  }
1501
1534
  }
1502
1535
  class ue extends x {
@@ -1589,8 +1622,8 @@ class ue extends x {
1589
1622
  return n.className = "dimension-lock-icon", n.setAttribute("type", "button"), n.setAttribute("aria-pressed", String(this.locked)), n.setAttribute(
1590
1623
  "aria-label",
1591
1624
  this.locked ? "Unlock aspect ratio" : "Lock aspect ratio"
1592
- ), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (o) => {
1593
- o.preventDefault(), this.toggleLock(n);
1625
+ ), n.title = this.locked ? "Unlock aspect ratio" : "Lock aspect ratio", n.innerHTML = this.getLockSVG(this.locked), n.onclick = (a) => {
1626
+ a.preventDefault(), this.toggleLock(n);
1594
1627
  }, s.appendChild(n), t.appendChild(e), t.appendChild(s), t.appendChild(i), t;
1595
1628
  }
1596
1629
  isLocked() {
@@ -1707,11 +1740,11 @@ class ct extends x {
1707
1740
  <span class="upload-label">Replace</span>
1708
1741
  `);
1709
1742
  const n = () => {
1710
- this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
1711
- }, o = () => {
1712
- this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", o);
1743
+ this.hideLoading(), this.previewWrapper.classList.add("has-image"), this.previewEl.style.display = "block", this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
1744
+ }, a = () => {
1745
+ this.hideLoading(), this.showError("Failed to load image. Please try again."), this.previewWrapper.classList.remove("has-image"), this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), this.previewEl.removeEventListener("load", n), this.previewEl.removeEventListener("error", a);
1713
1746
  };
1714
- this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
1747
+ this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", a), this.previewEl.src = t;
1715
1748
  } else
1716
1749
  this.hideLoading(), this.previewWrapper.classList.remove("has-image"), this.previewEl.src = "", this.previewEl.style.display = "none", this.previewWrapper.style.display = "none", s && s instanceof HTMLElement && (s.style.display = "block"), e && e.classList.add("no-image"), i && (i.innerHTML = `
1717
1750
  <span class="upload-icon">${Y}</span>
@@ -1722,24 +1755,24 @@ class ct extends x {
1722
1755
  const t = document.createElement("div");
1723
1756
  t.className = "upload-setting-wrapper", t.setAttribute("data-setting-id", this.id), t.addEventListener(
1724
1757
  "focusout",
1725
- (a) => {
1758
+ (o) => {
1726
1759
  var l;
1727
- a.relatedTarget && t.contains(a.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
1760
+ o.relatedTarget && t.contains(o.relatedTarget) || (l = this.onBlur) == null || l.call(this, this.value ?? "");
1728
1761
  },
1729
1762
  !0
1730
1763
  );
1731
1764
  const e = !!(this.props.title || this.props.icon);
1732
1765
  if (e || t.classList.add("no-label"), e) {
1733
- const a = document.createElement("div");
1734
- if (a.className = "icon-title-container", this.props.icon) {
1766
+ const o = document.createElement("div");
1767
+ if (o.className = "icon-title-container", this.props.icon) {
1735
1768
  const l = this.createIcon(this.props.icon);
1736
- a.appendChild(l);
1769
+ o.appendChild(l);
1737
1770
  }
1738
1771
  if (this.props.title) {
1739
1772
  const l = this.createLabel(this.props.title);
1740
- a.appendChild(l);
1773
+ o.appendChild(l);
1741
1774
  }
1742
- t.appendChild(a);
1775
+ t.appendChild(o);
1743
1776
  }
1744
1777
  this.errorContainer = document.createElement("div"), this.errorContainer.className = "error-message", this.errorContainer.style.display = "none", t.appendChild(this.errorContainer);
1745
1778
  const i = document.createElement("div");
@@ -1748,18 +1781,18 @@ class ct extends x {
1748
1781
  s || i.classList.add("no-image");
1749
1782
  const n = document.createElement("div");
1750
1783
  if (n.className = "preview-placeholder", n.innerHTML = Ot, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = $t, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
1751
- const a = document.createElement("button");
1752
- a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Ht, this.previewWrapper.appendChild(a), a.onclick = (l) => {
1784
+ const o = document.createElement("button");
1785
+ o.className = "delete-button", o.type = "button", o.title = "Delete image", o.innerHTML = Ht, this.previewWrapper.appendChild(o), o.onclick = (l) => {
1753
1786
  var r;
1754
1787
  l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
1755
1788
  };
1756
1789
  }
1757
1790
  this.previewWrapper.appendChild(this.previewEl);
1758
- const o = document.createElement("button");
1759
- return o.className = "upload-button", this.getDataPropsPath() && o.setAttribute("data-test-id", this.getDataPropsPath()), o.innerHTML = `
1791
+ const a = document.createElement("button");
1792
+ return a.className = "upload-button", this.getDataPropsPath() && a.setAttribute("data-test-id", this.getDataPropsPath()), a.innerHTML = `
1760
1793
  <span class="upload-icon">${Y}</span>
1761
1794
  <span class="upload-label">Upload</span>
1762
- `, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(o), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = () => {
1795
+ `, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(a), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), a.onclick = () => {
1763
1796
  window.postMessage(
1764
1797
  {
1765
1798
  type: "OPEN_FILE_MANAGER_MODAL",
@@ -1816,7 +1849,7 @@ const Bt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
1816
1849
  <polyline points="6 9 12 15 18 9"></polyline>
1817
1850
  </svg>
1818
1851
  `;
1819
- class ve extends x {
1852
+ class fe extends x {
1820
1853
  constructor(t = {}) {
1821
1854
  if (super(t), this.inputType = "select", this._options = [], this.isOpen = !1, this.selectedOptionIndex = null, this.optionsListEl = null, this.svgContainer = null, this.buttonEl = null, this.isLoading = !1, this.container = null, this.hasInitializedOptions = !1, this.selectedOptionIndex = null, t.default !== void 0 && (this.value = t.default), this.initializeOptions(t), !t.getOptionsAsync && this.value !== void 0) {
1822
1855
  const e = this._options.findIndex(
@@ -1843,44 +1876,44 @@ class ve extends x {
1843
1876
  e.classList.add("has-label");
1844
1877
  const n = document.createElement("div");
1845
1878
  n.className = "select-label", n.textContent = this.props.title, e.appendChild(n);
1846
- const o = document.createElement("span");
1847
- if (o.className = "select-value", this.isLoading)
1848
- o.textContent = this.props.loadingText || "Loading options...";
1879
+ const a = document.createElement("span");
1880
+ if (a.className = "select-value", this.isLoading)
1881
+ a.textContent = this.props.loadingText || "Loading options...";
1849
1882
  else {
1850
- const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = a && typeof a.name == "string" ? a.name : "Select an option";
1851
- o.textContent = l;
1883
+ const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, l = o && typeof o.name == "string" ? o.name : "Select an option";
1884
+ a.textContent = l;
1852
1885
  }
1853
- e.appendChild(o);
1886
+ e.appendChild(a);
1854
1887
  } else {
1855
1888
  const n = document.createElement("span");
1856
1889
  if (this.isLoading)
1857
1890
  n.textContent = this.props.loadingText || "Loading options...";
1858
1891
  else {
1859
- const o = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, a = o && typeof o.name == "string" ? o.name : "Select an option";
1860
- n.textContent = a;
1892
+ const a = this.selectedOptionIndex !== null && this._options && this.selectedOptionIndex >= 0 && this.selectedOptionIndex < this._options.length ? this._options[this.selectedOptionIndex] : null, o = a && typeof a.name == "string" ? a.name : "Select an option";
1893
+ n.textContent = o;
1861
1894
  }
1862
1895
  e.appendChild(n);
1863
1896
  }
1864
1897
  e.onclick = () => {
1865
- var n, o;
1866
- this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1898
+ var n, a;
1899
+ this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1867
1900
  }, t.appendChild(e), this.buttonEl = e;
1868
1901
  const i = document.createElement("ul");
1869
- i.classList.add("select-api-options"), this._options.forEach((n, o) => {
1870
- const a = this.createOption(n, o);
1871
- a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
1902
+ i.classList.add("select-api-options"), this._options.forEach((n, a) => {
1903
+ const o = this.createOption(n, a);
1904
+ o.onclick = (l) => this.selectApiOption(l, a, e), i.appendChild(o);
1872
1905
  }), t.appendChild(i);
1873
1906
  const s = document.createElement("div");
1874
1907
  return s.classList.add("svg-container"), s.innerHTML = Dt, t.appendChild(s), s.onclick = () => {
1875
- var n, o;
1876
- this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (o = this.svgContainer) == null || o.classList.toggle("open", this.isOpen));
1908
+ var n, a;
1909
+ this.isLoading || (this.isOpen = !this.isOpen, (n = this.optionsListEl) == null || n.classList.toggle("open", this.isOpen), (a = this.svgContainer) == null || a.classList.toggle("open", this.isOpen));
1877
1910
  }, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1878
- const o = new Set(
1911
+ const a = new Set(
1879
1912
  this._options.map((l) => JSON.stringify(l.value))
1880
- ), a = n.filter(
1881
- (l) => !o.has(JSON.stringify(l.value))
1913
+ ), o = n.filter(
1914
+ (l) => !a.has(JSON.stringify(l.value))
1882
1915
  );
1883
- if (this._options.push(...a), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
1916
+ if (this._options.push(...o), this.isLoading = !1, this.hasInitializedOptions = !0, this.value !== void 0) {
1884
1917
  const l = this._options.findIndex(
1885
1918
  (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1886
1919
  );
@@ -1894,12 +1927,12 @@ class ve extends x {
1894
1927
  !0
1895
1928
  );
1896
1929
  })) : this.props.getOptionsAsync && this._options.length <= 1 && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1897
- const o = new Set(
1930
+ const a = new Set(
1898
1931
  this._options.map((l) => JSON.stringify(l.value))
1899
- ), a = n.filter(
1900
- (l) => !o.has(JSON.stringify(l.value))
1932
+ ), o = n.filter(
1933
+ (l) => !a.has(JSON.stringify(l.value))
1901
1934
  );
1902
- if (this._options.push(...a), this.isLoading = !1, this.value !== void 0) {
1935
+ if (this._options.push(...o), this.isLoading = !1, this.value !== void 0) {
1903
1936
  const l = this._options.findIndex(
1904
1937
  (r) => JSON.stringify(r.value) === JSON.stringify(this.value)
1905
1938
  );
@@ -1918,19 +1951,11 @@ class ve extends x {
1918
1951
  return JSON.stringify(t ? {} : { value: this.value }, null, 2);
1919
1952
  }
1920
1953
  selectApiOption(t, e, i) {
1921
- var l, r, p, c;
1922
- const s = t.target, n = s.querySelector(".select-api-radio") || ((l = s.closest(".select-api-option")) == null ? void 0 : l.querySelector(".select-api-radio"));
1923
- n && (n.checked = !0), this.selectedOptionIndex = e;
1924
- const o = this._options[e].value;
1925
- this.value = o;
1926
- const a = i.querySelector(".select-value");
1927
- if (a)
1928
- a.textContent = this._options[e].name;
1929
- else {
1930
- const d = i.firstChild;
1931
- d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
1932
- }
1933
- this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (p = this.svgContainer) == null || p.classList.remove("open"), (c = this.onChange) == null || c.call(this, o), this.detectChangeCallback && this.detectChangeCallback(o);
1954
+ var o, l, r;
1955
+ const s = t.target, n = s.querySelector(".select-api-radio") || ((o = s.closest(".select-api-option")) == null ? void 0 : o.querySelector(".select-api-radio"));
1956
+ n && (n.checked = !0);
1957
+ const a = this._options[e].value;
1958
+ this.setValue(a), this.isOpen = !1, (l = this.optionsListEl) == null || l.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open");
1934
1959
  }
1935
1960
  updateOptionsList() {
1936
1961
  !this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
@@ -1954,22 +1979,32 @@ class ve extends x {
1954
1979
  i.textContent = t || n, this.buttonEl.classList.remove("error"), this.buttonEl.removeAttribute("disabled"), this.svgContainer && (this.svgContainer.style.display = "");
1955
1980
  }
1956
1981
  }
1982
+ update(t = !1) {
1983
+ var e;
1984
+ if (this.selectedOptionIndex = this.value !== void 0 ? this._options.findIndex(
1985
+ (i) => JSON.stringify(i.value) === JSON.stringify(this.value)
1986
+ ) : null, this.updateOptionsList(), this.updateButtonText(), t && this.value !== void 0) {
1987
+ (e = this.onChange) == null || e.call(this, this.value);
1988
+ const i = this.props.detectChange || this.detectChangeCallback;
1989
+ i == null || i(this.value);
1990
+ }
1991
+ }
1957
1992
  setDetectChange(t) {
1958
- this.detectChangeCallback = t;
1993
+ this.detectChangeCallback = t, this.props.detectChange = t;
1959
1994
  }
1960
1995
  setValue(t) {
1961
- this.value = t, this.selectedOptionIndex = this._options.findIndex(
1996
+ super.setValue(t), this.selectedOptionIndex = this._options.findIndex(
1962
1997
  (e) => JSON.stringify(e.value) === JSON.stringify(t)
1963
- ), this.updateButtonText();
1998
+ ), this.updateButtonText(), this.updateOptionsList(), this.detectChangeCallback && this.detectChangeCallback !== this.props.detectChange && this.detectChangeCallback(t);
1964
1999
  }
1965
2000
  }
1966
- class fe extends x {
2001
+ class ve extends x {
1967
2002
  constructor(t) {
1968
2003
  var e, i;
1969
2004
  super(t), this.inputType = "text", this.value = t.default ?? ((i = (e = t.options) == null ? void 0 : e[0]) == null ? void 0 : i.value) ?? "", this.detectChangeCallback = t.detectChange;
1970
2005
  }
1971
2006
  draw() {
1972
- var o, a;
2007
+ var a, o;
1973
2008
  const t = document.createElement("div");
1974
2009
  t.className = "toggle-setting-container", this.props.icon && t.classList.add("toggle-with-icon");
1975
2010
  const e = document.createElement("div");
@@ -1985,7 +2020,7 @@ class fe extends x {
1985
2020
  const i = document.createElement("label");
1986
2021
  i.className = "toggle-switch";
1987
2022
  const s = document.createElement("input");
1988
- 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", () => {
2023
+ s.type = "checkbox", s.checked = ((o = (a = this.props.options) == null ? void 0 : a.find((l) => l.value === this.value)) == null ? void 0 : o.status) ?? !1, this.getDataPropsPath() && s.setAttribute("data-test-id", this.getDataPropsPath()), s.addEventListener("change", () => {
1989
2024
  var r, p;
1990
2025
  const l = ((p = (r = this.props.options) == null ? void 0 : r.find((c) => c.status === s.checked)) == null ? void 0 : p.value) ?? "";
1991
2026
  this.value = l, this.onChange && this.onChange(this.value), this.detectChangeCallback && this.detectChangeCallback(this.value);
@@ -2030,27 +2065,27 @@ class Ce extends x {
2030
2065
  i.className = "setting-label", i.setAttribute("for", this.id + "-input");
2031
2066
  const s = document.createElement("span");
2032
2067
  if (s.textContent = this.props.title ?? "Gap", i.appendChild(s), this.props.icon) {
2033
- const a = document.createElement("span");
2034
- a.className = "setting-icon", a.innerHTML = this.props.icon, i.insertBefore(a, s);
2068
+ const o = document.createElement("span");
2069
+ o.className = "setting-icon", o.innerHTML = this.props.icon, i.insertBefore(o, s);
2035
2070
  }
2036
2071
  const n = document.createElement("div");
2037
2072
  n.className = `setting-input-wrapper ${this.props.wrapperClassName || ""}`, n.classList.add("gap-setting-wrapper");
2038
- const o = document.createElement("div");
2039
- return o.className = "gap-inputs-container", this.props.rowGap && o.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && o.appendChild(this.createGapInput("column", "Col")), n.appendChild(o), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
2073
+ const a = document.createElement("div");
2074
+ return a.className = "gap-inputs-container", this.props.rowGap && a.appendChild(this.createGapInput("row", "Row")), this.props.columnGap && a.appendChild(this.createGapInput("column", "Col")), n.appendChild(a), e.appendChild(i), e.appendChild(n), t.appendChild(e), t;
2040
2075
  }
2041
2076
  createGapInput(t, e) {
2042
2077
  const i = document.createElement("div");
2043
2078
  i.className = "gap-input-wrapper";
2044
2079
  const s = document.createElement("input");
2045
2080
  if (s.type = "number", s.className = `gap-input gap-${t}-input ${this.props.inputClassName || ""}`, s.id = `${this.id}-${t}-input`, s.min = String(this.props.minValue ?? 0), this.props.maxValue !== void 0 && (s.max = String(this.props.maxValue)), s.step = String(this.props.step ?? 1), s.value = String(this.inputValues[t] ?? this.value), s.title = e, this.getDataPropsPath() && s.setAttribute("data-test-id", `${this.getDataPropsPath()}_${t}`), s.addEventListener("input", (n) => {
2046
- const o = n.target;
2047
- let a = parseFloat(o.value);
2048
- a = this.validateValue(a), String(a) !== o.value && (o.value = String(a)), this.inputValues[t] = a, this.setValue(a);
2081
+ const a = n.target;
2082
+ let o = parseFloat(a.value);
2083
+ o = this.validateValue(o), String(o) !== a.value && (a.value = String(o)), this.inputValues[t] = o, this.setValue(o);
2049
2084
  }), s.addEventListener("blur", (n) => {
2050
2085
  var l, r;
2051
- const o = n.target;
2052
- let a = parseFloat(o.value);
2053
- a = this.validateValue(a), String(a) !== o.value && (o.value = String(a), this.inputValues[t] = a, this.setValue(a)), (r = (l = this.props).onBlur) == null || r.call(l);
2086
+ const a = n.target;
2087
+ let o = parseFloat(a.value);
2088
+ o = this.validateValue(o), String(o) !== a.value && (a.value = String(o), this.inputValues[t] = o, this.setValue(o)), (r = (l = this.props).onBlur) == null || r.call(l);
2054
2089
  }), i.appendChild(s), this.props.suffix && this.props.suffix !== "none") {
2055
2090
  const n = document.createElement("span");
2056
2091
  n.className = "gap-suffix", n.textContent = this.props.suffix, i.appendChild(n), s.style.paddingRight = "30px";
@@ -2123,9 +2158,9 @@ class Ee extends x {
2123
2158
  return i.font = s, i.measureText(t).width;
2124
2159
  }
2125
2160
  adaptPlaceholderToSingleLine(t, e) {
2126
- const i = window.getComputedStyle(t), s = parseFloat(i.paddingLeft) || 0, n = parseFloat(i.paddingRight) || 0, o = parseFloat(i.borderLeftWidth) || 0, a = parseFloat(i.borderRightWidth) || 0, l = Math.max(
2161
+ const i = window.getComputedStyle(t), s = parseFloat(i.paddingLeft) || 0, n = parseFloat(i.paddingRight) || 0, a = parseFloat(i.borderLeftWidth) || 0, o = parseFloat(i.borderRightWidth) || 0, l = Math.max(
2127
2162
  0,
2128
- t.clientWidth - s - n - o - a
2163
+ t.clientWidth - s - n - a - o
2129
2164
  );
2130
2165
  if (l <= 0) {
2131
2166
  t.placeholder = e;
@@ -2138,16 +2173,16 @@ class Ee extends x {
2138
2173
  const p = "...";
2139
2174
  let c = 0, d = e.length, u = 0;
2140
2175
  for (; c <= d; ) {
2141
- const v = Math.floor((c + d) / 2), m = e.slice(0, v).trimEnd() + p;
2142
- this.measureTextWidth(m, i) <= l ? (u = v, c = v + 1) : d = v - 1;
2176
+ const f = Math.floor((c + d) / 2), m = e.slice(0, f).trimEnd() + p;
2177
+ this.measureTextWidth(m, i) <= l ? (u = f, c = f + 1) : d = f - 1;
2143
2178
  }
2144
2179
  const g = e.slice(0, u).trimEnd() + p;
2145
2180
  t.placeholder = g;
2146
2181
  }
2147
2182
  autosizeTextarea(t, e = 3) {
2148
2183
  t.style.height = "auto";
2149
- const i = window.getComputedStyle(t), s = parseFloat(i.lineHeight) || 20, n = parseFloat(i.paddingTop) + parseFloat(i.paddingBottom), o = parseFloat(i.borderTopWidth) + parseFloat(i.borderBottomWidth), a = s * e + n + o, l = Math.min(t.scrollHeight || 44, a);
2150
- t.style.height = `${l}px`, t.scrollHeight > a ? t.style.overflowY = "auto" : t.style.overflowY = "hidden";
2184
+ const i = window.getComputedStyle(t), s = parseFloat(i.lineHeight) || 20, n = parseFloat(i.paddingTop) + parseFloat(i.paddingBottom), a = parseFloat(i.borderTopWidth) + parseFloat(i.borderBottomWidth), o = s * e + n + a, l = Math.min(t.scrollHeight || 44, o);
2185
+ t.style.height = `${l}px`, t.scrollHeight > o ? t.style.overflowY = "auto" : t.style.overflowY = "hidden";
2151
2186
  }
2152
2187
  createTextareaRow(t, e) {
2153
2188
  const i = document.createElement("div");
@@ -2159,19 +2194,19 @@ class Ee extends x {
2159
2194
  title: "",
2160
2195
  id: `${this.id}_upload_${t}`
2161
2196
  });
2162
- n.setOnChange((a) => {
2163
- this.updateLanguageValue(t, a), t === this.defaultLanguage && this.updateOtherLanguagePlaceholders(a);
2197
+ n.setOnChange((o) => {
2198
+ this.updateLanguageValue(t, o), t === this.defaultLanguage && this.updateOtherLanguagePlaceholders(o);
2164
2199
  }), this.uploadSettings.set(t, n);
2165
- const o = n.draw();
2166
- o.classList.add("simple-language-upload"), i.appendChild(o);
2200
+ const a = n.draw();
2201
+ a.classList.add("simple-language-upload"), i.appendChild(a);
2167
2202
  } else {
2168
2203
  const n = document.createElement("textarea");
2169
2204
  n.id = `textarea-${t}`, n.classList.add("simple-language-textarea"), n.value = e || "", n.rows = 1, n.style.overflowY = "hidden";
2170
- let o = this.props.placeholder || "Enter text in {language}...";
2171
- o.includes("{language}") && (o = o.replace(
2205
+ let a = this.props.placeholder || "Enter text in {language}...";
2206
+ a.includes("{language}") && (a = a.replace(
2172
2207
  "{language}",
2173
2208
  t.toUpperCase()
2174
- )), n.setAttribute("data-full-placeholder", o), this.adaptPlaceholderToSingleLine(n, o), this.getDataPropsPath() && n.setAttribute(
2209
+ )), n.setAttribute("data-full-placeholder", a), this.adaptPlaceholderToSingleLine(n, a), this.getDataPropsPath() && n.setAttribute(
2175
2210
  "data-test-id",
2176
2211
  `${this.getDataPropsPath()}_${t}`
2177
2212
  ), n.addEventListener("input", (l) => {
@@ -2200,11 +2235,11 @@ class Ee extends x {
2200
2235
  `#textarea-${e}`
2201
2236
  );
2202
2237
  if (i && (!i.value || i.value.trim() === "")) {
2203
- const o = t || ((n = this.props.placeholder) == null ? void 0 : n.replace(
2238
+ const a = t || ((n = this.props.placeholder) == null ? void 0 : n.replace(
2204
2239
  "{language}",
2205
2240
  e.toUpperCase()
2206
2241
  )) || `Enter text in ${e.toUpperCase()}...`;
2207
- i.setAttribute("data-full-placeholder", o), this.adaptPlaceholderToSingleLine(i, o);
2242
+ i.setAttribute("data-full-placeholder", a), this.adaptPlaceholderToSingleLine(i, a);
2208
2243
  }
2209
2244
  });
2210
2245
  }
@@ -2216,17 +2251,17 @@ class Ee extends x {
2216
2251
  }
2217
2252
  const e = document.createElement("div");
2218
2253
  e.classList.add("simple-multi-language-content"), this.props.languages.forEach((s) => {
2219
- var a;
2220
- const n = ((a = this.value) == null ? void 0 : a[s]) || "", o = this.createTextareaRow(s, n);
2221
- e.appendChild(o);
2254
+ var o;
2255
+ const n = ((o = this.value) == null ? void 0 : o[s]) || "", a = this.createTextareaRow(s, n);
2256
+ e.appendChild(a);
2222
2257
  }), t.appendChild(e), this.container = t;
2223
2258
  const i = () => {
2224
2259
  if (!this.container) return;
2225
2260
  this.container.querySelectorAll(
2226
2261
  ".simple-language-textarea"
2227
2262
  ).forEach((n) => {
2228
- const o = n.getAttribute("data-full-placeholder") || "";
2229
- o && this.adaptPlaceholderToSingleLine(n, o);
2263
+ const a = n.getAttribute("data-full-placeholder") || "";
2264
+ a && this.adaptPlaceholderToSingleLine(n, a);
2230
2265
  });
2231
2266
  };
2232
2267
  return window.addEventListener("resize", i), t;
@@ -2278,17 +2313,17 @@ class we extends x {
2278
2313
  }
2279
2314
  }
2280
2315
  const ht = (h, t, e) => {
2281
- let i = !1, s = 0, n = 0, o = 0, a = 0;
2316
+ let i = !1, s = 0, n = 0, a = 0, o = 0;
2282
2317
  const l = (c) => {
2283
2318
  if (c.target.closest("button")) return;
2284
2319
  i = !0, s = c.clientX, n = c.clientY;
2285
2320
  const d = t.getBoundingClientRect();
2286
- o = d.left, a = d.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", p), document.body.style.userSelect = "none";
2321
+ a = d.left, o = d.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", p), document.body.style.userSelect = "none";
2287
2322
  }, r = (c) => {
2288
2323
  if (!i) return;
2289
- const d = c.clientX - s, u = c.clientY - n, g = window.innerWidth, v = window.innerHeight, m = t.offsetWidth, f = t.offsetHeight;
2290
- let C = o + d, w = a + u;
2291
- C = Math.max(8, Math.min(g - m - 8, C)), w = Math.max(8, Math.min(v - f - 8, w)), t.style.left = `${C}px`, t.style.top = `${w}px`, e == null || e(C, w);
2324
+ const d = c.clientX - s, u = c.clientY - n, g = window.innerWidth, f = window.innerHeight, m = t.offsetWidth, v = t.offsetHeight;
2325
+ let C = a + d, w = o + u;
2326
+ C = Math.max(8, Math.min(g - m - 8, C)), w = Math.max(8, Math.min(f - v - 8, w)), t.style.left = `${C}px`, t.style.top = `${w}px`, e == null || e(C, w);
2292
2327
  }, p = () => {
2293
2328
  i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", p), document.body.style.userSelect = "";
2294
2329
  };
@@ -2305,35 +2340,35 @@ const ht = (h, t, e) => {
2305
2340
  b: parseInt(e.slice(4, 6), 16)
2306
2341
  };
2307
2342
  }, G = (h) => {
2308
- const { r: t, g: e, b: i } = S(h), s = t / 255, n = e / 255, o = i / 255, a = Math.max(s, n, o), l = Math.min(s, n, o), r = a - l;
2343
+ const { r: t, g: e, b: i } = S(h), s = t / 255, n = e / 255, a = i / 255, o = Math.max(s, n, a), l = Math.min(s, n, a), r = o - l;
2309
2344
  let p = 0;
2310
- r !== 0 && (a === s ? p = (n - o) / r % 6 : a === n ? p = (o - s) / r + 2 : p = (s - n) / r + 4), p < 0 && (p += 6);
2311
- const c = a === 0 ? 0 : r / a, d = a;
2345
+ r !== 0 && (o === s ? p = (n - a) / r % 6 : o === n ? p = (a - s) / r + 2 : p = (s - n) / r + 4), p < 0 && (p += 6);
2346
+ const c = o === 0 ? 0 : r / o, d = o;
2312
2347
  return { h: p * 60, s: c, v: d };
2313
2348
  }, F = (h, t, e) => {
2314
- const i = (h % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
2315
- let a = 0, l = 0, r = 0;
2316
- 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), _(
2317
- Math.round((a + o) * 255),
2318
- Math.round((l + o) * 255),
2319
- Math.round((r + o) * 255)
2349
+ const i = (h % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), a = e - s;
2350
+ let o = 0, l = 0, r = 0;
2351
+ return i < 60 ? (o = s, l = n, r = 0) : i < 120 ? (o = n, l = s, r = 0) : i < 180 ? (o = 0, l = s, r = n) : i < 240 ? (o = 0, l = n, r = s) : i < 300 ? (o = n, l = 0, r = s) : (o = s, l = 0, r = n), _(
2352
+ Math.round((o + a) * 255),
2353
+ Math.round((l + a) * 255),
2354
+ Math.round((r + a) * 255)
2320
2355
  );
2321
2356
  }, dt = (h, t, e) => {
2322
2357
  const i = e * (1 - t / 2), s = i === 0 || i === 1 ? 0 : (e - i) / Math.min(i, 1 - i);
2323
2358
  return { hue: h, sat: s, lightness: i };
2324
2359
  }, et = (h, t, e) => {
2325
2360
  const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(h / 60 % 2 - 1)), n = e - i / 2;
2326
- let o = 0, a = 0, l = 0;
2327
- return h < 60 ? (o = i, a = s, l = 0) : h < 120 ? (o = s, a = i, l = 0) : h < 180 ? (o = 0, a = i, l = s) : h < 240 ? (o = 0, a = s, l = i) : h < 300 ? (o = s, a = 0, l = i) : (o = i, a = 0, l = s), {
2328
- r: Math.round((o + n) * 255),
2329
- g: Math.round((a + n) * 255),
2361
+ let a = 0, o = 0, l = 0;
2362
+ return h < 60 ? (a = i, o = s, l = 0) : h < 120 ? (a = s, o = i, l = 0) : h < 180 ? (a = 0, o = i, l = s) : h < 240 ? (a = 0, o = s, l = i) : h < 300 ? (a = s, o = 0, l = i) : (a = i, o = 0, l = s), {
2363
+ r: Math.round((a + n) * 255),
2364
+ g: Math.round((o + n) * 255),
2330
2365
  b: Math.round((l + n) * 255)
2331
2366
  };
2332
2367
  }, pt = (h, t) => {
2333
2368
  const e = Math.max(0, Math.min(100, t)) / 100;
2334
2369
  if (h.startsWith("#")) {
2335
- const { r: s, g: n, b: o } = S(h);
2336
- return `rgba(${s}, ${n}, ${o}, ${e})`;
2370
+ const { r: s, g: n, b: a } = S(h);
2371
+ return `rgba(${s}, ${n}, ${a}, ${e})`;
2337
2372
  }
2338
2373
  if (h.startsWith("rgba("))
2339
2374
  return h.replace(/,\s*[\d.]+\)$/, `, ${e})`);
@@ -2342,29 +2377,29 @@ const ht = (h, t, e) => {
2342
2377
  if (h.startsWith("hsl(")) {
2343
2378
  const s = h.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2344
2379
  if (s) {
2345
- const { r: n, g: o, b: a } = et(
2380
+ const { r: n, g: a, b: o } = et(
2346
2381
  parseInt(s[1]),
2347
2382
  parseInt(s[2]) / 100,
2348
2383
  parseInt(s[3]) / 100
2349
2384
  );
2350
- return `rgba(${n}, ${o}, ${a}, ${e})`;
2385
+ return `rgba(${n}, ${a}, ${o}, ${e})`;
2351
2386
  }
2352
2387
  }
2353
2388
  if (h.startsWith("hsla(")) {
2354
2389
  const s = h.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
2355
2390
  if (s) {
2356
- const { r: n, g: o, b: a } = et(
2391
+ const { r: n, g: a, b: o } = et(
2357
2392
  parseInt(s[1]),
2358
2393
  parseInt(s[2]) / 100,
2359
2394
  parseInt(s[3]) / 100
2360
2395
  );
2361
- return `rgba(${n}, ${o}, ${a}, ${e})`;
2396
+ return `rgba(${n}, ${a}, ${o}, ${e})`;
2362
2397
  }
2363
2398
  }
2364
2399
  const i = W(h);
2365
2400
  if (i) {
2366
- const { r: s, g: n, b: o } = S(i);
2367
- return `rgba(${s}, ${n}, ${o}, ${e})`;
2401
+ const { r: s, g: n, b: a } = S(i);
2402
+ return `rgba(${s}, ${n}, ${a}, ${e})`;
2368
2403
  }
2369
2404
  return h;
2370
2405
  }, Wt = (h) => [
@@ -2404,9 +2439,9 @@ const ht = (h, t, e) => {
2404
2439
  }, gt = (h) => {
2405
2440
  const t = h.trim();
2406
2441
  if (/^#[0-9A-Fa-f]{8}$/.test(t)) {
2407
- 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);
2442
+ const n = t.slice(1), a = parseInt(n.slice(0, 2), 16), o = parseInt(n.slice(2, 4), 16), l = parseInt(n.slice(4, 6), 16), r = parseInt(n.slice(6, 8), 16);
2408
2443
  return {
2409
- color: _(o, a, l),
2444
+ color: _(a, o, l),
2410
2445
  position: 0,
2411
2446
  opacity: Math.round(r / 255 * 100)
2412
2447
  };
@@ -2415,9 +2450,9 @@ const ht = (h, t, e) => {
2415
2450
  /rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/
2416
2451
  );
2417
2452
  if (e) {
2418
- const n = parseInt(e[1]), o = parseInt(e[2]), a = parseInt(e[3]), l = e[4] ? parseFloat(e[4]) : 1;
2453
+ const n = parseInt(e[1]), a = parseInt(e[2]), o = parseInt(e[3]), l = e[4] ? parseFloat(e[4]) : 1;
2419
2454
  return {
2420
- color: _(n, o, a),
2455
+ color: _(n, a, o),
2421
2456
  position: 0,
2422
2457
  opacity: Math.round(l * 100)
2423
2458
  };
@@ -2426,13 +2461,13 @@ const ht = (h, t, e) => {
2426
2461
  /hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/
2427
2462
  );
2428
2463
  if (i) {
2429
- const { r: n, g: o, b: a } = et(
2464
+ const { r: n, g: a, b: o } = et(
2430
2465
  parseFloat(i[1]),
2431
2466
  parseFloat(i[2]) / 100,
2432
2467
  parseFloat(i[3]) / 100
2433
2468
  ), l = i[4] ? parseFloat(i[4]) : 1;
2434
2469
  return {
2435
- color: _(n, o, a),
2470
+ color: _(n, a, o),
2436
2471
  position: 0,
2437
2472
  opacity: Math.round(l * 100)
2438
2473
  };
@@ -2456,10 +2491,10 @@ const ht = (h, t, e) => {
2456
2491
  const e = new RegExp(`${t}\\s*\\(`, "i"), i = h.match(e);
2457
2492
  if (!i) return null;
2458
2493
  const s = i.index + i[0].length;
2459
- let n = 1, o = s;
2460
- for (let a = s; a < h.length && n > 0; a++)
2461
- h[a] === "(" ? n++ : h[a] === ")" && n--, o = a;
2462
- return n === 0 ? h.substring(s, o) : null;
2494
+ let n = 1, a = s;
2495
+ for (let o = s; o < h.length && n > 0; o++)
2496
+ h[o] === "(" ? n++ : h[o] === ")" && n--, a = o;
2497
+ return n === 0 ? h.substring(s, a) : null;
2463
2498
  }, zt = (h) => {
2464
2499
  const t = h.split(" ")[0].toLowerCase();
2465
2500
  return [
@@ -2478,11 +2513,11 @@ const ht = (h, t, e) => {
2478
2513
  return h.forEach((e, i) => {
2479
2514
  const s = e.trim();
2480
2515
  if (!s) return;
2481
- let n = "", o = 0;
2482
- const a = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
2483
- a && ut(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = h.length === 1 ? 0 : i / (h.length - 1) * 100);
2516
+ let n = "", a = 0;
2517
+ const o = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
2518
+ o && ut(o[1].trim()) ? (n = o[1].trim(), a = parseFloat(o[2])) : (n = s, a = h.length === 1 ? 0 : i / (h.length - 1) * 100);
2484
2519
  const l = gt(n);
2485
- l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
2520
+ l.position = Math.max(0, Math.min(100, Math.round(a))), t.push(l);
2486
2521
  }), t;
2487
2522
  }, O = (h) => {
2488
2523
  const t = h.stops && h.stops.length ? h.stops : [{ color: "#000000", position: 0, opacity: 100 }];
@@ -2504,12 +2539,12 @@ const ht = (h, t, e) => {
2504
2539
  const e = at(t, "linear-gradient");
2505
2540
  if (e) {
2506
2541
  const s = ot(e);
2507
- let n = 90, o = s;
2508
- const a = s[0];
2509
- if (a.includes("deg")) {
2510
- const r = a.match(/(-?\d+(?:\.\d+)?)deg/);
2511
- r && (n = parseFloat(r[1]), o = s.slice(1));
2512
- } else a.includes("to ") && (n = {
2542
+ let n = 90, a = s;
2543
+ const o = s[0];
2544
+ if (o.includes("deg")) {
2545
+ const r = o.match(/(-?\d+(?:\.\d+)?)deg/);
2546
+ r && (n = parseFloat(r[1]), a = s.slice(1));
2547
+ } else o.includes("to ") && (n = {
2513
2548
  "to right": 90,
2514
2549
  "to left": 270,
2515
2550
  "to bottom": 180,
@@ -2518,14 +2553,14 @@ const ht = (h, t, e) => {
2518
2553
  "to bottom left": 225,
2519
2554
  "to top right": 45,
2520
2555
  "to top left": 315
2521
- }[a] ?? 90, o = s.slice(1));
2522
- const l = lt(o);
2556
+ }[o] ?? 90, a = s.slice(1));
2557
+ const l = lt(a);
2523
2558
  return l.length ? O({ type: "linear", angle: n, stops: l }) : null;
2524
2559
  }
2525
2560
  const i = at(t, "radial-gradient");
2526
2561
  if (i) {
2527
- const s = ot(i), n = s[0] && !zt(s[0]) ? s.slice(1) : s, o = lt(n);
2528
- return o.length ? O({ type: "radial", angle: 0, stops: o }) : null;
2562
+ const s = ot(i), n = s[0] && !zt(s[0]) ? s.slice(1) : s, a = lt(n);
2563
+ return a.length ? O({ type: "radial", angle: 0, stops: a }) : null;
2529
2564
  }
2530
2565
  return null;
2531
2566
  }, T = (h) => {
@@ -2533,8 +2568,8 @@ const ht = (h, t, e) => {
2533
2568
  const e = h.stops[0], i = e.color;
2534
2569
  if (i.startsWith("var(--"))
2535
2570
  return i;
2536
- const s = e.opacity ?? 100, n = i.replace("#", ""), o = Math.round(s / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
2537
- return `#${n}${o}`;
2571
+ const s = e.opacity ?? 100, n = i.replace("#", ""), a = Math.round(s / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
2572
+ return `#${n}${a}`;
2538
2573
  }
2539
2574
  const t = h.stops.map(
2540
2575
  (e) => `${pt(e.color, e.opacity ?? 100)} ${e.position}%`
@@ -2621,12 +2656,12 @@ const ht = (h, t, e) => {
2621
2656
  l && (i = t, s = l.type === "solid" ? "solid" : "gradient");
2622
2657
  }
2623
2658
  if (!i) return;
2624
- const n = e === "all" ? s : e, o = this.list(n), a = o.indexOf(i);
2625
- a !== -1 && o.splice(a, 1), o.unshift(i), o.length > this.MAX_COLORS && (o.length = this.MAX_COLORS), this.persist();
2659
+ const n = e === "all" ? s : e, a = this.list(n), o = a.indexOf(i);
2660
+ o !== -1 && a.splice(o, 1), a.unshift(i), a.length > this.MAX_COLORS && (a.length = this.MAX_COLORS), this.persist();
2626
2661
  }
2627
2662
  };
2628
2663
  U.STORAGE_KEY = "settingsLib_recentColors", U.MAX_COLORS = 12, U.colors = null;
2629
- let B = U;
2664
+ let D = U;
2630
2665
  const it = (h, t) => {
2631
2666
  const e = document.createElement("div");
2632
2667
  e.className = "color-picker-recent-section";
@@ -2636,25 +2671,25 @@ const it = (h, t) => {
2636
2671
  s.className = "color-picker-tooltip", s.style.display = "none", e.appendChild(s);
2637
2672
  const n = () => {
2638
2673
  s.style.display = "none";
2639
- }, o = (p, c) => {
2674
+ }, a = (p, c) => {
2640
2675
  const d = p.getBoundingClientRect();
2641
2676
  s.textContent = c, s.style.left = `${d.left + d.width / 2}px`, s.style.top = `${d.bottom + 8}px`, s.style.display = "block";
2642
- }, a = document.createElement("div");
2643
- a.className = "color-picker-recent-grid";
2677
+ }, o = document.createElement("div");
2678
+ o.className = "color-picker-recent-grid";
2644
2679
  const l = document.createElement("div");
2645
- l.className = "color-picker-recent-placeholder", l.textContent = "No recent colors yet", e.appendChild(i), e.appendChild(a), e.appendChild(l);
2680
+ l.className = "color-picker-recent-placeholder", l.textContent = "No recent colors yet", e.appendChild(i), e.appendChild(o), e.appendChild(l);
2646
2681
  const r = () => {
2647
- n(), a.innerHTML = "";
2648
- const p = B.getColors(t);
2682
+ n(), o.innerHTML = "";
2683
+ const p = D.getColors(t);
2649
2684
  if (p.length === 0) {
2650
- a.style.display = "none", l.style.display = "block";
2685
+ o.style.display = "none", l.style.display = "block";
2651
2686
  return;
2652
2687
  }
2653
- a.style.display = "grid", l.style.display = "none", p.forEach((c) => {
2688
+ o.style.display = "grid", l.style.display = "none", p.forEach((c) => {
2654
2689
  const d = document.createElement("button");
2655
2690
  d.type = "button", d.className = "color-picker-recent-swatch";
2656
2691
  const u = qt(c);
2657
- d.title = u, d.setAttribute("aria-label", `Use color: ${u}`), d.style.background = c, d.style.borderColor = c, d.addEventListener("mouseenter", () => o(d, u)), d.addEventListener("mouseleave", () => {
2692
+ d.title = u, d.setAttribute("aria-label", `Use color: ${u}`), d.style.background = c, d.style.borderColor = c, d.addEventListener("mouseenter", () => a(d, u)), d.addEventListener("mouseleave", () => {
2658
2693
  n(), d.style.boxShadow = "";
2659
2694
  }), d.addEventListener("mousedown", () => {
2660
2695
  d.style.boxShadow = "0px 0px 0px 2px var(--grey40)";
@@ -2664,7 +2699,7 @@ const it = (h, t) => {
2664
2699
  }, 150);
2665
2700
  }), d.addEventListener("click", () => {
2666
2701
  n(), h(c);
2667
- }), a.appendChild(d);
2702
+ }), o.appendChild(d);
2668
2703
  });
2669
2704
  };
2670
2705
  return r(), { container: e, refresh: r };
@@ -2682,7 +2717,7 @@ const it = (h, t) => {
2682
2717
  <path fill-rule="evenodd" clip-rule="evenodd"
2683
2718
  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"
2684
2719
  fill="#919EAB"/>
2685
- </svg>`, vt = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2720
+ </svg>`, ft = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2686
2721
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
2687
2722
  </svg>`, _t = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2688
2723
  <path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
@@ -2719,8 +2754,8 @@ class Yt {
2719
2754
  if (Array.from(n).some(
2720
2755
  (l) => l.contains(s)
2721
2756
  )) return;
2722
- const a = document.querySelector(".gradient-popover");
2723
- a && a.contains(s) || (i.preventDefault(), i.stopPropagation(), this.close(!0));
2757
+ const o = document.querySelector(".gradient-popover");
2758
+ o && o.contains(s) || (i.preventDefault(), i.stopPropagation(), this.close(!0));
2724
2759
  }, this.keyDown = (i) => {
2725
2760
  if (this.isOpen) {
2726
2761
  if (i.key === "Escape")
@@ -2748,12 +2783,12 @@ class Yt {
2748
2783
  s.className = "color-picker-close", s.innerHTML = mt, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), ht(e, t);
2749
2784
  const n = document.createElement("div");
2750
2785
  n.className = "color-picker-area", this.colorArea = n;
2751
- const o = document.createElement("div");
2752
- o.className = "color-picker-marker", this.colorMarker = o, n.appendChild(o);
2753
2786
  const a = document.createElement("div");
2754
- a.className = "color-picker-sliders-container";
2787
+ a.className = "color-picker-marker", this.colorMarker = a, n.appendChild(a);
2788
+ const o = document.createElement("div");
2789
+ o.className = "color-picker-sliders-container";
2755
2790
  const l = document.createElement("button");
2756
- l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = vt;
2791
+ l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = ft;
2757
2792
  const r = document.createElement("div");
2758
2793
  r.className = "color-picker-sliders-group";
2759
2794
  const p = document.createElement("div");
@@ -2763,28 +2798,28 @@ class Yt {
2763
2798
  const d = document.createElement("div");
2764
2799
  d.className = "color-picker-opacity", this.opacitySlider = d;
2765
2800
  const u = document.createElement("div");
2766
- u.className = "color-picker-opacity-marker", this.opacityMarker = u, d.appendChild(u), r.appendChild(p), r.appendChild(d), a.appendChild(l), a.appendChild(r);
2801
+ u.className = "color-picker-opacity-marker", this.opacityMarker = u, d.appendChild(u), r.appendChild(p), r.appendChild(d), o.appendChild(l), o.appendChild(r);
2767
2802
  const g = it((b) => {
2768
- var L;
2769
- this.setColor(b), (L = this.onChange) == null || L.call(this, b, this.currentOpacity);
2803
+ var k;
2804
+ this.setColor(b), (k = this.onChange) == null || k.call(this, b, this.currentOpacity);
2770
2805
  }, this.recentScope);
2771
2806
  this.recentSectionRefresh = g.refresh;
2772
- const v = document.createElement("div");
2773
- v.className = "color-picker-format-section";
2807
+ const f = document.createElement("div");
2808
+ f.className = "color-picker-format-section";
2774
2809
  const m = document.createElement("select");
2775
2810
  m.className = "color-picker-format-select", this.select = m;
2776
- const f = document.createElement("option");
2777
- f.value = "hex", f.textContent = "HEX";
2811
+ const v = document.createElement("option");
2812
+ v.value = "hex", v.textContent = "HEX";
2778
2813
  const C = document.createElement("option");
2779
2814
  C.value = "rgb", C.textContent = "RGB";
2780
2815
  const w = document.createElement("option");
2781
- w.value = "hsl", w.textContent = "HSL", m.appendChild(f), m.appendChild(C), m.appendChild(w);
2816
+ w.value = "hsl", w.textContent = "HSL", m.appendChild(v), m.appendChild(C), m.appendChild(w);
2782
2817
  const E = document.createElement("input");
2783
2818
  E.type = "text", E.className = "color-picker-color-input", E.value = this.currentColor, this.input = E;
2784
- const k = document.createElement("div");
2785
- k.className = "color-picker-input-container";
2819
+ const M = document.createElement("div");
2820
+ M.className = "color-picker-input-container";
2786
2821
  const y = document.createElement("button");
2787
- return y.className = "color-picker-copy-inside", y.textContent = "Copy", k.appendChild(E), k.appendChild(y), v.appendChild(m), v.appendChild(k), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(g.container), t.appendChild(v), t.addEventListener("click", (b) => b.stopPropagation()), this.bind(n, p, d, E, m, y, l), t;
2822
+ return y.className = "color-picker-copy-inside", y.textContent = "Copy", M.appendChild(E), M.appendChild(y), f.appendChild(m), f.appendChild(M), t.appendChild(e), t.appendChild(n), t.appendChild(o), t.appendChild(g.container), t.appendChild(f), t.addEventListener("click", (b) => b.stopPropagation()), this.bind(n, p, d, E, m, y, l), t;
2788
2823
  }
2789
2824
  createBackdrop() {
2790
2825
  const t = document.createElement("div");
@@ -2792,20 +2827,20 @@ class Yt {
2792
2827
  e.preventDefault(), e.stopPropagation(), this.close(!0);
2793
2828
  }), t;
2794
2829
  }
2795
- bind(t, e, i, s, n, o, a) {
2830
+ bind(t, e, i, s, n, a, o) {
2796
2831
  const l = (c) => {
2797
2832
  var C;
2798
2833
  const d = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width)), g = Math.max(0, Math.min(1, (c.clientY - d.top) / d.height));
2799
2834
  this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${g * 100}%`;
2800
- const m = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, f = F(m, u, 1 - g);
2801
- this.currentColor = f, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, f, this.currentOpacity);
2835
+ const m = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, v = F(m, u, 1 - g);
2836
+ this.currentColor = v, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, v, this.currentOpacity);
2802
2837
  }, r = (c) => {
2803
2838
  var C;
2804
2839
  const d = e.getBoundingClientRect();
2805
2840
  let u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width));
2806
2841
  this.hueMarker.style.left = `${u * 100}%`;
2807
- const g = u * 360, v = this.parsePercentage(this.colorMarker.style.left || "0%"), m = this.parsePercentage(this.colorMarker.style.top || "0%"), f = F(g, v, 1 - m);
2808
- this.currentColor = f, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, f, this.currentOpacity);
2842
+ const g = u * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), m = this.parsePercentage(this.colorMarker.style.top || "0%"), v = F(g, f, 1 - m);
2843
+ this.currentColor = v, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (C = this.onChange) == null || C.call(this, v, this.currentOpacity);
2809
2844
  }, p = (c) => {
2810
2845
  var g;
2811
2846
  const d = i.getBoundingClientRect(), u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width));
@@ -2831,13 +2866,13 @@ class Yt {
2831
2866
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
2832
2867
  }), n.addEventListener("change", () => this.syncInput()), s.addEventListener("input", () => this.applyFromInput()), s.addEventListener("blur", () => this.syncInput()), s.addEventListener("keydown", (c) => {
2833
2868
  c.key === "Enter" && (c.preventDefault(), this.syncInput(), s.blur());
2834
- }), o.addEventListener("click", async () => {
2869
+ }), a.addEventListener("click", async () => {
2835
2870
  try {
2836
2871
  await navigator.clipboard.writeText(s.value);
2837
2872
  } catch {
2838
2873
  s.select(), document.execCommand("copy");
2839
2874
  }
2840
- }), a.addEventListener("click", async () => {
2875
+ }), o.addEventListener("click", async () => {
2841
2876
  var c;
2842
2877
  if (!("EyeDropper" in window)) {
2843
2878
  alert("EyeDropper API is not supported in this browser.");
@@ -2854,22 +2889,22 @@ class Yt {
2854
2889
  );
2855
2890
  }
2856
2891
  setColor(t) {
2857
- var o;
2892
+ var a;
2858
2893
  this.currentColor = t;
2859
2894
  const { h: e, s: i, v: s } = G(t), n = e >= 360 ? e % 360 : e;
2860
- this.hueMarker.style.left = `${n / 360 * 100}%`, this.colorMarker.style.left = `${i * 100}%`, this.colorMarker.style.top = `${(1 - s) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (o = this.onChange) == null || o.call(this, t, this.currentOpacity);
2895
+ this.hueMarker.style.left = `${n / 360 * 100}%`, this.colorMarker.style.left = `${i * 100}%`, this.colorMarker.style.top = `${(1 - s) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (a = this.onChange) == null || a.call(this, t, this.currentOpacity);
2861
2896
  }
2862
2897
  syncInput() {
2863
2898
  const t = this.select.value, { h: e, s: i, v: s } = G(this.currentColor);
2864
2899
  if (t === "hex") this.input.value = this.currentColor;
2865
2900
  else if (t === "rgb") {
2866
- const { r: n, g: o, b: a } = S(this.currentColor);
2867
- this.input.value = `rgb(${n}, ${o}, ${a})`;
2901
+ const { r: n, g: a, b: o } = S(this.currentColor);
2902
+ this.input.value = `rgb(${n}, ${a}, ${o})`;
2868
2903
  } else {
2869
- const { hue: n, sat: o, lightness: a } = dt(e, i, s);
2904
+ const { hue: n, sat: a, lightness: o } = dt(e, i, s);
2870
2905
  this.input.value = `hsl(${Math.round(n)}, ${Math.round(
2871
- o * 100
2872
- )}%, ${Math.round(a * 100)}%)`;
2906
+ a * 100
2907
+ )}%, ${Math.round(o * 100)}%)`;
2873
2908
  }
2874
2909
  }
2875
2910
  applyFromInput() {
@@ -2879,12 +2914,12 @@ class Yt {
2879
2914
  else {
2880
2915
  const i = t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
2881
2916
  if (i) {
2882
- const s = parseInt(i[1]), n = parseInt(i[2]), o = parseInt(i[3]);
2883
- s <= 255 && n <= 255 && o <= 255 && (e = `#${[s, n, o].map((a) => a.toString(16).padStart(2, "0")).join("")}`);
2917
+ const s = parseInt(i[1]), n = parseInt(i[2]), a = parseInt(i[3]);
2918
+ s <= 255 && n <= 255 && a <= 255 && (e = `#${[s, n, a].map((o) => o.toString(16).padStart(2, "0")).join("")}`);
2884
2919
  } else {
2885
2920
  const s = t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2886
2921
  if (s) {
2887
- const n = parseInt(s[1]), o = parseInt(s[2]) / 100, a = parseInt(s[3]) / 100, l = a + o * Math.min(a, 1 - a), r = l === 0 ? 0 : 2 * (1 - a / l);
2922
+ const n = parseInt(s[1]), a = parseInt(s[2]) / 100, o = parseInt(s[3]) / 100, l = o + a * Math.min(o, 1 - o), r = l === 0 ? 0 : 2 * (1 - o / l);
2888
2923
  e = F(n, r, l);
2889
2924
  }
2890
2925
  }
@@ -2901,18 +2936,18 @@ class Yt {
2901
2936
  open(t, e, i) {
2902
2937
  var w;
2903
2938
  this.currentColor = t, this.currentOpacity = i ?? 100, this.syncInput();
2904
- const { h: s, s: n, v: o } = G(t);
2905
- 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}%`, (w = this.recentSectionRefresh) == null || w.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);
2906
- const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), p = window.innerWidth, c = window.innerHeight, d = 16;
2939
+ const { h: s, s: n, v: a } = G(t);
2940
+ this.hueMarker.style.left = `${s / 360 * 100}%`, this.colorMarker.style.left = `${n * 100}%`, this.colorMarker.style.top = `${(1 - a) * 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}%`, (w = this.recentSectionRefresh) == null || w.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);
2941
+ const o = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), p = window.innerWidth, c = window.innerHeight, d = 16;
2907
2942
  let u = r.right + 8, g = r.top;
2908
- const v = p - r.right, m = r.left;
2909
- v >= a + d ? u = r.right + 8 : m >= a + d ? u = r.left - a - 8 : u = Math.max(d, (p - a) / 2);
2910
- const f = c - r.bottom, C = r.top;
2911
- f >= l + d ? g = r.bottom + 8 : C >= l + d ? g = r.top - l - 8 : f > C ? (g = r.bottom + 8, g + l > c - d && (g = c - l - d)) : (g = r.top - l - 8, g < d && (g = d)), this.element.style.left = `${u}px`, this.element.style.top = `${g}px`;
2943
+ const f = p - r.right, m = r.left;
2944
+ f >= o + d ? u = r.right + 8 : m >= o + d ? u = r.left - o - 8 : u = Math.max(d, (p - o) / 2);
2945
+ const v = c - r.bottom, C = r.top;
2946
+ v >= l + d ? g = r.bottom + 8 : C >= l + d ? g = r.top - l - 8 : v > C ? (g = r.bottom + 8, g + l > c - d && (g = c - l - d)) : (g = r.top - l - 8, g < d && (g = d)), this.element.style.left = `${u}px`, this.element.style.top = `${g}px`;
2912
2947
  }
2913
2948
  close(t) {
2914
2949
  var e;
2915
- this.isOpen && (this.isOpen = !1, this.backdrop.style.display = "none", this.element.style.display = "none", document.removeEventListener("click", this.outsideClick, !0), document.removeEventListener("keydown", this.keyDown, !0), t && this.onChange && this.recentScope === "solid" && (B.addColor(this.currentColor, this.recentScope), (e = this.recentSectionRefresh) == null || e.call(this)));
2950
+ this.isOpen && (this.isOpen = !1, this.backdrop.style.display = "none", this.element.style.display = "none", document.removeEventListener("click", this.outsideClick, !0), document.removeEventListener("keydown", this.keyDown, !0), t && this.onChange && this.recentScope === "solid" && (D.addColor(this.currentColor, this.recentScope), (e = this.recentSectionRefresh) == null || e.call(this)));
2916
2951
  }
2917
2952
  getElement() {
2918
2953
  return this.element;
@@ -2936,20 +2971,20 @@ class Qt {
2936
2971
  const s = document.createElement("div");
2937
2972
  s.className = "color-picker-sliders-container embedded";
2938
2973
  const n = document.createElement("button");
2939
- n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML = vt;
2940
- const o = document.createElement("div");
2941
- o.className = "color-picker-sliders-group";
2974
+ n.className = "color-picker-eyedropper", n.type = "button", n.innerHTML = ft;
2942
2975
  const a = document.createElement("div");
2943
- a.className = "color-picker-hue embedded", this.hueSlider = a;
2976
+ a.className = "color-picker-sliders-group";
2977
+ const o = document.createElement("div");
2978
+ o.className = "color-picker-hue embedded", this.hueSlider = o;
2944
2979
  const l = document.createElement("div");
2945
- l.className = "color-picker-hue-marker", this.hueMarker = l, a.appendChild(l);
2980
+ l.className = "color-picker-hue-marker", this.hueMarker = l, o.appendChild(l);
2946
2981
  const r = document.createElement("div");
2947
2982
  r.className = "color-picker-opacity embedded", this.opacitySlider = r;
2948
2983
  const p = document.createElement("div");
2949
- p.className = "color-picker-opacity-marker", this.opacityMarker = p, r.appendChild(p), o.appendChild(a), o.appendChild(r), s.appendChild(n), s.appendChild(o);
2984
+ p.className = "color-picker-opacity-marker", this.opacityMarker = p, r.appendChild(p), a.appendChild(o), a.appendChild(r), s.appendChild(n), s.appendChild(a);
2950
2985
  const c = it((E) => {
2951
- const k = I(E);
2952
- k && k.type !== "solid" ? this.onColorChange(E, this.currentOpacity) : (this.setColor(E), this.onColorChange(this.currentColor, this.currentOpacity));
2986
+ const M = I(E);
2987
+ M && M.type !== "solid" ? this.onColorChange(E, this.currentOpacity) : (this.setColor(E), this.onColorChange(this.currentColor, this.currentOpacity));
2953
2988
  }, "all");
2954
2989
  this.recentSectionRefresh = c.refresh;
2955
2990
  const d = document.createElement("div");
@@ -2958,28 +2993,28 @@ class Qt {
2958
2993
  u.className = "color-picker-format-select", this.select = u;
2959
2994
  const g = document.createElement("option");
2960
2995
  g.value = "hex", g.textContent = "HEX";
2961
- const v = document.createElement("option");
2962
- v.value = "rgb", v.textContent = "RGB";
2996
+ const f = document.createElement("option");
2997
+ f.value = "rgb", f.textContent = "RGB";
2963
2998
  const m = document.createElement("option");
2964
- m.value = "hsl", m.textContent = "HSL", u.appendChild(g), u.appendChild(v), u.appendChild(m);
2965
- const f = document.createElement("input");
2966
- f.type = "text", f.className = "color-picker-color-input", this.input = f;
2999
+ m.value = "hsl", m.textContent = "HSL", u.appendChild(g), u.appendChild(f), u.appendChild(m);
3000
+ const v = document.createElement("input");
3001
+ v.type = "text", v.className = "color-picker-color-input", this.input = v;
2967
3002
  const C = document.createElement("div");
2968
3003
  C.className = "color-picker-input-container";
2969
3004
  const w = document.createElement("button");
2970
- return w.className = "color-picker-copy-inside", w.textContent = "Copy", C.appendChild(f), C.appendChild(w), d.appendChild(u), d.appendChild(C), t.appendChild(e), t.appendChild(s), t.appendChild(d), t.appendChild(c.container), this.bind(e, a, r, f, u, w, n), t;
3005
+ return w.className = "color-picker-copy-inside", w.textContent = "Copy", C.appendChild(v), C.appendChild(w), d.appendChild(u), d.appendChild(C), t.appendChild(e), t.appendChild(s), t.appendChild(d), t.appendChild(c.container), this.bind(e, o, r, v, u, w, n), t;
2971
3006
  }
2972
- bind(t, e, i, s, n, o, a) {
3007
+ bind(t, e, i, s, n, a, o) {
2973
3008
  const l = (c) => {
2974
3009
  const d = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width)), g = Math.max(0, Math.min(1, (c.clientY - d.top) / d.height));
2975
3010
  this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${g * 100}%`;
2976
- const m = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, f = F(m, u, 1 - g);
2977
- this.currentColor = f, this.syncInput(), this.updateOpacityBg(), this.queueChange();
3011
+ const m = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, v = F(m, u, 1 - g);
3012
+ this.currentColor = v, this.syncInput(), this.updateOpacityBg(), this.queueChange();
2978
3013
  }, r = (c) => {
2979
3014
  const d = e.getBoundingClientRect(), u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width));
2980
3015
  this.hueMarker.style.left = `${u * 100}%`;
2981
- const g = u * 360, v = this.parsePercentage(this.colorMarker.style.left || "0%"), m = this.parsePercentage(this.colorMarker.style.top || "0%"), f = F(g, v, 1 - m);
2982
- this.currentColor = f, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
3016
+ const g = u * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), m = this.parsePercentage(this.colorMarker.style.top || "0%"), v = F(g, f, 1 - m);
3017
+ this.currentColor = v, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
2983
3018
  linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), this.queueChange();
2984
3019
  }, p = (c) => {
2985
3020
  const d = i.getBoundingClientRect(), u = Math.max(0, Math.min(1, (c.clientX - d.left) / d.width));
@@ -3011,13 +3046,13 @@ class Qt {
3011
3046
  this.syncInput();
3012
3047
  }), s.addEventListener("keydown", (c) => {
3013
3048
  c.key === "Enter" && (c.preventDefault(), this.syncInput(), s.blur());
3014
- }), o.addEventListener("click", async () => {
3049
+ }), a.addEventListener("click", async () => {
3015
3050
  try {
3016
3051
  await navigator.clipboard.writeText(s.value);
3017
3052
  } catch {
3018
3053
  s.select(), document.execCommand("copy");
3019
3054
  }
3020
- }), a.addEventListener("click", async () => {
3055
+ }), o.addEventListener("click", async () => {
3021
3056
  if (!("EyeDropper" in window)) {
3022
3057
  alert("EyeDropper API is not supported in this browser.");
3023
3058
  return;
@@ -3040,13 +3075,13 @@ class Qt {
3040
3075
  if (t === "hex")
3041
3076
  this.input.value = this.currentColor;
3042
3077
  else if (t === "rgb") {
3043
- const { r: n, g: o, b: a } = S(this.currentColor);
3044
- this.input.value = `rgb(${n}, ${o}, ${a})`;
3078
+ const { r: n, g: a, b: o } = S(this.currentColor);
3079
+ this.input.value = `rgb(${n}, ${a}, ${o})`;
3045
3080
  } else {
3046
- const { hue: n, sat: o, lightness: a } = dt(e, i, s);
3081
+ const { hue: n, sat: a, lightness: o } = dt(e, i, s);
3047
3082
  this.input.value = `hsl(${Math.round(n)}, ${Math.round(
3048
- o * 100
3049
- )}%, ${Math.round(a * 100)}%)`;
3083
+ a * 100
3084
+ )}%, ${Math.round(o * 100)}%)`;
3050
3085
  }
3051
3086
  }
3052
3087
  applyFromInput() {
@@ -3057,12 +3092,12 @@ class Qt {
3057
3092
  else {
3058
3093
  const i = t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
3059
3094
  if (i) {
3060
- const s = parseInt(i[1], 10), n = parseInt(i[2], 10), o = parseInt(i[3], 10);
3061
- s <= 255 && n <= 255 && o <= 255 && (e = "#" + [s, n, o].map((a) => a.toString(16).padStart(2, "0")).join(""));
3095
+ const s = parseInt(i[1], 10), n = parseInt(i[2], 10), a = parseInt(i[3], 10);
3096
+ s <= 255 && n <= 255 && a <= 255 && (e = "#" + [s, n, a].map((o) => o.toString(16).padStart(2, "0")).join(""));
3062
3097
  } else {
3063
3098
  const s = t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
3064
3099
  if (s) {
3065
- const n = parseInt(s[1], 10), o = parseInt(s[2], 10) / 100, a = parseInt(s[3], 10) / 100, l = a + o * Math.min(a, 1 - a), r = l === 0 ? 0 : 2 * (1 - a / l);
3100
+ const n = parseInt(s[1], 10), a = parseInt(s[2], 10) / 100, o = parseInt(s[3], 10) / 100, l = o + a * Math.min(o, 1 - o), r = l === 0 ? 0 : 2 * (1 - o / l);
3066
3101
  e = F(n, r, l);
3067
3102
  }
3068
3103
  }
@@ -3090,15 +3125,15 @@ class Qt {
3090
3125
  this.pendingExternalUpdate = void 0, this.initFromColor(t, e);
3091
3126
  }
3092
3127
  initFromColor(t, e) {
3093
- var a;
3128
+ var o;
3094
3129
  this.currentColor = t, this.currentOpacity = e;
3095
- const { h: i, s, v: n } = G(t), o = i >= 360 ? i % 360 : i;
3096
- this.hueMarker.style.left = `${o / 360 * 100}%`, this.colorMarker.style.left = `${s * 100}%`, this.colorMarker.style.top = `${(1 - n) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
3097
- linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`, this.opacityMarker.style.left = `${e}%`, this.updateOpacityBg(), this.syncInput(), (a = this.recentSectionRefresh) == null || a.call(this);
3130
+ const { h: i, s, v: n } = G(t), a = i >= 360 ? i % 360 : i;
3131
+ this.hueMarker.style.left = `${a / 360 * 100}%`, this.colorMarker.style.left = `${s * 100}%`, this.colorMarker.style.top = `${(1 - n) * 100}%`, this.colorArea.style.background = `linear-gradient(to top, #000, transparent),
3132
+ linear-gradient(to right, #fff, hsl(${a}, 100%, 50%))`, this.opacityMarker.style.left = `${e}%`, this.updateOpacityBg(), this.syncInput(), (o = this.recentSectionRefresh) == null || o.call(this);
3098
3133
  }
3099
3134
  commitRecentColor() {
3100
3135
  var t;
3101
- this.recentScope === "solid" && (B.addColor(this.currentColor, this.recentScope), (t = this.recentSectionRefresh) == null || t.call(this));
3136
+ this.recentScope === "solid" && (D.addColor(this.currentColor, this.recentScope), (t = this.recentSectionRefresh) == null || t.call(this));
3102
3137
  }
3103
3138
  getElement() {
3104
3139
  return this.element;
@@ -3125,14 +3160,14 @@ const P = class P extends x {
3125
3160
  }, 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.solidPicker = null, this.pendingSolidColor = null, this.variant = "default", this.globalLayoutMode = "list", this.globalSearchQuery = "", this.currentMode = "custom", this.unlinkButton = null, this.onBackgroundClick = (i) => {
3126
3161
  var d;
3127
3162
  if (!this.popoverEl || !this.isPopoverOpen) return;
3128
- const s = i.target, n = this.popoverEl.contains(s), o = (d = this.element) == null ? void 0 : d.contains(s), a = document.querySelectorAll(".custom-color-picker"), l = Array.from(a).some((u) => u.contains(s)), r = s.closest(
3163
+ const s = i.target, n = this.popoverEl.contains(s), a = (d = this.element) == null ? void 0 : d.contains(s), o = document.querySelectorAll(".custom-color-picker"), l = Array.from(o).some((u) => u.contains(s)), r = s.closest(
3129
3164
  ".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"
3130
3165
  ), p = s.classList.contains(
3131
3166
  "color-picker-backdrop"
3132
3167
  ), c = s.classList.contains(
3133
3168
  "gradient-popover-backdrop"
3134
3169
  );
3135
- !n && !o && !l && !r && !p && !c && this.closePopover();
3170
+ !n && !a && !l && !r && !p && !c && this.closePopover();
3136
3171
  }, this.handlePopoverKeydown = (i) => {
3137
3172
  if (this.isPopoverOpen) {
3138
3173
  if (i.key === "Escape") {
@@ -3252,8 +3287,8 @@ const P = class P extends x {
3252
3287
  if (n === 100)
3253
3288
  this.inputEl.value = s;
3254
3289
  else {
3255
- const a = Math.round(n / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
3256
- this.inputEl.value = `${s}${a}`;
3290
+ const o = Math.round(n / 100 * 255).toString(16).toUpperCase().padStart(2, "0");
3291
+ this.inputEl.value = `${s}${o}`;
3257
3292
  }
3258
3293
  }
3259
3294
  } else
@@ -3298,12 +3333,12 @@ const P = class P extends x {
3298
3333
  s.className = "gradient-editor";
3299
3334
  const n = document.createElement("div");
3300
3335
  n.className = "type-tabs-wrapper";
3301
- const o = this.createTypeTabs();
3302
- n.appendChild(o), s.appendChild(n);
3303
- const a = document.createElement("div");
3304
- if (a.className = "gradient-editor-content", this.updatePopoverContent(a), s.appendChild(a), this.variant !== "global" && e) {
3336
+ const a = this.createTypeTabs();
3337
+ n.appendChild(a), s.appendChild(n);
3338
+ const o = document.createElement("div");
3339
+ if (o.className = "gradient-editor-content", this.updatePopoverContent(o), s.appendChild(o), this.variant !== "global" && e) {
3305
3340
  const c = e.children[0], d = e.children[1], u = (g) => {
3306
- this.currentMode = g, g === "custom" ? (c.classList.add("active"), d.classList.remove("active"), n.style.display = "block") : (d.classList.add("active"), c.classList.remove("active"), n.style.display = "none"), this.updatePopoverContent(a);
3341
+ this.currentMode = g, g === "custom" ? (c.classList.add("active"), d.classList.remove("active"), n.style.display = "block") : (d.classList.add("active"), c.classList.remove("active"), n.style.display = "none"), this.updatePopoverContent(o);
3307
3342
  };
3308
3343
  c.addEventListener("click", () => u("custom")), d.addEventListener("click", () => u("global")), (p = (r = (l = this.value) == null ? void 0 : l.stops) == null ? void 0 : r[0]) != null && p.color.startsWith("var(--") ? (this.currentMode = "global", u("global")) : (this.currentMode = "custom", u("custom"));
3309
3344
  }
@@ -3317,9 +3352,9 @@ const P = class P extends x {
3317
3352
  e.type = "button", e.className = `gradient-type-tab ${((s = this.value) == null ? void 0 : s.type) === "solid" ? "active" : ""}`, e.innerHTML = Zt, e.style.minWidth = "32px", e.addEventListener("click", () => this.switchType("solid"));
3318
3353
  const i = document.createElement("button");
3319
3354
  return i.type = "button", i.className = `gradient-type-tab ${((n = this.value) == null ? void 0 : n.type) !== "solid" ? "active" : ""}`, i.innerHTML = Xt, i.style.minWidth = "32px", i.addEventListener("click", () => {
3320
- var a, l;
3321
- const o = ((a = this.value) == null ? void 0 : a.type) === "solid" ? "linear" : ((l = this.value) == null ? void 0 : l.type) || "linear";
3322
- this.switchType(o);
3355
+ var o, l;
3356
+ const a = ((o = this.value) == null ? void 0 : o.type) === "solid" ? "linear" : ((l = this.value) == null ? void 0 : l.type) || "linear";
3357
+ this.switchType(a);
3323
3358
  }), t.appendChild(e), t.appendChild(i), t;
3324
3359
  }
3325
3360
  switchType(t) {
@@ -3331,8 +3366,8 @@ const P = class P extends x {
3331
3366
  ]), t !== "solid" && this.value.stops.length === 1) {
3332
3367
  const n = this.value.stops[0].color;
3333
3368
  if (n.startsWith("var(--")) {
3334
- const o = this.resolveGlobalVarColor(n), a = I(o);
3335
- a && a.type !== "solid" && a.stops.length >= 2 ? (this.value.stops = a.stops, this.value.angle = a.angle, this.value.type = a.type) : (this.value.stops.push({
3369
+ const a = this.resolveGlobalVarColor(n), o = I(a);
3370
+ o && o.type !== "solid" && o.stops.length >= 2 ? (this.value.stops = o.stops, this.value.angle = o.angle, this.value.type = o.type) : (this.value.stops.push({
3336
3371
  color: "#786666",
3337
3372
  position: 100,
3338
3373
  opacity: 100
@@ -3346,9 +3381,9 @@ const P = class P extends x {
3346
3381
  } else t !== "solid" && this.value.stops.length >= 2 && (this.value.angle || (this.value.angle = 90));
3347
3382
  if (this.popoverEl) {
3348
3383
  const s = this.popoverEl.querySelectorAll(".gradient-type-tab");
3349
- s.forEach((a) => a.classList.remove("active"));
3350
- const n = s[0], o = s[1];
3351
- t === "solid" ? n == null || n.classList.add("active") : o == null || o.classList.add("active");
3384
+ s.forEach((o) => o.classList.remove("active"));
3385
+ const n = s[0], a = s[1];
3386
+ t === "solid" ? n == null || n.classList.add("active") : a == null || a.classList.add("active");
3352
3387
  }
3353
3388
  const e = (i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-editor-content");
3354
3389
  e && this.updatePopoverContent(e), this.updateUI(), this.triggerChange();
@@ -3387,32 +3422,32 @@ const P = class P extends x {
3387
3422
  keys: ["text-dark", "text-light"]
3388
3423
  }
3389
3424
  ], g = this.globalSearchQuery.toLowerCase();
3390
- let v;
3391
- this.globalLayoutMode === "list" ? (v = document.createElement("div"), v.className = "global-colors-list") : (v = document.createElement("div"), v.className = "global-colors-grid"), c.appendChild(v), u.forEach((m) => {
3392
- const f = Object.entries(d).filter(([C]) => !m.keys.includes(C) && m.title !== "Global Colors" ? !1 : m.keys.includes(C) && C.toLowerCase().includes(g));
3393
- f.length !== 0 && f.forEach(([C, w]) => {
3425
+ let f;
3426
+ this.globalLayoutMode === "list" ? (f = document.createElement("div"), f.className = "global-colors-list") : (f = document.createElement("div"), f.className = "global-colors-grid"), c.appendChild(f), u.forEach((m) => {
3427
+ const v = Object.entries(d).filter(([C]) => !m.keys.includes(C) && m.title !== "Global Colors" ? !1 : m.keys.includes(C) && C.toLowerCase().includes(g));
3428
+ v.length !== 0 && v.forEach(([C, w]) => {
3394
3429
  if (this.globalLayoutMode === "list") {
3395
3430
  const E = document.createElement("div");
3396
3431
  E.className = "global-color-row";
3397
- const k = document.createElement("div");
3398
- k.className = "global-color-circle";
3432
+ const M = document.createElement("div");
3433
+ M.className = "global-color-circle";
3399
3434
  const y = this.resolveGlobalVarColor(w);
3400
- k.style.background = y, e.color === `var(--${C})` && k.classList.add("selected");
3435
+ M.style.background = y, e.color === `var(--${C})` && M.classList.add("selected");
3401
3436
  const b = document.createElement("span");
3402
- b.className = "global-color-label", b.textContent = C.split("-").map((L) => L.charAt(0).toUpperCase() + L.slice(1)).join(" "), E.appendChild(k), E.appendChild(b), E.addEventListener("click", (L) => {
3403
- L.preventDefault();
3437
+ b.className = "global-color-label", b.textContent = C.split("-").map((k) => k.charAt(0).toUpperCase() + k.slice(1)).join(" "), E.appendChild(M), E.appendChild(b), E.addEventListener("click", (k) => {
3438
+ k.preventDefault();
3404
3439
  const $ = `var(--${C})`;
3405
3440
  this.setValue($), this.pendingSolidColor = $, i(c);
3406
- }), v.appendChild(E);
3441
+ }), f.appendChild(E);
3407
3442
  } else {
3408
3443
  const E = document.createElement("div");
3409
3444
  E.className = "global-color-circle";
3410
- const k = this.resolveGlobalVarColor(w);
3411
- E.style.background = k, E.title = C.split("-").map((y) => y.charAt(0).toUpperCase() + y.slice(1)).join(" "), e.color === `var(--${C})` && E.classList.add("selected"), E.addEventListener("click", (y) => {
3445
+ const M = this.resolveGlobalVarColor(w);
3446
+ E.style.background = M, E.title = C.split("-").map((y) => y.charAt(0).toUpperCase() + y.slice(1)).join(" "), e.color === `var(--${C})` && E.classList.add("selected"), E.addEventListener("click", (y) => {
3412
3447
  y.preventDefault();
3413
3448
  const b = `var(--${C})`;
3414
3449
  this.setValue(b), this.pendingSolidColor = b, i(c);
3415
- }), v.appendChild(E);
3450
+ }), f.appendChild(E);
3416
3451
  }
3417
3452
  });
3418
3453
  });
@@ -3420,14 +3455,14 @@ const P = class P extends x {
3420
3455
  s.className = "global-controls-row";
3421
3456
  const n = document.createElement("div");
3422
3457
  n.className = "global-search-container";
3423
- const o = document.createElement("span");
3424
- o.className = "global-search-icon", o.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>';
3425
- const a = document.createElement("input");
3426
- a.type = "text", a.className = "global-search-input", a.placeholder = "Search", a.value = this.globalSearchQuery;
3458
+ const a = document.createElement("span");
3459
+ a.className = "global-search-icon", a.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>';
3460
+ const o = document.createElement("input");
3461
+ o.type = "text", o.className = "global-search-input", o.placeholder = "Search", o.value = this.globalSearchQuery;
3427
3462
  const l = document.createElement("div");
3428
- a.addEventListener("input", (c) => {
3463
+ o.addEventListener("input", (c) => {
3429
3464
  this.globalSearchQuery = c.target.value, i(l);
3430
- }), n.appendChild(o), n.appendChild(a);
3465
+ }), n.appendChild(a), n.appendChild(o);
3431
3466
  const r = document.createElement("button");
3432
3467
  r.className = "global-layout-toggle", r.type = "button";
3433
3468
  const p = () => {
@@ -3444,9 +3479,9 @@ const P = class P extends x {
3444
3479
  initialOpacity: e.opacity ?? 100,
3445
3480
  onColorChange: (s, n) => {
3446
3481
  if (this.value) {
3447
- const o = I(s);
3448
- if (o && o.type !== "solid") {
3449
- this.value = o, this.switchType(o.type);
3482
+ const a = I(s);
3483
+ if (a && a.type !== "solid") {
3484
+ this.value = a, this.switchType(a.type);
3450
3485
  return;
3451
3486
  }
3452
3487
  this.value.stops[0].color = s, this.value.stops[0].opacity = n, this.updateUI(), this.triggerChange(), this.pendingSolidColor = s;
@@ -3468,39 +3503,39 @@ const P = class P extends x {
3468
3503
  u.value = "linear", u.textContent = "Linear";
3469
3504
  const g = document.createElement("option");
3470
3505
  g.value = "radial", g.textContent = "Radial", d.appendChild(u), d.appendChild(g), d.value = this.value.type === "radial" ? "radial" : "linear", i = document.createElement("input"), i.type = "text", i.inputMode = "numeric", i.className = "gradient-degree-input", i.value = `${this.value.angle ?? 90}°`, i.style.width = "75px", i.style.textAlign = "center", (!this.value.angle || this.value.stops.length < 2) && (this.value.angle = 90, i.value = "90°");
3471
- const v = document.createElement("button");
3472
- v.type = "button", v.className = "gradient-flip-btn", v.innerHTML = _t, d.addEventListener("change", () => {
3506
+ const f = document.createElement("button");
3507
+ f.type = "button", f.className = "gradient-flip-btn", f.innerHTML = _t, d.addEventListener("change", () => {
3473
3508
  this.switchType(d.value === "radial" ? "radial" : "linear"), i && this.updateDegreeVisibility(i);
3474
3509
  }), i.addEventListener("focus", (m) => {
3475
- const f = m.target;
3476
- f.value = f.value.replace(/[^0-9-]/g, ""), setTimeout(() => f.select(), 0);
3510
+ const v = m.target;
3511
+ v.value = v.value.replace(/[^0-9-]/g, ""), setTimeout(() => v.select(), 0);
3477
3512
  }), i.addEventListener("input", (m) => {
3478
- const f = parseInt(m.target.value);
3479
- !Number.isNaN(f) && this.value && (this.value.angle = Math.max(0, Math.min(360, f)), this.debouncedPreviewUpdate());
3513
+ const v = parseInt(m.target.value);
3514
+ !Number.isNaN(v) && this.value && (this.value.angle = Math.max(0, Math.min(360, v)), this.debouncedPreviewUpdate());
3480
3515
  }), i.addEventListener("blur", (m) => {
3481
3516
  var w;
3482
3517
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
3483
- const f = m.target;
3484
- let C = parseInt(f.value);
3485
- Number.isNaN(C) && (C = ((w = this.value) == null ? void 0 : w.angle) ?? 0), C = Math.max(0, Math.min(360, C)), this.value && (this.value.angle = C), f.value = `${C}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3486
- }), v.addEventListener("click", () => {
3518
+ const v = m.target;
3519
+ let C = parseInt(v.value);
3520
+ Number.isNaN(C) && (C = ((w = this.value) == null ? void 0 : w.angle) ?? 0), C = Math.max(0, Math.min(360, C)), this.value && (this.value.angle = C), v.value = `${C}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3521
+ }), f.addEventListener("click", () => {
3487
3522
  !this.value || !this.value.stops || (this.value.stops.forEach((m) => {
3488
3523
  m.position = 100 - m.position;
3489
- }), this.value.stops.sort((m, f) => m.position - f.position), this.updateGradientPreview(s), this.createHandles(n, s), this.updateStopsList(r), this.updateUI(), this.triggerChange());
3490
- }), c.appendChild(d), c.appendChild(i), c.appendChild(v), t.appendChild(c), this.updateDegreeVisibility(i);
3524
+ }), this.value.stops.sort((m, v) => m.position - v.position), this.updateGradientPreview(s), this.createHandles(n, s), this.updateStopsList(r), this.updateUI(), this.triggerChange());
3525
+ }), c.appendChild(d), c.appendChild(i), c.appendChild(f), t.appendChild(c), this.updateDegreeVisibility(i);
3491
3526
  }
3492
3527
  const s = document.createElement("div");
3493
3528
  s.className = "gradient-preview", this.updateGradientPreview(s);
3494
3529
  const n = document.createElement("div");
3495
3530
  n.className = "gradient-handles", s.appendChild(n), t.appendChild(s), this.createHandles(n, s);
3496
- const o = document.createElement("div");
3497
- o.className = "gradient-stops-header";
3498
- const a = document.createElement("span");
3499
- a.textContent = "Stops";
3531
+ const a = document.createElement("div");
3532
+ a.className = "gradient-stops-header";
3533
+ const o = document.createElement("span");
3534
+ o.textContent = "Stops";
3500
3535
  const l = document.createElement("button");
3501
- l.type = "button", l.className = "gradient-add-stop", l.textContent = "+", o.appendChild(a), o.appendChild(l);
3536
+ l.type = "button", l.className = "gradient-add-stop", l.textContent = "+", a.appendChild(o), a.appendChild(l);
3502
3537
  const r = document.createElement("div");
3503
- r.className = "gradient-stops", t.appendChild(o), t.appendChild(r), this.updateStopsList(r);
3538
+ r.className = "gradient-stops", t.appendChild(a), t.appendChild(r), this.updateStopsList(r);
3504
3539
  const p = it((c) => {
3505
3540
  const d = I(c);
3506
3541
  d && (this.value = d, this.switchType(d.type), this.updateUI(), this.triggerChange());
@@ -3528,18 +3563,18 @@ const P = class P extends x {
3528
3563
  t.innerHTML = "", !(!this.value || this.value.type === "solid" || !this.value.stops) && this.value.stops.forEach((i, s) => {
3529
3564
  const n = document.createElement("div");
3530
3565
  n.className = "gstop-handle", n.style.left = `${Math.max(0, Math.min(100, i.position))}%`, n.style.top = "0%";
3531
- const o = document.createElement("div");
3532
- o.className = "gstop-chip", o.style.backgroundColor = i.color, n.appendChild(o);
3533
- let a = !1, l = 0, r = 0;
3566
+ const a = document.createElement("div");
3567
+ a.className = "gstop-chip", a.style.backgroundColor = i.color, n.appendChild(a);
3568
+ let o = !1, l = 0, r = 0;
3534
3569
  const p = (u) => {
3535
- a = !0, l = u.clientX, r = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", c), document.addEventListener("mouseup", d), u.preventDefault(), u.stopPropagation();
3570
+ o = !0, l = u.clientX, r = this.value.stops[s].position, n.classList.add("selected"), document.addEventListener("mousemove", c), document.addEventListener("mouseup", d), u.preventDefault(), u.stopPropagation();
3536
3571
  }, c = (u) => {
3537
- if (!a || !this.value) return;
3538
- const g = e.getBoundingClientRect(), v = u.clientX - l;
3539
- let m = r + v / g.width * 100;
3572
+ if (!o || !this.value) return;
3573
+ const g = e.getBoundingClientRect(), f = u.clientX - l;
3574
+ let m = r + f / g.width * 100;
3540
3575
  m = Math.max(0, Math.min(100, m)), this.value.stops[s].position = Math.round(m), n.style.left = `${m}%`, this.updateGradientPreview();
3541
3576
  }, d = () => {
3542
- a && (a = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", d), this.value && (this.value.stops.sort((u, g) => u.position - g.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange());
3577
+ o && (o = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", d), this.value && (this.value.stops.sort((u, g) => u.position - g.position), this.createHandles(t, e), this.updateStopsList()), this.updateUI(), this.triggerChange());
3543
3578
  };
3544
3579
  n.addEventListener("mousedown", p), t.appendChild(n);
3545
3580
  });
@@ -3548,13 +3583,13 @@ const P = class P extends x {
3548
3583
  var i;
3549
3584
  const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
3550
3585
  !e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
3551
- var E, k;
3552
- const o = document.createElement("div");
3553
- o.className = "gstop-row";
3586
+ var E, M;
3554
3587
  const a = document.createElement("div");
3555
- a.className = "gstop-position-group";
3588
+ a.className = "gstop-row";
3589
+ const o = document.createElement("div");
3590
+ o.className = "gstop-position-group";
3556
3591
  const l = document.createElement("input");
3557
- l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", a.appendChild(l);
3592
+ l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", o.appendChild(l);
3558
3593
  const r = document.createElement("div");
3559
3594
  r.className = "gstop-color-container";
3560
3595
  const p = document.createElement("div");
@@ -3564,26 +3599,26 @@ const P = class P extends x {
3564
3599
  const d = document.createElement("button");
3565
3600
  d.type = "button", d.className = "gstop-color-copy", d.textContent = "Copy", r.appendChild(p), r.appendChild(c), r.appendChild(d);
3566
3601
  const u = document.createElement("button");
3567
- u.type = "button", u.className = "gstop-del", u.innerHTML = Jt, u.disabled = (((k = (E = this.value) == null ? void 0 : E.stops) == null ? void 0 : k.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(u), e.appendChild(o);
3602
+ u.type = "button", u.className = "gstop-del", u.innerHTML = Jt, u.disabled = (((M = (E = this.value) == null ? void 0 : E.stops) == null ? void 0 : M.length) || 0) <= 2, a.appendChild(o), a.appendChild(r), a.appendChild(u), e.appendChild(a);
3568
3603
  const g = document.createElement("span");
3569
3604
  g.className = "gstop-opacity-label", g.textContent = "Opacity";
3570
- const v = document.createElement("div");
3571
- v.className = "gstop-opacity-group";
3605
+ const f = document.createElement("div");
3606
+ f.className = "gstop-opacity-group";
3572
3607
  const m = document.createElement("input");
3573
3608
  m.type = "range", m.className = "gstop-opacity-slider", m.min = "0", m.max = "100", m.value = String(s.opacity ?? 100);
3574
- const f = S(s.color);
3609
+ const v = S(s.color);
3575
3610
  m.style.setProperty(
3576
3611
  "--slider-color",
3577
- `rgb(${f.r}, ${f.g}, ${f.b})`
3612
+ `rgb(${v.r}, ${v.g}, ${v.b})`
3578
3613
  );
3579
3614
  const C = document.createElement("span");
3580
- C.className = "gstop-opacity-value", C.textContent = `${s.opacity ?? 100}%`, v.appendChild(m), v.appendChild(C);
3615
+ C.className = "gstop-opacity-value", C.textContent = `${s.opacity ?? 100}%`, f.appendChild(m), f.appendChild(C);
3581
3616
  const w = new Yt((y, b) => {
3582
3617
  c.value = y.replace("#", "").toUpperCase(), p.style.backgroundColor = y, this.value.stops[n].color = y, b !== void 0 && (this.value.stops[n].opacity = b, m.value = String(b), C.textContent = `${b}%`);
3583
- const L = S(y);
3618
+ const k = S(y);
3584
3619
  m.style.setProperty(
3585
3620
  "--slider-color",
3586
- `rgb(${L.r}, ${L.g}, ${L.b})`
3621
+ `rgb(${k.r}, ${k.g}, ${k.b})`
3587
3622
  ), this.updateGradientPreview(), this.createHandles(
3588
3623
  this.popoverEl.querySelector(".gradient-handles"),
3589
3624
  this.popoverEl.querySelector(".gradient-preview")
@@ -3595,10 +3630,10 @@ const P = class P extends x {
3595
3630
  const y = c.value.trim(), b = y.startsWith("#") ? y : `#${y}`;
3596
3631
  if (/^#[0-9A-Fa-f]{6}$/.test(b)) {
3597
3632
  this.value.stops[n].color = b, p.style.backgroundColor = b;
3598
- const L = S(b);
3633
+ const k = S(b);
3599
3634
  m.style.setProperty(
3600
3635
  "--slider-color",
3601
- `rgb(${L.r}, ${L.g}, ${L.b})`
3636
+ `rgb(${k.r}, ${k.g}, ${k.b})`
3602
3637
  ), this.debouncedPreviewUpdate();
3603
3638
  }
3604
3639
  }), c.addEventListener("blur", () => {
@@ -3613,18 +3648,18 @@ const P = class P extends x {
3613
3648
  const b = y.target;
3614
3649
  b.value = b.value.replace("%", ""), b.select();
3615
3650
  }), l.addEventListener("input", (y) => {
3616
- const b = y.target, L = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3617
- if (!Number.isNaN(L)) {
3618
- const $ = Math.max(0, Math.min(100, L));
3651
+ const b = y.target, k = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3652
+ if (!Number.isNaN(k)) {
3653
+ const $ = Math.max(0, Math.min(100, k));
3619
3654
  this.value.stops[n].position = $, b.value = `${$}%`, this.debouncedPreviewUpdate();
3620
3655
  }
3621
3656
  }), l.addEventListener("blur", (y) => {
3622
3657
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
3623
- const b = y.target, L = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3624
- if (Number.isNaN(L))
3658
+ const b = y.target, k = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3659
+ if (Number.isNaN(k))
3625
3660
  b.value = `${this.value.stops[n].position}%`;
3626
3661
  else {
3627
- const $ = Math.max(0, Math.min(100, L));
3662
+ const $ = Math.max(0, Math.min(100, k));
3628
3663
  this.value.stops[n].position = $, b.value = `${$}%`;
3629
3664
  }
3630
3665
  this.updateGradientPreview(), this.createHandles(
@@ -3647,32 +3682,32 @@ const P = class P extends x {
3647
3682
  }
3648
3683
  addStop() {
3649
3684
  if (!this.value || this.value.type === "solid" || !this.value.stops) return;
3650
- const t = this.value.stops.map((o) => o.position).sort((o, a) => o - a);
3685
+ const t = this.value.stops.map((a) => a.position).sort((a, o) => a - o);
3651
3686
  let e = 50, i = 0;
3652
- for (let o = 0; o < t.length - 1; o++) {
3653
- const a = t[o + 1] - t[o];
3654
- a > i && (i = a, e = t[o] + a / 2);
3687
+ for (let a = 0; a < t.length - 1; a++) {
3688
+ const o = t[a + 1] - t[a];
3689
+ o > i && (i = o, e = t[a] + o / 2);
3655
3690
  }
3656
3691
  const s = this.value.stops.reduce(
3657
- (o, a) => Math.abs(a.position - e) < Math.abs(o.position - e) ? a : o
3692
+ (a, o) => Math.abs(o.position - e) < Math.abs(a.position - e) ? o : a
3658
3693
  ), n = {
3659
3694
  position: Math.round(e),
3660
3695
  color: s.color,
3661
3696
  opacity: s.opacity ?? 100
3662
3697
  };
3663
- this.value.stops.push(n), this.value.stops.sort((o, a) => o.position - a.position);
3698
+ this.value.stops.push(n), this.value.stops.sort((a, o) => a.position - o.position);
3664
3699
  }
3665
3700
  openPopover() {
3666
3701
  if (this.popoverEl && (P.openInstance && P.openInstance !== this && P.openInstance.closePopover(), !this.isPopoverOpen)) {
3667
3702
  if (this.isPopoverOpen = !0, P.openInstance = this, this.backdropEl && (this.backdropEl.style.display = "block", this.backdropEl.parentElement || document.body.appendChild(this.backdropEl)), this.popoverEl.style.display = "flex", this.refreshPopoverContent(), this.element) {
3668
3703
  const t = this.element.getBoundingClientRect(), e = 306, i = window.innerWidth, s = window.innerHeight, n = 16;
3669
3704
  this.popoverEl.style.position = "fixed", this.popoverEl.style.zIndex = "10000", this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
3670
- const o = this.popoverEl.offsetHeight;
3671
- let a = t.right + 8, l = t.top;
3705
+ const a = this.popoverEl.offsetHeight;
3706
+ let o = t.right + 8, l = t.top;
3672
3707
  const r = i - t.right, p = t.left, c = e + n;
3673
- r < c && p > r + 100 && (a = t.left - e - 8);
3708
+ r < c && p > r + 100 && (o = t.left - e - 8);
3674
3709
  const d = s - t.bottom, u = t.top;
3675
- u >= o + n ? l = t.top - o - 8 : d >= o + n ? l = t.bottom + 8 : u > d ? (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 };
3710
+ u >= a + n ? l = t.top - a - 8 : d >= a + n ? l = t.bottom + 8 : u > d ? (l = t.top - a - 8, l < n && (l = n)) : (l = t.bottom + 8, l + a > s - n && (l = s - a - n)), this.popoverEl.style.left = `${o}px`, this.popoverEl.style.top = `${l}px`, this.popoverPosition = { left: o, top: l };
3676
3711
  }
3677
3712
  setTimeout(
3678
3713
  () => document.addEventListener("click", this.onBackgroundClick, !0),
@@ -3689,24 +3724,24 @@ const P = class P extends x {
3689
3724
  }
3690
3725
  requestAnimationFrame(() => {
3691
3726
  if (!this.popoverEl || !this.element) return;
3692
- const e = this.element.getBoundingClientRect(), i = 306, s = window.innerWidth, n = window.innerHeight, o = 16;
3727
+ const e = this.element.getBoundingClientRect(), i = 306, s = window.innerWidth, n = window.innerHeight, a = 16;
3693
3728
  this.popoverEl.style.left, this.popoverEl.style.top, this.popoverEl.style.left = "-9999px", this.popoverEl.style.top = "0px";
3694
- const a = this.popoverEl.offsetHeight;
3729
+ const o = this.popoverEl.offsetHeight;
3695
3730
  let l = e.right + 8, r = e.top;
3696
- const p = s - e.right, c = e.left, d = i + o;
3731
+ const p = s - e.right, c = e.left, d = i + a;
3697
3732
  p < d && c > p + 100 && (l = e.left - i - 8);
3698
3733
  const u = n - e.bottom, g = e.top;
3699
- g >= a + o ? r = e.top - a - 8 : u >= a + o ? r = e.bottom + 8 : g > u ? (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`;
3734
+ g >= o + a ? r = e.top - o - 8 : u >= o + a ? r = e.bottom + 8 : g > u ? (r = e.top - o - 8, r < a && (r = a)) : (r = e.bottom + 8, r + o > n - a && (r = n - o - a)), this.popoverEl.style.left = `${l}px`, this.popoverEl.style.top = `${r}px`;
3700
3735
  });
3701
3736
  }
3702
3737
  }
3703
3738
  refreshPopoverContent() {
3704
- var n, o;
3739
+ var n, a;
3705
3740
  if (!this.popoverEl) return;
3706
3741
  const t = this.popoverEl.querySelectorAll(".gradient-type-tab");
3707
- t.forEach((a) => a.classList.remove("active"));
3742
+ t.forEach((o) => o.classList.remove("active"));
3708
3743
  const e = t[0], i = t[1];
3709
- ((n = this.value) == null ? void 0 : n.type) === "solid" ? e.classList.add("active") : (i.classList.add("active"), (o = this.recentGradientRefresh) == null || o.call(this)), this.popoverEl.offsetHeight;
3744
+ ((n = this.value) == null ? void 0 : n.type) === "solid" ? e.classList.add("active") : (i.classList.add("active"), (a = this.recentGradientRefresh) == null || a.call(this)), this.popoverEl.offsetHeight;
3710
3745
  const s = this.popoverEl.querySelector(".gradient-editor-content");
3711
3746
  s && this.updatePopoverContent(s);
3712
3747
  }
@@ -3715,13 +3750,13 @@ const P = class P extends x {
3715
3750
  if (!(!this.popoverEl || !this.isPopoverOpen)) {
3716
3751
  if (this.isPopoverOpen = !1, this.popoverPosition = null, this.backdropEl && (this.backdropEl.style.display = "none"), this.popoverEl.style.display = "none", document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), this.commitPendingSolidColor(), this.value && this.value.type !== "solid") {
3717
3752
  const e = T(this.value);
3718
- B.addColor(e, "gradient"), (t = this.recentGradientRefresh) == null || t.call(this);
3753
+ D.addColor(e, "gradient"), (t = this.recentGradientRefresh) == null || t.call(this);
3719
3754
  }
3720
3755
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), P.openInstance === this && (P.openInstance = null);
3721
3756
  }
3722
3757
  }
3723
3758
  commitPendingSolidColor() {
3724
- this.pendingSolidColor && (this.solidPicker ? this.solidPicker.commitRecentColor() : B.addColor(this.pendingSolidColor, "solid"), this.pendingSolidColor = null);
3759
+ this.pendingSolidColor && (this.solidPicker ? this.solidPicker.commitRecentColor() : D.addColor(this.pendingSolidColor, "solid"), this.pendingSolidColor = null);
3725
3760
  }
3726
3761
  handlePaste(t) {
3727
3762
  var i;
@@ -3797,7 +3832,7 @@ class xe extends H {
3797
3832
  const t = super.getValues(), e = this.settings.color.getValue();
3798
3833
  return {
3799
3834
  ...t,
3800
- color: e ? `${e} 1` : t.color
3835
+ color: e ? `${e}` : t.color
3801
3836
  };
3802
3837
  }
3803
3838
  getCssCode() {
@@ -3879,8 +3914,8 @@ class Le extends H {
3879
3914
  });
3880
3915
  }
3881
3916
  getCssCode() {
3882
- var o;
3883
- const t = this.settings.color.getValue() ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((o = this.settings.align) == null ? void 0 : o.value) ?? "left";
3917
+ var a;
3918
+ const t = this.settings.color.getValue() ?? "#000000", e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
3884
3919
  return `
3885
3920
  color: ${t};
3886
3921
  font-family: ${e};
@@ -3890,8 +3925,8 @@ class Le extends H {
3890
3925
  `;
3891
3926
  }
3892
3927
  getTextGradientCss() {
3893
- var a;
3894
- const t = this.settings.color.getCSSForText(), e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((a = this.settings.align) == null ? void 0 : a.value) ?? "left";
3928
+ var o;
3929
+ const t = this.settings.color.getCSSForText(), e = this.settings.fontFamily.value ?? "Satoshi", i = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, n = ((o = this.settings.align) == null ? void 0 : o.value) ?? "left";
3895
3930
  return `
3896
3931
  ${Object.entries(t).map(([l, r]) => `${l}: ${r};`).join(`
3897
3932
  `)}
@@ -3910,11 +3945,11 @@ class j extends x {
3910
3945
  }), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
3911
3946
  }
3912
3947
  draw() {
3913
- const t = this.value === "auto" ? "text" : "number", e = (a) => {
3914
- this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
3948
+ const t = this.value === "auto" ? "text" : "number", e = (o) => {
3949
+ this.value !== "auto" && (this.props.minValue !== void 0 && (o.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (o.max = String(this.props.maxValue)), this.props.className && o.classList.add(this.props.className), o.addEventListener("input", () => {
3915
3950
  const l = this.props.minValue ?? Number.MIN_SAFE_INTEGER, r = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
3916
- let p = Number(a.value);
3917
- p < l && (p = l), p > r && (p = r), a.value = String(p);
3951
+ let p = Number(o.value);
3952
+ p < l && (p = l), p > r && (p = r), o.value = String(p);
3918
3953
  }));
3919
3954
  }, i = this.createInput({
3920
3955
  value: this.value,
@@ -3935,9 +3970,9 @@ class j extends x {
3935
3970
  s && (s.style.paddingRight = "35px");
3936
3971
  const n = document.createElement("span");
3937
3972
  n.className = "suffix-label", n.textContent = this.props.suffix, i.appendChild(n);
3938
- const o = i.querySelector("input");
3939
- return o && (o.oninput = (a) => {
3940
- const l = a.target.value.trim();
3973
+ const a = i.querySelector("input");
3974
+ return a && (a.oninput = (o) => {
3975
+ const l = o.target.value.trim();
3941
3976
  if (l.toLowerCase() === "auto")
3942
3977
  this.value = "auto";
3943
3978
  else {
@@ -4022,10 +4057,10 @@ class Me extends H {
4022
4057
  draw() {
4023
4058
  const t = super.draw(), e = t.querySelector(".setting-group-content");
4024
4059
  if (!e) return t;
4025
- const i = Array.from(e.children), [s, n, o] = i;
4060
+ const i = Array.from(e.children), [s, n, a] = i;
4026
4061
  e.innerHTML = "", e.appendChild(s), e.appendChild(n);
4027
- const a = document.createElement("div");
4028
- return a.className = "bgset-or-label", a.textContent = "OR", e.appendChild(a), e.appendChild(o), t;
4062
+ const o = document.createElement("div");
4063
+ return o.className = "bgset-or-label", o.textContent = "OR", e.appendChild(o), e.appendChild(a), t;
4029
4064
  }
4030
4065
  getCssCode() {
4031
4066
  const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#000000";
@@ -4059,21 +4094,21 @@ export {
4059
4094
  Ee as MultiLanguageSetting,
4060
4095
  V as NumberSetting,
4061
4096
  Nt as OpacitySetting,
4062
- ve as SelectApiSettings,
4097
+ fe as SelectApiSettings,
4063
4098
  tt as SelectSetting,
4064
4099
  x as Setting,
4065
4100
  H as SettingGroup,
4066
4101
  Lt as StringSetting,
4067
4102
  wt as TabSettingGroup,
4068
4103
  wt as TabsSettingGroup,
4069
- fe as Toggle,
4104
+ ve as Toggle,
4070
4105
  ct as UploadSetting,
4071
4106
  me as WidthSetting,
4072
4107
  he as asSettingGroupWithSettings,
4073
4108
  xt as createSettingGroup,
4074
4109
  ce as createTabSettingGroup,
4075
- D as isSetting,
4110
+ A as isSetting,
4076
4111
  nt as isSettingChild,
4077
- M as isSettingGroup,
4112
+ L as isSettingGroup,
4078
4113
  z as iterateSettings
4079
4114
  };