aptechka 0.79.0 → 0.80.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 (150) hide show
  1. package/lib/{Animation-BDEX44-i.js → Animation-C4tLEBGM.js} +2 -2
  2. package/lib/{Animation-hZcAchp_.cjs → Animation-jmvFcNfM.cjs} +1 -1
  3. package/lib/Composed-BB1MtFiT.js +70 -0
  4. package/lib/Composed-CSeUTRCg.cjs +1 -0
  5. package/lib/{Damped-z9Uaw2MJ.cjs → Damped-77Urmi3q.cjs} +1 -1
  6. package/lib/{Damped-CtQmJ52v.js → Damped-DVG5nrYV.js} +2 -2
  7. package/lib/DerivedArray-B8A0-8uT.cjs +1 -0
  8. package/lib/DerivedArray-D3scYQdp.js +59 -0
  9. package/lib/{DragControls-K67-diF5.cjs → DragControls-BlL26P1V.cjs} +1 -1
  10. package/lib/{DragControls-DyIrD3GV.js → DragControls-Cm_88cLt.js} +4 -4
  11. package/lib/{SourceElement-VVdVc1d-.cjs → SourceElement-BBfaAgwe.cjs} +1 -1
  12. package/lib/{SourceElement-BnMxiOqY.js → SourceElement-BiNNtaz9.js} +2 -2
  13. package/lib/Store-1JrMCgdX.cjs +1 -0
  14. package/lib/{Store-0BVty6AZ.js → Store-BtVtCGLk.js} +52 -35
  15. package/lib/{Tweened-BlZB0vl4.js → Tweened-C1lnK6n9.js} +2 -2
  16. package/lib/{Tweened-mvHucL4Y.cjs → Tweened-CXQrFQth.cjs} +1 -1
  17. package/lib/{Viewport-DB0qAZPJ.cjs → Viewport-Cx50Hufs.cjs} +1 -1
  18. package/lib/{Viewport-DA10iWAO.js → Viewport-DbN_JWBM.js} +2 -2
  19. package/lib/accordion/index.cjs +1 -1
  20. package/lib/accordion/index.js +1 -1
  21. package/lib/animation/index.cjs +1 -1
  22. package/lib/animation/index.js +3 -3
  23. package/lib/attribute/index.cjs +1 -1
  24. package/lib/attribute/index.js +3 -3
  25. package/lib/billboard/index.cjs +1 -1
  26. package/lib/billboard/index.js +2 -2
  27. package/lib/canvas/index.cjs +1 -1
  28. package/lib/canvas/index.js +2 -2
  29. package/lib/connector/index.cjs +1 -1
  30. package/lib/connector/index.js +2 -1
  31. package/lib/controls/index.cjs +1 -1
  32. package/lib/controls/index.js +1 -1
  33. package/lib/css-property/index.cjs +1 -1
  34. package/lib/css-property/index.js +3 -3
  35. package/lib/css-value-parser/index.cjs +1 -1
  36. package/lib/css-value-parser/index.js +1 -1
  37. package/lib/dev/index.cjs +1 -1
  38. package/lib/dev/index.js +2 -2
  39. package/lib/device/index.cjs +1 -1
  40. package/lib/device/index.js +1 -1
  41. package/lib/{dom-CVWzyXPH.js → dom-fgxIeFxm.js} +22 -7
  42. package/lib/dom-hTEdqeoj.cjs +1 -0
  43. package/lib/element-linked-store/index.cjs +1 -1
  44. package/lib/element-linked-store/index.js +2 -2
  45. package/lib/element-resizer/index.cjs +1 -1
  46. package/lib/element-resizer/index.js +2 -2
  47. package/lib/en3/index.cjs +1 -1
  48. package/lib/en3/index.js +2 -2
  49. package/lib/iframe/index.cjs +1 -1
  50. package/lib/iframe/index.js +3 -3
  51. package/lib/image/index.cjs +1 -1
  52. package/lib/image/index.js +4 -4
  53. package/lib/{index-DekP7OZe.cjs → index-CKTweR3M.cjs} +1 -1
  54. package/lib/{index-Bv9zgfdb.js → index-JqYHGoo6.js} +1 -1
  55. package/lib/intersector/index.cjs +1 -1
  56. package/lib/intersector/index.js +2 -2
  57. package/lib/jsx/ComponentElement.d.ts +13 -0
  58. package/lib/jsx/h.d.ts +3 -0
  59. package/lib/jsx/hooks/common.d.ts +1 -0
  60. package/lib/jsx/hooks/component/lifecycle.d.ts +4 -0
  61. package/lib/jsx/hooks/component/useInternals.d.ts +2 -0
  62. package/lib/jsx/hooks/component/useShadow.d.ts +2 -0
  63. package/lib/jsx/hooks/component/useStylesheet.d.ts +8 -0
  64. package/lib/jsx/hooks/store.d.ts +8 -0
  65. package/lib/jsx/index.cjs +1 -0
  66. package/lib/jsx/index.d.ts +9 -0
  67. package/lib/jsx/index.js +140 -0
  68. package/lib/jsx/render.d.ts +1 -0
  69. package/lib/jsx/type.d.ts +224 -0
  70. package/lib/jsx/utils/attributes/class.d.ts +5 -0
  71. package/lib/jsx/utils/attributes/setAttributes.d.ts +2 -0
  72. package/lib/jsx/utils/attributes/style.d.ts +6 -0
  73. package/lib/jsx/utils/children/filterChildren.d.ts +2 -0
  74. package/lib/jsx/utils/children/findTextNode.d.ts +1 -0
  75. package/lib/jsx/utils/children/removeChildren.d.ts +1 -0
  76. package/lib/jsx/utils/children/storeChildren.d.ts +2 -0
  77. package/lib/jsx/utils/elementStoreSubscription.d.ts +2 -0
  78. package/lib/ladder/index.cjs +1 -1
  79. package/lib/ladder/index.js +2 -2
  80. package/lib/layout-box/index.cjs +1 -1
  81. package/lib/layout-box/index.js +2 -2
  82. package/lib/loading/index.cjs +1 -1
  83. package/lib/loading/index.js +1 -1
  84. package/lib/masonry-layout/index.cjs +1 -1
  85. package/lib/masonry-layout/index.js +2 -2
  86. package/lib/media/index.cjs +1 -1
  87. package/lib/media/index.js +2 -2
  88. package/lib/morph/Morph.d.ts +3 -21
  89. package/lib/morph/index.cjs +1 -1
  90. package/lib/morph/index.js +3 -3
  91. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +1 -1
  92. package/lib/need_redo_tweaker/index.cjs +1 -1
  93. package/lib/need_redo_tweaker/index.js +8 -8
  94. package/lib/pixel-perfect/index.cjs +1 -1
  95. package/lib/pixel-perfect/index.js +3 -3
  96. package/lib/pointer/index.cjs +1 -1
  97. package/lib/pointer/index.js +4 -4
  98. package/lib/popover/index.cjs +1 -1
  99. package/lib/popover/index.js +3 -3
  100. package/lib/radio/index.cjs +1 -1
  101. package/lib/radio/index.js +1 -1
  102. package/lib/render-BCEBRfHS.js +196 -0
  103. package/lib/render-Rv0UMACs.cjs +1 -0
  104. package/lib/router/Link.d.ts +3 -1
  105. package/lib/router/Route.d.ts +9 -10
  106. package/lib/router/Router.d.ts +13 -13
  107. package/lib/router/index.cjs +1 -1
  108. package/lib/router/index.d.ts +2 -2
  109. package/lib/router/index.js +267 -216
  110. package/lib/scroll/index.cjs +1 -1
  111. package/lib/scroll/index.js +8 -8
  112. package/lib/{scroll-DNGJVxa2.js → scroll-7JSxRKFK.js} +2 -2
  113. package/lib/{scroll-CIdNtj3G.cjs → scroll-DxcPU0vk.cjs} +1 -1
  114. package/lib/scroll-entries/index.cjs +1 -1
  115. package/lib/scroll-entries/index.js +1 -1
  116. package/lib/scroll-kit/index.cjs +1 -1
  117. package/lib/scroll-kit/index.js +4 -4
  118. package/lib/sequence/index.cjs +1 -1
  119. package/lib/sequence/index.js +3 -3
  120. package/lib/size-element/index.cjs +1 -1
  121. package/lib/size-element/index.js +1 -1
  122. package/lib/slicer/SlicerElement.d.ts +1 -1
  123. package/lib/slicer/index.cjs +1 -1
  124. package/lib/slicer/index.js +13 -13
  125. package/lib/source/index.cjs +1 -1
  126. package/lib/source/index.js +1 -1
  127. package/lib/store/DerivedArray.d.ts +11 -1
  128. package/lib/store/Store.d.ts +5 -0
  129. package/lib/store/index.cjs +1 -1
  130. package/lib/store/index.js +10 -87
  131. package/lib/{stylesheet-HWF2a3nr.cjs → stylesheet-BcwbfhBp.cjs} +1 -1
  132. package/lib/{stylesheet-DpnWNVyD.js → stylesheet-JlRFfJIc.js} +1 -1
  133. package/lib/ticker/index.cjs +1 -1
  134. package/lib/ticker/index.js +2 -2
  135. package/lib/url-C2kASACG.cjs +1 -0
  136. package/lib/{url-Ddgqz4Q_.js → url-CGbjOTU4.js} +17 -17
  137. package/lib/utils/dom.d.ts +2 -0
  138. package/lib/utils/index.cjs +1 -1
  139. package/lib/utils/index.js +102 -100
  140. package/lib/utils/url.d.ts +3 -2
  141. package/lib/video/index.cjs +1 -1
  142. package/lib/video/index.js +3 -3
  143. package/lib/window-resizer/index.cjs +1 -1
  144. package/lib/window-resizer/index.js +1 -1
  145. package/lib/youtube/index.cjs +1 -1
  146. package/lib/youtube/index.js +3 -3
  147. package/package.json +21 -11
  148. package/lib/Store-Cd1GlEmZ.cjs +0 -1
  149. package/lib/dom-JBOkFLTh.cjs +0 -1
  150. package/lib/url-VIZgwj_h.cjs +0 -1
@@ -1,268 +1,319 @@
1
- var X = (a, e) => (e = Symbol[a]) ? e : Symbol.for("Symbol." + a), Z = (a) => {
2
- throw TypeError(a);
1
+ var W = (c) => {
2
+ throw TypeError(c);
3
3
  };
4
- var W = (a, e, s) => e.has(a) || Z("Cannot " + s);
5
- var t = (a, e, s) => (W(a, e, "read from private field"), s ? s.call(a) : e.get(a)), h = (a, e, s) => e.has(a) ? Z("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, s), n = (a, e, s, i) => (W(a, e, "write to private field"), i ? i.call(a, s) : e.set(a, s), s), Y = (a, e, s) => (W(a, e, "access private method"), s);
6
- var I = (a, e, s) => new Promise((i, r) => {
7
- var o = (m) => {
4
+ var $ = (c, t, s) => t.has(c) || W("Cannot " + s);
5
+ var e = (c, t, s) => ($(c, t, "read from private field"), s ? s.call(c) : t.get(c)), a = (c, t, s) => t.has(c) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, s), r = (c, t, s, i) => ($(c, t, "write to private field"), i ? i.call(c, s) : t.set(c, s), s), n = (c, t, s) => ($(c, t, "access private method"), s);
6
+ var R = (c, t, s) => new Promise((i, l) => {
7
+ var m = (f) => {
8
8
  try {
9
- f(s.next(m));
10
- } catch (w) {
11
- r(w);
9
+ y(s.next(f));
10
+ } catch (D) {
11
+ l(D);
12
12
  }
13
- }, c = (m) => {
13
+ }, w = (f) => {
14
14
  try {
15
- f(s.throw(m));
16
- } catch (w) {
17
- r(w);
15
+ y(s.throw(f));
16
+ } catch (D) {
17
+ l(D);
18
18
  }
19
- }, f = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(o, c);
20
- f((s = s.apply(a, e)).next());
19
+ }, y = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(m, w);
20
+ y((s = s.apply(c, t)).next());
21
21
  });
22
- var $ = (a, e, s) => (e = a[X("asyncIterator")]) ? e.call(a) : (a = a[X("iterator")](), e = {}, s = (i, r) => (r = a[i]) && (e[i] = (o) => new Promise((c, f, m) => (o = r.call(a, o), m = o.done, Promise.resolve(o.value).then((w) => c({ value: w, done: m }), f)))), s("next"), s("return"), e);
23
- import { URLPattern as at } from "urlpattern-polyfill";
24
- import { Notifier as nt } from "../notifier/index.js";
25
- import { i as _ } from "../index-Bv9zgfdb.js";
26
- import { d as ht } from "../function-C10DGppn.js";
22
+ import { Notifier as pt } from "../notifier/index.js";
27
23
  import "construct-style-sheets-polyfill";
28
- import { n as rt, c as ot, s as ct } from "../url-Ddgqz4Q_.js";
29
- import { i as lt } from "../object-D6MVWB4l.js";
30
- var y, U, A, p, d, L, k, v, E, R, M, tt;
31
- class ut {
32
- constructor(e, s) {
33
- h(this, M);
34
- h(this, y);
35
- h(this, U);
36
- h(this, A);
37
- h(this, p);
38
- h(this, d);
39
- h(this, L);
40
- h(this, k);
41
- h(this, v, null);
42
- h(this, E, []);
43
- h(this, R, []);
44
- n(this, y, e), n(this, U, s), n(this, A, new URLPattern({ pathname: t(this, y) })), n(this, p, null), n(this, d, null), n(this, L, !1), n(this, k, null), _ && n(this, v, new MutationObserver((i) => {
45
- i[0].addedNodes.forEach((o) => {
46
- t(this, p) ? t(this, R).push(o) : t(this, E).push(o);
24
+ import "../index-JqYHGoo6.js";
25
+ import { n as ft, c as Y, s as Rt } from "../url-CGbjOTU4.js";
26
+ import { URLPattern as gt } from "urlpattern-polyfill";
27
+ import { r as vt } from "../render-BCEBRfHS.js";
28
+ import { t as Lt } from "../dom-fgxIeFxm.js";
29
+ import { i as j } from "../object-D6MVWB4l.js";
30
+ var b, v, B, G, T;
31
+ class wt {
32
+ constructor(t, s) {
33
+ a(this, B);
34
+ a(this, b);
35
+ a(this, v);
36
+ a(this, T, (t) => {
37
+ t.preventDefault();
38
+ const s = e(this, B, G), i = e(this, v).getAttribute(
39
+ "data-history-action"
40
+ ) || "push";
41
+ e(this, b).navigate(s, {
42
+ historyAction: i
47
43
  });
48
- }));
44
+ });
45
+ r(this, b, t), r(this, v, s), e(this, v).addEventListener("click", e(this, T));
49
46
  }
50
- get pattern() {
51
- return t(this, y);
47
+ checkCurrent(t) {
48
+ }
49
+ destroy() {
50
+ e(this, v).removeEventListener("click", e(this, T)), e(this, v).classList.remove("current");
52
51
  }
53
- get urlPattern() {
54
- return t(this, A);
52
+ }
53
+ b = new WeakMap(), v = new WeakMap(), B = new WeakSet(), G = function() {
54
+ const t = new URL(e(this, v).href);
55
+ return e(this, b).normalizePath(
56
+ t.pathname + t.search + t.hash
57
+ ).path;
58
+ }, T = new WeakMap();
59
+ var k, q, C, d, u, U, M, P, A, N, o, J, Q, V, X, Z, _, tt, et, st, F;
60
+ class yt {
61
+ constructor(t, s) {
62
+ a(this, o);
63
+ a(this, k);
64
+ a(this, q);
65
+ a(this, C);
66
+ a(this, d, null);
67
+ a(this, u, null);
68
+ a(this, U, !1);
69
+ a(this, M, null);
70
+ a(this, P);
71
+ a(this, A, []);
72
+ a(this, N, []);
73
+ r(this, k, t), r(this, q, s), r(this, C, new URLPattern({ pathname: e(this, k) })), r(this, P, new MutationObserver(
74
+ n(this, o, et).bind(this)
75
+ ));
76
+ }
77
+ get pattern() {
78
+ return e(this, k);
55
79
  }
56
80
  get isActive() {
57
- return t(this, L);
81
+ return e(this, U);
58
82
  }
59
83
  get element() {
60
- return t(this, d);
84
+ return e(this, u);
61
85
  }
62
86
  get nest() {
63
- return t(this, k);
87
+ return e(this, M);
64
88
  }
65
- testPathname(e) {
66
- return this.urlPattern.test({ pathname: e });
89
+ testPathname(t) {
90
+ return e(this, C).test({ pathname: t });
67
91
  }
68
- render(e, s) {
69
- return I(this, null, function* () {
70
- var i, r;
71
- if (t(this, v).observe(document.head, {
92
+ render(t, s) {
93
+ return R(this, null, function* () {
94
+ e(this, P).observe(document.head, {
72
95
  childList: !0,
73
96
  subtree: !0
74
- }), t(this, p))
75
- t(this, E).forEach((o) => {
76
- document.head.appendChild(o);
77
- });
78
- else {
79
- const o = yield t(this, U).call(this);
80
- if (n(this, R, [...t(this, E)]), typeof o.default == "function" && (n(this, p, o.default), lt(o.default))) {
81
- const c = "e-" + ((i = t(this, p)) == null ? void 0 : i.name.toLowerCase());
82
- customElements.get(c) || customElements.define(c, o.default);
83
- }
84
- }
85
- if (yield Y(this, M, tt).call(this), t(this, p)) {
86
- const o = t(this, A).exec({ pathname: s }), c = (o == null ? void 0 : o.pathname.groups) || {}, f = Object.fromEntries(
87
- new URLSearchParams(location.search)
88
- ), m = {
89
- pathnameParams: c,
90
- searchParams: f
91
- };
92
- n(this, d, new (t(this, p))(m)), e.appendChild(t(this, d)), n(this, k, t(this, d).querySelector("[data-nest]") || ((r = t(this, d).shadowRoot) == null ? void 0 : r.querySelector("[data-nest]")) || t(this, d).shadowRoot || t(this, d)), n(this, L, !0);
93
- }
94
- t(this, v).disconnect();
97
+ }), e(this, d) ? n(this, o, V).call(this) : yield n(this, o, J).call(this), yield n(this, o, st).call(this), e(this, d) && (yield n(this, o, X).call(this, t, s)), e(this, P).disconnect();
95
98
  });
96
99
  }
97
100
  close() {
98
- var e;
99
- t(this, v).disconnect(), (e = t(this, d)) == null || e.remove(), n(this, L, !1), t(this, R).forEach((s) => document.head.removeChild(s)), n(this, R, []);
101
+ n(this, o, _).call(this);
100
102
  }
101
103
  getAnchorElements() {
102
- var s;
103
- let e = [];
104
- return t(this, d) && (e = [...t(this, d).querySelectorAll("a")]), (s = t(this, d)) != null && s.shadowRoot && (e = [
105
- ...e,
106
- ...t(this, d).shadowRoot.querySelectorAll("a")
107
- ]), e;
104
+ const t = [];
105
+ return e(this, u) && (t.push(...e(this, u).querySelectorAll("a")), Lt(e(this, u), (s) => {
106
+ t.push(...s.shadowRoot.querySelectorAll("a"));
107
+ })), t;
108
108
  }
109
109
  }
110
- y = new WeakMap(), U = new WeakMap(), A = new WeakMap(), p = new WeakMap(), d = new WeakMap(), L = new WeakMap(), k = new WeakMap(), v = new WeakMap(), E = new WeakMap(), R = new WeakMap(), M = new WeakSet(), tt = function() {
111
- return I(this, null, function* () {
112
- const e = t(this, E).filter((c) => c instanceof HTMLElement ? c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK" : !1);
113
- try {
114
- for (var s = $(e), i, r, o; i = !(r = yield s.next()).done; i = !1) {
115
- const c = r.value;
116
- yield new Promise((f) => {
117
- c.onload = () => {
118
- f();
119
- };
120
- });
121
- }
122
- } catch (r) {
123
- o = [r];
124
- } finally {
125
- try {
126
- i && (r = s.return) && (yield r.call(s));
127
- } finally {
128
- if (o)
129
- throw o[0];
130
- }
110
+ k = new WeakMap(), q = new WeakMap(), C = new WeakMap(), d = new WeakMap(), u = new WeakMap(), U = new WeakMap(), M = new WeakMap(), P = new WeakMap(), A = new WeakMap(), N = new WeakMap(), o = new WeakSet(), J = function() {
111
+ return R(this, null, function* () {
112
+ const t = yield e(this, q).call(this);
113
+ r(this, N, [...e(this, A)]), typeof t.default == "function" && (r(this, d, t.default), yield n(this, o, Q).call(this));
114
+ });
115
+ }, Q = function() {
116
+ return R(this, null, function* () {
117
+ if (e(this, d) && j(e(this, d))) {
118
+ const t = `e-${e(this, d).name.toLowerCase()}`;
119
+ customElements.get(t) || customElements.define(
120
+ t,
121
+ e(this, d)
122
+ );
131
123
  }
132
124
  });
133
- };
134
- var S, u, P, O, N, x;
135
- class mt {
136
- constructor(e, s) {
137
- h(this, S);
138
- h(this, u);
139
- h(this, P);
140
- h(this, O);
141
- h(this, N);
142
- h(this, x, (e) => {
143
- e.preventDefault(), t(this, S).links.forEach((s) => {
144
- var i;
145
- t(this, P) === t(s, P) || (i = t(s, N)) != null && i.includes(t(this, P)) ? t(s, u).classList.add("clicked") : t(s, u).classList.remove("clicked");
146
- }), t(this, S).navigate(t(this, P), t(this, O));
125
+ }, V = function() {
126
+ e(this, A).forEach((t) => {
127
+ document.head.appendChild(t.cloneNode(!0));
128
+ });
129
+ }, X = function(t, s) {
130
+ return R(this, null, function* () {
131
+ const l = { urlPatternResult: e(this, C).exec({ pathname: s }) };
132
+ j(e(this, d)) ? (r(this, u, new (e(this, d))(l)), t.appendChild(e(this, u))) : r(this, u, vt(
133
+ t,
134
+ e(this, d),
135
+ l
136
+ )), n(this, o, Z).call(this), r(this, U, !0);
137
+ });
138
+ }, Z = function() {
139
+ var t;
140
+ e(this, u) && r(this, M, e(this, u).querySelector("[data-nest]") || ((t = e(this, u).shadowRoot) == null ? void 0 : t.querySelector("[data-nest]")) || e(this, u).shadowRoot || e(this, u));
141
+ }, _ = function() {
142
+ var t;
143
+ e(this, P).disconnect(), (t = e(this, u)) == null || t.remove(), r(this, U, !1), n(this, o, tt).call(this);
144
+ }, tt = function() {
145
+ e(this, N).forEach((t) => {
146
+ t.parentNode === document.head && document.head.removeChild(t);
147
+ }), r(this, N, []);
148
+ }, et = function(t) {
149
+ t.forEach((s) => {
150
+ s.addedNodes.forEach((i) => {
151
+ e(this, d) ? e(this, N).push(i) : e(this, A).push(i);
147
152
  });
148
- var o, c;
149
- n(this, S, e), n(this, u, s), n(this, P, t(this, u).getAttribute("href") || "/"), n(this, O, t(this, u).getAttribute(
150
- "data-history-action"
151
- ) || "push"), t(this, u).addEventListener("click", t(this, x));
152
- const i = e.normalizePath(t(this, P)), r = e.normalizePath(location.pathname);
153
- n(this, N, (o = t(this, u).getAttribute("data-match-paths")) == null ? void 0 : o.split(",").map((f) => e.normalizePath(f.trim()).pathname)), t(this, u).hasAttribute("data-include") ? r.pathname.includes(i.pathname) && t(this, u).classList.add("current") : i.pathname === r.pathname || (c = t(this, N)) != null && c.includes(r.pathname) ? (t(this, u).classList.add("current"), t(this, u).classList.add("clicked")) : t(this, u).classList.remove("clicked");
154
- }
155
- destroy() {
156
- t(this, u).removeEventListener("click", t(this, x)), t(this, u).classList.remove("current");
157
- }
158
- }
159
- S = new WeakMap(), u = new WeakMap(), P = new WeakMap(), O = new WeakMap(), N = new WeakMap(), x = new WeakMap();
160
- globalThis.URLPattern = at;
161
- var C, z, g, q, H, b, T, B, j, D, et, K;
162
- class Et {
163
- constructor(e) {
164
- h(this, D);
165
- h(this, C, null);
166
- h(this, z, null);
167
- h(this, g, []);
168
- h(this, q, null);
169
- h(this, H, []);
170
- h(this, b);
171
- h(this, T, null);
172
- h(this, B, new nt());
173
- h(this, j, ht(() => {
174
- const e = (s) => s.split("/").length;
175
- n(this, g, t(this, g).sort((s, i) => e(s.pattern) - e(i.pattern))), this.navigate(location.pathname);
176
- }, 0));
177
- h(this, K, (e) => {
153
+ });
154
+ }, st = function() {
155
+ return R(this, null, function* () {
156
+ const t = e(this, A).filter(n(this, o, F));
157
+ yield Promise.all(
158
+ t.map(
159
+ (s) => new Promise((i) => {
160
+ n(this, o, F).call(this, s) ? s.onload = () => i() : i();
161
+ })
162
+ )
163
+ );
164
+ });
165
+ }, F = function(t) {
166
+ return t instanceof HTMLElement && (t.tagName === "STYLE" || t.tagName === "SCRIPT" || t.tagName === "LINK");
167
+ };
168
+ globalThis.URLPattern = gt;
169
+ var S, I, g, z, E, L, O, p, H, h, it, at, ht, rt, nt, ot, ct, lt, ut, K, dt, mt, x;
170
+ class zt {
171
+ constructor(t) {
172
+ a(this, h);
173
+ a(this, S);
174
+ a(this, I);
175
+ a(this, g, []);
176
+ a(this, z, null);
177
+ a(this, E, []);
178
+ a(this, L, null);
179
+ a(this, O, null);
180
+ a(this, p, null);
181
+ a(this, H, new pt());
182
+ a(this, x, (t) => {
178
183
  var s;
179
- (s = e.state) != null && s.path && this.navigate(e.state.path, "none");
184
+ (s = t.state) != null && s.path && this.navigate(t.state.path, {
185
+ historyAction: "none"
186
+ });
180
187
  });
181
- _ && (e != null && e.base ? n(this, z, rt(e.base)) : n(this, z, "/"), n(this, C, (e == null ? void 0 : e.rootElement) || document.body), addEventListener("popstate", t(this, K)));
188
+ var s;
189
+ r(this, I, t != null && t.base ? ft(t.base) : "/"), r(this, S, (s = t == null ? void 0 : t.rootElement) != null ? s : document.body), r(this, p, this.normalizePath(
190
+ location.pathname + location.search + location.hash
191
+ )), n(this, h, it).call(this);
182
192
  }
183
- get currentPathname() {
184
- return t(this, T);
193
+ get candidateURL() {
194
+ return e(this, L);
185
195
  }
186
- get candidatePathname() {
187
- return t(this, b);
196
+ get currentURL() {
197
+ return e(this, p);
188
198
  }
189
199
  get routes() {
190
- return t(this, g);
200
+ return e(this, g);
191
201
  }
192
202
  get links() {
193
- return t(this, H);
203
+ return e(this, E);
204
+ }
205
+ run() {
206
+ n(this, h, lt).call(this), this.navigate(e(this, p).path, { revalidate: !0 });
194
207
  }
195
- navigationEvent(e) {
196
- return t(this, B).subscribe(e);
208
+ destroy() {
209
+ removeEventListener("popstate", e(this, x)), n(this, h, K).call(this), e(this, g).forEach((t) => t.close()), e(this, H).close();
197
210
  }
198
- defineRoute(e, s) {
199
- const i = new ut(e, s);
200
- t(this, g).push(i), t(this, j).call(this);
211
+ navigationEvent(t) {
212
+ return e(this, H).subscribe(t);
201
213
  }
202
- navigate(e, s = "push") {
203
- return I(this, null, function* () {
204
- var J, Q;
205
- const i = this.normalizePath(e);
206
- let { pathname: r, hash: o, parameters: c, leaf: f } = i;
207
- if (t(this, b) === r || t(this, T) === r)
214
+ defineRoute(t, s) {
215
+ const i = new yt(t, s);
216
+ e(this, g).push(i);
217
+ }
218
+ navigate(t, s) {
219
+ return R(this, null, function* () {
220
+ var l, m, w;
221
+ const i = this.normalizePath(t);
222
+ if (!(s != null && s.revalidate) && (((l = e(this, L)) == null ? void 0 : l.pathname) === i.pathname || e(this, p).pathname === i.pathname)) {
223
+ ((m = e(this, p)) == null ? void 0 : m.parameters) !== i.parameters && (r(this, O, e(this, p)), r(this, p, i), Y({
224
+ action: ((w = e(this, p)) == null ? void 0 : w.hash) !== i.hash ? "replace" : (s == null ? void 0 : s.historyAction) || "push",
225
+ pathname: i.pathname,
226
+ searchParameters: i.parameters,
227
+ hash: i.hash
228
+ })), e(this, E).forEach((y) => {
229
+ y.checkCurrent(i);
230
+ });
208
231
  return;
209
- n(this, b, r);
210
- const m = t(this, g).filter((l) => l.isActive), w = t(this, g).filter(
211
- (l) => !m.includes(l) && l.testPathname(f)
212
- ), st = m.filter((l) => !l.testPathname(f)), F = m.filter((l) => l.testPathname(f));
213
- let G = !0;
214
- if (this.preprocessor)
215
- try {
216
- yield new Promise((l, it) => {
217
- var V;
218
- (V = this.preprocessor) == null || V.call(this, { path: i, resolve: l, reject: it });
219
- });
220
- } catch (l) {
221
- l ? console.error(l) : console.log("Route change canceled"), G = !1;
222
- }
223
- if (G && t(this, b) === r) {
224
- n(this, q, F[F.length - 1]), st.forEach((l) => {
225
- l.close();
226
- }), n(this, T, r), ot({ action: s, pathname: r, searchParameters: c, hash: o });
227
- try {
228
- for (var yt = $(w), At, kt, St; At = !(kt = yield yt.next()).done; At = !1) {
229
- const l = kt.value;
230
- yield l.render(((J = t(this, q)) == null ? void 0 : J.nest) || t(this, C), r), n(this, q, l);
231
- }
232
- } catch (kt) {
233
- St = [kt];
234
- } finally {
235
- try {
236
- At && (kt = yt.return) && (yield kt.call(yt));
237
- } finally {
238
- if (St)
239
- throw St[0];
240
- }
241
- }
242
- Y(this, D, et).call(this), (Q = this.postprocessor) == null || Q.call(this, { pathname: r }), t(this, B).notify({ pathname: r });
243
232
  }
233
+ r(this, L, i), (yield n(this, h, at).call(this, e(this, L))) && i.path === e(this, L).path && (yield n(this, h, ht).call(this, e(this, L), s));
244
234
  });
245
235
  }
246
- normalizePath(e) {
247
- return ct(e, { base: t(this, z) });
236
+ normalizePath(t) {
237
+ return Rt(t, { base: e(this, I) });
248
238
  }
249
239
  }
250
- C = new WeakMap(), z = new WeakMap(), g = new WeakMap(), q = new WeakMap(), H = new WeakMap(), b = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), D = new WeakSet(), et = function() {
251
- const e = t(this, g).filter((i) => i.isActive), s = Array.from(
240
+ S = new WeakMap(), I = new WeakMap(), g = new WeakMap(), z = new WeakMap(), E = new WeakMap(), L = new WeakMap(), O = new WeakMap(), p = new WeakMap(), H = new WeakMap(), h = new WeakSet(), it = function() {
241
+ addEventListener("popstate", e(this, x));
242
+ }, at = function(t) {
243
+ return R(this, null, function* () {
244
+ if (!this.preprocessor) return !0;
245
+ try {
246
+ return yield new Promise((s, i) => {
247
+ var l;
248
+ (l = this.preprocessor) == null || l.call(this, { path: t, resolve: s, reject: i });
249
+ }), !0;
250
+ } catch (s) {
251
+ return console.error(s != null ? s : "Route change canceled"), !1;
252
+ }
253
+ });
254
+ }, ht = function(i) {
255
+ return R(this, arguments, function* (t, s = {}) {
256
+ var f;
257
+ const { activeRoutes: l, newRoutes: m, oldRoutes: w, keepRoutes: y } = n(this, h, rt).call(this, t.leaf);
258
+ r(this, z, (f = y[y.length - 1]) != null ? f : null), n(this, h, nt).call(this, w), r(this, p, t), Y({
259
+ action: s.historyAction || "push",
260
+ pathname: t.pathname,
261
+ searchParameters: t.parameters,
262
+ hash: t.hash
263
+ }), yield n(this, h, ot).call(this, m, t.leaf), n(this, h, ut).call(this), n(this, h, ct).call(this, t.pathname);
264
+ });
265
+ }, rt = function(t) {
266
+ const s = e(this, g).filter((i) => i.isActive);
267
+ return {
268
+ activeRoutes: s,
269
+ newRoutes: e(this, g).filter(
270
+ (i) => !s.includes(i) && i.testPathname(t)
271
+ ),
272
+ oldRoutes: s.filter((i) => !i.testPathname(t)),
273
+ keepRoutes: s.filter((i) => i.testPathname(t))
274
+ };
275
+ }, nt = function(t) {
276
+ t.forEach((s) => s.close());
277
+ }, ot = function(t, s) {
278
+ return R(this, null, function* () {
279
+ var i, l;
280
+ for (const m of t) {
281
+ const w = (l = (i = e(this, z)) == null ? void 0 : i.nest) != null ? l : e(this, S);
282
+ yield m.render(w, s), r(this, z, m);
283
+ }
284
+ });
285
+ }, ct = function(t) {
286
+ var s;
287
+ (s = this.postprocessor) == null || s.call(this, { pathname: t }), e(this, H).notify({ pathname: t });
288
+ }, lt = function() {
289
+ e(this, g).sort((t, s) => {
290
+ const i = t.pattern.split("/").length, l = s.pattern.split("/").length;
291
+ return i - l;
292
+ });
293
+ }, ut = function() {
294
+ n(this, h, K).call(this), n(this, h, dt).call(this);
295
+ }, K = function() {
296
+ e(this, E).forEach((t) => t.destroy()), r(this, E, []);
297
+ }, dt = function() {
298
+ const t = e(this, g).filter((i) => i.isActive), s = n(this, h, mt).call(this, t);
299
+ r(this, E, s.map((i) => new wt(this, i)));
300
+ }, mt = function(t) {
301
+ const s = Array.from(
302
+ e(this, S).querySelectorAll("a")
303
+ ), i = t.flatMap(
304
+ (l) => l.getAnchorElements()
305
+ );
306
+ return Array.from(
252
307
  new Set(
253
- [
254
- ...t(this, C).querySelectorAll("a"),
255
- ...e.map((i) => i.getAnchorElements()).flat()
256
- ].filter((i) => {
257
- var r;
258
- return (r = i.getAttribute("href")) == null ? void 0 : r.startsWith("/");
259
- })
308
+ [...s, ...i].filter(
309
+ (l) => {
310
+ var m;
311
+ return (m = l.getAttribute("href")) == null ? void 0 : m.startsWith("/");
312
+ }
313
+ )
260
314
  )
261
315
  );
262
- t(this, H).forEach((i) => {
263
- i.destroy();
264
- }), n(this, H, s.map((i) => new mt(this, i)));
265
- }, K = new WeakMap();
316
+ }, x = new WeakMap();
266
317
  export {
267
- Et as Router
318
+ zt as Router
268
319
  };