@jasonshimmy/custom-elements-runtime 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- class ut {
1
+ class dt {
2
2
  pendingUpdates = /* @__PURE__ */ new Map();
3
3
  isFlushScheduled = !1;
4
4
  /**
5
5
  * Schedule an update to be executed in the next microtask
6
6
  * Uses component identity to deduplicate multiple render requests for the same component
7
7
  */
8
- schedule(t, r) {
9
- const n = r || t.toString();
10
- this.pendingUpdates.set(n, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
8
+ schedule(t, n) {
9
+ const r = n || t.toString();
10
+ this.pendingUpdates.set(r, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
11
11
  }
12
12
  /**
13
13
  * Execute all pending updates
@@ -15,11 +15,11 @@ class ut {
15
15
  flush() {
16
16
  const t = Array.from(this.pendingUpdates.values());
17
17
  this.pendingUpdates.clear(), this.isFlushScheduled = !1;
18
- for (const r of t)
18
+ for (const n of t)
19
19
  try {
20
- r();
21
- } catch (n) {
22
- typeof console < "u" && console.error && console.error("Error in batched update:", n);
20
+ n();
21
+ } catch (r) {
22
+ typeof console < "u" && console.error && console.error("Error in batched update:", r);
23
23
  }
24
24
  }
25
25
  /**
@@ -29,25 +29,25 @@ class ut {
29
29
  return this.pendingUpdates.size;
30
30
  }
31
31
  }
32
- const ft = new ut();
33
- function le(e, t) {
34
- ft.schedule(e, t);
32
+ const pt = new dt();
33
+ function fe(e, t) {
34
+ pt.schedule(e, t);
35
35
  }
36
- const Ue = /* @__PURE__ */ new WeakSet();
37
- class dt {
36
+ const Fe = /* @__PURE__ */ new WeakSet();
37
+ class ht {
38
38
  static cache = /* @__PURE__ */ new WeakMap();
39
39
  static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
40
40
  static objectHandlerCache = /* @__PURE__ */ new WeakMap();
41
41
  /**
42
42
  * Get or create a reactive proxy for an object
43
43
  */
44
- static getOrCreateProxy(t, r, n = !1) {
44
+ static getOrCreateProxy(t, n, r = !1) {
45
45
  const i = this.cache.get(t);
46
46
  if (i)
47
47
  return i;
48
- const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
48
+ const s = r ? this.getOrCreateArrayHandler(n) : this.getOrCreateObjectHandler(n), o = new Proxy(t, s);
49
49
  try {
50
- tt.markAsProxy(o);
50
+ rt.markAsProxy(o);
51
51
  } catch {
52
52
  }
53
53
  return this.cache.set(t, o), o;
@@ -57,9 +57,9 @@ class dt {
57
57
  */
58
58
  static getOrCreateArrayHandler(t) {
59
59
  if (!this.arrayHandlerCache.has(t)) {
60
- const r = {
61
- get: (n, i, s) => {
62
- const o = Reflect.get(n, i, s);
60
+ const n = {
61
+ get: (r, i, s) => {
62
+ const o = Reflect.get(r, i, s);
63
63
  return typeof o == "function" && typeof i == "string" && [
64
64
  "push",
65
65
  "pop",
@@ -71,14 +71,14 @@ class dt {
71
71
  "fill",
72
72
  "copyWithin"
73
73
  ].includes(i) ? function(...u) {
74
- const m = o.apply(n, u);
75
- return t.triggerUpdate(), m;
74
+ const y = o.apply(r, u);
75
+ return t.triggerUpdate(), y;
76
76
  } : o;
77
77
  },
78
- set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
79
- deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
78
+ set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
79
+ deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
80
80
  };
81
- this.arrayHandlerCache.set(t, r);
81
+ this.arrayHandlerCache.set(t, n);
82
82
  }
83
83
  return this.arrayHandlerCache.get(t);
84
84
  }
@@ -87,12 +87,12 @@ class dt {
87
87
  */
88
88
  static getOrCreateObjectHandler(t) {
89
89
  if (!this.objectHandlerCache.has(t)) {
90
- const r = {
91
- get: (n, i, s) => Reflect.get(n, i, s),
92
- set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
93
- deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
90
+ const n = {
91
+ get: (r, i, s) => Reflect.get(r, i, s),
92
+ set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
93
+ deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
94
94
  };
95
- this.objectHandlerCache.set(t, r);
95
+ this.objectHandlerCache.set(t, n);
96
96
  }
97
97
  return this.objectHandlerCache.get(t);
98
98
  }
@@ -118,7 +118,7 @@ class dt {
118
118
  };
119
119
  }
120
120
  }
121
- class tt {
121
+ class rt {
122
122
  // Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
123
123
  // This allows handler caches in ReactiveProxyCache to reuse handlers
124
124
  // for identical reactive contexts instead of creating a new context object
@@ -127,19 +127,19 @@ class tt {
127
127
  /**
128
128
  * Create an optimized reactive proxy with minimal overhead
129
129
  */
130
- static createReactiveProxy(t, r, n) {
130
+ static createReactiveProxy(t, n, r) {
131
131
  try {
132
- if (Ue.has(t)) return t;
132
+ if (Fe.has(t)) return t;
133
133
  } catch {
134
134
  }
135
135
  const i = Array.isArray(t);
136
- let s = this.contextCache.get(r);
137
- s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(r, s));
138
- let o = s.get(n);
136
+ let s = this.contextCache.get(n);
137
+ s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(n, s));
138
+ let o = s.get(r);
139
139
  return o || (o = {
140
- triggerUpdate: r,
141
- makeReactiveValue: n
142
- }, s.set(n, o)), dt.getOrCreateProxy(t, o, i);
140
+ triggerUpdate: n,
141
+ makeReactiveValue: r
142
+ }, s.set(r, o)), ht.getOrCreateProxy(t, o, i);
143
143
  }
144
144
  /**
145
145
  * Mark an object as a proxy (for optimization)
@@ -147,12 +147,12 @@ class tt {
147
147
  static markAsProxy(t) {
148
148
  if (t)
149
149
  try {
150
- Ue.add(t);
150
+ Fe.add(t);
151
151
  } catch {
152
152
  }
153
153
  }
154
154
  }
155
- class pt {
155
+ class gt {
156
156
  currentComponent = null;
157
157
  componentDependencies = /* @__PURE__ */ new Map();
158
158
  componentRenderFunctions = /* @__PURE__ */ new Map();
@@ -165,8 +165,8 @@ class pt {
165
165
  /**
166
166
  * Set the current component being rendered for dependency tracking
167
167
  */
168
- setCurrentComponent(t, r) {
169
- this.currentComponent = t, this.componentRenderFunctions.set(t, r), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
168
+ setCurrentComponent(t, n) {
169
+ this.currentComponent = t, this.componentRenderFunctions.set(t, n), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
170
170
  }
171
171
  /**
172
172
  * Clear the current component after rendering
@@ -198,19 +198,19 @@ class pt {
198
198
  */
199
199
  shouldEmitRenderWarning() {
200
200
  if (!this.currentComponent) return !0;
201
- const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0, n = Date.now();
202
- return n - r < 1e3 ? !1 : (this.lastWarningTime.set(t, n), !0);
201
+ const t = this.currentComponent, n = this.lastWarningTime.get(t) || 0, r = Date.now();
202
+ return r - n < 1e3 ? !1 : (this.lastWarningTime.set(t, r), !0);
203
203
  }
204
204
  /**
205
205
  * Execute a function with tracking disabled
206
206
  */
207
207
  withoutTracking(t) {
208
- const r = this.trackingDisabled;
208
+ const n = this.trackingDisabled;
209
209
  this.trackingDisabled = !0;
210
210
  try {
211
211
  return t();
212
212
  } finally {
213
- this.trackingDisabled = r;
213
+ this.trackingDisabled = n;
214
214
  }
215
215
  }
216
216
  /**
@@ -218,11 +218,11 @@ class pt {
218
218
  */
219
219
  getOrCreateState(t) {
220
220
  if (!this.currentComponent)
221
- return new De(t);
222
- const r = this.currentComponent, n = this.stateIndexCounter.get(r) || 0, i = `${r}:${n}`;
223
- if (this.stateIndexCounter.set(r, n + 1), this.stateStorage.has(i))
221
+ return new He(t);
222
+ const n = this.currentComponent, r = this.stateIndexCounter.get(n) || 0, i = `${n}:${r}`;
223
+ if (this.stateIndexCounter.set(n, r + 1), this.stateStorage.has(i))
224
224
  return this.stateStorage.get(i);
225
- const s = new De(t);
225
+ const s = new He(t);
226
226
  return this.stateStorage.set(i, s), s;
227
227
  }
228
228
  /**
@@ -235,28 +235,33 @@ class pt {
235
235
  * Trigger updates for all components that depend on a state
236
236
  */
237
237
  triggerUpdate(t) {
238
- t.getDependents().forEach((r) => {
239
- const n = this.componentRenderFunctions.get(r);
240
- n && le(n, r);
238
+ t.getDependents().forEach((n) => {
239
+ const r = this.componentRenderFunctions.get(n);
240
+ r && fe(r, n);
241
241
  });
242
242
  }
243
243
  /**
244
244
  * Clean up component dependencies when component is destroyed
245
245
  */
246
246
  cleanup(t) {
247
- const r = this.componentDependencies.get(t);
248
- r && (r.forEach((n) => n.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
249
- for (const n of Array.from(this.stateStorage.keys()))
250
- n.startsWith(t + ":") && this.stateStorage.delete(n);
247
+ const n = this.componentDependencies.get(t);
248
+ n && (n.forEach((r) => r.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
249
+ for (const r of Array.from(this.stateStorage.keys()))
250
+ r.startsWith(t + ":") && this.stateStorage.delete(r);
251
251
  this.stateIndexCounter.delete(t);
252
252
  }
253
253
  }
254
- const F = new pt();
255
- class De {
254
+ const F = new gt();
255
+ class He {
256
256
  _value;
257
257
  dependents = /* @__PURE__ */ new Set();
258
258
  constructor(t) {
259
259
  this._value = this.makeReactive(t);
260
+ try {
261
+ const n = Symbol.for("@cer/ReactiveState");
262
+ Object.defineProperty(this, n, { value: !0, enumerable: !1, configurable: !1 });
263
+ } catch {
264
+ }
260
265
  }
261
266
  get value() {
262
267
  return F.trackDependency(this), this._value;
@@ -279,159 +284,172 @@ class De {
279
284
  return this.dependents;
280
285
  }
281
286
  makeReactive(t) {
282
- return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : tt.createReactiveProxy(
287
+ return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : rt.createReactiveProxy(
283
288
  t,
284
289
  () => F.triggerUpdate(this),
285
- (r) => this.makeReactive(r)
290
+ (n) => this.makeReactive(n)
286
291
  );
287
292
  }
288
293
  }
289
- function or(e) {
294
+ function fn(e) {
290
295
  return F.getOrCreateState(e === void 0 ? null : e);
291
296
  }
292
- function ar(e) {
293
- const t = new De(e());
297
+ function ee(e) {
298
+ if (!e || typeof e != "object") return !1;
299
+ try {
300
+ const t = Symbol.for("@cer/ReactiveState");
301
+ if (e[t]) return !0;
302
+ } catch {
303
+ }
304
+ try {
305
+ return !!(e.constructor && e.constructor.name === "ReactiveState");
306
+ } catch {
307
+ return !1;
308
+ }
309
+ }
310
+ function dn(e) {
311
+ const t = new He(e());
294
312
  return {
295
313
  get value() {
296
314
  return F.trackDependency(t), e();
297
315
  }
298
316
  };
299
317
  }
300
- function cr(e, t, r = {}) {
301
- let n = e();
302
- r.immediate && t(n, n);
318
+ function pn(e, t, n = {}) {
319
+ let r = e();
320
+ n.immediate && t(r, r);
303
321
  const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
304
322
  F.setCurrentComponent(i, s);
305
323
  const o = e();
306
- F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
324
+ F.clearCurrentComponent(), o !== r && (t(o, r), r = o);
307
325
  };
308
326
  return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
309
327
  F.cleanup(i);
310
328
  };
311
329
  }
312
- const be = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), He = 500;
313
- function te(e) {
314
- if (be.has(e))
315
- return be.get(e);
330
+ const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
331
+ function ne(e) {
332
+ if (xe.has(e))
333
+ return xe.get(e);
316
334
  const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
317
- return be.size < He && be.set(e, t), t;
335
+ return xe.size < Ue && xe.set(e, t), t;
318
336
  }
319
- function rt(e) {
320
- if (we.has(e))
321
- return we.get(e);
322
- const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
323
- return we.size < He && we.set(e, t), t;
337
+ function it(e) {
338
+ if (ve.has(e))
339
+ return ve.get(e);
340
+ const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
341
+ return ve.size < Ue && ve.set(e, t), t;
324
342
  }
325
- function ne(e) {
343
+ function ie(e) {
326
344
  if (typeof e == "string") {
327
- if (ve.has(e))
328
- return ve.get(e);
345
+ if (ke.has(e))
346
+ return ke.get(e);
329
347
  const t = e.replace(
330
348
  /[&<>"']/g,
331
- (r) => ({
349
+ (n) => ({
332
350
  "&": "&amp;",
333
351
  "<": "&lt;",
334
352
  ">": "&gt;",
335
353
  '"': "&quot;",
336
354
  "'": "&#39;"
337
- })[r]
355
+ })[n]
338
356
  );
339
- return t !== e && ve.size < He && ve.set(e, t), t;
357
+ return t !== e && ke.size < Ue && ke.set(e, t), t;
340
358
  }
341
359
  return e;
342
360
  }
343
361
  function H(e, t) {
344
362
  if (typeof t == "string") {
345
- const r = t.split(".").reduce((n, i) => n?.[i], e);
346
- return r && typeof r == "object" && r.constructor && r.constructor.name === "ReactiveState" ? r.value : r;
363
+ const n = t.split(".").reduce((r, i) => r?.[i], e);
364
+ return ee(n) ? n.value : n;
347
365
  }
348
366
  return t;
349
367
  }
350
- function Ce(e, t, r) {
351
- const n = String(t).split("."), i = n.pop();
368
+ function Ee(e, t, n) {
369
+ const r = String(t).split("."), i = r.pop();
352
370
  if (!i) return;
353
- const s = n.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
354
- s[i] && typeof s[i] == "object" && s[i].constructor && s[i].constructor.name === "ReactiveState" ? s[i].value = r : s[i] = r;
371
+ const s = r.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
372
+ ee(s[i]) ? s[i].value = n : s[i] = n;
355
373
  }
356
- const nt = typeof process < "u" && process.env?.NODE_ENV !== "production";
357
- function ie(e, ...t) {
358
- nt && console.error(e, ...t);
374
+ const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
375
+ function se(e, ...t) {
376
+ st && console.error(e, ...t);
359
377
  }
360
- function Re(e, ...t) {
361
- nt && console.warn(e, ...t);
378
+ function Oe(e, ...t) {
379
+ st && console.warn(e, ...t);
362
380
  }
363
- function ht(e, t, r) {
364
- if (r)
365
- for (const [n, i] of Object.entries(r)) {
381
+ function yt(e, t, n) {
382
+ if (n)
383
+ for (const [r, i] of Object.entries(n)) {
366
384
  let s, o = {};
367
- if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
385
+ if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(r, {
368
386
  callback: s,
369
387
  options: o,
370
- oldValue: H(e, n)
388
+ oldValue: H(e, r)
371
389
  }), o.immediate)
372
390
  try {
373
- const a = H(e, n);
391
+ const a = H(e, r);
374
392
  s(a, void 0, e);
375
393
  } catch (a) {
376
- ie(`Error in immediate watcher for "${n}":`, a);
394
+ se(`Error in immediate watcher for "${r}":`, a);
377
395
  }
378
396
  }
379
397
  }
380
- function gt(e, t, r, n) {
398
+ function mt(e, t, n, r) {
381
399
  const i = (o, a) => {
382
400
  if (o === a) return !0;
383
401
  if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
384
402
  if (Array.isArray(o) && Array.isArray(a))
385
- return o.length !== a.length ? !1 : o.every((g, w) => i(g, a[w]));
386
- const u = Object.keys(o), m = Object.keys(a);
387
- return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
388
- }, s = t.get(r);
389
- if (s && !i(n, s.oldValue))
403
+ return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
404
+ const u = Object.keys(o), y = Object.keys(a);
405
+ return u.length !== y.length ? !1 : u.every((g) => i(o[g], a[g]));
406
+ }, s = t.get(n);
407
+ if (s && !i(r, s.oldValue))
390
408
  try {
391
- s.callback(n, s.oldValue, e), s.oldValue = n;
409
+ s.callback(r, s.oldValue, e), s.oldValue = r;
392
410
  } catch (o) {
393
- ie(`Error in watcher for "${r}":`, o);
411
+ se(`Error in watcher for "${n}":`, o);
394
412
  }
395
413
  for (const [o, a] of t.entries())
396
- if (a.options.deep && r.startsWith(o + "."))
414
+ if (a.options.deep && n.startsWith(o + "."))
397
415
  try {
398
416
  const u = H(e, o);
399
417
  i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
400
418
  } catch (u) {
401
- ie(`Error in deep watcher for "${o}":`, u);
419
+ se(`Error in deep watcher for "${o}":`, u);
402
420
  }
403
421
  }
404
- function qe(e, t) {
422
+ function Ke(e, t) {
405
423
  return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
406
424
  }
407
- function mt(e, t, r) {
408
- t && Object.entries(t).forEach(([n, i]) => {
409
- const s = te(n), o = e.getAttribute(s);
410
- if (i.type === Function && typeof e[n] == "function")
411
- r[n] = e[n];
412
- else if (typeof e[n] < "u")
425
+ function bt(e, t, n) {
426
+ t && Object.entries(t).forEach(([r, i]) => {
427
+ const s = ne(r), o = e.getAttribute(s);
428
+ if (i.type === Function && typeof e[r] == "function")
429
+ n[r] = e[r];
430
+ else if (typeof e[r] < "u")
413
431
  try {
414
- const a = e[n];
415
- i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r[n] = a : r[n] = ne(qe(String(a), i.type));
432
+ const a = e[r];
433
+ i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? n[r] = a : n[r] = ie(Ke(String(a), i.type));
416
434
  } catch {
417
- r[n] = e[n];
435
+ n[r] = e[r];
418
436
  }
419
- else o !== null ? r[n] = ne(qe(o, i.type)) : "default" in i && i.default !== void 0 && (r[n] = ne(i.default));
437
+ else o !== null ? n[r] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (n[r] = ie(i.default));
420
438
  });
421
439
  }
422
- function yt(e, t, r) {
423
- t.props && mt(e, t.props, r);
440
+ function wt(e, t, n) {
441
+ t.props && bt(e, t.props, n);
424
442
  }
425
- function bt(e, t, r, n) {
426
- e.onConnected && !r && (e.onConnected(t), n(!0));
443
+ function xt(e, t, n, r) {
444
+ e.onConnected && !n && (e.onConnected(t), r(!0));
427
445
  }
428
- function wt(e, t, r, n, i, s, o, a) {
429
- e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), a(!1);
446
+ function vt(e, t, n, r, i, s, o, a) {
447
+ e.onDisconnected && e.onDisconnected(t), n.forEach((u) => u()), r(), i(), s(!1), o(null), a(!1);
430
448
  }
431
- function vt(e, t, r, n, i) {
432
- e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
449
+ function kt(e, t, n, r, i) {
450
+ e.onAttributeChanged && e.onAttributeChanged(t, n, r, i);
433
451
  }
434
- class xt {
452
+ class Ct {
435
453
  static cache = /* @__PURE__ */ new Map();
436
454
  static maxCacheSize = 1e3;
437
455
  // Dangerous patterns to block
@@ -452,14 +470,14 @@ class xt {
452
470
  /fetch/i,
453
471
  /XMLHttpRequest/i
454
472
  ];
455
- static evaluate(t, r) {
456
- const n = this.cache.get(t);
457
- if (n) {
458
- if (!n.isSecure) {
459
- Re("Blocked cached dangerous expression:", t);
473
+ static evaluate(t, n) {
474
+ const r = this.cache.get(t);
475
+ if (r) {
476
+ if (!r.isSecure) {
477
+ Oe("Blocked cached dangerous expression:", t);
460
478
  return;
461
479
  }
462
- return n.evaluator(r);
480
+ return r.evaluator(n);
463
481
  }
464
482
  const i = this.createEvaluator(t);
465
483
  if (this.cache.size >= this.maxCacheSize) {
@@ -467,10 +485,10 @@ class xt {
467
485
  s && this.cache.delete(s);
468
486
  }
469
487
  if (this.cache.set(t, i), !i.isSecure) {
470
- Re("Blocked dangerous expression:", t);
488
+ Oe("Blocked dangerous expression:", t);
471
489
  return;
472
490
  }
473
- return i.evaluator(r);
491
+ return i.evaluator(n);
474
492
  }
475
493
  static createEvaluator(t) {
476
494
  if (this.hasDangerousPatterns(t))
@@ -481,28 +499,28 @@ class xt {
481
499
  }, isSecure: !1 };
482
500
  try {
483
501
  return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
484
- } catch (r) {
485
- return Re("Failed to create evaluator for expression:", t, r), { evaluator: () => {
502
+ } catch (n) {
503
+ return Oe("Failed to create evaluator for expression:", t, n), { evaluator: () => {
486
504
  }, isSecure: !1 };
487
505
  }
488
506
  }
489
507
  static hasDangerousPatterns(t) {
490
- return this.dangerousPatterns.some((r) => r.test(t));
508
+ return this.dangerousPatterns.some((n) => n.test(t));
491
509
  }
492
510
  static createSafeEvaluator(t) {
493
511
  if (t.trim().startsWith("{") && t.trim().endsWith("}"))
494
512
  return this.createObjectEvaluator(t);
495
513
  if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
496
- const r = t.trim().slice(4);
497
- return (n) => H(n, r);
514
+ const n = t.trim().slice(4);
515
+ return (r) => H(r, n);
498
516
  }
499
- return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
517
+ return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (n) => H(n, t);
500
518
  }
501
519
  static createObjectEvaluator(t) {
502
- const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
520
+ const n = t.trim().slice(1, -1), r = this.parseObjectProperties(n);
503
521
  return (i) => {
504
522
  const s = {};
505
- for (const { key: o, value: a } of n)
523
+ for (const { key: o, value: a } of r)
506
524
  try {
507
525
  if (a.startsWith("ctx.")) {
508
526
  const u = a.slice(4);
@@ -516,51 +534,51 @@ class xt {
516
534
  };
517
535
  }
518
536
  static parseObjectProperties(t) {
519
- const r = [], n = t.split(",");
520
- for (const i of n) {
537
+ const n = [], r = t.split(",");
538
+ for (const i of r) {
521
539
  const s = i.indexOf(":");
522
540
  if (s === -1) continue;
523
541
  const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
524
- r.push({ key: u, value: a });
542
+ n.push({ key: u, value: a });
525
543
  }
526
- return r;
544
+ return n;
527
545
  }
528
546
  static createSimpleEvaluator(t) {
529
- return (r) => {
547
+ return (n) => {
530
548
  try {
531
- let n = t;
549
+ let r = t;
532
550
  const i = [];
533
- n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (w) => `<<#${i.push(w) - 1}#>>`);
534
- const s = n.match(/ctx\.[\w.]+/g) || [];
535
- for (const w of s) {
536
- const h = w.slice(4), l = H(r, h);
551
+ r = r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
552
+ const s = r.match(/ctx\.[\w.]+/g) || [];
553
+ for (const b of s) {
554
+ const h = b.slice(4), l = H(n, h);
537
555
  if (l === void 0) return;
538
556
  const d = i.push(JSON.stringify(l)) - 1;
539
- n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
557
+ r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
540
558
  }
541
- const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = n.match(o) || [];
542
- for (const w of a) {
543
- if (w.startsWith("ctx.")) continue;
544
- const h = H(r, w);
559
+ const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = r.match(o) || [];
560
+ for (const b of a) {
561
+ if (b.startsWith("ctx.")) continue;
562
+ const h = H(n, b);
545
563
  if (h === void 0) return;
546
564
  const l = i.push(JSON.stringify(h)) - 1;
547
- n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
565
+ r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
548
566
  }
549
567
  const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
550
- let m;
568
+ let y;
551
569
  const g = /* @__PURE__ */ new Set();
552
- for (; (m = u.exec(n)) !== null; ) {
553
- const w = m[1];
554
- if (["true", "false", "null", "undefined"].includes(w) || /^[0-9]+$/.test(w) || w === "ctx" || g.has(w)) continue;
555
- g.add(w);
556
- const h = H(r, w);
570
+ for (; (y = u.exec(r)) !== null; ) {
571
+ const b = y[1];
572
+ if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
573
+ g.add(b);
574
+ const h = H(n, b);
557
575
  if (h === void 0) return;
558
576
  const l = JSON.stringify(h), d = i.push(l) - 1;
559
- w.includes(".") ? n = n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : n = n.replace(new RegExp("\\b" + w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
577
+ b.includes(".") ? r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : r = r.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
560
578
  }
561
- n = n.replace(/<<#(\d+)#>>/g, (w, h) => i[Number(h)]);
579
+ r = r.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
562
580
  try {
563
- return this.evaluateBasicExpression(n);
581
+ return this.evaluateBasicExpression(r);
564
582
  } catch {
565
583
  return;
566
584
  }
@@ -575,13 +593,13 @@ class xt {
575
593
  * arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
576
594
  */
577
595
  static evaluateBasicExpression(t) {
578
- const r = this.tokenize(t);
579
- let n = 0;
596
+ const n = this.tokenize(t);
597
+ let r = 0;
580
598
  function i() {
581
- return r[n];
599
+ return n[r];
582
600
  }
583
601
  function s(c) {
584
- const p = r[n++];
602
+ const p = n[r++];
585
603
  if (c && !p)
586
604
  throw new Error(`Unexpected token EOF, expected ${c}`);
587
605
  if (c && p && p.type !== c && p.value !== c)
@@ -597,21 +615,21 @@ class xt {
597
615
  s("?");
598
616
  const p = o();
599
617
  s(":");
600
- const y = o();
601
- return c ? p : y;
618
+ const m = o();
619
+ return c ? p : m;
602
620
  }
603
621
  return c;
604
622
  }
605
623
  function u() {
606
- let c = m();
624
+ let c = y();
607
625
  for (; i() && i().value === "||"; ) {
608
626
  s("OP");
609
- const p = m();
627
+ const p = y();
610
628
  c = c || p;
611
629
  }
612
630
  return c;
613
631
  }
614
- function m() {
632
+ function y() {
615
633
  let c = g();
616
634
  for (; i() && i().value === "&&"; ) {
617
635
  s("OP");
@@ -621,42 +639,42 @@ class xt {
621
639
  return c;
622
640
  }
623
641
  function g() {
624
- let c = w();
642
+ let c = b();
625
643
  for (; i() && ["==", "!=", "===", "!=="].includes(i().value); ) {
626
- const p = s("OP").value, y = w();
644
+ const p = s("OP").value, m = b();
627
645
  switch (p) {
628
646
  case "==":
629
- c = c == y;
647
+ c = c == m;
630
648
  break;
631
649
  case "!=":
632
- c = c != y;
650
+ c = c != m;
633
651
  break;
634
652
  case "===":
635
- c = c === y;
653
+ c = c === m;
636
654
  break;
637
655
  case "!==":
638
- c = c !== y;
656
+ c = c !== m;
639
657
  break;
640
658
  }
641
659
  }
642
660
  return c;
643
661
  }
644
- function w() {
662
+ function b() {
645
663
  let c = h();
646
664
  for (; i() && [">", "<", ">=", "<="].includes(i().value); ) {
647
- const p = s("OP").value, y = h();
665
+ const p = s("OP").value, m = h();
648
666
  switch (p) {
649
667
  case ">":
650
- c = c > y;
668
+ c = c > m;
651
669
  break;
652
670
  case "<":
653
- c = c < y;
671
+ c = c < m;
654
672
  break;
655
673
  case ">=":
656
- c = c >= y;
674
+ c = c >= m;
657
675
  break;
658
676
  case "<=":
659
- c = c <= y;
677
+ c = c <= m;
660
678
  break;
661
679
  }
662
680
  }
@@ -665,33 +683,33 @@ class xt {
665
683
  function h() {
666
684
  let c = l();
667
685
  for (; i() && (i().value === "+" || i().value === "-"); ) {
668
- const p = s("OP").value, y = l();
669
- c = p === "+" ? c + y : c - y;
686
+ const p = s("OP").value, m = l();
687
+ c = p === "+" ? c + m : c - m;
670
688
  }
671
689
  return c;
672
690
  }
673
691
  function l() {
674
692
  let c = d();
675
693
  for (; i() && (i().value === "*" || i().value === "/" || i().value === "%"); ) {
676
- const p = s("OP").value, y = d();
694
+ const p = s("OP").value, m = d();
677
695
  switch (p) {
678
696
  case "*":
679
- c = c * y;
697
+ c = c * m;
680
698
  break;
681
699
  case "/":
682
- c = c / y;
700
+ c = c / m;
683
701
  break;
684
702
  case "%":
685
- c = c % y;
703
+ c = c % m;
686
704
  break;
687
705
  }
688
706
  }
689
707
  return c;
690
708
  }
691
709
  function d() {
692
- return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : v();
710
+ return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : x();
693
711
  }
694
- function v() {
712
+ function x() {
695
713
  const c = i();
696
714
  if (c) {
697
715
  if (c.type === "NUMBER")
@@ -718,21 +736,21 @@ class xt {
718
736
  return o();
719
737
  }
720
738
  static tokenize(t) {
721
- const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
739
+ const n = [], r = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
722
740
  let i;
723
- for (; (i = n.exec(t)) !== null; ) {
741
+ for (; (i = r.exec(t)) !== null; ) {
724
742
  const s = i[1];
725
- s && (/^\d/.test(s) ? r.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? r.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? r.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? r.push({ type: "PUNC", value: s }) : r.push({ type: "OP", value: s }));
743
+ s && (/^\d/.test(s) ? n.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? n.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? n.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? n.push({ type: "PUNC", value: s }) : n.push({ type: "OP", value: s }));
726
744
  }
727
- return r;
745
+ return n;
728
746
  }
729
- static evaluateSimpleValue(t, r) {
747
+ static evaluateSimpleValue(t, n) {
730
748
  if (t === "true") return !0;
731
749
  if (t === "false") return !1;
732
750
  if (!isNaN(Number(t))) return Number(t);
733
751
  if (t.startsWith("ctx.")) {
734
- const n = t.slice(4);
735
- return H(r, n);
752
+ const r = t.slice(4);
753
+ return H(n, r);
736
754
  }
737
755
  return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
738
756
  }
@@ -743,14 +761,14 @@ class xt {
743
761
  return this.cache.size;
744
762
  }
745
763
  }
746
- class se {
764
+ class oe {
747
765
  static cleanupFunctions = /* @__PURE__ */ new WeakMap();
748
766
  /**
749
767
  * Add an event listener with automatic cleanup tracking
750
768
  */
751
- static addListener(t, r, n, i) {
752
- t.addEventListener(r, n, i);
753
- const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
769
+ static addListener(t, n, r, i) {
770
+ t.addEventListener(n, r, i);
771
+ const o = { event: n, handler: r, options: i, cleanup: () => t.removeEventListener(n, r, i), addedAt: Date.now() };
754
772
  this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
755
773
  const a = this.cleanupFunctions.get(t);
756
774
  a.push(o), this.cleanupFunctions.get(t).__metaList = a;
@@ -758,13 +776,13 @@ class se {
758
776
  /**
759
777
  * Remove a specific event listener
760
778
  */
761
- static removeListener(t, r, n, i) {
762
- t.removeEventListener(r, n, i);
779
+ static removeListener(t, n, r, i) {
780
+ t.removeEventListener(n, r, i);
763
781
  const s = this.cleanupFunctions.get(t);
764
782
  if (s) {
765
783
  const o = s.__metaList || null;
766
784
  if (o) {
767
- const a = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
785
+ const a = o.findIndex((u) => u.event === n && u.handler === r && JSON.stringify(u.options) === JSON.stringify(i));
768
786
  if (a >= 0) {
769
787
  try {
770
788
  o[a].cleanup();
@@ -783,8 +801,8 @@ class se {
783
801
  * Clean up all event listeners for an element
784
802
  */
785
803
  static cleanup(t) {
786
- const r = this.cleanupFunctions.get(t);
787
- r && ((r.__metaList || r).forEach((i) => {
804
+ const n = this.cleanupFunctions.get(t);
805
+ n && ((n.__metaList || n).forEach((i) => {
788
806
  try {
789
807
  typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
790
808
  } catch (s) {
@@ -806,52 +824,52 @@ class se {
806
824
  * Check if an element has any tracked event listeners
807
825
  */
808
826
  static hasListeners(t) {
809
- const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
810
- return !!(n && n.length > 0);
827
+ const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
828
+ return !!(r && r.length > 0);
811
829
  }
812
830
  /**
813
831
  * Get the number of tracked event listeners for an element
814
832
  */
815
833
  static getListenerCount(t) {
816
- const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
817
- return n ? n.length : 0;
834
+ const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
835
+ return r ? r.length : 0;
818
836
  }
819
837
  }
820
- function ce(e, t) {
838
+ function ue(e, t) {
821
839
  if (t && e instanceof HTMLElement) {
822
- se.cleanup(e);
823
- for (const r in t)
824
- t[r] === e && delete t[r];
825
- for (const r of Array.from(e.childNodes))
826
- ce(r, t);
840
+ oe.cleanup(e);
841
+ for (const n in t)
842
+ t[n] === e && delete t[n];
843
+ for (const n of Array.from(e.childNodes))
844
+ ue(n, t);
827
845
  }
828
846
  }
829
- function de(e, t, r) {
847
+ function he(e, t, n) {
830
848
  if (typeof e == "string") return;
831
- const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
832
- n ? n.value = t : i && r && (r[i] = t);
849
+ const r = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
850
+ r ? r.value = t : i && n && (n[i] = t);
833
851
  }
834
- function kt(e, t, r, n, i, s, o, a) {
852
+ function _t(e, t, n, r, i, s, o, a) {
835
853
  if (!s) return;
836
- const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), w = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
837
- if (w) {
854
+ const u = t.includes("lazy"), y = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
855
+ if (b) {
838
856
  const C = e.value;
839
857
  return a && typeof C == "object" && C !== null ? C[a] : C;
840
858
  }
841
859
  return H(s._state || s, e);
842
860
  }, l = h();
843
861
  let d = "text";
844
- o instanceof HTMLInputElement ? d = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
845
- const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
862
+ o instanceof HTMLInputElement ? d = r?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
863
+ const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
846
864
  if (d === "checkbox")
847
865
  if (Array.isArray(l))
848
- r[c] = l.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
866
+ n[c] = l.includes(String(o?.getAttribute("value") ?? r?.value ?? ""));
849
867
  else {
850
868
  const C = o?.getAttribute("true-value") ?? !0;
851
- r[c] = l === C;
869
+ n[c] = l === C;
852
870
  }
853
871
  else if (d === "radio")
854
- r[c] = l === (n?.value ?? "");
872
+ n[c] = l === (r?.value ?? "");
855
873
  else if (d === "select")
856
874
  if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
857
875
  const C = Array.isArray(l) ? l.map(String) : [];
@@ -859,102 +877,102 @@ function kt(e, t, r, n, i, s, o, a) {
859
877
  Array.from(o.options).forEach((k) => {
860
878
  k.selected = C.includes(k.value);
861
879
  });
862
- }, 0), r[c] = Array.isArray(l) ? l : [];
880
+ }, 0), n[c] = Array.isArray(l) ? l : [];
863
881
  } else
864
- r[c] = l;
882
+ n[c] = l;
865
883
  else {
866
- r[c] = l;
884
+ n[c] = l;
867
885
  try {
868
- const C = te(c);
869
- n && (n[C] = l);
886
+ const C = ne(c);
887
+ r && (r[C] = l);
870
888
  } catch {
871
889
  }
872
890
  }
873
- const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", y = (C) => {
891
+ const p = u || d === "checkbox" || d === "radio" || d === "select" ? "change" : "input", m = (C) => {
874
892
  if (C.isComposing || i._isComposing) return;
875
893
  const k = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
876
894
  if (C.isTrusted === !1 && !k) return;
877
895
  const f = C.target;
878
896
  if (!f || f._modelUpdating) return;
879
- let x = f.value;
897
+ let v = f.value;
880
898
  if (d === "checkbox") {
881
- const R = h();
882
- if (Array.isArray(R)) {
883
- const T = f.getAttribute("value") ?? "", $ = Array.from(R);
899
+ const T = h();
900
+ if (Array.isArray(T)) {
901
+ const R = f.getAttribute("value") ?? "", S = Array.from(T);
884
902
  if (f.checked)
885
- $.includes(T) || $.push(T);
903
+ S.includes(R) || S.push(R);
886
904
  else {
887
- const P = $.indexOf(T);
888
- P > -1 && $.splice(P, 1);
905
+ const P = S.indexOf(R);
906
+ P > -1 && S.splice(P, 1);
889
907
  }
890
- x = $;
908
+ v = S;
891
909
  } else {
892
- const T = f.getAttribute("true-value") ?? !0, $ = f.getAttribute("false-value") ?? !1;
893
- x = f.checked ? T : $;
910
+ const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
911
+ v = f.checked ? R : S;
894
912
  }
895
913
  } else if (d === "radio")
896
- x = f.getAttribute("value") ?? f.value;
914
+ v = f.getAttribute("value") ?? f.value;
897
915
  else if (d === "select" && f.multiple)
898
- x = Array.from(f.selectedOptions).map((R) => R.value);
899
- else if (m && typeof x == "string" && (x = x.trim()), g) {
900
- const R = Number(x);
901
- isNaN(R) || (x = R);
916
+ v = Array.from(f.selectedOptions).map((T) => T.value);
917
+ else if (y && typeof v == "string" && (v = v.trim()), g) {
918
+ const T = Number(v);
919
+ isNaN(T) || (v = T);
902
920
  }
903
921
  const A = s._state || s, _ = h();
904
- if (Array.isArray(x) && Array.isArray(_) ? JSON.stringify([...x].sort()) !== JSON.stringify([..._].sort()) : x !== _) {
922
+ if (Array.isArray(v) && Array.isArray(_) ? JSON.stringify([...v].sort()) !== JSON.stringify([..._].sort()) : v !== _) {
905
923
  f._modelUpdating = !0;
906
924
  try {
907
- if (w)
925
+ if (b)
908
926
  if (a && typeof e.value == "object" && e.value !== null) {
909
- const R = { ...e.value };
910
- R[a] = x, e.value = R;
927
+ const T = { ...e.value };
928
+ T[a] = v, e.value = T;
911
929
  } else
912
- e.value = x;
930
+ e.value = v;
913
931
  else
914
- Ce(A, e, x);
932
+ Ee(A, e, v);
915
933
  if (s._requestRender && s._requestRender(), s._triggerWatchers) {
916
- const R = w ? "reactiveState" : e;
917
- s._triggerWatchers(R, x);
934
+ const T = b ? "reactiveState" : e;
935
+ s._triggerWatchers(T, v);
918
936
  }
919
937
  if (f) {
920
- const R = `update:${te(c)}`, T = new CustomEvent(R, {
921
- detail: x,
938
+ const T = `update:${ne(c)}`, R = new CustomEvent(T, {
939
+ detail: v,
922
940
  bubbles: !0,
923
941
  composed: !0
924
942
  });
925
- f.dispatchEvent(T);
943
+ f.dispatchEvent(R);
926
944
  }
927
945
  } finally {
928
946
  setTimeout(() => f._modelUpdating = !1, 0);
929
947
  }
930
948
  }
931
949
  };
932
- if (v) {
950
+ if (x) {
933
951
  if (i[p]) {
934
952
  const C = i[p];
935
- o && se.removeListener(o, p, C);
953
+ o && oe.removeListener(o, p, C);
936
954
  }
937
- i[p] = y;
955
+ i[p] = m;
938
956
  } else {
939
- const C = `update:${te(c)}`;
957
+ const C = `update:${ne(c)}`;
940
958
  if (i[C]) {
941
959
  const k = i[C];
942
- o && se.removeListener(o, C, k);
960
+ o && oe.removeListener(o, C, k);
943
961
  }
944
962
  i[C] = (k) => {
945
- const f = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
946
- if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
947
- Ce(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
948
- const S = k.target;
949
- if (S) {
950
- S[c] = x;
963
+ const f = s._state || s, v = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
964
+ if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
965
+ Ee(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
966
+ const $ = k.target;
967
+ if ($) {
968
+ $[c] = v;
951
969
  try {
952
- const R = te(c);
953
- typeof x == "boolean" ? x ? S.setAttribute(R, "true") : S.setAttribute(R, "false") : S.setAttribute(R, String(x));
970
+ const T = ne(c);
971
+ typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
954
972
  } catch {
955
973
  }
956
974
  queueMicrotask(() => {
957
- typeof S._applyProps == "function" && S._applyProps(S._cfg), typeof S._requestRender == "function" && S._requestRender();
975
+ typeof $._applyProps == "function" && $._applyProps($._cfg), typeof $._requestRender == "function" && $._requestRender();
958
976
  });
959
977
  }
960
978
  }
@@ -964,16 +982,16 @@ function kt(e, t, r, n, i, s, o, a) {
964
982
  i._isComposing = !1;
965
983
  const k = C.target;
966
984
  k && setTimeout(() => {
967
- const f = k.value, x = s._state || s, A = H(x, e);
985
+ const f = k.value, v = s._state || s, A = H(v, e);
968
986
  let _ = f;
969
- if (m && (_ = _.trim()), g) {
970
- const R = Number(_);
971
- isNaN(R) || (_ = R);
987
+ if (y && (_ = _.trim()), g) {
988
+ const T = Number(_);
989
+ isNaN(T) || (_ = T);
972
990
  }
973
991
  if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
974
992
  k._modelUpdating = !0;
975
993
  try {
976
- Ce(x, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
994
+ Ee(v, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
977
995
  } finally {
978
996
  setTimeout(() => k._modelUpdating = !1, 0);
979
997
  }
@@ -981,42 +999,42 @@ function kt(e, t, r, n, i, s, o, a) {
981
999
  }, 0);
982
1000
  });
983
1001
  }
984
- function it(e) {
1002
+ function ot(e) {
985
1003
  const t = e.slice(2);
986
1004
  return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
987
1005
  }
988
- function Ct(e, t, r, n) {
1006
+ function Et(e, t, n, r) {
989
1007
  if (typeof e == "object" && e !== null)
990
1008
  for (const [i, s] of Object.entries(e))
991
- i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
1009
+ i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? n[i] = s : t[i] = s;
992
1010
  else if (typeof e == "string") {
993
- if (!n) return;
1011
+ if (!r) return;
994
1012
  try {
995
- const i = he(e, n);
1013
+ const i = ye(e, r);
996
1014
  if (typeof i == "object" && i !== null) {
997
1015
  for (const [s, o] of Object.entries(i))
998
- s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
1016
+ s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? n[s] = o : t[s] = o;
999
1017
  return;
1000
1018
  } else {
1001
- r[e] = i;
1019
+ n[e] = i;
1002
1020
  return;
1003
1021
  }
1004
1022
  } catch {
1005
- const i = H(n, e);
1006
- r[e] = i;
1023
+ const i = H(r, e);
1024
+ n[e] = i;
1007
1025
  }
1008
1026
  }
1009
1027
  }
1010
- function _t(e, t, r) {
1011
- let n;
1028
+ function $t(e, t, n) {
1029
+ let r;
1012
1030
  if (typeof e == "string") {
1013
- if (!r) return;
1014
- n = he(e, r);
1031
+ if (!n) return;
1032
+ r = ye(e, n);
1015
1033
  } else
1016
- n = e;
1034
+ r = e;
1017
1035
  const i = t.style || "";
1018
1036
  let s = i;
1019
- if (n) {
1037
+ if (r) {
1020
1038
  if (i) {
1021
1039
  const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
1022
1040
  (u) => u.startsWith("display:")
@@ -1032,36 +1050,36 @@ function _t(e, t, r) {
1032
1050
  s = "display: none";
1033
1051
  s !== i && (s ? t.style = s : delete t.style);
1034
1052
  }
1035
- function he(e, t) {
1036
- return xt.evaluate(e, t);
1053
+ function ye(e, t) {
1054
+ return Ct.evaluate(e, t);
1037
1055
  }
1038
- function Et(e, t, r) {
1039
- let n;
1056
+ function St(e, t, n) {
1057
+ let r;
1040
1058
  if (typeof e == "string") {
1041
- if (!r) return;
1042
- n = he(e, r);
1059
+ if (!n) return;
1060
+ r = ye(e, n);
1043
1061
  } else
1044
- n = e;
1062
+ r = e;
1045
1063
  let i = [];
1046
- typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && n !== null && (i = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
1064
+ typeof r == "string" ? i = [r] : Array.isArray(r) ? i = r.filter(Boolean) : typeof r == "object" && r !== null && (i = Object.entries(r).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
1047
1065
  const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
1048
1066
  o && (t.class = o);
1049
1067
  }
1050
- function St(e, t, r) {
1051
- let n;
1068
+ function At(e, t, n) {
1069
+ let r;
1052
1070
  if (typeof e == "string") {
1053
- if (!r) return;
1054
- n = he(e, r);
1071
+ if (!n) return;
1072
+ r = ye(e, n);
1055
1073
  } else
1056
- n = e;
1074
+ r = e;
1057
1075
  let i = "";
1058
- if (typeof n == "string")
1059
- i = n;
1060
- else if (n && typeof n == "object") {
1076
+ if (typeof r == "string")
1077
+ i = r;
1078
+ else if (r && typeof r == "object") {
1061
1079
  const o = [];
1062
- for (const [a, u] of Object.entries(n))
1080
+ for (const [a, u] of Object.entries(r))
1063
1081
  if (u != null && u !== "") {
1064
- const m = a.replace(
1082
+ const y = a.replace(
1065
1083
  /[A-Z]/g,
1066
1084
  (h) => `-${h.toLowerCase()}`
1067
1085
  ), g = [
@@ -1090,65 +1108,65 @@ function St(e, t, r) {
1090
1108
  "min-height",
1091
1109
  "max-height"
1092
1110
  ];
1093
- let w = String(u);
1094
- typeof u == "number" && g.includes(m) && (w = `${u}px`), o.push(`${m}: ${w}`);
1111
+ let b = String(u);
1112
+ typeof u == "number" && g.includes(y) && (b = `${u}px`), o.push(`${y}: ${b}`);
1095
1113
  }
1096
1114
  i = o.join("; ") + (o.length > 0 ? ";" : "");
1097
1115
  }
1098
1116
  const s = t.style || "";
1099
1117
  t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
1100
1118
  }
1101
- function $t(e, t, r) {
1102
- let n = e;
1103
- typeof e == "string" && r && (n = he(e, r)), n && typeof n == "object" && n.constructor?.name === "ReactiveState" ? t.reactiveRef = n : t.ref = n;
1119
+ function Tt(e, t, n) {
1120
+ let r = e;
1121
+ typeof e == "string" && n && (r = ye(e, n)), ee(r) ? t.reactiveRef = r : t.ref = r;
1104
1122
  }
1105
- function st(e, t, r, n) {
1106
- const i = {}, s = { ...n || {} }, o = {};
1123
+ function at(e, t, n, r) {
1124
+ const i = {}, s = { ...r || {} }, o = {};
1107
1125
  for (const [a, u] of Object.entries(e)) {
1108
- const { value: m, modifiers: g, arg: w } = u;
1126
+ const { value: y, modifiers: g, arg: b } = u;
1109
1127
  if (a === "model" || a.startsWith("model:")) {
1110
- const h = a.split(":"), l = h.length > 1 ? h[1] : w;
1111
- kt(
1112
- m,
1128
+ const h = a.split(":"), l = h.length > 1 ? h[1] : b;
1129
+ _t(
1130
+ y,
1113
1131
  // Pass the original value (could be string or reactive state object)
1114
1132
  g,
1115
1133
  i,
1116
1134
  s,
1117
1135
  o,
1118
1136
  t,
1119
- r,
1137
+ n,
1120
1138
  l
1121
1139
  );
1122
1140
  continue;
1123
1141
  }
1124
1142
  switch (a) {
1125
1143
  case "bind":
1126
- Ct(m, i, s, t);
1144
+ Et(y, i, s, t);
1127
1145
  break;
1128
1146
  case "show":
1129
- _t(m, s, t);
1147
+ $t(y, s, t);
1130
1148
  break;
1131
1149
  case "class":
1132
- Et(m, s, t);
1150
+ St(y, s, t);
1133
1151
  break;
1134
1152
  case "style":
1135
- St(m, s, t);
1153
+ At(y, s, t);
1136
1154
  break;
1137
1155
  case "ref":
1138
- $t(m, i, t);
1156
+ Tt(y, i, t);
1139
1157
  break;
1140
1158
  }
1141
1159
  }
1142
1160
  return { props: i, attrs: s, listeners: o };
1143
1161
  }
1144
- function Ie(e, t) {
1162
+ function Be(e, t) {
1145
1163
  if (Array.isArray(e)) {
1146
1164
  const s = /* @__PURE__ */ new Set();
1147
1165
  return e.map((o) => {
1148
1166
  if (!o || typeof o != "object") return o;
1149
1167
  let a = o.props?.key ?? o.key;
1150
1168
  if (!a) {
1151
- const w = o.tag || "node", l = [
1169
+ const b = o.tag || "node", l = [
1152
1170
  // attrs (kebab-case)
1153
1171
  o.props?.attrs?.id,
1154
1172
  o.props?.attrs?.name,
@@ -1159,66 +1177,66 @@ function Ie(e, t) {
1159
1177
  o.props?.props?.dataKey,
1160
1178
  o.props?.props?.["data-key"]
1161
1179
  ].find((d) => d != null) ?? "";
1162
- a = l ? `${t}:${w}:${l}` : `${t}:${w}`;
1180
+ a = l ? `${t}:${b}:${l}` : `${t}:${b}`;
1163
1181
  }
1164
- let u = a, m = 1;
1182
+ let u = a, y = 1;
1165
1183
  for (; s.has(u); )
1166
- u = `${a}#${m++}`;
1184
+ u = `${a}#${y++}`;
1167
1185
  s.add(u);
1168
1186
  let g = o.children;
1169
- return Array.isArray(g) && (g = Ie(g, u)), { ...o, key: u, children: g };
1187
+ return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
1170
1188
  });
1171
1189
  }
1172
- const r = e;
1173
- let n = r.props?.key ?? r.key ?? t, i = r.children;
1174
- return Array.isArray(i) && (i = Ie(i, n)), { ...r, key: n, children: i };
1190
+ const n = e;
1191
+ let r = n.props?.key ?? n.key ?? t, i = n.children;
1192
+ return Array.isArray(i) && (i = Be(i, r)), { ...n, key: r, children: i };
1175
1193
  }
1176
- function Fe(e, t, r, n) {
1177
- const i = r.directives ?? {}, s = st(
1194
+ function Ve(e, t, n, r) {
1195
+ const i = n.directives ?? {}, s = at(
1178
1196
  i,
1179
- n,
1197
+ r,
1180
1198
  e,
1181
- r.attrs
1199
+ n.attrs
1182
1200
  ), o = {
1183
1201
  ...t.props,
1184
- ...r.props,
1202
+ ...n.props,
1185
1203
  ...s.props
1186
1204
  }, a = {
1187
1205
  ...t.attrs,
1188
- ...r.attrs,
1206
+ ...n.attrs,
1189
1207
  ...s.attrs
1190
- }, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
1191
- let w = !1;
1192
- for (const d in { ...u, ...m }) {
1193
- const v = u[d], b = m[d];
1194
- if (v !== b)
1195
- if (w = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
1196
- e.value !== b && (e.value = b ?? "");
1208
+ }, u = t.props ?? {}, y = o, g = n?.isCustomElement ?? t?.isCustomElement ?? !1;
1209
+ let b = !1;
1210
+ for (const d in { ...u, ...y }) {
1211
+ const x = u[d], w = y[d];
1212
+ if (x !== w)
1213
+ if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
1214
+ e.value !== w && (e.value = w ?? "");
1197
1215
  else if (d === "checked" && e instanceof HTMLInputElement)
1198
- e.checked = !!b;
1199
- else if (d.startsWith("on") && typeof b == "function") {
1200
- const c = it(d);
1201
- typeof v == "function" && se.removeListener(e, c, v), se.addListener(e, c, b);
1202
- } else if (b == null)
1216
+ e.checked = !!w;
1217
+ else if (d.startsWith("on") && typeof w == "function") {
1218
+ const c = ot(d);
1219
+ typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
1220
+ } else if (w == null)
1203
1221
  e.removeAttribute(d);
1204
- else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
1222
+ else if ((n?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
1205
1223
  try {
1206
- e[d] = b;
1224
+ e[d] = w;
1207
1225
  } catch {
1208
1226
  }
1209
1227
  else
1210
- b === !1 && e.removeAttribute(d);
1228
+ w === !1 && e.removeAttribute(d);
1211
1229
  }
1212
- for (const [d, v] of Object.entries(
1230
+ for (const [d, x] of Object.entries(
1213
1231
  s.listeners || {}
1214
1232
  ))
1215
- se.addListener(e, d, v);
1233
+ oe.addListener(e, d, x);
1216
1234
  const h = t.attrs ?? {}, l = a;
1217
1235
  for (const d in { ...h, ...l }) {
1218
- const v = h[d], b = l[d];
1219
- let c = v, p = b;
1220
- if (v && typeof v == "object" && v.constructor?.name === "ReactiveState" && (c = v.value), b && typeof b == "object" && b.constructor?.name === "ReactiveState" && (p = b.value), c !== p)
1221
- if (w = !0, p == null || p === !1) {
1236
+ const x = h[d], w = l[d];
1237
+ let c = x, p = w;
1238
+ if (ee(x) && (c = x.value), ee(w) && (p = w.value), c !== p)
1239
+ if (b = !0, p == null || p === !1) {
1222
1240
  if (e.removeAttribute(d), d === "value") {
1223
1241
  if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
1224
1242
  try {
@@ -1280,15 +1298,15 @@ function Fe(e, t, r, n) {
1280
1298
  e.setAttribute(d, String(p));
1281
1299
  continue;
1282
1300
  }
1283
- const y = e.namespaceURI === "http://www.w3.org/2000/svg";
1284
- if (g && !y && d.includes("-")) {
1285
- const C = rt(d);
1301
+ const m = e.namespaceURI === "http://www.w3.org/2000/svg";
1302
+ if (g && !m && d.includes("-")) {
1303
+ const C = it(d);
1286
1304
  try {
1287
1305
  e[C] = p;
1288
1306
  } catch {
1289
1307
  e.setAttribute(d, String(p));
1290
1308
  }
1291
- } else if (!y && d in e)
1309
+ } else if (!m && d in e)
1292
1310
  try {
1293
1311
  e[d] = p;
1294
1312
  } catch {
@@ -1298,7 +1316,7 @@ function Fe(e, t, r, n) {
1298
1316
  e.setAttribute(d, String(p));
1299
1317
  }
1300
1318
  }
1301
- if (g && w)
1319
+ if (g && b)
1302
1320
  try {
1303
1321
  if (typeof e._applyProps == "function")
1304
1322
  try {
@@ -1309,7 +1327,7 @@ function Fe(e, t, r, n) {
1309
1327
  } catch {
1310
1328
  }
1311
1329
  }
1312
- function X(e, t, r) {
1330
+ function X(e, t, n) {
1313
1331
  if (typeof e == "string")
1314
1332
  return document.createTextNode(e);
1315
1333
  if (e.tag === "#text") {
@@ -1319,80 +1337,80 @@ function X(e, t, r) {
1319
1337
  return e.key != null && (h.key = e.key), h;
1320
1338
  }
1321
1339
  if (e.tag === "#anchor") {
1322
- const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), v = document.createTextNode("");
1323
- h.key != null && (d.key = `${h.key}:start`, v.key = `${h.key}:end`), h._startNode = d, h._endNode = v;
1324
- const b = document.createDocumentFragment();
1325
- b.appendChild(d);
1340
+ const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), x = document.createTextNode("");
1341
+ h.key != null && (d.key = `${h.key}:start`, x.key = `${h.key}:end`), h._startNode = d, h._endNode = x;
1342
+ const w = document.createDocumentFragment();
1343
+ w.appendChild(d);
1326
1344
  for (const c of l) {
1327
1345
  const p = X(c, t);
1328
- b.appendChild(p);
1346
+ w.appendChild(p);
1329
1347
  }
1330
- return b.appendChild(v), b;
1348
+ return w.appendChild(x), w;
1331
1349
  }
1332
- const n = document.createElement(e.tag);
1333
- e.key != null && (n.key = e.key);
1334
- const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = st(o, t, n, s), u = {
1350
+ const r = document.createElement(e.tag);
1351
+ e.key != null && (r.key = e.key);
1352
+ const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, r, s), u = {
1335
1353
  ...i,
1336
1354
  ...a.props
1337
- }, m = {
1355
+ }, y = {
1338
1356
  ...s,
1339
1357
  ...a.attrs
1340
- }, g = n.namespaceURI === "http://www.w3.org/2000/svg";
1341
- for (const h in m) {
1342
- const l = m[h];
1358
+ }, g = r.namespaceURI === "http://www.w3.org/2000/svg";
1359
+ for (const h in y) {
1360
+ const l = y[h];
1343
1361
  if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
1344
1362
  if (typeof l == "boolean")
1345
- l && n.setAttribute(h, "");
1363
+ l && r.setAttribute(h, "");
1346
1364
  else if (l != null)
1347
- if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
1365
+ if (!g && h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement || r instanceof HTMLProgressElement))
1348
1366
  try {
1349
- n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
1367
+ r instanceof HTMLProgressElement ? r.value = Number(l) : r.value = l ?? "";
1350
1368
  } catch {
1351
- n.setAttribute(h, String(l));
1369
+ r.setAttribute(h, String(l));
1352
1370
  }
1353
- else if (!g && h === "checked" && n instanceof HTMLInputElement)
1371
+ else if (!g && h === "checked" && r instanceof HTMLInputElement)
1354
1372
  try {
1355
- n.checked = !!l;
1373
+ r.checked = !!l;
1356
1374
  } catch {
1357
- n.setAttribute(h, String(l));
1375
+ r.setAttribute(h, String(l));
1358
1376
  }
1359
- else if (!g && h in n)
1377
+ else if (!g && h in r)
1360
1378
  try {
1361
- n[h] = l;
1379
+ r[h] = l;
1362
1380
  } catch {
1363
- n.setAttribute(h, String(l));
1381
+ r.setAttribute(h, String(l));
1364
1382
  }
1365
1383
  else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
1366
- const v = rt(h);
1384
+ const x = it(h);
1367
1385
  try {
1368
- n[v] = l;
1386
+ r[x] = l;
1369
1387
  } catch {
1370
- n.setAttribute(h, String(l));
1388
+ r.setAttribute(h, String(l));
1371
1389
  }
1372
1390
  } else
1373
- n.setAttribute(h, String(l));
1391
+ r.setAttribute(h, String(l));
1374
1392
  }
1375
1393
  }
1376
1394
  for (const h in u) {
1377
1395
  const l = u[h];
1378
1396
  if (!(typeof h != "string" || /\[object Object\]/.test(h)))
1379
- if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
1397
+ if (h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement)) {
1380
1398
  const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1381
- n.value = d ?? "";
1382
- } else if (h === "checked" && n instanceof HTMLInputElement) {
1399
+ r.value = d ?? "";
1400
+ } else if (h === "checked" && r instanceof HTMLInputElement) {
1383
1401
  const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1384
- n.checked = !!d;
1402
+ r.checked = !!d;
1385
1403
  } else if (h.startsWith("on") && typeof l == "function")
1386
- se.addListener(n, it(h), l);
1404
+ oe.addListener(r, ot(h), l);
1387
1405
  else {
1388
1406
  if (h.startsWith("on") && l === void 0)
1389
1407
  continue;
1390
1408
  if (l == null || l === !1)
1391
- n.removeAttribute(h);
1392
- else if ((e.props?.isCustomElement ?? !1) || h in n)
1409
+ r.removeAttribute(h);
1410
+ else if ((e.props?.isCustomElement ?? !1) || h in r)
1393
1411
  try {
1394
- const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1395
- n[h] = v;
1412
+ const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
+ r[h] = x;
1396
1414
  } catch {
1397
1415
  }
1398
1416
  }
@@ -1400,44 +1418,44 @@ function X(e, t, r) {
1400
1418
  for (const [h, l] of Object.entries(
1401
1419
  a.listeners || {}
1402
1420
  ))
1403
- se.addListener(n, h, l);
1404
- const w = {
1421
+ oe.addListener(r, h, l);
1422
+ const b = {
1405
1423
  ...e,
1406
1424
  props: {
1407
1425
  ...e.props,
1408
1426
  ...a.props
1409
1427
  }
1410
1428
  };
1411
- de(w, n, r);
1429
+ he(b, r, n);
1412
1430
  try {
1413
- if (typeof n._applyProps == "function")
1431
+ if (typeof r._applyProps == "function")
1414
1432
  try {
1415
- n._applyProps(n._cfg);
1433
+ r._applyProps(r._cfg);
1416
1434
  } catch {
1417
1435
  }
1418
- typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
1436
+ typeof r.requestRender == "function" ? r.requestRender() : typeof r._render == "function" && r._render(r._cfg);
1419
1437
  } catch {
1420
1438
  }
1421
1439
  if (Array.isArray(e.children))
1422
1440
  for (const h of e.children)
1423
- n.appendChild(X(h, t, r));
1424
- else typeof e.children == "string" && (n.textContent = e.children);
1441
+ r.appendChild(X(h, t, n));
1442
+ else typeof e.children == "string" && (r.textContent = e.children);
1425
1443
  try {
1426
- if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
1444
+ if (r instanceof HTMLSelectElement && y && y.hasOwnProperty("value"))
1427
1445
  try {
1428
- n.value = m.value ?? "";
1446
+ r.value = y.value ?? "";
1429
1447
  } catch {
1430
1448
  }
1431
1449
  } catch {
1432
1450
  }
1433
- return n;
1451
+ return r;
1434
1452
  }
1435
- function At(e, t, r, n, i) {
1436
- if (typeof r == "string") {
1437
- e.textContent !== r && (e.textContent = r);
1453
+ function Rt(e, t, n, r, i) {
1454
+ if (typeof n == "string") {
1455
+ e.textContent !== n && (e.textContent = n);
1438
1456
  return;
1439
1457
  }
1440
- if (!Array.isArray(r)) return;
1458
+ if (!Array.isArray(n)) return;
1441
1459
  const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
1442
1460
  for (const l of o)
1443
1461
  l && l.key != null && a.set(l.key, l);
@@ -1446,199 +1464,199 @@ function At(e, t, r, n, i) {
1446
1464
  const d = l.key;
1447
1465
  d != null && u.set(d, l);
1448
1466
  }
1449
- const m = /* @__PURE__ */ new Set();
1467
+ const y = /* @__PURE__ */ new Set();
1450
1468
  let g = e.firstChild;
1451
- function w(l, d) {
1452
- let v = l;
1453
- for (; v && (m.add(v), v !== d); )
1454
- v = v.nextSibling;
1469
+ function b(l, d) {
1470
+ let x = l;
1471
+ for (; x && (y.add(x), x !== d); )
1472
+ x = x.nextSibling;
1455
1473
  }
1456
- function h(l, d, v, b) {
1474
+ function h(l, d, x, w) {
1457
1475
  const c = [];
1458
1476
  let p = l.nextSibling;
1459
1477
  for (; p && p !== d; )
1460
1478
  c.push(p), p = p.nextSibling;
1461
- const y = Array.isArray(v) ? v : [];
1462
- if (b.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
1479
+ const m = Array.isArray(x) ? x : [];
1480
+ if (w.some((k) => k && k.key != null) || m.some((k) => k && k.key != null)) {
1463
1481
  const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1464
- for (const _ of y)
1482
+ for (const _ of m)
1465
1483
  _ && _.key != null && k.set(_.key, _);
1466
1484
  for (const _ of c) {
1467
- const S = _.key;
1468
- S != null && f.set(S, _);
1485
+ const $ = _.key;
1486
+ $ != null && f.set($, _);
1469
1487
  }
1470
- const x = /* @__PURE__ */ new Set();
1488
+ const v = /* @__PURE__ */ new Set();
1471
1489
  let A = l.nextSibling;
1472
- for (const _ of b) {
1473
- let S;
1490
+ for (const _ of w) {
1491
+ let $;
1474
1492
  if (_.key != null && f.has(_.key)) {
1475
- const R = k.get(_.key);
1476
- S = _e(
1493
+ const T = k.get(_.key);
1494
+ $ = $e(
1477
1495
  f.get(_.key),
1478
- R,
1496
+ T,
1479
1497
  _,
1480
- n
1481
- ), x.add(S), S !== A && e.contains(S) && e.insertBefore(S, A);
1498
+ r
1499
+ ), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
1482
1500
  } else
1483
- S = X(_, n), e.insertBefore(S, A), x.add(S);
1484
- A = S.nextSibling;
1501
+ $ = X(_, r), e.insertBefore($, A), v.add($);
1502
+ A = $.nextSibling;
1485
1503
  }
1486
1504
  for (const _ of c)
1487
- !x.has(_) && e.contains(_) && e.removeChild(_);
1505
+ !v.has(_) && e.contains(_) && e.removeChild(_);
1488
1506
  } else {
1489
1507
  const k = Math.min(
1490
- y.length,
1491
- b.length
1508
+ m.length,
1509
+ w.length
1492
1510
  );
1493
1511
  for (let f = 0; f < k; f++) {
1494
- const x = y[f], A = b[f], _ = _e(c[f], x, A, n);
1512
+ const v = m[f], A = w[f], _ = $e(c[f], v, A, r);
1495
1513
  _ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
1496
1514
  }
1497
- for (let f = k; f < b.length; f++)
1498
- e.insertBefore(X(b[f], n), d);
1515
+ for (let f = k; f < w.length; f++)
1516
+ e.insertBefore(X(w[f], r), d);
1499
1517
  for (let f = k; f < c.length; f++)
1500
1518
  e.removeChild(c[f]);
1501
1519
  }
1502
1520
  }
1503
- for (const l of r) {
1521
+ for (const l of n) {
1504
1522
  let d;
1505
1523
  if (l.tag === "#anchor") {
1506
- const v = l.key, b = `${v}:start`, c = `${v}:end`;
1507
- let p = u.get(b), y = u.get(c);
1524
+ const x = l.key, w = `${x}:start`, c = `${x}:end`;
1525
+ let p = u.get(w), m = u.get(c);
1508
1526
  const C = Array.isArray(l.children) ? l.children : [];
1509
- if (p || (p = document.createTextNode(""), p.key = b), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
1527
+ if (p || (p = document.createTextNode(""), p.key = w), m || (m = document.createTextNode(""), m.key = c), l._startNode = p, l._endNode = m, !e.contains(p) || !e.contains(m)) {
1510
1528
  e.insertBefore(p, g);
1511
1529
  for (const k of C)
1512
- e.insertBefore(X(k, n), g);
1513
- e.insertBefore(y, g);
1530
+ e.insertBefore(X(k, r), g);
1531
+ e.insertBefore(m, g);
1514
1532
  } else
1515
1533
  h(
1516
1534
  p,
1517
- y,
1518
- a.get(v)?.children,
1535
+ m,
1536
+ a.get(x)?.children,
1519
1537
  C
1520
1538
  );
1521
- w(p, y), g = y.nextSibling;
1539
+ b(p, m), g = m.nextSibling;
1522
1540
  continue;
1523
1541
  }
1524
1542
  if (l.key != null && u.has(l.key)) {
1525
- const v = a.get(l.key);
1526
- d = _e(
1543
+ const x = a.get(l.key);
1544
+ d = $e(
1527
1545
  u.get(l.key),
1528
- v,
1546
+ x,
1529
1547
  l,
1530
- n,
1548
+ r,
1531
1549
  i
1532
- ), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
1550
+ ), y.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
1533
1551
  } else
1534
- d = X(l, n, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
1552
+ d = X(l, r, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), y.add(d);
1535
1553
  g = d.nextSibling;
1536
1554
  }
1537
1555
  for (const l of s)
1538
- !m.has(l) && e.contains(l) && (ce(l, i), e.removeChild(l));
1556
+ !y.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
1539
1557
  }
1540
- function _e(e, t, r, n, i) {
1541
- if (t && typeof t != "string" && t.props?.ref && i && ce(e, i), t === r) return e;
1542
- if (typeof r == "string") {
1558
+ function $e(e, t, n, r, i) {
1559
+ if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === n) return e;
1560
+ if (typeof n == "string") {
1543
1561
  if (e.nodeType === Node.TEXT_NODE)
1544
- return e.textContent !== r && (e.textContent = r), e;
1562
+ return e.textContent !== n && (e.textContent = n), e;
1545
1563
  {
1546
- const o = document.createTextNode(r);
1564
+ const o = document.createTextNode(n);
1547
1565
  return e.parentNode?.replaceChild(o, e), o;
1548
1566
  }
1549
1567
  }
1550
- if (r && typeof r != "string" && r.tag === "#anchor") {
1551
- const o = r, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
1552
- o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
1568
+ if (n && typeof n != "string" && n.tag === "#anchor") {
1569
+ const o = n, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), y = o._endNode ?? document.createTextNode("");
1570
+ o.key != null && (u.key = `${o.key}:start`, y.key = `${o.key}:end`), o._startNode = u, o._endNode = y;
1553
1571
  const g = document.createDocumentFragment();
1554
1572
  g.appendChild(u);
1555
- for (const w of a) {
1556
- const h = X(w, n);
1573
+ for (const b of a) {
1574
+ const h = X(b, r);
1557
1575
  g.appendChild(h);
1558
1576
  }
1559
- return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
1577
+ return g.appendChild(y), e.parentNode?.replaceChild(g, e), u;
1560
1578
  }
1561
- if (!r) {
1562
- ce(e, i);
1579
+ if (!n) {
1580
+ ue(e, i);
1563
1581
  const o = document.createComment("removed");
1564
1582
  return e.parentNode?.replaceChild(o, e), o;
1565
1583
  }
1566
1584
  if (!t || typeof t == "string") {
1567
- ce(e, i);
1568
- const o = X(r, n, i);
1569
- return de(r, o, i), e.parentNode?.replaceChild(o, e), o;
1570
- }
1571
- if (r.tag === "#anchor") {
1572
- const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
1573
- r.key != null && (a.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = a, r._endNode = u;
1574
- const m = document.createDocumentFragment();
1575
- m.appendChild(a);
1585
+ ue(e, i);
1586
+ const o = X(n, r, i);
1587
+ return he(n, o, i), e.parentNode?.replaceChild(o, e), o;
1588
+ }
1589
+ if (n.tag === "#anchor") {
1590
+ const o = Array.isArray(n.children) ? n.children : [], a = n._startNode ?? document.createTextNode(""), u = n._endNode ?? document.createTextNode("");
1591
+ n.key != null && (a.key = `${n.key}:start`, u.key = `${n.key}:end`), n._startNode = a, n._endNode = u;
1592
+ const y = document.createDocumentFragment();
1593
+ y.appendChild(a);
1576
1594
  for (const g of o)
1577
- m.appendChild(X(g, n));
1578
- return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
1595
+ y.appendChild(X(g, r));
1596
+ return y.appendChild(u), e.parentNode?.replaceChild(y, e), a;
1579
1597
  }
1580
- if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
1598
+ if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
1581
1599
  const o = e;
1582
- return Fe(o, t.props || {}, r.props || {}, n), At(o, t.children, r.children, n, i), de(r, o, i), o;
1600
+ return Ve(o, t.props || {}, n.props || {}, r), Rt(o, t.children, n.children, r, i), he(n, o, i), o;
1583
1601
  }
1584
- if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
1602
+ if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && (t.tag && String(t.tag).includes("-") || n.props && n.props.isCustomElement || t.props && t.props.isCustomElement))
1585
1603
  try {
1586
1604
  const a = e;
1587
- return Fe(a, t.props || {}, r.props || {}, n), de(r, a, i), a;
1605
+ return Ve(a, t.props || {}, n.props || {}, r), he(n, a, i), a;
1588
1606
  } catch {
1589
1607
  }
1590
- ce(e, i);
1591
- const s = X(r, n, i);
1592
- return de(r, s, i), e.parentNode?.replaceChild(s, e), s;
1608
+ ue(e, i);
1609
+ const s = X(n, r, i);
1610
+ return he(n, s, i), e.parentNode?.replaceChild(s, e), s;
1593
1611
  }
1594
- function Rt(e, t, r, n) {
1612
+ function Ot(e, t, n, r) {
1595
1613
  let i;
1596
1614
  Array.isArray(t) ? t.length === 1 ? (i = t[0], i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })) : i = { tag: "div", key: "__root__", children: t } : (i = t, i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })), i && typeof i == "object" && i.tag === "#anchor" && (i = {
1597
1615
  tag: "div",
1598
1616
  key: "__anchor_root__",
1599
1617
  props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
1600
1618
  children: [i]
1601
- }), i = Ie(i, String(i.key ?? "root"));
1619
+ }), i = Be(i, String(i.key ?? "root"));
1602
1620
  const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
1603
1621
  let a;
1604
- s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = _e(o, s, i, r, n) : (a = X(i, r, n), e.replaceChild(a, o)) : (a = X(i, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
1622
+ s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, n, r) : (a = X(i, n, r), e.replaceChild(a, o)) : (a = X(i, n, r), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
1605
1623
  const u = [];
1606
- for (let m = 0; m < e.childNodes.length; m++) {
1607
- const g = e.childNodes[m];
1608
- g !== a && g.nodeName !== "STYLE" && (ce(g, n), u.push(g));
1624
+ for (let y = 0; y < e.childNodes.length; y++) {
1625
+ const g = e.childNodes[y];
1626
+ g !== a && g.nodeName !== "STYLE" && (ue(g, r), u.push(g));
1609
1627
  }
1610
- u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
1628
+ u.forEach((y) => e.removeChild(y)), e._prevVNode = i, e._prevDom = a;
1611
1629
  }
1612
- function Te(e) {
1613
- if (typeof e == "string") return ne(e);
1630
+ function Pe(e) {
1631
+ if (typeof e == "string") return ie(e);
1614
1632
  if (e.tag === "#text")
1615
- return typeof e.children == "string" ? ne(e.children) : "";
1633
+ return typeof e.children == "string" ? ie(e.children) : "";
1616
1634
  if (e.tag === "#anchor")
1617
- return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Te).join("");
1635
+ return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
1618
1636
  let t = "";
1619
- e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ne(String(s))}"`).join(""));
1620
- let r = "";
1621
- e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ne(String(s))}"`).join(""));
1622
- const n = Array.isArray(e.children) ? e.children.filter(Boolean).map(Te).join("") : typeof e.children == "string" ? ne(e.children) : e.children ? Te(e.children) : "";
1623
- return `<${e.tag}${t}${r}>${n}</${e.tag}>`;
1624
- }
1625
- function Tt(e, ...t) {
1626
- let r = "";
1627
- for (let n = 0; n < e.length; n++)
1628
- r += e[n], n < t.length && (r += t[n]);
1629
- return r;
1637
+ e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
1638
+ let n = "";
1639
+ e.props && (n = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
1640
+ const r = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? ie(e.children) : e.children ? Pe(e.children) : "";
1641
+ return `<${e.tag}${t}${n}>${r}</${e.tag}>`;
1642
+ }
1643
+ function Pt(e, ...t) {
1644
+ let n = "";
1645
+ for (let r = 0; r < e.length; r++)
1646
+ n += e[r], r < t.length && (n += t[r]);
1647
+ return n;
1630
1648
  }
1631
- function ot(e) {
1649
+ function ct(e) {
1632
1650
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
1633
1651
  }
1634
- let xe = null;
1635
- function Ke() {
1636
- return xe || (xe = new CSSStyleSheet(), xe.replaceSync(ot(Pt))), xe;
1652
+ let Ce = null;
1653
+ function Je() {
1654
+ return Ce || (Ce = new CSSStyleSheet(), Ce.replaceSync(ct(Mt))), Ce;
1637
1655
  }
1638
- function Ot(e) {
1656
+ function Lt(e) {
1639
1657
  return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
1640
1658
  }
1641
- const Pt = Tt`
1659
+ const Mt = Pt`
1642
1660
  :host, *, ::before, ::after {
1643
1661
  all: isolate;
1644
1662
  box-sizing: border-box;
@@ -1696,7 +1714,7 @@ const Pt = Tt`
1696
1714
  sup { top: -.5em }
1697
1715
  [disabled], [aria-disabled=true] { cursor: not-allowed }
1698
1716
  [hidden] { display: none }
1699
- `, Lt = {
1717
+ `, jt = {
1700
1718
  neutral: {
1701
1719
  50: "#fafafa",
1702
1720
  100: "#f4f4f5",
@@ -1792,17 +1810,55 @@ const Pt = Tt`
1792
1810
  black: { DEFAULT: "#000000" },
1793
1811
  transparent: { DEFAULT: "transparent" },
1794
1812
  current: { DEFAULT: "currentColor" }
1795
- }, jt = Object.fromEntries(
1796
- Object.entries(Lt).map(([e, t]) => [
1813
+ }, Nt = Object.fromEntries(
1814
+ Object.entries(jt).map(([e, t]) => [
1797
1815
  e,
1798
1816
  Object.fromEntries(
1799
- Object.entries(t).map(([r, n]) => [
1800
- r,
1801
- `var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
1817
+ Object.entries(t).map(([n, r]) => [
1818
+ n,
1819
+ `var(--color-${e}${n === "DEFAULT" ? "" : `-${n}`}, ${r})`
1802
1820
  ])
1803
1821
  )
1804
1822
  ])
1805
- ), Oe = {
1823
+ ), le = "0.25rem", Wt = {
1824
+ // Tailwind container widths
1825
+ // 3xs: 16rem => 16 / 0.25 = 64
1826
+ "3xs": 64,
1827
+ // 2xs: 18rem => 72
1828
+ "2xs": 72,
1829
+ // xs: 20rem => 80
1830
+ xs: 80,
1831
+ // sm: 24rem => 96
1832
+ sm: 96,
1833
+ // md: 28rem => 112
1834
+ md: 112,
1835
+ // lg: 32rem => 128
1836
+ lg: 128,
1837
+ // xl: 36rem => 144
1838
+ xl: 144,
1839
+ // 2xl: 42rem => 168
1840
+ "2xl": 168,
1841
+ // 3xl: 48rem => 192
1842
+ "3xl": 192,
1843
+ // 4xl: 56rem => 224
1844
+ "4xl": 224,
1845
+ // 5xl: 64rem => 256
1846
+ "5xl": 256,
1847
+ // 6xl: 72rem => 288
1848
+ "6xl": 288,
1849
+ // 7xl: 80rem => 320
1850
+ "7xl": 320
1851
+ }, zt = () => {
1852
+ const e = {};
1853
+ for (const [t, n] of Object.entries(Wt))
1854
+ e[`max-w-${t}`] = `max-width:calc(${le} * ${n});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${n});`, e[`w-${t}`] = `width:calc(${le} * ${n});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${n});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${n});`, e[`h-${t}`] = `height:calc(${le} * ${n});`;
1855
+ return e;
1856
+ }, Dt = () => {
1857
+ const e = {};
1858
+ for (const t of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
1859
+ e[`grid-cols-${t}`] = `grid-template-columns:repeat(${t},minmax(0,1fr));`, e[`grid-rows-${t}`] = `grid-template-rows:repeat(${t},minmax(0,1fr));`, e[`col-span-${t}`] = `grid-column:span ${t} / span ${t};`, e[`row-span-${t}`] = `grid-row:span ${t} / span ${t};`;
1860
+ return e;
1861
+ }, Le = {
1806
1862
  /* Display */
1807
1863
  block: "display:block;",
1808
1864
  inline: "display:inline;",
@@ -1818,8 +1874,11 @@ const Pt = Tt`
1818
1874
  "h-screen": "height:100dvw;",
1819
1875
  "max-w-full": "max-width:100%;",
1820
1876
  "max-h-full": "max-height:100%;",
1877
+ "max-w-screen": "max-width:100dvw;",
1878
+ "max-h-screen": "max-height:100dvh;",
1821
1879
  "min-w-0": "min-width:0;",
1822
1880
  "min-h-0": "min-height:0;",
1881
+ ...zt(),
1823
1882
  "m-auto": "margin:auto;",
1824
1883
  "mx-auto": "margin-inline:auto;",
1825
1884
  "my-auto": "margin-block:auto;",
@@ -1834,55 +1893,8 @@ const Pt = Tt`
1834
1893
  /* Accessibility */
1835
1894
  "sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
1836
1895
  "not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
1837
- /* Grid Layout */
1838
- "grid-cols-1": "grid-template-columns:repeat(1,minmax(0,1fr));",
1839
- "grid-cols-2": "grid-template-columns:repeat(2,minmax(0,1fr));",
1840
- "grid-cols-3": "grid-template-columns:repeat(3,minmax(0,1fr));",
1841
- "grid-cols-4": "grid-template-columns:repeat(4,minmax(0,1fr));",
1842
- "grid-cols-5": "grid-template-columns:repeat(5,minmax(0,1fr));",
1843
- "grid-cols-6": "grid-template-columns:repeat(6,minmax(0,1fr));",
1844
- "grid-cols-7": "grid-template-columns:repeat(7,minmax(0,1fr));",
1845
- "grid-cols-8": "grid-template-columns:repeat(8,minmax(0,1fr));",
1846
- "grid-cols-9": "grid-template-columns:repeat(9,minmax(0,1fr));",
1847
- "grid-cols-10": "grid-template-columns:repeat(10,minmax(0,1fr));",
1848
- "grid-cols-11": "grid-template-columns:repeat(11,minmax(0,1fr));",
1849
- "grid-cols-12": "grid-template-columns:repeat(12,minmax(0,1fr));",
1850
- "grid-rows-1": "grid-template-rows:repeat(1,minmax(0,1fr));",
1851
- "grid-rows-2": "grid-template-rows:repeat(2,minmax(0,1fr));",
1852
- "grid-rows-3": "grid-template-rows:repeat(3,minmax(0,1fr));",
1853
- "grid-rows-4": "grid-template-rows:repeat(4,minmax(0,1fr));",
1854
- "grid-rows-5": "grid-template-rows:repeat(5,minmax(0,1fr));",
1855
- "grid-rows-6": "grid-template-rows:repeat(6,minmax(0,1fr));",
1856
- "grid-rows-7": "grid-template-rows:repeat(7,minmax(0,1fr));",
1857
- "grid-rows-8": "grid-template-rows:repeat(8,minmax(0,1fr));",
1858
- "grid-rows-9": "grid-template-rows:repeat(9,minmax(0,1fr));",
1859
- "grid-rows-10": "grid-template-rows:repeat(10,minmax(0,1fr));",
1860
- "grid-rows-11": "grid-template-rows:repeat(11,minmax(0,1fr));",
1861
- "grid-rows-12": "grid-template-rows:repeat(12,minmax(0,1fr));",
1862
- /* Grid Placement */
1863
- "col-span-1": "grid-column:span 1 / span 1;",
1864
- "col-span-2": "grid-column:span 2 / span 2;",
1865
- "col-span-3": "grid-column:span 3 / span 3;",
1866
- "col-span-4": "grid-column:span 4 / span 4;",
1867
- "col-span-5": "grid-column:span 5 / span 5;",
1868
- "col-span-6": "grid-column:span 6 / span 6;",
1869
- "col-span-7": "grid-column:span 7 / span 7;",
1870
- "col-span-8": "grid-column:span 8 / span 8;",
1871
- "col-span-9": "grid-column:span 9 / span 9;",
1872
- "col-span-10": "grid-column:span 10 / span 10;",
1873
- "col-span-11": "grid-column:span 11 / span 11;",
1874
- "col-span-12": "grid-column:span 12 / span 12;",
1875
- "row-span-1": "grid-row:span 1 / span 1;",
1876
- "row-span-2": "grid-row:span 2 / span 2;",
1877
- "row-span-3": "grid-row:span 3 / span 3;",
1878
- "row-span-4": "grid-row:span 4 / span 4;",
1879
- "row-span-6": "grid-row:span 6 / span 6;",
1880
- "row-span-7": "grid-row:span 7 / span 7;",
1881
- "row-span-8": "grid-row:span 8 / span 8;",
1882
- "row-span-9": "grid-row:span 9 / span 9;",
1883
- "row-span-10": "grid-row:span 10 / span 10;",
1884
- "row-span-11": "grid-row:span 11 / span 11;",
1885
- "row-span-12": "grid-row:span 12 / span 12;",
1896
+ /* Grid Layout & Placement */
1897
+ ...Dt(),
1886
1898
  /* Positioning */
1887
1899
  absolute: "position:absolute;",
1888
1900
  relative: "position:relative;",
@@ -2017,7 +2029,7 @@ const Pt = Tt`
2017
2029
  "z-30": "z-index:30;",
2018
2030
  "z-40": "z-index:40;",
2019
2031
  "z-50": "z-index:50;"
2020
- }, Mt = "0.25rem", Ve = {
2032
+ }, Ze = {
2021
2033
  m: ["margin"],
2022
2034
  mx: ["margin-inline"],
2023
2035
  my: ["margin-block"],
@@ -2050,19 +2062,19 @@ const Pt = Tt`
2050
2062
  "gap-y": ["row-gap"]
2051
2063
  };
2052
2064
  function G(e, t) {
2053
- let r = 0, n = 0;
2065
+ let n = 0, r = 0;
2054
2066
  for (let i = 0; i < e.length; i++) {
2055
2067
  const s = e[i];
2056
- if (s === "[") r++;
2057
- else if (s === "]" && r > 0) r--;
2058
- else if (s === "(") n++;
2059
- else if (s === ")" && n > 0) n--;
2060
- else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
2068
+ if (s === "[") n++;
2069
+ else if (s === "]" && n > 0) n--;
2070
+ else if (s === "(") r++;
2071
+ else if (s === ")" && r > 0) r--;
2072
+ else if (n === 0 && r === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
2061
2073
  return e.slice(0, i) + t + e.slice(i);
2062
2074
  }
2063
2075
  return e + t;
2064
2076
  }
2065
- const Nt = {
2077
+ const It = {
2066
2078
  before: (e, t) => `${e}::before{${t}}`,
2067
2079
  after: (e, t) => `${e}::after{${t}}`,
2068
2080
  hover: (e, t) => `${G(e, ":hover")}{${t}}`,
@@ -2085,7 +2097,7 @@ const Nt = {
2085
2097
  "peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
2086
2098
  "peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
2087
2099
  "peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
2088
- }, Pe = {
2100
+ }, Me = {
2089
2101
  // Responsive
2090
2102
  sm: "(min-width:640px)",
2091
2103
  md: "(min-width:768px)",
@@ -2094,25 +2106,25 @@ const Nt = {
2094
2106
  "2xl": "(min-width:1536px)",
2095
2107
  // Dark mode (now plain string)
2096
2108
  dark: "(prefers-color-scheme: dark)"
2097
- }, Le = ["sm", "md", "lg", "xl", "2xl"];
2098
- function je(e) {
2099
- const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
2100
- if (n.length < 2) return null;
2101
- const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
2102
- if (Number.isNaN(o) || !Ve[i]) return null;
2109
+ }, je = ["sm", "md", "lg", "xl", "2xl"];
2110
+ function Ne(e) {
2111
+ const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
2112
+ if (r.length < 2) return null;
2113
+ const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
2114
+ if (Number.isNaN(o) || !Ze[i]) return null;
2103
2115
  const a = t ? "-" : "";
2104
- return Ve[i].map((u) => `${u}:calc(${a}${Mt} * ${o});`).join("");
2116
+ return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
2105
2117
  }
2106
- function Je(e) {
2107
- const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
2108
- return `${n} ${i} ${s}`;
2118
+ function Ge(e) {
2119
+ const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
2120
+ return `${r} ${i} ${s}`;
2109
2121
  }
2110
- function Wt(e) {
2122
+ function Ht(e) {
2111
2123
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
2112
2124
  if (!t) return null;
2113
- const [, r, n, i = "DEFAULT"] = t, s = jt[n]?.[i];
2125
+ const [, n, r, i = "DEFAULT"] = t, s = Nt[r]?.[i];
2114
2126
  if (!s) return null;
2115
- if (r === "shadow") return `--ce-shadow-color:${s};`;
2127
+ if (n === "shadow") return `--ce-shadow-color:${s};`;
2116
2128
  const a = {
2117
2129
  bg: "background-color",
2118
2130
  decoration: "text-decoration-color",
@@ -2123,44 +2135,44 @@ function Wt(e) {
2123
2135
  accent: "accent-color",
2124
2136
  fill: "fill",
2125
2137
  stroke: "stroke"
2126
- }[r];
2138
+ }[n];
2127
2139
  return a ? `${a}:${s};` : null;
2128
2140
  }
2129
- function zt(e) {
2130
- const [t, r] = e.split("/");
2131
- if (!r) return { base: t };
2132
- const n = parseInt(r, 10);
2133
- return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
2134
- }
2135
- function Me(e) {
2136
- const { base: t, opacity: r } = zt(e), n = Wt(t);
2137
- if (n) {
2138
- if (r !== void 0) {
2139
- const s = /#([0-9a-f]{6})/i.exec(n);
2141
+ function Bt(e) {
2142
+ const [t, n] = e.split("/");
2143
+ if (!n) return { base: t };
2144
+ const r = parseInt(n, 10);
2145
+ return isNaN(r) || r < 0 || r > 100 ? { base: t } : { base: t, opacity: r / 100 };
2146
+ }
2147
+ function We(e) {
2148
+ const { base: t, opacity: n } = Bt(e), r = Ht(t);
2149
+ if (r) {
2150
+ if (n !== void 0) {
2151
+ const s = /#([0-9a-f]{6})/i.exec(r);
2140
2152
  if (s) {
2141
- const o = Je(s[0]);
2142
- return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2153
+ const o = Ge(s[0]);
2154
+ return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2143
2155
  }
2144
2156
  }
2145
- return n;
2157
+ return r;
2146
2158
  }
2147
- const i = Ee(t);
2148
- if (i && r !== void 0) {
2159
+ const i = Se(t);
2160
+ if (i && n !== void 0) {
2149
2161
  const s = /#([0-9a-f]{6})/i.exec(i);
2150
2162
  if (s) {
2151
- const o = Je(s[0]);
2152
- return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2163
+ const o = Ge(s[0]);
2164
+ return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2153
2165
  }
2154
2166
  }
2155
2167
  return i;
2156
2168
  }
2157
- function Ne(e) {
2169
+ function ze(e) {
2158
2170
  const t = /^opacity-(\d{1,3})$/.exec(e);
2159
2171
  if (!t) return null;
2160
- const r = parseInt(t[1], 10);
2161
- return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
2172
+ const n = parseInt(t[1], 10);
2173
+ return n < 0 || n > 100 ? null : `opacity:${n / 100};`;
2162
2174
  }
2163
- function Ee(e) {
2175
+ function Se(e) {
2164
2176
  if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
2165
2177
  const i = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
2166
2178
  if (i) {
@@ -2170,9 +2182,9 @@ function Ee(e) {
2170
2182
  }
2171
2183
  return null;
2172
2184
  }
2173
- const t = e.indexOf("-["), r = e.endsWith("]");
2174
- if (t > 0 && r) {
2175
- const n = e.slice(0, t);
2185
+ const t = e.indexOf("-["), n = e.endsWith("]");
2186
+ if (t > 0 && n) {
2187
+ const r = e.slice(0, t);
2176
2188
  let i = e.slice(t + 2, -1);
2177
2189
  i = i.replace(/_/g, " ");
2178
2190
  const s = {
@@ -2197,6 +2209,8 @@ function Ee(e) {
2197
2209
  "border-r": "border-right",
2198
2210
  "border-x": "border-inline",
2199
2211
  "border-y": "border-block",
2212
+ "grid-cols": "grid-template-columns",
2213
+ "grid-rows": "grid-template-rows",
2200
2214
  transition: "transition-property",
2201
2215
  ease: "transition-timing-function",
2202
2216
  delay: "transition-delay",
@@ -2217,63 +2231,63 @@ function Ee(e) {
2217
2231
  leading: "line-height",
2218
2232
  z: "z-index"
2219
2233
  };
2220
- if (n === "rotate")
2234
+ if (r === "rotate")
2221
2235
  return `transform:rotate(${i});`;
2222
- const o = s[n] ?? n.replace(/_/g, "-");
2236
+ const o = s[r] ?? r.replace(/_/g, "-");
2223
2237
  if (o && i) return `${o}:${i};`;
2224
2238
  }
2225
2239
  return null;
2226
2240
  }
2227
- function Dt(e) {
2241
+ function Ut(e) {
2228
2242
  if (e.startsWith("[") && e.endsWith("]")) {
2229
- const r = e.slice(1, -1);
2230
- return r.includes("&") ? r : e;
2243
+ const n = e.slice(1, -1);
2244
+ return n.includes("&") ? n : e;
2231
2245
  }
2232
2246
  const t = e.indexOf("-[");
2233
2247
  if (t > 0 && e.endsWith("]")) {
2234
- const r = e.slice(t + 2, -1).replace(/_/g, "-");
2235
- return r.includes("&") ? r : e.replace(/_/g, "-");
2248
+ const n = e.slice(t + 2, -1).replace(/_/g, "-");
2249
+ return n.includes("&") ? n : e.replace(/_/g, "-");
2236
2250
  }
2237
2251
  return null;
2238
2252
  }
2239
- function It(e) {
2253
+ function qt(e) {
2240
2254
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
2241
2255
  }
2242
- function Ht(e) {
2243
- const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
2244
- let n;
2245
- for (; n = t.exec(e); ) {
2246
- const i = n[2].split(/\s+/).filter(Boolean);
2247
- i.length && r.push(...i);
2256
+ function Ft(e) {
2257
+ const t = /class\s*=\s*(['"])(.*?)\1/g, n = [];
2258
+ let r;
2259
+ for (; r = t.exec(e); ) {
2260
+ const i = r[2].split(/\s+/).filter(Boolean);
2261
+ i.length && n.push(...i);
2248
2262
  }
2249
- return r.filter(Boolean);
2263
+ return n.filter(Boolean);
2250
2264
  }
2251
- const Ze = /* @__PURE__ */ new Map(), Bt = 16;
2252
- function Ut(e) {
2253
- const t = Date.now(), r = Ze.get(e);
2254
- if (r && t - r.timestamp < Bt) return r.css;
2255
- const n = Ht(e), i = new Set(n), s = [], o = [], a = [], u = [], m = {};
2256
- function g(b, c = !1) {
2257
- const p = (c ? "dark|" : "") + b;
2258
- if (p in m) return m[p];
2259
- const y = d(b, c);
2260
- return m[p] = y, y;
2261
- }
2262
- function w(b) {
2263
- const c = b.some((y) => Le.includes(y)), p = b.includes("dark");
2264
- return b.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
2265
- }
2266
- function h(b) {
2265
+ const Xe = /* @__PURE__ */ new Map(), Kt = 16;
2266
+ function Vt(e) {
2267
+ const t = Date.now(), n = Xe.get(e);
2268
+ if (n && t - n.timestamp < Kt) return n.css;
2269
+ const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [], y = {};
2270
+ function g(w, c = !1) {
2271
+ const p = (c ? "dark|" : "") + w;
2272
+ if (p in y) return y[p];
2273
+ const m = d(w, c);
2274
+ return y[p] = m, m;
2275
+ }
2276
+ function b(w) {
2277
+ const c = w.some((m) => je.includes(m)), p = w.includes("dark");
2278
+ return w.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
2279
+ }
2280
+ function h(w) {
2267
2281
  const c = [];
2268
- let p = "", y = 0, C = 0;
2269
- for (let k = 0; k < b.length; k++) {
2270
- const f = b[k];
2271
- f === "[" ? y++ : f === "]" && y > 0 ? y-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && y === 0 && C === 0 ? (c.push(p), p = "") : p += f;
2282
+ let p = "", m = 0, C = 0;
2283
+ for (let k = 0; k < w.length; k++) {
2284
+ const f = w[k];
2285
+ f === "[" ? m++ : f === "]" && m > 0 ? m-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && m === 0 && C === 0 ? (c.push(p), p = "") : p += f;
2272
2286
  }
2273
2287
  return p && c.push(p), c;
2274
2288
  }
2275
- function l(b) {
2276
- switch (b) {
2289
+ function l(w) {
2290
+ switch (w) {
2277
2291
  case "hover":
2278
2292
  return ":hover";
2279
2293
  case "focus":
@@ -2302,126 +2316,126 @@ function Ut(e) {
2302
2316
  return null;
2303
2317
  }
2304
2318
  }
2305
- function d(b, c = !1) {
2306
- const p = h(b);
2307
- let y = !1;
2308
- const C = p.find((E) => (E.startsWith("!") && (y = !0, E = E.slice(1)), Oe[E] || je(E) || Ne(E) || Me(E) || Ee(E)));
2319
+ function d(w, c = !1) {
2320
+ const p = h(w);
2321
+ let m = !1;
2322
+ const C = p.find((E) => (E.startsWith("!") && (m = !0, E = E.slice(1)), Le[E] || Ne(E) || ze(E) || We(E) || Se(E)));
2309
2323
  if (!C) return null;
2310
- const k = C.replace(/^!/, ""), f = Oe[k] ?? je(k) ?? Ne(k) ?? Me(k) ?? Ee(k);
2324
+ const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
2311
2325
  if (!f) return null;
2312
- const x = p.indexOf(C);
2313
- let A = x >= 0 ? p.slice(0, x) : [];
2326
+ const v = p.indexOf(C);
2327
+ let A = v >= 0 ? p.slice(0, v) : [];
2314
2328
  c && (A = A.filter((E) => E !== "dark"));
2315
- const _ = `.${It(b)}`, S = "__SUBJECT__", R = y ? f.replace(/;$/, " !important;") : f;
2316
- let T = S;
2317
- const $ = [];
2329
+ const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = m ? f.replace(/;$/, " !important;") : f;
2330
+ let R = $;
2331
+ const S = [];
2318
2332
  for (const E of A)
2319
- E.startsWith("group-") ? (T = `.group:${E.slice(6)} ${T}`, $.push(E)) : E.startsWith("peer-") && (T = T.replace(S, `.peer:${E.slice(5)}~${S}`), $.push(E));
2320
- A = A.filter((E) => !$.includes(E));
2333
+ E.startsWith("group-") ? (R = `.group:${E.slice(6)} ${R}`, S.push(E)) : E.startsWith("peer-") && (R = R.replace($, `.peer:${E.slice(5)}~${$}`), S.push(E));
2334
+ A = A.filter((E) => !S.includes(E));
2321
2335
  const P = [], B = [];
2322
- let J = null;
2336
+ let V = null;
2323
2337
  for (const E of A) {
2324
- if (E === "dark" || Le.includes(E)) continue;
2325
- const U = Dt(E);
2338
+ if (E === "dark" || je.includes(E)) continue;
2339
+ const U = Ut(E);
2326
2340
  if (U) {
2327
- J = U;
2341
+ V = U;
2328
2342
  continue;
2329
2343
  }
2330
2344
  const D = l(E);
2331
2345
  if (D) {
2332
- J ? B.push(D) : P.push(D);
2346
+ V ? B.push(D) : P.push(D);
2333
2347
  continue;
2334
2348
  }
2335
- const z = Nt[E];
2336
- typeof z == "function" && (T = z(T, R).split("{")[0]);
2349
+ const W = It[E];
2350
+ typeof W == "function" && (R = W(R, T).split("{")[0]);
2337
2351
  }
2338
- function ye(E, U) {
2352
+ function we(E, U) {
2339
2353
  if (!U) return E;
2340
- let D = 0, z = 0;
2354
+ let D = 0, W = 0;
2341
2355
  if (E.length && (E[0] === ">" || E[0] === "+" || E[0] === "~" || E[0] === " ")) {
2342
2356
  let O = 1;
2343
2357
  for (; O < E.length && E[O] === " "; ) O++;
2344
2358
  for (; O < E.length; O++) {
2345
2359
  const I = E[O];
2346
- if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? z++ : I === ")" && z > 0 && z--, D === 0 && z === 0 && (E[O] === ">" || E[O] === "+" || E[O] === "~" || E[O] === " "))
2360
+ if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? W++ : I === ")" && W > 0 && W--, D === 0 && W === 0 && (E[O] === ">" || E[O] === "+" || E[O] === "~" || E[O] === " "))
2347
2361
  return E.slice(0, O) + U + E.slice(O);
2348
2362
  }
2349
2363
  return E + U;
2350
2364
  }
2351
2365
  for (let O = 0; O < E.length; O++) {
2352
2366
  const I = E[O];
2353
- if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? z++ : I === ")" && z > 0 && z--, D === 0 && z === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
2367
+ if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? W++ : I === ")" && W > 0 && W--, D === 0 && W === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
2354
2368
  return E.slice(0, O) + U + E.slice(O);
2355
2369
  }
2356
2370
  return E + U;
2357
2371
  }
2358
2372
  const K = P.join(""), L = B.join("");
2359
- if (J)
2360
- if (J.includes("&")) {
2361
- const E = J.indexOf("&"), U = J.slice(0, E), D = J.slice(E + 1), z = S + K, O = T;
2373
+ if (V)
2374
+ if (V.includes("&")) {
2375
+ const E = V.indexOf("&"), U = V.slice(0, E), D = V.slice(E + 1), W = $ + K, O = R;
2362
2376
  if (P.length === 0)
2363
- T = O.replace(S, U + z + L + D);
2377
+ R = O.replace($, U + W + L + D);
2364
2378
  else {
2365
- const I = ye(D, L);
2366
- T = O.replace(S, U + z + I);
2379
+ const I = we(D, L);
2380
+ R = O.replace($, U + W + I);
2367
2381
  }
2368
2382
  } else
2369
- T = T.replace(S, `${J}${S + K}`), L && (T = T.replace(S, `${S}${L}`));
2383
+ R = R.replace($, `${V}${$ + K}`), L && (R = R.replace($, `${$}${L}`));
2370
2384
  else
2371
- T = S + K + L;
2372
- T = T.replace(new RegExp(S, "g"), _);
2373
- let j = `${T}{${R}}`;
2374
- const V = A.filter((E) => Le.includes(E)), Z = V.length ? V[V.length - 1] : null, W = A.includes("dark");
2375
- return c && Z ? j = `@media (prefers-color-scheme: dark) and ${Pe[Z]}{${j}}` : c ? j = `@media (prefers-color-scheme: dark){${j}}` : W && Z ? j = `@media (prefers-color-scheme: dark) and ${Pe[Z]}{${j}}` : W ? j = `@media (prefers-color-scheme: dark){${j}}` : Z && (j = `@media ${Pe[Z]}{${j}}`), j;
2376
- }
2377
- for (const b of i) {
2378
- const c = h(b), p = c.find(
2379
- (f) => Oe[f] || je(f) || Ne(f) || Me(f) || Ee(f)
2385
+ R = $ + K + L;
2386
+ R = R.replace(new RegExp($, "g"), _);
2387
+ let M = `${R}{${T}}`;
2388
+ const J = A.filter((E) => je.includes(E)), Z = J.length ? J[J.length - 1] : null, z = A.includes("dark");
2389
+ return c && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : c ? M = `@media (prefers-color-scheme: dark){${M}}` : z && Z ? M = `@media (prefers-color-scheme: dark) and ${Me[Z]}{${M}}` : z ? M = `@media (prefers-color-scheme: dark){${M}}` : Z && (M = `@media ${Me[Z]}{${M}}`), M;
2390
+ }
2391
+ for (const w of i) {
2392
+ const c = h(w), p = c.find(
2393
+ (f) => Le[f] || Ne(f) || ze(f) || We(f) || Se(f)
2380
2394
  );
2381
2395
  if (!p) continue;
2382
- const y = c.indexOf(p), C = y >= 0 ? c.slice(0, y) : [], k = w(C);
2396
+ const m = c.indexOf(p), C = m >= 0 ? c.slice(0, m) : [], k = b(C);
2383
2397
  if (k === 4) {
2384
- const f = g(b, !0);
2398
+ const f = g(w, !0);
2385
2399
  f && u.push(f);
2386
2400
  } else {
2387
- const f = g(b);
2401
+ const f = g(w);
2388
2402
  f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
2389
2403
  }
2390
2404
  }
2391
- const v = [...s, ...o, ...a, ...u].join("");
2392
- return Ze.set(e, { css: v, timestamp: t }), v;
2405
+ const x = [...s, ...o, ...a, ...u].join("");
2406
+ return Xe.set(e, { css: x, timestamp: t }), x;
2393
2407
  }
2394
- const pe = [];
2395
- function qt(e, t, r, n, i, s, o, a) {
2408
+ const ge = [];
2409
+ function Jt(e, t, n, r, i, s, o, a) {
2396
2410
  if (e) {
2397
- pe.push(r);
2411
+ ge.push(n);
2398
2412
  try {
2399
- const u = t.render(r);
2413
+ const u = t.render(n);
2400
2414
  if (u instanceof Promise) {
2401
- s(!0), u.then((m) => {
2402
- s(!1), o(null), Ge(e, m, r, n, i), a(e.innerHTML);
2403
- }).catch((m) => {
2404
- s(!1), o(m);
2415
+ s(!0), u.then((y) => {
2416
+ s(!1), o(null), Ye(e, y, n, r, i), a(e.innerHTML);
2417
+ }).catch((y) => {
2418
+ s(!1), o(y);
2405
2419
  });
2406
2420
  return;
2407
2421
  }
2408
- Ge(e, u, r, n, i), a(e.innerHTML);
2422
+ Ye(e, u, n, r, i), a(e.innerHTML);
2409
2423
  } finally {
2410
- pe.pop();
2424
+ ge.pop();
2411
2425
  }
2412
2426
  }
2413
2427
  }
2414
- function Ge(e, t, r, n, i) {
2415
- e && (Rt(
2428
+ function Ye(e, t, n, r, i) {
2429
+ e && (Ot(
2416
2430
  e,
2417
2431
  Array.isArray(t) ? t : [t],
2418
- r,
2419
- n
2432
+ n,
2433
+ r
2420
2434
  ), i(e.innerHTML));
2421
2435
  }
2422
- function Ft(e, t, r, n, i, s, o) {
2436
+ function Zt(e, t, n, r, i, s, o) {
2423
2437
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
2424
- if (i(r + 1), r === 15)
2438
+ if (i(n + 1), n === 15)
2425
2439
  console.warn(
2426
2440
  `⚠️ Component is re-rendering rapidly. This might indicate:
2427
2441
  Common causes:
@@ -2430,7 +2444,7 @@ function Ft(e, t, r, n, i, s, o) {
2430
2444
  • Missing dependencies in computed/watch
2431
2445
  Component rendering will be throttled to prevent browser freeze.`
2432
2446
  );
2433
- else if (r > 20) {
2447
+ else if (n > 20) {
2434
2448
  console.error(
2435
2449
  `🛑 Infinite loop detected in component render:
2436
2450
  • This might be caused by state updates during render
@@ -2441,41 +2455,41 @@ Stopping runaway component render to prevent browser freeze`
2441
2455
  }
2442
2456
  } else
2443
2457
  i(0);
2444
- const m = setTimeout(() => {
2445
- n(Date.now()), e(), o(null);
2446
- }, r > 10 ? 100 : 0);
2447
- o(m);
2458
+ const y = setTimeout(() => {
2459
+ r(Date.now()), e(), o(null);
2460
+ }, n > 10 ? 100 : 0);
2461
+ o(y);
2448
2462
  }
2449
- function Kt(e, t, r, n, i) {
2463
+ function Gt(e, t, n, r, i) {
2450
2464
  if (!e) return;
2451
- const s = Ut(r);
2465
+ const s = Vt(n);
2452
2466
  if ((!s || s.trim() === "") && !t._computedStyle) {
2453
- i(null), e.adoptedStyleSheets = [Ke()];
2467
+ i(null), e.adoptedStyleSheets = [Je()];
2454
2468
  return;
2455
2469
  }
2456
2470
  let o = "";
2457
2471
  t._computedStyle && (o = t._computedStyle);
2458
- let a = Ot(`${o}
2472
+ let a = Lt(`${o}
2459
2473
  ${s}
2460
2474
  `);
2461
- a = ot(a);
2462
- let u = n;
2463
- u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Ke(), u], i(u);
2475
+ a = ct(a);
2476
+ let u = r;
2477
+ u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
2464
2478
  }
2465
2479
  let N = null;
2466
- function Vt(e) {
2480
+ function Xt(e) {
2467
2481
  N = e;
2468
2482
  }
2469
- function Jt() {
2483
+ function Yt() {
2470
2484
  N = null;
2471
2485
  }
2472
- function lr() {
2486
+ function hn() {
2473
2487
  if (!N)
2474
2488
  throw new Error("useEmit must be called during component render");
2475
2489
  const e = N.emit;
2476
- return (t, r) => e(t, r);
2490
+ return (t, n) => e(t, n);
2477
2491
  }
2478
- function ge(e) {
2492
+ function me(e) {
2479
2493
  e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
2480
2494
  value: {},
2481
2495
  writable: !0,
@@ -2483,30 +2497,30 @@ function ge(e) {
2483
2497
  configurable: !1
2484
2498
  });
2485
2499
  }
2486
- function ur(e) {
2500
+ function gn(e) {
2487
2501
  if (!N)
2488
2502
  throw new Error("useOnConnected must be called during component render");
2489
- ge(N), N._hookCallbacks.onConnected = e;
2503
+ me(N), N._hookCallbacks.onConnected = e;
2490
2504
  }
2491
- function fr(e) {
2505
+ function yn(e) {
2492
2506
  if (!N)
2493
2507
  throw new Error("useOnDisconnected must be called during component render");
2494
- ge(N), N._hookCallbacks.onDisconnected = e;
2508
+ me(N), N._hookCallbacks.onDisconnected = e;
2495
2509
  }
2496
- function dr(e) {
2510
+ function mn(e) {
2497
2511
  if (!N)
2498
2512
  throw new Error("useOnAttributeChanged must be called during component render");
2499
- ge(N), N._hookCallbacks.onAttributeChanged = e;
2513
+ me(N), N._hookCallbacks.onAttributeChanged = e;
2500
2514
  }
2501
- function pr(e) {
2515
+ function bn(e) {
2502
2516
  if (!N)
2503
2517
  throw new Error("useOnError must be called during component render");
2504
- ge(N), N._hookCallbacks.onError = e;
2518
+ me(N), N._hookCallbacks.onError = e;
2505
2519
  }
2506
- function hr(e) {
2520
+ function wn(e) {
2507
2521
  if (!N)
2508
2522
  throw new Error("useStyle must be called during component render");
2509
- ge(N);
2523
+ me(N);
2510
2524
  try {
2511
2525
  const t = e();
2512
2526
  Object.defineProperty(N, "_computedStyle", {
@@ -2524,12 +2538,12 @@ function hr(e) {
2524
2538
  });
2525
2539
  }
2526
2540
  }
2527
- const $e = /* @__PURE__ */ new Map(), Xe = Symbol.for("cer.registry");
2541
+ const Te = /* @__PURE__ */ new Map(), Qe = Symbol.for("cer.registry");
2528
2542
  if (typeof window < "u") {
2529
2543
  const e = globalThis;
2530
- e[Xe] || (e[Xe] = $e);
2544
+ e[Qe] || (e[Qe] = Te);
2531
2545
  }
2532
- function Zt(e, t) {
2546
+ function Qt(e, t) {
2533
2547
  if (!t.render)
2534
2548
  throw new Error(
2535
2549
  "Component must have a render function"
@@ -2574,34 +2588,34 @@ function Zt(e, t) {
2574
2588
  _templateLoading = !1;
2575
2589
  _templateError = null;
2576
2590
  constructor() {
2577
- super(), this.attachShadow({ mode: "open" }), this._cfg = $e.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
2578
- const r = this._initContext(t);
2579
- Object.defineProperty(r, "refs", {
2591
+ super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
2592
+ const n = this._initContext(t);
2593
+ Object.defineProperty(n, "refs", {
2580
2594
  value: this._refs,
2581
2595
  writable: !1,
2582
2596
  enumerable: !1,
2583
2597
  configurable: !1
2584
- }), Object.defineProperty(r, "requestRender", {
2598
+ }), Object.defineProperty(n, "requestRender", {
2585
2599
  value: () => this.requestRender(),
2586
2600
  writable: !1,
2587
2601
  enumerable: !1,
2588
2602
  configurable: !1
2589
- }), Object.defineProperty(r, "_requestRender", {
2603
+ }), Object.defineProperty(n, "_requestRender", {
2590
2604
  value: () => this._requestRender(),
2591
2605
  writable: !1,
2592
2606
  enumerable: !1,
2593
2607
  configurable: !1
2594
- }), Object.defineProperty(r, "_componentId", {
2608
+ }), Object.defineProperty(n, "_componentId", {
2595
2609
  value: this._componentId,
2596
2610
  writable: !1,
2597
2611
  enumerable: !1,
2598
2612
  configurable: !1
2599
- }), Object.defineProperty(r, "_triggerWatchers", {
2613
+ }), Object.defineProperty(n, "_triggerWatchers", {
2600
2614
  value: (i, s) => this._triggerWatchers(i, s),
2601
2615
  writable: !1,
2602
2616
  enumerable: !1,
2603
2617
  configurable: !1
2604
- }), this.context = r, Object.defineProperty(this.context, "emit", {
2618
+ }), this.context = n, Object.defineProperty(this.context, "emit", {
2605
2619
  value: (i, s, o) => {
2606
2620
  const a = new CustomEvent(i, {
2607
2621
  detail: s,
@@ -2615,11 +2629,11 @@ function Zt(e, t) {
2615
2629
  enumerable: !1,
2616
2630
  configurable: !1
2617
2631
  });
2618
- const n = $e.get(e) || t;
2619
- Object.keys(n).forEach((i) => {
2620
- const s = n[i];
2632
+ const r = Te.get(e) || t;
2633
+ Object.keys(r).forEach((i) => {
2634
+ const s = r[i];
2621
2635
  typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
2622
- }), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
2636
+ }), this._applyComputed(r), r.props && Object.keys(r.props).forEach((i) => {
2623
2637
  let s = this[i];
2624
2638
  Object.defineProperty(this, i, {
2625
2639
  get() {
@@ -2627,28 +2641,28 @@ function Zt(e, t) {
2627
2641
  },
2628
2642
  set(o) {
2629
2643
  const a = s;
2630
- s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
2644
+ s = o, this.context[i] = o, this._initializing || (this._applyProps(r), a !== o && this._requestRender());
2631
2645
  },
2632
2646
  enumerable: !0,
2633
2647
  configurable: !0
2634
2648
  });
2635
- }), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
2649
+ }), this._initializing = !1, this._initWatchers(r), this._applyProps(r), this._render(r);
2636
2650
  }
2637
2651
  connectedCallback() {
2638
2652
  this._runLogicWithinErrorBoundary(t, () => {
2639
- this._applyProps(t), this._requestRender(), bt(
2653
+ this._applyProps(t), this._requestRender(), xt(
2640
2654
  t,
2641
2655
  this.context,
2642
2656
  this._mounted,
2643
- (r) => {
2644
- this._mounted = r;
2657
+ (n) => {
2658
+ this._mounted = n;
2645
2659
  }
2646
2660
  );
2647
2661
  });
2648
2662
  }
2649
2663
  disconnectedCallback() {
2650
2664
  this._runLogicWithinErrorBoundary(t, () => {
2651
- wt(
2665
+ vt(
2652
2666
  t,
2653
2667
  this.context,
2654
2668
  this._listeners,
@@ -2658,52 +2672,52 @@ function Zt(e, t) {
2658
2672
  () => {
2659
2673
  this._watchers.clear();
2660
2674
  },
2661
- (r) => {
2662
- this._templateLoading = r;
2675
+ (n) => {
2676
+ this._templateLoading = n;
2663
2677
  },
2664
- (r) => {
2665
- this._templateError = r;
2678
+ (n) => {
2679
+ this._templateError = n;
2666
2680
  },
2667
- (r) => {
2668
- this._mounted = r;
2681
+ (n) => {
2682
+ this._mounted = n;
2669
2683
  }
2670
2684
  );
2671
2685
  });
2672
2686
  }
2673
- attributeChangedCallback(r, n, i) {
2687
+ attributeChangedCallback(n, r, i) {
2674
2688
  this._runLogicWithinErrorBoundary(t, () => {
2675
- this._applyProps(t), n !== i && this._requestRender(), vt(
2689
+ this._applyProps(t), r !== i && this._requestRender(), kt(
2676
2690
  t,
2677
- r,
2678
2691
  n,
2692
+ r,
2679
2693
  i,
2680
2694
  this.context
2681
2695
  );
2682
2696
  });
2683
2697
  }
2684
2698
  static get observedAttributes() {
2685
- return t.props ? Object.keys(t.props).map(te) : [];
2699
+ return t.props ? Object.keys(t.props).map(ne) : [];
2686
2700
  }
2687
- _applyComputed(r) {
2701
+ _applyComputed(n) {
2688
2702
  }
2689
2703
  // --- Render ---
2690
- _render(r) {
2691
- this._runLogicWithinErrorBoundary(r, () => {
2692
- qt(
2704
+ _render(n) {
2705
+ this._runLogicWithinErrorBoundary(n, () => {
2706
+ Jt(
2693
2707
  this.shadowRoot,
2694
- r,
2708
+ n,
2695
2709
  this.context,
2696
2710
  this._refs,
2697
- (n) => {
2698
- this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
2711
+ (r) => {
2712
+ this._lastHtmlStringForJitCSS = r, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(r);
2699
2713
  },
2700
- (n) => {
2701
- this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
2714
+ (r) => {
2715
+ this._templateLoading = r, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(r);
2702
2716
  },
2703
- (n) => {
2704
- this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
2717
+ (r) => {
2718
+ this._templateError = r, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(r);
2705
2719
  },
2706
- (n) => this._applyStyle(r, n)
2720
+ (r) => this._applyStyle(n, r)
2707
2721
  );
2708
2722
  });
2709
2723
  }
@@ -2712,32 +2726,32 @@ function Zt(e, t) {
2712
2726
  }
2713
2727
  _requestRender() {
2714
2728
  this._runLogicWithinErrorBoundary(this._cfg, () => {
2715
- le(() => {
2716
- Ft(
2729
+ fe(() => {
2730
+ Zt(
2717
2731
  () => this._render(this._cfg),
2718
2732
  this._lastRenderTime,
2719
2733
  this._renderCount,
2720
- (r) => {
2721
- this._lastRenderTime = r;
2734
+ (n) => {
2735
+ this._lastRenderTime = n;
2722
2736
  },
2723
- (r) => {
2724
- this._renderCount = r;
2737
+ (n) => {
2738
+ this._renderCount = n;
2725
2739
  },
2726
2740
  this._renderTimeoutId,
2727
- (r) => {
2728
- this._renderTimeoutId = r;
2741
+ (n) => {
2742
+ this._renderTimeoutId = n;
2729
2743
  }
2730
2744
  );
2731
2745
  }, this._componentId);
2732
2746
  });
2733
2747
  }
2734
2748
  // --- Style ---
2735
- _applyStyle(r, n) {
2736
- this._runLogicWithinErrorBoundary(r, () => {
2737
- Kt(
2749
+ _applyStyle(n, r) {
2750
+ this._runLogicWithinErrorBoundary(n, () => {
2751
+ Gt(
2738
2752
  this.shadowRoot,
2739
2753
  this.context,
2740
- n,
2754
+ r,
2741
2755
  this._styleSheet,
2742
2756
  (i) => {
2743
2757
  this._styleSheet = i;
@@ -2746,21 +2760,21 @@ function Zt(e, t) {
2746
2760
  });
2747
2761
  }
2748
2762
  // --- Error Boundary function ---
2749
- _runLogicWithinErrorBoundary(r, n) {
2763
+ _runLogicWithinErrorBoundary(n, r) {
2750
2764
  this._hasError && (this._hasError = !1);
2751
2765
  try {
2752
- n();
2766
+ r();
2753
2767
  } catch (i) {
2754
- this._hasError = !0, r.onError && r.onError(i, this.context);
2768
+ this._hasError = !0, n.onError && n.onError(i, this.context);
2755
2769
  }
2756
2770
  }
2757
2771
  // --- State, props, computed ---
2758
- _initContext(r) {
2772
+ _initContext(n) {
2759
2773
  try {
2760
- let n = function(s, o = "") {
2774
+ let r = function(s, o = "") {
2761
2775
  return Array.isArray(s) ? new Proxy(s, {
2762
- get(a, u, m) {
2763
- const g = Reflect.get(a, u, m);
2776
+ get(a, u, y) {
2777
+ const g = Reflect.get(a, u, y);
2764
2778
  return typeof g == "function" && typeof u == "string" && [
2765
2779
  "push",
2766
2780
  "pop",
@@ -2773,56 +2787,56 @@ function Zt(e, t) {
2773
2787
  const l = g.apply(a, h);
2774
2788
  if (!i._initializing) {
2775
2789
  const d = o || "root";
2776
- i._triggerWatchers(d, a), le(() => i._render(r), i._componentId);
2790
+ i._triggerWatchers(d, a), fe(() => i._render(n), i._componentId);
2777
2791
  }
2778
2792
  return l;
2779
2793
  } : g;
2780
2794
  },
2781
- set(a, u, m) {
2782
- if (a[u] = m, !i._initializing) {
2795
+ set(a, u, y) {
2796
+ if (a[u] = y, !i._initializing) {
2783
2797
  const g = o ? `${o}.${String(u)}` : String(u);
2784
- i._triggerWatchers(g, m), le(() => i._render(r), i._componentId);
2798
+ i._triggerWatchers(g, y), fe(() => i._render(n), i._componentId);
2785
2799
  }
2786
2800
  return !0;
2787
2801
  },
2788
2802
  deleteProperty(a, u) {
2789
2803
  if (delete a[u], !i._initializing) {
2790
- const m = o ? `${o}.${String(u)}` : String(u);
2791
- i._triggerWatchers(m, void 0), le(() => i._render(r), i._componentId);
2804
+ const y = o ? `${o}.${String(u)}` : String(u);
2805
+ i._triggerWatchers(y, void 0), fe(() => i._render(n), i._componentId);
2792
2806
  }
2793
2807
  return !0;
2794
2808
  }
2795
2809
  }) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
2796
2810
  const u = o ? `${o}.${a}` : a;
2797
- s[a] = n(s[a], u);
2811
+ s[a] = r(s[a], u);
2798
2812
  }), new Proxy(s, {
2799
- set(a, u, m) {
2813
+ set(a, u, y) {
2800
2814
  const g = o ? `${o}.${String(u)}` : String(u);
2801
- return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
2815
+ return a[u] = r(y, g), i._initializing || (i._triggerWatchers(
2802
2816
  g,
2803
2817
  a[u]
2804
- ), le(() => i._render(r), i._componentId)), !0;
2818
+ ), fe(() => i._render(n), i._componentId)), !0;
2805
2819
  },
2806
- get(a, u, m) {
2807
- return Reflect.get(a, u, m);
2820
+ get(a, u, y) {
2821
+ return Reflect.get(a, u, y);
2808
2822
  }
2809
2823
  })) : s;
2810
2824
  };
2811
2825
  const i = this;
2812
- return n({
2826
+ return r({
2813
2827
  // For functional components, state is managed by state() function calls
2814
2828
  // Include prop defaults in initial reactive context so prop updates trigger reactivity
2815
- ...r.props ? Object.fromEntries(
2816
- Object.entries(r.props).map(([s, o]) => [s, o.default])
2829
+ ...n.props ? Object.fromEntries(
2830
+ Object.entries(n.props).map(([s, o]) => [s, o.default])
2817
2831
  ) : {}
2818
2832
  });
2819
2833
  } catch {
2820
2834
  return {};
2821
2835
  }
2822
2836
  }
2823
- _initWatchers(r) {
2824
- this._runLogicWithinErrorBoundary(r, () => {
2825
- ht(
2837
+ _initWatchers(n) {
2838
+ this._runLogicWithinErrorBoundary(n, () => {
2839
+ yt(
2826
2840
  this.context,
2827
2841
  this._watchers,
2828
2842
  {}
@@ -2830,41 +2844,41 @@ function Zt(e, t) {
2830
2844
  );
2831
2845
  });
2832
2846
  }
2833
- _triggerWatchers(r, n) {
2834
- gt(this.context, this._watchers, r, n);
2847
+ _triggerWatchers(n, r) {
2848
+ mt(this.context, this._watchers, n, r);
2835
2849
  }
2836
- _applyProps(r) {
2837
- this._runLogicWithinErrorBoundary(r, () => {
2850
+ _applyProps(n) {
2851
+ this._runLogicWithinErrorBoundary(n, () => {
2838
2852
  try {
2839
- yt(this, r, this.context);
2840
- } catch (n) {
2841
- this._hasError = !0, r.onError && r.onError(n, this.context);
2853
+ wt(this, n, this.context);
2854
+ } catch (r) {
2855
+ this._hasError = !0, n.onError && n.onError(r, this.context);
2842
2856
  }
2843
2857
  });
2844
2858
  }
2845
2859
  };
2846
2860
  }
2847
- function Ye(e, t) {
2848
- let r = te(e);
2849
- r.includes("-") || (r = `cer-${r}`);
2850
- let n = {};
2861
+ function et(e, t) {
2862
+ let n = ne(e);
2863
+ n.includes("-") || (n = `cer-${n}`);
2864
+ let r = {};
2851
2865
  if (typeof window < "u")
2852
2866
  try {
2853
2867
  const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
2854
2868
  if (a) {
2855
- const m = a[1].split(",").map((g) => g.trim());
2856
- for (const g of m) {
2857
- const w = g.indexOf("=");
2858
- if (w !== -1) {
2859
- const h = g.substring(0, w).trim(), l = g.substring(w + 1).trim();
2869
+ const y = a[1].split(",").map((g) => g.trim());
2870
+ for (const g of y) {
2871
+ const b = g.indexOf("=");
2872
+ if (b !== -1) {
2873
+ const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
2860
2874
  try {
2861
- l === "true" ? n[h] = !0 : l === "false" ? n[h] = !1 : l === "[]" ? n[h] = [] : l === "{}" ? n[h] = {} : /^\d+$/.test(l) ? n[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? n[h] = l.slice(1, -1) : n[h] = l;
2875
+ l === "true" ? r[h] = !0 : l === "false" ? r[h] = !1 : l === "[]" ? r[h] = [] : l === "{}" ? r[h] = {} : /^\d+$/.test(l) ? r[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? r[h] = l.slice(1, -1) : r[h] = l;
2862
2876
  } catch {
2863
- n[h] = "";
2877
+ r[h] = "";
2864
2878
  }
2865
2879
  } else {
2866
2880
  const h = g.split(":")[0].trim();
2867
- h && !h.includes("}") && (n[h] = "");
2881
+ h && !h.includes("}") && (r[h] = "");
2868
2882
  }
2869
2883
  }
2870
2884
  }
@@ -2874,7 +2888,7 @@ function Ye(e, t) {
2874
2888
  const s = {
2875
2889
  // Generate props config from defaults
2876
2890
  props: Object.fromEntries(
2877
- Object.entries(n).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
2891
+ Object.entries(r).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
2878
2892
  ),
2879
2893
  // Add lifecycle hooks from the stored functions
2880
2894
  onConnected: (o) => {
@@ -2883,55 +2897,55 @@ function Ye(e, t) {
2883
2897
  onDisconnected: (o) => {
2884
2898
  i.onDisconnected && i.onDisconnected();
2885
2899
  },
2886
- onAttributeChanged: (o, a, u, m) => {
2900
+ onAttributeChanged: (o, a, u, y) => {
2887
2901
  i.onAttributeChanged && i.onAttributeChanged(o, a, u);
2888
2902
  },
2889
2903
  onError: (o, a) => {
2890
2904
  i.onError && o && i.onError(o);
2891
2905
  },
2892
2906
  render: (o) => {
2893
- const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
2907
+ const a = o._componentId || `${n}-${Math.random().toString(36).substr(2, 9)}`;
2894
2908
  F.setCurrentComponent(a, () => {
2895
2909
  o.requestRender && o.requestRender();
2896
2910
  });
2897
2911
  try {
2898
- Vt(o);
2899
- const u = Object.keys(n).length > 0;
2900
- let m;
2912
+ Xt(o);
2913
+ const u = Object.keys(r).length > 0;
2914
+ let y;
2901
2915
  if (u) {
2902
2916
  const g = {};
2903
- Object.keys(n).forEach((w) => {
2904
- g[w] = o[w] ?? n[w];
2905
- }), m = t(g);
2917
+ Object.keys(r).forEach((b) => {
2918
+ g[b] = o[b] ?? r[b];
2919
+ }), y = t(g);
2906
2920
  } else
2907
- m = t();
2921
+ y = t();
2908
2922
  if (o._hookCallbacks) {
2909
2923
  const g = o._hookCallbacks;
2910
2924
  g.onConnected && (i.onConnected = g.onConnected), g.onDisconnected && (i.onDisconnected = g.onDisconnected), g.onAttributeChanged && (i.onAttributeChanged = g.onAttributeChanged), g.onError && (i.onError = g.onError), g.style && (o._styleCallback = g.style);
2911
2925
  }
2912
- return m;
2926
+ return y;
2913
2927
  } finally {
2914
- Jt(), F.clearCurrentComponent();
2928
+ Yt(), F.clearCurrentComponent();
2915
2929
  }
2916
2930
  }
2917
2931
  };
2918
- $e.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Zt(r, s)));
2932
+ Te.set(n, s), typeof window < "u" && (customElements.get(n) || customElements.define(n, Qt(n, s)));
2919
2933
  }
2920
- class Gt {
2934
+ class en {
2921
2935
  map = /* @__PURE__ */ new Map();
2922
2936
  maxSize;
2923
2937
  constructor(t) {
2924
2938
  this.maxSize = t;
2925
2939
  }
2926
2940
  get(t) {
2927
- const r = this.map.get(t);
2928
- if (r !== void 0)
2929
- return this.map.delete(t), this.map.set(t, r), r;
2941
+ const n = this.map.get(t);
2942
+ if (n !== void 0)
2943
+ return this.map.delete(t), this.map.set(t, n), n;
2930
2944
  }
2931
- set(t, r) {
2932
- if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
2933
- const n = this.map.keys().next().value;
2934
- n !== void 0 && this.map.delete(n);
2945
+ set(t, n) {
2946
+ if (this.map.has(t) && this.map.delete(t), this.map.set(t, n), this.map.size > this.maxSize) {
2947
+ const r = this.map.keys().next().value;
2948
+ r !== void 0 && this.map.delete(r);
2935
2949
  }
2936
2950
  }
2937
2951
  has(t) {
@@ -2941,8 +2955,8 @@ class Gt {
2941
2955
  this.map.clear();
2942
2956
  }
2943
2957
  }
2944
- const We = new Gt(500);
2945
- function Xt(e, t) {
2958
+ const De = new en(500);
2959
+ function tn(e, t) {
2946
2960
  if (e == null) {
2947
2961
  console.warn(
2948
2962
  `⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
@@ -2955,107 +2969,107 @@ function Xt(e, t) {
2955
2969
  `💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`
2956
2970
  );
2957
2971
  }
2958
- function fe(e, t = {}, r, n) {
2959
- const i = n ?? t.key;
2960
- return { tag: e, key: i, props: t, children: r };
2972
+ function pe(e, t = {}, n, r) {
2973
+ const i = r ?? t.key;
2974
+ return { tag: e, key: i, props: t, children: n };
2961
2975
  }
2962
- function Se(e) {
2976
+ function Ae(e) {
2963
2977
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
2964
2978
  }
2965
- function ke(e) {
2966
- return typeof e == "object" && e !== null && "tag" in e && !Se(e);
2979
+ function _e(e) {
2980
+ return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
2967
2981
  }
2968
- function Yt(e, t) {
2982
+ function nn(e, t) {
2969
2983
  return e.key != null ? e : { ...e, key: t };
2970
2984
  }
2971
- function Qt(e, t = [], r = {}) {
2972
- const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2985
+ function rn(e, t = [], n = {}) {
2986
+ const r = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2973
2987
  let u;
2974
2988
  for (; u = a.exec(e); ) {
2975
- const m = u[1], g = u[2], w = (u[4] || u[6]) ?? "", h = w.match(/^{{(\d+)}}$/);
2976
- let l = h ? t[Number(h[1])] ?? null : w;
2989
+ const y = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
2990
+ let l = h ? t[Number(h[1])] ?? null : b;
2977
2991
  h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
2978
2992
  const d = ["model", "bind", "show", "class", "style", "ref"];
2979
- if (m === ":") {
2980
- const [v, b] = g.split(":"), [c, ...p] = v.split(".");
2993
+ if (y === ":") {
2994
+ const [x, w] = g.split(":"), [c, ...p] = x.split(".");
2981
2995
  if (d.includes(c)) {
2982
- const y = [...p], C = c === "model" && b ? `model:${b}` : c;
2996
+ const m = [...p], C = c === "model" && w ? `model:${w}` : c;
2983
2997
  s[C] = {
2984
2998
  value: l,
2985
- modifiers: y,
2986
- arg: b
2999
+ modifiers: m,
3000
+ arg: w
2987
3001
  };
2988
3002
  } else {
2989
- let y = l;
2990
- y && typeof y == "object" && y.constructor?.name === "ReactiveState" && (y = y.value), i[g] = y, o.push(g);
3003
+ let m = l;
3004
+ m && ee(m) && (m = m.value), i[g] = m, o.push(g);
2991
3005
  }
2992
- } else if (m === "@") {
2993
- const [v, ...b] = g.split("."), c = b;
2994
- Xt(l, v);
2995
- const p = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
3006
+ } else if (y === "@") {
3007
+ const [x, ...w] = g.split("."), c = w;
3008
+ tn(l, x);
3009
+ const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
2996
3010
  if (p) {
2997
- const y = (k) => {
3011
+ const m = (k) => {
2998
3012
  if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
2999
- return c.includes("once") && k.currentTarget?.removeEventListener(v, y), p(k);
3000
- }, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
3001
- n[C] = y;
3013
+ return c.includes("once") && k.currentTarget?.removeEventListener(x, m), p(k);
3014
+ }, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
3015
+ r[C] = m;
3002
3016
  }
3003
- } else g === "ref" ? n.ref = l : i[g] = l;
3017
+ } else g === "ref" ? r.ref = l : i[g] = l;
3004
3018
  }
3005
- return { props: n, attrs: i, directives: s, bound: o };
3019
+ return { props: r, attrs: i, directives: s, bound: o };
3006
3020
  }
3007
- function er(e, t, r) {
3008
- const n = pe.length > 0 ? pe[pe.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
3021
+ function sn(e, t, n) {
3022
+ const r = ge.length > 0 ? ge[ge.length - 1] : void 0, i = n ?? r, s = !n && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
3009
3023
  if (s && o) {
3010
- const f = We.get(o);
3024
+ const f = De.get(o);
3011
3025
  if (f) return f;
3012
3026
  }
3013
- function a(f, x) {
3014
- return fe("#text", {}, f, x);
3027
+ function a(f, v) {
3028
+ return pe("#text", {}, f, v);
3015
3029
  }
3016
3030
  let u = "";
3017
3031
  for (let f = 0; f < e.length; f++)
3018
3032
  u += e[f], f < t.length && (u += `{{${f}}}`);
3019
- const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3020
- let w, h = [], l = null, d = {}, v, b = 0, c = [];
3033
+ const y = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3034
+ let b, h = [], l = null, d = {}, x, w = 0, c = [];
3021
3035
  function p(f) {
3022
- !f || typeof f != "object" || Se(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((x) => {
3023
- if (x === "style" && d.attrs.style) {
3036
+ !f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((v) => {
3037
+ if (v === "style" && d.attrs.style) {
3024
3038
  const A = d.attrs.style.replace(
3025
3039
  /;?\s*$/,
3026
3040
  ""
3027
3041
  ), _ = f.attrs.style.replace(/^;?\s*/, "");
3028
3042
  d.attrs.style = A + "; " + _;
3029
- } else if (x === "class" && d.attrs.class) {
3030
- const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), S = [
3043
+ } else if (v === "class" && d.attrs.class) {
3044
+ const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
3031
3045
  .../* @__PURE__ */ new Set([...A, ..._])
3032
3046
  ];
3033
- d.attrs.class = S.join(" ");
3047
+ d.attrs.class = $.join(" ");
3034
3048
  } else
3035
- d.attrs[x] = f.attrs[x];
3049
+ d.attrs[v] = f.attrs[v];
3036
3050
  }))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
3037
3051
  }
3038
- function y(f, x) {
3052
+ function m(f, v) {
3039
3053
  const A = l ? h : c;
3040
- if (Se(f)) {
3041
- const _ = f.key ?? x;
3042
- let S = f.children;
3054
+ if (Ae(f)) {
3055
+ const _ = f.key ?? v;
3056
+ let $ = f.children;
3043
3057
  A.push({
3044
3058
  ...f,
3045
3059
  key: _,
3046
- children: S
3060
+ children: $
3047
3061
  });
3048
3062
  return;
3049
3063
  }
3050
- if (ke(f)) {
3051
- A.push(Yt(f, void 0));
3064
+ if (_e(f)) {
3065
+ A.push(nn(f, void 0));
3052
3066
  return;
3053
3067
  }
3054
3068
  if (Array.isArray(f)) {
3055
3069
  if (f.length === 0) return;
3056
3070
  for (let _ = 0; _ < f.length; _++) {
3057
- const S = f[_];
3058
- Se(S) || ke(S) || Array.isArray(S) ? y(S, `${x}-${_}`) : S !== null && typeof S == "object" ? p(S) : A.push(a(String(S), `${x}-${_}`));
3071
+ const $ = f[_];
3072
+ Ae($) || _e($) || Array.isArray($) ? m($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
3059
3073
  }
3060
3074
  return;
3061
3075
  }
@@ -3063,7 +3077,7 @@ function er(e, t, r) {
3063
3077
  p(f);
3064
3078
  return;
3065
3079
  }
3066
- A.push(a(String(f), x));
3080
+ A.push(a(String(f), v));
3067
3081
  }
3068
3082
  const C = /* @__PURE__ */ new Set([
3069
3083
  "area",
@@ -3081,20 +3095,20 @@ function er(e, t, r) {
3081
3095
  "track",
3082
3096
  "wbr"
3083
3097
  ]);
3084
- for (; w = m.exec(u); )
3085
- if (!(w[0].startsWith("<!--") && w[0].endsWith("-->"))) {
3086
- if (w[1]) {
3087
- const f = w[1], x = w[0][1] === "/", A = w[0][w[0].length - 2] === "/" || C.has(f), {
3098
+ for (; b = y.exec(u); )
3099
+ if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
3100
+ if (b[1]) {
3101
+ const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3088
3102
  props: _,
3089
- attrs: S,
3090
- directives: R,
3091
- bound: T
3092
- } = Qt(w[2] || "", t, i), $ = { props: {}, attrs: {} };
3093
- for (const P in _) $.props[P] = _[P];
3094
- for (const P in S) $.attrs[P] = S[P];
3095
- if ($.attrs && Object.prototype.hasOwnProperty.call($.attrs, "key") && !($.props && Object.prototype.hasOwnProperty.call($.props, "key")))
3103
+ attrs: $,
3104
+ directives: T,
3105
+ bound: R
3106
+ } = rn(b[2] || "", t, i), S = { props: {}, attrs: {} };
3107
+ for (const P in _) S.props[P] = _[P];
3108
+ for (const P in $) S.attrs[P] = $[P];
3109
+ if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
3096
3110
  try {
3097
- $.props.key = $.attrs.key;
3111
+ S.props.key = S.attrs.key;
3098
3112
  } catch {
3099
3113
  }
3100
3114
  try {
@@ -3107,188 +3121,188 @@ function er(e, t, r) {
3107
3121
  audio: ["muted", "autoplay", "controls", "loop"],
3108
3122
  img: ["src", "alt", "width", "height"],
3109
3123
  button: ["type", "name", "value", "disabled", "autofocus", "form"]
3110
- }, B = f.toLowerCase(), J = P[B] ?? [];
3111
- if ($.attrs) {
3112
- for (const K of J)
3113
- if (T && T.includes(K) && K in $.attrs && !($.props && K in $.props)) {
3114
- let L = $.attrs[K];
3115
- L && typeof L == "object" && L.constructor?.name === "ReactiveState" && (L = L.value), $.props[K] = L, delete $.attrs[K];
3124
+ }, B = f.toLowerCase(), V = P[B] ?? [];
3125
+ if (S.attrs) {
3126
+ for (const K of V)
3127
+ if (R && R.includes(K) && K in S.attrs && !(S.props && K in S.props)) {
3128
+ let L = S.attrs[K];
3129
+ L && ee(L) && (L = L.value), S.props[K] = L, delete S.attrs[K];
3116
3130
  }
3117
3131
  }
3118
- if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && ($.isCustomElement = !0, T && $.attrs)) {
3132
+ if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && (S.isCustomElement = !0, R && S.attrs)) {
3119
3133
  const K = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
3120
- for (const L of T)
3121
- if (L in $.attrs && !($.props && L in $.props)) {
3122
- const j = L.includes("-") ? L.split("-").map((Z, W) => W === 0 ? Z : Z.charAt(0).toUpperCase() + Z.slice(1)).join("") : L;
3123
- let V = $.attrs[L];
3124
- V && typeof V == "object" && V.constructor?.name === "ReactiveState" && (V = V.value), $.props[j] = V, K.has(L) || delete $.attrs[L];
3134
+ for (const L of R)
3135
+ if (L in S.attrs && !(S.props && L in S.props)) {
3136
+ const M = L.includes("-") ? L.split("-").map((Z, z) => z === 0 ? Z : Z.charAt(0).toUpperCase() + Z.slice(1)).join("") : L;
3137
+ let J = S.attrs[L];
3138
+ J && ee(J) && (J = J.value), S.props[M] = J, K.has(L) || delete S.attrs[L];
3125
3139
  }
3126
3140
  }
3127
3141
  } catch {
3128
3142
  }
3129
- if (R && Object.keys(R).some((P) => P === "model" || P.startsWith("model:")))
3143
+ if (T && Object.keys(T).some((P) => P === "model" || P.startsWith("model:")))
3130
3144
  try {
3131
- const P = Symbol.for("cer.registry"), B = globalThis[P], J = !!(B && typeof B.has == "function" && B.has(f)), ye = !!(i && (i.__customElements instanceof Set && i.__customElements.has(f) || Array.isArray(i.__isCustomElements) && i.__isCustomElements.includes(f)));
3132
- if (!!(f.includes("-") || ye || J))
3133
- for (const j of Object.keys(R)) {
3134
- if (j !== "model" && !j.startsWith("model:")) continue;
3135
- const V = R[j], Z = V.arg ?? (j.includes(":") ? j.split(":", 2)[1] : void 0), W = V.value, E = Z ?? "modelValue", U = H, D = Ce, z = i ? i._state || i : void 0;
3145
+ const P = Symbol.for("cer.registry"), B = globalThis[P], V = !!(B && typeof B.has == "function" && B.has(f)), we = !!(i && (i.__customElements instanceof Set && i.__customElements.has(f) || Array.isArray(i.__isCustomElements) && i.__isCustomElements.includes(f)));
3146
+ if (!!(f.includes("-") || we || V))
3147
+ for (const M of Object.keys(T)) {
3148
+ if (M !== "model" && !M.startsWith("model:")) continue;
3149
+ const J = T[M], Z = J.arg ?? (M.includes(":") ? M.split(":", 2)[1] : void 0), z = J.value, E = Z ?? "modelValue", U = H, D = Ee, W = i ? i._state || i : void 0;
3136
3150
  let O;
3137
- typeof W == "string" && i ? O = U(z, W) : (O = W, O && typeof O == "object" && O.constructor?.name === "ReactiveState" && (O = O.value)), $.props[E] = O;
3151
+ typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
3138
3152
  try {
3139
- const re = te(E);
3140
- $.attrs || ($.attrs = {}), O !== void 0 && ($.attrs[re] = O);
3153
+ const re = ne(E);
3154
+ S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[re] = O);
3141
3155
  } catch {
3142
3156
  }
3143
- $.isCustomElement = !0;
3144
- const Be = `update:${te(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ct = "on" + Be.charAt(0).toUpperCase() + Be.slice(1);
3145
- $.props[ct] = function(re) {
3157
+ S.isCustomElement = !0;
3158
+ const qe = `update:${ne(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
3159
+ S.props[ut] = function(re) {
3146
3160
  const Y = re.detail !== void 0 ? re.detail : re.target ? re.target.value : void 0;
3147
- if (z)
3148
- if (W && typeof W == "object" && W.constructor?.name === "ReactiveState") {
3149
- const oe = W.value;
3150
- (Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (W.value = Y, i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
3161
+ if (W)
3162
+ if (z && ee(z)) {
3163
+ const ae = z.value;
3164
+ (Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (z.value = Y, i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
3151
3165
  } else {
3152
- const oe = U(z, typeof W == "string" ? W : String(W));
3153
- (Array.isArray(Y) && Array.isArray(oe) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...oe].sort()) : Y !== oe) && (D(z, typeof W == "string" ? W : String(W), Y), i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
3166
+ const ae = U(W, typeof z == "string" ? z : String(z));
3167
+ (Array.isArray(Y) && Array.isArray(ae) ? JSON.stringify([...Y].sort()) !== JSON.stringify([...ae].sort()) : Y !== ae) && (D(W, typeof z == "string" ? z : String(z), Y), i?.requestRender ? i.requestRender() : i?._requestRender && i._requestRender());
3154
3168
  }
3155
- }, delete R[j];
3169
+ }, delete T[M];
3156
3170
  }
3157
3171
  } catch {
3158
3172
  }
3159
- if (Object.keys(R).length > 0 && ($.directives = { ...R }), x) {
3160
- const P = fe(
3173
+ if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
3174
+ const P = pe(
3161
3175
  l,
3162
3176
  d,
3163
- h.length === 1 && ke(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
3164
- v
3177
+ h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
3178
+ x
3165
3179
  ), B = g.pop();
3166
- B ? (l = B.tag, d = B.props, v = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, v = void 0, h = []);
3167
- } else A ? l ? h.push(fe(f, $, void 0, void 0)) : c.push(fe(f, $, void 0, void 0)) : (l && g.push({
3180
+ B ? (l = B.tag, d = B.props, x = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, x = void 0, h = []);
3181
+ } else A ? l ? h.push(pe(f, S, void 0, void 0)) : c.push(pe(f, S, void 0, void 0)) : (l && g.push({
3168
3182
  tag: l,
3169
3183
  props: d,
3170
3184
  children: h,
3171
- key: v
3172
- }), l = f, d = $, h = []);
3173
- } else if (typeof w[3] < "u") {
3174
- const f = Number(w[3]), x = t[f], A = `interp-${f}`;
3175
- y(x, A);
3176
- } else if (w[4]) {
3177
- const f = w[4], x = l ? h : c, A = f.split(/({{\d+}})/);
3185
+ key: x
3186
+ }), l = f, d = S, h = []);
3187
+ } else if (typeof b[3] < "u") {
3188
+ const f = Number(b[3]), v = t[f], A = `interp-${f}`;
3189
+ m(v, A);
3190
+ } else if (b[4]) {
3191
+ const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
3178
3192
  for (const _ of A) {
3179
3193
  if (!_) continue;
3180
- const S = _.match(/^{{(\d+)}}$/);
3181
- if (S) {
3182
- const R = Number(S[1]), T = t[R], $ = `interp-${R}`;
3183
- y(T, $);
3194
+ const $ = _.match(/^{{(\d+)}}$/);
3195
+ if ($) {
3196
+ const T = Number($[1]), R = t[T], S = `interp-${T}`;
3197
+ m(R, S);
3184
3198
  } else {
3185
- const R = `text-${b++}`;
3186
- x.push(a(_, R));
3199
+ const T = `text-${w++}`;
3200
+ v.push(a(_, T));
3187
3201
  }
3188
3202
  }
3189
3203
  }
3190
3204
  }
3191
- const k = c.filter((f) => ke(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
3205
+ const k = c.filter((f) => _e(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
3192
3206
  if (k.length === 1) {
3193
3207
  const f = k[0];
3194
- return s && o && We.set(o, f), f;
3208
+ return s && o && De.set(o, f), f;
3195
3209
  } else if (k.length > 1) {
3196
3210
  const f = k;
3197
- return s && o && We.set(o, f), f;
3211
+ return s && o && De.set(o, f), f;
3198
3212
  }
3199
- return fe("div", {}, "", "fallback-root");
3213
+ return pe("div", {}, "", "fallback-root");
3200
3214
  }
3201
- function ae(e, ...t) {
3202
- const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
3203
- return er(e, t, n);
3215
+ function ce(e, ...t) {
3216
+ const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
3217
+ return sn(e, t, r);
3204
3218
  }
3205
- function Ae(e, t) {
3206
- return M(e ? t : [], "when-block");
3219
+ function Re(e, t) {
3220
+ return j(e ? t : [], "when-block");
3207
3221
  }
3208
- function gr(e, t) {
3209
- return e.map((r, n) => {
3210
- const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
3211
- return M(t(r, n), `each-${i}`);
3222
+ function xn(e, t) {
3223
+ return e.map((n, r) => {
3224
+ const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
3225
+ return j(t(n, r), `each-${i}`);
3212
3226
  });
3213
3227
  }
3214
- function tr() {
3228
+ function on() {
3215
3229
  const e = [];
3216
3230
  return {
3217
- when(t, r) {
3218
- return e.push([t, r]), this;
3231
+ when(t, n) {
3232
+ return e.push([t, n]), this;
3219
3233
  },
3220
3234
  otherwise(t) {
3221
3235
  return e.push([!0, t]), this;
3222
3236
  },
3223
3237
  done() {
3224
- return rr(...e);
3238
+ return an(...e);
3225
3239
  }
3226
3240
  };
3227
3241
  }
3228
- function rr(...e) {
3242
+ function an(...e) {
3229
3243
  for (let t = 0; t < e.length; t++) {
3230
- const [r, n] = e[t];
3231
- if (r) return [M(n, `whenChain-branch-${t}`)];
3244
+ const [n, r] = e[t];
3245
+ if (n) return [j(r, `whenChain-branch-${t}`)];
3232
3246
  }
3233
- return [M([], "whenChain-empty")];
3247
+ return [j([], "whenChain-empty")];
3234
3248
  }
3235
- function M(e, t) {
3236
- const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3249
+ function j(e, t) {
3250
+ const n = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3237
3251
  return {
3238
3252
  tag: "#anchor",
3239
3253
  key: t,
3240
- children: r
3254
+ children: n
3241
3255
  };
3242
3256
  }
3243
- function mr(e, t) {
3244
- return Ae(!e, t);
3257
+ function vn(e, t) {
3258
+ return Re(!e, t);
3245
3259
  }
3246
- function yr(e, t) {
3247
- const r = !e || e.length === 0;
3248
- return Ae(r, t);
3260
+ function kn(e, t) {
3261
+ const n = !e || e.length === 0;
3262
+ return Re(n, t);
3249
3263
  }
3250
- function br(e, t) {
3251
- const r = !!(e && e.length > 0);
3252
- return Ae(r, t);
3264
+ function Cn(e, t) {
3265
+ const n = !!(e && e.length > 0);
3266
+ return Re(n, t);
3253
3267
  }
3254
- function wr(e, t, r) {
3255
- const n = [];
3268
+ function _n(e, t, n) {
3269
+ const r = [];
3256
3270
  return e.forEach((i, s) => {
3257
- t(i, s) && n.push({ item: i, originalIndex: s });
3258
- }), n.map(({ item: i, originalIndex: s }, o) => {
3271
+ t(i, s) && r.push({ item: i, originalIndex: s });
3272
+ }), r.map(({ item: i, originalIndex: s }, o) => {
3259
3273
  const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
3260
- return M(r(i, s, o), `each-where-${a}`);
3274
+ return j(n(i, s, o), `each-where-${a}`);
3261
3275
  });
3262
3276
  }
3263
- function vr(e, t) {
3264
- const r = e?.length ?? 0;
3265
- return r === 0 && t.empty ? M(t.empty, "switch-length-empty") : r === 1 && t.one ? M(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? M(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? M(t.many(e), "switch-length-many") : M([], "switch-length-fallback");
3277
+ function En(e, t) {
3278
+ const n = e?.length ?? 0;
3279
+ return n === 0 && t.empty ? j(t.empty, "switch-length-empty") : n === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[n] ? j(t.exactly[n](e), `switch-length-${n}`) : n > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
3266
3280
  }
3267
- function xr(e, t, r) {
3268
- const n = /* @__PURE__ */ new Map();
3281
+ function $n(e, t, n) {
3282
+ const r = /* @__PURE__ */ new Map();
3269
3283
  return e.forEach((i) => {
3270
3284
  const s = t(i);
3271
- n.has(s) || n.set(s, []), n.get(s).push(i);
3272
- }), Array.from(n.entries()).map(([i, s], o) => M(
3273
- r(i, s, o),
3285
+ r.has(s) || r.set(s, []), r.get(s).push(i);
3286
+ }), Array.from(r.entries()).map(([i, s], o) => j(
3287
+ n(i, s, o),
3274
3288
  `each-group-${i}`
3275
3289
  ));
3276
3290
  }
3277
- function kr(e, t, r, n) {
3278
- const i = r * t, s = Math.min(i + t, e.length);
3291
+ function Sn(e, t, n, r) {
3292
+ const i = n * t, s = Math.min(i + t, e.length);
3279
3293
  return e.slice(i, s).map((a, u) => {
3280
- const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
3281
- return M(n(a, m, u), `each-page-${g}`);
3294
+ const y = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${y}` : `page-${y}`;
3295
+ return j(r(a, y, u), `each-page-${g}`);
3282
3296
  });
3283
3297
  }
3284
- function Cr(e, t) {
3285
- return e.loading && t.loading ? M(t.loading, "promise-loading") : e.error && t.error ? M(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? M(t.success(e.data), "promise-success") : t.idle ? M(t.idle, "promise-idle") : M([], "promise-fallback");
3298
+ function An(e, t) {
3299
+ return e.loading && t.loading ? j(t.loading, "promise-loading") : e.error && t.error ? j(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? j(t.success(e.data), "promise-success") : t.idle ? j(t.idle, "promise-idle") : j([], "promise-fallback");
3286
3300
  }
3287
3301
  function q(e, t) {
3288
- const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
3289
- return Ae(!!r, t);
3302
+ const n = typeof window < "u" && window.matchMedia?.(e)?.matches;
3303
+ return Re(!!n, t);
3290
3304
  }
3291
- const ee = {
3305
+ const te = {
3292
3306
  // Responsive breakpoints (matching style.ts)
3293
3307
  sm: "(min-width:640px)",
3294
3308
  md: "(min-width:768px)",
@@ -3297,15 +3311,15 @@ const ee = {
3297
3311
  "2xl": "(min-width:1536px)",
3298
3312
  // Dark mode (matching style.ts)
3299
3313
  dark: "(prefers-color-scheme: dark)"
3300
- }, at = ["sm", "md", "lg", "xl", "2xl"], nr = {
3314
+ }, lt = ["sm", "md", "lg", "xl", "2xl"], cn = {
3301
3315
  // Breakpoint-based rendering (matching style.ts exactly)
3302
- sm: (e) => q(ee.sm, e),
3303
- md: (e) => q(ee.md, e),
3304
- lg: (e) => q(ee.lg, e),
3305
- xl: (e) => q(ee.xl, e),
3306
- "2xl": (e) => q(ee["2xl"], e),
3316
+ sm: (e) => q(te.sm, e),
3317
+ md: (e) => q(te.md, e),
3318
+ lg: (e) => q(te.lg, e),
3319
+ xl: (e) => q(te.xl, e),
3320
+ "2xl": (e) => q(te["2xl"], e),
3307
3321
  // Dark mode (matching style.ts)
3308
- dark: (e) => q(ee.dark, e),
3322
+ dark: (e) => q(te.dark, e),
3309
3323
  light: (e) => q("(prefers-color-scheme: light)", e),
3310
3324
  // Accessibility and interaction preferences
3311
3325
  touch: (e) => q("(hover: none) and (pointer: coarse)", e),
@@ -3316,48 +3330,48 @@ const ee = {
3316
3330
  portrait: (e) => q("(orientation: portrait)", e),
3317
3331
  landscape: (e) => q("(orientation: landscape)", e)
3318
3332
  };
3319
- function _r(e, t) {
3320
- const r = [];
3321
- e.includes("dark") ? r.push(ee.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
3322
- const n = e.filter(
3323
- (o) => at.includes(o)
3324
- ), i = n[n.length - 1];
3325
- i && i in ee && r.push(ee[i]);
3326
- const s = r.length > 0 ? r.join(" and ") : "all";
3333
+ function Tn(e, t) {
3334
+ const n = [];
3335
+ e.includes("dark") ? n.push(te.dark) : e.includes("light") && n.push("(prefers-color-scheme: light)");
3336
+ const r = e.filter(
3337
+ (o) => lt.includes(o)
3338
+ ), i = r[r.length - 1];
3339
+ i && i in te && n.push(te[i]);
3340
+ const s = n.length > 0 ? n.join(" and ") : "all";
3327
3341
  return q(s, t);
3328
3342
  }
3329
- function Er(e) {
3343
+ function Rn(e) {
3330
3344
  const t = [];
3331
- return e.base && t.push(M(e.base, "responsive-base")), at.forEach((r) => {
3332
- const n = e[r];
3333
- n && t.push(nr[r](n));
3345
+ return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((n) => {
3346
+ const r = e[n];
3347
+ r && t.push(cn[n](r));
3334
3348
  }), t;
3335
3349
  }
3336
- function Sr(e) {
3350
+ function On(e) {
3337
3351
  const t = [];
3338
- let r = null;
3352
+ let n = null;
3339
3353
  return {
3340
- case(n, i) {
3341
- const s = typeof n == "function" ? n : (o) => o === n;
3354
+ case(r, i) {
3355
+ const s = typeof r == "function" ? r : (o) => o === r;
3342
3356
  return t.push({ condition: s, content: i }), this;
3343
3357
  },
3344
- when(n, i) {
3345
- return t.push({ condition: n, content: i }), this;
3358
+ when(r, i) {
3359
+ return t.push({ condition: r, content: i }), this;
3346
3360
  },
3347
- otherwise(n) {
3348
- return r = n, this;
3361
+ otherwise(r) {
3362
+ return n = r, this;
3349
3363
  },
3350
3364
  done() {
3351
- for (let n = 0; n < t.length; n++) {
3352
- const { condition: i, content: s } = t[n];
3365
+ for (let r = 0; r < t.length; r++) {
3366
+ const { condition: i, content: s } = t[r];
3353
3367
  if (i(e))
3354
- return M(s, `switch-case-${n}`);
3368
+ return j(s, `switch-case-${r}`);
3355
3369
  }
3356
- return M(r || [], "switch-otherwise");
3370
+ return j(n || [], "switch-otherwise");
3357
3371
  }
3358
3372
  };
3359
3373
  }
3360
- class ue extends EventTarget {
3374
+ class de extends EventTarget {
3361
3375
  handlers = {};
3362
3376
  static instance;
3363
3377
  eventCounters = /* @__PURE__ */ new Map();
@@ -3365,21 +3379,21 @@ class ue extends EventTarget {
3365
3379
  * Returns the singleton instance of GlobalEventBus
3366
3380
  */
3367
3381
  static getInstance() {
3368
- return ue.instance || (ue.instance = new ue()), ue.instance;
3382
+ return de.instance || (de.instance = new de()), de.instance;
3369
3383
  }
3370
3384
  /**
3371
3385
  * Emit a global event with optional data. Includes event storm protection.
3372
3386
  * @param eventName - Name of the event
3373
3387
  * @param data - Optional event payload
3374
3388
  */
3375
- emit(t, r) {
3376
- const n = Date.now(), i = this.eventCounters.get(t);
3377
- if (!i || n - i.window > 1e3)
3378
- this.eventCounters.set(t, { count: 1, window: n });
3389
+ emit(t, n) {
3390
+ const r = Date.now(), i = this.eventCounters.get(t);
3391
+ if (!i || r - i.window > 1e3)
3392
+ this.eventCounters.set(t, { count: 1, window: r });
3379
3393
  else if (i.count++, i.count > 50 && i.count > 100)
3380
3394
  return;
3381
3395
  this.dispatchEvent(new CustomEvent(t, {
3382
- detail: r,
3396
+ detail: n,
3383
3397
  bubbles: !1,
3384
3398
  // Global events don't need to bubble
3385
3399
  cancelable: !0
@@ -3387,9 +3401,9 @@ class ue extends EventTarget {
3387
3401
  const s = this.handlers[t];
3388
3402
  s && s.forEach((o) => {
3389
3403
  try {
3390
- o(r);
3404
+ o(n);
3391
3405
  } catch (a) {
3392
- ie(`Error in global event handler for "${t}":`, a);
3406
+ se(`Error in global event handler for "${t}":`, a);
3393
3407
  }
3394
3408
  });
3395
3409
  }
@@ -3398,17 +3412,17 @@ class ue extends EventTarget {
3398
3412
  * @param eventName - Name of the event
3399
3413
  * @param handler - Handler function
3400
3414
  */
3401
- on(t, r) {
3402
- return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
3415
+ on(t, n) {
3416
+ return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(n), () => this.off(t, n);
3403
3417
  }
3404
3418
  /**
3405
3419
  * Remove a specific handler for a global event.
3406
3420
  * @param eventName - Name of the event
3407
3421
  * @param handler - Handler function to remove
3408
3422
  */
3409
- off(t, r) {
3410
- const n = this.handlers[t];
3411
- n && n.delete(r);
3423
+ off(t, n) {
3424
+ const r = this.handlers[t];
3425
+ r && r.delete(n);
3412
3426
  }
3413
3427
  /**
3414
3428
  * Remove all handlers for a specific event.
@@ -3423,18 +3437,18 @@ class ue extends EventTarget {
3423
3437
  * @param handler - CustomEvent handler
3424
3438
  * @param options - AddEventListener options
3425
3439
  */
3426
- listen(t, r, n) {
3427
- return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
3440
+ listen(t, n, r) {
3441
+ return this.addEventListener(t, n, r), () => this.removeEventListener(t, n);
3428
3442
  }
3429
3443
  /**
3430
3444
  * Register a one-time event handler. Returns a promise that resolves with the event data.
3431
3445
  * @param eventName - Name of the event
3432
3446
  * @param handler - Handler function
3433
3447
  */
3434
- once(t, r) {
3435
- return new Promise((n) => {
3448
+ once(t, n) {
3449
+ return new Promise((r) => {
3436
3450
  const i = this.on(t, (s) => {
3437
- i(), r(s), n(s);
3451
+ i(), n(s), r(s);
3438
3452
  });
3439
3453
  });
3440
3454
  }
@@ -3464,10 +3478,10 @@ class ue extends EventTarget {
3464
3478
  */
3465
3479
  getEventStats() {
3466
3480
  const t = {};
3467
- for (const [r, n] of this.eventCounters.entries())
3468
- t[r] = {
3469
- count: n.count,
3470
- handlersCount: this.getHandlerCount(r)
3481
+ for (const [n, r] of this.eventCounters.entries())
3482
+ t[n] = {
3483
+ count: r.count,
3484
+ handlersCount: this.getHandlerCount(n)
3471
3485
  };
3472
3486
  return t;
3473
3487
  }
@@ -3478,12 +3492,12 @@ class ue extends EventTarget {
3478
3492
  this.eventCounters.clear();
3479
3493
  }
3480
3494
  }
3481
- const me = ue.getInstance(), $r = (e, t) => me.emit(e, t), Ar = (e, t) => me.on(e, t), Rr = (e, t) => me.off(e, t), Tr = (e, t) => me.once(e, t), Or = (e, t, r) => me.listen(e, t, r);
3482
- function Qe(e) {
3495
+ const be = de.getInstance(), Pn = (e, t) => be.emit(e, t), Ln = (e, t) => be.on(e, t), Mn = (e, t) => be.off(e, t), jn = (e, t) => be.once(e, t), Nn = (e, t, n) => be.listen(e, t, n);
3496
+ function tt(e) {
3483
3497
  let t = { ...e };
3484
- const r = [];
3485
- function n(a) {
3486
- r.push(a), a(t);
3498
+ const n = [];
3499
+ function r(a) {
3500
+ n.push(a), a(t);
3487
3501
  }
3488
3502
  function i() {
3489
3503
  return t;
@@ -3493,143 +3507,143 @@ function Qe(e) {
3493
3507
  t = { ...t, ...u }, o();
3494
3508
  }
3495
3509
  function o() {
3496
- r.forEach((a) => a(t));
3510
+ n.forEach((a) => a(t));
3497
3511
  }
3498
- return { subscribe: n, getState: i, setState: s };
3512
+ return { subscribe: r, getState: i, setState: s };
3499
3513
  }
3500
- const et = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
3501
- for (const r of e) {
3502
- const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
3514
+ const nt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
3515
+ for (const n of e) {
3516
+ const r = [], i = n.path.replace(/:[^/]+/g, (a) => (r.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
3503
3517
  if (o) {
3504
3518
  const a = {};
3505
- return n.forEach((u, m) => {
3506
- a[u] = o[m + 1];
3507
- }), { route: r, params: a };
3519
+ return r.forEach((u, y) => {
3520
+ a[u] = o[y + 1];
3521
+ }), { route: n, params: a };
3508
3522
  }
3509
3523
  }
3510
3524
  return { route: null, params: {} };
3511
- }, ze = {};
3512
- async function ir(e) {
3525
+ }, Ie = {};
3526
+ async function ln(e) {
3513
3527
  if (e.component) return e.component;
3514
3528
  if (e.load) {
3515
- if (ze[e.path]) return ze[e.path];
3529
+ if (Ie[e.path]) return Ie[e.path];
3516
3530
  try {
3517
3531
  const t = await e.load();
3518
- return ze[e.path] = t.default, t.default;
3532
+ return Ie[e.path] = t.default, t.default;
3519
3533
  } catch {
3520
3534
  throw new Error(`Failed to load component for route: ${e.path}`);
3521
3535
  }
3522
3536
  }
3523
3537
  throw new Error(`No component or loader defined for route: ${e.path}`);
3524
3538
  }
3525
- function sr(e) {
3526
- const { routes: t, base: r = "", initialUrl: n } = e;
3527
- let i, s, o, a, u, m, g;
3528
- const w = async (v, b) => {
3529
- const c = t.find((p) => Q([p], v.path).route !== null);
3539
+ function un(e) {
3540
+ const { routes: t, base: n = "", initialUrl: r } = e;
3541
+ let i, s, o, a, u, y, g;
3542
+ const b = async (x, w) => {
3543
+ const c = t.find((p) => Q([p], x.path).route !== null);
3530
3544
  if (c?.beforeEnter)
3531
3545
  try {
3532
- const p = await c.beforeEnter(v, b);
3546
+ const p = await c.beforeEnter(x, w);
3533
3547
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3534
3548
  } catch (p) {
3535
- return ie("beforeEnter error", p), !1;
3549
+ return se("beforeEnter error", p), !1;
3536
3550
  }
3537
3551
  return !0;
3538
- }, h = async (v, b) => {
3539
- const c = t.find((p) => Q([p], v.path).route !== null);
3552
+ }, h = async (x, w) => {
3553
+ const c = t.find((p) => Q([p], x.path).route !== null);
3540
3554
  if (c?.onEnter)
3541
3555
  try {
3542
- const p = await c.onEnter(v, b);
3556
+ const p = await c.onEnter(x, w);
3543
3557
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3544
3558
  } catch (p) {
3545
- return ie("onEnter error", p), !1;
3559
+ return se("onEnter error", p), !1;
3546
3560
  }
3547
3561
  return !0;
3548
- }, l = (v, b) => {
3549
- const c = t.find((p) => Q([p], v.path).route !== null);
3562
+ }, l = (x, w) => {
3563
+ const c = t.find((p) => Q([p], x.path).route !== null);
3550
3564
  if (c?.afterEnter)
3551
3565
  try {
3552
- c.afterEnter(v, b);
3566
+ c.afterEnter(x, w);
3553
3567
  } catch (p) {
3554
- ie("afterEnter error", p);
3568
+ se("afterEnter error", p);
3555
3569
  }
3556
- }, d = async (v, b = !1) => {
3570
+ }, d = async (x, w = !1) => {
3557
3571
  try {
3558
3572
  const c = {
3559
- path: v.replace(r, "") || "/",
3573
+ path: x.replace(n, "") || "/",
3560
3574
  query: {}
3561
3575
  }, p = Q(t, c.path);
3562
3576
  if (!p) throw new Error(`No route found for ${c.path}`);
3563
- const y = o.getState(), C = {
3577
+ const m = o.getState(), C = {
3564
3578
  path: c.path,
3565
3579
  params: p.params,
3566
3580
  query: c.query
3567
3581
  };
3568
- if (!await w(C, y) || !await h(C, y)) return;
3569
- typeof window < "u" && typeof document < "u" && (b ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(C), l(C, y);
3582
+ if (!await b(C, m) || !await h(C, m)) return;
3583
+ typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + x) : window.history.pushState({}, "", n + x)), o.setState(C), l(C, m);
3570
3584
  } catch (c) {
3571
- ie("Navigation error:", c);
3585
+ se("Navigation error:", c);
3572
3586
  }
3573
3587
  };
3574
- if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
3588
+ if (typeof window < "u" && typeof document < "u" && typeof r > "u") {
3575
3589
  i = () => {
3576
- const b = new URL(window.location.href), c = b.pathname.replace(r, "") || "/", p = et(b.search);
3590
+ const w = new URL(window.location.href), c = w.pathname.replace(n, "") || "/", p = nt(w.search);
3577
3591
  return { path: c, query: p };
3578
3592
  }, s = i();
3579
- const v = Q(t, s.path);
3580
- o = Qe({
3593
+ const x = Q(t, s.path);
3594
+ o = tt({
3581
3595
  path: s.path,
3582
- params: v.params,
3596
+ params: x.params,
3583
3597
  query: s.query
3584
- }), a = async (b = !1) => {
3598
+ }), a = async (w = !1) => {
3585
3599
  const c = i();
3586
- await d(c.path, b);
3587
- }, window.addEventListener("popstate", () => a(!0)), u = (b) => d(b, !1), m = (b) => d(b, !0), g = () => window.history.back();
3600
+ await d(c.path, w);
3601
+ }, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), y = (w) => d(w, !0), g = () => window.history.back();
3588
3602
  } else {
3589
3603
  i = () => {
3590
- const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = et(c.search);
3591
- return { path: p, query: y };
3604
+ const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", m = nt(c.search);
3605
+ return { path: p, query: m };
3592
3606
  }, s = i();
3593
- const v = Q(t, s.path);
3594
- o = Qe({
3607
+ const x = Q(t, s.path);
3608
+ o = tt({
3595
3609
  path: s.path,
3596
- params: v.params,
3610
+ params: x.params,
3597
3611
  query: s.query
3598
3612
  }), a = async () => {
3599
3613
  const c = i();
3600
- await b(c.path);
3614
+ await w(c.path);
3601
3615
  };
3602
- const b = async (c) => {
3616
+ const w = async (c) => {
3603
3617
  try {
3604
3618
  const p = {
3605
- path: c.replace(r, "") || "/",
3619
+ path: c.replace(n, "") || "/",
3606
3620
  query: {}
3607
- }, y = Q(t, p.path);
3608
- if (!y) throw new Error(`No route found for ${p.path}`);
3621
+ }, m = Q(t, p.path);
3622
+ if (!m) throw new Error(`No route found for ${p.path}`);
3609
3623
  const C = o.getState(), k = {
3610
3624
  path: p.path,
3611
- params: y.params,
3625
+ params: m.params,
3612
3626
  query: p.query
3613
- }, f = t.find((x) => Q([x], k.path).route !== null);
3627
+ }, f = t.find((v) => Q([v], k.path).route !== null);
3614
3628
  if (f?.beforeEnter)
3615
3629
  try {
3616
- const x = await f.beforeEnter(k, C);
3617
- if (typeof x == "string") {
3618
- await b(x);
3630
+ const v = await f.beforeEnter(k, C);
3631
+ if (typeof v == "string") {
3632
+ await w(v);
3619
3633
  return;
3620
3634
  }
3621
- if (x === !1) return;
3635
+ if (v === !1) return;
3622
3636
  } catch {
3623
3637
  return;
3624
3638
  }
3625
3639
  if (f?.onEnter)
3626
3640
  try {
3627
- const x = await f.onEnter(k, C);
3628
- if (typeof x == "string") {
3629
- await b(x);
3641
+ const v = await f.onEnter(k, C);
3642
+ if (typeof v == "string") {
3643
+ await w(v);
3630
3644
  return;
3631
3645
  }
3632
- if (x === !1) return;
3646
+ if (v === !1) return;
3633
3647
  } catch {
3634
3648
  return;
3635
3649
  }
@@ -3641,85 +3655,85 @@ function sr(e) {
3641
3655
  } catch {
3642
3656
  }
3643
3657
  };
3644
- u = async (c) => b(c), m = async (c) => b(c), g = () => {
3658
+ u = async (c) => w(c), y = async (c) => w(c), g = () => {
3645
3659
  };
3646
3660
  }
3647
3661
  return {
3648
3662
  store: o,
3649
3663
  push: u,
3650
- replace: m,
3664
+ replace: y,
3651
3665
  back: g,
3652
3666
  subscribe: o.subscribe,
3653
- matchRoute: (v) => Q(t, v),
3667
+ matchRoute: (x) => Q(t, x),
3654
3668
  getCurrent: () => o.getState(),
3655
- resolveRouteComponent: ir
3669
+ resolveRouteComponent: ln
3656
3670
  };
3657
3671
  }
3658
- function Pr(e, t) {
3672
+ function Wn(e, t) {
3659
3673
  return Q(e, t);
3660
3674
  }
3661
- function Lr(e) {
3662
- const t = sr(e);
3663
- return Ye("router-view", (r = {}, n = {}) => {
3664
- const { onConnected: i } = n;
3675
+ function zn(e) {
3676
+ const t = un(e);
3677
+ return et("router-view", (n = {}, r = {}) => {
3678
+ const { onConnected: i } = r;
3665
3679
  if (i && i(() => {
3666
3680
  t && typeof t.subscribe == "function" && t.subscribe(() => {
3667
3681
  });
3668
- }), !t) return ae`<div>Router not initialized.</div>`;
3682
+ }), !t) return ce`<div>Router not initialized.</div>`;
3669
3683
  const s = t.getCurrent(), { path: o } = s, a = t.matchRoute(o);
3670
3684
  return a.route ? t.resolveRouteComponent(a.route).then((u) => {
3671
3685
  if (typeof u == "string")
3672
3686
  return { tag: u, props: {}, children: [] };
3673
3687
  if (typeof u == "function") {
3674
- const m = u();
3675
- return (m instanceof Promise ? m : Promise.resolve(m)).then((w) => typeof w == "string" ? { tag: w, props: {}, children: [] } : w);
3688
+ const y = u();
3689
+ return (y instanceof Promise ? y : Promise.resolve(y)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
3676
3690
  }
3677
- return ae`<div>Invalid route component</div>`;
3678
- }).catch(() => ae`<div>Invalid route component</div>`) : ae`<div>Not found</div>`;
3679
- }), Ye("router-link", (r = {}, n = {}) => {
3691
+ return ce`<div>Invalid route component</div>`;
3692
+ }).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
3693
+ }), et("router-link", (n = {}, r = {}) => {
3680
3694
  const {
3681
3695
  to: i = "",
3682
3696
  tag: s = "a",
3683
3697
  replace: o = !1,
3684
3698
  exact: a = !1,
3685
3699
  activeClass: u = "active",
3686
- exactActiveClass: m = "exact-active",
3700
+ exactActiveClass: y = "exact-active",
3687
3701
  ariaCurrentValue: g = "page",
3688
- disabled: w = !1,
3702
+ disabled: b = !1,
3689
3703
  external: h = !1,
3690
3704
  class: l = ""
3691
- } = r, d = t.getCurrent(), v = d.path === i, b = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
3692
- for (const _ of p) y[_] = !0;
3705
+ } = n, d = t.getCurrent(), x = d.path === i, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = x ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), m = {};
3706
+ for (const _ of p) m[_] = !0;
3693
3707
  const C = {
3694
- ...y,
3708
+ ...m,
3695
3709
  // Also include the configurable names (may duplicate the above)
3696
- [u]: b,
3697
- [m]: v
3698
- }, k = s === "button", f = w ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3699
- if (w) {
3710
+ [u]: w,
3711
+ [y]: x
3712
+ }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3713
+ if (b) {
3700
3714
  _.preventDefault();
3701
3715
  return;
3702
3716
  }
3703
3717
  h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
3704
3718
  };
3705
- return ae`
3706
- ${tr().when(k, ae`
3719
+ return ce`
3720
+ ${on().when(k, ce`
3707
3721
  <button
3708
3722
  part="button"
3709
3723
  :class="${C}"
3710
3724
  ${c}
3711
3725
  ${f}
3712
- ${x}
3726
+ ${v}
3713
3727
  @click="${A}"
3714
3728
  ><slot></slot></button>
3715
- `).otherwise(ae`
3729
+ `).otherwise(ce`
3716
3730
  <a
3717
3731
  part="link"
3718
3732
  href="${i}"
3719
3733
  :class="${C}"
3720
3734
  ${c}
3721
3735
  ${f}
3722
- ${x}
3736
+ ${v}
3723
3737
  @click="${A}"
3724
3738
  ><slot></slot></a>
3725
3739
  `).done()}
@@ -3727,51 +3741,51 @@ function Lr(e) {
3727
3741
  }), t;
3728
3742
  }
3729
3743
  export {
3730
- ue as GlobalEventBus,
3731
- M as anchorBlock,
3732
- Ye as component,
3733
- ar as computed,
3734
- Qe as createStore,
3735
- Tt as css,
3736
- gr as each,
3737
- xr as eachGroup,
3738
- kr as eachPage,
3739
- wr as eachWhere,
3740
- $r as emit,
3741
- me as eventBus,
3742
- ae as html,
3743
- Lr as initRouter,
3744
- Or as listen,
3745
- tr as match,
3744
+ de as GlobalEventBus,
3745
+ j as anchorBlock,
3746
+ et as component,
3747
+ dn as computed,
3748
+ tt as createStore,
3749
+ Pt as css,
3750
+ xn as each,
3751
+ $n as eachGroup,
3752
+ Sn as eachPage,
3753
+ _n as eachWhere,
3754
+ Pn as emit,
3755
+ be as eventBus,
3756
+ ce as html,
3757
+ zn as initRouter,
3758
+ Nn as listen,
3759
+ on as match,
3746
3760
  Q as matchRoute,
3747
- Pr as matchRouteSSR,
3748
- ee as mediaVariants,
3749
- Rr as off,
3750
- Ar as on,
3751
- Tr as once,
3752
- et as parseQuery,
3753
- or as ref,
3754
- Te as renderToString,
3755
- ir as resolveRouteComponent,
3756
- nr as responsive,
3757
- at as responsiveOrder,
3758
- Er as responsiveSwitch,
3759
- Sr as switchOn,
3760
- vr as switchOnLength,
3761
- Cr as switchOnPromise,
3762
- mr as unless,
3763
- lr as useEmit,
3764
- dr as useOnAttributeChanged,
3765
- ur as useOnConnected,
3766
- fr as useOnDisconnected,
3767
- pr as useOnError,
3768
- sr as useRouter,
3769
- hr as useStyle,
3770
- cr as watch,
3771
- Ae as when,
3772
- yr as whenEmpty,
3761
+ Wn as matchRouteSSR,
3762
+ te as mediaVariants,
3763
+ Mn as off,
3764
+ Ln as on,
3765
+ jn as once,
3766
+ nt as parseQuery,
3767
+ fn as ref,
3768
+ Pe as renderToString,
3769
+ ln as resolveRouteComponent,
3770
+ cn as responsive,
3771
+ lt as responsiveOrder,
3772
+ Rn as responsiveSwitch,
3773
+ On as switchOn,
3774
+ En as switchOnLength,
3775
+ An as switchOnPromise,
3776
+ vn as unless,
3777
+ hn as useEmit,
3778
+ mn as useOnAttributeChanged,
3779
+ gn as useOnConnected,
3780
+ yn as useOnDisconnected,
3781
+ bn as useOnError,
3782
+ un as useRouter,
3783
+ wn as useStyle,
3784
+ pn as watch,
3785
+ Re as when,
3786
+ kn as whenEmpty,
3773
3787
  q as whenMedia,
3774
- br as whenNotEmpty,
3775
- _r as whenVariants
3788
+ Cn as whenNotEmpty,
3789
+ Tn as whenVariants
3776
3790
  };
3777
3791
  //# sourceMappingURL=custom-elements-runtime.es.js.map