aptechka 0.42.10 → 0.43.1

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