aptechka 0.82.2 → 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 {
@@ -1 +1 @@
1
- "use strict";var O=n=>{throw TypeError(n)};var C=(n,e,s)=>e.has(n)||O("Cannot "+s);var t=(n,e,s)=>(C(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?O("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),o=(n,e,s,p)=>(C(n,e,"write to private field"),p?p.call(n,s):e.set(n,s),s),m=(n,e,s)=>(C(n,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../media/index.cjs"),q=require("../index-CKTweR3M.cjs");require("construct-style-sheets-polyfill");var y,d;class F{constructor(e){r(this,y);r(this,d);o(this,y,e.index),o(this,d,document.createElement("span")),t(this,d).classList.add("letter"),e.clone?t(this,d).innerHTML=`<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>`:t(this,d).innerHTML=`<span class="original"><span class="value">${e.text}</span></span>`}get index(){return t(this,y)}get element(){return t(this,d)}}y=new WeakMap,d=new WeakMap;var L,h,g,E;class S{constructor(e){r(this,L);r(this,h);r(this,g);r(this,E);if(o(this,L,e.index),o(this,h,document.createElement("span")),o(this,g,[]),o(this,E,e.text.endsWith("\\n")),t(this,E)&&(e.text=e.text.replace("\\n","")),e.letters&&e.lettersAcc!==void 0){let s=0;const p=e.text.split("").map(c=>{if(c!==" ")return new F({index:e.lettersAcc+s++,text:c,clone:e.clone})});o(this,g,p.filter(c=>c instanceof F)),t(this,h).append(...t(this,g).map(c=>c.element))}else e.clone?t(this,h).innerHTML=`<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>`:t(this,h).innerHTML=`<span class="original"><span class="value">${e.text}</span></span>`;t(this,h).classList.add("word")}get index(){return t(this,L)}get element(){return t(this,h)}get letters(){return t(this,g)}get hasNewLine(){return t(this,E)}}L=new WeakMap,h=new WeakMap,g=new WeakMap,E=new WeakMap;var N,a,x,T,u,H,D;class P extends HTMLElement{constructor(){super(...arguments);r(this,u);r(this,N,"");r(this,a,[]);r(this,x,[]);r(this,T,null)}get wordsArray(){return t(this,a)}get lettersArray(){return t(this,x)}get originalHTML(){return t(this,N)}connectedCallback(){this.classList.contains("splitted")||(o(this,N,this.innerHTML.trim()),this.hasAttribute("media")?(o(this,T,new k.Media(this.getAttribute("media"))),t(this,T).subscribe(s=>{s.current?m(this,u,H).call(this):!s.current&&s.previous&&m(this,u,D).call(this)})):m(this,u,H).call(this),this.classList.add("splitted"))}disconnectedCallback(){var s;m(this,u,D).call(this),(s=t(this,T))==null||s.close()}}N=new WeakMap,a=new WeakMap,x=new WeakMap,T=new WeakMap,u=new WeakSet,H=function(){const s=[];o(this,a,[]);let p=0,c=0;const $=i=>{var f;const l=(f=i.textContent)==null?void 0:f.trim();if(!l)return document.createDocumentFragment();const A=document.createDocumentFragment();return l.replace(/[\s\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g," ").split(" ").forEach((M,b,v)=>{if(!M)return;const w=new S({index:p,text:M+(b<v.length-1?" ":""),letters:this.hasAttribute("letters"),lettersAcc:c,clone:this.hasAttribute("clone")});c+=w.letters.length,p+=1,t(this,x).push(...w.letters),t(this,a).push(w),A.appendChild(w.element)}),A},_=i=>{if(i.nodeType===Node.TEXT_NODE)return $(i);if(i.nodeType===Node.ELEMENT_NODE){const l=i.cloneNode(!1);return Array.from(i.childNodes).forEach(A=>{const f=_(A);f&&(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(f.childNodes).forEach((M,b,v)=>{l.append(M),b!==v.length-1&&l.append(new Text(" "))}):l.appendChild(f))}),l}return i.cloneNode()};Array.from(this.childNodes).forEach(i=>{const l=_(i);l.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.push(...Array.from(l.childNodes)):s.push(l)}),this.hasAttribute("index")&&(t(this,a).forEach(i=>{i.element.style.setProperty("--word-index",i.index.toString())}),t(this,x).forEach(i=>{i.element.style.setProperty("--letter-index",i.index.toString())})),this.innerHTML="",s.forEach((i,l)=>{this.appendChild(i),l<s.length-1&&i.nodeType===Node.ELEMENT_NODE&&this.appendChild(new Text(" "))}),this.style.setProperty("--words-length",t(this,a).length.toString()),this.style.setProperty("--letters-length",t(this,x).length.toString())},D=function(){o(this,a,[]),this.innerHTML=t(this,N),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")};q.isBrowser&&!customElements.get("e-slicer")&&customElements.define("e-slicer",P);exports.Letter=F;exports.SlicerElement=P;exports.Word=S;
1
+ "use strict";var P=i=>{throw TypeError(i)};var H=(i,e,s)=>e.has(i)||P("Cannot "+s);var t=(i,e,s)=>(H(i,e,"read from private field"),s?s.call(i):e.get(i)),c=(i,e,s)=>e.has(i)?P("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),o=(i,e,s,g)=>(H(i,e,"write to private field"),g?g.call(i,s):e.set(i,s),s),L=(i,e,s)=>(H(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../media/index.cjs"),q=require("../index-CKTweR3M.cjs");require("construct-style-sheets-polyfill");var A,u;class D{constructor(e){c(this,A);c(this,u);o(this,A,e.index),o(this,u,document.createElement("span")),t(this,u).classList.add("letter"),e.clone?t(this,u).innerHTML=`<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>`:t(this,u).innerHTML=`<span class="original"><span class="value">${e.text}</span></span>`}get index(){return t(this,A)}get element(){return t(this,u)}}A=new WeakMap,u=new WeakMap;var M,h,p,x;class S{constructor(e){c(this,M);c(this,h);c(this,p);c(this,x);if(o(this,M,e.index),o(this,h,document.createElement("span")),o(this,p,[]),o(this,x,e.text.endsWith("\\n")),t(this,x)&&(e.text=e.text.replace("\\n","")),e.letters&&e.lettersAcc!==void 0){let s=0;const g=/([\s\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u3000\uFEFF\-–—])/,T=e.text.split(g).filter(y=>y.trim()!=="");T.length>1&&t(this,h).classList.add("words-inside"),T.forEach((y,w,n)=>{const l=y.split("").map(r=>{if(r!==" ")return new D({index:e.lettersAcc+s++,text:r,clone:e.clone})});if(o(this,p,l.filter(r=>r instanceof D)),n.length>1){const r=document.createElement("span");r.append(...t(this,p).map(a=>a.element)),t(this,h).append(r),w!==n.length-1&&t(this,h).append(r)}else t(this,h).append(...t(this,p).map(r=>r.element))})}else e.clone?t(this,h).innerHTML=`<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>`:t(this,h).innerHTML=`<span class="original"><span class="value">${e.text}</span></span>`;t(this,h).classList.add("word")}get index(){return t(this,M)}get element(){return t(this,h)}get letters(){return t(this,p)}get hasNewLine(){return t(this,x)}}M=new WeakMap,h=new WeakMap,p=new WeakMap,x=new WeakMap;var m,d,E,N,f,_,O;class $ extends HTMLElement{constructor(){super(...arguments);c(this,f);c(this,m,"");c(this,d,[]);c(this,E,[]);c(this,N,null)}get wordsArray(){return t(this,d)}get lettersArray(){return t(this,E)}get originalHTML(){return t(this,m)}connectedCallback(){this.classList.contains("splitted")||(o(this,m,this.innerHTML.trim()),this.hasAttribute("media")?(o(this,N,new k.Media(this.getAttribute("media"))),t(this,N).subscribe(s=>{s.current?L(this,f,_).call(this):!s.current&&s.previous&&L(this,f,O).call(this)})):L(this,f,_).call(this),this.classList.add("splitted"))}disconnectedCallback(){var s;L(this,f,O).call(this),(s=t(this,N))==null||s.close()}}m=new WeakMap,d=new WeakMap,E=new WeakMap,N=new WeakMap,f=new WeakSet,_=function(){const s=[];o(this,d,[]);let g=0,T=0;const y=n=>{var a;const l=(a=n.textContent)==null?void 0:a.trim();if(!l)return document.createDocumentFragment();const r=document.createDocumentFragment();return l.replace(/[\s\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g," ").split(" ").forEach((F,v,C)=>{if(!F)return;const b=new S({index:g,text:F+(v<C.length-1?" ":""),letters:this.hasAttribute("letters"),lettersAcc:T,clone:this.hasAttribute("clone")});T+=b.letters.length,g+=1,t(this,E).push(...b.letters),t(this,d).push(b),r.appendChild(b.element)}),r},w=n=>{if(n.nodeType===Node.TEXT_NODE)return y(n);if(n.nodeType===Node.ELEMENT_NODE){const l=n.cloneNode(!1);return Array.from(n.childNodes).forEach(r=>{const a=w(r);a&&(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(a.childNodes).forEach((F,v,C)=>{l.append(F),v!==C.length-1&&l.append(new Text(" "))}):l.appendChild(a))}),l}return n.cloneNode()};Array.from(this.childNodes).forEach(n=>{const l=w(n);l.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.push(...Array.from(l.childNodes)):s.push(l)}),this.hasAttribute("index")&&(t(this,d).forEach(n=>{n.element.style.setProperty("--word-index",n.index.toString())}),t(this,E).forEach(n=>{n.element.style.setProperty("--letter-index",n.index.toString())})),this.innerHTML="",s.forEach((n,l)=>{this.appendChild(n),l<s.length-1&&n.nodeType===Node.ELEMENT_NODE&&this.appendChild(new Text(" "))}),this.style.setProperty("--words-length",t(this,d).length.toString()),this.style.setProperty("--letters-length",t(this,E).length.toString())},O=function(){o(this,d,[]),this.innerHTML=t(this,m),this.style.removeProperty("--words-length"),this.style.removeProperty("--letters-length")};q.isBrowser&&!customElements.get("e-slicer")&&customElements.define("e-slicer",$);exports.Letter=D;exports.SlicerElement=$;exports.Word=S;
@@ -1,145 +1,154 @@
1
- var O = (n) => {
2
- throw TypeError(n);
1
+ var P = (i) => {
2
+ throw TypeError(i);
3
3
  };
4
- var F = (n, e, s) => e.has(n) || O("Cannot " + s);
5
- var t = (n, e, s) => (F(n, e, "read from private field"), s ? s.call(n) : e.get(n)), r = (n, e, s) => e.has(n) ? O("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, s), o = (n, e, s, p) => (F(n, e, "write to private field"), p ? p.call(n, s) : e.set(n, s), s), T = (n, e, s) => (F(n, e, "access private method"), s);
4
+ var b = (i, e, s) => e.has(i) || P("Cannot " + s);
5
+ var t = (i, e, s) => (b(i, e, "read from private field"), s ? s.call(i) : e.get(i)), h = (i, e, s) => e.has(i) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, s), o = (i, e, s, g) => (b(i, e, "write to private field"), g ? g.call(i, s) : e.set(i, s), s), L = (i, e, s) => (b(i, e, "access private method"), s);
6
6
  import { Media as $ } from "../media/index.js";
7
7
  import { i as S } from "../index-LReFyN6i.js";
8
8
  import "construct-style-sheets-polyfill";
9
- var y, d;
9
+ var A, u;
10
10
  class _ {
11
11
  constructor(e) {
12
- r(this, y);
13
- r(this, d);
14
- o(this, y, e.index), o(this, d, document.createElement("span")), t(this, d).classList.add("letter"), e.clone ? t(this, d).innerHTML = `<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>` : t(this, d).innerHTML = `<span class="original"><span class="value">${e.text}</span></span>`;
12
+ h(this, A);
13
+ h(this, u);
14
+ o(this, A, e.index), o(this, u, document.createElement("span")), t(this, u).classList.add("letter"), e.clone ? t(this, u).innerHTML = `<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>` : t(this, u).innerHTML = `<span class="original"><span class="value">${e.text}</span></span>`;
15
15
  }
16
16
  get index() {
17
- return t(this, y);
17
+ return t(this, A);
18
18
  }
19
19
  get element() {
20
- return t(this, d);
20
+ return t(this, u);
21
21
  }
22
22
  }
23
- y = new WeakMap(), d = new WeakMap();
24
- var L, c, g, E;
23
+ A = new WeakMap(), u = new WeakMap();
24
+ var M, c, p, m;
25
25
  class k {
26
26
  constructor(e) {
27
- r(this, L);
28
- r(this, c);
29
- r(this, g);
30
- r(this, E);
31
- if (o(this, L, e.index), o(this, c, document.createElement("span")), o(this, g, []), o(this, E, e.text.endsWith("\\n")), t(this, E) && (e.text = e.text.replace("\\n", "")), e.letters && e.lettersAcc !== void 0) {
27
+ h(this, M);
28
+ h(this, c);
29
+ h(this, p);
30
+ h(this, m);
31
+ if (o(this, M, e.index), o(this, c, document.createElement("span")), o(this, p, []), o(this, m, e.text.endsWith("\\n")), t(this, m) && (e.text = e.text.replace("\\n", "")), e.letters && e.lettersAcc !== void 0) {
32
32
  let s = 0;
33
- const p = e.text.split("").map((h) => {
34
- if (h !== " ")
35
- return new _({
36
- index: e.lettersAcc + s++,
37
- text: h,
38
- clone: e.clone
39
- });
33
+ const g = /([\s\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u3000\uFEFF\-–—])/, T = e.text.split(g).filter((y) => y.trim() !== "");
34
+ T.length > 1 && t(this, c).classList.add("words-inside"), T.forEach((y, w, n) => {
35
+ const l = y.split("").map((r) => {
36
+ if (r !== " ")
37
+ return new _({
38
+ index: e.lettersAcc + s++,
39
+ text: r,
40
+ clone: e.clone
41
+ });
42
+ });
43
+ if (o(this, p, l.filter((r) => r instanceof _)), n.length > 1) {
44
+ const r = document.createElement("span");
45
+ r.append(
46
+ ...t(this, p).map((a) => a.element)
47
+ ), t(this, c).append(r), w !== n.length - 1 && t(this, c).append(r);
48
+ } else
49
+ t(this, c).append(
50
+ ...t(this, p).map((r) => r.element)
51
+ );
40
52
  });
41
- o(this, g, p.filter((h) => h instanceof _)), t(this, c).append(
42
- ...t(this, g).map((h) => h.element)
43
- );
44
53
  } else
45
54
  e.clone ? t(this, c).innerHTML = `<span class="original"><span class="value">${e.text}</span></span><span class="clone" aria-hidden><span class="value">${e.text}</span></span>` : t(this, c).innerHTML = `<span class="original"><span class="value">${e.text}</span></span>`;
46
55
  t(this, c).classList.add("word");
47
56
  }
48
57
  get index() {
49
- return t(this, L);
58
+ return t(this, M);
50
59
  }
51
60
  get element() {
52
61
  return t(this, c);
53
62
  }
54
63
  get letters() {
55
- return t(this, g);
64
+ return t(this, p);
56
65
  }
57
66
  get hasNewLine() {
58
- return t(this, E);
67
+ return t(this, m);
59
68
  }
60
69
  }
61
- L = new WeakMap(), c = new WeakMap(), g = new WeakMap(), E = new WeakMap();
62
- var m, a, x, N, u, H, b;
70
+ M = new WeakMap(), c = new WeakMap(), p = new WeakMap(), m = new WeakMap();
71
+ var x, d, E, N, f, D, O;
63
72
  class G extends HTMLElement {
64
73
  constructor() {
65
74
  super(...arguments);
66
- r(this, u);
67
- r(this, m, "");
68
- r(this, a, []);
69
- r(this, x, []);
70
- r(this, N, null);
75
+ h(this, f);
76
+ h(this, x, "");
77
+ h(this, d, []);
78
+ h(this, E, []);
79
+ h(this, N, null);
71
80
  }
72
81
  get wordsArray() {
73
- return t(this, a);
82
+ return t(this, d);
74
83
  }
75
84
  get lettersArray() {
76
- return t(this, x);
85
+ return t(this, E);
77
86
  }
78
87
  get originalHTML() {
79
- return t(this, m);
88
+ return t(this, x);
80
89
  }
81
90
  connectedCallback() {
82
- this.classList.contains("splitted") || (o(this, m, this.innerHTML.trim()), this.hasAttribute("media") ? (o(this, N, new $(this.getAttribute("media"))), t(this, N).subscribe((s) => {
83
- s.current ? T(this, u, H).call(this) : !s.current && s.previous && T(this, u, b).call(this);
84
- })) : T(this, u, H).call(this), this.classList.add("splitted"));
91
+ this.classList.contains("splitted") || (o(this, x, this.innerHTML.trim()), this.hasAttribute("media") ? (o(this, N, new $(this.getAttribute("media"))), t(this, N).subscribe((s) => {
92
+ s.current ? L(this, f, D).call(this) : !s.current && s.previous && L(this, f, O).call(this);
93
+ })) : L(this, f, D).call(this), this.classList.add("splitted"));
85
94
  }
86
95
  disconnectedCallback() {
87
96
  var s;
88
- T(this, u, b).call(this), (s = t(this, N)) == null || s.close();
97
+ L(this, f, O).call(this), (s = t(this, N)) == null || s.close();
89
98
  }
90
99
  }
91
- m = new WeakMap(), a = new WeakMap(), x = new WeakMap(), N = new WeakMap(), u = new WeakSet(), H = function() {
100
+ x = new WeakMap(), d = new WeakMap(), E = new WeakMap(), N = new WeakMap(), f = new WeakSet(), D = function() {
92
101
  const s = [];
93
- o(this, a, []);
94
- let p = 0, h = 0;
95
- const P = (i) => {
96
- var f;
97
- const l = (f = i.textContent) == null ? void 0 : f.trim();
102
+ o(this, d, []);
103
+ let g = 0, T = 0;
104
+ const y = (n) => {
105
+ var a;
106
+ const l = (a = n.textContent) == null ? void 0 : a.trim();
98
107
  if (!l) return document.createDocumentFragment();
99
- const A = document.createDocumentFragment();
108
+ const r = document.createDocumentFragment();
100
109
  return l.replace(
101
110
  /[\s\u00A0\u1680\u2000-\u200F\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g,
102
111
  " "
103
- ).split(" ").forEach((M, v, C) => {
104
- if (!M) return;
105
- const w = new k({
106
- index: p,
107
- text: M + (v < C.length - 1 ? " " : ""),
112
+ ).split(" ").forEach((F, C, H) => {
113
+ if (!F) return;
114
+ const v = new k({
115
+ index: g,
116
+ text: F + (C < H.length - 1 ? " " : ""),
108
117
  letters: this.hasAttribute("letters"),
109
- lettersAcc: h,
118
+ lettersAcc: T,
110
119
  clone: this.hasAttribute("clone")
111
120
  });
112
- h += w.letters.length, p += 1, t(this, x).push(...w.letters), t(this, a).push(w), A.appendChild(w.element);
113
- }), A;
114
- }, D = (i) => {
115
- if (i.nodeType === Node.TEXT_NODE)
116
- return P(i);
117
- if (i.nodeType === Node.ELEMENT_NODE) {
118
- const l = i.cloneNode(!1);
119
- return Array.from(i.childNodes).forEach((A) => {
120
- const f = D(A);
121
- f && (f.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? Array.from(f.childNodes).forEach((M, v, C) => {
122
- l.append(M), v !== C.length - 1 && l.append(new Text(" "));
123
- }) : l.appendChild(f));
121
+ T += v.letters.length, g += 1, t(this, E).push(...v.letters), t(this, d).push(v), r.appendChild(v.element);
122
+ }), r;
123
+ }, w = (n) => {
124
+ if (n.nodeType === Node.TEXT_NODE)
125
+ return y(n);
126
+ if (n.nodeType === Node.ELEMENT_NODE) {
127
+ const l = n.cloneNode(!1);
128
+ return Array.from(n.childNodes).forEach((r) => {
129
+ const a = w(r);
130
+ a && (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? Array.from(a.childNodes).forEach((F, C, H) => {
131
+ l.append(F), C !== H.length - 1 && l.append(new Text(" "));
132
+ }) : l.appendChild(a));
124
133
  }), l;
125
134
  }
126
- return i.cloneNode();
135
+ return n.cloneNode();
127
136
  };
128
- Array.from(this.childNodes).forEach((i) => {
129
- const l = D(i);
137
+ Array.from(this.childNodes).forEach((n) => {
138
+ const l = w(n);
130
139
  l.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? s.push(...Array.from(l.childNodes)) : s.push(l);
131
- }), this.hasAttribute("index") && (t(this, a).forEach((i) => {
132
- i.element.style.setProperty("--word-index", i.index.toString());
133
- }), t(this, x).forEach((i) => {
134
- i.element.style.setProperty(
140
+ }), this.hasAttribute("index") && (t(this, d).forEach((n) => {
141
+ n.element.style.setProperty("--word-index", n.index.toString());
142
+ }), t(this, E).forEach((n) => {
143
+ n.element.style.setProperty(
135
144
  "--letter-index",
136
- i.index.toString()
145
+ n.index.toString()
137
146
  );
138
- })), this.innerHTML = "", s.forEach((i, l) => {
139
- this.appendChild(i), l < s.length - 1 && i.nodeType === Node.ELEMENT_NODE && this.appendChild(new Text(" "));
140
- }), this.style.setProperty("--words-length", t(this, a).length.toString()), this.style.setProperty("--letters-length", t(this, x).length.toString());
141
- }, b = function() {
142
- o(this, a, []), this.innerHTML = t(this, m), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
147
+ })), this.innerHTML = "", s.forEach((n, l) => {
148
+ this.appendChild(n), l < s.length - 1 && n.nodeType === Node.ELEMENT_NODE && this.appendChild(new Text(" "));
149
+ }), this.style.setProperty("--words-length", t(this, d).length.toString()), this.style.setProperty("--letters-length", t(this, E).length.toString());
150
+ }, O = function() {
151
+ o(this, d, []), this.innerHTML = t(this, x), this.style.removeProperty("--words-length"), this.style.removeProperty("--letters-length");
143
152
  };
144
153
  S && !customElements.get("e-slicer") && customElements.define("e-slicer", G);
145
154
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.82.2",
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;