aptechka 0.43.1 → 0.43.2
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 +3 -3
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +54 -54
- package/package.json +1 -1
package/lib/morph/Morph.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface MorphNavigationEntry {
|
|
|
11
11
|
isCached: boolean;
|
|
12
12
|
state?: any;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface MorphTransitionEntry extends MorphNavigationEntry {
|
|
15
15
|
newDocument: Document;
|
|
16
16
|
}
|
|
17
17
|
export interface MorphChildrenActionEntry {
|
|
@@ -32,8 +32,8 @@ export interface MorphNavigateOptions {
|
|
|
32
32
|
state?: any;
|
|
33
33
|
}
|
|
34
34
|
export interface MorphEvents {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
morphStart: CustomEvent<MorphTransitionEntry>;
|
|
36
|
+
morphComplete: CustomEvent<MorphTransitionEntry>;
|
|
37
37
|
morphNewChildrenAdded: CustomEvent<MorphChildrenActionEntry>;
|
|
38
38
|
morphOldChildrenRemoved: CustomEvent<MorphChildrenActionEntry>;
|
|
39
39
|
}
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),dt=r=>{throw TypeError(r)};var $=(r,t,
|
|
1
|
+
"use strict";var lt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),dt=r=>{throw TypeError(r)};var $=(r,t,s)=>t.has(r)||dt("Cannot "+s);var e=(r,t,s)=>($(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?dt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),c=(r,t,s,n)=>($(r,t,"write to private field"),n?n.call(r,s):t.set(r,s),s),y=(r,t,s)=>($(r,t,"access private method"),s);var R=(r,t,s)=>new Promise((n,l)=>{var d=m=>{try{E(s.next(m))}catch(P){l(P)}},o=m=>{try{E(s.throw(m))}catch(P){l(P)}},E=m=>m.done?n(m.value):Promise.resolve(m.value).then(d,o);E((s=s.apply(r,t)).next())});var ut=(r,t,s)=>(t=r[lt("asyncIterator")])?t.call(r):(r=r[lt("iterator")](),t={},s=(n,l)=>(l=r[n])&&(t[n]=d=>new Promise((o,E,m)=>(d=l.call(r,d),m=d.done,Promise.resolve(d.value).then(P=>o({value:P,done:m}),E)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wt=require("../browser-CpzFX2xg.cjs"),J=require("../events-KVanG9sR.cjs"),Q=require("../url-CHQeS8b5.cjs"),mt=require("../loading/index.cjs");class pt extends HTMLElement{constructor(){super()}connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",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"};for(const[s,n]of Object.entries(t))this.setAttribute(s,n)}}customElements.get("morph-announcer")||customElements.define("morph-announcer",pt);var T,h,g,D,O,k,_,H;class ft{constructor(t,s){a(this,T);a(this,h);a(this,g);a(this,D);a(this,O);a(this,k);a(this,_,t=>{t.preventDefault(),e(this,T).links.forEach(s=>{var n;e(this,g)===e(s,g)||(n=e(s,k))!=null&&n.includes(e(this,g))?e(s,h).classList.add("clicked"):e(s,h).classList.remove("clicked")}),e(this,T).navigate(e(this,g),{historyAction:e(this,D),state:e(this,O)})});a(this,H,()=>{e(this,T).prefetch(e(this,g)),e(this,h).removeEventListener("pointerenter",e(this,H))});var d,o;c(this,T,s),c(this,h,t),c(this,g,e(this,h).getAttribute("href")||"/"),c(this,D,e(this,h).getAttribute("data-history-action")||"push"),c(this,O,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,_));const n=s.normalizePath(e(this,g)),l=s.normalizePath(location.pathname);c(this,k,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(E=>s.normalizePath(E.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,h).classList.add("current"):n.pathname===l.pathname||(o=e(this,k))!=null&&o.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,H))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,_)),e(this,h).removeEventListener("pointerenter",e(this,H)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,g=new WeakMap,D=new WeakMap,O=new WeakMap,k=new WeakMap,_=new WeakMap,H=new WeakMap;var F,I,j,B,N,v,U,M,b,L,W,Y,C,A,u,tt,et,gt,st,X;class yt{constructor(t){a(this,u);a(this,F,null);a(this,I,null);a(this,j,null);a(this,B,!1);a(this,N,null);a(this,v,[]);a(this,U,new DOMParser);a(this,M,new Map);a(this,b);a(this,L,null);a(this,W);a(this,Y);a(this,C,[]);a(this,A,null);a(this,X,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(wt.isBrowser){c(this,F,Q.normalizeBase(t==null?void 0:t.base)),c(this,I,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,j,(t==null?void 0:t.cachePages)!==!1),c(this,B,(t==null?void 0:t.trailingSlash)||!1),c(this,N,y(this,u,et).call(this,document.body));const s=this.normalizePath(location.pathname);c(this,L,s.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,X)),Q.changeHistory("replace",e(this,L),s.parameters,s.hash),e(this,N).map(n=>[...n.children]).flat().forEach(n=>{n instanceof HTMLElement&&n.classList.add("current")}),c(this,A,new pt)}}get currentPathname(){return e(this,L)}get previousPathname(){return e(this,W)}get currentState(){return e(this,Y)}get links(){return e(this,v)}normalizePath(t){return Q.splitPath(t,e(this,F),e(this,B))}prefetch(t){return R(this,null,function*(){const s=this.normalizePath(t);return y(this,u,tt).call(this,s.pathname)})}navigate(l){return R(this,arguments,function*(t,{historyAction:s="push",state:n}={}){var it;if(e(this,C).length)return;const d=this.normalizePath(t);let{pathname:o,hash:E,parameters:m,leaf:P}=d;if(e(this,b)===o||e(this,L)===o)return;c(this,Y,n),c(this,b,o);const x=e(this,M).has(o);try{mt.loading.add("__morph");let K=!0;if(this.preprocessor)try{yield new Promise((i,f)=>{var w;(w=this.preprocessor)==null||w.call(this,{pathname:o,resolve:i,reject:f,isCached:x,state:n})})}catch(i){i?console.error(i):console.log("Route change canceled"),K=!1}if(!K||e(this,b)!==o)return;const S=e(this,M).get(o)||(yield y(this,u,tt).call(this,o));if(e(this,b)!==o)return;if(S.title)e(this,A).textContent=S.title;else{const i=S.querySelector("h1"),f=(i==null?void 0:i.innerText)||(i==null?void 0:i.textContent)||o;e(this,A).textContent=f}document.body.appendChild(e(this,A)),J.dispatchEvent(document,"morphStart",{detail:{pathname:o,isCached:x,state:n,newDocument:S}});const nt=Array.from(document.head.children),rt=Array.from(S.head.cloneNode(!0).children),at=y(this,u,gt).call(this,nt,rt),Lt=y(this,u,st).call(this,nt,at),V=y(this,u,st).call(this,rt,at);V.forEach((i,f)=>{if(i.tagName==="SCRIPT"&&i.getAttribute("src")){const w=document.createElement("script");w.type="module",w.src=i.getAttribute("src"),V[f]=w}}),V.forEach(i=>{document.head.appendChild(i)});const Z=V.filter(i=>!i.hasAttribute("data-no-waiting")&&(i.tagName==="STYLE"||i.tagName==="SCRIPT"||i.tagName==="LINK")&&i.getAttribute("rel")!=="canonical");e(this,I)&&Z.length&&(yield new Promise(i=>R(this,null,function*(){let f=0;try{for(var w=ut(Z),ht,z,ct;ht=!(z=yield w.next()).done;ht=!1){const G=z.value;G.onload=()=>{f++,f===Z.length&&i()}}}catch(z){ct=[z]}finally{try{ht&&(z=w.return)&&(yield z.call(w))}finally{if(ct)throw ct[0]}}})));const ot=[];Lt.forEach(i=>{i.hasAttribute("data-permanent")||(i.tagName==="SCRIPT"||i.tagName==="STYLE"||i.getAttribute("rel")==="stylesheet"?ot.push(i):i.remove())}),c(this,W,e(this,L)),c(this,L,o),Q.changeHistory(s,o,m,E);const Et=y(this,u,et).call(this,S.body.cloneNode(!0));e(this,N).forEach((i,f)=>{const w=Et[f++],ht=getComputedStyle(i).getPropertyValue("--morph-duration"),z=[...w.childNodes];if(ht){const ct=[...i.childNodes];ct.forEach(p=>{p instanceof HTMLElement&&p.classList.add("old")}),z.forEach(p=>{p instanceof HTMLElement&&p.classList.add("new")}),i.append(...z),setTimeout(()=>{z.forEach(p=>{p instanceof HTMLElement&&p.classList.add("in")})},10);const G={element:i,pathname:o,isCached:x,state:n};J.dispatchEvent(document,"morphNewChildrenAdded",{detail:G});const vt=new Promise(p=>{setTimeout(()=>{ct.forEach(q=>q.remove()),z.forEach(q=>{q instanceof HTMLElement&&(q.classList.remove("new","in"),q.classList.add("current"))}),J.dispatchEvent(document,"morphOldChildrenRemoved",{detail:G}),p()},(parseFloat(ht)||0)*1e3+10)});e(this,C).push(vt)}else i.innerHTML="",i.append(...z)}),yield Promise.all(e(this,C)),ot.forEach(i=>i.remove()),c(this,C,[]),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",P),e(this,A).remove(),(it=this.postprocessor)==null||it.call(this,{pathname:o,isCached:x,state:n}),J.dispatchEvent(document,"morphComplete",{detail:{pathname:o,isCached:x,state:n}}),mt.loading.complete("__morph")}catch(K){console.error(K)}c(this,b,void 0)})}addLink(t){e(this,v).push(new ft(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){c(this,v,e(this,v).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return((n=s.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});e(this,v).forEach(s=>s.destroy()),c(this,v,t.map(s=>new ft(s,this)))}}F=new WeakMap,I=new WeakMap,j=new WeakMap,B=new WeakMap,N=new WeakMap,v=new WeakMap,U=new WeakMap,M=new WeakMap,b=new WeakMap,L=new WeakMap,W=new WeakMap,Y=new WeakMap,C=new WeakMap,A=new WeakMap,u=new WeakSet,tt=function(t){return R(this,null,function*(){const s=e(this,M).get(t);if(s)return s;const l=yield(yield fetch(t)).text(),d=e(this,U).parseFromString(l,"text/html");return e(this,j)&&e(this,M).set(t,d),d})},et=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},gt=function(t,s){return t.filter(n=>s.find(l=>l.outerHTML===n.outerHTML))},st=function(t,s){return t.filter(n=>!s.find(l=>l.outerHTML===n.outerHTML))},X=new WeakMap;exports.Morph=yt;
|
package/lib/morph/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var ct = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), lt = (r) =>
|
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
4
|
var Z = (r, t, s) => t.has(r) || lt("Cannot " + s);
|
|
5
|
-
var e = (r, t, s) => (Z(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? lt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), c = (r, t, s, n) => (Z(r, t, "write to private field"), n ? n.call(r, s) : t.set(r, s), s),
|
|
5
|
+
var e = (r, t, s) => (Z(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? lt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), c = (r, t, s, n) => (Z(r, t, "write to private field"), n ? n.call(r, s) : t.set(r, s), s), y = (r, t, s) => (Z(r, t, "access private method"), s);
|
|
6
6
|
var D = (r, t, s) => new Promise((n, l) => {
|
|
7
7
|
var d = (m) => {
|
|
8
8
|
try {
|
|
@@ -20,9 +20,9 @@ var D = (r, t, s) => new Promise((n, l) => {
|
|
|
20
20
|
E((s = s.apply(r, t)).next());
|
|
21
21
|
});
|
|
22
22
|
var dt = (r, t, s) => (t = r[ct("asyncIterator")]) ? t.call(r) : (r = r[ct("iterator")](), t = {}, s = (n, l) => (l = r[n]) && (t[n] = (d) => new Promise((o, E, m) => (d = l.call(r, d), m = d.done, Promise.resolve(d.value).then((P) => o({ value: P, done: m }), E)))), s("next"), s("return"), t);
|
|
23
|
-
import { i as
|
|
23
|
+
import { i as vt } from "../browser-0zX67oeU.js";
|
|
24
24
|
import { d as J } from "../events-CsVF98U6.js";
|
|
25
|
-
import { n as
|
|
25
|
+
import { n as yt, c as ut, s as At } from "../url-DqQuzXwT.js";
|
|
26
26
|
import { loading as mt } from "../loading/index.js";
|
|
27
27
|
class pt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
@@ -39,43 +39,43 @@ class pt extends HTMLElement {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
customElements.get("morph-announcer") || customElements.define("morph-announcer", pt);
|
|
42
|
-
var T, h,
|
|
42
|
+
var T, h, L, F, I, S, O, H;
|
|
43
43
|
class ft {
|
|
44
44
|
constructor(t, s) {
|
|
45
45
|
a(this, T);
|
|
46
46
|
a(this, h);
|
|
47
|
-
a(this,
|
|
47
|
+
a(this, L);
|
|
48
48
|
a(this, F);
|
|
49
49
|
a(this, I);
|
|
50
|
-
a(this,
|
|
50
|
+
a(this, S);
|
|
51
51
|
a(this, O, (t) => {
|
|
52
52
|
t.preventDefault(), e(this, T).links.forEach((s) => {
|
|
53
53
|
var n;
|
|
54
|
-
e(this,
|
|
55
|
-
}), e(this, T).navigate(e(this,
|
|
54
|
+
e(this, L) === e(s, L) || (n = e(s, S)) != null && n.includes(e(this, L)) ? e(s, h).classList.add("clicked") : e(s, h).classList.remove("clicked");
|
|
55
|
+
}), e(this, T).navigate(e(this, L), {
|
|
56
56
|
historyAction: e(this, F),
|
|
57
57
|
state: e(this, I)
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
-
a(this,
|
|
61
|
-
e(this, T).prefetch(e(this,
|
|
60
|
+
a(this, H, () => {
|
|
61
|
+
e(this, T).prefetch(e(this, L)), e(this, h).removeEventListener("pointerenter", e(this, H));
|
|
62
62
|
});
|
|
63
63
|
var d, o;
|
|
64
|
-
c(this, T, s), c(this, h, t), c(this,
|
|
64
|
+
c(this, T, s), c(this, h, t), c(this, L, e(this, h).getAttribute("href") || "/"), c(this, F, e(this, h).getAttribute(
|
|
65
65
|
"data-history-action"
|
|
66
66
|
) || "push"), c(this, I, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, O));
|
|
67
|
-
const n = s.normalizePath(e(this,
|
|
68
|
-
c(this,
|
|
67
|
+
const n = s.normalizePath(e(this, L)), l = s.normalizePath(location.pathname);
|
|
68
|
+
c(this, S, (d = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : d.split(",").map((E) => s.normalizePath(E.trim()).pathname)), e(this, h).hasAttribute("data-include") ? l.pathname.includes(n.pathname) && e(this, h).classList.add("current") : n.pathname === l.pathname || (o = e(this, S)) != null && o.includes(l.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, H));
|
|
69
69
|
}
|
|
70
70
|
get element() {
|
|
71
71
|
return e(this, h);
|
|
72
72
|
}
|
|
73
73
|
destroy() {
|
|
74
|
-
e(this, h).removeEventListener("click", e(this, O)), e(this, h).removeEventListener("pointerenter", e(this,
|
|
74
|
+
e(this, h).removeEventListener("click", e(this, O)), e(this, h).removeEventListener("pointerenter", e(this, H)), e(this, h).classList.remove("current");
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
T = new WeakMap(), h = new WeakMap(),
|
|
78
|
-
var _, q, B, W, N,
|
|
77
|
+
T = new WeakMap(), h = new WeakMap(), L = new WeakMap(), F = new WeakMap(), I = new WeakMap(), S = new WeakMap(), O = new WeakMap(), H = new WeakMap();
|
|
78
|
+
var _, q, B, W, N, w, Q, C, A, g, Y, j, M, b, u, $, tt, Lt, et, U;
|
|
79
79
|
class kt {
|
|
80
80
|
constructor(t) {
|
|
81
81
|
a(this, u);
|
|
@@ -84,11 +84,11 @@ class kt {
|
|
|
84
84
|
a(this, B, null);
|
|
85
85
|
a(this, W, !1);
|
|
86
86
|
a(this, N, null);
|
|
87
|
-
a(this,
|
|
87
|
+
a(this, w, []);
|
|
88
88
|
a(this, Q, new DOMParser());
|
|
89
89
|
a(this, C, /* @__PURE__ */ new Map());
|
|
90
|
-
a(this,
|
|
91
|
-
a(this,
|
|
90
|
+
a(this, A);
|
|
91
|
+
a(this, g, null);
|
|
92
92
|
a(this, Y);
|
|
93
93
|
a(this, j);
|
|
94
94
|
a(this, M, []);
|
|
@@ -96,18 +96,18 @@ class kt {
|
|
|
96
96
|
a(this, U, (t) => {
|
|
97
97
|
t.state && this.navigate(t.state, { historyAction: "none" });
|
|
98
98
|
});
|
|
99
|
-
if (
|
|
100
|
-
c(this, _,
|
|
99
|
+
if (vt) {
|
|
100
|
+
c(this, _, yt(t == null ? void 0 : t.base)), c(this, q, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, B, (t == null ? void 0 : t.cachePages) !== !1), c(this, W, (t == null ? void 0 : t.trailingSlash) || !1), c(this, N, y(this, u, tt).call(this, document.body));
|
|
101
101
|
const s = this.normalizePath(location.pathname);
|
|
102
|
-
c(this,
|
|
102
|
+
c(this, g, s.pathname), document.documentElement.setAttribute(
|
|
103
103
|
"data-current-pathname",
|
|
104
|
-
e(this,
|
|
104
|
+
e(this, g)
|
|
105
105
|
), document.documentElement.setAttribute(
|
|
106
106
|
"data-current-leaf",
|
|
107
107
|
s.leaf
|
|
108
108
|
), this.findLinks(), addEventListener("popstate", e(this, U)), ut(
|
|
109
109
|
"replace",
|
|
110
|
-
e(this,
|
|
110
|
+
e(this, g),
|
|
111
111
|
s.parameters,
|
|
112
112
|
s.hash
|
|
113
113
|
), e(this, N).map((n) => [...n.children]).flat().forEach((n) => {
|
|
@@ -116,7 +116,7 @@ class kt {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
get currentPathname() {
|
|
119
|
-
return e(this,
|
|
119
|
+
return e(this, g);
|
|
120
120
|
}
|
|
121
121
|
get previousPathname() {
|
|
122
122
|
return e(this, Y);
|
|
@@ -125,15 +125,15 @@ class kt {
|
|
|
125
125
|
return e(this, j);
|
|
126
126
|
}
|
|
127
127
|
get links() {
|
|
128
|
-
return e(this,
|
|
128
|
+
return e(this, w);
|
|
129
129
|
}
|
|
130
130
|
normalizePath(t) {
|
|
131
|
-
return
|
|
131
|
+
return At(t, e(this, _), e(this, W));
|
|
132
132
|
}
|
|
133
133
|
prefetch(t) {
|
|
134
134
|
return D(this, null, function* () {
|
|
135
135
|
const s = this.normalizePath(t);
|
|
136
|
-
return
|
|
136
|
+
return y(this, u, $).call(this, s.pathname);
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
navigate(l) {
|
|
@@ -143,9 +143,9 @@ class kt {
|
|
|
143
143
|
return;
|
|
144
144
|
const d = this.normalizePath(t);
|
|
145
145
|
let { pathname: o, hash: E, parameters: m, leaf: P } = d;
|
|
146
|
-
if (e(this,
|
|
146
|
+
if (e(this, A) === o || e(this, g) === o)
|
|
147
147
|
return;
|
|
148
|
-
c(this, j, n), c(this,
|
|
148
|
+
c(this, j, n), c(this, A, o);
|
|
149
149
|
const x = e(this, C).has(o);
|
|
150
150
|
try {
|
|
151
151
|
mt.add("__morph");
|
|
@@ -153,16 +153,16 @@ class kt {
|
|
|
153
153
|
if (this.preprocessor)
|
|
154
154
|
try {
|
|
155
155
|
yield new Promise((i, f) => {
|
|
156
|
-
var
|
|
157
|
-
(
|
|
156
|
+
var v;
|
|
157
|
+
(v = this.preprocessor) == null || v.call(this, { pathname: o, resolve: i, reject: f, isCached: x, state: n });
|
|
158
158
|
});
|
|
159
159
|
} catch (i) {
|
|
160
160
|
i ? console.error(i) : console.log("Route change canceled"), K = !1;
|
|
161
161
|
}
|
|
162
|
-
if (!K || e(this,
|
|
162
|
+
if (!K || e(this, A) !== o)
|
|
163
163
|
return;
|
|
164
|
-
const k = e(this, C).get(o) || (yield
|
|
165
|
-
if (e(this,
|
|
164
|
+
const k = e(this, C).get(o) || (yield y(this, u, $).call(this, o));
|
|
165
|
+
if (e(this, A) !== o)
|
|
166
166
|
return;
|
|
167
167
|
if (k.title)
|
|
168
168
|
e(this, b).textContent = k.title;
|
|
@@ -170,7 +170,7 @@ class kt {
|
|
|
170
170
|
const i = k.querySelector("h1"), f = (i == null ? void 0 : i.innerText) || (i == null ? void 0 : i.textContent) || o;
|
|
171
171
|
e(this, b).textContent = f;
|
|
172
172
|
}
|
|
173
|
-
document.body.appendChild(e(this, b)), J(document, "
|
|
173
|
+
document.body.appendChild(e(this, b)), J(document, "morphStart", {
|
|
174
174
|
detail: {
|
|
175
175
|
pathname: o,
|
|
176
176
|
isCached: x,
|
|
@@ -180,11 +180,11 @@ class kt {
|
|
|
180
180
|
});
|
|
181
181
|
const it = Array.from(document.head.children), nt = Array.from(
|
|
182
182
|
k.head.cloneNode(!0).children
|
|
183
|
-
), rt =
|
|
183
|
+
), rt = y(this, u, Lt).call(this, it, nt), gt = y(this, u, et).call(this, it, rt), V = y(this, u, et).call(this, nt, rt);
|
|
184
184
|
V.forEach((i, f) => {
|
|
185
185
|
if (i.tagName === "SCRIPT" && i.getAttribute("src")) {
|
|
186
|
-
const
|
|
187
|
-
|
|
186
|
+
const v = document.createElement("script");
|
|
187
|
+
v.type = "module", v.src = i.getAttribute("src"), V[f] = v;
|
|
188
188
|
}
|
|
189
189
|
}), V.forEach((i) => {
|
|
190
190
|
document.head.appendChild(i);
|
|
@@ -195,7 +195,7 @@ class kt {
|
|
|
195
195
|
e(this, q) && X.length && (yield new Promise((i) => D(this, null, function* () {
|
|
196
196
|
let f = 0;
|
|
197
197
|
try {
|
|
198
|
-
for (var
|
|
198
|
+
for (var v = dt(X), ot, z, ht; ot = !(z = yield v.next()).done; ot = !1) {
|
|
199
199
|
const G = z.value;
|
|
200
200
|
G.onload = () => {
|
|
201
201
|
f++, f === X.length && i();
|
|
@@ -205,7 +205,7 @@ class kt {
|
|
|
205
205
|
ht = [z];
|
|
206
206
|
} finally {
|
|
207
207
|
try {
|
|
208
|
-
ot && (z =
|
|
208
|
+
ot && (z = v.return) && (yield z.call(v));
|
|
209
209
|
} finally {
|
|
210
210
|
if (ht)
|
|
211
211
|
throw ht[0];
|
|
@@ -213,12 +213,12 @@ class kt {
|
|
|
213
213
|
}
|
|
214
214
|
})));
|
|
215
215
|
const at = [];
|
|
216
|
-
|
|
216
|
+
gt.forEach((i) => {
|
|
217
217
|
i.hasAttribute("data-permanent") || (i.tagName === "SCRIPT" || i.tagName === "STYLE" || i.getAttribute("rel") === "stylesheet" ? at.push(i) : i.remove());
|
|
218
|
-
}), c(this, Y, e(this,
|
|
219
|
-
const Et =
|
|
218
|
+
}), c(this, Y, e(this, g)), c(this, g, o), ut(s, o, m, E);
|
|
219
|
+
const Et = y(this, u, tt).call(this, k.body.cloneNode(!0));
|
|
220
220
|
e(this, N).forEach((i, f) => {
|
|
221
|
-
const
|
|
221
|
+
const v = Et[f++], ot = getComputedStyle(i).getPropertyValue("--morph-duration"), z = [...v.childNodes];
|
|
222
222
|
if (ot) {
|
|
223
223
|
const ht = [...i.childNodes];
|
|
224
224
|
ht.forEach((p) => {
|
|
@@ -239,7 +239,7 @@ class kt {
|
|
|
239
239
|
J(document, "morphNewChildrenAdded", {
|
|
240
240
|
detail: G
|
|
241
241
|
});
|
|
242
|
-
const
|
|
242
|
+
const wt = new Promise((p) => {
|
|
243
243
|
setTimeout(() => {
|
|
244
244
|
ht.forEach((R) => R.remove()), z.forEach((R) => {
|
|
245
245
|
R instanceof HTMLElement && (R.classList.remove("new", "in"), R.classList.add("current"));
|
|
@@ -248,10 +248,10 @@ class kt {
|
|
|
248
248
|
}), p();
|
|
249
249
|
}, (parseFloat(ot) || 0) * 1e3 + 10);
|
|
250
250
|
});
|
|
251
|
-
e(this, M).push(
|
|
251
|
+
e(this, M).push(wt);
|
|
252
252
|
} else
|
|
253
253
|
i.innerHTML = "", i.append(...z);
|
|
254
|
-
}), yield Promise.all(e(this, M)), at.forEach((i) => i.remove()), c(this, M, []), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", P), e(this, b).remove(), (st = this.postprocessor) == null || st.call(this, { pathname: o, isCached: x, state: n }), J(document, "
|
|
254
|
+
}), yield Promise.all(e(this, M)), at.forEach((i) => i.remove()), c(this, M, []), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", o), document.documentElement.setAttribute("data-current-leaf", P), e(this, b).remove(), (st = this.postprocessor) == null || st.call(this, { pathname: o, isCached: x, state: n }), J(document, "morphComplete", {
|
|
255
255
|
detail: {
|
|
256
256
|
pathname: o,
|
|
257
257
|
isCached: x,
|
|
@@ -261,11 +261,11 @@ class kt {
|
|
|
261
261
|
} catch (K) {
|
|
262
262
|
console.error(K);
|
|
263
263
|
}
|
|
264
|
-
c(this,
|
|
264
|
+
c(this, A, void 0);
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
addLink(t) {
|
|
268
|
-
e(this,
|
|
268
|
+
e(this, w).push(new ft(t, this));
|
|
269
269
|
}
|
|
270
270
|
addLinks(t) {
|
|
271
271
|
t.forEach((s) => {
|
|
@@ -273,7 +273,7 @@ class kt {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
removeLink(t) {
|
|
276
|
-
c(this,
|
|
276
|
+
c(this, w, e(this, w).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
277
277
|
}
|
|
278
278
|
findLinks() {
|
|
279
279
|
const t = [
|
|
@@ -284,10 +284,10 @@ class kt {
|
|
|
284
284
|
return ((n = s.getAttribute("href")) == null ? void 0 : n.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
|
|
285
285
|
}
|
|
286
286
|
);
|
|
287
|
-
e(this,
|
|
287
|
+
e(this, w).forEach((s) => s.destroy()), c(this, w, t.map((s) => new ft(s, this)));
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
_ = new WeakMap(), q = new WeakMap(), B = new WeakMap(), W = new WeakMap(), N = new WeakMap(),
|
|
290
|
+
_ = new WeakMap(), q = new WeakMap(), B = new WeakMap(), W = new WeakMap(), N = new WeakMap(), w = new WeakMap(), Q = new WeakMap(), C = new WeakMap(), A = new WeakMap(), g = new WeakMap(), Y = new WeakMap(), j = new WeakMap(), M = new WeakMap(), b = new WeakMap(), u = new WeakSet(), $ = function(t) {
|
|
291
291
|
return D(this, null, function* () {
|
|
292
292
|
const s = e(this, C).get(t);
|
|
293
293
|
if (s)
|
|
@@ -298,7 +298,7 @@ _ = new WeakMap(), q = new WeakMap(), B = new WeakMap(), W = new WeakMap(), N =
|
|
|
298
298
|
}, tt = function(t) {
|
|
299
299
|
const s = [...t.querySelectorAll("[data-morph]")];
|
|
300
300
|
return s.length ? s : [t];
|
|
301
|
-
},
|
|
301
|
+
}, Lt = function(t, s) {
|
|
302
302
|
return t.filter(
|
|
303
303
|
(n) => s.find(
|
|
304
304
|
(l) => l.outerHTML === n.outerHTML
|