@jasonshimmy/custom-elements-runtime 1.0.0 → 1.0.1

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 ve = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
331
+ function ne(e) {
332
+ if (ve.has(e))
333
+ return ve.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 ve.size < Ue && ve.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 (xe.has(e))
339
+ return xe.get(e);
340
+ const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
341
+ return xe.size < Ue && xe.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 vt(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 xt(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,24 +683,24 @@ 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
  }
@@ -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");
862
+ o instanceof HTMLInputElement ? d = r?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
845
863
  const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? 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,18 +877,18 @@ 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;
@@ -878,51 +896,51 @@ function kt(e, t, r, n, i, s, o, a) {
878
896
  if (!f || f._modelUpdating) return;
879
897
  let x = 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
+ x = 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
+ x = f.checked ? R : S;
894
912
  }
895
913
  } else if (d === "radio")
896
914
  x = 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
+ x = Array.from(f.selectedOptions).map((T) => T.value);
917
+ else if (y && typeof x == "string" && (x = x.trim()), g) {
918
+ const T = Number(x);
919
+ isNaN(T) || (x = T);
902
920
  }
903
921
  const A = s._state || s, _ = h();
904
922
  if (Array.isArray(x) && Array.isArray(_) ? JSON.stringify([...x].sort()) !== JSON.stringify([..._].sort()) : x !== _) {
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] = x, e.value = T;
911
929
  } else
912
930
  e.value = x;
913
931
  else
914
- Ce(A, e, x);
932
+ Ee(A, e, x);
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, x);
918
936
  }
919
937
  if (f) {
920
- const R = `update:${te(c)}`, T = new CustomEvent(R, {
938
+ const T = `update:${ne(c)}`, R = new CustomEvent(T, {
921
939
  detail: x,
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);
@@ -932,29 +950,29 @@ function kt(e, t, r, n, i, s, o, a) {
932
950
  if (v) {
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
963
  const f = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
946
964
  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;
965
+ Ee(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
966
+ const $ = k.target;
967
+ if ($) {
968
+ $[c] = x;
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 x == "boolean" ? x ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(x));
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
  }
@@ -966,14 +984,14 @@ function kt(e, t, r, n, i, s, o, a) {
966
984
  k && setTimeout(() => {
967
985
  const f = k.value, x = s._state || s, A = H(x, 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(x, 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 v = u[d], w = y[d];
1212
+ if (v !== 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 v == "function" && oe.removeListener(e, c, v), 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
1230
  for (const [d, v] of Object.entries(
1213
1231
  s.listeners || {}
1214
1232
  ))
1215
- se.addListener(e, d, v);
1233
+ oe.addListener(e, d, v);
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 v = h[d], w = l[d];
1237
+ let c = v, p = w;
1238
+ if (ee(v) && (c = v.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") {
@@ -1321,78 +1339,78 @@ function X(e, t, r) {
1321
1339
  if (e.tag === "#anchor") {
1322
1340
  const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), v = document.createTextNode("");
1323
1341
  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);
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(v), 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 v = it(h);
1367
1385
  try {
1368
- n[v] = l;
1386
+ r[v] = 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
1412
  const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1395
- n[h] = v;
1413
+ r[h] = v;
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) {
1469
+ function b(l, d) {
1452
1470
  let v = l;
1453
- for (; v && (m.add(v), v !== d); )
1471
+ for (; v && (y.add(v), v !== d); )
1454
1472
  v = v.nextSibling;
1455
1473
  }
1456
- function h(l, d, v, b) {
1474
+ function h(l, d, v, 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(v) ? v : [];
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
1488
  const x = /* @__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
+ ), x.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), x.add($);
1502
+ A = $.nextSibling;
1485
1503
  }
1486
1504
  for (const _ of c)
1487
1505
  !x.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 x = m[f], A = w[f], _ = $e(c[f], x, 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 v = l.key, w = `${v}:start`, c = `${v}: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,
1535
+ m,
1518
1536
  a.get(v)?.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
1543
  const v = a.get(l.key);
1526
- d = _e(
1544
+ d = $e(
1527
1545
  u.get(l.key),
1528
1546
  v,
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;",
@@ -1820,6 +1876,7 @@ const Pt = Tt`
1820
1876
  "max-h-full": "max-height:100%;",
1821
1877
  "min-w-0": "min-width:0;",
1822
1878
  "min-h-0": "min-height:0;",
1879
+ ...zt(),
1823
1880
  "m-auto": "margin:auto;",
1824
1881
  "mx-auto": "margin-inline:auto;",
1825
1882
  "my-auto": "margin-block:auto;",
@@ -1834,55 +1891,8 @@ const Pt = Tt`
1834
1891
  /* Accessibility */
1835
1892
  "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
1893
  "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;",
1894
+ /* Grid Layout & Placement */
1895
+ ...Dt(),
1886
1896
  /* Positioning */
1887
1897
  absolute: "position:absolute;",
1888
1898
  relative: "position:relative;",
@@ -2017,7 +2027,7 @@ const Pt = Tt`
2017
2027
  "z-30": "z-index:30;",
2018
2028
  "z-40": "z-index:40;",
2019
2029
  "z-50": "z-index:50;"
2020
- }, Mt = "0.25rem", Ve = {
2030
+ }, Ze = {
2021
2031
  m: ["margin"],
2022
2032
  mx: ["margin-inline"],
2023
2033
  my: ["margin-block"],
@@ -2050,19 +2060,19 @@ const Pt = Tt`
2050
2060
  "gap-y": ["row-gap"]
2051
2061
  };
2052
2062
  function G(e, t) {
2053
- let r = 0, n = 0;
2063
+ let n = 0, r = 0;
2054
2064
  for (let i = 0; i < e.length; i++) {
2055
2065
  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 === " "))
2066
+ if (s === "[") n++;
2067
+ else if (s === "]" && n > 0) n--;
2068
+ else if (s === "(") r++;
2069
+ else if (s === ")" && r > 0) r--;
2070
+ else if (n === 0 && r === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
2061
2071
  return e.slice(0, i) + t + e.slice(i);
2062
2072
  }
2063
2073
  return e + t;
2064
2074
  }
2065
- const Nt = {
2075
+ const It = {
2066
2076
  before: (e, t) => `${e}::before{${t}}`,
2067
2077
  after: (e, t) => `${e}::after{${t}}`,
2068
2078
  hover: (e, t) => `${G(e, ":hover")}{${t}}`,
@@ -2085,7 +2095,7 @@ const Nt = {
2085
2095
  "peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
2086
2096
  "peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
2087
2097
  "peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
2088
- }, Pe = {
2098
+ }, Me = {
2089
2099
  // Responsive
2090
2100
  sm: "(min-width:640px)",
2091
2101
  md: "(min-width:768px)",
@@ -2094,25 +2104,25 @@ const Nt = {
2094
2104
  "2xl": "(min-width:1536px)",
2095
2105
  // Dark mode (now plain string)
2096
2106
  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;
2107
+ }, je = ["sm", "md", "lg", "xl", "2xl"];
2108
+ function Ne(e) {
2109
+ const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
2110
+ if (r.length < 2) return null;
2111
+ const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
2112
+ if (Number.isNaN(o) || !Ze[i]) return null;
2103
2113
  const a = t ? "-" : "";
2104
- return Ve[i].map((u) => `${u}:calc(${a}${Mt} * ${o});`).join("");
2114
+ return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
2105
2115
  }
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}`;
2116
+ function Ge(e) {
2117
+ const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
2118
+ return `${r} ${i} ${s}`;
2109
2119
  }
2110
- function Wt(e) {
2120
+ function Ht(e) {
2111
2121
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
2112
2122
  if (!t) return null;
2113
- const [, r, n, i = "DEFAULT"] = t, s = jt[n]?.[i];
2123
+ const [, n, r, i = "DEFAULT"] = t, s = Nt[r]?.[i];
2114
2124
  if (!s) return null;
2115
- if (r === "shadow") return `--ce-shadow-color:${s};`;
2125
+ if (n === "shadow") return `--ce-shadow-color:${s};`;
2116
2126
  const a = {
2117
2127
  bg: "background-color",
2118
2128
  decoration: "text-decoration-color",
@@ -2123,44 +2133,44 @@ function Wt(e) {
2123
2133
  accent: "accent-color",
2124
2134
  fill: "fill",
2125
2135
  stroke: "stroke"
2126
- }[r];
2136
+ }[n];
2127
2137
  return a ? `${a}:${s};` : null;
2128
2138
  }
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);
2139
+ function Bt(e) {
2140
+ const [t, n] = e.split("/");
2141
+ if (!n) return { base: t };
2142
+ const r = parseInt(n, 10);
2143
+ return isNaN(r) || r < 0 || r > 100 ? { base: t } : { base: t, opacity: r / 100 };
2144
+ }
2145
+ function We(e) {
2146
+ const { base: t, opacity: n } = Bt(e), r = Ht(t);
2147
+ if (r) {
2148
+ if (n !== void 0) {
2149
+ const s = /#([0-9a-f]{6})/i.exec(r);
2140
2150
  if (s) {
2141
- const o = Je(s[0]);
2142
- return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2151
+ const o = Ge(s[0]);
2152
+ return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2143
2153
  }
2144
2154
  }
2145
- return n;
2155
+ return r;
2146
2156
  }
2147
- const i = Ee(t);
2148
- if (i && r !== void 0) {
2157
+ const i = Se(t);
2158
+ if (i && n !== void 0) {
2149
2159
  const s = /#([0-9a-f]{6})/i.exec(i);
2150
2160
  if (s) {
2151
- const o = Je(s[0]);
2152
- return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2161
+ const o = Ge(s[0]);
2162
+ return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2153
2163
  }
2154
2164
  }
2155
2165
  return i;
2156
2166
  }
2157
- function Ne(e) {
2167
+ function ze(e) {
2158
2168
  const t = /^opacity-(\d{1,3})$/.exec(e);
2159
2169
  if (!t) return null;
2160
- const r = parseInt(t[1], 10);
2161
- return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
2170
+ const n = parseInt(t[1], 10);
2171
+ return n < 0 || n > 100 ? null : `opacity:${n / 100};`;
2162
2172
  }
2163
- function Ee(e) {
2173
+ function Se(e) {
2164
2174
  if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
2165
2175
  const i = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
2166
2176
  if (i) {
@@ -2170,9 +2180,9 @@ function Ee(e) {
2170
2180
  }
2171
2181
  return null;
2172
2182
  }
2173
- const t = e.indexOf("-["), r = e.endsWith("]");
2174
- if (t > 0 && r) {
2175
- const n = e.slice(0, t);
2183
+ const t = e.indexOf("-["), n = e.endsWith("]");
2184
+ if (t > 0 && n) {
2185
+ const r = e.slice(0, t);
2176
2186
  let i = e.slice(t + 2, -1);
2177
2187
  i = i.replace(/_/g, " ");
2178
2188
  const s = {
@@ -2197,6 +2207,8 @@ function Ee(e) {
2197
2207
  "border-r": "border-right",
2198
2208
  "border-x": "border-inline",
2199
2209
  "border-y": "border-block",
2210
+ "grid-cols": "grid-template-columns",
2211
+ "grid-rows": "grid-template-rows",
2200
2212
  transition: "transition-property",
2201
2213
  ease: "transition-timing-function",
2202
2214
  delay: "transition-delay",
@@ -2217,63 +2229,63 @@ function Ee(e) {
2217
2229
  leading: "line-height",
2218
2230
  z: "z-index"
2219
2231
  };
2220
- if (n === "rotate")
2232
+ if (r === "rotate")
2221
2233
  return `transform:rotate(${i});`;
2222
- const o = s[n] ?? n.replace(/_/g, "-");
2234
+ const o = s[r] ?? r.replace(/_/g, "-");
2223
2235
  if (o && i) return `${o}:${i};`;
2224
2236
  }
2225
2237
  return null;
2226
2238
  }
2227
- function Dt(e) {
2239
+ function Ut(e) {
2228
2240
  if (e.startsWith("[") && e.endsWith("]")) {
2229
- const r = e.slice(1, -1);
2230
- return r.includes("&") ? r : e;
2241
+ const n = e.slice(1, -1);
2242
+ return n.includes("&") ? n : e;
2231
2243
  }
2232
2244
  const t = e.indexOf("-[");
2233
2245
  if (t > 0 && e.endsWith("]")) {
2234
- const r = e.slice(t + 2, -1).replace(/_/g, "-");
2235
- return r.includes("&") ? r : e.replace(/_/g, "-");
2246
+ const n = e.slice(t + 2, -1).replace(/_/g, "-");
2247
+ return n.includes("&") ? n : e.replace(/_/g, "-");
2236
2248
  }
2237
2249
  return null;
2238
2250
  }
2239
- function It(e) {
2251
+ function qt(e) {
2240
2252
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
2241
2253
  }
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);
2254
+ function Ft(e) {
2255
+ const t = /class\s*=\s*(['"])(.*?)\1/g, n = [];
2256
+ let r;
2257
+ for (; r = t.exec(e); ) {
2258
+ const i = r[2].split(/\s+/).filter(Boolean);
2259
+ i.length && n.push(...i);
2248
2260
  }
2249
- return r.filter(Boolean);
2261
+ return n.filter(Boolean);
2250
2262
  }
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) {
2263
+ const Xe = /* @__PURE__ */ new Map(), Kt = 16;
2264
+ function Vt(e) {
2265
+ const t = Date.now(), n = Xe.get(e);
2266
+ if (n && t - n.timestamp < Kt) return n.css;
2267
+ const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [], y = {};
2268
+ function g(w, c = !1) {
2269
+ const p = (c ? "dark|" : "") + w;
2270
+ if (p in y) return y[p];
2271
+ const m = d(w, c);
2272
+ return y[p] = m, m;
2273
+ }
2274
+ function b(w) {
2275
+ const c = w.some((m) => je.includes(m)), p = w.includes("dark");
2276
+ return w.length === 0 ? 1 : !c && !p ? 2 : c && !p ? 3 : 4;
2277
+ }
2278
+ function h(w) {
2267
2279
  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;
2280
+ let p = "", m = 0, C = 0;
2281
+ for (let k = 0; k < w.length; k++) {
2282
+ const f = w[k];
2283
+ f === "[" ? m++ : f === "]" && m > 0 ? m-- : f === "(" ? C++ : f === ")" && C > 0 && C--, f === ":" && m === 0 && C === 0 ? (c.push(p), p = "") : p += f;
2272
2284
  }
2273
2285
  return p && c.push(p), c;
2274
2286
  }
2275
- function l(b) {
2276
- switch (b) {
2287
+ function l(w) {
2288
+ switch (w) {
2277
2289
  case "hover":
2278
2290
  return ":hover";
2279
2291
  case "focus":
@@ -2302,126 +2314,126 @@ function Ut(e) {
2302
2314
  return null;
2303
2315
  }
2304
2316
  }
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)));
2317
+ function d(w, c = !1) {
2318
+ const p = h(w);
2319
+ let m = !1;
2320
+ const C = p.find((E) => (E.startsWith("!") && (m = !0, E = E.slice(1)), Le[E] || Ne(E) || ze(E) || We(E) || Se(E)));
2309
2321
  if (!C) return null;
2310
- const k = C.replace(/^!/, ""), f = Oe[k] ?? je(k) ?? Ne(k) ?? Me(k) ?? Ee(k);
2322
+ const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
2311
2323
  if (!f) return null;
2312
2324
  const x = p.indexOf(C);
2313
2325
  let A = x >= 0 ? p.slice(0, x) : [];
2314
2326
  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 $ = [];
2327
+ const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = m ? f.replace(/;$/, " !important;") : f;
2328
+ let R = $;
2329
+ const S = [];
2318
2330
  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));
2331
+ 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));
2332
+ A = A.filter((E) => !S.includes(E));
2321
2333
  const P = [], B = [];
2322
- let J = null;
2334
+ let V = null;
2323
2335
  for (const E of A) {
2324
- if (E === "dark" || Le.includes(E)) continue;
2325
- const U = Dt(E);
2336
+ if (E === "dark" || je.includes(E)) continue;
2337
+ const U = Ut(E);
2326
2338
  if (U) {
2327
- J = U;
2339
+ V = U;
2328
2340
  continue;
2329
2341
  }
2330
2342
  const D = l(E);
2331
2343
  if (D) {
2332
- J ? B.push(D) : P.push(D);
2344
+ V ? B.push(D) : P.push(D);
2333
2345
  continue;
2334
2346
  }
2335
- const z = Nt[E];
2336
- typeof z == "function" && (T = z(T, R).split("{")[0]);
2347
+ const W = It[E];
2348
+ typeof W == "function" && (R = W(R, T).split("{")[0]);
2337
2349
  }
2338
- function ye(E, U) {
2350
+ function we(E, U) {
2339
2351
  if (!U) return E;
2340
- let D = 0, z = 0;
2352
+ let D = 0, W = 0;
2341
2353
  if (E.length && (E[0] === ">" || E[0] === "+" || E[0] === "~" || E[0] === " ")) {
2342
2354
  let O = 1;
2343
2355
  for (; O < E.length && E[O] === " "; ) O++;
2344
2356
  for (; O < E.length; O++) {
2345
2357
  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] === " "))
2358
+ 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
2359
  return E.slice(0, O) + U + E.slice(O);
2348
2360
  }
2349
2361
  return E + U;
2350
2362
  }
2351
2363
  for (let O = 0; O < E.length; O++) {
2352
2364
  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 === " "))
2365
+ if (I === "[" ? D++ : I === "]" && D > 0 ? D-- : I === "(" ? W++ : I === ")" && W > 0 && W--, D === 0 && W === 0 && (I === ">" || I === "+" || I === "~" || I === " "))
2354
2366
  return E.slice(0, O) + U + E.slice(O);
2355
2367
  }
2356
2368
  return E + U;
2357
2369
  }
2358
2370
  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;
2371
+ if (V)
2372
+ if (V.includes("&")) {
2373
+ const E = V.indexOf("&"), U = V.slice(0, E), D = V.slice(E + 1), W = $ + K, O = R;
2362
2374
  if (P.length === 0)
2363
- T = O.replace(S, U + z + L + D);
2375
+ R = O.replace($, U + W + L + D);
2364
2376
  else {
2365
- const I = ye(D, L);
2366
- T = O.replace(S, U + z + I);
2377
+ const I = we(D, L);
2378
+ R = O.replace($, U + W + I);
2367
2379
  }
2368
2380
  } else
2369
- T = T.replace(S, `${J}${S + K}`), L && (T = T.replace(S, `${S}${L}`));
2381
+ R = R.replace($, `${V}${$ + K}`), L && (R = R.replace($, `${$}${L}`));
2370
2382
  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)
2383
+ R = $ + K + L;
2384
+ R = R.replace(new RegExp($, "g"), _);
2385
+ let M = `${R}{${T}}`;
2386
+ const J = A.filter((E) => je.includes(E)), Z = J.length ? J[J.length - 1] : null, z = A.includes("dark");
2387
+ 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;
2388
+ }
2389
+ for (const w of i) {
2390
+ const c = h(w), p = c.find(
2391
+ (f) => Le[f] || Ne(f) || ze(f) || We(f) || Se(f)
2380
2392
  );
2381
2393
  if (!p) continue;
2382
- const y = c.indexOf(p), C = y >= 0 ? c.slice(0, y) : [], k = w(C);
2394
+ const m = c.indexOf(p), C = m >= 0 ? c.slice(0, m) : [], k = b(C);
2383
2395
  if (k === 4) {
2384
- const f = g(b, !0);
2396
+ const f = g(w, !0);
2385
2397
  f && u.push(f);
2386
2398
  } else {
2387
- const f = g(b);
2399
+ const f = g(w);
2388
2400
  f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
2389
2401
  }
2390
2402
  }
2391
2403
  const v = [...s, ...o, ...a, ...u].join("");
2392
- return Ze.set(e, { css: v, timestamp: t }), v;
2404
+ return Xe.set(e, { css: v, timestamp: t }), v;
2393
2405
  }
2394
- const pe = [];
2395
- function qt(e, t, r, n, i, s, o, a) {
2406
+ const ge = [];
2407
+ function Jt(e, t, n, r, i, s, o, a) {
2396
2408
  if (e) {
2397
- pe.push(r);
2409
+ ge.push(n);
2398
2410
  try {
2399
- const u = t.render(r);
2411
+ const u = t.render(n);
2400
2412
  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);
2413
+ s(!0), u.then((y) => {
2414
+ s(!1), o(null), Ye(e, y, n, r, i), a(e.innerHTML);
2415
+ }).catch((y) => {
2416
+ s(!1), o(y);
2405
2417
  });
2406
2418
  return;
2407
2419
  }
2408
- Ge(e, u, r, n, i), a(e.innerHTML);
2420
+ Ye(e, u, n, r, i), a(e.innerHTML);
2409
2421
  } finally {
2410
- pe.pop();
2422
+ ge.pop();
2411
2423
  }
2412
2424
  }
2413
2425
  }
2414
- function Ge(e, t, r, n, i) {
2415
- e && (Rt(
2426
+ function Ye(e, t, n, r, i) {
2427
+ e && (Ot(
2416
2428
  e,
2417
2429
  Array.isArray(t) ? t : [t],
2418
- r,
2419
- n
2430
+ n,
2431
+ r
2420
2432
  ), i(e.innerHTML));
2421
2433
  }
2422
- function Ft(e, t, r, n, i, s, o) {
2434
+ function Zt(e, t, n, r, i, s, o) {
2423
2435
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
2424
- if (i(r + 1), r === 15)
2436
+ if (i(n + 1), n === 15)
2425
2437
  console.warn(
2426
2438
  `⚠️ Component is re-rendering rapidly. This might indicate:
2427
2439
  Common causes:
@@ -2430,7 +2442,7 @@ function Ft(e, t, r, n, i, s, o) {
2430
2442
  • Missing dependencies in computed/watch
2431
2443
  Component rendering will be throttled to prevent browser freeze.`
2432
2444
  );
2433
- else if (r > 20) {
2445
+ else if (n > 20) {
2434
2446
  console.error(
2435
2447
  `🛑 Infinite loop detected in component render:
2436
2448
  • This might be caused by state updates during render
@@ -2441,41 +2453,41 @@ Stopping runaway component render to prevent browser freeze`
2441
2453
  }
2442
2454
  } else
2443
2455
  i(0);
2444
- const m = setTimeout(() => {
2445
- n(Date.now()), e(), o(null);
2446
- }, r > 10 ? 100 : 0);
2447
- o(m);
2456
+ const y = setTimeout(() => {
2457
+ r(Date.now()), e(), o(null);
2458
+ }, n > 10 ? 100 : 0);
2459
+ o(y);
2448
2460
  }
2449
- function Kt(e, t, r, n, i) {
2461
+ function Gt(e, t, n, r, i) {
2450
2462
  if (!e) return;
2451
- const s = Ut(r);
2463
+ const s = Vt(n);
2452
2464
  if ((!s || s.trim() === "") && !t._computedStyle) {
2453
- i(null), e.adoptedStyleSheets = [Ke()];
2465
+ i(null), e.adoptedStyleSheets = [Je()];
2454
2466
  return;
2455
2467
  }
2456
2468
  let o = "";
2457
2469
  t._computedStyle && (o = t._computedStyle);
2458
- let a = Ot(`${o}
2470
+ let a = Lt(`${o}
2459
2471
  ${s}
2460
2472
  `);
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);
2473
+ a = ct(a);
2474
+ let u = r;
2475
+ u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
2464
2476
  }
2465
2477
  let N = null;
2466
- function Vt(e) {
2478
+ function Xt(e) {
2467
2479
  N = e;
2468
2480
  }
2469
- function Jt() {
2481
+ function Yt() {
2470
2482
  N = null;
2471
2483
  }
2472
- function lr() {
2484
+ function hn() {
2473
2485
  if (!N)
2474
2486
  throw new Error("useEmit must be called during component render");
2475
2487
  const e = N.emit;
2476
- return (t, r) => e(t, r);
2488
+ return (t, n) => e(t, n);
2477
2489
  }
2478
- function ge(e) {
2490
+ function me(e) {
2479
2491
  e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
2480
2492
  value: {},
2481
2493
  writable: !0,
@@ -2483,30 +2495,30 @@ function ge(e) {
2483
2495
  configurable: !1
2484
2496
  });
2485
2497
  }
2486
- function ur(e) {
2498
+ function gn(e) {
2487
2499
  if (!N)
2488
2500
  throw new Error("useOnConnected must be called during component render");
2489
- ge(N), N._hookCallbacks.onConnected = e;
2501
+ me(N), N._hookCallbacks.onConnected = e;
2490
2502
  }
2491
- function fr(e) {
2503
+ function yn(e) {
2492
2504
  if (!N)
2493
2505
  throw new Error("useOnDisconnected must be called during component render");
2494
- ge(N), N._hookCallbacks.onDisconnected = e;
2506
+ me(N), N._hookCallbacks.onDisconnected = e;
2495
2507
  }
2496
- function dr(e) {
2508
+ function mn(e) {
2497
2509
  if (!N)
2498
2510
  throw new Error("useOnAttributeChanged must be called during component render");
2499
- ge(N), N._hookCallbacks.onAttributeChanged = e;
2511
+ me(N), N._hookCallbacks.onAttributeChanged = e;
2500
2512
  }
2501
- function pr(e) {
2513
+ function bn(e) {
2502
2514
  if (!N)
2503
2515
  throw new Error("useOnError must be called during component render");
2504
- ge(N), N._hookCallbacks.onError = e;
2516
+ me(N), N._hookCallbacks.onError = e;
2505
2517
  }
2506
- function hr(e) {
2518
+ function wn(e) {
2507
2519
  if (!N)
2508
2520
  throw new Error("useStyle must be called during component render");
2509
- ge(N);
2521
+ me(N);
2510
2522
  try {
2511
2523
  const t = e();
2512
2524
  Object.defineProperty(N, "_computedStyle", {
@@ -2524,12 +2536,12 @@ function hr(e) {
2524
2536
  });
2525
2537
  }
2526
2538
  }
2527
- const $e = /* @__PURE__ */ new Map(), Xe = Symbol.for("cer.registry");
2539
+ const Te = /* @__PURE__ */ new Map(), Qe = Symbol.for("cer.registry");
2528
2540
  if (typeof window < "u") {
2529
2541
  const e = globalThis;
2530
- e[Xe] || (e[Xe] = $e);
2542
+ e[Qe] || (e[Qe] = Te);
2531
2543
  }
2532
- function Zt(e, t) {
2544
+ function Qt(e, t) {
2533
2545
  if (!t.render)
2534
2546
  throw new Error(
2535
2547
  "Component must have a render function"
@@ -2574,34 +2586,34 @@ function Zt(e, t) {
2574
2586
  _templateLoading = !1;
2575
2587
  _templateError = null;
2576
2588
  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", {
2589
+ super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
2590
+ const n = this._initContext(t);
2591
+ Object.defineProperty(n, "refs", {
2580
2592
  value: this._refs,
2581
2593
  writable: !1,
2582
2594
  enumerable: !1,
2583
2595
  configurable: !1
2584
- }), Object.defineProperty(r, "requestRender", {
2596
+ }), Object.defineProperty(n, "requestRender", {
2585
2597
  value: () => this.requestRender(),
2586
2598
  writable: !1,
2587
2599
  enumerable: !1,
2588
2600
  configurable: !1
2589
- }), Object.defineProperty(r, "_requestRender", {
2601
+ }), Object.defineProperty(n, "_requestRender", {
2590
2602
  value: () => this._requestRender(),
2591
2603
  writable: !1,
2592
2604
  enumerable: !1,
2593
2605
  configurable: !1
2594
- }), Object.defineProperty(r, "_componentId", {
2606
+ }), Object.defineProperty(n, "_componentId", {
2595
2607
  value: this._componentId,
2596
2608
  writable: !1,
2597
2609
  enumerable: !1,
2598
2610
  configurable: !1
2599
- }), Object.defineProperty(r, "_triggerWatchers", {
2611
+ }), Object.defineProperty(n, "_triggerWatchers", {
2600
2612
  value: (i, s) => this._triggerWatchers(i, s),
2601
2613
  writable: !1,
2602
2614
  enumerable: !1,
2603
2615
  configurable: !1
2604
- }), this.context = r, Object.defineProperty(this.context, "emit", {
2616
+ }), this.context = n, Object.defineProperty(this.context, "emit", {
2605
2617
  value: (i, s, o) => {
2606
2618
  const a = new CustomEvent(i, {
2607
2619
  detail: s,
@@ -2615,11 +2627,11 @@ function Zt(e, t) {
2615
2627
  enumerable: !1,
2616
2628
  configurable: !1
2617
2629
  });
2618
- const n = $e.get(e) || t;
2619
- Object.keys(n).forEach((i) => {
2620
- const s = n[i];
2630
+ const r = Te.get(e) || t;
2631
+ Object.keys(r).forEach((i) => {
2632
+ const s = r[i];
2621
2633
  typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
2622
- }), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
2634
+ }), this._applyComputed(r), r.props && Object.keys(r.props).forEach((i) => {
2623
2635
  let s = this[i];
2624
2636
  Object.defineProperty(this, i, {
2625
2637
  get() {
@@ -2627,28 +2639,28 @@ function Zt(e, t) {
2627
2639
  },
2628
2640
  set(o) {
2629
2641
  const a = s;
2630
- s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
2642
+ s = o, this.context[i] = o, this._initializing || (this._applyProps(r), a !== o && this._requestRender());
2631
2643
  },
2632
2644
  enumerable: !0,
2633
2645
  configurable: !0
2634
2646
  });
2635
- }), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
2647
+ }), this._initializing = !1, this._initWatchers(r), this._applyProps(r), this._render(r);
2636
2648
  }
2637
2649
  connectedCallback() {
2638
2650
  this._runLogicWithinErrorBoundary(t, () => {
2639
- this._applyProps(t), this._requestRender(), bt(
2651
+ this._applyProps(t), this._requestRender(), vt(
2640
2652
  t,
2641
2653
  this.context,
2642
2654
  this._mounted,
2643
- (r) => {
2644
- this._mounted = r;
2655
+ (n) => {
2656
+ this._mounted = n;
2645
2657
  }
2646
2658
  );
2647
2659
  });
2648
2660
  }
2649
2661
  disconnectedCallback() {
2650
2662
  this._runLogicWithinErrorBoundary(t, () => {
2651
- wt(
2663
+ xt(
2652
2664
  t,
2653
2665
  this.context,
2654
2666
  this._listeners,
@@ -2658,52 +2670,52 @@ function Zt(e, t) {
2658
2670
  () => {
2659
2671
  this._watchers.clear();
2660
2672
  },
2661
- (r) => {
2662
- this._templateLoading = r;
2673
+ (n) => {
2674
+ this._templateLoading = n;
2663
2675
  },
2664
- (r) => {
2665
- this._templateError = r;
2676
+ (n) => {
2677
+ this._templateError = n;
2666
2678
  },
2667
- (r) => {
2668
- this._mounted = r;
2679
+ (n) => {
2680
+ this._mounted = n;
2669
2681
  }
2670
2682
  );
2671
2683
  });
2672
2684
  }
2673
- attributeChangedCallback(r, n, i) {
2685
+ attributeChangedCallback(n, r, i) {
2674
2686
  this._runLogicWithinErrorBoundary(t, () => {
2675
- this._applyProps(t), n !== i && this._requestRender(), vt(
2687
+ this._applyProps(t), r !== i && this._requestRender(), kt(
2676
2688
  t,
2677
- r,
2678
2689
  n,
2690
+ r,
2679
2691
  i,
2680
2692
  this.context
2681
2693
  );
2682
2694
  });
2683
2695
  }
2684
2696
  static get observedAttributes() {
2685
- return t.props ? Object.keys(t.props).map(te) : [];
2697
+ return t.props ? Object.keys(t.props).map(ne) : [];
2686
2698
  }
2687
- _applyComputed(r) {
2699
+ _applyComputed(n) {
2688
2700
  }
2689
2701
  // --- Render ---
2690
- _render(r) {
2691
- this._runLogicWithinErrorBoundary(r, () => {
2692
- qt(
2702
+ _render(n) {
2703
+ this._runLogicWithinErrorBoundary(n, () => {
2704
+ Jt(
2693
2705
  this.shadowRoot,
2694
- r,
2706
+ n,
2695
2707
  this.context,
2696
2708
  this._refs,
2697
- (n) => {
2698
- this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
2709
+ (r) => {
2710
+ this._lastHtmlStringForJitCSS = r, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(r);
2699
2711
  },
2700
- (n) => {
2701
- this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
2712
+ (r) => {
2713
+ this._templateLoading = r, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(r);
2702
2714
  },
2703
- (n) => {
2704
- this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
2715
+ (r) => {
2716
+ this._templateError = r, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(r);
2705
2717
  },
2706
- (n) => this._applyStyle(r, n)
2718
+ (r) => this._applyStyle(n, r)
2707
2719
  );
2708
2720
  });
2709
2721
  }
@@ -2712,32 +2724,32 @@ function Zt(e, t) {
2712
2724
  }
2713
2725
  _requestRender() {
2714
2726
  this._runLogicWithinErrorBoundary(this._cfg, () => {
2715
- le(() => {
2716
- Ft(
2727
+ fe(() => {
2728
+ Zt(
2717
2729
  () => this._render(this._cfg),
2718
2730
  this._lastRenderTime,
2719
2731
  this._renderCount,
2720
- (r) => {
2721
- this._lastRenderTime = r;
2732
+ (n) => {
2733
+ this._lastRenderTime = n;
2722
2734
  },
2723
- (r) => {
2724
- this._renderCount = r;
2735
+ (n) => {
2736
+ this._renderCount = n;
2725
2737
  },
2726
2738
  this._renderTimeoutId,
2727
- (r) => {
2728
- this._renderTimeoutId = r;
2739
+ (n) => {
2740
+ this._renderTimeoutId = n;
2729
2741
  }
2730
2742
  );
2731
2743
  }, this._componentId);
2732
2744
  });
2733
2745
  }
2734
2746
  // --- Style ---
2735
- _applyStyle(r, n) {
2736
- this._runLogicWithinErrorBoundary(r, () => {
2737
- Kt(
2747
+ _applyStyle(n, r) {
2748
+ this._runLogicWithinErrorBoundary(n, () => {
2749
+ Gt(
2738
2750
  this.shadowRoot,
2739
2751
  this.context,
2740
- n,
2752
+ r,
2741
2753
  this._styleSheet,
2742
2754
  (i) => {
2743
2755
  this._styleSheet = i;
@@ -2746,21 +2758,21 @@ function Zt(e, t) {
2746
2758
  });
2747
2759
  }
2748
2760
  // --- Error Boundary function ---
2749
- _runLogicWithinErrorBoundary(r, n) {
2761
+ _runLogicWithinErrorBoundary(n, r) {
2750
2762
  this._hasError && (this._hasError = !1);
2751
2763
  try {
2752
- n();
2764
+ r();
2753
2765
  } catch (i) {
2754
- this._hasError = !0, r.onError && r.onError(i, this.context);
2766
+ this._hasError = !0, n.onError && n.onError(i, this.context);
2755
2767
  }
2756
2768
  }
2757
2769
  // --- State, props, computed ---
2758
- _initContext(r) {
2770
+ _initContext(n) {
2759
2771
  try {
2760
- let n = function(s, o = "") {
2772
+ let r = function(s, o = "") {
2761
2773
  return Array.isArray(s) ? new Proxy(s, {
2762
- get(a, u, m) {
2763
- const g = Reflect.get(a, u, m);
2774
+ get(a, u, y) {
2775
+ const g = Reflect.get(a, u, y);
2764
2776
  return typeof g == "function" && typeof u == "string" && [
2765
2777
  "push",
2766
2778
  "pop",
@@ -2773,56 +2785,56 @@ function Zt(e, t) {
2773
2785
  const l = g.apply(a, h);
2774
2786
  if (!i._initializing) {
2775
2787
  const d = o || "root";
2776
- i._triggerWatchers(d, a), le(() => i._render(r), i._componentId);
2788
+ i._triggerWatchers(d, a), fe(() => i._render(n), i._componentId);
2777
2789
  }
2778
2790
  return l;
2779
2791
  } : g;
2780
2792
  },
2781
- set(a, u, m) {
2782
- if (a[u] = m, !i._initializing) {
2793
+ set(a, u, y) {
2794
+ if (a[u] = y, !i._initializing) {
2783
2795
  const g = o ? `${o}.${String(u)}` : String(u);
2784
- i._triggerWatchers(g, m), le(() => i._render(r), i._componentId);
2796
+ i._triggerWatchers(g, y), fe(() => i._render(n), i._componentId);
2785
2797
  }
2786
2798
  return !0;
2787
2799
  },
2788
2800
  deleteProperty(a, u) {
2789
2801
  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);
2802
+ const y = o ? `${o}.${String(u)}` : String(u);
2803
+ i._triggerWatchers(y, void 0), fe(() => i._render(n), i._componentId);
2792
2804
  }
2793
2805
  return !0;
2794
2806
  }
2795
2807
  }) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
2796
2808
  const u = o ? `${o}.${a}` : a;
2797
- s[a] = n(s[a], u);
2809
+ s[a] = r(s[a], u);
2798
2810
  }), new Proxy(s, {
2799
- set(a, u, m) {
2811
+ set(a, u, y) {
2800
2812
  const g = o ? `${o}.${String(u)}` : String(u);
2801
- return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
2813
+ return a[u] = r(y, g), i._initializing || (i._triggerWatchers(
2802
2814
  g,
2803
2815
  a[u]
2804
- ), le(() => i._render(r), i._componentId)), !0;
2816
+ ), fe(() => i._render(n), i._componentId)), !0;
2805
2817
  },
2806
- get(a, u, m) {
2807
- return Reflect.get(a, u, m);
2818
+ get(a, u, y) {
2819
+ return Reflect.get(a, u, y);
2808
2820
  }
2809
2821
  })) : s;
2810
2822
  };
2811
2823
  const i = this;
2812
- return n({
2824
+ return r({
2813
2825
  // For functional components, state is managed by state() function calls
2814
2826
  // 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])
2827
+ ...n.props ? Object.fromEntries(
2828
+ Object.entries(n.props).map(([s, o]) => [s, o.default])
2817
2829
  ) : {}
2818
2830
  });
2819
2831
  } catch {
2820
2832
  return {};
2821
2833
  }
2822
2834
  }
2823
- _initWatchers(r) {
2824
- this._runLogicWithinErrorBoundary(r, () => {
2825
- ht(
2835
+ _initWatchers(n) {
2836
+ this._runLogicWithinErrorBoundary(n, () => {
2837
+ yt(
2826
2838
  this.context,
2827
2839
  this._watchers,
2828
2840
  {}
@@ -2830,41 +2842,41 @@ function Zt(e, t) {
2830
2842
  );
2831
2843
  });
2832
2844
  }
2833
- _triggerWatchers(r, n) {
2834
- gt(this.context, this._watchers, r, n);
2845
+ _triggerWatchers(n, r) {
2846
+ mt(this.context, this._watchers, n, r);
2835
2847
  }
2836
- _applyProps(r) {
2837
- this._runLogicWithinErrorBoundary(r, () => {
2848
+ _applyProps(n) {
2849
+ this._runLogicWithinErrorBoundary(n, () => {
2838
2850
  try {
2839
- yt(this, r, this.context);
2840
- } catch (n) {
2841
- this._hasError = !0, r.onError && r.onError(n, this.context);
2851
+ wt(this, n, this.context);
2852
+ } catch (r) {
2853
+ this._hasError = !0, n.onError && n.onError(r, this.context);
2842
2854
  }
2843
2855
  });
2844
2856
  }
2845
2857
  };
2846
2858
  }
2847
- function Ye(e, t) {
2848
- let r = te(e);
2849
- r.includes("-") || (r = `cer-${r}`);
2850
- let n = {};
2859
+ function et(e, t) {
2860
+ let n = ne(e);
2861
+ n.includes("-") || (n = `cer-${n}`);
2862
+ let r = {};
2851
2863
  if (typeof window < "u")
2852
2864
  try {
2853
2865
  const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
2854
2866
  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();
2867
+ const y = a[1].split(",").map((g) => g.trim());
2868
+ for (const g of y) {
2869
+ const b = g.indexOf("=");
2870
+ if (b !== -1) {
2871
+ const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
2860
2872
  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;
2873
+ 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
2874
  } catch {
2863
- n[h] = "";
2875
+ r[h] = "";
2864
2876
  }
2865
2877
  } else {
2866
2878
  const h = g.split(":")[0].trim();
2867
- h && !h.includes("}") && (n[h] = "");
2879
+ h && !h.includes("}") && (r[h] = "");
2868
2880
  }
2869
2881
  }
2870
2882
  }
@@ -2874,7 +2886,7 @@ function Ye(e, t) {
2874
2886
  const s = {
2875
2887
  // Generate props config from defaults
2876
2888
  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 }])
2889
+ Object.entries(r).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
2878
2890
  ),
2879
2891
  // Add lifecycle hooks from the stored functions
2880
2892
  onConnected: (o) => {
@@ -2883,55 +2895,55 @@ function Ye(e, t) {
2883
2895
  onDisconnected: (o) => {
2884
2896
  i.onDisconnected && i.onDisconnected();
2885
2897
  },
2886
- onAttributeChanged: (o, a, u, m) => {
2898
+ onAttributeChanged: (o, a, u, y) => {
2887
2899
  i.onAttributeChanged && i.onAttributeChanged(o, a, u);
2888
2900
  },
2889
2901
  onError: (o, a) => {
2890
2902
  i.onError && o && i.onError(o);
2891
2903
  },
2892
2904
  render: (o) => {
2893
- const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
2905
+ const a = o._componentId || `${n}-${Math.random().toString(36).substr(2, 9)}`;
2894
2906
  F.setCurrentComponent(a, () => {
2895
2907
  o.requestRender && o.requestRender();
2896
2908
  });
2897
2909
  try {
2898
- Vt(o);
2899
- const u = Object.keys(n).length > 0;
2900
- let m;
2910
+ Xt(o);
2911
+ const u = Object.keys(r).length > 0;
2912
+ let y;
2901
2913
  if (u) {
2902
2914
  const g = {};
2903
- Object.keys(n).forEach((w) => {
2904
- g[w] = o[w] ?? n[w];
2905
- }), m = t(g);
2915
+ Object.keys(r).forEach((b) => {
2916
+ g[b] = o[b] ?? r[b];
2917
+ }), y = t(g);
2906
2918
  } else
2907
- m = t();
2919
+ y = t();
2908
2920
  if (o._hookCallbacks) {
2909
2921
  const g = o._hookCallbacks;
2910
2922
  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
2923
  }
2912
- return m;
2924
+ return y;
2913
2925
  } finally {
2914
- Jt(), F.clearCurrentComponent();
2926
+ Yt(), F.clearCurrentComponent();
2915
2927
  }
2916
2928
  }
2917
2929
  };
2918
- $e.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Zt(r, s)));
2930
+ Te.set(n, s), typeof window < "u" && (customElements.get(n) || customElements.define(n, Qt(n, s)));
2919
2931
  }
2920
- class Gt {
2932
+ class en {
2921
2933
  map = /* @__PURE__ */ new Map();
2922
2934
  maxSize;
2923
2935
  constructor(t) {
2924
2936
  this.maxSize = t;
2925
2937
  }
2926
2938
  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;
2939
+ const n = this.map.get(t);
2940
+ if (n !== void 0)
2941
+ return this.map.delete(t), this.map.set(t, n), n;
2930
2942
  }
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);
2943
+ set(t, n) {
2944
+ if (this.map.has(t) && this.map.delete(t), this.map.set(t, n), this.map.size > this.maxSize) {
2945
+ const r = this.map.keys().next().value;
2946
+ r !== void 0 && this.map.delete(r);
2935
2947
  }
2936
2948
  }
2937
2949
  has(t) {
@@ -2941,8 +2953,8 @@ class Gt {
2941
2953
  this.map.clear();
2942
2954
  }
2943
2955
  }
2944
- const We = new Gt(500);
2945
- function Xt(e, t) {
2956
+ const De = new en(500);
2957
+ function tn(e, t) {
2946
2958
  if (e == null) {
2947
2959
  console.warn(
2948
2960
  `⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
@@ -2955,71 +2967,71 @@ function Xt(e, t) {
2955
2967
  `💡 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
2968
  );
2957
2969
  }
2958
- function fe(e, t = {}, r, n) {
2959
- const i = n ?? t.key;
2960
- return { tag: e, key: i, props: t, children: r };
2970
+ function pe(e, t = {}, n, r) {
2971
+ const i = r ?? t.key;
2972
+ return { tag: e, key: i, props: t, children: n };
2961
2973
  }
2962
- function Se(e) {
2974
+ function Ae(e) {
2963
2975
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
2964
2976
  }
2965
- function ke(e) {
2966
- return typeof e == "object" && e !== null && "tag" in e && !Se(e);
2977
+ function _e(e) {
2978
+ return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
2967
2979
  }
2968
- function Yt(e, t) {
2980
+ function nn(e, t) {
2969
2981
  return e.key != null ? e : { ...e, key: t };
2970
2982
  }
2971
- function Qt(e, t = [], r = {}) {
2972
- const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2983
+ function rn(e, t = [], n = {}) {
2984
+ const r = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2973
2985
  let u;
2974
2986
  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;
2987
+ const y = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
2988
+ let l = h ? t[Number(h[1])] ?? null : b;
2977
2989
  h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
2978
2990
  const d = ["model", "bind", "show", "class", "style", "ref"];
2979
- if (m === ":") {
2980
- const [v, b] = g.split(":"), [c, ...p] = v.split(".");
2991
+ if (y === ":") {
2992
+ const [v, w] = g.split(":"), [c, ...p] = v.split(".");
2981
2993
  if (d.includes(c)) {
2982
- const y = [...p], C = c === "model" && b ? `model:${b}` : c;
2994
+ const m = [...p], C = c === "model" && w ? `model:${w}` : c;
2983
2995
  s[C] = {
2984
2996
  value: l,
2985
- modifiers: y,
2986
- arg: b
2997
+ modifiers: m,
2998
+ arg: w
2987
2999
  };
2988
3000
  } else {
2989
- let y = l;
2990
- y && typeof y == "object" && y.constructor?.name === "ReactiveState" && (y = y.value), i[g] = y, o.push(g);
3001
+ let m = l;
3002
+ m && ee(m) && (m = m.value), i[g] = m, o.push(g);
2991
3003
  }
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;
3004
+ } else if (y === "@") {
3005
+ const [v, ...w] = g.split("."), c = w;
3006
+ tn(l, v);
3007
+ const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
2996
3008
  if (p) {
2997
- const y = (k) => {
3009
+ const m = (k) => {
2998
3010
  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);
3011
+ return c.includes("once") && k.currentTarget?.removeEventListener(v, m), p(k);
3000
3012
  }, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
3001
- n[C] = y;
3013
+ r[C] = m;
3002
3014
  }
3003
- } else g === "ref" ? n.ref = l : i[g] = l;
3015
+ } else g === "ref" ? r.ref = l : i[g] = l;
3004
3016
  }
3005
- return { props: n, attrs: i, directives: s, bound: o };
3017
+ return { props: r, attrs: i, directives: s, bound: o };
3006
3018
  }
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;
3019
+ function sn(e, t, n) {
3020
+ 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
3021
  if (s && o) {
3010
- const f = We.get(o);
3022
+ const f = De.get(o);
3011
3023
  if (f) return f;
3012
3024
  }
3013
3025
  function a(f, x) {
3014
- return fe("#text", {}, f, x);
3026
+ return pe("#text", {}, f, x);
3015
3027
  }
3016
3028
  let u = "";
3017
3029
  for (let f = 0; f < e.length; f++)
3018
3030
  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 = [];
3031
+ const y = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3032
+ let b, h = [], l = null, d = {}, v, w = 0, c = [];
3021
3033
  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) => {
3034
+ !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((x) => {
3023
3035
  if (x === "style" && d.attrs.style) {
3024
3036
  const A = d.attrs.style.replace(
3025
3037
  /;?\s*$/,
@@ -3027,35 +3039,35 @@ function er(e, t, r) {
3027
3039
  ), _ = f.attrs.style.replace(/^;?\s*/, "");
3028
3040
  d.attrs.style = A + "; " + _;
3029
3041
  } 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 = [
3042
+ const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
3031
3043
  .../* @__PURE__ */ new Set([...A, ..._])
3032
3044
  ];
3033
- d.attrs.class = S.join(" ");
3045
+ d.attrs.class = $.join(" ");
3034
3046
  } else
3035
3047
  d.attrs[x] = f.attrs[x];
3036
3048
  }))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
3037
3049
  }
3038
- function y(f, x) {
3050
+ function m(f, x) {
3039
3051
  const A = l ? h : c;
3040
- if (Se(f)) {
3052
+ if (Ae(f)) {
3041
3053
  const _ = f.key ?? x;
3042
- let S = f.children;
3054
+ let $ = f.children;
3043
3055
  A.push({
3044
3056
  ...f,
3045
3057
  key: _,
3046
- children: S
3058
+ children: $
3047
3059
  });
3048
3060
  return;
3049
3061
  }
3050
- if (ke(f)) {
3051
- A.push(Yt(f, void 0));
3062
+ if (_e(f)) {
3063
+ A.push(nn(f, void 0));
3052
3064
  return;
3053
3065
  }
3054
3066
  if (Array.isArray(f)) {
3055
3067
  if (f.length === 0) return;
3056
3068
  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}-${_}`));
3069
+ const $ = f[_];
3070
+ Ae($) || _e($) || Array.isArray($) ? m($, `${x}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${x}-${_}`));
3059
3071
  }
3060
3072
  return;
3061
3073
  }
@@ -3081,20 +3093,20 @@ function er(e, t, r) {
3081
3093
  "track",
3082
3094
  "wbr"
3083
3095
  ]);
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), {
3096
+ for (; b = y.exec(u); )
3097
+ if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
3098
+ if (b[1]) {
3099
+ const f = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3088
3100
  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")))
3101
+ attrs: $,
3102
+ directives: T,
3103
+ bound: R
3104
+ } = rn(b[2] || "", t, i), S = { props: {}, attrs: {} };
3105
+ for (const P in _) S.props[P] = _[P];
3106
+ for (const P in $) S.attrs[P] = $[P];
3107
+ if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
3096
3108
  try {
3097
- $.props.key = $.attrs.key;
3109
+ S.props.key = S.attrs.key;
3098
3110
  } catch {
3099
3111
  }
3100
3112
  try {
@@ -3107,188 +3119,188 @@ function er(e, t, r) {
3107
3119
  audio: ["muted", "autoplay", "controls", "loop"],
3108
3120
  img: ["src", "alt", "width", "height"],
3109
3121
  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];
3122
+ }, B = f.toLowerCase(), V = P[B] ?? [];
3123
+ if (S.attrs) {
3124
+ for (const K of V)
3125
+ if (R && R.includes(K) && K in S.attrs && !(S.props && K in S.props)) {
3126
+ let L = S.attrs[K];
3127
+ L && ee(L) && (L = L.value), S.props[K] = L, delete S.attrs[K];
3116
3128
  }
3117
3129
  }
3118
- if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && ($.isCustomElement = !0, T && $.attrs)) {
3130
+ if ((f.includes("-") || !!i?.__customElements?.has?.(f)) && (S.isCustomElement = !0, R && S.attrs)) {
3119
3131
  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];
3132
+ for (const L of R)
3133
+ if (L in S.attrs && !(S.props && L in S.props)) {
3134
+ const M = L.includes("-") ? L.split("-").map((Z, z) => z === 0 ? Z : Z.charAt(0).toUpperCase() + Z.slice(1)).join("") : L;
3135
+ let J = S.attrs[L];
3136
+ J && ee(J) && (J = J.value), S.props[M] = J, K.has(L) || delete S.attrs[L];
3125
3137
  }
3126
3138
  }
3127
3139
  } catch {
3128
3140
  }
3129
- if (R && Object.keys(R).some((P) => P === "model" || P.startsWith("model:")))
3141
+ if (T && Object.keys(T).some((P) => P === "model" || P.startsWith("model:")))
3130
3142
  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;
3143
+ 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)));
3144
+ if (!!(f.includes("-") || we || V))
3145
+ for (const M of Object.keys(T)) {
3146
+ if (M !== "model" && !M.startsWith("model:")) continue;
3147
+ 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
3148
  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;
3149
+ typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
3138
3150
  try {
3139
- const re = te(E);
3140
- $.attrs || ($.attrs = {}), O !== void 0 && ($.attrs[re] = O);
3151
+ const re = ne(E);
3152
+ S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[re] = O);
3141
3153
  } catch {
3142
3154
  }
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) {
3155
+ S.isCustomElement = !0;
3156
+ const qe = `update:${ne(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
3157
+ S.props[ut] = function(re) {
3146
3158
  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());
3159
+ if (W)
3160
+ if (z && ee(z)) {
3161
+ const ae = z.value;
3162
+ (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
3163
  } 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());
3164
+ const ae = U(W, typeof z == "string" ? z : String(z));
3165
+ (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
3166
  }
3155
- }, delete R[j];
3167
+ }, delete T[M];
3156
3168
  }
3157
3169
  } catch {
3158
3170
  }
3159
- if (Object.keys(R).length > 0 && ($.directives = { ...R }), x) {
3160
- const P = fe(
3171
+ if (Object.keys(T).length > 0 && (S.directives = { ...T }), x) {
3172
+ const P = pe(
3161
3173
  l,
3162
3174
  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,
3175
+ h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
3164
3176
  v
3165
3177
  ), B = g.pop();
3166
3178
  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({
3179
+ } 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
3180
  tag: l,
3169
3181
  props: d,
3170
3182
  children: h,
3171
3183
  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+}})/);
3184
+ }), l = f, d = S, h = []);
3185
+ } else if (typeof b[3] < "u") {
3186
+ const f = Number(b[3]), x = t[f], A = `interp-${f}`;
3187
+ m(x, A);
3188
+ } else if (b[4]) {
3189
+ const f = b[4], x = l ? h : c, A = f.split(/({{\d+}})/);
3178
3190
  for (const _ of A) {
3179
3191
  if (!_) continue;
3180
- const S = _.match(/^{{(\d+)}}$/);
3181
- if (S) {
3182
- const R = Number(S[1]), T = t[R], $ = `interp-${R}`;
3183
- y(T, $);
3192
+ const $ = _.match(/^{{(\d+)}}$/);
3193
+ if ($) {
3194
+ const T = Number($[1]), R = t[T], S = `interp-${T}`;
3195
+ m(R, S);
3184
3196
  } else {
3185
- const R = `text-${b++}`;
3186
- x.push(a(_, R));
3197
+ const T = `text-${w++}`;
3198
+ x.push(a(_, T));
3187
3199
  }
3188
3200
  }
3189
3201
  }
3190
3202
  }
3191
- const k = c.filter((f) => ke(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
3203
+ const k = c.filter((f) => _e(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
3192
3204
  if (k.length === 1) {
3193
3205
  const f = k[0];
3194
- return s && o && We.set(o, f), f;
3206
+ return s && o && De.set(o, f), f;
3195
3207
  } else if (k.length > 1) {
3196
3208
  const f = k;
3197
- return s && o && We.set(o, f), f;
3209
+ return s && o && De.set(o, f), f;
3198
3210
  }
3199
- return fe("div", {}, "", "fallback-root");
3211
+ return pe("div", {}, "", "fallback-root");
3200
3212
  }
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);
3213
+ function ce(e, ...t) {
3214
+ const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
3215
+ return sn(e, t, r);
3204
3216
  }
3205
- function Ae(e, t) {
3206
- return M(e ? t : [], "when-block");
3217
+ function Re(e, t) {
3218
+ return j(e ? t : [], "when-block");
3207
3219
  }
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}`);
3220
+ function vn(e, t) {
3221
+ return e.map((n, r) => {
3222
+ const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
3223
+ return j(t(n, r), `each-${i}`);
3212
3224
  });
3213
3225
  }
3214
- function tr() {
3226
+ function on() {
3215
3227
  const e = [];
3216
3228
  return {
3217
- when(t, r) {
3218
- return e.push([t, r]), this;
3229
+ when(t, n) {
3230
+ return e.push([t, n]), this;
3219
3231
  },
3220
3232
  otherwise(t) {
3221
3233
  return e.push([!0, t]), this;
3222
3234
  },
3223
3235
  done() {
3224
- return rr(...e);
3236
+ return an(...e);
3225
3237
  }
3226
3238
  };
3227
3239
  }
3228
- function rr(...e) {
3240
+ function an(...e) {
3229
3241
  for (let t = 0; t < e.length; t++) {
3230
- const [r, n] = e[t];
3231
- if (r) return [M(n, `whenChain-branch-${t}`)];
3242
+ const [n, r] = e[t];
3243
+ if (n) return [j(r, `whenChain-branch-${t}`)];
3232
3244
  }
3233
- return [M([], "whenChain-empty")];
3245
+ return [j([], "whenChain-empty")];
3234
3246
  }
3235
- function M(e, t) {
3236
- const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3247
+ function j(e, t) {
3248
+ const n = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3237
3249
  return {
3238
3250
  tag: "#anchor",
3239
3251
  key: t,
3240
- children: r
3252
+ children: n
3241
3253
  };
3242
3254
  }
3243
- function mr(e, t) {
3244
- return Ae(!e, t);
3255
+ function xn(e, t) {
3256
+ return Re(!e, t);
3245
3257
  }
3246
- function yr(e, t) {
3247
- const r = !e || e.length === 0;
3248
- return Ae(r, t);
3258
+ function kn(e, t) {
3259
+ const n = !e || e.length === 0;
3260
+ return Re(n, t);
3249
3261
  }
3250
- function br(e, t) {
3251
- const r = !!(e && e.length > 0);
3252
- return Ae(r, t);
3262
+ function Cn(e, t) {
3263
+ const n = !!(e && e.length > 0);
3264
+ return Re(n, t);
3253
3265
  }
3254
- function wr(e, t, r) {
3255
- const n = [];
3266
+ function _n(e, t, n) {
3267
+ const r = [];
3256
3268
  return e.forEach((i, s) => {
3257
- t(i, s) && n.push({ item: i, originalIndex: s });
3258
- }), n.map(({ item: i, originalIndex: s }, o) => {
3269
+ t(i, s) && r.push({ item: i, originalIndex: s });
3270
+ }), r.map(({ item: i, originalIndex: s }, o) => {
3259
3271
  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}`);
3272
+ return j(n(i, s, o), `each-where-${a}`);
3261
3273
  });
3262
3274
  }
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");
3275
+ function En(e, t) {
3276
+ const n = e?.length ?? 0;
3277
+ 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
3278
  }
3267
- function xr(e, t, r) {
3268
- const n = /* @__PURE__ */ new Map();
3279
+ function $n(e, t, n) {
3280
+ const r = /* @__PURE__ */ new Map();
3269
3281
  return e.forEach((i) => {
3270
3282
  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),
3283
+ r.has(s) || r.set(s, []), r.get(s).push(i);
3284
+ }), Array.from(r.entries()).map(([i, s], o) => j(
3285
+ n(i, s, o),
3274
3286
  `each-group-${i}`
3275
3287
  ));
3276
3288
  }
3277
- function kr(e, t, r, n) {
3278
- const i = r * t, s = Math.min(i + t, e.length);
3289
+ function Sn(e, t, n, r) {
3290
+ const i = n * t, s = Math.min(i + t, e.length);
3279
3291
  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}`);
3292
+ const y = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${y}` : `page-${y}`;
3293
+ return j(r(a, y, u), `each-page-${g}`);
3282
3294
  });
3283
3295
  }
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");
3296
+ function An(e, t) {
3297
+ 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
3298
  }
3287
3299
  function q(e, t) {
3288
- const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
3289
- return Ae(!!r, t);
3300
+ const n = typeof window < "u" && window.matchMedia?.(e)?.matches;
3301
+ return Re(!!n, t);
3290
3302
  }
3291
- const ee = {
3303
+ const te = {
3292
3304
  // Responsive breakpoints (matching style.ts)
3293
3305
  sm: "(min-width:640px)",
3294
3306
  md: "(min-width:768px)",
@@ -3297,15 +3309,15 @@ const ee = {
3297
3309
  "2xl": "(min-width:1536px)",
3298
3310
  // Dark mode (matching style.ts)
3299
3311
  dark: "(prefers-color-scheme: dark)"
3300
- }, at = ["sm", "md", "lg", "xl", "2xl"], nr = {
3312
+ }, lt = ["sm", "md", "lg", "xl", "2xl"], cn = {
3301
3313
  // 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),
3314
+ sm: (e) => q(te.sm, e),
3315
+ md: (e) => q(te.md, e),
3316
+ lg: (e) => q(te.lg, e),
3317
+ xl: (e) => q(te.xl, e),
3318
+ "2xl": (e) => q(te["2xl"], e),
3307
3319
  // Dark mode (matching style.ts)
3308
- dark: (e) => q(ee.dark, e),
3320
+ dark: (e) => q(te.dark, e),
3309
3321
  light: (e) => q("(prefers-color-scheme: light)", e),
3310
3322
  // Accessibility and interaction preferences
3311
3323
  touch: (e) => q("(hover: none) and (pointer: coarse)", e),
@@ -3316,48 +3328,48 @@ const ee = {
3316
3328
  portrait: (e) => q("(orientation: portrait)", e),
3317
3329
  landscape: (e) => q("(orientation: landscape)", e)
3318
3330
  };
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";
3331
+ function Tn(e, t) {
3332
+ const n = [];
3333
+ e.includes("dark") ? n.push(te.dark) : e.includes("light") && n.push("(prefers-color-scheme: light)");
3334
+ const r = e.filter(
3335
+ (o) => lt.includes(o)
3336
+ ), i = r[r.length - 1];
3337
+ i && i in te && n.push(te[i]);
3338
+ const s = n.length > 0 ? n.join(" and ") : "all";
3327
3339
  return q(s, t);
3328
3340
  }
3329
- function Er(e) {
3341
+ function Rn(e) {
3330
3342
  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));
3343
+ return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((n) => {
3344
+ const r = e[n];
3345
+ r && t.push(cn[n](r));
3334
3346
  }), t;
3335
3347
  }
3336
- function Sr(e) {
3348
+ function On(e) {
3337
3349
  const t = [];
3338
- let r = null;
3350
+ let n = null;
3339
3351
  return {
3340
- case(n, i) {
3341
- const s = typeof n == "function" ? n : (o) => o === n;
3352
+ case(r, i) {
3353
+ const s = typeof r == "function" ? r : (o) => o === r;
3342
3354
  return t.push({ condition: s, content: i }), this;
3343
3355
  },
3344
- when(n, i) {
3345
- return t.push({ condition: n, content: i }), this;
3356
+ when(r, i) {
3357
+ return t.push({ condition: r, content: i }), this;
3346
3358
  },
3347
- otherwise(n) {
3348
- return r = n, this;
3359
+ otherwise(r) {
3360
+ return n = r, this;
3349
3361
  },
3350
3362
  done() {
3351
- for (let n = 0; n < t.length; n++) {
3352
- const { condition: i, content: s } = t[n];
3363
+ for (let r = 0; r < t.length; r++) {
3364
+ const { condition: i, content: s } = t[r];
3353
3365
  if (i(e))
3354
- return M(s, `switch-case-${n}`);
3366
+ return j(s, `switch-case-${r}`);
3355
3367
  }
3356
- return M(r || [], "switch-otherwise");
3368
+ return j(n || [], "switch-otherwise");
3357
3369
  }
3358
3370
  };
3359
3371
  }
3360
- class ue extends EventTarget {
3372
+ class de extends EventTarget {
3361
3373
  handlers = {};
3362
3374
  static instance;
3363
3375
  eventCounters = /* @__PURE__ */ new Map();
@@ -3365,21 +3377,21 @@ class ue extends EventTarget {
3365
3377
  * Returns the singleton instance of GlobalEventBus
3366
3378
  */
3367
3379
  static getInstance() {
3368
- return ue.instance || (ue.instance = new ue()), ue.instance;
3380
+ return de.instance || (de.instance = new de()), de.instance;
3369
3381
  }
3370
3382
  /**
3371
3383
  * Emit a global event with optional data. Includes event storm protection.
3372
3384
  * @param eventName - Name of the event
3373
3385
  * @param data - Optional event payload
3374
3386
  */
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 });
3387
+ emit(t, n) {
3388
+ const r = Date.now(), i = this.eventCounters.get(t);
3389
+ if (!i || r - i.window > 1e3)
3390
+ this.eventCounters.set(t, { count: 1, window: r });
3379
3391
  else if (i.count++, i.count > 50 && i.count > 100)
3380
3392
  return;
3381
3393
  this.dispatchEvent(new CustomEvent(t, {
3382
- detail: r,
3394
+ detail: n,
3383
3395
  bubbles: !1,
3384
3396
  // Global events don't need to bubble
3385
3397
  cancelable: !0
@@ -3387,9 +3399,9 @@ class ue extends EventTarget {
3387
3399
  const s = this.handlers[t];
3388
3400
  s && s.forEach((o) => {
3389
3401
  try {
3390
- o(r);
3402
+ o(n);
3391
3403
  } catch (a) {
3392
- ie(`Error in global event handler for "${t}":`, a);
3404
+ se(`Error in global event handler for "${t}":`, a);
3393
3405
  }
3394
3406
  });
3395
3407
  }
@@ -3398,17 +3410,17 @@ class ue extends EventTarget {
3398
3410
  * @param eventName - Name of the event
3399
3411
  * @param handler - Handler function
3400
3412
  */
3401
- on(t, r) {
3402
- return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
3413
+ on(t, n) {
3414
+ return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(n), () => this.off(t, n);
3403
3415
  }
3404
3416
  /**
3405
3417
  * Remove a specific handler for a global event.
3406
3418
  * @param eventName - Name of the event
3407
3419
  * @param handler - Handler function to remove
3408
3420
  */
3409
- off(t, r) {
3410
- const n = this.handlers[t];
3411
- n && n.delete(r);
3421
+ off(t, n) {
3422
+ const r = this.handlers[t];
3423
+ r && r.delete(n);
3412
3424
  }
3413
3425
  /**
3414
3426
  * Remove all handlers for a specific event.
@@ -3423,18 +3435,18 @@ class ue extends EventTarget {
3423
3435
  * @param handler - CustomEvent handler
3424
3436
  * @param options - AddEventListener options
3425
3437
  */
3426
- listen(t, r, n) {
3427
- return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
3438
+ listen(t, n, r) {
3439
+ return this.addEventListener(t, n, r), () => this.removeEventListener(t, n);
3428
3440
  }
3429
3441
  /**
3430
3442
  * Register a one-time event handler. Returns a promise that resolves with the event data.
3431
3443
  * @param eventName - Name of the event
3432
3444
  * @param handler - Handler function
3433
3445
  */
3434
- once(t, r) {
3435
- return new Promise((n) => {
3446
+ once(t, n) {
3447
+ return new Promise((r) => {
3436
3448
  const i = this.on(t, (s) => {
3437
- i(), r(s), n(s);
3449
+ i(), n(s), r(s);
3438
3450
  });
3439
3451
  });
3440
3452
  }
@@ -3464,10 +3476,10 @@ class ue extends EventTarget {
3464
3476
  */
3465
3477
  getEventStats() {
3466
3478
  const t = {};
3467
- for (const [r, n] of this.eventCounters.entries())
3468
- t[r] = {
3469
- count: n.count,
3470
- handlersCount: this.getHandlerCount(r)
3479
+ for (const [n, r] of this.eventCounters.entries())
3480
+ t[n] = {
3481
+ count: r.count,
3482
+ handlersCount: this.getHandlerCount(n)
3471
3483
  };
3472
3484
  return t;
3473
3485
  }
@@ -3478,12 +3490,12 @@ class ue extends EventTarget {
3478
3490
  this.eventCounters.clear();
3479
3491
  }
3480
3492
  }
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) {
3493
+ 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);
3494
+ function tt(e) {
3483
3495
  let t = { ...e };
3484
- const r = [];
3485
- function n(a) {
3486
- r.push(a), a(t);
3496
+ const n = [];
3497
+ function r(a) {
3498
+ n.push(a), a(t);
3487
3499
  }
3488
3500
  function i() {
3489
3501
  return t;
@@ -3493,129 +3505,129 @@ function Qe(e) {
3493
3505
  t = { ...t, ...u }, o();
3494
3506
  }
3495
3507
  function o() {
3496
- r.forEach((a) => a(t));
3508
+ n.forEach((a) => a(t));
3497
3509
  }
3498
- return { subscribe: n, getState: i, setState: s };
3510
+ return { subscribe: r, getState: i, setState: s };
3499
3511
  }
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);
3512
+ const nt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
3513
+ for (const n of e) {
3514
+ const r = [], i = n.path.replace(/:[^/]+/g, (a) => (r.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
3503
3515
  if (o) {
3504
3516
  const a = {};
3505
- return n.forEach((u, m) => {
3506
- a[u] = o[m + 1];
3507
- }), { route: r, params: a };
3517
+ return r.forEach((u, y) => {
3518
+ a[u] = o[y + 1];
3519
+ }), { route: n, params: a };
3508
3520
  }
3509
3521
  }
3510
3522
  return { route: null, params: {} };
3511
- }, ze = {};
3512
- async function ir(e) {
3523
+ }, Ie = {};
3524
+ async function ln(e) {
3513
3525
  if (e.component) return e.component;
3514
3526
  if (e.load) {
3515
- if (ze[e.path]) return ze[e.path];
3527
+ if (Ie[e.path]) return Ie[e.path];
3516
3528
  try {
3517
3529
  const t = await e.load();
3518
- return ze[e.path] = t.default, t.default;
3530
+ return Ie[e.path] = t.default, t.default;
3519
3531
  } catch {
3520
3532
  throw new Error(`Failed to load component for route: ${e.path}`);
3521
3533
  }
3522
3534
  }
3523
3535
  throw new Error(`No component or loader defined for route: ${e.path}`);
3524
3536
  }
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) => {
3537
+ function un(e) {
3538
+ const { routes: t, base: n = "", initialUrl: r } = e;
3539
+ let i, s, o, a, u, y, g;
3540
+ const b = async (v, w) => {
3529
3541
  const c = t.find((p) => Q([p], v.path).route !== null);
3530
3542
  if (c?.beforeEnter)
3531
3543
  try {
3532
- const p = await c.beforeEnter(v, b);
3544
+ const p = await c.beforeEnter(v, w);
3533
3545
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3534
3546
  } catch (p) {
3535
- return ie("beforeEnter error", p), !1;
3547
+ return se("beforeEnter error", p), !1;
3536
3548
  }
3537
3549
  return !0;
3538
- }, h = async (v, b) => {
3550
+ }, h = async (v, w) => {
3539
3551
  const c = t.find((p) => Q([p], v.path).route !== null);
3540
3552
  if (c?.onEnter)
3541
3553
  try {
3542
- const p = await c.onEnter(v, b);
3554
+ const p = await c.onEnter(v, w);
3543
3555
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3544
3556
  } catch (p) {
3545
- return ie("onEnter error", p), !1;
3557
+ return se("onEnter error", p), !1;
3546
3558
  }
3547
3559
  return !0;
3548
- }, l = (v, b) => {
3560
+ }, l = (v, w) => {
3549
3561
  const c = t.find((p) => Q([p], v.path).route !== null);
3550
3562
  if (c?.afterEnter)
3551
3563
  try {
3552
- c.afterEnter(v, b);
3564
+ c.afterEnter(v, w);
3553
3565
  } catch (p) {
3554
- ie("afterEnter error", p);
3566
+ se("afterEnter error", p);
3555
3567
  }
3556
- }, d = async (v, b = !1) => {
3568
+ }, d = async (v, w = !1) => {
3557
3569
  try {
3558
3570
  const c = {
3559
- path: v.replace(r, "") || "/",
3571
+ path: v.replace(n, "") || "/",
3560
3572
  query: {}
3561
3573
  }, p = Q(t, c.path);
3562
3574
  if (!p) throw new Error(`No route found for ${c.path}`);
3563
- const y = o.getState(), C = {
3575
+ const m = o.getState(), C = {
3564
3576
  path: c.path,
3565
3577
  params: p.params,
3566
3578
  query: c.query
3567
3579
  };
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);
3580
+ if (!await b(C, m) || !await h(C, m)) return;
3581
+ typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + v) : window.history.pushState({}, "", n + v)), o.setState(C), l(C, m);
3570
3582
  } catch (c) {
3571
- ie("Navigation error:", c);
3583
+ se("Navigation error:", c);
3572
3584
  }
3573
3585
  };
3574
- if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
3586
+ if (typeof window < "u" && typeof document < "u" && typeof r > "u") {
3575
3587
  i = () => {
3576
- const b = new URL(window.location.href), c = b.pathname.replace(r, "") || "/", p = et(b.search);
3588
+ const w = new URL(window.location.href), c = w.pathname.replace(n, "") || "/", p = nt(w.search);
3577
3589
  return { path: c, query: p };
3578
3590
  }, s = i();
3579
3591
  const v = Q(t, s.path);
3580
- o = Qe({
3592
+ o = tt({
3581
3593
  path: s.path,
3582
3594
  params: v.params,
3583
3595
  query: s.query
3584
- }), a = async (b = !1) => {
3596
+ }), a = async (w = !1) => {
3585
3597
  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();
3598
+ await d(c.path, w);
3599
+ }, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), y = (w) => d(w, !0), g = () => window.history.back();
3588
3600
  } else {
3589
3601
  i = () => {
3590
- const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = et(c.search);
3591
- return { path: p, query: y };
3602
+ const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", m = nt(c.search);
3603
+ return { path: p, query: m };
3592
3604
  }, s = i();
3593
3605
  const v = Q(t, s.path);
3594
- o = Qe({
3606
+ o = tt({
3595
3607
  path: s.path,
3596
3608
  params: v.params,
3597
3609
  query: s.query
3598
3610
  }), a = async () => {
3599
3611
  const c = i();
3600
- await b(c.path);
3612
+ await w(c.path);
3601
3613
  };
3602
- const b = async (c) => {
3614
+ const w = async (c) => {
3603
3615
  try {
3604
3616
  const p = {
3605
- path: c.replace(r, "") || "/",
3617
+ path: c.replace(n, "") || "/",
3606
3618
  query: {}
3607
- }, y = Q(t, p.path);
3608
- if (!y) throw new Error(`No route found for ${p.path}`);
3619
+ }, m = Q(t, p.path);
3620
+ if (!m) throw new Error(`No route found for ${p.path}`);
3609
3621
  const C = o.getState(), k = {
3610
3622
  path: p.path,
3611
- params: y.params,
3623
+ params: m.params,
3612
3624
  query: p.query
3613
3625
  }, f = t.find((x) => Q([x], k.path).route !== null);
3614
3626
  if (f?.beforeEnter)
3615
3627
  try {
3616
3628
  const x = await f.beforeEnter(k, C);
3617
3629
  if (typeof x == "string") {
3618
- await b(x);
3630
+ await w(x);
3619
3631
  return;
3620
3632
  }
3621
3633
  if (x === !1) return;
@@ -3626,7 +3638,7 @@ function sr(e) {
3626
3638
  try {
3627
3639
  const x = await f.onEnter(k, C);
3628
3640
  if (typeof x == "string") {
3629
- await b(x);
3641
+ await w(x);
3630
3642
  return;
3631
3643
  }
3632
3644
  if (x === !1) return;
@@ -3641,69 +3653,69 @@ function sr(e) {
3641
3653
  } catch {
3642
3654
  }
3643
3655
  };
3644
- u = async (c) => b(c), m = async (c) => b(c), g = () => {
3656
+ u = async (c) => w(c), y = async (c) => w(c), g = () => {
3645
3657
  };
3646
3658
  }
3647
3659
  return {
3648
3660
  store: o,
3649
3661
  push: u,
3650
- replace: m,
3662
+ replace: y,
3651
3663
  back: g,
3652
3664
  subscribe: o.subscribe,
3653
3665
  matchRoute: (v) => Q(t, v),
3654
3666
  getCurrent: () => o.getState(),
3655
- resolveRouteComponent: ir
3667
+ resolveRouteComponent: ln
3656
3668
  };
3657
3669
  }
3658
- function Pr(e, t) {
3670
+ function Wn(e, t) {
3659
3671
  return Q(e, t);
3660
3672
  }
3661
- function Lr(e) {
3662
- const t = sr(e);
3663
- return Ye("router-view", (r = {}, n = {}) => {
3664
- const { onConnected: i } = n;
3673
+ function zn(e) {
3674
+ const t = un(e);
3675
+ return et("router-view", (n = {}, r = {}) => {
3676
+ const { onConnected: i } = r;
3665
3677
  if (i && i(() => {
3666
3678
  t && typeof t.subscribe == "function" && t.subscribe(() => {
3667
3679
  });
3668
- }), !t) return ae`<div>Router not initialized.</div>`;
3680
+ }), !t) return ce`<div>Router not initialized.</div>`;
3669
3681
  const s = t.getCurrent(), { path: o } = s, a = t.matchRoute(o);
3670
3682
  return a.route ? t.resolveRouteComponent(a.route).then((u) => {
3671
3683
  if (typeof u == "string")
3672
3684
  return { tag: u, props: {}, children: [] };
3673
3685
  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);
3686
+ const y = u();
3687
+ return (y instanceof Promise ? y : Promise.resolve(y)).then((b) => typeof b == "string" ? { tag: b, props: {}, children: [] } : b);
3676
3688
  }
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 = {}) => {
3689
+ return ce`<div>Invalid route component</div>`;
3690
+ }).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
3691
+ }), et("router-link", (n = {}, r = {}) => {
3680
3692
  const {
3681
3693
  to: i = "",
3682
3694
  tag: s = "a",
3683
3695
  replace: o = !1,
3684
3696
  exact: a = !1,
3685
3697
  activeClass: u = "active",
3686
- exactActiveClass: m = "exact-active",
3698
+ exactActiveClass: y = "exact-active",
3687
3699
  ariaCurrentValue: g = "page",
3688
- disabled: w = !1,
3700
+ disabled: b = !1,
3689
3701
  external: h = !1,
3690
3702
  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;
3703
+ } = n, d = t.getCurrent(), v = d.path === i, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), m = {};
3704
+ for (const _ of p) m[_] = !0;
3693
3705
  const C = {
3694
- ...y,
3706
+ ...m,
3695
3707
  // 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) {
3708
+ [u]: w,
3709
+ [y]: v
3710
+ }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3711
+ if (b) {
3700
3712
  _.preventDefault();
3701
3713
  return;
3702
3714
  }
3703
3715
  h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
3704
3716
  };
3705
- return ae`
3706
- ${tr().when(k, ae`
3717
+ return ce`
3718
+ ${on().when(k, ce`
3707
3719
  <button
3708
3720
  part="button"
3709
3721
  :class="${C}"
@@ -3712,7 +3724,7 @@ function Lr(e) {
3712
3724
  ${x}
3713
3725
  @click="${A}"
3714
3726
  ><slot></slot></button>
3715
- `).otherwise(ae`
3727
+ `).otherwise(ce`
3716
3728
  <a
3717
3729
  part="link"
3718
3730
  href="${i}"
@@ -3727,51 +3739,51 @@ function Lr(e) {
3727
3739
  }), t;
3728
3740
  }
3729
3741
  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,
3742
+ de as GlobalEventBus,
3743
+ j as anchorBlock,
3744
+ et as component,
3745
+ dn as computed,
3746
+ tt as createStore,
3747
+ Pt as css,
3748
+ vn as each,
3749
+ $n as eachGroup,
3750
+ Sn as eachPage,
3751
+ _n as eachWhere,
3752
+ Pn as emit,
3753
+ be as eventBus,
3754
+ ce as html,
3755
+ zn as initRouter,
3756
+ Nn as listen,
3757
+ on as match,
3746
3758
  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,
3759
+ Wn as matchRouteSSR,
3760
+ te as mediaVariants,
3761
+ Mn as off,
3762
+ Ln as on,
3763
+ jn as once,
3764
+ nt as parseQuery,
3765
+ fn as ref,
3766
+ Pe as renderToString,
3767
+ ln as resolveRouteComponent,
3768
+ cn as responsive,
3769
+ lt as responsiveOrder,
3770
+ Rn as responsiveSwitch,
3771
+ On as switchOn,
3772
+ En as switchOnLength,
3773
+ An as switchOnPromise,
3774
+ xn as unless,
3775
+ hn as useEmit,
3776
+ mn as useOnAttributeChanged,
3777
+ gn as useOnConnected,
3778
+ yn as useOnDisconnected,
3779
+ bn as useOnError,
3780
+ un as useRouter,
3781
+ wn as useStyle,
3782
+ pn as watch,
3783
+ Re as when,
3784
+ kn as whenEmpty,
3773
3785
  q as whenMedia,
3774
- br as whenNotEmpty,
3775
- _r as whenVariants
3786
+ Cn as whenNotEmpty,
3787
+ Tn as whenVariants
3776
3788
  };
3777
3789
  //# sourceMappingURL=custom-elements-runtime.es.js.map