aptechka 0.16.0 → 0.17.0

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 (148) hide show
  1. package/lib/animation/Animation.d.ts +34 -0
  2. package/lib/animation/Damped.d.ts +18 -0
  3. package/lib/animation/Tweened.d.ts +14 -0
  4. package/lib/animation/index.d.ts +3 -0
  5. package/lib/attribute/index.d.ts +14 -0
  6. package/lib/canvas/index.d.ts +34 -0
  7. package/lib/class-linked-status/index.d.ts +11 -0
  8. package/lib/connector/index.d.ts +15 -0
  9. package/lib/controls/AutoplayControls.d.ts +16 -0
  10. package/lib/controls/Controls.d.ts +8 -0
  11. package/lib/controls/DragControls.d.ts +15 -0
  12. package/lib/controls/KeyboardControls.d.ts +13 -0
  13. package/lib/controls/WheelControls.d.ts +18 -0
  14. package/lib/controls/index.d.ts +5 -0
  15. package/lib/css-property/index.d.ts +16 -0
  16. package/lib/css-unit-parser/index.d.ts +6 -0
  17. package/lib/css-value-parser/index.d.ts +6 -0
  18. package/lib/dev/index.d.ts +1 -0
  19. package/lib/device/Device.d.ts +18 -0
  20. package/lib/device/Viewport.d.ts +28 -0
  21. package/lib/device/index.d.ts +2 -0
  22. package/lib/element-resizer/index.d.ts +9 -0
  23. package/lib/en3/En3Raycaster.d.ts +20 -0
  24. package/lib/en3/En3View.d.ts +39 -0
  25. package/lib/en3/en3.d.ts +36 -0
  26. package/lib/en3/index.d.ts +7 -0
  27. package/lib/en3/utils/coverTexture.d.ts +6 -0
  28. package/lib/en3/utils/dispose.d.ts +2 -0
  29. package/lib/en3/utils/getCurrentViewport.d.ts +8 -0
  30. package/lib/en3/utils/traverseMaterials.d.ts +2 -0
  31. package/lib/en3/utils/traverseMeshes.d.ts +2 -0
  32. package/lib/image/index.d.ts +10 -0
  33. package/lib/intersector/index.d.ts +9 -0
  34. package/lib/ladder/index.d.ts +23 -0
  35. package/lib/layout-box/index.d.ts +95 -0
  36. package/lib/loading/index.d.ts +38 -0
  37. package/lib/media/index.d.ts +11 -0
  38. package/lib/need_redo_tweaker/CheckboxElement.d.ts +14 -0
  39. package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +10 -0
  40. package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +10 -0
  41. package/lib/need_redo_tweaker/TweakerElement.d.ts +17 -0
  42. package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +19 -0
  43. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +23 -0
  44. package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +10 -0
  45. package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +13 -0
  46. package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +10 -0
  47. package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +9 -0
  48. package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +10 -0
  49. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +74 -0
  50. package/lib/need_redo_tweaker/element-constructor/createStylesheet.d.ts +2 -0
  51. package/lib/need_redo_tweaker/element-constructor/createTheme.d.ts +12 -0
  52. package/lib/need_redo_tweaker/element-constructor/index.d.ts +4 -0
  53. package/lib/need_redo_tweaker/element-constructor/knownSvgTags.d.ts +1 -0
  54. package/lib/need_redo_tweaker/element-constructor/tags.d.ts +118 -0
  55. package/lib/need_redo_tweaker/index.cjs +4 -4
  56. package/lib/need_redo_tweaker/index.d.ts +1 -0
  57. package/lib/need_redo_tweaker/index.js +1 -2
  58. package/lib/need_redo_tweaker/select/SelectElement.d.ts +24 -0
  59. package/lib/need_redo_tweaker/select/SelectHeadElement.d.ts +12 -0
  60. package/lib/need_redo_tweaker/select/SelectOptionElement.d.ts +13 -0
  61. package/lib/need_redo_tweaker/select/SelectUserElement.d.ts +6 -0
  62. package/lib/need_redo_tweaker/select/index.d.ts +4 -0
  63. package/lib/need_redo_tweaker/theme/index.d.ts +35 -0
  64. package/lib/need_redo_tweaker/tweakerManagerConstructors.d.ts +14 -0
  65. package/lib/need_redo_tweaker/tweakerStorage.d.ts +23 -0
  66. package/lib/notifier/index.d.ts +8 -0
  67. package/lib/object-DOa0yKM9.js +114 -0
  68. package/lib/object-HBC5QlzO.cjs +1 -0
  69. package/lib/order/index.d.ts +22 -0
  70. package/lib/pointer/Pointer.d.ts +22 -0
  71. package/lib/pointer/PointerElement.d.ts +13 -0
  72. package/lib/pointer/index.d.ts +2 -0
  73. package/lib/popover/PopoverButtonElement.d.ts +14 -0
  74. package/lib/popover/PopoverElement.d.ts +25 -0
  75. package/lib/popover/index.d.ts +2 -0
  76. package/lib/scroll/ScrollBulletButtonsElement.d.ts +11 -0
  77. package/lib/scroll/ScrollButtonElement.d.ts +5 -0
  78. package/lib/scroll/ScrollElement.d.ts +81 -0
  79. package/lib/scroll/ScrollSection.d.ts +22 -0
  80. package/lib/scroll/ScrollSegmentElement.d.ts +62 -0
  81. package/lib/scroll/ScrollSetButtonElement.d.ts +9 -0
  82. package/lib/scroll/ScrollStepButtonElement.d.ts +9 -0
  83. package/lib/scroll/ScrollUserElement.d.ts +6 -0
  84. package/lib/scroll/ScrollbarElement.d.ts +13 -0
  85. package/lib/scroll/index.d.ts +6 -0
  86. package/lib/scroll-entries/index.d.ts +20 -0
  87. package/lib/sequence/index.d.ts +20 -0
  88. package/lib/slicer/Letter.d.ts +11 -0
  89. package/lib/slicer/SlicerElement.d.ts +20 -0
  90. package/lib/slicer/Word.d.ts +16 -0
  91. package/lib/slicer/index.d.ts +3 -0
  92. package/lib/source/SourceClass.d.ts +11 -0
  93. package/lib/source/SourceElement.d.ts +24 -0
  94. package/lib/source/SourceManager.d.ts +13 -0
  95. package/lib/source/SourceSet.d.ts +8 -0
  96. package/lib/source/index.d.ts +4 -0
  97. package/lib/store/Composed.d.ts +7 -0
  98. package/lib/store/Derived.d.ts +7 -0
  99. package/lib/store/DerivedArray.d.ts +7 -0
  100. package/lib/store/Resource.d.ts +11 -0
  101. package/lib/store/Store.d.ts +35 -0
  102. package/lib/store/StoreRegistry.d.ts +22 -0
  103. package/lib/store/index.d.ts +6 -0
  104. package/lib/test/starting-style/index.d.ts +1 -0
  105. package/lib/ticker/index.d.ts +21 -0
  106. package/lib/utils/array.d.ts +2 -0
  107. package/lib/utils/attributes.d.ts +2 -0
  108. package/lib/utils/browser.d.ts +1 -0
  109. package/lib/utils/bytes.d.ts +1 -0
  110. package/lib/utils/canvas.d.ts +7 -0
  111. package/lib/utils/collisions.d.ts +3 -0
  112. package/lib/utils/coordinates.d.ts +13 -0
  113. package/lib/utils/cssom.d.ts +5 -0
  114. package/lib/utils/decoding.d.ts +2 -0
  115. package/lib/utils/dom.d.ts +5 -0
  116. package/lib/utils/easings.d.ts +17 -0
  117. package/lib/utils/events.d.ts +8 -0
  118. package/lib/utils/file.d.ts +1 -0
  119. package/lib/utils/function.d.ts +2 -0
  120. package/lib/utils/gestures.d.ts +1 -0
  121. package/lib/utils/index.cjs +1 -1
  122. package/lib/utils/index.d.ts +27 -0
  123. package/lib/utils/index.js +155 -140
  124. package/lib/utils/jss.d.ts +12 -0
  125. package/lib/utils/layout.d.ts +3 -0
  126. package/lib/utils/math.d.ts +11 -0
  127. package/lib/utils/number.d.ts +3 -0
  128. package/lib/utils/object.d.ts +9 -0
  129. package/lib/utils/polyfills.d.ts +1 -0
  130. package/lib/utils/promises.d.ts +1 -0
  131. package/lib/utils/string.d.ts +8 -0
  132. package/lib/utils/style.d.ts +2 -0
  133. package/lib/utils/ts-shape.d.ts +20 -0
  134. package/lib/utils/ts-utility.d.ts +26 -0
  135. package/lib/utils/url.d.ts +9 -0
  136. package/lib/video/index.d.ts +21 -0
  137. package/lib/window-resizer/index.d.ts +9 -0
  138. package/package.json +3 -21
  139. package/lib/file-BEr-o55N.js +0 -31
  140. package/lib/file-C9BbxzVU.cjs +0 -1
  141. package/lib/morph/index.cjs +0 -1
  142. package/lib/morph/index.js +0 -225
  143. package/lib/object-CCiXnER2.cjs +0 -1
  144. package/lib/object-D6MVWB4l.js +0 -85
  145. package/lib/router/index.cjs +0 -1
  146. package/lib/router/index.js +0 -266
  147. package/lib/url-C3dWnJQg.cjs +0 -1
  148. package/lib/url-DMNfW7uN.js +0 -22
@@ -1,31 +0,0 @@
1
- function c(n) {
2
- n.dispatchEvent(
3
- new CustomEvent("sizeChange", {
4
- bubbles: !0,
5
- composed: !0
6
- })
7
- );
8
- }
9
- function s(n) {
10
- n.dispatchEvent(
11
- new CustomEvent("beforeSizeChange", {
12
- bubbles: !0,
13
- composed: !0
14
- })
15
- );
16
- }
17
- function i(n, t) {
18
- const o = new Blob([JSON.stringify(t)], { type: "application/json" }), e = document.createElement("a");
19
- e.download = n + ".json", e.href = window.URL.createObjectURL(o), e.dataset.downloadurl = ["application/json", e.download, e.href].join(":");
20
- const a = new MouseEvent("click", {
21
- view: window,
22
- bubbles: !0,
23
- cancelable: !0
24
- });
25
- e.dispatchEvent(a), e.remove();
26
- }
27
- export {
28
- s as a,
29
- i as c,
30
- c as d
31
- };
@@ -1 +0,0 @@
1
- "use strict";function i(n){n.dispatchEvent(new CustomEvent("sizeChange",{bubbles:!0,composed:!0}))}function c(n){n.dispatchEvent(new CustomEvent("beforeSizeChange",{bubbles:!0,composed:!0}))}function s(n,t){const o=new Blob([JSON.stringify(t)],{type:"application/json"}),e=document.createElement("a");e.download=n+".json",e.href=window.URL.createObjectURL(o),e.dataset.downloadurl=["application/json",e.download,e.href].join(":");const a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(a),e.remove()}exports.createJSONAndSave=s;exports.dispatchBeforeSizeChangeEvent=c;exports.dispatchSizeChangeEvent=i;
@@ -1 +0,0 @@
1
- "use strict";var it=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s),st=s=>{throw TypeError(s)};var _=(s,t,i)=>t.has(s)||st("Cannot "+i);var e=(s,t,i)=>(_(s,t,"read from private field"),i?i.call(s):t.get(s)),o=(s,t,i)=>t.has(s)?st("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),c=(s,t,i,r)=>(_(s,t,"write to private field"),r?r.call(s,i):t.set(s,i),i),m=(s,t,i)=>(_(s,t,"access private method"),i);var k=(s,t,i)=>new Promise((r,n)=>{var d=u=>{try{p(i.next(u))}catch(E){n(E)}},g=u=>{try{p(i.throw(u))}catch(E){n(E)}},p=u=>u.done?r(u.value):Promise.resolve(u.value).then(d,g);p((i=i.apply(s,t)).next())});var nt=(s,t,i)=>(t=s[it("asyncIterator")])?t.call(s):(s=s[it("iterator")](),t={},i=(r,n)=>(n=s[r])&&(t[r]=d=>new Promise((g,p,u)=>(d=n.call(s,d),u=d.done,Promise.resolve(d.value).then(E=>g({value:E,done:u}),p)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("../notifier/index.cjs"),lt=require("../browser-CpzFX2xg.cjs"),G=require("../url-C3dWnJQg.cjs");var y,h,f,C,A,S,M;class ut{constructor(t,i){o(this,y);o(this,h);o(this,f);o(this,C);o(this,A);o(this,S,t=>{t.preventDefault(),e(this,y).links.forEach(i=>{var r;e(this,f)===e(i,f)||(r=e(i,A))!=null&&r.includes(e(this,f))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,y).navigate(e(this,f),e(this,C))});o(this,M,()=>{e(this,y).prefetch(e(this,f)),e(this,h).removeEventListener("pointerenter",e(this,M))});var d,g;c(this,y,i),c(this,h,t),c(this,f,e(this,h).getAttribute("href")||"/"),c(this,C,e(this,h).getAttribute("data-history-action")||"push"),e(this,h).addEventListener("click",e(this,S));const r=i.normalizePath(e(this,f)),n=i.normalizePath(location.pathname);c(this,A,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(p=>i.normalizePath(p.trim()).pathname)),e(this,h).hasAttribute("data-include")?n.pathname.includes(r.pathname)&&e(this,h).classList.add("current"):r.pathname===n.pathname||(g=e(this,A))!=null&&g.includes(n.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,M))}destroy(){e(this,h).removeEventListener("click",e(this,S)),e(this,h).removeEventListener("pointerenter",e(this,M)),e(this,h).classList.remove("current")}}y=new WeakMap,h=new WeakMap,f=new WeakMap,C=new WeakMap,A=new WeakMap,S=new WeakMap,M=new WeakMap;var H,z,q,x,N,B,P,L,w,D,R,l,J,Q,U,at,V,W;class dt{constructor(t){o(this,l);o(this,H,null);o(this,z,null);o(this,q,null);o(this,x,null);o(this,N,[]);o(this,B,new DOMParser);o(this,P,new Map);o(this,L);o(this,w,null);o(this,D,new rt.Notifier);o(this,R,new rt.Notifier);o(this,W,t=>{t.state&&this.navigate(t.state,"none")});if(lt.isBrowser){t!=null&&t.base?c(this,H,G.normalizeBase(t.base)):c(this,H,"/"),c(this,z,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,q,(t==null?void 0:t.cachePages)!==!1),c(this,x,m(this,l,U).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,w,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,w)),document.documentElement.setAttribute("data-current-leaf",i.leaf),m(this,l,Q).call(this),addEventListener("popstate",e(this,W))}}get currentPathname(){return e(this,w)}get links(){return e(this,N)}normalizePath(t){return G.splitPath(t,e(this,H))}beforeNavigationEvent(t){return e(this,D).subscribe(t)}afterNavigationEvent(t){return e(this,R).subscribe(t)}prefetch(t){return k(this,null,function*(){const i=this.normalizePath(t);return m(this,l,J).call(this,i.pathname)})}navigate(t,i="push"){return k(this,null,function*(){var E;const r=this.normalizePath(t);let{pathname:n,hash:d,parameters:g,leaf:p}=r;if(e(this,L)===n||e(this,w)===n)return;c(this,L,n);const u=e(this,P).has(n);try{let F=!0;if(e(this,D).notify({pathname:n,isCached:u}),this.preprocessor)try{yield new Promise((a,b)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:n,resolve:a,reject:b,isCached:u})})}catch(a){a?console.error(a):console.log("Route change canceled"),F=!1}if(!F||e(this,L)!==n)return;const X=e(this,P).get(n)||(yield m(this,l,J).call(this,n));if(e(this,L)!==n)return;const Z=Array.from(document.head.children),$=Array.from(X.head.cloneNode(!0).children),tt=m(this,l,at).call(this,Z,$),ot=m(this,l,V).call(this,Z,tt),I=m(this,l,V).call(this,$,tt);I.forEach((a,b)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=a.getAttribute("src"),I[b]=v}}),I.forEach(a=>{document.head.appendChild(a)});const j=I.filter(a=>(a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK")&&a.getAttribute("rel")!=="canonical");e(this,z)&&j.length&&(yield new Promise(a=>k(this,null,function*(){let b=0;try{for(var v=nt(j),ct,K,O;ct=!(K=yield v.next()).done;ct=!1){const T=K.value;T.onload=()=>{b++,b===j.length&&a()}}}catch(K){O=[K]}finally{try{ct&&(K=v.return)&&(yield K.call(v))}finally{if(O)throw O[0]}}}))),ot.forEach(a=>{a.hasAttribute("data-permanent")||a.remove()}),c(this,w,n),G.changeHistory(i,n,g,d);const ht=m(this,l,U).call(this,X.body.cloneNode(!0));e(this,x).forEach((a,b)=>{const v=ht[b];let ct=[...a.childNodes],K=[...v.childNodes];ct.forEach(O=>{if(O instanceof HTMLElement){const T=O.getAttribute("data-remain");let et;K=K.filter(Y=>Y instanceof HTMLElement&&T&&Y.getAttribute("data-remain")===T?(et=Y,!1):!0),T&&et||O.remove()}else O.remove()}),a.append(...K)}),m(this,l,Q).call(this),document.documentElement.setAttribute("data-current-pathname",n),document.documentElement.setAttribute("data-current-leaf",p),(E=this.postprocessor)==null||E.call(this,{pathname:n,isCached:u}),e(this,R).notify({pathname:n,isCached:u})}catch(F){console.error(F)}c(this,L,void 0)})}}H=new WeakMap,z=new WeakMap,q=new WeakMap,x=new WeakMap,N=new WeakMap,B=new WeakMap,P=new WeakMap,L=new WeakMap,w=new WeakMap,D=new WeakMap,R=new WeakMap,l=new WeakSet,J=function(t){return k(this,null,function*(){const i=e(this,P).get(t);if(i)return i;const n=yield(yield fetch(t)).text(),d=e(this,B).parseFromString(n,"text/html");return e(this,q)&&e(this,P).set(t,d),d})},Q=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var r;return(r=i.getAttribute("href"))==null?void 0:r.startsWith("/")});e(this,N).forEach(i=>i.destroy()),c(this,N,t.map(i=>new ut(i,this)))},U=function(t){return[...t.querySelectorAll("[data-morph]")]},at=function(t,i){return t.filter(r=>i.find(n=>n.outerHTML===r.outerHTML))},V=function(t,i){return t.filter(r=>!i.find(n=>n.outerHTML===r.outerHTML))},W=new WeakMap;exports.Morph=dt;
@@ -1,225 +0,0 @@
1
- var et = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s), it = (s) => {
2
- throw TypeError(s);
3
- };
4
- var G = (s, t, i) => t.has(s) || it("Cannot " + i);
5
- var e = (s, t, i) => (G(s, t, "read from private field"), i ? i.call(s) : t.get(s)), o = (s, t, i) => t.has(s) ? it("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, i), c = (s, t, i, a) => (G(s, t, "write to private field"), a ? a.call(s, i) : t.set(s, i), i), m = (s, t, i) => (G(s, t, "access private method"), i);
6
- var k = (s, t, i) => new Promise((a, n) => {
7
- var d = (u) => {
8
- try {
9
- p(i.next(u));
10
- } catch (E) {
11
- n(E);
12
- }
13
- }, g = (u) => {
14
- try {
15
- p(i.throw(u));
16
- } catch (E) {
17
- n(E);
18
- }
19
- }, p = (u) => u.done ? a(u.value) : Promise.resolve(u.value).then(d, g);
20
- p((i = i.apply(s, t)).next());
21
- });
22
- var st = (s, t, i) => (t = s[et("asyncIterator")]) ? t.call(s) : (s = s[et("iterator")](), t = {}, i = (a, n) => (n = s[a]) && (t[a] = (d) => new Promise((g, p, u) => (d = n.call(s, d), u = d.done, Promise.resolve(d.value).then((E) => g({ value: E, done: u }), p)))), i("next"), i("return"), t);
23
- import { Notifier as nt } from "../notifier/index.js";
24
- import { i as ct } from "../browser-0zX67oeU.js";
25
- import { n as lt, s as ut, c as dt } from "../url-DMNfW7uN.js";
26
- var A, h, f, C, y, z, H;
27
- class mt {
28
- constructor(t, i) {
29
- o(this, A);
30
- o(this, h);
31
- o(this, f);
32
- o(this, C);
33
- o(this, y);
34
- o(this, z, (t) => {
35
- t.preventDefault(), e(this, A).links.forEach((i) => {
36
- var a;
37
- e(this, f) === e(i, f) || (a = e(i, y)) != null && a.includes(e(this, f)) ? e(i, h).classList.add("clicked") : e(i, h).classList.remove("clicked");
38
- }), e(this, A).navigate(e(this, f), e(this, C));
39
- });
40
- o(this, H, () => {
41
- e(this, A).prefetch(e(this, f)), e(this, h).removeEventListener("pointerenter", e(this, H));
42
- });
43
- var d, g;
44
- c(this, A, i), c(this, h, t), c(this, f, e(this, h).getAttribute("href") || "/"), c(this, C, e(this, h).getAttribute(
45
- "data-history-action"
46
- ) || "push"), e(this, h).addEventListener("click", e(this, z));
47
- const a = i.normalizePath(e(this, f)), n = i.normalizePath(location.pathname);
48
- c(this, y, (d = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : d.split(",").map((p) => i.normalizePath(p.trim()).pathname)), e(this, h).hasAttribute("data-include") ? n.pathname.includes(a.pathname) && e(this, h).classList.add("current") : a.pathname === n.pathname || (g = e(this, y)) != null && g.includes(n.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, H));
49
- }
50
- destroy() {
51
- e(this, h).removeEventListener("click", e(this, z)), e(this, h).removeEventListener("pointerenter", e(this, H)), e(this, h).classList.remove("current");
52
- }
53
- }
54
- A = new WeakMap(), h = new WeakMap(), f = new WeakMap(), C = new WeakMap(), y = new WeakMap(), z = new WeakMap(), H = new WeakMap();
55
- var M, S, x, D, N, O, P, b, w, R, F, l, J, Q, U, at, V, W;
56
- class Lt {
57
- constructor(t) {
58
- o(this, l);
59
- o(this, M, null);
60
- o(this, S, null);
61
- o(this, x, null);
62
- o(this, D, null);
63
- o(this, N, []);
64
- o(this, O, new DOMParser());
65
- o(this, P, /* @__PURE__ */ new Map());
66
- o(this, b);
67
- o(this, w, null);
68
- o(this, R, new nt());
69
- o(this, F, new nt());
70
- o(this, W, (t) => {
71
- t.state && this.navigate(t.state, "none");
72
- });
73
- if (ct) {
74
- t != null && t.base ? c(this, M, lt(t.base)) : c(this, M, "/"), c(this, S, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, x, (t == null ? void 0 : t.cachePages) !== !1), c(this, D, m(this, l, U).call(this, document.body));
75
- const i = this.normalizePath(location.pathname);
76
- c(this, w, i.pathname), document.documentElement.setAttribute(
77
- "data-current-pathname",
78
- e(this, w)
79
- ), document.documentElement.setAttribute(
80
- "data-current-leaf",
81
- i.leaf
82
- ), m(this, l, Q).call(this), addEventListener("popstate", e(this, W));
83
- }
84
- }
85
- get currentPathname() {
86
- return e(this, w);
87
- }
88
- get links() {
89
- return e(this, N);
90
- }
91
- normalizePath(t) {
92
- return ut(t, e(this, M));
93
- }
94
- beforeNavigationEvent(t) {
95
- return e(this, R).subscribe(t);
96
- }
97
- afterNavigationEvent(t) {
98
- return e(this, F).subscribe(t);
99
- }
100
- prefetch(t) {
101
- return k(this, null, function* () {
102
- const i = this.normalizePath(t);
103
- return m(this, l, J).call(this, i.pathname);
104
- });
105
- }
106
- navigate(t, i = "push") {
107
- return k(this, null, function* () {
108
- var E;
109
- const a = this.normalizePath(t);
110
- let { pathname: n, hash: d, parameters: g, leaf: p } = a;
111
- if (e(this, b) === n || e(this, w) === n)
112
- return;
113
- c(this, b, n);
114
- const u = e(this, P).has(n);
115
- try {
116
- let I = !0;
117
- if (e(this, R).notify({
118
- pathname: n,
119
- isCached: u
120
- }), this.preprocessor)
121
- try {
122
- yield new Promise((r, L) => {
123
- var v;
124
- (v = this.preprocessor) == null || v.call(this, { pathname: n, resolve: r, reject: L, isCached: u });
125
- });
126
- } catch (r) {
127
- r ? console.error(r) : console.log("Route change canceled"), I = !1;
128
- }
129
- if (!I || e(this, b) !== n)
130
- return;
131
- const X = e(this, P).get(n) || (yield m(this, l, J).call(this, n));
132
- if (e(this, b) !== n)
133
- return;
134
- const Z = Array.from(document.head.children), _ = Array.from(
135
- X.head.cloneNode(!0).children
136
- ), $ = m(this, l, at).call(this, Z, _), rt = m(this, l, V).call(this, Z, $), q = m(this, l, V).call(this, _, $);
137
- q.forEach((r, L) => {
138
- if (r.tagName === "SCRIPT" && r.getAttribute("src")) {
139
- const v = document.createElement("script");
140
- v.type = "module", v.src = r.getAttribute("src"), q[L] = v;
141
- }
142
- }), q.forEach((r) => {
143
- document.head.appendChild(r);
144
- });
145
- const K = q.filter(
146
- (r) => (r.tagName === "STYLE" || r.tagName === "SCRIPT" || r.tagName === "LINK") && r.getAttribute("rel") !== "canonical"
147
- );
148
- e(this, S) && K.length && (yield new Promise((r) => k(this, null, function* () {
149
- let L = 0;
150
- try {
151
- for (var v = st(K), ht, Y, B; ht = !(Y = yield v.next()).done; ht = !1) {
152
- const T = Y.value;
153
- T.onload = () => {
154
- L++, L === K.length && r();
155
- };
156
- }
157
- } catch (Y) {
158
- B = [Y];
159
- } finally {
160
- try {
161
- ht && (Y = v.return) && (yield Y.call(v));
162
- } finally {
163
- if (B)
164
- throw B[0];
165
- }
166
- }
167
- }))), rt.forEach((r) => {
168
- r.hasAttribute("data-permanent") || r.remove();
169
- }), c(this, w, n), dt(i, n, g, d);
170
- const ot = m(this, l, U).call(this, X.body.cloneNode(!0));
171
- e(this, D).forEach((r, L) => {
172
- const v = ot[L];
173
- let ht = [...r.childNodes], Y = [...v.childNodes];
174
- ht.forEach((B) => {
175
- if (B instanceof HTMLElement) {
176
- const T = B.getAttribute("data-remain");
177
- let tt;
178
- Y = Y.filter(
179
- (j) => j instanceof HTMLElement && T && j.getAttribute("data-remain") === T ? (tt = j, !1) : !0
180
- ), T && tt || B.remove();
181
- } else
182
- B.remove();
183
- }), r.append(...Y);
184
- }), m(this, l, Q).call(this), document.documentElement.setAttribute("data-current-pathname", n), document.documentElement.setAttribute("data-current-leaf", p), (E = this.postprocessor) == null || E.call(this, { pathname: n, isCached: u }), e(this, F).notify({ pathname: n, isCached: u });
185
- } catch (I) {
186
- console.error(I);
187
- }
188
- c(this, b, void 0);
189
- });
190
- }
191
- }
192
- M = new WeakMap(), S = new WeakMap(), x = new WeakMap(), D = new WeakMap(), N = new WeakMap(), O = new WeakMap(), P = new WeakMap(), b = new WeakMap(), w = new WeakMap(), R = new WeakMap(), F = new WeakMap(), l = new WeakSet(), J = function(t) {
193
- return k(this, null, function* () {
194
- const i = e(this, P).get(t);
195
- if (i)
196
- return i;
197
- const n = yield (yield fetch(t)).text(), d = e(this, O).parseFromString(n, "text/html");
198
- return e(this, x) && e(this, P).set(t, d), d;
199
- });
200
- }, Q = function() {
201
- const t = [
202
- ...document.documentElement.querySelectorAll("a")
203
- ].filter((i) => {
204
- var a;
205
- return (a = i.getAttribute("href")) == null ? void 0 : a.startsWith("/");
206
- });
207
- e(this, N).forEach((i) => i.destroy()), c(this, N, t.map((i) => new mt(i, this)));
208
- }, U = function(t) {
209
- return [...t.querySelectorAll("[data-morph]")];
210
- }, at = function(t, i) {
211
- return t.filter(
212
- (a) => i.find(
213
- (n) => n.outerHTML === a.outerHTML
214
- )
215
- );
216
- }, V = function(t, i) {
217
- return t.filter(
218
- (a) => !i.find(
219
- (n) => n.outerHTML === a.outerHTML
220
- )
221
- );
222
- }, W = new WeakMap();
223
- export {
224
- Lt as Morph
225
- };
@@ -1 +0,0 @@
1
- "use strict";function s(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function f(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Node)return e;const t=Array.isArray(e)?[]:{};for(const r in e)e.hasOwnProperty(r)&&(t[r]=f(e[r]));return t}function c(e,t,r=s){for(const n in t)r(t[n])?(e[n]||Object.assign(e,{[n]:{}}),c(e[n],t[n],r)):Object.assign(e,{[n]:t[n]});return e}function u(e){return e===null||typeof e=="undefined"}function i(e,t){if(typeof e!=typeof t)return!1;if([e,t].some(r=>u(r)))return e===t;if(Array.isArray(e)){const r=e.length>t.length?e:t,n=e.length>t.length?t:e;return r.every((p,y)=>i(p,n[y]))}if(typeof e!="object"||e instanceof Node||typeof e=="object"&&e.constructor.toString().startsWith("class"))return e===t;for(const r in e){if(!t.hasOwnProperty(r))return!1;if(typeof e[r]=="object"&&typeof t[r]=="object"){if(!i(e[r],t[r]))return!1}else if(e[r]!==t[r])return!1}return!0}function l(e,t){const r={};for(const n in e)t.includes(n)&&(r[n]=e[n]);return r}function o(e,t){const r={};for(const n in e)t.includes(n)||(r[n]=e[n]);return r}function a(e){var t;return typeof e=="function"&&((t=Object.getOwnPropertyDescriptor(e,"prototype"))==null?void 0:t.writable)===!1}function O(e,...t){t.forEach(r=>{Object.getOwnPropertyNames(r.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n)||Object.create(null))})})}exports.cloneDeep=f;exports.compareObjects=i;exports.isESClass=a;exports.isNullish=u;exports.isObject=s;exports.mergeDeep=c;exports.mixin=O;exports.omit=o;exports.pick=l;
@@ -1,85 +0,0 @@
1
- function c(e) {
2
- return typeof e == "object" && e !== null && !Array.isArray(e);
3
- }
4
- function y(e) {
5
- if (e === null || typeof e != "object")
6
- return e;
7
- if (e instanceof Date)
8
- return new Date(e.getTime());
9
- if (e instanceof Node)
10
- return e;
11
- const t = Array.isArray(e) ? [] : {};
12
- for (const r in e)
13
- e.hasOwnProperty(r) && (t[r] = y(e[r]));
14
- return t;
15
- }
16
- function a(e, t, r = c) {
17
- for (const n in t)
18
- r(t[n]) ? (e[n] || Object.assign(e, { [n]: {} }), a(e[n], t[n], r)) : Object.assign(e, { [n]: t[n] });
19
- return e;
20
- }
21
- function u(e) {
22
- return e === null || typeof e == "undefined";
23
- }
24
- function i(e, t) {
25
- if (typeof e != typeof t)
26
- return !1;
27
- if ([e, t].some((r) => u(r)))
28
- return e === t;
29
- if (Array.isArray(e)) {
30
- const r = e.length > t.length ? e : t, n = e.length > t.length ? t : e;
31
- return r.every(
32
- (s, f) => i(s, n[f])
33
- );
34
- }
35
- if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
36
- return e === t;
37
- for (const r in e) {
38
- if (!t.hasOwnProperty(r))
39
- return !1;
40
- if (typeof e[r] == "object" && typeof t[r] == "object") {
41
- if (!i(e[r], t[r]))
42
- return !1;
43
- } else if (e[r] !== t[r])
44
- return !1;
45
- }
46
- return !0;
47
- }
48
- function p(e, t) {
49
- const r = {};
50
- for (const n in e)
51
- t.includes(n) && (r[n] = e[n]);
52
- return r;
53
- }
54
- function o(e, t) {
55
- const r = {};
56
- for (const n in e)
57
- t.includes(n) || (r[n] = e[n]);
58
- return r;
59
- }
60
- function l(e) {
61
- var t;
62
- return typeof e == "function" && ((t = Object.getOwnPropertyDescriptor(e, "prototype")) == null ? void 0 : t.writable) === !1;
63
- }
64
- function O(e, ...t) {
65
- t.forEach((r) => {
66
- Object.getOwnPropertyNames(r.prototype).forEach((n) => {
67
- Object.defineProperty(
68
- e.prototype,
69
- n,
70
- Object.getOwnPropertyDescriptor(r.prototype, n) || /* @__PURE__ */ Object.create(null)
71
- );
72
- });
73
- });
74
- }
75
- export {
76
- c as a,
77
- u as b,
78
- y as c,
79
- i as d,
80
- O as e,
81
- l as i,
82
- a as m,
83
- o,
84
- p
85
- };
@@ -1 +0,0 @@
1
- "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,C))}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
@@ -1,266 +0,0 @@
1
- var X = (a, e) => (e = Symbol[a]) ? e : Symbol.for("Symbol." + a), Z = (a) => {
2
- throw TypeError(a);
3
- };
4
- var W = (a, e, s) => e.has(a) || Z("Cannot " + s);
5
- var t = (a, e, s) => (W(a, e, "read from private field"), s ? s.call(a) : e.get(a)), h = (a, e, s) => e.has(a) ? Z("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, s), n = (a, e, s, i) => (W(a, e, "write to private field"), i ? i.call(a, s) : e.set(a, s), s), Y = (a, e, s) => (W(a, e, "access private method"), s);
6
- var I = (a, e, s) => new Promise((i, r) => {
7
- var o = (m) => {
8
- try {
9
- f(s.next(m));
10
- } catch (w) {
11
- r(w);
12
- }
13
- }, c = (m) => {
14
- try {
15
- f(s.throw(m));
16
- } catch (w) {
17
- r(w);
18
- }
19
- }, f = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(o, c);
20
- f((s = s.apply(a, e)).next());
21
- });
22
- var $ = (a, e, s) => (e = a[X("asyncIterator")]) ? e.call(a) : (a = a[X("iterator")](), e = {}, s = (i, r) => (r = a[i]) && (e[i] = (o) => new Promise((c, f, m) => (o = r.call(a, o), m = o.done, Promise.resolve(o.value).then((w) => c({ value: w, done: m }), f)))), s("next"), s("return"), e);
23
- import { URLPattern as at } from "urlpattern-polyfill";
24
- import { Notifier as nt } from "../notifier/index.js";
25
- import { i as _ } from "../browser-0zX67oeU.js";
26
- import { d as ht } from "../function-C10DGppn.js";
27
- import { n as rt, c as ot, s as ct } from "../url-DMNfW7uN.js";
28
- import { i as lt } from "../object-D6MVWB4l.js";
29
- var y, U, A, p, d, L, k, v, E, R, M, tt;
30
- class ut {
31
- constructor(e, s) {
32
- h(this, M);
33
- h(this, y);
34
- h(this, U);
35
- h(this, A);
36
- h(this, p);
37
- h(this, d);
38
- h(this, L);
39
- h(this, k);
40
- h(this, v, null);
41
- h(this, E, []);
42
- h(this, R, []);
43
- n(this, y, e), n(this, U, s), n(this, A, new URLPattern({ pathname: t(this, y) })), n(this, p, null), n(this, d, null), n(this, L, !1), n(this, k, null), _ && n(this, v, new MutationObserver((i) => {
44
- i[0].addedNodes.forEach((o) => {
45
- t(this, p) ? t(this, R).push(o) : t(this, E).push(o);
46
- });
47
- }));
48
- }
49
- get pattern() {
50
- return t(this, y);
51
- }
52
- get urlPattern() {
53
- return t(this, A);
54
- }
55
- get isActive() {
56
- return t(this, L);
57
- }
58
- get element() {
59
- return t(this, d);
60
- }
61
- get nest() {
62
- return t(this, k);
63
- }
64
- testPathname(e) {
65
- return this.urlPattern.test({ pathname: e });
66
- }
67
- render(e, s) {
68
- return I(this, null, function* () {
69
- var i, r;
70
- if (t(this, v).observe(document.head, {
71
- childList: !0,
72
- subtree: !0
73
- }), t(this, p))
74
- t(this, E).forEach((o) => {
75
- document.head.appendChild(o);
76
- });
77
- else {
78
- const o = yield t(this, U).call(this);
79
- if (n(this, R, [...t(this, E)]), typeof o.default == "function" && (n(this, p, o.default), lt(o.default))) {
80
- const c = "e-" + ((i = t(this, p)) == null ? void 0 : i.name.toLowerCase());
81
- customElements.get(c) || customElements.define(c, o.default);
82
- }
83
- }
84
- if (yield Y(this, M, tt).call(this), t(this, p)) {
85
- const o = t(this, A).exec({ pathname: s }), c = (o == null ? void 0 : o.pathname.groups) || {}, f = Object.fromEntries(
86
- new URLSearchParams(location.search)
87
- ), m = {
88
- pathnameParams: c,
89
- searchParams: f
90
- };
91
- n(this, d, new (t(this, p))(m)), e.appendChild(t(this, d)), n(this, k, t(this, d).querySelector("[data-nest]") || ((r = t(this, d).shadowRoot) == null ? void 0 : r.querySelector("[data-nest]")) || t(this, d).shadowRoot || t(this, d)), n(this, L, !0);
92
- }
93
- t(this, v).disconnect();
94
- });
95
- }
96
- close() {
97
- var e;
98
- t(this, v).disconnect(), (e = t(this, d)) == null || e.remove(), n(this, L, !1), t(this, R).forEach((s) => document.head.removeChild(s)), n(this, R, []);
99
- }
100
- getAnchorElements() {
101
- var s;
102
- let e = [];
103
- return t(this, d) && (e = [...t(this, d).querySelectorAll("a")]), (s = t(this, d)) != null && s.shadowRoot && (e = [
104
- ...e,
105
- ...t(this, d).shadowRoot.querySelectorAll("a")
106
- ]), e;
107
- }
108
- }
109
- y = new WeakMap(), U = new WeakMap(), A = new WeakMap(), p = new WeakMap(), d = new WeakMap(), L = new WeakMap(), k = new WeakMap(), v = new WeakMap(), E = new WeakMap(), R = new WeakMap(), M = new WeakSet(), tt = function() {
110
- return I(this, null, function* () {
111
- const e = t(this, E).filter((c) => c instanceof HTMLElement ? c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK" : !1);
112
- try {
113
- for (var s = $(e), i, r, o; i = !(r = yield s.next()).done; i = !1) {
114
- const c = r.value;
115
- yield new Promise((f) => {
116
- c.onload = () => {
117
- f();
118
- };
119
- });
120
- }
121
- } catch (r) {
122
- o = [r];
123
- } finally {
124
- try {
125
- i && (r = s.return) && (yield r.call(s));
126
- } finally {
127
- if (o)
128
- throw o[0];
129
- }
130
- }
131
- });
132
- };
133
- var S, u, P, O, N, x;
134
- class mt {
135
- constructor(e, s) {
136
- h(this, S);
137
- h(this, u);
138
- h(this, P);
139
- h(this, O);
140
- h(this, N);
141
- h(this, x, (e) => {
142
- e.preventDefault(), t(this, S).links.forEach((s) => {
143
- var i;
144
- t(this, P) === t(s, P) || (i = t(s, N)) != null && i.includes(t(this, P)) ? t(s, u).classList.add("clicked") : t(s, u).classList.remove("clicked");
145
- }), t(this, S).navigate(t(this, P), t(this, O));
146
- });
147
- var o, c;
148
- n(this, S, e), n(this, u, s), n(this, P, t(this, u).getAttribute("href") || "/"), n(this, O, t(this, u).getAttribute(
149
- "data-history-action"
150
- ) || "push"), t(this, u).addEventListener("click", t(this, x));
151
- const i = e.normalizePath(t(this, P)), r = e.normalizePath(location.pathname);
152
- n(this, N, (o = t(this, u).getAttribute("data-match-paths")) == null ? void 0 : o.split(",").map((f) => e.normalizePath(f.trim()).pathname)), t(this, u).hasAttribute("data-include") ? r.pathname.includes(i.pathname) && t(this, u).classList.add("current") : i.pathname === r.pathname || (c = t(this, N)) != null && c.includes(r.pathname) ? (t(this, u).classList.add("current"), t(this, u).classList.add("clicked")) : t(this, u).classList.remove("clicked");
153
- }
154
- destroy() {
155
- t(this, u).removeEventListener("click", t(this, x)), t(this, u).classList.remove("current");
156
- }
157
- }
158
- S = new WeakMap(), u = new WeakMap(), P = new WeakMap(), O = new WeakMap(), N = new WeakMap(), x = new WeakMap();
159
- globalThis.URLPattern = at;
160
- var C, z, g, q, H, b, T, B, j, D, et, K;
161
- class vt {
162
- constructor(e) {
163
- h(this, D);
164
- h(this, C, null);
165
- h(this, z, null);
166
- h(this, g, []);
167
- h(this, q, null);
168
- h(this, H, []);
169
- h(this, b);
170
- h(this, T, null);
171
- h(this, B, new nt());
172
- h(this, j, ht(() => {
173
- const e = (s) => s.split("/").length;
174
- n(this, g, t(this, g).sort((s, i) => e(s.pattern) - e(i.pattern))), this.navigate(location.pathname);
175
- }, 0));
176
- h(this, K, (e) => {
177
- e.state && this.navigate(e.state, "none");
178
- });
179
- _ && (e != null && e.base ? n(this, z, rt(e.base)) : n(this, z, "/"), n(this, C, (e == null ? void 0 : e.rootElement) || document.body), addEventListener("popstate", t(this, K)));
180
- }
181
- get currentPathname() {
182
- return t(this, T);
183
- }
184
- get candidatePathname() {
185
- return t(this, b);
186
- }
187
- get routes() {
188
- return t(this, g);
189
- }
190
- get links() {
191
- return t(this, H);
192
- }
193
- navigationEvent(e) {
194
- return t(this, B).subscribe(e);
195
- }
196
- defineRoute(e, s) {
197
- const i = new ut(e, s);
198
- t(this, g).push(i), t(this, j).call(this);
199
- }
200
- navigate(e, s = "push") {
201
- return I(this, null, function* () {
202
- var J, Q;
203
- const i = this.normalizePath(e);
204
- let { pathname: r, hash: o, parameters: c, leaf: f } = i;
205
- if (t(this, b) === r || t(this, T) === r)
206
- return;
207
- n(this, b, r);
208
- const m = t(this, g).filter((l) => l.isActive), w = t(this, g).filter(
209
- (l) => !m.includes(l) && l.testPathname(f)
210
- ), st = m.filter((l) => !l.testPathname(f)), F = m.filter((l) => l.testPathname(f));
211
- let G = !0;
212
- if (this.preprocessor)
213
- try {
214
- yield new Promise((l, it) => {
215
- var V;
216
- (V = this.preprocessor) == null || V.call(this, { path: i, resolve: l, reject: it });
217
- });
218
- } catch (l) {
219
- l ? console.error(l) : console.log("Route change canceled"), G = !1;
220
- }
221
- if (G && t(this, b) === r) {
222
- n(this, q, F[F.length - 1]), st.forEach((l) => {
223
- l.close();
224
- }), n(this, T, r), ot(s, r, c, o);
225
- try {
226
- for (var bt = $(w), yt, At, kt; yt = !(At = yield bt.next()).done; yt = !1) {
227
- const l = At.value;
228
- yield l.render(((J = t(this, q)) == null ? void 0 : J.nest) || t(this, C), r), n(this, q, l);
229
- }
230
- } catch (At) {
231
- kt = [At];
232
- } finally {
233
- try {
234
- yt && (At = bt.return) && (yield At.call(bt));
235
- } finally {
236
- if (kt)
237
- throw kt[0];
238
- }
239
- }
240
- Y(this, D, et).call(this), (Q = this.postprocessor) == null || Q.call(this, { pathname: r }), t(this, B).notify({ pathname: r });
241
- }
242
- });
243
- }
244
- normalizePath(e) {
245
- return ct(e, t(this, z));
246
- }
247
- }
248
- C = new WeakMap(), z = new WeakMap(), g = new WeakMap(), q = new WeakMap(), H = new WeakMap(), b = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), D = new WeakSet(), et = function() {
249
- const e = t(this, g).filter((i) => i.isActive), s = Array.from(
250
- new Set(
251
- [
252
- ...t(this, C).querySelectorAll("a"),
253
- ...e.map((i) => i.getAnchorElements()).flat()
254
- ].filter((i) => {
255
- var r;
256
- return (r = i.getAttribute("href")) == null ? void 0 : r.startsWith("/");
257
- })
258
- )
259
- );
260
- t(this, H).forEach((i) => {
261
- i.destroy();
262
- }), n(this, H, s.map((i) => new mt(this, i)));
263
- }, K = new WeakMap();
264
- export {
265
- vt as Router
266
- };
@@ -1 +0,0 @@
1
- "use strict";function h(t,n=""){n=n.endsWith("/")?n.slice(0,-1):n,t=t.replace(n,""),t.startsWith("/")&&(t=t.slice(1));const c=t.split("#"),s=c[0].split("?"),i=s[0].startsWith("/")?s[0]:"/"+s[0],o=n+i,e=s==null?void 0:s[1],r=c==null?void 0:c[1];return{leaf:i,pathname:o,parameters:e,hash:r}}function p(t){return t.endsWith("/")||(t+="/"),t}function a(t,n,c,s){const i=c||location.search,o=s?s.startsWith("#")?s:"#"+s:"",e=i?i.startsWith("?")?i:"?"+i:"",r=`${n}${o}${e}`;t==="push"?history.pushState(r,"",r):t==="replace"&&history.replaceState(r,"",r)}exports.changeHistory=a;exports.normalizeBase=p;exports.splitPath=h;
@@ -1,22 +0,0 @@
1
- function h(t, n = "") {
2
- n = n.endsWith("/") ? n.slice(0, -1) : n, t = t.replace(n, ""), t.startsWith("/") && (t = t.slice(1));
3
- const i = t.split("#"), s = i[0].split("?"), c = s[0].startsWith("/") ? s[0] : "/" + s[0], r = n + c, e = s == null ? void 0 : s[1], o = i == null ? void 0 : i[1];
4
- return {
5
- leaf: c,
6
- pathname: r,
7
- parameters: e,
8
- hash: o
9
- };
10
- }
11
- function p(t) {
12
- return t.endsWith("/") || (t += "/"), t;
13
- }
14
- function a(t, n, i, s) {
15
- const c = i || location.search, r = s ? s.startsWith("#") ? s : "#" + s : "", e = c ? c.startsWith("?") ? c : "?" + c : "", o = `${n}${r}${e}`;
16
- t === "push" ? history.pushState(o, "", o) : t === "replace" && history.replaceState(o, "", o);
17
- }
18
- export {
19
- a as c,
20
- p as n,
21
- h as s
22
- };