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