@reactive-web-components/rwc 2.63.0 → 2.63.7

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.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.63.0",
3
+ "version": "2.63.7",
4
4
  "type": "module",
5
5
  "types": "./shared/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./shared/index.d.ts",
9
- "import": "./reactive-web-component.BmD7vrr3.js",
10
- "require": "./reactive-web-component.B_uUgR3i.umd.cjs"
9
+ "import": "./reactive-web-component.BmjLtNib.js",
10
+ "require": "./reactive-web-component.Bx_Hbzlr.umd.cjs"
11
11
  }
12
12
  },
13
13
  "author": "tamazyanarsen",
@@ -34,6 +34,6 @@
34
34
  "ui",
35
35
  "frontend"
36
36
  ],
37
- "module": "./reactive-web-component.BmD7vrr3.js",
38
- "main": "./reactive-web-component.B_uUgR3i.umd.cjs"
37
+ "module": "./reactive-web-component.BmjLtNib.js",
38
+ "main": "./reactive-web-component.Bx_Hbzlr.umd.cjs"
39
39
  }
@@ -1,18 +1,18 @@
1
- var dt = Object.defineProperty;
2
- var ht = (s, t, e) => t in s ? dt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var f = (s, t, e) => ht(s, typeof t != "symbol" ? t + "" : t, e);
1
+ var lt = Object.defineProperty;
2
+ var at = (s, t, e) => t in s ? lt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var f = (s, t, e) => at(s, typeof t != "symbol" ? t + "" : t, e);
4
4
  const F = (s) => s && typeof s == "object" && ("classList" in s || "attributes" in s || "customAttributes" in s || "reactiveClassList" in s || "listeners" in s || "customListeners" in s || "children" in s || "effects" in s || "ref" in s || "style" in s || Object.keys(s).some(
5
5
  (t) => t.startsWith(".") || t.startsWith("@") || t.startsWith("$")
6
- )) && !("hostElement" in s), ft = (s) => s && typeof s == "object" && "hostElement" in s && "append" in s && "set" in s && "addStyle" in s && "setAttribute" in s && "addClass" in s && "addEffect" in s && "addReactiveContent" in s && "setReactiveContent" in s && "clear" in s, G = (s, t, ...e) => {
6
+ )) && !("hostElement" in s), dt = (s) => s && typeof s == "object" && "hostElement" in s && "append" in s && "set" in s && "addStyle" in s && "setAttribute" in s && "addClass" in s && "addEffect" in s && "addReactiveContent" in s && "setReactiveContent" in s && "clear" in s, G = (s, t, ...e) => {
7
7
  t && t.apply(s, e);
8
8
  };
9
9
  let z = !0;
10
- const b = (...s) => {
10
+ const C = (...s) => {
11
11
  z && console.debug(
12
12
  ["[rwc]", ...s].join(" | "),
13
13
  ...Array.from(s.join("").matchAll(/%c/gm)).map((t, e) => e % 2 === 0 ? "color:red" : "color:inherit")
14
14
  );
15
- }, N = (s) => s.replace(/([A-Z])/gm, (t) => `-${t.toLowerCase()}`), ut = (s) => s.replace(/-(\w)/gm, (t, e) => e.toUpperCase()), V = (s, ...t) => {
15
+ }, N = (s) => s.replace(/([A-Z])/gm, (t) => `-${t.toLowerCase()}`), ht = (s) => s.replace(/-(\w)/gm, (t, e) => e.toUpperCase()), V = (s, ...t) => {
16
16
  if (!z) return;
17
17
  const e = {
18
18
  r: "color: #ff0000",
@@ -40,48 +40,34 @@ const b = (...s) => {
40
40
  const c = new RegExp(`\\${i}([^\\s,]+)`, "g");
41
41
  r = r.replace(c, "%c$1");
42
42
  }), console.log(r, ...o, ...t);
43
- }, Vt = () => {
43
+ }, kt = () => {
44
44
  z = !0;
45
- }, pt = () => {
45
+ }, ft = () => {
46
46
  z = !1;
47
47
  };
48
- pt();
49
- const Nt = (s, t) => {
48
+ ft();
49
+ const Pt = (s, t) => {
50
50
  s.every(Boolean) && t(s);
51
51
  }, k = /* @__PURE__ */ new Set();
52
- let U = !1, K = !1;
53
- const mt = () => {
54
- if (!K) {
55
- K = !0;
56
- try {
57
- if (U = !1, k.size === 0)
58
- return;
59
- const s = Array.from(k);
60
- k.clear(), s.forEach((t) => {
61
- if (t.status === "active") {
62
- Y(t), O.push(t);
63
- try {
64
- t();
65
- } catch (e) {
66
- console.error("Error in effect:", e);
67
- } finally {
68
- O.pop();
69
- }
52
+ let K = !1;
53
+ const ut = (s) => {
54
+ s.status === "active" && k.add(s), K || (K = !0, queueMicrotask(() => {
55
+ K = !1, C("pendingEffects.size", k.size);
56
+ const t = Array.from(k);
57
+ k.clear(), t.forEach((e) => {
58
+ if (e.status === "active") {
59
+ U(e), O.push(e);
60
+ try {
61
+ e();
62
+ } catch (n) {
63
+ console.error("Error in effect:", n);
64
+ } finally {
65
+ O.pop();
70
66
  }
71
- }), k.size > 0 && nt();
72
- } finally {
73
- K = !1;
74
- }
75
- }
76
- };
77
- function Et() {
78
- queueMicrotask(mt);
79
- }
80
- const nt = () => {
81
- U || (U = !0, Et());
82
- }, Ct = (s) => {
83
- k.add(s), nt();
84
- }, O = [], Y = (s) => {
67
+ }
68
+ }), C("after ------ pendingEffects.size", k.size);
69
+ }));
70
+ }, O = [], U = (s) => {
85
71
  var t, e, n, o;
86
72
  (t = s.children) == null || t.forEach((r) => {
87
73
  var i;
@@ -107,9 +93,7 @@ function j(s, t) {
107
93
  }, o.peek = function() {
108
94
  return Object.freeze(s);
109
95
  }, o.initValue = Object.freeze(s), o.forceSet = function(r) {
110
- s = r, n.forEach((i) => {
111
- Ct(i);
112
- });
96
+ s = r, n.forEach((i) => ut(i));
113
97
  }, o.set = function(r, i = e) {
114
98
  s !== r && i(s, r) && o.forceSet(r);
115
99
  }, o.update = function(r) {
@@ -137,17 +121,17 @@ function j(s, t) {
137
121
  function w(s, t) {
138
122
  var r;
139
123
  const e = `${(t == null ? void 0 : t.name) || ""}_${Math.random().toString(36).substring(2, 15)}`;
140
- b("current effect", `%c${e}%c`);
124
+ C("current effect", `%c${e}%c`);
141
125
  const n = s;
142
126
  n.status = "active", n.children = /* @__PURE__ */ new Set(), n.effectId = e;
143
127
  const o = O[O.length - 1];
144
128
  return o && ((r = o.children) == null || r.add(n), n.parent = new WeakRef(o), n.destroy = () => {
145
129
  var i;
146
- Y(n), (i = o.children) == null || i.delete(n), n.destroy = void 0, n.status = "inactive";
130
+ U(n), (i = o.children) == null || i.delete(n), n.destroy = void 0, n.status = "inactive";
147
131
  }), n.cleanupSet = /* @__PURE__ */ new Set(), O.push(n), n(), O.pop(), n;
148
132
  }
149
133
  const g = (s) => !!s && ["object", "function"].includes(typeof s) && "set" in s && "update" in s && "forceSet" in s && "signalId" in s;
150
- function Jt(s, ...t) {
134
+ function Ft(s, ...t) {
151
135
  const e = j("");
152
136
  return w(() => {
153
137
  const n = t.map(
@@ -158,21 +142,21 @@ function Jt(s, ...t) {
158
142
  }), e.set(o.join(""));
159
143
  }), e;
160
144
  }
161
- function qt(s, t) {
145
+ function Bt(s, t) {
162
146
  const e = j(t ?? null), n = (o) => e.set(o);
163
147
  return s instanceof Promise ? s.then(n) : typeof s == "function" && w(() => {
164
148
  const o = s();
165
149
  o instanceof Promise ? o.then(n) : g(o) ? w(() => n(o())) : n(o);
166
150
  }), e;
167
151
  }
168
- function zt(s, t) {
152
+ function Vt(s, t) {
169
153
  let e = s(), n = t();
170
154
  w(() => {
171
155
  const o = s(), r = t();
172
156
  o !== r && (o !== e ? t.set(o) : r !== n && s.set(r)), e = o, n = r;
173
157
  });
174
158
  }
175
- function Dt(...s) {
159
+ function Nt(...s) {
176
160
  let t = s.map((n) => n());
177
161
  const e = j(t);
178
162
  return s.forEach((n, o) => {
@@ -182,26 +166,26 @@ function Dt(...s) {
182
166
  });
183
167
  }), e;
184
168
  }
185
- const Gt = (...s) => {
169
+ const Jt = (...s) => {
186
170
  const t = j([]);
187
171
  return w(() => {
188
172
  t.set(
189
173
  s.map((e) => e())
190
174
  );
191
175
  }), t;
192
- }, Kt = (s, t) => {
176
+ }, qt = (s, t) => {
193
177
  let e = !0;
194
178
  const n = w(() => {
195
179
  var o;
196
180
  e && (e = !1, t(s()), (o = n.destroy) == null || o.call(n));
197
181
  });
198
- }, J = "eventProps", q = "EVENT_CONFIG", P = "observedAttributes", Ut = () => (s, t) => {
182
+ }, J = "eventProps", q = "EVENT_CONFIG", P = "observedAttributes", zt = () => (s, t) => {
199
183
  Reflect.get(s, P) || Reflect.defineProperty(s, P, {
200
184
  value: []
201
185
  }), Reflect.get(s, P).push(
202
186
  N(t)
203
187
  );
204
- }, Yt = (s) => (t, e) => {
188
+ }, Dt = (s) => (t, e) => {
205
189
  Reflect.get(t, J) || Reflect.defineProperty(t, J, {
206
190
  value: []
207
191
  }), Reflect.get(t, q) || Reflect.defineProperty(t, q, {
@@ -210,8 +194,8 @@ const Gt = (...s) => {
210
194
  bubbles: (s == null ? void 0 : s.bubbles) ?? !1,
211
195
  composed: (s == null ? void 0 : s.composed) ?? !1
212
196
  }, Reflect.get(t, J).push(e);
213
- }, ot = (s, t = !1) => (e) => {
214
- b(
197
+ }, st = (s, t = !1) => (e) => {
198
+ C(
215
199
  s,
216
200
  "start register static attr",
217
201
  e.prototype[P]
@@ -222,19 +206,19 @@ const Gt = (...s) => {
222
206
  Array.isArray(r) ? i.push(...r) : i.push(r), i.forEach((c) => {
223
207
  const a = new CSSStyleSheet();
224
208
  a.replaceSync(c), n.push(a);
225
- const C = new CSSStyleSheet();
226
- C.replaceSync(c.slice(c.indexOf("@property"))), document.adoptedStyleSheets.push(C);
209
+ const b = new CSSStyleSheet();
210
+ b.replaceSync(c.slice(c.indexOf("@property"))), document.adoptedStyleSheets.push(b);
227
211
  });
228
212
  }
229
213
  class o extends e {
230
214
  constructor(...i) {
231
- b("constructor", `%c${s}%c`), super(t, ...i), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
215
+ C("constructor", `%c${s}%c`), super(t, ...i), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
232
216
  }
233
217
  render() {
234
- return b("rwc: render from new class"), e.prototype.render.call(this);
218
+ return C("rwc: render from new class"), e.prototype.render.call(this);
235
219
  }
236
220
  attributeChangedCallback(i, c, a) {
237
- b(
221
+ C(
238
222
  "%cAttribute has changed.%c",
239
223
  `%c${i}%c`,
240
224
  `oldValue: ${c}, newValue: ${a}`,
@@ -244,9 +228,9 @@ const Gt = (...s) => {
244
228
  a = JSON.parse(a);
245
229
  } catch {
246
230
  }
247
- const C = ut(i);
248
- if (C in this && g(this[C])) {
249
- const h = this[C];
231
+ const b = ht(i);
232
+ if (b in this && g(this[b])) {
233
+ const h = this[b];
250
234
  h.setName(i), a === null ? (h.set(h.initValue), this.removeAttribute(i)) : h.set(a);
251
235
  }
252
236
  G(
@@ -259,17 +243,17 @@ const Gt = (...s) => {
259
243
  }
260
244
  connectedCallback() {
261
245
  const i = () => {
262
- var a, C;
263
- b("rwc: connectedCallback"), b("connectedCallback", `%c${s}%c`, this), (a = this.init) == null || a.call(this), this.providers && Object.keys(this.providers).length > 0 && (b("WRAPPER for providers", s), Object.entries(this.providers).forEach(
246
+ var a, b;
247
+ C("rwc: connectedCallback"), C("connectedCallback", `%c${s}%c`, this), (a = this.init) == null || a.call(this), this.providers && Object.keys(this.providers).length > 0 && (C("WRAPPER for providers", s), Object.entries(this.providers).forEach(
264
248
  ([h, d]) => {
265
- b("register provider", h, d()), this.addEventListener(h, (m) => {
249
+ C("register provider", h, d()), this.addEventListener(h, (m) => {
266
250
  var u;
267
- b("send provider", h, d());
251
+ C("send provider", h, d());
268
252
  const p = m;
269
253
  ((u = p.detail) == null ? void 0 : u.context) === h && (p.stopPropagation(), p.detail.callback(d));
270
254
  });
271
255
  }
272
- )), this.checkInjects(), (C = e.prototype[J]) == null || C.forEach(
256
+ )), this.checkInjects(), (b = e.prototype[J]) == null || b.forEach(
273
257
  (h) => {
274
258
  this[h] = (d) => {
275
259
  const m = e.prototype[q][h], { bubbles: p, composed: u } = m;
@@ -290,9 +274,9 @@ const Gt = (...s) => {
290
274
  ));
291
275
  };
292
276
  }
293
- ), b("start render", `%c${s}%c`, s);
277
+ ), C("start render", `%c${s}%c`, s);
294
278
  const c = () => {
295
- b("rwc: insertRenderTemplate");
279
+ C("rwc: insertRenderTemplate");
296
280
  const d = this.render().hostElement;
297
281
  d && this.shadow.appendChild(d), G(this, e.prototype.connectedCallback), this.appendSlotContent();
298
282
  };
@@ -313,7 +297,7 @@ const Gt = (...s) => {
313
297
  } else
314
298
  c();
315
299
  this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((h) => {
316
- b(
300
+ C(
317
301
  this.slotContext,
318
302
  this.slotContext && this.slotContext[h.name]
319
303
  ), V(
@@ -385,11 +369,11 @@ class _ extends HTMLElement {
385
369
  (e = this.appendAllSlotContent) == null || e.call(this);
386
370
  }
387
371
  inject(e) {
388
- return b("%cinject%c", e), this.injects[e] || (this.injects[e] = j(null)), this.injects[e];
372
+ return C("%cinject%c", e), this.injects[e] || (this.injects[e] = j(null)), this.injects[e];
389
373
  }
390
374
  checkInjects() {
391
375
  Object.entries(this.injects).forEach(([e, n]) => {
392
- b(
376
+ C(
393
377
  "%cinject%c",
394
378
  `%c${e}%c`,
395
379
  "from BaseElement (dispatch event)"
@@ -412,24 +396,24 @@ class _ extends HTMLElement {
412
396
  }
413
397
  }
414
398
  f(_, "observedAttributes", []), f(_, "renderTagName", ""), f(_, "styles");
415
- const Zt = (s) => "render" in s && "setReactiveValue" in s, bt = "handleSlotContext", Q = "onConnected", rt = (s) => typeof s == "string" ? s : JSON.stringify(s), St = (s) => {
399
+ const Gt = (s) => "render" in s && "setReactiveValue" in s, pt = "handleSlotContext", X = "onConnected", nt = (s) => typeof s == "string" ? s : JSON.stringify(s), mt = (s) => {
416
400
  const t = document.createElement("span");
417
- return t.textContent = rt(s), t;
418
- }, it = (s, t) => (s.appendChild(St(t)), s), yt = (s, t) => (s.replaceChildren(), it(s, t)), tt = (s) => {
401
+ return t.textContent = nt(s), t;
402
+ }, ot = (s, t) => (s.appendChild(mt(t)), s), Et = (s, t) => (s.replaceChildren(), ot(s, t)), Q = (s) => {
419
403
  const t = document.createElement("span");
420
404
  return w(() => {
421
405
  const e = s();
422
- t.textContent = rt(e);
406
+ t.textContent = nt(e);
423
407
  }), t;
424
408
  };
425
- class ct {
409
+ class rt {
426
410
  constructor(t) {
427
411
  f(this, "wrapper");
428
412
  f(this, "keyedEffects", /* @__PURE__ */ new Map());
429
413
  f(this, "append", (...t) => (t.forEach((e) => {
430
414
  var o;
431
415
  const n = e.hostElement;
432
- n && ((o = this.hostElement) == null || o.appendChild(n), Q in n && setTimeout(() => {
416
+ n && ((o = this.hostElement) == null || o.appendChild(n), X in n && setTimeout(() => {
433
417
  var r;
434
418
  (r = n.onConnected) == null || r.call(
435
419
  n,
@@ -458,15 +442,15 @@ class ct {
458
442
  }), this));
459
443
  f(this, "addHtmlContent", (t) => {
460
444
  const e = this.hostElement;
461
- return e ? (it(e, t), this) : this;
445
+ return e ? (ot(e, t), this) : this;
462
446
  });
463
447
  f(this, "setHtmlContent", (t) => {
464
448
  const e = this.hostElement;
465
- return e ? (yt(e, t), this) : this;
449
+ return e ? (Et(e, t), this) : this;
466
450
  });
467
451
  f(this, "setAttribute", (t, e) => {
468
452
  var r;
469
- b("setAttribute", t, e);
453
+ C("setAttribute", t, e);
470
454
  const n = this.hostElement;
471
455
  if (!n) return this;
472
456
  let o;
@@ -491,7 +475,7 @@ class ct {
491
475
  return typeof e != "string" ? n = JSON.stringify(e) : n = e, (o = this.hostElement) == null || o.setAttribute(N(t), n), this;
492
476
  });
493
477
  f(this, "setReactiveAttribute", (t, e) => (this.addEffect((n) => {
494
- b("setReactiveAttribute effect", t, e), n.setAttribute(t, e());
478
+ C("setReactiveAttribute effect", t, e), n.setAttribute(t, e());
495
479
  }, t), this));
496
480
  f(this, "setReactiveCustomAttribute", (t, e) => (this.addEffect((n) => {
497
481
  n.setCustomAttribute(t, e());
@@ -513,7 +497,7 @@ class ct {
513
497
  }) : typeof o == "string" && (r ? e.style.setProperty(n, o) : e.style[n] = o);
514
498
  }), this) : this;
515
499
  });
516
- f(this, "onConnected", (t) => this.hostElement ? (Reflect.defineProperty(this.hostElement, Q, {
500
+ f(this, "onConnected", (t) => this.hostElement ? (Reflect.defineProperty(this.hostElement, X, {
517
501
  get() {
518
502
  return t;
519
503
  }
@@ -555,17 +539,17 @@ class ct {
555
539
  const o = () => t(this, n);
556
540
  if (e) {
557
541
  const c = (r = this.keyedEffects.get(e)) == null ? void 0 : r.deref();
558
- c && Y(c);
542
+ c && U(c);
559
543
  }
560
544
  return (i = n.effectSet) == null || i.add(new WeakRef(o)), o.component = this.wrapper, w(o, { name: (e == null ? void 0 : e.toString()) || n.tagName }), this;
561
545
  });
562
546
  f(this, "addReactiveContent", (t) => {
563
547
  var e;
564
- return (e = this.hostElement) == null || e.appendChild(tt(t)), this;
548
+ return (e = this.hostElement) == null || e.appendChild(Q(t)), this;
565
549
  });
566
550
  f(this, "setReactiveContent", (t) => {
567
551
  var e;
568
- return this.clear(), (e = this.hostElement) == null || e.appendChild(tt(t)), this;
552
+ return this.clear(), (e = this.hostElement) == null || e.appendChild(Q(t)), this;
569
553
  });
570
554
  f(this, "clear", () => {
571
555
  var t;
@@ -587,7 +571,7 @@ class ct {
587
571
  ), this;
588
572
  }
589
573
  }
590
- class wt extends ct {
574
+ class Ct extends rt {
591
575
  constructor() {
592
576
  super(...arguments);
593
577
  f(this, "setReactiveValue", (e) => (this.hostElement instanceof _ && this.hostElement.setReactiveValue(e), this));
@@ -600,10 +584,10 @@ class wt extends ct {
600
584
  });
601
585
  }
602
586
  }
603
- const Xt = () => () => {
604
- }, vt = (s) => new wt(new WeakRef(s)), At = (s) => new ct(new WeakRef(s)), Rt = (s, ...t) => ({
587
+ const Kt = () => () => {
588
+ }, bt = (s) => new Ct(new WeakRef(s)), St = (s) => new rt(new WeakRef(s)), yt = (s, ...t) => ({
605
589
  classList: [...s.map((e) => e.trim()).filter(Boolean), ...t]
606
- }), Qt = (s, ...t) => Rt(s, ...t), lt = (s, t) => {
590
+ }), Ut = (s, ...t) => yt(s, ...t), it = (s, t) => {
607
591
  var o;
608
592
  if (!t || !s.deref()) return;
609
593
  const e = Object.keys(t || {}).filter(
@@ -620,21 +604,21 @@ const Xt = () => () => {
620
604
  });
621
605
  const n = s.deref();
622
606
  if (n)
623
- return Ot(n, t.classList), jt(n, t.style), Tt(n, t.attributes), Mt(n, t.reactiveClassList), It(n, t.customAttributes), Lt(n, t.children), gt(n, t.effects), et(n, t.listeners), et(n, t.customListeners), (o = t.ref) == null || o.set(n), n;
624
- }, et = (s, t) => {
607
+ return Rt(n, t.classList), Lt(n, t.style), It(n, t.attributes), gt(n, t.reactiveClassList), At(n, t.customAttributes), vt(n, t.children), wt(n, t.effects), tt(n, t.listeners), tt(n, t.customListeners), (o = t.ref) == null || o.set(n), n;
608
+ }, tt = (s, t) => {
625
609
  t && Object.entries(t).forEach(([e, n]) => {
626
610
  typeof n == "function" && s.addEventlistener(e, n);
627
611
  });
628
- }, gt = (s, t) => t == null ? void 0 : t.forEach((e) => s.addEffect(e)), Lt = (s, t) => D(new WeakRef(s), ...t || []) ?? s, It = (s, t) => {
612
+ }, wt = (s, t) => t == null ? void 0 : t.forEach((e) => s.addEffect(e)), vt = (s, t) => D(new WeakRef(s), ...t || []) ?? s, At = (s, t) => {
629
613
  const e = t;
630
614
  e && Object.keys(e).forEach((n) => {
631
615
  g(e[n]) ? s.setReactiveCustomAttribute(n, e[n]) : typeof e[n] == "function" ? s.addEffect(() => {
632
616
  s.setCustomAttribute(n, e[n]());
633
617
  }) : s.setCustomAttribute(n, e[n]);
634
618
  });
635
- }, Ot = (s, t) => s.addClass(...t || []), Mt = (s, t) => s.addReactiveClass(t || {}), jt = (s, t) => s.addStyle(t || {}), Tt = (s, t) => {
619
+ }, Rt = (s, t) => s.addClass(...t || []), gt = (s, t) => s.addReactiveClass(t || {}), Lt = (s, t) => s.addStyle(t || {}), It = (s, t) => {
636
620
  const e = t, n = (o, r) => {
637
- r !== void 0 && (b("addAttribute", o, r), g(r) ? s.setReactiveAttribute(o, r) : typeof r == "function" ? s.addEffect(() => {
621
+ r !== void 0 && (C("addAttribute", o, r), g(r) ? s.setReactiveAttribute(o, r) : typeof r == "function" ? s.addEffect(() => {
638
622
  s.setAttribute(o, r());
639
623
  }) : s.setAttribute(o, r));
640
624
  };
@@ -648,9 +632,9 @@ const Xt = () => () => {
648
632
  typeof n == "string" ? n.trim().length > 0 && e.addHtmlContent(n) : g(n) ? e.addReactiveContent(n) : e.append(n);
649
633
  }), e;
650
634
  }, W = (s, t) => {
651
- const e = document.createElement(s), n = At(e);
652
- return lt(new WeakRef(n), t) ?? n;
653
- }, Z = (s, t) => {
635
+ const e = document.createElement(s), n = St(e);
636
+ return it(new WeakRef(n), t) ?? n;
637
+ }, Y = (s, t) => {
654
638
  const [e, ...n] = s.split(" ").map((r) => r.trim()), o = W(e, t);
655
639
  return n.length > 0 && o.addClass(...n), (...r) => D(
656
640
  new WeakRef(o),
@@ -663,13 +647,13 @@ const Xt = () => () => {
663
647
  return W("div").addStyle({ display: "contents" }).addEffect((e) => {
664
648
  e.clear(), D(new WeakRef(e), ...[s()].flat());
665
649
  }, t);
666
- }, te = (s, t, e) => {
650
+ }, Yt = (s, t, e) => {
667
651
  const n = W("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
668
652
  let a = [];
669
- const C = /* @__PURE__ */ new Set();
653
+ const b = /* @__PURE__ */ new Set();
670
654
  let h = s.peek();
671
655
  const d = (u) => {
672
- C.delete(u), o.delete(u), r.delete(u), i.delete(u), c.delete(u);
656
+ b.delete(u), o.delete(u), r.delete(u), i.delete(u), c.delete(u);
673
657
  }, m = (u) => {
674
658
  if (!c.has(u)) {
675
659
  const y = a.indexOf(u);
@@ -684,7 +668,7 @@ const Xt = () => () => {
684
668
  }), a = y;
685
669
  const L = n.hostElement;
686
670
  if (!L) return;
687
- b(
671
+ C(
688
672
  "containerChildren",
689
673
  Array.from(L.children),
690
674
  a
@@ -695,46 +679,46 @@ const Xt = () => () => {
695
679
  S && !x.has(S) && H.push(E);
696
680
  }), H.forEach((E) => {
697
681
  const S = E.dataset.key;
698
- b("remove element", S, E), E.remove(), d(S);
682
+ C("remove element", S, E), E.remove(), d(S);
699
683
  }), y.forEach((E, S) => {
700
684
  var v;
701
- const A = u[S], $ = h[S];
685
+ const A = u[S], T = h[S];
702
686
  if (!o.has(E))
703
- b("create new element", E, A), o.set(
687
+ C("create new element", E, A), o.set(
704
688
  E,
705
689
  j(Math.random().toString(36).substring(2, 15))
706
690
  ), r.set(
707
691
  E,
708
692
  () => e(A, S, u).setCustomAttribute("data-key", E)
709
693
  );
710
- else if ($ && JSON.stringify(A) !== JSON.stringify($)) {
694
+ else if (T && JSON.stringify(A) !== JSON.stringify(T)) {
711
695
  const R = i.get(E);
712
696
  (v = o.get(E)) == null || v.set(Math.random().toString(36).substring(2, 15)), r.set(
713
697
  E,
714
698
  () => e(A, S, u).setCustomAttribute("data-key", E)
715
- ), R && R.parentNode && b("mark element for update", E);
699
+ ), R && R.parentNode && C("mark element for update", E);
716
700
  }
717
701
  }), h = [...u.map((E) => ({ ...E }))];
718
702
  const B = () => {
719
703
  o.forEach((E, S) => {
720
- b("key from setTimeout foreach currItemSignalMap", S), C.has(S) || (C.add(S), w(() => {
721
- var X;
704
+ C("key from setTimeout foreach currItemSignalMap", S), b.has(S) || (b.add(S), w(() => {
705
+ var Z;
722
706
  E();
723
- const A = m(S), $ = (X = r.get(S)) == null ? void 0 : X();
724
- if (!$ || !$.hostElement) return;
725
- const v = n.hostElement, R = $.hostElement;
707
+ const A = m(S), T = (Z = r.get(S)) == null ? void 0 : Z();
708
+ if (!T || !T.hostElement) return;
709
+ const v = n.hostElement, R = T.hostElement;
726
710
  if (!v) return;
727
- b("call effect from setTimeout", S, R);
711
+ C("call effect from setTimeout", S, R);
728
712
  const I = i.get(S);
729
713
  if (I && I.parentNode === v) {
730
714
  if (p(I, A, v)) {
731
- const T = v.children[A];
732
- T && T !== I ? v.insertBefore(I, T) : T || v.appendChild(I);
715
+ const $ = v.children[A];
716
+ $ && $ !== I ? v.insertBefore(I, $) : $ || v.appendChild(I);
733
717
  }
734
718
  R !== I && (I.replaceWith(R), i.set(S, R));
735
719
  } else if (i.set(S, R), A < v.children.length) {
736
- const T = v.children[A];
737
- T ? v.insertBefore(R, T) : v.appendChild(R);
720
+ const $ = v.children[A];
721
+ $ ? v.insertBefore(R, $) : v.appendChild(R);
738
722
  } else
739
723
  v.appendChild(R);
740
724
  }));
@@ -742,7 +726,7 @@ const Xt = () => () => {
742
726
  };
743
727
  Promise.resolve().then(() => B());
744
728
  }), n;
745
- }, ee = (s) => {
729
+ }, Zt = (s) => {
746
730
  let t = [W("div")], e = !1;
747
731
  return w(() => {
748
732
  var r, i;
@@ -753,13 +737,13 @@ const Xt = () => () => {
753
737
  W("div").addStyle({ display: "none" }).setAttribute("id", "empty_template")
754
738
  );
755
739
  try {
756
- b(
740
+ C(
757
741
  "newReactiveComponent.map",
758
742
  o.map((c) => {
759
743
  var a;
760
- return b("newReactiveComponent hostElement", c.hostElement), (a = c.hostElement) == null ? void 0 : a.id;
744
+ return C("newReactiveComponent hostElement", c.hostElement), (a = c.hostElement) == null ? void 0 : a.id;
761
745
  })
762
- ), b(
746
+ ), C(
763
747
  "currComponent[0].hostElement?.id",
764
748
  (r = t[0].hostElement) == null ? void 0 : r.id,
765
749
  t
@@ -773,75 +757,75 @@ const Xt = () => () => {
773
757
  console.error(c);
774
758
  }
775
759
  }), e ? t : t[0];
776
- }, se = (s) => bt in s, ne = (s) => {
777
- const t = Z("div")().addStyle({ display: "contents" }), e = (n) => {
760
+ }, Xt = (s) => pt in s, Qt = (s) => {
761
+ const t = Y("div")().addStyle({ display: "contents" }), e = (n) => {
778
762
  const o = t.hostElement;
779
763
  return o && (o.innerHTML = n), t;
780
764
  };
781
765
  return typeof s == "string" ? e(s) : t.addEffect(() => {
782
766
  e(s());
783
767
  }), t;
784
- }, at = (s, t, e) => s ? M(t) : e ? M(e) : Z("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), $t = (s, t, e) => M(() => at(!!s(), t, e)), oe = (s, t, e) => typeof s == "boolean" ? at(s, t, e) : $t(s, t, e), st = (s, t) => M(t).addEffect((e, n) => {
768
+ }, ct = (s, t, e) => s ? M(t) : e ? M(e) : Y("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), Ot = (s, t, e) => M(() => ct(!!s(), t, e)), te = (s, t, e) => typeof s == "boolean" ? ct(s, t, e) : Ot(s, t, e), et = (s, t) => M(t).addEffect((e, n) => {
785
769
  if (typeof s == "boolean")
786
770
  n.style.display = s ? "block" : "none";
787
771
  else {
788
772
  const o = s() ? "block" : "none";
789
773
  n.style.display = o;
790
774
  }
791
- }), re = (s, t, e) => {
775
+ }), ee = (s, t, e) => {
792
776
  const n = [
793
- st(s, t)
777
+ et(s, t)
794
778
  ].flat();
795
779
  return e && n.push(
796
780
  ...[
797
- st(
781
+ et(
798
782
  () => typeof s == "boolean" ? !s : !s(),
799
783
  e
800
784
  )
801
785
  ].flat()
802
786
  ), M(() => n);
803
- }, _t = (s, t) => {
804
- b("createCustomElement", s);
805
- const e = document.createElement(s), n = vt(e);
787
+ }, Mt = (s, t) => {
788
+ C("createCustomElement", s);
789
+ const e = document.createElement(s), n = bt(e);
806
790
  return e.init = () => {
807
- lt(new WeakRef(n), t);
791
+ it(new WeakRef(n), t);
808
792
  }, n;
809
- }, Wt = (s, t) => {
810
- const e = s.split(" ").slice(1).map((o) => o.trim()), n = _t(s.split(" ")[0], t);
793
+ }, jt = (s, t) => {
794
+ const e = s.split(" ").slice(1).map((o) => o.trim()), n = Mt(s.split(" ")[0], t);
811
795
  return Array.isArray(e) && e.length > 0 && n.addClass(...e), (...o) => {
812
796
  const r = o.filter(Boolean).flat().flatMap(
813
797
  (c) => typeof c == "function" && !g(c) ? M(() => c(n)) : c
814
798
  ), i = n.hostElement;
815
- return i && (i.allSlotContent = r, i.slotContent = r.filter(ft).reduce(
799
+ return i && (i.allSlotContent = r, i.slotContent = r.filter(dt).reduce(
816
800
  (c, a) => {
817
801
  var h;
818
- const C = ((h = a.hostElement) == null ? void 0 : h.getAttribute("slot")) || "default";
819
- return c[C] || (c[C] = []), c[C].push(a), c;
802
+ const b = ((h = a.hostElement) == null ? void 0 : h.getAttribute("slot")) || "default";
803
+ return c[b] || (c[b] = []), c[b].push(a), c;
820
804
  },
821
805
  {}
822
806
  ), i.appendAllSlotContent = () => {
823
807
  D(new WeakRef(n), ...r);
824
808
  }), n;
825
809
  };
826
- }, xt = (s, t, e) => Wt(
810
+ }, $t = (s, t, e) => jt(
827
811
  `${s.renderTagName}${t && typeof t == "string" ? " " + t : ""}`,
828
812
  F(t) ? t : t && typeof t == "string" ? e : void 0
829
- ), ie = () => {
813
+ ), se = () => {
830
814
  const s = () => {
831
815
  };
832
816
  return s.oldValue = null, s;
833
- }, ce = () => ({}), Ht = (s, t, e) => {
834
- const n = t ? ot(t, e)(s) : s;
817
+ }, ne = () => ({}), Tt = (s, t, e) => {
818
+ const n = t ? st(t, e)(s) : s;
835
819
  return (o, ...r) => {
836
820
  const i = [...r];
837
- return o && !F(o) && i.unshift(o), xt(n, F(o) ? o : {})(...i);
821
+ return o && !F(o) && i.unshift(o), $t(n, F(o) ? o : {})(...i);
838
822
  };
839
- }, le = (s) => [
840
- Ht(s),
823
+ }, oe = (s) => [
824
+ Tt(s),
841
825
  (t, e) => {
842
- ot(t, e)(s);
826
+ st(t, e)(s);
843
827
  }
844
- ], l = {}, kt = [
828
+ ], l = {}, _t = [
845
829
  "div",
846
830
  "span",
847
831
  "section",
@@ -903,25 +887,25 @@ const Xt = () => () => {
903
887
  "canvas",
904
888
  "slot"
905
889
  ];
906
- kt.forEach((s) => {
890
+ _t.forEach((s) => {
907
891
  l[s] = (t, ...e) => {
908
892
  let n = [...e];
909
- return t && !F(t) && (n = [t].concat(n)), Z(s, F(t) ? t : {})(...n);
893
+ return t && !F(t) && (n = [t].concat(n)), Y(s, F(t) ? t : {})(...n);
910
894
  };
911
895
  });
912
- const Pt = l.div, ae = l.span, de = l.section, he = l.input, fe = l.button, ue = l.table, pe = l.tr, me = l.td, Ee = l.th, Ce = l.ul, be = l.li, Se = l.ol, ye = l.form, we = l.label, ve = l.select, Ae = l.option, Re = l.textarea, ge = l.img, Le = l.a, Ie = l.p, Oe = l.h1, Me = l.h2, je = l.h3, Te = l.h4, $e = l.h5, _e = l.h6, We = l.br, xe = l.hr, He = l.pre, ke = l.code, Pe = l.nav, Fe = l.header, Be = l.footer, Ve = l.main, Ne = l.aside, Je = l.article, qe = l.figure, ze = l.figcaption, De = l.blockquote, Ge = l.cite, Ke = l.small, Ue = l.strong, Ye = l.em, Ze = l.b, Xe = l.i, Qe = l.u, ts = l.s, es = l.sub, ss = l.sup, ns = l.mark, os = l.del, rs = l.ins, is = l.details, cs = l.summary, ls = l.progress, as = l.meter, ds = l.audio, hs = l.video, fs = l.canvas, us = l.slot, ps = (s) => (t) => s(t).addClass(...t.classList ?? []).addReactiveClass(t.reactiveClassList ?? {});
913
- function Ft(s, t) {
896
+ const Wt = l.div, re = l.span, ie = l.section, ce = l.input, le = l.button, ae = l.table, de = l.tr, he = l.td, fe = l.th, ue = l.ul, pe = l.li, me = l.ol, Ee = l.form, Ce = l.label, be = l.select, Se = l.option, ye = l.textarea, we = l.img, ve = l.a, Ae = l.p, Re = l.h1, ge = l.h2, Le = l.h3, Ie = l.h4, Oe = l.h5, Me = l.h6, je = l.br, $e = l.hr, Te = l.pre, _e = l.code, We = l.nav, xe = l.header, He = l.footer, ke = l.main, Pe = l.aside, Fe = l.article, Be = l.figure, Ve = l.figcaption, Ne = l.blockquote, Je = l.cite, qe = l.small, ze = l.strong, De = l.em, Ge = l.b, Ke = l.i, Ue = l.u, Ye = l.s, Ze = l.sub, Xe = l.sup, Qe = l.mark, ts = l.del, es = l.ins, ss = l.details, ns = l.summary, os = l.progress, rs = l.meter, is = l.audio, cs = l.video, ls = l.canvas, as = l.slot, ds = (s) => (t) => s(t).addClass(...t.classList ?? []).addReactiveClass(t.reactiveClassList ?? {});
897
+ function xt(s, t) {
914
898
  let e = 0;
915
899
  return (...n) => {
916
900
  const o = Date.now();
917
901
  o - e >= t && (s(...n), e = o);
918
902
  };
919
903
  }
920
- const ms = (s, t) => M(() => {
904
+ const hs = (s, t) => M(() => {
921
905
  const e = s();
922
906
  let n = null;
923
907
  return e.map(
924
- (o, r) => Pt(
908
+ (o, r) => Wt(
925
909
  {
926
910
  "@dragstart": (i, c, a) => {
927
911
  n = a;
@@ -935,11 +919,11 @@ const ms = (s, t) => M(() => {
935
919
  "@dragover": (i) => {
936
920
  i.preventDefault();
937
921
  },
938
- "@dragenter": Ft((i, c, a) => {
939
- var C, h, d;
922
+ "@dragenter": xt((i, c, a) => {
923
+ var b, h, d;
940
924
  if (i.preventDefault(), n) {
941
925
  let m = n, p = a;
942
- const u = ((C = n.getClientRects().item(0)) == null ? void 0 : C.y) ?? 0, y = ((h = a.getClientRects().item(0)) == null ? void 0 : h.y) ?? 0;
926
+ const u = ((b = n.getClientRects().item(0)) == null ? void 0 : b.y) ?? 0, y = ((h = a.getClientRects().item(0)) == null ? void 0 : h.y) ?? 0;
943
927
  u < y && ([m, p] = [a, n]), (d = a.parentElement) == null || d.insertBefore(m, p);
944
928
  }
945
929
  }, 200)
@@ -947,15 +931,15 @@ const ms = (s, t) => M(() => {
947
931
  t(o, r, [...s.peek()])
948
932
  )
949
933
  );
950
- }), Es = (s, t, e) => {
934
+ }), fs = (s, t, e) => {
951
935
  let n = [], o = [];
952
936
  const r = W("div").addStyle({ display: "contents" }), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
953
937
  return w(() => {
954
- const a = s(), C = a.map(t);
955
- o.filter((d) => !C.includes(d)).forEach((d) => {
938
+ const a = s(), b = a.map(t);
939
+ o.filter((d) => !b.includes(d)).forEach((d) => {
956
940
  var m, p;
957
941
  i.delete(d), (p = (m = r.hostElement) == null ? void 0 : m.querySelector(`[data-key="${d}"]`)) == null || p.remove();
958
- }), C.forEach((d, m) => {
942
+ }), b.forEach((d, m) => {
959
943
  o.includes(d) || i.set(
960
944
  d,
961
945
  () => e(a[m], m, a).setCustomAttribute(
@@ -963,13 +947,13 @@ const ms = (s, t) => M(() => {
963
947
  d
964
948
  )
965
949
  );
966
- }), C.forEach((d, m) => {
950
+ }), b.forEach((d, m) => {
967
951
  var p;
968
952
  if (o.includes(d)) {
969
953
  JSON.stringify(n[o.indexOf(d)]) !== JSON.stringify(a[m]) && ((p = c.get(d)) == null || p.set({
970
954
  templateFunc: () => e(a[m], m, a),
971
955
  items: a,
972
- itemsKey: C,
956
+ itemsKey: b,
973
957
  index: m
974
958
  }));
975
959
  return;
@@ -979,7 +963,7 @@ const ms = (s, t) => M(() => {
979
963
  j({
980
964
  templateFunc: () => e(a[m], m, a),
981
965
  items: a,
982
- itemsKey: C,
966
+ itemsKey: b,
983
967
  index: m
984
968
  })
985
969
  ), queueMicrotask(() => {
@@ -1005,130 +989,130 @@ const ms = (s, t) => M(() => {
1005
989
  const h = (d, m, p) => {
1006
990
  p && m && (d < m.children.length ? m.insertBefore(p, m.children[d]) : m.appendChild(p));
1007
991
  };
1008
- o = C, n = [...a];
992
+ o = b, n = [...a];
1009
993
  }), r;
1010
994
  };
1011
995
  export {
1012
996
  _ as BaseElement,
1013
- Le as a,
1014
- Tt as addAttributeList,
1015
- Ot as addClassList,
1016
- It as addCustomAttributes,
1017
- Mt as addReactiveClassList,
1018
- jt as addStyleList,
997
+ ve as a,
998
+ It as addAttributeList,
999
+ Rt as addClassList,
1000
+ At as addCustomAttributes,
1001
+ gt as addReactiveClassList,
1002
+ Lt as addStyleList,
1019
1003
  D as appendContentItem,
1020
- Je as article,
1021
- Ne as aside,
1022
- ds as audio,
1023
- Ze as b,
1024
- zt as bindReactiveSignals,
1025
- De as blockquote,
1026
- We as br,
1027
- fe as button,
1004
+ Fe as article,
1005
+ Pe as aside,
1006
+ is as audio,
1007
+ Ge as b,
1008
+ Vt as bindReactiveSignals,
1009
+ Ne as blockquote,
1010
+ je as br,
1011
+ le as button,
1028
1012
  N as camelToKebab,
1029
- fs as canvas,
1013
+ ls as canvas,
1030
1014
  G as checkCall,
1031
- Nt as checkRef,
1032
- Ge as cite,
1033
- Rt as classList,
1034
- Qt as cls,
1035
- ke as code,
1015
+ Pt as checkRef,
1016
+ Je as cite,
1017
+ yt as classList,
1018
+ Ut as cls,
1019
+ _e as code,
1036
1020
  V as colorLog,
1037
- Gt as combineLatest,
1038
- ot as component,
1039
- le as configCustomComponent,
1040
- ps as createComponent,
1041
- xt as createCustom,
1042
- Wt as createCustomEl,
1043
- _t as createCustomElement,
1044
- Z as createEl,
1021
+ Jt as combineLatest,
1022
+ st as component,
1023
+ oe as configCustomComponent,
1024
+ ds as createComponent,
1025
+ $t as createCustom,
1026
+ jt as createCustomEl,
1027
+ Mt as createCustomElement,
1028
+ Y as createEl,
1045
1029
  W as createElement,
1046
- qt as createSignal,
1047
- vt as customElementHelpers,
1048
- ms as ddList,
1049
- ce as defineSlotTemplate,
1050
- os as del,
1051
- is as details,
1052
- pt as disableLogs,
1053
- Pt as div,
1030
+ Bt as createSignal,
1031
+ bt as customElementHelpers,
1032
+ hs as ddList,
1033
+ ne as defineSlotTemplate,
1034
+ ts as del,
1035
+ ss as details,
1036
+ ft as disableLogs,
1037
+ Wt as div,
1054
1038
  w as effect,
1055
- At as elementHelpers,
1056
- Ye as em,
1057
- Vt as enableLogs,
1058
- Yt as event,
1059
- Xt as eventEmitter,
1060
- ze as figcaption,
1061
- qe as figure,
1062
- Kt as firstUpdate,
1063
- Be as footer,
1064
- Dt as forkJoin,
1065
- ye as form,
1066
- Es as getList,
1039
+ St as elementHelpers,
1040
+ De as em,
1041
+ kt as enableLogs,
1042
+ Dt as event,
1043
+ Kt as eventEmitter,
1044
+ Ve as figcaption,
1045
+ Be as figure,
1046
+ qt as firstUpdate,
1047
+ He as footer,
1048
+ Nt as forkJoin,
1049
+ Ee as form,
1050
+ fs as getList,
1067
1051
  M as getSignalContent,
1068
- Oe as h1,
1069
- Me as h2,
1070
- je as h3,
1071
- Te as h4,
1072
- $e as h5,
1073
- _e as h6,
1074
- Fe as header,
1075
- xe as hr,
1076
- Xe as i,
1077
- ge as img,
1078
- lt as initComponent,
1079
- he as input,
1080
- rs as ins,
1081
- Zt as isBaseElement,
1082
- ft as isComponentConfig,
1052
+ Re as h1,
1053
+ ge as h2,
1054
+ Le as h3,
1055
+ Ie as h4,
1056
+ Oe as h5,
1057
+ Me as h6,
1058
+ xe as header,
1059
+ $e as hr,
1060
+ Ke as i,
1061
+ we as img,
1062
+ it as initComponent,
1063
+ ce as input,
1064
+ es as ins,
1065
+ Gt as isBaseElement,
1066
+ dt as isComponentConfig,
1083
1067
  F as isComponentInitConfig,
1084
1068
  g as isReactiveSignal,
1085
- se as isSlotTemplate,
1086
- ut as kebabToCamel,
1087
- we as label,
1088
- be as li,
1089
- Ve as main,
1090
- ns as mark,
1091
- as as meter,
1092
- Pe as nav,
1093
- ie as newEventEmitter,
1094
- Se as ol,
1095
- te as oldGetList,
1096
- Ae as option,
1097
- Ie as p,
1098
- He as pre,
1099
- ls as progress,
1100
- b as projectLog,
1101
- Ut as property,
1102
- Y as removeEffect,
1103
- at as renderIf,
1104
- Jt as rs,
1105
- $t as rxRenderIf,
1106
- ts as s,
1107
- de as section,
1108
- ve as select,
1109
- Lt as setChildren,
1110
- gt as setEffects,
1111
- et as setListeners,
1112
- re as show,
1113
- st as showIf,
1069
+ Xt as isSlotTemplate,
1070
+ ht as kebabToCamel,
1071
+ Ce as label,
1072
+ pe as li,
1073
+ ke as main,
1074
+ Qe as mark,
1075
+ rs as meter,
1076
+ We as nav,
1077
+ se as newEventEmitter,
1078
+ me as ol,
1079
+ Yt as oldGetList,
1080
+ Se as option,
1081
+ Ae as p,
1082
+ Te as pre,
1083
+ os as progress,
1084
+ C as projectLog,
1085
+ zt as property,
1086
+ U as removeEffect,
1087
+ ct as renderIf,
1088
+ Ft as rs,
1089
+ Ot as rxRenderIf,
1090
+ Ye as s,
1091
+ ie as section,
1092
+ be as select,
1093
+ vt as setChildren,
1094
+ wt as setEffects,
1095
+ tt as setListeners,
1096
+ ee as show,
1097
+ et as showIf,
1114
1098
  j as signal,
1115
- ee as signalComponent,
1116
- us as slot,
1117
- Ke as small,
1118
- ae as span,
1119
- Ue as strong,
1120
- es as sub,
1121
- cs as summary,
1122
- ss as sup,
1123
- ue as table,
1124
- me as td,
1125
- Re as textarea,
1126
- Ee as th,
1127
- pe as tr,
1128
- Qe as u,
1129
- Ce as ul,
1130
- ne as unsafeHtml,
1131
- Ht as useCustomComponent,
1132
- hs as video,
1133
- oe as when
1099
+ Zt as signalComponent,
1100
+ as as slot,
1101
+ qe as small,
1102
+ re as span,
1103
+ ze as strong,
1104
+ Ze as sub,
1105
+ ns as summary,
1106
+ Xe as sup,
1107
+ ae as table,
1108
+ he as td,
1109
+ ye as textarea,
1110
+ fe as th,
1111
+ de as tr,
1112
+ Ue as u,
1113
+ ue as ul,
1114
+ Qt as unsafeHtml,
1115
+ Tt as useCustomComponent,
1116
+ cs as video,
1117
+ te as when
1134
1118
  };
@@ -0,0 +1,2 @@
1
+ (function(i,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(i=typeof globalThis<"u"?globalThis:i||self,A(i.ReactiveComponent={}))})(this,function(i){"use strict";var fn=Object.defineProperty;var hn=(i,A,_)=>A in i?fn(i,A,{enumerable:!0,configurable:!0,writable:!0,value:_}):i[A]=_;var u=(i,A,_)=>hn(i,typeof A!="symbol"?A+"":A,_);const A=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"ref"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),_=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,D=(n,t,...e)=>{t&&t.apply(n,e)};let G=!0;const C=(...n)=>{G&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},B=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),ot=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),F=(n,...t)=>{if(!G)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const a=c.slice(1);return e[a]||"color: inherit"});let r=n;s.forEach(c=>{const a=new RegExp(`\\${c}([^\\s,]+)`,"g");r=r.replace(a,"%c$1")}),console.log(r,...o,...t)},Tt=()=>{G=!0},rt=()=>{G=!1};rt();const jt=(n,t)=>{n.every(Boolean)&&t(n)},V=new Set;let Q=!1;const Ot=n=>{n.status==="active"&&V.add(n),Q||(Q=!0,queueMicrotask(()=>{Q=!1,C("pendingEffects.size",V.size);const t=Array.from(V);V.clear(),t.forEach(e=>{if(e.status==="active"){K(e),O.push(e);try{e()}catch(s){console.error("Error in effect:",s)}finally{O.pop()}}}),C("after ------ pendingEffects.size",V.size)}))},O=[],K=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(r=>{var c;return(c=r.destroy)==null?void 0:c.call(r)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(r=>r()),(o=n.cleanupSet)==null||o.clear()};function T(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const r=O[O.length-1];return r&&!r.fake&&!s.has(r)&&r.status==="active"&&(s.add(r),(c=r.cleanupSet)==null||c.add(()=>s.delete(r))),!(t!=null&&t.name)&&(r!=null&&r.effectId)&&o.setName(r.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(r){return o.signalId=`${r}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(r){return e=r,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(r){n=r,s.forEach(c=>Ot(c))},o.set=function(r,c=e){n!==r&&c(n,r)&&o.forceSet(r)},o.update=function(r){o.set(r(n))},o.pipe=(r,c)=>{c!=null&&c.name&&o.setName(c.name);const a=T(null);return v(()=>{const d=o();v(()=>{const h=r(d);h instanceof Promise?h.then(E=>a.set(E)):R(h)?v(()=>a.set(h()),{name:"pipe_effect_inner"}):a.set(h)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),a},o}function v(n,t){var r;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;C("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=O[O.length-1];return o&&((r=o.children)==null||r.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;K(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,O.push(s),s(),O.pop(),s}const R=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function Mt(n,...t){const e=T("");return v(()=>{const s=t.map(r=>R(r)?String(r()):String(r)),o=[n[0]];s.forEach((r,c)=>{o.push(r,n[c+1])}),e.set(o.join(""))}),e}function $t(n,t){const e=T(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&v(()=>{const o=n();o instanceof Promise?o.then(s):R(o)?v(()=>s(o())):s(o)}),e}function _t(n,t){let e=n(),s=t();v(()=>{const o=n(),r=t();o!==r&&(o!==e?t.set(o):r!==s&&n.set(r)),e=o,s=r})}function Ht(...n){let t=n.map(s=>s());const e=T(t);return n.forEach((s,o)=>{v(()=>{const r=()=>t.filter(c=>c!==void 0).length;r()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),r()===n.length&&e.set([...t])})}),e}const kt=(...n)=>{const t=T([]);return v(()=>{t.set(n.map(e=>e()))}),t},Wt=(n,t)=>{let e=!0;const s=v(()=>{var o;e&&(e=!1,t(n()),(o=s.destroy)==null||o.call(s))})},U="eventProps",Y="EVENT_CONFIG",J="observedAttributes",Pt=()=>(n,t)=>{Reflect.get(n,J)||Reflect.defineProperty(n,J,{value:[]}),Reflect.get(n,J).push(B(t))},Bt=n=>(t,e)=>{Reflect.get(t,U)||Reflect.defineProperty(t,U,{value:[]}),Reflect.get(t,Y)||Reflect.defineProperty(t,Y,{value:{}}),Reflect.get(t,Y)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,U).push(e)},x=(n,t=!1)=>e=>{C(n,"start register static attr",e.prototype[J]);const s=[];if(e.styles){const r=e.styles,c=[];Array.isArray(r)?c.push(...r):c.push(r),c.forEach(a=>{const d=new CSSStyleSheet;d.replaceSync(a),s.push(d);const S=new CSSStyleSheet;S.replaceSync(a.slice(a.indexOf("@property"))),document.adoptedStyleSheets.push(S)})}class o extends e{constructor(...c){C("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return C("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,a,d){C("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${a}, newValue: ${d}`,`%c${n}%c`);try{d=JSON.parse(d)}catch{}const S=ot(c);if(S in this&&R(this[S])){const h=this[S];h.setName(c),d===null?(h.set(h.initValue),this.removeAttribute(c)):h.set(d)}D(this,e.prototype.attributeChangedCallback,c,a,d)}connectedCallback(){const c=()=>{var d,S;C("rwc: connectedCallback"),C("connectedCallback",`%c${n}%c`,this),(d=this.init)==null||d.call(this),this.providers&&Object.keys(this.providers).length>0&&(C("WRAPPER for providers",n),Object.entries(this.providers).forEach(([h,f])=>{C("register provider",h,f()),this.addEventListener(h,E=>{var m;C("send provider",h,f());const p=E;((m=p.detail)==null?void 0:m.context)===h&&(p.stopPropagation(),p.detail.callback(f))})})),this.checkInjects(),(S=e.prototype[U])==null||S.forEach(h=>{this[h]=f=>{const E=e.prototype[Y][h],{bubbles:p,composed:m}=E;R(f)?v(()=>{F("@oemit reactive value",f()),this.dispatchEvent(new CustomEvent(h,{detail:f(),bubbles:p,composed:m}))}):(F("@oemit value",f),this.dispatchEvent(new CustomEvent(h,{detail:f,bubbles:p,composed:m})))}}),C("start render",`%c${n}%c`,n);const a=()=>{C("rwc: insertRenderTemplate");const f=this.render().hostElement;f&&this.shadow.appendChild(f),D(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const h=p=>p instanceof Promise||Array.isArray(p)&&p.every(m=>m instanceof Promise),f=this.rootStyle,E=p=>{const m=new CSSStyleSheet;m.replaceSync(p),this.shadow.adoptedStyleSheets.push(m);const w=new CSSStyleSheet;w.replaceSync(p.slice(p.indexOf("@property"))),document.adoptedStyleSheets.push(w)};if(h(f)){const p=[];Array.isArray(f)?p.push(...f):p.push(f),Promise.all(p).then(m=>m.forEach(w=>E(w.default))).then(()=>a())}else{const p=[];Array.isArray(f)?p.push(...f):p.push(f),p.forEach(m=>E(m)),a()}}else a();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{C(this.slotContext,this.slotContext&&this.slotContext[h.name]),F("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(f=>{const E=this.slotContext[h.name];this.slotContext&&R(E)&&(F("@oslot element",h,`name:${h.name};`,h.assignedElements()),v(()=>{f.dispatchEvent(new CustomEvent("handleSlotContext",{detail:E()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),v(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var a,d;return(d=(a=c.deref())==null?void 0:a.destroy)==null?void 0:d.call(a)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),D(this,e.prototype.disconnectedCallback)}}return u(o,"observedAttributes",e.prototype[J]??[]),u(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class H extends HTMLElement{constructor(e=!1){super();u(this,"init");u(this,"isSlotLazyLoading",!1);u(this,"slotTemplate");u(this,"slotContext");u(this,"rootStyle");u(this,"modelValue");u(this,"providers");u(this,"effectSet",new Set);u(this,"appendAllSlotContent");u(this,"allSlotContent",[]);u(this,"slotContent",{});u(this,"htmlSlotContent",{});u(this,"shadow");u(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const r=e.slot||"default";this.htmlSlotContent[r]||(this.htmlSlotContent[r]=[]),(o=this.htmlSlotContent[r])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return C("%cinject%c",e),this.injects[e]||(this.injects[e]=T(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{C("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>v(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}u(H,"observedAttributes",[]),u(H,"renderTagName",""),u(H,"styles");const Ft=n=>"render"in n&&"setReactiveValue"in n,Vt="handleSlotContext",it="onConnected",ct=n=>typeof n=="string"?n:JSON.stringify(n),Jt=n=>{const t=document.createElement("span");return t.textContent=ct(n),t},lt=(n,t)=>(n.appendChild(Jt(t)),n),Nt=(n,t)=>(n.replaceChildren(),lt(n,t)),at=n=>{const t=document.createElement("span");return v(()=>{const e=n();t.textContent=ct(e)}),t};class dt{constructor(t){u(this,"wrapper");u(this,"keyedEffects",new Map);u(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),it in s&&setTimeout(()=>{var r;(r=s.onConnected)==null||r.call(s,e,s)}))}),this));u(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const r=o.hostElement;r&&e.appendChild(r)}),(s=this.hostElement)==null||s.appendChild(e),this});u(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(r=>r===e.hostElement)){const r=e.hostElement;r&&((o=this.hostElement)==null||o.removeChild(r))}}),this));u(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(lt(e,t),this):this});u(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(Nt(e,t),this):this});u(this,"setAttribute",(t,e)=>{var r;C("setAttribute",t,e);const s=this.hostElement;if(!s)return this;let o;if((typeof e=="boolean"||e===null)&&!(s instanceof H))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((r=this.hostElement)==null||r.setAttribute(B(t),o),!(s instanceof H)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});u(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(B(t),s),this});u(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{C("setReactiveAttribute effect",t,e),s.setAttribute(t,e())},t),this));u(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));u(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(B(t)),this});u(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const r=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(r){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(r?e.style.setProperty(s,o):e.style[s]=o)}),this):this});u(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,it,{get(){return t}}),this):this);u(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
2
+ `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const r=e();r.length>0&&(o?this.replaceClass(o,r):this.addClass(r),o=r)})})()}),this));u(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});u(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));u(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});u(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});u(this,"addEffect",(t,e)=>{var r,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const a=(r=this.keyedEffects.get(e))==null?void 0:r.deref();a&&K(a)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,v(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});u(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(at(t)),this});u(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(at(t)),this});u(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,r=>e(r,this,this.hostElement),s),this}}class qt extends dt{constructor(){super(...arguments);u(this,"setReactiveValue",e=>(this.hostElement instanceof H&&this.hostElement.setReactiveValue(e),this));u(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([r,c])=>{s[r]=c}),this})}}const zt=()=>()=>{},ft=n=>new qt(new WeakRef(n)),ht=n=>new dt(new WeakRef(n)),ut=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Dt=(n,...t)=>ut(n,...t),tt=(n,t)=>{var o;if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(r=>r.startsWith(".")||r.startsWith("@")||r.startsWith("$"));e.filter(r=>r.startsWith(".")).forEach(r=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[r.slice(1)]=t[r]}),e.filter(r=>r.startsWith("@")).forEach(r=>{t!=null&&t.listeners||(t.listeners={});const c=r.slice(1);t.listeners[c]=t[r]}),e.filter(r=>r.startsWith("$")).forEach(r=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[r])});const s=n.deref();if(s)return Ct(s,t.classList),St(s,t.style),yt(s,t.attributes),bt(s,t.reactiveClassList),Et(s,t.customAttributes),pt(s,t.children),mt(s,t.effects),et(s,t.listeners),et(s,t.customListeners),(o=t.ref)==null||o.set(s),s},et=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},mt=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),pt=(n,t)=>N(new WeakRef(n),...t||[])??n,Et=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{R(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},Ct=(n,t)=>n.addClass(...t||[]),bt=(n,t)=>n.addReactiveClass(t||{}),St=(n,t)=>n.addStyle(t||{}),yt=(n,t)=>{const e=t,s=(o,r)=>{r!==void 0&&(C("addAttribute",o,r),R(r)?n.setReactiveAttribute(o,r):typeof r=="function"?n.addEffect(()=>{n.setAttribute(o,r())}):n.setAttribute(o,r))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},N=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):R(s)?e.addReactiveContent(s):e.append(s)}),e},k=(n,t)=>{const e=document.createElement(n),s=ht(e);return tt(new WeakRef(s),t)??s},Z=(n,t)=>{const[e,...s]=n.split(" ").map(r=>r.trim()),o=k(e,t);return s.length>0&&o.addClass(...s),(...r)=>N(new WeakRef(o),...r.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!R(c)?j(()=>c(o)):c))??o},j=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return k("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),N(new WeakRef(e),...[n()].flat())},t)},Gt=(n,t,e)=>{const s=k("div").addStyle({display:"contents"}),o=new Map,r=new Map,c=new Map,a=new Map;let d=[];const S=new Set;let h=n.peek();const f=m=>{S.delete(m),o.delete(m),r.delete(m),c.delete(m),a.delete(m)},E=m=>{if(!a.has(m)){const w=d.indexOf(m);return a.set(m,w),w}return a.get(m)},p=(m,w,q)=>Array.from(q.children).indexOf(m)!==w;return v(()=>{const m=n(),w=m.map(t).map(b=>typeof b=="string"?b:b.toString()),q=new Set(w);a.clear(),w.forEach((b,y)=>{a.set(b,y)}),d=w;const M=s.hostElement;if(!M)return;C("containerChildren",Array.from(M.children),d);const z=[];Array.from(M.children).forEach(b=>{const y=b.dataset.key;y&&!q.has(y)&&z.push(b)}),z.forEach(b=>{const y=b.dataset.key;C("remove element",y,b),b.remove(),f(y)}),w.forEach((b,y)=>{var g;const L=m[y],P=h[y];if(!o.has(b))C("create new element",b,L),o.set(b,T(Math.random().toString(36).substring(2,15))),r.set(b,()=>e(L,y,m).setCustomAttribute("data-key",b));else if(P&&JSON.stringify(L)!==JSON.stringify(P)){const I=c.get(b);(g=o.get(b))==null||g.set(Math.random().toString(36).substring(2,15)),r.set(b,()=>e(L,y,m).setCustomAttribute("data-key",b)),I&&I.parentNode&&C("mark element for update",b)}}),h=[...m.map(b=>({...b}))];const X=()=>{o.forEach((b,y)=>{C("key from setTimeout foreach currItemSignalMap",y),S.has(y)||(S.add(y),v(()=>{var It;b();const L=E(y),P=(It=r.get(y))==null?void 0:It();if(!P||!P.hostElement)return;const g=s.hostElement,I=P.hostElement;if(!g)return;C("call effect from setTimeout",y,I);const $=c.get(y);if($&&$.parentNode===g){if(p($,L,g)){const W=g.children[L];W&&W!==$?g.insertBefore($,W):W||g.appendChild($)}I!==$&&($.replaceWith(I),c.set(y,I))}else if(c.set(y,I),L<g.children.length){const W=g.children[L];W?g.insertBefore(I,W):g.appendChild(I)}else g.appendChild(I)}))})};Promise.resolve().then(()=>X())}),s},Kt=n=>{let t=[k("div")],e=!1;return v(()=>{var r,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{C("newReactiveComponent.map",o.map(a=>{var d;return C("newReactiveComponent hostElement",a.hostElement),(d=a.hostElement)==null?void 0:d.id})),C("currComponent[0].hostElement?.id",(r=t[0].hostElement)==null?void 0:r.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(a=>a.hostElement).filter(Boolean)),t.slice(1).forEach(a=>{var d;return(d=a.hostElement)==null?void 0:d.remove()}),t=o}catch(a){console.error(a)}}),e?t:t[0]},Ut=n=>Vt in n,Yt=n=>{const t=Z("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},nt=(n,t,e)=>n?j(t):e?j(e):Z("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),vt=(n,t,e)=>j(()=>nt(!!n(),t,e)),Zt=(n,t,e)=>typeof n=="boolean"?nt(n,t,e):vt(n,t,e),st=(n,t)=>j(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),Xt=(n,t,e)=>{const s=[st(n,t)].flat();return e&&s.push(...[st(()=>typeof n=="boolean"?!n:!n(),e)].flat()),j(()=>s)},wt=(n,t)=>{C("createCustomElement",n);const e=document.createElement(n),s=ft(e);return e.init=()=>{tt(new WeakRef(s),t)},s},At=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=wt(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const r=o.filter(Boolean).flat().flatMap(a=>typeof a=="function"&&!R(a)?j(()=>a(s)):a),c=s.hostElement;return c&&(c.allSlotContent=r,c.slotContent=r.filter(_).reduce((a,d)=>{var h;const S=((h=d.hostElement)==null?void 0:h.getAttribute("slot"))||"default";return a[S]||(a[S]=[]),a[S].push(d),a},{}),c.appendAllSlotContent=()=>{N(new WeakRef(s),...r)}),s}},gt=(n,t,e)=>At(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,A(t)?t:t&&typeof t=="string"?e:void 0),Qt=()=>{const n=()=>{};return n.oldValue=null,n},xt=()=>({}),Rt=(n,t,e)=>{const s=t?x(t,e)(n):n;return(o,...r)=>{const c=[...r];return o&&!A(o)&&c.unshift(o),gt(s,A(o)?o:{})(...c)}},te=n=>[Rt(n),(t,e)=>{x(t,e)(n)}],l={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{l[n]=(t,...e)=>{let s=[...e];return t&&!A(t)&&(s=[t].concat(s)),Z(n,A(t)?t:{})(...s)}});const Lt=l.div,ee=l.span,ne=l.section,se=l.input,oe=l.button,re=l.table,ie=l.tr,ce=l.td,le=l.th,ae=l.ul,de=l.li,fe=l.ol,he=l.form,ue=l.label,me=l.select,pe=l.option,Ee=l.textarea,Ce=l.img,be=l.a,Se=l.p,ye=l.h1,ve=l.h2,we=l.h3,Ae=l.h4,ge=l.h5,Re=l.h6,Le=l.br,Ie=l.hr,Te=l.pre,je=l.code,Oe=l.nav,Me=l.header,$e=l.footer,_e=l.main,He=l.aside,ke=l.article,We=l.figure,Pe=l.figcaption,Be=l.blockquote,Fe=l.cite,Ve=l.small,Je=l.strong,Ne=l.em,qe=l.b,ze=l.i,De=l.u,Ge=l.s,Ke=l.sub,Ue=l.sup,Ye=l.mark,Ze=l.del,Xe=l.ins,Qe=l.details,xe=l.summary,tn=l.progress,en=l.meter,nn=l.audio,sn=l.video,on=l.canvas,rn=l.slot,cn=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});function ln(n,t){let e=0;return(...s)=>{const o=Date.now();o-e>=t&&(n(...s),e=o)}}const an=(n,t)=>j(()=>{const e=n();let s=null;return e.map((o,r)=>Lt({"@dragstart":(c,a,d)=>{s=d},"@dragend":(c,a,d)=>{d.style.transform="",d.removeAttribute("draggable")},"@mousedown":(c,a,d)=>{d.style.transform="translateZ(0)",d.setAttribute("draggable","true")},"@dragover":c=>{c.preventDefault()},"@dragenter":ln((c,a,d)=>{var S,h,f;if(c.preventDefault(),s){let E=s,p=d;const m=((S=s.getClientRects().item(0))==null?void 0:S.y)??0,w=((h=d.getClientRects().item(0))==null?void 0:h.y)??0;m<w&&([E,p]=[d,s]),(f=d.parentElement)==null||f.insertBefore(E,p)}},200)},t(o,r,[...n.peek()])))}),dn=(n,t,e)=>{let s=[],o=[];const r=k("div").addStyle({display:"contents"}),c=new Map,a=new Map;return v(()=>{const d=n(),S=d.map(t);o.filter(f=>!S.includes(f)).forEach(f=>{var E,p;c.delete(f),(p=(E=r.hostElement)==null?void 0:E.querySelector(`[data-key="${f}"]`))==null||p.remove()}),S.forEach((f,E)=>{o.includes(f)||c.set(f,()=>e(d[E],E,d).setCustomAttribute("data-key",f))}),S.forEach((f,E)=>{var p;if(o.includes(f)){JSON.stringify(s[o.indexOf(f)])!==JSON.stringify(d[E])&&((p=a.get(f))==null||p.set({templateFunc:()=>e(d[E],E,d),items:d,itemsKey:S,index:E}));return}a.set(f,T({templateFunc:()=>e(d[E],E,d),items:d,itemsKey:S,index:E})),queueMicrotask(()=>{v(()=>{var z,X,b;const{templateFunc:m,index:w}=((z=a.get(f))==null?void 0:z())??{},q=(X=r.hostElement)==null?void 0:X.querySelector(`[data-key="${f}"]`),M=(m==null?void 0:m().setCustomAttribute("data-key",f).hostElement)??document.createElement("div");q?(b=r.hostElement)==null||b.childNodes.forEach((y,L)=>{y instanceof HTMLElement&&y.getAttribute("data-key")===f&&(w===L?(h(w??0,r.hostElement,M),y.remove()):h(w??0,r.hostElement,M))}):h(w??0,r.hostElement,M)})})});const h=(f,E,p)=>{p&&E&&(f<E.children.length?E.insertBefore(p,E.children[f]):E.appendChild(p))};o=S,s=[...d]}),r};i.BaseElement=H,i.a=be,i.addAttributeList=yt,i.addClassList=Ct,i.addCustomAttributes=Et,i.addReactiveClassList=bt,i.addStyleList=St,i.appendContentItem=N,i.article=ke,i.aside=He,i.audio=nn,i.b=qe,i.bindReactiveSignals=_t,i.blockquote=Be,i.br=Le,i.button=oe,i.camelToKebab=B,i.canvas=on,i.checkCall=D,i.checkRef=jt,i.cite=Fe,i.classList=ut,i.cls=Dt,i.code=je,i.colorLog=F,i.combineLatest=kt,i.component=x,i.configCustomComponent=te,i.createComponent=cn,i.createCustom=gt,i.createCustomEl=At,i.createCustomElement=wt,i.createEl=Z,i.createElement=k,i.createSignal=$t,i.customElementHelpers=ft,i.ddList=an,i.defineSlotTemplate=xt,i.del=Ze,i.details=Qe,i.disableLogs=rt,i.div=Lt,i.effect=v,i.elementHelpers=ht,i.em=Ne,i.enableLogs=Tt,i.event=Bt,i.eventEmitter=zt,i.figcaption=Pe,i.figure=We,i.firstUpdate=Wt,i.footer=$e,i.forkJoin=Ht,i.form=he,i.getList=dn,i.getSignalContent=j,i.h1=ye,i.h2=ve,i.h3=we,i.h4=Ae,i.h5=ge,i.h6=Re,i.header=Me,i.hr=Ie,i.i=ze,i.img=Ce,i.initComponent=tt,i.input=se,i.ins=Xe,i.isBaseElement=Ft,i.isComponentConfig=_,i.isComponentInitConfig=A,i.isReactiveSignal=R,i.isSlotTemplate=Ut,i.kebabToCamel=ot,i.label=ue,i.li=de,i.main=_e,i.mark=Ye,i.meter=en,i.nav=Oe,i.newEventEmitter=Qt,i.ol=fe,i.oldGetList=Gt,i.option=pe,i.p=Se,i.pre=Te,i.progress=tn,i.projectLog=C,i.property=Pt,i.removeEffect=K,i.renderIf=nt,i.rs=Mt,i.rxRenderIf=vt,i.s=Ge,i.section=ne,i.select=me,i.setChildren=pt,i.setEffects=mt,i.setListeners=et,i.show=Xt,i.showIf=st,i.signal=T,i.signalComponent=Kt,i.slot=rn,i.small=Ve,i.span=ee,i.strong=Je,i.sub=Ke,i.summary=xe,i.sup=Ue,i.table=re,i.td=ce,i.textarea=Ee,i.th=le,i.tr=ie,i.u=De,i.ul=ae,i.unsafeHtml=Yt,i.useCustomComponent=Rt,i.video=sn,i.when=Zt,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
@@ -1,2 +0,0 @@
1
- (function(i,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(i=typeof globalThis<"u"?globalThis:i||self,A(i.ReactiveComponent={}))})(this,function(i){"use strict";var pn=Object.defineProperty;var En=(i,A,_)=>A in i?pn(i,A,{enumerable:!0,configurable:!0,writable:!0,value:_}):i[A]=_;var u=(i,A,_)=>En(i,typeof A!="symbol"?A+"":A,_);const A=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"ref"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),_=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,D=(n,t,...e)=>{t&&t.apply(n,e)};let G=!0;const b=(...n)=>{G&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},F=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),rt=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),B=(n,...t)=>{if(!G)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const a=c.slice(1);return e[a]||"color: inherit"});let r=n;s.forEach(c=>{const a=new RegExp(`\\${c}([^\\s,]+)`,"g");r=r.replace(a,"%c$1")}),console.log(r,...o,...t)},Ot=()=>{G=!0},it=()=>{G=!1};it();const Mt=(n,t)=>{n.every(Boolean)&&t(n)},V=new Set;let Q=!1,x=!1;const $t=()=>{if(!x){x=!0;try{if(Q=!1,V.size===0)return;const n=Array.from(V);V.clear(),n.forEach(t=>{if(t.status==="active"){K(t),O.push(t);try{t()}catch(e){console.error("Error in effect:",e)}finally{O.pop()}}}),V.size>0&&ct()}finally{x=!1}}};function _t(){queueMicrotask($t)}const ct=()=>{Q||(Q=!0,_t())},Ht=n=>{V.add(n),ct()},O=[],K=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(r=>{var c;return(c=r.destroy)==null?void 0:c.call(r)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(r=>r()),(o=n.cleanupSet)==null||o.clear()};function T(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const r=O[O.length-1];return r&&!r.fake&&!s.has(r)&&r.status==="active"&&(s.add(r),(c=r.cleanupSet)==null||c.add(()=>s.delete(r))),!(t!=null&&t.name)&&(r!=null&&r.effectId)&&o.setName(r.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(r){return o.signalId=`${r}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(r){return e=r,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(r){n=r,s.forEach(c=>{Ht(c)})},o.set=function(r,c=e){n!==r&&c(n,r)&&o.forceSet(r)},o.update=function(r){o.set(r(n))},o.pipe=(r,c)=>{c!=null&&c.name&&o.setName(c.name);const a=T(null);return v(()=>{const d=o();v(()=>{const h=r(d);h instanceof Promise?h.then(E=>a.set(E)):R(h)?v(()=>a.set(h()),{name:"pipe_effect_inner"}):a.set(h)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),a},o}function v(n,t){var r;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;b("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=O[O.length-1];return o&&((r=o.children)==null||r.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;K(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,O.push(s),s(),O.pop(),s}const R=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function kt(n,...t){const e=T("");return v(()=>{const s=t.map(r=>R(r)?String(r()):String(r)),o=[n[0]];s.forEach((r,c)=>{o.push(r,n[c+1])}),e.set(o.join(""))}),e}function Wt(n,t){const e=T(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&v(()=>{const o=n();o instanceof Promise?o.then(s):R(o)?v(()=>s(o())):s(o)}),e}function Pt(n,t){let e=n(),s=t();v(()=>{const o=n(),r=t();o!==r&&(o!==e?t.set(o):r!==s&&n.set(r)),e=o,s=r})}function Ft(...n){let t=n.map(s=>s());const e=T(t);return n.forEach((s,o)=>{v(()=>{const r=()=>t.filter(c=>c!==void 0).length;r()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),r()===n.length&&e.set([...t])})}),e}const Bt=(...n)=>{const t=T([]);return v(()=>{t.set(n.map(e=>e()))}),t},Vt=(n,t)=>{let e=!0;const s=v(()=>{var o;e&&(e=!1,t(n()),(o=s.destroy)==null||o.call(s))})},U="eventProps",Y="EVENT_CONFIG",J="observedAttributes",Jt=()=>(n,t)=>{Reflect.get(n,J)||Reflect.defineProperty(n,J,{value:[]}),Reflect.get(n,J).push(F(t))},Nt=n=>(t,e)=>{Reflect.get(t,U)||Reflect.defineProperty(t,U,{value:[]}),Reflect.get(t,Y)||Reflect.defineProperty(t,Y,{value:{}}),Reflect.get(t,Y)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,U).push(e)},tt=(n,t=!1)=>e=>{b(n,"start register static attr",e.prototype[J]);const s=[];if(e.styles){const r=e.styles,c=[];Array.isArray(r)?c.push(...r):c.push(r),c.forEach(a=>{const d=new CSSStyleSheet;d.replaceSync(a),s.push(d);const S=new CSSStyleSheet;S.replaceSync(a.slice(a.indexOf("@property"))),document.adoptedStyleSheets.push(S)})}class o extends e{constructor(...c){b("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return b("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,a,d){b("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${a}, newValue: ${d}`,`%c${n}%c`);try{d=JSON.parse(d)}catch{}const S=rt(c);if(S in this&&R(this[S])){const h=this[S];h.setName(c),d===null?(h.set(h.initValue),this.removeAttribute(c)):h.set(d)}D(this,e.prototype.attributeChangedCallback,c,a,d)}connectedCallback(){const c=()=>{var d,S;b("rwc: connectedCallback"),b("connectedCallback",`%c${n}%c`,this),(d=this.init)==null||d.call(this),this.providers&&Object.keys(this.providers).length>0&&(b("WRAPPER for providers",n),Object.entries(this.providers).forEach(([h,f])=>{b("register provider",h,f()),this.addEventListener(h,E=>{var m;b("send provider",h,f());const p=E;((m=p.detail)==null?void 0:m.context)===h&&(p.stopPropagation(),p.detail.callback(f))})})),this.checkInjects(),(S=e.prototype[U])==null||S.forEach(h=>{this[h]=f=>{const E=e.prototype[Y][h],{bubbles:p,composed:m}=E;R(f)?v(()=>{B("@oemit reactive value",f()),this.dispatchEvent(new CustomEvent(h,{detail:f(),bubbles:p,composed:m}))}):(B("@oemit value",f),this.dispatchEvent(new CustomEvent(h,{detail:f,bubbles:p,composed:m})))}}),b("start render",`%c${n}%c`,n);const a=()=>{b("rwc: insertRenderTemplate");const f=this.render().hostElement;f&&this.shadow.appendChild(f),D(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const h=p=>p instanceof Promise||Array.isArray(p)&&p.every(m=>m instanceof Promise),f=this.rootStyle,E=p=>{const m=new CSSStyleSheet;m.replaceSync(p),this.shadow.adoptedStyleSheets.push(m);const w=new CSSStyleSheet;w.replaceSync(p.slice(p.indexOf("@property"))),document.adoptedStyleSheets.push(w)};if(h(f)){const p=[];Array.isArray(f)?p.push(...f):p.push(f),Promise.all(p).then(m=>m.forEach(w=>E(w.default))).then(()=>a())}else{const p=[];Array.isArray(f)?p.push(...f):p.push(f),p.forEach(m=>E(m)),a()}}else a();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{b(this.slotContext,this.slotContext&&this.slotContext[h.name]),B("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(f=>{const E=this.slotContext[h.name];this.slotContext&&R(E)&&(B("@oslot element",h,`name:${h.name};`,h.assignedElements()),v(()=>{f.dispatchEvent(new CustomEvent("handleSlotContext",{detail:E()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),v(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var a,d;return(d=(a=c.deref())==null?void 0:a.destroy)==null?void 0:d.call(a)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),D(this,e.prototype.disconnectedCallback)}}return u(o,"observedAttributes",e.prototype[J]??[]),u(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class H extends HTMLElement{constructor(e=!1){super();u(this,"init");u(this,"isSlotLazyLoading",!1);u(this,"slotTemplate");u(this,"slotContext");u(this,"rootStyle");u(this,"modelValue");u(this,"providers");u(this,"effectSet",new Set);u(this,"appendAllSlotContent");u(this,"allSlotContent",[]);u(this,"slotContent",{});u(this,"htmlSlotContent",{});u(this,"shadow");u(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const r=e.slot||"default";this.htmlSlotContent[r]||(this.htmlSlotContent[r]=[]),(o=this.htmlSlotContent[r])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return b("%cinject%c",e),this.injects[e]||(this.injects[e]=T(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{b("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>v(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}u(H,"observedAttributes",[]),u(H,"renderTagName",""),u(H,"styles");const qt=n=>"render"in n&&"setReactiveValue"in n,zt="handleSlotContext",lt="onConnected",at=n=>typeof n=="string"?n:JSON.stringify(n),Dt=n=>{const t=document.createElement("span");return t.textContent=at(n),t},dt=(n,t)=>(n.appendChild(Dt(t)),n),Gt=(n,t)=>(n.replaceChildren(),dt(n,t)),ft=n=>{const t=document.createElement("span");return v(()=>{const e=n();t.textContent=at(e)}),t};class ht{constructor(t){u(this,"wrapper");u(this,"keyedEffects",new Map);u(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),lt in s&&setTimeout(()=>{var r;(r=s.onConnected)==null||r.call(s,e,s)}))}),this));u(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const r=o.hostElement;r&&e.appendChild(r)}),(s=this.hostElement)==null||s.appendChild(e),this});u(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(r=>r===e.hostElement)){const r=e.hostElement;r&&((o=this.hostElement)==null||o.removeChild(r))}}),this));u(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(dt(e,t),this):this});u(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(Gt(e,t),this):this});u(this,"setAttribute",(t,e)=>{var r;b("setAttribute",t,e);const s=this.hostElement;if(!s)return this;let o;if((typeof e=="boolean"||e===null)&&!(s instanceof H))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((r=this.hostElement)==null||r.setAttribute(F(t),o),!(s instanceof H)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});u(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(F(t),s),this});u(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{b("setReactiveAttribute effect",t,e),s.setAttribute(t,e())},t),this));u(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));u(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(F(t)),this});u(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const r=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(r){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(r?e.style.setProperty(s,o):e.style[s]=o)}),this):this});u(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,lt,{get(){return t}}),this):this);u(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
2
- `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const r=e();r.length>0&&(o?this.replaceClass(o,r):this.addClass(r),o=r)})})()}),this));u(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});u(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));u(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});u(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});u(this,"addEffect",(t,e)=>{var r,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const a=(r=this.keyedEffects.get(e))==null?void 0:r.deref();a&&K(a)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,v(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});u(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(ft(t)),this});u(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(ft(t)),this});u(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,r=>e(r,this,this.hostElement),s),this}}class Kt extends ht{constructor(){super(...arguments);u(this,"setReactiveValue",e=>(this.hostElement instanceof H&&this.hostElement.setReactiveValue(e),this));u(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([r,c])=>{s[r]=c}),this})}}const Ut=()=>()=>{},ut=n=>new Kt(new WeakRef(n)),mt=n=>new ht(new WeakRef(n)),pt=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Yt=(n,...t)=>pt(n,...t),et=(n,t)=>{var o;if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(r=>r.startsWith(".")||r.startsWith("@")||r.startsWith("$"));e.filter(r=>r.startsWith(".")).forEach(r=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[r.slice(1)]=t[r]}),e.filter(r=>r.startsWith("@")).forEach(r=>{t!=null&&t.listeners||(t.listeners={});const c=r.slice(1);t.listeners[c]=t[r]}),e.filter(r=>r.startsWith("$")).forEach(r=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[r])});const s=n.deref();if(s)return St(s,t.classList),vt(s,t.style),wt(s,t.attributes),yt(s,t.reactiveClassList),bt(s,t.customAttributes),Ct(s,t.children),Et(s,t.effects),nt(s,t.listeners),nt(s,t.customListeners),(o=t.ref)==null||o.set(s),s},nt=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},Et=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),Ct=(n,t)=>N(new WeakRef(n),...t||[])??n,bt=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{R(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},St=(n,t)=>n.addClass(...t||[]),yt=(n,t)=>n.addReactiveClass(t||{}),vt=(n,t)=>n.addStyle(t||{}),wt=(n,t)=>{const e=t,s=(o,r)=>{r!==void 0&&(b("addAttribute",o,r),R(r)?n.setReactiveAttribute(o,r):typeof r=="function"?n.addEffect(()=>{n.setAttribute(o,r())}):n.setAttribute(o,r))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},N=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):R(s)?e.addReactiveContent(s):e.append(s)}),e},k=(n,t)=>{const e=document.createElement(n),s=mt(e);return et(new WeakRef(s),t)??s},Z=(n,t)=>{const[e,...s]=n.split(" ").map(r=>r.trim()),o=k(e,t);return s.length>0&&o.addClass(...s),(...r)=>N(new WeakRef(o),...r.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!R(c)?j(()=>c(o)):c))??o},j=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return k("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),N(new WeakRef(e),...[n()].flat())},t)},Zt=(n,t,e)=>{const s=k("div").addStyle({display:"contents"}),o=new Map,r=new Map,c=new Map,a=new Map;let d=[];const S=new Set;let h=n.peek();const f=m=>{S.delete(m),o.delete(m),r.delete(m),c.delete(m),a.delete(m)},E=m=>{if(!a.has(m)){const w=d.indexOf(m);return a.set(m,w),w}return a.get(m)},p=(m,w,q)=>Array.from(q.children).indexOf(m)!==w;return v(()=>{const m=n(),w=m.map(t).map(C=>typeof C=="string"?C:C.toString()),q=new Set(w);a.clear(),w.forEach((C,y)=>{a.set(C,y)}),d=w;const M=s.hostElement;if(!M)return;b("containerChildren",Array.from(M.children),d);const z=[];Array.from(M.children).forEach(C=>{const y=C.dataset.key;y&&!q.has(y)&&z.push(C)}),z.forEach(C=>{const y=C.dataset.key;b("remove element",y,C),C.remove(),f(y)}),w.forEach((C,y)=>{var g;const L=m[y],P=h[y];if(!o.has(C))b("create new element",C,L),o.set(C,T(Math.random().toString(36).substring(2,15))),r.set(C,()=>e(L,y,m).setCustomAttribute("data-key",C));else if(P&&JSON.stringify(L)!==JSON.stringify(P)){const I=c.get(C);(g=o.get(C))==null||g.set(Math.random().toString(36).substring(2,15)),r.set(C,()=>e(L,y,m).setCustomAttribute("data-key",C)),I&&I.parentNode&&b("mark element for update",C)}}),h=[...m.map(C=>({...C}))];const X=()=>{o.forEach((C,y)=>{b("key from setTimeout foreach currItemSignalMap",y),S.has(y)||(S.add(y),v(()=>{var jt;C();const L=E(y),P=(jt=r.get(y))==null?void 0:jt();if(!P||!P.hostElement)return;const g=s.hostElement,I=P.hostElement;if(!g)return;b("call effect from setTimeout",y,I);const $=c.get(y);if($&&$.parentNode===g){if(p($,L,g)){const W=g.children[L];W&&W!==$?g.insertBefore($,W):W||g.appendChild($)}I!==$&&($.replaceWith(I),c.set(y,I))}else if(c.set(y,I),L<g.children.length){const W=g.children[L];W?g.insertBefore(I,W):g.appendChild(I)}else g.appendChild(I)}))})};Promise.resolve().then(()=>X())}),s},Xt=n=>{let t=[k("div")],e=!1;return v(()=>{var r,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{b("newReactiveComponent.map",o.map(a=>{var d;return b("newReactiveComponent hostElement",a.hostElement),(d=a.hostElement)==null?void 0:d.id})),b("currComponent[0].hostElement?.id",(r=t[0].hostElement)==null?void 0:r.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(a=>a.hostElement).filter(Boolean)),t.slice(1).forEach(a=>{var d;return(d=a.hostElement)==null?void 0:d.remove()}),t=o}catch(a){console.error(a)}}),e?t:t[0]},Qt=n=>zt in n,xt=n=>{const t=Z("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},st=(n,t,e)=>n?j(t):e?j(e):Z("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),At=(n,t,e)=>j(()=>st(!!n(),t,e)),te=(n,t,e)=>typeof n=="boolean"?st(n,t,e):At(n,t,e),ot=(n,t)=>j(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),ee=(n,t,e)=>{const s=[ot(n,t)].flat();return e&&s.push(...[ot(()=>typeof n=="boolean"?!n:!n(),e)].flat()),j(()=>s)},gt=(n,t)=>{b("createCustomElement",n);const e=document.createElement(n),s=ut(e);return e.init=()=>{et(new WeakRef(s),t)},s},Rt=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=gt(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const r=o.filter(Boolean).flat().flatMap(a=>typeof a=="function"&&!R(a)?j(()=>a(s)):a),c=s.hostElement;return c&&(c.allSlotContent=r,c.slotContent=r.filter(_).reduce((a,d)=>{var h;const S=((h=d.hostElement)==null?void 0:h.getAttribute("slot"))||"default";return a[S]||(a[S]=[]),a[S].push(d),a},{}),c.appendAllSlotContent=()=>{N(new WeakRef(s),...r)}),s}},Lt=(n,t,e)=>Rt(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,A(t)?t:t&&typeof t=="string"?e:void 0),ne=()=>{const n=()=>{};return n.oldValue=null,n},se=()=>({}),It=(n,t,e)=>{const s=t?tt(t,e)(n):n;return(o,...r)=>{const c=[...r];return o&&!A(o)&&c.unshift(o),Lt(s,A(o)?o:{})(...c)}},oe=n=>[It(n),(t,e)=>{tt(t,e)(n)}],l={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{l[n]=(t,...e)=>{let s=[...e];return t&&!A(t)&&(s=[t].concat(s)),Z(n,A(t)?t:{})(...s)}});const Tt=l.div,re=l.span,ie=l.section,ce=l.input,le=l.button,ae=l.table,de=l.tr,fe=l.td,he=l.th,ue=l.ul,me=l.li,pe=l.ol,Ee=l.form,Ce=l.label,be=l.select,Se=l.option,ye=l.textarea,ve=l.img,we=l.a,Ae=l.p,ge=l.h1,Re=l.h2,Le=l.h3,Ie=l.h4,Te=l.h5,je=l.h6,Oe=l.br,Me=l.hr,$e=l.pre,_e=l.code,He=l.nav,ke=l.header,We=l.footer,Pe=l.main,Fe=l.aside,Be=l.article,Ve=l.figure,Je=l.figcaption,Ne=l.blockquote,qe=l.cite,ze=l.small,De=l.strong,Ge=l.em,Ke=l.b,Ue=l.i,Ye=l.u,Ze=l.s,Xe=l.sub,Qe=l.sup,xe=l.mark,tn=l.del,en=l.ins,nn=l.details,sn=l.summary,on=l.progress,rn=l.meter,cn=l.audio,ln=l.video,an=l.canvas,dn=l.slot,fn=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});function hn(n,t){let e=0;return(...s)=>{const o=Date.now();o-e>=t&&(n(...s),e=o)}}const un=(n,t)=>j(()=>{const e=n();let s=null;return e.map((o,r)=>Tt({"@dragstart":(c,a,d)=>{s=d},"@dragend":(c,a,d)=>{d.style.transform="",d.removeAttribute("draggable")},"@mousedown":(c,a,d)=>{d.style.transform="translateZ(0)",d.setAttribute("draggable","true")},"@dragover":c=>{c.preventDefault()},"@dragenter":hn((c,a,d)=>{var S,h,f;if(c.preventDefault(),s){let E=s,p=d;const m=((S=s.getClientRects().item(0))==null?void 0:S.y)??0,w=((h=d.getClientRects().item(0))==null?void 0:h.y)??0;m<w&&([E,p]=[d,s]),(f=d.parentElement)==null||f.insertBefore(E,p)}},200)},t(o,r,[...n.peek()])))}),mn=(n,t,e)=>{let s=[],o=[];const r=k("div").addStyle({display:"contents"}),c=new Map,a=new Map;return v(()=>{const d=n(),S=d.map(t);o.filter(f=>!S.includes(f)).forEach(f=>{var E,p;c.delete(f),(p=(E=r.hostElement)==null?void 0:E.querySelector(`[data-key="${f}"]`))==null||p.remove()}),S.forEach((f,E)=>{o.includes(f)||c.set(f,()=>e(d[E],E,d).setCustomAttribute("data-key",f))}),S.forEach((f,E)=>{var p;if(o.includes(f)){JSON.stringify(s[o.indexOf(f)])!==JSON.stringify(d[E])&&((p=a.get(f))==null||p.set({templateFunc:()=>e(d[E],E,d),items:d,itemsKey:S,index:E}));return}a.set(f,T({templateFunc:()=>e(d[E],E,d),items:d,itemsKey:S,index:E})),queueMicrotask(()=>{v(()=>{var z,X,C;const{templateFunc:m,index:w}=((z=a.get(f))==null?void 0:z())??{},q=(X=r.hostElement)==null?void 0:X.querySelector(`[data-key="${f}"]`),M=(m==null?void 0:m().setCustomAttribute("data-key",f).hostElement)??document.createElement("div");q?(C=r.hostElement)==null||C.childNodes.forEach((y,L)=>{y instanceof HTMLElement&&y.getAttribute("data-key")===f&&(w===L?(h(w??0,r.hostElement,M),y.remove()):h(w??0,r.hostElement,M))}):h(w??0,r.hostElement,M)})})});const h=(f,E,p)=>{p&&E&&(f<E.children.length?E.insertBefore(p,E.children[f]):E.appendChild(p))};o=S,s=[...d]}),r};i.BaseElement=H,i.a=we,i.addAttributeList=wt,i.addClassList=St,i.addCustomAttributes=bt,i.addReactiveClassList=yt,i.addStyleList=vt,i.appendContentItem=N,i.article=Be,i.aside=Fe,i.audio=cn,i.b=Ke,i.bindReactiveSignals=Pt,i.blockquote=Ne,i.br=Oe,i.button=le,i.camelToKebab=F,i.canvas=an,i.checkCall=D,i.checkRef=Mt,i.cite=qe,i.classList=pt,i.cls=Yt,i.code=_e,i.colorLog=B,i.combineLatest=Bt,i.component=tt,i.configCustomComponent=oe,i.createComponent=fn,i.createCustom=Lt,i.createCustomEl=Rt,i.createCustomElement=gt,i.createEl=Z,i.createElement=k,i.createSignal=Wt,i.customElementHelpers=ut,i.ddList=un,i.defineSlotTemplate=se,i.del=tn,i.details=nn,i.disableLogs=it,i.div=Tt,i.effect=v,i.elementHelpers=mt,i.em=Ge,i.enableLogs=Ot,i.event=Nt,i.eventEmitter=Ut,i.figcaption=Je,i.figure=Ve,i.firstUpdate=Vt,i.footer=We,i.forkJoin=Ft,i.form=Ee,i.getList=mn,i.getSignalContent=j,i.h1=ge,i.h2=Re,i.h3=Le,i.h4=Ie,i.h5=Te,i.h6=je,i.header=ke,i.hr=Me,i.i=Ue,i.img=ve,i.initComponent=et,i.input=ce,i.ins=en,i.isBaseElement=qt,i.isComponentConfig=_,i.isComponentInitConfig=A,i.isReactiveSignal=R,i.isSlotTemplate=Qt,i.kebabToCamel=rt,i.label=Ce,i.li=me,i.main=Pe,i.mark=xe,i.meter=rn,i.nav=He,i.newEventEmitter=ne,i.ol=pe,i.oldGetList=Zt,i.option=Se,i.p=Ae,i.pre=$e,i.progress=on,i.projectLog=b,i.property=Jt,i.removeEffect=K,i.renderIf=st,i.rs=kt,i.rxRenderIf=At,i.s=Ze,i.section=ie,i.select=be,i.setChildren=Ct,i.setEffects=Et,i.setListeners=nt,i.show=ee,i.showIf=ot,i.signal=T,i.signalComponent=Xt,i.slot=dn,i.small=ze,i.span=re,i.strong=De,i.sub=Xe,i.summary=sn,i.sup=Qe,i.table=ae,i.td=fe,i.textarea=ye,i.th=he,i.tr=de,i.u=Ye,i.ul=ue,i.unsafeHtml=xt,i.useCustomComponent=It,i.video=ln,i.when=te,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});