@reactive-web-components/rwc 2.51.9 → 2.51.11

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.
Files changed (38) hide show
  1. package/README.md +1302 -0
  2. package/main.d.ts +0 -0
  3. package/package.json +1 -4
  4. package/reactive-web-component.BjYWVrAv.js +912 -0
  5. package/reactive-web-component.COtoOyWr.umd.cjs +2 -0
  6. package/shared/constants/constants.d.ts +2 -0
  7. package/shared/index.d.ts +2 -0
  8. package/shared/types/base-element.d.ts +1 -0
  9. package/shared/types/element.d.ts +191 -0
  10. package/shared/types/index.d.ts +3 -0
  11. package/shared/types/list.type.d.ts +7 -0
  12. package/shared/utils/helpers.d.ts +7 -0
  13. package/shared/utils/html-decorators/html-property.d.ts +6 -0
  14. package/shared/utils/html-decorators/index.d.ts +1 -0
  15. package/shared/utils/html-elements/__tests__/element.test.d.ts +1 -0
  16. package/shared/utils/html-elements/base-element.d.ts +33 -0
  17. package/shared/utils/html-elements/custom-element.d.ts +11 -0
  18. package/shared/utils/html-elements/element-helper.d.ts +21 -0
  19. package/shared/utils/html-elements/element.d.ts +84 -0
  20. package/shared/utils/html-elements/index.d.ts +4 -0
  21. package/shared/utils/html-fabric/custom-fabric.d.ts +3 -0
  22. package/shared/utils/html-fabric/fabric.d.ts +67 -0
  23. package/shared/utils/html-fabric/fn-component.d.ts +5 -0
  24. package/shared/utils/html-fabric/index.d.ts +3 -0
  25. package/shared/utils/index.d.ts +5 -0
  26. package/shared/utils/routing/router.d.ts +10 -0
  27. package/shared/utils/signal/helpers.types.d.ts +3 -0
  28. package/shared/utils/signal/index.d.ts +3 -0
  29. package/shared/utils/signal/signal.d.ts +18 -0
  30. package/shared/utils/signal/signal.type.d.ts +18 -0
  31. package/shared/utils/signal/utils.d.ts +10 -0
  32. package/test-components/examples/button/button.d.ts +12 -0
  33. package/test-components/examples/counter.d.ts +15 -0
  34. package/test-components/examples/test-list/dynamic-items-test.d.ts +17 -0
  35. package/test-components/examples/test-list/example.list.d.ts +26 -0
  36. package/test-components/examples/useCustomComponent.d.ts +21 -0
  37. package/test-components/examples/when.d.ts +6 -0
  38. package/test-components/tab-bar.d.ts +23 -0
@@ -0,0 +1,912 @@
1
+ var X = Object.defineProperty;
2
+ var Z = (t, e, s) => e in t ? X(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var E = (t, e, s) => Z(t, typeof e != "symbol" ? e + "" : e, s);
4
+ const w = (t) => t && typeof t == "object" && ("classList" in t || "attributes" in t || "customAttributes" in t || "reactiveClassList" in t || "listeners" in t || "customListeners" in t || "children" in t || "effects" in t || "style" in t || Object.keys(t).some(
5
+ (e) => e.startsWith(".") || e.startsWith("@") || e.startsWith("$")
6
+ )) && !("hostElement" in t), Q = (t) => t && typeof t == "object" && "hostElement" in t && "append" in t && "set" in t && "addStyle" in t && "setAttribute" in t && "addClass" in t && "addEffect" in t && "addReactiveContent" in t && "setReactiveContent" in t && "clear" in t, F = (t, e, ...s) => {
7
+ e && e.apply(t, s);
8
+ };
9
+ let P = !0;
10
+ const C = (...t) => {
11
+ P && console.log(
12
+ t.join(" | "),
13
+ ...Array.from(t.join("").matchAll(/%c/gm)).map((e, s) => s % 2 === 0 ? "color:red" : "color:inherit")
14
+ );
15
+ }, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), Y = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
16
+ if (!P) return;
17
+ const s = {
18
+ r: "color: #ff0000",
19
+ // red
20
+ g: "color: #00ff00",
21
+ // green
22
+ b: "color: #0000ff",
23
+ // blue
24
+ y: "color: #ffff00",
25
+ // yellow
26
+ p: "color: #800080",
27
+ // purple
28
+ c: "color: #00ffff",
29
+ // cyan
30
+ o: "color: #ffa500",
31
+ // orange
32
+ w: "color: #808080"
33
+ // gray (w for white/gray)
34
+ }, n = t.match(/@[rgbpycow]/g) || [], o = n.map((r) => {
35
+ const h = r.slice(1);
36
+ return s[h] || "color: inherit";
37
+ });
38
+ let c = t;
39
+ n.forEach((r) => {
40
+ const h = new RegExp(`\\${r}([^\\s,]+)`, "g");
41
+ c = c.replace(h, "%c$1");
42
+ }), console.log(c, ...o, ...e);
43
+ }, yt = () => {
44
+ P = !0;
45
+ }, K = () => {
46
+ P = !1;
47
+ };
48
+ K();
49
+ const L = /* @__PURE__ */ new WeakMap(), M = [], g = [];
50
+ function R(t, e = () => !0) {
51
+ const s = /* @__PURE__ */ new Set();
52
+ let n = e;
53
+ function o() {
54
+ const c = M[M.length - 1];
55
+ if (c && !("fake" in c && c.fake)) {
56
+ const r = L.get(c), h = r == null ? void 0 : r.parent;
57
+ if (h) {
58
+ const l = L.get(h);
59
+ l == null || l.cleanupFns.add(() => {
60
+ s.delete(c);
61
+ });
62
+ }
63
+ s.add(c);
64
+ }
65
+ return t;
66
+ }
67
+ return o.getSubscribers = () => [...s], o.setCompareFn = function(c) {
68
+ return n = c, o;
69
+ }, o.clearSubscribers = function() {
70
+ s.clear();
71
+ }, o.peek = function() {
72
+ return Object.freeze(t);
73
+ }, o.initValue = Object.freeze(t), o.oldValue = Object.freeze(t), o.forceSet = function(c) {
74
+ o.oldValue = Object.freeze(t), t = c, s.forEach((r) => Promise.resolve(r).then((h) => {
75
+ const l = L.get(h);
76
+ l && l.cleanupFns.size > 0 && (l.cleanupFns.forEach((a) => a()), l.cleanupFns.clear()), g.push(h), h(), g.pop();
77
+ }));
78
+ }, o.set = function(c, r = n) {
79
+ t !== c && r(t, c) && o.forceSet(c);
80
+ }, o.update = function(c) {
81
+ o.set(c(t));
82
+ }, o.pipe = (c) => {
83
+ const r = R(null);
84
+ return m(() => {
85
+ const h = c(o());
86
+ h instanceof Promise ? h.then((l) => r.set(l)) : y(h) ? m(() => r.set(h())) : r.set(h);
87
+ }), r;
88
+ }, o;
89
+ }
90
+ function m(t) {
91
+ const e = Date.now();
92
+ C("current effect", `%c${e}%c`);
93
+ const s = t;
94
+ t = () => (C("current effect callback", `%c${e}%c`), s());
95
+ const n = g[g.length - 1];
96
+ L.has(t) || L.set(t, { cleanupFns: /* @__PURE__ */ new Set() });
97
+ const o = L.get(t);
98
+ n ? o.parent = n : delete o.parent, g.push(t), M.push(t), t(), M.pop(), g.pop();
99
+ }
100
+ const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
101
+ function St(t, ...e) {
102
+ const s = R("");
103
+ return m(() => {
104
+ const n = e.map(
105
+ (c) => y(c) ? String(c()) : String(c)
106
+ ), o = [t[0]];
107
+ n.forEach((c, r) => {
108
+ o.push(c, t[r + 1]);
109
+ }), s.set(o.join(""));
110
+ }), s;
111
+ }
112
+ function vt(t, e) {
113
+ const s = R(e ?? null), n = (o) => s.set(o);
114
+ return t instanceof Promise ? t.then(n) : typeof t == "function" && m(() => {
115
+ const o = t();
116
+ o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
117
+ }), s;
118
+ }
119
+ function At(t, e) {
120
+ let s = t(), n = e();
121
+ m(() => {
122
+ const o = t(), c = e();
123
+ o !== c && (o !== s ? e.set(o) : c !== n && t.set(c)), s = o, n = c;
124
+ });
125
+ }
126
+ function gt(...t) {
127
+ let e = t.map((n) => n());
128
+ const s = R(e);
129
+ return t.forEach((n, o) => {
130
+ m(() => {
131
+ const c = () => e.filter((r) => r !== void 0).length;
132
+ c() === t.length && (e = Array.from(e).fill(void 0)), e[o] = n(), c() === t.length && s.set([...e]);
133
+ });
134
+ }), s;
135
+ }
136
+ class O extends HTMLElement {
137
+ constructor(s = !1) {
138
+ super();
139
+ E(this, "isSlotLazyLoading", !1);
140
+ E(this, "slotTemplate");
141
+ E(this, "slotContext");
142
+ E(this, "rootStyle");
143
+ E(this, "modelValue");
144
+ E(this, "providers");
145
+ E(this, "appendAllSlotContent");
146
+ E(this, "allSlotContent", []);
147
+ E(this, "slotContent", {});
148
+ E(this, "htmlSlotContent", {});
149
+ E(this, "shadow");
150
+ E(this, "injects", {});
151
+ this.shadow = this.attachShadow({ mode: s ? "closed" : "open" });
152
+ }
153
+ // @ts-expect-error - appendChild is not defined in the HTMLElement interface
154
+ appendChild(s, n = !0) {
155
+ var o;
156
+ if (this.isSlotLazyLoading && n) {
157
+ if (s instanceof HTMLElement) {
158
+ const c = s.slot || "default";
159
+ this.htmlSlotContent[c] || (this.htmlSlotContent[c] = []), (o = this.htmlSlotContent[c]) == null || o.push(s);
160
+ }
161
+ } else return super.appendChild(s);
162
+ }
163
+ appendSlotContent() {
164
+ var s;
165
+ (s = this.appendAllSlotContent) == null || s.call(this);
166
+ }
167
+ inject(s) {
168
+ return C("%cinject%c", s), this.injects[s] || (this.injects[s] = R(null)), this.injects[s];
169
+ }
170
+ checkInjects() {
171
+ Object.entries(this.injects).forEach(([s, n]) => {
172
+ C(
173
+ "%cinject%c",
174
+ `%c${s}%c`,
175
+ "from BaseElement (dispatch event)"
176
+ ), this.shadow.dispatchEvent(
177
+ new CustomEvent(s, {
178
+ detail: {
179
+ context: s,
180
+ callback: (o) => m(() => {
181
+ n.set(o());
182
+ })
183
+ },
184
+ bubbles: !0,
185
+ composed: !0
186
+ })
187
+ );
188
+ });
189
+ }
190
+ setReactiveValue(s) {
191
+ this.modelValue = s;
192
+ }
193
+ }
194
+ E(O, "observedAttributes", []), E(O, "renderTagName", ""), E(O, "styles");
195
+ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotContext", _ = "onConnected", Ot = () => () => {
196
+ }, z = (t, e) => {
197
+ const s = new Text(
198
+ typeof e == "string" ? e : JSON.stringify(e)
199
+ );
200
+ return t.appendChild(s), t;
201
+ }, D = (t, e) => (t.innerHTML = "", z(t, e)), B = (t) => {
202
+ const e = document.createElement("div");
203
+ return e.style.display = "contents", m(() => {
204
+ const s = t();
205
+ D(e, s);
206
+ }), e;
207
+ }, N = (t) => ({
208
+ append(...e) {
209
+ return e.forEach((s) => {
210
+ t.appendChild(s.hostElement), _ in s.hostElement && setTimeout(() => {
211
+ var n, o;
212
+ (o = (n = s.hostElement).onConnected) == null || o.call(
213
+ n,
214
+ s,
215
+ s.hostElement
216
+ );
217
+ });
218
+ }), this;
219
+ },
220
+ set(...e) {
221
+ this.clear();
222
+ const s = document.createDocumentFragment();
223
+ return e.forEach((n) => {
224
+ s.appendChild(n.hostElement);
225
+ }), t.appendChild(s), this;
226
+ },
227
+ removeChild(...e) {
228
+ return e.forEach((s) => {
229
+ Array.from(t.childNodes.values()).some(
230
+ (n) => n === s.hostElement
231
+ ) && t.removeChild(s.hostElement);
232
+ }), this;
233
+ },
234
+ addHtmlContent(e) {
235
+ return z(t, e), this;
236
+ },
237
+ setHtmlContent(e) {
238
+ return D(t, e), this;
239
+ },
240
+ addEventlistener(e, s, n = !1) {
241
+ return t.addEventListener(e, (o) => s(o, this, t), n), this;
242
+ },
243
+ setAttribute(e, s) {
244
+ let n;
245
+ if (typeof s == "boolean" && !(t instanceof O))
246
+ if (s)
247
+ n = "";
248
+ else {
249
+ this.removeAttribute(e);
250
+ const o = e.toLowerCase();
251
+ return o in t && (t[o] = null), this;
252
+ }
253
+ else typeof s != "string" ? n = JSON.stringify(s) : n = s;
254
+ if (t.setAttribute($(e), n), !(t instanceof O)) {
255
+ const o = e.toLowerCase();
256
+ o in t && (t[o] = s);
257
+ }
258
+ return this;
259
+ },
260
+ setCustomAttribute(e, s) {
261
+ let n;
262
+ return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute($(e), n), this;
263
+ },
264
+ setReactiveAttribute(e, s) {
265
+ return m(() => this.setAttribute(e, s())), this;
266
+ },
267
+ setReactiveCustomAttribute(e, s) {
268
+ return m(() => this.setCustomAttribute(e, s())), this;
269
+ },
270
+ removeAttribute(e) {
271
+ return t.removeAttribute($(e)), this;
272
+ },
273
+ addStyle(e) {
274
+ return Object.entries(e).forEach(([s, n]) => {
275
+ const o = s.startsWith("--");
276
+ typeof n == "function" ? this.addEffect(() => {
277
+ if (o) {
278
+ const c = String(n() || "");
279
+ t.style.setProperty(s, c);
280
+ } else
281
+ t.style[s] = n();
282
+ }) : typeof n == "string" && (o ? t.style.setProperty(s, n) : t.style[s] = n);
283
+ }), this;
284
+ },
285
+ onConnected(e) {
286
+ return Reflect.defineProperty(t, _, {
287
+ get() {
288
+ return e;
289
+ }
290
+ }), this;
291
+ },
292
+ addClass(...e) {
293
+ return e.forEach((s) => {
294
+ typeof s == "string" ? t.classList.add(
295
+ ...s.split(" ").flatMap((n) => n.split(`
296
+ `)).map((n) => n.trim()).filter(Boolean)
297
+ ) : (() => {
298
+ let n = null;
299
+ this.addEffect(() => {
300
+ const o = s();
301
+ o.length > 0 && (n ? this.replaceClass(n, o) : this.addClass(o), n = o);
302
+ });
303
+ })();
304
+ }), this;
305
+ },
306
+ setClass(...e) {
307
+ return t.classList.remove(...t.classList), t.classList.add(...e), this;
308
+ },
309
+ addReactiveClass(e) {
310
+ return Object.keys(e).forEach((s) => {
311
+ m(() => {
312
+ e[s]() ? this.addClass(s) : this.removeClass(s);
313
+ });
314
+ }), this;
315
+ },
316
+ removeClass(...e) {
317
+ return t.classList.remove(...e), this;
318
+ },
319
+ replaceClass(e, s) {
320
+ return t.classList.replace(e, s), this;
321
+ },
322
+ addEffect(e) {
323
+ return m(() => e(this, this.hostElement)), this;
324
+ },
325
+ addReactiveContent(e) {
326
+ return t.appendChild(B(e)), this;
327
+ },
328
+ setReactiveContent(e) {
329
+ return this.clear(), t.appendChild(B(e)), this;
330
+ },
331
+ clear() {
332
+ return t.innerHTML = "", this;
333
+ },
334
+ hostElement: t
335
+ }), et = (t, ...e) => ({
336
+ classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
337
+ }), jt = (t, ...e) => et(t, ...e), G = (t, e) => {
338
+ if (!e) return t;
339
+ const s = Object.keys(e || {}).filter(
340
+ (n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
341
+ );
342
+ return s.filter((n) => n.startsWith(".")).forEach((n) => {
343
+ e != null && e.attributes || (e.attributes = {}), e.attributes[n.slice(1)] = e[n];
344
+ }), s.filter((n) => n.startsWith("@")).forEach((n) => {
345
+ e != null && e.listeners || (e.listeners = {});
346
+ const o = n.slice(1);
347
+ e.listeners[o] = e[n];
348
+ }), s.filter((n) => n.startsWith("$")).forEach((n) => {
349
+ e != null && e.effects || (e.effects = []), e.effects.push(e[n]);
350
+ }), rt(t, e.classList), it(t, e.style), lt(t, e.attributes), ct(t, e.reactiveClassList), ot(t, e.customAttributes), nt(t, e.children), st(t, e.effects), J(t, e.listeners), J(t, e.customListeners), t;
351
+ }, J = (t, e) => {
352
+ e && Object.entries(e).forEach(([s, n]) => {
353
+ typeof n == "function" && t.addEventlistener(s, n);
354
+ });
355
+ }, st = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), nt = (t, e) => W(t, ...e || []), ot = (t, e) => {
356
+ const s = e;
357
+ s && Object.keys(s).forEach((n) => {
358
+ y(s[n]) ? t.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? t.addEffect(() => {
359
+ t.setCustomAttribute(n, s[n]());
360
+ }) : t.setCustomAttribute(n, s[n]);
361
+ });
362
+ }, rt = (t, e) => t.addClass(...e || []), ct = (t, e) => t.addReactiveClass(e || {}), it = (t, e) => t.addStyle(e || {}), lt = (t, e) => {
363
+ const s = e, n = (o, c) => {
364
+ c && (y(c) ? t.setReactiveAttribute(o, c) : typeof c == "function" ? t.addEffect(() => {
365
+ t.setAttribute(o, c());
366
+ }) : t.setAttribute(o, c));
367
+ };
368
+ s && Object.keys(s).forEach((o) => {
369
+ n(o, s[o]);
370
+ });
371
+ }, W = (t, ...e) => (e.forEach((s) => {
372
+ typeof s == "string" ? s.trim().length > 0 && t.addHtmlContent(s) : y(s) ? t.addReactiveContent(s) : t.append(s);
373
+ }), t), j = (t, e) => {
374
+ const s = document.createElement(t), n = {
375
+ ...N(s)
376
+ };
377
+ return G(n, e);
378
+ }, at = (t, e) => {
379
+ const [s, ...n] = t.split(" ").map((c) => c.trim()), o = j(s, e);
380
+ return n.length > 0 && o.addClass(...n), (...c) => W(
381
+ o,
382
+ ...c.filter(Boolean).map(
383
+ (r) => typeof r == "function" && !y(r) ? S(() => r(o)) : r
384
+ )
385
+ );
386
+ }, V = (t, e) => {
387
+ const s = at(t, e);
388
+ return Object.assign(s, s());
389
+ }, S = (t) => j("div").addStyle({ display: "contents" }).addEffect((e) => {
390
+ const s = t(), n = [];
391
+ Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
392
+ }), Rt = (t, e, s) => {
393
+ const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
394
+ let r = [];
395
+ const h = /* @__PURE__ */ new Set();
396
+ let l = t.peek();
397
+ const a = (d) => {
398
+ h.delete(d), o.delete(d), c.delete(d);
399
+ };
400
+ return m(() => {
401
+ const d = t();
402
+ r = d.map(e).map((f) => typeof f == "string" ? f : f.toString());
403
+ const u = Array.from(n.hostElement.children);
404
+ C("containerChildren", u, r), u.forEach((f) => {
405
+ const b = f.dataset.key;
406
+ r.includes(b) || (C("remove element", b, f), f.remove(), a(b));
407
+ }), r.forEach((f) => {
408
+ var T, v;
409
+ const b = d[r.indexOf(f)];
410
+ o.has(f) ? JSON.stringify(b) !== JSON.stringify(l[r.indexOf(f)]) && ((T = n.hostElement.querySelector(`[data-key="${f}"]`)) == null || T.remove(), (v = o.get(f)) == null || v.set(Math.random().toString(36).substring(2, 15)), c.set(
411
+ f,
412
+ () => s(b, r.indexOf(f), d).setCustomAttribute(
413
+ "data-key",
414
+ f
415
+ )
416
+ )) : (C("create new element", f, b), o.set(
417
+ f,
418
+ R(Math.random().toString(36).substring(2, 15))
419
+ ), c.set(
420
+ f,
421
+ () => s(b, r.indexOf(f), d).setCustomAttribute(
422
+ "data-key",
423
+ f
424
+ )
425
+ ));
426
+ }), l = d;
427
+ const p = () => {
428
+ o.forEach((f, b) => {
429
+ C("key from setTimeout foreach currItemSignalMap", b), h.has(b) || (h.add(b), m(() => {
430
+ var H;
431
+ f();
432
+ const T = r.indexOf(b), v = (H = c.get(b)) == null ? void 0 : H();
433
+ v && (C(
434
+ "call effect from setTimeout",
435
+ b,
436
+ v.hostElement
437
+ ), T <= n.hostElement.children.length - 1 ? n.hostElement.insertBefore(
438
+ v.hostElement,
439
+ n.hostElement.children[T]
440
+ ) : n.hostElement.append(v.hostElement));
441
+ }));
442
+ });
443
+ };
444
+ Promise.resolve().then(() => p());
445
+ }), n;
446
+ }, Tt = (t, e, s) => {
447
+ const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map();
448
+ return m(() => {
449
+ let c = Array.from(n.hostElement.children).map(
450
+ (a) => a.dataset.key
451
+ );
452
+ const r = t(), h = r.map(e).map((a) => a.toString()), l = /* @__PURE__ */ new Map();
453
+ r.forEach((a, d) => l.set(h[d], a)), c.filter((a) => !h.includes(a)).forEach(
454
+ (a) => {
455
+ var d;
456
+ return (d = n.hostElement.querySelector(`[data-key="${a}"]`)) == null ? void 0 : d.remove();
457
+ }
458
+ ), c = c.filter(
459
+ (a) => h.includes(a)
460
+ ), h.forEach((a, d) => {
461
+ if (c.includes(a)) {
462
+ if (JSON.stringify(o.get(a)) !== JSON.stringify(l.get(a))) {
463
+ const u = s(r[d], d, r).setCustomAttribute(
464
+ "data-key",
465
+ a
466
+ ).hostElement;
467
+ n.hostElement.querySelector(
468
+ `[data-key="${a}"]`
469
+ ).replaceWith(u);
470
+ const p = n.hostElement.children;
471
+ d > p.length - 2 ? n.hostElement.append(u) : n.hostElement.insertBefore(u, p[d + 1]);
472
+ }
473
+ } else {
474
+ const u = s(r[d], d, r).setCustomAttribute(
475
+ "data-key",
476
+ a
477
+ ), p = n.hostElement.children;
478
+ d > p.length - 1 ? n.hostElement.append(u.hostElement) : n.hostElement.insertBefore(
479
+ u.hostElement,
480
+ p[d]
481
+ );
482
+ }
483
+ }), r.forEach((a, d) => o.set(h[d], a));
484
+ }), n;
485
+ }, xt = (t) => {
486
+ let e = [j("div")], s = !1;
487
+ return m(() => {
488
+ var c;
489
+ const n = t(), o = [];
490
+ Array.isArray(n) ? (o.push(...n), s = !0) : o.push(n), o.length === 0 && o.push(
491
+ j("div").addStyle({ display: "none" })
492
+ );
493
+ try {
494
+ (c = e[0].hostElement) == null || c.replaceWith(
495
+ ...o.map((r) => r.hostElement)
496
+ ), e.forEach((r) => {
497
+ var h;
498
+ return (h = r.hostElement) == null ? void 0 : h.remove();
499
+ }), e = o;
500
+ } catch (r) {
501
+ console.error(r);
502
+ }
503
+ }), s ? e : e[0];
504
+ }, wt = (t) => tt in t, $t = (t) => {
505
+ const e = V("div").addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
506
+ return typeof t == "string" ? s(t) : e.addEffect(() => {
507
+ s(t());
508
+ }), e;
509
+ }, U = (t, e, s) => S(t ? e : s || (() => "")), ht = (t, e, s) => S(() => U(!!t(), e, s)), kt = (t, e, s) => typeof t == "boolean" ? U(t, e, s) : ht(t, e, s), q = (t, e) => {
510
+ const s = S(e);
511
+ return typeof t == "boolean" ? s.hostElement.style.display = t ? "contents" : "none" : s.addEffect((n, o) => {
512
+ o.style.display = t() ? "contents" : "none";
513
+ }), s;
514
+ }, It = (t, e, s) => {
515
+ const n = [];
516
+ return n.push(q(t, e)), s && n.push(
517
+ q(
518
+ () => typeof t == "boolean" ? !t : !t(),
519
+ s
520
+ )
521
+ ), S(() => n);
522
+ }, dt = (t, e) => {
523
+ C("createCustomElement", t);
524
+ const s = document.createElement(t), n = {
525
+ ...N(s),
526
+ setReactiveValue(o) {
527
+ return s instanceof O && s.setReactiveValue(o), this;
528
+ },
529
+ setSlotTemplate(o) {
530
+ const c = s.slotTemplate;
531
+ return c && Object.entries(o).forEach(([r, h]) => {
532
+ c[r] = h;
533
+ }), this;
534
+ }
535
+ };
536
+ return G(n, e);
537
+ }, ut = (t, e) => {
538
+ const s = t.split(" ").slice(1).map((o) => o.trim()), n = dt(t.split(" ")[0], e);
539
+ return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
540
+ A("@rcreateCustomEl content", t, o);
541
+ const c = o.filter(Boolean).map(
542
+ (r) => typeof r == "function" && !y(r) ? S(() => r(n)) : r
543
+ );
544
+ return n.hostElement.allSlotContent = c, n.hostElement.slotContent = c.filter(Q).reduce(
545
+ (r, h) => {
546
+ const l = h.hostElement.getAttribute("slot") || "default";
547
+ return r[l] || (r[l] = []), r[l].push(h), r;
548
+ },
549
+ {}
550
+ ), n.hostElement.appendAllSlotContent = () => W(n, ...c), n;
551
+ };
552
+ }, ft = (t, e, s) => ut(
553
+ `${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
554
+ w(e) ? e : e && typeof e == "string" ? s : void 0
555
+ ), pt = (t, e, s) => {
556
+ const n = ft(t, e, s);
557
+ return Object.assign(n, n());
558
+ }, Mt = () => {
559
+ const t = () => {
560
+ };
561
+ return t.oldValue = null, t;
562
+ }, Pt = () => ({}), Wt = (t, e, s) => {
563
+ const n = e ? Et(e, s)(t) : t;
564
+ return (o, ...c) => {
565
+ const r = [...c];
566
+ return o && !w(o) && r.unshift(o), pt(n, w(o) ? o : {})(...r);
567
+ };
568
+ }, i = {}, mt = [
569
+ "div",
570
+ "span",
571
+ "section",
572
+ "input",
573
+ "button",
574
+ "table",
575
+ "tr",
576
+ "td",
577
+ "th",
578
+ "ul",
579
+ "li",
580
+ "ol",
581
+ "form",
582
+ "label",
583
+ "select",
584
+ "option",
585
+ "textarea",
586
+ "img",
587
+ "a",
588
+ "p",
589
+ "h1",
590
+ "h2",
591
+ "h3",
592
+ "h4",
593
+ "h5",
594
+ "h6",
595
+ "br",
596
+ "hr",
597
+ "pre",
598
+ "code",
599
+ "nav",
600
+ "header",
601
+ "footer",
602
+ "main",
603
+ "aside",
604
+ "article",
605
+ "figure",
606
+ "figcaption",
607
+ "blockquote",
608
+ "cite",
609
+ "small",
610
+ "strong",
611
+ "em",
612
+ "b",
613
+ "i",
614
+ "u",
615
+ "s",
616
+ "sub",
617
+ "sup",
618
+ "mark",
619
+ "del",
620
+ "ins",
621
+ "details",
622
+ "summary",
623
+ "progress",
624
+ "meter",
625
+ "audio",
626
+ "video",
627
+ "canvas",
628
+ "slot"
629
+ ];
630
+ mt.forEach((t) => {
631
+ i[t] = (e, ...s) => {
632
+ let n = [...s];
633
+ return e && !w(e) && (n = [e].concat(n)), V(t, w(e) ? e : {})(...n);
634
+ };
635
+ });
636
+ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt = i.table, qt = i.tr, zt = i.td, Dt = i.th, Nt = i.ul, Gt = i.li, Vt = i.ol, Ut = i.form, Xt = i.label, Zt = i.select, Qt = i.option, Yt = i.textarea, Kt = i.img, te = i.a, ee = i.p, se = i.h1, ne = i.h2, oe = i.h3, re = i.h4, ce = i.h5, ie = i.h6, le = i.br, ae = i.hr, he = i.pre, de = i.code, ue = i.nav, fe = i.header, pe = i.footer, me = i.main, Ce = i.aside, Ee = i.article, be = i.figure, ye = i.figcaption, Se = i.blockquote, ve = i.cite, Ae = i.small, ge = i.strong, Le = i.em, Oe = i.b, je = i.i, Re = i.u, Te = i.s, xe = i.sub, we = i.sup, $e = i.mark, ke = i.del, Ie = i.ins, Me = i.details, Pe = i.summary, We = i.progress, Fe = i.meter, He = i.audio, _e = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", I = "EVENT_CONFIG", x = "observedAttributes", ze = () => (t, e) => {
637
+ Reflect.get(t, x) || Reflect.defineProperty(t, x, {
638
+ value: []
639
+ }), Reflect.get(t, x).push(
640
+ $(e)
641
+ );
642
+ }, De = (t) => (e, s) => {
643
+ Reflect.get(e, k) || Reflect.defineProperty(e, k, {
644
+ value: []
645
+ }), Reflect.get(e, I) || Reflect.defineProperty(e, I, {
646
+ value: {}
647
+ }), Reflect.get(e, I)[s] = {
648
+ bubbles: (t == null ? void 0 : t.bubbles) ?? !1,
649
+ composed: (t == null ? void 0 : t.composed) ?? !1
650
+ }, Reflect.get(e, k).push(s);
651
+ }, Et = (t, e = !1) => (s) => {
652
+ C(
653
+ t,
654
+ "start register static attr",
655
+ s.prototype[x]
656
+ );
657
+ const n = [];
658
+ if (s.styles) {
659
+ const c = s.styles, r = [];
660
+ Array.isArray(c) ? r.push(...c) : r.push(c), r.forEach((h) => {
661
+ const l = new CSSStyleSheet();
662
+ l.replaceSync(h), n.push(l);
663
+ const a = new CSSStyleSheet();
664
+ a.replaceSync(h.slice(h.indexOf("@property"))), document.adoptedStyleSheets.push(a);
665
+ });
666
+ }
667
+ class o extends s {
668
+ constructor(...r) {
669
+ C("constructor", `%c${t}%c`), super(e, ...r), A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
670
+ }
671
+ render() {
672
+ let r = Ct();
673
+ const h = () => {
674
+ r = s.prototype.render.call(this);
675
+ };
676
+ return h.fake = !0, m(h), r;
677
+ }
678
+ attributeChangedCallback(r, h, l) {
679
+ C(
680
+ "%cAttribute has changed.%c",
681
+ `%c${r}%c`,
682
+ `oldValue: ${h}, newValue: ${l}`,
683
+ `%c${t}%c`
684
+ );
685
+ try {
686
+ l = JSON.parse(l);
687
+ } catch {
688
+ }
689
+ const a = Y(r);
690
+ if (a in this && y(this[a])) {
691
+ const d = this[a];
692
+ l === null ? (d.set(d.initValue), this.removeAttribute(r)) : d.set(l);
693
+ }
694
+ F(
695
+ this,
696
+ s.prototype.attributeChangedCallback,
697
+ r,
698
+ h,
699
+ l
700
+ );
701
+ }
702
+ connectedCallback() {
703
+ var h;
704
+ C("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (C("WRAPPER for providers", t), Object.entries(this.providers).forEach(
705
+ ([l, a]) => {
706
+ C("register provider", l, a()), this.addEventListener(l, (d) => {
707
+ var p;
708
+ C("send provider", l, a());
709
+ const u = d;
710
+ ((p = u.detail) == null ? void 0 : p.context) === l && (u.stopPropagation(), u.detail.callback(a));
711
+ });
712
+ }
713
+ )), this.checkInjects(), (h = s.prototype[k]) == null || h.forEach(
714
+ (l) => {
715
+ this[l] = (a) => {
716
+ const d = s.prototype[I][l], { bubbles: u, composed: p } = d;
717
+ y(a) ? m(() => {
718
+ A("@oemit reactive value", a()), this.dispatchEvent(
719
+ new CustomEvent(l, {
720
+ detail: a(),
721
+ bubbles: u,
722
+ composed: p
723
+ })
724
+ );
725
+ }) : (A("@oemit value", a), this.dispatchEvent(
726
+ new CustomEvent(l, {
727
+ detail: a,
728
+ bubbles: u,
729
+ composed: p
730
+ })
731
+ ));
732
+ };
733
+ }
734
+ ), C("start render", `%c${t}%c`, t);
735
+ const r = () => {
736
+ const l = this.render();
737
+ this.shadow.appendChild(l.hostElement), this.appendSlotContent(), setTimeout(() => {
738
+ F(this, s.prototype.connectedCallback);
739
+ });
740
+ };
741
+ if (this.rootStyle && !s.styles) {
742
+ const l = (u) => u instanceof Promise || Array.isArray(u) && u.every((p) => p instanceof Promise), a = this.rootStyle, d = (u) => {
743
+ const p = new CSSStyleSheet();
744
+ p.replaceSync(u), this.shadow.adoptedStyleSheets.push(p);
745
+ const f = new CSSStyleSheet();
746
+ f.replaceSync(u.slice(u.indexOf("@property"))), document.adoptedStyleSheets.push(f);
747
+ };
748
+ if (l(a)) {
749
+ const u = [];
750
+ Array.isArray(a) ? u.push(...a) : u.push(a), Promise.all(u).then((p) => p.forEach((f) => d(f.default))).then(() => r());
751
+ } else {
752
+ const u = [];
753
+ Array.isArray(a) ? u.push(...a) : u.push(a), u.forEach((p) => d(p)), r();
754
+ }
755
+ } else
756
+ r();
757
+ this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((l) => {
758
+ C(
759
+ this.slotContext,
760
+ this.slotContext && this.slotContext[l.name]
761
+ ), A(
762
+ "@bslot element",
763
+ l,
764
+ `name:${l.name};`,
765
+ l.assignedElements()
766
+ ), l.assignedElements().forEach((a) => {
767
+ const d = this.slotContext[l.name];
768
+ this.slotContext && y(d) && (A(
769
+ "@oslot element",
770
+ l,
771
+ `name:${l.name};`,
772
+ l.assignedElements()
773
+ ), m(() => {
774
+ a.dispatchEvent(
775
+ new CustomEvent("handleSlotContext", {
776
+ detail: d()
777
+ })
778
+ );
779
+ }));
780
+ });
781
+ });
782
+ }
783
+ disconnectedCallback() {
784
+ this.shadow.replaceChildren(), this.replaceChildren(), F(this, s.prototype.disconnectedCallback);
785
+ }
786
+ }
787
+ return E(o, "observedAttributes", s.prototype[x] ?? []), E(o, "renderTagName", t), o.toString = () => t, customElements.get(t) ? console.error(
788
+ `название тега ${t} повторяется, компонент ${s.name} не зарегистрирован`
789
+ ) : customElements.define(t, o), o;
790
+ };
791
+ export {
792
+ O as BaseElement,
793
+ te as a,
794
+ lt as addAttributeList,
795
+ rt as addClassList,
796
+ ot as addCustomAttributes,
797
+ z as addHtmlContent,
798
+ ct as addReactiveClassList,
799
+ it as addStyleList,
800
+ W as appendContentItem,
801
+ Ee as article,
802
+ Ce as aside,
803
+ He as audio,
804
+ Oe as b,
805
+ At as bindReactiveSignals,
806
+ Se as blockquote,
807
+ le as br,
808
+ Bt as button,
809
+ $ as camelToKebab,
810
+ Be as canvas,
811
+ F as checkCall,
812
+ ve as cite,
813
+ et as classList,
814
+ jt as cls,
815
+ de as code,
816
+ A as colorLog,
817
+ Et as component,
818
+ qe as createComponent,
819
+ ft as createCustom,
820
+ ut as createCustomEl,
821
+ dt as createCustomElement,
822
+ at as createEl,
823
+ j as createElement,
824
+ vt as createSignal,
825
+ pt as customEl,
826
+ Pt as defineSlotTemplate,
827
+ ke as del,
828
+ Me as details,
829
+ K as disableLogs,
830
+ Ct as div,
831
+ m as effect,
832
+ V as el,
833
+ N as elementHelpers,
834
+ Le as em,
835
+ yt as enableLogs,
836
+ De as event,
837
+ Ot as eventEmitter,
838
+ ye as figcaption,
839
+ be as figure,
840
+ pe as footer,
841
+ gt as forkJoin,
842
+ Ut as form,
843
+ Rt as getList,
844
+ S as getSignalContent,
845
+ se as h1,
846
+ ne as h2,
847
+ oe as h3,
848
+ re as h4,
849
+ ce as h5,
850
+ ie as h6,
851
+ fe as header,
852
+ ae as hr,
853
+ B as htmlEffectWrapper,
854
+ je as i,
855
+ Kt as img,
856
+ G as initComponent,
857
+ _t as input,
858
+ Ie as ins,
859
+ Lt as isBaseElement,
860
+ Q as isComponentConfig,
861
+ w as isComponentInitConfig,
862
+ y as isReactiveSignal,
863
+ wt as isSlotTemplate,
864
+ Y as kebabToCamel,
865
+ Xt as label,
866
+ Gt as li,
867
+ me as main,
868
+ $e as mark,
869
+ Fe as meter,
870
+ ue as nav,
871
+ Mt as newEventEmitter,
872
+ Vt as ol,
873
+ Tt as oldGetList,
874
+ Qt as option,
875
+ ee as p,
876
+ he as pre,
877
+ We as progress,
878
+ C as projectLog,
879
+ ze as property,
880
+ U as renderIf,
881
+ St as rs,
882
+ ht as rxRenderIf,
883
+ Te as s,
884
+ Ht as section,
885
+ Zt as select,
886
+ nt as setChildren,
887
+ st as setEffects,
888
+ D as setHtmlContent,
889
+ J as setListeners,
890
+ It as show,
891
+ q as showIf,
892
+ R as signal,
893
+ xt as signalComponent,
894
+ Je as slot,
895
+ Ae as small,
896
+ Ft as span,
897
+ ge as strong,
898
+ xe as sub,
899
+ Pe as summary,
900
+ we as sup,
901
+ Jt as table,
902
+ zt as td,
903
+ Yt as textarea,
904
+ Dt as th,
905
+ qt as tr,
906
+ Re as u,
907
+ Nt as ul,
908
+ $t as unsafeHtml,
909
+ Wt as useCustomComponent,
910
+ _e as video,
911
+ kt as when
912
+ };