aptechka 0.64.9 → 0.65.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/{DragControls-DGDUw6bM.js → DragControls-DNwpgJ9b.js} +2 -2
- package/lib/{Tweened-_pF0zXXN.js → Tweened-CtbUoAvI.js} +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/custom-element/CustomElement.d.ts +20 -0
- package/lib/custom-scrollbar/index.cjs +1 -1
- package/lib/custom-scrollbar/index.js +69 -45
- package/lib/{easings-BEmRlrDd.js → easings-DngMp9IN.js} +14 -14
- package/lib/morph/Morph.d.ts +8 -2
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +250 -229
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +72 -62
- package/lib/scroll/index.js +3 -3
- package/lib/scroll-CIdNtj3G.cjs +1 -0
- package/lib/scroll-DNGJVxa2.js +37 -0
- package/lib/utils/custom-elements.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +169 -147
- package/lib/utils/scroll.d.ts +1 -1
- package/package.json +4 -4
- package/lib/scroll-BWF48oHS.js +0 -37
- package/lib/scroll-CFDCeArT.cjs +0 -1
package/lib/morph/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var Ct = (a, t) => (t = Symbol[a]) ? t : Symbol.for("Symbol." + a), Tt = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (
|
|
6
|
-
var z = (
|
|
7
|
-
var
|
|
4
|
+
var ft = (a, t, s) => t.has(a) || Tt("Cannot " + s);
|
|
5
|
+
var e = (a, t, s) => (ft(a, t, "read from private field"), s ? s.call(a) : t.get(a)), o = (a, t, s) => t.has(a) ? Tt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, s), n = (a, t, s, i) => (ft(a, t, "write to private field"), i ? i.call(a, s) : t.set(a, s), s), m = (a, t, s) => (ft(a, t, "access private method"), s);
|
|
6
|
+
var z = (a, t, s) => new Promise((i, h) => {
|
|
7
|
+
var w = (E) => {
|
|
8
8
|
try {
|
|
9
9
|
S(s.next(E));
|
|
10
10
|
} catch (R) {
|
|
11
|
-
|
|
11
|
+
h(R);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, b = (E) => {
|
|
14
14
|
try {
|
|
15
15
|
S(s.throw(E));
|
|
16
16
|
} catch (R) {
|
|
17
|
-
|
|
17
|
+
h(R);
|
|
18
18
|
}
|
|
19
|
-
}, S = (E) => E.done ? i(E.value) : Promise.resolve(E.value).then(
|
|
20
|
-
S((s = s.apply(
|
|
19
|
+
}, S = (E) => E.done ? i(E.value) : Promise.resolve(E.value).then(w, b);
|
|
20
|
+
S((s = s.apply(a, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
import { i as
|
|
24
|
-
import { d as
|
|
25
|
-
import { r as
|
|
26
|
-
import { w as
|
|
22
|
+
var xt = (a, t, s) => (t = a[Ct("asyncIterator")]) ? t.call(a) : (a = a[Ct("iterator")](), t = {}, s = (i, h) => (h = a[i]) && (t[i] = (w) => new Promise((b, S, E) => (w = h.call(a, w), E = w.done, Promise.resolve(w.value).then((R) => b({ value: R, done: E }), S)))), s("next"), s("return"), t);
|
|
23
|
+
import { i as Dt } from "../index-Bv9zgfdb.js";
|
|
24
|
+
import { d as I } from "../events-CsVF98U6.js";
|
|
25
|
+
import { r as Wt } from "../polyfills-DJrTJQky.js";
|
|
26
|
+
import { w as Bt, s as Yt } from "../scroll-DNGJVxa2.js";
|
|
27
27
|
import "construct-style-sheets-polyfill";
|
|
28
|
-
import { n as
|
|
29
|
-
import { cssValueParser as
|
|
30
|
-
class
|
|
28
|
+
import { n as Xt, c as Mt, s as Ut } from "../url-Cc-RVfii.js";
|
|
29
|
+
import { cssValueParser as $t } from "../css-value-parser/index.js";
|
|
30
|
+
class Rt extends HTMLElement {
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
const t = {
|
|
33
33
|
"aria-live": "assertive",
|
|
@@ -38,192 +38,207 @@ class Nt extends HTMLElement {
|
|
|
38
38
|
this.setAttribute(s, i);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
class
|
|
41
|
+
Dt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Rt);
|
|
42
|
+
var C, l, V, et, $;
|
|
43
|
+
class pt {
|
|
44
44
|
constructor(t, s) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
o(this, C);
|
|
46
|
+
o(this, l);
|
|
47
|
+
o(this, V);
|
|
48
|
+
o(this, et, (t) => {
|
|
49
49
|
var i;
|
|
50
|
-
if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this,
|
|
50
|
+
if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, C).previousPathname)
|
|
51
51
|
history.back();
|
|
52
52
|
else {
|
|
53
|
-
const
|
|
53
|
+
const h = e(this, l).getAttribute(
|
|
54
54
|
"data-history-action"
|
|
55
|
-
) || "push",
|
|
55
|
+
) || "push", w = e(this, l).hasAttribute("data-center-scroll"), b = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), S = b ? $t.parse(b) : void 0, E = e(this, l).hasAttribute("data-revalidate"), R = e(this, l).hasAttribute(
|
|
56
56
|
"data-keep-search-parameters"
|
|
57
|
-
),
|
|
58
|
-
e(this,
|
|
59
|
-
historyAction:
|
|
60
|
-
centerScroll:
|
|
57
|
+
), ht = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((Y) => Y.trim()), f = e(this, l).hasAttribute("data-clear-state");
|
|
58
|
+
e(this, C).navigate(e(this, V), {
|
|
59
|
+
historyAction: h,
|
|
60
|
+
centerScroll: w,
|
|
61
61
|
offsetScroll: S,
|
|
62
62
|
revalidate: E,
|
|
63
63
|
keepSearchParameters: R,
|
|
64
|
-
submorph:
|
|
64
|
+
submorph: ht,
|
|
65
65
|
clearState: f
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
o(this, $, () => {
|
|
70
70
|
const t = e(this, l).hasAttribute("data-revalidate");
|
|
71
|
-
e(this,
|
|
71
|
+
e(this, C).prefetch(e(this, V), t), e(this, l).removeEventListener("pointerenter", e(this, $));
|
|
72
72
|
});
|
|
73
|
-
|
|
73
|
+
n(this, C, s), n(this, l, t), n(this, V, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, et)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, $));
|
|
74
74
|
}
|
|
75
75
|
get element() {
|
|
76
76
|
return e(this, l);
|
|
77
77
|
}
|
|
78
78
|
checkCurrent(t) {
|
|
79
|
-
const s = e(this,
|
|
79
|
+
const s = e(this, C).normalizePath(t), i = e(this, C).normalizePath(e(this, V));
|
|
80
80
|
e(this, l).hasAttribute("data-include") && s.pathname.includes(i.pathname) ? e(this, l).classList.add("current") : i.pathname === s.pathname ? e(this, l).classList.add("current") : e(this, l).classList.remove("current");
|
|
81
81
|
}
|
|
82
82
|
destroy() {
|
|
83
|
-
e(this, l).removeEventListener("click", e(this,
|
|
83
|
+
e(this, l).removeEventListener("click", e(this, et)), e(this, l).removeEventListener("pointerenter", e(this, $)), e(this, l).classList.remove("current");
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
class
|
|
86
|
+
C = new WeakMap(), l = new WeakMap(), V = new WeakMap(), et = new WeakMap(), $ = new WeakMap();
|
|
87
|
+
var M, j, L, F, O, H, K;
|
|
88
|
+
class Ht {
|
|
89
89
|
constructor(t, s, i) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
o(this, M);
|
|
91
|
+
o(this, j);
|
|
92
|
+
o(this, L, { x: 0, y: 0 });
|
|
93
|
+
o(this, F);
|
|
94
|
+
o(this, O, null);
|
|
95
|
+
o(this, H, null);
|
|
96
|
+
o(this, K, null);
|
|
97
|
+
n(this, M, t), n(this, j, s), n(this, F, i.cloneNode(!0));
|
|
98
98
|
}
|
|
99
99
|
get pathname() {
|
|
100
|
-
return e(this,
|
|
100
|
+
return e(this, j);
|
|
101
101
|
}
|
|
102
102
|
get scrollState() {
|
|
103
|
-
return e(this,
|
|
103
|
+
return e(this, L);
|
|
104
104
|
}
|
|
105
105
|
get document() {
|
|
106
|
-
return e(this,
|
|
106
|
+
return e(this, H);
|
|
107
107
|
}
|
|
108
108
|
cloneDocument() {
|
|
109
|
-
|
|
109
|
+
n(this, H, (e(this, O) || e(this, F)).cloneNode(!0));
|
|
110
110
|
}
|
|
111
111
|
get title() {
|
|
112
112
|
let t = "";
|
|
113
|
-
if (e(this,
|
|
114
|
-
t = e(this,
|
|
113
|
+
if (e(this, H).title)
|
|
114
|
+
t = e(this, H).title;
|
|
115
115
|
else {
|
|
116
|
-
const s = e(this,
|
|
117
|
-
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this,
|
|
116
|
+
const s = e(this, H).querySelector("h1");
|
|
117
|
+
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, j);
|
|
118
118
|
}
|
|
119
119
|
return t;
|
|
120
120
|
}
|
|
121
121
|
clearScrollState() {
|
|
122
|
-
e(this,
|
|
122
|
+
e(this, L).x = 0, e(this, L).y = 0;
|
|
123
123
|
}
|
|
124
124
|
clearDocumentState() {
|
|
125
|
-
|
|
125
|
+
n(this, O, null);
|
|
126
126
|
}
|
|
127
127
|
saveScrollState() {
|
|
128
128
|
e(this, F).documentElement.hasAttribute(
|
|
129
129
|
"data-no-scroll-restoration"
|
|
130
|
-
) ? (e(this,
|
|
130
|
+
) ? (e(this, L).x = 0, e(this, L).y = 0) : (e(this, L).x = e(this, M).scrollValue.left, e(this, L).y = e(this, M).scrollValue.top);
|
|
131
131
|
}
|
|
132
132
|
restoreScrollPosition() {
|
|
133
|
-
e(this,
|
|
134
|
-
top: e(this,
|
|
135
|
-
left: e(this,
|
|
133
|
+
e(this, M).scrollElement.scroll({
|
|
134
|
+
top: e(this, L).y,
|
|
135
|
+
left: e(this, L).x,
|
|
136
136
|
behavior: "instant"
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
saveDocumentState() {
|
|
140
140
|
e(this, F).documentElement.hasAttribute(
|
|
141
141
|
"data-no-page-restoration"
|
|
142
|
-
) ?
|
|
142
|
+
) ? n(this, O, null) : n(this, O, document.cloneNode(!0));
|
|
143
143
|
}
|
|
144
144
|
renewScrollPosition() {
|
|
145
|
-
e(this,
|
|
145
|
+
e(this, M).scrollElement.scroll({
|
|
146
146
|
top: 0,
|
|
147
147
|
left: 0,
|
|
148
148
|
behavior: "instant"
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
saveState(t) {
|
|
152
|
-
|
|
152
|
+
n(this, K, t);
|
|
153
153
|
}
|
|
154
154
|
clearState() {
|
|
155
|
-
const t = e(this,
|
|
156
|
-
return
|
|
155
|
+
const t = e(this, K);
|
|
156
|
+
return n(this, K, null), t;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
var
|
|
161
|
-
const
|
|
159
|
+
M = new WeakMap(), j = new WeakMap(), L = new WeakMap(), F = new WeakMap(), O = new WeakMap(), H = new WeakMap(), K = new WeakMap();
|
|
160
|
+
var k, G, p, lt, N, d, st, W, T, P, it, D, B, J, Q, rt, c, ot, qt, Et, zt, gt, St, wt, vt, ct, Z;
|
|
161
|
+
const tt = class tt {
|
|
162
162
|
constructor(t) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
163
|
+
o(this, c);
|
|
164
|
+
o(this, k, null);
|
|
165
|
+
o(this, G, null);
|
|
166
|
+
o(this, p, []);
|
|
167
|
+
o(this, lt, new DOMParser());
|
|
168
|
+
o(this, N);
|
|
169
|
+
o(this, d, null);
|
|
170
|
+
o(this, st);
|
|
171
|
+
o(this, W, []);
|
|
172
|
+
o(this, T, !1);
|
|
173
|
+
o(this, P, null);
|
|
174
|
+
o(this, it, !1);
|
|
175
|
+
o(this, D, /* @__PURE__ */ new Map());
|
|
176
|
+
o(this, B, null);
|
|
177
|
+
o(this, J, 0);
|
|
178
|
+
o(this, Q, 0);
|
|
179
|
+
o(this, rt, (t) => {
|
|
177
180
|
var s;
|
|
178
181
|
return ((s = t.getAttribute("href")) == null ? void 0 : s.startsWith("/")) && !t.hasAttribute("download") && !t.hasAttribute("data-morph-skip") && !t.closest("[data-morph-skip]") && t.getAttribute("target") !== "_blank";
|
|
179
182
|
});
|
|
180
|
-
|
|
183
|
+
o(this, ct, (t) => z(this, null, function* () {
|
|
181
184
|
var s;
|
|
182
|
-
(s = t.state) != null && s.path && (t.preventDefault(),
|
|
185
|
+
(s = t.state) != null && s.path && (t.preventDefault(), n(this, T, !0), yield this.navigate(t.state.path, { historyAction: "none" }), n(this, T, !1));
|
|
183
186
|
}));
|
|
184
|
-
|
|
185
|
-
const t = e(this,
|
|
186
|
-
document.documentElement.classList.toggle("
|
|
187
|
+
o(this, Z, () => {
|
|
188
|
+
const { left: t, top: s } = this.scrollValue, i = s - e(this, Q), h = t - e(this, J);
|
|
189
|
+
n(this, Q, s), n(this, J, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
|
|
190
|
+
"scroll-y-forward",
|
|
191
|
+
i > 0
|
|
192
|
+
), document.documentElement.classList.toggle(
|
|
193
|
+
"scroll-y-backward",
|
|
194
|
+
i < 0
|
|
195
|
+
), document.documentElement.classList.toggle(
|
|
196
|
+
"scroll-x-forward",
|
|
197
|
+
h > 0
|
|
198
|
+
), document.documentElement.classList.toggle(
|
|
199
|
+
"scroll-x-backward",
|
|
200
|
+
h < 0
|
|
201
|
+
), I(document, "morphScroll", {
|
|
187
202
|
detail: {
|
|
188
|
-
left:
|
|
189
|
-
top:
|
|
203
|
+
left: t,
|
|
204
|
+
top: s
|
|
190
205
|
}
|
|
191
206
|
});
|
|
192
207
|
});
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
base:
|
|
208
|
+
if (Dt && !tt.instance) {
|
|
209
|
+
tt.instance = this, n(this, k, {
|
|
210
|
+
base: Xt(t == null ? void 0 : t.base),
|
|
196
211
|
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
197
212
|
cachePages: (t == null ? void 0 : t.cachePages) !== !1,
|
|
198
213
|
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
199
|
-
scrollSelector:
|
|
214
|
+
scrollSelector: t == null ? void 0 : t.scrollSelector,
|
|
200
215
|
morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
|
|
201
|
-
}),
|
|
216
|
+
}), n(this, G, m(this, c, Et).call(this, document.body));
|
|
202
217
|
const s = this.normalizePath(
|
|
203
218
|
location.pathname + location.hash
|
|
204
219
|
);
|
|
205
|
-
|
|
206
|
-
e(this,
|
|
207
|
-
new
|
|
220
|
+
n(this, d, s.pathname), e(this, D).set(
|
|
221
|
+
e(this, d),
|
|
222
|
+
new Ht(this, e(this, d), document)
|
|
208
223
|
), document.documentElement.setAttribute(
|
|
209
224
|
"data-current-pathname",
|
|
210
|
-
e(this,
|
|
225
|
+
e(this, d)
|
|
211
226
|
), document.documentElement.setAttribute(
|
|
212
227
|
"data-current-leaf",
|
|
213
228
|
s.leaf
|
|
214
|
-
), this.findLinks(), addEventListener("popstate", e(this,
|
|
229
|
+
), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", e(this, ct)), Mt({
|
|
215
230
|
action: "replace",
|
|
216
|
-
pathname: e(this,
|
|
231
|
+
pathname: e(this, d),
|
|
217
232
|
searchParameters: s.parameters || location.search,
|
|
218
233
|
hash: s.hash
|
|
219
|
-
}),
|
|
234
|
+
}), n(this, B, new Rt()), m(this, c, wt).call(this, document);
|
|
220
235
|
}
|
|
221
236
|
}
|
|
222
237
|
get currentPathname() {
|
|
223
|
-
return e(this,
|
|
238
|
+
return e(this, d);
|
|
224
239
|
}
|
|
225
240
|
get previousPathname() {
|
|
226
|
-
return e(this,
|
|
241
|
+
return e(this, st);
|
|
227
242
|
}
|
|
228
243
|
get links() {
|
|
229
244
|
return e(this, p);
|
|
@@ -234,24 +249,28 @@ const Z = class Z {
|
|
|
234
249
|
get isPopstateNavigation() {
|
|
235
250
|
return e(this, T);
|
|
236
251
|
}
|
|
252
|
+
get scrollValue() {
|
|
253
|
+
let t = 0, s = 0;
|
|
254
|
+
return e(this, it) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, P).scrollTop, s = e(this, P).scrollLeft), { top: t, left: s };
|
|
255
|
+
}
|
|
237
256
|
saveState(t) {
|
|
238
|
-
const s = e(this, D).get(e(this,
|
|
257
|
+
const s = e(this, D).get(e(this, d));
|
|
239
258
|
s && s.saveState(t);
|
|
240
259
|
}
|
|
241
260
|
getState() {
|
|
242
|
-
const t = e(this, D).get(e(this,
|
|
261
|
+
const t = e(this, D).get(e(this, d));
|
|
243
262
|
return t == null ? void 0 : t.clearState();
|
|
244
263
|
}
|
|
245
264
|
normalizePath(t) {
|
|
246
|
-
return
|
|
247
|
-
base: e(this,
|
|
248
|
-
trailingSlash: e(this,
|
|
265
|
+
return Ut(t, {
|
|
266
|
+
base: e(this, k).base,
|
|
267
|
+
trailingSlash: e(this, k).trailingSlash
|
|
249
268
|
});
|
|
250
269
|
}
|
|
251
270
|
prefetch(t, s) {
|
|
252
271
|
return z(this, null, function* () {
|
|
253
272
|
const i = this.normalizePath(t);
|
|
254
|
-
m(this,
|
|
273
|
+
m(this, c, ot).call(this, i.pathname, {
|
|
255
274
|
searchParameters: i.parameters,
|
|
256
275
|
revalidate: s
|
|
257
276
|
});
|
|
@@ -261,30 +280,30 @@ const Z = class Z {
|
|
|
261
280
|
return z(this, arguments, function* (t, {
|
|
262
281
|
historyAction: s = "push",
|
|
263
282
|
centerScroll: i,
|
|
264
|
-
offsetScroll:
|
|
265
|
-
revalidate:
|
|
266
|
-
keepSearchParameters:
|
|
283
|
+
offsetScroll: h,
|
|
284
|
+
revalidate: w,
|
|
285
|
+
keepSearchParameters: b,
|
|
267
286
|
submorph: S,
|
|
268
287
|
clearState: E
|
|
269
288
|
} = {}) {
|
|
270
|
-
var
|
|
271
|
-
if (e(this,
|
|
289
|
+
var Lt;
|
|
290
|
+
if (e(this, W).length)
|
|
272
291
|
return;
|
|
273
|
-
const
|
|
274
|
-
let { pathname: f, hash:
|
|
275
|
-
if (e(this,
|
|
276
|
-
e(this, T) || m(this,
|
|
292
|
+
const ht = this.normalizePath(((Lt = this.pathnameModifier) == null ? void 0 : Lt.call(this, t)) || t);
|
|
293
|
+
let { pathname: f, hash: Y, parameters: yt, leaf: It } = ht;
|
|
294
|
+
if (e(this, N) === f || e(this, d) === f) {
|
|
295
|
+
e(this, T) || m(this, c, vt).call(this, Y || 0, {
|
|
277
296
|
centerScroll: i,
|
|
278
|
-
offsetScroll:
|
|
297
|
+
offsetScroll: h,
|
|
279
298
|
behavior: "smooth"
|
|
280
299
|
});
|
|
281
300
|
return;
|
|
282
301
|
}
|
|
283
|
-
|
|
284
|
-
|
|
302
|
+
n(this, N, f), e(this, p).forEach((X) => {
|
|
303
|
+
X.checkCurrent(f);
|
|
285
304
|
});
|
|
286
305
|
try {
|
|
287
|
-
let
|
|
306
|
+
let X = !0;
|
|
288
307
|
if (this.preprocessor)
|
|
289
308
|
try {
|
|
290
309
|
yield new Promise((r, A) => {
|
|
@@ -297,140 +316,142 @@ const Z = class Z {
|
|
|
297
316
|
});
|
|
298
317
|
});
|
|
299
318
|
} catch (r) {
|
|
300
|
-
r ? console.error(r) : console.log("Route change canceled"),
|
|
319
|
+
r ? console.error(r) : console.log("Route change canceled"), X = !1;
|
|
301
320
|
}
|
|
302
|
-
if (!
|
|
321
|
+
if (!X || e(this, N) !== f) {
|
|
303
322
|
e(this, p).forEach((r) => {
|
|
304
|
-
r.checkCurrent(e(this,
|
|
323
|
+
r.checkCurrent(e(this, d));
|
|
305
324
|
});
|
|
306
325
|
return;
|
|
307
326
|
}
|
|
308
|
-
const
|
|
327
|
+
const ut = {
|
|
309
328
|
pathname: f,
|
|
310
329
|
submorph: S
|
|
311
330
|
};
|
|
312
|
-
|
|
313
|
-
detail:
|
|
331
|
+
I(document, "morphNavigation", {
|
|
332
|
+
detail: ut
|
|
314
333
|
});
|
|
315
|
-
const
|
|
316
|
-
searchParameters:
|
|
317
|
-
revalidate:
|
|
334
|
+
const dt = yield m(this, c, ot).call(this, e(this, d)), v = yield m(this, c, ot).call(this, f, {
|
|
335
|
+
searchParameters: yt,
|
|
336
|
+
revalidate: w
|
|
318
337
|
});
|
|
319
|
-
if (e(this,
|
|
338
|
+
if (e(this, N) !== f) {
|
|
320
339
|
e(this, p).forEach((r) => {
|
|
321
|
-
r.checkCurrent(e(this,
|
|
340
|
+
r.checkCurrent(e(this, d));
|
|
322
341
|
});
|
|
323
342
|
return;
|
|
324
343
|
}
|
|
325
|
-
|
|
326
|
-
detail:
|
|
344
|
+
dt.clearState(), dt.saveScrollState(), dt.saveDocumentState(), e(this, T) || (v.clearScrollState(), v.clearDocumentState()), E && v.clearState(), v.cloneDocument(), e(this, B).textContent = v.title, document.body.appendChild(e(this, B)), I(document, "morphStart", {
|
|
345
|
+
detail: ut
|
|
327
346
|
});
|
|
328
|
-
const
|
|
329
|
-
|
|
347
|
+
const bt = Array.from(document.head.children), Pt = Array.from(v.document.head.children), kt = m(this, c, zt).call(this, bt, Pt), Vt = m(this, c, gt).call(this, bt, kt), nt = m(this, c, gt).call(this, Pt, kt);
|
|
348
|
+
nt.forEach((r, A) => {
|
|
330
349
|
if (r.tagName === "SCRIPT" && r.getAttribute("src")) {
|
|
331
350
|
const y = document.createElement("script");
|
|
332
|
-
y.type = "module", y.src = r.getAttribute("src"),
|
|
351
|
+
y.type = "module", y.src = r.getAttribute("src"), nt[A] = y;
|
|
333
352
|
}
|
|
334
|
-
}),
|
|
353
|
+
}), nt.forEach((r) => {
|
|
335
354
|
document.head.appendChild(r);
|
|
336
355
|
});
|
|
337
|
-
const
|
|
356
|
+
const mt = nt.filter((r) => {
|
|
338
357
|
if (r.hasAttribute("data-no-waiting"))
|
|
339
358
|
return !1;
|
|
340
|
-
if (m(this,
|
|
359
|
+
if (m(this, c, St).call(this, r))
|
|
341
360
|
return !0;
|
|
342
361
|
});
|
|
343
|
-
e(this,
|
|
362
|
+
e(this, k).waitForHeadToLoad && mt.length && (yield new Promise((r) => z(this, null, function* () {
|
|
344
363
|
let A = 0;
|
|
345
364
|
try {
|
|
346
|
-
for (var y =
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
A++, A ===
|
|
365
|
+
for (var y = xt(mt), _, q, U; _ = !(q = yield y.next()).done; _ = !1) {
|
|
366
|
+
const at = q.value;
|
|
367
|
+
at.onload = () => {
|
|
368
|
+
A++, A === mt.length && r();
|
|
350
369
|
};
|
|
351
370
|
}
|
|
352
371
|
} catch (q) {
|
|
353
|
-
|
|
372
|
+
U = [q];
|
|
354
373
|
} finally {
|
|
355
374
|
try {
|
|
356
|
-
|
|
375
|
+
_ && (q = y.return) && (yield q.call(y));
|
|
357
376
|
} finally {
|
|
358
|
-
if (
|
|
359
|
-
throw
|
|
377
|
+
if (U)
|
|
378
|
+
throw U[0];
|
|
360
379
|
}
|
|
361
380
|
}
|
|
362
|
-
}))), yield
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
r.hasAttribute("data-permanent") || (m(this,
|
|
381
|
+
}))), yield Bt(10);
|
|
382
|
+
const At = [];
|
|
383
|
+
Vt.forEach((r) => {
|
|
384
|
+
r.hasAttribute("data-permanent") || (m(this, c, St).call(this, r) ? At.push(r) : r.remove());
|
|
366
385
|
});
|
|
367
|
-
const
|
|
368
|
-
e(this,
|
|
386
|
+
const Ft = m(this, c, Et).call(this, v.document.body);
|
|
387
|
+
e(this, k).morphInsideScrollContainer || m(this, c, wt).call(this, v.document), document.documentElement.setAttribute("data-current-pathname", f), document.documentElement.setAttribute("data-current-leaf", It), Mt({
|
|
369
388
|
action: s,
|
|
370
389
|
pathname: f,
|
|
371
|
-
searchParameters:
|
|
372
|
-
hash:
|
|
373
|
-
}), e(this,
|
|
374
|
-
const y =
|
|
375
|
-
let q = [],
|
|
376
|
-
S ? S.forEach((
|
|
377
|
-
const g = r.querySelector(
|
|
378
|
-
g &&
|
|
379
|
-
}) : (q.push(...y.childNodes),
|
|
380
|
-
|
|
381
|
-
}), q.forEach((
|
|
382
|
-
|
|
383
|
-
}), S ? q.forEach((
|
|
384
|
-
var
|
|
385
|
-
(
|
|
386
|
-
|
|
387
|
-
|
|
390
|
+
searchParameters: yt || (b ? location.search : ""),
|
|
391
|
+
hash: Y
|
|
392
|
+
}), e(this, B).remove(), n(this, st, e(this, d)), n(this, d, f), e(this, G).forEach((r, A) => {
|
|
393
|
+
const y = Ft[A], _ = getComputedStyle(r).getPropertyValue("--morph-duration");
|
|
394
|
+
let q = [], U = [];
|
|
395
|
+
S ? S.forEach((u) => {
|
|
396
|
+
const g = r.querySelector(u), x = y.querySelector(u);
|
|
397
|
+
g && x && (U.push(g), q.push(x));
|
|
398
|
+
}) : (q.push(...y.childNodes), U.push(...r.childNodes)), U.forEach((u) => {
|
|
399
|
+
u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"));
|
|
400
|
+
}), q.forEach((u) => {
|
|
401
|
+
u instanceof HTMLElement && (this.findNewLinks(u), u.classList.add("new"));
|
|
402
|
+
}), S ? q.forEach((u, g) => {
|
|
403
|
+
var x;
|
|
404
|
+
(x = U[g].parentElement) == null || x.insertBefore(
|
|
405
|
+
u,
|
|
406
|
+
U[g]
|
|
388
407
|
);
|
|
389
|
-
}) : r.prepend(...q),
|
|
390
|
-
q.forEach((
|
|
408
|
+
}) : r.prepend(...q), Wt(() => {
|
|
409
|
+
q.forEach((u) => {
|
|
391
410
|
var g;
|
|
392
|
-
|
|
411
|
+
u instanceof HTMLElement && ((g = u.parentElement) == null || g.style.setProperty(
|
|
393
412
|
"--new-content-height",
|
|
394
|
-
|
|
395
|
-
),
|
|
413
|
+
u.offsetHeight + "px"
|
|
414
|
+
), u.classList.add("in"));
|
|
396
415
|
});
|
|
397
416
|
});
|
|
398
|
-
const
|
|
417
|
+
const at = {
|
|
399
418
|
morphElement: r,
|
|
400
419
|
pathname: f
|
|
401
420
|
};
|
|
402
|
-
|
|
403
|
-
detail:
|
|
421
|
+
I(document, "morphNewChildrenAdded", {
|
|
422
|
+
detail: at
|
|
404
423
|
});
|
|
405
|
-
const
|
|
424
|
+
const Ot = new Promise((u) => {
|
|
406
425
|
setTimeout(() => {
|
|
407
|
-
|
|
408
|
-
var
|
|
409
|
-
g instanceof HTMLElement && ((
|
|
426
|
+
U.forEach((g) => g.remove()), q.forEach((g) => {
|
|
427
|
+
var x;
|
|
428
|
+
g instanceof HTMLElement && ((x = g.parentElement) == null || x.style.removeProperty(
|
|
410
429
|
"--new-content-height"
|
|
411
430
|
), g.classList.remove("in", "new"));
|
|
412
|
-
}),
|
|
413
|
-
detail:
|
|
414
|
-
}),
|
|
415
|
-
}, (parseFloat(
|
|
431
|
+
}), I(document, "morphOldChildrenRemoved", {
|
|
432
|
+
detail: at
|
|
433
|
+
}), u();
|
|
434
|
+
}, (parseFloat(_) || 0) * 1e3 + 10);
|
|
416
435
|
});
|
|
417
|
-
e(this,
|
|
418
|
-
}),
|
|
436
|
+
e(this, W).push(Ot);
|
|
437
|
+
}), Y ? (v.clearScrollState(), m(this, c, vt).call(this, Y, { centerScroll: i, offsetScroll: h })) : e(this, T) ? v.restoreScrollPosition() : v.renewScrollPosition(), I(document, "morphNavigationScroll", {
|
|
438
|
+
detail: v.scrollState
|
|
439
|
+
}), yield Promise.all(e(this, W)), At.forEach((r) => r.remove()), n(this, W, []), e(this, G).forEach((r) => {
|
|
419
440
|
r.querySelectorAll("script").forEach((y) => {
|
|
420
|
-
const
|
|
421
|
-
|
|
441
|
+
const _ = document.createElement("script");
|
|
442
|
+
_.type = "module", _.src = y.getAttribute("src"), y.replaceWith(_);
|
|
422
443
|
});
|
|
423
|
-
}),
|
|
424
|
-
detail:
|
|
444
|
+
}), I(document, "morphComplete", {
|
|
445
|
+
detail: ut
|
|
425
446
|
}), window.dispatchEvent(new Event("resize"));
|
|
426
|
-
} catch (
|
|
427
|
-
console.error(
|
|
447
|
+
} catch (X) {
|
|
448
|
+
console.error(X);
|
|
428
449
|
}
|
|
429
|
-
|
|
450
|
+
n(this, N, void 0);
|
|
430
451
|
});
|
|
431
452
|
}
|
|
432
453
|
addLink(t) {
|
|
433
|
-
e(this, p).push(new
|
|
454
|
+
e(this, p).push(new pt(t, this));
|
|
434
455
|
}
|
|
435
456
|
addLinks(t) {
|
|
436
457
|
t.forEach((s) => {
|
|
@@ -438,71 +459,71 @@ const Z = class Z {
|
|
|
438
459
|
});
|
|
439
460
|
}
|
|
440
461
|
removeLink(t) {
|
|
441
|
-
|
|
462
|
+
n(this, p, e(this, p).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
442
463
|
}
|
|
443
464
|
destroyOldLinks(t) {
|
|
444
|
-
|
|
465
|
+
n(this, p, e(this, p).filter((s) => t.contains(s.element) ? (s.destroy(), !1) : !0));
|
|
445
466
|
}
|
|
446
467
|
findNewLinks(t) {
|
|
447
468
|
const s = [...t.querySelectorAll("a")].filter(
|
|
448
|
-
e(this,
|
|
469
|
+
e(this, rt)
|
|
449
470
|
);
|
|
450
471
|
e(this, p).push(
|
|
451
|
-
...s.map((i) => new
|
|
472
|
+
...s.map((i) => new pt(i, this))
|
|
452
473
|
);
|
|
453
474
|
}
|
|
454
475
|
findLinks() {
|
|
455
476
|
const t = [
|
|
456
477
|
...document.documentElement.querySelectorAll("a")
|
|
457
|
-
].filter(e(this,
|
|
458
|
-
e(this, p).forEach((s) => s.destroy()),
|
|
478
|
+
].filter(e(this, rt));
|
|
479
|
+
e(this, p).forEach((s) => s.destroy()), n(this, p, t.map((s) => new pt(s, this)));
|
|
459
480
|
}
|
|
460
481
|
};
|
|
461
|
-
|
|
482
|
+
k = new WeakMap(), G = new WeakMap(), p = new WeakMap(), lt = new WeakMap(), N = new WeakMap(), d = new WeakMap(), st = new WeakMap(), W = new WeakMap(), T = new WeakMap(), P = new WeakMap(), it = new WeakMap(), D = new WeakMap(), B = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), rt = new WeakMap(), c = new WeakSet(), ot = function(t, s) {
|
|
462
483
|
return z(this, null, function* () {
|
|
463
484
|
let i = e(this, D).get(t);
|
|
464
|
-
return (!i || s != null && s.revalidate) && (i = yield m(this,
|
|
485
|
+
return (!i || s != null && s.revalidate) && (i = yield m(this, c, qt).call(this, t, s == null ? void 0 : s.searchParameters)), i;
|
|
465
486
|
});
|
|
466
|
-
},
|
|
487
|
+
}, qt = function(t, s) {
|
|
467
488
|
return z(this, null, function* () {
|
|
468
|
-
const
|
|
489
|
+
const h = yield (yield fetch(
|
|
469
490
|
`${t}${s ? "?" + s : ""}`
|
|
470
|
-
)).text(),
|
|
471
|
-
return e(this, D).set(t,
|
|
491
|
+
)).text(), w = e(this, lt).parseFromString(h, "text/html"), b = new Ht(this, t, w);
|
|
492
|
+
return e(this, D).set(t, b), b;
|
|
472
493
|
});
|
|
473
|
-
},
|
|
494
|
+
}, Et = function(t) {
|
|
474
495
|
const s = [...t.querySelectorAll("[data-morph]")];
|
|
475
496
|
return s.length ? s : [t];
|
|
476
|
-
},
|
|
497
|
+
}, zt = function(t, s) {
|
|
477
498
|
return t.filter(
|
|
478
499
|
(i) => s.find(
|
|
479
|
-
(
|
|
500
|
+
(h) => h.outerHTML === i.outerHTML
|
|
480
501
|
)
|
|
481
502
|
);
|
|
482
|
-
},
|
|
503
|
+
}, gt = function(t, s) {
|
|
483
504
|
return t.filter(
|
|
484
505
|
(i) => !s.find(
|
|
485
|
-
(
|
|
506
|
+
(h) => h.outerHTML === i.outerHTML
|
|
486
507
|
)
|
|
487
508
|
);
|
|
488
|
-
},
|
|
509
|
+
}, St = function(t) {
|
|
489
510
|
return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
490
|
-
},
|
|
511
|
+
}, wt = function(t) {
|
|
491
512
|
var s, i;
|
|
492
513
|
(s = e(this, P)) == null || s.removeEventListener(
|
|
493
514
|
"scroll",
|
|
494
|
-
e(this,
|
|
495
|
-
),
|
|
496
|
-
},
|
|
515
|
+
e(this, Z)
|
|
516
|
+
), n(this, Q, 0), n(this, J, 0), n(this, P, e(this, k).scrollSelector && t.querySelector(e(this, k).scrollSelector) || window), n(this, it, e(this, P) === window), (i = e(this, P)) == null || i.addEventListener("scroll", e(this, Z)), e(this, Z).call(this);
|
|
517
|
+
}, vt = function(t, s) {
|
|
497
518
|
const i = typeof t == "string" ? document.getElementById(t) : t;
|
|
498
|
-
(typeof i == "number" || i) &&
|
|
519
|
+
(typeof i == "number" || i) && Yt(i, {
|
|
499
520
|
scrollElement: e(this, P),
|
|
500
521
|
behavior: (s == null ? void 0 : s.behavior) || "instant",
|
|
501
522
|
center: s == null ? void 0 : s.centerScroll,
|
|
502
523
|
offset: s == null ? void 0 : s.offsetScroll
|
|
503
524
|
});
|
|
504
|
-
},
|
|
505
|
-
let
|
|
525
|
+
}, ct = new WeakMap(), Z = new WeakMap(), tt.instance = null;
|
|
526
|
+
let Nt = tt;
|
|
506
527
|
export {
|
|
507
|
-
|
|
528
|
+
Nt as Morph
|
|
508
529
|
};
|