aptechka 0.82.3 → 0.82.4

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.
@@ -5,6 +5,7 @@ export declare const activeComponent: {
5
5
  };
6
6
  export declare class ComponentElement extends HTMLElement {
7
7
  #private;
8
+ __props__: any;
8
9
  constructor();
9
10
  addConnectCallback(callback: ComponentConnectCallback): void;
10
11
  addDisconnectCallback(callback: ComponentDisconnectCallback): void;
package/lib/jsx/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var d=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var l=(t,e,o)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,f=(t,e)=>{for(var o in e||(e={}))p.call(e,o)&&l(t,o,e[o]);if(d)for(var o of d(e))v.call(e,o)&&l(t,o,e[o]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../render-DBQUdpsp.cjs"),h=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const D=require("../Store-1JrMCgdX.cjs"),a=require("../Composed-CSeUTRCg.cjs"),S=require("../DerivedArray-B8A0-8uT.cjs");function w(){return{value:null}}function m(t){n.activeComponent.current.addConnectCallback(t)}function R(t){n.activeComponent.current.addDisconnectCallback(t)}function A(t){const e=n.activeComponent.current.attachInternals();return t==null||t(e),e}function x(t,e){const o=n.activeComponent.current.attachShadow(f({mode:"open"},t));return e==null||e(o),o}function C(t){const e=new CSSStyleSheet;return e.replaceSync(t),e}function g(t){let e="";const o=(s,r)=>{r&&(e+=`${r} {`);for(const[u,c]of Object.entries(s))typeof c=="object"&&c!==null?o(c,u):e+=`${h.camelToKebab(u)}: ${c};`;r&&(e+="}")};return o(t),e}function T(t,e){const o=C(e),s=[];for(const r of t.adoptedStyleSheets)Array.from(o.cssRules).filter(c=>!Array.from(r.cssRules).some(i=>i.cssText===c.cssText)).forEach(c=>{const i=r.insertRule(c.cssText);s.push(()=>r.deleteRule(i))});return()=>s.forEach(r=>r())}function b(t){const e=document.createElement("style");return e.textContent=t,document.head.appendChild(e),()=>e.remove()}function q(t){const e=g(t);if(n.activeComponent.current.shadowRoot){n.activeComponent.current.shadowRoot.adoptedStyleSheets=[...n.activeComponent.current.shadowRoot.adoptedStyleSheets,C(e)];return}m(o=>{const s=o.getRootNode();if(s===document){if(!Array.from(document.head.querySelectorAll("style")).find(u=>u.textContent===e))return b(e)}else if(s instanceof ShadowRoot)return T(s,e)})}function j(...t){const e=new D.Store(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function E(...t){const e=new a.Derived(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function K(...t){const e=new S.DerivedArray(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function I(...t){const e=new S.DerivedKeyedArray(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function O(...t){const e=new a.Resource(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function $(...t){const e=new a.Composed(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}exports.Fragment=n.Fragment;exports.h=n.h;exports.render=n.render;exports.useComposedStore=$;exports.useConnect=m;exports.useDerivedArrayStore=K;exports.useDerivedKeyedArrayStore=I;exports.useDerivedStore=E;exports.useDisconnect=R;exports.useInternals=A;exports.useRef=w;exports.useResourceStore=O;exports.useShadow=x;exports.useStore=j;exports.useStylesheet=q;
1
+ "use strict";var y=Object.defineProperty;var d=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var l=(t,e,o)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,f=(t,e)=>{for(var o in e||(e={}))p.call(e,o)&&l(t,o,e[o]);if(d)for(var o of d(e))v.call(e,o)&&l(t,o,e[o]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../render-BWjKu0M_.cjs"),h=require("../string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const D=require("../Store-1JrMCgdX.cjs"),a=require("../Composed-CSeUTRCg.cjs"),S=require("../DerivedArray-B8A0-8uT.cjs");function w(){return{value:null}}function m(t){n.activeComponent.current.addConnectCallback(t)}function R(t){n.activeComponent.current.addDisconnectCallback(t)}function A(t){const e=n.activeComponent.current.attachInternals();return t==null||t(e),e}function x(t,e){const o=n.activeComponent.current.attachShadow(f({mode:"open"},t));return e==null||e(o),o}function C(t){const e=new CSSStyleSheet;return e.replaceSync(t),e}function g(t){let e="";const o=(s,r)=>{r&&(e+=`${r} {`);for(const[u,c]of Object.entries(s))typeof c=="object"&&c!==null?o(c,u):e+=`${h.camelToKebab(u)}: ${c};`;r&&(e+="}")};return o(t),e}function T(t,e){const o=C(e),s=[];for(const r of t.adoptedStyleSheets)Array.from(o.cssRules).filter(c=>!Array.from(r.cssRules).some(i=>i.cssText===c.cssText)).forEach(c=>{const i=r.insertRule(c.cssText);s.push(()=>r.deleteRule(i))});return()=>s.forEach(r=>r())}function b(t){const e=document.createElement("style");return e.textContent=t,document.head.appendChild(e),()=>e.remove()}function q(t){const e=g(t);if(n.activeComponent.current.shadowRoot){n.activeComponent.current.shadowRoot.adoptedStyleSheets=[...n.activeComponent.current.shadowRoot.adoptedStyleSheets,C(e)];return}m(o=>{const s=o.getRootNode();if(s===document){if(!Array.from(document.head.querySelectorAll("style")).find(u=>u.textContent===e))return b(e)}else if(s instanceof ShadowRoot)return T(s,e)})}function j(...t){const e=new D.Store(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function E(...t){const e=new a.Derived(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function K(...t){const e=new S.DerivedArray(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function I(...t){const e=new S.DerivedKeyedArray(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function O(...t){const e=new a.Resource(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}function $(...t){const e=new a.Composed(...t);return n.activeComponent.current&&n.activeComponent.current.addDisconnectCallback(()=>{e.close()}),e}exports.Fragment=n.Fragment;exports.h=n.h;exports.render=n.render;exports.useComposedStore=$;exports.useConnect=m;exports.useDerivedArrayStore=K;exports.useDerivedKeyedArrayStore=I;exports.useDerivedStore=E;exports.useDisconnect=R;exports.useInternals=A;exports.useRef=w;exports.useResourceStore=O;exports.useShadow=x;exports.useStore=j;exports.useStylesheet=q;
package/lib/jsx/index.js CHANGED
@@ -9,8 +9,8 @@ var d = (t, e, n) => e in t ? S(t, e, { enumerable: !0, configurable: !0, writab
9
9
  y.call(e, n) && d(t, n, e[n]);
10
10
  return t;
11
11
  };
12
- import { a as r } from "../render-CiA0mn5V.js";
13
- import { F as V, h as W, r as X } from "../render-CiA0mn5V.js";
12
+ import { a as r } from "../render-B3Hf-O7M.js";
13
+ import { F as V, h as W, r as X } from "../render-B3Hf-O7M.js";
14
14
  import { c as h } from "../string-BlMQbe8b.js";
15
15
  import "construct-style-sheets-polyfill";
16
16
  import "../index-LReFyN6i.js";
@@ -0,0 +1,13 @@
1
+ export declare function hmrPlugin(): {
2
+ name: string;
3
+ apply: "serve";
4
+ transform(code: string, id: string): {
5
+ code: string;
6
+ map: null;
7
+ } | null;
8
+ config(_config: any, opt: any): {
9
+ define: {
10
+ __JSX_HMR_DEV__: boolean;
11
+ };
12
+ };
13
+ };
package/lib/jsx/type.d.ts CHANGED
@@ -221,4 +221,8 @@ declare global {
221
221
  __storeId: string
222
222
  __key: string
223
223
  }
224
+
225
+ var Fragment: {
226
+ (props: { children?: any }): any
227
+ }
224
228
  }
@@ -0,0 +1,205 @@
1
+ var O = Object.defineProperty, R = Object.defineProperties;
2
+ var q = Object.getOwnPropertyDescriptors;
3
+ var _ = Object.getOwnPropertySymbols;
4
+ var B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
5
+ var L = (r) => {
6
+ throw TypeError(r);
7
+ };
8
+ var w = (r, s, t) => s in r ? O(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t, y = (r, s) => {
9
+ for (var t in s || (s = {}))
10
+ B.call(s, t) && w(r, t, s[t]);
11
+ if (_)
12
+ for (var t of _(s))
13
+ H.call(s, t) && w(r, t, s[t]);
14
+ return r;
15
+ }, N = (r, s) => R(r, q(s));
16
+ var D = (r, s, t) => s.has(r) || L("Cannot " + t);
17
+ var u = (r, s, t) => (D(r, s, "read from private field"), t ? t.call(r) : s.get(r)), m = (r, s, t) => s.has(r) ? L("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), C = (r, s, t, o) => (D(r, s, "write to private field"), o ? o.call(r, t) : s.set(r, t), t);
18
+ import { S as l } from "./Store-CgQ3ReoB.js";
19
+ import { c as K } from "./string-BlMQbe8b.js";
20
+ import "construct-style-sheets-polyfill";
21
+ import "./index-LReFyN6i.js";
22
+ import { connector as M } from "./connector/index.js";
23
+ import { a as P } from "./DerivedArray-DG9iR0mf.js";
24
+ const J = { current: null };
25
+ var b, p;
26
+ class X extends HTMLElement {
27
+ constructor() {
28
+ super();
29
+ m(this, b, []);
30
+ m(this, p, []);
31
+ J.current = this;
32
+ }
33
+ addConnectCallback(t) {
34
+ u(this, b).push(t);
35
+ }
36
+ addDisconnectCallback(t) {
37
+ u(this, p).push(t);
38
+ }
39
+ connectedCallback() {
40
+ u(this, b).forEach((t) => {
41
+ const o = t(this);
42
+ o && u(this, p).push(o);
43
+ });
44
+ }
45
+ disconnectedCallback() {
46
+ u(this, p).forEach((t) => {
47
+ t(this);
48
+ }), C(this, b, []), C(this, p, []);
49
+ }
50
+ }
51
+ b = new WeakMap(), p = new WeakMap();
52
+ function E(r, s, t) {
53
+ const o = s.subscribe((c) => {
54
+ t(c);
55
+ });
56
+ M.subscribe(r, {
57
+ disconnectCallback: () => {
58
+ o();
59
+ },
60
+ maxWaitSec: 20,
61
+ unsubscribeAfterDisconnect: !0
62
+ });
63
+ }
64
+ function W(r, s) {
65
+ s && (s instanceof l ? E(r, s, (t) => {
66
+ t.previous && r.classList.remove(t.previous.toString()), t.current && r.classList.add(t.current.toString());
67
+ }) : typeof s == "object" && !Array.isArray(s) ? Object.entries(s).forEach(([t, o]) => {
68
+ o instanceof l ? E(r, o, (c) => {
69
+ r.classList.toggle(t, !!c.current);
70
+ }) : o && r.classList.add(t);
71
+ }) : Array.isArray(s) ? s.forEach((t) => {
72
+ typeof t == "string" ? r.classList.add(t) : W(r, t);
73
+ }) : s.toString().split(" ").map((t) => r.classList.add(t.trim())));
74
+ }
75
+ function $(r, s) {
76
+ s && (typeof s == "object" ? Object.entries(s).forEach(([t, o]) => {
77
+ o instanceof l ? E(r, o, (c) => {
78
+ var n;
79
+ r.style[t] = (n = c.current) == null ? void 0 : n.toString();
80
+ }) : (typeof o == "number" || typeof o == "string" || typeof o == "boolean") && (r.style[t] = o.toString());
81
+ }) : typeof s == "string" && (r.style = s));
82
+ }
83
+ function A(r, s, t) {
84
+ s === "ref" && t ? Array.isArray(t) ? t.forEach((o) => {
85
+ typeof o == "object" && "value" in o && (o.value = r);
86
+ }) : typeof t == "object" && "value" in t && (t.value = r) : s === "className" || s === "class" ? W(r, t) : s === "style" ? $(r, t) : typeof t == "number" ? s === "tabIndex" ? r.setAttribute("tabindex", t.toString()) : A(r, s, t.toString()) : typeof t == "string" ? s === "htmlFor" ? r.setAttribute("for", t) : r.setAttribute(s, t) : typeof t == "boolean" ? t ? r.setAttribute(s, "") : r.removeAttribute(s) : t instanceof l && E(r, t, (o) => {
87
+ s in r ? r[s] = o.current : A(r, s, o.current);
88
+ });
89
+ }
90
+ function z(r, s) {
91
+ for (const [t, o] of Object.entries(s != null ? s : {}))
92
+ typeof o == "function" && t.startsWith("on") ? r.addEventListener(
93
+ t.replace("on", "").toLowerCase(),
94
+ o
95
+ ) : A(r, t, o);
96
+ }
97
+ function I(r) {
98
+ const s = [];
99
+ return r.forEach((t) => {
100
+ t != null && (typeof t == "number" ? s.push(t.toString()) : Array.isArray(t) ? t.forEach((o) => {
101
+ s.push(...I(o));
102
+ }) : s.push(t));
103
+ }), s;
104
+ }
105
+ function Q(r, s) {
106
+ const t = [...r.childNodes].filter((e) => e.__storeId === s.id), o = s.current, c = Array.isArray(o) ? o : [o], n = [];
107
+ if (c.forEach((e) => {
108
+ let i = null;
109
+ typeof e == "boolean" || typeof e == "number" || typeof e == "string" ? i = document.createTextNode(e.toString()) : e instanceof Node && (i = e), i && (i.__storeId = s.id, n.push(i));
110
+ }), s instanceof P) {
111
+ const e = [];
112
+ n.forEach((i, f) => {
113
+ const a = t.find(
114
+ (h) => h.__key === i.__key
115
+ );
116
+ a ? a.isEqualNode(i) ? e.push(a) : (a.replaceWith(i), e.push(i)) : (e.push(i), r.appendChild(i));
117
+ }), t.forEach((i) => {
118
+ e.includes(i) || i.remove();
119
+ });
120
+ } else
121
+ n.forEach((e, i) => {
122
+ var a;
123
+ const f = t[i];
124
+ if (f)
125
+ f.isEqualNode(e) || (f.replaceWith(e), t[i] = e);
126
+ else {
127
+ const h = t[t.length - 1];
128
+ h ? (a = h.parentNode) == null || a.insertBefore(
129
+ e,
130
+ h.nextSibling
131
+ ) : r.appendChild(e);
132
+ }
133
+ }), t.slice(n.length).forEach((e) => {
134
+ e.remove();
135
+ });
136
+ }
137
+ class g {
138
+ constructor(s, t, o) {
139
+ this.tag = s, this.attributes = t, this.children = o;
140
+ }
141
+ }
142
+ class S {
143
+ constructor(s, t, o) {
144
+ this.tag = s, this.attributes = t, this.children = o;
145
+ }
146
+ }
147
+ function d(r, s, t, o = !1) {
148
+ const c = I(t);
149
+ z(r, s), c.forEach((n) => {
150
+ if (n instanceof l)
151
+ E(r, n, () => {
152
+ Q(r, n);
153
+ });
154
+ else if (n instanceof g)
155
+ n.tag === "shadow" && r.shadowRoot ? d(
156
+ r.shadowRoot,
157
+ n.attributes,
158
+ n.children
159
+ ) : d(r, n.attributes, n.children);
160
+ else if (n instanceof S) {
161
+ let e = null;
162
+ n.tag === "svg" ? (e = document.createElementNS(
163
+ "http://www.w3.org/2000/svg",
164
+ "svg"
165
+ ), d(e, n.attributes, n.children, !0)) : e = o ? document.createElementNS("http://www.w3.org/2000/svg", n.tag) : document.createElement(n.tag), d(e, n.attributes, n.children, o), r.append(e);
166
+ } else
167
+ r.append(n);
168
+ });
169
+ }
170
+ function U(r, s, ...t) {
171
+ var o;
172
+ if (typeof r == "string")
173
+ return r === "component" ? new g(r, s, t) : r === "shadow" ? new g(r, s, t) : new S(r, s, t);
174
+ {
175
+ if (r === F)
176
+ return F(t);
177
+ if (r.template)
178
+ return r(y({}, s));
179
+ const c = `e-${K(r.name)}`;
180
+ let n = customElements.get(c);
181
+ n || (n = (o = class extends X {
182
+ constructor() {
183
+ super();
184
+ }
185
+ }, o.formAssociated = r.formAssociated, o), customElements.define(c, n));
186
+ const e = new n(), i = N(y({}, s), {
187
+ children: t
188
+ }), f = r(i);
189
+ return __JSX_HMR_DEV__ && (e.__props__ = i), (f instanceof g || f instanceof S) && (f != null && f.children || f.attributes) && d(e, f.attributes, f.children), e;
190
+ }
191
+ }
192
+ function F(r) {
193
+ const s = document.createDocumentFragment();
194
+ return d(s, void 0, r), s;
195
+ }
196
+ function T(r, s, t) {
197
+ const o = /* @__PURE__ */ U(s, y({}, t));
198
+ return r.append(o), o;
199
+ }
200
+ export {
201
+ F,
202
+ J as a,
203
+ U as h,
204
+ T as r
205
+ };
@@ -0,0 +1 @@
1
+ "use strict";var R=Object.defineProperty,B=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var q=r=>{throw TypeError(r)};var L=(r,e,t)=>e in r?R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,y=(r,e)=>{for(var t in e||(e={}))K.call(e,t)&&L(r,t,e[t]);if(w)for(var t of w(e))M.call(e,t)&&L(r,t,e[t]);return r},N=(r,e)=>B(r,H(e));var D=(r,e,t)=>e.has(r)||q("Cannot "+t);var p=(r,e,t)=>(D(r,e,"read from private field"),t?t.call(r):e.get(r)),S=(r,e,t)=>e.has(r)?q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),C=(r,e,t,s)=>(D(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t);const l=require("./Store-1JrMCgdX.cjs"),P=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");require("./index-CKTweR3M.cjs");const J=require("./connector/index.cjs"),X=require("./DerivedArray-B8A0-8uT.cjs"),F={current:null};var b,u;class $ extends HTMLElement{constructor(){super();S(this,b,[]);S(this,u,[]);F.current=this}addConnectCallback(t){p(this,b).push(t)}addDisconnectCallback(t){p(this,u).push(t)}connectedCallback(){p(this,b).forEach(t=>{const s=t(this);s&&p(this,u).push(s)})}disconnectedCallback(){p(this,u).forEach(t=>{t(this)}),C(this,b,[]),C(this,u,[])}}b=new WeakMap,u=new WeakMap;function g(r,e,t){const s=e.subscribe(f=>{t(f)});J.connector.subscribe(r,{disconnectCallback:()=>{s()},maxWaitSec:20,unsubscribeAfterDisconnect:!0})}function W(r,e){e&&(e instanceof l.Store?g(r,e,t=>{t.previous&&r.classList.remove(t.previous.toString()),t.current&&r.classList.add(t.current.toString())}):typeof e=="object"&&!Array.isArray(e)?Object.entries(e).forEach(([t,s])=>{s instanceof l.Store?g(r,s,f=>{r.classList.toggle(t,!!f.current)}):s&&r.classList.add(t)}):Array.isArray(e)?e.forEach(t=>{typeof t=="string"?r.classList.add(t):W(r,t)}):e.toString().split(" ").map(t=>r.classList.add(t.trim())))}function z(r,e){e&&(typeof e=="object"?Object.entries(e).forEach(([t,s])=>{s instanceof l.Store?g(r,s,f=>{var o;r.style[t]=(o=f.current)==null?void 0:o.toString()}):(typeof s=="number"||typeof s=="string"||typeof s=="boolean")&&(r.style[t]=s.toString())}):typeof e=="string"&&(r.style=e))}function A(r,e,t){e==="ref"&&t?Array.isArray(t)?t.forEach(s=>{typeof s=="object"&&"value"in s&&(s.value=r)}):typeof t=="object"&&"value"in t&&(t.value=r):e==="className"||e==="class"?W(r,t):e==="style"?z(r,t):typeof t=="number"?e==="tabIndex"?r.setAttribute("tabindex",t.toString()):A(r,e,t.toString()):typeof t=="string"?e==="htmlFor"?r.setAttribute("for",t):r.setAttribute(e,t):typeof t=="boolean"?t?r.setAttribute(e,""):r.removeAttribute(e):t instanceof l.Store&&g(r,t,s=>{e in r?r[e]=s.current:A(r,e,s.current)})}function Q(r,e){for(const[t,s]of Object.entries(e!=null?e:{}))typeof s=="function"&&t.startsWith("on")?r.addEventListener(t.replace("on","").toLowerCase(),s):A(r,t,s)}function I(r){const e=[];return r.forEach(t=>{t!=null&&(typeof t=="number"?e.push(t.toString()):Array.isArray(t)?t.forEach(s=>{e.push(...I(s))}):e.push(t))}),e}function U(r,e){const t=[...r.childNodes].filter(n=>n.__storeId===e.id),s=e.current,f=Array.isArray(s)?s:[s],o=[];if(f.forEach(n=>{let i=null;typeof n=="boolean"||typeof n=="number"||typeof n=="string"?i=document.createTextNode(n.toString()):n instanceof Node&&(i=n),i&&(i.__storeId=e.id,o.push(i))}),e instanceof X.DerivedKeyedArray){const n=[];o.forEach((i,c)=>{const a=t.find(h=>h.__key===i.__key);a?a.isEqualNode(i)?n.push(a):(a.replaceWith(i),n.push(i)):(n.push(i),r.appendChild(i))}),t.forEach(i=>{n.includes(i)||i.remove()})}else o.forEach((n,i)=>{var a;const c=t[i];if(c)c.isEqualNode(n)||(c.replaceWith(n),t[i]=n);else{const h=t[t.length-1];h?(a=h.parentNode)==null||a.insertBefore(n,h.nextSibling):r.appendChild(n)}}),t.slice(o.length).forEach(n=>{n.remove()})}class E{constructor(e,t,s){this.tag=e,this.attributes=t,this.children=s}}class _{constructor(e,t,s){this.tag=e,this.attributes=t,this.children=s}}function d(r,e,t,s=!1){const f=I(t);Q(r,e),f.forEach(o=>{if(o instanceof l.Store)g(r,o,()=>{U(r,o)});else if(o instanceof E)o.tag==="shadow"&&r.shadowRoot?d(r.shadowRoot,o.attributes,o.children):d(r,o.attributes,o.children);else if(o instanceof _){let n=null;o.tag==="svg"?(n=document.createElementNS("http://www.w3.org/2000/svg","svg"),d(n,o.attributes,o.children,!0)):n=s?document.createElementNS("http://www.w3.org/2000/svg",o.tag):document.createElement(o.tag),d(n,o.attributes,o.children,s),r.append(n)}else r.append(o)})}function O(r,e,...t){var s;if(typeof r=="string")return r==="component"?new E(r,e,t):r==="shadow"?new E(r,e,t):new _(r,e,t);{if(r===m)return m(t);if(r.template)return r(y({},e));const f=`e-${P.camelToKebab(r.name)}`;let o=customElements.get(f);o||(o=(s=class extends ${constructor(){super()}},s.formAssociated=r.formAssociated,s),customElements.define(f,o));const n=new o,i=N(y({},e),{children:t}),c=r(i);return __JSX_HMR_DEV__&&(n.__props__=i),(c instanceof E||c instanceof _)&&(c!=null&&c.children||c.attributes)&&d(n,c.attributes,c.children),n}}function m(r){const e=document.createDocumentFragment();return d(e,void 0,r),e}function V(r,e,t){const s=O(e,y({},t));return r.append(s),s}exports.Fragment=m;exports.activeComponent=F;exports.h=O;exports.render=V;
@@ -1 +1 @@
1
- "use strict";var lt=Object.defineProperty,ut=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var dt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var Y=i=>{throw TypeError(i)};var W=(i,t,e)=>t in i?lt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,_=(i,t)=>{for(var e in t||(t={}))dt.call(t,e)&&W(i,e,t[e]);if(K)for(var e of K(t))ft.call(t,e)&&W(i,e,t[e]);return i},$=(i,t)=>ut(i,ct(t));var B=(i,t,e)=>t.has(i)||Y("Cannot "+e);var s=(i,t,e)=>(B(i,t,"read from private field"),e?e.call(i):t.get(i)),n=(i,t,e)=>t.has(i)?Y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,r)=>(B(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e),u=(i,t,e)=>(B(i,t,"access private method"),e);var G=(i,t,e,r)=>({set _(a){h(i,t,a,e)},get _(){return s(i,t,r)}});var p=(i,t,e)=>new Promise((r,a)=>{var c=m=>{try{w(e.next(m))}catch(L){a(L)}},H=m=>{try{w(e.throw(m))}catch(L){a(L)}},w=m=>m.done?r(m.value):Promise.resolve(m.value).then(c,H);w((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("../history/index.cjs"),gt=require("../LocalLinks-Bua7BGRF.cjs"),wt=require("../PageAnnouncerElement-C4k2kDJ5.cjs"),pt=require("../PageScroll-C7QBpx0G.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const J=require("../url-CPgw9bd5.cjs"),Rt=require("urlpattern-polyfill"),Pt=require("../render-DBQUdpsp.cjs"),vt=require("../object-baN9pgbU.cjs");var S,M,E,g,d,q,U,P,v,b,o,Q,X,Z,tt,et,st,it,rt,I;class bt{constructor(t,e){n(this,o);n(this,S);n(this,M);n(this,E);n(this,g,null);n(this,d,null);n(this,q,!1);n(this,U,null);n(this,P);n(this,v,[]);n(this,b,[]);h(this,S,t),h(this,M,e),h(this,E,new URLPattern({pathname:s(this,S)})),h(this,P,new MutationObserver(u(this,o,it).bind(this)))}get pattern(){return s(this,S)}get isActive(){return s(this,q)}get element(){return s(this,d)}get nest(){return s(this,U)}testPathname(t){return s(this,E).test({pathname:t})}render(t,e){return p(this,null,function*(){s(this,P).observe(document.head,{childList:!0,subtree:!0}),s(this,g)?u(this,o,X).call(this):yield u(this,o,Q).call(this),yield u(this,o,rt).call(this),s(this,g)&&(yield u(this,o,Z).call(this,t,e)),s(this,P).disconnect()})}close(){u(this,o,et).call(this)}}S=new WeakMap,M=new WeakMap,E=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakMap,U=new WeakMap,P=new WeakMap,v=new WeakMap,b=new WeakMap,o=new WeakSet,Q=function(){return p(this,null,function*(){const t=yield s(this,M).call(this);h(this,b,[...s(this,v)]),typeof t.default=="function"&&h(this,g,t.default)})},X=function(){s(this,v).forEach(t=>{document.head.appendChild(t.cloneNode(!0))})},Z=function(t,e){return p(this,null,function*(){const a={urlPatternResult:s(this,E).exec({pathname:e.pathname})};vt.isESClass(s(this,g))?(h(this,d,new(s(this,g))(a)),t.appendChild(s(this,d))):h(this,d,Pt.render(t,s(this,g),a)),u(this,o,tt).call(this),h(this,q,!0)})},tt=function(){var t;s(this,d)&&h(this,U,s(this,d).querySelector("[data-nest]")||((t=s(this,d).shadowRoot)==null?void 0:t.querySelector("[data-nest]"))||s(this,d).shadowRoot||s(this,d))},et=function(){var t;s(this,P).disconnect(),(t=s(this,d))==null||t.remove(),h(this,q,!1),u(this,o,st).call(this)},st=function(){s(this,b).forEach(t=>{t.parentNode===document.head&&document.head.removeChild(t)}),h(this,b,[])},it=function(t){t.forEach(e=>{e.addedNodes.forEach(r=>{s(this,g)?s(this,b).push(r):s(this,v).push(r)})})},rt=function(){return p(this,null,function*(){const t=s(this,v).filter(u(this,o,I));yield Promise.all(t.map(e=>new Promise(r=>{u(this,o,I).call(this,e)?e.onload=()=>r():r()})))})},I=function(t){return t instanceof HTMLElement&&(t.tagName==="STYLE"||t.tagName==="SCRIPT"||t.tagName==="LINK")};globalThis.URLPattern=Rt.URLPattern;var l,y,T,N,k,A,R,C,f,at,nt,ht,z,ot;class yt{constructor(t){n(this,f);n(this,l,null);n(this,y,null);n(this,T,null);n(this,N,null);n(this,k,null);n(this,A,0);n(this,R,[]);n(this,C,null);h(this,l,$(_({},t),{rootElement:(t==null?void 0:t.rootElement)||document.body,base:J.normalizeBase(t==null?void 0:t.base)})),h(this,k,new wt.PageAnnouncerElement),h(this,y,new pt.PageScroll(s(this,l).scrollSelector)),s(this,y).update(),h(this,T,new gt.LocalLinks({base:s(this,l).base,trailingSlash:s(this,l).trailingSlash,includeAnchor:t==null?void 0:t.includeAnchor,onClick:(e,r)=>{try{this.navigate(e,r)}catch(a){window.location.assign(e)}}})),s(this,T).update(),h(this,N,new mt.History({onPop:e=>{this.navigate(e)}}))}history(){return s(this,N)}get scroll(){return scroll}get routes(){return s(this,R)}run(){u(this,f,ot).call(this),this.navigate(new URL(location.href),{revalidate:!0})}defineRoute(t,e){const r=new bt(t,e);s(this,R).push(r)}navigate(t,e){return p(this,null,function*(){var O,j,x,V,D,F;const r=s(this,N).isBack,a=++G(this,A)._;let c=J.normalizeURL(t,{base:s(this,l).base,trailingSlash:s(this,l).trailingSlash});if(s(this,l).urlModifier&&(c=s(this,l).urlModifier(c)),!(yield u(this,f,at).call(this,c))||s(this,A)!==a||(yield(j=(O=s(this,l)).beforeNavigation)==null?void 0:j.call(O),s(this,A)!==a))return;const{activeRoutes:H,newRoutes:w,oldRoutes:m,keepRoutes:L}=u(this,f,nt).call(this,c);h(this,C,(x=L[L.length-1])!=null?x:null),r||(s(this,N).push(c),((V=e==null?void 0:e.keepScrollPosition)==null||V)&&s(this,y).element.scrollTo({top:0,behavior:"instant"})),s(this,k).create(document,c.pathname),s(this,l).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>u(this,f,z).call(this,m,w,c)).finished:yield u(this,f,z).call(this,m,w,c),s(this,y).update(),s(this,T).update(),s(this,k).done(),yield(F=(D=s(this,l)).afterNavigation)==null?void 0:F.call(D)})}}l=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap,k=new WeakMap,A=new WeakMap,R=new WeakMap,C=new WeakMap,f=new WeakSet,at=function(t){return p(this,null,function*(){if(!s(this,l).preprocessor)return!0;try{return yield new Promise((e,r)=>{var a,c;(c=(a=s(this,l)).preprocessor)==null||c.call(a,{url:t,resolve:e,reject:r})}),!0}catch(e){return console.error(e!=null?e:"Route change canceled"),!1}})},nt=function(t){let e=t.pathname.replace(s(this,l).base,"");e.startsWith("/")||(e=`/${e}`);const r=s(this,R).filter(a=>a.isActive);return{activeRoutes:r,newRoutes:s(this,R).filter(a=>!r.includes(a)&&a.testPathname(e)),oldRoutes:r.filter(a=>!a.testPathname(e)),keepRoutes:r.filter(a=>a.testPathname(e))}},ht=function(t){t.forEach(e=>e.close())},z=function(t,e,r){return p(this,null,function*(){var a,c;u(this,f,ht).call(this,t);for(const H of e){const w=(c=(a=s(this,C))==null?void 0:a.nest)!=null?c:s(this,l).rootElement;yield H.render(w,r),h(this,C,H)}})},ot=function(){s(this,R).sort((t,e)=>{const r=t.pattern.split("/").length,a=e.pattern.split("/").length;return r-a})};exports.Router=yt;
1
+ "use strict";var lt=Object.defineProperty,ut=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var dt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var Y=i=>{throw TypeError(i)};var W=(i,t,e)=>t in i?lt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,_=(i,t)=>{for(var e in t||(t={}))dt.call(t,e)&&W(i,e,t[e]);if(K)for(var e of K(t))ft.call(t,e)&&W(i,e,t[e]);return i},$=(i,t)=>ut(i,ct(t));var B=(i,t,e)=>t.has(i)||Y("Cannot "+e);var s=(i,t,e)=>(B(i,t,"read from private field"),e?e.call(i):t.get(i)),n=(i,t,e)=>t.has(i)?Y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,r)=>(B(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e),u=(i,t,e)=>(B(i,t,"access private method"),e);var G=(i,t,e,r)=>({set _(a){h(i,t,a,e)},get _(){return s(i,t,r)}});var p=(i,t,e)=>new Promise((r,a)=>{var c=m=>{try{w(e.next(m))}catch(L){a(L)}},H=m=>{try{w(e.throw(m))}catch(L){a(L)}},w=m=>m.done?r(m.value):Promise.resolve(m.value).then(c,H);w((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("../history/index.cjs"),gt=require("../LocalLinks-Bua7BGRF.cjs"),wt=require("../PageAnnouncerElement-C4k2kDJ5.cjs"),pt=require("../PageScroll-C7QBpx0G.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const J=require("../url-CPgw9bd5.cjs"),Rt=require("urlpattern-polyfill"),Pt=require("../render-BWjKu0M_.cjs"),vt=require("../object-baN9pgbU.cjs");var S,M,E,g,d,q,U,P,v,b,o,Q,X,Z,tt,et,st,it,rt,I;class bt{constructor(t,e){n(this,o);n(this,S);n(this,M);n(this,E);n(this,g,null);n(this,d,null);n(this,q,!1);n(this,U,null);n(this,P);n(this,v,[]);n(this,b,[]);h(this,S,t),h(this,M,e),h(this,E,new URLPattern({pathname:s(this,S)})),h(this,P,new MutationObserver(u(this,o,it).bind(this)))}get pattern(){return s(this,S)}get isActive(){return s(this,q)}get element(){return s(this,d)}get nest(){return s(this,U)}testPathname(t){return s(this,E).test({pathname:t})}render(t,e){return p(this,null,function*(){s(this,P).observe(document.head,{childList:!0,subtree:!0}),s(this,g)?u(this,o,X).call(this):yield u(this,o,Q).call(this),yield u(this,o,rt).call(this),s(this,g)&&(yield u(this,o,Z).call(this,t,e)),s(this,P).disconnect()})}close(){u(this,o,et).call(this)}}S=new WeakMap,M=new WeakMap,E=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakMap,U=new WeakMap,P=new WeakMap,v=new WeakMap,b=new WeakMap,o=new WeakSet,Q=function(){return p(this,null,function*(){const t=yield s(this,M).call(this);h(this,b,[...s(this,v)]),typeof t.default=="function"&&h(this,g,t.default)})},X=function(){s(this,v).forEach(t=>{document.head.appendChild(t.cloneNode(!0))})},Z=function(t,e){return p(this,null,function*(){const a={urlPatternResult:s(this,E).exec({pathname:e.pathname})};vt.isESClass(s(this,g))?(h(this,d,new(s(this,g))(a)),t.appendChild(s(this,d))):h(this,d,Pt.render(t,s(this,g),a)),u(this,o,tt).call(this),h(this,q,!0)})},tt=function(){var t;s(this,d)&&h(this,U,s(this,d).querySelector("[data-nest]")||((t=s(this,d).shadowRoot)==null?void 0:t.querySelector("[data-nest]"))||s(this,d).shadowRoot||s(this,d))},et=function(){var t;s(this,P).disconnect(),(t=s(this,d))==null||t.remove(),h(this,q,!1),u(this,o,st).call(this)},st=function(){s(this,b).forEach(t=>{t.parentNode===document.head&&document.head.removeChild(t)}),h(this,b,[])},it=function(t){t.forEach(e=>{e.addedNodes.forEach(r=>{s(this,g)?s(this,b).push(r):s(this,v).push(r)})})},rt=function(){return p(this,null,function*(){const t=s(this,v).filter(u(this,o,I));yield Promise.all(t.map(e=>new Promise(r=>{u(this,o,I).call(this,e)?e.onload=()=>r():r()})))})},I=function(t){return t instanceof HTMLElement&&(t.tagName==="STYLE"||t.tagName==="SCRIPT"||t.tagName==="LINK")};globalThis.URLPattern=Rt.URLPattern;var l,y,T,N,k,A,R,C,f,at,nt,ht,z,ot;class yt{constructor(t){n(this,f);n(this,l,null);n(this,y,null);n(this,T,null);n(this,N,null);n(this,k,null);n(this,A,0);n(this,R,[]);n(this,C,null);h(this,l,$(_({},t),{rootElement:(t==null?void 0:t.rootElement)||document.body,base:J.normalizeBase(t==null?void 0:t.base)})),h(this,k,new wt.PageAnnouncerElement),h(this,y,new pt.PageScroll(s(this,l).scrollSelector)),s(this,y).update(),h(this,T,new gt.LocalLinks({base:s(this,l).base,trailingSlash:s(this,l).trailingSlash,includeAnchor:t==null?void 0:t.includeAnchor,onClick:(e,r)=>{try{this.navigate(e,r)}catch(a){window.location.assign(e)}}})),s(this,T).update(),h(this,N,new mt.History({onPop:e=>{this.navigate(e)}}))}history(){return s(this,N)}get scroll(){return scroll}get routes(){return s(this,R)}run(){u(this,f,ot).call(this),this.navigate(new URL(location.href),{revalidate:!0})}defineRoute(t,e){const r=new bt(t,e);s(this,R).push(r)}navigate(t,e){return p(this,null,function*(){var O,j,x,V,D,F;const r=s(this,N).isBack,a=++G(this,A)._;let c=J.normalizeURL(t,{base:s(this,l).base,trailingSlash:s(this,l).trailingSlash});if(s(this,l).urlModifier&&(c=s(this,l).urlModifier(c)),!(yield u(this,f,at).call(this,c))||s(this,A)!==a||(yield(j=(O=s(this,l)).beforeNavigation)==null?void 0:j.call(O),s(this,A)!==a))return;const{activeRoutes:H,newRoutes:w,oldRoutes:m,keepRoutes:L}=u(this,f,nt).call(this,c);h(this,C,(x=L[L.length-1])!=null?x:null),r||(s(this,N).push(c),((V=e==null?void 0:e.keepScrollPosition)==null||V)&&s(this,y).element.scrollTo({top:0,behavior:"instant"})),s(this,k).create(document,c.pathname),s(this,l).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>u(this,f,z).call(this,m,w,c)).finished:yield u(this,f,z).call(this,m,w,c),s(this,y).update(),s(this,T).update(),s(this,k).done(),yield(F=(D=s(this,l)).afterNavigation)==null?void 0:F.call(D)})}}l=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap,k=new WeakMap,A=new WeakMap,R=new WeakMap,C=new WeakMap,f=new WeakSet,at=function(t){return p(this,null,function*(){if(!s(this,l).preprocessor)return!0;try{return yield new Promise((e,r)=>{var a,c;(c=(a=s(this,l)).preprocessor)==null||c.call(a,{url:t,resolve:e,reject:r})}),!0}catch(e){return console.error(e!=null?e:"Route change canceled"),!1}})},nt=function(t){let e=t.pathname.replace(s(this,l).base,"");e.startsWith("/")||(e=`/${e}`);const r=s(this,R).filter(a=>a.isActive);return{activeRoutes:r,newRoutes:s(this,R).filter(a=>!r.includes(a)&&a.testPathname(e)),oldRoutes:r.filter(a=>!a.testPathname(e)),keepRoutes:r.filter(a=>a.testPathname(e))}},ht=function(t){t.forEach(e=>e.close())},z=function(t,e,r){return p(this,null,function*(){var a,c;u(this,f,ht).call(this,t);for(const H of e){const w=(c=(a=s(this,C))==null?void 0:a.nest)!=null?c:s(this,l).rootElement;yield H.render(w,r),h(this,C,H)}})},ot=function(){s(this,R).sort((t,e)=>{const r=t.pattern.split("/").length,a=e.pattern.split("/").length;return r-a})};exports.Router=yt;
@@ -47,7 +47,7 @@ import "construct-style-sheets-polyfill";
47
47
  import "../index-LReFyN6i.js";
48
48
  import { a as gt, n as Rt } from "../url-DAl-mgbC.js";
49
49
  import { URLPattern as Pt } from "urlpattern-polyfill";
50
- import { r as vt } from "../render-CiA0mn5V.js";
50
+ import { r as vt } from "../render-B3Hf-O7M.js";
51
51
  import { i as bt } from "../object-CcMK4y_r.js";
52
52
  var E, M, S, p, d, T, B, P, v, b, o, Q, X, Z, _, tt, et, st, it, z;
53
53
  class Nt {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.82.3",
3
+ "version": "0.82.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -454,18 +454,17 @@
454
454
  "tsx": "^4.20.3",
455
455
  "vite": "^7.0.6",
456
456
  "vite-plugin-dts": "^4.5.4",
457
- "vite-plugin-htmc": "0.1.16"
457
+ "vite-plugin-htmc": "0.1.16",
458
+ "prettier-plugin-organize-imports": "^4.2.0",
459
+ "csstype": "^3.1.3"
458
460
  },
459
461
  "dependencies": {
460
462
  "construct-style-sheets-polyfill": "^3.1.0",
461
- "csstype": "^3.1.3",
462
- "prettier-plugin-organize-imports": "^4.2.0",
463
463
  "three": "^0.179.1",
464
464
  "urlpattern-polyfill": "^10.1.0"
465
465
  },
466
466
  "peerDependencies": {
467
467
  "construct-style-sheets-polyfill": "^3.1.0",
468
- "prettier-plugin-organize-imports": "^4.2.0",
469
468
  "three": "^0.179.1",
470
469
  "urlpattern-polyfill": "^10.1.0"
471
470
  }
@@ -1,205 +0,0 @@
1
- var O = Object.defineProperty, q = Object.defineProperties;
2
- var B = Object.getOwnPropertyDescriptors;
3
- var S = Object.getOwnPropertySymbols;
4
- var K = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
5
- var L = (r) => {
6
- throw TypeError(r);
7
- };
8
- var w = (r, s, t) => s in r ? O(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t, E = (r, s) => {
9
- for (var t in s || (s = {}))
10
- K.call(s, t) && w(r, t, s[t]);
11
- if (S)
12
- for (var t of S(s))
13
- P.call(s, t) && w(r, t, s[t]);
14
- return r;
15
- }, N = (r, s) => q(r, B(s));
16
- var _ = (r, s, t) => s.has(r) || L("Cannot " + t);
17
- var p = (r, s, t) => (_(r, s, "read from private field"), t ? t.call(r) : s.get(r)), m = (r, s, t) => s.has(r) ? L("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), C = (r, s, t, o) => (_(r, s, "write to private field"), o ? o.call(r, t) : s.set(r, t), t);
18
- import { S as l } from "./Store-CgQ3ReoB.js";
19
- import { c as R } from "./string-BlMQbe8b.js";
20
- import "construct-style-sheets-polyfill";
21
- import "./index-LReFyN6i.js";
22
- import { connector as H } from "./connector/index.js";
23
- import { a as M } from "./DerivedArray-DG9iR0mf.js";
24
- const $ = { current: null };
25
- var b, u;
26
- class z extends HTMLElement {
27
- constructor() {
28
- super();
29
- m(this, b, []);
30
- m(this, u, []);
31
- $.current = this;
32
- }
33
- addConnectCallback(t) {
34
- p(this, b).push(t);
35
- }
36
- addDisconnectCallback(t) {
37
- p(this, u).push(t);
38
- }
39
- connectedCallback() {
40
- p(this, b).forEach((t) => {
41
- const o = t(this);
42
- o && p(this, u).push(o);
43
- });
44
- }
45
- disconnectedCallback() {
46
- p(this, u).forEach((t) => {
47
- t(this);
48
- }), C(this, b, []), C(this, u, []);
49
- }
50
- }
51
- b = new WeakMap(), u = new WeakMap();
52
- function y(r, s, t) {
53
- const o = s.subscribe((f) => {
54
- t(f);
55
- });
56
- H.subscribe(r, {
57
- disconnectCallback: () => {
58
- o();
59
- },
60
- maxWaitSec: 20,
61
- unsubscribeAfterDisconnect: !0
62
- });
63
- }
64
- function F(r, s) {
65
- s && (s instanceof l ? y(r, s, (t) => {
66
- t.previous && r.classList.remove(t.previous.toString()), t.current && r.classList.add(t.current.toString());
67
- }) : typeof s == "object" && !Array.isArray(s) ? Object.entries(s).forEach(([t, o]) => {
68
- o instanceof l ? y(r, o, (f) => {
69
- r.classList.toggle(t, !!f.current);
70
- }) : o && r.classList.add(t);
71
- }) : Array.isArray(s) ? s.forEach((t) => {
72
- typeof t == "string" ? r.classList.add(t) : F(r, t);
73
- }) : s.toString().split(" ").map((t) => r.classList.add(t.trim())));
74
- }
75
- function J(r, s) {
76
- s && (typeof s == "object" ? Object.entries(s).forEach(([t, o]) => {
77
- o instanceof l ? y(r, o, (f) => {
78
- var e;
79
- r.style[t] = (e = f.current) == null ? void 0 : e.toString();
80
- }) : (typeof o == "number" || typeof o == "string" || typeof o == "boolean") && (r.style[t] = o.toString());
81
- }) : typeof s == "string" && (r.style = s));
82
- }
83
- function A(r, s, t) {
84
- s === "ref" && t ? Array.isArray(t) ? t.forEach((o) => {
85
- typeof o == "object" && "value" in o && (o.value = r);
86
- }) : typeof t == "object" && "value" in t && (t.value = r) : s === "className" || s === "class" ? F(r, t) : s === "style" ? J(r, t) : typeof t == "number" ? s === "tabIndex" ? r.setAttribute("tabindex", t.toString()) : A(r, s, t.toString()) : typeof t == "string" ? s === "htmlFor" ? r.setAttribute("for", t) : r.setAttribute(s, t) : typeof t == "boolean" ? t ? r.setAttribute(s, "") : r.removeAttribute(s) : t instanceof l && y(r, t, (o) => {
87
- s in r ? r[s] = o.current : A(r, s, o.current);
88
- });
89
- }
90
- function Q(r, s) {
91
- for (const [t, o] of Object.entries(s != null ? s : {}))
92
- typeof o == "function" && t.startsWith("on") ? r.addEventListener(
93
- t.replace("on", "").toLowerCase(),
94
- o
95
- ) : A(r, t, o);
96
- }
97
- function W(r) {
98
- const s = [];
99
- return r.forEach((t) => {
100
- t != null && (typeof t == "number" ? s.push(t.toString()) : Array.isArray(t) ? t.forEach((o) => {
101
- s.push(...W(o));
102
- }) : s.push(t));
103
- }), s;
104
- }
105
- function U(r, s) {
106
- const t = [...r.childNodes].filter((n) => n.__storeId === s.id), o = s.current, f = Array.isArray(o) ? o : [o], e = [];
107
- if (f.forEach((n) => {
108
- let i = null;
109
- typeof n == "boolean" || typeof n == "number" || typeof n == "string" ? i = document.createTextNode(n.toString()) : n instanceof Node && (i = n), i && (i.__storeId = s.id, e.push(i));
110
- }), s instanceof M) {
111
- const n = [];
112
- e.forEach((i, c) => {
113
- const a = t.find(
114
- (h) => h.__key === i.__key
115
- );
116
- a ? a.isEqualNode(i) ? n.push(a) : (a.replaceWith(i), n.push(i)) : (n.push(i), r.appendChild(i));
117
- }), t.forEach((i) => {
118
- n.includes(i) || i.remove();
119
- });
120
- } else
121
- e.forEach((n, i) => {
122
- var a;
123
- const c = t[i];
124
- if (c)
125
- c.isEqualNode(n) || (c.replaceWith(n), t[i] = n);
126
- else {
127
- const h = t[t.length - 1];
128
- h ? (a = h.parentNode) == null || a.insertBefore(
129
- n,
130
- h.nextSibling
131
- ) : r.appendChild(n);
132
- }
133
- }), t.slice(e.length).forEach((n) => {
134
- n.remove();
135
- });
136
- }
137
- class g {
138
- constructor(s, t, o) {
139
- this.tag = s, this.attributes = t, this.children = o;
140
- }
141
- }
142
- class I {
143
- constructor(s, t, o) {
144
- this.tag = s, this.attributes = t, this.children = o;
145
- }
146
- }
147
- function d(r, s, t, o = !1) {
148
- const f = W(t);
149
- Q(r, s), f.forEach((e) => {
150
- if (e instanceof l)
151
- y(r, e, () => {
152
- U(r, e);
153
- });
154
- else if (e instanceof g)
155
- e.tag === "shadow" && r.shadowRoot ? d(
156
- r.shadowRoot,
157
- e.attributes,
158
- e.children
159
- ) : d(r, e.attributes, e.children);
160
- else if (e instanceof I) {
161
- let n = null;
162
- e.tag === "svg" ? (n = document.createElementNS(
163
- "http://www.w3.org/2000/svg",
164
- "svg"
165
- ), d(n, e.attributes, e.children, !0)) : n = o ? document.createElementNS("http://www.w3.org/2000/svg", e.tag) : document.createElement(e.tag), d(n, e.attributes, e.children, o), r.append(n);
166
- } else
167
- r.append(e);
168
- });
169
- }
170
- function X(r, s, ...t) {
171
- var o;
172
- if (typeof r == "string")
173
- return r === "component" ? new g(r, s, t) : r === "shadow" ? new g(r, s, t) : new I(r, s, t);
174
- {
175
- if (r === D)
176
- return D(t);
177
- if (r.template)
178
- return r(E({}, s));
179
- const f = `e-${R(r.name)}`;
180
- let e = customElements.get(f);
181
- e || (e = (o = class extends z {
182
- constructor() {
183
- super();
184
- }
185
- }, o.formAssociated = r.formAssociated, o), customElements.define(f, e));
186
- const n = new e(), i = N(E({}, s), {
187
- children: t
188
- }), c = r(i);
189
- return c instanceof g && (c != null && c.children || c.attributes) && d(n, c.attributes, c.children), n;
190
- }
191
- }
192
- function D(r) {
193
- const s = document.createDocumentFragment();
194
- return d(s, void 0, r), s;
195
- }
196
- function T(r, s, t) {
197
- const o = /* @__PURE__ */ X(s, E({}, t));
198
- return r.append(o), o;
199
- }
200
- export {
201
- D as F,
202
- $ as a,
203
- X as h,
204
- T as r
205
- };
@@ -1 +0,0 @@
1
- "use strict";var B=Object.defineProperty,K=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var _=r=>{throw TypeError(r)};var L=(r,e,t)=>e in r?B(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,y=(r,e)=>{for(var t in e||(e={}))R.call(e,t)&&L(r,t,e[t]);if(w)for(var t of w(e))H.call(e,t)&&L(r,t,e[t]);return r},q=(r,e)=>K(r,P(e));var N=(r,e,t)=>e.has(r)||_("Cannot "+t);var p=(r,e,t)=>(N(r,e,"read from private field"),t?t.call(r):e.get(r)),S=(r,e,t)=>e.has(r)?_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),C=(r,e,t,s)=>(N(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t);const l=require("./Store-1JrMCgdX.cjs"),M=require("./string-DUXXtU8v.cjs");require("construct-style-sheets-polyfill");require("./index-CKTweR3M.cjs");const $=require("./connector/index.cjs"),z=require("./DerivedArray-B8A0-8uT.cjs"),D={current:null};var b,u;class J extends HTMLElement{constructor(){super();S(this,b,[]);S(this,u,[]);D.current=this}addConnectCallback(t){p(this,b).push(t)}addDisconnectCallback(t){p(this,u).push(t)}connectedCallback(){p(this,b).forEach(t=>{const s=t(this);s&&p(this,u).push(s)})}disconnectedCallback(){p(this,u).forEach(t=>{t(this)}),C(this,b,[]),C(this,u,[])}}b=new WeakMap,u=new WeakMap;function g(r,e,t){const s=e.subscribe(c=>{t(c)});$.connector.subscribe(r,{disconnectCallback:()=>{s()},maxWaitSec:20,unsubscribeAfterDisconnect:!0})}function F(r,e){e&&(e instanceof l.Store?g(r,e,t=>{t.previous&&r.classList.remove(t.previous.toString()),t.current&&r.classList.add(t.current.toString())}):typeof e=="object"&&!Array.isArray(e)?Object.entries(e).forEach(([t,s])=>{s instanceof l.Store?g(r,s,c=>{r.classList.toggle(t,!!c.current)}):s&&r.classList.add(t)}):Array.isArray(e)?e.forEach(t=>{typeof t=="string"?r.classList.add(t):F(r,t)}):e.toString().split(" ").map(t=>r.classList.add(t.trim())))}function Q(r,e){e&&(typeof e=="object"?Object.entries(e).forEach(([t,s])=>{s instanceof l.Store?g(r,s,c=>{var o;r.style[t]=(o=c.current)==null?void 0:o.toString()}):(typeof s=="number"||typeof s=="string"||typeof s=="boolean")&&(r.style[t]=s.toString())}):typeof e=="string"&&(r.style=e))}function A(r,e,t){e==="ref"&&t?Array.isArray(t)?t.forEach(s=>{typeof s=="object"&&"value"in s&&(s.value=r)}):typeof t=="object"&&"value"in t&&(t.value=r):e==="className"||e==="class"?F(r,t):e==="style"?Q(r,t):typeof t=="number"?e==="tabIndex"?r.setAttribute("tabindex",t.toString()):A(r,e,t.toString()):typeof t=="string"?e==="htmlFor"?r.setAttribute("for",t):r.setAttribute(e,t):typeof t=="boolean"?t?r.setAttribute(e,""):r.removeAttribute(e):t instanceof l.Store&&g(r,t,s=>{e in r?r[e]=s.current:A(r,e,s.current)})}function U(r,e){for(const[t,s]of Object.entries(e!=null?e:{}))typeof s=="function"&&t.startsWith("on")?r.addEventListener(t.replace("on","").toLowerCase(),s):A(r,t,s)}function W(r){const e=[];return r.forEach(t=>{t!=null&&(typeof t=="number"?e.push(t.toString()):Array.isArray(t)?t.forEach(s=>{e.push(...W(s))}):e.push(t))}),e}function X(r,e){const t=[...r.childNodes].filter(n=>n.__storeId===e.id),s=e.current,c=Array.isArray(s)?s:[s],o=[];if(c.forEach(n=>{let i=null;typeof n=="boolean"||typeof n=="number"||typeof n=="string"?i=document.createTextNode(n.toString()):n instanceof Node&&(i=n),i&&(i.__storeId=e.id,o.push(i))}),e instanceof z.DerivedKeyedArray){const n=[];o.forEach((i,f)=>{const a=t.find(h=>h.__key===i.__key);a?a.isEqualNode(i)?n.push(a):(a.replaceWith(i),n.push(i)):(n.push(i),r.appendChild(i))}),t.forEach(i=>{n.includes(i)||i.remove()})}else o.forEach((n,i)=>{var a;const f=t[i];if(f)f.isEqualNode(n)||(f.replaceWith(n),t[i]=n);else{const h=t[t.length-1];h?(a=h.parentNode)==null||a.insertBefore(n,h.nextSibling):r.appendChild(n)}}),t.slice(o.length).forEach(n=>{n.remove()})}class E{constructor(e,t,s){this.tag=e,this.attributes=t,this.children=s}}class I{constructor(e,t,s){this.tag=e,this.attributes=t,this.children=s}}function d(r,e,t,s=!1){const c=W(t);U(r,e),c.forEach(o=>{if(o instanceof l.Store)g(r,o,()=>{X(r,o)});else if(o instanceof E)o.tag==="shadow"&&r.shadowRoot?d(r.shadowRoot,o.attributes,o.children):d(r,o.attributes,o.children);else if(o instanceof I){let n=null;o.tag==="svg"?(n=document.createElementNS("http://www.w3.org/2000/svg","svg"),d(n,o.attributes,o.children,!0)):n=s?document.createElementNS("http://www.w3.org/2000/svg",o.tag):document.createElement(o.tag),d(n,o.attributes,o.children,s),r.append(n)}else r.append(o)})}function O(r,e,...t){var s;if(typeof r=="string")return r==="component"?new E(r,e,t):r==="shadow"?new E(r,e,t):new I(r,e,t);{if(r===m)return m(t);if(r.template)return r(y({},e));const c=`e-${M.camelToKebab(r.name)}`;let o=customElements.get(c);o||(o=(s=class extends J{constructor(){super()}},s.formAssociated=r.formAssociated,s),customElements.define(c,o));const n=new o,i=q(y({},e),{children:t}),f=r(i);return f instanceof E&&(f!=null&&f.children||f.attributes)&&d(n,f.attributes,f.children),n}}function m(r){const e=document.createDocumentFragment();return d(e,void 0,r),e}function Y(r,e,t){const s=O(e,y({},t));return r.append(s),s}exports.Fragment=m;exports.activeComponent=D;exports.h=O;exports.render=Y;