aptechka 0.1.12 → 0.1.15

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 (55) hide show
  1. package/lib/Damped-Fy7tHx4d.js +33 -0
  2. package/lib/Damped-mdFs8WSd.cjs +1 -0
  3. package/lib/{WheelControls-CX9WUbBC.js → WheelControls-BN4XGOpG.js} +29 -34
  4. package/lib/WheelControls-Dc1xcVG6.cjs +1 -0
  5. package/lib/animation/Tweened.d.ts +0 -1
  6. package/lib/animation/index.cjs +1 -1
  7. package/lib/animation/index.js +20 -26
  8. package/lib/component/Component.d.ts +7 -3
  9. package/lib/component/hooks/custom-element.d.ts +2 -0
  10. package/lib/component/index.cjs +1 -1
  11. package/lib/component/index.d.ts +2 -1
  12. package/lib/component/index.js +174 -139
  13. package/lib/controls/index.cjs +1 -1
  14. package/lib/controls/index.js +20 -23
  15. package/lib/en3/{test → core}/En3Raycaster.d.ts +1 -1
  16. package/lib/en3/core/en3.d.ts +2 -0
  17. package/lib/en3/index.cjs +7 -7
  18. package/lib/en3/index.d.ts +1 -1
  19. package/lib/en3/index.js +540 -523
  20. package/lib/index-B-ZmkQyB.cjs +9 -0
  21. package/lib/{index-BWTXnG5n.js → index-Dizn7btU.js} +96 -96
  22. package/lib/layout-box/index.cjs +1 -1
  23. package/lib/layout-box/index.d.ts +15 -0
  24. package/lib/layout-box/index.js +102 -93
  25. package/lib/morph/Morph.d.ts +1 -0
  26. package/lib/morph/index.cjs +1 -1
  27. package/lib/morph/index.js +130 -122
  28. package/lib/object-BZELAoVj.cjs +1 -0
  29. package/lib/object-R34VLqhp.js +85 -0
  30. package/lib/order/index.cjs +1 -1
  31. package/lib/order/index.d.ts +1 -0
  32. package/lib/order/index.js +1 -1
  33. package/lib/popover/index.cjs +1 -1
  34. package/lib/popover/index.js +50 -50
  35. package/lib/resized/index.d.ts +11 -0
  36. package/lib/router/index.cjs +1 -1
  37. package/lib/router/index.js +101 -105
  38. package/lib/scroll/index.cjs +1 -1
  39. package/lib/scroll/index.js +2 -2
  40. package/lib/select/index.cjs +1 -1
  41. package/lib/select/index.js +1 -1
  42. package/lib/studio/index.cjs +1 -1
  43. package/lib/studio/index.js +1 -1
  44. package/lib/utils/index.cjs +1 -1
  45. package/lib/utils/index.d.ts +1 -1
  46. package/lib/utils/index.js +15 -14
  47. package/lib/utils/object.d.ts +1 -0
  48. package/package.json +1 -1
  49. package/lib/Damped-BwpMU9Gi.cjs +0 -1
  50. package/lib/Damped-urvryQLo.js +0 -36
  51. package/lib/WheelControls-CfDeGCOU.cjs +0 -1
  52. package/lib/component/hooks/shadow.d.ts +0 -1
  53. package/lib/index-3G1lTMEf.cjs +0 -9
  54. package/lib/object-C1ph624j.cjs +0 -1
  55. package/lib/object-DIPjdukP.js +0 -73
@@ -1,54 +1,54 @@
1
- import { Attribute as C } from "../attribute/index.js";
2
- import { CustomElement as I, define as A } from "../custom-element/index.js";
3
- import { S as q } from "../Store-JOKrNVEr.js";
4
- import { g as B } from "../style-j2TwriJ_.js";
5
- import { AbstractButtonElement as G } from "../abstract-elements/index.js";
6
- var x = Object.defineProperty, H = Object.getOwnPropertyDescriptor, R = (e, t, s) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, F = (e, t, s, r) => {
7
- for (var n = r > 1 ? void 0 : r ? H(t, s) : t, p = e.length - 1, l; p >= 0; p--)
1
+ import { Attribute as T } from "../attribute/index.js";
2
+ import { CustomElement as D, define as P } from "../custom-element/index.js";
3
+ import { S as I } from "../Store-JOKrNVEr.js";
4
+ import { g as N } from "../style-j2TwriJ_.js";
5
+ import { AbstractButtonElement as q } from "../abstract-elements/index.js";
6
+ var B = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, s, r) => {
7
+ for (var n = r > 1 ? void 0 : r ? G(t, s) : t, p = e.length - 1, l; p >= 0; p--)
8
8
  (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
9
- return r && n && x(t, s, n), n;
10
- }, $ = (e, t, s) => (R(e, typeof t != "symbol" ? t + "" : t, s), s), T = (e, t, s) => {
9
+ return r && n && B(t, s, n), n;
10
+ }, M = (e, t, s) => {
11
11
  if (!t.has(e))
12
12
  throw TypeError("Cannot " + s);
13
- }, i = (e, t, s) => (T(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
13
+ }, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
14
14
  if (t.has(e))
15
15
  throw TypeError("Cannot add the same private member more than once");
16
16
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
17
- }, W = (e, t, s, r) => (T(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), P = (e, t, s) => (T(e, t, "access private method"), s), S, h, m, d, g, f, k, D, _, w, y, E, L, M, v;
18
- let a = class extends I {
17
+ }, S = (e, t, s, r) => (M(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), C = (e, t, s) => (M(e, t, "access private method"), s), L, h, g, d, m, f, W, A, u, w, y, E, k, $, v;
18
+ let a = class extends D {
19
19
  constructor() {
20
- super(...arguments), o(this, k), o(this, _), o(this, L), o(this, S, -1), o(this, h, new q(!1)), o(this, m, void 0), o(this, d, new C(this, "history", !1)), o(this, g, new C(this, "single", !1)), o(this, f, !1), $(this, "open", () => {
21
- i(this, h).current || (i(this, h).current = !0, i(this, g).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), W(this, S, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, k, D)), clearTimeout(i(this, m)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
20
+ super(...arguments), o(this, W), o(this, u), o(this, k), o(this, L, -1), o(this, h, new I(!1)), o(this, g, void 0), o(this, d, new T(this, "history", !1)), o(this, m, new T(this, "single", !1)), o(this, f, !1), this.open = () => {
21
+ i(this, h).current || (i(this, h).current = !0, i(this, m).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), S(this, L, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, W, A)), clearTimeout(i(this, g)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
22
22
  addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
23
23
  }));
24
- }), $(this, "close", () => {
24
+ }, this.close = () => {
25
25
  i(this, h).current && (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, d).current && history.replaceState(
26
26
  "",
27
27
  "",
28
- location.href.replace(new RegExp(`[&?]${i(this, _, w)}`, "g"), "")
28
+ location.href.replace(new RegExp(`[&?]${i(this, u, w)}`, "g"), "")
29
29
  ), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
30
30
  this.classList.remove("triggered"), this.style.display = "none";
31
- }, B(this)));
32
- }), o(this, y, (e) => {
33
- P(this, L, M).call(this, () => {
31
+ }, N(this)));
32
+ }, o(this, y, (e) => {
33
+ C(this, k, $).call(this, () => {
34
34
  const t = e.composedPath();
35
35
  (!t.find((s) => s === this) && !t.find(
36
36
  (s) => s instanceof HTMLElement && s.closest("e-popover-button")
37
37
  ) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
38
38
  });
39
39
  }), o(this, E, (e) => {
40
- P(this, L, M).call(this, () => {
40
+ C(this, k, $).call(this, () => {
41
41
  e.code === "Escape" && this.close();
42
42
  });
43
43
  }), o(this, v, () => {
44
- W(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, _, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, _, w)) && this.open(), W(this, f, !0);
44
+ S(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, u, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, u, w)) && this.open(), S(this, f, !0);
45
45
  });
46
46
  }
47
47
  get history() {
48
48
  return i(this, d);
49
49
  }
50
50
  get single() {
51
- return i(this, g);
51
+ return i(this, m);
52
52
  }
53
53
  get opened() {
54
54
  return i(this, h);
@@ -59,70 +59,70 @@ let a = class extends I {
59
59
  }, 0);
60
60
  }
61
61
  disconnectedCallback() {
62
- clearTimeout(i(this, m)), removeEventListener("popstate", i(this, v));
62
+ clearTimeout(i(this, g)), removeEventListener("popstate", i(this, v));
63
63
  }
64
64
  };
65
- S = /* @__PURE__ */ new WeakMap();
65
+ L = /* @__PURE__ */ new WeakMap();
66
66
  h = /* @__PURE__ */ new WeakMap();
67
- m = /* @__PURE__ */ new WeakMap();
68
- d = /* @__PURE__ */ new WeakMap();
69
67
  g = /* @__PURE__ */ new WeakMap();
68
+ d = /* @__PURE__ */ new WeakMap();
69
+ m = /* @__PURE__ */ new WeakMap();
70
70
  f = /* @__PURE__ */ new WeakMap();
71
- k = /* @__PURE__ */ new WeakSet();
72
- D = function() {
73
- return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, w)}`;
71
+ W = /* @__PURE__ */ new WeakSet();
72
+ A = function() {
73
+ return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, w)}`;
74
74
  };
75
- _ = /* @__PURE__ */ new WeakSet();
75
+ u = /* @__PURE__ */ new WeakSet();
76
76
  w = function() {
77
77
  return `modal-${this.id}`;
78
78
  };
79
79
  y = /* @__PURE__ */ new WeakMap();
80
80
  E = /* @__PURE__ */ new WeakMap();
81
- L = /* @__PURE__ */ new WeakSet();
82
- M = function(e) {
83
- (a.__opened[i(this, S) - 1] || a.__opened.length === 1) && e();
81
+ k = /* @__PURE__ */ new WeakSet();
82
+ $ = function(e) {
83
+ (a.__opened[i(this, L) - 1] || a.__opened.length === 1) && e();
84
84
  };
85
85
  v = /* @__PURE__ */ new WeakMap();
86
- $(a, "__opened", []);
87
- a = F([
88
- A("e-popover")
86
+ a.__opened = [];
87
+ a = H([
88
+ P("e-popover")
89
89
  ], a);
90
- var z = Object.defineProperty, J = Object.getOwnPropertyDescriptor, K = (e, t, s, r) => {
91
- for (var n = r > 1 ? void 0 : r ? J(t, s) : t, p = e.length - 1, l; p >= 0; p--)
90
+ var R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, r) => {
91
+ for (var n = r > 1 ? void 0 : r ? z(t, s) : t, p = e.length - 1, l; p >= 0; p--)
92
92
  (l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
93
- return r && n && z(t, s, n), n;
94
- }, N = (e, t, s) => {
93
+ return r && n && R(t, s, n), n;
94
+ }, x = (e, t, s) => {
95
95
  if (!t.has(e))
96
96
  throw TypeError("Cannot " + s);
97
- }, u = (e, t, s) => (N(e, t, "read from private field"), s ? s.call(e) : t.get(e)), Q = (e, t, s) => {
97
+ }, _ = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), J = (e, t, s) => {
98
98
  if (t.has(e))
99
99
  throw TypeError("Cannot add the same private member more than once");
100
100
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
101
- }, U = (e, t, s, r) => (N(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
102
- let O = class extends G {
101
+ }, K = (e, t, s, r) => (x(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
102
+ let O = class extends q {
103
103
  constructor() {
104
- super(...arguments), Q(this, c, void 0);
104
+ super(...arguments), J(this, c, void 0);
105
105
  }
106
106
  get popoverElement() {
107
- return u(this, c);
107
+ return _(this, c);
108
108
  }
109
109
  click() {
110
- if (u(this, c)) {
110
+ if (_(this, c)) {
111
111
  const e = this.getAttribute("type") || "open";
112
- e === "open" || e === "toggle" && !u(this, c).opened.current ? u(this, c).open() : (e === "close" || e === "toggle" && u(this, c).opened.current) && u(this, c).close();
112
+ e === "open" || e === "toggle" && !_(this, c).opened.current ? _(this, c).open() : (e === "close" || e === "toggle" && _(this, c).opened.current) && _(this, c).close();
113
113
  }
114
114
  }
115
115
  connectedCallback() {
116
116
  const e = this.getAttribute("target");
117
117
  if (e) {
118
118
  const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
119
- t ? U(this, c, t) : console.warn(this, `target ${e} not found`);
119
+ t ? K(this, c, t) : console.warn(this, `target ${e} not found`);
120
120
  }
121
121
  }
122
122
  };
123
123
  c = /* @__PURE__ */ new WeakMap();
124
- O = K([
125
- A("e-popover-button")
124
+ O = F([
125
+ P("e-popover-button")
126
126
  ], O);
127
127
  export {
128
128
  O as PopoverButtonElement,
@@ -0,0 +1,11 @@
1
+ import { Store, StoreOptions } from '../store';
2
+ import { ElementOrSelector } from '../utils';
3
+ export interface ResizedOptions extends StoreOptions<number, 'number'> {
4
+ dispatcher?: ElementOrSelector;
5
+ }
6
+ export type ResizedCallback = () => number;
7
+ export declare class Resized extends Store<number, 'number'> {
8
+ #private;
9
+ constructor(callback: ResizedCallback, options?: ResizedOptions);
10
+ close(): void;
11
+ }
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var Z=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var it=(i,t,s)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s;var I=(i,t,s)=>(it(i,typeof t!="symbol"?t+"":t,s),s),F=(i,t,s)=>{if(!t.has(i))throw TypeError("Cannot "+s)};var e=(i,t,s)=>(F(i,t,"read from private field"),s?s.call(i):t.get(i)),n=(i,t,s)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,s)},o=(i,t,s,r)=>(F(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s);var G=(i,t,s)=>(F(i,t,"access private method"),s);var D=(i,t,s)=>new Promise((r,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(h,a);d((s=s.apply(i,t)).next())});var J=(i,t,s)=>(t=i[Z("asyncIterator")])?t.call(i):(i=i[Z("iterator")](),t={},s=(r,f)=>(f=i[r])&&(t[r]=h=>new Promise((a,d,u)=>(h=f.call(i,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),nt=require("../function-MthRj-GJ.cjs"),$=require("../object-C1ph624j.cjs");var b,H,R,m,l,w,S,v,P,y,K,tt;class ht{constructor(t,s){n(this,K);n(this,b,void 0);n(this,H,void 0);n(this,R,void 0);n(this,m,void 0);n(this,l,void 0);n(this,w,void 0);n(this,S,void 0);n(this,v,null);n(this,P,[]);n(this,y,[]);o(this,b,t),o(this,H,s),o(this,R,new URLPattern({pathname:e(this,b)})),o(this,m,null),o(this,l,null),o(this,w,!1),o(this,S,null),_.isBrowser&&o(this,v,new MutationObserver(r=>{r[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,w)}get element(){return e(this,l)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return D(this,null,function*(){var r,f;if(e(this,v).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,H).call(this);if(o(this,y,[...e(this,P)]),typeof h.default=="function"&&(o(this,m,h.default),$.isESClass(h.default))){const a="e-"+((r=e(this,m))==null?void 0:r.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield G(this,K,tt).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:a,searchParams:d};$.isESClass(e(this,m))?o(this,l,new(e(this,m))(u)):o(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),o(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),o(this,w,!0)}e(this,v).disconnect()})}close(){var t;e(this,v).disconnect(),(t=e(this,l))==null||t.remove(),o(this,w,!1),e(this,y).forEach(s=>document.head.removeChild(s)),o(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,H=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,w=new WeakMap,S=new WeakMap,v=new WeakMap,P=new WeakMap,y=new WeakMap,K=new WeakSet,tt=function(){return D(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=J(t),r,f,h;r=!(f=yield s.next()).done;r=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{r&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var U,g,A,j,M;class at{constructor(t,s){n(this,U,void 0);n(this,g,void 0);n(this,A,void 0);n(this,j,void 0);n(this,M,t=>{t.preventDefault(),e(this,U).navigate(e(this,A),e(this,j))});o(this,U,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,j,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,M)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,M)),e(this,g).classList.remove("current")}}U=new WeakMap,g=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap;globalThis.URLPattern=rt.URLPattern;var k,q,p,C,x,E,N,B,W,Y,et,z;const O=class O{constructor(t){n(this,Y);n(this,k,null);n(this,q,void 0);n(this,p,[]);n(this,C,null);n(this,x,[]);n(this,E,void 0);n(this,N,null);n(this,B,new ot.Notifier);I(this,"preprocessor");I(this,"postprocessor");n(this,W,nt.debounce(()=>{const t=s=>s.split("/").length;o(this,p,e(this,p).sort((s,r)=>t(s.pattern)-t(r.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));n(this,z,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),O.active=this,_.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,z)))}get currentPathname(){return e(this,N)}get candidatePathname(){return e(this,E)}get routes(){return e(this,p)}navigationEvent(t){return e(this,B).subscribe(t)}defineRoute(t,s){const r=new ht(t,s);e(this,p).push(r),e(this,W).call(this)}navigate(t,s="push"){return D(this,null,function*(){var u,V;if(e(this,E)===t||e(this,N)===t)return;O.active=this,o(this,E,t);const r=e(this,p).filter(c=>c.isActive),f=e(this,p).filter(c=>!r.includes(c)&&c.testPathname(t)),h=r.filter(c=>!c.testPathname(t)),a=r.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var X;(X=this.preprocessor)==null||X.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){o(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),o(this,N,t);try{for(var T=J(f),ut,ft,dt;ut=!(ft=yield T.next()).done;ut=!1){const L=ft.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),o(this,C,L)}}catch(ft){dt=[ft]}finally{try{ut&&(ft=T.return)&&(yield ft.call(T))}finally{if(dt)throw dt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),G(this,Y,et).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:t}),e(this,B).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,p=new WeakMap,C=new WeakMap,x=new WeakMap,E=new WeakMap,N=new WeakMap,B=new WeakMap,W=new WeakMap,Y=new WeakSet,et=function(){const t=e(this,p).filter(r=>r.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(r=>r.getAnchorElements()).flat()].filter(r=>{var f;return(f=r.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,x).forEach(r=>{r.destroy()}),o(this,x,s.map(r=>new at(this,r)))},z=new WeakMap,I(O,"active");let Q=O;exports.Router=Q;
1
+ "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)),o=(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)},r=(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,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?i(u.value):Promise.resolve(u.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,f)=>(f=n[i])&&(t[i]=h=>new Promise((a,d,u)=>(h=f.call(n,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("urlpattern-polyfill"),st=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),it=require("../function-MthRj-GJ.cjs"),Z=require("../object-BZELAoVj.cjs");var b,O,R,m,l,v,S,p,P,y,I,$;class nt{constructor(t,s){o(this,I);o(this,b,void 0);o(this,O,void 0);o(this,R,void 0);o(this,m,void 0);o(this,l,void 0);o(this,v,void 0);o(this,S,void 0);o(this,p,null);o(this,P,[]);o(this,y,[]);r(this,b,t),r(this,O,s),r(this,R,new URLPattern({pathname:e(this,b)})),r(this,m,null),r(this,l,null),r(this,v,!1),r(this,S,null),_.isBrowser&&r(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 outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,f;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(r(this,y,[...e(this,P)]),typeof h.default=="function"&&(r(this,m,h.default),Z.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)),u={pathnameParams:a,searchParams:d};Z.isESClass(e(this,m))?r(this,l,new(e(this,m))(u)):r(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),r(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),r(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),r(this,v,!1),e(this,y).forEach(s=>document.head.removeChild(s)),r(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,f,h;i=!(f=yield s.next()).done;i=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{i&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){o(this,H,void 0);o(this,g,void 0);o(this,A,void 0);o(this,U,void 0);o(this,j,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});r(this,H,t),r(this,g,s),r(this,A,e(this,g).getAttribute("href")||"/"),r(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=et.URLPattern;var k,q,w,C,M,E,N,x,D,K,tt,W;const Y=class Y{constructor(t){o(this,K);o(this,k,null);o(this,q,void 0);o(this,w,[]);o(this,C,null);o(this,M,[]);o(this,E,void 0);o(this,N,null);o(this,x,new st.Notifier);o(this,D,it.debounce(()=>{const t=s=>s.split("/").length;r(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));o(this,W,t=>{t.state&&this.navigate(t.state,"none")});r(this,q,(t==null?void 0:t.base)||""),Y.active=this,_.isBrowser&&(r(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,N)}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 u,Q;if(e(this,E)===t||e(this,N)===t)return;Y.active=this,r(this,E,t);const i=e(this,w).filter(c=>c.isActive),f=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){r(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),r(this,N,t);try{for(var T=G(f),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),r(this,C,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,tt).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,C=new WeakMap,M=new WeakMap,E=new WeakMap,N=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,tt=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 f;return(f=i.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),r(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;
@@ -1,17 +1,15 @@
1
- var st = Object.defineProperty;
2
- var V = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
3
- var it = (i, t, s) => t in i ? st(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
4
- var B = (i, t, s) => (it(i, typeof t != "symbol" ? t + "" : t, s), s), z = (i, t, s) => {
5
- if (!t.has(i))
1
+ var Q = (o, t) => (t = Symbol[o]) ? t : Symbol.for("Symbol." + o);
2
+ var $ = (o, t, s) => {
3
+ if (!t.has(o))
6
4
  throw TypeError("Cannot " + s);
7
5
  };
8
- var e = (i, t, s) => (z(i, t, "read from private field"), s ? s.call(i) : t.get(i)), n = (i, t, s) => {
9
- if (t.has(i))
6
+ var e = (o, t, s) => ($(o, t, "read from private field"), s ? s.call(o) : t.get(o)), n = (o, t, s) => {
7
+ if (t.has(o))
10
8
  throw TypeError("Cannot add the same private member more than once");
11
- t instanceof WeakSet ? t.add(i) : t.set(i, s);
12
- }, r = (i, t, s, o) => (z(i, t, "write to private field"), o ? o.call(i, s) : t.set(i, s), s);
13
- var F = (i, t, s) => (z(i, t, "access private method"), s);
14
- var D = (i, t, s) => new Promise((o, f) => {
9
+ t instanceof WeakSet ? t.add(o) : t.set(o, s);
10
+ }, r = (o, t, s, i) => ($(o, t, "write to private field"), i ? i.call(o, s) : t.set(o, s), s);
11
+ var z = (o, t, s) => ($(o, t, "access private method"), s);
12
+ var j = (o, t, s) => new Promise((i, f) => {
15
13
  var h = (u) => {
16
14
  try {
17
15
  d(s.next(u));
@@ -24,31 +22,31 @@ var D = (i, t, s) => new Promise((o, f) => {
24
22
  } catch (T) {
25
23
  f(T);
26
24
  }
27
- }, d = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(h, a);
28
- d((s = s.apply(i, t)).next());
25
+ }, d = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(h, a);
26
+ d((s = s.apply(o, t)).next());
29
27
  });
30
- var G = (i, t, s) => (t = i[V("asyncIterator")]) ? t.call(i) : (i = i[V("iterator")](), t = {}, s = (o, f) => (f = i[o]) && (t[o] = (h) => new Promise((a, d, u) => (h = f.call(i, h), u = h.done, Promise.resolve(h.value).then((T) => a({ value: T, done: u }), d)))), s("next"), s("return"), t);
31
- import { URLPattern as ot } from "urlpattern-polyfill";
32
- import { Notifier as rt } from "../notifier/index.js";
33
- import { i as _ } from "../browser-0zX67oeU.js";
34
- import { d as nt } from "../function-C10DGppn.js";
35
- import { i as X } from "../object-DIPjdukP.js";
36
- var R, H, b, m, l, v, A, w, P, E, K, tt;
37
- class ht {
28
+ var F = (o, t, s) => (t = o[Q("asyncIterator")]) ? t.call(o) : (o = o[Q("iterator")](), t = {}, s = (i, f) => (f = o[i]) && (t[i] = (h) => new Promise((a, d, u) => (h = f.call(o, h), u = h.done, Promise.resolve(h.value).then((T) => a({ value: T, done: u }), d)))), s("next"), s("return"), t);
29
+ import { URLPattern as et } from "urlpattern-polyfill";
30
+ import { Notifier as st } from "../notifier/index.js";
31
+ import { i as Z } from "../browser-0zX67oeU.js";
32
+ import { d as it } from "../function-C10DGppn.js";
33
+ import { i as V } from "../object-R34VLqhp.js";
34
+ var R, U, b, m, c, w, A, v, P, E, B, _;
35
+ class ot {
38
36
  constructor(t, s) {
39
- n(this, K);
37
+ n(this, B);
40
38
  n(this, R, void 0);
41
- n(this, H, void 0);
39
+ n(this, U, void 0);
42
40
  n(this, b, void 0);
43
41
  n(this, m, void 0);
44
- n(this, l, void 0);
45
- n(this, v, void 0);
42
+ n(this, c, void 0);
43
+ n(this, w, void 0);
46
44
  n(this, A, void 0);
47
- n(this, w, null);
45
+ n(this, v, null);
48
46
  n(this, P, []);
49
47
  n(this, E, []);
50
- r(this, R, t), r(this, H, s), r(this, b, new URLPattern({ pathname: e(this, R) })), r(this, m, null), r(this, l, null), r(this, v, !1), r(this, A, null), _ && r(this, w, new MutationObserver((o) => {
51
- o[0].addedNodes.forEach((h) => {
48
+ r(this, R, t), r(this, U, s), r(this, b, new URLPattern({ pathname: e(this, R) })), r(this, m, null), r(this, c, null), r(this, w, !1), r(this, A, null), Z && r(this, v, new MutationObserver((i) => {
49
+ i[0].addedNodes.forEach((h) => {
52
50
  e(this, m) ? e(this, E).push(h) : e(this, P).push(h);
53
51
  });
54
52
  }));
@@ -60,10 +58,10 @@ class ht {
60
58
  return e(this, b);
61
59
  }
62
60
  get isActive() {
63
- return e(this, v);
61
+ return e(this, w);
64
62
  }
65
63
  get element() {
66
- return e(this, l);
64
+ return e(this, c);
67
65
  }
68
66
  get outlet() {
69
67
  return e(this, A);
@@ -72,9 +70,9 @@ class ht {
72
70
  return this.urlPattern.test({ pathname: t });
73
71
  }
74
72
  render(t, s) {
75
- return D(this, null, function* () {
76
- var o, f;
77
- if (e(this, w).observe(document.head, {
73
+ return j(this, null, function* () {
74
+ var i, f;
75
+ if (e(this, v).observe(document.head, {
78
76
  childList: !0,
79
77
  subtree: !0
80
78
  }), e(this, m))
@@ -82,44 +80,44 @@ class ht {
82
80
  document.head.appendChild(h);
83
81
  });
84
82
  else {
85
- const h = yield e(this, H).call(this);
86
- if (r(this, E, [...e(this, P)]), typeof h.default == "function" && (r(this, m, h.default), X(h.default))) {
87
- const a = "e-" + ((o = e(this, m)) == null ? void 0 : o.name.toLowerCase());
83
+ const h = yield e(this, U).call(this);
84
+ if (r(this, E, [...e(this, P)]), typeof h.default == "function" && (r(this, m, h.default), V(h.default))) {
85
+ const a = "e-" + ((i = e(this, m)) == null ? void 0 : i.name.toLowerCase());
88
86
  customElements.get(a) || customElements.define(a, h.default);
89
87
  }
90
88
  }
91
- if (yield F(this, K, tt).call(this), e(this, m)) {
89
+ if (yield z(this, B, _).call(this), e(this, m)) {
92
90
  const h = e(this, b).exec({ pathname: s }), a = (h == null ? void 0 : h.pathname.groups) || {}, d = Object.fromEntries(
93
91
  new URLSearchParams(location.search)
94
92
  ), u = {
95
93
  pathnameParams: a,
96
94
  searchParams: d
97
95
  };
98
- X(e(this, m)) ? r(this, l, new (e(this, m))(
96
+ V(e(this, m)) ? r(this, c, new (e(this, m))(
99
97
  u
100
- )) : r(this, l, e(this, m).call(this, u)), t.appendChild(e(this, l)), r(this, A, e(this, l).querySelector("[data-outlet]") || ((f = e(this, l).shadowRoot) == null ? void 0 : f.querySelector("[data-outlet]")) || e(this, l).shadowRoot || e(this, l)), r(this, v, !0);
98
+ )) : r(this, c, e(this, m).call(this, u)), t.appendChild(e(this, c)), r(this, A, e(this, c).querySelector("[data-outlet]") || ((f = e(this, c).shadowRoot) == null ? void 0 : f.querySelector("[data-outlet]")) || e(this, c).shadowRoot || e(this, c)), r(this, w, !0);
101
99
  }
102
- e(this, w).disconnect();
100
+ e(this, v).disconnect();
103
101
  });
104
102
  }
105
103
  close() {
106
104
  var t;
107
- e(this, w).disconnect(), (t = e(this, l)) == null || t.remove(), r(this, v, !1), e(this, E).forEach((s) => document.head.removeChild(s)), r(this, E, []);
105
+ e(this, v).disconnect(), (t = e(this, c)) == null || t.remove(), r(this, w, !1), e(this, E).forEach((s) => document.head.removeChild(s)), r(this, E, []);
108
106
  }
109
107
  getAnchorElements() {
110
108
  var s;
111
109
  let t = [];
112
- return e(this, l) && (t = [...e(this, l).querySelectorAll("a")]), (s = e(this, l)) != null && s.shadowRoot && (t = [
110
+ return e(this, c) && (t = [...e(this, c).querySelectorAll("a")]), (s = e(this, c)) != null && s.shadowRoot && (t = [
113
111
  ...t,
114
- ...e(this, l).shadowRoot.querySelectorAll("a")
112
+ ...e(this, c).shadowRoot.querySelectorAll("a")
115
113
  ]), t;
116
114
  }
117
115
  }
118
- R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l = new WeakMap(), v = new WeakMap(), A = new WeakMap(), w = new WeakMap(), P = new WeakMap(), E = new WeakMap(), K = new WeakSet(), tt = function() {
119
- return D(this, null, function* () {
116
+ R = new WeakMap(), U = new WeakMap(), b = new WeakMap(), m = new WeakMap(), c = new WeakMap(), w = new WeakMap(), A = new WeakMap(), v = new WeakMap(), P = new WeakMap(), E = new WeakMap(), B = new WeakSet(), _ = function() {
117
+ return j(this, null, function* () {
120
118
  const t = e(this, P).filter((a) => a instanceof HTMLElement ? a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK" : !1);
121
119
  try {
122
- for (var s = G(t), o, f, h; o = !(f = yield s.next()).done; o = !1) {
120
+ for (var s = F(t), i, f, h; i = !(f = yield s.next()).done; i = !1) {
123
121
  const a = f.value;
124
122
  yield new Promise((d) => {
125
123
  a.onload = () => {
@@ -131,7 +129,7 @@ R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l =
131
129
  h = [f];
132
130
  } finally {
133
131
  try {
134
- o && (f = s.return) && (yield f.call(s));
132
+ i && (f = s.return) && (yield f.call(s));
135
133
  } finally {
136
134
  if (h)
137
135
  throw h[0];
@@ -139,46 +137,44 @@ R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l =
139
137
  }
140
138
  });
141
139
  };
142
- var O, p, S, x, I;
143
- class at {
140
+ var H, g, S, O, x;
141
+ class rt {
144
142
  constructor(t, s) {
145
- n(this, O, void 0);
146
- n(this, p, void 0);
143
+ n(this, H, void 0);
144
+ n(this, g, void 0);
147
145
  n(this, S, void 0);
148
- n(this, x, void 0);
149
- n(this, I, (t) => {
150
- t.preventDefault(), e(this, O).navigate(e(this, S), e(this, x));
146
+ n(this, O, void 0);
147
+ n(this, x, (t) => {
148
+ t.preventDefault(), e(this, H).navigate(e(this, S), e(this, O));
151
149
  });
152
- r(this, O, t), r(this, p, s), r(this, S, e(this, p).getAttribute("href") || "/"), r(this, x, e(this, p).getAttribute("data-history-action") || "push"), e(this, p).addEventListener("click", e(this, I)), location.pathname === e(this, S) && e(this, p).classList.add("current");
150
+ r(this, H, t), r(this, g, s), r(this, S, e(this, g).getAttribute("href") || "/"), r(this, O, e(this, g).getAttribute("data-history-action") || "push"), e(this, g).addEventListener("click", e(this, x)), location.pathname === e(this, S) && e(this, g).classList.add("current");
153
151
  }
154
152
  destroy() {
155
- e(this, p).removeEventListener("click", e(this, I)), e(this, p).classList.remove("current");
153
+ e(this, g).removeEventListener("click", e(this, x)), e(this, g).classList.remove("current");
156
154
  }
157
155
  }
158
- O = new WeakMap(), p = new WeakMap(), S = new WeakMap(), x = new WeakMap(), I = new WeakMap();
159
- globalThis.URLPattern = ot;
160
- var k, N, g, C, M, L, q, j, W, Y, et, $;
161
- const U = class U {
156
+ H = new WeakMap(), g = new WeakMap(), S = new WeakMap(), O = new WeakMap(), x = new WeakMap();
157
+ globalThis.URLPattern = et;
158
+ var k, N, p, C, I, L, q, M, D, K, tt, W;
159
+ const Y = class Y {
162
160
  constructor(t) {
163
- n(this, Y);
161
+ n(this, K);
164
162
  n(this, k, null);
165
163
  n(this, N, void 0);
166
- n(this, g, []);
164
+ n(this, p, []);
167
165
  n(this, C, null);
168
- n(this, M, []);
166
+ n(this, I, []);
169
167
  n(this, L, void 0);
170
168
  n(this, q, null);
171
- n(this, j, new rt());
172
- B(this, "preprocessor");
173
- B(this, "postprocessor");
174
- n(this, W, nt(() => {
169
+ n(this, M, new st());
170
+ n(this, D, it(() => {
175
171
  const t = (s) => s.split("/").length;
176
- r(this, g, e(this, g).sort((s, o) => t(s.pattern) - t(o.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
172
+ r(this, p, e(this, p).sort((s, i) => t(s.pattern) - t(i.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
177
173
  }, 0));
178
- n(this, $, (t) => {
174
+ n(this, W, (t) => {
179
175
  t.state && this.navigate(t.state, "none");
180
176
  });
181
- r(this, N, (t == null ? void 0 : t.base) || ""), U.active = this, _ && (r(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, $)));
177
+ r(this, N, (t == null ? void 0 : t.base) || ""), Y.active = this, Z && (r(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, W)));
182
178
  }
183
179
  get currentPathname() {
184
180
  return e(this, q);
@@ -187,79 +183,79 @@ const U = class U {
187
183
  return e(this, L);
188
184
  }
189
185
  get routes() {
190
- return e(this, g);
186
+ return e(this, p);
191
187
  }
192
188
  navigationEvent(t) {
193
- return e(this, j).subscribe(t);
189
+ return e(this, M).subscribe(t);
194
190
  }
195
191
  defineRoute(t, s) {
196
- const o = new ht(t, s);
197
- e(this, g).push(o), e(this, W).call(this);
192
+ const i = new ot(t, s);
193
+ e(this, p).push(i), e(this, D).call(this);
198
194
  }
199
195
  navigate(t, s = "push") {
200
- return D(this, null, function* () {
201
- var u, J;
196
+ return j(this, null, function* () {
197
+ var u, G;
202
198
  if (e(this, L) === t || e(this, q) === t)
203
199
  return;
204
- U.active = this, r(this, L, t);
205
- const o = e(this, g).filter((c) => c.isActive), f = e(this, g).filter(
206
- (c) => !o.includes(c) && c.testPathname(t)
207
- ), h = o.filter((c) => !c.testPathname(t)), a = o.filter((c) => c.testPathname(t));
200
+ Y.active = this, r(this, L, t);
201
+ const i = e(this, p).filter((l) => l.isActive), f = e(this, p).filter(
202
+ (l) => !i.includes(l) && l.testPathname(t)
203
+ ), h = i.filter((l) => !l.testPathname(t)), a = i.filter((l) => l.testPathname(t));
208
204
  let d = !0;
209
205
  if (this.preprocessor)
210
206
  try {
211
- yield new Promise((c, y) => {
212
- var Q;
213
- (Q = this.preprocessor) == null || Q.call(this, { pathname: t, resolve: c, reject: y });
207
+ yield new Promise((l, y) => {
208
+ var J;
209
+ (J = this.preprocessor) == null || J.call(this, { pathname: t, resolve: l, reject: y });
214
210
  });
215
- } catch (c) {
216
- c ? console.error(c) : console.log("Route change canceled"), d = !1;
211
+ } catch (l) {
212
+ l ? console.error(l) : console.log("Route change canceled"), d = !1;
217
213
  }
218
214
  if (d && e(this, L) === t) {
219
215
  r(this, C, a[a.length - 1]), h.forEach((y) => {
220
216
  y.close();
221
217
  }), r(this, q, t);
222
218
  try {
223
- for (var T = G(f), vt, wt, Pt; vt = !(wt = yield T.next()).done; vt = !1) {
224
- const y = wt.value;
219
+ for (var T = F(f), mt, gt, pt; mt = !(gt = yield T.next()).done; mt = !1) {
220
+ const y = gt.value;
225
221
  yield y.render(
226
222
  ((u = e(this, C)) == null ? void 0 : u.outlet) || e(this, k),
227
223
  t
228
224
  ), r(this, C, y);
229
225
  }
230
- } catch (wt) {
231
- Pt = [wt];
226
+ } catch (gt) {
227
+ pt = [gt];
232
228
  } finally {
233
229
  try {
234
- vt && (wt = T.return) && (yield wt.call(T));
230
+ mt && (gt = T.return) && (yield gt.call(T));
235
231
  } finally {
236
- if (Pt)
237
- throw Pt[0];
232
+ if (pt)
233
+ throw pt[0];
238
234
  }
239
235
  }
240
- const c = e(this, N) + t + location.search;
241
- s === "push" ? history.pushState(c, "", c) : s === "replace" && history.replaceState(c, "", c), F(this, Y, et).call(this), (J = this.postprocessor) == null || J.call(this, { pathname: t }), e(this, j).notify({ pathname: t });
236
+ const l = e(this, N) + t + location.search;
237
+ s === "push" ? history.pushState(l, "", l) : s === "replace" && history.replaceState(l, "", l), z(this, K, tt).call(this), (G = this.postprocessor) == null || G.call(this, { pathname: t }), e(this, M).notify({ pathname: t });
242
238
  }
243
239
  });
244
240
  }
245
241
  };
246
- k = new WeakMap(), N = new WeakMap(), g = new WeakMap(), C = new WeakMap(), M = new WeakMap(), L = new WeakMap(), q = new WeakMap(), j = new WeakMap(), W = new WeakMap(), Y = new WeakSet(), et = function() {
247
- const t = e(this, g).filter((o) => o.isActive), s = Array.from(
242
+ k = new WeakMap(), N = new WeakMap(), p = new WeakMap(), C = new WeakMap(), I = new WeakMap(), L = new WeakMap(), q = new WeakMap(), M = new WeakMap(), D = new WeakMap(), K = new WeakSet(), tt = function() {
243
+ const t = e(this, p).filter((i) => i.isActive), s = Array.from(
248
244
  new Set(
249
245
  [
250
246
  ...e(this, k).querySelectorAll("a"),
251
- ...t.map((o) => o.getAnchorElements()).flat()
252
- ].filter((o) => {
247
+ ...t.map((i) => i.getAnchorElements()).flat()
248
+ ].filter((i) => {
253
249
  var f;
254
- return (f = o.getAttribute("href")) == null ? void 0 : f.startsWith("/");
250
+ return (f = i.getAttribute("href")) == null ? void 0 : f.startsWith("/");
255
251
  })
256
252
  )
257
253
  );
258
- e(this, M).forEach((o) => {
259
- o.destroy();
260
- }), r(this, M, s.map((o) => new at(this, o)));
261
- }, $ = new WeakMap(), B(U, "active");
262
- let Z = U;
254
+ e(this, I).forEach((i) => {
255
+ i.destroy();
256
+ }), r(this, I, s.map((i) => new rt(this, i)));
257
+ }, W = new WeakMap();
258
+ let X = Y;
263
259
  export {
264
- Z as Router
260
+ X as Router
265
261
  };