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