aptechka 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/lib/Composed-C2Vv1xxR.cjs +1 -0
  2. package/lib/Composed-DhtYBEmo.js +79 -0
  3. package/lib/component/Component.d.ts +29 -0
  4. package/lib/component/hooks/animation.d.ts +9 -0
  5. package/lib/component/hooks/context.d.ts +2 -0
  6. package/lib/component/hooks/intersection.d.ts +4 -0
  7. package/lib/component/hooks/resize.d.ts +6 -0
  8. package/lib/component/hooks/shadow.d.ts +1 -0
  9. package/lib/component/hooks/stores.d.ts +6 -0
  10. package/lib/component/hooks/style.d.ts +2 -0
  11. package/lib/component/index.cjs +1 -0
  12. package/lib/component/index.d.ts +7 -0
  13. package/lib/component/index.js +187 -0
  14. package/lib/connector/index.cjs +1 -1
  15. package/lib/connector/index.js +1 -1
  16. package/lib/element-constructor/ElementConstructor.d.ts +1 -1
  17. package/lib/element-constructor/tags.d.ts +2 -3
  18. package/lib/element-resizer/index.cjs +1 -1
  19. package/lib/element-resizer/index.d.ts +1 -1
  20. package/lib/element-resizer/index.js +2 -1
  21. package/lib/en3/core/en3.d.ts +2 -2
  22. package/lib/en3/objects/En3Clip.d.ts +1 -1
  23. package/lib/intersector/index.cjs +1 -1
  24. package/lib/intersector/index.d.ts +1 -1
  25. package/lib/intersector/index.js +2 -1
  26. package/lib/layout-box/index.cjs +1 -1
  27. package/lib/layout-box/index.d.ts +2 -2
  28. package/lib/layout-box/index.js +70 -72
  29. package/lib/object-C1ph624j.cjs +1 -0
  30. package/lib/object-DIPjdukP.js +73 -0
  31. package/lib/popover/index.cjs +1 -1
  32. package/lib/popover/index.js +79 -71
  33. package/lib/router/Route.d.ts +8 -2
  34. package/lib/router/index.cjs +1 -1
  35. package/lib/router/index.d.ts +1 -2
  36. package/lib/router/index.js +139 -140
  37. package/lib/store/index.cjs +1 -1
  38. package/lib/store/index.js +48 -111
  39. package/lib/ticker/index.cjs +1 -1
  40. package/lib/ticker/index.d.ts +1 -1
  41. package/lib/ticker/index.js +33 -37
  42. package/lib/utils/dom.d.ts +2 -2
  43. package/lib/utils/index.cjs +1 -1
  44. package/lib/utils/index.d.ts +1 -1
  45. package/lib/utils/index.js +113 -168
  46. package/lib/utils/object.d.ts +1 -0
  47. package/package.json +10 -2
  48. package/lib/router/RouteElement.d.ts +0 -14
@@ -1 +1 @@
1
- "use strict";var it=Object.defineProperty;var $=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var rt=(i,t,s)=>t in i?it(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var K=(i,t,s)=>(rt(i,typeof t!="symbol"?t+"":t,s),s),J=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(J(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(J(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var Q=(i,t,s)=>(J(i,t,"access private method"),s);var W=(i,t,s)=>new Promise((r,l)=>{var a=d=>{try{f(s.next(d))}catch(T){l(T)}},u=d=>{try{f(s.throw(d))}catch(T){l(T)}},f=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,u);f((s=s.apply(i,t)).next())});var V=(i,t,s)=>(t=i[$("asyncIterator")])?t.call(i):(i=i[$("iterator")](),t={},s=(r,l)=>(l=i[r])&&(t[r]=a=>new Promise((u,f,d)=>(a=l.call(i,a),d=a.done,Promise.resolve(a.value).then(T=>u({value:T,done:d}),f)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),at=require("../function-MthRj-GJ.cjs"),ht=require("../custom-element/index.cjs");var R,x,b,m,c,P,S,w,v,E,Y,et;class ct{constructor(t,s){n(this,Y);n(this,R,void 0);n(this,x,void 0);n(this,b,void 0);n(this,m,void 0);n(this,c,void 0);n(this,P,void 0);n(this,S,void 0);n(this,w,null);n(this,v,[]);n(this,E,[]);o(this,R,t),o(this,x,s),o(this,b,new URLPattern({pathname:e(this,R)})),o(this,m,null),o(this,c,null),o(this,P,!1),o(this,S,null),tt.isBrowser&&o(this,w,new MutationObserver(r=>{r[0].addedNodes.forEach(a=>{e(this,m)?e(this,E).push(a):e(this,v).push(a)})}))}get pattern(){return e(this,R)}get urlPattern(){return e(this,b)}get isActive(){return e(this,P)}get element(){return e(this,c)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return W(this,null,function*(){var r,l;if(e(this,w).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,v).forEach(a=>{document.head.appendChild(a)});else{const a=yield e(this,x).call(this);o(this,E,[...e(this,v)]),typeof a.default=="function"&&(o(this,m,a.default),customElements.define("e-"+((r=e(this,m))==null?void 0:r.name.toLowerCase()),a.default))}if(yield Q(this,Y,et).call(this),e(this,m)){const a=e(this,b).exec({pathname:s}),u=(a==null?void 0:a.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:u,searchParams:f};o(this,c,new(e(this,m))(d)),t.appendChild(e(this,c)),o(this,S,e(this,c).querySelector("[data-outlet]")||((l=e(this,c).shadowRoot)==null?void 0:l.querySelector("[data-outlet]"))||e(this,c).shadowRoot||e(this,c)),o(this,P,!0)}e(this,w).disconnect()})}close(){var t;e(this,w).disconnect(),(t=e(this,c))==null||t.remove(),o(this,P,!1),e(this,E).forEach(s=>document.head.removeChild(s)),o(this,E,[])}getAnchorElements(){var s;let t=[];return e(this,c)&&(t=[...e(this,c).querySelectorAll("a")]),(s=e(this,c))!=null&&s.shadowRoot&&(t=[...t,...e(this,c).shadowRoot.querySelectorAll("a")]),t}}R=new WeakMap,x=new WeakMap,b=new WeakMap,m=new WeakMap,c=new WeakMap,P=new WeakMap,S=new WeakMap,w=new WeakMap,v=new WeakMap,E=new WeakMap,Y=new WeakSet,et=function(){return W(this,null,function*(){const t=e(this,v).filter(u=>u instanceof HTMLElement?u.tagName==="STYLE"||u.tagName==="SCRIPT"||u.tagName==="LINK":!1);try{for(var s=V(t),r,l,a;r=!(l=yield s.next()).done;r=!1){const u=l.value;yield new Promise(f=>{u.onload=()=>{f()}})}}catch(l){a=[l]}finally{try{r&&(l=s.return)&&(yield l.call(s))}finally{if(a)throw a[0]}}})};var H,g,A,U,M;class lt{constructor(t,s){n(this,H,void 0);n(this,g,void 0);n(this,A,void 0);n(this,U,void 0);n(this,M,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});o(this,H,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,U,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,M)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,M)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,M=new WeakMap;globalThis.URLPattern=nt.URLPattern;var k,q,p,N,j,y,C,B,z,F,st,G;const O=class O{constructor(t){n(this,F);n(this,k,null);n(this,q,void 0);n(this,p,[]);n(this,N,null);n(this,j,[]);n(this,y,void 0);n(this,C,null);n(this,B,new ot.Notifier);K(this,"preprocessor");K(this,"postprocessor");n(this,z,at.debounce(()=>{const t=s=>s.split("/").length;o(this,p,e(this,p).sort((s,r)=>t(s.pattern)-t(r.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));n(this,G,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),O.active=this,tt.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,G)))}get currentPathname(){return e(this,C)}get candidatePathname(){return e(this,y)}get routes(){return e(this,p)}navigationEvent(t){return e(this,B).subscribe(t)}defineRoute(t,s){const r=new ct(t,s);e(this,p).push(r),e(this,z).call(this)}navigate(t,s="push"){return W(this,null,function*(){var d,Z;if(e(this,y)===t||e(this,C)===t)return;O.active=this,o(this,y,t);const r=e(this,p).filter(h=>h.isActive),l=e(this,p).filter(h=>!r.includes(h)&&h.testPathname(t)),a=r.filter(h=>!h.testPathname(t)),u=r.filter(h=>h.testPathname(t));let f=!0;if(this.preprocessor)try{yield new Promise((h,L)=>{var _;(_=this.preprocessor)==null||_.call(this,{pathname:t,resolve:h,reject:L})})}catch(h){h?console.error(h):console.log("Route change canceled"),f=!1}if(f&&e(this,y)===t){o(this,N,u[u.length-1]),a.forEach(L=>{L.close()}),o(this,C,t);try{for(var T=V(l),mt,gt,pt;mt=!(gt=yield T.next()).done;mt=!1){const L=gt.value;yield L.render(((d=e(this,N))==null?void 0:d.outlet)||e(this,k),t),o(this,N,L)}}catch(gt){pt=[gt]}finally{try{mt&&(gt=T.return)&&(yield gt.call(T))}finally{if(pt)throw pt[0]}}const h=e(this,q)+t+location.search;s==="push"?history.pushState(h,"",h):s==="replace"&&history.replaceState(h,"",h),Q(this,F,st).call(this),(Z=this.postprocessor)==null||Z.call(this,{pathname:t}),e(this,B).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,p=new WeakMap,N=new WeakMap,j=new WeakMap,y=new WeakMap,C=new WeakMap,B=new WeakMap,z=new WeakMap,F=new WeakSet,st=function(){const t=e(this,p).filter(r=>r.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(r=>r.getAnchorElements()).flat()].filter(r=>{var l;return(l=r.getAttribute("href"))==null?void 0:l.startsWith("/")})));e(this,j).forEach(r=>{r.destroy()}),o(this,j,s.map(r=>new lt(this,r)))},G=new WeakMap,K(O,"active");let X=O;var I,D;class ut extends ht.CustomElement{constructor(s){super();n(this,I,void 0);n(this,D,void 0);o(this,I,s.pathnameParams),o(this,D,s.searchParams)}get pathnameParams(){return e(this,I)}get searchParams(){return e(this,D)}}I=new WeakMap,D=new WeakMap;exports.RouteElement=ut;exports.Router=X;
1
+ "use strict";var st=Object.defineProperty;var Z=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var it=(i,t,s)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var I=(i,t,s)=>(it(i,typeof t!="symbol"?t+"":t,s),s),F=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(F(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(F(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var G=(i,t,s)=>(F(i,t,"access private method"),s);var D=(i,t,s)=>new Promise((r,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(h,a);d((s=s.apply(i,t)).next())});var J=(i,t,s)=>(t=i[Z("asyncIterator")])?t.call(i):(i=i[Z("iterator")](),t={},s=(r,f)=>(f=i[r])&&(t[r]=h=>new Promise((a,d,u)=>(h=f.call(i,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),nt=require("../function-MthRj-GJ.cjs"),$=require("../object-C1ph624j.cjs");var b,H,R,m,l,w,S,v,P,y,K,tt;class ht{constructor(t,s){n(this,K);n(this,b,void 0);n(this,H,void 0);n(this,R,void 0);n(this,m,void 0);n(this,l,void 0);n(this,w,void 0);n(this,S,void 0);n(this,v,null);n(this,P,[]);n(this,y,[]);o(this,b,t),o(this,H,s),o(this,R,new URLPattern({pathname:e(this,b)})),o(this,m,null),o(this,l,null),o(this,w,!1),o(this,S,null),_.isBrowser&&o(this,v,new MutationObserver(r=>{r[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,w)}get element(){return e(this,l)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return D(this,null,function*(){var r,f;if(e(this,v).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,H).call(this);if(o(this,y,[...e(this,P)]),typeof h.default=="function"&&(o(this,m,h.default),$.isESClass(h.default))){const a="e-"+((r=e(this,m))==null?void 0:r.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield G(this,K,tt).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:a,searchParams:d};$.isESClass(e(this,m))?o(this,l,new(e(this,m))(u)):o(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),o(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),o(this,w,!0)}e(this,v).disconnect()})}close(){var t;e(this,v).disconnect(),(t=e(this,l))==null||t.remove(),o(this,w,!1),e(this,y).forEach(s=>document.head.removeChild(s)),o(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,H=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,w=new WeakMap,S=new WeakMap,v=new WeakMap,P=new WeakMap,y=new WeakMap,K=new WeakSet,tt=function(){return D(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=J(t),r,f,h;r=!(f=yield s.next()).done;r=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{r&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var U,g,A,j,M;class at{constructor(t,s){n(this,U,void 0);n(this,g,void 0);n(this,A,void 0);n(this,j,void 0);n(this,M,t=>{t.preventDefault(),e(this,U).navigate(e(this,A),e(this,j))});o(this,U,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,j,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,M)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,M)),e(this,g).classList.remove("current")}}U=new WeakMap,g=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap;globalThis.URLPattern=rt.URLPattern;var k,q,p,C,x,E,N,B,W,Y,et,z;const O=class O{constructor(t){n(this,Y);n(this,k,null);n(this,q,void 0);n(this,p,[]);n(this,C,null);n(this,x,[]);n(this,E,void 0);n(this,N,null);n(this,B,new ot.Notifier);I(this,"preprocessor");I(this,"postprocessor");n(this,W,nt.debounce(()=>{const t=s=>s.split("/").length;o(this,p,e(this,p).sort((s,r)=>t(s.pattern)-t(r.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));n(this,z,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),O.active=this,_.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,z)))}get currentPathname(){return e(this,N)}get candidatePathname(){return e(this,E)}get routes(){return e(this,p)}navigationEvent(t){return e(this,B).subscribe(t)}defineRoute(t,s){const r=new ht(t,s);e(this,p).push(r),e(this,W).call(this)}navigate(t,s="push"){return D(this,null,function*(){var u,V;if(e(this,E)===t||e(this,N)===t)return;O.active=this,o(this,E,t);const r=e(this,p).filter(c=>c.isActive),f=e(this,p).filter(c=>!r.includes(c)&&c.testPathname(t)),h=r.filter(c=>!c.testPathname(t)),a=r.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var X;(X=this.preprocessor)==null||X.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){o(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),o(this,N,t);try{for(var T=J(f),ut,ft,dt;ut=!(ft=yield T.next()).done;ut=!1){const L=ft.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),o(this,C,L)}}catch(ft){dt=[ft]}finally{try{ut&&(ft=T.return)&&(yield ft.call(T))}finally{if(dt)throw dt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),G(this,Y,et).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:t}),e(this,B).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,p=new WeakMap,C=new WeakMap,x=new WeakMap,E=new WeakMap,N=new WeakMap,B=new WeakMap,W=new WeakMap,Y=new WeakSet,et=function(){const t=e(this,p).filter(r=>r.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(r=>r.getAnchorElements()).flat()].filter(r=>{var f;return(f=r.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,x).forEach(r=>{r.destroy()}),o(this,x,s.map(r=>new at(this,r)))},z=new WeakMap,I(O,"active");let Q=O;exports.Router=Q;
@@ -1,3 +1,2 @@
1
1
  export { Router, type RouterPreprocessorEntry, type RouterPreprocessor, type RouterPostprocessor, type RouterAfterNavigationCallback, type RouterHistoryAction, type RouterParameters, } from './Router';
2
- export { RouteElement, type RouteParameters, type RouteURLParams } from './RouteElement';
3
- export { type RouteModule } from './Route';
2
+ export { type RouteModule, type RouteParameters, type RouteURLParams, } from './Route';
@@ -1,55 +1,55 @@
1
- var it = Object.defineProperty;
2
- var Z = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
3
- var rt = (i, t, s) => t in i ? it(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
4
- var K = (i, t, s) => (rt(i, typeof t != "symbol" ? t + "" : t, s), s), G = (i, t, s) => {
1
+ var st = Object.defineProperty;
2
+ var V = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
3
+ var it = (i, t, s) => t in i ? st(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
4
+ var B = (i, t, s) => (it(i, typeof t != "symbol" ? t + "" : t, s), s), z = (i, t, s) => {
5
5
  if (!t.has(i))
6
6
  throw TypeError("Cannot " + s);
7
7
  };
8
- var e = (i, t, s) => (G(i, t, "read from private field"), s ? s.call(i) : t.get(i)), o = (i, t, s) => {
8
+ var e = (i, t, s) => (z(i, t, "read from private field"), s ? s.call(i) : t.get(i)), n = (i, t, s) => {
9
9
  if (t.has(i))
10
10
  throw TypeError("Cannot add the same private member more than once");
11
11
  t instanceof WeakSet ? t.add(i) : t.set(i, s);
12
- }, n = (i, t, s, r) => (G(i, t, "write to private field"), r ? r.call(i, s) : t.set(i, s), s);
13
- var J = (i, t, s) => (G(i, t, "access private method"), s);
14
- var W = (i, t, s) => new Promise((r, l) => {
15
- var a = (f) => {
12
+ }, r = (i, t, s, o) => (z(i, t, "write to private field"), o ? o.call(i, s) : t.set(i, s), s);
13
+ var F = (i, t, s) => (z(i, t, "access private method"), s);
14
+ var D = (i, t, s) => new Promise((o, f) => {
15
+ var h = (u) => {
16
16
  try {
17
- d(s.next(f));
17
+ d(s.next(u));
18
18
  } catch (T) {
19
- l(T);
19
+ f(T);
20
20
  }
21
- }, u = (f) => {
21
+ }, a = (u) => {
22
22
  try {
23
- d(s.throw(f));
23
+ d(s.throw(u));
24
24
  } catch (T) {
25
- l(T);
25
+ f(T);
26
26
  }
27
- }, d = (f) => f.done ? r(f.value) : Promise.resolve(f.value).then(a, u);
27
+ }, d = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(h, a);
28
28
  d((s = s.apply(i, t)).next());
29
29
  });
30
- var Q = (i, t, s) => (t = i[Z("asyncIterator")]) ? t.call(i) : (i = i[Z("iterator")](), t = {}, s = (r, l) => (l = i[r]) && (t[r] = (a) => new Promise((u, d, f) => (a = l.call(i, a), f = a.done, Promise.resolve(a.value).then((T) => u({ value: T, done: f }), d)))), s("next"), s("return"), t);
30
+ var G = (i, t, s) => (t = i[V("asyncIterator")]) ? t.call(i) : (i = i[V("iterator")](), t = {}, s = (o, f) => (f = i[o]) && (t[o] = (h) => new Promise((a, d, u) => (h = f.call(i, h), u = h.done, Promise.resolve(h.value).then((T) => a({ value: T, done: u }), d)))), s("next"), s("return"), t);
31
31
  import { URLPattern as ot } from "urlpattern-polyfill";
32
- import { Notifier as nt } from "../notifier/index.js";
33
- import { i as tt } from "../browser-0zX67oeU.js";
34
- import { d as at } from "../function-C10DGppn.js";
35
- import { CustomElement as ht } from "../custom-element/index.js";
36
- var R, H, b, m, c, P, A, v, w, E, Y, et;
37
- class ct {
32
+ import { Notifier as rt } from "../notifier/index.js";
33
+ import { i as _ } from "../browser-0zX67oeU.js";
34
+ import { d as nt } from "../function-C10DGppn.js";
35
+ import { i as X } from "../object-DIPjdukP.js";
36
+ var R, H, b, m, l, v, A, w, P, E, K, tt;
37
+ class ht {
38
38
  constructor(t, s) {
39
- o(this, Y);
40
- o(this, R, void 0);
41
- o(this, H, void 0);
42
- o(this, b, void 0);
43
- o(this, m, void 0);
44
- o(this, c, void 0);
45
- o(this, P, void 0);
46
- o(this, A, void 0);
47
- o(this, v, null);
48
- o(this, w, []);
49
- o(this, E, []);
50
- n(this, R, t), n(this, H, s), n(this, b, new URLPattern({ pathname: e(this, R) })), n(this, m, null), n(this, c, null), n(this, P, !1), n(this, A, null), tt && n(this, v, new MutationObserver((r) => {
51
- r[0].addedNodes.forEach((a) => {
52
- e(this, m) ? e(this, E).push(a) : e(this, w).push(a);
39
+ n(this, K);
40
+ n(this, R, void 0);
41
+ n(this, H, void 0);
42
+ n(this, b, void 0);
43
+ n(this, m, void 0);
44
+ n(this, l, void 0);
45
+ n(this, v, void 0);
46
+ n(this, A, void 0);
47
+ n(this, w, null);
48
+ n(this, P, []);
49
+ n(this, E, []);
50
+ r(this, R, t), r(this, H, s), r(this, b, new URLPattern({ pathname: e(this, R) })), r(this, m, null), r(this, l, null), r(this, v, !1), r(this, A, null), _ && r(this, w, new MutationObserver((o) => {
51
+ o[0].addedNodes.forEach((h) => {
52
+ e(this, m) ? e(this, E).push(h) : e(this, P).push(h);
53
53
  });
54
54
  }));
55
55
  }
@@ -60,10 +60,10 @@ class ct {
60
60
  return e(this, b);
61
61
  }
62
62
  get isActive() {
63
- return e(this, P);
63
+ return e(this, v);
64
64
  }
65
65
  get element() {
66
- return e(this, c);
66
+ return e(this, l);
67
67
  }
68
68
  get outlet() {
69
69
  return e(this, A);
@@ -72,71 +72,84 @@ class ct {
72
72
  return this.urlPattern.test({ pathname: t });
73
73
  }
74
74
  render(t, s) {
75
- return W(this, null, function* () {
76
- var r, l;
77
- if (e(this, v).observe(document.head, { childList: !0, subtree: !0 }), e(this, m))
78
- e(this, w).forEach((a) => {
79
- document.head.appendChild(a);
75
+ return D(this, null, function* () {
76
+ var o, f;
77
+ if (e(this, w).observe(document.head, {
78
+ childList: !0,
79
+ subtree: !0
80
+ }), e(this, m))
81
+ e(this, P).forEach((h) => {
82
+ document.head.appendChild(h);
80
83
  });
81
84
  else {
82
- const a = yield e(this, H).call(this);
83
- n(this, E, [...e(this, w)]), typeof a.default == "function" && (n(this, m, a.default), customElements.define("e-" + ((r = e(this, m)) == null ? void 0 : r.name.toLowerCase()), a.default));
85
+ const h = yield e(this, H).call(this);
86
+ if (r(this, E, [...e(this, P)]), typeof h.default == "function" && (r(this, m, h.default), X(h.default))) {
87
+ const a = "e-" + ((o = e(this, m)) == null ? void 0 : o.name.toLowerCase());
88
+ customElements.get(a) || customElements.define(a, h.default);
89
+ }
84
90
  }
85
- if (yield J(this, Y, et).call(this), e(this, m)) {
86
- const a = e(this, b).exec({ pathname: s }), u = (a == null ? void 0 : a.pathname.groups) || {}, d = Object.fromEntries(new URLSearchParams(location.search)), f = {
87
- pathnameParams: u,
91
+ if (yield F(this, K, tt).call(this), e(this, m)) {
92
+ const h = e(this, b).exec({ pathname: s }), a = (h == null ? void 0 : h.pathname.groups) || {}, d = Object.fromEntries(
93
+ new URLSearchParams(location.search)
94
+ ), u = {
95
+ pathnameParams: a,
88
96
  searchParams: d
89
97
  };
90
- n(this, c, new (e(this, m))(f)), t.appendChild(e(this, c)), n(this, A, e(this, c).querySelector("[data-outlet]") || ((l = e(this, c).shadowRoot) == null ? void 0 : l.querySelector("[data-outlet]")) || e(this, c).shadowRoot || e(this, c)), n(this, P, !0);
98
+ X(e(this, m)) ? r(this, l, new (e(this, m))(
99
+ u
100
+ )) : r(this, l, e(this, m).call(this, u)), t.appendChild(e(this, l)), r(this, A, e(this, l).querySelector("[data-outlet]") || ((f = e(this, l).shadowRoot) == null ? void 0 : f.querySelector("[data-outlet]")) || e(this, l).shadowRoot || e(this, l)), r(this, v, !0);
91
101
  }
92
- e(this, v).disconnect();
102
+ e(this, w).disconnect();
93
103
  });
94
104
  }
95
105
  close() {
96
106
  var t;
97
- e(this, v).disconnect(), (t = e(this, c)) == null || t.remove(), n(this, P, !1), e(this, E).forEach((s) => document.head.removeChild(s)), n(this, E, []);
107
+ e(this, w).disconnect(), (t = e(this, l)) == null || t.remove(), r(this, v, !1), e(this, E).forEach((s) => document.head.removeChild(s)), r(this, E, []);
98
108
  }
99
109
  getAnchorElements() {
100
110
  var s;
101
111
  let t = [];
102
- return e(this, c) && (t = [...e(this, c).querySelectorAll("a")]), (s = e(this, c)) != null && s.shadowRoot && (t = [...t, ...e(this, c).shadowRoot.querySelectorAll("a")]), t;
112
+ return e(this, l) && (t = [...e(this, l).querySelectorAll("a")]), (s = e(this, l)) != null && s.shadowRoot && (t = [
113
+ ...t,
114
+ ...e(this, l).shadowRoot.querySelectorAll("a")
115
+ ]), t;
103
116
  }
104
117
  }
105
- R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), c = new WeakMap(), P = new WeakMap(), A = new WeakMap(), v = new WeakMap(), w = new WeakMap(), E = new WeakMap(), Y = new WeakSet(), et = function() {
106
- return W(this, null, function* () {
107
- const t = e(this, w).filter((u) => u instanceof HTMLElement ? u.tagName === "STYLE" || u.tagName === "SCRIPT" || u.tagName === "LINK" : !1);
118
+ R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l = new WeakMap(), v = new WeakMap(), A = new WeakMap(), w = new WeakMap(), P = new WeakMap(), E = new WeakMap(), K = new WeakSet(), tt = function() {
119
+ return D(this, null, function* () {
120
+ const t = e(this, P).filter((a) => a instanceof HTMLElement ? a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK" : !1);
108
121
  try {
109
- for (var s = Q(t), r, l, a; r = !(l = yield s.next()).done; r = !1) {
110
- const u = l.value;
122
+ for (var s = G(t), o, f, h; o = !(f = yield s.next()).done; o = !1) {
123
+ const a = f.value;
111
124
  yield new Promise((d) => {
112
- u.onload = () => {
125
+ a.onload = () => {
113
126
  d();
114
127
  };
115
128
  });
116
129
  }
117
- } catch (l) {
118
- a = [l];
130
+ } catch (f) {
131
+ h = [f];
119
132
  } finally {
120
133
  try {
121
- r && (l = s.return) && (yield l.call(s));
134
+ o && (f = s.return) && (yield f.call(s));
122
135
  } finally {
123
- if (a)
124
- throw a[0];
136
+ if (h)
137
+ throw h[0];
125
138
  }
126
139
  }
127
140
  });
128
141
  };
129
142
  var O, p, S, x, I;
130
- class lt {
143
+ class at {
131
144
  constructor(t, s) {
132
- o(this, O, void 0);
133
- o(this, p, void 0);
134
- o(this, S, void 0);
135
- o(this, x, void 0);
136
- o(this, I, (t) => {
145
+ n(this, O, void 0);
146
+ n(this, p, void 0);
147
+ n(this, S, void 0);
148
+ n(this, x, void 0);
149
+ n(this, I, (t) => {
137
150
  t.preventDefault(), e(this, O).navigate(e(this, S), e(this, x));
138
151
  });
139
- n(this, O, t), n(this, p, s), n(this, S, e(this, p).getAttribute("href") || "/"), n(this, x, e(this, p).getAttribute("data-history-action") || "push"), e(this, p).addEventListener("click", e(this, I)), location.pathname === e(this, S) && e(this, p).classList.add("current");
152
+ r(this, O, t), r(this, p, s), r(this, S, e(this, p).getAttribute("href") || "/"), r(this, x, e(this, p).getAttribute("data-history-action") || "push"), e(this, p).addEventListener("click", e(this, I)), location.pathname === e(this, S) && e(this, p).classList.add("current");
140
153
  }
141
154
  destroy() {
142
155
  e(this, p).removeEventListener("click", e(this, I)), e(this, p).classList.remove("current");
@@ -144,28 +157,28 @@ class lt {
144
157
  }
145
158
  O = new WeakMap(), p = new WeakMap(), S = new WeakMap(), x = new WeakMap(), I = new WeakMap();
146
159
  globalThis.URLPattern = ot;
147
- var k, N, g, C, M, L, q, j, $, z, st, F;
160
+ var k, N, g, C, M, L, q, j, W, Y, et, $;
148
161
  const U = class U {
149
162
  constructor(t) {
150
- o(this, z);
151
- o(this, k, null);
152
- o(this, N, void 0);
153
- o(this, g, []);
154
- o(this, C, null);
155
- o(this, M, []);
156
- o(this, L, void 0);
157
- o(this, q, null);
158
- o(this, j, new nt());
159
- K(this, "preprocessor");
160
- K(this, "postprocessor");
161
- o(this, $, at(() => {
163
+ n(this, Y);
164
+ n(this, k, null);
165
+ n(this, N, void 0);
166
+ n(this, g, []);
167
+ n(this, C, null);
168
+ n(this, M, []);
169
+ n(this, L, void 0);
170
+ n(this, q, null);
171
+ n(this, j, new rt());
172
+ B(this, "preprocessor");
173
+ B(this, "postprocessor");
174
+ n(this, W, nt(() => {
162
175
  const t = (s) => s.split("/").length;
163
- n(this, g, e(this, g).sort((s, r) => t(s.pattern) - t(r.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
176
+ r(this, g, e(this, g).sort((s, o) => t(s.pattern) - t(o.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
164
177
  }, 0));
165
- o(this, F, (t) => {
178
+ n(this, $, (t) => {
166
179
  t.state && this.navigate(t.state, "none");
167
180
  });
168
- n(this, N, (t == null ? void 0 : t.base) || ""), U.active = this, tt && (n(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, F)));
181
+ r(this, N, (t == null ? void 0 : t.base) || ""), U.active = this, _ && (r(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, $)));
169
182
  }
170
183
  get currentPathname() {
171
184
  return e(this, q);
@@ -180,87 +193,73 @@ const U = class U {
180
193
  return e(this, j).subscribe(t);
181
194
  }
182
195
  defineRoute(t, s) {
183
- const r = new ct(t, s);
184
- e(this, g).push(r), e(this, $).call(this);
196
+ const o = new ht(t, s);
197
+ e(this, g).push(o), e(this, W).call(this);
185
198
  }
186
199
  navigate(t, s = "push") {
187
- return W(this, null, function* () {
188
- var f, V;
200
+ return D(this, null, function* () {
201
+ var u, J;
189
202
  if (e(this, L) === t || e(this, q) === t)
190
203
  return;
191
- U.active = this, n(this, L, t);
192
- const r = e(this, g).filter((h) => h.isActive), l = e(this, g).filter(
193
- (h) => !r.includes(h) && h.testPathname(t)
194
- ), a = r.filter((h) => !h.testPathname(t)), u = r.filter((h) => h.testPathname(t));
204
+ U.active = this, r(this, L, t);
205
+ const o = e(this, g).filter((c) => c.isActive), f = e(this, g).filter(
206
+ (c) => !o.includes(c) && c.testPathname(t)
207
+ ), h = o.filter((c) => !c.testPathname(t)), a = o.filter((c) => c.testPathname(t));
195
208
  let d = !0;
196
209
  if (this.preprocessor)
197
210
  try {
198
- yield new Promise((h, y) => {
199
- var X;
200
- (X = this.preprocessor) == null || X.call(this, { pathname: t, resolve: h, reject: y });
211
+ yield new Promise((c, y) => {
212
+ var Q;
213
+ (Q = this.preprocessor) == null || Q.call(this, { pathname: t, resolve: c, reject: y });
201
214
  });
202
- } catch (h) {
203
- h ? console.error(h) : console.log("Route change canceled"), d = !1;
215
+ } catch (c) {
216
+ c ? console.error(c) : console.log("Route change canceled"), d = !1;
204
217
  }
205
218
  if (d && e(this, L) === t) {
206
- n(this, C, u[u.length - 1]), a.forEach((y) => {
219
+ r(this, C, a[a.length - 1]), h.forEach((y) => {
207
220
  y.close();
208
- }), n(this, q, t);
221
+ }), r(this, q, t);
209
222
  try {
210
- for (var T = Q(l), Et, Lt, yt; Et = !(Lt = yield T.next()).done; Et = !1) {
211
- const y = Lt.value;
212
- yield y.render(((f = e(this, C)) == null ? void 0 : f.outlet) || e(this, k), t), n(this, C, y);
223
+ for (var T = G(f), vt, wt, Pt; vt = !(wt = yield T.next()).done; vt = !1) {
224
+ const y = wt.value;
225
+ yield y.render(
226
+ ((u = e(this, C)) == null ? void 0 : u.outlet) || e(this, k),
227
+ t
228
+ ), r(this, C, y);
213
229
  }
214
- } catch (Lt) {
215
- yt = [Lt];
230
+ } catch (wt) {
231
+ Pt = [wt];
216
232
  } finally {
217
233
  try {
218
- Et && (Lt = T.return) && (yield Lt.call(T));
234
+ vt && (wt = T.return) && (yield wt.call(T));
219
235
  } finally {
220
- if (yt)
221
- throw yt[0];
236
+ if (Pt)
237
+ throw Pt[0];
222
238
  }
223
239
  }
224
- const h = e(this, N) + t + location.search;
225
- s === "push" ? history.pushState(h, "", h) : s === "replace" && history.replaceState(h, "", h), J(this, z, st).call(this), (V = this.postprocessor) == null || V.call(this, { pathname: t }), e(this, j).notify({ pathname: t });
240
+ const c = e(this, N) + t + location.search;
241
+ s === "push" ? history.pushState(c, "", c) : s === "replace" && history.replaceState(c, "", c), F(this, Y, et).call(this), (J = this.postprocessor) == null || J.call(this, { pathname: t }), e(this, j).notify({ pathname: t });
226
242
  }
227
243
  });
228
244
  }
229
245
  };
230
- k = new WeakMap(), N = new WeakMap(), g = new WeakMap(), C = new WeakMap(), M = new WeakMap(), L = new WeakMap(), q = new WeakMap(), j = new WeakMap(), $ = new WeakMap(), z = new WeakSet(), st = function() {
231
- const t = e(this, g).filter((r) => r.isActive), s = Array.from(
246
+ k = new WeakMap(), N = new WeakMap(), g = new WeakMap(), C = new WeakMap(), M = new WeakMap(), L = new WeakMap(), q = new WeakMap(), j = new WeakMap(), W = new WeakMap(), Y = new WeakSet(), et = function() {
247
+ const t = e(this, g).filter((o) => o.isActive), s = Array.from(
232
248
  new Set(
233
249
  [
234
250
  ...e(this, k).querySelectorAll("a"),
235
- ...t.map((r) => r.getAnchorElements()).flat()
236
- ].filter((r) => {
237
- var l;
238
- return (l = r.getAttribute("href")) == null ? void 0 : l.startsWith("/");
251
+ ...t.map((o) => o.getAnchorElements()).flat()
252
+ ].filter((o) => {
253
+ var f;
254
+ return (f = o.getAttribute("href")) == null ? void 0 : f.startsWith("/");
239
255
  })
240
256
  )
241
257
  );
242
- e(this, M).forEach((r) => {
243
- r.destroy();
244
- }), n(this, M, s.map((r) => new lt(this, r)));
245
- }, F = new WeakMap(), K(U, "active");
246
- let _ = U;
247
- var B, D;
248
- class Pt extends ht {
249
- constructor(s) {
250
- super();
251
- o(this, B, void 0);
252
- o(this, D, void 0);
253
- n(this, B, s.pathnameParams), n(this, D, s.searchParams);
254
- }
255
- get pathnameParams() {
256
- return e(this, B);
257
- }
258
- get searchParams() {
259
- return e(this, D);
260
- }
261
- }
262
- B = new WeakMap(), D = new WeakMap();
258
+ e(this, M).forEach((o) => {
259
+ o.destroy();
260
+ }), r(this, M, s.map((o) => new at(this, o)));
261
+ }, $ = new WeakMap(), B(U, "active");
262
+ let Z = U;
263
263
  export {
264
- Pt as RouteElement,
265
- _ as Router
264
+ Z as Router
266
265
  };
@@ -1 +1 @@
1
- "use strict";var C=(t,r,e)=>{if(!r.has(t))throw TypeError("Cannot "+e)};var u=(t,r,e)=>(C(t,r,"read from private field"),e?e.call(t):r.get(t)),n=(t,r,e)=>{if(r.has(t))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(t):r.set(t,e)},o=(t,r,e,s)=>(C(t,r,"write to private field"),s?s.call(t,e):r.set(t,e),e);var R=(t,r,e,s)=>({set _(c){o(t,r,c,e)},get _(){return u(t,r,s)}});var A=(t,r,e)=>new Promise((s,c)=>{var h=i=>{try{v(e.next(i))}catch(f){c(f)}},l=i=>{try{v(e.throw(i))}catch(f){c(f)}},v=i=>i.done?s(i.value):Promise.resolve(i.value).then(h,l);v((e=e.apply(t,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Store-D0_rDIsE.cjs"),I=require("../Derived-SjPdLJiZ.cjs"),q=require("../function-MthRj-GJ.cjs");var b;class E extends d.Store{constructor(e,s,c){super(null,c);n(this,b,void 0);o(this,b,e.subscribe(h=>{const l=[];h.current.forEach((v,i)=>{var f;h.current[i]===((f=h.previous)==null?void 0:f[i])&&this.current[i]?l.push(this.current[i]):l.push(s(v))}),this.current=l}))}close(){super.close(),u(this,b).call(this)}}b=new WeakMap;var S,a,p;class D extends d.Store{constructor(e,s,c){super(e,c);n(this,S,void 0);n(this,a,void 0);n(this,p,0);o(this,a,new d.Store(!1)),o(this,S,s),c!=null&&c.manualControl||this.refetch()}get isPending(){return u(this,a)}refetch(){u(this,a).current=!0,o(this,p,u(this,p)+1);const e=u(this,p);u(this,S).call(this).then(s=>{e===u(this,p)&&(u(this,a).current=!1,this.current=s)})}}S=new WeakMap,a=new WeakMap,p=new WeakMap;var g,m,y;class P extends D{constructor(e,s,c=100){super(e,s,{manualControl:!0,skipSubscribeNotification:!0});n(this,g,void 0);n(this,m,void 0);n(this,y,0);o(this,m,c)}get step(){return u(this,y)}startAccumulating(){o(this,g,setInterval(()=>A(this,null,function*(){++R(this,y)._,this.refetch()}),u(this,m)))}stopAccumulating(){clearInterval(u(this,g))}close(){super.close(),this.stopAccumulating()}}g=new WeakMap,m=new WeakMap,y=new WeakMap;var x;class j extends d.Store{constructor(e,s,c){super(null,c);n(this,x,[]);const h=q.debounce(()=>{this.current=s()},0);e.forEach(l=>{u(this,x).push(l.subscribe(()=>{h()}))})}close(){super.close(),u(this,x).forEach(e=>e())}}x=new WeakMap;exports.Store=d.Store;exports.activeStores=d.activeStores;exports.storeRegistry=d.storeRegistry;exports.Derived=I.Derived;exports.Composed=j;exports.CumulativeResource=P;exports.DerivedArray=E;exports.Resource=D;
1
+ "use strict";var g=(e,r,t)=>{if(!r.has(e))throw TypeError("Cannot "+t)};var u=(e,r,t)=>(g(e,r,"read from private field"),t?t.call(e):r.get(e)),l=(e,r,t)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,t)},v=(e,r,t,s)=>(g(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);var S=(e,r,t,s)=>({set _(o){v(e,r,o,t)},get _(){return u(e,r,s)}});var y=(e,r,t)=>new Promise((s,o)=>{var R=i=>{try{p(t.next(i))}catch(m){o(m)}},C=i=>{try{p(t.throw(i))}catch(m){o(m)}},p=i=>i.done?s(i.value):Promise.resolve(i.value).then(R,C);p((t=t.apply(e,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../Store-D0_rDIsE.cjs"),A=require("../Derived-SjPdLJiZ.cjs"),d=require("../Composed-C2Vv1xxR.cjs");var c,a,n;class D extends d.Resource{constructor(t,s,o=100){super(t,s,{manualControl:!0,skipSubscribeNotification:!0});l(this,c,void 0);l(this,a,void 0);l(this,n,0);v(this,a,o)}get step(){return u(this,n)}startAccumulating(){v(this,c,setInterval(()=>y(this,null,function*(){++S(this,n)._,this.refetch()}),u(this,a)))}stopAccumulating(){clearInterval(u(this,c))}close(){super.close(),this.stopAccumulating()}}c=new WeakMap,a=new WeakMap,n=new WeakMap;exports.Store=h.Store;exports.activeStores=h.activeStores;exports.storeRegistry=h.storeRegistry;exports.Derived=A.Derived;exports.Composed=d.Composed;exports.DerivedArray=d.DerivedArray;exports.Resource=d.Resource;exports.CumulativeResource=D;