aptechka 0.5.42 → 0.7.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 (273) hide show
  1. package/lib/Animation-6Na1MCtM.cjs +1 -0
  2. package/lib/Animation-CELiTw3n.js +132 -0
  3. package/lib/Composed-DmLYTh1b.js +35 -0
  4. package/lib/Composed-Dx2hs-va.cjs +1 -0
  5. package/lib/{Damped-P4MkCGoY.js → Damped-Mx_FNNVz.js} +2 -5
  6. package/lib/Damped-loFiBsBy.cjs +1 -0
  7. package/lib/{Derived-kPJs5JC5.js → Derived-DlCvc0xQ.js} +1 -1
  8. package/lib/{Derived-B-g8dYgh.cjs → Derived-a6MDQEPY.cjs} +1 -1
  9. package/lib/ElementConstructor-CAZ2ra8m.cjs +1 -0
  10. package/lib/ElementConstructor-OYlPJf2L.js +366 -0
  11. package/lib/Resource-D3TQormz.cjs +1 -0
  12. package/lib/Resource-DIcoALGo.js +64 -0
  13. package/lib/{SourceManager-Q-PB-Rkh.js → SourceManager-Bz329f90.js} +1 -1
  14. package/lib/{SourceManager-vSlsMKUE.cjs → SourceManager-kxr5eUyL.cjs} +1 -1
  15. package/lib/Store-6s0YXK4o.cjs +1 -0
  16. package/lib/{Store-BQXXikps.js → Store-BI2xxXOA.js} +42 -42
  17. package/lib/Tweened-B_mclQ61.cjs +1 -0
  18. package/lib/Tweened-NE8M9onF.js +48 -0
  19. package/lib/{Viewport-DMB0dO-s.cjs → Viewport-CJeKnL5V.cjs} +1 -1
  20. package/lib/{Viewport-CFFhFKqX.js → Viewport-D9IL7kUQ.js} +1 -1
  21. package/lib/_createStore-Cf1MyeHa.cjs +1 -0
  22. package/lib/_createStore-Ck9bHolX.js +12 -0
  23. package/lib/accordion/AccordionElement.d.ts +5 -2
  24. package/lib/accordion/index.cjs +1 -1
  25. package/lib/accordion/index.js +141 -105
  26. package/lib/animation/Animation.d.ts +11 -19
  27. package/lib/animation/Damped.d.ts +4 -6
  28. package/lib/animation/Tweened.d.ts +2 -4
  29. package/lib/animation/index.cjs +1 -1
  30. package/lib/animation/index.js +3 -3
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.d.ts +1 -1
  33. package/lib/attribute/index.js +31 -31
  34. package/lib/canvas/index.cjs +1 -1
  35. package/lib/canvas/index.d.ts +1 -1
  36. package/lib/canvas/index.js +29 -29
  37. package/lib/checkbox/index.cjs +1 -1
  38. package/lib/checkbox/index.js +20 -20
  39. package/lib/class-linked-status/index.cjs +1 -1
  40. package/lib/class-linked-status/index.js +1 -1
  41. package/lib/controls/AutoplayControls.d.ts +1 -1
  42. package/lib/controls/DragControls.d.ts +1 -1
  43. package/lib/controls/WheelControls.d.ts +1 -1
  44. package/lib/controls/index.cjs +1 -1
  45. package/lib/controls/index.js +3 -3
  46. package/lib/counter/index.d.ts +8 -0
  47. package/lib/{createStylesheet-DBCEbDjI.js → createStylesheet-CR_yi5tp.js} +1 -1
  48. package/lib/{createStylesheet-CqHU9_qv.cjs → createStylesheet-p23sZ7Ey.cjs} +1 -1
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +2 -1
  51. package/lib/css-property/index.js +36 -32
  52. package/lib/custom-element/index.d.ts +1 -4
  53. package/lib/dev/index.cjs +1 -1
  54. package/lib/dev/index.js +1 -1
  55. package/lib/device/index.cjs +1 -1
  56. package/lib/device/index.js +1 -1
  57. package/lib/element-constructor/ElementConstructor.d.ts +2 -2
  58. package/lib/element-constructor/index.cjs +1 -1
  59. package/lib/element-constructor/index.js +114 -113
  60. package/lib/en3/core/En3Raycaster.d.ts +20 -0
  61. package/lib/en3/core/En3View.d.ts +1 -1
  62. package/lib/en3/core/en3.d.ts +7 -3
  63. package/lib/en3/helpers/En3Controls.d.ts +5 -0
  64. package/lib/en3/helpers/En3GridHelper.d.ts +8 -0
  65. package/lib/en3/helpers/En3Object3dManager.d.ts +12 -0
  66. package/lib/en3/helpers/En3OrbitControls.d.ts +8 -0
  67. package/lib/en3/helpers/En3TransformControls.d.ts +8 -0
  68. package/lib/en3/helpers/index.cjs +1 -0
  69. package/lib/en3/helpers/index.d.ts +2 -0
  70. package/lib/en3/helpers/index.js +1165 -0
  71. package/lib/en3/index.cjs +1 -215
  72. package/lib/en3/index.d.ts +1 -19
  73. package/lib/en3/index.js +4 -4227
  74. package/lib/en3/libs/index.cjs +1 -0
  75. package/lib/en3/libs/index.d.ts +1 -0
  76. package/lib/en3/libs/index.js +201 -0
  77. package/lib/en3/loaders/_En3GLTFLoader.d.ts +12 -0
  78. package/lib/en3/loaders/_En3TextureLoader.d.ts +8 -0
  79. package/lib/en3/loaders/index.cjs +1 -0
  80. package/lib/en3/loaders/index.d.ts +3 -0
  81. package/lib/en3/loaders/index.js +1757 -0
  82. package/lib/en3/loaders/loaders.d.ts +13 -0
  83. package/lib/en3/misc/index.cjs +10 -0
  84. package/lib/en3/misc/index.d.ts +2 -0
  85. package/lib/en3/misc/index.js +115 -0
  86. package/lib/en3/objects/En3Clip.d.ts +1 -1
  87. package/lib/en3/objects/En3ClipHelpers.d.ts +1 -1
  88. package/lib/en3/objects/En3GLTF.d.ts +4 -3
  89. package/lib/en3/objects/En3Image.d.ts +1 -1
  90. package/lib/en3/objects/En3ImageLike.d.ts +3 -2
  91. package/lib/en3/objects/En3SourceConsumer.d.ts +1 -1
  92. package/lib/en3/objects/En3Video.d.ts +1 -1
  93. package/lib/en3/objects/fluid/Advection.d.ts +1 -1
  94. package/lib/en3/objects/fluid/Divergence.d.ts +1 -1
  95. package/lib/en3/objects/fluid/En3Fluid.d.ts +1 -1
  96. package/lib/en3/objects/fluid/En3FluidElement.d.ts +1 -1
  97. package/lib/en3/objects/fluid/ExternalForce.d.ts +1 -1
  98. package/lib/en3/objects/fluid/Poisson.d.ts +1 -1
  99. package/lib/en3/objects/fluid/Pressure.d.ts +1 -1
  100. package/lib/en3/objects/fluid/Simulation.d.ts +1 -1
  101. package/lib/en3/objects/fluid/Viscous.d.ts +1 -1
  102. package/lib/en3/objects/fluid/index.d.ts +0 -3
  103. package/lib/en3/objects/index.d.ts +7 -0
  104. package/lib/en3/utils/coverTexture.d.ts +1 -1
  105. package/lib/en3/utils/index.cjs +1 -0
  106. package/lib/en3/utils/index.d.ts +5 -0
  107. package/lib/en3/utils/index.js +43 -0
  108. package/lib/en3-C4mzaF6q.cjs +8 -0
  109. package/lib/en3-hbkN1OPu.js +343 -0
  110. package/lib/globals-DMjysUXI.js +8 -0
  111. package/lib/globals-bYKki-b9.cjs +1 -0
  112. package/lib/image/index.cjs +1 -1
  113. package/lib/image/index.js +1 -1
  114. package/lib/{index-BtsOv9u0.js → index-BAH_fO2N.js} +66 -66
  115. package/lib/index-D1LQUR-R.cjs +9 -0
  116. package/lib/instantiate-D19Uvc31.js +125 -0
  117. package/lib/instantiate-Db5gGSYG.cjs +1 -0
  118. package/lib/jsx/ComponentElement.d.ts +18 -0
  119. package/lib/jsx/globals.d.ts +13 -0
  120. package/lib/jsx/h.d.ts +7 -0
  121. package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
  122. package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
  123. package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
  124. package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
  125. package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
  126. package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
  127. package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
  128. package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
  129. package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
  130. package/lib/jsx/hooks/onAnimationFrame.js +22 -0
  131. package/lib/jsx/hooks/onElementResize.cjs +1 -0
  132. package/lib/jsx/hooks/onElementResize.d.ts +5 -0
  133. package/lib/jsx/hooks/onElementResize.js +11 -0
  134. package/lib/jsx/hooks/onIntersection.cjs +1 -0
  135. package/lib/jsx/hooks/onIntersection.d.ts +5 -0
  136. package/lib/jsx/hooks/onIntersection.js +11 -0
  137. package/lib/jsx/hooks/onWindowResize.cjs +1 -0
  138. package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
  139. package/lib/jsx/hooks/onWindowResize.js +8 -0
  140. package/lib/jsx/hooks/store/createArrayStore.d.ts +3 -0
  141. package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
  142. package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
  143. package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
  144. package/lib/jsx/hooks/store/createDerivedComponent.d.ts +3 -0
  145. package/lib/jsx/hooks/store/createDerivedComponents.d.ts +3 -0
  146. package/lib/jsx/hooks/store/createResource.d.ts +3 -0
  147. package/lib/jsx/hooks/store/createStore.d.ts +3 -0
  148. package/lib/jsx/hooks/store/index.cjs +1 -0
  149. package/lib/jsx/hooks/store/index.d.ts +7 -0
  150. package/lib/jsx/hooks/store/index.js +49 -0
  151. package/lib/jsx/hooks/watchAttribute.cjs +1 -0
  152. package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
  153. package/lib/jsx/hooks/watchAttribute.js +17 -0
  154. package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
  155. package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
  156. package/lib/jsx/hooks/watchCSSProperty.js +17 -0
  157. package/lib/jsx/index.cjs +1 -0
  158. package/lib/jsx/index.d.ts +13 -0
  159. package/lib/jsx/index.js +91 -0
  160. package/lib/jsx/instantiate.d.ts +5 -0
  161. package/lib/jsx/register.d.ts +1 -0
  162. package/lib/jsx/render.d.ts +6 -0
  163. package/lib/jsx/type.d.ts +188 -0
  164. package/lib/ladder/index.cjs +1 -1
  165. package/lib/ladder/index.d.ts +2 -0
  166. package/lib/ladder/index.js +84 -66
  167. package/lib/layout-box/index.cjs +1 -1
  168. package/lib/layout-box/index.d.ts +11 -2
  169. package/lib/layout-box/index.js +190 -164
  170. package/lib/media/index.cjs +1 -1
  171. package/lib/media/index.js +1 -1
  172. package/lib/modal/index.cjs +1 -1
  173. package/lib/modal/index.js +16 -16
  174. package/lib/morph/Morph.d.ts +2 -2
  175. package/lib/morph/index.cjs +1 -1
  176. package/lib/morph/index.d.ts +1 -1
  177. package/lib/morph/index.js +135 -143
  178. package/lib/notifier/index.d.ts +2 -2
  179. package/lib/notifier/index.js +3 -1
  180. package/lib/onConnect-DGP866cj.cjs +1 -0
  181. package/lib/onConnect-y5DrxJ9P.js +7 -0
  182. package/lib/pointer/Pointer.d.ts +1 -1
  183. package/lib/pointer/PointerElement.d.ts +1 -1
  184. package/lib/pointer/index.cjs +1 -1
  185. package/lib/pointer/index.js +3 -3
  186. package/lib/polyfills-CM4SCDTt.cjs +1 -0
  187. package/lib/polyfills-X6KXuHg-.js +33 -0
  188. package/lib/popover/PopoverButtonElement.d.ts +1 -1
  189. package/lib/popover/PopoverElement.d.ts +2 -2
  190. package/lib/popover/index.cjs +1 -1
  191. package/lib/popover/index.js +49 -49
  192. package/lib/router/Router.d.ts +11 -3
  193. package/lib/router/index.cjs +1 -1
  194. package/lib/router/index.d.ts +1 -1
  195. package/lib/router/index.js +185 -165
  196. package/lib/scroll/ScrollElement.d.ts +8 -25
  197. package/lib/scroll/ScrollSection.d.ts +23 -0
  198. package/lib/scroll/ScrollSegmentElement.d.ts +3 -3
  199. package/lib/scroll/ScrollUserElement.d.ts +1 -1
  200. package/lib/scroll/index.cjs +1 -1
  201. package/lib/scroll/index.js +87 -83
  202. package/lib/scroll-entries/index.d.ts +1 -1
  203. package/lib/select/SelectUserElement.d.ts +1 -1
  204. package/lib/select/index.cjs +1 -1
  205. package/lib/select/index.js +1 -1
  206. package/lib/sequence/index.cjs +1 -1
  207. package/lib/sequence/index.d.ts +1 -1
  208. package/lib/sequence/index.js +8 -8
  209. package/lib/slicer/SlicerElement.d.ts +2 -2
  210. package/lib/slicer/index.cjs +4 -4
  211. package/lib/slicer/index.js +31 -31
  212. package/lib/source/SourceElement.d.ts +2 -2
  213. package/lib/source/SourceManager.d.ts +1 -1
  214. package/lib/source/index.cjs +1 -1
  215. package/lib/source/index.js +2 -2
  216. package/lib/store/ArrayStore.d.ts +21 -0
  217. package/lib/store/Store.d.ts +1 -7
  218. package/lib/store/index.cjs +1 -1
  219. package/lib/store/index.d.ts +2 -2
  220. package/lib/store/index.js +65 -139
  221. package/lib/tags-BqJKcIve.js +485 -0
  222. package/lib/tags-ld5jemJw.cjs +1 -0
  223. package/lib/theme/index.cjs +1 -1
  224. package/lib/theme/index.js +2 -2
  225. package/lib/tweaker/TweakerBooleanManagerElement.d.ts +2 -2
  226. package/lib/tweaker/TweakerColorManagerElement.d.ts +2 -2
  227. package/lib/tweaker/TweakerElement.d.ts +1 -1
  228. package/lib/tweaker/TweakerFieldElement.d.ts +2 -2
  229. package/lib/tweaker/TweakerFolderElement.d.ts +5 -3
  230. package/lib/tweaker/TweakerLinkManagerElement.d.ts +2 -2
  231. package/lib/tweaker/TweakerNumberManagerElement.d.ts +4 -8
  232. package/lib/tweaker/TweakerSelectManagerElement.d.ts +2 -2
  233. package/lib/tweaker/TweakerStoreManagerElement.d.ts +7 -7
  234. package/lib/tweaker/TweakerStringManagerElement.d.ts +3 -5
  235. package/lib/tweaker/index.cjs +3 -3
  236. package/lib/tweaker/index.js +535 -412
  237. package/lib/tweaker/tweakerManagerConstructors.d.ts +2 -2
  238. package/lib/tweaker/tweakerStorage.d.ts +8 -1
  239. package/lib/url-C3dWnJQg.cjs +1 -0
  240. package/lib/url-DMNfW7uN.js +22 -0
  241. package/lib/utils/function.d.ts +2 -2
  242. package/lib/utils/index.cjs +1 -1
  243. package/lib/utils/index.d.ts +1 -0
  244. package/lib/utils/index.js +39 -34
  245. package/lib/utils/layout.d.ts +1 -1
  246. package/lib/utils/number.d.ts +1 -0
  247. package/lib/utils/url.d.ts +9 -0
  248. package/lib/video/index.cjs +1 -1
  249. package/lib/video/index.js +14 -14
  250. package/package.json +108 -12
  251. package/lib/Animation-DDHjrbtL.cjs +0 -1
  252. package/lib/Animation-Dq_05jlR.js +0 -217
  253. package/lib/Damped-l0mnlhar.cjs +0 -1
  254. package/lib/Store-C-1ruEIm.cjs +0 -1
  255. package/lib/Tweened-CwDC2zl8.js +0 -51
  256. package/lib/Tweened-DIt9j9B-.cjs +0 -1
  257. package/lib/animation/AnimationLink.d.ts +0 -13
  258. package/lib/en3/loaders/en3GLTFLoader.d.ts +0 -14
  259. package/lib/en3/loaders/en3TextureLoader.d.ts +0 -3
  260. package/lib/en3/test/En3HTML.d.ts +0 -10
  261. package/lib/index-Buf76Qoq.cjs +0 -9
  262. package/lib/polyfills-BA-CL_HF.js +0 -27
  263. package/lib/polyfills-DHs2SNbz.cjs +0 -1
  264. package/lib/resized/index.cjs +0 -1
  265. package/lib/resized/index.d.ts +0 -12
  266. package/lib/resized/index.js +0 -30
  267. package/lib/store/CumulativeResource.d.ts +0 -13
  268. package/lib/tags-CMPg9ETZ.js +0 -848
  269. package/lib/tags-Djb6mb1o.cjs +0 -1
  270. package/lib/tweaker/TweakerRangeManagerElement.d.ts +0 -11
  271. package/lib/en3/{loaders → core}/en3Cache.d.ts +0 -0
  272. package/lib/en3/{test → misc}/En3ModifiedMaterial.d.ts +0 -0
  273. package/lib/en3/{attachments → misc}/En3SourceManager.d.ts +2 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../attribute/index.cjs"),W=require("../custom-element/index.cjs"),D=require("../Store-C-1ruEIm.cjs"),I=require("../style-At6aDoqG.cjs"),N=require("../browser-CpzFX2xg.cjs"),G=require("../tags-Djb6mb1o.cjs");var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,K=(s,e,t,n)=>{for(var a=n>1?void 0:n?R(e,t):e,c=s.length-1,d;c>=0;c--)(d=s[c])&&(a=(n?d(e,t,a):d(a))||a);return n&&a&&H(e,t,a),a},q=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)},i=(s,e,t)=>(q(s,e,"read from private field"),t?t.call(s):e.get(s)),h=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},S=(s,e,t,n)=>(q(s,e,"write to private field"),n?n.call(s,t):e.set(s,t),t),x=(s,e,t)=>(q(s,e,"access private method"),t),T,p,g,l,v,f,O,b,u,m,w,y,L,$,E;exports.PopoverElement=class extends W.CustomElement{constructor(){super(...arguments),h(this,O),h(this,u),h(this,L),h(this,T,-1),h(this,p,new D.Store(!1)),h(this,g,void 0),h(this,l,new A.Attribute(this,"history",!1)),h(this,v,new A.Attribute(this,"single",!1)),h(this,f,!1),this.open=(e=!0)=>{if(i(this,p).current)return;i(this,p).current=!0,i(this,v).current&&(exports.PopoverElement.__opened.forEach(n=>n.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),S(this,T,exports.PopoverElement.__opened.length-1),i(this,l).current&&i(this,f)&&history.pushState("","",i(this,O,b)),clearTimeout(i(this,g)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const t=()=>{addEventListener("click",i(this,w)),addEventListener("keydown",i(this,y)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};e?setTimeout(t):t()},this.close=()=>{if(i(this,p).current){if(i(this,p).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,l).current){const e=new URL(location.href);e.searchParams.delete(i(this,u,m)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",i(this,w)),removeEventListener("keydown",i(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},I.getElementTransitionDurationMS(this))}},h(this,w,e=>{x(this,L,$).call(this,()=>{const t=e.composedPath();!t.find(n=>n===this)&&!t.find(n=>n instanceof HTMLElement&&n.closest("e-popover-button"))&&t[0]instanceof HTMLElement&&!t[0].closest("[data-outside]")&&this.close()})}),h(this,y,e=>{x(this,L,$).call(this,()=>{e.code==="Escape"&&this.close()})}),h(this,E,()=>{S(this,f,!1),i(this,p).current&&i(this,l).current&&!location.search.includes(i(this,u,m))?this.close():!i(this,p).current&&i(this,l).current&&location.search.includes(i(this,u,m))&&this.open(),S(this,f,!0)})}get history(){return i(this,l)}get single(){return i(this,v)}get opened(){return i(this,p)}connectedCallback(){i(this,l).observe(),i(this,v).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,E)),setTimeout(()=>{i(this,E).call(this)},0)}disconnectedCallback(){i(this,l).unobserve(),i(this,v).unobserve(),exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),clearTimeout(i(this,g)),removeEventListener("popstate",i(this,E))}};T=new WeakMap;p=new WeakMap;g=new WeakMap;l=new WeakMap;v=new WeakMap;f=new WeakMap;O=new WeakSet;b=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${i(this,u,m)}`};u=new WeakSet;m=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;L=new WeakSet;$=function(s){(exports.PopoverElement.__opened[i(this,T)-1]||exports.PopoverElement.__opened.length===1)&&s()};E=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=K([W.define("e-popover")],exports.PopoverElement);var U=Object.defineProperty,z=Object.getOwnPropertyDescriptor,F=(s,e,t,n)=>{for(var a=n>1?void 0:n?z(e,t):e,c=s.length-1,d;c>=0;c--)(d=s[c])&&(a=(n?d(e,t,a):d(a))||a);return n&&a&&U(e,t,a),a},B=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)},r=(s,e,t)=>(B(s,e,"read from private field"),t?t.call(s):e.get(s)),_=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},J=(s,e,t,n)=>(B(s,e,"write to private field"),n?n.call(s,t):e.set(s,t),t),o,P,C,k,M;exports.PopoverButtonElement=class extends W.CustomElement{constructor(){super(),_(this,o,void 0),_(this,P,()=>{this.classList.add("triggered")}),_(this,C,()=>{this.classList.add("opened")}),_(this,k,()=>{this.classList.remove("opened")}),_(this,M,()=>{this.classList.remove("triggered")}),N.isBrowser&&G.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(r(this,o)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!r(this,o).opened.current?r(this,o).open():(e==="close"||e==="toggle"&&r(this,o).opened.current)&&r(this,o).close()}},onKeydown:e=>{e.code==="Space"&&e.currentTarget.click()}})}get popoverElement(){return r(this,o)}connectedCallback(){const e=this.getAttribute("target");if(e){const t=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);t?(J(this,o,t),r(this,o).addEventListener("popoverTriggered",r(this,P)),r(this,o).addEventListener("popoverOpened",r(this,C)),r(this,o).addEventListener("popoverClosing",r(this,k)),r(this,o).addEventListener("popoverClosed",r(this,M))):console.warn(this,`target ${e} not found`)}}disconnectedCallback(){r(this,o)&&(r(this,o).removeEventListener("popoverTriggered",r(this,P)),r(this,o).removeEventListener("popoverOpened",r(this,C)),r(this,o).removeEventListener("popoverClosing",r(this,k)),r(this,o).removeEventListener("popoverClosed",r(this,M)))}};o=new WeakMap;P=new WeakMap;C=new WeakMap;k=new WeakMap;M=new WeakMap;exports.PopoverButtonElement=F([W.define("e-popover-button")],exports.PopoverButtonElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../attribute/index.cjs"),W=require("../custom-element/index.cjs"),D=require("../Store-6s0YXK4o.cjs"),I=require("../style-At6aDoqG.cjs"),N=require("../browser-CpzFX2xg.cjs"),G=require("../tags-ld5jemJw.cjs");var H=Object.defineProperty,R=Object.getOwnPropertyDescriptor,K=(s,e,t,o)=>{for(var a=o>1?void 0:o?R(e,t):e,c=s.length-1,d;c>=0;c--)(d=s[c])&&(a=(o?d(e,t,a):d(a))||a);return o&&a&&H(e,t,a),a},b=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)},i=(s,e,t)=>(b(s,e,"read from private field"),t?t.call(s):e.get(s)),h=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},S=(s,e,t,o)=>(b(s,e,"write to private field"),e.set(s,t),t),A=(s,e,t)=>(b(s,e,"access private method"),t),T,p,g,l,v,f,O,x,u,m,w,y,L,$,E;exports.PopoverElement=class extends W.CustomElement{constructor(){super(...arguments),h(this,O),h(this,u),h(this,L),h(this,T,-1),h(this,p,new D.Store(!1)),h(this,g,void 0),h(this,l,new q.Attribute(this,"history",!1)),h(this,v,new q.Attribute(this,"single",!1)),h(this,f,!1),this.open=(e=!0)=>{if(i(this,p).current)return;i(this,p).current=!0,i(this,v).current&&(exports.PopoverElement.__opened.forEach(o=>o.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),S(this,T,exports.PopoverElement.__opened.length-1),i(this,l).current&&i(this,f)&&history.pushState("","",i(this,O,x)),clearTimeout(i(this,g)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const t=()=>{addEventListener("click",i(this,w)),addEventListener("keydown",i(this,y)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};e?setTimeout(t):t()},this.close=()=>{if(i(this,p).current){if(i(this,p).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,l).current){const e=new URL(location.href);e.searchParams.delete(i(this,u,m)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",i(this,w)),removeEventListener("keydown",i(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},I.getElementTransitionDurationMS(this))}},h(this,w,e=>{A(this,L,$).call(this,()=>{const t=e.composedPath();!t.find(o=>o===this)&&!t.find(o=>o instanceof HTMLElement&&o.closest("e-popover-button"))&&t[0]instanceof HTMLElement&&!t[0].closest("[data-outside]")&&this.close()})}),h(this,y,e=>{A(this,L,$).call(this,()=>{e.code==="Escape"&&this.close()})}),h(this,E,()=>{S(this,f,!1),i(this,p).current&&i(this,l).current&&!location.search.includes(i(this,u,m))?this.close():!i(this,p).current&&i(this,l).current&&location.search.includes(i(this,u,m))&&this.open(),S(this,f,!0)})}get history(){return i(this,l)}get single(){return i(this,v)}get opened(){return i(this,p)}connectedCallback(){i(this,l).observe(),i(this,v).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,E)),setTimeout(()=>{i(this,E).call(this)},0)}disconnectedCallback(){i(this,l).unobserve(),i(this,v).unobserve(),exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),clearTimeout(i(this,g)),removeEventListener("popstate",i(this,E))}};T=new WeakMap;p=new WeakMap;g=new WeakMap;l=new WeakMap;v=new WeakMap;f=new WeakMap;O=new WeakSet;x=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${i(this,u,m)}`};u=new WeakSet;m=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;L=new WeakSet;$=function(s){(exports.PopoverElement.__opened[i(this,T)-1]||exports.PopoverElement.__opened.length===1)&&s()};E=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=K([W.define("e-popover")],exports.PopoverElement);var U=Object.defineProperty,z=Object.getOwnPropertyDescriptor,F=(s,e,t,o)=>{for(var a=o>1?void 0:o?z(e,t):e,c=s.length-1,d;c>=0;c--)(d=s[c])&&(a=(o?d(e,t,a):d(a))||a);return o&&a&&U(e,t,a),a},B=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)},r=(s,e,t)=>(B(s,e,"read from private field"),t?t.call(s):e.get(s)),_=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},J=(s,e,t,o)=>(B(s,e,"write to private field"),e.set(s,t),t),n,P,C,k,M;exports.PopoverButtonElement=class extends W.CustomElement{constructor(){super(),_(this,n,void 0),_(this,P,()=>{this.classList.add("triggered")}),_(this,C,()=>{this.classList.add("opened")}),_(this,k,()=>{this.classList.remove("opened")}),_(this,M,()=>{this.classList.remove("triggered")}),N.isBrowser&&G.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(r(this,n)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!r(this,n).opened.current?r(this,n).open():(e==="close"||e==="toggle"&&r(this,n).opened.current)&&r(this,n).close()}},onKeydown:e=>{e.code==="Space"&&e.currentTarget.click()}})}get popoverElement(){return r(this,n)}connectedCallback(){const e=this.getAttribute("target");if(e){const t=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);t?(J(this,n,t),r(this,n).addEventListener("popoverTriggered",r(this,P)),r(this,n).addEventListener("popoverOpened",r(this,C)),r(this,n).addEventListener("popoverClosing",r(this,k)),r(this,n).addEventListener("popoverClosed",r(this,M))):console.warn(this,`target ${e} not found`)}}disconnectedCallback(){r(this,n)&&(r(this,n).removeEventListener("popoverTriggered",r(this,P)),r(this,n).removeEventListener("popoverOpened",r(this,C)),r(this,n).removeEventListener("popoverClosing",r(this,k)),r(this,n).removeEventListener("popoverClosed",r(this,M)))}};n=new WeakMap;P=new WeakMap;C=new WeakMap;k=new WeakMap;M=new WeakMap;exports.PopoverButtonElement=F([W.define("e-popover-button")],exports.PopoverButtonElement);
@@ -1,85 +1,85 @@
1
1
  import { Attribute as x } from "../attribute/index.js";
2
- import { CustomElement as N, define as q } from "../custom-element/index.js";
3
- import { S as H } from "../Store-BQXXikps.js";
4
- import { a as R } from "../style-CklEF62D.js";
5
- import { i as b } from "../browser-0zX67oeU.js";
6
- import { e as K } from "../tags-CMPg9ETZ.js";
7
- var U = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, o) => {
8
- for (var a = o > 1 ? void 0 : o ? z(t, s) : t, d = e.length - 1, v; d >= 0; d--)
9
- (v = e[d]) && (a = (o ? v(t, s, a) : v(a)) || a);
10
- return o && a && U(t, s, a), a;
2
+ import { CustomElement as I, define as N } from "../custom-element/index.js";
3
+ import { S as G } from "../Store-BI2xxXOA.js";
4
+ import { a as H } from "../style-CklEF62D.js";
5
+ import { i as R } from "../browser-0zX67oeU.js";
6
+ import { e as K } from "../tags-BqJKcIve.js";
7
+ var U = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, p) => {
8
+ for (var o = p > 1 ? void 0 : p ? z(t, s) : t, l = e.length - 1, v; l >= 0; l--)
9
+ (v = e[l]) && (o = (p ? v(t, s, o) : v(o)) || o);
10
+ return p && o && U(t, s, o), o;
11
11
  }, A = (e, t, s) => {
12
12
  if (!t.has(e))
13
13
  throw TypeError("Cannot " + s);
14
- }, i = (e, t, s) => (A(e, t, "read from private field"), s ? s.call(e) : t.get(e)), p = (e, t, s) => {
14
+ }, i = (e, t, s) => (A(e, t, "read from private field"), s ? s.call(e) : t.get(e)), h = (e, t, s) => {
15
15
  if (t.has(e))
16
16
  throw TypeError("Cannot add the same private member more than once");
17
17
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
18
- }, O = (e, t, s, o) => (A(e, t, "write to private field"), o ? o.call(e, s) : t.set(e, s), s), D = (e, t, s) => (A(e, t, "access private method"), s), S, c, E, l, _, g, $, B, u, m, L, y, C, P, w;
19
- let h = class extends N {
18
+ }, O = (e, t, s, p) => (A(e, t, "write to private field"), t.set(e, s), s), D = (e, t, s) => (A(e, t, "access private method"), s), S, c, E, d, u, g, $, q, _, m, L, y, C, P, w;
19
+ let a = class extends I {
20
20
  constructor() {
21
- super(...arguments), p(this, $), p(this, u), p(this, C), p(this, S, -1), p(this, c, new H(!1)), p(this, E, void 0), p(this, l, new x(this, "history", !1)), p(this, _, new x(this, "single", !1)), p(this, g, !1), this.open = (e = !0) => {
21
+ super(...arguments), h(this, $), h(this, _), h(this, C), h(this, S, -1), h(this, c, new G(!1)), h(this, E, void 0), h(this, d, new x(this, "history", !1)), h(this, u, new x(this, "single", !1)), h(this, g, !1), this.open = (e = !0) => {
22
22
  if (i(this, c).current)
23
23
  return;
24
- i(this, c).current = !0, i(this, _).current && (h.__opened.forEach((s) => s.close()), h.__opened = []), h.__opened.push(this), O(this, S, h.__opened.length - 1), i(this, l).current && i(this, g) && history.pushState("", "", i(this, $, B)), clearTimeout(i(this, E)), this.classList.add("triggered"), this.style.display = "block", this.dispatchEvent(new CustomEvent("popoverTriggered"));
24
+ i(this, c).current = !0, i(this, u).current && (a.__opened.forEach((s) => s.close()), a.__opened = []), a.__opened.push(this), O(this, S, a.__opened.length - 1), i(this, d).current && i(this, g) && history.pushState("", "", i(this, $, q)), clearTimeout(i(this, E)), this.classList.add("triggered"), this.style.display = "block", this.dispatchEvent(new CustomEvent("popoverTriggered"));
25
25
  const t = () => {
26
26
  addEventListener("click", i(this, L)), addEventListener("keydown", i(this, y)), this.style.opacity = "1", this.classList.add("opened"), this.dispatchEvent(new CustomEvent("popoverOpened"));
27
27
  };
28
28
  e ? setTimeout(t) : t();
29
29
  }, this.close = () => {
30
30
  if (i(this, c).current) {
31
- if (i(this, c).current = !1, h.__opened = h.__opened.filter((e) => e !== this), i(this, l).current) {
31
+ if (i(this, c).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, d).current) {
32
32
  const e = new URL(location.href);
33
- e.searchParams.delete(i(this, u, m)), history.replaceState(null, "", e.href);
33
+ e.searchParams.delete(i(this, _, m)), history.replaceState(null, "", e.href);
34
34
  }
35
35
  this.classList.remove("opened"), this.style.opacity = "0", this.dispatchEvent(new CustomEvent("popoverClosing")), removeEventListener("click", i(this, L)), removeEventListener("keydown", i(this, y)), setTimeout(() => {
36
36
  this.classList.remove("triggered"), this.style.display = "none", this.dispatchEvent(new CustomEvent("popoverClosed"));
37
- }, R(this));
37
+ }, H(this));
38
38
  }
39
- }, p(this, L, (e) => {
39
+ }, h(this, L, (e) => {
40
40
  D(this, C, P).call(this, () => {
41
41
  const t = e.composedPath();
42
42
  !t.find((s) => s === this) && !t.find(
43
43
  (s) => s instanceof HTMLElement && s.closest("e-popover-button")
44
44
  ) && t[0] instanceof HTMLElement && !t[0].closest("[data-outside]") && this.close();
45
45
  });
46
- }), p(this, y, (e) => {
46
+ }), h(this, y, (e) => {
47
47
  D(this, C, P).call(this, () => {
48
48
  e.code === "Escape" && this.close();
49
49
  });
50
- }), p(this, w, () => {
51
- O(this, g, !1), i(this, c).current && i(this, l).current && !location.search.includes(i(this, u, m)) ? this.close() : !i(this, c).current && i(this, l).current && location.search.includes(i(this, u, m)) && this.open(), O(this, g, !0);
50
+ }), h(this, w, () => {
51
+ O(this, g, !1), i(this, c).current && i(this, d).current && !location.search.includes(i(this, _, m)) ? this.close() : !i(this, c).current && i(this, d).current && location.search.includes(i(this, _, m)) && this.open(), O(this, g, !0);
52
52
  });
53
53
  }
54
54
  get history() {
55
- return i(this, l);
55
+ return i(this, d);
56
56
  }
57
57
  get single() {
58
- return i(this, _);
58
+ return i(this, u);
59
59
  }
60
60
  get opened() {
61
61
  return i(this, c);
62
62
  }
63
63
  connectedCallback() {
64
- i(this, l).observe(), i(this, _).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, w)), setTimeout(() => {
64
+ i(this, d).observe(), i(this, u).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, w)), setTimeout(() => {
65
65
  i(this, w).call(this);
66
66
  }, 0);
67
67
  }
68
68
  disconnectedCallback() {
69
- i(this, l).unobserve(), i(this, _).unobserve(), h.__opened = h.__opened.filter((e) => e !== this), clearTimeout(i(this, E)), removeEventListener("popstate", i(this, w));
69
+ i(this, d).unobserve(), i(this, u).unobserve(), a.__opened = a.__opened.filter((e) => e !== this), clearTimeout(i(this, E)), removeEventListener("popstate", i(this, w));
70
70
  }
71
71
  };
72
72
  S = /* @__PURE__ */ new WeakMap();
73
73
  c = /* @__PURE__ */ new WeakMap();
74
74
  E = /* @__PURE__ */ new WeakMap();
75
- l = /* @__PURE__ */ new WeakMap();
76
- _ = /* @__PURE__ */ new WeakMap();
75
+ d = /* @__PURE__ */ new WeakMap();
76
+ u = /* @__PURE__ */ new WeakMap();
77
77
  g = /* @__PURE__ */ new WeakMap();
78
78
  $ = /* @__PURE__ */ new WeakSet();
79
- B = function() {
80
- return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, m)}`;
79
+ q = function() {
80
+ return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, m)}`;
81
81
  };
82
- u = /* @__PURE__ */ new WeakSet();
82
+ _ = /* @__PURE__ */ new WeakSet();
83
83
  m = function() {
84
84
  return `modal-${this.id}`;
85
85
  };
@@ -87,26 +87,26 @@ L = /* @__PURE__ */ new WeakMap();
87
87
  y = /* @__PURE__ */ new WeakMap();
88
88
  C = /* @__PURE__ */ new WeakSet();
89
89
  P = function(e) {
90
- (h.__opened[i(this, S) - 1] || h.__opened.length === 1) && e();
90
+ (a.__opened[i(this, S) - 1] || a.__opened.length === 1) && e();
91
91
  };
92
92
  w = /* @__PURE__ */ new WeakMap();
93
- h.__opened = [];
94
- h = F([
95
- q("e-popover")
96
- ], h);
97
- var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, V = (e, t, s, o) => {
98
- for (var a = o > 1 ? void 0 : o ? Q(t, s) : t, d = e.length - 1, v; d >= 0; d--)
99
- (v = e[d]) && (a = (o ? v(t, s, a) : v(a)) || a);
100
- return o && a && J(t, s, a), a;
101
- }, G = (e, t, s) => {
93
+ a.__opened = [];
94
+ a = F([
95
+ N("e-popover")
96
+ ], a);
97
+ var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, V = (e, t, s, p) => {
98
+ for (var o = p > 1 ? void 0 : p ? Q(t, s) : t, l = e.length - 1, v; l >= 0; l--)
99
+ (v = e[l]) && (o = (p ? v(t, s, o) : v(o)) || o);
100
+ return p && o && J(t, s, o), o;
101
+ }, B = (e, t, s) => {
102
102
  if (!t.has(e))
103
103
  throw TypeError("Cannot " + s);
104
- }, r = (e, t, s) => (G(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => {
104
+ }, r = (e, t, s) => (B(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => {
105
105
  if (t.has(e))
106
106
  throw TypeError("Cannot add the same private member more than once");
107
107
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
108
- }, X = (e, t, s, o) => (G(e, t, "write to private field"), o ? o.call(e, s) : t.set(e, s), s), n, k, W, M, T;
109
- let I = class extends N {
108
+ }, X = (e, t, s, p) => (B(e, t, "write to private field"), t.set(e, s), s), n, k, W, M, T;
109
+ let b = class extends I {
110
110
  constructor() {
111
111
  super(), f(this, n, void 0), f(this, k, () => {
112
112
  this.classList.add("triggered");
@@ -116,7 +116,7 @@ let I = class extends N {
116
116
  this.classList.remove("opened");
117
117
  }), f(this, T, () => {
118
118
  this.classList.remove("triggered");
119
- }), b && K(this, {
119
+ }), R && K(this, {
120
120
  tabindex: this.getAttribute("tabindex") || "0",
121
121
  onClick: () => {
122
122
  if (r(this, n)) {
@@ -172,10 +172,10 @@ k = /* @__PURE__ */ new WeakMap();
172
172
  W = /* @__PURE__ */ new WeakMap();
173
173
  M = /* @__PURE__ */ new WeakMap();
174
174
  T = /* @__PURE__ */ new WeakMap();
175
- I = V([
176
- q("e-popover-button")
177
- ], I);
175
+ b = V([
176
+ N("e-popover-button")
177
+ ], b);
178
178
  export {
179
- I as PopoverButtonElement,
180
- h as PopoverElement
179
+ b as PopoverButtonElement,
180
+ a as PopoverElement
181
181
  };
@@ -1,7 +1,9 @@
1
+ import { splitPath, ChangeHistoryAction } from '../utils';
1
2
  import { Route, RouteModule } from './Route';
3
+ import { Link } from './Link';
2
4
 
3
5
  export interface RouterPreprocessorEntry {
4
- pathname: string;
6
+ path: ReturnType<typeof splitPath>;
5
7
  resolve: () => void;
6
8
  reject: () => void;
7
9
  }
@@ -14,7 +16,6 @@ export interface RouterAfterNavigationEntry {
14
16
  pathname: string;
15
17
  }
16
18
  export type RouterAfterNavigationCallback = (entry: RouterAfterNavigationEntry) => void;
17
- export type RouterHistoryAction = 'push' | 'replace' | 'none';
18
19
  export interface RouterParameters {
19
20
  rootElement?: HTMLElement;
20
21
  base?: string;
@@ -28,7 +29,14 @@ export declare class Router {
28
29
  get currentPathname(): string;
29
30
  get candidatePathname(): string | undefined;
30
31
  get routes(): Route[];
32
+ get links(): Link[];
31
33
  navigationEvent(callback: RouterAfterNavigationCallback): () => void;
32
34
  defineRoute(pattern: string, module: RouteModule): void;
33
- navigate(pathname: string, action?: RouterHistoryAction): Promise<void>;
35
+ navigate(path: string, action?: ChangeHistoryAction): Promise<void>;
36
+ normalizePath(path: string): {
37
+ leaf: string;
38
+ pathname: string;
39
+ parameters: string;
40
+ hash: string;
41
+ };
34
42
  }
@@ -1 +1 @@
1
- "use strict";var X=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var z=(n,t,s)=>{if(!t.has(n))throw TypeError("Cannot "+s)};var e=(n,t,s)=>(z(n,t,"read from private field"),s?s.call(n):t.get(n)),r=(n,t,s)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,s)},o=(n,t,s,i)=>(z(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s);var F=(n,t,s)=>(z(n,t,"access private method"),s);var B=(n,t,s)=>new Promise((i,u)=>{var h=f=>{try{d(s.next(f))}catch(T){u(T)}},a=f=>{try{d(s.throw(f))}catch(T){u(T)}},d=f=>f.done?i(f.value):Promise.resolve(f.value).then(h,a);d((s=s.apply(n,t)).next())});var G=(n,t,s)=>(t=n[X("asyncIterator")])?t.call(n):(n=n[X("iterator")](),t={},s=(i,u)=>(u=n[i])&&(t[i]=h=>new Promise((a,d,f)=>(h=u.call(n,h),f=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:f}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("urlpattern-polyfill"),et=require("../notifier/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),st=require("../function-MthRj-GJ.cjs"),it=require("../object-CCiXnER2.cjs");var b,O,R,m,l,v,S,p,P,y,I,_;class nt{constructor(t,s){r(this,I);r(this,b,void 0);r(this,O,void 0);r(this,R,void 0);r(this,m,void 0);r(this,l,void 0);r(this,v,void 0);r(this,S,void 0);r(this,p,null);r(this,P,[]);r(this,y,[]);o(this,b,t),o(this,O,s),o(this,R,new URLPattern({pathname:e(this,b)})),o(this,m,null),o(this,l,null),o(this,v,!1),o(this,S,null),Z.isBrowser&&o(this,p,new MutationObserver(i=>{i[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,v)}get element(){return e(this,l)}get nest(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,u;if(e(this,p).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,O).call(this);if(o(this,y,[...e(this,P)]),typeof h.default=="function"&&(o(this,m,h.default),it.isESClass(h.default))){const a="e-"+((i=e(this,m))==null?void 0:i.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield F(this,I,_).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)),f={pathnameParams:a,searchParams:d};o(this,l,new(e(this,m))(f)),t.appendChild(e(this,l)),o(this,S,e(this,l).querySelector("[data-nest]")||((u=e(this,l).shadowRoot)==null?void 0:u.querySelector("[data-nest]"))||e(this,l).shadowRoot||e(this,l)),o(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),o(this,v,!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,O=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,v=new WeakMap,S=new WeakMap,p=new WeakMap,P=new WeakMap,y=new WeakMap,I=new WeakSet,_=function(){return B(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=G(t),i,u,h;i=!(u=yield s.next()).done;i=!1){const a=u.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(u){h=[u]}finally{try{i&&(u=s.return)&&(yield u.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){r(this,H,void 0);r(this,g,void 0);r(this,A,void 0);r(this,U,void 0);r(this,j,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,j)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,j)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,j=new WeakMap;globalThis.URLPattern=tt.URLPattern;var k,q,w,N,M,E,C,x,D,K,$,W;const Y=class Y{constructor(t){r(this,K);r(this,k,null);r(this,q,void 0);r(this,w,[]);r(this,N,null);r(this,M,[]);r(this,E,void 0);r(this,C,null);r(this,x,new et.Notifier);r(this,D,st.debounce(()=>{const t=s=>s.split("/").length;o(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));r(this,W,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),Y.active=this,Z.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,C)}get candidatePathname(){return e(this,E)}get routes(){return e(this,w)}navigationEvent(t){return e(this,x).subscribe(t)}defineRoute(t,s){const i=new nt(t,s);e(this,w).push(i),e(this,D).call(this)}navigate(t,s="push"){return B(this,null,function*(){var f,Q;if(e(this,E)===t||e(this,C)===t)return;Y.active=this,o(this,E,t);const i=e(this,w).filter(c=>c.isActive),u=e(this,w).filter(c=>!i.includes(c)&&c.testPathname(t)),h=i.filter(c=>!c.testPathname(t)),a=i.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var V;(V=this.preprocessor)==null||V.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,N,a[a.length-1]),h.forEach(L=>{L.close()}),o(this,C,t);try{for(var T=G(u),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((f=e(this,N))==null?void 0:f.nest)||e(this,k),t),o(this,N,L)}}catch(ct){lt=[ct]}finally{try{at&&(ct=T.return)&&(yield ct.call(T))}finally{if(lt)throw lt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),F(this,K,$).call(this),(Q=this.postprocessor)==null||Q.call(this,{pathname:t}),e(this,x).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,w=new WeakMap,N=new WeakMap,M=new WeakMap,E=new WeakMap,C=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,$=function(){const t=e(this,w).filter(i=>i.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(i=>i.getAnchorElements()).flat()].filter(i=>{var u;return(u=i.getAttribute("href"))==null?void 0:u.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),o(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;
1
+ "use strict";var tt=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var Y=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(Y(a,e,"read from private field"),s?s.call(a):e.get(a)),h=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(Y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var F=(a,e,s)=>(Y(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,r)=>{var o=u=>{try{f(s.next(u))}catch(v){r(v)}},c=u=>{try{f(s.throw(u))}catch(v){r(v)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var G=(a,e,s)=>(e=a[tt("asyncIterator")])?e.call(a):(a=a[tt("iterator")](),e={},s=(i,r)=>(r=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=r.call(a,o),u=o.done,Promise.resolve(o.value).then(v=>c({value:v,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),st=require("../browser-CpzFX2xg.cjs"),ct=require("../function-MthRj-GJ.cjs"),J=require("../url-C3dWnJQg.cjs"),lt=require("../instantiate-Db5gGSYG.cjs"),et=require("../object-CCiXnER2.cjs");var R,O,A,p,d,w,S,L,b,E,x,it;class ut{constructor(e,s){h(this,x);h(this,R,void 0);h(this,O,void 0);h(this,A,void 0);h(this,p,void 0);h(this,d,void 0);h(this,w,void 0);h(this,S,void 0);h(this,L,null);h(this,b,[]);h(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,w,!1),n(this,S,null),st.isBrowser&&n(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,w)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,r;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(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),et.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 F(this,x,it).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)),u={pathnameParams:c,searchParams:f};et.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,lt.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,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,w,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,w,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,w=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,it=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=G(e),i,r,o;i=!(r=yield s.next()).done;i=!1){const c=r.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(r){o=[r]}finally{try{i&&(r=s.return)&&(yield r.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class dt{constructor(e,s){h(this,k,void 0);h(this,m,void 0);h(this,P,void 0);h(this,U,void 0);h(this,q,void 0);h(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),r=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?r.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===r.pathname||(c=t(this,q))!=null&&c.includes(r.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=rt.URLPattern;var C,N,g,z,T,y,H,B,I,D,nt,K;const W=class W{constructor(e){h(this,D);h(this,C,null);h(this,N,null);h(this,g,[]);h(this,z,null);h(this,T,[]);h(this,y,void 0);h(this,H,null);h(this,B,new ot.Notifier);h(this,I,ct.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));h(this,K,e=>{e.state&&this.navigate(e.state,"none")});st.isBrowser&&(e!=null&&e.base?n(this,N,J.normalizeBase(e.base)):n(this,N,"/"),W.active=this,n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,K)))}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 ut(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Z,_;const i=this.normalizePath(e);let{pathname:r,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===r||t(this,H)===r)return;W.active=this,n(this,y,r);const u=t(this,g).filter(l=>l.isActive),v=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),at=u.filter(l=>!l.testPathname(f)),V=u.filter(l=>l.testPathname(f));let X=!0;if(this.preprocessor)try{yield new Promise((l,ht)=>{var $;($=this.preprocessor)==null||$.call(this,{path:i,resolve:l,reject:ht})})}catch(l){l?console.error(l):console.log("Route change canceled"),X=!1}if(X&&t(this,y)===r){n(this,z,V[V.length-1]),at.forEach(l=>{l.close()}),n(this,H,r);try{for(var pt=G(v),gt,Pt,vt;gt=!(Pt=yield pt.next()).done;gt=!1){const l=Pt.value;yield l.render(((Z=t(this,z))==null?void 0:Z.nest)||t(this,C),r),n(this,z,l)}}catch(Pt){vt=[Pt]}finally{try{gt&&(Pt=pt.return)&&(yield Pt.call(pt))}finally{if(vt)throw vt[0]}}J.changeHistory(s,r,c,o),F(this,D,nt).call(this),(_=this.postprocessor)==null||_.call(this,{pathname:r}),t(this,B).notify({pathname:r})}})}normalizePath(e){return J.splitPath(e,t(this,N))}};C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,D=new WeakSet,nt=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var r;return(r=i.getAttribute("href"))==null?void 0:r.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new dt(this,i)))},K=new WeakMap;let Q=W;exports.Router=Q;
@@ -1,2 +1,2 @@
1
- export { Router, type RouterPreprocessorEntry, type RouterPreprocessor, type RouterPostprocessor, type RouterAfterNavigationCallback, type RouterHistoryAction, type RouterParameters, } from './Router';
1
+ export { Router, type RouterPreprocessorEntry, type RouterPreprocessor, type RouterPostprocessor, type RouterAfterNavigationCallback, type RouterParameters, } from './Router';
2
2
  export { type RouteModule, type RouteParameters, type RouteURLParams, } from './Route';