wox-gui 0.1.7 → 0.1.8

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.
@@ -21,7 +21,7 @@ s(T, "BASE_STYLES", `
21
21
  :host([hidden]) { display: none !important; }
22
22
  `);
23
23
  let w = T;
24
- const S = `
24
+ const M = `
25
25
  /* glow: neon glow effect using --wox-fx-color */
26
26
  .glow {
27
27
  border-color: var(--wox-fx-color);
@@ -53,14 +53,14 @@ class H extends w {
53
53
  constructor() {
54
54
  super(...arguments);
55
55
  s(this, "_render", () => {
56
- const t = this.getAttribute("name"), e = this.getAttribute("size") || "18", n = this.getAttribute("color") || "", o = this.hasAttribute("glow"), i = this.hasAttribute("pulse"), a = t ? `<span class="material-icons" style="--size:${e}px">${t}</span>` : "<slot></slot>", r = o || i ? `<span class="fx-wrap${o ? " glow" : ""}${i ? " pulse" : ""}" style="--wox-fx-color:${n};color:${n}">${a}</span>` : a;
56
+ const t = this.getAttribute("name"), e = this.getAttribute("size") || "18", n = this.getAttribute("color") || "", o = this.hasAttribute("glow"), i = this.hasAttribute("pulse"), r = t ? `<span class="material-icons" style="--size:${e}px">${t}</span>` : "<slot></slot>", a = o || i ? `<span class="fx-wrap${o ? " glow" : ""}${i ? " pulse" : ""}" style="--wox-fx-color:${n};color:${n}">${r}</span>` : r;
57
57
  this.render(`
58
58
  :host { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
59
59
  .material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: var(--size, 18px); display: inline-block; line-height: 1; text-transform: none; letter-spacing: normal; word-wrap: normal; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; color: inherit; }
60
60
  ::slotted(svg) { width: var(--size, 18px); height: var(--size, 18px); }
61
61
  slot { display: inline-flex; align-items: center; justify-content: center; }
62
62
  .fx-wrap { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--wox-radius-sm, 3px); padding: 4px; }
63
- ${S} :host { --size: ${e}px; }`, r);
63
+ ${M} :host { --size: ${e}px; }`, a);
64
64
  });
65
65
  }
66
66
  connectedCallback() {
@@ -71,7 +71,7 @@ class H extends w {
71
71
  }
72
72
  }
73
73
  s(H, "observedAttributes", ["name", "size", "color", "glow", "pulse"]);
74
- class G extends w {
74
+ class j extends w {
75
75
  constructor() {
76
76
  super(...arguments);
77
77
  s(this, "_render", () => {
@@ -92,8 +92,8 @@ class G extends w {
92
92
  this.isConnected && this._render();
93
93
  }
94
94
  }
95
- s(G, "observedAttributes", ["direction", "spacing"]);
96
- class j extends w {
95
+ s(j, "observedAttributes", ["direction", "spacing"]);
96
+ class G extends w {
97
97
  constructor() {
98
98
  super(...arguments);
99
99
  s(this, "_render", () => {
@@ -115,27 +115,30 @@ class j extends w {
115
115
  this.isConnected && this._render();
116
116
  }
117
117
  }
118
- s(j, "observedAttributes", ["variant", "text", "color"]);
118
+ s(G, "observedAttributes", ["variant", "text", "color"]);
119
119
  class Y extends w {
120
120
  constructor() {
121
121
  super(...arguments);
122
122
  s(this, "_render", () => {
123
- const t = this.getAttribute("variant") || "icon", e = this.getAttribute("icon") || "", n = this.getAttribute("label") || "", o = this.hasAttribute("active"), i = this.hasAttribute("disabled"), a = this.getAttribute("dash") || "solid", r = this.getAttribute("color") || "", l = [`v-${t}`, o ? "active" : "", this.hasAttribute("glow") ? "glow" : "", this.hasAttribute("pulse") ? "pulse" : ""].filter(Boolean).join(" ");
124
- let h = "";
125
- t === "icon" ? h = e ? `<span class="material-icons">${e}</span>` : "<slot></slot>" : t === "text" ? h = (e ? `<span class="material-icons" style="font-size:14px">${e}</span>` : "") + (n || "<slot></slot>") : t === "tile" ? h = (e ? `<span class="material-icons">${e}</span>` : '<slot name="icon"></slot>') + `<span>${n}</span>` : t === "dash" && (h = `<div class="dash-line${a === "solid" ? "" : ` ${a}`}"></div>`);
126
- const d = r ? ` data-color style="--wox-fx-color:${r}"` : "";
123
+ const t = this.getAttribute("variant") || "icon", e = this.getAttribute("icon") || "", n = this.getAttribute("label") || "", o = this.hasAttribute("active"), i = this.hasAttribute("disabled"), r = this.getAttribute("dash") || "solid", a = this.getAttribute("color") || "", l = this.hasAttribute("glow"), x = this.hasAttribute("pulse"), d = this.getAttribute("border-color") || "", u = this.getAttribute("border-style") || "", h = this.getAttribute("icon-color") || "", v = this.getAttribute("text-color") || "", b = [`v-${t}`, o ? "active" : "", l ? "glow" : "", x ? "pulse" : ""].filter(Boolean).join(" ");
124
+ let g = "";
125
+ t === "icon" ? g = e ? `<span class="material-icons">${e}</span>` : "<slot></slot>" : t === "text" ? g = (e ? `<span class="material-icons" style="font-size:14px">${e}</span>` : "") + (n || "<slot></slot>") : t === "tile" ? g = (e ? `<span class="material-icons">${e}</span>` : '<slot name="icon"></slot>') + `<span>${n}</span>` : t === "dash" && (g = `<div class="dash-line${r === "solid" ? "" : ` ${r}`}"></div>`);
126
+ const f = [];
127
+ a && f.push(`--wox-fx-color:${a}`), d && f.push(`--wox-btn-border:${d}`), u && f.push(`--wox-btn-border-style:${u}`), h && f.push(`--wox-btn-icon:${h}`), v && f.push(`--wox-btn-text:${v}`);
128
+ const k = a ? " data-color" : "", E = f.length ? ` style="${f.join(";")}"` : "";
127
129
  this.render(`
128
130
  :host { display: inline-block; }
129
131
  button {
130
132
  display: flex; align-items: center; justify-content: center; gap: 6px;
131
- background: transparent; border: 1px solid var(--wox-border); color: var(--wox-text-secondary, #999);
133
+ background: transparent; border: 1px solid var(--wox-btn-border, var(--wox-border)); border-style: var(--wox-btn-border-style, solid); color: var(--wox-btn-text, var(--wox-text-secondary, #999));
132
134
  cursor: pointer; font-family: var(--wox-font, sans-serif); font-size: var(--wox-font-size-base, 12px);
133
135
  transition: all var(--wox-transition-fast, 0.12s); border-radius: var(--wox-radius-sm, 3px);
134
136
  padding: 0; margin: 0; line-height: 1; user-select: none;
135
137
  }
136
- button:hover { background: var(--wox-bg-hover, #2a2a2e); color: var(--wox-text-hi, #fff); }
138
+ button:hover { background: var(--wox-bg-hover, #2a2a2e); color: var(--wox-btn-text, var(--wox-text-hi, #fff)); }
137
139
  button:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
138
- button.active { background: var(--wox-bg-hover, #2a2a2e); color: var(--wox-accent, #00e5ff); border-color: var(--wox-border-light, #444); }
140
+ button.active { background: var(--wox-bg-hover, #2a2a2e); color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); border-color: var(--wox-btn-border, var(--wox-border-light, #444)); }
141
+ .material-icons { color: var(--wox-btn-icon, inherit); }
139
142
 
140
143
  /* icon variant */
141
144
  button.v-icon { width: 34px; height: 32px; border-radius: var(--wox-radius-sm, 3px); }
@@ -147,13 +150,13 @@ class Y extends w {
147
150
  /* tile variant */
148
151
  button.v-tile {
149
152
  flex-direction: column; gap: 6px; background: var(--wox-bg-toolbar, #1e1e22);
150
- border: 1px solid var(--wox-border, #333); border-radius: var(--wox-radius-xl, 10px);
153
+ border: 1px solid var(--wox-border, #333); border-style: var(--wox-btn-border-style, solid); border-radius: var(--wox-radius-xl, 10px);
151
154
  padding: 12px 10px; min-width: 68px; font-size: var(--wox-font-size-sm, 10px);
152
155
  font-weight: 500; text-transform: uppercase;
153
156
  transition: all var(--wox-transition-smooth, 0.25s cubic-bezier(0.4, 0, 0.2, 1));
154
157
  position: relative; overflow: hidden;
155
158
  }
156
- button.v-tile:hover { background: var(--wox-bg-hover, #2a2a2e); border-color: var(--wox-border-light, #555); color: var(--wox-text-primary, #eee); transform: translateY(-1px); }
159
+ button.v-tile:hover { background: var(--wox-bg-hover, #2a2a2e); border-color: var(--wox-btn-border, var(--wox-border-light, #555)); color: var(--wox-btn-text, var(--wox-text-primary, #eee)); transform: translateY(-1px); }
157
160
  button.v-tile:hover svg, button.v-tile:hover .material-icons { transform: scale(1.05); opacity: 1; }
158
161
  button.v-tile svg, button.v-tile .material-icons { display: block; width: 32px; height: 32px; transition: transform 0.2s; opacity: 0.8; font-size: 28px; }
159
162
  button.v-tile.delete:hover { border-color: var(--wox-danger, #f72585); color: var(--wox-danger, #f72585); background: rgba(247, 37, 133, 0.05); }
@@ -162,7 +165,7 @@ class Y extends w {
162
165
  button.v-tile[data-color] { --wox-fx-color: var(--wox-text-secondary, #999); }
163
166
  button.v-tile[data-color]:hover {
164
167
  background: color-mix(in srgb, var(--wox-fx-color), transparent 92%);
165
- border-color: var(--wox-fx-color); color: var(--wox-fx-color);
168
+ border-color: var(--wox-btn-border, var(--wox-fx-color)); color: var(--wox-btn-text, var(--wox-fx-color));
166
169
  box-shadow: 0 0 15px color-mix(in srgb, var(--wox-fx-color), transparent 80%);
167
170
  }
168
171
  button.v-tile[data-color]:hover svg { filter: drop-shadow(0 0 4px var(--wox-fx-color)); }
@@ -170,27 +173,27 @@ class Y extends w {
170
173
  /* dash variant */
171
174
  button.v-dash {
172
175
  width: 42px; height: 26px; background: var(--wox-bg-panel, #1c1c21);
173
- border: 1px solid var(--wox-border, #333); border-radius: var(--wox-radius-lg, 8px);
176
+ border: 1px solid var(--wox-border, #333); border-style: var(--wox-btn-border-style, solid); border-radius: var(--wox-radius-lg, 8px);
174
177
  transition: all 0.2s;
175
178
  }
176
- button.v-dash:hover { background: var(--wox-bg-hover, #2a2a2e); border-color: var(--wox-border-light, #555); transform: translateY(-1px); }
177
- button.v-dash.active { border-color: var(--wox-accent, #00e5ff); box-shadow: var(--wox-shadow-accent, 0 0 10px rgba(0, 229, 255, 0.3)); }
178
- .dash-line { width: 16px; height: 3px; background: var(--wox-text-secondary, #666); border-radius: 1px; }
179
- button.v-dash.active .dash-line { background: var(--wox-accent, #00e5ff); }
180
- .dash-line.dotted { background: radial-gradient(circle, currentColor 1px, transparent 1px); background-size: 4px 100%; color: var(--wox-text-secondary, #666); }
181
- button.v-dash.active .dash-line.dotted { color: var(--wox-accent, #00e5ff); }
182
- .dash-line.dashed { background: linear-gradient(to right, currentColor 6px, transparent 6px); background-size: 10px 100%; color: var(--wox-text-secondary, #666); }
183
- button.v-dash.active .dash-line.dashed { color: var(--wox-accent, #00e5ff); }
184
- .dash-line.longdash { background: linear-gradient(to right, currentColor 12px, transparent 4px); background-size: 16px 100%; color: var(--wox-text-secondary, #666); }
185
- button.v-dash.active .dash-line.longdash { color: var(--wox-accent, #00e5ff); }
186
- .dash-line.dotdash { background: linear-gradient(to right, currentColor 8px, transparent 4px, currentColor 2px, transparent 4px); background-size: 18px 100%; color: var(--wox-text-secondary, #666); }
187
- button.v-dash.active .dash-line.dotdash { color: var(--wox-accent, #00e5ff); }
188
- .dash-line.zigzag { background: repeating-linear-gradient(45deg, currentColor, currentColor 2px, transparent 2px, transparent 4px); color: var(--wox-text-secondary, #666); }
189
- button.v-dash.active .dash-line.zigzag { color: var(--wox-accent, #00e5ff); }
179
+ button.v-dash:hover { background: var(--wox-bg-hover, #2a2a2e); border-color: var(--wox-btn-border, var(--wox-border-light, #555)); transform: translateY(-1px); }
180
+ button.v-dash.active { border-color: var(--wox-btn-border, var(--wox-accent, #00e5ff)); box-shadow: var(--wox-shadow-accent, 0 0 10px rgba(0, 229, 255, 0.3)); }
181
+ .dash-line { width: 16px; height: 3px; background: var(--wox-btn-text, var(--wox-text-secondary, #666)); border-radius: 1px; }
182
+ button.v-dash.active .dash-line { background: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
183
+ .dash-line.dotted { background: radial-gradient(circle, currentColor 1px, transparent 1px); background-size: 4px 100%; color: var(--wox-btn-text, var(--wox-text-secondary, #666)); }
184
+ button.v-dash.active .dash-line.dotted { color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
185
+ .dash-line.dashed { background: linear-gradient(to right, currentColor 6px, transparent 6px); background-size: 10px 100%; color: var(--wox-btn-text, var(--wox-text-secondary, #666)); }
186
+ button.v-dash.active .dash-line.dashed { color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
187
+ .dash-line.longdash { background: linear-gradient(to right, currentColor 12px, transparent 4px); background-size: 16px 100%; color: var(--wox-btn-text, var(--wox-text-secondary, #666)); }
188
+ button.v-dash.active .dash-line.longdash { color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
189
+ .dash-line.dotdash { background: linear-gradient(to right, currentColor 8px, transparent 4px, currentColor 2px, transparent 4px); background-size: 18px 100%; color: var(--wox-btn-text, var(--wox-text-secondary, #666)); }
190
+ button.v-dash.active .dash-line.dotdash { color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
191
+ .dash-line.zigzag { background: repeating-linear-gradient(45deg, currentColor, currentColor 2px, transparent 2px, transparent 4px); color: var(--wox-btn-text, var(--wox-text-secondary, #666)); }
192
+ button.v-dash.active .dash-line.zigzag { color: var(--wox-btn-text, var(--wox-accent, #00e5ff)); }
190
193
 
191
194
  .material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; display: inline-block; line-height: 1; text-transform: none; letter-spacing: normal; word-wrap: normal; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; }
192
- ` + S, `<button class="${l}"${d} ${i ? "disabled" : ""}>${h}</button>`), this.$("button").addEventListener("click", (u) => {
193
- i || this.emit("wox-click", { originalEvent: u });
195
+ ` + M, `<button class="${b}"${k}${E} ${i ? "disabled" : ""}>${g}</button>`), this.$("button").addEventListener("click", (z) => {
196
+ i || this.emit("wox-click", { originalEvent: z });
194
197
  });
195
198
  });
196
199
  }
@@ -201,12 +204,12 @@ class Y extends w {
201
204
  this.isConnected && this._render();
202
205
  }
203
206
  }
204
- s(Y, "observedAttributes", ["variant", "icon", "label", "active", "disabled", "color", "size", "dash", "glow", "pulse"]);
207
+ s(Y, "observedAttributes", ["variant", "icon", "label", "active", "disabled", "color", "size", "dash", "glow", "pulse", "border-color", "border-style", "icon-color", "text-color"]);
205
208
  class X extends w {
206
209
  constructor() {
207
210
  super(...arguments);
208
211
  s(this, "_render", () => {
209
- const t = this.getAttribute("type") || "text", e = this.getAttribute("value") || "", n = this.getAttribute("unit") || "", o = this.getAttribute("label") || "", i = this.getAttribute("min"), a = this.getAttribute("max"), r = this.getAttribute("step"), l = this.getAttribute("placeholder") || "", h = this.hasAttribute("disabled"), d = t === "number", u = d ? `${i !== null ? ` min="${i}"` : ""}${a !== null ? ` max="${a}"` : ""}${r !== null ? ` step="${r}"` : ""}` : "";
212
+ const t = this.getAttribute("type") || "text", e = this.getAttribute("value") || "", n = this.getAttribute("unit") || "", o = this.getAttribute("label") || "", i = this.getAttribute("min"), r = this.getAttribute("max"), a = this.getAttribute("step"), l = this.getAttribute("placeholder") || "", x = this.hasAttribute("disabled"), d = t === "number", u = d ? `${i !== null ? ` min="${i}"` : ""}${r !== null ? ` max="${r}"` : ""}${a !== null ? ` step="${a}"` : ""}` : "";
210
213
  this.render(`
211
214
  :host { display: inline-block; }
212
215
  .wrapper { display: flex; flex-direction: column; gap: 3px; }
@@ -233,32 +236,32 @@ class X extends w {
233
236
  <div class="wrapper">
234
237
  ${o ? `<label class="${d ? "scrub" : ""}">${o}${n ? `<span class="unit">${n}</span>` : ""}</label>` : ""}
235
238
  <div class="input-wrap">
236
- <input type="${d ? "number" : "text"}" value="${e}" placeholder="${l}" ${u} ${h ? "disabled" : ""} class="${n && !o ? "has-unit" : ""}">
239
+ <input type="${d ? "number" : "text"}" value="${e}" placeholder="${l}" ${u} ${x ? "disabled" : ""} class="${n && !o ? "has-unit" : ""}">
237
240
  ${n && !o ? `<span class="suffix">${n}</span>` : ""}
238
241
  </div>
239
242
  </div>
240
243
  `);
241
- const x = this.$("input");
242
- if (x.addEventListener("input", () => {
243
- const v = d ? parseFloat(x.value) : x.value;
244
+ const h = this.$("input");
245
+ if (h.addEventListener("input", () => {
246
+ const v = d ? parseFloat(h.value) : h.value;
244
247
  this.emit("wox-input", { value: v });
245
- }), x.addEventListener("change", () => {
246
- const v = d ? parseFloat(x.value) : x.value;
248
+ }), h.addEventListener("change", () => {
249
+ const v = d ? parseFloat(h.value) : h.value;
247
250
  this.emit("wox-change", { value: v });
248
- }), x.addEventListener("keydown", (v) => {
249
- v.key === "Enter" && x.blur();
251
+ }), h.addEventListener("keydown", (v) => {
252
+ v.key === "Enter" && h.blur();
250
253
  }), d && o) {
251
254
  const v = this.$("label");
252
- let g = 0, b = 0;
253
- const y = (A) => {
254
- const M = A.clientX - g, m = parseFloat(r) || 1;
255
- let _ = b + Math.round(M / 2) * m;
256
- i !== null && (_ = Math.max(parseFloat(i), _)), a !== null && (_ = Math.min(parseFloat(a), _)), x.value = _, this.emit("wox-input", { value: _ });
257
- }, E = () => {
258
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", E), this.emit("wox-change", { value: parseFloat(x.value) });
255
+ let b = 0, g = 0;
256
+ const f = (E) => {
257
+ const z = E.clientX - b, m = parseFloat(a) || 1;
258
+ let y = g + Math.round(z / 2) * m;
259
+ i !== null && (y = Math.max(parseFloat(i), y)), r !== null && (y = Math.min(parseFloat(r), y)), h.value = y, this.emit("wox-input", { value: y });
260
+ }, k = () => {
261
+ document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", k), this.emit("wox-change", { value: parseFloat(h.value) });
259
262
  };
260
- v.addEventListener("mousedown", (A) => {
261
- h || (g = A.clientX, b = parseFloat(x.value) || 0, document.addEventListener("mousemove", y), document.addEventListener("mouseup", E), A.preventDefault());
263
+ v.addEventListener("mousedown", (E) => {
264
+ x || (b = E.clientX, g = parseFloat(h.value) || 0, document.addEventListener("mousemove", f), document.addEventListener("mouseup", k), E.preventDefault());
262
265
  });
263
266
  }
264
267
  });
@@ -286,7 +289,7 @@ class X extends w {
286
289
  }
287
290
  }
288
291
  s(X, "observedAttributes", ["type", "value", "unit", "label", "min", "max", "step", "placeholder", "disabled"]);
289
- const k = (p) => String(p).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
292
+ const $ = (p) => String(p).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
290
293
  class q extends w {
291
294
  constructor() {
292
295
  super(...arguments);
@@ -317,8 +320,8 @@ class q extends w {
317
320
  s(this, "_calculateDropdownPosition", () => {
318
321
  const t = this.$(".trigger");
319
322
  if (!t) return null;
320
- const e = t.getBoundingClientRect(), n = window.innerHeight, o = window.innerWidth, i = n - e.bottom, a = e.top, r = e.width, l = Math.max(0, Math.min(e.left, o - r));
321
- return this._openUpward ? { bottom: n - e.top + 2, left: l, width: r, maxHeight: Math.max(100, Math.min(200, a - 10)) } : { top: e.bottom + 2, left: l, width: r, maxHeight: Math.max(100, Math.min(200, i - 10)) };
323
+ const e = t.getBoundingClientRect(), n = window.innerHeight, o = window.innerWidth, i = n - e.bottom, r = e.top, a = e.width, l = Math.max(0, Math.min(e.left, o - a));
324
+ return this._openUpward ? { bottom: n - e.top + 2, left: l, width: a, maxHeight: Math.max(100, Math.min(200, r - 10)) } : { top: e.bottom + 2, left: l, width: a, maxHeight: Math.max(100, Math.min(200, i - 10)) };
322
325
  });
323
326
  s(this, "_updateDropdownPosition", () => {
324
327
  requestAnimationFrame(() => {
@@ -368,25 +371,25 @@ class q extends w {
368
371
  let e = "";
369
372
  if (this.multiple && this._selectedOptions.length > 0) e = this._selectedOptions.map((o) => `
370
373
  <span class="tag">
371
- ${o.image ? `<img src="${k(o.image)}" class="tag-img" alt="">` : ""}
372
- ${k(o.label)}
373
- <span class="remove-tag" data-value="${k(o.value)}">×</span>
374
+ ${o.image ? `<img src="${$(o.image)}" class="tag-img" alt="">` : ""}
375
+ ${$(o.label)}
376
+ <span class="remove-tag" data-value="${$(o.value)}">×</span>
374
377
  </span>
375
378
  `).join("");
376
379
  else if (this._selectedOptions.length > 0) {
377
380
  const o = this._selectedOptions[0];
378
381
  e = `<span class="single-value">
379
- ${o.image ? `<img src="${k(o.image)}" class="single-img" alt="">` : ""}
380
- <span>${k(o.label)}</span>
382
+ ${o.image ? `<img src="${$(o.image)}" class="single-img" alt="">` : ""}
383
+ <span>${$(o.label)}</span>
381
384
  </span>`;
382
- } else e = `<span class="placeholder">${k(this.placeholder)}</span>`;
385
+ } else e = `<span class="placeholder">${$(this.placeholder)}</span>`;
383
386
  let n = "";
384
- if (this._isOpen && (n = `<div class="dropdown">${this.searchable ? `<input type="text" class="search-input" placeholder="Search..." value="${k(this._searchValue)}">` : ""}${this._filteredOptions.length > 0 ? this._filteredOptions.map((o, i) => `<div
385
- class="option${this._selectedOptions.some((a) => a.value === o.value) ? " selected" : ""}${i === this._focusedIndex ? " focused" : ""}"
386
- data-value="${k(o.value)}"
387
+ if (this._isOpen && (n = `<div class="dropdown">${this.searchable ? `<input type="text" class="search-input" placeholder="Search..." value="${$(this._searchValue)}">` : ""}${this._filteredOptions.length > 0 ? this._filteredOptions.map((o, i) => `<div
388
+ class="option${this._selectedOptions.some((r) => r.value === o.value) ? " selected" : ""}${i === this._focusedIndex ? " focused" : ""}"
389
+ data-value="${$(o.value)}"
387
390
  >
388
- ${o.image ? `<img src="${k(o.image)}" class="option-img" alt="">` : ""}
389
- <span>${k(o.label)}</span>
391
+ ${o.image ? `<img src="${$(o.image)}" class="option-img" alt="">` : ""}
392
+ <span>${$(o.label)}</span>
390
393
  </div>`).join("") : '<div class="no-options">No options found</div>'}</div>`), this.render(`
391
394
  :host {
392
395
  display: inline-block;
@@ -615,7 +618,7 @@ class q extends w {
615
618
  if (t === "options") {
616
619
  this._parsedOptions = null;
617
620
  const o = this.options;
618
- this._filteredOptions = [...o], this._selectedOptions = this._selectedOptions.filter((i) => o.some((a) => a.value === i.value));
621
+ this._filteredOptions = [...o], this._selectedOptions = this._selectedOptions.filter((i) => o.some((r) => r.value === i.value));
619
622
  } else if (t === "value" && n !== null) {
620
623
  const o = this.options.find((i) => i.value === n);
621
624
  this._selectedOptions = o ? [o] : [];
@@ -716,11 +719,11 @@ class J extends w {
716
719
  return e === "%" ? Math.round(100 * t) + "%" : n < 1 ? t.toFixed(2) : String(t);
717
720
  });
718
721
  s(this, "_updateVisuals", () => {
719
- const { min: t, max: e } = this._getConfig(), n = parseFloat(this.getAttribute("value") ?? t), o = (n - t) / (e - t) * 100, i = this.$(".fill"), a = this.$(".thumb"), r = this.$(".value");
720
- i && (i.style.width = o + "%"), a && (a.style.left = o + "%"), r && (r.textContent = this._formatVal(n));
722
+ const { min: t, max: e } = this._getConfig(), n = parseFloat(this.getAttribute("value") ?? t), o = (n - t) / (e - t) * 100, i = this.$(".fill"), r = this.$(".thumb"), a = this.$(".value");
723
+ i && (i.style.width = o + "%"), r && (r.style.left = o + "%"), a && (a.textContent = this._formatVal(n));
721
724
  });
722
725
  s(this, "_build", () => {
723
- const { min: t, max: e } = this._getConfig(), n = parseFloat(this.getAttribute("value") ?? t), o = this.getAttribute("label") || "", i = this.hasAttribute("show-value"), a = (n - t) / (e - t) * 100, r = this.getAttribute("color") || "", l = [this.hasAttribute("glow") ? "glow" : "", this.hasAttribute("pulse") ? "pulse" : ""].filter(Boolean).join(" "), h = r ? `--wox-fx-color:${r};border-color:${r}` : "", d = r ? " custom-color" : "";
726
+ const { min: t, max: e } = this._getConfig(), n = parseFloat(this.getAttribute("value") ?? t), o = this.getAttribute("label") || "", i = this.hasAttribute("show-value"), r = (n - t) / (e - t) * 100, a = this.getAttribute("color") || "", l = [this.hasAttribute("glow") ? "glow" : "", this.hasAttribute("pulse") ? "pulse" : ""].filter(Boolean).join(" "), x = a ? `--wox-fx-color:${a};border-color:${a}` : "", d = a ? " custom-color" : "";
724
727
  this.render(`
725
728
  :host { display: inline-block; width: 100%; }
726
729
  .wrapper { display: flex; align-items: center; gap: var(--wox-space-lg, 12px); }
@@ -745,38 +748,38 @@ class J extends w {
745
748
  }
746
749
  .fill.custom-color { background: var(--wox-fx-color); }
747
750
  .thumb.glow { width: 16px; height: 16px; }
748
- ` + S, `
751
+ ` + M, `
749
752
  <div class="wrapper">
750
753
  ${o ? `<span class="label">${o}</span>` : ""}
751
754
  <div class="track-wrap">
752
- <div class="track"><div class="fill${d}" style="width:${a}%;${r ? "--wox-fx-color:" + r : ""}"></div></div>
753
- <div class="thumb ${l}" style="${h};left:${a}%"></div>
755
+ <div class="track"><div class="fill${d}" style="width:${r}%;${a ? "--wox-fx-color:" + a : ""}"></div></div>
756
+ <div class="thumb ${l}" style="${x};left:${r}%"></div>
754
757
  </div>
755
758
  ${i ? `<span class="value">${this._formatVal(n)}</span>` : ""}
756
759
  </div>
757
760
  `), this._attachDrag();
758
761
  });
759
762
  s(this, "_attachDrag", () => {
760
- const { min: t, max: e, step: n, unit: o } = this._getConfig(), i = this.$(".track-wrap"), a = this.$(".fill"), r = this.$(".thumb"), l = this.$(".value"), h = (x) => {
763
+ const { min: t, max: e, step: n, unit: o } = this._getConfig(), i = this.$(".track-wrap"), r = this.$(".fill"), a = this.$(".thumb"), l = this.$(".value"), x = (h) => {
761
764
  const v = i.getBoundingClientRect();
762
- let g = (x - v.left) / v.width;
763
- g = Math.max(0, Math.min(1, g));
764
- let b = t + g * (e - t);
765
- b = Math.round(b / n) * n, b = Math.max(t, Math.min(e, b));
766
- const y = (b - t) / (e - t) * 100;
767
- return a.style.width = y + "%", r.style.left = y + "%", l && (l.textContent = o === "%" ? Math.round(100 * b) + "%" : n < 1 ? b.toFixed(2) : String(b)), b;
768
- }, d = (x) => {
769
- const v = h(x.clientX);
765
+ let b = (h - v.left) / v.width;
766
+ b = Math.max(0, Math.min(1, b));
767
+ let g = t + b * (e - t);
768
+ g = Math.round(g / n) * n, g = Math.max(t, Math.min(e, g));
769
+ const f = (g - t) / (e - t) * 100;
770
+ return r.style.width = f + "%", a.style.left = f + "%", l && (l.textContent = o === "%" ? Math.round(100 * g) + "%" : n < 1 ? g.toFixed(2) : String(g)), g;
771
+ }, d = (h) => {
772
+ const v = x(h.clientX);
770
773
  this.emit("wox-input", { value: v });
771
- }, u = (x) => {
772
- this._dragging = !1, r.classList.remove("dragging"), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
773
- const v = h(x.clientX);
774
+ }, u = (h) => {
775
+ this._dragging = !1, a.classList.remove("dragging"), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
776
+ const v = x(h.clientX);
774
777
  this.setAttribute("value", v), this.emit("wox-change", { value: v });
775
778
  };
776
- i.addEventListener("mousedown", (x) => {
777
- this._dragging = !0, r.classList.add("dragging");
778
- const v = h(x.clientX);
779
- this.emit("wox-input", { value: v }), document.addEventListener("mousemove", d), document.addEventListener("mouseup", u), x.preventDefault();
779
+ i.addEventListener("mousedown", (h) => {
780
+ this._dragging = !0, a.classList.add("dragging");
781
+ const v = x(h.clientX);
782
+ this.emit("wox-input", { value: v }), document.addEventListener("mousemove", d), document.addEventListener("mouseup", u), h.preventDefault();
780
783
  });
781
784
  });
782
785
  this._dragging = !1;
@@ -793,7 +796,7 @@ class K extends w {
793
796
  constructor() {
794
797
  super(...arguments);
795
798
  s(this, "_render", () => {
796
- const t = this.getAttribute("color") || "transparent", e = this.getAttribute("size") || "24", n = this.hasAttribute("selected"), o = this.hasAttribute("glow"), i = this.hasAttribute("pulse"), a = [n ? "selected" : "", o ? "glow" : "", i ? "pulse" : ""].filter(Boolean).join(" "), r = o || i ? ` style="--wox-fx-color:${t}"` : "";
799
+ const t = this.getAttribute("color") || "transparent", e = this.getAttribute("size") || "24", n = this.hasAttribute("selected"), o = this.hasAttribute("glow"), i = this.hasAttribute("pulse"), r = [n ? "selected" : "", o ? "glow" : "", i ? "pulse" : ""].filter(Boolean).join(" "), a = o || i ? ` style="--wox-fx-color:${t}"` : "";
797
800
  this.render(`
798
801
  :host { display: inline-block; }
799
802
  .swatch {
@@ -811,7 +814,7 @@ class K extends w {
811
814
  background: repeating-conic-gradient(#888 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
812
815
  }
813
816
  .color { position: absolute; inset: 0; }
814
- ${S} :host { --size: ${e}px; }`, `<div class="swatch ${a}"${r}>
817
+ ${M} :host { --size: ${e}px; }`, `<div class="swatch ${r}"${a}>
815
818
  <div class="checker"></div>
816
819
  <div class="color" style="background:${t}"></div>
817
820
  </div>`), this.$(".swatch").addEventListener("click", () => {
@@ -851,9 +854,9 @@ class V extends w {
851
854
  s(this, "_position", () => {
852
855
  const t = this.shadowRoot.querySelector(".tip");
853
856
  if (!t) return;
854
- const e = this.getAttribute("position") || "top", n = this.getBoundingClientRect(), o = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight, r = { top: n.top - 6 - o.height >= 0, bottom: n.bottom + 6 + o.height <= a, left: n.left - 6 - o.width >= 0, right: n.right + 6 + o.width <= i }, l = { top: "bottom", bottom: "top", left: "right", right: "left" }, h = [e, l[e], ...["top", "bottom", "left", "right"].filter((x) => x !== e && x !== l[e])].find((x) => r[x]) || e;
857
+ const e = this.getAttribute("position") || "top", n = this.getBoundingClientRect(), o = t.getBoundingClientRect(), i = window.innerWidth, r = window.innerHeight, a = { top: n.top - 6 - o.height >= 0, bottom: n.bottom + 6 + o.height <= r, left: n.left - 6 - o.width >= 0, right: n.right + 6 + o.width <= i }, l = { top: "bottom", bottom: "top", left: "right", right: "left" }, x = [e, l[e], ...["top", "bottom", "left", "right"].filter((h) => h !== e && h !== l[e])].find((h) => a[h]) || e;
855
858
  let d, u;
856
- h === "top" ? (d = n.top - 6 - o.height, u = n.left + n.width / 2 - o.width / 2) : h === "bottom" ? (d = n.bottom + 6, u = n.left + n.width / 2 - o.width / 2) : h === "left" ? (d = n.top + n.height / 2 - o.height / 2, u = n.left - 6 - o.width) : (d = n.top + n.height / 2 - o.height / 2, u = n.right + 6), u = Math.max(4, Math.min(u, i - o.width - 4)), d = Math.max(4, Math.min(d, a - o.height - 4)), t.style.top = `${d}px`, t.style.left = `${u}px`;
859
+ x === "top" ? (d = n.top - 6 - o.height, u = n.left + n.width / 2 - o.width / 2) : x === "bottom" ? (d = n.bottom + 6, u = n.left + n.width / 2 - o.width / 2) : x === "left" ? (d = n.top + n.height / 2 - o.height / 2, u = n.left - 6 - o.width) : (d = n.top + n.height / 2 - o.height / 2, u = n.right + 6), u = Math.max(4, Math.min(u, i - o.width - 4)), d = Math.max(4, Math.min(d, r - o.height - 4)), t.style.top = `${d}px`, t.style.left = `${u}px`;
857
860
  });
858
861
  }
859
862
  connectedCallback() {
@@ -973,21 +976,21 @@ class U extends w {
973
976
  const t = this._wCtx, e = 220;
974
977
  t.clearRect(0, 0, e, e);
975
978
  const n = t.createConicGradient(-Math.PI / 2, 110, 110);
976
- for (let x = 0; x <= 36; x++) n.addColorStop(x / 36, `hsl(${10 * x},100%,50%)`);
979
+ for (let h = 0; h <= 36; h++) n.addColorStop(h / 36, `hsl(${10 * h},100%,50%)`);
977
980
  t.fillStyle = n, t.beginPath(), t.arc(110, 110, 104, 0, 2 * Math.PI), t.fill(), t.save(), t.globalCompositeOperation = "destination-out", t.beginPath(), t.arc(110, 110, 78, 0, 2 * Math.PI), t.fill(), t.restore(), t.strokeStyle = "rgba(0,0,0,0.25)", t.lineWidth = 1, t.beginPath(), t.arc(110, 110, 103.5, 0, 2 * Math.PI), t.stroke(), t.beginPath(), t.arc(110, 110, 78.5, 0, 2 * Math.PI), t.stroke();
978
- const o = this._hue * Math.PI * 2 - Math.PI / 2, i = 110 + 91 * Math.cos(o), a = 110 + 91 * Math.sin(o);
979
- t.strokeStyle = "#fff", t.lineWidth = 2.5, t.beginPath(), t.arc(i, a, 8, 0, 2 * Math.PI), t.stroke(), t.strokeStyle = "rgba(0,0,0,0.4)", t.lineWidth = 1, t.beginPath(), t.arc(i, a, 8, 0, 2 * Math.PI), t.stroke();
980
- const r = 104, l = t.createLinearGradient(58, 0, 162, 0);
981
- l.addColorStop(0, "#fff"), l.addColorStop(1, `hsl(${360 * this._hue},100%,50%)`), t.fillStyle = l, t.fillRect(58, 58, r, r);
982
- const h = t.createLinearGradient(0, 58, 0, 162);
983
- h.addColorStop(0, "rgba(0,0,0,0)"), h.addColorStop(1, "rgba(0,0,0,1)"), t.fillStyle = h, t.fillRect(58, 58, r, r);
984
- const d = 58 + this._sat * r, u = 58 + (1 - this._val) * r;
981
+ const o = this._hue * Math.PI * 2 - Math.PI / 2, i = 110 + 91 * Math.cos(o), r = 110 + 91 * Math.sin(o);
982
+ t.strokeStyle = "#fff", t.lineWidth = 2.5, t.beginPath(), t.arc(i, r, 8, 0, 2 * Math.PI), t.stroke(), t.strokeStyle = "rgba(0,0,0,0.4)", t.lineWidth = 1, t.beginPath(), t.arc(i, r, 8, 0, 2 * Math.PI), t.stroke();
983
+ const a = 104, l = t.createLinearGradient(58, 0, 162, 0);
984
+ l.addColorStop(0, "#fff"), l.addColorStop(1, `hsl(${360 * this._hue},100%,50%)`), t.fillStyle = l, t.fillRect(58, 58, a, a);
985
+ const x = t.createLinearGradient(0, 58, 0, 162);
986
+ x.addColorStop(0, "rgba(0,0,0,0)"), x.addColorStop(1, "rgba(0,0,0,1)"), t.fillStyle = x, t.fillRect(58, 58, a, a);
987
+ const d = 58 + this._sat * a, u = 58 + (1 - this._val) * a;
985
988
  t.strokeStyle = "#fff", t.lineWidth = 2.5, t.beginPath(), t.arc(d, u, 7, 0, 2 * Math.PI), t.stroke(), t.strokeStyle = "rgba(0,0,0,0.4)", t.lineWidth = 1, t.beginPath(), t.arc(d, u, 7, 0, 2 * Math.PI), t.stroke();
986
989
  });
987
990
  s(this, "_drawAlpha", () => {
988
991
  const t = this._aCtx;
989
992
  t.clearRect(0, 0, 192, 14);
990
- for (let a = 0; a < 192; a += 8) for (let r = 0; r < 14; r += 8) t.fillStyle = (a / 8 + r / 8) % 2 == 0 ? "#aaa" : "#fff", t.fillRect(a, r, 8, 8);
993
+ for (let r = 0; r < 192; r += 8) for (let a = 0; a < 14; a += 8) t.fillStyle = (r / 8 + a / 8) % 2 == 0 ? "#aaa" : "#fff", t.fillRect(r, a, 8, 8);
991
994
  const [e, n, o] = this._hsvToRgb(this._hue, this._sat, this._val), i = t.createLinearGradient(0, 0, 192, 0);
992
995
  i.addColorStop(0, `rgba(${e},${n},${o},0)`), i.addColorStop(1, `rgba(${e},${n},${o},1)`), t.fillStyle = i, t.fillRect(0, 0, 192, 14), this._alphaKnob.style.left = 192 * this._alpha - 7 + "px";
993
996
  });
@@ -1022,16 +1025,16 @@ class U extends w {
1022
1025
  });
1023
1026
  s(this, "_hsvToRgb", (t, e, n) => {
1024
1027
  const o = (i) => {
1025
- const a = (i + 6 * t) % 6;
1026
- return n - n * e * Math.max(0, Math.min(a, 4 - a, 1));
1028
+ const r = (i + 6 * t) % 6;
1029
+ return n - n * e * Math.max(0, Math.min(r, 4 - r, 1));
1027
1030
  };
1028
1031
  return [Math.round(255 * o(5)), Math.round(255 * o(3)), Math.round(255 * o(1))];
1029
1032
  });
1030
1033
  s(this, "_rgbToHsv", (t, e, n) => {
1031
1034
  t /= 255, e /= 255, n /= 255;
1032
1035
  const o = Math.max(t, e, n), i = o - Math.min(t, e, n);
1033
- let a = 0;
1034
- return i && (a = o === t ? ((e - n) / i % 6 + 6) % 6 : o === e ? (n - t) / i + 2 : (t - e) / i + 4), [a / 6, o ? i / o : 0, o];
1036
+ let r = 0;
1037
+ return i && (r = o === t ? ((e - n) / i % 6 + 6) % 6 : o === e ? (n - t) / i + 2 : (t - e) / i + 4), [r / 6, o ? i / o : 0, o];
1035
1038
  });
1036
1039
  s(this, "_hexToRgb", (t) => {
1037
1040
  const e = parseInt(t.slice(1), 16);
@@ -1076,13 +1079,13 @@ class Q extends w {
1076
1079
  constructor() {
1077
1080
  super(...arguments);
1078
1081
  s(this, "_render", () => {
1079
- const t = this.getAttribute("type") || "item", e = this.getAttribute("label") || "", n = this.getAttribute("shortcut") || "", o = this.getAttribute("icon") || "", i = this.hasAttribute("disabled"), a = this.hasAttribute("submenu");
1082
+ const t = this.getAttribute("type") || "item", e = this.getAttribute("label") || "", n = this.getAttribute("shortcut") || "", o = this.getAttribute("icon") || "", i = this.hasAttribute("disabled"), r = this.hasAttribute("submenu");
1080
1083
  t !== "separator" ? t !== "header" ? (this.render(P, `
1081
1084
  <div class="item ${i ? "disabled" : ""}">
1082
1085
  ${o ? `<span class="icon material-icons">${o}</span>` : ""}
1083
1086
  <span class="label">${e}</span>
1084
1087
  ${n ? `<span class="shortcut">${n}</span>` : ""}
1085
- ${a ? '<span class="arrow">&#9654;</span>' : ""}
1088
+ ${r ? '<span class="arrow">&#9654;</span>' : ""}
1086
1089
  </div>
1087
1090
  `), i || this.$(".item").addEventListener("click", () => {
1088
1091
  this.emit("wox-select", { label: e });
@@ -1124,7 +1127,7 @@ class Z extends w {
1124
1127
  `);
1125
1128
  const o = this.$(".trigger");
1126
1129
  this.$(".dropdown"), n === "click" ? o.addEventListener("click", (i) => {
1127
- i.stopPropagation(), this._toggle();
1130
+ i.stopPropagation(), this.children.length === 0 ? this.emit("wox-click", { label: this.getAttribute("label") || "" }) : this._toggle();
1128
1131
  }) : n === "hover" && (this.addEventListener("mouseenter", () => this._open()), this.addEventListener("mouseleave", () => this._close())), this._outsideClick = (i) => {
1129
1132
  !this.contains(i.target) && this.hasAttribute("open") && this._close();
1130
1133
  }, document.addEventListener("mousedown", this._outsideClick), this.addEventListener("wox-select", () => this._close());
@@ -1139,10 +1142,10 @@ class Z extends w {
1139
1142
  requestAnimationFrame(() => {
1140
1143
  const t = this.$(".trigger"), e = this.$(".dropdown");
1141
1144
  if (!t || !e) return;
1142
- const n = t.getBoundingClientRect(), o = window.innerWidth, i = window.innerHeight, a = e.getBoundingClientRect();
1143
- n.left + a.width > o ? e.style.left = n.right - a.width + "px" : e.style.left = `${n.left}px`;
1144
- const r = i - n.bottom, l = n.top;
1145
- r >= a.height || r >= l ? (e.style.top = `${n.bottom}px`, e.style.bottom = "") : (e.style.top = "", e.style.bottom = i - n.top + "px");
1145
+ const n = t.getBoundingClientRect(), o = window.innerWidth, i = window.innerHeight, r = e.getBoundingClientRect();
1146
+ n.left + r.width > o ? e.style.left = n.right - r.width + "px" : e.style.left = `${n.left}px`;
1147
+ const a = i - n.bottom, l = n.top;
1148
+ a >= r.height || a >= l ? (e.style.top = `${n.bottom}px`, e.style.bottom = "") : (e.style.top = "", e.style.bottom = i - n.top + "px");
1146
1149
  });
1147
1150
  });
1148
1151
  s(this, "_close", () => {
@@ -1171,7 +1174,7 @@ class tt extends w {
1171
1174
  constructor() {
1172
1175
  super(...arguments);
1173
1176
  s(this, "_render", () => {
1174
- const t = this.getAttribute("name") || "Layer", e = this.getAttribute("type") || "layer", n = this.hasAttribute("visible"), o = this.hasAttribute("locked"), i = this.hasAttribute("selected"), a = $t[e] || "layers";
1177
+ const t = this.getAttribute("name") || "Layer", e = this.getAttribute("type") || "layer", n = this.hasAttribute("visible"), o = this.hasAttribute("locked"), i = this.hasAttribute("selected"), r = $t[e] || "layers";
1175
1178
  this.render(`
1176
1179
  :host { display: block; }
1177
1180
  .layer {
@@ -1199,19 +1202,19 @@ class tt extends w {
1199
1202
  .toggle:hover, .toggle.on { opacity: 1; color: var(--wox-accent, #00e5ff); }
1200
1203
  `, `
1201
1204
  <div class="layer ${i ? "selected" : ""}">
1202
- <span class="type-icon material-icons">${a}</span>
1205
+ <span class="type-icon material-icons">${r}</span>
1203
1206
  <span class="name">${t}</span>
1204
1207
  <span class="toggle eye ${n ? "on" : ""} material-icons">${n ? "visibility" : "visibility_off"}</span>
1205
1208
  <span class="toggle lock ${o ? "on" : ""} material-icons">${o ? "lock" : "lock_open"}</span>
1206
1209
  </div>
1207
- `), this.$(".layer").addEventListener("click", (r) => {
1208
- r.target.closest(".toggle") || this.emit("wox-select", { name: t });
1209
- }), this.$(".name").addEventListener("dblclick", () => this._startEditing()), this.$(".eye").addEventListener("click", (r) => {
1210
- r.stopPropagation();
1210
+ `), this.$(".layer").addEventListener("click", (a) => {
1211
+ a.target.closest(".toggle") || this.emit("wox-select", { name: t });
1212
+ }), this.$(".name").addEventListener("dblclick", () => this._startEditing()), this.$(".eye").addEventListener("click", (a) => {
1213
+ a.stopPropagation();
1211
1214
  const l = !n;
1212
1215
  l ? this.setAttribute("visible", "") : this.removeAttribute("visible"), this.emit("wox-visibility", { visible: l });
1213
- }), this.$(".lock").addEventListener("click", (r) => {
1214
- r.stopPropagation();
1216
+ }), this.$(".lock").addEventListener("click", (a) => {
1217
+ a.stopPropagation();
1215
1218
  const l = !o;
1216
1219
  l ? this.setAttribute("locked", "") : this.removeAttribute("locked"), this.emit("wox-lock", { locked: l });
1217
1220
  });
@@ -1359,9 +1362,9 @@ class ot extends w {
1359
1362
  t.innerHTML = "";
1360
1363
  const e = this._getTabs(), n = this.getAttribute("active") || ((o = e[0]) == null ? void 0 : o.getAttribute("name")) || "";
1361
1364
  e.forEach((i) => {
1362
- const a = i.getAttribute("name") || "", r = i.getAttribute("label") || a, l = document.createElement("button");
1363
- l.className = "tab-btn" + (a === n ? " active" : ""), l.textContent = r, l.addEventListener("click", () => {
1364
- this.setAttribute("active", a), this.emit("wox-tab-change", { name: a });
1365
+ const r = i.getAttribute("name") || "", a = i.getAttribute("label") || r, l = document.createElement("button");
1366
+ l.className = "tab-btn" + (r === n ? " active" : ""), l.textContent = a, l.addEventListener("click", () => {
1367
+ this.setAttribute("active", r), this.emit("wox-tab-change", { name: r });
1365
1368
  }), t.appendChild(l);
1366
1369
  }), this._updateActive();
1367
1370
  });
@@ -1371,9 +1374,9 @@ class ot extends w {
1371
1374
  t.forEach((o) => {
1372
1375
  (o.getAttribute("name") || "") === e ? o.setAttribute("active", "") : o.removeAttribute("active");
1373
1376
  }), this.$$(".tab-btn").forEach((o, i) => {
1374
- var r;
1375
- const a = ((r = t[i]) == null ? void 0 : r.getAttribute("name")) || "";
1376
- o.classList.toggle("active", a === e);
1377
+ var a;
1378
+ const r = ((a = t[i]) == null ? void 0 : a.getAttribute("name")) || "";
1379
+ o.classList.toggle("active", r === e);
1377
1380
  });
1378
1381
  });
1379
1382
  s(this, "_getTabs", () => [...this.querySelectorAll(":scope > wox-tab")]);
@@ -1434,7 +1437,7 @@ class st extends w {
1434
1437
  }
1435
1438
  }
1436
1439
  s(st, "observedAttributes", ["width", "position"]);
1437
- class at extends w {
1440
+ class rt extends w {
1438
1441
  constructor() {
1439
1442
  super(...arguments);
1440
1443
  s(this, "_render", () => {
@@ -1460,14 +1463,14 @@ class at extends w {
1460
1463
  const n = this.$(".resizer");
1461
1464
  if (!n) return;
1462
1465
  let o = 0, i = 0;
1463
- const a = this.getAttribute("position") === "left", r = (h) => {
1464
- const d = a ? h.clientX - o : o - h.clientX, u = Math.max(180, Math.min(600, i + d));
1466
+ const r = this.getAttribute("position") === "left", a = (x) => {
1467
+ const d = r ? x.clientX - o : o - x.clientX, u = Math.max(180, Math.min(600, i + d));
1465
1468
  this.style.width = u + "px";
1466
1469
  }, l = () => {
1467
- document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", l);
1470
+ document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", l);
1468
1471
  };
1469
- n.addEventListener("mousedown", (h) => {
1470
- o = h.clientX, i = this.getBoundingClientRect().width, document.addEventListener("mousemove", r), document.addEventListener("mouseup", l), h.preventDefault();
1472
+ n.addEventListener("mousedown", (x) => {
1473
+ o = x.clientX, i = this.getBoundingClientRect().width, document.addEventListener("mousemove", a), document.addEventListener("mouseup", l), x.preventDefault();
1471
1474
  });
1472
1475
  }
1473
1476
  });
@@ -1479,8 +1482,8 @@ class at extends w {
1479
1482
  this.isConnected && this._render();
1480
1483
  }
1481
1484
  }
1482
- s(at, "observedAttributes", ["width", "position", "resizable"]);
1483
- class rt extends w {
1485
+ s(rt, "observedAttributes", ["width", "position", "resizable"]);
1486
+ class at extends w {
1484
1487
  constructor() {
1485
1488
  super(...arguments);
1486
1489
  s(this, "_render", () => {
@@ -1506,7 +1509,7 @@ class rt extends w {
1506
1509
  this.isConnected && this._render();
1507
1510
  }
1508
1511
  }
1509
- s(rt, "observedAttributes", ["height"]);
1512
+ s(at, "observedAttributes", ["height"]);
1510
1513
  class dt extends w {
1511
1514
  constructor() {
1512
1515
  super(...arguments);
@@ -1540,7 +1543,7 @@ class lt extends w {
1540
1543
  constructor() {
1541
1544
  super(...arguments);
1542
1545
  s(this, "_render", () => {
1543
- const t = this.getAttribute("title") || "", e = !this.hasAttribute("closable") || this.getAttribute("closable") !== "false", n = this.getAttribute("width") || "400px", o = this.getAttribute("color") || "", i = [this.hasAttribute("glow") ? "glow" : "", this.hasAttribute("pulse") ? "pulse" : ""].filter(Boolean).join(" "), a = o ? ` style="--wox-fx-color:${o}"` : "";
1546
+ const t = this.getAttribute("title") || "", e = !this.hasAttribute("closable") || this.getAttribute("closable") !== "false", n = this.getAttribute("width") || "400px", o = this.getAttribute("color") || "", i = [this.hasAttribute("glow") ? "glow" : "", this.hasAttribute("pulse") ? "pulse" : ""].filter(Boolean).join(" "), r = o ? ` style="--wox-fx-color:${o}"` : "";
1544
1547
  this.render(`
1545
1548
  :host { display: none; }
1546
1549
  :host([open]) { display: block; }
@@ -1577,9 +1580,9 @@ class lt extends w {
1577
1580
  .btn-secondary:hover { background: var(--wox-border-light, #444); }
1578
1581
  .btn-primary { background: var(--wox-accent, #00e5ff); color: var(--wox-text-hi, #fff); }
1579
1582
  .btn-primary:hover { filter: brightness(0.85); }
1580
- ${S} .box { --width: ${n}; }`, `
1583
+ ${M} .box { --width: ${n}; }`, `
1581
1584
  <div class="overlay">
1582
- <div class="box ${i}"${a}>
1585
+ <div class="box ${i}"${r}>
1583
1586
  <div class="header">
1584
1587
  <span class="title">${t}</span>
1585
1588
  ${e ? '<button class="close-btn">&#x2715;</button>' : ""}
@@ -1596,16 +1599,16 @@ class lt extends w {
1596
1599
  `), this.$(".overlay").addEventListener("click", (d) => {
1597
1600
  d.target === this.$(".overlay") && (this.removeAttribute("open"), this.emit("wox-close", {}));
1598
1601
  });
1599
- const r = this.$(".close-btn");
1600
- r && r.addEventListener("click", () => {
1602
+ const a = this.$(".close-btn");
1603
+ a && a.addEventListener("click", () => {
1601
1604
  this.removeAttribute("open"), this.emit("wox-close", {});
1602
1605
  });
1603
1606
  const l = this.$(".cancel-btn");
1604
1607
  l && l.addEventListener("click", () => {
1605
1608
  this.removeAttribute("open"), this.emit("wox-cancel", {});
1606
1609
  });
1607
- const h = this.$(".ok-btn");
1608
- h && h.addEventListener("click", () => {
1610
+ const x = this.$(".ok-btn");
1611
+ x && x.addEventListener("click", () => {
1609
1612
  this.removeAttribute("open"), this.emit("wox-confirm", {});
1610
1613
  });
1611
1614
  });
@@ -1655,26 +1658,26 @@ class vt extends w {
1655
1658
  if (!this._sortKey) return this._rows;
1656
1659
  const t = this._sortKey, e = this._sortDir === "asc" ? 1 : -1;
1657
1660
  return [...this._rows].sort((n, o) => {
1658
- const i = n[t], a = o[t];
1659
- return i == null && a == null ? 0 : i == null ? e : a == null ? -e : typeof i == "number" && typeof a == "number" ? (i - a) * e : String(i).localeCompare(String(a)) * e;
1661
+ const i = n[t], r = o[t];
1662
+ return i == null && r == null ? 0 : i == null ? e : r == null ? -e : typeof i == "number" && typeof r == "number" ? (i - r) * e : String(i).localeCompare(String(r)) * e;
1660
1663
  });
1661
1664
  });
1662
1665
  s(this, "_render", () => {
1663
1666
  const t = this._getSortedRows(), e = this._columns.map((o, i) => {
1664
- const a = this._sortKey === o.key, r = [a ? "sorted" : "", a && this._sortDir === "desc" ? "desc" : ""].filter(Boolean).join(" "), l = o.sortable !== !1;
1665
- return `<div class="header-cell ${r}" data-col="${i}" style="width:${this._colWidths[i]}px" draggable="true">
1667
+ const r = this._sortKey === o.key, a = [r ? "sorted" : "", r && this._sortDir === "desc" ? "desc" : ""].filter(Boolean).join(" "), l = o.sortable !== !1;
1668
+ return `<div class="header-cell ${a}" data-col="${i}" style="width:${this._colWidths[i]}px" draggable="true">
1666
1669
  <span class="label-text">${o.label || o.key}</span>
1667
1670
  ${l ? '<span class="sort-arrow">&#9650;</span>' : ""}
1668
1671
  <div class="resize-handle" data-col="${i}"></div>
1669
1672
  </div>`;
1670
1673
  }).join(""), n = t.length === 0 ? '<div class="empty">No data</div>' : t.map((o, i) => {
1671
- const a = i % 2 == 0 ? "even" : "odd", r = this._columns.map((l, h) => {
1672
- const d = l.align ? ` align-${l.align}` : "", u = this._editingCell && this._editingCell.rowIndex === i && this._editingCell.key === l.key, x = o[l.key] != null ? o[l.key] : "";
1673
- return u ? `<div class="cell${d}" style="width:${this._colWidths[h]}px" data-key="${l.key}">
1674
+ const r = i % 2 == 0 ? "even" : "odd", a = this._columns.map((l, x) => {
1675
+ const d = l.align ? ` align-${l.align}` : "", u = this._editingCell && this._editingCell.rowIndex === i && this._editingCell.key === l.key, h = o[l.key] != null ? o[l.key] : "";
1676
+ return u ? `<div class="cell${d}" style="width:${this._colWidths[x]}px" data-key="${l.key}">
1674
1677
  <input class="cell-input" spellcheck="false">
1675
- </div>` : `<div class="cell${d}" style="width:${this._colWidths[h]}px" data-key="${l.key}">${x}</div>`;
1678
+ </div>` : `<div class="cell${d}" style="width:${this._colWidths[x]}px" data-key="${l.key}">${h}</div>`;
1676
1679
  }).join("");
1677
- return `<div class="row ${a}" data-row="${i}">${r}</div>`;
1680
+ return `<div class="row ${r}" data-row="${i}">${a}</div>`;
1678
1681
  }).join("");
1679
1682
  if (this.render(`
1680
1683
  :host { display: block; overflow: hidden; border: 1px solid var(--wox-border, #333); border-radius: var(--wox-radius-md, 6px); background: var(--wox-bg-panel, #17171a); }
@@ -1768,11 +1771,11 @@ class vt extends w {
1768
1771
  `), this._bindEvents(), this._editingCell) {
1769
1772
  const o = this.$(".cell-input");
1770
1773
  if (o) {
1771
- const { rowIndex: i, key: a } = this._editingCell, r = this._getSortedRows();
1772
- let l = r[i][a] != null ? r[i][a] : "";
1773
- const h = document.createElement("div");
1774
- h.innerHTML = l;
1775
- const d = h.textContent || h.innerText || l;
1774
+ const { rowIndex: i, key: r } = this._editingCell, a = this._getSortedRows();
1775
+ let l = a[i][r] != null ? a[i][r] : "";
1776
+ const x = document.createElement("div");
1777
+ x.innerHTML = l;
1778
+ const d = x.textContent || x.innerText || l;
1776
1779
  o.value = d, o.dataset.oldValue = d, o.focus(), o.select(), o.addEventListener("keydown", (u) => {
1777
1780
  u.key === "Enter" ? this._commitEdit(o.value) : u.key === "Escape" && (this._editingCell = null, this._render());
1778
1781
  }), o.addEventListener("blur", () => {
@@ -1783,8 +1786,8 @@ class vt extends w {
1783
1786
  });
1784
1787
  s(this, "_commitEdit", (t) => {
1785
1788
  if (!this._editingCell) return;
1786
- const { rowIndex: e, key: n } = this._editingCell, o = this.$(".cell-input"), i = o ? o.dataset.oldValue : "", a = this._getSortedRows()[e];
1787
- i !== t && (this.emit("wox-cell-change", { row: a, key: n, oldValue: i, newValue: t }), a[n] = t), this._editingCell = null, this._render();
1789
+ const { rowIndex: e, key: n } = this._editingCell, o = this.$(".cell-input"), i = o ? o.dataset.oldValue : "", r = this._getSortedRows()[e];
1790
+ i !== t && (this.emit("wox-cell-change", { row: r, key: n, oldValue: i, newValue: t }), r[n] = t), this._editingCell = null, this._render();
1788
1791
  });
1789
1792
  s(this, "_bindEvents", () => {
1790
1793
  this.$$(".header-cell").forEach((t) => {
@@ -1813,8 +1816,8 @@ class vt extends w {
1813
1816
  }), t.querySelectorAll(".cell").forEach((e) => {
1814
1817
  e.addEventListener("dblclick", (n) => {
1815
1818
  n.stopPropagation();
1816
- const o = Number(t.dataset.row), i = e.dataset.key, a = this._columns.findIndex((r) => r.key === i);
1817
- this._columns[a].editable !== !1 && (this._editingCell = { rowIndex: o, key: i }, this._render());
1819
+ const o = Number(t.dataset.row), i = e.dataset.key, r = this._columns.findIndex((a) => a.key === i);
1820
+ this._columns[r].editable !== !1 && (this._editingCell = { rowIndex: o, key: i }, this._render());
1818
1821
  });
1819
1822
  });
1820
1823
  }), this.$$(".resize-handle").forEach((t) => {
@@ -1822,13 +1825,13 @@ class vt extends w {
1822
1825
  e.preventDefault(), e.stopPropagation();
1823
1826
  const n = Number(t.dataset.col), o = e.clientX, i = this._colWidths[n];
1824
1827
  t.classList.add("active");
1825
- const a = (l) => {
1826
- const h = l.clientX - o;
1827
- this._colWidths[n] = Math.max(40, i + h), this._applyWidths();
1828
- }, r = () => {
1829
- t.classList.remove("active"), document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", r);
1828
+ const r = (l) => {
1829
+ const x = l.clientX - o;
1830
+ this._colWidths[n] = Math.max(40, i + x), this._applyWidths();
1831
+ }, a = () => {
1832
+ t.classList.remove("active"), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", a);
1830
1833
  };
1831
- document.addEventListener("mousemove", a), document.addEventListener("mouseup", r);
1834
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", a);
1832
1835
  });
1833
1836
  });
1834
1837
  });
@@ -1844,8 +1847,8 @@ class vt extends w {
1844
1847
  s(this, "_swapColumns", (t, e) => {
1845
1848
  const n = [...this._columns], o = [...this._colWidths], [i] = n.splice(t, 1);
1846
1849
  n.splice(e, 0, i);
1847
- const [a] = o.splice(t, 1);
1848
- o.splice(e, 0, a), this._columns = n, this._colWidths = o, this._render();
1850
+ const [r] = o.splice(t, 1);
1851
+ o.splice(e, 0, r), this._columns = n, this._colWidths = o, this._render();
1849
1852
  });
1850
1853
  }
1851
1854
  connectedCallback() {
@@ -1864,7 +1867,7 @@ class vt extends w {
1864
1867
  return this._rows;
1865
1868
  }
1866
1869
  }
1867
- const Et = 4e3, ht = { TL: { top: "16px", left: "16px" }, TC: { top: "16px", left: "50%", transform: "translateX(-50%)" }, TR: { top: "16px", right: "16px" }, BL: { bottom: "16px", left: "16px" }, BC: { bottom: "16px", left: "50%", transform: "translateX(-50%)" }, BR: { bottom: "16px", right: "16px" } }, Ct = { TL: "translateX(-120%)", TC: "translateY(-120%)", TR: "translateX(120%)", BL: "translateX(-120%)", BC: "translateY(120%)", BR: "translateX(120%)" }, At = { success: { bg: "#1a2e1a", border: "#4CAF50", icon: "#66BB6A", progress: "#4CAF50", text: "#c8e6c9" }, error: { bg: "#2e1a1a", border: "#f44336", icon: "#ef5350", progress: "#f44336", text: "#ffcdd2" }, warning: { bg: "#2e2a1a", border: "#FF9800", icon: "#FFA726", progress: "#FF9800", text: "#ffe0b2" }, info: { bg: "#1a222e", border: "#2196F3", icon: "#42A5F5", progress: "#2196F3", text: "#bbdefb" } }, zt = { success: { bg: "#e8f5e9", border: "#2e7d32", icon: "#388e3c", progress: "#2e7d32", text: "#1b5e20" }, error: { bg: "#fce4ec", border: "#c62828", icon: "#d32f2f", progress: "#c62828", text: "#b71c1c" }, warning: { bg: "#fff8e1", border: "#e65100", icon: "#ef6c00", progress: "#e65100", text: "#bf360c" }, info: { bg: "#e3f2fd", border: "#1565c0", icon: "#1976d2", progress: "#1565c0", text: "#0d47a1" } }, xt = { success: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>', error: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>', warning: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>', info: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>' };
1870
+ const Ct = 4e3, ht = { TL: { top: "16px", left: "16px" }, TC: { top: "16px", left: "50%", transform: "translateX(-50%)" }, TR: { top: "16px", right: "16px" }, BL: { bottom: "16px", left: "16px" }, BC: { bottom: "16px", left: "50%", transform: "translateX(-50%)" }, BR: { bottom: "16px", right: "16px" } }, Et = { TL: "translateX(-120%)", TC: "translateY(-120%)", TR: "translateX(120%)", BL: "translateX(-120%)", BC: "translateY(120%)", BR: "translateX(120%)" }, At = { success: { bg: "#1a2e1a", border: "#4CAF50", icon: "#66BB6A", progress: "#4CAF50", text: "#c8e6c9" }, error: { bg: "#2e1a1a", border: "#f44336", icon: "#ef5350", progress: "#f44336", text: "#ffcdd2" }, warning: { bg: "#2e2a1a", border: "#FF9800", icon: "#FFA726", progress: "#FF9800", text: "#ffe0b2" }, info: { bg: "#1a222e", border: "#2196F3", icon: "#42A5F5", progress: "#2196F3", text: "#bbdefb" } }, zt = { success: { bg: "#e8f5e9", border: "#2e7d32", icon: "#388e3c", progress: "#2e7d32", text: "#1b5e20" }, error: { bg: "#fce4ec", border: "#c62828", icon: "#d32f2f", progress: "#c62828", text: "#b71c1c" }, warning: { bg: "#fff8e1", border: "#e65100", icon: "#ef6c00", progress: "#e65100", text: "#bf360c" }, info: { bg: "#e3f2fd", border: "#1565c0", icon: "#1976d2", progress: "#1565c0", text: "#0d47a1" } }, xt = { success: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>', error: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>', warning: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>', info: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>' };
1868
1871
  let ut = !1;
1869
1872
  const N = /* @__PURE__ */ new Set(), F = {}, D = (p, c, t = {}) => {
1870
1873
  (() => {
@@ -1930,61 +1933,61 @@ const N = /* @__PURE__ */ new Set(), F = {}, D = (p, c, t = {}) => {
1930
1933
  const e = `${p}::${c}`;
1931
1934
  if (N.has(e)) return;
1932
1935
  N.add(e);
1933
- const { duration: n = Et, closable: o = !0, position: i = "BR" } = t, a = document.documentElement.dataset.woxTheme === "light", r = ((m) => {
1934
- const _ = document.documentElement.dataset.woxTheme === "light" ? zt : At;
1935
- return _[m] || _.info;
1936
- })(p), l = ht[i] ? i : "BR", h = ((m) => {
1936
+ const { duration: n = Ct, closable: o = !0, position: i = "BR" } = t, r = document.documentElement.dataset.woxTheme === "light", a = ((m) => {
1937
+ const y = document.documentElement.dataset.woxTheme === "light" ? zt : At;
1938
+ return y[m] || y.info;
1939
+ })(p), l = ht[i] ? i : "BR", x = ((m) => {
1937
1940
  if (F[m]) return F[m];
1938
- const _ = document.createElement("div");
1939
- _.className = `wox-toast-container wox-toast-container-${m}`;
1941
+ const y = document.createElement("div");
1942
+ y.className = `wox-toast-container wox-toast-container-${m}`;
1940
1943
  const _t = ht[m];
1941
- return Object.assign(_.style, _t), m.startsWith("B") && (_.style.flexDirection = "column-reverse"), document.body.appendChild(_), F[m] = _, _;
1944
+ return Object.assign(y.style, _t), m.startsWith("B") && (y.style.flexDirection = "column-reverse"), document.body.appendChild(y), F[m] = y, y;
1942
1945
  })(l), d = document.createElement("div");
1943
- d.className = `wox-toast wox-toast-${p}`, d.style.backgroundColor = r.bg, d.style.borderLeftColor = r.border, d.style.color = r.text;
1946
+ d.className = `wox-toast wox-toast-${p}`, d.style.backgroundColor = a.bg, d.style.borderLeftColor = a.border, d.style.color = a.text;
1944
1947
  let u = `
1945
- <span class="wox-toast-icon" style="color:${r.icon}">${xt[p] || xt.info}</span>
1948
+ <span class="wox-toast-icon" style="color:${a.icon}">${xt[p] || xt.info}</span>
1946
1949
  <span class="wox-toast-message">${c}</span>
1947
1950
  `;
1948
1951
  if (o && (u += '<button class="wox-toast-close" aria-label="Close">&times;</button>'), d.innerHTML = u, o) {
1949
1952
  const m = d.querySelector(".wox-toast-close");
1950
1953
  m && (m.addEventListener("mouseenter", () => {
1951
- m.style.color = r.icon;
1954
+ m.style.color = a.icon;
1952
1955
  }), m.addEventListener("mouseleave", () => {
1953
- m.style.color = a ? "#999" : "#666";
1956
+ m.style.color = r ? "#999" : "#666";
1954
1957
  }));
1955
1958
  }
1956
- let x = null;
1957
- n > 0 && (x = document.createElement("div"), x.className = "wox-toast-progress", x.style.backgroundColor = r.progress, x.style.width = "100%", d.appendChild(x));
1958
- const v = Ct[l];
1959
- d.animate([{ transform: v, opacity: 0 }, { transform: "translateX(0) translateY(0)", opacity: 1 }], { duration: 300, easing: "cubic-bezier(.22,1,.36,1)", fill: "forwards" }), h.appendChild(d);
1960
- let g = null, b = n, y = 0, E = null;
1961
- const A = () => {
1962
- n <= 0 || (y = Date.now(), x && (E = x.animate([{ width: x.style.width }, { width: "0%" }], { duration: b, easing: "linear", fill: "forwards" })), g = setTimeout(() => M(), b));
1963
- }, M = () => {
1964
- N.delete(e), g && (clearTimeout(g), g = null), E && E.cancel(), d.animate([{ transform: "translateX(0) translateY(0)", opacity: 1 }, { transform: v, opacity: 0 }], { duration: 300, easing: "cubic-bezier(.22,1,.36,1)", fill: "forwards" }).onfinish = () => {
1959
+ let h = null;
1960
+ n > 0 && (h = document.createElement("div"), h.className = "wox-toast-progress", h.style.backgroundColor = a.progress, h.style.width = "100%", d.appendChild(h));
1961
+ const v = Et[l];
1962
+ d.animate([{ transform: v, opacity: 0 }, { transform: "translateX(0) translateY(0)", opacity: 1 }], { duration: 300, easing: "cubic-bezier(.22,1,.36,1)", fill: "forwards" }), x.appendChild(d);
1963
+ let b = null, g = n, f = 0, k = null;
1964
+ const E = () => {
1965
+ n <= 0 || (f = Date.now(), h && (k = h.animate([{ width: h.style.width }, { width: "0%" }], { duration: g, easing: "linear", fill: "forwards" })), b = setTimeout(() => z(), g));
1966
+ }, z = () => {
1967
+ N.delete(e), b && (clearTimeout(b), b = null), k && k.cancel(), d.animate([{ transform: "translateX(0) translateY(0)", opacity: 1 }, { transform: v, opacity: 0 }], { duration: 300, easing: "cubic-bezier(.22,1,.36,1)", fill: "forwards" }).onfinish = () => {
1965
1968
  const m = d.offsetHeight;
1966
1969
  d.style.minHeight = "0", d.style.padding = "0", d.style.margin = "0", d.style.overflow = "hidden", d.animate([{ height: `${m}px` }, { height: "0px" }], { duration: 200, easing: "ease" }).onfinish = () => d.remove();
1967
1970
  };
1968
1971
  };
1969
1972
  if (d.addEventListener("mouseenter", () => {
1970
- g && (clearTimeout(g), g = null), E && E.pause();
1971
- const m = Date.now() - y;
1972
- if (b = Math.max(b - m, 0), x && E) {
1973
- const _ = n > 0 ? b / n * 100 : 0;
1974
- x.style.width = `${_}%`;
1973
+ b && (clearTimeout(b), b = null), k && k.pause();
1974
+ const m = Date.now() - f;
1975
+ if (g = Math.max(g - m, 0), h && k) {
1976
+ const y = n > 0 ? g / n * 100 : 0;
1977
+ h.style.width = `${y}%`;
1975
1978
  }
1976
- }), d.addEventListener("mouseleave", A), o) {
1979
+ }), d.addEventListener("mouseleave", E), o) {
1977
1980
  const m = d.querySelector(".wox-toast-close");
1978
- m && m.addEventListener("click", M);
1981
+ m && m.addEventListener("click", z);
1979
1982
  }
1980
- A();
1983
+ E();
1981
1984
  };
1982
- class z extends w {
1985
+ class L extends w {
1983
1986
  }
1984
- s(z, "success", (c, t) => D("success", c, t)), s(z, "error", (c, t) => D("error", c, t)), s(z, "warning", (c, t) => D("warning", c, t)), s(z, "info", (c, t) => D("info", c, t));
1985
- const f = class f extends w {
1987
+ s(L, "success", (c, t) => D("success", c, t)), s(L, "error", (c, t) => D("error", c, t)), s(L, "warning", (c, t) => D("warning", c, t)), s(L, "info", (c, t) => D("info", c, t));
1988
+ const _ = class _ extends w {
1986
1989
  };
1987
- s(f, "_el", null), s(f, "_listenersReady", !1), s(f, "show", (c, t) => {
1990
+ s(_, "_el", null), s(_, "_listenersReady", !1), s(_, "show", (c, t) => {
1988
1991
  if (!c || !t) return;
1989
1992
  c.preventDefault(), c.stopPropagation(), (() => {
1990
1993
  if (document.getElementById("wox-ctx-menu-styles")) return;
@@ -2018,37 +2021,37 @@ s(f, "_el", null), s(f, "_listenersReady", !1), s(f, "show", (c, t) => {
2018
2021
  .wox-ctx-menu-divider { height: 1px; background: var(--wox-border, #333); margin: 4px 8px; }
2019
2022
  `, document.head.appendChild(n);
2020
2023
  })();
2021
- let e = f._el;
2022
- e || (e = document.createElement("div"), e.id = "wox-ctx-menu", e.className = "wox-ctx-menu", document.body.appendChild(e), f._el = e), e.innerHTML = "", t.forEach((n) => {
2024
+ let e = _._el;
2025
+ e || (e = document.createElement("div"), e.id = "wox-ctx-menu", e.className = "wox-ctx-menu", document.body.appendChild(e), _._el = e), e.innerHTML = "", t.forEach((n) => {
2023
2026
  if (n.divider) {
2024
- const r = document.createElement("div");
2025
- return r.className = "wox-ctx-menu-divider", void e.appendChild(r);
2027
+ const a = document.createElement("div");
2028
+ return a.className = "wox-ctx-menu-divider", void e.appendChild(a);
2026
2029
  }
2027
2030
  const o = document.createElement("div");
2028
2031
  o.className = "wox-ctx-menu-item", n.disabled && o.classList.add("wox-ctx-menu-item--disabled");
2029
2032
  const i = document.createElement("i");
2030
2033
  i.className = "material-icons wox-ctx-menu-icon", i.textContent = n.icon || "", o.appendChild(i);
2031
- const a = document.createElement("span");
2032
- if (a.className = "wox-ctx-menu-label", a.textContent = n.label || "", o.appendChild(a), n.shortcut) {
2033
- const r = document.createElement("span");
2034
- r.className = "wox-ctx-menu-shortcut", r.textContent = n.shortcut, o.appendChild(r);
2034
+ const r = document.createElement("span");
2035
+ if (r.className = "wox-ctx-menu-label", r.textContent = n.label || "", o.appendChild(r), n.shortcut) {
2036
+ const a = document.createElement("span");
2037
+ a.className = "wox-ctx-menu-shortcut", a.textContent = n.shortcut, o.appendChild(a);
2035
2038
  }
2036
2039
  n.disabled || o.addEventListener("click", () => {
2037
- f.hide(), n.action && n.action();
2040
+ _.hide(), n.action && n.action();
2038
2041
  }), e.appendChild(o);
2039
2042
  }), e.style.display = "block", e.style.left = `${c.clientX}px`, e.style.top = `${c.clientY}px`, requestAnimationFrame(() => {
2040
2043
  const n = e.getBoundingClientRect(), o = window.innerWidth, i = window.innerHeight;
2041
2044
  n.right > o && (e.style.left = o - n.width - 4 + "px"), n.bottom > i && (e.style.top = i - n.height - 4 + "px");
2042
- }), f._listenersReady || (document.addEventListener("click", f._onClickOutside, !0), document.addEventListener("contextmenu", f._onClickOutside, !0), document.addEventListener("keydown", f._onKeyDown, !0), f._listenersReady = !0);
2043
- }), s(f, "hide", () => {
2044
- f._el && (f._el.style.display = "none");
2045
- }), s(f, "_onClickOutside", (c) => {
2046
- f._el && f._el.style.display !== "none" && (f._el.contains(c.target) || f.hide());
2047
- }), s(f, "_onKeyDown", (c) => {
2048
- c.key === "Escape" && f.hide();
2045
+ }), _._listenersReady || (document.addEventListener("click", _._onClickOutside, !0), document.addEventListener("contextmenu", _._onClickOutside, !0), document.addEventListener("keydown", _._onKeyDown, !0), _._listenersReady = !0);
2046
+ }), s(_, "hide", () => {
2047
+ _._el && (_._el.style.display = "none");
2048
+ }), s(_, "_onClickOutside", (c) => {
2049
+ _._el && _._el.style.display !== "none" && (_._el.contains(c.target) || _.hide());
2050
+ }), s(_, "_onKeyDown", (c) => {
2051
+ c.key === "Escape" && _.hide();
2049
2052
  });
2050
- let O = f;
2051
- const C = (p) => {
2053
+ let O = _;
2054
+ const A = (p) => {
2052
2055
  if (!p || !p.stops || p.stops.length < 2) return "";
2053
2056
  const c = [...p.stops].sort((t, e) => t.position - e.position).map((t) => `${t.color} ${t.position}%`).join(", ");
2054
2057
  return p.type === "linear" ? `linear-gradient(${p.angle}deg, ${c})` : `radial-gradient(circle, ${c})`;
@@ -2057,13 +2060,13 @@ const C = (p) => {
2057
2060
  let c = null, t = 90, e = null;
2058
2061
  const n = p.match(/^linear-gradient\(\s*(\d+)deg\s*,\s*(.+)\)$/i);
2059
2062
  if (n && (c = "linear", t = parseInt(n[1], 10), e = n[2]), !c) {
2060
- const r = p.match(/^radial-gradient\(\s*(?:circle|ellipse)?\s*,?\s*(.+)\)$/i);
2061
- r && (c = "radial", e = r[1]);
2063
+ const a = p.match(/^radial-gradient\(\s*(?:circle|ellipse)?\s*,?\s*(.+)\)$/i);
2064
+ a && (c = "radial", e = a[1]);
2062
2065
  }
2063
2066
  if (!c || !e) return null;
2064
2067
  const o = [], i = /(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\))\s+(\d+(?:\.\d+)?)%/g;
2065
- let a;
2066
- for (; (a = i.exec(e)) !== null; ) o.push({ color: a[1], position: parseFloat(a[2]) });
2068
+ let r;
2069
+ for (; (r = i.exec(e)) !== null; ) o.push({ color: r[1], position: parseFloat(r[2]) });
2067
2070
  return o.length < 2 ? null : { type: c, angle: t, stops: o };
2068
2071
  };
2069
2072
  class mt extends w {
@@ -2074,7 +2077,7 @@ class mt extends w {
2074
2077
  s(this, "_justDragged", !1);
2075
2078
  s(this, "_build", () => {
2076
2079
  if (!this._gradient) return;
2077
- const t = C(this._gradient);
2080
+ const t = A(this._gradient);
2078
2081
  this.render(`
2079
2082
  :host { display: block; }
2080
2083
  .editor { padding: var(--wox-space-md, 8px) 0; }
@@ -2108,10 +2111,10 @@ class mt extends w {
2108
2111
  });
2109
2112
  s(this, "_updatePreview", () => {
2110
2113
  const t = this.$(".bar");
2111
- t && (t.style.background = C(this._gradient));
2114
+ t && (t.style.background = A(this._gradient));
2112
2115
  });
2113
2116
  s(this, "_emitGradient", (t) => {
2114
- this.emit(t, { gradient: this.gradient, css: C(this._gradient) });
2117
+ this.emit(t, { gradient: this.gradient, css: A(this._gradient) });
2115
2118
  });
2116
2119
  s(this, "_renderStops", () => {
2117
2120
  const t = this.$(".stops");
@@ -2119,30 +2122,30 @@ class mt extends w {
2119
2122
  const n = this._gradient.stops.indexOf(e), o = document.createElement("div");
2120
2123
  o.className = "handle", o.style.left = e.position + "%", o.style.backgroundColor = e.color, o.dataset.index = n;
2121
2124
  const i = document.createElement("input");
2122
- i.type = "color", i.value = e.color, i.className = "color-input", o.appendChild(i), o.addEventListener("click", (a) => {
2123
- this._justDragged ? this._justDragged = !1 : (a.stopPropagation(), i.click());
2124
- }), i.addEventListener("input", (a) => {
2125
- const r = parseInt(o.dataset.index, 10);
2126
- this._gradient.stops[r].color = a.target.value, o.style.backgroundColor = a.target.value, this._updatePreview(), this._emitGradient("wox-gradient-input");
2125
+ i.type = "color", i.value = e.color, i.className = "color-input", o.appendChild(i), o.addEventListener("click", (r) => {
2126
+ this._justDragged ? this._justDragged = !1 : (r.stopPropagation(), i.click());
2127
+ }), i.addEventListener("input", (r) => {
2128
+ const a = parseInt(o.dataset.index, 10);
2129
+ this._gradient.stops[a].color = r.target.value, o.style.backgroundColor = r.target.value, this._updatePreview(), this._emitGradient("wox-gradient-input");
2127
2130
  }), i.addEventListener("change", () => {
2128
2131
  this._emitGradient("wox-gradient-change");
2129
- }), i.addEventListener("click", (a) => a.stopPropagation()), o.addEventListener("mousedown", (a) => {
2130
- if (a.target === i) return;
2131
- a.preventDefault(), a.stopPropagation();
2132
- const r = this.$(".bar");
2133
- if (!r) return;
2134
- const l = r.getBoundingClientRect(), h = parseInt(o.dataset.index, 10);
2135
- this._dragging = { idx: h, startY: a.clientY }, o.classList.add("dragging");
2136
- const d = (x) => {
2137
- const v = (x.clientX - l.left) / l.width * 100, g = Math.max(0, Math.min(100, Math.round(10 * v) / 10));
2138
- this._gradient.stops[h].position = g, o.style.left = g + "%", Math.abs(x.clientY - this._dragging.startY) > 40 && this._gradient.stops.length > 2 ? o.classList.add("removing") : o.classList.remove("removing"), this._updatePreview(), this._emitGradient("wox-gradient-input");
2139
- }, u = (x) => {
2140
- var b;
2132
+ }), i.addEventListener("click", (r) => r.stopPropagation()), o.addEventListener("mousedown", (r) => {
2133
+ if (r.target === i) return;
2134
+ r.preventDefault(), r.stopPropagation();
2135
+ const a = this.$(".bar");
2136
+ if (!a) return;
2137
+ const l = a.getBoundingClientRect(), x = parseInt(o.dataset.index, 10);
2138
+ this._dragging = { idx: x, startY: r.clientY }, o.classList.add("dragging");
2139
+ const d = (h) => {
2140
+ const v = (h.clientX - l.left) / l.width * 100, b = Math.max(0, Math.min(100, Math.round(10 * v) / 10));
2141
+ this._gradient.stops[x].position = b, o.style.left = b + "%", Math.abs(h.clientY - this._dragging.startY) > 40 && this._gradient.stops.length > 2 ? o.classList.add("removing") : o.classList.remove("removing"), this._updatePreview(), this._emitGradient("wox-gradient-input");
2142
+ }, u = (h) => {
2143
+ var g;
2141
2144
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u), o.classList.remove("dragging");
2142
- const v = Math.abs(x.clientY - this._dragging.startY);
2143
- v > 40 && this._gradient.stops.length > 2 ? (this._gradient.stops.splice(h, 1), this._renderStops(), this._updatePreview(), this._emitGradient("wox-gradient-change")) : this._emitGradient("wox-gradient-change");
2144
- const g = Math.abs(x.clientX - (l.left + (((b = this._gradient.stops[h]) == null ? void 0 : b.position) || 0) * l.width / 100));
2145
- (v > 3 || g > 3) && (this._justDragged = !0), this._dragging = null;
2145
+ const v = Math.abs(h.clientY - this._dragging.startY);
2146
+ v > 40 && this._gradient.stops.length > 2 ? (this._gradient.stops.splice(x, 1), this._renderStops(), this._updatePreview(), this._emitGradient("wox-gradient-change")) : this._emitGradient("wox-gradient-change");
2147
+ const b = Math.abs(h.clientX - (l.left + (((g = this._gradient.stops[x]) == null ? void 0 : g.position) || 0) * l.width / 100));
2148
+ (v > 3 || b > 3) && (this._justDragged = !0), this._dragging = null;
2146
2149
  };
2147
2150
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
2148
2151
  }), t.appendChild(o);
@@ -2151,13 +2154,13 @@ class mt extends w {
2151
2154
  s(this, "_bindBarEvents", () => {
2152
2155
  const t = this.$(".bar");
2153
2156
  t && t.addEventListener("dblclick", (e) => {
2154
- const n = t.getBoundingClientRect(), o = Math.round((e.clientX - n.left) / n.width * 100), i = Math.max(0, Math.min(100, o)), a = [...this._gradient.stops].sort((l, h) => l.position - h.position);
2155
- let r = "#888888";
2156
- for (let l = 0; l < a.length - 1; l++) if (i >= a[l].position && i <= a[l + 1].position) {
2157
- r = a[l].color;
2157
+ const n = t.getBoundingClientRect(), o = Math.round((e.clientX - n.left) / n.width * 100), i = Math.max(0, Math.min(100, o)), r = [...this._gradient.stops].sort((l, x) => l.position - x.position);
2158
+ let a = "#888888";
2159
+ for (let l = 0; l < r.length - 1; l++) if (i >= r[l].position && i <= r[l + 1].position) {
2160
+ a = r[l].color;
2158
2161
  break;
2159
2162
  }
2160
- this._gradient.stops.push({ color: r, position: i }), this._renderStops(), this._updatePreview(), this._emitGradient("wox-gradient-change");
2163
+ this._gradient.stops.push({ color: a, position: i }), this._renderStops(), this._updatePreview(), this._emitGradient("wox-gradient-change");
2161
2164
  });
2162
2165
  });
2163
2166
  }
@@ -2216,7 +2219,7 @@ class ct extends w {
2216
2219
  s(this, "_labelForValue", (t) => {
2217
2220
  if (!t) return "None";
2218
2221
  if (bt(t)) {
2219
- for (const e of this._gradients) if (C(e) === t) return e.name;
2222
+ for (const e of this._gradients) if (A(e) === t) return e.name;
2220
2223
  return "Custom Gradient";
2221
2224
  }
2222
2225
  return t;
@@ -2374,10 +2377,10 @@ class ct extends w {
2374
2377
  o && o.setAttribute("value", this._gradient.angle);
2375
2378
  const i = this.$(".speed-row wox-slider");
2376
2379
  i && i.setAttribute("value", this._animationSpeed);
2377
- const a = this.$(".anim-type-row");
2378
- a && (a.style.display = this._animationSpeed > 0 ? "" : "none");
2379
- const r = this.$(".anim-select");
2380
- r && (r.value = this._animationType);
2380
+ const r = this.$(".anim-type-row");
2381
+ r && (r.style.display = this._animationSpeed > 0 ? "" : "none");
2382
+ const a = this.$(".anim-select");
2383
+ a && (a.value = this._animationType);
2381
2384
  });
2382
2385
  s(this, "_bindEvents", () => {
2383
2386
  this.$(".current").addEventListener("click", (d) => {
@@ -2385,7 +2388,7 @@ class ct extends w {
2385
2388
  }), this.$$(".type-btn").forEach((d) => {
2386
2389
  d.addEventListener("click", () => {
2387
2390
  if (!this._gradient) return;
2388
- this.$$(".type-btn").forEach((x) => x.classList.remove("active")), d.classList.add("active"), this._gradient.type = d.dataset.type;
2391
+ this.$$(".type-btn").forEach((h) => h.classList.remove("active")), d.classList.add("active"), this._gradient.type = d.dataset.type;
2389
2392
  const u = this.$(".angle-row");
2390
2393
  u && (u.style.display = d.dataset.type === "linear" ? "" : "none"), this._applyGradient();
2391
2394
  });
@@ -2418,12 +2421,12 @@ class ct extends w {
2418
2421
  i && i.addEventListener("click", () => {
2419
2422
  this._applyFromEditor(!1);
2420
2423
  });
2421
- const a = this.$(".save-btn");
2422
- a && a.addEventListener("click", () => {
2424
+ const r = this.$(".save-btn");
2425
+ r && r.addEventListener("click", () => {
2423
2426
  this._applyFromEditor(!0);
2424
2427
  });
2425
- const r = this.$(".name-input");
2426
- r && r.addEventListener("input", (d) => {
2428
+ const a = this.$(".name-input");
2429
+ a && a.addEventListener("input", (d) => {
2427
2430
  this._editingName = d.target.value.trim();
2428
2431
  });
2429
2432
  const l = this.$(".modal-editor");
@@ -2432,8 +2435,8 @@ class ct extends w {
2432
2435
  }), l.addEventListener("wox-gradient-change", (d) => {
2433
2436
  this._editingGradient = d.detail.gradient;
2434
2437
  }));
2435
- const h = this.$(".editor-modal");
2436
- h && h.addEventListener("wox-close", () => {
2438
+ const x = this.$(".editor-modal");
2439
+ x && x.addEventListener("wox-close", () => {
2437
2440
  this._editingGradient = null, this._editingName = "";
2438
2441
  });
2439
2442
  });
@@ -2445,8 +2448,8 @@ class ct extends w {
2445
2448
  if (!t || !e) return;
2446
2449
  const n = t.getBoundingClientRect(), o = window.innerHeight;
2447
2450
  e.style.left = `${n.left}px`, e.style.width = `${n.width}px`;
2448
- const i = o - n.bottom, a = n.top;
2449
- i >= 280 || i >= a ? (e.style.top = `${n.bottom}px`, e.style.bottom = "", e.style.maxHeight = `${Math.min(280, i - 4)}px`) : (e.style.top = "", e.style.bottom = o - n.top + "px", e.style.maxHeight = `${Math.min(280, a - 4)}px`);
2451
+ const i = o - n.bottom, r = n.top;
2452
+ i >= 280 || i >= r ? (e.style.top = `${n.bottom}px`, e.style.bottom = "", e.style.maxHeight = `${Math.min(280, i - 4)}px`) : (e.style.top = "", e.style.bottom = o - n.top + "px", e.style.maxHeight = `${Math.min(280, r - 4)}px`);
2450
2453
  });
2451
2454
  s(this, "_closeDropdown", () => {
2452
2455
  this._open = !1, this.$(".selector").classList.remove("open");
@@ -2463,14 +2466,14 @@ class ct extends w {
2463
2466
  <input type="color" class="solid-input" value="${n}">
2464
2467
  </div>
2465
2468
  `, this._gradients.forEach((o) => {
2466
- const i = C(o), a = o.id.startsWith("grad_preset_"), r = a ? `<button class="dropdown-item-btn" data-dup-id="${o.id}" title="Duplicate gradient">&#x2398;</button>` : "", l = a ? "" : `<button class="dropdown-item-btn" data-edit-id="${o.id}" title="Edit gradient">&#9998;</button>`, h = a ? "" : `<button class="dropdown-item-btn delete-btn" data-delete-id="${o.id}" title="Delete gradient">&times;</button>`;
2469
+ const i = A(o), r = o.id.startsWith("grad_preset_"), a = r ? `<button class="dropdown-item-btn" data-dup-id="${o.id}" title="Duplicate gradient">&#x2398;</button>` : "", l = r ? "" : `<button class="dropdown-item-btn" data-edit-id="${o.id}" title="Edit gradient">&#9998;</button>`, x = r ? "" : `<button class="dropdown-item-btn delete-btn" data-delete-id="${o.id}" title="Delete gradient">&times;</button>`;
2467
2470
  e += `
2468
2471
  <div class="dropdown-item" data-gradient-id="${o.id}">
2469
2472
  <div class="dropdown-item-preview" style="background: ${i}"></div>
2470
2473
  <span class="dropdown-item-label">${o.name}</span>
2471
- ${r}
2474
+ ${a}
2472
2475
  ${l}
2473
- ${h}
2476
+ ${x}
2474
2477
  </div>
2475
2478
  `;
2476
2479
  }), e += `
@@ -2490,28 +2493,28 @@ class ct extends w {
2490
2493
  }), n.addEventListener("change", () => {
2491
2494
  n.style.pointerEvents = "none";
2492
2495
  }), n.addEventListener("click", (i) => i.stopPropagation())), t.querySelectorAll("[data-gradient-id]").forEach((i) => {
2493
- i.addEventListener("click", (a) => {
2494
- if (a.target.hasAttribute("data-delete-id") || a.target.hasAttribute("data-edit-id") || a.target.hasAttribute("data-dup-id")) return;
2495
- const r = this._getById(i.dataset.gradientId);
2496
- r && (this._gradient = JSON.parse(JSON.stringify(r)), this._value = C(this._gradient), this._updatePreview(), this._syncControls(), this._emitChange(), this._closeDropdown());
2496
+ i.addEventListener("click", (r) => {
2497
+ if (r.target.hasAttribute("data-delete-id") || r.target.hasAttribute("data-edit-id") || r.target.hasAttribute("data-dup-id")) return;
2498
+ const a = this._getById(i.dataset.gradientId);
2499
+ a && (this._gradient = JSON.parse(JSON.stringify(a)), this._value = A(this._gradient), this._updatePreview(), this._syncControls(), this._emitChange(), this._closeDropdown());
2497
2500
  });
2498
2501
  }), t.querySelectorAll("[data-dup-id]").forEach((i) => {
2499
- i.addEventListener("click", (a) => {
2500
- a.stopPropagation();
2501
- const r = this._getById(i.dataset.dupId);
2502
- if (!r) return;
2503
- const l = { id: R(), name: r.name + " Copy", type: r.type, angle: r.angle, stops: r.stops.map((h) => ({ ...h })) };
2502
+ i.addEventListener("click", (r) => {
2503
+ r.stopPropagation();
2504
+ const a = this._getById(i.dataset.dupId);
2505
+ if (!a) return;
2506
+ const l = { id: R(), name: a.name + " Copy", type: a.type, angle: a.angle, stops: a.stops.map((x) => ({ ...x })) };
2504
2507
  this._closeDropdown(), this._openEditorDialog(l);
2505
2508
  });
2506
2509
  }), t.querySelectorAll("[data-edit-id]").forEach((i) => {
2507
- i.addEventListener("click", (a) => {
2508
- a.stopPropagation();
2509
- const r = this._getById(i.dataset.editId);
2510
- r && (this._closeDropdown(), this._openEditorDialog(JSON.parse(JSON.stringify(r))));
2510
+ i.addEventListener("click", (r) => {
2511
+ r.stopPropagation();
2512
+ const a = this._getById(i.dataset.editId);
2513
+ a && (this._closeDropdown(), this._openEditorDialog(JSON.parse(JSON.stringify(a))));
2511
2514
  });
2512
2515
  }), t.querySelectorAll("[data-delete-id]").forEach((i) => {
2513
- i.addEventListener("click", (a) => {
2514
- a.stopPropagation(), this._delete(i.dataset.deleteId), this._populateDropdown();
2516
+ i.addEventListener("click", (r) => {
2517
+ r.stopPropagation(), this._delete(i.dataset.deleteId), this._populateDropdown();
2515
2518
  });
2516
2519
  });
2517
2520
  const o = t.querySelector('[data-action="custom"]');
@@ -2532,14 +2535,14 @@ class ct extends w {
2532
2535
  s(this, "_applyFromEditor", (t) => {
2533
2536
  if (!this._editingGradient) return;
2534
2537
  const e = JSON.parse(JSON.stringify(this._editingGradient));
2535
- this._editingName && (e.name = this._editingName), e.id = this._editingOriginalId || e.id || R(), t && this._save(e), this._gradient = JSON.parse(JSON.stringify(e)), this._value = C(this._gradient), this._updatePreview(), this._syncControls(), this._emitChange(), this._closeModal();
2538
+ this._editingName && (e.name = this._editingName), e.id = this._editingOriginalId || e.id || R(), t && this._save(e), this._gradient = JSON.parse(JSON.stringify(e)), this._value = A(this._gradient), this._updatePreview(), this._syncControls(), this._emitChange(), this._closeModal();
2536
2539
  });
2537
2540
  s(this, "_closeModal", () => {
2538
2541
  const t = this.$(".editor-modal");
2539
2542
  t && t.removeAttribute("open"), this._editingGradient = null, this._editingName = "", this._editingOriginalId = null;
2540
2543
  });
2541
2544
  s(this, "_applyGradient", () => {
2542
- this._gradient && (this._value = C(this._gradient), this._updatePreview(), this._emitChange());
2545
+ this._gradient && (this._value = A(this._gradient), this._updatePreview(), this._emitChange());
2543
2546
  });
2544
2547
  s(this, "_emitChange", () => {
2545
2548
  this.emit("wox-gradient-change", { value: this._value, animationSpeed: this._animationSpeed, animationType: this._animationType });
@@ -2606,22 +2609,22 @@ class pt extends w {
2606
2609
  return e;
2607
2610
  });
2608
2611
  s(this, "_generateGrid", (t, e) => {
2609
- const n = /* @__PURE__ */ new Date(), o = wt(n), i = new Date(t, e, 1).getDay(), a = new Date(t, e + 1, 0).getDate();
2610
- let r = "";
2611
- const l = e === 0 ? t - 1 : t, h = e === 0 ? 11 : e - 1, d = new Date(l, h + 1, 0).getDate();
2612
- for (let g = i - 1; g >= 0; g--) {
2613
- const b = d - g;
2614
- r += `<div class="day-cell other-month" data-date="${B(l, h, b)}">${b}</div>`;
2612
+ const n = /* @__PURE__ */ new Date(), o = wt(n), i = new Date(t, e, 1).getDay(), r = new Date(t, e + 1, 0).getDate();
2613
+ let a = "";
2614
+ const l = e === 0 ? t - 1 : t, x = e === 0 ? 11 : e - 1, d = new Date(l, x + 1, 0).getDate();
2615
+ for (let b = i - 1; b >= 0; b--) {
2616
+ const g = d - b;
2617
+ a += `<div class="day-cell other-month" data-date="${B(l, x, g)}">${g}</div>`;
2615
2618
  }
2616
- for (let g = 1; g <= a; g++) {
2617
- const b = B(t, e, g);
2618
- let y = "day-cell";
2619
- b === o && (y += " today"), this.rangeMode ? this._selectedRange.start && b === this._selectedRange.start ? y += " range-start" : this._selectedRange.end && b === this._selectedRange.end ? y += " range-end" : Dt(b, this._selectedRange.start, this._selectedRange.end) && (y += " in-range") : this._selectedDate && b === this._selectedDate && (y += " selected"), r += `<div class="${y}" data-date="${b}">${g}</div>`;
2619
+ for (let b = 1; b <= r; b++) {
2620
+ const g = B(t, e, b);
2621
+ let f = "day-cell";
2622
+ g === o && (f += " today"), this.rangeMode ? this._selectedRange.start && g === this._selectedRange.start ? f += " range-start" : this._selectedRange.end && g === this._selectedRange.end ? f += " range-end" : Dt(g, this._selectedRange.start, this._selectedRange.end) && (f += " in-range") : this._selectedDate && g === this._selectedDate && (f += " selected"), a += `<div class="${f}" data-date="${g}">${b}</div>`;
2620
2623
  }
2621
- const u = 7 * Math.ceil((i + a) / 7), x = e === 11 ? t + 1 : t, v = e === 11 ? 0 : e + 1;
2622
- for (let g = 1; g <= u - i - a; g++)
2623
- r += `<div class="day-cell other-month" data-date="${B(x, v, g)}">${g}</div>`;
2624
- return r;
2624
+ const u = 7 * Math.ceil((i + r) / 7), h = e === 11 ? t + 1 : t, v = e === 11 ? 0 : e + 1;
2625
+ for (let b = 1; b <= u - i - r; b++)
2626
+ a += `<div class="day-cell other-month" data-date="${B(h, v, b)}">${b}</div>`;
2627
+ return a;
2625
2628
  });
2626
2629
  s(this, "_getModeHint", () => this.rangeMode ? this._selectedRange.start ? this._selectedRange.end ? `${this._selectedRange.start} → ${this._selectedRange.end}` : "Select end date" : "Select start date" : "Select a date");
2627
2630
  s(this, "_render", () => {
@@ -2920,9 +2923,9 @@ s(pt, "observedAttributes", ["range-mode", "value", "range-start", "range-end",
2920
2923
  const wt = (p) => `${p.getFullYear()}-${String(p.getMonth() + 1).padStart(2, "0")}-${String(p.getDate()).padStart(2, "0")}`, I = (p) => {
2921
2924
  const [c, t, e] = p.split("-").map(Number);
2922
2925
  return new Date(c, t - 1, e);
2923
- }, B = (p, c, t) => `${p}-${String(c + 1).padStart(2, "0")}-${String(t).padStart(2, "0")}`, Dt = (p, c, t) => !(!c || !t) && p > c && p < t, W = "woxTheme", $ = class $ {
2926
+ }, B = (p, c, t) => `${p}-${String(c + 1).padStart(2, "0")}-${String(t).padStart(2, "0")}`, Dt = (p, c, t) => !(!c || !t) && p > c && p < t, W = "woxTheme", C = class C {
2924
2927
  };
2925
- s($, "get", () => document.documentElement.dataset[W] === "light" ? "light" : "dark"), s($, "set", (c) => {
2928
+ s(C, "get", () => document.documentElement.dataset[W] === "light" ? "light" : "dark"), s(C, "set", (c) => {
2926
2929
  if (c === "dark" || c === "light") {
2927
2930
  c === "light" ? document.documentElement.dataset[W] = "light" : delete document.documentElement.dataset[W];
2928
2931
  try {
@@ -2931,25 +2934,25 @@ s($, "get", () => document.documentElement.dataset[W] === "light" ? "light" : "d
2931
2934
  }
2932
2935
  document.documentElement.dispatchEvent(new CustomEvent("wox-theme-change", { detail: { theme: c }, bubbles: !0, composed: !0 }));
2933
2936
  }
2934
- }), s($, "toggle", () => {
2935
- $.set($.get() === "dark" ? "light" : "dark");
2936
- }), s($, "auto", () => {
2937
+ }), s(C, "toggle", () => {
2938
+ C.set(C.get() === "dark" ? "light" : "dark");
2939
+ }), s(C, "auto", () => {
2937
2940
  try {
2938
2941
  const t = localStorage.getItem("wox-theme");
2939
- if (t === "dark" || t === "light") return void $.set(t);
2942
+ if (t === "dark" || t === "light") return void C.set(t);
2940
2943
  } catch {
2941
2944
  }
2942
2945
  const c = window.matchMedia("(prefers-color-scheme: light)").matches;
2943
- $.set(c ? "light" : "dark");
2946
+ C.set(c ? "light" : "dark");
2944
2947
  });
2945
- let L = $;
2948
+ let S = C;
2946
2949
  class ft extends w {
2947
2950
  constructor() {
2948
2951
  super(...arguments);
2949
2952
  s(this, "_onThemeChange", null);
2950
2953
  }
2951
2954
  connectedCallback() {
2952
- this._render(), this.hasAttribute("auto") && L.auto(), this._onThemeChange = () => this._updateIcon(), document.documentElement.addEventListener("wox-theme-change", this._onThemeChange), this._updateIcon();
2955
+ this._render(), this.hasAttribute("auto") && S.auto(), this._onThemeChange = () => this._updateIcon(), document.documentElement.addEventListener("wox-theme-change", this._onThemeChange), this._updateIcon();
2953
2956
  }
2954
2957
  disconnectedCallback() {
2955
2958
  this._onThemeChange && (document.documentElement.removeEventListener("wox-theme-change", this._onThemeChange), this._onThemeChange = null);
@@ -2989,16 +2992,16 @@ class ft extends w {
2989
2992
  -webkit-font-smoothing: antialiased;
2990
2993
  text-rendering: optimizeLegibility;
2991
2994
  }
2992
- `, '<button type="button" title="Toggle theme"><span class="icon">light_mode</span></button>'), this.$("button").addEventListener("click", () => L.toggle());
2995
+ `, '<button type="button" title="Toggle theme"><span class="icon">light_mode</span></button>'), this.$("button").addEventListener("click", () => S.toggle());
2993
2996
  }
2994
2997
  _updateIcon() {
2995
2998
  const t = this.$(".icon");
2996
2999
  if (!t) return;
2997
- const e = L.get() === "dark";
3000
+ const e = S.get() === "dark";
2998
3001
  t.textContent = e ? "light_mode" : "dark_mode", this.$("button").title = e ? "Switch to light mode" : "Switch to dark mode";
2999
3002
  }
3000
3003
  }
3001
- customElements.define("wox-icon", H), customElements.define("wox-separator", G), customElements.define("wox-badge", j), customElements.define("wox-button", Y), customElements.define("wox-input", X), customElements.define("wox-select", q), customElements.define("wox-slider", J), customElements.define("wox-color-swatch", K), customElements.define("wox-tooltip", V), customElements.define("wox-color-picker", U), customElements.define("wox-menu-item", Q), customElements.define("wox-menu", Z), customElements.define("wox-layer-item", tt), customElements.define("wox-section", et), customElements.define("wox-tab", nt), customElements.define("wox-tabs", ot), customElements.define("wox-toolbar-group", it), customElements.define("wox-toolbar", st), customElements.define("wox-panel", at), customElements.define("wox-menubar", rt), customElements.define("wox-statusbar", dt), customElements.define("wox-modal", lt), customElements.define("wox-datagrid", vt), customElements.define("wox-toast", z), customElements.define("wox-context-menu", O), customElements.define("wox-gradient-editor", mt), customElements.define("wox-gradient-selector", ct), customElements.define("wox-date-picker", pt), customElements.define("wox-theme-toggle", ft);
3004
+ customElements.define("wox-icon", H), customElements.define("wox-separator", j), customElements.define("wox-badge", G), customElements.define("wox-button", Y), customElements.define("wox-input", X), customElements.define("wox-select", q), customElements.define("wox-slider", J), customElements.define("wox-color-swatch", K), customElements.define("wox-tooltip", V), customElements.define("wox-color-picker", U), customElements.define("wox-menu-item", Q), customElements.define("wox-menu", Z), customElements.define("wox-layer-item", tt), customElements.define("wox-section", et), customElements.define("wox-tab", nt), customElements.define("wox-tabs", ot), customElements.define("wox-toolbar-group", it), customElements.define("wox-toolbar", st), customElements.define("wox-panel", rt), customElements.define("wox-menubar", at), customElements.define("wox-statusbar", dt), customElements.define("wox-modal", lt), customElements.define("wox-datagrid", vt), customElements.define("wox-toast", L), customElements.define("wox-context-menu", O), customElements.define("wox-gradient-editor", mt), customElements.define("wox-gradient-selector", ct), customElements.define("wox-date-picker", pt), customElements.define("wox-theme-toggle", ft);
3002
3005
  const Rt = `/* wox-theme.css — Global CSS custom properties for the WOX component library */
3003
3006
  :root {
3004
3007
  --wox-bg-app: #121214;
@@ -3086,10 +3089,10 @@ const Rt = `/* wox-theme.css — Global CSS custom properties for the WOX compon
3086
3089
  if (document.getElementById("wox-theme")) return;
3087
3090
  const p = document.createElement("style");
3088
3091
  p.id = "wox-theme", p.textContent = Rt, document.head.appendChild(p);
3089
- })(), window.WoxIcon = H, window.WoxSeparator = G, window.WoxBadge = j, window.WoxButton = Y, window.WoxInput = X, window.WoxSelect = q, window.WoxSlider = J, window.WoxColorSwatch = K, window.WoxTooltip = V, window.WoxColorPicker = U, window.WoxMenuItem = Q, window.WoxMenu = Z, window.WoxLayerItem = tt, window.WoxSection = et, window.WoxTab = nt, window.WoxTabs = ot, window.WoxToolbarGroup = it, window.WoxToolbar = st, window.WoxPanel = at, window.WoxMenubar = rt, window.WoxStatusbar = dt, window.WoxModal = lt, window.WoxDatagrid = vt, window.WoxToast = z, window.WoxContextMenu = O, window.WoxGradientEditor = mt, window.WoxGradientSelector = ct, window.WoxDatePicker = pt, window.WoxThemeToggle = ft;
3092
+ })(), window.WoxIcon = H, window.WoxSeparator = j, window.WoxBadge = G, window.WoxButton = Y, window.WoxInput = X, window.WoxSelect = q, window.WoxSlider = J, window.WoxColorSwatch = K, window.WoxTooltip = V, window.WoxColorPicker = U, window.WoxMenuItem = Q, window.WoxMenu = Z, window.WoxLayerItem = tt, window.WoxSection = et, window.WoxTab = nt, window.WoxTabs = ot, window.WoxToolbarGroup = it, window.WoxToolbar = st, window.WoxPanel = rt, window.WoxMenubar = at, window.WoxStatusbar = dt, window.WoxModal = lt, window.WoxDatagrid = vt, window.WoxToast = L, window.WoxContextMenu = O, window.WoxGradientEditor = mt, window.WoxGradientSelector = ct, window.WoxDatePicker = pt, window.WoxThemeToggle = ft;
3090
3093
  export {
3091
- S as FX_STYLES,
3092
- j as WoxBadge,
3094
+ M as FX_STYLES,
3095
+ G as WoxBadge,
3093
3096
  Y as WoxButton,
3094
3097
  U as WoxColorPicker,
3095
3098
  K as WoxColorSwatch,
@@ -3104,22 +3107,22 @@ export {
3104
3107
  tt as WoxLayerItem,
3105
3108
  Z as WoxMenu,
3106
3109
  Q as WoxMenuItem,
3107
- rt as WoxMenubar,
3110
+ at as WoxMenubar,
3108
3111
  lt as WoxModal,
3109
- at as WoxPanel,
3112
+ rt as WoxPanel,
3110
3113
  et as WoxSection,
3111
3114
  q as WoxSelect,
3112
- G as WoxSeparator,
3115
+ j as WoxSeparator,
3113
3116
  J as WoxSlider,
3114
3117
  dt as WoxStatusbar,
3115
3118
  nt as WoxTab,
3116
3119
  ot as WoxTabs,
3117
- L as WoxTheme,
3120
+ S as WoxTheme,
3118
3121
  ft as WoxThemeToggle,
3119
- z as WoxToast,
3122
+ L as WoxToast,
3120
3123
  st as WoxToolbar,
3121
3124
  it as WoxToolbarGroup,
3122
3125
  V as WoxTooltip,
3123
3126
  gt as cssToGradient,
3124
- C as gradientToCSS
3127
+ A as gradientToCSS
3125
3128
  };