aptechka 0.74.2 → 0.75.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.
@@ -1,408 +1,472 @@
1
- var se = Object.defineProperty, ae = Object.defineProperties;
2
- var ne = Object.getOwnPropertyDescriptors;
3
- var Wt = Object.getOwnPropertySymbols;
4
- var re = Object.prototype.hasOwnProperty, oe = Object.prototype.propertyIsEnumerable;
5
- var Xt = (o, e) => (e = Symbol[o]) ? e : Symbol.for("Symbol." + o), Kt = (o) => {
1
+ var ce = Object.defineProperty, de = Object.defineProperties;
2
+ var ue = Object.getOwnPropertyDescriptors;
3
+ var Gt = Object.getOwnPropertySymbols;
4
+ var me = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
5
+ var Jt = (o, e) => (e = Symbol[o]) ? e : Symbol.for("Symbol." + o), Zt = (o) => {
6
6
  throw TypeError(o);
7
7
  };
8
- var Yt = (o, e, i) => e in o ? se(o, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[e] = i, Et = (o, e) => {
9
- for (var i in e || (e = {}))
10
- re.call(e, i) && Yt(o, i, e[i]);
11
- if (Wt)
12
- for (var i of Wt(e))
13
- oe.call(e, i) && Yt(o, i, e[i]);
8
+ var Qt = (o, e, s) => e in o ? ce(o, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[e] = s, Ct = (o, e) => {
9
+ for (var s in e || (e = {}))
10
+ me.call(e, s) && Qt(o, s, e[s]);
11
+ if (Gt)
12
+ for (var s of Gt(e))
13
+ fe.call(e, s) && Qt(o, s, e[s]);
14
14
  return o;
15
- }, kt = (o, e) => ae(o, ne(e));
16
- var Pt = (o, e, i) => e.has(o) || Kt("Cannot " + i);
17
- var t = (o, e, i) => (Pt(o, e, "read from private field"), i ? i.call(o) : e.get(o)), l = (o, e, i) => e.has(o) ? Kt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, i), r = (o, e, i, s) => (Pt(o, e, "write to private field"), s ? s.call(o, i) : e.set(o, i), i), p = (o, e, i) => (Pt(o, e, "access private method"), i);
18
- var W = (o, e, i) => new Promise((s, h) => {
19
- var S = (d) => {
15
+ }, Nt = (o, e) => de(o, ue(e));
16
+ var Dt = (o, e, s) => e.has(o) || Zt("Cannot " + s);
17
+ var t = (o, e, s) => (Dt(o, e, "read from private field"), s ? s.call(o) : e.get(o)), h = (o, e, s) => e.has(o) ? Zt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, s), r = (o, e, s, i) => (Dt(o, e, "write to private field"), i ? i.call(o, s) : e.set(o, s), s), g = (o, e, s) => (Dt(o, e, "access private method"), s);
18
+ var G = (o, e, s) => new Promise((i, l) => {
19
+ var S = (c) => {
20
20
  try {
21
- b(i.next(d));
22
- } catch (E) {
23
- h(E);
21
+ E(s.next(c));
22
+ } catch (L) {
23
+ l(L);
24
24
  }
25
- }, g = (d) => {
25
+ }, p = (c) => {
26
26
  try {
27
- b(i.throw(d));
28
- } catch (E) {
29
- h(E);
27
+ E(s.throw(c));
28
+ } catch (L) {
29
+ l(L);
30
30
  }
31
- }, b = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(S, g);
32
- b((i = i.apply(o, e)).next());
31
+ }, E = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(S, p);
32
+ E((s = s.apply(o, e)).next());
33
33
  });
34
- var jt = (o, e, i) => (e = o[Xt("asyncIterator")]) ? e.call(o) : (o = o[Xt("iterator")](), e = {}, i = (s, h) => (h = o[s]) && (e[s] = (S) => new Promise((g, b, d) => (S = h.call(o, S), d = S.done, Promise.resolve(S.value).then((E) => g({ value: E, done: d }), b)))), i("next"), i("return"), e);
35
- import { i as Jt } from "../index-Bv9zgfdb.js";
36
- import { d as T } from "../events-CsVF98U6.js";
37
- import { w as le, s as he } from "../scroll-DPkCFTxg.js";
34
+ var _t = (o, e, s) => (e = o[Jt("asyncIterator")]) ? e.call(o) : (o = o[Jt("iterator")](), e = {}, s = (i, l) => (l = o[i]) && (e[i] = (S) => new Promise((p, E, c) => (S = l.call(o, S), c = S.done, Promise.resolve(S.value).then((L) => p({ value: L, done: c }), E)))), s("next"), s("return"), e);
35
+ import { i as se } from "../index-Bv9zgfdb.js";
36
+ import { d as I } from "../events-CsVF98U6.js";
37
+ import { w as pe, s as ge } from "../scroll-DPkCFTxg.js";
38
38
  import "construct-style-sheets-polyfill";
39
- import { n as ce, c as Ct, s as ue } from "../url-CFnGU6md.js";
40
- import { cssValueParser as de } from "../css-value-parser/index.js";
41
- class Qt extends HTMLElement {
39
+ import { n as Ee, c as It, s as Le } from "../url-CBKXmNOi.js";
40
+ import { cssValueParser as Se } from "../css-value-parser/index.js";
41
+ import { c as ve } from "../string-BlMQbe8b.js";
42
+ class ie extends HTMLElement {
42
43
  connectedCallback() {
43
44
  const e = {
44
45
  "aria-live": "assertive",
45
46
  "aria-atomic": "true",
46
47
  style: "position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"
47
48
  };
48
- for (const [i, s] of Object.entries(e))
49
- this.setAttribute(i, s);
49
+ for (const [s, i] of Object.entries(e))
50
+ this.setAttribute(s, i);
50
51
  }
51
52
  }
52
- Jt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Qt);
53
- var P, a, q, J, St, rt, Q;
54
- class Ht {
55
- constructor(e, i) {
56
- l(this, J);
57
- l(this, P);
58
- l(this, a);
59
- l(this, q);
60
- l(this, rt, (e) => {
61
- var s;
53
+ se && !customElements.get("morph-announcer") && customElements.define("morph-announcer", ie);
54
+ var H, a, U, st, Rt, mt, it;
55
+ class qt {
56
+ constructor(e, s) {
57
+ h(this, st);
58
+ h(this, H);
59
+ h(this, a);
60
+ h(this, U);
61
+ h(this, mt, (e) => {
62
+ var i;
62
63
  if (e.preventDefault(), document.documentElement.classList.contains("click-disabled"))
63
64
  return;
64
- if (t(this, a).hasAttribute("data-back") && t(this, P).previousURL)
65
+ if (t(this, a).hasAttribute("data-back") && t(this, H).previousURL)
65
66
  history.back();
66
67
  else {
67
- r(this, q, t(this, a).getAttribute("href") || "/");
68
- const h = t(this, a).getAttribute(
68
+ r(this, U, t(this, a).getAttribute("href") || "/");
69
+ const l = t(this, a).getAttribute(
69
70
  "data-history-action"
70
- ) || "push", S = t(this, a).hasAttribute("data-center-scroll"), g = getComputedStyle(t(this, a)).getPropertyValue("--offset-scroll").trim(), b = g ? de.parse(g) : void 0, d = t(this, a).hasAttribute("data-revalidate") || t(this, a).hasAttribute("data-pagination-more-link") || t(this, a).hasAttribute("data-pagination-set-link"), E = t(this, a).hasAttribute(
71
+ ) || "push", S = t(this, a).hasAttribute("data-center-scroll"), p = getComputedStyle(t(this, a)).getPropertyValue("--offset-scroll").trim(), E = p ? Se.parse(p) : void 0, c = t(this, a).hasAttribute("data-revalidate") || t(this, a).hasAttribute("data-pagination-more-link") || t(this, a).hasAttribute("data-pagination-set-link"), L = t(this, a).hasAttribute(
71
72
  "data-keep-search-parameters"
72
- ), bt = t(this, a).hasAttribute("data-keep-scroll-position") || t(this, a).hasAttribute("data-pagination-more-link"), at = t(this, a).getAttribute(
73
+ ), D = t(this, a).hasAttribute("data-keep-scroll-position") || t(this, a).hasAttribute("data-pagination-more-link"), dt = t(this, a).getAttribute(
73
74
  "data-scroll-behaviour"
74
- ), dt = p(this, J, St).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
75
- dt && (t(this, a).hasAttribute("data-pagination-set-link") ? t(this, P).links.forEach((U) => {
76
- U.updatePagination(
75
+ ), et = g(this, st, Rt).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
76
+ et && (t(this, a).hasAttribute("data-pagination-set-link") ? t(this, H).links.forEach((M) => {
77
+ M.updatePagination(
77
78
  parseInt(t(this, a).getAttribute("data-value") || "1"),
78
- dt.selector
79
+ et.selector
79
80
  );
80
- }) : t(this, a).hasAttribute("data-pagination-more-link") && t(this, P).links.forEach((U) => {
81
- U.updatePagination(
82
- dt.currentPage + 1,
83
- dt.selector
81
+ }) : t(this, a).hasAttribute("data-pagination-more-link") && t(this, H).links.forEach((M) => {
82
+ M.updatePagination(
83
+ et.currentPage + 1,
84
+ et.selector
84
85
  );
85
86
  }));
86
- const mt = ((s = t(this, a).getAttribute("data-submorph")) == null ? void 0 : s.split(",").map((U) => U.trim())) || t(this, a).hasAttribute("data-pagination-more-link") && [
87
+ const ne = ((i = t(this, a).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((M) => M.trim())) || t(this, a).hasAttribute("data-pagination-more-link") && [
87
88
  t(this, a).getAttribute("data-pagination-more-link")
88
89
  ] || t(this, a).hasAttribute("data-pagination-set-link") && [
89
90
  t(this, a).getAttribute("data-pagination-set-link")
90
- ] || void 0, c = t(this, a).hasAttribute("data-clear-state");
91
- t(this, P).navigate(t(this, q), {
92
- historyAction: h,
91
+ ] || void 0, yt = t(this, a).hasAttribute("data-clear-state");
92
+ let d = t(this, U);
93
+ if (t(this, a).hasAttribute("data-toggle-params")) {
94
+ const [M, Pt] = t(this, U).split("?"), j = new URLSearchParams(Pt), W = new URLSearchParams(location.search), A = new URLSearchParams();
95
+ for (const [w] of j)
96
+ (!W.has(w) || W.has(w) && W.get(w) !== j.get(w)) && A.append(w, j.get(w));
97
+ if (t(this, a).hasAttribute("data-merge-params"))
98
+ for (const [w] of W)
99
+ j.has(w) || A.append(w, W.get(w));
100
+ d = `${M}?${A.toString()}`;
101
+ }
102
+ t(this, H).navigate(d, {
103
+ historyAction: l,
93
104
  centerScroll: S,
94
- offsetScroll: b,
95
- revalidate: d,
96
- keepSearchParameters: E,
97
- submorph: mt,
98
- clearState: c,
99
- keepScrollPosition: bt,
100
- scrollBehaviour: at,
101
- submorphAppend: t(this, a).hasAttribute("data-pagination-more-link")
105
+ offsetScroll: E,
106
+ revalidate: c,
107
+ keepSearchParameters: L,
108
+ submorph: ne,
109
+ clearState: yt,
110
+ keepScrollPosition: D,
111
+ scrollBehaviour: dt,
112
+ submorphAppend: t(this, a).hasAttribute("data-pagination-more-link"),
113
+ mergeParams: t(this, a).hasAttribute("data-merge-params") && !t(this, a).hasAttribute("data-toggle-params")
102
114
  });
103
115
  }
104
116
  });
105
- l(this, Q, () => {
117
+ h(this, it, () => {
106
118
  const e = t(this, a).hasAttribute("data-revalidate");
107
- t(this, P).prefetch(t(this, q), e), t(this, a).removeEventListener("pointerenter", t(this, Q));
119
+ t(this, H).prefetch(t(this, U), e), t(this, a).removeEventListener("pointerenter", t(this, it));
108
120
  });
109
- r(this, P, i), r(this, a, e), t(this, a).addEventListener("click", t(this, rt)), r(this, q, t(this, a).getAttribute("href") || "/"), this.checkCurrent(location.href.replace(location.origin, ""));
110
- const s = p(this, J, St).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
111
- s && this.updatePagination(
112
- s.currentPage,
113
- s.selector
114
- ), t(this, a).hasAttribute("data-prefetch") && t(this, a).addEventListener("pointerenter", t(this, Q));
121
+ r(this, H, s), r(this, a, e), t(this, a).addEventListener("click", t(this, mt)), r(this, U, t(this, a).getAttribute("href") || "/"), this.checkCurrent(location.href.replace(location.origin, ""));
122
+ const i = g(this, st, Rt).call(this, t(this, a).getAttribute("data-pagination-set-link") || t(this, a).getAttribute("data-pagination-more-link"));
123
+ i && this.updatePagination(
124
+ i.currentPage,
125
+ i.selector
126
+ ), t(this, a).hasAttribute("data-prefetch") && t(this, a).addEventListener("pointerenter", t(this, it));
115
127
  }
116
128
  get element() {
117
129
  return t(this, a);
118
130
  }
119
131
  checkCurrent(e) {
120
- var h;
121
- const i = t(this, P).normalizePath(e), s = t(this, P).normalizePath(t(this, q));
122
- t(this, a).hasAttribute("data-include") && i.pathname.includes(s.pathname) ? t(this, a).classList.add("current") : s.pathname === i.pathname ? t(this, a).classList.add("current") : (h = t(this, a).getAttribute("data-associated-paths")) != null && h.split(",").find((S) => i.pathname.includes(S)) ? t(this, a).classList.add("current") : t(this, a).classList.remove("current"), i.path === s.path ? t(this, a).classList.add("exact") : t(this, a).classList.remove("exact");
123
- }
124
- updatePagination(e, i) {
125
- const s = p(this, J, St).call(this, i);
126
- if (s)
127
- if (s.element.setAttribute(
132
+ var L;
133
+ const s = t(this, H).normalizePath(e), i = t(this, H).normalizePath(t(this, U));
134
+ t(this, a).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? t(this, a).classList.add("current") : i.pathname === s.pathname ? t(this, a).classList.add("current") : (L = t(this, a).getAttribute("data-associated-paths")) != null && L.split(",").find((D) => s.pathname.includes(D)) ? t(this, a).classList.add("current") : t(this, a).classList.remove("current"), s.path === i.path ? t(this, a).classList.add("exact") : t(this, a).classList.remove("exact");
135
+ const [l, S] = t(this, U).split("?"), p = new URLSearchParams(S), E = new URLSearchParams(location.search);
136
+ let c = 0;
137
+ for (const [D] of E)
138
+ p.has(D) && E.get(D) === p.get(D) && c++;
139
+ c ? (t(this, a).classList.toggle(
140
+ "all-params-matched",
141
+ E.size === c
142
+ ), t(this, a).classList.toggle(
143
+ "some-params-matched",
144
+ E.size !== c
145
+ )) : (t(this, a).classList.remove("all-params-matched"), t(this, a).classList.remove("some-params-matched"));
146
+ }
147
+ updatePagination(e, s) {
148
+ const i = g(this, st, Rt).call(this, s);
149
+ if (i)
150
+ if (i.element.setAttribute(
128
151
  "data-current-page",
129
152
  e.toString()
130
153
  ), t(this, a).hasAttribute("data-pagination-more-link"))
131
- if (e < s.totalPages) {
154
+ if (e < i.totalPages) {
132
155
  t(this, a).style.display = "";
133
- const h = t(this, a).querySelector(
156
+ const l = t(this, a).querySelector(
134
157
  "[data-pagination-more-link-counter]"
135
158
  );
136
- h && (h.textContent = (s.totalPages - e).toString());
137
- const S = t(this, a).getAttribute("href"), g = new URL(S, window.location.origin);
138
- g.searchParams.set("page", (e + 1).toString());
139
- const b = g.href.replace(g.origin, "").toString();
140
- t(this, a).setAttribute("href", b), this.checkCurrent(b);
159
+ l && (l.textContent = (i.totalPages - e).toString());
160
+ const S = t(this, a).getAttribute("href"), p = new URL(S, window.location.origin);
161
+ p.searchParams.set("page", (e + 1).toString());
162
+ const E = p.href.replace(p.origin, "").toString();
163
+ t(this, a).setAttribute("href", E), this.checkCurrent(E);
141
164
  } else
142
165
  t(this, a).style.display = "none";
143
166
  else t(this, a).hasAttribute("data-pagination-set-link") && (t(this, a).getAttribute("data-value") === e.toString() ? t(this, a).classList.add("pagination-current") : t(this, a).classList.remove("pagination-current"));
144
167
  }
145
168
  destroy() {
146
- t(this, a).removeEventListener("click", t(this, rt)), t(this, a).removeEventListener("pointerenter", t(this, Q)), t(this, a).classList.remove("current", "exact", "pagination-current");
169
+ t(this, a).removeEventListener("click", t(this, mt)), t(this, a).removeEventListener("pointerenter", t(this, it)), t(this, a).classList.remove("current", "exact", "pagination-current");
147
170
  }
148
171
  }
149
- P = new WeakMap(), a = new WeakMap(), q = new WeakMap(), J = new WeakSet(), St = function(e) {
172
+ H = new WeakMap(), a = new WeakMap(), U = new WeakMap(), st = new WeakSet(), Rt = function(e) {
150
173
  if (!e)
151
174
  return;
152
- const i = document.querySelector(e);
153
- if (i) {
154
- const s = parseInt(
155
- i.getAttribute("data-current-page") || "1"
156
- ), h = parseInt(
157
- i.getAttribute("data-total-pages") || "1"
175
+ const s = document.querySelector(e);
176
+ if (s) {
177
+ const i = parseInt(
178
+ s.getAttribute("data-current-page") || "1"
179
+ ), l = parseInt(
180
+ s.getAttribute("data-total-pages") || "1"
158
181
  );
159
182
  return {
160
- element: i,
161
- currentPage: s,
162
- totalPages: h,
183
+ element: s,
184
+ currentPage: i,
185
+ totalPages: l,
163
186
  selector: e
164
187
  };
165
188
  }
166
- }, rt = new WeakMap(), Q = new WeakMap();
167
- const me = new DOMParser();
168
- var M, X, A, x, Y, z, Z, K, V, ot;
169
- class $t {
170
- constructor(e, i) {
171
- l(this, M);
172
- l(this, X);
173
- l(this, A, { x: 0, y: 0 });
174
- l(this, x, null);
175
- l(this, Y, null);
176
- l(this, z, null);
177
- l(this, Z, null);
178
- l(this, K, null);
179
- l(this, V, null);
180
- l(this, ot);
181
- r(this, M, e), r(this, X, i);
189
+ }, mt = new WeakMap(), it = new WeakMap();
190
+ const be = new DOMParser();
191
+ var q, J, k, z, Q, B, at, Z, X, ft;
192
+ class te {
193
+ constructor(e, s) {
194
+ h(this, q);
195
+ h(this, J);
196
+ h(this, k, { x: 0, y: 0 });
197
+ h(this, z, null);
198
+ h(this, Q, null);
199
+ h(this, B, null);
200
+ h(this, at, null);
201
+ h(this, Z, null);
202
+ h(this, X, null);
203
+ h(this, ft);
204
+ r(this, q, e), r(this, J, s);
182
205
  }
183
206
  get pathname() {
184
- return t(this, X);
207
+ return t(this, J);
185
208
  }
186
209
  get scrollState() {
187
- return t(this, A);
210
+ return t(this, k);
188
211
  }
189
212
  get document() {
190
- return t(this, z);
213
+ return t(this, B);
191
214
  }
192
215
  setHeaders(e) {
193
- r(this, ot, e);
216
+ r(this, ft, e);
194
217
  }
195
218
  setInitialDocument(e) {
196
- r(this, x, e.cloneNode(!0));
219
+ r(this, z, e.cloneNode(!0));
197
220
  }
198
221
  abort() {
199
222
  var e;
200
- return (e = t(this, K)) == null ? void 0 : e.abort(
201
- `[${t(this, X)}] page loading cancelled`
223
+ return (e = t(this, Z)) == null ? void 0 : e.abort(
224
+ `[${t(this, J)}] page loading cancelled`
202
225
  );
203
226
  }
204
- fetch(e, i, s) {
205
- return W(this, null, function* () {
206
- var h;
207
- if (!s) {
208
- const b = ((h = t(this, x)) == null ? void 0 : h.documentElement.getAttribute("data-cache")) && i !== e, d = t(this, x) && t(this, M).isPopstateNavigation;
209
- if (t(this, V) || b || d)
210
- return t(this, V);
227
+ fetch(e, s, i) {
228
+ return G(this, null, function* () {
229
+ var l;
230
+ if (!i) {
231
+ const E = ((l = t(this, z)) == null ? void 0 : l.documentElement.getAttribute("data-cache")) && s !== e, c = t(this, z) && t(this, q).isPopstateNavigation;
232
+ if (t(this, X) || E || c)
233
+ return t(this, X);
211
234
  }
212
- return r(this, V, new Promise((S) => W(this, null, function* () {
235
+ return r(this, X, new Promise((S) => G(this, null, function* () {
213
236
  try {
214
- r(this, K, new AbortController());
215
- const b = yield (yield fetch(e, {
216
- signal: t(this, K).signal,
217
- headers: Et({
237
+ r(this, Z, new AbortController());
238
+ const E = yield (yield fetch(e, {
239
+ signal: t(this, Z).signal,
240
+ headers: Ct({
218
241
  "X-MORPH": "true",
219
- "X-MORPH-CURRENT-PATH": encodeURIComponent(i),
242
+ "X-MORPH-CURRENT-PATH": encodeURIComponent(s),
220
243
  "X-MORPH-NEW-PATH": encodeURIComponent(e)
221
- }, t(this, ot))
222
- })).text(), d = me.parseFromString(b, "text/html");
223
- this.setInitialDocument(d);
224
- } catch (g) {
225
- console.warn(g);
244
+ }, t(this, ft))
245
+ })).text(), c = be.parseFromString(E, "text/html");
246
+ this.setInitialDocument(c);
247
+ } catch (p) {
248
+ console.warn(p);
226
249
  } finally {
227
- r(this, K, null), r(this, V, null), S();
250
+ r(this, Z, null), r(this, X, null), S();
228
251
  }
229
- }))), t(this, V);
252
+ }))), t(this, X);
230
253
  });
231
254
  }
232
255
  cloneDocument() {
233
- r(this, z, (t(this, Y) || t(this, x)).cloneNode(!0));
256
+ r(this, B, (t(this, Q) || t(this, z)).cloneNode(!0));
234
257
  }
235
258
  get title() {
236
259
  let e = "";
237
- if (t(this, z).title)
238
- e = t(this, z).title;
260
+ if (t(this, B).title)
261
+ e = t(this, B).title;
239
262
  else {
240
- const i = t(this, z).querySelector("h1");
241
- e = (i == null ? void 0 : i.innerText) || (i == null ? void 0 : i.textContent) || t(this, X);
263
+ const s = t(this, B).querySelector("h1");
264
+ e = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || t(this, J);
242
265
  }
243
266
  return e;
244
267
  }
245
268
  clearScrollState() {
246
- t(this, A).x = 0, t(this, A).y = 0;
269
+ t(this, k).x = 0, t(this, k).y = 0;
247
270
  }
248
271
  clearDocumentState() {
249
- r(this, Y, null);
272
+ r(this, Q, null);
250
273
  }
251
274
  saveScrollState() {
252
- t(this, x).documentElement.hasAttribute(
275
+ t(this, z).documentElement.hasAttribute(
253
276
  "data-no-scroll-restoration"
254
- ) ? (t(this, A).x = 0, t(this, A).y = 0) : (t(this, A).x = t(this, M).scrollValue.left, t(this, A).y = t(this, M).scrollValue.top);
277
+ ) ? (t(this, k).x = 0, t(this, k).y = 0) : (t(this, k).x = t(this, q).scrollValue.left, t(this, k).y = t(this, q).scrollValue.top);
255
278
  }
256
279
  restoreScrollPosition() {
257
- t(this, M).scrollElement.scroll({
258
- top: t(this, A).y,
259
- left: t(this, A).x,
280
+ t(this, q).scrollElement.scroll({
281
+ top: t(this, k).y,
282
+ left: t(this, k).x,
260
283
  behavior: "instant"
261
284
  });
262
285
  }
263
286
  saveDocumentState() {
264
- t(this, x).documentElement.hasAttribute(
287
+ t(this, z).documentElement.hasAttribute(
265
288
  "data-no-page-restoration"
266
- ) ? r(this, Y, null) : r(this, Y, document.cloneNode(!0));
289
+ ) ? r(this, Q, null) : r(this, Q, document.cloneNode(!0));
267
290
  }
268
291
  renewScrollPosition() {
269
- t(this, M).scrollElement.scroll({
292
+ t(this, q).scrollElement.scroll({
270
293
  top: 0,
271
294
  left: 0,
272
295
  behavior: "instant"
273
296
  });
274
297
  }
275
298
  saveState(e) {
276
- r(this, Z, e);
299
+ r(this, at, e);
277
300
  }
278
301
  clearState() {
279
- const e = t(this, Z);
280
- return r(this, Z, null), e;
302
+ const e = t(this, at);
303
+ return r(this, at, null), e;
281
304
  }
282
305
  }
283
- M = new WeakMap(), X = new WeakMap(), A = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), z = new WeakMap(), Z = new WeakMap(), K = new WeakMap(), V = new WeakMap(), ot = new WeakMap();
284
- var R, _, y, F, f, j, O, B, C, lt, N, $, tt, et, ht, it, ct, m, Rt, ut, vt, Tt, Zt, Mt, xt, Nt, Ut, Lt, st;
285
- const nt = class nt {
306
+ q = new WeakMap(), J = new WeakMap(), k = new WeakMap(), z = new WeakMap(), Q = new WeakMap(), B = new WeakMap(), at = new WeakMap(), Z = new WeakMap(), X = new WeakMap(), ft = new WeakMap();
307
+ var C, nt, pt, zt, gt;
308
+ class ye {
286
309
  constructor(e) {
287
- l(this, m);
288
- l(this, R, null);
289
- l(this, _, null);
290
- l(this, y, []);
291
- l(this, F);
292
- l(this, f, null);
293
- l(this, j);
294
- l(this, O, []);
295
- l(this, B, !1);
296
- l(this, C, null);
297
- l(this, lt, !1);
298
- l(this, N, /* @__PURE__ */ new Map());
299
- l(this, $, null);
300
- l(this, tt, 0);
301
- l(this, et, 0);
302
- l(this, ht);
303
- l(this, it);
304
- l(this, ct);
305
- l(this, ut, (e) => {
306
- var i;
307
- return ((i = e.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !e.hasAttribute("download") && !e.hasAttribute("data-morph-skip") && !e.closest("[data-morph-skip]") && e.getAttribute("target") !== "_blank";
310
+ h(this, pt);
311
+ h(this, C);
312
+ h(this, nt, []);
313
+ h(this, gt, () => {
314
+ g(this, pt, zt).call(this);
315
+ });
316
+ r(this, C, e);
317
+ for (const s in t(this, C).dataset) {
318
+ const i = ve(s);
319
+ if (i.startsWith("param-")) {
320
+ const l = i.split("param-")[1], S = t(this, C).dataset[s];
321
+ t(this, nt).push({
322
+ name: l,
323
+ value: S
324
+ });
325
+ }
326
+ }
327
+ document.addEventListener(
328
+ "morphURLParametersChange",
329
+ t(this, gt)
330
+ ), g(this, pt, zt).call(this);
331
+ }
332
+ destroy() {
333
+ document.removeEventListener(
334
+ "morphURLParametersChange",
335
+ t(this, gt)
336
+ );
337
+ }
338
+ }
339
+ C = new WeakMap(), nt = new WeakMap(), pt = new WeakSet(), zt = function() {
340
+ const e = new URLSearchParams(location.search);
341
+ let s = !!t(this, nt).find((l) => e.has(l.name) && (e.get(l.name) === l.value || l.value === "*"));
342
+ !s && t(this, C).hasAttribute("data-match-no-params") && (s = !t(this, nt).filter((l) => e.has(l.name)).length);
343
+ const i = t(this, C).getAttribute("data-hide-class");
344
+ s ? i ? t(this, C).classList.remove(i) : t(this, C).style.display = "" : i ? t(this, C).classList.add(i) : t(this, C).style.display = "none";
345
+ }, gt = new WeakMap();
346
+ var N, rt, y, K, f, _, Y, $, T, Et, V, Lt, tt, ot, ht, St, lt, vt, m, Vt, bt, Ht, Wt, ae, Ft, Ot, Bt, Xt, Tt, ct;
347
+ const ut = class ut {
348
+ constructor(e) {
349
+ h(this, m);
350
+ h(this, N, null);
351
+ h(this, rt, null);
352
+ h(this, y, []);
353
+ h(this, K);
354
+ h(this, f, null);
355
+ h(this, _);
356
+ h(this, Y, []);
357
+ h(this, $, !1);
358
+ h(this, T, null);
359
+ h(this, Et, !1);
360
+ h(this, V, /* @__PURE__ */ new Map());
361
+ h(this, Lt, []);
362
+ h(this, tt, null);
363
+ h(this, ot, 0);
364
+ h(this, ht, 0);
365
+ h(this, St);
366
+ h(this, lt);
367
+ h(this, vt);
368
+ h(this, bt, (e) => {
369
+ var s;
370
+ return ((s = e.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !e.hasAttribute("download") && !e.hasAttribute("data-morph-skip") && !e.closest("[data-morph-skip]") && e.getAttribute("target") !== "_blank";
308
371
  });
309
- l(this, Lt, (e) => W(this, null, function* () {
310
- e.preventDefault(), r(this, B, !0), yield this.navigate(location.href.replace(location.origin, ""), {
372
+ h(this, Tt, (e) => G(this, null, function* () {
373
+ e.preventDefault(), r(this, $, !0), yield this.navigate(location.href.replace(location.origin, ""), {
311
374
  historyAction: "none",
312
- submorph: t(this, it) ? void 0 : t(this, ht),
313
- revalidate: t(this, it),
314
- keepScrollPosition: t(this, ct)
315
- }), r(this, B, !1);
375
+ submorph: t(this, lt) ? void 0 : t(this, St),
376
+ revalidate: t(this, lt),
377
+ keepScrollPosition: t(this, vt)
378
+ }), r(this, $, !1);
316
379
  }));
317
- l(this, st, () => {
318
- const { left: e, top: i } = this.scrollValue, s = i - t(this, et), h = e - t(this, tt);
319
- r(this, et, i), r(this, tt, e), document.documentElement.classList.toggle("scroll-y", i > 0), document.documentElement.classList.toggle("scroll-x", e > 0), document.documentElement.classList.toggle(
380
+ h(this, ct, () => {
381
+ const { left: e, top: s } = this.scrollValue, i = s - t(this, ht), l = e - t(this, ot);
382
+ r(this, ht, s), r(this, ot, e), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", e > 0), document.documentElement.classList.toggle(
320
383
  "scroll-y-forward",
321
- s > 0
384
+ i > 0
322
385
  ), document.documentElement.classList.toggle(
323
386
  "scroll-y-backward",
324
- s < 0
387
+ i < 0
325
388
  ), document.documentElement.classList.toggle(
326
389
  "scroll-x-forward",
327
- h > 0
390
+ l > 0
328
391
  ), document.documentElement.classList.toggle(
329
392
  "scroll-x-backward",
330
- h < 0
331
- ), T(document, "morphScroll", {
393
+ l < 0
394
+ ), I(document, "morphScroll", {
332
395
  detail: {
333
396
  left: e,
334
- top: i
397
+ top: s
335
398
  }
336
399
  });
337
400
  });
338
- if (Jt && !nt.instance) {
339
- nt.instance = this, r(this, R, {
340
- base: ce(e == null ? void 0 : e.base),
401
+ if (se && !ut.instance) {
402
+ ut.instance = this, r(this, N, {
403
+ base: Ee(e == null ? void 0 : e.base),
341
404
  waitForHeadToLoad: (e == null ? void 0 : e.waitForHeadToLoad) !== !1,
342
405
  trailingSlash: (e == null ? void 0 : e.trailingSlash) || !1,
343
406
  scrollSelector: e == null ? void 0 : e.scrollSelector,
344
407
  morphInsideScrollContainer: (e == null ? void 0 : e.morphInsideScrollContainer) || !1
345
- }), r(this, _, p(this, m, Tt).call(this, document.body));
346
- const i = this.normalizePath(
408
+ }), r(this, rt, g(this, m, Wt).call(this, document.body));
409
+ const s = this.normalizePath(
347
410
  location.pathname + location.search + location.hash
348
411
  );
349
- r(this, f, i);
350
- const s = new $t(this, t(this, f).pathname);
351
- s.setInitialDocument(document), t(this, N).set(t(this, f).pathname, s), document.documentElement.setAttribute(
412
+ r(this, f, s);
413
+ const i = new te(this, t(this, f).pathname);
414
+ i.setInitialDocument(document), t(this, V).set(t(this, f).pathname, i), document.documentElement.setAttribute(
352
415
  "data-current-pathname",
353
416
  t(this, f).pathname
354
417
  ), document.documentElement.setAttribute(
355
418
  "data-current-leaf",
356
- i.leaf
357
- ), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", t(this, Lt)), Ct({
419
+ s.leaf
420
+ ), this.findLinks(), this.findParamsDependent(), history.scrollRestoration = "manual", addEventListener("popstate", t(this, Tt)), It({
358
421
  action: "replace",
359
- pathname: i.pathname,
360
- searchParameters: i.parameters,
361
- hash: i.hash
362
- }), r(this, $, new Qt()), p(this, m, Nt).call(this, document);
422
+ pathname: s.pathname,
423
+ searchParameters: s.parameters,
424
+ hash: s.hash
425
+ }), r(this, tt, new ie()), g(this, m, Bt).call(this, document);
363
426
  }
364
427
  }
365
428
  get currentURL() {
366
429
  return t(this, f);
367
430
  }
368
431
  get previousURL() {
369
- return t(this, j);
432
+ return t(this, _);
370
433
  }
371
434
  get links() {
372
435
  return t(this, y);
373
436
  }
374
437
  get scrollElement() {
375
- return t(this, C);
438
+ return t(this, T);
376
439
  }
377
440
  get isPopstateNavigation() {
378
- return t(this, B);
441
+ return t(this, $);
379
442
  }
380
443
  get scrollValue() {
381
- let e = 0, i = 0;
382
- return t(this, lt) ? (e = window.scrollY, i = window.scrollX) : (e = t(this, C).scrollTop, i = t(this, C).scrollLeft), { top: e, left: i };
444
+ let e = 0, s = 0;
445
+ return t(this, Et) ? (e = window.scrollY, s = window.scrollX) : (e = t(this, T).scrollTop, s = t(this, T).scrollLeft), { top: e, left: s };
383
446
  }
384
447
  saveState(e) {
385
- const i = t(this, N).get(t(this, f).path);
386
- i && i.saveState(e);
448
+ const s = t(this, V).get(t(this, f).path);
449
+ s && s.saveState(e);
387
450
  }
388
451
  getState() {
389
- const e = t(this, N).get(t(this, f).path);
452
+ const e = t(this, V).get(t(this, f).path);
390
453
  return e == null ? void 0 : e.clearState();
391
454
  }
392
- normalizePath(e) {
393
- return ue(e, {
394
- base: t(this, R).base,
395
- trailingSlash: t(this, R).trailingSlash
455
+ normalizePath(e, s) {
456
+ return Le(e, {
457
+ base: t(this, N).base,
458
+ trailingSlash: t(this, N).trailingSlash,
459
+ mergeParams: s != null && s.mergeParams ? location.search : ""
396
460
  });
397
461
  }
398
- prefetch(e, i) {
399
- return W(this, null, function* () {
400
- var h;
401
- if (t(this, O).length)
462
+ prefetch(e, s) {
463
+ return G(this, null, function* () {
464
+ var l;
465
+ if (t(this, Y).length)
402
466
  return;
403
- e = ((h = this.pathnameModifier) == null ? void 0 : h.call(this, e)) || e;
404
- const s = p(this, m, vt).call(this, e);
405
- s == null || s.fetch(e, t(this, f).path, i);
467
+ e = ((l = this.pathnameModifier) == null ? void 0 : l.call(this, e)) || e;
468
+ const i = g(this, m, Ht).call(this, e);
469
+ i == null || i.fetch(e, t(this, f).path, s);
406
470
  });
407
471
  }
408
472
  excludeHeadChild(e) {
@@ -410,303 +474,319 @@ const nt = class nt {
410
474
  }
411
475
  setHeaders(e) {
412
476
  }
413
- navigate(dt) {
414
- return W(this, arguments, function* (e, {
415
- historyAction: i = "push",
416
- centerScroll: s,
417
- offsetScroll: h,
477
+ navigate(ne) {
478
+ return G(this, arguments, function* (e, {
479
+ historyAction: s = "push",
480
+ centerScroll: i,
481
+ offsetScroll: l,
418
482
  scrollBehaviour: S,
419
- revalidate: g,
420
- keepSearchParameters: b,
421
- submorph: d,
422
- submorphAppend: E,
423
- clearState: bt,
424
- keepScrollPosition: at
483
+ revalidate: p,
484
+ keepSearchParameters: E,
485
+ submorph: c,
486
+ submorphAppend: L,
487
+ clearState: D,
488
+ keepScrollPosition: dt,
489
+ mergeParams: et
425
490
  } = {}) {
426
- var U, Dt, It, qt;
427
- if (t(this, O).length)
491
+ var M, Pt, j, W;
492
+ if (t(this, Y).length)
428
493
  return;
429
- r(this, ht, d), r(this, it, g), r(this, ct, at);
430
- const mt = ((U = this.pathnameModifier) == null ? void 0 : U.call(this, e)) || e, c = this.normalizePath(mt);
431
- if (t(this, y).forEach((G) => {
432
- G.checkCurrent(c.path);
433
- }), !g && (((Dt = t(this, F)) == null ? void 0 : Dt.pathname) === c.pathname || t(this, f).pathname === c.pathname)) {
434
- at || p(this, m, Ut).call(this, c.hash || 0, {
435
- centerScroll: s,
436
- offsetScroll: h,
494
+ r(this, St, c), r(this, lt, p), r(this, vt, dt);
495
+ const yt = ((M = this.pathnameModifier) == null ? void 0 : M.call(this, e)) || e, d = this.normalizePath(yt, {
496
+ mergeParams: et
497
+ });
498
+ if (!p && (((Pt = t(this, K)) == null ? void 0 : Pt.pathname) === d.pathname || t(this, f).pathname === d.pathname)) {
499
+ dt || g(this, m, Xt).call(this, d.hash || 0, {
500
+ centerScroll: i,
501
+ offsetScroll: l,
437
502
  behavior: "smooth"
438
- }), T(document, "morphSamePath", {
503
+ }), I(document, "morphSamePath", {
439
504
  custom: !0
440
- }), ((It = t(this, f)) == null ? void 0 : It.parameters) !== c.parameters && (r(this, j, t(this, f)), r(this, f, c), Ct({
441
- action: ((qt = t(this, f)) == null ? void 0 : qt.hash) !== c.hash ? "replace" : i,
442
- pathname: c.pathname,
443
- searchParameters: c.parameters,
444
- hash: c.hash
445
- }), T(document, "morphURLParametersChange", {
505
+ }), ((j = t(this, f)) == null ? void 0 : j.parameters) !== d.parameters && (r(this, _, t(this, f)), r(this, f, d), It({
506
+ action: ((W = t(this, f)) == null ? void 0 : W.hash) !== d.hash ? "replace" : s,
507
+ pathname: d.pathname,
508
+ searchParameters: d.parameters,
509
+ hash: d.hash
510
+ }), I(document, "morphURLParametersChange", {
446
511
  detail: {
447
512
  newURL: t(this, f),
448
- previousURL: t(this, j)
513
+ previousURL: t(this, _)
449
514
  }
450
- }));
515
+ })), t(this, y).forEach((A) => {
516
+ A.checkCurrent(d.path);
517
+ });
451
518
  return;
452
- }
453
- r(this, F, c);
519
+ } else
520
+ t(this, y).forEach((A) => {
521
+ A.checkCurrent(d.path);
522
+ });
523
+ r(this, K, d);
454
524
  try {
455
- let G = !0;
525
+ let A = !0;
456
526
  if (this.preprocessor)
457
527
  try {
458
- yield new Promise((n, w) => {
459
- var k;
460
- (k = this.preprocessor) == null || k.call(this, {
461
- url: c,
528
+ yield new Promise((n, P) => {
529
+ var R;
530
+ (R = this.preprocessor) == null || R.call(this, {
531
+ url: d,
462
532
  resolve: n,
463
- reject: w,
464
- submorph: d
533
+ reject: P,
534
+ submorph: c
465
535
  });
466
536
  });
467
537
  } catch (n) {
468
- n ? console.error(n) : console.log("Route change canceled"), G = !1;
538
+ n ? console.error(n) : console.log("Route change canceled"), A = !1;
469
539
  }
470
- if (!G || t(this, F).pathname !== c.pathname) {
540
+ if (!A || t(this, K).pathname !== d.pathname) {
471
541
  t(this, y).forEach((n) => {
472
542
  n.checkCurrent(t(this, f).path);
473
543
  });
474
544
  return;
475
545
  }
476
- const zt = {
477
- url: c,
478
- submorph: d
546
+ const w = {
547
+ url: d,
548
+ submorph: c
479
549
  };
480
- d ? E || d.forEach((n) => {
481
- document.querySelectorAll(n).forEach((w) => {
482
- w.classList.add("out"), w.setAttribute("data-morph-out", "");
550
+ c ? L || c.forEach((n) => {
551
+ document.querySelectorAll(n).forEach((P) => {
552
+ P.classList.add("out"), P.setAttribute("data-morph-out", "");
483
553
  });
484
- }) : t(this, _).forEach((n) => {
485
- var w, k;
486
- (w = n.firstElementChild) == null || w.classList.add("out"), (k = n.firstElementChild) == null || k.setAttribute("data-morph-out", "");
487
- }), T(document, "morphNavigation", {
488
- detail: zt
554
+ }) : t(this, rt).forEach((n) => {
555
+ var P, R;
556
+ (P = n.firstElementChild) == null || P.classList.add("out"), (R = n.firstElementChild) == null || R.setAttribute("data-morph-out", "");
557
+ }), I(document, "morphNavigation", {
558
+ detail: w
489
559
  });
490
- const yt = p(this, m, vt).call(this, t(this, f).pathname), v = p(this, m, vt).call(this, c.pathname);
491
- if (t(this, N).forEach((n) => {
492
- n.pathname !== c.pathname && n.abort();
493
- }), yield v == null ? void 0 : v.fetch(mt, t(this, f).path, g), t(this, F).pathname !== c.pathname) {
560
+ const Mt = g(this, m, Ht).call(this, t(this, f).pathname), v = g(this, m, Ht).call(this, d.pathname);
561
+ if (t(this, V).forEach((n) => {
562
+ n.pathname !== d.pathname && n.abort();
563
+ }), yield v == null ? void 0 : v.fetch(yt, t(this, f).path, p), t(this, K).pathname !== d.pathname) {
494
564
  t(this, y).forEach((n) => {
495
565
  n.checkCurrent(t(this, f).path);
496
566
  });
497
567
  return;
498
568
  }
499
- yt.clearState(), yt.saveScrollState(), yt.saveDocumentState(), (!t(this, B) || g) && (v.clearScrollState(), v.clearDocumentState()), bt && v.clearState(), v.cloneDocument(), t(this, $).textContent = v.title, document.body.appendChild(t(this, $));
500
- const ft = kt(Et({}, zt), {
569
+ Mt.clearState(), Mt.saveScrollState(), Mt.saveDocumentState(), (!t(this, $) || p) && (v.clearScrollState(), v.clearDocumentState()), D && v.clearState(), v.cloneDocument(), t(this, tt).textContent = v.title, document.body.appendChild(t(this, tt));
570
+ const wt = Nt(Ct({}, w), {
501
571
  document: v.document
502
572
  });
503
- E || ft.document.querySelectorAll("[data-morph-out]").forEach((n) => {
573
+ L || wt.document.querySelectorAll("[data-morph-out]").forEach((n) => {
504
574
  n.classList.remove("out");
505
- }), T(document, "morphStart", {
506
- detail: ft
575
+ }), I(document, "morphStart", {
576
+ detail: wt
507
577
  });
508
- const Vt = Array.from(document.head.children), Ft = Array.from(v.document.head.children), Ot = p(this, m, Zt).call(this, Vt, Ft), _t = p(this, m, Mt).call(this, Vt, Ot), pt = p(this, m, Mt).call(this, Ft, Ot).filter((n) => !this.excludeHeadChild(n));
509
- pt.forEach((n, w) => {
510
- n.tagName === "SCRIPT" && (pt[w] = p(this, m, Rt).call(this, n));
511
- }), pt.forEach((n) => {
578
+ const Kt = Array.from(document.head.children), Yt = Array.from(v.document.head.children), $t = g(this, m, ae).call(this, Kt, Yt), re = g(this, m, Ft).call(this, Kt, $t), At = g(this, m, Ft).call(this, Yt, $t).filter((n) => !this.excludeHeadChild(n));
579
+ At.forEach((n, P) => {
580
+ n.tagName === "SCRIPT" && (At[P] = g(this, m, Vt).call(this, n));
581
+ }), At.forEach((n) => {
512
582
  document.head.appendChild(n);
513
583
  });
514
- const wt = pt.filter((n) => {
584
+ const xt = At.filter((n) => {
515
585
  if (n.hasAttribute("data-no-waiting"))
516
586
  return !1;
517
- if (p(this, m, xt).call(this, n))
587
+ if (g(this, m, Ot).call(this, n))
518
588
  return !0;
519
589
  });
520
- t(this, R).waitForHeadToLoad && wt.length && (yield new Promise((n) => W(this, null, function* () {
521
- let w = 0;
590
+ t(this, N).waitForHeadToLoad && xt.length && (yield new Promise((n) => G(this, null, function* () {
591
+ let P = 0;
522
592
  try {
523
- for (var k = jt(wt), ee, D, H; ee = !(D = yield k.next()).done; ee = !1) {
524
- const gt = D.value;
525
- gt.onload = () => {
526
- w++, w === wt.length && n();
593
+ for (var R = _t(xt), he, F, x; he = !(F = yield R.next()).done; he = !1) {
594
+ const kt = F.value;
595
+ kt.onload = () => {
596
+ P++, P === xt.length && n();
527
597
  };
528
598
  }
529
- } catch (D) {
530
- H = [D];
599
+ } catch (F) {
600
+ x = [F];
531
601
  } finally {
532
602
  try {
533
- ee && (D = k.return) && (yield D.call(k));
603
+ he && (F = R.return) && (yield F.call(R));
534
604
  } finally {
535
- if (H)
536
- throw H[0];
605
+ if (x)
606
+ throw x[0];
537
607
  }
538
608
  }
539
- }))), yield le(10);
540
- const Bt = [];
541
- E || _t.forEach((n) => {
542
- n.hasAttribute("data-permanent") || (p(this, m, xt).call(this, n) ? Bt.push(n) : n.remove());
609
+ }))), yield pe(10);
610
+ const jt = [];
611
+ L || re.forEach((n) => {
612
+ n.hasAttribute("data-permanent") || (g(this, m, Ot).call(this, n) ? jt.push(n) : n.remove());
543
613
  });
544
- const te = p(this, m, Tt).call(this, v.document.body);
545
- !t(this, R).morphInsideScrollContainer && !d && p(this, m, Nt).call(this, v.document), document.documentElement.setAttribute(
614
+ const oe = g(this, m, Wt).call(this, v.document.body);
615
+ !t(this, N).morphInsideScrollContainer && !c && g(this, m, Bt).call(this, v.document), document.documentElement.setAttribute(
546
616
  "data-current-pathname",
547
- c.pathname
617
+ d.pathname
548
618
  ), document.documentElement.setAttribute(
549
619
  "data-current-leaf",
550
- c.leaf
551
- ), Ct({
552
- action: i,
553
- pathname: c.pathname,
554
- searchParameters: c.parameters || (b ? location.search : ""),
555
- hash: c.hash
556
- }), t(this, $).remove(), r(this, j, t(this, f)), r(this, f, c);
557
- const At = [];
558
- t(this, _).forEach((n, w) => {
559
- const k = te[w], ee = getComputedStyle(n).getPropertyValue("--morph-duration");
560
- let D = [], H = [];
561
- d ? (d.forEach((u) => {
562
- const L = n.querySelector(u), I = k.querySelector(u);
563
- L && I && (H.push(L), D.push(I));
564
- }), H.forEach((u) => {
565
- u.parentElement && At.push(u.parentElement);
566
- })) : (D.push(...k.childNodes), H.push(...n.childNodes), At.push(n)), E || H.forEach((u) => {
620
+ d.leaf
621
+ ), It({
622
+ action: s,
623
+ pathname: d.pathname,
624
+ searchParameters: d.parameters || (E ? location.search : ""),
625
+ hash: d.hash
626
+ }), t(this, tt).remove(), r(this, _, t(this, f)), r(this, f, d);
627
+ const Ut = [];
628
+ t(this, rt).forEach((n, P) => {
629
+ const R = oe[P], he = getComputedStyle(n).getPropertyValue("--morph-duration");
630
+ let F = [], x = [];
631
+ c ? (c.forEach((u) => {
632
+ const b = n.querySelector(u), O = R.querySelector(u);
633
+ b && O && (x.push(b), F.push(O));
634
+ }), x.forEach((u) => {
635
+ u.parentElement && Ut.push(u.parentElement);
636
+ })) : (F.push(...R.childNodes), x.push(...n.childNodes), Ut.push(n)), L || x.forEach((u) => {
567
637
  u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"));
568
- }), D.forEach((u) => {
638
+ }), F.forEach((u) => {
569
639
  u instanceof HTMLElement && (this.findNewLinks(u), u.classList.add("new"));
570
- }), d ? E ? D.forEach((u, L) => {
571
- H[L] instanceof HTMLElement && H[L].append(...u.childNodes);
572
- }) : D.forEach((u, L) => {
573
- var I;
574
- (I = H[L].parentElement) == null || I.insertBefore(
640
+ }), c ? L ? F.forEach((u, b) => {
641
+ x[b] instanceof HTMLElement && x[b].append(...u.childNodes);
642
+ }) : F.forEach((u, b) => {
643
+ var O;
644
+ (O = x[b].parentElement) == null || O.insertBefore(
575
645
  u,
576
- H[L]
646
+ x[b]
577
647
  );
578
- }) : n.prepend(...D), setTimeout(() => {
579
- E || H.forEach((u) => {
648
+ }) : n.prepend(...F), setTimeout(() => {
649
+ L || x.forEach((u) => {
580
650
  u instanceof HTMLElement && u.classList.add("old-idle");
581
- }), D.forEach((u) => {
582
- var L;
583
- u instanceof HTMLElement && ((L = u.parentElement) == null || L.style.setProperty(
651
+ }), F.forEach((u) => {
652
+ var b;
653
+ u instanceof HTMLElement && ((b = u.parentElement) == null || b.style.setProperty(
584
654
  "--new-content-height",
585
655
  u.offsetHeight + "px"
586
656
  ), u.classList.add("new-idle"));
587
657
  });
588
658
  }, 0);
589
- const gt = kt(Et({}, ft), {
659
+ const kt = Nt(Ct({}, wt), {
590
660
  morphElement: n
591
661
  });
592
- T(document, "morphNewChildrenAdded", {
593
- detail: gt
662
+ I(document, "morphNewChildrenAdded", {
663
+ detail: kt
594
664
  });
595
- const ie = new Promise((u) => {
665
+ const le = new Promise((u) => {
596
666
  setTimeout(() => {
597
- E || H.forEach((L) => L.remove()), D.forEach((L) => {
598
- var I;
599
- L instanceof HTMLElement && ((I = L.parentElement) == null || I.style.removeProperty(
667
+ L || x.forEach((b) => b.remove()), F.forEach((b) => {
668
+ var O;
669
+ b instanceof HTMLElement && ((O = b.parentElement) == null || O.style.removeProperty(
600
670
  "--new-content-height"
601
- ), L.classList.remove("new-idle", "new"));
602
- }), E || T(document, "morphOldChildrenRemoved", {
603
- detail: gt
671
+ ), b.classList.remove("new-idle", "new"));
672
+ }), L || I(document, "morphOldChildrenRemoved", {
673
+ detail: kt
604
674
  }), u();
605
- }, (parseFloat(ee) || 0) * 1e3 + 10);
675
+ }, (parseFloat(he) || 0) * 1e3 + 10);
606
676
  });
607
- t(this, O).push(ie);
677
+ t(this, Y).push(le);
608
678
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
609
679
  "--new-document-scroll-position",
610
680
  (this.scrollValue.top - v.scrollState.y) * 1 + "px"
611
681
  ) : document.documentElement.style.setProperty(
612
682
  "--new-document-scroll-position",
613
683
  this.scrollValue.top + "px"
614
- ), T(document, "morphBeforeNavigationScroll", {
684
+ ), I(document, "morphBeforeNavigationScroll", {
615
685
  detail: v.scrollState
616
- }), c.hash ? (v.clearScrollState(), p(this, m, Ut).call(this, c.hash, {
617
- centerScroll: s,
618
- offsetScroll: h,
686
+ }), d.hash ? (v.clearScrollState(), g(this, m, Xt).call(this, d.hash, {
687
+ centerScroll: i,
688
+ offsetScroll: l,
619
689
  behavior: S
620
- })) : t(this, B) ? v.restoreScrollPosition() : at || v.renewScrollPosition(), yield Promise.all(t(this, O)), E || Bt.forEach((n) => n.remove()), r(this, O, []), At.forEach((n) => {
621
- n.querySelectorAll("script").forEach((k) => {
622
- k.replaceWith(p(this, m, Rt).call(this, k));
690
+ })) : t(this, $) ? v.restoreScrollPosition() : dt || v.renewScrollPosition(), yield Promise.all(t(this, Y)), L || jt.forEach((n) => n.remove()), r(this, Y, []), Ut.forEach((n) => {
691
+ n.querySelectorAll("script").forEach((R) => {
692
+ R.replaceWith(g(this, m, Vt).call(this, R));
623
693
  });
624
694
  }), t(this, y).forEach((n) => {
625
695
  n.checkCurrent(t(this, f).path);
626
- }), T(document, "morphComplete", {
627
- detail: ft
696
+ }), this.findParamsDependent(), I(document, "morphComplete", {
697
+ detail: wt
628
698
  }), document.documentElement.style.removeProperty(
629
699
  "--new-document-scroll-position"
630
700
  ), window.dispatchEvent(new Event("resize"));
631
- } catch (G) {
632
- console.error(G);
701
+ } catch (A) {
702
+ console.error(A);
633
703
  }
634
- r(this, F, void 0);
704
+ r(this, K, void 0);
635
705
  });
636
706
  }
637
707
  addLink(e) {
638
- t(this, y).push(new Ht(e, this));
708
+ t(this, y).push(new qt(e, this));
639
709
  }
640
710
  addLinks(e) {
641
- e.forEach((i) => {
642
- this.addLink(i);
711
+ e.forEach((s) => {
712
+ this.addLink(s);
643
713
  });
644
714
  }
645
715
  removeLink(e) {
646
- r(this, y, t(this, y).filter((i) => i.element === e ? (i.destroy(), !1) : !0));
716
+ r(this, y, t(this, y).filter((s) => s.element === e ? (s.destroy(), !1) : !0));
647
717
  }
648
718
  destroyOldLinks(e) {
649
- r(this, y, t(this, y).filter((i) => e.contains(i.element) ? (i.destroy(), !1) : !0));
719
+ r(this, y, t(this, y).filter((s) => e.contains(s.element) ? (s.destroy(), !1) : !0));
650
720
  }
651
721
  findNewLinks(e) {
652
- const i = [...e.querySelectorAll("a")].filter(
653
- t(this, ut)
722
+ const s = [...e.querySelectorAll("a")].filter(
723
+ t(this, bt)
654
724
  );
655
725
  t(this, y).push(
656
- ...i.map((s) => new Ht(s, this))
726
+ ...s.map((i) => new qt(i, this))
657
727
  );
658
728
  }
659
729
  findLinks() {
660
730
  const e = [
661
731
  ...document.documentElement.querySelectorAll("a")
662
- ].filter(t(this, ut));
663
- t(this, y).forEach((i) => i.destroy()), r(this, y, e.map((i) => new Ht(i, this)));
732
+ ].filter(t(this, bt));
733
+ t(this, y).forEach((s) => s.destroy()), r(this, y, e.map((s) => new qt(s, this)));
734
+ }
735
+ findParamsDependent() {
736
+ const e = [
737
+ ...document.documentElement.querySelectorAll(
738
+ "[data-morph-params-dependent]"
739
+ )
740
+ ];
741
+ t(this, Lt).forEach((s) => s.destroy()), r(this, Lt, e.map(
742
+ (s) => new ye(s)
743
+ ));
664
744
  }
665
745
  };
666
- R = new WeakMap(), _ = new WeakMap(), y = new WeakMap(), F = new WeakMap(), f = new WeakMap(), j = new WeakMap(), O = new WeakMap(), B = new WeakMap(), C = new WeakMap(), lt = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), ht = new WeakMap(), it = new WeakMap(), ct = new WeakMap(), m = new WeakSet(), Rt = function(e) {
667
- const i = document.createElement("script");
668
- for (let s = 0; s < e.attributes.length; s++) {
669
- const h = e.attributes[s];
670
- i.setAttribute(h.name, h.value);
671
- }
672
- return e.hasAttribute("src") || (i.innerHTML = e.innerHTML), i;
673
- }, ut = new WeakMap(), vt = function(e) {
674
- const i = this.normalizePath(e);
675
- let s = t(this, N).get(i.pathname);
676
- return s || (s = new $t(this, i.pathname), t(this, N).set(i.pathname, s)), s;
677
- }, Tt = function(e) {
678
- const i = [...e.querySelectorAll("[data-morph]")];
679
- return i.length ? i : [e];
680
- }, Zt = function(e, i) {
746
+ N = new WeakMap(), rt = new WeakMap(), y = new WeakMap(), K = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), Y = new WeakMap(), $ = new WeakMap(), T = new WeakMap(), Et = new WeakMap(), V = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), ot = new WeakMap(), ht = new WeakMap(), St = new WeakMap(), lt = new WeakMap(), vt = new WeakMap(), m = new WeakSet(), Vt = function(e) {
747
+ const s = document.createElement("script");
748
+ for (let i = 0; i < e.attributes.length; i++) {
749
+ const l = e.attributes[i];
750
+ s.setAttribute(l.name, l.value);
751
+ }
752
+ return e.hasAttribute("src") || (s.innerHTML = e.innerHTML), s;
753
+ }, bt = new WeakMap(), Ht = function(e) {
754
+ const s = this.normalizePath(e);
755
+ let i = t(this, V).get(s.pathname);
756
+ return i || (i = new te(this, s.pathname), t(this, V).set(s.pathname, i)), i;
757
+ }, Wt = function(e) {
758
+ const s = [...e.querySelectorAll("[data-morph]")];
759
+ return s.length ? s : [e];
760
+ }, ae = function(e, s) {
681
761
  return e.filter(
682
- (s) => i.find(
683
- (h) => h.outerHTML === s.outerHTML
762
+ (i) => s.find(
763
+ (l) => l.outerHTML === i.outerHTML
684
764
  )
685
765
  );
686
- }, Mt = function(e, i) {
766
+ }, Ft = function(e, s) {
687
767
  return e.filter(
688
- (s) => !i.find(
689
- (h) => h.outerHTML === s.outerHTML
768
+ (i) => !s.find(
769
+ (l) => l.outerHTML === i.outerHTML
690
770
  )
691
771
  );
692
- }, xt = function(e) {
772
+ }, Ot = function(e) {
693
773
  return e.tagName === "SCRIPT" || e.tagName === "STYLE" || e.tagName === "LINK" && e.getAttribute("rel") === "stylesheet";
694
- }, Nt = function(e) {
695
- var i, s;
696
- (i = t(this, C)) == null || i.removeEventListener(
774
+ }, Bt = function(e) {
775
+ var s, i;
776
+ (s = t(this, T)) == null || s.removeEventListener(
697
777
  "scroll",
698
- t(this, st)
699
- ), r(this, et, 0), r(this, tt, 0), r(this, C, t(this, R).scrollSelector && e.querySelector(t(this, R).scrollSelector) || window), r(this, lt, t(this, C) === window), (s = t(this, C)) == null || s.addEventListener("scroll", t(this, st)), t(this, st).call(this);
700
- }, Ut = function(e, i) {
701
- const s = typeof e == "string" ? document.getElementById(e) : e;
702
- (typeof s == "number" || s) && he(s, {
703
- scrollElement: t(this, C),
704
- behavior: (i == null ? void 0 : i.behavior) || "instant",
705
- center: i == null ? void 0 : i.centerScroll,
706
- offset: i == null ? void 0 : i.offsetScroll
778
+ t(this, ct)
779
+ ), r(this, ht, 0), r(this, ot, 0), r(this, T, t(this, N).scrollSelector && e.querySelector(t(this, N).scrollSelector) || window), r(this, Et, t(this, T) === window), (i = t(this, T)) == null || i.addEventListener("scroll", t(this, ct)), t(this, ct).call(this);
780
+ }, Xt = function(e, s) {
781
+ const i = typeof e == "string" ? document.getElementById(e) : e;
782
+ (typeof i == "number" || i) && ge(i, {
783
+ scrollElement: t(this, T),
784
+ behavior: (s == null ? void 0 : s.behavior) || "instant",
785
+ center: s == null ? void 0 : s.centerScroll,
786
+ offset: s == null ? void 0 : s.offsetScroll
707
787
  });
708
- }, Lt = new WeakMap(), st = new WeakMap(), nt.instance = null;
709
- let Gt = nt;
788
+ }, Tt = new WeakMap(), ct = new WeakMap(), ut.instance = null;
789
+ let ee = ut;
710
790
  export {
711
- Gt as Morph
791
+ ee as Morph
712
792
  };