aptechka 0.70.19 → 0.71.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.
@@ -9,7 +9,7 @@ export interface MorphOptions {
9
9
  morphInsideScrollContainer: boolean;
10
10
  }
11
11
  export interface MorphNavigationEntry {
12
- path: string;
12
+ url: ReturnType<typeof splitPath>;
13
13
  submorph?: Array<string>;
14
14
  }
15
15
  export interface MorphNavigationDocumentFetchedEntry extends MorphNavigationEntry {
@@ -10,13 +10,13 @@ export interface MorphRouteSaveState {
10
10
  export type MorpRouteSaveParametersArg = string | object | URLSearchParams;
11
11
  export declare class MorphRoute {
12
12
  #private;
13
- constructor(morph: Morph, path: string);
14
- get path(): string;
13
+ constructor(morph: Morph, pathname: string);
14
+ get pathname(): string;
15
15
  get scrollState(): MorphRouteScrollState;
16
16
  get document(): Document;
17
17
  setInitialDocument(document: Document): void;
18
18
  abort(): void | undefined;
19
- fetch(revalidate?: boolean): Promise<void | null>;
19
+ fetch(path: string, revalidate?: boolean): Promise<void | null>;
20
20
  cloneDocument(): void;
21
21
  get title(): string;
22
22
  clearScrollState(): void;
@@ -1 +1 @@
1
- "use strict";var Xt=Object.defineProperty,jt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var Rt=Object.getOwnPropertySymbols;var $t=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable;var qt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),It=n=>{throw TypeError(n)};var Dt=(n,t,s)=>t in n?Xt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,Et=(n,t)=>{for(var s in t||(t={}))$t.call(t,s)&&Dt(n,s,t[s]);if(Rt)for(var s of Rt(t))Gt.call(t,s)&&Dt(n,s,t[s]);return n},gt=(n,t)=>jt(n,Kt(t));var vt=(n,t,s)=>t.has(n)||It("Cannot "+s);var e=(n,t,s)=>(vt(n,t,"read from private field"),s?s.call(n):t.get(n)),a=(n,t,s)=>t.has(n)?It("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),r=(n,t,s,i)=>(vt(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),E=(n,t,s)=>(vt(n,t,"access private method"),s);var X=(n,t,s)=>new Promise((i,m)=>{var y=v=>{try{S(s.next(v))}catch(Y){m(Y)}},H=v=>{try{S(s.throw(v))}catch(Y){m(Y)}},S=v=>v.done?i(v.value):Promise.resolve(v.value).then(y,H);S((s=s.apply(n,t)).next())});var Ut=(n,t,s)=>(t=n[qt("asyncIterator")])?t.call(n):(n=n[qt("iterator")](),t={},s=(i,m)=>(m=n[i])&&(t[i]=y=>new Promise((H,S,v)=>(y=m.call(n,y),v=y.done,Promise.resolve(y.value).then(Y=>H({value:Y,done:v}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zt=require("../index-DekP7OZe.cjs"),U=require("../events-KVanG9sR.cjs"),Jt=require("../polyfills-Df4r-ETT.cjs"),Vt=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const st=require("../url-BT4fssbO.cjs"),Qt=require("../css-value-parser/index.cjs");class Bt extends HTMLElement{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,i]of Object.entries(t))this.setAttribute(s,i)}}zt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Bt);var N,l,V,nt,J;class wt{constructor(t,s){a(this,N);a(this,l);a(this,V);a(this,nt,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,N).previousURL)history.back();else{r(this,V,e(this,l).getAttribute("href")||"/");const m=e(this,l).getAttribute("data-history-action")||"push",y=e(this,l).hasAttribute("data-center-scroll"),H=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=H?Qt.cssValueParser.parse(H):void 0,v=e(this,l).hasAttribute("data-revalidate"),Y=e(this,l).hasAttribute("data-keep-search-parameters"),h=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(lt=>lt.trim()),at=e(this,l).hasAttribute("data-clear-state");e(this,N).navigate(e(this,V),{historyAction:m,centerScroll:y,offsetScroll:S,revalidate:v,keepSearchParameters:Y,submorph:h,clearState:at})}});a(this,J,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,N).prefetch(e(this,V),t),e(this,l).removeEventListener("pointerenter",e(this,J))});r(this,N,s),r(this,l,t),r(this,V,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,nt)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,J))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,N).normalizePath(t),i=e(this,N).normalizePath(e(this,V));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")}destroy(){e(this,l).removeEventListener("click",e(this,nt)),e(this,l).removeEventListener("pointerenter",e(this,J)),e(this,l).classList.remove("current")}}N=new WeakMap,l=new WeakMap,V=new WeakMap,nt=new WeakMap,J=new WeakMap;const Zt=new DOMParser;var R,z,L,k,j,B,Q,K,F;class St{constructor(t,s){a(this,R);a(this,z);a(this,L,{x:0,y:0});a(this,k,null);a(this,j,null);a(this,B,null);a(this,Q,null);a(this,K,null);a(this,F,null);r(this,R,t),r(this,z,s)}get path(){return e(this,z)}get scrollState(){return e(this,L)}get document(){return e(this,B)}setInitialDocument(t){r(this,k,t.cloneNode(!0))}abort(){var t;return(t=e(this,K))==null?void 0:t.abort(`[${e(this,z)}] page loading cancelled`)}fetch(t){return X(this,null,function*(){return e(this,F)||e(this,k)&&e(this,k).documentElement.hasAttribute("data-cache")&&!t||e(this,k)&&e(this,R).isPopstateNavigation?e(this,F):(r(this,F,new Promise(s=>X(this,null,function*(){try{r(this,K,new AbortController);const m=yield(yield fetch(e(this,z),{signal:e(this,K).signal})).text(),y=Zt.parseFromString(m,"text/html");this.setInitialDocument(y)}catch(i){console.warn(i)}finally{r(this,K,null),r(this,F,null),s()}}))),e(this,F))})}cloneDocument(){r(this,B,(e(this,j)||e(this,k)).cloneNode(!0))}get title(){let t="";if(e(this,B).title)t=e(this,B).title;else{const s=e(this,B).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,z)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){r(this,j,null)}saveScrollState(){e(this,k).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,R).scrollValue.left,e(this,L).y=e(this,R).scrollValue.top)}restoreScrollPosition(){e(this,R).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,k).documentElement.hasAttribute("data-no-page-restoration")?r(this,j,null):r(this,j,document.cloneNode(!0))}renewScrollPosition(){e(this,R).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){r(this,Q,t)}clearState(){const t=e(this,Q);return r(this,Q,null),t}}R=new WeakMap,z=new WeakMap,L=new WeakMap,k=new WeakMap,j=new WeakMap,B=new WeakMap,Q=new WeakMap,K=new WeakMap,F=new WeakMap;var C,Z,g,O,d,$,W,q,A,rt,T,G,_,tt,ot,c,ut,Lt,Ft,bt,At,Pt,kt,dt,et;const it=class it{constructor(t){a(this,c);a(this,C,null);a(this,Z,null);a(this,g,[]);a(this,O);a(this,d,null);a(this,$);a(this,W,[]);a(this,q,!1);a(this,A,null);a(this,rt,!1);a(this,T,new Map);a(this,G,null);a(this,_,0);a(this,tt,0);a(this,ot,t=>{var s;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"});a(this,dt,t=>X(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),r(this,q,!0),yield this.navigate(t.state.path,{historyAction:"none"}),r(this,q,!1))}));a(this,et,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,tt),m=t-e(this,_);r(this,tt,s),r(this,_,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",m>0),document.documentElement.classList.toggle("scroll-x-backward",m<0),U.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(zt.isBrowser&&!it.instance){it.instance=this,r(this,C,{base:st.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),r(this,Z,E(this,c,Lt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);r(this,d,s);const i=new St(this,e(this,d).path);i.setInitialDocument(document),e(this,T).set(e(this,d).path,i),document.documentElement.setAttribute("data-current-pathname",e(this,d).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,dt)),st.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,G,new Bt),E(this,c,Pt).call(this,document)}}get currentURL(){return e(this,d)}get previousURL(){return e(this,$)}get links(){return e(this,g)}get scrollElement(){return e(this,A)}get isPopstateNavigation(){return e(this,q)}get scrollValue(){let t=0,s=0;return e(this,rt)?(t=window.scrollY,s=window.scrollX):(t=e(this,A).scrollTop,s=e(this,A).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,T).get(e(this,d).path);s&&s.saveState(t)}getState(){const t=e(this,T).get(e(this,d).path);return t==null?void 0:t.clearState()}normalizePath(t){return st.splitPath(t,{base:e(this,C).base,trailingSlash:e(this,C).trailingSlash})}prefetch(t,s){return X(this,null,function*(){if(e(this,W).length)return;const i=E(this,c,ut).call(this,t);i==null||i.fetch(s)})}navigate(Y){return X(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:m,revalidate:y,keepSearchParameters:H,submorph:S,clearState:v}={}){var at,lt,Ct;if(e(this,W).length)return;const h=this.normalizePath(((at=this.pathnameModifier)==null?void 0:at.call(this,t))||t);if(((lt=e(this,O))==null?void 0:lt.pathname)===h.pathname||e(this,d).pathname===h.pathname){if(e(this,q)||E(this,c,kt).call(this,h.hash||0,{centerScroll:i,offsetScroll:m,behavior:"smooth"}),((Ct=e(this,d))==null?void 0:Ct.path)!==h.path){r(this,$,e(this,d)),r(this,d,h),st.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters||(H?location.search:""),hash:h.hash}),U.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:e(this,d),previousURL:e(this,$)}});const M=new St(this,e(this,d).path);M.setInitialDocument(document),e(this,T).set(e(this,d).path,M)}return}r(this,O,h),e(this,g).forEach(M=>{M.checkCurrent(h.path)});try{let M=!0;if(this.preprocessor)try{yield new Promise((o,x)=>{var p;(p=this.preprocessor)==null||p.call(this,{path:t,resolve:o,reject:x,submorph:S})})}catch(o){o?console.error(o):console.log("Route change canceled"),M=!1}if(!M||e(this,O).path!==h.path){e(this,g).forEach(o=>{o.checkCurrent(e(this,d).path)});return}const Tt={path:h.path,submorph:S};U.dispatchEvent(document,"morphNavigation",{detail:Tt});const mt=E(this,c,ut).call(this,e(this,d).path),f=E(this,c,ut).call(this,t);if(e(this,T).forEach(o=>{o.path!==h.path&&o.abort()}),yield f==null?void 0:f.fetch(y),e(this,O).path!==h.path){e(this,g).forEach(o=>{o.checkCurrent(e(this,d).path)});return}mt.clearState(),mt.saveScrollState(),mt.saveDocumentState(),e(this,q)||(f.clearScrollState(),f.clearDocumentState()),v&&f.clearState(),f.cloneDocument(),e(this,G).textContent=f.title,document.body.appendChild(e(this,G));const ft=gt(Et({},Tt),{document:f.document});U.dispatchEvent(document,"morphStart",{detail:ft});const Ht=Array.from(document.head.children),Mt=Array.from(f.document.head.children),xt=E(this,c,Ft).call(this,Ht,Mt),Ot=E(this,c,bt).call(this,Ht,xt),ht=E(this,c,bt).call(this,Mt,xt);ht.forEach((o,x)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const p=document.createElement("script"),D=o.getAttribute("src");D.includes("http")||(p.type="module"),p.src=D,ht[x]=p}}),ht.forEach(o=>{document.head.appendChild(o)});const pt=ht.filter(o=>{if(o.hasAttribute("data-no-waiting"))return!1;if(E(this,c,At).call(this,o))return!0});e(this,C).waitForHeadToLoad&&pt.length&&(yield new Promise(o=>X(this,null,function*(){let x=0;try{for(var p=Ut(pt),D,b,P;D=!(b=yield p.next()).done;D=!1){const ct=b.value;ct.onload=()=>{x++,x===pt.length&&o()}}}catch(b){P=[b]}finally{try{D&&(b=p.return)&&(yield b.call(p))}finally{if(P)throw P[0]}}}))),yield Vt.wait(10);const Nt=[];Ot.forEach(o=>{o.hasAttribute("data-permanent")||(E(this,c,At).call(this,o)?Nt.push(o):o.remove())});const Wt=E(this,c,Lt).call(this,f.document.body);e(this,C).morphInsideScrollContainer||E(this,c,Pt).call(this,f.document),document.documentElement.setAttribute("data-current-pathname",h.pathname),document.documentElement.setAttribute("data-current-leaf",h.leaf),st.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters||(H?location.search:""),hash:h.hash}),e(this,G).remove(),r(this,$,e(this,d)),r(this,d,h),e(this,Z).forEach((o,x)=>{const p=Wt[x],D=getComputedStyle(o).getPropertyValue("--morph-duration");let b=[],P=[];S?S.forEach(u=>{const w=o.querySelector(u),I=p.querySelector(u);w&&I&&(P.push(w),b.push(I))}):(b.push(...p.childNodes),P.push(...o.childNodes)),P.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),b.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),S?b.forEach((u,w)=>{var I;(I=P[w].parentElement)==null||I.insertBefore(u,P[w])}):o.prepend(...b),Jt.requestIdleCallback(()=>{P.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),b.forEach(u=>{var w;u instanceof HTMLElement&&((w=u.parentElement)==null||w.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})});const ct=gt(Et({},ft),{morphElement:o});U.dispatchEvent(document,"morphNewChildrenAdded",{detail:ct});const Yt=new Promise(u=>{setTimeout(()=>{P.forEach(w=>w.remove()),b.forEach(w=>{var I;w instanceof HTMLElement&&((I=w.parentElement)==null||I.style.removeProperty("--new-content-height"),w.classList.remove("new-idle","new"))}),U.dispatchEvent(document,"morphOldChildrenRemoved",{detail:ct}),u()},(parseFloat(D)||0)*1e3+10)});e(this,W).push(Yt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-f.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),U.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:f.scrollState}),h.hash?(f.clearScrollState(),E(this,c,kt).call(this,h.hash,{centerScroll:i,offsetScroll:m})):e(this,q)?f.restoreScrollPosition():f.renewScrollPosition(),yield Promise.all(e(this,W)),Nt.forEach(o=>o.remove()),r(this,W,[]),e(this,Z).forEach(o=>{o.querySelectorAll("script").forEach(p=>{const D=document.createElement("script");for(let b=0;b<p.attributes.length;b++){const P=p.attributes[b];D.setAttribute(P.name,P.value)}p.hasAttribute("src")||(D.innerHTML=p.innerHTML),p.replaceWith(D)})}),U.dispatchEvent(document,"morphComplete",{detail:ft}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(M){console.error(M)}r(this,O,void 0)})}addLink(t){e(this,g).push(new wt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){r(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){r(this,g,e(this,g).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,ot));e(this,g).push(...s.map(i=>new wt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,ot));e(this,g).forEach(s=>s.destroy()),r(this,g,t.map(s=>new wt(s,this)))}};C=new WeakMap,Z=new WeakMap,g=new WeakMap,O=new WeakMap,d=new WeakMap,$=new WeakMap,W=new WeakMap,q=new WeakMap,A=new WeakMap,rt=new WeakMap,T=new WeakMap,G=new WeakMap,_=new WeakMap,tt=new WeakMap,ot=new WeakMap,c=new WeakSet,ut=function(t){let s=t.split("#")[0],i=e(this,T).get(s);return i||(i=new St(this,s),e(this,T).set(s,i)),i},Lt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Ft=function(t,s){return t.filter(i=>s.find(m=>m.outerHTML===i.outerHTML))},bt=function(t,s){return t.filter(i=>!s.find(m=>m.outerHTML===i.outerHTML))},At=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Pt=function(t){var s,i;(s=e(this,A))==null||s.removeEventListener("scroll",e(this,et)),r(this,tt,0),r(this,_,0),r(this,A,e(this,C).scrollSelector&&t.querySelector(e(this,C).scrollSelector)||window),r(this,rt,e(this,A)===window),(i=e(this,A))==null||i.addEventListener("scroll",e(this,et)),e(this,et).call(this)},kt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Vt.scrollToElement(i,{scrollElement:e(this,A),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},dt=new WeakMap,et=new WeakMap,it.instance=null;let yt=it;exports.Morph=yt;
1
+ "use strict";var jt=Object.defineProperty,Kt=Object.defineProperties;var $t=Object.getOwnPropertyDescriptors;var Nt=Object.getOwnPropertySymbols;var Gt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var qt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ut=n=>{throw TypeError(n)};var Dt=(n,t,s)=>t in n?jt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,gt=(n,t)=>{for(var s in t||(t={}))Gt.call(t,s)&&Dt(n,s,t[s]);if(Nt)for(var s of Nt(t))Jt.call(t,s)&&Dt(n,s,t[s]);return n},vt=(n,t)=>Kt(n,$t(t));var St=(n,t,s)=>t.has(n)||Ut("Cannot "+s);var e=(n,t,s)=>(St(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>t.has(n)?Ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),r=(n,t,s,i)=>(St(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),E=(n,t,s)=>(St(n,t,"access private method"),s);var W=(n,t,s)=>new Promise((i,d)=>{var y=v=>{try{w(s.next(v))}catch(O){d(O)}},P=v=>{try{w(s.throw(v))}catch(O){d(O)}},w=v=>v.done?i(v.value):Promise.resolve(v.value).then(y,P);w((s=s.apply(n,t)).next())});var zt=(n,t,s)=>(t=n[qt("asyncIterator")])?t.call(n):(n=n[qt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=y=>new Promise((P,w,v)=>(y=d.call(n,y),v=y.done,Promise.resolve(y.value).then(O=>P({value:O,done:v}),w)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ft=require("../index-DekP7OZe.cjs"),U=require("../events-KVanG9sR.cjs"),Qt=require("../polyfills-Df4r-ETT.cjs"),It=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const it=require("../url-YEESIcRn.cjs"),Zt=require("../css-value-parser/index.cjs");class Bt extends HTMLElement{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,i]of Object.entries(t))this.setAttribute(s,i)}}Ft.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Bt);var H,l,z,rt,J;class wt{constructor(t,s){o(this,H);o(this,l);o(this,z);o(this,rt,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,H).previousURL)history.back();else{r(this,z,e(this,l).getAttribute("href")||"/");const d=e(this,l).getAttribute("data-history-action")||"push",y=e(this,l).hasAttribute("data-center-scroll"),P=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),w=P?Zt.cssValueParser.parse(P):void 0,v=e(this,l).hasAttribute("data-revalidate"),O=e(this,l).hasAttribute("data-keep-search-parameters"),h=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(ht=>ht.trim()),lt=e(this,l).hasAttribute("data-clear-state");e(this,H).navigate(e(this,z),{historyAction:d,centerScroll:y,offsetScroll:w,revalidate:v,keepSearchParameters:O,submorph:h,clearState:lt})}});o(this,J,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,H).prefetch(e(this,z),t),e(this,l).removeEventListener("pointerenter",e(this,J))});r(this,H,s),r(this,l,t),r(this,z,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,rt)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,J))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,H).normalizePath(t),i=e(this,H).normalizePath(e(this,z));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")}destroy(){e(this,l).removeEventListener("click",e(this,rt)),e(this,l).removeEventListener("pointerenter",e(this,J)),e(this,l).classList.remove("current")}}H=new WeakMap,l=new WeakMap,z=new WeakMap,rt=new WeakMap,J=new WeakMap;const _t=new DOMParser;var R,Y,L,C,X,I,Q,j,V,Z;class Vt{constructor(t,s){o(this,R);o(this,Y);o(this,L,{x:0,y:0});o(this,C,null);o(this,X,null);o(this,I,null);o(this,Q,null);o(this,j,null);o(this,V,null);o(this,Z);r(this,R,t),r(this,Y,s),r(this,Z,s)}get pathname(){return e(this,Y)}get scrollState(){return e(this,L)}get document(){return e(this,I)}setInitialDocument(t){r(this,C,t.cloneNode(!0))}abort(){var t;return(t=e(this,j))==null?void 0:t.abort(`[${e(this,Y)}] page loading cancelled`)}fetch(t,s){return W(this,null,function*(){return e(this,V)||e(this,C)&&e(this,C).documentElement.hasAttribute("data-cache")&&!s&&e(this,Z)!==t||e(this,C)&&e(this,R).isPopstateNavigation?e(this,V):(r(this,V,new Promise(i=>W(this,null,function*(){try{r(this,j,new AbortController);const y=yield(yield fetch(t,{signal:e(this,j).signal})).text(),P=_t.parseFromString(y,"text/html");this.setInitialDocument(P)}catch(d){console.warn(d)}finally{r(this,Z,t),r(this,j,null),r(this,V,null),i()}}))),e(this,V))})}cloneDocument(){r(this,I,(e(this,X)||e(this,C)).cloneNode(!0))}get title(){let t="";if(e(this,I).title)t=e(this,I).title;else{const s=e(this,I).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){r(this,X,null)}saveScrollState(){e(this,C).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,R).scrollValue.left,e(this,L).y=e(this,R).scrollValue.top)}restoreScrollPosition(){e(this,R).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,C).documentElement.hasAttribute("data-no-page-restoration")?r(this,X,null):r(this,X,document.cloneNode(!0))}renewScrollPosition(){e(this,R).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){r(this,Q,t)}clearState(){const t=e(this,Q);return r(this,Q,null),t}}R=new WeakMap,Y=new WeakMap,L=new WeakMap,C=new WeakMap,X=new WeakMap,I=new WeakMap,Q=new WeakMap,j=new WeakMap,V=new WeakMap,Z=new WeakMap;var T,_,g,F,m,K,B,x,A,at,N,$,tt,et,ot,c,dt,Lt,Ot,bt,At,Pt,kt,mt,st;const nt=class nt{constructor(t){o(this,c);o(this,T,null);o(this,_,null);o(this,g,[]);o(this,F);o(this,m,null);o(this,K);o(this,B,[]);o(this,x,!1);o(this,A,null);o(this,at,!1);o(this,N,new Map);o(this,$,null);o(this,tt,0);o(this,et,0);o(this,ot,t=>{var s;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"});o(this,mt,t=>W(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),r(this,x,!0),yield this.navigate(t.state.path,{historyAction:"none"}),r(this,x,!1))}));o(this,st,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,et),d=t-e(this,tt);r(this,et,s),r(this,tt,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",d>0),document.documentElement.classList.toggle("scroll-x-backward",d<0),U.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Ft.isBrowser&&!nt.instance){nt.instance=this,r(this,T,{base:it.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),r(this,_,E(this,c,Lt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash+location.search);r(this,m,s);const i=new Vt(this,e(this,m).pathname);i.setInitialDocument(document),e(this,N).set(e(this,m).path,i),document.documentElement.setAttribute("data-current-pathname",e(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,mt)),it.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,$,new Bt),E(this,c,Pt).call(this,document)}}get currentURL(){return e(this,m)}get previousURL(){return e(this,K)}get links(){return e(this,g)}get scrollElement(){return e(this,A)}get isPopstateNavigation(){return e(this,x)}get scrollValue(){let t=0,s=0;return e(this,at)?(t=window.scrollY,s=window.scrollX):(t=e(this,A).scrollTop,s=e(this,A).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,N).get(e(this,m).path);s&&s.saveState(t)}getState(){const t=e(this,N).get(e(this,m).path);return t==null?void 0:t.clearState()}normalizePath(t){return it.splitPath(t,{base:e(this,T).base,trailingSlash:e(this,T).trailingSlash})}prefetch(t,s){return W(this,null,function*(){if(e(this,B).length)return;const i=E(this,c,dt).call(this,t);i==null||i.fetch(t,s)})}navigate(O){return W(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:y,keepSearchParameters:P,submorph:w,clearState:v}={}){var lt,ht,Ct;if(e(this,B).length)return;const h=this.normalizePath(((lt=this.pathnameModifier)==null?void 0:lt.call(this,t))||t);if(((ht=e(this,F))==null?void 0:ht.pathname)===h.pathname||e(this,m).pathname===h.pathname){e(this,x)||E(this,c,kt).call(this,h.hash||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"}),((Ct=e(this,m))==null?void 0:Ct.parameters)!==h.parameters&&(r(this,K,e(this,m)),r(this,m,h),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters,hash:h.hash}),U.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:e(this,m),previousURL:e(this,K)}}));return}r(this,F,h),e(this,g).forEach(G=>{G.checkCurrent(h.pathname)});try{let G=!0;if(this.preprocessor)try{yield new Promise((a,M)=>{var p;(p=this.preprocessor)==null||p.call(this,{url:h,resolve:a,reject:M,submorph:w})})}catch(a){a?console.error(a):console.log("Route change canceled"),G=!1}if(!G||e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).pathname)});return}const Tt={url:h,submorph:w};U.dispatchEvent(document,"morphNavigation",{detail:Tt});const ft=E(this,c,dt).call(this,e(this,m).pathname),f=E(this,c,dt).call(this,t);if(e(this,N).forEach(a=>{a.pathname!==h.pathname&&a.abort()}),yield f==null?void 0:f.fetch(t,y),e(this,F).pathname!==h.pathname){e(this,g).forEach(a=>{a.checkCurrent(e(this,m).path)});return}ft.clearState(),ft.saveScrollState(),ft.saveDocumentState(),e(this,x)||(f.clearScrollState(),f.clearDocumentState()),v&&f.clearState(),f.cloneDocument(),e(this,$).textContent=f.title,document.body.appendChild(e(this,$));const pt=vt(gt({},Tt),{document:f.document});U.dispatchEvent(document,"morphStart",{detail:pt});const Mt=Array.from(document.head.children),Ht=Array.from(f.document.head.children),Rt=E(this,c,Ot).call(this,Mt,Ht),Wt=E(this,c,bt).call(this,Mt,Rt),ct=E(this,c,bt).call(this,Ht,Rt);ct.forEach((a,M)=>{if(a.tagName==="SCRIPT"&&a.getAttribute("src")){const p=document.createElement("script"),q=a.getAttribute("src");q.includes("http")||(p.type="module"),p.src=q,ct[M]=p}}),ct.forEach(a=>{document.head.appendChild(a)});const Et=ct.filter(a=>{if(a.hasAttribute("data-no-waiting"))return!1;if(E(this,c,At).call(this,a))return!0});e(this,T).waitForHeadToLoad&&Et.length&&(yield new Promise(a=>W(this,null,function*(){let M=0;try{for(var p=zt(Et),q,b,k;q=!(b=yield p.next()).done;q=!1){const ut=b.value;ut.onload=()=>{M++,M===Et.length&&a()}}}catch(b){k=[b]}finally{try{q&&(b=p.return)&&(yield b.call(p))}finally{if(k)throw k[0]}}}))),yield It.wait(10);const xt=[];Wt.forEach(a=>{a.hasAttribute("data-permanent")||(E(this,c,At).call(this,a)?xt.push(a):a.remove())});const Yt=E(this,c,Lt).call(this,f.document.body);e(this,T).morphInsideScrollContainer||E(this,c,Pt).call(this,f.document),document.documentElement.setAttribute("data-current-pathname",h.pathname),document.documentElement.setAttribute("data-current-leaf",h.leaf),it.changeHistory({action:s,pathname:h.pathname,searchParameters:h.parameters||(P?location.search:""),hash:h.hash}),e(this,$).remove(),r(this,K,e(this,m)),r(this,m,h),e(this,_).forEach((a,M)=>{const p=Yt[M],q=getComputedStyle(a).getPropertyValue("--morph-duration");let b=[],k=[];w?w.forEach(u=>{const S=a.querySelector(u),D=p.querySelector(u);S&&D&&(k.push(S),b.push(D))}):(b.push(...p.childNodes),k.push(...a.childNodes)),k.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),b.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),w?b.forEach((u,S)=>{var D;(D=k[S].parentElement)==null||D.insertBefore(u,k[S])}):a.prepend(...b),Qt.requestIdleCallback(()=>{k.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),b.forEach(u=>{var S;u instanceof HTMLElement&&((S=u.parentElement)==null||S.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})});const ut=vt(gt({},pt),{morphElement:a});U.dispatchEvent(document,"morphNewChildrenAdded",{detail:ut});const Xt=new Promise(u=>{setTimeout(()=>{k.forEach(S=>S.remove()),b.forEach(S=>{var D;S instanceof HTMLElement&&((D=S.parentElement)==null||D.style.removeProperty("--new-content-height"),S.classList.remove("new-idle","new"))}),U.dispatchEvent(document,"morphOldChildrenRemoved",{detail:ut}),u()},(parseFloat(q)||0)*1e3+10)});e(this,B).push(Xt)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-f.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),U.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:f.scrollState}),h.hash?(f.clearScrollState(),E(this,c,kt).call(this,h.hash,{centerScroll:i,offsetScroll:d})):e(this,x)?f.restoreScrollPosition():f.renewScrollPosition(),yield Promise.all(e(this,B)),xt.forEach(a=>a.remove()),r(this,B,[]),e(this,_).forEach(a=>{a.querySelectorAll("script").forEach(p=>{const q=document.createElement("script");for(let b=0;b<p.attributes.length;b++){const k=p.attributes[b];q.setAttribute(k.name,k.value)}p.hasAttribute("src")||(q.innerHTML=p.innerHTML),p.replaceWith(q)})}),U.dispatchEvent(document,"morphComplete",{detail:pt}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(G){console.error(G)}r(this,F,void 0)})}addLink(t){e(this,g).push(new wt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){r(this,g,e(this,g).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){r(this,g,e(this,g).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,ot));e(this,g).push(...s.map(i=>new wt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,ot));e(this,g).forEach(s=>s.destroy()),r(this,g,t.map(s=>new wt(s,this)))}};T=new WeakMap,_=new WeakMap,g=new WeakMap,F=new WeakMap,m=new WeakMap,K=new WeakMap,B=new WeakMap,x=new WeakMap,A=new WeakMap,at=new WeakMap,N=new WeakMap,$=new WeakMap,tt=new WeakMap,et=new WeakMap,ot=new WeakMap,c=new WeakSet,dt=function(t){const s=this.normalizePath(t);let i=e(this,N).get(s.pathname);return i||(i=new Vt(this,s.pathname),e(this,N).set(s.pathname,i)),i},Lt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Ot=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},bt=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},At=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},Pt=function(t){var s,i;(s=e(this,A))==null||s.removeEventListener("scroll",e(this,st)),r(this,et,0),r(this,tt,0),r(this,A,e(this,T).scrollSelector&&t.querySelector(e(this,T).scrollSelector)||window),r(this,at,e(this,A)===window),(i=e(this,A))==null||i.addEventListener("scroll",e(this,st)),e(this,st).call(this)},kt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&It.scrollToElement(i,{scrollElement:e(this,A),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},mt=new WeakMap,st=new WeakMap,nt.instance=null;let yt=nt;exports.Morph=yt;
@@ -1,45 +1,45 @@
1
- var Yt = Object.defineProperty, Xt = Object.defineProperties;
2
- var jt = Object.getOwnPropertyDescriptors;
3
- var Nt = Object.getOwnPropertySymbols;
4
- var Kt = Object.prototype.hasOwnProperty, $t = Object.prototype.propertyIsEnumerable;
5
- var Rt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), It = (r) => {
1
+ var Xt = Object.defineProperty, jt = Object.defineProperties;
2
+ var Kt = Object.getOwnPropertyDescriptors;
3
+ var xt = Object.getOwnPropertySymbols;
4
+ var $t = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
5
+ var Nt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), Ut = (r) => {
6
6
  throw TypeError(r);
7
7
  };
8
- var Dt = (r, t, s) => t in r ? Yt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s, pt = (r, t) => {
8
+ var Dt = (r, t, s) => t in r ? Xt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s, Et = (r, t) => {
9
9
  for (var s in t || (t = {}))
10
- Kt.call(t, s) && Dt(r, s, t[s]);
11
- if (Nt)
12
- for (var s of Nt(t))
13
- $t.call(t, s) && Dt(r, s, t[s]);
10
+ $t.call(t, s) && Dt(r, s, t[s]);
11
+ if (xt)
12
+ for (var s of xt(t))
13
+ Gt.call(t, s) && Dt(r, s, t[s]);
14
14
  return r;
15
- }, Et = (r, t) => Xt(r, jt(t));
16
- var gt = (r, t, s) => t.has(r) || It("Cannot " + s);
17
- var e = (r, t, s) => (gt(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? It("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), n = (r, t, s, i) => (gt(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), E = (r, t, s) => (gt(r, t, "access private method"), s);
18
- var X = (r, t, s) => new Promise((i, m) => {
19
- var L = (w) => {
15
+ }, gt = (r, t) => jt(r, Kt(t));
16
+ var wt = (r, t, s) => t.has(r) || Ut("Cannot " + s);
17
+ var e = (r, t, s) => (wt(r, t, "read from private field"), s ? s.call(r) : t.get(r)), a = (r, t, s) => t.has(r) ? Ut("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, s), n = (r, t, s, i) => (wt(r, t, "write to private field"), i ? i.call(r, s) : t.set(r, s), s), E = (r, t, s) => (wt(r, t, "access private method"), s);
18
+ var W = (r, t, s) => new Promise((i, d) => {
19
+ var v = (w) => {
20
20
  try {
21
- v(s.next(w));
22
- } catch (Y) {
23
- m(Y);
21
+ L(s.next(w));
22
+ } catch (O) {
23
+ d(O);
24
24
  }
25
- }, H = (w) => {
25
+ }, k = (w) => {
26
26
  try {
27
- v(s.throw(w));
28
- } catch (Y) {
29
- m(Y);
27
+ L(s.throw(w));
28
+ } catch (O) {
29
+ d(O);
30
30
  }
31
- }, v = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(L, H);
32
- v((s = s.apply(r, t)).next());
31
+ }, L = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(v, k);
32
+ L((s = s.apply(r, t)).next());
33
33
  });
34
- var Ut = (r, t, s) => (t = r[Rt("asyncIterator")]) ? t.call(r) : (r = r[Rt("iterator")](), t = {}, s = (i, m) => (m = r[i]) && (t[i] = (L) => new Promise((H, v, w) => (L = m.call(r, L), w = L.done, Promise.resolve(L.value).then((Y) => H({ value: Y, done: w }), v)))), s("next"), s("return"), t);
34
+ var zt = (r, t, s) => (t = r[Nt("asyncIterator")]) ? t.call(r) : (r = r[Nt("iterator")](), t = {}, s = (i, d) => (d = r[i]) && (t[i] = (v) => new Promise((k, L, w) => (v = d.call(r, v), w = v.done, Promise.resolve(v.value).then((O) => k({ value: O, done: w }), L)))), s("next"), s("return"), t);
35
35
  import { i as qt } from "../index-Bv9zgfdb.js";
36
- import { d as V } from "../events-CsVF98U6.js";
37
- import { r as Gt } from "../polyfills-DJrTJQky.js";
38
- import { w as Jt, s as Qt } from "../scroll-DPkCFTxg.js";
36
+ import { d as z } from "../events-CsVF98U6.js";
37
+ import { r as Jt } from "../polyfills-DJrTJQky.js";
38
+ import { w as Qt, s as Zt } from "../scroll-DPkCFTxg.js";
39
39
  import "construct-style-sheets-polyfill";
40
- import { n as Zt, c as wt, s as _t } from "../url-Cb0SFRMc.js";
41
- import { cssValueParser as te } from "../css-value-parser/index.js";
42
- class zt extends HTMLElement {
40
+ import { n as _t, c as St, s as te } from "../url-UL9zSCHb.js";
41
+ import { cssValueParser as ee } from "../css-value-parser/index.js";
42
+ class Ft extends HTMLElement {
43
43
  connectedCallback() {
44
44
  const t = {
45
45
  "aria-live": "assertive",
@@ -50,113 +50,114 @@ class zt extends HTMLElement {
50
50
  this.setAttribute(s, i);
51
51
  }
52
52
  }
53
- qt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", zt);
54
- var N, l, q, it, J;
55
- class St {
53
+ qt && !customElements.get("morph-announcer") && customElements.define("morph-announcer", Ft);
54
+ var R, l, I, rt, J;
55
+ class Lt {
56
56
  constructor(t, s) {
57
- a(this, N);
57
+ a(this, R);
58
58
  a(this, l);
59
- a(this, q);
60
- a(this, it, (t) => {
59
+ a(this, I);
60
+ a(this, rt, (t) => {
61
61
  var i;
62
- if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, N).previousURL)
62
+ if (t.preventDefault(), e(this, l).hasAttribute("data-back") && e(this, R).previousURL)
63
63
  history.back();
64
64
  else {
65
- n(this, q, e(this, l).getAttribute("href") || "/");
66
- const m = e(this, l).getAttribute(
65
+ n(this, I, e(this, l).getAttribute("href") || "/");
66
+ const d = e(this, l).getAttribute(
67
67
  "data-history-action"
68
- ) || "push", L = e(this, l).hasAttribute("data-center-scroll"), H = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), v = H ? te.parse(H) : void 0, w = e(this, l).hasAttribute("data-revalidate"), Y = e(this, l).hasAttribute(
68
+ ) || "push", v = e(this, l).hasAttribute("data-center-scroll"), k = getComputedStyle(e(this, l)).getPropertyValue("--offset-scroll").trim(), L = k ? ee.parse(k) : void 0, w = e(this, l).hasAttribute("data-revalidate"), O = e(this, l).hasAttribute(
69
69
  "data-keep-search-parameters"
70
- ), h = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((at) => at.trim()), ot = e(this, l).hasAttribute("data-clear-state");
71
- e(this, N).navigate(e(this, q), {
72
- historyAction: m,
73
- centerScroll: L,
74
- offsetScroll: v,
70
+ ), h = (i = e(this, l).getAttribute("data-submorph")) == null ? void 0 : i.split(",").map((lt) => lt.trim()), at = e(this, l).hasAttribute("data-clear-state");
71
+ e(this, R).navigate(e(this, I), {
72
+ historyAction: d,
73
+ centerScroll: v,
74
+ offsetScroll: L,
75
75
  revalidate: w,
76
- keepSearchParameters: Y,
76
+ keepSearchParameters: O,
77
77
  submorph: h,
78
- clearState: ot
78
+ clearState: at
79
79
  });
80
80
  }
81
81
  });
82
82
  a(this, J, () => {
83
83
  const t = e(this, l).hasAttribute("data-revalidate");
84
- e(this, N).prefetch(e(this, q), t), e(this, l).removeEventListener("pointerenter", e(this, J));
84
+ e(this, R).prefetch(e(this, I), t), e(this, l).removeEventListener("pointerenter", e(this, J));
85
85
  });
86
- n(this, N, s), n(this, l, t), n(this, q, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, it)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, J));
86
+ n(this, R, s), n(this, l, t), n(this, I, e(this, l).getAttribute("href") || "/"), e(this, l).addEventListener("click", e(this, rt)), this.checkCurrent(location.pathname), e(this, l).hasAttribute("data-prefetch") && e(this, l).addEventListener("pointerenter", e(this, J));
87
87
  }
88
88
  get element() {
89
89
  return e(this, l);
90
90
  }
91
91
  checkCurrent(t) {
92
- const s = e(this, N).normalizePath(t), i = e(this, N).normalizePath(e(this, q));
92
+ const s = e(this, R).normalizePath(t), i = e(this, R).normalizePath(e(this, I));
93
93
  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");
94
94
  }
95
95
  destroy() {
96
- e(this, l).removeEventListener("click", e(this, it)), e(this, l).removeEventListener("pointerenter", e(this, J)), e(this, l).classList.remove("current");
96
+ e(this, l).removeEventListener("click", e(this, rt)), e(this, l).removeEventListener("pointerenter", e(this, J)), e(this, l).classList.remove("current");
97
97
  }
98
98
  }
99
- N = new WeakMap(), l = new WeakMap(), q = new WeakMap(), it = new WeakMap(), J = new WeakMap();
100
- const ee = new DOMParser();
101
- var R, z, y, P, j, F, Q, K, W;
102
- class vt {
99
+ R = new WeakMap(), l = new WeakMap(), I = new WeakMap(), rt = new WeakMap(), J = new WeakMap();
100
+ const se = new DOMParser();
101
+ var H, Y, y, C, X, V, Q, j, q, Z;
102
+ class It {
103
103
  constructor(t, s) {
104
- a(this, R);
105
- a(this, z);
104
+ a(this, H);
105
+ a(this, Y);
106
106
  a(this, y, { x: 0, y: 0 });
107
- a(this, P, null);
108
- a(this, j, null);
109
- a(this, F, null);
107
+ a(this, C, null);
108
+ a(this, X, null);
109
+ a(this, V, null);
110
110
  a(this, Q, null);
111
- a(this, K, null);
112
- a(this, W, null);
113
- n(this, R, t), n(this, z, s);
111
+ a(this, j, null);
112
+ a(this, q, null);
113
+ a(this, Z);
114
+ n(this, H, t), n(this, Y, s), n(this, Z, s);
114
115
  }
115
- get path() {
116
- return e(this, z);
116
+ get pathname() {
117
+ return e(this, Y);
117
118
  }
118
119
  get scrollState() {
119
120
  return e(this, y);
120
121
  }
121
122
  get document() {
122
- return e(this, F);
123
+ return e(this, V);
123
124
  }
124
125
  setInitialDocument(t) {
125
- n(this, P, t.cloneNode(!0));
126
+ n(this, C, t.cloneNode(!0));
126
127
  }
127
128
  abort() {
128
129
  var t;
129
- return (t = e(this, K)) == null ? void 0 : t.abort(
130
- `[${e(this, z)}] page loading cancelled`
130
+ return (t = e(this, j)) == null ? void 0 : t.abort(
131
+ `[${e(this, Y)}] page loading cancelled`
131
132
  );
132
133
  }
133
- fetch(t) {
134
- return X(this, null, function* () {
135
- return e(this, W) || e(this, P) && e(this, P).documentElement.hasAttribute("data-cache") && !t || e(this, P) && e(this, R).isPopstateNavigation ? e(this, W) : (n(this, W, new Promise((s) => X(this, null, function* () {
134
+ fetch(t, s) {
135
+ return W(this, null, function* () {
136
+ return e(this, q) || e(this, C) && e(this, C).documentElement.hasAttribute("data-cache") && !s && e(this, Z) !== t || e(this, C) && e(this, H).isPopstateNavigation ? e(this, q) : (n(this, q, new Promise((i) => W(this, null, function* () {
136
137
  try {
137
- n(this, K, new AbortController());
138
- const m = yield (yield fetch(e(this, z), {
139
- signal: e(this, K).signal
140
- })).text(), L = ee.parseFromString(m, "text/html");
141
- this.setInitialDocument(L);
142
- } catch (i) {
143
- console.warn(i);
138
+ n(this, j, new AbortController());
139
+ const v = yield (yield fetch(t, {
140
+ signal: e(this, j).signal
141
+ })).text(), k = se.parseFromString(v, "text/html");
142
+ this.setInitialDocument(k);
143
+ } catch (d) {
144
+ console.warn(d);
144
145
  } finally {
145
- n(this, K, null), n(this, W, null), s();
146
+ n(this, Z, t), n(this, j, null), n(this, q, null), i();
146
147
  }
147
- }))), e(this, W));
148
+ }))), e(this, q));
148
149
  });
149
150
  }
150
151
  cloneDocument() {
151
- n(this, F, (e(this, j) || e(this, P)).cloneNode(!0));
152
+ n(this, V, (e(this, X) || e(this, C)).cloneNode(!0));
152
153
  }
153
154
  get title() {
154
155
  let t = "";
155
- if (e(this, F).title)
156
- t = e(this, F).title;
156
+ if (e(this, V).title)
157
+ t = e(this, V).title;
157
158
  else {
158
- const s = e(this, F).querySelector("h1");
159
- t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, z);
159
+ const s = e(this, V).querySelector("h1");
160
+ t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, Y);
160
161
  }
161
162
  return t;
162
163
  }
@@ -164,27 +165,27 @@ class vt {
164
165
  e(this, y).x = 0, e(this, y).y = 0;
165
166
  }
166
167
  clearDocumentState() {
167
- n(this, j, null);
168
+ n(this, X, null);
168
169
  }
169
170
  saveScrollState() {
170
- e(this, P).documentElement.hasAttribute(
171
+ e(this, C).documentElement.hasAttribute(
171
172
  "data-no-scroll-restoration"
172
- ) ? (e(this, y).x = 0, e(this, y).y = 0) : (e(this, y).x = e(this, R).scrollValue.left, e(this, y).y = e(this, R).scrollValue.top);
173
+ ) ? (e(this, y).x = 0, e(this, y).y = 0) : (e(this, y).x = e(this, H).scrollValue.left, e(this, y).y = e(this, H).scrollValue.top);
173
174
  }
174
175
  restoreScrollPosition() {
175
- e(this, R).scrollElement.scroll({
176
+ e(this, H).scrollElement.scroll({
176
177
  top: e(this, y).y,
177
178
  left: e(this, y).x,
178
179
  behavior: "instant"
179
180
  });
180
181
  }
181
182
  saveDocumentState() {
182
- e(this, P).documentElement.hasAttribute(
183
+ e(this, C).documentElement.hasAttribute(
183
184
  "data-no-page-restoration"
184
- ) ? n(this, j, null) : n(this, j, document.cloneNode(!0));
185
+ ) ? n(this, X, null) : n(this, X, document.cloneNode(!0));
185
186
  }
186
187
  renewScrollPosition() {
187
- e(this, R).scrollElement.scroll({
188
+ e(this, H).scrollElement.scroll({
188
189
  top: 0,
189
190
  left: 0,
190
191
  behavior: "instant"
@@ -198,36 +199,36 @@ class vt {
198
199
  return n(this, Q, null), t;
199
200
  }
200
201
  }
201
- R = new WeakMap(), z = new WeakMap(), y = new WeakMap(), P = new WeakMap(), j = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), K = new WeakMap(), W = new WeakMap();
202
- var C, Z, g, B, d, $, O, D, A, rt, T, G, _, tt, nt, c, ct, Lt, Ft, yt, bt, At, kt, ut, et;
203
- const st = class st {
202
+ H = new WeakMap(), Y = new WeakMap(), y = new WeakMap(), C = new WeakMap(), X = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), j = new WeakMap(), q = new WeakMap(), Z = new WeakMap();
203
+ var T, _, g, F, m, K, B, x, A, nt, N, $, tt, et, ot, c, ut, vt, Bt, yt, bt, At, kt, dt, st;
204
+ const it = class it {
204
205
  constructor(t) {
205
206
  a(this, c);
206
- a(this, C, null);
207
- a(this, Z, null);
207
+ a(this, T, null);
208
+ a(this, _, null);
208
209
  a(this, g, []);
209
- a(this, B);
210
- a(this, d, null);
211
- a(this, $);
212
- a(this, O, []);
213
- a(this, D, !1);
210
+ a(this, F);
211
+ a(this, m, null);
212
+ a(this, K);
213
+ a(this, B, []);
214
+ a(this, x, !1);
214
215
  a(this, A, null);
215
- a(this, rt, !1);
216
- a(this, T, /* @__PURE__ */ new Map());
217
- a(this, G, null);
218
- a(this, _, 0);
216
+ a(this, nt, !1);
217
+ a(this, N, /* @__PURE__ */ new Map());
218
+ a(this, $, null);
219
219
  a(this, tt, 0);
220
- a(this, nt, (t) => {
220
+ a(this, et, 0);
221
+ a(this, ot, (t) => {
221
222
  var s;
222
223
  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";
223
224
  });
224
- a(this, ut, (t) => X(this, null, function* () {
225
+ a(this, dt, (t) => W(this, null, function* () {
225
226
  var s;
226
- (s = t.state) != null && s.path && (t.preventDefault(), n(this, D, !0), yield this.navigate(t.state.path, { historyAction: "none" }), n(this, D, !1));
227
+ (s = t.state) != null && s.path && (t.preventDefault(), n(this, x, !0), yield this.navigate(t.state.path, { historyAction: "none" }), n(this, x, !1));
227
228
  }));
228
- a(this, et, () => {
229
- const { left: t, top: s } = this.scrollValue, i = s - e(this, tt), m = t - e(this, _);
230
- n(this, tt, s), n(this, _, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
229
+ a(this, st, () => {
230
+ const { left: t, top: s } = this.scrollValue, i = s - e(this, et), d = t - e(this, tt);
231
+ n(this, et, s), n(this, tt, t), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", t > 0), document.documentElement.classList.toggle(
231
232
  "scroll-y-forward",
232
233
  i > 0
233
234
  ), document.documentElement.classList.toggle(
@@ -235,49 +236,49 @@ const st = class st {
235
236
  i < 0
236
237
  ), document.documentElement.classList.toggle(
237
238
  "scroll-x-forward",
238
- m > 0
239
+ d > 0
239
240
  ), document.documentElement.classList.toggle(
240
241
  "scroll-x-backward",
241
- m < 0
242
- ), V(document, "morphScroll", {
242
+ d < 0
243
+ ), z(document, "morphScroll", {
243
244
  detail: {
244
245
  left: t,
245
246
  top: s
246
247
  }
247
248
  });
248
249
  });
249
- if (qt && !st.instance) {
250
- st.instance = this, n(this, C, {
251
- base: Zt(t == null ? void 0 : t.base),
250
+ if (qt && !it.instance) {
251
+ it.instance = this, n(this, T, {
252
+ base: _t(t == null ? void 0 : t.base),
252
253
  waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
253
254
  trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
254
255
  scrollSelector: t == null ? void 0 : t.scrollSelector,
255
256
  morphInsideScrollContainer: (t == null ? void 0 : t.morphInsideScrollContainer) || !1
256
- }), n(this, Z, E(this, c, Lt).call(this, document.body));
257
+ }), n(this, _, E(this, c, vt).call(this, document.body));
257
258
  const s = this.normalizePath(
258
259
  location.pathname + location.hash + location.search
259
260
  );
260
- n(this, d, s);
261
- const i = new vt(this, e(this, d).path);
262
- i.setInitialDocument(document), e(this, T).set(e(this, d).path, i), document.documentElement.setAttribute(
261
+ n(this, m, s);
262
+ const i = new It(this, e(this, m).pathname);
263
+ i.setInitialDocument(document), e(this, N).set(e(this, m).path, i), document.documentElement.setAttribute(
263
264
  "data-current-pathname",
264
- e(this, d).pathname
265
+ e(this, m).pathname
265
266
  ), document.documentElement.setAttribute(
266
267
  "data-current-leaf",
267
268
  s.leaf
268
- ), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", e(this, ut)), wt({
269
+ ), this.findLinks(), history.scrollRestoration = "manual", addEventListener("popstate", e(this, dt)), St({
269
270
  action: "replace",
270
271
  pathname: s.pathname,
271
272
  searchParameters: s.parameters,
272
273
  hash: s.hash
273
- }), n(this, G, new zt()), E(this, c, At).call(this, document);
274
+ }), n(this, $, new Ft()), E(this, c, At).call(this, document);
274
275
  }
275
276
  }
276
277
  get currentURL() {
277
- return e(this, d);
278
+ return e(this, m);
278
279
  }
279
280
  get previousURL() {
280
- return e(this, $);
281
+ return e(this, K);
281
282
  }
282
283
  get links() {
283
284
  return e(this, g);
@@ -286,189 +287,185 @@ const st = class st {
286
287
  return e(this, A);
287
288
  }
288
289
  get isPopstateNavigation() {
289
- return e(this, D);
290
+ return e(this, x);
290
291
  }
291
292
  get scrollValue() {
292
293
  let t = 0, s = 0;
293
- return e(this, rt) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, A).scrollTop, s = e(this, A).scrollLeft), { top: t, left: s };
294
+ return e(this, nt) ? (t = window.scrollY, s = window.scrollX) : (t = e(this, A).scrollTop, s = e(this, A).scrollLeft), { top: t, left: s };
294
295
  }
295
296
  saveState(t) {
296
- const s = e(this, T).get(e(this, d).path);
297
+ const s = e(this, N).get(e(this, m).path);
297
298
  s && s.saveState(t);
298
299
  }
299
300
  getState() {
300
- const t = e(this, T).get(e(this, d).path);
301
+ const t = e(this, N).get(e(this, m).path);
301
302
  return t == null ? void 0 : t.clearState();
302
303
  }
303
304
  normalizePath(t) {
304
- return _t(t, {
305
- base: e(this, C).base,
306
- trailingSlash: e(this, C).trailingSlash
305
+ return te(t, {
306
+ base: e(this, T).base,
307
+ trailingSlash: e(this, T).trailingSlash
307
308
  });
308
309
  }
309
310
  prefetch(t, s) {
310
- return X(this, null, function* () {
311
- if (e(this, O).length)
311
+ return W(this, null, function* () {
312
+ if (e(this, B).length)
312
313
  return;
313
- const i = E(this, c, ct).call(this, t);
314
- i == null || i.fetch(s);
314
+ const i = E(this, c, ut).call(this, t);
315
+ i == null || i.fetch(t, s);
315
316
  });
316
317
  }
317
- navigate(Y) {
318
- return X(this, arguments, function* (t, {
318
+ navigate(O) {
319
+ return W(this, arguments, function* (t, {
319
320
  historyAction: s = "push",
320
321
  centerScroll: i,
321
- offsetScroll: m,
322
- revalidate: L,
323
- keepSearchParameters: H,
324
- submorph: v,
322
+ offsetScroll: d,
323
+ revalidate: v,
324
+ keepSearchParameters: k,
325
+ submorph: L,
325
326
  clearState: w
326
327
  } = {}) {
327
- var ot, at, Pt;
328
- if (e(this, O).length)
328
+ var at, lt, Pt;
329
+ if (e(this, B).length)
329
330
  return;
330
331
  const h = this.normalizePath(
331
- ((ot = this.pathnameModifier) == null ? void 0 : ot.call(this, t)) || t
332
+ ((at = this.pathnameModifier) == null ? void 0 : at.call(this, t)) || t
332
333
  );
333
- if (((at = e(this, B)) == null ? void 0 : at.pathname) === h.pathname || e(this, d).pathname === h.pathname) {
334
- if (e(this, D) || E(this, c, kt).call(this, h.hash || 0, {
334
+ if (((lt = e(this, F)) == null ? void 0 : lt.pathname) === h.pathname || e(this, m).pathname === h.pathname) {
335
+ e(this, x) || E(this, c, kt).call(this, h.hash || 0, {
335
336
  centerScroll: i,
336
- offsetScroll: m,
337
+ offsetScroll: d,
337
338
  behavior: "smooth"
338
- }), ((Pt = e(this, d)) == null ? void 0 : Pt.path) !== h.path) {
339
- n(this, $, e(this, d)), n(this, d, h), wt({
340
- action: s,
341
- pathname: h.pathname,
342
- searchParameters: h.parameters || (H ? location.search : ""),
343
- hash: h.hash
344
- }), V(document, "morphURLParametersChange", {
345
- detail: {
346
- newURL: e(this, d),
347
- previousURL: e(this, $)
348
- }
349
- });
350
- const M = new vt(this, e(this, d).path);
351
- M.setInitialDocument(document), e(this, T).set(e(this, d).path, M);
352
- }
339
+ }), ((Pt = e(this, m)) == null ? void 0 : Pt.parameters) !== h.parameters && (n(this, K, e(this, m)), n(this, m, h), St({
340
+ action: s,
341
+ pathname: h.pathname,
342
+ searchParameters: h.parameters,
343
+ hash: h.hash
344
+ }), z(document, "morphURLParametersChange", {
345
+ detail: {
346
+ newURL: e(this, m),
347
+ previousURL: e(this, K)
348
+ }
349
+ }));
353
350
  return;
354
351
  }
355
- n(this, B, h), e(this, g).forEach((M) => {
356
- M.checkCurrent(h.path);
352
+ n(this, F, h), e(this, g).forEach((G) => {
353
+ G.checkCurrent(h.pathname);
357
354
  });
358
355
  try {
359
- let M = !0;
356
+ let G = !0;
360
357
  if (this.preprocessor)
361
358
  try {
362
- yield new Promise((o, x) => {
359
+ yield new Promise((o, M) => {
363
360
  var p;
364
361
  (p = this.preprocessor) == null || p.call(this, {
365
- path: t,
362
+ url: h,
366
363
  resolve: o,
367
- reject: x,
368
- submorph: v
364
+ reject: M,
365
+ submorph: L
369
366
  });
370
367
  });
371
368
  } catch (o) {
372
- o ? console.error(o) : console.log("Route change canceled"), M = !1;
369
+ o ? console.error(o) : console.log("Route change canceled"), G = !1;
373
370
  }
374
- if (!M || e(this, B).path !== h.path) {
371
+ if (!G || e(this, F).pathname !== h.pathname) {
375
372
  e(this, g).forEach((o) => {
376
- o.checkCurrent(e(this, d).path);
373
+ o.checkCurrent(e(this, m).pathname);
377
374
  });
378
375
  return;
379
376
  }
380
377
  const Ct = {
381
- path: h.path,
382
- submorph: v
378
+ url: h,
379
+ submorph: L
383
380
  };
384
- V(document, "morphNavigation", {
381
+ z(document, "morphNavigation", {
385
382
  detail: Ct
386
383
  });
387
- const dt = E(this, c, ct).call(this, e(this, d).path), f = E(this, c, ct).call(this, t);
388
- if (e(this, T).forEach((o) => {
389
- o.path !== h.path && o.abort();
390
- }), yield f == null ? void 0 : f.fetch(L), e(this, B).path !== h.path) {
384
+ const mt = E(this, c, ut).call(this, e(this, m).pathname), f = E(this, c, ut).call(this, t);
385
+ if (e(this, N).forEach((o) => {
386
+ o.pathname !== h.pathname && o.abort();
387
+ }), yield f == null ? void 0 : f.fetch(t, v), e(this, F).pathname !== h.pathname) {
391
388
  e(this, g).forEach((o) => {
392
- o.checkCurrent(e(this, d).path);
389
+ o.checkCurrent(e(this, m).path);
393
390
  });
394
391
  return;
395
392
  }
396
- dt.clearState(), dt.saveScrollState(), dt.saveDocumentState(), e(this, D) || (f.clearScrollState(), f.clearDocumentState()), w && f.clearState(), f.cloneDocument(), e(this, G).textContent = f.title, document.body.appendChild(e(this, G));
397
- const mt = Et(pt({}, Ct), {
393
+ mt.clearState(), mt.saveScrollState(), mt.saveDocumentState(), e(this, x) || (f.clearScrollState(), f.clearDocumentState()), w && f.clearState(), f.cloneDocument(), e(this, $).textContent = f.title, document.body.appendChild(e(this, $));
394
+ const ft = gt(Et({}, Ct), {
398
395
  document: f.document
399
396
  });
400
- V(document, "morphStart", {
401
- detail: mt
397
+ z(document, "morphStart", {
398
+ detail: ft
402
399
  });
403
- const Tt = Array.from(document.head.children), Ht = Array.from(f.document.head.children), Mt = E(this, c, Ft).call(this, Tt, Ht), Wt = E(this, c, yt).call(this, Tt, Mt), lt = E(this, c, yt).call(this, Ht, Mt);
404
- lt.forEach((o, x) => {
400
+ const Tt = Array.from(document.head.children), Mt = Array.from(f.document.head.children), Rt = E(this, c, Bt).call(this, Tt, Mt), Ot = E(this, c, yt).call(this, Tt, Rt), ht = E(this, c, yt).call(this, Mt, Rt);
401
+ ht.forEach((o, M) => {
405
402
  if (o.tagName === "SCRIPT" && o.getAttribute("src")) {
406
- const p = document.createElement("script"), I = o.getAttribute("src");
407
- I.includes("http") || (p.type = "module"), p.src = I, lt[x] = p;
403
+ const p = document.createElement("script"), D = o.getAttribute("src");
404
+ D.includes("http") || (p.type = "module"), p.src = D, ht[M] = p;
408
405
  }
409
- }), lt.forEach((o) => {
406
+ }), ht.forEach((o) => {
410
407
  document.head.appendChild(o);
411
408
  });
412
- const ft = lt.filter((o) => {
409
+ const pt = ht.filter((o) => {
413
410
  if (o.hasAttribute("data-no-waiting"))
414
411
  return !1;
415
412
  if (E(this, c, bt).call(this, o))
416
413
  return !0;
417
414
  });
418
- e(this, C).waitForHeadToLoad && ft.length && (yield new Promise((o) => X(this, null, function* () {
419
- let x = 0;
415
+ e(this, T).waitForHeadToLoad && pt.length && (yield new Promise((o) => W(this, null, function* () {
416
+ let M = 0;
420
417
  try {
421
- for (var p = Ut(ft), I, b, k; I = !(b = yield p.next()).done; I = !1) {
422
- const ht = b.value;
423
- ht.onload = () => {
424
- x++, x === ft.length && o();
418
+ for (var p = zt(pt), D, b, P; D = !(b = yield p.next()).done; D = !1) {
419
+ const ct = b.value;
420
+ ct.onload = () => {
421
+ M++, M === pt.length && o();
425
422
  };
426
423
  }
427
424
  } catch (b) {
428
- k = [b];
425
+ P = [b];
429
426
  } finally {
430
427
  try {
431
- I && (b = p.return) && (yield b.call(p));
428
+ D && (b = p.return) && (yield b.call(p));
432
429
  } finally {
433
- if (k)
434
- throw k[0];
430
+ if (P)
431
+ throw P[0];
435
432
  }
436
433
  }
437
- }))), yield Jt(10);
438
- const xt = [];
439
- Wt.forEach((o) => {
440
- o.hasAttribute("data-permanent") || (E(this, c, bt).call(this, o) ? xt.push(o) : o.remove());
434
+ }))), yield Qt(10);
435
+ const Ht = [];
436
+ Ot.forEach((o) => {
437
+ o.hasAttribute("data-permanent") || (E(this, c, bt).call(this, o) ? Ht.push(o) : o.remove());
441
438
  });
442
- const Bt = E(this, c, Lt).call(this, f.document.body);
443
- e(this, C).morphInsideScrollContainer || E(this, c, At).call(this, f.document), document.documentElement.setAttribute(
439
+ const Wt = E(this, c, vt).call(this, f.document.body);
440
+ e(this, T).morphInsideScrollContainer || E(this, c, At).call(this, f.document), document.documentElement.setAttribute(
444
441
  "data-current-pathname",
445
442
  h.pathname
446
443
  ), document.documentElement.setAttribute(
447
444
  "data-current-leaf",
448
445
  h.leaf
449
- ), wt({
446
+ ), St({
450
447
  action: s,
451
448
  pathname: h.pathname,
452
- searchParameters: h.parameters || (H ? location.search : ""),
449
+ searchParameters: h.parameters || (k ? location.search : ""),
453
450
  hash: h.hash
454
- }), e(this, G).remove(), n(this, $, e(this, d)), n(this, d, h), e(this, Z).forEach((o, x) => {
455
- const p = Bt[x], I = getComputedStyle(o).getPropertyValue("--morph-duration");
456
- let b = [], k = [];
457
- v ? v.forEach((u) => {
451
+ }), e(this, $).remove(), n(this, K, e(this, m)), n(this, m, h), e(this, _).forEach((o, M) => {
452
+ const p = Wt[M], D = getComputedStyle(o).getPropertyValue("--morph-duration");
453
+ let b = [], P = [];
454
+ L ? L.forEach((u) => {
458
455
  const S = o.querySelector(u), U = p.querySelector(u);
459
- S && U && (k.push(S), b.push(U));
460
- }) : (b.push(...p.childNodes), k.push(...o.childNodes)), k.forEach((u) => {
456
+ S && U && (P.push(S), b.push(U));
457
+ }) : (b.push(...p.childNodes), P.push(...o.childNodes)), P.forEach((u) => {
461
458
  u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"));
462
459
  }), b.forEach((u) => {
463
460
  u instanceof HTMLElement && (this.findNewLinks(u), u.classList.add("new"));
464
- }), v ? b.forEach((u, S) => {
461
+ }), L ? b.forEach((u, S) => {
465
462
  var U;
466
- (U = k[S].parentElement) == null || U.insertBefore(
463
+ (U = P[S].parentElement) == null || U.insertBefore(
467
464
  u,
468
- k[S]
465
+ P[S]
469
466
  );
470
- }) : o.prepend(...b), Gt(() => {
471
- k.forEach((u) => {
467
+ }) : o.prepend(...b), Jt(() => {
468
+ P.forEach((u) => {
472
469
  u instanceof HTMLElement && u.classList.add("old-idle");
473
470
  }), b.forEach((u) => {
474
471
  var S;
@@ -478,58 +475,58 @@ const st = class st {
478
475
  ), u.classList.add("new-idle"));
479
476
  });
480
477
  });
481
- const ht = Et(pt({}, mt), {
478
+ const ct = gt(Et({}, ft), {
482
479
  morphElement: o
483
480
  });
484
- V(document, "morphNewChildrenAdded", {
485
- detail: ht
481
+ z(document, "morphNewChildrenAdded", {
482
+ detail: ct
486
483
  });
487
- const Ot = new Promise((u) => {
484
+ const Yt = new Promise((u) => {
488
485
  setTimeout(() => {
489
- k.forEach((S) => S.remove()), b.forEach((S) => {
486
+ P.forEach((S) => S.remove()), b.forEach((S) => {
490
487
  var U;
491
488
  S instanceof HTMLElement && ((U = S.parentElement) == null || U.style.removeProperty(
492
489
  "--new-content-height"
493
490
  ), S.classList.remove("new-idle", "new"));
494
- }), V(document, "morphOldChildrenRemoved", {
495
- detail: ht
491
+ }), z(document, "morphOldChildrenRemoved", {
492
+ detail: ct
496
493
  }), u();
497
- }, (parseFloat(I) || 0) * 1e3 + 10);
494
+ }, (parseFloat(D) || 0) * 1e3 + 10);
498
495
  });
499
- e(this, O).push(Ot);
496
+ e(this, B).push(Yt);
500
497
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
501
498
  "--new-document-scroll-position",
502
499
  (this.scrollValue.top - f.scrollState.y) * 1 + "px"
503
500
  ) : document.documentElement.style.setProperty(
504
501
  "--new-document-scroll-position",
505
502
  this.scrollValue.top + "px"
506
- ), V(document, "morphBeforeNavigationScroll", {
503
+ ), z(document, "morphBeforeNavigationScroll", {
507
504
  detail: f.scrollState
508
505
  }), h.hash ? (f.clearScrollState(), E(this, c, kt).call(this, h.hash, {
509
506
  centerScroll: i,
510
- offsetScroll: m
511
- })) : e(this, D) ? f.restoreScrollPosition() : f.renewScrollPosition(), yield Promise.all(e(this, O)), xt.forEach((o) => o.remove()), n(this, O, []), e(this, Z).forEach((o) => {
507
+ offsetScroll: d
508
+ })) : e(this, x) ? f.restoreScrollPosition() : f.renewScrollPosition(), yield Promise.all(e(this, B)), Ht.forEach((o) => o.remove()), n(this, B, []), e(this, _).forEach((o) => {
512
509
  o.querySelectorAll("script").forEach((p) => {
513
- const I = document.createElement("script");
510
+ const D = document.createElement("script");
514
511
  for (let b = 0; b < p.attributes.length; b++) {
515
- const k = p.attributes[b];
516
- I.setAttribute(k.name, k.value);
512
+ const P = p.attributes[b];
513
+ D.setAttribute(P.name, P.value);
517
514
  }
518
- p.hasAttribute("src") || (I.innerHTML = p.innerHTML), p.replaceWith(I);
515
+ p.hasAttribute("src") || (D.innerHTML = p.innerHTML), p.replaceWith(D);
519
516
  });
520
- }), V(document, "morphComplete", {
521
- detail: mt
517
+ }), z(document, "morphComplete", {
518
+ detail: ft
522
519
  }), document.documentElement.style.removeProperty(
523
520
  "--new-document-scroll-position"
524
521
  ), window.dispatchEvent(new Event("resize"));
525
- } catch (M) {
526
- console.error(M);
522
+ } catch (G) {
523
+ console.error(G);
527
524
  }
528
- n(this, B, void 0);
525
+ n(this, F, void 0);
529
526
  });
530
527
  }
531
528
  addLink(t) {
532
- e(this, g).push(new St(t, this));
529
+ e(this, g).push(new Lt(t, this));
533
530
  }
534
531
  addLinks(t) {
535
532
  t.forEach((s) => {
@@ -544,35 +541,36 @@ const st = class st {
544
541
  }
545
542
  findNewLinks(t) {
546
543
  const s = [...t.querySelectorAll("a")].filter(
547
- e(this, nt)
544
+ e(this, ot)
548
545
  );
549
546
  e(this, g).push(
550
- ...s.map((i) => new St(i, this))
547
+ ...s.map((i) => new Lt(i, this))
551
548
  );
552
549
  }
553
550
  findLinks() {
554
551
  const t = [
555
552
  ...document.documentElement.querySelectorAll("a")
556
- ].filter(e(this, nt));
557
- e(this, g).forEach((s) => s.destroy()), n(this, g, t.map((s) => new St(s, this)));
553
+ ].filter(e(this, ot));
554
+ e(this, g).forEach((s) => s.destroy()), n(this, g, t.map((s) => new Lt(s, this)));
558
555
  }
559
556
  };
560
- C = new WeakMap(), Z = new WeakMap(), g = new WeakMap(), B = new WeakMap(), d = new WeakMap(), $ = new WeakMap(), O = new WeakMap(), D = new WeakMap(), A = new WeakMap(), rt = new WeakMap(), T = new WeakMap(), G = new WeakMap(), _ = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), c = new WeakSet(), ct = function(t) {
561
- let s = t.split("#")[0], i = e(this, T).get(s);
562
- return i || (i = new vt(this, s), e(this, T).set(s, i)), i;
563
- }, Lt = function(t) {
557
+ T = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), F = new WeakMap(), m = new WeakMap(), K = new WeakMap(), B = new WeakMap(), x = new WeakMap(), A = new WeakMap(), nt = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), ot = new WeakMap(), c = new WeakSet(), ut = function(t) {
558
+ const s = this.normalizePath(t);
559
+ let i = e(this, N).get(s.pathname);
560
+ return i || (i = new It(this, s.pathname), e(this, N).set(s.pathname, i)), i;
561
+ }, vt = function(t) {
564
562
  const s = [...t.querySelectorAll("[data-morph]")];
565
563
  return s.length ? s : [t];
566
- }, Ft = function(t, s) {
564
+ }, Bt = function(t, s) {
567
565
  return t.filter(
568
566
  (i) => s.find(
569
- (m) => m.outerHTML === i.outerHTML
567
+ (d) => d.outerHTML === i.outerHTML
570
568
  )
571
569
  );
572
570
  }, yt = function(t, s) {
573
571
  return t.filter(
574
572
  (i) => !s.find(
575
- (m) => m.outerHTML === i.outerHTML
573
+ (d) => d.outerHTML === i.outerHTML
576
574
  )
577
575
  );
578
576
  }, bt = function(t) {
@@ -581,18 +579,18 @@ C = new WeakMap(), Z = new WeakMap(), g = new WeakMap(), B = new WeakMap(), d =
581
579
  var s, i;
582
580
  (s = e(this, A)) == null || s.removeEventListener(
583
581
  "scroll",
584
- e(this, et)
585
- ), n(this, tt, 0), n(this, _, 0), n(this, A, e(this, C).scrollSelector && t.querySelector(e(this, C).scrollSelector) || window), n(this, rt, e(this, A) === window), (i = e(this, A)) == null || i.addEventListener("scroll", e(this, et)), e(this, et).call(this);
582
+ e(this, st)
583
+ ), n(this, et, 0), n(this, tt, 0), n(this, A, e(this, T).scrollSelector && t.querySelector(e(this, T).scrollSelector) || window), n(this, nt, e(this, A) === window), (i = e(this, A)) == null || i.addEventListener("scroll", e(this, st)), e(this, st).call(this);
586
584
  }, kt = function(t, s) {
587
585
  const i = typeof t == "string" ? document.getElementById(t) : t;
588
- (typeof i == "number" || i) && Qt(i, {
586
+ (typeof i == "number" || i) && Zt(i, {
589
587
  scrollElement: e(this, A),
590
588
  behavior: (s == null ? void 0 : s.behavior) || "instant",
591
589
  center: s == null ? void 0 : s.centerScroll,
592
590
  offset: s == null ? void 0 : s.offsetScroll
593
591
  });
594
- }, ut = new WeakMap(), et = new WeakMap(), st.instance = null;
595
- let Vt = st;
592
+ }, dt = new WeakMap(), st = new WeakMap(), it.instance = null;
593
+ let Vt = it;
596
594
  export {
597
595
  Vt as Morph
598
596
  };
@@ -1 +1 @@
1
- "use strict";var oe=l=>{throw TypeError(l)};var ee=(l,n,t)=>n.has(l)||oe("Cannot "+t);var e=(l,n,t)=>(ee(l,n,"read from private field"),t?t.call(l):n.get(l)),r=(l,n,t)=>n.has(l)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,t),o=(l,n,t,s)=>(ee(l,n,"write to private field"),s?s.call(l,t):n.set(l,t),t),p=(l,n,t)=>(ee(l,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),E=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),M=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-BT4fssbO.cjs"),le=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var d,w,_,N;class de{constructor(){r(this,d,new Map);r(this,w,[]);r(this,_,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const c=i[0],f=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),F=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!f||F)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,d)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,d).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,d).get(n);i==null||i.forEach(c=>{c.close()})}let s=e(this,d).get(n);s!=null&&s.length||(s=[],e(this,d).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(o(this,w,e(this,w).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,d).forEach(i=>{i.forEach(c=>s.push(c))}),e(this,d).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,d).get(n);e(this,d).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,d).get(n);s&&(s=s.filter(i=>i!==t),e(this,d).set(n,s))}}}d=new WeakMap,w=new WeakMap,_=new WeakMap,N=new WeakMap;var v,z,B,k,H,m,C,A,x,b,R,q,T,y,$,a,V,W,u,ce,L,Z,G,O,j,X,D;const S=class S extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,z);r(this,B);r(this,k);r(this,H);r(this,m);r(this,C);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,T);r(this,y);r(this,$);r(this,a);r(this,V);r(this,W);r(this,G);r(this,O);r(this,j);r(this,X);r(this,D);this.urlValue="",o(this,v,!1),o(this,m,new E.CSSProperty(this,"--history",!1)),o(this,C,new E.CSSProperty(this,"--restore",!1)),o(this,A,new E.CSSProperty(this,"--close-rest",!1)),o(this,x,new E.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new E.CSSProperty(this,"--group","")),o(this,R,new E.CSSProperty(this,"--click-outside",!1)),o(this,q,new E.CSSProperty(this,"--escape",!1)),o(this,T,new E.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,y,!0),o(this,a,new ue.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,V,[]),o(this,W,[]),o(this,G,()=>{o(this,y,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)}),o(this,O,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,T).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,D,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(S.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=S.stack.groups.get(this.group.current),i=s==null?void 0:s.find(c=>c.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,C)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,z)),clearTimeout(e(this,B)),p(this,u,L).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),M.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,y)&&history.pushState(history.state,"",e(this,u,ce)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{S.stack.add(e(this,b).current,this),e(this,W).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,L).call(this,!0,this.openClass),e(this,a).set("opened",!0),M.dispatchEvent(window,"resize"),M.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0),M.dispatchEvent(this,"popoverTransitionend")},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,k)),clearTimeout(e(this,H)),S.stack.remove(e(this,b).current,this),p(this,u,Z).call(this),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!0,this.closingClass),M.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,L).call(this,!1,this.closingClass),M.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,V,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,V).forEach(t=>{t.addEventListener("click",e(this,D))}),o(this,W,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,C).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,T).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,G)),setTimeout(()=>{e(this,C).current?(o(this,y,!1),this.urlValue=he.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)):(p(this,u,Z).call(this),o(this,y,!0))},0),e(this,T).subscribe(()=>{e(this,O).call(this)}),le.windowResizer.subscribe(e(this,O))}disconnectedCallback(){e(this,V).forEach(t=>{t.removeEventListener("click",e(this,D))}),S.stack.remove(e(this,b).current,this),le.windowResizer.unsubscribe(e(this,O)),e(this,m).close(),e(this,C).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,T).close(),this.removeAttribute("role"),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!1,this.closingClass),clearTimeout(e(this,z)),clearTimeout(e(this,B)),clearTimeout(e(this,k)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,G)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,Z).call(this)}};v=new WeakMap,z=new WeakMap,B=new WeakMap,k=new WeakMap,H=new WeakMap,m=new WeakMap,C=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,T=new WeakMap,y=new WeakMap,$=new WeakMap,a=new WeakMap,V=new WeakMap,W=new WeakMap,u=new WeakSet,ce=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},L=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},G=new WeakMap,O=new WeakMap,j=new WeakMap,X=new WeakMap,D=new WeakMap,S.stack=new de;let U=S;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,P,te,Y,I,J,K,se;class ae extends HTMLElement{constructor(){super();r(this,P);r(this,h);r(this,g,new E.CSSProperty(this,"--type","open"));r(this,Y,()=>{e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,I,()=>{e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,J,()=>{e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,K,()=>{e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,P,te).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;else{const f=this.getRootNode();f instanceof ShadowRoot?i=f.host.closest("[data-popover]"):f instanceof HTMLElement&&(i=f.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const c=f=>{if(!f)return null;let F=f.querySelector("[data-popover]");return!F&&(f!=null&&f.parentElement)&&(F=c(f.parentElement)),F};i=c(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,I)),e(this,h).addEventListener("popoverClosing",e(this,J)),e(this,h).addEventListener("popoverClosed",e(this,K))):console.warn(this,`target ${t} not found`)}p(this,P,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,P,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,P,te).call(this)}}h=new WeakMap,g=new WeakMap,P=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,I)),e(this,h).removeEventListener("popoverClosing",e(this,J)),e(this,h).removeEventListener("popoverClosed",e(this,K)))},Y=new WeakMap,I=new WeakMap,J=new WeakMap,K=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
1
+ "use strict";var oe=l=>{throw TypeError(l)};var ee=(l,n,t)=>n.has(l)||oe("Cannot "+t);var e=(l,n,t)=>(ee(l,n,"read from private field"),t?t.call(l):n.get(l)),r=(l,n,t)=>n.has(l)?oe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(l):n.set(l,t),o=(l,n,t,s)=>(ee(l,n,"write to private field"),s?s.call(l,t):n.set(l,t),t),p=(l,n,t)=>(ee(l,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("../element-linked-store/index.cjs"),E=require("../css-property/index.cjs"),ie=require("../index-DekP7OZe.cjs"),M=require("../events-KVanG9sR.cjs"),pe=require("../function-MthRj-GJ.cjs"),ne=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const he=require("../url-YEESIcRn.cjs"),le=require("../window-resizer/index.cjs"),Q=require("../Viewport-DB0qAZPJ.cjs");var d,w,_,N;class de{constructor(){r(this,d,new Map);r(this,w,[]);r(this,_,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(re=>re instanceof HTMLElement&&re.hasAttribute("data-popover-content")))return;const c=i[0],f=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),F=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!f||F)&&t.close()}});r(this,N,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,_)),addEventListener("keydown",e(this,N))}get groups(){return e(this,d)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,d).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,d).get(n);i==null||i.forEach(c=>{c.close()})}let s=e(this,d).get(n);s!=null&&s.length||(s=[],e(this,d).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(o(this,w,e(this,w).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,d).forEach(i=>{i.forEach(c=>s.push(c))}),e(this,d).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,d).get(n);e(this,d).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,d).get(n);s&&(s=s.filter(i=>i!==t),e(this,d).set(n,s))}}}d=new WeakMap,w=new WeakMap,_=new WeakMap,N=new WeakMap;var v,z,B,k,H,m,C,A,x,b,R,q,T,y,$,a,V,W,u,ce,L,Z,G,O,j,X,D;const S=class S extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,z);r(this,B);r(this,k);r(this,H);r(this,m);r(this,C);r(this,A);r(this,x);r(this,b);r(this,R);r(this,q);r(this,T);r(this,y);r(this,$);r(this,a);r(this,V);r(this,W);r(this,G);r(this,O);r(this,j);r(this,X);r(this,D);this.urlValue="",o(this,v,!1),o(this,m,new E.CSSProperty(this,"--history",!1)),o(this,C,new E.CSSProperty(this,"--restore",!1)),o(this,A,new E.CSSProperty(this,"--close-rest",!1)),o(this,x,new E.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new E.CSSProperty(this,"--group","")),o(this,R,new E.CSSProperty(this,"--click-outside",!1)),o(this,q,new E.CSSProperty(this,"--escape",!1)),o(this,T,new E.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,y,!0),o(this,a,new ue.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,V,[]),o(this,W,[]),o(this,G,()=>{o(this,y,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)}),o(this,O,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,j).call(this)}),o(this,j,pe.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,T).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Q.viewport.width?s=Q.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Q.viewport.height?i=Q.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),o(this,D,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(S.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=S.stack.groups.get(this.group.current),i=s==null?void 0:s.find(c=>c.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,C)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,b)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,v)}get lastTrigger(){return e(this,$)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&he.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,$,t==null?void 0:t.trigger),clearTimeout(e(this,z)),clearTimeout(e(this,B)),p(this,u,L).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),M.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,$)}}),e(this,m).current&&e(this,y)&&history.pushState(history.state,"",e(this,u,ce)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{S.stack.add(e(this,b).current,this),e(this,W).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,L).call(this,!0,this.openClass),e(this,a).set("opened",!0),M.dispatchEvent(window,"resize"),M.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,$)},bubbles:!0}),o(this,k,void 0),o(this,H,setTimeout(()=>{e(this,a).set("transitionend",!0),M.dispatchEvent(this,"popoverTransitionend")},ne.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,k,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,k)),clearTimeout(e(this,H)),S.stack.remove(e(this,b).current,this),p(this,u,Z).call(this),o(this,z,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!0,this.closingClass),M.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,B,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,L).call(this,!1,this.closingClass),M.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},ne.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,V,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,V).forEach(t=>{t.addEventListener("click",e(this,D))}),o(this,W,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,C).observe(),e(this,A).observe(),e(this,x).observe(),e(this,b).observe(),e(this,R).observe(),e(this,q).observe(),e(this,T).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,G)),setTimeout(()=>{e(this,C).current?(o(this,y,!1),this.urlValue=he.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,y,!0)):(p(this,u,Z).call(this),o(this,y,!0))},0),e(this,T).subscribe(()=>{e(this,O).call(this)}),le.windowResizer.subscribe(e(this,O))}disconnectedCallback(){e(this,V).forEach(t=>{t.removeEventListener("click",e(this,D))}),S.stack.remove(e(this,b).current,this),le.windowResizer.unsubscribe(e(this,O)),e(this,m).close(),e(this,C).close(),e(this,A).close(),e(this,x).close(),e(this,b).close(),e(this,R).close(),e(this,q).close(),e(this,T).close(),this.removeAttribute("role"),p(this,u,L).call(this,!1,this.openClass),p(this,u,L).call(this,!1,this.closingClass),clearTimeout(e(this,z)),clearTimeout(e(this,B)),clearTimeout(e(this,k)),clearTimeout(e(this,H)),removeEventListener("popstate",e(this,G)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,Z).call(this)}};v=new WeakMap,z=new WeakMap,B=new WeakMap,k=new WeakMap,H=new WeakMap,m=new WeakMap,C=new WeakMap,A=new WeakMap,x=new WeakMap,b=new WeakMap,R=new WeakMap,q=new WeakMap,T=new WeakMap,y=new WeakMap,$=new WeakMap,a=new WeakMap,V=new WeakMap,W=new WeakMap,u=new WeakSet,ce=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},L=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},Z=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},G=new WeakMap,O=new WeakMap,j=new WeakMap,X=new WeakMap,D=new WeakMap,S.stack=new de;let U=S;ie.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",U);var h,g,P,te,Y,I,J,K,se;class ae extends HTMLElement{constructor(){super();r(this,P);r(this,h);r(this,g,new E.CSSProperty(this,"--type","open"));r(this,Y,()=>{e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,I,()=>{e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,J,()=>{e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,K,()=>{e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});ie.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,P,te).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;else{const f=this.getRootNode();f instanceof ShadowRoot?i=f.host.closest("[data-popover]"):f instanceof HTMLElement&&(i=f.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const c=f=>{if(!f)return null;let F=f.querySelector("[data-popover]");return!F&&(f!=null&&f.parentElement)&&(F=c(f.parentElement)),F};i=c(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,I)),e(this,h).addEventListener("popoverClosing",e(this,J)),e(this,h).addEventListener("popoverClosed",e(this,K))):console.warn(this,`target ${t} not found`)}p(this,P,se).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,P,se).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,P,te).call(this)}}h=new WeakMap,g=new WeakMap,P=new WeakSet,te=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,I)),e(this,h).removeEventListener("popoverClosing",e(this,J)),e(this,h).removeEventListener("popoverClosed",e(this,K)))},Y=new WeakMap,I=new WeakMap,J=new WeakMap,K=new WeakMap,se=function(t){e(this,h)instanceof U&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};ie.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ae);exports.PopoverButtonElement=ae;exports.PopoverElement=U;
@@ -10,7 +10,7 @@ import { d as q } from "../events-CsVF98U6.js";
10
10
  import { d as at } from "../function-C10DGppn.js";
11
11
  import { g as ht } from "../style-j2TwriJ_.js";
12
12
  import "construct-style-sheets-polyfill";
13
- import { u as ut, p as pt } from "../url-Cb0SFRMc.js";
13
+ import { u as ut, p as pt } from "../url-UL9zSCHb.js";
14
14
  import { windowResizer as nt } from "../window-resizer/index.js";
15
15
  import { v as K } from "../Viewport-DA10iWAO.js";
16
16
  var d, w, N, _;
@@ -1 +1 @@
1
- "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var B=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../index-DekP7OZe.cjs"),ht=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");const F=require("../url-BT4fssbO.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,M,et;class ct{constructor(e,s){r(this,M);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return B(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,M,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,M=new WeakSet,et=function(){return B(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,x,_,I,st,D;class ut{constructor(e){r(this,I);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,x,new rt.Notifier);r(this,_,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{var s;(s=e.state)!=null&&s.path&&this.navigate(e.state.path,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,x).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,_).call(this)}navigate(e,s="push"){return B(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory({action:s,pathname:h,searchParameters:c,hash:o});try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,I,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,x).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,{base:t(this,C)})}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,x=new WeakMap,_=new WeakMap,I=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
1
+ "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var B=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../index-DekP7OZe.cjs"),ht=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");const F=require("../url-YEESIcRn.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,M,et;class ct{constructor(e,s){r(this,M);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return B(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,M,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,M=new WeakSet,et=function(){return B(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,x,_,I,st,D;class ut{constructor(e){r(this,I);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,x,new rt.Notifier);r(this,_,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{var s;(s=e.state)!=null&&s.path&&this.navigate(e.state.path,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,x).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,_).call(this)}navigate(e,s="push"){return B(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory({action:s,pathname:h,searchParameters:c,hash:o});try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,I,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,x).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,{base:t(this,C)})}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,x=new WeakMap,_=new WeakMap,I=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
@@ -25,7 +25,7 @@ import { Notifier as nt } from "../notifier/index.js";
25
25
  import { i as _ } from "../index-Bv9zgfdb.js";
26
26
  import { d as ht } from "../function-C10DGppn.js";
27
27
  import "construct-style-sheets-polyfill";
28
- import { n as rt, c as ot, s as ct } from "../url-Cb0SFRMc.js";
28
+ import { n as rt, c as ot, s as ct } from "../url-UL9zSCHb.js";
29
29
  import { i as lt } from "../object-D6MVWB4l.js";
30
30
  var y, U, A, p, d, L, k, v, E, R, M, tt;
31
31
  class ut {
@@ -15,7 +15,7 @@ function $(t, { base: s = "", trailingSlash: a = !1 } = {}) {
15
15
  const e = t.split("#"), n = e[0].split("?");
16
16
  let r = n[0].startsWith("/") ? n[0] : "/" + n[0];
17
17
  a ? r = !r.endsWith("/") && r !== "/" ? r + "/" : r : r = r.endsWith("/") && r !== "/" ? r.slice(0, -1) : r;
18
- const c = s + r, h = n == null ? void 0 : n[1], l = e == null ? void 0 : e[1], W = `${c}${h ? "?" + h : ""}`;
18
+ const c = s + r, h = (n == null ? void 0 : n[1]) || "", l = e == null ? void 0 : e[1], W = `${c}${h ? "?" + h : ""}`;
19
19
  return {
20
20
  leaf: r,
21
21
  pathname: c,
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty,S=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var o=(t,s,r)=>s in t?u(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,f=(t,s)=>{for(var r in s||(s={}))p.call(s,r)&&o(t,r,s[r]);if(i)for(var r of i(s))y.call(s,r)&&o(t,r,s[r]);return t},m=(t,s)=>S(t,W(s));function d(t,{base:s="",trailingSlash:r=!1}={}){s=s.endsWith("/")?s.slice(0,-1):s,t=t.replace(s,""),t.startsWith("/")&&(t=t.slice(1));const n=t.split("#"),e=n[0].split("?");let a=e[0].startsWith("/")?e[0]:"/"+e[0];r?a=!a.endsWith("/")&&a!=="/"?a+"/":a:a=a.endsWith("/")&&a!=="/"?a.slice(0,-1):a;const c=s+a,h=(e==null?void 0:e[1])||"",l=n==null?void 0:n[1],P=`${c}${h?"?"+h:""}`;return{leaf:a,pathname:c,parameters:h,hash:l,path:P}}function $(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function g(t){if(t.action==="none")return;const s=t==null?void 0:t.searchParameters,r=t.hash?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",n=s?s.startsWith("?")?s:"?"+s:"",e=`${t.pathname}${r}${n}`,a=m(f({},t.state),{path:e});t.action==="push"?history.pushState(a,"",e):t.action==="replace"&&history.replaceState(a,"",e)}function w(t){const s=new URLSearchParams(t),r={};for(const[n,e]of s)r[n]=e;return r}function z(t,s){const r=new URL(location.href),n=(s==null?void 0:s.toString())||"";r.searchParams.set(t,n),history.replaceState(history.state,"",r.href)}exports.changeHistory=g;exports.normalizeBase=$;exports.parseSearchParameters=w;exports.splitPath=d;exports.updateSearchParameter=z;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),E=require("../index-DekP7OZe.cjs"),b=require("../canvas-CU5Xjahf.cjs"),C=require("../coordinates-D8Np3cPD.cjs"),D=require("../custom-elements-Dh4TWRDJ.cjs"),g=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),Q=require("../element-yhcBhsho.cjs"),A=require("../events-KVanG9sR.cjs"),O=require("../file-DSpfWdd9.cjs"),T=require("../function-MthRj-GJ.cjs"),B=require("../gestures-C7gbKx11.cjs"),S=require("../stylesheet-HWF2a3nr.cjs"),h=require("../layout-Ctc2p3uz.cjs"),a=require("../math-GDWEqu7y.cjs"),m=require("../number-ChAm68cm.cjs"),c=require("../object-CCiXnER2.cjs"),v=require("../polyfills-Df4r-ETT.cjs"),P=require("../scroll-CIdNtj3G.cjs"),l=require("../string-DUXXtU8v.cjs"),q=require("../style-At6aDoqG.cjs"),f=require("../url-BT4fssbO.cjs");function R(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function N(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let r=0;r<n;r++){const i=(r+e)%n;o[i]=t[r]}return o}function z(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,r=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,i)).toFixed(o))} ${r[i]}`}function j(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function M(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function V(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function k(t,e){let n=!1;const{x:o,y:r}=t;for(let i=0,u=e.length-1;i<e.length;u=i++){const p=e[i].x,d=e[i].y,y=e[u].x,I=e[u].y;d>r!=I>r&&o<(y-p)*(r-d)/(I-d)+p&&(n=!n)}return n}function w(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?w(t,o.slice(4,-1)):o}}function F(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(r=>{const i=w(o,r);i&&(e[r]=i)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function $(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function H(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}const U=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,K=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function W(t){let e,n;return K.test(t)?(e=`mailto:${t.trim()}`,n="email"):U.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function Z(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function J(t,e,n,o){let r,i=!1,u=0;const p=()=>{clearInterval(r),o!=null&&o.restartCounter&&(u=0),i&&(r=setInterval(()=>{n(u++)},e))},d=E.intersector.subscribe(t,y=>{i=y.isIntersecting,p()});return()=>{d(),clearInterval(r)}}exports.parseAttribute=x.parseAttribute;exports.parseAttributeValue=x.parseAttributeValue;exports.isBrowser=E.isBrowser;exports.contain=b.contain;exports.cover=b.cover;exports.fixPosition=b.fixPosition;exports.measureText=b.measureText;exports.getPointerPosition=C.getPointerPosition;exports.normalize=C.normalize;exports.screenToCartesian=C.screenToCartesian;exports.whenDefined=D.whenDefined;exports.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.isElementVisible=Q.isElementVisible;exports.dispatchEvent=A.dispatchEvent;exports.createJSONAndSave=O.createJSONAndSave;exports.downloadURI=O.downloadURI;exports.debounce=T.debounce;exports.throttle=T.throttle;exports.setupDrag=B.setupDrag;exports.createStylesheet=S.createStylesheet;exports.styleToString=S.styleToString;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.getStickyOffset=h.getStickyOffset;exports.calculateDistance=a.calculateDistance;exports.calculateDistanceWithRadius=a.calculateDistanceWithRadius;exports.clamp=a.clamp;exports.damp=a.damp;exports.lerp=a.lerp;exports.mapRange=a.mapRange;exports.round=a.round;exports.smootherstep=a.smootherstep;exports.smoothstep=a.smoothstep;exports.step=a.step;exports.beautifyNumber=m.beautifyNumber;exports.loopNumber=m.loopNumber;exports.preciseNumber=m.preciseNumber;exports.roundNumberTo=m.roundNumberTo;exports.toStep=m.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.nullishCoalescing=v.nullishCoalescing;exports.requestIdleCallback=v.requestIdleCallback;exports.scrollToElement=P.scrollToElement;exports.wait=P.wait;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.declension=l.declension;exports.decodeHtmlEntities=l.decodeHtmlEntities;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=q.getElementTransitionDurationMS;exports.getElementTransitionDurationS=q.getElementTransitionDurationS;exports.changeHistory=f.changeHistory;exports.normalizeBase=f.normalizeBase;exports.parseSearchParameters=f.parseSearchParameters;exports.splitPath=f.splitPath;exports.updateSearchParameter=f.updateSearchParameter;exports.cloneTemplateContent=Z;exports.copyTextToClipboard=j;exports.decode=H;exports.dotCircleCollision=V;exports.dotPolygonCollision=k;exports.dotRectCollision=M;exports.encode=$;exports.formatBytes=z;exports.getRootVariables=F;exports.insert=R;exports.setIntervalOnIntersection=J;exports.shiftArray=N;exports.tryCreateHrefFromContact=W;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),E=require("../index-DekP7OZe.cjs"),b=require("../canvas-CU5Xjahf.cjs"),C=require("../coordinates-D8Np3cPD.cjs"),D=require("../custom-elements-Dh4TWRDJ.cjs"),g=require("../dom-JBOkFLTh.cjs"),s=require("../easings-GegIwET5.cjs"),Q=require("../element-yhcBhsho.cjs"),A=require("../events-KVanG9sR.cjs"),O=require("../file-DSpfWdd9.cjs"),T=require("../function-MthRj-GJ.cjs"),B=require("../gestures-C7gbKx11.cjs"),S=require("../stylesheet-HWF2a3nr.cjs"),h=require("../layout-Ctc2p3uz.cjs"),a=require("../math-GDWEqu7y.cjs"),m=require("../number-ChAm68cm.cjs"),c=require("../object-CCiXnER2.cjs"),v=require("../polyfills-Df4r-ETT.cjs"),P=require("../scroll-CIdNtj3G.cjs"),l=require("../string-DUXXtU8v.cjs"),q=require("../style-At6aDoqG.cjs"),f=require("../url-YEESIcRn.cjs");function R(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function N(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let r=0;r<n;r++){const i=(r+e)%n;o[i]=t[r]}return o}function z(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,r=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,i)).toFixed(o))} ${r[i]}`}function j(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function M(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function V(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function k(t,e){let n=!1;const{x:o,y:r}=t;for(let i=0,u=e.length-1;i<e.length;u=i++){const p=e[i].x,d=e[i].y,y=e[u].x,I=e[u].y;d>r!=I>r&&o<(y-p)*(r-d)/(I-d)+p&&(n=!n)}return n}function w(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?w(t,o.slice(4,-1)):o}}function F(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(r=>{const i=w(o,r);i&&(e[r]=i)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function $(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function H(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}const U=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,K=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function W(t){let e,n;return K.test(t)?(e=`mailto:${t.trim()}`,n="email"):U.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function Z(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function J(t,e,n,o){let r,i=!1,u=0;const p=()=>{clearInterval(r),o!=null&&o.restartCounter&&(u=0),i&&(r=setInterval(()=>{n(u++)},e))},d=E.intersector.subscribe(t,y=>{i=y.isIntersecting,p()});return()=>{d(),clearInterval(r)}}exports.parseAttribute=x.parseAttribute;exports.parseAttributeValue=x.parseAttributeValue;exports.isBrowser=E.isBrowser;exports.contain=b.contain;exports.cover=b.cover;exports.fixPosition=b.fixPosition;exports.measureText=b.measureText;exports.getPointerPosition=C.getPointerPosition;exports.normalize=C.normalize;exports.screenToCartesian=C.screenToCartesian;exports.whenDefined=D.whenDefined;exports.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.isElementVisible=Q.isElementVisible;exports.dispatchEvent=A.dispatchEvent;exports.createJSONAndSave=O.createJSONAndSave;exports.downloadURI=O.downloadURI;exports.debounce=T.debounce;exports.throttle=T.throttle;exports.setupDrag=B.setupDrag;exports.createStylesheet=S.createStylesheet;exports.styleToString=S.styleToString;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.getStickyOffset=h.getStickyOffset;exports.calculateDistance=a.calculateDistance;exports.calculateDistanceWithRadius=a.calculateDistanceWithRadius;exports.clamp=a.clamp;exports.damp=a.damp;exports.lerp=a.lerp;exports.mapRange=a.mapRange;exports.round=a.round;exports.smootherstep=a.smootherstep;exports.smoothstep=a.smoothstep;exports.step=a.step;exports.beautifyNumber=m.beautifyNumber;exports.loopNumber=m.loopNumber;exports.preciseNumber=m.preciseNumber;exports.roundNumberTo=m.roundNumberTo;exports.toStep=m.toStep;exports.cloneDeep=c.cloneDeep;exports.compareObjects=c.compareObjects;exports.isESClass=c.isESClass;exports.isNullish=c.isNullish;exports.isObject=c.isObject;exports.mergeDeep=c.mergeDeep;exports.mixin=c.mixin;exports.omit=c.omit;exports.pick=c.pick;exports.nullishCoalescing=v.nullishCoalescing;exports.requestIdleCallback=v.requestIdleCallback;exports.scrollToElement=P.scrollToElement;exports.wait=P.wait;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.declension=l.declension;exports.decodeHtmlEntities=l.decodeHtmlEntities;exports.generateId=l.generateId;exports.isUppercase=l.isUppercase;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=q.getElementTransitionDurationMS;exports.getElementTransitionDurationS=q.getElementTransitionDurationS;exports.changeHistory=f.changeHistory;exports.normalizeBase=f.normalizeBase;exports.parseSearchParameters=f.parseSearchParameters;exports.splitPath=f.splitPath;exports.updateSearchParameter=f.updateSearchParameter;exports.cloneTemplateContent=Z;exports.copyTextToClipboard=j;exports.decode=H;exports.dotCircleCollision=V;exports.dotPolygonCollision=k;exports.dotRectCollision=M;exports.encode=$;exports.formatBytes=z;exports.getRootVariables=F;exports.insert=R;exports.setIntervalOnIntersection=J;exports.shiftArray=N;exports.tryCreateHrefFromContact=W;
@@ -20,7 +20,7 @@ import { n as lt, r as ut } from "../polyfills-DJrTJQky.js";
20
20
  import { s as dt, w as mt } from "../scroll-DPkCFTxg.js";
21
21
  import { c as xt, a as ht, b as bt, d as gt, g as yt, i as Ct, k as It, s as wt, t as vt, u as Et } from "../string-BlMQbe8b.js";
22
22
  import { g as Tt, a as Ot } from "../style-j2TwriJ_.js";
23
- import { c as Bt, n as At, p as Rt, s as Dt, u as Qt } from "../url-Cb0SFRMc.js";
23
+ import { c as Bt, n as At, p as Rt, s as Dt, u as Qt } from "../url-UL9zSCHb.js";
24
24
  function b(t, e, ...s) {
25
25
  return [...t.slice(0, e), ...s, ...t.slice(e)];
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.70.19",
3
+ "version": "0.71.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1 +0,0 @@
1
- "use strict";var u=Object.defineProperty,S=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var o=(t,s,r)=>s in t?u(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,f=(t,s)=>{for(var r in s||(s={}))p.call(s,r)&&o(t,r,s[r]);if(i)for(var r of i(s))y.call(s,r)&&o(t,r,s[r]);return t},m=(t,s)=>S(t,W(s));function d(t,{base:s="",trailingSlash:r=!1}={}){s=s.endsWith("/")?s.slice(0,-1):s,t=t.replace(s,""),t.startsWith("/")&&(t=t.slice(1));const n=t.split("#"),e=n[0].split("?");let a=e[0].startsWith("/")?e[0]:"/"+e[0];r?a=!a.endsWith("/")&&a!=="/"?a+"/":a:a=a.endsWith("/")&&a!=="/"?a.slice(0,-1):a;const c=s+a,h=e==null?void 0:e[1],l=n==null?void 0:n[1],P=`${c}${h?"?"+h:""}`;return{leaf:a,pathname:c,parameters:h,hash:l,path:P}}function $(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function g(t){if(t.action==="none")return;const s=t==null?void 0:t.searchParameters,r=t.hash?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",n=s?s.startsWith("?")?s:"?"+s:"",e=`${t.pathname}${r}${n}`,a=m(f({},t.state),{path:e});t.action==="push"?history.pushState(a,"",e):t.action==="replace"&&history.replaceState(a,"",e)}function w(t){const s=new URLSearchParams(t),r={};for(const[n,e]of s)r[n]=e;return r}function z(t,s){const r=new URL(location.href),n=(s==null?void 0:s.toString())||"";r.searchParams.set(t,n),history.replaceState(history.state,"",r.href)}exports.changeHistory=g;exports.normalizeBase=$;exports.parseSearchParameters=w;exports.splitPath=d;exports.updateSearchParameter=z;